obi-sdk 0.3.2 → 0.3.3
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-f072b7c6.js → obi-widget-93253f25.js} +2 -2
- package/dist/modular/chunks/{obi-widget-f072b7c6.js.map → obi-widget-93253f25.js.map} +1 -1
- package/dist/modular/chunks/{types-8887aa66.js → types-82772f00.js} +2 -2
- package/dist/modular/chunks/{types-8887aa66.js.map → types-82772f00.js.map} +1 -1
- package/dist/modular/core.js +1 -1
- package/dist/modular/index.js +2 -2
- package/dist/modular/ui.js +11 -11
- package/dist/obi-sdk.standalone.iife.js +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var A=function(A){"use strict";const e="http://localhost:5173/api";function t(A){return A&&A.__esModule&&Object.prototype.hasOwnProperty.call(A,"default")?A.default:A}var n={exports:{}};!function(A){var e=Object.prototype.hasOwnProperty,t="~";function n(){}function i(A,e,t){this.fn=A,this.context=e,this.once=t||!1}function r(A,e,n,r,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var o=new i(n,r||A,s),a=t?t+e:e;return A._events[a]?A._events[a].fn?A._events[a]=[A._events[a],o]:A._events[a].push(o):(A._events[a]=o,A._eventsCount++),A}function s(A,e){0===--A._eventsCount?A._events=new n:delete A._events[e]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(t=!1)),o.prototype.eventNames=function(){var A,n,i=[];if(0===this._eventsCount)return i;for(n in A=this._events)e.call(A,n)&&i.push(t?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(A)):i},o.prototype.listeners=function(A){var e=t?t+A:A,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,r=n.length,s=new Array(r);i<r;i++)s[i]=n[i].fn;return s},o.prototype.listenerCount=function(A){var e=t?t+A:A,n=this._events[e];return n?n.fn?1:n.length:0},o.prototype.emit=function(A,e,n,i,r,s){var o=t?t+A:A;if(!this._events[o])return!1;var a,c,d=this._events[o],l=arguments.length;if(d.fn){switch(d.once&&this.removeListener(A,d.fn,void 0,!0),l){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,e),!0;case 3:return d.fn.call(d.context,e,n),!0;case 4:return d.fn.call(d.context,e,n,i),!0;case 5:return d.fn.call(d.context,e,n,i,r),!0;case 6:return d.fn.call(d.context,e,n,i,r,s),!0}for(c=1,a=new Array(l-1);c<l;c++)a[c-1]=arguments[c];d.fn.apply(d.context,a)}else{var u,h=d.length;for(c=0;c<h;c++)switch(d[c].once&&this.removeListener(A,d[c].fn,void 0,!0),l){case 1:d[c].fn.call(d[c].context);break;case 2:d[c].fn.call(d[c].context,e);break;case 3:d[c].fn.call(d[c].context,e,n);break;case 4:d[c].fn.call(d[c].context,e,n,i);break;default:if(!a)for(u=1,a=new Array(l-1);u<l;u++)a[u-1]=arguments[u];d[c].fn.apply(d[c].context,a)}}return!0},o.prototype.on=function(A,e,t){return r(this,A,e,t,!1)},o.prototype.once=function(A,e,t){return r(this,A,e,t,!0)},o.prototype.removeListener=function(A,e,n,i){var r=t?t+A:A;if(!this._events[r])return this;if(!e)return s(this,r),this;var o=this._events[r];if(o.fn)o.fn!==e||i&&!o.once||n&&o.context!==n||s(this,r);else{for(var a=0,c=[],d=o.length;a<d;a++)(o[a].fn!==e||i&&!o[a].once||n&&o[a].context!==n)&&c.push(o[a]);c.length?this._events[r]=1===c.length?c[0]:c:s(this,r)}return this},o.prototype.removeAllListeners=function(A){var e;return A?(e=t?t+A:A,this._events[e]&&s(this,e)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=t,o.EventEmitter=o,A.exports=o}(n);const i=t(n.exports);function r(A,e){return e.forEach((function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach((function(t){if("default"!==t&&!(t in A)){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(A,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}}))})),Object.freeze(A)}var s=Object.defineProperty,o=(A,e,t)=>((A,e,t)=>e in A?s(A,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):A[e]=t)(A,"symbol"!=typeof e?e+"":e,t);let a=class{constructor(){o(this,"_locking"),o(this,"_locks"),this._locking=Promise.resolve(),this._locks=0}isLocked(){return this._locks>0}lock(){let A;this._locks+=1;const e=new Promise((e=>A=()=>{this._locks-=1,e()})),t=this._locking.then((()=>A));return this._locking=this._locking.then((()=>e)),t}};function c(A,e){if(!A)throw new Error(e)}function d(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 u(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 h=Symbol("@bufbuild/protobuf/enum-type");function g(A,e,t,n){A[h]=p(e,t.map((e=>({no:e.no,name:e.name,localName:A[e.no]}))))}function p(A,e,t){const n=Object.create(null),i=Object.create(null),r=[];for(const s of e){const A=m(s);r.push(A),n[s.name]=A,i[s.no]=A}return{typeName:A,values:r,findName:A=>n[A],findNumber:A=>i[A]}}function m(A){return"localName"in A?A:Object.assign(Object.assign({},A),{localName:A.name})}class f{equals(A){return this.getType().runtime.util.equals(this.getType(),this,A)}clone(){return this.getType().runtime.util.clone(this)}fromBinary(A,e){const t=this.getType().runtime.bin,n=t.makeReadOptions(e);return t.readMessage(this,n.readerFactory(A),A.byteLength,n),this}fromJson(A,e){const t=this.getType(),n=t.runtime.json,i=n.makeReadOptions(e);return n.readMessage(t,A,i,this),this}fromJsonString(A,e){let t;try{t=JSON.parse(A)}catch(n){throw new Error("cannot decode ".concat(this.getType().typeName," from JSON: ").concat(n instanceof Error?n.message:String(n)))}return this.fromJson(t,e)}toBinary(A){const e=this.getType().runtime.bin,t=e.makeWriteOptions(A),n=t.writerFactory();return e.writeMessage(this,n,t),n.finish()}toJson(A){const e=this.getType().runtime.json,t=e.makeWriteOptions(A);return e.writeMessage(this,t)}toJsonString(A){var e;const t=this.toJson(A);return JSON.stringify(t,null,null!==(e=null==A?void 0:A.prettySpaces)&&void 0!==e?e:0)}toJSON(){return this.toJson({emitDefaultValues:!0})}getType(){return Object.getPrototypeOf(this).constructor}}function B(){let A=0,e=0;for(let n=0;n<28;n+=7){let t=this.buf[this.pos++];if(A|=(127&t)<<n,!(128&t))return this.assertBounds(),[A,e]}let t=this.buf[this.pos++];if(A|=(15&t)<<28,e=(112&t)>>4,!(128&t))return this.assertBounds(),[A,e];for(let n=3;n<=31;n+=7){let t=this.buf[this.pos++];if(e|=(127&t)<<n,!(128&t))return this.assertBounds(),[A,e]}throw new Error("invalid varint")}function w(A,e,t){for(let r=0;r<28;r+=7){const n=A>>>r,i=!(n>>>7==0&&0==e),s=255&(i?128|n:n);if(t.push(s),!i)return}const n=A>>>28&15|(7&e)<<4,i=!!(e>>3);if(t.push(255&(i?128|n:n)),i){for(let A=3;A<31;A+=7){const n=e>>>A,i=!(n>>>7==0),r=255&(i?128|n:n);if(t.push(r),!i)return}t.push(e>>>31&1)}}const v=4294967296;function C(A){const e="-"===A[0];e&&(A=A.slice(1));const t=1e6;let n=0,i=0;function r(e,r){const s=Number(A.slice(e,r));i*=t,n=n*t+s,n>=v&&(i+=n/v|0,n%=v)}return r(-24,-18),r(-18,-12),r(-12,-6),r(-6),e?Q(n,i):b(n,i)}function y(A,e){if(({lo:A,hi:e}=function(A,e){return{lo:A>>>0,hi:e>>>0}}(A,e)),e<=2097151)return String(v*e+A);const t=16777215&(A>>>24|e<<8),n=e>>16&65535;let i=(16777215&A)+6777216*t+6710656*n,r=t+8147497*n,s=2*n;const o=1e7;return i>=o&&(r+=Math.floor(i/o),i%=o),r>=o&&(s+=Math.floor(r/o),r%=o),s.toString()+U(r)+U(i)}function b(A,e){return{lo:0|A,hi:0|e}}function Q(A,e){return e=~e,A?A=1+~A:e+=1,b(A,e)}const U=A=>{const e=String(A);return"0000000".slice(e.length)+e};function k(A,e){if(A>=0){for(;A>127;)e.push(127&A|128),A>>>=7;e.push(A)}else{for(let t=0;t<9;t++)e.push(127&A|128),A>>=7;e.push(1)}}function E(){let A=this.buf[this.pos++],e=127&A;if(!(128&A))return this.assertBounds(),e;if(A=this.buf[this.pos++],e|=(127&A)<<7,!(128&A))return this.assertBounds(),e;if(A=this.buf[this.pos++],e|=(127&A)<<14,!(128&A))return this.assertBounds(),e;if(A=this.buf[this.pos++],e|=(127&A)<<21,!(128&A))return this.assertBounds(),e;A=this.buf[this.pos++],e|=(15&A)<<28;for(let t=5;128&A&&t<10;t++)A=this.buf[this.pos++];if(128&A)throw new Error("invalid varint");return this.assertBounds(),e>>>0}const F=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 e=BigInt("-9223372036854775808"),t=BigInt("9223372036854775807"),n=BigInt("0"),i=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(A){const n="bigint"==typeof A?A:BigInt(A);if(n>t||n<e)throw new Error("int64 invalid: ".concat(A));return n},uParse(A){const e="bigint"==typeof A?A:BigInt(A);if(e>i||e<n)throw new Error("uint64 invalid: ".concat(A));return e},enc(e){return A.setBigInt64(0,this.parse(e),!0),{lo:A.getInt32(0,!0),hi:A.getInt32(4,!0)}},uEnc(e){return A.setBigInt64(0,this.uParse(e),!0),{lo:A.getInt32(0,!0),hi:A.getInt32(4,!0)}},dec:(e,t)=>(A.setInt32(0,e,!0),A.setInt32(4,t,!0),A.getBigInt64(0,!0)),uDec:(e,t)=>(A.setInt32(0,e,!0),A.setInt32(4,t,!0),A.getBigUint64(0,!0))}}const e=A=>c(/^-?[0-9]+$/.test(A),"int64 invalid: ".concat(A)),t=A=>c(/^[0-9]+$/.test(A),"uint64 invalid: ".concat(A));return{zero:"0",supported:!1,parse:A=>("string"!=typeof A&&(A=A.toString()),e(A),A),uParse:A=>("string"!=typeof A&&(A=A.toString()),t(A),A),enc:A=>("string"!=typeof A&&(A=A.toString()),e(A),C(A)),uEnc:A=>("string"!=typeof A&&(A=A.toString()),t(A),C(A)),dec:(A,e)=>function(A,e){let t=b(A,e);const n=2147483648&t.hi;n&&(t=Q(t.lo,t.hi));const i=y(t.lo,t.hi);return n?"-"+i:i}(A,e),uDec:(A,e)=>y(A,e)}}();var T,S,I,P,H,R;function D(A,e,t){if(e===t)return!0;if(A==T.BYTES){if(!(e instanceof Uint8Array&&t instanceof Uint8Array))return!1;if(e.length!==t.length)return!1;for(let A=0;A<e.length;A++)if(e[A]!==t[A])return!1;return!0}switch(A){case T.UINT64:case T.FIXED64:case T.INT64:case T.SFIXED64:case T.SINT64:return e==t}return!1}function x(A,e){switch(A){case T.BOOL:return!1;case T.UINT64:case T.FIXED64:case T.INT64:case T.SFIXED64:case T.SINT64:return 0==e?F.zero:"0";case T.DOUBLE:case T.FLOAT:return 0;case T.BYTES:return new Uint8Array(0);case T.STRING:return"";default:return 0}}function L(A,e){switch(A){case T.BOOL:return!1===e;case T.STRING:return""===e;case T.BYTES:return e instanceof Uint8Array&&!e.byteLength;default:return 0==e}}(S=T||(T={}))[S.DOUBLE=1]="DOUBLE",S[S.FLOAT=2]="FLOAT",S[S.INT64=3]="INT64",S[S.UINT64=4]="UINT64",S[S.INT32=5]="INT32",S[S.FIXED64=6]="FIXED64",S[S.FIXED32=7]="FIXED32",S[S.BOOL=8]="BOOL",S[S.STRING=9]="STRING",S[S.BYTES=12]="BYTES",S[S.UINT32=13]="UINT32",S[S.SFIXED32=15]="SFIXED32",S[S.SFIXED64=16]="SFIXED64",S[S.SINT32=17]="SINT32",S[S.SINT64=18]="SINT64",(P=I||(I={}))[P.BIGINT=0]="BIGINT",P[P.STRING=1]="STRING",(R=H||(H={}))[R.Varint=0]="Varint",R[R.Bit64=1]="Bit64",R[R.LengthDelimited=2]="LengthDelimited",R[R.StartGroup=3]="StartGroup",R[R.EndGroup=4]="EndGroup",R[R.Bit32=5]="Bit32";class O{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 n=0;n<this.chunks.length;n++)A+=this.chunks[n].length;let e=new Uint8Array(A),t=0;for(let n=0;n<this.chunks.length;n++)e.set(this.chunks[n],t),t+=this.chunks[n].length;return this.chunks=[],e}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let A=this.finish(),e=this.stack.pop();if(!e)throw new Error("invalid state, fork stack empty");return this.chunks=e.chunks,this.buf=e.buf,this.uint32(A.byteLength),this.raw(A)}tag(A,e){return this.uint32((A<<3|e)>>>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 d(A),k(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 e=this.textEncoder.encode(A);return this.uint32(e.byteLength),this.raw(e)}float(A){u(A);let e=new Uint8Array(4);return new DataView(e.buffer).setFloat32(0,A,!0),this.raw(e)}double(A){let e=new Uint8Array(8);return new DataView(e.buffer).setFloat64(0,A,!0),this.raw(e)}fixed32(A){l(A);let e=new Uint8Array(4);return new DataView(e.buffer).setUint32(0,A,!0),this.raw(e)}sfixed32(A){d(A);let e=new Uint8Array(4);return new DataView(e.buffer).setInt32(0,A,!0),this.raw(e)}sint32(A){return d(A),k(A=(A<<1^A>>31)>>>0,this.buf),this}sfixed64(A){let e=new Uint8Array(8),t=new DataView(e.buffer),n=F.enc(A);return t.setInt32(0,n.lo,!0),t.setInt32(4,n.hi,!0),this.raw(e)}fixed64(A){let e=new Uint8Array(8),t=new DataView(e.buffer),n=F.uEnc(A);return t.setInt32(0,n.lo,!0),t.setInt32(4,n.hi,!0),this.raw(e)}int64(A){let e=F.enc(A);return w(e.lo,e.hi,this.buf),this}sint64(A){let e=F.enc(A),t=e.hi>>31;return w(e.lo<<1^t,(e.hi<<1|e.lo>>>31)^t,this.buf),this}uint64(A){let e=F.uEnc(A);return w(e.lo,e.hi,this.buf),this}}class M{constructor(A,e){this.varint64=B,this.uint32=E,this.buf=A,this.len=A.length,this.pos=0,this.view=new DataView(A.buffer,A.byteOffset,A.byteLength),this.textDecoder=null!=e?e:new TextDecoder}tag(){let A=this.uint32(),e=A>>>3,t=7&A;if(e<=0||t<0||t>5)throw new Error("illegal tag: field no "+e+" wire type "+t);return[e,t]}skip(A,e){let t=this.pos;switch(A){case H.Varint:for(;128&this.buf[this.pos++];);break;case H.Bit64:this.pos+=4;case H.Bit32:this.pos+=4;break;case H.LengthDelimited:let t=this.uint32();this.pos+=t;break;case H.StartGroup:for(;;){const[A,t]=this.tag();if(t===H.EndGroup){if(void 0!==e&&A!==e)throw new Error("invalid end group tag");break}this.skip(t,A)}break;default:throw new Error("cant skip wire type "+A)}return this.assertBounds(),this.buf.subarray(t,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 F.dec(...this.varint64())}uint64(){return F.uDec(...this.varint64())}sint64(){let[A,e]=this.varint64(),t=-(1&A);return A=(A>>>1|(1&e)<<31)^t,e=e>>>1^t,F.dec(A,e)}bool(){let[A,e]=this.varint64();return 0!==A||0!==e}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return F.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return F.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(),e=this.pos;return this.pos+=A,this.assertBounds(),this.buf.subarray(e,e+A)}string(){return this.textDecoder.decode(this.bytes())}}function N(A){const e=A.field.localName,t=Object.create(null);return t[e]=function(A){const e=A.field;if(e.repeated)return[];if(void 0!==e.default)return e.default;switch(e.kind){case"enum":return e.T.values[0].no;case"scalar":return x(e.T,e.L);case"message":const A=e.T,t=new A;return A.fieldWrapper?A.fieldWrapper.unwrapField(t):t;case"map":throw"map fields are not allowed to be extensions"}}(A),[t,()=>t[e]]}let K="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),_=[];for(let VB=0;VB<K.length;VB++)_[K[VB].charCodeAt(0)]=VB;_["-".charCodeAt(0)]=K.indexOf("+"),_["_".charCodeAt(0)]=K.indexOf("/");const V={dec(A){let e=3*A.length/4;"="==A[A.length-2]?e-=2:"="==A[A.length-1]&&(e-=1);let t,n=new Uint8Array(e),i=0,r=0,s=0;for(let o=0;o<A.length;o++){if(t=_[A.charCodeAt(o)],void 0===t)switch(A[o]){case"=":r=0;case"\n":case"\r":case"\t":case" ":continue;default:throw Error("invalid base64 string.")}switch(r){case 0:s=t,r=1;break;case 1:n[i++]=s<<2|(48&t)>>4,s=t,r=2;break;case 2:n[i++]=(15&s)<<4|(60&t)>>2,s=t,r=3;break;case 3:n[i++]=(3&s)<<6|t,r=0}}if(1==r)throw Error("invalid base64 string.");return n.subarray(0,i)},enc(A){let e,t="",n=0,i=0;for(let r=0;r<A.length;r++)switch(e=A[r],n){case 0:t+=K[e>>2],i=(3&e)<<4,n=1;break;case 1:t+=K[i|e>>4],i=(15&e)<<2,n=2;break;case 2:t+=K[i|e>>6],t+=K[63&e],n=0}return n&&(t+=K[i],t+="=",1==n&&(t+="=")),t}};function G(A,e,t){W(e,A);const n=e.runtime.bin.makeReadOptions(t),i=function(A,e){if(!e.repeated&&("enum"==e.kind||"scalar"==e.kind)){for(let t=A.length-1;t>=0;--t)if(A[t].no==e.no)return[A[t]];return[]}return A.filter((A=>A.no===e.no))}(A.getType().runtime.bin.listUnknownFields(A),e.field),[r,s]=N(e);for(const o of i)e.runtime.bin.readField(r,n.readerFactory(o.data),e.field,o.wireType,n);return s()}function j(A,e,t,n){W(e,A);const i=e.runtime.bin.makeReadOptions(n),r=e.runtime.bin.makeWriteOptions(n);if(J(A,e)){const t=A.getType().runtime.bin.listUnknownFields(A).filter((A=>A.no!=e.field.no));A.getType().runtime.bin.discardUnknownFields(A);for(const e of t)A.getType().runtime.bin.onUnknownField(A,e.no,e.wireType,e.data)}const s=r.writerFactory();let o=e.field;o.opt||o.repeated||"enum"!=o.kind&&"scalar"!=o.kind||(o=Object.assign(Object.assign({},e.field),{opt:!0})),e.runtime.bin.writeField(o,t,s,r);const a=i.readerFactory(s.finish());for(;a.pos<a.len;){const[e,t]=a.tag(),n=a.skip(t,e);A.getType().runtime.bin.onUnknownField(A,e,t,n)}}function J(A,e){const t=A.getType();return e.extendee.typeName===t.typeName&&!!t.runtime.bin.listUnknownFields(A).find((A=>A.no==e.field.no))}function W(A,e){c(A.extendee.typeName==e.getType().typeName,"extension ".concat(A.typeName," can only be applied to message ").concat(A.extendee.typeName))}function X(A,e){const t=A.localName;if(A.repeated)return e[t].length>0;if(A.oneof)return e[A.oneof.localName].case===t;switch(A.kind){case"enum":case"scalar":return A.opt||A.req?void 0!==e[t]:"enum"==A.kind?e[t]!==A.T.values[0].no:!L(A.T,e[t]);case"message":return void 0!==e[t];case"map":return Object.keys(e[t]).length>0}}function Y(A,e){const t=A.localName,n=!A.opt&&!A.req;if(A.repeated)e[t]=[];else if(A.oneof)e[A.oneof.localName]={case:void 0};else switch(A.kind){case"map":e[t]={};break;case"enum":e[t]=n?A.T.values[0].no:void 0;break;case"scalar":e[t]=n?x(A.T,A.L):void 0;break;case"message":e[t]=void 0}}function q(A,e){if(null===A||"object"!=typeof A)return!1;if(!Object.getOwnPropertyNames(f.prototype).every((e=>e in A&&"function"==typeof A[e])))return!1;const t=A.getType();return null!==t&&"function"==typeof t&&"typeName"in t&&"string"==typeof t.typeName&&(void 0===e||t.typeName==e.typeName)}function $(A,e){return q(e)||!A.fieldWrapper?e:A.fieldWrapper.wrapField(e)}T.DOUBLE,T.FLOAT,T.INT64,T.UINT64,T.INT32,T.UINT32,T.BOOL,T.STRING,T.BYTES;const Z={ignoreUnknownFields:!1},z={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0};const AA=Symbol(),eA=Symbol();function tA(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,e,t,n,i){let r=t.localName;if(t.repeated){if(c("map"!=t.kind),null===e)return;if(!Array.isArray(e))throw new Error("cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(tA(e)));const o=A[r];for(const A of e){if(null===A)throw new Error("cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(tA(A)));switch(t.kind){case"message":o.push(t.T.fromJson(A,n));break;case"enum":const e=sA(t.T,A,n.ignoreUnknownFields,!0);e!==eA&&o.push(e);break;case"scalar":try{o.push(rA(t.T,A,t.L,!0))}catch(s){let e="cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(tA(A));throw s instanceof Error&&s.message.length>0&&(e+=": ".concat(s.message)),new Error(e)}}}}else if("map"==t.kind){if(null===e)return;if("object"!=typeof e||Array.isArray(e))throw new Error("cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(tA(e)));const o=A[r];for(const[A,r]of Object.entries(e)){if(null===r)throw new Error("cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: map value null"));let a;try{a=iA(t.K,A)}catch(s){let A="cannot decode map key for field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(tA(e));throw s instanceof Error&&s.message.length>0&&(A+=": ".concat(s.message)),new Error(A)}switch(t.V.kind){case"message":o[a]=t.V.T.fromJson(r,n);break;case"enum":const A=sA(t.V.T,r,n.ignoreUnknownFields,!0);A!==eA&&(o[a]=A);break;case"scalar":try{o[a]=rA(t.V.T,r,I.BIGINT,!0)}catch(s){let A="cannot decode map value for field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(tA(e));throw s instanceof Error&&s.message.length>0&&(A+=": ".concat(s.message)),new Error(A)}}}}else switch(t.oneof&&(A=A[t.oneof.localName]={case:r},r="value"),t.kind){case"message":const o=t.T;if(null===e&&"google.protobuf.Value"!=o.typeName)return;let a=A[r];q(a)?a.fromJson(e,n):(A[r]=a=o.fromJson(e,n),o.fieldWrapper&&!t.oneof&&(A[r]=o.fieldWrapper.unwrapField(a)));break;case"enum":const c=sA(t.T,e,n.ignoreUnknownFields,!1);switch(c){case AA:Y(t,A);break;case eA:break;default:A[r]=c}break;case"scalar":try{const n=rA(t.T,e,t.L,!1);n===AA?Y(t,A):A[r]=n}catch(s){let A="cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(tA(e));throw s instanceof Error&&s.message.length>0&&(A+=": ".concat(s.message)),new Error(A)}}}function iA(A,e){if(A===T.BOOL)switch(e){case"true":e=!0;break;case"false":e=!1}return rA(A,e,I.BIGINT,!0).toString()}function rA(A,e,t,n){if(null===e)return n?x(A,t):AA;switch(A){case T.DOUBLE:case T.FLOAT:if("NaN"===e)return Number.NaN;if("Infinity"===e)return Number.POSITIVE_INFINITY;if("-Infinity"===e)return Number.NEGATIVE_INFINITY;if(""===e)break;if("string"==typeof e&&e.trim().length!==e.length)break;if("string"!=typeof e&&"number"!=typeof e)break;const n=Number(e);if(Number.isNaN(n))break;if(!Number.isFinite(n))break;return A==T.FLOAT&&u(n),n;case T.INT32:case T.FIXED32:case T.SFIXED32:case T.SINT32:case T.UINT32:let r;if("number"==typeof e?r=e:"string"==typeof e&&e.length>0&&e.trim().length===e.length&&(r=Number(e)),void 0===r)break;return A==T.UINT32||A==T.FIXED32?l(r):d(r),r;case T.INT64:case T.SFIXED64:case T.SINT64:if("number"!=typeof e&&"string"!=typeof e)break;const s=F.parse(e);return t?s.toString():s;case T.FIXED64:case T.UINT64:if("number"!=typeof e&&"string"!=typeof e)break;const o=F.uParse(e);return t?o.toString():o;case T.BOOL:if("boolean"!=typeof e)break;return e;case T.STRING:if("string"!=typeof e)break;try{encodeURIComponent(e)}catch(i){throw new Error("invalid UTF8")}return e;case T.BYTES:if(""===e)return new Uint8Array(0);if("string"!=typeof e)break;return V.dec(e)}throw new Error}function sA(A,e,t,n){if(null===e)return"google.protobuf.NullValue"==A.typeName?0:n?A.values[0].no:AA;switch(typeof e){case"number":if(Number.isInteger(e))return e;break;case"string":const n=A.findName(e);if(void 0!==n)return n.no;if(t)return eA}throw new Error("cannot decode enum ".concat(A.typeName," from JSON: ").concat(tA(e)))}function oA(A){return!(!A.repeated&&"map"!=A.kind&&(A.oneof||"message"==A.kind||A.opt||A.req))}function aA(A,e,t){if("map"==A.kind){c("object"==typeof e&&null!=e);const n={},i=Object.entries(e);switch(A.V.kind){case"scalar":for(const[t,r]of i)n[t.toString()]=dA(A.V.T,r);break;case"message":for(const[A,r]of i)n[A.toString()]=r.toJson(t);break;case"enum":const e=A.V.T;for(const[A,r]of i)n[A.toString()]=cA(e,r,t.enumAsInteger)}return t.emitDefaultValues||i.length>0?n:void 0}if(A.repeated){c(Array.isArray(e));const n=[];switch(A.kind){case"scalar":for(let t=0;t<e.length;t++)n.push(dA(A.T,e[t]));break;case"enum":for(let i=0;i<e.length;i++)n.push(cA(A.T,e[i],t.enumAsInteger));break;case"message":for(let A=0;A<e.length;A++)n.push(e[A].toJson(t))}return t.emitDefaultValues||n.length>0?n:void 0}switch(A.kind){case"scalar":return dA(A.T,e);case"enum":return cA(A.T,e,t.enumAsInteger);case"message":return $(A.T,e).toJson(t)}}function cA(A,e,t){var n;if(c("number"==typeof e),"google.protobuf.NullValue"==A.typeName)return null;if(t)return e;const i=A.findNumber(e);return null!==(n=null==i?void 0:i.name)&&void 0!==n?n:e}function dA(A,e){switch(A){case T.INT32:case T.SFIXED32:case T.SINT32:case T.FIXED32:case T.UINT32:return c("number"==typeof e),e;case T.FLOAT:case T.DOUBLE:return c("number"==typeof e),Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":e;case T.STRING:return c("string"==typeof e),e;case T.BOOL:return c("boolean"==typeof e),e;case T.UINT64:case T.FIXED64:case T.INT64:case T.SFIXED64:case T.SINT64:return c("bigint"==typeof e||"string"==typeof e||"number"==typeof e),e.toString();case T.BYTES:return c(e instanceof Uint8Array),V.enc(e)}}const lA=Symbol("@bufbuild/protobuf/unknown-fields"),uA={readUnknownFields:!0,readerFactory:A=>new M(A)},hA={writeUnknownFields:!0,writerFactory:()=>new O};function gA(A,e,t,n,i){let{repeated:r,localName:s}=t;switch(t.oneof&&((A=A[t.oneof.localName]).case!=s&&delete A.value,A.case=s,s="value"),t.kind){case"scalar":case"enum":const o="enum"==t.kind?T.INT32:t.T;let a=fA;if("scalar"==t.kind&&t.L>0&&(a=mA),r){let t=A[s];if(n==H.LengthDelimited&&o!=T.STRING&&o!=T.BYTES){let A=e.uint32()+e.pos;for(;e.pos<A;)t.push(a(e,o))}else t.push(a(e,o))}else A[s]=a(e,o);break;case"message":const c=t.T;r?A[s].push(pA(e,new c,i,t)):q(A[s])?pA(e,A[s],i,t):(A[s]=pA(e,new c,i,t),!c.fieldWrapper||t.oneof||t.repeated||(A[s]=c.fieldWrapper.unwrapField(A[s])));break;case"map":let[d,l]=function(A,e,t){const n=e.uint32(),i=e.pos+n;let r,s;for(;e.pos<i;){const[n]=e.tag();switch(n){case 1:r=fA(e,A.K);break;case 2:switch(A.V.kind){case"scalar":s=fA(e,A.V.T);break;case"enum":s=e.int32();break;case"message":s=pA(e,new A.V.T,t,void 0)}}}if(void 0===r&&(r=x(A.K,I.BIGINT)),"string"!=typeof r&&"number"!=typeof r&&(r=r.toString()),void 0===s)switch(A.V.kind){case"scalar":s=x(A.V.T,I.BIGINT);break;case"enum":s=A.V.T.values[0].no;break;case"message":s=new A.V.T}return[r,s]}(t,e,i);A[s][d]=l}}function pA(A,e,t,n){const i=e.getType().runtime.bin,r=null==n?void 0:n.delimited;return i.readMessage(e,A,r?n.no:A.uint32(),t,r),e}function mA(A,e){const t=fA(A,e);return"bigint"==typeof t?t.toString():t}function fA(A,e){switch(e){case T.STRING:return A.string();case T.BOOL:return A.bool();case T.DOUBLE:return A.double();case T.FLOAT:return A.float();case T.INT32:return A.int32();case T.INT64:return A.int64();case T.UINT64:return A.uint64();case T.FIXED64:return A.fixed64();case T.BYTES:return A.bytes();case T.FIXED32:return A.fixed32();case T.SFIXED32:return A.sfixed32();case T.SFIXED64:return A.sfixed64();case T.SINT64:return A.sint64();case T.UINT32:return A.uint32();case T.SINT32:return A.sint32()}}function BA(A,e,t,n){c(void 0!==e);const i=A.repeated;switch(A.kind){case"scalar":case"enum":let r="enum"==A.kind?T.INT32:A.T;if(i)if(c(Array.isArray(e)),A.packed)!function(A,e,t,n){if(!n.length)return;A.tag(t,H.LengthDelimited).fork();let[,i]=yA(e);for(let r=0;r<n.length;r++)A[i](n[r]);A.join()}(t,r,A.no,e);else for(const n of e)CA(t,r,A.no,n);else CA(t,r,A.no,e);break;case"message":if(i){c(Array.isArray(e));for(const i of e)vA(t,n,A,i)}else vA(t,n,A,e);break;case"map":c("object"==typeof e&&null!=e);for(const[i,s]of Object.entries(e))wA(t,n,A,i,s)}}function wA(A,e,t,n,i){A.tag(t.no,H.LengthDelimited),A.fork();let r=n;switch(t.K){case T.INT32:case T.FIXED32:case T.UINT32:case T.SFIXED32:case T.SINT32:r=Number.parseInt(n);break;case T.BOOL:c("true"==n||"false"==n),r="true"==n}switch(CA(A,t.K,1,r),t.V.kind){case"scalar":CA(A,t.V.T,2,i);break;case"enum":CA(A,T.INT32,2,i);break;case"message":c(void 0!==i),A.tag(2,H.LengthDelimited).bytes(i.toBinary(e))}A.join()}function vA(A,e,t,n){const i=$(t.T,n);t.delimited?A.tag(t.no,H.StartGroup).raw(i.toBinary(e)).tag(t.no,H.EndGroup):A.tag(t.no,H.LengthDelimited).bytes(i.toBinary(e))}function CA(A,e,t,n){c(void 0!==n);let[i,r]=yA(e);A.tag(t,i)[r](n)}function yA(A){let e=H.Varint;switch(A){case T.BYTES:case T.STRING:e=H.LengthDelimited;break;case T.DOUBLE:case T.FIXED64:case T.SFIXED64:e=H.Bit64;break;case T.FIXED32:case T.SFIXED32:case T.FLOAT:e=H.Bit32}return[e,T[A].toLowerCase()]}function bA(A){if(void 0===A)return A;if(q(A))return A.clone();if(A instanceof Uint8Array){const e=new Uint8Array(A.byteLength);return e.set(A),e}return A}function QA(A){return A instanceof Uint8Array?A:new Uint8Array(A)}class UA{constructor(A,e){this._fields=A,this._normalizer=e}findJsonName(A){if(!this.jsonNames){const A={};for(const e of this.list())A[e.jsonName]=A[e.name]=e;this.jsonNames=A}return this.jsonNames[A]}find(A){if(!this.numbers){const A={};for(const e of this.list())A[e.no]=e;this.numbers=A}return this.numbers[A]}list(){return this.all||(this.all=this._normalizer(this._fields)),this.all}byNumber(){return this.numbersAsc||(this.numbersAsc=this.list().concat().sort(((A,e)=>A.no-e.no))),this.numbersAsc}byMember(){if(!this.members){this.members=[];const A=this.members;let e;for(const t of this.list())t.oneof?t.oneof!==e&&(e=t.oneof,A.push(e)):A.push(t)}return this.members}}function kA(A,e){const t=FA(A);return e?t:HA(PA(t))}const EA=FA;function FA(A){let e=!1;const t=[];for(let n=0;n<A.length;n++){let i=A.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":t.push(i),e=!1;break;default:e&&(e=!1,i=i.toUpperCase()),t.push(i)}}return t.join("")}const TA=new Set(["constructor","toString","toJSON","valueOf"]),SA=new Set(["getType","clone","equals","fromBinary","fromJson","fromJsonString","toBinary","toJson","toJsonString","toObject"]),IA=A=>"".concat(A,"$"),PA=A=>SA.has(A)?IA(A):A,HA=A=>TA.has(A)?IA(A):A;class RA{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=kA(A,!1)}addField(A){c(A.oneof===this,"field ".concat(A.name," not one of ").concat(this.name)),this.fields.push(A)}findField(A){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[A]}}const DA=(xA=A=>new UA(A,(A=>function(A){var e,t,n,i,r,s;const o=[];let a;for(const c of"function"==typeof A?A():A){const A=c;if(A.localName=kA(c.name,void 0!==c.oneof),A.jsonName=null!==(e=c.jsonName)&&void 0!==e?e:EA(c.name),A.repeated=null!==(t=c.repeated)&&void 0!==t&&t,"scalar"==c.kind&&(A.L=null!==(n=c.L)&&void 0!==n?n:I.BIGINT),A.delimited=null!==(i=c.delimited)&&void 0!==i&&i,A.req=null!==(r=c.req)&&void 0!==r&&r,A.opt=null!==(s=c.opt)&&void 0!==s&&s,void 0===c.packed&&(A.packed="enum"==c.kind||"scalar"==c.kind&&c.T!=T.BYTES&&c.T!=T.STRING),void 0!==c.oneof){const e="string"==typeof c.oneof?c.oneof:c.oneof.name;a&&a.name==e||(a=new RA(e)),A.oneof=a,a.addField(A)}o.push(A)}return o}(A))),LA=A=>{for(const e of A.getType().fields.byMember()){if(e.opt)continue;const t=e.localName,n=A;if(e.repeated)n[t]=[];else switch(e.kind){case"oneof":n[t]={case:void 0};break;case"enum":n[t]=0;break;case"map":n[t]={};break;case"scalar":n[t]=x(e.T,e.L)}}},{syntax:"proto3",json:{makeReadOptions:function(A){return A?Object.assign(Object.assign({},Z),A):Z},makeWriteOptions:function(A){return A?Object.assign(Object.assign({},z),A):z},readMessage(A,e,t,n){if(null==e||Array.isArray(e)||"object"!=typeof e)throw new Error("cannot decode message ".concat(A.typeName," from JSON: ").concat(tA(e)));n=null!=n?n:new A;const i=new Map,r=t.typeRegistry;for(const[s,o]of Object.entries(e)){const e=A.fields.findJsonName(s);if(e){if(e.oneof){if(null===o&&"scalar"==e.kind)continue;const t=i.get(e.oneof);if(void 0!==t)throw new Error("cannot decode message ".concat(A.typeName,' from JSON: multiple keys for oneof "').concat(e.oneof.name,'" present: "').concat(t,'", "').concat(s,'"'));i.set(e.oneof,s)}nA(n,o,e,t,A)}else{let e=!1;if((null==r?void 0:r.findExtension)&&s.startsWith("[")&&s.endsWith("]")){const i=r.findExtension(s.substring(1,s.length-1));if(i&&i.extendee.typeName==A.typeName){e=!0;const[A,r]=N(i);nA(A,o,i.field,t,i),j(n,i,r(),t)}}if(!e&&!t.ignoreUnknownFields)throw new Error("cannot decode message ".concat(A.typeName,' from JSON: key "').concat(s,'" is unknown'))}}return n},writeMessage(A,e){const t=A.getType(),n={};let i;try{for(i of t.fields.byNumber()){if(!X(i,A)){if(i.req)throw"required field not set";if(!e.emitDefaultValues)continue;if(!oA(i))continue}const t=aA(i,i.oneof?A[i.oneof.localName].value:A[i.localName],e);void 0!==t&&(n[e.useProtoFieldName?i.name:i.jsonName]=t)}const r=e.typeRegistry;if(null==r?void 0:r.findExtensionFor)for(const i of t.runtime.bin.listUnknownFields(A)){const s=r.findExtensionFor(t.typeName,i.no);if(s&&J(A,s)){const t=G(A,s,e),i=aA(s.field,t,e);void 0!==i&&(n[s.field.jsonName]=i)}}}catch(r){const A=i?"cannot encode field ".concat(t.typeName,".").concat(i.name," to JSON"):"cannot encode message ".concat(t.typeName," to JSON"),e=r instanceof Error?r.message:String(r);throw new Error(A+(e.length>0?": ".concat(e):""))}return n},readScalar:(A,e,t)=>rA(A,e,null!=t?t:I.BIGINT,!0),writeScalar(A,e,t){if(void 0!==e)return t||L(A,e)?dA(A,e):void 0},debug:tA},bin:{makeReadOptions:function(A){return A?Object.assign(Object.assign({},uA),A):uA},makeWriteOptions:function(A){return A?Object.assign(Object.assign({},hA),A):hA},listUnknownFields(A){var e;return null!==(e=A[lA])&&void 0!==e?e:[]},discardUnknownFields(A){delete A[lA]},writeUnknownFields(A,e){const t=A[lA];if(t)for(const n of t)e.tag(n.no,n.wireType).raw(n.data)},onUnknownField(A,e,t,n){const i=A;Array.isArray(i[lA])||(i[lA]=[]),i[lA].push({no:e,wireType:t,data:n})},readMessage(A,e,t,n,i){const r=A.getType(),s=i?e.len:e.pos+t;let o,a;for(;e.pos<s&&([o,a]=e.tag(),!0!==i||a!=H.EndGroup);){const t=r.fields.find(o);if(t)gA(A,e,t,a,n);else{const t=e.skip(a,o);n.readUnknownFields&&this.onUnknownField(A,o,a,t)}}if(i&&(a!=H.EndGroup||o!==t))throw new Error("invalid end group tag")},readField:gA,writeMessage(A,e,t){const n=A.getType();for(const i of n.fields.byNumber())if(X(i,A))BA(i,i.oneof?A[i.oneof.localName].value:A[i.localName],e,t);else if(i.req)throw new Error("cannot encode field ".concat(n.typeName,".").concat(i.name," to binary: required field not set"));return t.writeUnknownFields&&this.writeUnknownFields(A,e),e},writeField(A,e,t,n){void 0!==e&&BA(A,e,t,n)}},util:Object.assign(Object.assign({},{setEnumType:g,initPartial(A,e){if(void 0===A)return;const t=e.getType();for(const n of t.fields.byMember()){const t=n.localName,i=e,r=A;if(null!=r[t])switch(n.kind){case"oneof":const A=r[t].case;if(void 0===A)continue;const e=n.findField(A);let s=r[t].value;e&&"message"==e.kind&&!q(s,e.T)?s=new e.T(s):e&&"scalar"===e.kind&&e.T===T.BYTES&&(s=QA(s)),i[t]={case:A,value:s};break;case"scalar":case"enum":let o=r[t];n.T===T.BYTES&&(o=n.repeated?o.map(QA):QA(o)),i[t]=o;break;case"map":switch(n.V.kind){case"scalar":case"enum":if(n.V.T===T.BYTES)for(const[e,n]of Object.entries(r[t]))i[t][e]=QA(n);else Object.assign(i[t],r[t]);break;case"message":const A=n.V.T;for(const e of Object.keys(r[t])){let n=r[t][e];A.fieldWrapper||(n=new A(n)),i[t][e]=n}}break;case"message":const a=n.T;if(n.repeated)i[t]=r[t].map((A=>q(A,a)?A:new a(A)));else{const A=r[t];a.fieldWrapper?"google.protobuf.BytesValue"===a.typeName?i[t]=QA(A):i[t]=A:i[t]=q(A,a)?A:new a(A)}}}},equals:(A,e,t)=>e===t||!(!e||!t)&&A.fields.byMember().every((A=>{const n=e[A.localName],i=t[A.localName];if(A.repeated){if(n.length!==i.length)return!1;switch(A.kind){case"message":return n.every(((e,t)=>A.T.equals(e,i[t])));case"scalar":return n.every(((e,t)=>D(A.T,e,i[t])));case"enum":return n.every(((A,e)=>D(T.INT32,A,i[e])))}throw new Error("repeated cannot contain ".concat(A.kind))}switch(A.kind){case"message":return A.T.equals(n,i);case"enum":return D(T.INT32,n,i);case"scalar":return D(A.T,n,i);case"oneof":if(n.case!==i.case)return!1;const e=A.findField(n.case);if(void 0===e)return!0;switch(e.kind){case"message":return e.T.equals(n.value,i.value);case"enum":return D(T.INT32,n.value,i.value);case"scalar":return D(e.T,n.value,i.value)}throw new Error("oneof cannot contain ".concat(e.kind));case"map":const t=Object.keys(n).concat(Object.keys(i));switch(A.V.kind){case"message":const e=A.V.T;return t.every((A=>e.equals(n[A],i[A])));case"enum":return t.every((A=>D(T.INT32,n[A],i[A])));case"scalar":const r=A.V.T;return t.every((A=>D(r,n[A],i[A])))}}})),clone(A){const e=A.getType(),t=new e,n=t;for(const i of e.fields.byMember()){const e=A[i.localName];let t;if(i.repeated)t=e.map(bA);else if("map"==i.kind){t=n[i.localName];for(const[A,n]of Object.entries(e))t[A]=bA(n)}else t="oneof"==i.kind?i.findField(e.case)?{case:e.case,value:bA(e.value)}:{case:void 0}:bA(e);n[i.localName]=t}for(const i of e.runtime.bin.listUnknownFields(A))e.runtime.bin.onUnknownField(n,i.no,i.wireType,i.data);return t}}),{newFieldList:xA,initFields:LA}),makeMessageType(A,e,t){return function(A,e,t,n){var i;const r=null!==(i=null==n?void 0:n.localName)&&void 0!==i?i:e.substring(e.lastIndexOf(".")+1),s={[r]:function(e){A.util.initFields(this),A.util.initPartial(e,this)}}[r];return Object.setPrototypeOf(s.prototype,new f),Object.assign(s,{runtime:A,typeName:e,fields:A.util.newFieldList(t),fromBinary:(A,e)=>(new s).fromBinary(A,e),fromJson:(A,e)=>(new s).fromJson(A,e),fromJsonString:(A,e)=>(new s).fromJsonString(A,e),equals:(e,t)=>A.util.equals(s,e,t)}),s}(this,A,e,t)},makeEnum:function(A,e,t){const n={};for(const i of e){const A=m(i);n[A.localName]=A.no,n[A.no]=A.localName}return g(n,A,e),n},makeEnumType:p,getEnumType:function(A){const e=A[h];return c(e,"missing enum type on enum object"),e},makeExtension(A,e,t){return function(A,e,t,n){let i;return{typeName:e,extendee:t,get field(){if(!i){const t="function"==typeof n?n():n;t.name=e.split(".").pop(),t.jsonName="[".concat(e,"]"),i=A.util.newFieldList([t]).list()[0]}return i},runtime:A}}(this,A,e,t)}});var xA,LA;class OA extends f{constructor(A){super(),this.seconds=F.zero,this.nanos=0,DA.util.initPartial(A,this)}fromJson(A,e){if("string"!=typeof A)throw new Error("cannot decode google.protobuf.Timestamp from JSON: ".concat(DA.json.debug(A)));const t=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(!t)throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");const n=Date.parse(t[1]+"-"+t[2]+"-"+t[3]+"T"+t[4]+":"+t[5]+":"+t[6]+(t[8]?t[8]:"Z"));if(Number.isNaN(n))throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");if(n<Date.parse("0001-01-01T00:00:00Z")||n>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=F.parse(n/1e3),this.nanos=0,t[7]&&(this.nanos=parseInt("1"+t[7]+"0".repeat(9-t[7].length))-1e9),this}toJson(A){const e=1e3*Number(this.seconds);if(e<Date.parse("0001-01-01T00:00:00Z")||e>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 t="Z";if(this.nanos>0){const A=(this.nanos+1e9).toString().substring(1);t="000000"===A.substring(3)?"."+A.substring(0,3)+"Z":"000"===A.substring(6)?"."+A.substring(0,6)+"Z":"."+A+"Z"}return new Date(e).toISOString().replace(".000Z",t)}toDate(){return new Date(1e3*Number(this.seconds)+Math.ceil(this.nanos/1e6))}static now(){return OA.fromDate(new Date)}static fromDate(A){const e=A.getTime();return new OA({seconds:F.parse(Math.floor(e/1e3)),nanos:e%1e3*1e6})}static fromBinary(A,e){return(new OA).fromBinary(A,e)}static fromJson(A,e){return(new OA).fromJson(A,e)}static fromJsonString(A,e){return(new OA).fromJsonString(A,e)}static equals(A,e){return DA.util.equals(OA,A,e)}}OA.runtime=DA,OA.typeName="google.protobuf.Timestamp",OA.fields=DA.util.newFieldList((()=>[{no:1,name:"seconds",kind:"scalar",T:3},{no:2,name:"nanos",kind:"scalar",T:5}]));const MA=DA.makeMessageType("livekit.MetricsBatch",(()=>[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:OA},{no:3,name:"str_data",kind:"scalar",T:9,repeated:!0},{no:4,name:"time_series",kind:"message",T:NA,repeated:!0},{no:5,name:"events",kind:"message",T:_A,repeated:!0}])),NA=DA.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:KA,repeated:!0},{no:5,name:"rid",kind:"scalar",T:13}])),KA=DA.makeMessageType("livekit.MetricSample",(()=>[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:OA},{no:3,name:"value",kind:"scalar",T:2}])),_A=DA.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:OA},{no:7,name:"normalized_end_timestamp",kind:"message",T:OA,opt:!0},{no:8,name:"metadata",kind:"scalar",T:9},{no:9,name:"rid",kind:"scalar",T:13}])),VA=DA.makeEnum("livekit.BackupCodecPolicy",[{no:0,name:"PREFER_REGRESSION"},{no:1,name:"SIMULCAST"},{no:2,name:"REGRESSION"}]),GA=DA.makeEnum("livekit.TrackType",[{no:0,name:"AUDIO"},{no:1,name:"VIDEO"},{no:2,name:"DATA"}]),jA=DA.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"}]),JA=DA.makeEnum("livekit.VideoQuality",[{no:0,name:"LOW"},{no:1,name:"MEDIUM"},{no:2,name:"HIGH"},{no:3,name:"OFF"}]),WA=DA.makeEnum("livekit.ConnectionQuality",[{no:0,name:"POOR"},{no:1,name:"GOOD"},{no:2,name:"EXCELLENT"},{no:3,name:"LOST"}]),XA=DA.makeEnum("livekit.ClientConfigSetting",[{no:0,name:"UNSET"},{no:1,name:"DISABLED"},{no:2,name:"ENABLED"}]),YA=DA.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=DA.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"}]),$A=DA.makeEnum("livekit.SubscriptionError",[{no:0,name:"SE_UNKNOWN"},{no:1,name:"SE_CODEC_UNSUPPORTED"},{no:2,name:"SE_TRACK_NOTFOUND"}]),ZA=DA.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"}]),zA=DA.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:Ae,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:Ie}])),Ae=DA.makeMessageType("livekit.Codec",(()=>[{no:1,name:"mime",kind:"scalar",T:9},{no:2,name:"fmtp_line",kind:"scalar",T:9}])),ee=DA.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:DA.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}])),te=DA.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:DA.getEnumType(ne)},{no:4,name:"tracks",kind:"message",T:ae,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:ee},{no:12,name:"region",kind:"scalar",T:9},{no:13,name:"is_publisher",kind:"scalar",T:8},{no:14,name:"kind",kind:"enum",T:DA.getEnumType(ie)},{no:15,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:16,name:"disconnect_reason",kind:"enum",T:DA.getEnumType(YA)},{no:18,name:"kind_details",kind:"enum",T:DA.getEnumType(re),repeated:!0}])),ne=DA.makeEnum("livekit.ParticipantInfo.State",[{no:0,name:"JOINING"},{no:1,name:"JOINED"},{no:2,name:"ACTIVE"},{no:3,name:"DISCONNECTED"}]),ie=DA.makeEnum("livekit.ParticipantInfo.Kind",[{no:0,name:"STANDARD"},{no:1,name:"INGRESS"},{no:2,name:"EGRESS"},{no:3,name:"SIP"},{no:4,name:"AGENT"}]),re=DA.makeEnum("livekit.ParticipantInfo.KindDetail",[{no:0,name:"CLOUD_AGENT"},{no:1,name:"FORWARDED"}]),se=DA.makeEnum("livekit.Encryption.Type",[{no:0,name:"NONE"},{no:1,name:"GCM"},{no:2,name:"CUSTOM"}]),oe=DA.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:ce,repeated:!0}])),ae=DA.makeMessageType("livekit.TrackInfo",(()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:DA.getEnumType(GA)},{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:DA.getEnumType(jA)},{no:10,name:"layers",kind:"message",T:ce,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:oe,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:DA.getEnumType(se)},{no:17,name:"stream",kind:"scalar",T:9},{no:18,name:"version",kind:"message",T:Ie},{no:19,name:"audio_features",kind:"enum",T:DA.getEnumType(ZA),repeated:!0},{no:20,name:"backup_codec_policy",kind:"enum",T:DA.getEnumType(VA)}])),ce=DA.makeMessageType("livekit.VideoLayer",(()=>[{no:1,name:"quality",kind:"enum",T:DA.getEnumType(JA)},{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}])),de=DA.makeMessageType("livekit.DataPacket",(()=>[{no:1,name:"kind",kind:"enum",T:DA.getEnumType(le)},{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:ge,oneof:"value"},{no:3,name:"speaker",kind:"message",T:ue,oneof:"value"},{no:6,name:"sip_dtmf",kind:"message",T:pe,oneof:"value"},{no:7,name:"transcription",kind:"message",T:me,oneof:"value"},{no:8,name:"metrics",kind:"message",T:MA,oneof:"value"},{no:9,name:"chat_message",kind:"message",T:Be,oneof:"value"},{no:10,name:"rpc_request",kind:"message",T:we,oneof:"value"},{no:11,name:"rpc_ack",kind:"message",T:ve,oneof:"value"},{no:12,name:"rpc_response",kind:"message",T:Ce,oneof:"value"},{no:13,name:"stream_header",kind:"message",T:De,oneof:"value"},{no:14,name:"stream_chunk",kind:"message",T:xe,oneof:"value"},{no:15,name:"stream_trailer",kind:"message",T:Le,oneof:"value"}])),le=DA.makeEnum("livekit.DataPacket.Kind",[{no:0,name:"RELIABLE"},{no:1,name:"LOSSY"}]),ue=DA.makeMessageType("livekit.ActiveSpeakerUpdate",(()=>[{no:1,name:"speakers",kind:"message",T:he,repeated:!0}])),he=DA.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}])),ge=DA.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}])),pe=DA.makeMessageType("livekit.SipDTMF",(()=>[{no:3,name:"code",kind:"scalar",T:13},{no:4,name:"digit",kind:"scalar",T:9}])),me=DA.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:fe,repeated:!0}])),fe=DA.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}])),Be=DA.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}])),we=DA.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}])),ve=DA.makeMessageType("livekit.RpcAck",(()=>[{no:1,name:"request_id",kind:"scalar",T:9}])),Ce=DA.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:ye,oneof:"value"}])),ye=DA.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}])),be=DA.makeMessageType("livekit.ParticipantTracks",(()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sids",kind:"scalar",T:9,repeated:!0}])),Qe=DA.makeMessageType("livekit.ServerInfo",(()=>[{no:1,name:"edition",kind:"enum",T:DA.getEnumType(Ue)},{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}])),Ue=DA.makeEnum("livekit.ServerInfo.Edition",[{no:0,name:"Standard"},{no:1,name:"Cloud"}]),ke=DA.makeMessageType("livekit.ClientInfo",(()=>[{no:1,name:"sdk",kind:"enum",T:DA.getEnumType(Ee)},{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}])),Ee=DA.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"}]),Fe=DA.makeMessageType("livekit.ClientConfiguration",(()=>[{no:1,name:"video",kind:"message",T:Te},{no:2,name:"screen",kind:"message",T:Te},{no:3,name:"resume_connection",kind:"enum",T:DA.getEnumType(XA)},{no:4,name:"disabled_codecs",kind:"message",T:Se},{no:5,name:"force_relay",kind:"enum",T:DA.getEnumType(XA)}])),Te=DA.makeMessageType("livekit.VideoConfiguration",(()=>[{no:1,name:"hardware_encoder",kind:"enum",T:DA.getEnumType(XA)}])),Se=DA.makeMessageType("livekit.DisabledCodecs",(()=>[{no:1,name:"codecs",kind:"message",T:Ae,repeated:!0},{no:2,name:"publish",kind:"message",T:Ae,repeated:!0}])),Ie=DA.makeMessageType("livekit.TimedVersion",(()=>[{no:1,name:"unix_micro",kind:"scalar",T:3},{no:2,name:"ticks",kind:"scalar",T:5}])),Pe=DA.makeEnum("livekit.DataStream.OperationType",[{no:0,name:"CREATE"},{no:1,name:"UPDATE"},{no:2,name:"DELETE"},{no:3,name:"REACTION"}]),He=DA.makeMessageType("livekit.DataStream.TextHeader",(()=>[{no:1,name:"operation_type",kind:"enum",T:DA.getEnumType(Pe)},{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"}),Re=DA.makeMessageType("livekit.DataStream.ByteHeader",(()=>[{no:1,name:"name",kind:"scalar",T:9}]),{localName:"DataStream_ByteHeader"}),De=DA.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:DA.getEnumType(se)},{no:8,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:9,name:"text_header",kind:"message",T:He,oneof:"content_header"},{no:10,name:"byte_header",kind:"message",T:Re,oneof:"content_header"}]),{localName:"DataStream_Header"}),xe=DA.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"}),Le=DA.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"}),Oe=DA.makeEnum("livekit.SignalTarget",[{no:0,name:"PUBLISHER"},{no:1,name:"SUBSCRIBER"}]),Me=DA.makeEnum("livekit.StreamState",[{no:0,name:"ACTIVE"},{no:1,name:"PAUSED"}]),Ne=DA.makeEnum("livekit.CandidateProtocol",[{no:0,name:"UDP"},{no:1,name:"TCP"},{no:2,name:"TLS"}]),Ke=DA.makeMessageType("livekit.SignalRequest",(()=>[{no:1,name:"offer",kind:"message",T:$e,oneof:"message"},{no:2,name:"answer",kind:"message",T:$e,oneof:"message"},{no:3,name:"trickle",kind:"message",T:je,oneof:"message"},{no:4,name:"add_track",kind:"message",T:Ge,oneof:"message"},{no:5,name:"mute",kind:"message",T:Je,oneof:"message"},{no:6,name:"subscription",kind:"message",T:ze,oneof:"message"},{no:7,name:"track_setting",kind:"message",T:At,oneof:"message"},{no:8,name:"leave",kind:"message",T:nt,oneof:"message"},{no:10,name:"update_layers",kind:"message",T:rt,oneof:"message"},{no:11,name:"subscription_permission",kind:"message",T:Bt,oneof:"message"},{no:12,name:"sync_state",kind:"message",T:Ct,oneof:"message"},{no:13,name:"simulate",kind:"message",T:bt,oneof:"message"},{no:14,name:"ping",kind:"scalar",T:3,oneof:"message"},{no:15,name:"update_metadata",kind:"message",T:st,oneof:"message"},{no:16,name:"ping_req",kind:"message",T:Qt,oneof:"message"},{no:17,name:"update_audio_track",kind:"message",T:et,oneof:"message"},{no:18,name:"update_video_track",kind:"message",T:tt,oneof:"message"}])),_e=DA.makeMessageType("livekit.SignalResponse",(()=>[{no:1,name:"join",kind:"message",T:We,oneof:"message"},{no:2,name:"answer",kind:"message",T:$e,oneof:"message"},{no:3,name:"offer",kind:"message",T:$e,oneof:"message"},{no:4,name:"trickle",kind:"message",T:je,oneof:"message"},{no:5,name:"update",kind:"message",T:Ze,oneof:"message"},{no:6,name:"track_published",kind:"message",T:Ye,oneof:"message"},{no:8,name:"leave",kind:"message",T:nt,oneof:"message"},{no:9,name:"mute",kind:"message",T:Je,oneof:"message"},{no:10,name:"speakers_changed",kind:"message",T:at,oneof:"message"},{no:11,name:"room_update",kind:"message",T:ct,oneof:"message"},{no:12,name:"connection_quality",kind:"message",T:lt,oneof:"message"},{no:13,name:"stream_state_update",kind:"message",T:ht,oneof:"message"},{no:14,name:"subscribed_quality_update",kind:"message",T:mt,oneof:"message"},{no:15,name:"subscription_permission_update",kind:"message",T:wt,oneof:"message"},{no:16,name:"refresh_token",kind:"scalar",T:9,oneof:"message"},{no:17,name:"track_unpublished",kind:"message",T:qe,oneof:"message"},{no:18,name:"pong",kind:"scalar",T:3,oneof:"message"},{no:19,name:"reconnect",kind:"message",T:Xe,oneof:"message"},{no:20,name:"pong_resp",kind:"message",T:Ut,oneof:"message"},{no:21,name:"subscription_response",kind:"message",T:Ft,oneof:"message"},{no:22,name:"request_response",kind:"message",T:Tt,oneof:"message"},{no:23,name:"track_subscribed",kind:"message",T:It,oneof:"message"},{no:24,name:"room_moved",kind:"message",T:vt,oneof:"message"}])),Ve=DA.makeMessageType("livekit.SimulcastCodec",(()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"cid",kind:"scalar",T:9}])),Ge=DA.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:DA.getEnumType(GA)},{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:DA.getEnumType(jA)},{no:9,name:"layers",kind:"message",T:ce,repeated:!0},{no:10,name:"simulcast_codecs",kind:"message",T:Ve,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:DA.getEnumType(se)},{no:15,name:"stream",kind:"scalar",T:9},{no:16,name:"backup_codec_policy",kind:"enum",T:DA.getEnumType(VA)},{no:17,name:"audio_features",kind:"enum",T:DA.getEnumType(ZA),repeated:!0}])),je=DA.makeMessageType("livekit.TrickleRequest",(()=>[{no:1,name:"candidateInit",kind:"scalar",T:9},{no:2,name:"target",kind:"enum",T:DA.getEnumType(Oe)},{no:3,name:"final",kind:"scalar",T:8}])),Je=DA.makeMessageType("livekit.MuteTrackRequest",(()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"muted",kind:"scalar",T:8}])),We=DA.makeMessageType("livekit.JoinResponse",(()=>[{no:1,name:"room",kind:"message",T:zA},{no:2,name:"participant",kind:"message",T:te},{no:3,name:"other_participants",kind:"message",T:te,repeated:!0},{no:4,name:"server_version",kind:"scalar",T:9},{no:5,name:"ice_servers",kind:"message",T:ot,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:Fe},{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:Qe},{no:13,name:"sif_trailer",kind:"scalar",T:12},{no:14,name:"enabled_publish_codecs",kind:"message",T:Ae,repeated:!0},{no:15,name:"fast_publish",kind:"scalar",T:8}])),Xe=DA.makeMessageType("livekit.ReconnectResponse",(()=>[{no:1,name:"ice_servers",kind:"message",T:ot,repeated:!0},{no:2,name:"client_configuration",kind:"message",T:Fe}])),Ye=DA.makeMessageType("livekit.TrackPublishedResponse",(()=>[{no:1,name:"cid",kind:"scalar",T:9},{no:2,name:"track",kind:"message",T:ae}])),qe=DA.makeMessageType("livekit.TrackUnpublishedResponse",(()=>[{no:1,name:"track_sid",kind:"scalar",T:9}])),$e=DA.makeMessageType("livekit.SessionDescription",(()=>[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"sdp",kind:"scalar",T:9}])),Ze=DA.makeMessageType("livekit.ParticipantUpdate",(()=>[{no:1,name:"participants",kind:"message",T:te,repeated:!0}])),ze=DA.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:be,repeated:!0}])),At=DA.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:DA.getEnumType(JA)},{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}])),et=DA.makeMessageType("livekit.UpdateLocalAudioTrack",(()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"features",kind:"enum",T:DA.getEnumType(ZA),repeated:!0}])),tt=DA.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}])),nt=DA.makeMessageType("livekit.LeaveRequest",(()=>[{no:1,name:"can_reconnect",kind:"scalar",T:8},{no:2,name:"reason",kind:"enum",T:DA.getEnumType(YA)},{no:3,name:"action",kind:"enum",T:DA.getEnumType(it)},{no:4,name:"regions",kind:"message",T:kt}])),it=DA.makeEnum("livekit.LeaveRequest.Action",[{no:0,name:"DISCONNECT"},{no:1,name:"RESUME"},{no:2,name:"RECONNECT"}]),rt=DA.makeMessageType("livekit.UpdateVideoLayers",(()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"layers",kind:"message",T:ce,repeated:!0}])),st=DA.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}])),ot=DA.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}])),at=DA.makeMessageType("livekit.SpeakersChanged",(()=>[{no:1,name:"speakers",kind:"message",T:he,repeated:!0}])),ct=DA.makeMessageType("livekit.RoomUpdate",(()=>[{no:1,name:"room",kind:"message",T:zA}])),dt=DA.makeMessageType("livekit.ConnectionQualityInfo",(()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"quality",kind:"enum",T:DA.getEnumType(WA)},{no:3,name:"score",kind:"scalar",T:2}])),lt=DA.makeMessageType("livekit.ConnectionQualityUpdate",(()=>[{no:1,name:"updates",kind:"message",T:dt,repeated:!0}])),ut=DA.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:DA.getEnumType(Me)}])),ht=DA.makeMessageType("livekit.StreamStateUpdate",(()=>[{no:1,name:"stream_states",kind:"message",T:ut,repeated:!0}])),gt=DA.makeMessageType("livekit.SubscribedQuality",(()=>[{no:1,name:"quality",kind:"enum",T:DA.getEnumType(JA)},{no:2,name:"enabled",kind:"scalar",T:8}])),pt=DA.makeMessageType("livekit.SubscribedCodec",(()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"qualities",kind:"message",T:gt,repeated:!0}])),mt=DA.makeMessageType("livekit.SubscribedQualityUpdate",(()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"subscribed_qualities",kind:"message",T:gt,repeated:!0},{no:3,name:"subscribed_codecs",kind:"message",T:pt,repeated:!0}])),ft=DA.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}])),Bt=DA.makeMessageType("livekit.SubscriptionPermission",(()=>[{no:1,name:"all_participants",kind:"scalar",T:8},{no:2,name:"track_permissions",kind:"message",T:ft,repeated:!0}])),wt=DA.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}])),vt=DA.makeMessageType("livekit.RoomMovedResponse",(()=>[{no:1,name:"room",kind:"message",T:zA},{no:2,name:"token",kind:"scalar",T:9},{no:3,name:"participant",kind:"message",T:te},{no:4,name:"other_participants",kind:"message",T:te,repeated:!0}])),Ct=DA.makeMessageType("livekit.SyncState",(()=>[{no:1,name:"answer",kind:"message",T:$e},{no:2,name:"subscription",kind:"message",T:ze},{no:3,name:"publish_tracks",kind:"message",T:Ye,repeated:!0},{no:4,name:"data_channels",kind:"message",T:yt,repeated:!0},{no:5,name:"offer",kind:"message",T:$e},{no:6,name:"track_sids_disabled",kind:"scalar",T:9,repeated:!0}])),yt=DA.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:DA.getEnumType(Oe)}])),bt=DA.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:DA.getEnumType(Ne),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"}])),Qt=DA.makeMessageType("livekit.Ping",(()=>[{no:1,name:"timestamp",kind:"scalar",T:3},{no:2,name:"rtt",kind:"scalar",T:3}])),Ut=DA.makeMessageType("livekit.Pong",(()=>[{no:1,name:"last_ping_timestamp",kind:"scalar",T:3},{no:2,name:"timestamp",kind:"scalar",T:3}])),kt=DA.makeMessageType("livekit.RegionSettings",(()=>[{no:1,name:"regions",kind:"message",T:Et,repeated:!0}])),Et=DA.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}])),Ft=DA.makeMessageType("livekit.SubscriptionResponse",(()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"err",kind:"enum",T:DA.getEnumType($A)}])),Tt=DA.makeMessageType("livekit.RequestResponse",(()=>[{no:1,name:"request_id",kind:"scalar",T:13},{no:2,name:"reason",kind:"enum",T:DA.getEnumType(St)},{no:3,name:"message",kind:"scalar",T:9}])),St=DA.makeEnum("livekit.RequestResponse.Reason",[{no:0,name:"OK"},{no:1,name:"NOT_FOUND"},{no:2,name:"NOT_ALLOWED"},{no:3,name:"LIMIT_EXCEEDED"}]),It=DA.makeMessageType("livekit.TrackSubscribed",(()=>[{no:1,name:"track_sid",kind:"scalar",T:9}]));function Pt(A){return A&&A.__esModule&&Object.prototype.hasOwnProperty.call(A,"default")?A.default:A}var Ht,Rt,Dt,xt,Lt,Ot,Mt,Nt,Kt={exports:{}},_t=(Ht||(Ht=1,Dt=Kt.exports,xt=function(){var A=function(){},e="undefined",t=typeof window!==e&&typeof window.navigator!==e&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"],i={},r=null;function s(A,e){var t=A[e];if("function"==typeof t.bind)return t.bind(A);try{return Function.prototype.bind.call(t,A)}catch(n){return function(){return Function.prototype.apply.apply(t,[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 t=this.getLevel(),i=0;i<n.length;i++){var r=n[i];this[r]=i<t?A:this.methodFactory(r,t,this.name)}if(this.log=this.debug,typeof console===e&&t<this.levels.SILENT)return"No console available for logging"}function c(A){return function(){typeof console!==e&&(a.call(this),this[A].apply(this,arguments))}}function d(n,i,r){return function(n){return"debug"===n&&(n="log"),typeof console!==e&&("trace"===n&&t?o:void 0!==console[n]?s(console,n):void 0!==console.log?s(console,"log"):A)}(n)||c.apply(this,arguments)}function l(A,t){var s,o,c,l=this,u="loglevel";function h(){var A;if(typeof window!==e&&u){try{A=window.localStorage[u]}catch(r){}if(typeof A===e)try{var t=window.document.cookie,n=encodeURIComponent(u),i=t.indexOf(n+"=");-1!==i&&(A=/^([^;]+)/.exec(t.slice(i+n.length+1))[1])}catch(r){}return void 0===l.levels[A]&&(A=void 0),A}}function g(A){var e=A;if("string"==typeof e&&void 0!==l.levels[e.toUpperCase()]&&(e=l.levels[e.toUpperCase()]),"number"==typeof e&&e>=0&&e<=l.levels.SILENT)return e;throw new TypeError("log.setLevel() called with invalid level: "+A)}"string"==typeof A?u+=":"+A:"symbol"==typeof A&&(u=void 0),l.name=A,l.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},l.methodFactory=t||d,l.getLevel=function(){return null!=c?c:null!=o?o:s},l.setLevel=function(A,t){return c=g(A),!1!==t&&function(A){var t=(n[A]||"silent").toUpperCase();if(typeof window!==e&&u){try{return void(window.localStorage[u]=t)}catch(i){}try{window.document.cookie=encodeURIComponent(u)+"="+t+";"}catch(i){}}}(c),a.call(l)},l.setDefaultLevel=function(A){o=g(A),h()||l.setLevel(A,!1)},l.resetLevel=function(){c=null,function(){if(typeof window!==e&&u){try{window.localStorage.removeItem(u)}catch(A){}try{window.document.cookie=encodeURIComponent(u)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(A){}}}(),a.call(l)},l.enableAll=function(A){l.setLevel(l.levels.TRACE,A)},l.disableAll=function(A){l.setLevel(l.levels.SILENT,A)},l.rebuild=function(){if(r!==l&&(s=g(r.getLevel())),a.call(l),r===l)for(var A in i)i[A].rebuild()},s=g(r?r.getLevel():"WARN");var p=h();null!=p&&(c=g(p)),a.call(l)}(r=new l).getLogger=function(A){if("symbol"!=typeof A&&"string"!=typeof A||""===A)throw new TypeError("You must supply a name when creating a logger.");var e=i[A];return e||(e=i[A]=new l(A,r.methodFactory)),e};var u=typeof window!==e?window.log:void 0;return r.noConflict=function(){return typeof window!==e&&window.log===r&&(window.log=u),r},r.getLoggers=function(){return i},r.default=r,r},(Rt=Kt).exports?Rt.exports=xt():Dt.log=xt()),Kt.exports);(Ot=Lt||(Lt={}))[Ot.trace=0]="trace",Ot[Ot.debug=1]="debug",Ot[Ot.info=2]="info",Ot[Ot.warn=3]="warn",Ot[Ot.error=4]="error",Ot[Ot.silent=5]="silent",(Nt=Mt||(Mt={})).Default="livekit",Nt.Room="livekit-room",Nt.Participant="livekit-participant",Nt.Track="livekit-track",Nt.Publication="livekit-track-publication",Nt.Engine="livekit-engine",Nt.Signal="livekit-signal",Nt.PCManager="livekit-pc-manager",Nt.PCTransport="livekit-pc-transport",Nt.E2EE="lk-e2ee";let Vt=_t.getLogger("livekit");function Gt(A){const e=_t.getLogger(A);return e.setDefaultLevel(Vt.getLevel()),e}Object.values(Mt).map((A=>_t.getLogger(A))),Vt.setDefaultLevel(Lt.info);const jt=_t.getLogger("lk-e2ee"),Jt=7e3,Wt=[0,300,1200,2700,4800,Jt,Jt,Jt,Jt,Jt];function Xt(A,e,t,n){return new(t||(t=Promise))((function(i,r){function s(A){try{a(n.next(A))}catch(e){r(e)}}function o(A){try{a(n.throw(A))}catch(e){r(e)}}function a(A){var e;A.done?i(A.value):(e=A.value,e instanceof t?e:new t((function(A){A(e)}))).then(s,o)}a((n=n.apply(A,e||[])).next())}))}function Yt(A){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,t=A[Symbol.asyncIterator];return t?t.call(A):(A=function(A){var e="function"==typeof Symbol&&Symbol.iterator,t=e&&A[e],n=0;if(t)return t.call(A);if(A&&"number"==typeof A.length)return{next:function(){return A&&n>=A.length&&(A=void 0),{value:A&&A[n++],done:!A}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(A),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(t){e[t]=A[t]&&function(e){return new Promise((function(n,i){!function(A,e,t,n){Promise.resolve(n).then((function(e){A({value:e,done:t})}),e)}(n,i,(e=A[t](e)).done,e.value)}))}}}"function"==typeof SuppressedError&&SuppressedError;var qt,$t={exports:{}},Zt=function(){if(qt)return $t.exports;qt=1;var A,e="object"==typeof Reflect?Reflect:null,t=e&&"function"==typeof e.apply?e.apply:function(A,e,t){return Function.prototype.apply.call(A,e,t)};A=e&&"function"==typeof e.ownKeys?e.ownKeys:Object.getOwnPropertySymbols?function(A){return Object.getOwnPropertyNames(A).concat(Object.getOwnPropertySymbols(A))}:function(A){return Object.getOwnPropertyNames(A)};var n=Number.isNaN||function(A){return A!=A};function i(){i.init.call(this)}$t.exports=i,$t.exports.once=function(A,e){return new Promise((function(t,n){function i(t){A.removeListener(e,r),n(t)}function r(){"function"==typeof A.removeListener&&A.removeListener("error",i),t([].slice.call(arguments))}g(A,e,r,{once:!0}),"error"!==e&&function(A,e){"function"==typeof A.on&&g(A,"error",e,{once:!0})}(A,i)}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var r=10;function s(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._maxListeners?i.defaultMaxListeners:A._maxListeners}function a(A,e,t,n){var i,r,a,c;if(s(t),void 0===(r=A._events)?(r=A._events=Object.create(null),A._eventsCount=0):(void 0!==r.newListener&&(A.emit("newListener",e,t.listener?t.listener:t),r=A._events),a=r[e]),void 0===a)a=r[e]=t,++A._eventsCount;else if("function"==typeof a?a=r[e]=n?[t,a]:[a,t]:n?a.unshift(t):a.push(t),(i=o(A))>0&&a.length>i&&!a.warned){a.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=A,d.type=e,d.count=a.length,c=d,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 d(A,e,t){var n={fired:!1,wrapFn:void 0,target:A,type:e,listener:t},i=c.bind(n);return i.listener=t,n.wrapFn=i,i}function l(A,e,t){var n=A._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?t?[i.listener||i]:[i]:t?function(A){for(var e=new Array(A.length),t=0;t<e.length;++t)e[t]=A[t].listener||A[t];return e}(i):h(i,i.length)}function u(A){var e=this._events;if(void 0!==e){var t=e[A];if("function"==typeof t)return 1;if(void 0!==t)return t.length}return 0}function h(A,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=A[n];return t}function g(A,e,t,n){if("function"==typeof A.on)n.once?A.once(e,t):A.on(e,t);else{if("function"!=typeof A.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof A);A.addEventListener(e,(function i(r){n.once&&A.removeEventListener(e,i),t(r)}))}}return Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return r},set:function(A){if("number"!=typeof A||A<0||n(A))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+A+".");r=A}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(A){if("number"!=typeof A||A<0||n(A))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+A+".");return this._maxListeners=A,this},i.prototype.getMaxListeners=function(){return o(this)},i.prototype.emit=function(A){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var i="error"===A,r=this._events;if(void 0!==r)i=i&&void 0===r.error;else if(!i)return!1;if(i){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var a=r[A];if(void 0===a)return!1;if("function"==typeof a)t(a,this,e);else{var c=a.length,d=h(a,c);for(n=0;n<c;++n)t(d[n],this,e)}return!0},i.prototype.addListener=function(A,e){return a(this,A,e,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(A,e){return a(this,A,e,!0)},i.prototype.once=function(A,e){return s(e),this.on(A,d(this,A,e)),this},i.prototype.prependOnceListener=function(A,e){return s(e),this.prependListener(A,d(this,A,e)),this},i.prototype.removeListener=function(A,e){var t,n,i,r,o;if(s(e),void 0===(n=this._events))return this;if(void 0===(t=n[A]))return this;if(t===e||t.listener===e)0===--this._eventsCount?this._events=Object.create(null):(delete n[A],n.removeListener&&this.emit("removeListener",A,t.listener||e));else if("function"!=typeof t){for(i=-1,r=t.length-1;r>=0;r--)if(t[r]===e||t[r].listener===e){o=t[r].listener,i=r;break}if(i<0)return this;0===i?t.shift():function(A,e){for(;e+1<A.length;e++)A[e]=A[e+1];A.pop()}(t,i),1===t.length&&(n[A]=t[0]),void 0!==n.removeListener&&this.emit("removeListener",A,o||e)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(A){var e,t,n;if(void 0===(t=this._events))return this;if(void 0===t.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==t[A]&&(0===--this._eventsCount?this._events=Object.create(null):delete t[A]),this;if(0===arguments.length){var i,r=Object.keys(t);for(n=0;n<r.length;++n)"removeListener"!==(i=r[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=t[A]))this.removeListener(A,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(A,e[n]);return this},i.prototype.listeners=function(A){return l(this,A,!0)},i.prototype.rawListeners=function(A){return l(this,A,!1)},i.listenerCount=function(A,e){return"function"==typeof A.listenerCount?A.listenerCount(e):u.call(A,e)},i.prototype.listenerCount=u,i.prototype.eventNames=function(){return this._eventsCount>0?A(this._events):[]},$t.exports}();let zt=!0,An=!0;function en(A,e,t){const n=A.match(e);return n&&n.length>=t&&parseInt(n[t],10)}function tn(A,e,t){if(!A.RTCPeerConnection)return;const n=A.RTCPeerConnection.prototype,i=n.addEventListener;n.addEventListener=function(A,n){if(A!==e)return i.apply(this,arguments);const r=A=>{const e=t(A);e&&(n.handleEvent?n.handleEvent(e):n(e))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(n,r),i.apply(this,[A,r])};const r=n.removeEventListener;n.removeEventListener=function(A,t){if(A!==e||!this._eventMap||!this._eventMap[e])return r.apply(this,arguments);if(!this._eventMap[e].has(t))return r.apply(this,arguments);const n=this._eventMap[e].get(t);return this._eventMap[e].delete(t),0===this._eventMap[e].size&&delete this._eventMap[e],0===Object.keys(this._eventMap).length&&delete this._eventMap,r.apply(this,[A,n])},Object.defineProperty(n,"on"+e,{get(){return this["_on"+e]},set(A){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),A&&this.addEventListener(e,this["_on"+e]=A)},enumerable:!0,configurable:!0})}function nn(A){return"boolean"!=typeof A?new Error("Argument type: "+typeof A+". Please use a boolean."):(zt=A,A?"adapter.js logging disabled":"adapter.js logging enabled")}function rn(A){return"boolean"!=typeof A?new Error("Argument type: "+typeof A+". Please use a boolean."):(An=!A,"adapter.js deprecation warnings "+(A?"disabled":"enabled"))}function sn(){if("object"==typeof window){if(zt)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function on(A,e){An&&console.warn(A+" is deprecated, please use "+e+" instead.")}function an(A){return"[object Object]"===Object.prototype.toString.call(A)}function cn(A){return an(A)?Object.keys(A).reduce((function(e,t){const n=an(A[t]),i=n?cn(A[t]):A[t],r=n&&!Object.keys(i).length;return void 0===i||r?e:Object.assign(e,{[t]:i})}),{}):A}function dn(A,e,t){e&&!t.has(e.id)&&(t.set(e.id,e),Object.keys(e).forEach((n=>{n.endsWith("Id")?dn(A,A.get(e[n]),t):n.endsWith("Ids")&&e[n].forEach((e=>{dn(A,A.get(e),t)}))})))}function ln(A,e,t){const n=t?"outbound-rtp":"inbound-rtp",i=new Map;if(null===e)return i;const r=[];return A.forEach((A=>{"track"===A.type&&A.trackIdentifier===e.id&&r.push(A)})),r.forEach((e=>{A.forEach((t=>{t.type===n&&t.trackId===e.id&&dn(A,t,i)}))})),i}const un=sn;function hn(A,e){const t=A&&A.navigator;if(!t.mediaDevices)return;const n=function(A){if("object"!=typeof A||A.mandatory||A.optional)return A;const e={};return Object.keys(A).forEach((t=>{if("require"===t||"advanced"===t||"mediaSource"===t)return;const n="object"==typeof A[t]?A[t]:{ideal:A[t]};void 0!==n.exact&&"number"==typeof n.exact&&(n.min=n.max=n.exact);const i=function(A,e){return A?A+e.charAt(0).toUpperCase()+e.slice(1):"deviceId"===e?"sourceId":e};if(void 0!==n.ideal){e.optional=e.optional||[];let A={};"number"==typeof n.ideal?(A[i("min",t)]=n.ideal,e.optional.push(A),A={},A[i("max",t)]=n.ideal,e.optional.push(A)):(A[i("",t)]=n.ideal,e.optional.push(A))}void 0!==n.exact&&"number"!=typeof n.exact?(e.mandatory=e.mandatory||{},e.mandatory[i("",t)]=n.exact):["min","max"].forEach((A=>{void 0!==n[A]&&(e.mandatory=e.mandatory||{},e.mandatory[i(A,t)]=n[A])}))})),A.advanced&&(e.optional=(e.optional||[]).concat(A.advanced)),e},i=function(A,i){if(e.version>=61)return i(A);if((A=JSON.parse(JSON.stringify(A)))&&"object"==typeof A.audio){const e=function(A,e,t){e in A&&!(t in A)&&(A[t]=A[e],delete A[e])};e((A=JSON.parse(JSON.stringify(A))).audio,"autoGainControl","googAutoGainControl"),e(A.audio,"noiseSuppression","googNoiseSuppression"),A.audio=n(A.audio)}if(A&&"object"==typeof A.video){let r=A.video.facingMode;r=r&&("object"==typeof r?r:{ideal:r});const s=e.version<66;if(r&&("user"===r.exact||"environment"===r.exact||"user"===r.ideal||"environment"===r.ideal)&&(!t.mediaDevices.getSupportedConstraints||!t.mediaDevices.getSupportedConstraints().facingMode||s)){let e;if(delete A.video.facingMode,"environment"===r.exact||"environment"===r.ideal?e=["back","rear"]:"user"!==r.exact&&"user"!==r.ideal||(e=["front"]),e)return t.mediaDevices.enumerateDevices().then((t=>{let s=(t=t.filter((A=>"videoinput"===A.kind))).find((A=>e.some((e=>A.label.toLowerCase().includes(e)))));return!s&&t.length&&e.includes("back")&&(s=t[t.length-1]),s&&(A.video.deviceId=r.exact?{exact:s.deviceId}:{ideal:s.deviceId}),A.video=n(A.video),un("chrome: "+JSON.stringify(A)),i(A)}))}A.video=n(A.video)}return un("chrome: "+JSON.stringify(A)),i(A)},r=function(A){return e.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(t.getUserMedia=function(A,e,n){i(A,(A=>{t.webkitGetUserMedia(A,e,(A=>{n&&n(r(A))}))}))}.bind(t),t.mediaDevices.getUserMedia){const A=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return i(e,(e=>A(e).then((A=>{if(e.audio&&!A.getAudioTracks().length||e.video&&!A.getVideoTracks().length)throw A.getTracks().forEach((A=>{A.stop()})),new DOMException("","NotFoundError");return A}),(A=>Promise.reject(r(A))))))}}}function gn(A){A.MediaStream=A.MediaStream||A.webkitMediaStream}function pn(A){if("object"==typeof A&&A.RTCPeerConnection&&!("ontrack"in A.RTCPeerConnection.prototype)){Object.defineProperty(A.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=A.RTCPeerConnection.prototype.setRemoteDescription;A.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=e=>{e.stream.addEventListener("addtrack",(t=>{let n;n=A.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((A=>A.track&&A.track.id===t.track.id)):{track:t.track};const i=new Event("track");i.track=t.track,i.receiver=n,i.transceiver={receiver:n},i.streams=[e.stream],this.dispatchEvent(i)})),e.stream.getTracks().forEach((t=>{let n;n=A.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((A=>A.track&&A.track.id===t.id)):{track:t};const i=new Event("track");i.track=t,i.receiver=n,i.transceiver={receiver:n},i.streams=[e.stream],this.dispatchEvent(i)}))},this.addEventListener("addstream",this._ontrackpoly)),e.apply(this,arguments)}}else tn(A,"track",(A=>(A.transceiver||Object.defineProperty(A,"transceiver",{value:{receiver:A.receiver}}),A)))}function mn(A){if("object"==typeof A&&A.RTCPeerConnection&&!("getSenders"in A.RTCPeerConnection.prototype)&&"createDTMFSender"in A.RTCPeerConnection.prototype){const e=function(A,e){return{track:e,get dtmf(){return void 0===this._dtmf&&("audio"===e.kind?this._dtmf=A.createDTMFSender(e):this._dtmf=null),this._dtmf},_pc:A}};if(!A.RTCPeerConnection.prototype.getSenders){A.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const t=A.RTCPeerConnection.prototype.addTrack;A.RTCPeerConnection.prototype.addTrack=function(A,n){let i=t.apply(this,arguments);return i||(i=e(this,A),this._senders.push(i)),i};const n=A.RTCPeerConnection.prototype.removeTrack;A.RTCPeerConnection.prototype.removeTrack=function(A){n.apply(this,arguments);const e=this._senders.indexOf(A);-1!==e&&this._senders.splice(e,1)}}const t=A.RTCPeerConnection.prototype.addStream;A.RTCPeerConnection.prototype.addStream=function(A){this._senders=this._senders||[],t.apply(this,[A]),A.getTracks().forEach((A=>{this._senders.push(e(this,A))}))};const n=A.RTCPeerConnection.prototype.removeStream;A.RTCPeerConnection.prototype.removeStream=function(A){this._senders=this._senders||[],n.apply(this,[A]),A.getTracks().forEach((A=>{const e=this._senders.find((e=>e.track===A));e&&this._senders.splice(this._senders.indexOf(e),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 e=A.RTCPeerConnection.prototype.getSenders;A.RTCPeerConnection.prototype.getSenders=function(){const A=e.apply(this,[]);return A.forEach((A=>A._pc=this)),A},Object.defineProperty(A.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function fn(A){if(!("object"==typeof A&&A.RTCPeerConnection&&A.RTCRtpSender&&A.RTCRtpReceiver))return;if(!("getStats"in A.RTCRtpSender.prototype)){const e=A.RTCPeerConnection.prototype.getSenders;e&&(A.RTCPeerConnection.prototype.getSenders=function(){const A=e.apply(this,[]);return A.forEach((A=>A._pc=this)),A});const t=A.RTCPeerConnection.prototype.addTrack;t&&(A.RTCPeerConnection.prototype.addTrack=function(){const A=t.apply(this,arguments);return A._pc=this,A}),A.RTCRtpSender.prototype.getStats=function(){const A=this;return this._pc.getStats().then((e=>ln(e,A.track,!0)))}}if(!("getStats"in A.RTCRtpReceiver.prototype)){const e=A.RTCPeerConnection.prototype.getReceivers;e&&(A.RTCPeerConnection.prototype.getReceivers=function(){const A=e.apply(this,[]);return A.forEach((A=>A._pc=this)),A}),tn(A,"track",(A=>(A.receiver._pc=A.srcElement,A))),A.RTCRtpReceiver.prototype.getStats=function(){const A=this;return this._pc.getStats().then((e=>ln(e,A.track,!1)))}}if(!("getStats"in A.RTCRtpSender.prototype)||!("getStats"in A.RTCRtpReceiver.prototype))return;const e=A.RTCPeerConnection.prototype.getStats;A.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof A.MediaStreamTrack){const A=arguments[0];let e,t,n;return this.getSenders().forEach((t=>{t.track===A&&(e?n=!0:e=t)})),this.getReceivers().forEach((e=>(e.track===A&&(t?n=!0:t=e),e.track===A))),n||e&&t?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):e?e.getStats():t?t.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return e.apply(this,arguments)}}function Bn(A){A.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((A=>this._shimmedLocalStreams[A][0]))};const e=A.RTCPeerConnection.prototype.addTrack;A.RTCPeerConnection.prototype.addTrack=function(A,t){if(!t)return e.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const n=e.apply(this,arguments);return this._shimmedLocalStreams[t.id]?-1===this._shimmedLocalStreams[t.id].indexOf(n)&&this._shimmedLocalStreams[t.id].push(n):this._shimmedLocalStreams[t.id]=[t,n],n};const t=A.RTCPeerConnection.prototype.addStream;A.RTCPeerConnection.prototype.addStream=function(A){this._shimmedLocalStreams=this._shimmedLocalStreams||{},A.getTracks().forEach((A=>{if(this.getSenders().find((e=>e.track===A)))throw new DOMException("Track already exists.","InvalidAccessError")}));const e=this.getSenders();t.apply(this,arguments);const n=this.getSenders().filter((A=>-1===e.indexOf(A)));this._shimmedLocalStreams[A.id]=[A].concat(n)};const n=A.RTCPeerConnection.prototype.removeStream;A.RTCPeerConnection.prototype.removeStream=function(A){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[A.id],n.apply(this,arguments)};const i=A.RTCPeerConnection.prototype.removeTrack;A.RTCPeerConnection.prototype.removeTrack=function(A){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},A&&Object.keys(this._shimmedLocalStreams).forEach((e=>{const t=this._shimmedLocalStreams[e].indexOf(A);-1!==t&&this._shimmedLocalStreams[e].splice(t,1),1===this._shimmedLocalStreams[e].length&&delete this._shimmedLocalStreams[e]})),i.apply(this,arguments)}}function wn(A,e){if(!A.RTCPeerConnection)return;if(A.RTCPeerConnection.prototype.addTrack&&e.version>=65)return Bn(A);const t=A.RTCPeerConnection.prototype.getLocalStreams;A.RTCPeerConnection.prototype.getLocalStreams=function(){const A=t.apply(this);return this._reverseStreams=this._reverseStreams||{},A.map((A=>this._reverseStreams[A.id]))};const n=A.RTCPeerConnection.prototype.addStream;A.RTCPeerConnection.prototype.addStream=function(e){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},e.getTracks().forEach((A=>{if(this.getSenders().find((e=>e.track===A)))throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[e.id]){const t=new A.MediaStream(e.getTracks());this._streams[e.id]=t,this._reverseStreams[t.id]=e,e=t}n.apply(this,[e])};const i=A.RTCPeerConnection.prototype.removeStream;function r(A,e){let t=e.sdp;return Object.keys(A._reverseStreams||[]).forEach((e=>{const n=A._reverseStreams[e],i=A._streams[n.id];t=t.replace(new RegExp(i.id,"g"),n.id)})),new RTCSessionDescription({type:e.type,sdp:t})}A.RTCPeerConnection.prototype.removeStream=function(A){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[A.id]||A]),delete this._reverseStreams[this._streams[A.id]?this._streams[A.id].id:A.id],delete this._streams[A.id]},A.RTCPeerConnection.prototype.addTrack=function(e,t){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const n=[].slice.call(arguments,1);if(1!==n.length||!n[0].getTracks().find((A=>A===e)))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===e)))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const i=this._streams[t.id];if(i)i.addTrack(e),Promise.resolve().then((()=>{this.dispatchEvent(new Event("negotiationneeded"))}));else{const n=new A.MediaStream([e]);this._streams[t.id]=n,this._reverseStreams[n.id]=t,this.addStream(n)}return this.getSenders().find((A=>A.track===e))},["createOffer","createAnswer"].forEach((function(e){const t=A.RTCPeerConnection.prototype[e],n={[e](){const A=arguments;return arguments.length&&"function"==typeof arguments[0]?t.apply(this,[e=>{const t=r(this,e);A[0].apply(null,[t])},e=>{A[1]&&A[1].apply(null,e)},arguments[2]]):t.apply(this,arguments).then((A=>r(this,A)))}};A.RTCPeerConnection.prototype[e]=n[e]}));const s=A.RTCPeerConnection.prototype.setLocalDescription;A.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=function(A,e){let t=e.sdp;return Object.keys(A._reverseStreams||[]).forEach((e=>{const n=A._reverseStreams[e],i=A._streams[n.id];t=t.replace(new RegExp(n.id,"g"),i.id)})),new RTCSessionDescription({type:e.type,sdp:t})}(this,arguments[0]),s.apply(this,arguments)):s.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:r(this,A)}}),A.RTCPeerConnection.prototype.removeTrack=function(A){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!A._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(A._pc!==this)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let e;this._streams=this._streams||{},Object.keys(this._streams).forEach((t=>{this._streams[t].getTracks().find((e=>A.track===e))&&(e=this._streams[t])})),e&&(1===e.getTracks().length?this.removeStream(this._reverseStreams[e.id]):e.removeTrack(A.track),this.dispatchEvent(new Event("negotiationneeded")))}}function vn(A,e){!A.RTCPeerConnection&&A.webkitRTCPeerConnection&&(A.RTCPeerConnection=A.webkitRTCPeerConnection),A.RTCPeerConnection&&e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(e){const t=A.RTCPeerConnection.prototype[e],n={[e](){return arguments[0]=new("addIceCandidate"===e?A.RTCIceCandidate:A.RTCSessionDescription)(arguments[0]),t.apply(this,arguments)}};A.RTCPeerConnection.prototype[e]=n[e]}))}function Cn(A,e){tn(A,"negotiationneeded",(A=>{const t=A.target;if(!(e.version<72||t.getConfiguration&&"plan-b"===t.getConfiguration().sdpSemantics)||"stable"===t.signalingState)return A}))}var yn=Object.freeze({__proto__:null,fixNegotiationNeeded:Cn,shimAddTrackRemoveTrack:wn,shimAddTrackRemoveTrackWithNative:Bn,shimGetSendersWithDtmf:mn,shimGetUserMedia:hn,shimMediaStream:gn,shimOnTrack:pn,shimPeerConnection:vn,shimSenderReceiverGetStats:fn});function bn(A,e){const t=A&&A.navigator,n=A&&A.MediaStreamTrack;if(t.getUserMedia=function(A,e,n){on("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),t.mediaDevices.getUserMedia(A).then(e,n)},!(e.version>55&&"autoGainControl"in t.mediaDevices.getSupportedConstraints())){const A=function(A,e,t){e in A&&!(t in A)&&(A[t]=A[e],delete A[e])},e=t.mediaDevices.getUserMedia.bind(t.mediaDevices);if(t.mediaDevices.getUserMedia=function(t){return"object"==typeof t&&"object"==typeof t.audio&&(t=JSON.parse(JSON.stringify(t)),A(t.audio,"autoGainControl","mozAutoGainControl"),A(t.audio,"noiseSuppression","mozNoiseSuppression")),e(t)},n&&n.prototype.getSettings){const e=n.prototype.getSettings;n.prototype.getSettings=function(){const t=e.apply(this,arguments);return A(t,"mozAutoGainControl","autoGainControl"),A(t,"mozNoiseSuppression","noiseSuppression"),t}}if(n&&n.prototype.applyConstraints){const e=n.prototype.applyConstraints;n.prototype.applyConstraints=function(t){return"audio"===this.kind&&"object"==typeof t&&(t=JSON.parse(JSON.stringify(t)),A(t,"autoGainControl","mozAutoGainControl"),A(t,"noiseSuppression","mozNoiseSuppression")),e.apply(this,[t])}}}}function Qn(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 Un(A,e){if("object"!=typeof A||!A.RTCPeerConnection&&!A.mozRTCPeerConnection)return;!A.RTCPeerConnection&&A.mozRTCPeerConnection&&(A.RTCPeerConnection=A.mozRTCPeerConnection),e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(e){const t=A.RTCPeerConnection.prototype[e],n={[e](){return arguments[0]=new("addIceCandidate"===e?A.RTCIceCandidate:A.RTCSessionDescription)(arguments[0]),t.apply(this,arguments)}};A.RTCPeerConnection.prototype[e]=n[e]}));const t={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},n=A.RTCPeerConnection.prototype.getStats;A.RTCPeerConnection.prototype.getStats=function(){const[A,i,r]=arguments;return n.apply(this,[A||null]).then((A=>{if(e.version<53&&!i)try{A.forEach((A=>{A.type=t[A.type]||A.type}))}catch(n){if("TypeError"!==n.name)throw n;A.forEach(((e,n)=>{A.set(n,Object.assign({},e,{type:t[e.type]||e.type}))}))}return A})).then(i,r)}}function kn(A){if("object"!=typeof A||!A.RTCPeerConnection||!A.RTCRtpSender)return;if(A.RTCRtpSender&&"getStats"in A.RTCRtpSender.prototype)return;const e=A.RTCPeerConnection.prototype.getSenders;e&&(A.RTCPeerConnection.prototype.getSenders=function(){const A=e.apply(this,[]);return A.forEach((A=>A._pc=this)),A});const t=A.RTCPeerConnection.prototype.addTrack;t&&(A.RTCPeerConnection.prototype.addTrack=function(){const A=t.apply(this,arguments);return A._pc=this,A}),A.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function En(A){if("object"!=typeof A||!A.RTCPeerConnection||!A.RTCRtpSender)return;if(A.RTCRtpSender&&"getStats"in A.RTCRtpReceiver.prototype)return;const e=A.RTCPeerConnection.prototype.getReceivers;e&&(A.RTCPeerConnection.prototype.getReceivers=function(){const A=e.apply(this,[]);return A.forEach((A=>A._pc=this)),A}),tn(A,"track",(A=>(A.receiver._pc=A.srcElement,A))),A.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function Fn(A){A.RTCPeerConnection&&!("removeStream"in A.RTCPeerConnection.prototype)&&(A.RTCPeerConnection.prototype.removeStream=function(A){on("removeStream","removeTrack"),this.getSenders().forEach((e=>{e.track&&A.getTracks().includes(e.track)&&this.removeTrack(e)}))})}function Tn(A){A.DataChannel&&!A.RTCDataChannel&&(A.RTCDataChannel=A.DataChannel)}function Sn(A){if("object"!=typeof A||!A.RTCPeerConnection)return;const e=A.RTCPeerConnection.prototype.addTransceiver;e&&(A.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let A=arguments[1]&&arguments[1].sendEncodings;void 0===A&&(A=[]),A=[...A];const t=A.length>0;t&&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 n=e.apply(this,arguments);if(t){const{sender:e}=n,t=e.getParameters();(!("encodings"in t)||1===t.encodings.length&&0===Object.keys(t.encodings[0]).length)&&(t.encodings=A,e.sendEncodings=A,this.setParametersPromises.push(e.setParameters(t).then((()=>{delete e.sendEncodings})).catch((()=>{delete e.sendEncodings}))))}return n})}function In(A){if("object"!=typeof A||!A.RTCRtpSender)return;const e=A.RTCRtpSender.prototype.getParameters;e&&(A.RTCRtpSender.prototype.getParameters=function(){const A=e.apply(this,arguments);return"encodings"in A||(A.encodings=[].concat(this.sendEncodings||[{}])),A})}function Pn(A){if("object"!=typeof A||!A.RTCPeerConnection)return;const e=A.RTCPeerConnection.prototype.createOffer;A.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 Hn(A){if("object"!=typeof A||!A.RTCPeerConnection)return;const e=A.RTCPeerConnection.prototype.createAnswer;A.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 Rn=Object.freeze({__proto__:null,shimAddTransceiver:Sn,shimCreateAnswer:Hn,shimCreateOffer:Pn,shimGetDisplayMedia:function(A,e){A.navigator.mediaDevices&&"getDisplayMedia"in A.navigator.mediaDevices||A.navigator.mediaDevices&&(A.navigator.mediaDevices.getDisplayMedia=function(t){if(!t||!t.video){const A=new DOMException("getDisplayMedia without video constraints is undefined");return A.name="NotFoundError",A.code=8,Promise.reject(A)}return!0===t.video?t.video={mediaSource:e}:t.video.mediaSource=e,A.navigator.mediaDevices.getUserMedia(t)})},shimGetParameters:In,shimGetUserMedia:bn,shimOnTrack:Qn,shimPeerConnection:Un,shimRTCDataChannel:Tn,shimReceiverGetStats:En,shimRemoveStream:Fn,shimSenderGetStats:kn});function Dn(A){if("object"==typeof A&&A.RTCPeerConnection){if("getLocalStreams"in A.RTCPeerConnection.prototype||(A.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in A.RTCPeerConnection.prototype)){const e=A.RTCPeerConnection.prototype.addTrack;A.RTCPeerConnection.prototype.addStream=function(A){this._localStreams||(this._localStreams=[]),this._localStreams.includes(A)||this._localStreams.push(A),A.getAudioTracks().forEach((t=>e.call(this,t,A))),A.getVideoTracks().forEach((t=>e.call(this,t,A)))},A.RTCPeerConnection.prototype.addTrack=function(A){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return n&&n.forEach((A=>{this._localStreams?this._localStreams.includes(A)||this._localStreams.push(A):this._localStreams=[A]})),e.apply(this,arguments)}}"removeStream"in A.RTCPeerConnection.prototype||(A.RTCPeerConnection.prototype.removeStream=function(A){this._localStreams||(this._localStreams=[]);const e=this._localStreams.indexOf(A);if(-1===e)return;this._localStreams.splice(e,1);const t=A.getTracks();this.getSenders().forEach((A=>{t.includes(A.track)&&this.removeTrack(A)}))})}}function xn(A){if("object"==typeof A&&A.RTCPeerConnection&&("getRemoteStreams"in A.RTCPeerConnection.prototype||(A.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in A.RTCPeerConnection.prototype))){Object.defineProperty(A.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=A=>{A.streams.forEach((A=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(A))return;this._remoteStreams.push(A);const e=new Event("addstream");e.stream=A,this.dispatchEvent(e)}))})}});const e=A.RTCPeerConnection.prototype.setRemoteDescription;A.RTCPeerConnection.prototype.setRemoteDescription=function(){const A=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(e){e.streams.forEach((e=>{if(A._remoteStreams||(A._remoteStreams=[]),A._remoteStreams.indexOf(e)>=0)return;A._remoteStreams.push(e);const t=new Event("addstream");t.stream=e,A.dispatchEvent(t)}))}),e.apply(A,arguments)}}}function Ln(A){if("object"!=typeof A||!A.RTCPeerConnection)return;const e=A.RTCPeerConnection.prototype,t=e.createOffer,n=e.createAnswer,i=e.setLocalDescription,r=e.setRemoteDescription,s=e.addIceCandidate;e.createOffer=function(A,e){const n=arguments.length>=2?arguments[2]:arguments[0],i=t.apply(this,[n]);return e?(i.then(A,e),Promise.resolve()):i},e.createAnswer=function(A,e){const t=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[t]);return e?(i.then(A,e),Promise.resolve()):i};let o=function(A,e,t){const n=i.apply(this,[A]);return t?(n.then(e,t),Promise.resolve()):n};e.setLocalDescription=o,o=function(A,e,t){const n=r.apply(this,[A]);return t?(n.then(e,t),Promise.resolve()):n},e.setRemoteDescription=o,o=function(A,e,t){const n=s.apply(this,[A]);return t?(n.then(e,t),Promise.resolve()):n},e.addIceCandidate=o}function On(A){const e=A&&A.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){const A=e.mediaDevices,t=A.getUserMedia.bind(A);e.mediaDevices.getUserMedia=A=>t(Mn(A))}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=function(A,t,n){e.mediaDevices.getUserMedia(A).then(t,n)}.bind(e))}function Mn(A){return A&&void 0!==A.video?Object.assign({},A,{video:cn(A.video)}):A}function Nn(A){if(!A.RTCPeerConnection)return;const e=A.RTCPeerConnection;A.RTCPeerConnection=function(A,t){if(A&&A.iceServers){const e=[];for(let t=0;t<A.iceServers.length;t++){let n=A.iceServers[t];void 0===n.urls&&n.url?(on("RTCIceServer.url","RTCIceServer.urls"),n=JSON.parse(JSON.stringify(n)),n.urls=n.url,delete n.url,e.push(n)):e.push(A.iceServers[t])}A.iceServers=e}return new e(A,t)},A.RTCPeerConnection.prototype=e.prototype,"generateCertificate"in e&&Object.defineProperty(A.RTCPeerConnection,"generateCertificate",{get:()=>e.generateCertificate})}function Kn(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 _n(A){const e=A.RTCPeerConnection.prototype.createOffer;A.RTCPeerConnection.prototype.createOffer=function(A){if(A){void 0!==A.offerToReceiveAudio&&(A.offerToReceiveAudio=!!A.offerToReceiveAudio);const e=this.getTransceivers().find((A=>"audio"===A.receiver.track.kind));!1===A.offerToReceiveAudio&&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.offerToReceiveAudio||e||this.addTransceiver("audio",{direction:"recvonly"}),void 0!==A.offerToReceiveVideo&&(A.offerToReceiveVideo=!!A.offerToReceiveVideo);const t=this.getTransceivers().find((A=>"video"===A.receiver.track.kind));!1===A.offerToReceiveVideo&&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.offerToReceiveVideo||t||this.addTransceiver("video",{direction:"recvonly"})}return e.apply(this,arguments)}}function Vn(A){"object"!=typeof A||A.AudioContext||(A.AudioContext=A.webkitAudioContext)}var Gn,jn=Object.freeze({__proto__:null,shimAudioContext:Vn,shimCallbacksAPI:Ln,shimConstraints:Mn,shimCreateOfferLegacy:_n,shimGetUserMedia:On,shimLocalStreamsAPI:Dn,shimRTCIceServerUrls:Nn,shimRemoteStreamsAPI:xn,shimTrackEventTransceiver:Kn}),Jn={exports:{}},Wn=(Gn||(Gn=1,function(A){const e={generateIdentifier:function(){return Math.random().toString(36).substring(2,12)}};e.localCName=e.generateIdentifier(),e.splitLines=function(A){return A.trim().split("\n").map((A=>A.trim()))},e.splitSections=function(A){return A.split("\nm=").map(((A,e)=>(e>0?"m="+A:A).trim()+"\r\n"))},e.getDescription=function(A){const t=e.splitSections(A);return t&&t[0]},e.getMediaSections=function(A){const t=e.splitSections(A);return t.shift(),t},e.matchPrefix=function(A,t){return e.splitLines(A).filter((A=>0===A.indexOf(t)))},e.parseCandidate=function(A){let e;e=0===A.indexOf("a=candidate:")?A.substring(12).split(" "):A.substring(10).split(" ");const t={foundation:e[0],component:{1:"rtp",2:"rtcp"}[e[1]]||e[1],protocol:e[2].toLowerCase(),priority:parseInt(e[3],10),ip:e[4],address:e[4],port:parseInt(e[5],10),type:e[7]};for(let n=8;n<e.length;n+=2)switch(e[n]){case"raddr":t.relatedAddress=e[n+1];break;case"rport":t.relatedPort=parseInt(e[n+1],10);break;case"tcptype":t.tcpType=e[n+1];break;case"ufrag":t.ufrag=e[n+1],t.usernameFragment=e[n+1];break;default:void 0===t[e[n]]&&(t[e[n]]=e[n+1])}return t},e.writeCandidate=function(A){const e=[];e.push(A.foundation);const t=A.component;"rtp"===t?e.push(1):"rtcp"===t?e.push(2):e.push(t),e.push(A.protocol.toUpperCase()),e.push(A.priority),e.push(A.address||A.ip),e.push(A.port);const n=A.type;return e.push("typ"),e.push(n),"host"!==n&&A.relatedAddress&&A.relatedPort&&(e.push("raddr"),e.push(A.relatedAddress),e.push("rport"),e.push(A.relatedPort)),A.tcpType&&"tcp"===A.protocol.toLowerCase()&&(e.push("tcptype"),e.push(A.tcpType)),(A.usernameFragment||A.ufrag)&&(e.push("ufrag"),e.push(A.usernameFragment||A.ufrag)),"candidate:"+e.join(" ")},e.parseIceOptions=function(A){return A.substring(14).split(" ")},e.parseRtpMap=function(A){let e=A.substring(9).split(" ");const t={payloadType:parseInt(e.shift(),10)};return e=e[0].split("/"),t.name=e[0],t.clockRate=parseInt(e[1],10),t.channels=3===e.length?parseInt(e[2],10):1,t.numChannels=t.channels,t},e.writeRtpMap=function(A){let e=A.payloadType;void 0!==A.preferredPayloadType&&(e=A.preferredPayloadType);const t=A.channels||A.numChannels||1;return"a=rtpmap:"+e+" "+A.name+"/"+A.clockRate+(1!==t?"/"+t:"")+"\r\n"},e.parseExtmap=function(A){const e=A.substring(9).split(" ");return{id:parseInt(e[0],10),direction:e[0].indexOf("/")>0?e[0].split("/")[1]:"sendrecv",uri:e[1],attributes:e.slice(2).join(" ")}},e.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"},e.parseFmtp=function(A){const e={};let t;const n=A.substring(A.indexOf(" ")+1).split(";");for(let i=0;i<n.length;i++)t=n[i].trim().split("="),e[t[0].trim()]=t[1];return e},e.writeFmtp=function(A){let e="",t=A.payloadType;if(void 0!==A.preferredPayloadType&&(t=A.preferredPayloadType),A.parameters&&Object.keys(A.parameters).length){const n=[];Object.keys(A.parameters).forEach((e=>{void 0!==A.parameters[e]?n.push(e+"="+A.parameters[e]):n.push(e)})),e+="a=fmtp:"+t+" "+n.join(";")+"\r\n"}return e},e.parseRtcpFb=function(A){const e=A.substring(A.indexOf(" ")+1).split(" ");return{type:e.shift(),parameter:e.join(" ")}},e.writeRtcpFb=function(A){let e="",t=A.payloadType;return void 0!==A.preferredPayloadType&&(t=A.preferredPayloadType),A.rtcpFeedback&&A.rtcpFeedback.length&&A.rtcpFeedback.forEach((A=>{e+="a=rtcp-fb:"+t+" "+A.type+(A.parameter&&A.parameter.length?" "+A.parameter:"")+"\r\n"})),e},e.parseSsrcMedia=function(A){const e=A.indexOf(" "),t={ssrc:parseInt(A.substring(7,e),10)},n=A.indexOf(":",e);return n>-1?(t.attribute=A.substring(e+1,n),t.value=A.substring(n+1)):t.attribute=A.substring(e+1),t},e.parseSsrcGroup=function(A){const e=A.substring(13).split(" ");return{semantics:e.shift(),ssrcs:e.map((A=>parseInt(A,10)))}},e.getMid=function(A){const t=e.matchPrefix(A,"a=mid:")[0];if(t)return t.substring(6)},e.parseFingerprint=function(A){const e=A.substring(14).split(" ");return{algorithm:e[0].toLowerCase(),value:e[1].toUpperCase()}},e.getDtlsParameters=function(A,t){return{role:"auto",fingerprints:e.matchPrefix(A+t,"a=fingerprint:").map(e.parseFingerprint)}},e.writeDtlsParameters=function(A,e){let t="a=setup:"+e+"\r\n";return A.fingerprints.forEach((A=>{t+="a=fingerprint:"+A.algorithm+" "+A.value+"\r\n"})),t},e.parseCryptoLine=function(A){const e=A.substring(9).split(" ");return{tag:parseInt(e[0],10),cryptoSuite:e[1],keyParams:e[2],sessionParams:e.slice(3)}},e.writeCryptoLine=function(A){return"a=crypto:"+A.tag+" "+A.cryptoSuite+" "+("object"==typeof A.keyParams?e.writeCryptoKeyParams(A.keyParams):A.keyParams)+(A.sessionParams?" "+A.sessionParams.join(" "):"")+"\r\n"},e.parseCryptoKeyParams=function(A){if(0!==A.indexOf("inline:"))return null;const e=A.substring(7).split("|");return{keyMethod:"inline",keySalt:e[0],lifeTime:e[1],mkiValue:e[2]?e[2].split(":")[0]:void 0,mkiLength:e[2]?e[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,t){return e.matchPrefix(A+t,"a=crypto:").map(e.parseCryptoLine)},e.getIceParameters=function(A,t){const n=e.matchPrefix(A+t,"a=ice-ufrag:")[0],i=e.matchPrefix(A+t,"a=ice-pwd:")[0];return n&&i?{usernameFragment:n.substring(12),password:i.substring(10)}:null},e.writeIceParameters=function(A){let e="a=ice-ufrag:"+A.usernameFragment+"\r\na=ice-pwd:"+A.password+"\r\n";return A.iceLite&&(e+="a=ice-lite\r\n"),e},e.parseRtpParameters=function(A){const t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=e.splitLines(A)[0].split(" ");t.profile=n[2];for(let r=3;r<n.length;r++){const i=n[r],s=e.matchPrefix(A,"a=rtpmap:"+i+" ")[0];if(s){const n=e.parseRtpMap(s),r=e.matchPrefix(A,"a=fmtp:"+i+" ");switch(n.parameters=r.length?e.parseFmtp(r[0]):{},n.rtcpFeedback=e.matchPrefix(A,"a=rtcp-fb:"+i+" ").map(e.parseRtcpFb),t.codecs.push(n),n.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(n.name.toUpperCase())}}}e.matchPrefix(A,"a=extmap:").forEach((A=>{t.headerExtensions.push(e.parseExtmap(A))}));const i=e.matchPrefix(A,"a=rtcp-fb:* ").map(e.parseRtcpFb);return t.codecs.forEach((A=>{i.forEach((e=>{A.rtcpFeedback.find((A=>A.type===e.type&&A.parameter===e.parameter))||A.rtcpFeedback.push(e)}))})),t},e.writeRtpDescription=function(A,t){let n="";n+="m="+A+" ",n+=t.codecs.length>0?"9":"0",n+=" "+(t.profile||"UDP/TLS/RTP/SAVPF")+" ",n+=t.codecs.map((A=>void 0!==A.preferredPayloadType?A.preferredPayloadType:A.payloadType)).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach((A=>{n+=e.writeRtpMap(A),n+=e.writeFmtp(A),n+=e.writeRtcpFb(A)}));let i=0;return t.codecs.forEach((A=>{A.maxptime>i&&(i=A.maxptime)})),i>0&&(n+="a=maxptime:"+i+"\r\n"),t.headerExtensions&&t.headerExtensions.forEach((A=>{n+=e.writeExtmap(A)})),n},e.parseRtpEncodingParameters=function(A){const t=[],n=e.parseRtpParameters(A),i=-1!==n.fecMechanisms.indexOf("RED"),r=-1!==n.fecMechanisms.indexOf("ULPFEC"),s=e.matchPrefix(A,"a=ssrc:").map((A=>e.parseSsrcMedia(A))).filter((A=>"cname"===A.attribute)),o=s.length>0&&s[0].ssrc;let a;const c=e.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]),n.codecs.forEach((A=>{if("RTX"===A.name.toUpperCase()&&A.parameters.apt){let e={ssrc:o,codecPayloadType:parseInt(A.parameters.apt,10)};o&&a&&(e.rtx={ssrc:a}),t.push(e),i&&(e=JSON.parse(JSON.stringify(e)),e.fec={ssrc:o,mechanism:r?"red+ulpfec":"red"},t.push(e))}})),0===t.length&&o&&t.push({ssrc:o});let d=e.matchPrefix(A,"b=");return d.length&&(d=0===d[0].indexOf("b=TIAS:")?parseInt(d[0].substring(7),10):0===d[0].indexOf("b=AS:")?1e3*parseInt(d[0].substring(5),10)*.95-16e3:void 0,t.forEach((A=>{A.maxBitrate=d}))),t},e.parseRtcpParameters=function(A){const t={},n=e.matchPrefix(A,"a=ssrc:").map((A=>e.parseSsrcMedia(A))).filter((A=>"cname"===A.attribute))[0];n&&(t.cname=n.value,t.ssrc=n.ssrc);const i=e.matchPrefix(A,"a=rtcp-rsize");t.reducedSize=i.length>0,t.compound=0===i.length;const r=e.matchPrefix(A,"a=rtcp-mux");return t.mux=r.length>0,t},e.writeRtcpParameters=function(A){let e="";return A.reducedSize&&(e+="a=rtcp-rsize\r\n"),A.mux&&(e+="a=rtcp-mux\r\n"),void 0!==A.ssrc&&A.cname&&(e+="a=ssrc:"+A.ssrc+" cname:"+A.cname+"\r\n"),e},e.parseMsid=function(A){let t;const n=e.matchPrefix(A,"a=msid:");if(1===n.length)return t=n[0].substring(7).split(" "),{stream:t[0],track:t[1]};const i=e.matchPrefix(A,"a=ssrc:").map((A=>e.parseSsrcMedia(A))).filter((A=>"msid"===A.attribute));return i.length>0?(t=i[0].value.split(" "),{stream:t[0],track:t[1]}):void 0},e.parseSctpDescription=function(A){const t=e.parseMLine(A),n=e.matchPrefix(A,"a=max-message-size:");let i;n.length>0&&(i=parseInt(n[0].substring(19),10)),isNaN(i)&&(i=65536);const r=e.matchPrefix(A,"a=sctp-port:");if(r.length>0)return{port:parseInt(r[0].substring(12),10),protocol:t.fmt,maxMessageSize:i};const s=e.matchPrefix(A,"a=sctpmap:");if(s.length>0){const A=s[0].substring(10).split(" ");return{port:parseInt(A[0],10),protocol:A[1],maxMessageSize:i}}},e.writeSctpDescription=function(A,e){let t=[];return t="DTLS/SCTP"!==A.protocol?["m="+A.kind+" 9 "+A.protocol+" "+e.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+e.port+"\r\n"]:["m="+A.kind+" 9 "+A.protocol+" "+e.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+e.port+" "+e.protocol+" 65535\r\n"],void 0!==e.maxMessageSize&&t.push("a=max-message-size:"+e.maxMessageSize+"\r\n"),t.join("")},e.generateSessionId=function(){return Math.random().toString().substr(2,22)},e.writeSessionBoilerplate=function(A,t,n){let i;const r=void 0!==t?t:2;return i=A||e.generateSessionId(),"v=0\r\no="+(n||"thisisadapterortc")+" "+i+" "+r+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},e.getDirection=function(A,t){const n=e.splitLines(A);for(let e=0;e<n.length;e++)switch(n[e]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[e].substring(2)}return t?e.getDirection(t):"sendrecv"},e.getKind=function(A){return e.splitLines(A)[0].split(" ")[0].substring(2)},e.isRejected=function(A){return"0"===A.split(" ",2)[1]},e.parseMLine=function(A){const t=e.splitLines(A)[0].substring(2).split(" ");return{kind:t[0],port:parseInt(t[1],10),protocol:t[2],fmt:t.slice(3).join(" ")}},e.parseOLine=function(A){const t=e.matchPrefix(A,"o=")[0].substring(2).split(" ");return{username:t[0],sessionId:t[1],sessionVersion:parseInt(t[2],10),netType:t[3],addressType:t[4],address:t[5]}},e.isValidSDP=function(A){if("string"!=typeof A||0===A.length)return!1;const t=e.splitLines(A);for(let e=0;e<t.length;e++)if(t[e].length<2||"="!==t[e].charAt(1))return!1;return!0},A.exports=e}(Jn)),Jn.exports),Xn=Pt(Wn),Yn=r({__proto__:null,default:Xn},[Wn]);function qn(A){if(!A.RTCIceCandidate||A.RTCIceCandidate&&"foundation"in A.RTCIceCandidate.prototype)return;const e=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 t=new e(A),n=Xn.parseCandidate(A.candidate);for(const A in n)A in t||Object.defineProperty(t,A,{value:n[A]});return t.toJSON=function(){return{candidate:t.candidate,sdpMid:t.sdpMid,sdpMLineIndex:t.sdpMLineIndex,usernameFragment:t.usernameFragment}},t}return new e(A)},A.RTCIceCandidate.prototype=e.prototype,tn(A,"icecandidate",(e=>(e.candidate&&Object.defineProperty(e,"candidate",{value:new A.RTCIceCandidate(e.candidate),writable:"false"}),e)))}function $n(A){!A.RTCIceCandidate||A.RTCIceCandidate&&"relayProtocol"in A.RTCIceCandidate.prototype||tn(A,"icecandidate",(A=>{if(A.candidate){const e=Xn.parseCandidate(A.candidate.candidate);"relay"===e.type&&(A.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[e.priority>>24])}return A}))}function Zn(A,e){if(!A.RTCPeerConnection)return;"sctp"in A.RTCPeerConnection.prototype||Object.defineProperty(A.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const t=A.RTCPeerConnection.prototype.setRemoteDescription;A.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===e.browser&&e.version>=76){const{sdpSemantics:A}=this.getConfiguration();"plan-b"===A&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(function(A){if(!A||!A.sdp)return!1;const e=Xn.splitSections(A.sdp);return e.shift(),e.some((A=>{const e=Xn.parseMLine(A);return e&&"application"===e.kind&&-1!==e.protocol.indexOf("SCTP")}))}(arguments[0])){const A=function(A){const e=A.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===e||e.length<2)return-1;const t=parseInt(e[1],10);return t!=t?-1:t}(arguments[0]),t=function(A){let t=65536;return"firefox"===e.browser&&(t=e.version<57?-1===A?16384:2147483637:e.version<60?57===e.version?65535:65536:2147483637),t}(A),n=function(A,t){let n=65536;"firefox"===e.browser&&57===e.version&&(n=65535);const i=Xn.matchPrefix(A.sdp,"a=max-message-size:");return i.length>0?n=parseInt(i[0].substring(19),10):"firefox"===e.browser&&-1!==t&&(n=2147483637),n}(arguments[0],A);let i;i=0===t&&0===n?Number.POSITIVE_INFINITY:0===t||0===n?Math.max(t,n):Math.min(t,n);const r={};Object.defineProperty(r,"maxMessageSize",{get:()=>i}),this._sctp=r}return t.apply(this,arguments)}}function zn(A){if(!A.RTCPeerConnection||!("createDataChannel"in A.RTCPeerConnection.prototype))return;function e(A,e){const t=A.send;A.send=function(){const n=arguments[0],i=n.length||n.size||n.byteLength;if("open"===A.readyState&&e.sctp&&i>e.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+e.sctp.maxMessageSize+" bytes)");return t.apply(A,arguments)}}const t=A.RTCPeerConnection.prototype.createDataChannel;A.RTCPeerConnection.prototype.createDataChannel=function(){const A=t.apply(this,arguments);return e(A,this),A},tn(A,"datachannel",(A=>(e(A.channel,A.target),A)))}function Ai(A){if(!A.RTCPeerConnection||"connectionState"in A.RTCPeerConnection.prototype)return;const e=A.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 t=e[A];e[A]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=A=>{const e=A.target;if(e._lastConnectionState!==e.connectionState){e._lastConnectionState=e.connectionState;const t=new Event("connectionstatechange",A);e.dispatchEvent(t)}return A},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),t.apply(this,arguments)}}))}function ei(A,e){if(!A.RTCPeerConnection)return;if("chrome"===e.browser&&e.version>=71)return;if("safari"===e.browser&&e.version>=605)return;const t=A.RTCPeerConnection.prototype.setRemoteDescription;A.RTCPeerConnection.prototype.setRemoteDescription=function(e){if(e&&e.sdp&&-1!==e.sdp.indexOf("\na=extmap-allow-mixed")){const t=e.sdp.split("\n").filter((A=>"a=extmap-allow-mixed"!==A.trim())).join("\n");A.RTCSessionDescription&&e instanceof A.RTCSessionDescription?arguments[0]=new A.RTCSessionDescription({type:e.type,sdp:t}):e.sdp=t}return t.apply(this,arguments)}}function ti(A,e){if(!A.RTCPeerConnection||!A.RTCPeerConnection.prototype)return;const t=A.RTCPeerConnection.prototype.addIceCandidate;t&&0!==t.length&&(A.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===e.browser&&e.version<78||"firefox"===e.browser&&e.version<68||"safari"===e.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():t.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function ni(A,e){if(!A.RTCPeerConnection||!A.RTCPeerConnection.prototype)return;const t=A.RTCPeerConnection.prototype.setLocalDescription;t&&0!==t.length&&(A.RTCPeerConnection.prototype.setLocalDescription=function(){let A=arguments[0]||{};if("object"!=typeof A||A.type&&A.sdp)return t.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?t.apply(this,[A]):("offer"===A.type?this.createOffer:this.createAnswer).apply(this).then((A=>t.apply(this,[A])))})}var ii=Object.freeze({__proto__:null,removeExtmapAllowMixed:ei,shimAddIceCandidateNullOrEmpty:ti,shimConnectionState:Ai,shimMaxMessageSize:Zn,shimParameterlessSetLocalDescription:ni,shimRTCIceCandidate:qn,shimRTCIceCandidateRelayProtocol:$n,shimSendThrowTypeError:zn});!function(){let{window:A}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimSafari:!0};const t=sn,n=function(A){const e={browser:null,version:null};if(void 0===A||!A.navigator||!A.navigator.userAgent)return e.browser="Not a browser.",e;const{navigator:t}=A;if(t.userAgentData&&t.userAgentData.brands){const A=t.userAgentData.brands.find((A=>"Chromium"===A.brand));if(A)return{browser:"chrome",version:parseInt(A.version,10)}}if(t.mozGetUserMedia)e.browser="firefox",e.version=en(t.userAgent,/Firefox\/(\d+)\./,1);else if(t.webkitGetUserMedia||!1===A.isSecureContext&&A.webkitRTCPeerConnection)e.browser="chrome",e.version=en(t.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!A.RTCPeerConnection||!t.userAgent.match(/AppleWebKit\/(\d+)\./))return e.browser="Not a supported browser.",e;e.browser="safari",e.version=en(t.userAgent,/AppleWebKit\/(\d+)\./,1),e.supportsUnifiedPlan=A.RTCRtpTransceiver&&"currentDirection"in A.RTCRtpTransceiver.prototype}return e}(A),i={browserDetails:n,commonShim:ii,extractVersion:en,disableLog:nn,disableWarnings:rn,sdp:Yn};switch(n.browser){case"chrome":if(!yn||!vn||!e.shimChrome)return t("Chrome shim is not included in this adapter release."),i;if(null===n.version)return t("Chrome shim can not determine version, not shimming."),i;t("adapter.js shimming chrome."),i.browserShim=yn,ti(A,n),ni(A),hn(A,n),gn(A),vn(A,n),pn(A),wn(A,n),mn(A),fn(A),Cn(A,n),qn(A),$n(A),Ai(A),Zn(A,n),zn(A),ei(A,n);break;case"firefox":if(!Rn||!Un||!e.shimFirefox)return t("Firefox shim is not included in this adapter release."),i;t("adapter.js shimming firefox."),i.browserShim=Rn,ti(A,n),ni(A),bn(A,n),Un(A,n),Qn(A),Fn(A),kn(A),En(A),Tn(A),Sn(A),In(A),Pn(A),Hn(A),qn(A),Ai(A),Zn(A,n),zn(A);break;case"safari":if(!jn||!e.shimSafari)return t("Safari shim is not included in this adapter release."),i;t("adapter.js shimming safari."),i.browserShim=jn,ti(A,n),ni(A),Nn(A),_n(A),Ln(A),Dn(A),xn(A),Kn(A),On(A),Vn(A),qn(A),$n(A),Zn(A,n),zn(A),ei(A,n);break;default:t("Unsupported browser!")}}({window:"undefined"==typeof window?void 0:window});const ri="lk_e2ee";var si,oi,ai,ci,di,li,ui,hi,gi,pi,mi,fi,Bi,wi,vi,Ci,yi,bi,Qi,Ui;function ki(){return void 0!==window.RTCRtpScriptTransform}(oi=si||(si={})).SetKey="setKey",oi.RatchetRequest="ratchetRequest",oi.KeyRatcheted="keyRatcheted",(ai||(ai={})).KeyRatcheted="keyRatcheted",(di=ci||(ci={})).ParticipantEncryptionStatusChanged="participantEncryptionStatusChanged",di.EncryptionError="encryptionError",(li||(li={})).Error="cryptorError",Zt.EventEmitter;class Ei extends Error{constructor(A,e){super(e||"an error has occured"),this.name="LiveKitError",this.code=A}}(hi=ui||(ui={}))[hi.NotAllowed=0]="NotAllowed",hi[hi.ServerUnreachable=1]="ServerUnreachable",hi[hi.InternalError=2]="InternalError",hi[hi.Cancelled=3]="Cancelled",hi[hi.LeaveRequest=4]="LeaveRequest";class Fi extends Ei{constructor(A,e,t,n){super(1,A),this.name="ConnectionError",this.status=t,this.reason=e,this.context=n,this.reasonName=ui[e]}}class Ti extends Ei{constructor(A){super(21,null!=A?A:"device is unsupported"),this.name="DeviceUnsupportedError"}}class Si extends Ei{constructor(A){super(20,null!=A?A:"track is invalid"),this.name="TrackInvalidError"}}class Ii extends Ei{constructor(A){super(10,null!=A?A:"unsupported server"),this.name="UnsupportedServer"}}class Pi extends Ei{constructor(A){super(12,null!=A?A:"unexpected connection state"),this.name="UnexpectedConnectionState"}}class Hi extends Ei{constructor(A){super(13,null!=A?A:"unable to negotiate"),this.name="NegotiationError"}}class Ri extends Ei{constructor(A,e){super(15,A),this.name="PublishTrackError",this.status=e}}class Di extends Ei{constructor(A,e){super(15,A),this.reason=e,this.reasonName="string"==typeof e?e:St[e]}}(pi=gi||(gi={})).PermissionDenied="PermissionDenied",pi.NotFound="NotFound",pi.DeviceInUse="DeviceInUse",pi.Other="Other",function(A){A.getFailure=function(e){if(e&&"name"in e)return"NotFoundError"===e.name||"DevicesNotFoundError"===e.name?A.NotFound:"NotAllowedError"===e.name||"PermissionDeniedError"===e.name?A.PermissionDenied:"NotReadableError"===e.name||"TrackStartError"===e.name?A.DeviceInUse:A.Other}}(gi||(gi={})),(fi=mi||(mi={}))[fi.InvalidKey=0]="InvalidKey",fi[fi.MissingKey=1]="MissingKey",fi[fi.InternalError=2]="InternalError",(wi=Bi||(Bi={})).Connected="connected",wi.Reconnecting="reconnecting",wi.SignalReconnecting="signalReconnecting",wi.Reconnected="reconnected",wi.Disconnected="disconnected",wi.ConnectionStateChanged="connectionStateChanged",wi.Moved="moved",wi.MediaDevicesChanged="mediaDevicesChanged",wi.ParticipantConnected="participantConnected",wi.ParticipantDisconnected="participantDisconnected",wi.TrackPublished="trackPublished",wi.TrackSubscribed="trackSubscribed",wi.TrackSubscriptionFailed="trackSubscriptionFailed",wi.TrackUnpublished="trackUnpublished",wi.TrackUnsubscribed="trackUnsubscribed",wi.TrackMuted="trackMuted",wi.TrackUnmuted="trackUnmuted",wi.LocalTrackPublished="localTrackPublished",wi.LocalTrackUnpublished="localTrackUnpublished",wi.LocalAudioSilenceDetected="localAudioSilenceDetected",wi.ActiveSpeakersChanged="activeSpeakersChanged",wi.ParticipantMetadataChanged="participantMetadataChanged",wi.ParticipantNameChanged="participantNameChanged",wi.ParticipantAttributesChanged="participantAttributesChanged",wi.ParticipantActive="participantActive",wi.RoomMetadataChanged="roomMetadataChanged",wi.DataReceived="dataReceived",wi.SipDTMFReceived="sipDTMFReceived",wi.TranscriptionReceived="transcriptionReceived",wi.ConnectionQualityChanged="connectionQualityChanged",wi.TrackStreamStateChanged="trackStreamStateChanged",wi.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",wi.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",wi.AudioPlaybackStatusChanged="audioPlaybackChanged",wi.VideoPlaybackStatusChanged="videoPlaybackChanged",wi.MediaDevicesError="mediaDevicesError",wi.ParticipantPermissionsChanged="participantPermissionsChanged",wi.SignalConnected="signalConnected",wi.RecordingStatusChanged="recordingStatusChanged",wi.ParticipantEncryptionStatusChanged="participantEncryptionStatusChanged",wi.EncryptionError="encryptionError",wi.DCBufferStatusChanged="dcBufferStatusChanged",wi.ActiveDeviceChanged="activeDeviceChanged",wi.ChatMessage="chatMessage",wi.LocalTrackSubscribed="localTrackSubscribed",wi.MetricsReceived="metricsReceived",(Ci=vi||(vi={})).TrackPublished="trackPublished",Ci.TrackSubscribed="trackSubscribed",Ci.TrackSubscriptionFailed="trackSubscriptionFailed",Ci.TrackUnpublished="trackUnpublished",Ci.TrackUnsubscribed="trackUnsubscribed",Ci.TrackMuted="trackMuted",Ci.TrackUnmuted="trackUnmuted",Ci.LocalTrackPublished="localTrackPublished",Ci.LocalTrackUnpublished="localTrackUnpublished",Ci.ParticipantMetadataChanged="participantMetadataChanged",Ci.ParticipantNameChanged="participantNameChanged",Ci.DataReceived="dataReceived",Ci.SipDTMFReceived="sipDTMFReceived",Ci.TranscriptionReceived="transcriptionReceived",Ci.IsSpeakingChanged="isSpeakingChanged",Ci.ConnectionQualityChanged="connectionQualityChanged",Ci.TrackStreamStateChanged="trackStreamStateChanged",Ci.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",Ci.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",Ci.MediaDevicesError="mediaDevicesError",Ci.AudioStreamAcquired="audioStreamAcquired",Ci.ParticipantPermissionsChanged="participantPermissionsChanged",Ci.PCTrackAdded="pcTrackAdded",Ci.AttributesChanged="attributesChanged",Ci.LocalTrackSubscribed="localTrackSubscribed",Ci.ChatMessage="chatMessage",Ci.Active="active",(bi=yi||(yi={})).TransportsCreated="transportsCreated",bi.Connected="connected",bi.Disconnected="disconnected",bi.Resuming="resuming",bi.Resumed="resumed",bi.Restarting="restarting",bi.Restarted="restarted",bi.SignalResumed="signalResumed",bi.SignalRestarted="signalRestarted",bi.Closing="closing",bi.MediaTrackAdded="mediaTrackAdded",bi.ActiveSpeakersUpdate="activeSpeakersUpdate",bi.DataPacketReceived="dataPacketReceived",bi.RTPVideoMapUpdate="rtpVideoMapUpdate",bi.DCBufferStatusChanged="dcBufferStatusChanged",bi.ParticipantUpdate="participantUpdate",bi.RoomUpdate="roomUpdate",bi.SpeakersChanged="speakersChanged",bi.StreamStateChanged="streamStateChanged",bi.ConnectionQualityUpdate="connectionQualityUpdate",bi.SubscriptionError="subscriptionError",bi.SubscriptionPermissionUpdate="subscriptionPermissionUpdate",bi.RemoteMute="remoteMute",bi.SubscribedQualityUpdate="subscribedQualityUpdate",bi.LocalTrackUnpublished="localTrackUnpublished",bi.LocalTrackSubscribed="localTrackSubscribed",bi.Offline="offline",bi.SignalRequestResponse="signalRequestResponse",bi.SignalConnected="signalConnected",bi.RoomMoved="roomMoved",(Ui=Qi||(Qi={})).Message="message",Ui.Muted="muted",Ui.Unmuted="unmuted",Ui.Restarted="restarted",Ui.Ended="ended",Ui.Subscribed="subscribed",Ui.Unsubscribed="unsubscribed",Ui.UpdateSettings="updateSettings",Ui.UpdateSubscription="updateSubscription",Ui.AudioPlaybackStarted="audioPlaybackStarted",Ui.AudioPlaybackFailed="audioPlaybackFailed",Ui.AudioSilenceDetected="audioSilenceDetected",Ui.VisibilityChanged="visibilityChanged",Ui.VideoDimensionsChanged="videoDimensionsChanged",Ui.VideoPlaybackStarted="videoPlaybackStarted",Ui.VideoPlaybackFailed="videoPlaybackFailed",Ui.ElementAttached="elementAttached",Ui.ElementDetached="elementDetached",Ui.UpstreamPaused="upstreamPaused",Ui.UpstreamResumed="upstreamResumed",Ui.SubscriptionPermissionChanged="subscriptionPermissionChanged",Ui.SubscriptionStatusChanged="subscriptionStatusChanged",Ui.SubscriptionFailed="subscriptionFailed",Ui.TrackProcessorUpdate="trackProcessorUpdate",Ui.AudioTrackFeatureUpdate="audioTrackFeatureUpdate",Ui.TranscriptionReceived="transcriptionReceived",Ui.TimeSyncUpdate="timeSyncUpdate";const xi=/version\/(\d+(\.?_?\d+)+)/i;let Li;function Oi(A){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(void 0===A&&"undefined"==typeof navigator)return;const t=(null!=A?A:navigator.userAgent).toLowerCase();if(void 0===Li||e){const A=Mi.find((A=>{let{test:e}=A;return e.test(t)}));Li=null==A?void 0:A.describe(t)}return Li}const Mi=[{test:/firefox|iceweasel|fxios/i,describe:A=>({name:"Firefox",version:Ni(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,A),os:A.toLowerCase().includes("fxios")?"iOS":void 0,osVersion:Ki(A)})},{test:/chrom|crios|crmo/i,describe:A=>({name:"Chrome",version:Ni(/(?:chrome|chromium|crios|crmo)\/(\d+(\.?_?\d+)+)/i,A),os:A.toLowerCase().includes("crios")?"iOS":void 0,osVersion:Ki(A)})},{test:/safari|applewebkit/i,describe:A=>({name:"Safari",version:Ni(xi,A),os:A.includes("mobile/")?"iOS":"macOS",osVersion:Ki(A)})}];function Ni(A,e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const n=e.match(A);return n&&n.length>=t&&n[t]||""}function Ki(A){return A.includes("mac os")?Ni(/\(.+?(\d+_\d+(:?_\d+)?)/,A,1).replace(/_/g,"."):void 0}class _i{}_i.setTimeout=function(){return setTimeout(...arguments)},_i.setInterval=function(){return setInterval(...arguments)},_i.clearTimeout=function(){return clearTimeout(...arguments)},_i.clearInterval=function(){return clearInterval(...arguments)};const Vi=[];var Gi,ji;(ji=Gi||(Gi={}))[ji.LOW=0]="LOW",ji[ji.MEDIUM=1]="MEDIUM",ji[ji.HIGH=2]="HIGH";class Ji extends Zt.EventEmitter{constructor(A,e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var n;super(),this.attachedElements=[],this.isMuted=!1,this.streamState=Ji.StreamState.Active,this.isInBackground=!1,this._currentBitrate=0,this.log=Vt,this.appVisibilityChangedListener=()=>{this.backgroundTimeout&&clearTimeout(this.backgroundTimeout),"hidden"===document.visibilityState?this.backgroundTimeout=setTimeout((()=>this.handleAppVisibilityChanged()),5e3):this.handleAppVisibilityChanged()},this.log=Gt(null!==(n=t.loggerName)&&void 0!==n?n:Mt.Track),this.loggerContextCb=t.loggerContextCb,this.setMaxListeners(100),this.kind=e,this._mediaStreamTrack=A,this._mediaStreamID=A.id,this.source=Ji.Source.Unknown}get logContext(){var A;return Object.assign(Object.assign({},null===(A=this.loggerContextCb)||void 0===A?void 0:A.call(this)),zr(this))}get currentBitrate(){return this._currentBitrate}get mediaStreamTrack(){return this._mediaStreamTrack}get mediaStreamID(){return this._mediaStreamID}attach(A){let e="audio";this.kind===Ji.Kind.Video&&(e="video"),0===this.attachedElements.length&&this.kind===Ji.Kind.Video&&this.addAppVisibilityListener(),A||("audio"===e&&(Vi.forEach((e=>{null!==e.parentElement||A||(A=e)})),A&&Vi.splice(Vi.indexOf(A),1)),A||(A=document.createElement(e))),this.attachedElements.includes(A)||this.attachedElements.push(A),Wi(this.mediaStreamTrack,A);const t=A.srcObject.getTracks(),n=t.some((A=>"audio"===A.kind));return A.play().then((()=>{this.emit(n?Qi.AudioPlaybackStarted:Qi.VideoPlaybackStarted)})).catch((e=>{"NotAllowedError"===e.name?this.emit(n?Qi.AudioPlaybackFailed:Qi.VideoPlaybackFailed,e):"AbortError"===e.name?Vt.debug("".concat(n?"audio":"video"," playback aborted, likely due to new play request")):Vt.warn("could not playback ".concat(n?"audio":"video"),e),n&&A&&t.some((A=>"video"===A.kind))&&"NotAllowedError"===e.name&&(A.muted=!0,A.play().catch((()=>{})))})),this.emit(Qi.ElementAttached,A),A}detach(A){try{if(A){Xi(this.mediaStreamTrack,A);const e=this.attachedElements.indexOf(A);return e>=0&&(this.attachedElements.splice(e,1),this.recycleElement(A),this.emit(Qi.ElementDetached,A)),A}const e=[];return this.attachedElements.forEach((A=>{Xi(this.mediaStreamTrack,A),e.push(A),this.recycleElement(A),this.emit(Qi.ElementDetached,A)})),this.attachedElements=[],e}finally{0===this.attachedElements.length&&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(A){A.loggerName&&(this.log=Gt(A.loggerName)),A.loggerContextCb&&(this.loggerContextCb=A.loggerContextCb)}recycleElement(A){if(A instanceof HTMLAudioElement){let e=!0;A.pause(),Vi.forEach((A=>{A.parentElement||(e=!1)})),e&&Vi.push(A)}}handleAppVisibilityChanged(){return Xt(this,void 0,void 0,(function*(){this.isInBackground="hidden"===document.visibilityState,this.isInBackground||this.kind!==Ji.Kind.Video||setTimeout((()=>this.attachedElements.forEach((A=>A.play().catch((()=>{}))))),0)}))}addAppVisibilityListener(){pr()?(this.isInBackground="hidden"===document.visibilityState,document.addEventListener("visibilitychange",this.appVisibilityChangedListener)):this.isInBackground=!1}removeAppVisibilityListener(){pr()&&document.removeEventListener("visibilitychange",this.appVisibilityChangedListener)}}function Wi(A,e){let t,n;t=e.srcObject instanceof MediaStream?e.srcObject:new MediaStream,n="audio"===A.kind?t.getAudioTracks():t.getVideoTracks(),n.includes(A)||(n.forEach((A=>{t.removeTrack(A)})),t.addTrack(A)),hr()&&e instanceof HTMLVideoElement||(e.autoplay=!0),e.muted=0===t.getAudioTracks().length,e instanceof HTMLVideoElement&&(e.playsInline=!0),e.srcObject!==t&&(e.srcObject=t,(hr()||ur())&&e instanceof HTMLVideoElement&&setTimeout((()=>{e.srcObject=t,e.play().catch((()=>{}))}),0))}function Xi(A,e){if(e.srcObject instanceof MediaStream){const t=e.srcObject;t.removeTrack(A),t.getTracks().length>0?e.srcObject=t:e.srcObject=null}}!function(A){let e;var t;let n;var i;let r;var s;(t=e=A.Kind||(A.Kind={})).Audio="audio",t.Video="video",t.Unknown="unknown",(i=n=A.Source||(A.Source={})).Camera="camera",i.Microphone="microphone",i.ScreenShare="screen_share",i.ScreenShareAudio="screen_share_audio",i.Unknown="unknown",(s=r=A.StreamState||(A.StreamState={})).Active="active",s.Paused="paused",s.Unknown="unknown",A.kindToProto=function(A){switch(A){case e.Audio:return GA.AUDIO;case e.Video:return GA.VIDEO;default:return GA.DATA}},A.kindFromProto=function(A){switch(A){case GA.AUDIO:return e.Audio;case GA.VIDEO:return e.Video;default:return e.Unknown}},A.sourceToProto=function(A){switch(A){case n.Camera:return jA.CAMERA;case n.Microphone:return jA.MICROPHONE;case n.ScreenShare:return jA.SCREEN_SHARE;case n.ScreenShareAudio:return jA.SCREEN_SHARE_AUDIO;default:return jA.UNKNOWN}},A.sourceFromProto=function(A){switch(A){case jA.CAMERA:return n.Camera;case jA.MICROPHONE:return n.Microphone;case jA.SCREEN_SHARE:return n.ScreenShare;case jA.SCREEN_SHARE_AUDIO:return n.ScreenShareAudio;default:return n.Unknown}},A.streamStateFromProto=function(A){switch(A){case Me.ACTIVE:return r.Active;case Me.PAUSED:return r.Paused;default:return r.Unknown}}}(Ji||(Ji={}));class Yi{constructor(A,e,t,n,i){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===e||void 0===t)throw new TypeError("Unsupported options: provide at least width, height and maxBitrate");this.width=A,this.height=e,this.aspectRatio=A/e,this.encoding={maxBitrate:t,maxFramerate:n,priority:i}}}get resolution(){return{width:this.width,height:this.height,frameRate:this.encoding.maxFramerate,aspectRatio:this.aspectRatio}}}const qi=["vp8","h264"],$i=["vp8","h264","vp9","av1"];function Zi(A){return!!qi.find((e=>e===A))}var zi,Ar,er,tr;(Ar=zi||(zi={}))[Ar.PREFER_REGRESSION=0]="PREFER_REGRESSION",Ar[Ar.SIMULCAST=1]="SIMULCAST",Ar[Ar.REGRESSION=2]="REGRESSION",(tr=er||(er={})).telephone={maxBitrate:12e3},tr.speech={maxBitrate:24e3},tr.music={maxBitrate:48e3},tr.musicStereo={maxBitrate:64e3},tr.musicHighQuality={maxBitrate:96e3},tr.musicHighQualityStereo={maxBitrate:128e3};const nr={h90:new Yi(160,90,9e4,20),h180:new Yi(320,180,16e4,20),h216:new Yi(384,216,18e4,20),h360:new Yi(640,360,45e4,20),h540:new Yi(960,540,8e5,25),h720:new Yi(1280,720,17e5,30),h1080:new Yi(1920,1080,3e6,30),h1440:new Yi(2560,1440,5e6,30),h2160:new Yi(3840,2160,8e6,30)},ir={h120:new Yi(160,120,7e4,20),h180:new Yi(240,180,125e3,20),h240:new Yi(320,240,14e4,20),h360:new Yi(480,360,33e4,20),h480:new Yi(640,480,5e5,20),h540:new Yi(720,540,6e5,25),h720:new Yi(960,720,13e5,30),h1080:new Yi(1440,1080,23e5,30),h1440:new Yi(1920,1440,38e5,30)},rr={h360fps3:new Yi(640,360,2e5,3,"medium"),h360fps15:new Yi(640,360,4e5,15,"medium"),h720fps5:new Yi(1280,720,8e5,5,"medium"),h720fps15:new Yi(1280,720,15e5,15,"medium"),h720fps30:new Yi(1280,720,2e6,30,"medium"),h1080fps15:new Yi(1920,1080,25e5,15,"medium"),h1080fps30:new Yi(1920,1080,5e6,30,"medium"),original:new Yi(0,0,7e6,30,"medium")},sr="https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension";function or(A){return Xt(this,void 0,void 0,(function*(){return new Promise((e=>_i.setTimeout(e,A)))}))}function ar(){return"addTransceiver"in RTCPeerConnection.prototype}function cr(){return"addTrack"in RTCPeerConnection.prototype}function dr(A){return"av1"===A||"vp9"===A}function lr(A){return!!document&&(A||(A=document.createElement("audio")),"setSinkId"in A)}function ur(){var A;return"Firefox"===(null===(A=Oi())||void 0===A?void 0:A.name)}function hr(){var A;return"Safari"===(null===(A=Oi())||void 0===A?void 0:A.name)}function gr(){var A,e;return!!pr()&&(null!==(e=null===(A=navigator.userAgentData)||void 0===A?void 0:A.mobile)&&void 0!==e?e:/Tablet|iPad|Mobile|Android|BlackBerry/.test(navigator.userAgent))}function pr(){return"undefined"!=typeof document}function mr(){return"ReactNative"==navigator.product}function fr(A){return A.hostname.endsWith(".livekit.cloud")||A.hostname.endsWith(".livekit.run")}function Br(){if(global&&global.LiveKitReactNativeGlobal)return global.LiveKitReactNativeGlobal}function wr(){if(!mr())return;let A=Br();return A?A.platform:void 0}function vr(){if(pr())return window.devicePixelRatio;if(mr()){let A=Br();if(A)return A.devicePixelRatio}return 1}function Cr(A,e){const t=A.split("."),n=e.split("."),i=Math.min(t.length,n.length);for(let r=0;r<i;++r){const A=parseInt(t[r],10),e=parseInt(n[r],10);if(A>e)return 1;if(A<e)return-1;if(r===i-1&&A===e)return 0}return""===A&&""!==e?-1:""===e?1:t.length==n.length?0:t.length<n.length?-1:1}function yr(A){for(const e of A)e.target.handleResize(e)}function br(A){for(const e of A)e.target.handleVisibilityChanged(e)}let Qr=null;const Ur=()=>(Qr||(Qr=new ResizeObserver(yr)),Qr);let kr=null;const Er=()=>(kr||(kr=new IntersectionObserver(br,{root:null,rootMargin:"0px"})),kr);function Fr(){let A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=document.createElement("canvas");i.width=A,i.height=e;const r=i.getContext("2d");null==r||r.fillRect(0,0,i.width,i.height),n&&r&&(r.beginPath(),r.arc(A/2,e/2,50,0,2*Math.PI,!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=t,o}let Tr;function Sr(){if(!Tr){const A=new AudioContext,e=A.createOscillator(),t=A.createGain();t.gain.setValueAtTime(0,0);const n=A.createMediaStreamDestination();if(e.connect(t),t.connect(n),e.start(),[Tr]=n.stream.getAudioTracks(),!Tr)throw Error("Could not get empty media stream audio track");Tr.enabled=!1}return Tr.clone()}class Ir{constructor(A,e){this.onFinally=e,this.promise=new Promise(((e,t)=>Xt(this,void 0,void 0,(function*(){this.resolve=e,this.reject=t,A&&(yield A(e,t))})))).finally((()=>{var A;return null===(A=this.onFinally)||void 0===A?void 0:A.call(this)}))}}function Pr(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 Hr(A){return A.startsWith("ws")?A.replace(/^(ws)/,"http"):A}function Rr(A){switch(A.reason){case ui.LeaveRequest:return A.context;case ui.Cancelled:return YA.CLIENT_INITIATED;case ui.NotAllowed:return YA.USER_REJECTED;case ui.ServerUnreachable:return YA.JOIN_FAILURE;default:return YA.UNKNOWN_REASON}}function Dr(A){return void 0!==A?Number(A):void 0}function xr(A){return void 0!==A?BigInt(A):void 0}function Lr(A){return!!A&&!(A instanceof MediaStreamTrack)&&A.isLocal}function Or(A){return!!A&&A.kind==Ji.Kind.Audio}function Mr(A){return!!A&&A.kind==Ji.Kind.Video}function Nr(A){return Lr(A)&&Mr(A)}function Kr(A){return Lr(A)&&Or(A)}function _r(A){return!!A&&!A.isLocal}function Vr(A){return!!A&&!A.isLocal}function Gr(A){return _r(A)&&Mr(A)}function jr(A,e,t){var n,i,r,s;const{optionsWithoutProcessor:o,audioProcessor:a,videoProcessor:c}=As(null!=A?A:{}),d=null==e?void 0:e.processor,l=null==t?void 0:t.processor,u=null!=o?o:{};return!0===u.audio&&(u.audio={}),!0===u.video&&(u.video={}),u.audio&&(Jr(u.audio,e),null!==(n=(r=u.audio).deviceId)&&void 0!==n||(r.deviceId={ideal:"default"}),(a||d)&&(u.audio.processor=null!=a?a:d)),u.video&&(Jr(u.video,t),null!==(i=(s=u.video).deviceId)&&void 0!==i||(s.deviceId={ideal:"default"}),(c||l)&&(u.video.processor=null!=c?c:l)),u}function Jr(A,e){return Object.keys(e).forEach((t=>{void 0===A[t]&&(A[t]=e[t])})),A}function Wr(A){var e,t,n,i;const r={};if(A.video)if("object"==typeof A.video){const t={},i=t,s=A.video;Object.keys(s).forEach((A=>{"resolution"===A?Jr(i,s.resolution):i[A]=s[A]})),r.video=t,null!==(e=(n=r.video).deviceId)&&void 0!==e||(n.deviceId={ideal:"default"})}else r.video=!!A.video&&{deviceId:{ideal:"default"}};else r.video=!1;return A.audio?"object"==typeof A.audio?(r.audio=A.audio,null!==(t=(i=r.audio).deviceId)&&void 0!==t||(i.deviceId={ideal:"default"})):r.audio={deviceId:{ideal:"default"}}:r.audio=!1,r}function Xr(){var A;const e="undefined"!=typeof window&&(window.AudioContext||window.webkitAudioContext);if(e){const t=new e({latencyHint:"interactive"});if("suspended"===t.state&&"undefined"!=typeof window&&(null===(A=window.document)||void 0===A?void 0:A.body)){const A=()=>Xt(this,void 0,void 0,(function*(){var e;try{"suspended"===t.state&&(yield t.resume())}catch(n){console.warn("Error trying to auto-resume audio context",n)}null===(e=window.document.body)||void 0===e||e.removeEventListener("click",A)}));window.document.body.addEventListener("click",A)}return t}}function Yr(A){return"audioinput"===A?Ji.Source.Microphone:"videoinput"===A?Ji.Source.Camera:Ji.Source.Unknown}function qr(A){return A===Ji.Source.Microphone?"audioinput":A===Ji.Source.Camera?"videoinput":void 0}function $r(A){return A.split("/")[1].toLowerCase()}function Zr(A){const e=[];return A.forEach((A=>{void 0!==A.track&&e.push(new Ye({cid:A.track.mediaStreamID,track:A.trackInfo}))})),e}function zr(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?zr(A.track):{})}}function As(A){const e=Object.assign({},A);let t,n;return"object"==typeof e.audio&&e.audio.processor&&(t=e.audio.processor,e.audio=Object.assign(Object.assign({},e.audio),{processor:void 0})),"object"==typeof e.video&&e.video.processor&&(n=e.video.processor,e.video=Object.assign(Object.assign({},e.video),{processor:void 0})),{audioProcessor:t,videoProcessor:n,optionsWithoutProcessor:(i=e,void 0===i?i:"function"==typeof structuredClone?structuredClone(i):JSON.parse(JSON.stringify(i)))};var i}class es extends Zt.EventEmitter{constructor(A){super(),this.onWorkerMessage=A=>{var e,t;const{kind:n,data:i}=A.data;switch(n){case"error":Vt.error(i.error.message),this.emit(ci.EncryptionError,i.error);break;case"initAck":i.enabled&&this.keyProvider.getKeys().forEach((A=>{this.postKey(A)}));break;case"enable":if(i.enabled&&this.keyProvider.getKeys().forEach((A=>{this.postKey(A)})),this.encryptionEnabled!==i.enabled&&i.participantIdentity===(null===(e=this.room)||void 0===e?void 0:e.localParticipant.identity))this.emit(ci.ParticipantEncryptionStatusChanged,i.enabled,this.room.localParticipant),this.encryptionEnabled=i.enabled;else if(i.participantIdentity){const A=null===(t=this.room)||void 0===t?void 0:t.getParticipantByIdentity(i.participantIdentity);if(!A)throw TypeError("couldn't set encryption status, participant not found".concat(i.participantIdentity));this.emit(ci.ParticipantEncryptionStatusChanged,i.enabled,A)}break;case"ratchetKey":this.keyProvider.emit(si.KeyRatcheted,i.ratchetResult,i.participantIdentity,i.keyIndex)}},this.onWorkerError=A=>{Vt.error("e2ee worker encountered an error:",{error:A.error}),this.emit(ci.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||ki()))throw new Ti("tried to setup end-to-end encryption on an unsupported browser");if(Vt.info("setting up e2ee"),A!==this.room){this.room=A,this.setupEventListeners(A,this.keyProvider);const e={kind:"init",data:{keyProviderOptions:this.keyProvider.getOptions(),loglevel:jt.getLevel()}};this.worker&&(Vt.info("initializing worker",{worker:this.worker}),this.worker.onmessage=this.onWorkerMessage,this.worker.onerror=this.onWorkerError,this.worker.postMessage(e))}}setParticipantCryptorEnabled(A,e){Vt.debug("set e2ee to ".concat(A," for participant ").concat(e)),this.postEnable(A,e)}setSifTrailer(A){A&&0!==A.length?this.postSifTrailer(A):Vt.warn("ignoring server sent trailer as it's empty")}setupEngine(A){A.on(yi.RTPVideoMapUpdate,(A=>{this.postRTPMap(A)}))}setupEventListeners(A,e){A.on(Bi.TrackPublished,((A,e)=>this.setParticipantCryptorEnabled(A.trackInfo.encryption!==se.NONE,e.identity))),A.on(Bi.ConnectionStateChanged,(e=>{e===vo.Connected&&A.remoteParticipants.forEach((A=>{A.trackPublications.forEach((e=>{this.setParticipantCryptorEnabled(e.trackInfo.encryption!==se.NONE,A.identity)}))}))})).on(Bi.TrackUnsubscribed,((A,e,t)=>{var n;const i={kind:"removeTransform",data:{participantIdentity:t.identity,trackId:A.mediaStreamID}};null===(n=this.worker)||void 0===n||n.postMessage(i)})).on(Bi.TrackSubscribed,((A,e,t)=>{this.setupE2EEReceiver(A,t.identity,e.trackInfo)})).on(Bi.SignalConnected,(()=>{if(!this.room)throw new TypeError("expected room to be present on signal connect");e.getKeys().forEach((A=>{this.postKey(A)})),this.setParticipantCryptorEnabled(this.room.localParticipant.isE2EEEnabled,this.room.localParticipant.identity)})),A.localParticipant.on(vi.LocalTrackPublished,(A=>Xt(this,void 0,void 0,(function*(){this.setupE2EESender(A.track,A.track.sender)})))),e.on(si.SetKey,(A=>this.postKey(A))).on(si.RatchetRequest,((A,e)=>this.postRatchetRequest(A,e)))}postRatchetRequest(A,e){if(!this.worker)throw Error("could not ratchet key, worker is missing");const t={kind:"ratchetRequest",data:{participantIdentity:A,keyIndex:e}};this.worker.postMessage(t)}postKey(A){let{key:e,participantIdentity:t,keyIndex:n}=A;var i;if(!this.worker)throw Error("could not set key, worker is missing");const r={kind:"setKey",data:{participantIdentity:t,isPublisher:t===(null===(i=this.room)||void 0===i?void 0:i.localParticipant.identity),key:e,keyIndex:n}};this.worker.postMessage(r)}postEnable(A,e){if(!this.worker)throw new ReferenceError("failed to enable e2ee, worker is not ready");{const t={kind:"enable",data:{enabled:A,participantIdentity:e}};this.worker.postMessage(t)}}postRTPMap(A){var e;if(!this.worker)throw TypeError("could not post rtp map, worker is missing");if(!(null===(e=this.room)||void 0===e?void 0:e.localParticipant.identity))throw TypeError("could not post rtp map, local participant identity is missing");const t={kind:"setRTPMap",data:{map:A,participantIdentity:this.room.localParticipant.identity}};this.worker.postMessage(t)}postSifTrailer(A){if(!this.worker)throw Error("could not post SIF trailer, worker is missing");const e={kind:"setSifTrailer",data:{trailer:A}};this.worker.postMessage(e)}setupE2EEReceiver(A,e,t){if(A.receiver){if(!(null==t?void 0:t.mimeType)||""===t.mimeType)throw new TypeError("MimeType missing from trackInfo, cannot set up E2EE cryptor");this.handleReceiver(A.receiver,A.mediaStreamID,e,"video"===A.kind?$r(t.mimeType):void 0)}}setupE2EESender(A,e){Lr(A)&&e?this.handleSender(e,A.mediaStreamID,void 0):e||Vt.warn("early return because sender is not ready")}handleReceiver(A,e,t,n){return Xt(this,void 0,void 0,(function*(){if(this.worker){if(ki()){const i={kind:"decode",participantIdentity:t,trackId:e,codec:n};A.transform=new RTCRtpScriptTransform(this.worker,i)}else{if(ri in A&&n){const A={kind:"updateCodec",data:{trackId:e,codec:n,participantIdentity:t}};return void this.worker.postMessage(A)}let i=A.writableStream,r=A.readableStream;if(!i||!r){const e=A.createEncodedStreams();A.writableStream=e.writable,i=e.writable,A.readableStream=e.readable,r=e.readable}const s={kind:"decode",data:{readableStream:r,writableStream:i,trackId:e,codec:n,participantIdentity:t}};this.worker.postMessage(s,[r,i])}A[ri]=!0}}))}handleSender(A,e,t){var n;if(!(ri in A)&&this.worker){if(!(null===(n=this.room)||void 0===n?void 0:n.localParticipant.identity)||""===this.room.localParticipant.identity)throw TypeError("local identity needs to be known in order to set up encrypted sender");if(ki()){Vt.info("initialize script transform");const n={kind:"encode",participantIdentity:this.room.localParticipant.identity,trackId:e,codec:t};A.transform=new RTCRtpScriptTransform(this.worker,n)}else{Vt.info("initialize encoded streams");const n=A.createEncodedStreams(),i={kind:"encode",data:{readableStream:n.readable,writableStream:n.writable,codec:t,trackId:e,participantIdentity:this.room.localParticipant.identity}};this.worker.postMessage(i,[n.readable,n.writable])}A[ri]=!0}}}const ts="default";class ns{constructor(){this._previousDevices=[]}static getInstance(){return void 0===this.instance&&(this.instance=new ns),this.instance}get previousDevices(){return this._previousDevices}getDevices(A){return Xt(this,arguments,void 0,(function(A){var e=this;let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return function*(){var n;if((null===(n=ns.userMediaPromiseMap)||void 0===n?void 0:n.size)>0){Vt.debug("awaiting getUserMedia promise");try{A?yield ns.userMediaPromiseMap.get(A):yield Promise.all(ns.userMediaPromiseMap.values())}catch(r){Vt.warn("error waiting for media permissons")}}let i=yield navigator.mediaDevices.enumerateDevices();if(t&&(!hr()||!e.hasDeviceInUse(A))&&(0===i.filter((e=>e.kind===A)).length||i.some((e=>{const t=""===e.label,n=!A||e.kind===A;return t&&n})))){const e={video:"audioinput"!==A&&"audiooutput"!==A,audio:"videoinput"!==A&&{deviceId:{ideal:"default"}}},t=yield navigator.mediaDevices.getUserMedia(e);i=yield navigator.mediaDevices.enumerateDevices(),t.getTracks().forEach((A=>{A.stop()}))}return e._previousDevices=i,A&&(i=i.filter((e=>e.kind===A))),i}()}))}normalizeDeviceId(A,e,t){return Xt(this,void 0,void 0,(function*(){if(e!==ts)return e;const n=yield this.getDevices(A),i=n.find((A=>A.deviceId===ts));if(!i)return void Vt.warn("could not reliably determine default device");const r=n.find((A=>A.deviceId!==ts&&A.groupId===(null!=t?t:i.groupId)));if(r)return null==r?void 0:r.deviceId;Vt.warn("could not reliably determine default device")}))}hasDeviceInUse(A){return A?ns.userMediaPromiseMap.has(A):ns.userMediaPromiseMap.size>0}}var is,rs;ns.mediaDeviceKinds=["audioinput","audiooutput","videoinput"],ns.userMediaPromiseMap=new Map,(rs=is||(is={}))[rs.WAITING=0]="WAITING",rs[rs.RUNNING=1]="RUNNING",rs[rs.COMPLETED=2]="COMPLETED";class ss{constructor(){this.pendingTasks=new Map,this.taskMutex=new a,this.nextTaskIndex=0}run(A){return Xt(this,void 0,void 0,(function*(){const e={id:this.nextTaskIndex++,enqueuedAt:Date.now(),status:is.WAITING};this.pendingTasks.set(e.id,e);const t=yield this.taskMutex.lock();try{return e.executedAt=Date.now(),e.status=is.RUNNING,yield A()}finally{e.status=is.COMPLETED,this.pendingTasks.delete(e.id),t()}}))}flush(){return Xt(this,void 0,void 0,(function*(){return this.run((()=>Xt(this,void 0,void 0,(function*(){}))))}))}snapshot(){return Array.from(this.pendingTasks.values())}}function os(A,e){return A.pathname="".concat(function(A){return A.endsWith("/")?A:"".concat(A,"/")}(A.pathname)).concat(e),A.toString()}const as=["syncState","trickle","offer","answer","simulate","leave"];var cs,ds;(ds=cs||(cs={}))[ds.CONNECTING=0]="CONNECTING",ds[ds.CONNECTED=1]="CONNECTED",ds[ds.RECONNECTING=2]="RECONNECTING",ds[ds.DISCONNECTING=3]="DISCONNECTING",ds[ds.DISCONNECTED=4]="DISCONNECTED";class ls{get currentState(){return this.state}get isDisconnected(){return this.state===cs.DISCONNECTING||this.state===cs.DISCONNECTED}get isEstablishingConnection(){return this.state===cs.CONNECTING||this.state===cs.RECONNECTING}getNextRequestId(){return this._requestId+=1,this._requestId}constructor(){let A=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var t;this.rtt=0,this.state=cs.DISCONNECTED,this.log=Vt,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=Gt(null!==(t=e.loggerName)&&void 0!==t?t:Mt.Signal),this.loggerContextCb=e.loggerContextCb,this.useJSON=A,this.requestQueue=new ss,this.queuedRequests=[],this.closingLock=new a,this.connectionLock=new a,this.state=cs.DISCONNECTED}get logContext(){var A,e;return null!==(e=null===(A=this.loggerContextCb)||void 0===A?void 0:A.call(this))&&void 0!==e?e:{}}join(A,e,t,n){return Xt(this,void 0,void 0,(function*(){return this.state=cs.CONNECTING,this.options=t,yield this.connect(A,e,t,n)}))}reconnect(A,e,t,n){return Xt(this,void 0,void 0,(function*(){if(this.options)return this.state=cs.RECONNECTING,this.clearPingInterval(),yield this.connect(A,e,Object.assign(Object.assign({},this.options),{reconnect:!0,sid:t,reconnectReason:n}));this.log.warn("attempted to reconnect without signal options being set, ignoring",this.logContext)}))}connect(A,e,t,n){this.connectOptions=t;const i=function(A,e,t){var n;const i=new URLSearchParams;return i.set("access_token",A),t.reconnect&&(i.set("reconnect","1"),t.sid&&i.set("sid",t.sid)),i.set("auto_subscribe",t.autoSubscribe?"1":"0"),i.set("sdk",mr()?"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),t.adaptiveStream&&i.set("adaptive_stream","1"),t.reconnectReason&&i.set("reconnect_reason",t.reconnectReason.toString()),(null===(n=navigator.connection)||void 0===n?void 0:n.type)&&i.set("network",navigator.connection.type),i}(e,function(){var A;const e=new ke({sdk:Ee.JS,protocol:16,version:"2.13.0"});return mr()&&(e.os=null!==(A=wr())&&void 0!==A?A:""),e}(),t),r=function(A,e){const t=new URL(function(A){return A.startsWith("http")?A.replace(/^(http)/,"ws"):A}(A));return e.forEach(((A,e)=>{t.searchParams.set(e,A)})),os(t,"rtc")}(A,i),s=os(new URL(Hr(r)),"validate");return new Promise(((A,e)=>Xt(this,void 0,void 0,(function*(){const i=yield this.connectionLock.lock();try{const i=()=>Xt(this,void 0,void 0,(function*(){this.close(),clearTimeout(o),e(new Fi("room connection has been cancelled (signal)",ui.Cancelled))})),o=setTimeout((()=>{this.close(),e(new Fi("room connection has timed out (signal)",ui.ServerUnreachable))}),t.websocketTimeout);(null==n?void 0:n.aborted)&&i(),null==n||n.addEventListener("abort",i);const a=new URL(r);a.searchParams.has("access_token")&&a.searchParams.set("access_token","<redacted>"),this.log.debug("connecting to ".concat(a),Object.assign({reconnect:t.reconnect,reconnectReason:t.reconnectReason},this.logContext)),this.ws&&(yield this.close(!1)),this.ws=new WebSocket(r),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{clearTimeout(o)},this.ws.onerror=A=>Xt(this,void 0,void 0,(function*(){if(this.state===cs.CONNECTED)this.handleWSError(A);else{this.state=cs.DISCONNECTED,clearTimeout(o);try{const t=yield fetch(s);if(t.status.toFixed(0).startsWith("4")){const A=yield t.text();e(new Fi(A,ui.NotAllowed,t.status))}else e(new Fi("Encountered unknown websocket error during connection: ".concat(A.toString()),ui.InternalError,t.status))}catch(t){e(new Fi(t instanceof Error?t.message:"server was not reachable",ui.ServerUnreachable))}}})),this.ws.onmessage=r=>Xt(this,void 0,void 0,(function*(){var s,o,a;let c;if("string"==typeof r.data){const A=JSON.parse(r.data);c=_e.fromJson(A,{ignoreUnknownFields:!0})}else{if(!(r.data instanceof ArrayBuffer))return void this.log.error("could not decode websocket message: ".concat(typeof r.data),this.logContext);c=_e.fromBinary(new Uint8Array(r.data))}if(this.state!==cs.CONNECTED){let r=!1;if("join"===(null===(s=c.message)||void 0===s?void 0:s.case)?(this.state=cs.CONNECTED,null==n||n.removeEventListener("abort",i),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===cs.RECONNECTING&&"leave"!==c.message.case?(this.state=cs.CONNECTED,null==n||n.removeEventListener("abort",i),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),r=!0)):this.isEstablishingConnection&&"leave"===c.message.case?e(new Fi("Received leave request while trying to (re)connect",ui.LeaveRequest,void 0,c.message.value.reason)):t.reconnect||e(new Fi("did not receive join response, got ".concat(null===(a=c.message)||void 0===a?void 0:a.case," instead"),ui.InternalError)),!r)return}this.signalLatency&&(yield or(this.signalLatency)),this.handleSignalResponse(c)})),this.ws.onclose=A=>{this.isEstablishingConnection&&e(new Fi("Websocket got closed during a (re)connection attempt",ui.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{i()}}))))}close(){return Xt(this,arguments,void 0,(function(){var A=this;let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function*(){const t=yield A.closingLock.lock();try{if(A.clearPingInterval(),e&&(A.state=cs.DISCONNECTING),A.ws){A.ws.onmessage=null,A.ws.onopen=null,A.ws.onclose=null;const e=new Promise((e=>{A.ws?A.ws.onclose=()=>{e()}:e()}));A.ws.readyState<A.ws.CLOSING&&(A.ws.close(),yield Promise.race([e,or(250)])),A.ws=void 0}}finally{e&&(A.state=cs.DISCONNECTED),t()}}()}))}sendOffer(A){this.log.debug("sending offer",Object.assign(Object.assign({},this.logContext),{offerSdp:A.sdp})),this.sendRequest({case:"offer",value:hs(A)})}sendAnswer(A){return this.log.debug("sending answer",Object.assign(Object.assign({},this.logContext),{answerSdp:A.sdp})),this.sendRequest({case:"answer",value:hs(A)})}sendIceCandidate(A,e){return this.log.debug("sending ice candidate",Object.assign(Object.assign({},this.logContext),{candidate:A})),this.sendRequest({case:"trickle",value:new je({candidateInit:JSON.stringify(A),target:e})})}sendMuteTrack(A,e){return this.sendRequest({case:"mute",value:new Je({sid:A,muted:e})})}sendAddTrack(A){return this.sendRequest({case:"addTrack",value:A})}sendUpdateLocalMetadata(A,e){return Xt(this,arguments,void 0,(function(A,e){var t=this;let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){const i=t.getNextRequestId();return yield t.sendRequest({case:"updateMetadata",value:new st({requestId:i,metadata:A,name:e,attributes:n})}),i}()}))}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,e){return this.sendRequest({case:"updateLayers",value:new rt({trackSid:A,layers:e})})}sendUpdateSubscriptionPermissions(A,e){return this.sendRequest({case:"subscriptionPermission",value:new Bt({allParticipants:A,trackPermissions:e})})}sendSimulateScenario(A){return this.sendRequest({case:"simulate",value:A})}sendPing(){return Promise.all([this.sendRequest({case:"ping",value:F.parse(Date.now())}),this.sendRequest({case:"pingReq",value:new Qt({timestamp:F.parse(Date.now()),rtt:F.parse(this.rtt)})})])}sendUpdateLocalAudioTrack(A,e){return this.sendRequest({case:"updateAudioTrack",value:new et({trackSid:A,features:e})})}sendLeave(){return this.sendRequest({case:"leave",value:new nt({reason:YA.CLIENT_INITIATED,action:it.DISCONNECT})})}sendRequest(A){return Xt(this,arguments,void 0,(function(A){var e=this;let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function*(){const n=!t&&!function(A){const e=as.indexOf(A.case)>=0;return Vt.trace("request allowed to bypass queue:",{canPass:e,req:A}),e}(A);if(n&&e.state===cs.RECONNECTING)return void e.queuedRequests.push((()=>Xt(e,void 0,void 0,(function*(){yield this.sendRequest(A,!0)}))));if(t||(yield e.requestQueue.flush()),e.signalLatency&&(yield or(e.signalLatency)),!e.ws||e.ws.readyState!==e.ws.OPEN)return void e.log.error("cannot send signal request before connected, type: ".concat(null==A?void 0:A.case),e.logContext);const i=new Ke({message:A});try{e.useJSON?e.ws.send(i.toJsonString()):e.ws.send(i.toBinary())}catch(r){e.log.error("error sending signal message",Object.assign(Object.assign({},e.logContext),{error:r}))}}()}))}handleSignalResponse(A){var e,t;const n=A.message;if(null==n)return void this.log.debug("received unsupported message",this.logContext);let i=!1;if("answer"===n.case){const A=us(n.value);this.onAnswer&&this.onAnswer(A)}else if("offer"===n.case){const A=us(n.value);this.onOffer&&this.onOffer(A)}else if("trickle"===n.case){const A=JSON.parse(n.value.candidateInit);this.onTrickle&&this.onTrickle(A,n.value.target)}else"update"===n.case?this.onParticipantUpdate&&this.onParticipantUpdate(null!==(e=n.value.participants)&&void 0!==e?e:[]):"trackPublished"===n.case?this.onLocalTrackPublished&&this.onLocalTrackPublished(n.value):"speakersChanged"===n.case?this.onSpeakersChanged&&this.onSpeakersChanged(null!==(t=n.value.speakers)&&void 0!==t?t:[]):"leave"===n.case?this.onLeave&&this.onLeave(n.value):"mute"===n.case?this.onRemoteMuteChanged&&this.onRemoteMuteChanged(n.value.sid,n.value.muted):"roomUpdate"===n.case?this.onRoomUpdate&&n.value.room&&this.onRoomUpdate(n.value.room):"connectionQuality"===n.case?this.onConnectionQuality&&this.onConnectionQuality(n.value):"streamStateUpdate"===n.case?this.onStreamStateUpdate&&this.onStreamStateUpdate(n.value):"subscribedQualityUpdate"===n.case?this.onSubscribedQualityUpdate&&this.onSubscribedQualityUpdate(n.value):"subscriptionPermissionUpdate"===n.case?this.onSubscriptionPermissionUpdate&&this.onSubscriptionPermissionUpdate(n.value):"refreshToken"===n.case?this.onTokenRefresh&&this.onTokenRefresh(n.value):"trackUnpublished"===n.case?this.onLocalTrackUnpublished&&this.onLocalTrackUnpublished(n.value):"subscriptionResponse"===n.case?this.onSubscriptionError&&this.onSubscriptionError(n.value):"pong"===n.case||("pongResp"===n.case?(this.rtt=Date.now()-Number.parseInt(n.value.lastPingTimestamp.toString()),this.resetPingTimeout(),i=!0):"requestResponse"===n.case?this.onRequestResponse&&this.onRequestResponse(n.value):"trackSubscribed"===n.case?this.onLocalTrackSubscribed&&this.onLocalTrackSubscribed(n.value.trackSid):"roomMoved"===n.case?(this.onTokenRefresh&&this.onTokenRefresh(n.value.token),this.onRoomMoved&&this.onRoomMoved(n.value)):this.log.debug("unsupported message",Object.assign(Object.assign({},this.logContext),{msgCase:n.case})));i||this.resetPingTimeout()}setReconnected(){for(;this.queuedRequests.length>0;){const A=this.queuedRequests.shift();A&&this.requestQueue.run(A)}}handleOnClose(A){return Xt(this,void 0,void 0,(function*(){if(this.state===cs.DISCONNECTED)return;const e=this.onClose;yield this.close(),this.log.debug("websocket connection closed: ".concat(A),Object.assign(Object.assign({},this.logContext),{reason:A})),e&&e(A)}))}handleWSError(A){this.log.error("websocket error",Object.assign(Object.assign({},this.logContext),{error:A}))}resetPingTimeout(){this.clearPingTimeout(),this.pingTimeoutDuration?this.pingTimeout=_i.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&&_i.clearTimeout(this.pingTimeout)}startPingInterval(){this.clearPingInterval(),this.resetPingTimeout(),this.pingIntervalDuration?(this.log.debug("start ping interval",this.logContext),this.pingInterval=_i.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&&_i.clearInterval(this.pingInterval)}}function us(A){const e={type:"offer",sdp:A.sdp};switch(A.type){case"answer":case"offer":case"pranswer":case"rollback":e.type=A.type}return e}function hs(A){return new $e({sdp:A.sdp,type:A.type})}var gs,ps,ms,fs,Bs,ws={},vs={},Cs={exports:{}};function ys(){if(gs)return Cs.exports;gs=1;var A=Cs.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 e="candidate:%s %d %s %d %s %d typ %s";return e+=null!=A.raddr?" raddr %s rport %d":"%v%v",e+=null!=A.tcptype?" tcptype %s":"%v",null!=A.generation&&(e+=" generation %d"),(e+=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 e="ssrc:%d";return null!=A.attribute&&(e+=" %s",null!=A.value&&(e+=":%s")),e}},{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 e="mediaclk:";return e+=null!=A.id?"id=%s %s":"%v%s",e+=null!=A.mediaClockValue?"=%s":"",(e+=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(e){A[e].forEach((function(A){A.reg||(A.reg=/(.*)/),A.format||(A.format="%s")}))})),Cs.exports}function bs(){if(fs)return ms;fs=1;var A=ys(),e=/%[sdv%]/g,t=function(A){var t=1,n=arguments,i=n.length;return A.replace(e,(function(A){if(t>=i)return A;var e=n[t];switch(t+=1,A){case"%%":return"%";case"%s":return String(e);case"%d":return Number(e);case"%v":return""}}))},n=function(A,e,n){var i=[A+"="+(e.format instanceof Function?e.format(e.push?n:n[e.name]):e.format)];if(e.names)for(var r=0;r<e.names.length;r+=1){var s=e.names[r];e.name?i.push(n[e.name][s]):i.push(n[e.names[r]])}else i.push(n[e.name]);return t.apply(null,i)},i=["v","o","s","i","u","e","p","c","b","t","r","z","a"],r=["i","c","b","a"];return ms=function(e,t){t=t||{},null==e.version&&(e.version=0),null==e.name&&(e.name=" "),e.media.forEach((function(A){null==A.payloads&&(A.payloads="")}));var s=t.outerOrder||i,o=t.innerOrder||r,a=[];return s.forEach((function(t){A[t].forEach((function(A){A.name in e&&null!=e[A.name]?a.push(n(t,A,e)):A.push in e&&null!=e[A.push]&&e[A.push].forEach((function(e){a.push(n(t,A,e))}))}))})),e.media.forEach((function(e){a.push(n("m",A.m[0],e)),o.forEach((function(t){A[t].forEach((function(A){A.name in e&&null!=e[A.name]?a.push(n(t,A,e)):A.push in e&&null!=e[A.push]&&e[A.push].forEach((function(e){a.push(n(t,A,e))}))}))}))})),a.join("\r\n")+"\r\n"}}var Qs=function(){if(Bs)return ws;Bs=1;var A=(ps||(ps=1,function(A){var e=function(A){return String(Number(A))===A?Number(A):A},t=function(A,t,n){var i=A.name&&A.names;A.push&&!t[A.push]?t[A.push]=[]:i&&!t[A.name]&&(t[A.name]={});var r=A.push?{}:i?t[A.name]:t;!function(A,t,n,i){if(i&&!n)t[i]=e(A[1]);else for(var r=0;r<n.length;r+=1)null!=A[r+1]&&(t[n[r]]=e(A[r+1]))}(n.match(A.reg),r,A.names,A.name),A.push&&t[A.push].push(r)},n=ys(),i=RegExp.prototype.test.bind(/^([a-z])=(.*)/);A.parse=function(A){var e={},r=[],s=e;return A.split(/(\r\n|\r|\n)/).filter(i).forEach((function(A){var e=A[0],i=A.slice(2);"m"===e&&(r.push({rtp:[],fmtp:[]}),s=r[r.length-1]);for(var o=0;o<(n[e]||[]).length;o+=1){var a=n[e][o];if(a.reg.test(i))return t(a,s,i)}})),e.media=r,e};var r=function(A,t){var n=t.split(/=(.+)/,2);return 2===n.length?A[n[0]]=e(n[1]):1===n.length&&t.length>1&&(A[n[0]]=void 0),A};A.parseParams=function(A){return A.split(/;\s?/).reduce(r,{})},A.parseFmtpConfig=A.parseParams,A.parsePayloads=function(A){return A.toString().split(" ").map(Number)},A.parseRemoteCandidates=function(A){for(var t=[],n=A.split(" ").map(e),i=0;i<n.length;i+=3)t.push({component:n[i],ip:n[i+1],port:n[i+2]});return t},A.parseImageAttributes=function(A){return A.split(" ").map((function(A){return A.substring(1,A.length-1).split(",").reduce(r,{})}))},A.parseSimulcastStreamList=function(A){return A.split(";").map((function(A){return A.split(",").map((function(A){var t,n=!1;return"~"!==A[0]?t=e(A):(t=e(A.substring(1,A.length)),n=!0),{scid:t,paused:n}}))}))}}(vs)),vs),e=bs(),t=ys();return ws.grammar=t,ws.write=e,ws.parse=A.parse,ws.parseParams=A.parseParams,ws.parseFmtpConfig=A.parseFmtpConfig,ws.parsePayloads=A.parsePayloads,ws.parseRemoteCandidates=A.parseRemoteCandidates,ws.parseImageAttributes=A.parseImageAttributes,ws.parseSimulcastStreamList=A.parseSimulcastStreamList,ws}();function Us(A,e,t){var n,i,r;void 0===e&&(e=50),void 0===t&&(t={});var s=null!=(n=t.isImmediate)&&n,o=null!=(i=t.callback)&&i,a=t.maxWait,c=Date.now(),d=[],l=function(){var t=[].slice.call(arguments),n=this;return new Promise((function(i,l){var u=s&&void 0===r;if(void 0!==r&&clearTimeout(r),r=setTimeout((function(){if(r=void 0,c=Date.now(),!s){var e=A.apply(n,t);o&&o(e),d.forEach((function(A){return(0,A.resolve)(e)})),d=[]}}),function(){if(void 0!==a){var A=Date.now()-c;if(A+e>=a)return a-A}return e}()),u){var h=A.apply(n,t);return o&&o(h),i(h)}d.push({resolve:i,reject:l})}))};return l.cancel=function(A){void 0!==r&&clearTimeout(r),d.forEach((function(e){return(0,e.reject)(A)})),d=[]},l}const ks="negotiationStarted",Es="negotiationComplete",Fs="rtpVideoPayloadTypes";class Ts extends Zt.EventEmitter{get pc(){return this._pc||(this._pc=this.createPC()),this._pc}constructor(A){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var t;super(),this.log=Vt,this.ddExtID=0,this.pendingCandidates=[],this.restartingIce=!1,this.renegotiate=!1,this.trackBitrates=[],this.remoteStereoMids=[],this.remoteNackMids=[],this.negotiate=Us((A=>Xt(this,void 0,void 0,(function*(){this.emit(ks);try{yield this.createAndSendOffer()}catch(e){if(!A)throw e;A(e)}}))),20),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=Gt(null!==(t=e.loggerName)&&void 0!==t?t:Mt.PCTransport),this.loggerOptions=e,this.config=A,this._pc=this.createPC()}createPC(){const A=new RTCPeerConnection(this.config);return A.onicecandidate=A=>{var e;A.candidate&&(null===(e=this.onIceCandidate)||void 0===e||e.call(this,A.candidate))},A.onicecandidateerror=A=>{var e;null===(e=this.onIceCandidateError)||void 0===e||e.call(this,A)},A.oniceconnectionstatechange=()=>{var e;null===(e=this.onIceConnectionStateChange)||void 0===e||e.call(this,A.iceConnectionState)},A.onsignalingstatechange=()=>{var e;null===(e=this.onSignalingStatechange)||void 0===e||e.call(this,A.signalingState)},A.onconnectionstatechange=()=>{var e;null===(e=this.onConnectionStateChange)||void 0===e||e.call(this,A.connectionState)},A.ondatachannel=A=>{var e;null===(e=this.onDataChannel)||void 0===e||e.call(this,A)},A.ontrack=A=>{var e;null===(e=this.onTrack)||void 0===e||e.call(this,A)},A}get logContext(){var A,e;return Object.assign({},null===(e=(A=this.loggerOptions).loggerContextCb)||void 0===e?void 0:e.call(A))}get isICEConnected(){return null!==this._pc&&("connected"===this.pc.iceConnectionState||"completed"===this.pc.iceConnectionState)}addIceCandidate(A){return Xt(this,void 0,void 0,(function*(){if(this.pc.remoteDescription&&!this.restartingIce)return this.pc.addIceCandidate(A);this.pendingCandidates.push(A)}))}setRemoteDescription(A){return Xt(this,void 0,void 0,(function*(){var e;let t;if("offer"===A.type){let{stereoMids:e,nackMids:t}=function(A){var e;const t=[],n=[],i=Qs.parse(null!==(e=A.sdp)&&void 0!==e?e:"");let r=0;return i.media.forEach((A=>{var e;"audio"===A.type&&(A.rtp.some((A=>"opus"===A.codec&&(r=A.payload,!0))),(null===(e=A.rtcpFb)||void 0===e?void 0:e.some((A=>A.payload===r&&"nack"===A.type)))&&n.push(A.mid),A.fmtp.some((e=>e.payload===r&&(e.config.includes("sprop-stereo=1")&&t.push(A.mid),!0))))})),{stereoMids:t,nackMids:n}}(A);this.remoteStereoMids=e,this.remoteNackMids=t}else if("answer"===A.type){const n=Qs.parse(null!==(e=A.sdp)&&void 0!==e?e:"");n.media.forEach((A=>{"audio"===A.type&&this.trackBitrates.some((e=>{if(!e.transceiver||A.mid!=e.transceiver.mid)return!1;let t=0;if(A.rtp.some((A=>A.codec.toUpperCase()===e.codec.toUpperCase()&&(t=A.payload,!0))),0===t)return!0;let n=!1;for(const i of A.fmtp)if(i.payload===t){i.config=i.config.split(";").filter((A=>!A.includes("maxaveragebitrate"))).join(";"),e.maxbr>0&&(i.config+=";maxaveragebitrate=".concat(1e3*e.maxbr)),n=!0;break}return n||e.maxbr>0&&A.fmtp.push({payload:t,config:"maxaveragebitrate=".concat(1e3*e.maxbr)}),!0}))})),t=Qs.write(n)}yield this.setMungedSDP(A,t,!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(Es),A.sdp)&&Qs.parse(A.sdp).media.forEach((A=>{"video"===A.type&&this.emit(Fs,A.rtp)}))}))}createAndSendOffer(A){return Xt(this,void 0,void 0,(function*(){var e;if(void 0===this.onOffer)return;if((null==A?void 0:A.iceRestart)&&(this.log.debug("restarting ICE",this.logContext),this.restartingIce=!0),this._pc&&"have-local-offer"===this._pc.signalingState){const e=this._pc.remoteDescription;if(!(null==A?void 0:A.iceRestart)||!e)return void(this.renegotiate=!0);yield this._pc.setRemoteDescription(e)}else if(!this._pc||"closed"===this._pc.signalingState)return void this.log.warn("could not createOffer with closed peer connection",this.logContext);this.log.debug("starting to negotiate",this.logContext);const t=yield this.pc.createOffer(A);this.log.debug("original offer",Object.assign({sdp:t.sdp},this.logContext));const n=Qs.parse(null!==(e=t.sdp)&&void 0!==e?e:"");n.media.forEach((A=>{Is(A),"audio"===A.type?Ss(A,[],[]):"video"===A.type&&this.trackBitrates.some((e=>{if(!A.msid||!e.cid||!A.msid.includes(e.cid))return!1;let t=0;if(A.rtp.some((A=>A.codec.toUpperCase()===e.codec.toUpperCase()&&(t=A.payload,!0))),0===t)return!0;if(dr(e.codec)&&this.ensureVideoDDExtensionForSVC(A,n),"av1"!==e.codec)return!0;const i=Math.round(.7*e.maxbr);for(const n of A.fmtp)if(n.payload===t){n.config.includes("x-google-start-bitrate")||(n.config+=";x-google-start-bitrate=".concat(i));break}return!0}))})),yield this.setMungedSDP(t,Qs.write(n)),this.onOffer(t)}))}createAndSetAnswer(){return Xt(this,void 0,void 0,(function*(){var A;const e=yield this.pc.createAnswer(),t=Qs.parse(null!==(A=e.sdp)&&void 0!==A?A:"");return t.media.forEach((A=>{Is(A),"audio"===A.type&&Ss(A,this.remoteStereoMids,this.remoteNackMids)})),yield this.setMungedSDP(e,Qs.write(t)),e}))}createDataChannel(A,e){return this.pc.createDataChannel(A,e)}addTransceiver(A,e){return this.pc.addTransceiver(A,e)}addTrack(A){if(!this._pc)throw new Pi("PC closed, cannot add track");return this._pc.addTrack(A)}setTrackCodecBitrate(A){this.trackBitrates.push(A)}setConfiguration(A){var e;if(!this._pc)throw new Pi("PC closed, cannot configure");return null===(e=this._pc)||void 0===e?void 0:e.setConfiguration(A)}canRemoveTrack(){var A;return!!(null===(A=this._pc)||void 0===A?void 0:A.removeTrack)}removeTrack(A){var e;return null===(e=this._pc)||void 0===e?void 0:e.removeTrack(A)}getConnectionState(){var A,e;return null!==(e=null===(A=this._pc)||void 0===A?void 0:A.connectionState)&&void 0!==e?e:"closed"}getICEConnectionState(){var A,e;return null!==(e=null===(A=this._pc)||void 0===A?void 0:A.iceConnectionState)&&void 0!==e?e:"closed"}getSignallingState(){var A,e;return null!==(e=null===(A=this._pc)||void 0===A?void 0:A.signalingState)&&void 0!==e?e:"closed"}getTransceivers(){var A,e;return null!==(e=null===(A=this._pc)||void 0===A?void 0:A.getTransceivers())&&void 0!==e?e:[]}getSenders(){var A,e;return null!==(e=null===(A=this._pc)||void 0===A?void 0:A.getSenders())&&void 0!==e?e:[]}getLocalDescription(){var A;return null===(A=this._pc)||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 Xt(this,void 0,void 0,(function*(){var A;if(!this._pc)return;let e="";const t=new Map,n=new Map;if((yield this._pc.getStats()).forEach((A=>{switch(A.type){case"transport":e=A.selectedCandidatePairId;break;case"candidate-pair":""===e&&A.selected&&(e=A.id),t.set(A.id,A);break;case"remote-candidate":n.set(A.id,"".concat(A.address,":").concat(A.port))}})),""===e)return;const i=null===(A=t.get(e))||void 0===A?void 0:A.remoteCandidateId;return void 0!==i?n.get(i):void 0}))}setMungedSDP(A,e,t){return Xt(this,void 0,void 0,(function*(){if(e){const i=A.sdp;A.sdp=e;try{return this.log.debug("setting munged ".concat(t?"remote":"local"," description"),this.logContext),void(t?yield this.pc.setRemoteDescription(A):yield this.pc.setLocalDescription(A))}catch(n){this.log.warn("not able to set ".concat(A.type,", falling back to unmodified sdp"),Object.assign(Object.assign({},this.logContext),{error:n,sdp:e})),A.sdp=i}}try{t?yield this.pc.setRemoteDescription(A):yield this.pc.setLocalDescription(A)}catch(n){let e="unknown error";n instanceof Error?e=n.message:"string"==typeof n&&(e=n);const i={error:e,sdp:A.sdp};throw!t&&this.pc.remoteDescription&&(i.remoteSdp=this.pc.remoteDescription),this.log.error("unable to set ".concat(A.type),Object.assign(Object.assign({},this.logContext),{fields:i})),new Hi(e)}}))}ensureVideoDDExtensionForSVC(A,e){var t,n;if(!(null===(t=A.ext)||void 0===t?void 0:t.some((A=>A.uri===sr)))){if(0===this.ddExtID){let A=0;e.media.forEach((e=>{var t;"video"===e.type&&(null===(t=e.ext)||void 0===t||t.forEach((e=>{e.value>A&&(A=e.value)})))})),this.ddExtID=A+1}null===(n=A.ext)||void 0===n||n.push({value:this.ddExtID,uri:sr})}}}function Ss(A,e,t){let n=0;A.rtp.some((A=>"opus"===A.codec&&(n=A.payload,!0))),n>0&&(A.rtcpFb||(A.rtcpFb=[]),t.includes(A.mid)&&!A.rtcpFb.some((A=>A.payload===n&&"nack"===A.type))&&A.rtcpFb.push({payload:n,type:"nack"}),e.includes(A.mid)&&A.fmtp.some((A=>A.payload===n&&(A.config.includes("stereo=1")||(A.config+=";stereo=1"),!0))))}function Is(A){if(A.connection){const e=A.connection.ip.indexOf(":")>=0;(4===A.connection.version&&e||6===A.connection.version&&!e)&&(A.connection.ip="0.0.0.0",A.connection.version=4)}}const Ps="vp8",Hs={audioPreset:er.music,dtx:!0,red:!0,forceStereo:!1,simulcast:!0,screenShareEncoding:rr.h1080fps15.encoding,stopMicTrackOnMute:!1,videoCodec:Ps,backupCodec:!0},Rs={deviceId:{ideal:"default"},autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0,voiceIsolation:!0},Ds={deviceId:{ideal:"default"},resolution:nr.h720.resolution},xs={adaptiveStream:!1,dynacast:!1,stopLocalTrackOnUnpublish:!0,reconnectPolicy:new class{constructor(A){this._retryDelays=void 0!==A?[...A]:Wt}nextRetryDelayInMs(A){if(A.retryCount>=this._retryDelays.length)return null;const e=this._retryDelays[A.retryCount];return A.retryCount<=1?e:e+1e3*Math.random()}},disconnectOnPageLeave:!0,webAudioMix:!1},Ls={autoSubscribe:!0,maxRetries:1,peerConnectionTimeout:15e3,websocketTimeout:15e3};var Os,Ms;(Ms=Os||(Os={}))[Ms.NEW=0]="NEW",Ms[Ms.CONNECTING=1]="CONNECTING",Ms[Ms.CONNECTED=2]="CONNECTED",Ms[Ms.FAILED=3]="FAILED",Ms[Ms.CLOSING=4]="CLOSING",Ms[Ms.CLOSED=5]="CLOSED";class Ns{get needsPublisher(){return this.isPublisherConnectionRequired}get needsSubscriber(){return this.isSubscriberConnectionRequired}get currentState(){return this.state}constructor(A,e,t){var n;this.peerConnectionTimeout=Ls.peerConnectionTimeout,this.log=Vt,this.updateState=()=>{var A;const e=this.state,t=this.requiredTransports.map((A=>A.getConnectionState()));t.every((A=>"connected"===A))?this.state=Os.CONNECTED:t.some((A=>"failed"===A))?this.state=Os.FAILED:t.some((A=>"connecting"===A))?this.state=Os.CONNECTING:t.every((A=>"closed"===A))?this.state=Os.CLOSED:t.some((A=>"closed"===A))?this.state=Os.CLOSING:t.every((A=>"new"===A))&&(this.state=Os.NEW),e!==this.state&&(this.log.debug("pc state change: from ".concat(Os[e]," to ").concat(Os[this.state]),this.logContext),null===(A=this.onStateChange)||void 0===A||A.call(this,this.state,this.publisher.getConnectionState(),this.subscriber.getConnectionState()))},this.log=Gt(null!==(n=t.loggerName)&&void 0!==n?n:Mt.PCManager),this.loggerOptions=t,this.isPublisherConnectionRequired=!e,this.isSubscriberConnectionRequired=e,this.publisher=new Ts(A,t),this.subscriber=new Ts(A,t),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 e;null===(e=this.onIceCandidate)||void 0===e||e.call(this,A,Oe.PUBLISHER)},this.subscriber.onIceCandidate=A=>{var e;null===(e=this.onIceCandidate)||void 0===e||e.call(this,A,Oe.SUBSCRIBER)},this.subscriber.onDataChannel=A=>{var e;null===(e=this.onDataChannel)||void 0===e||e.call(this,A)},this.subscriber.onTrack=A=>{var e;null===(e=this.onTrack)||void 0===e||e.call(this,A)},this.publisher.onOffer=A=>{var e;null===(e=this.onPublisherOffer)||void 0===e||e.call(this,A)},this.state=Os.NEW,this.connectionLock=new a,this.remoteOfferLock=new a}get logContext(){var A,e;return Object.assign({},null===(e=(A=this.loggerOptions).loggerContextCb)||void 0===e?void 0:e.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 Xt(this,void 0,void 0,(function*(){if(this.publisher&&"closed"!==this.publisher.getSignallingState()){const e=this.publisher;for(const t of e.getSenders())try{e.canRemoveTrack()&&e.removeTrack(t)}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 Xt(this,void 0,void 0,(function*(){this.subscriber.restartingIce=!0,this.needsPublisher&&(yield this.createAndSendPublisherOffer({iceRestart:!0}))}))}addIceCandidate(A,e){return Xt(this,void 0,void 0,(function*(){e===Oe.PUBLISHER?yield this.publisher.addIceCandidate(A):yield this.subscriber.addIceCandidate(A)}))}createSubscriberAnswerFromOffer(A){return Xt(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 e=yield this.remoteOfferLock.lock();try{return yield this.subscriber.setRemoteDescription(A),yield this.subscriber.createAndSetAnswer()}finally{e()}}))}updateConfiguration(A,e){this.publisher.setConfiguration(A),this.subscriber.setConfiguration(A),e&&this.triggerIceRestart()}ensurePCTransportConnection(A,e){return Xt(this,void 0,void 0,(function*(){var t;const n=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===(t=this.requiredTransports)||void 0===t?void 0:t.map((t=>this.ensureTransportConnected(t,A,e))))}finally{n()}}))}negotiate(A){return Xt(this,void 0,void 0,(function*(){return new Promise(((e,t)=>Xt(this,void 0,void 0,(function*(){const n=setTimeout((()=>{t("negotiation timed out")}),this.peerConnectionTimeout);A.signal.addEventListener("abort",(()=>{clearTimeout(n),t("negotiation aborted")})),this.publisher.once(ks,(()=>{A.signal.aborted||this.publisher.once(Es,(()=>{clearTimeout(n),e()}))})),yield this.publisher.negotiate((A=>{clearTimeout(n),t(A)}))}))))}))}addPublisherTransceiver(A,e){return this.publisher.addTransceiver(A,e)}addPublisherTrack(A){return this.publisher.addTrack(A)}createPublisherDataChannel(A,e){return this.publisher.createDataChannel(A,e)}getConnectedAddress(A){return A===Oe.PUBLISHER||A===Oe.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,e){return Xt(this,arguments,void 0,(function(A,e){var t=this;let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.peerConnectionTimeout;return function*(){if("connected"!==A.getConnectionState())return new Promise(((A,i)=>Xt(t,void 0,void 0,(function*(){const t=()=>{this.log.warn("abort transport connection",this.logContext),_i.clearTimeout(r),i(new Fi("room connection has been cancelled",ui.Cancelled))};(null==e?void 0:e.signal.aborted)&&t(),null==e||e.signal.addEventListener("abort",t);const r=_i.setTimeout((()=>{null==e||e.signal.removeEventListener("abort",t),i(new Fi("could not establish pc connection",ui.InternalError))}),n);for(;this.state!==Os.CONNECTED;)if(yield or(50),null==e?void 0:e.signal.aborted)return void i(new Fi("room connection has been cancelled",ui.Cancelled));_i.clearTimeout(r),null==e||e.signal.removeEventListener("abort",t),A()}))))}()}))}}class Ks extends Error{constructor(A,e,t){super(e),this.code=A,this.message=Vs(e,Ks.MAX_MESSAGE_BYTES),this.data=t?Vs(t,Ks.MAX_DATA_BYTES):void 0}static fromProto(A){return new Ks(A.code,A.message,A.data)}toProto(){return new ye({code:this.code,message:this.message,data:this.data})}static builtIn(A,e){return new Ks(Ks.ErrorCode[A],Ks.ErrorMessage[A],e)}}function _s(A){return(new TextEncoder).encode(A).length}function Vs(A,e){if(_s(A)<=e)return A;let t=0,n=A.length;const i=new TextEncoder;for(;t<n;){const r=Math.floor((t+n+1)/2);i.encode(A.slice(0,r)).length<=e?t=r:n=r-1}return A.slice(0,t)}Ks.MAX_MESSAGE_BYTES=256,Ks.MAX_DATA_BYTES=15360,Ks.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},Ks.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 Gs=2e3;function js(A,e){if(!e)return 0;let t,n;return"bytesReceived"in A?(t=A.bytesReceived,n=e.bytesReceived):"bytesSent"in A&&(t=A.bytesSent,n=e.bytesSent),void 0===t||void 0===n||void 0===A.timestamp||void 0===e.timestamp?0:8*(t-n)*1e3/(A.timestamp-e.timestamp)}class Js extends Ji{get sender(){return this._sender}set sender(A){this._sender=A}get constraints(){return this._constraints}constructor(A,e,t){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];super(A,e,arguments.length>4?arguments[4]:void 0),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=Us((()=>Xt(this,void 0,void 0,(function*(){yield this.pauseUpstream()}))),5e3),this.handleTrackUnmuteEvent=()=>Xt(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(Qi.Ended,this)},this.reacquireTrack=!1,this.providedByUser=n,this.muteLock=new a,this.pauseUpstreamLock=new a,this.processorLock=new a,this.restartLock=new a,this.setMediaStreamTrack(A,!0),this._constraints=A.getConstraints(),t&&(this._constraints=t)}get id(){return this._mediaStreamTrack.id}get dimensions(){if(this.kind!==Ji.Kind.Video)return;const{width:A,height:e}=this._mediaStreamTrack.getSettings();return A&&e?{width:A,height:e}:void 0}get isUpstreamPaused(){return this._isUpstreamPaused}get isUserProvided(){return this.providedByUser}get mediaStreamTrack(){var A,e;return null!==(e=null===(A=this.processor)||void 0===A?void 0:A.processedTrack)&&void 0!==e?e:this._mediaStreamTrack}get isLocal(){return!0}getSourceTrackSettings(){return this._mediaStreamTrack.getSettings()}setMediaStreamTrack(A,e){return Xt(this,void 0,void 0,(function*(){var t;if(A===this._mediaStreamTrack&&!e)return;let n;if(this._mediaStreamTrack&&(this.attachedElements.forEach((A=>{Xi(this._mediaStreamTrack,A)})),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([A]),A&&(A.addEventListener("ended",this.handleEnded),A.addEventListener("mute",this.handleTrackMuteEvent),A.addEventListener("unmute",this.handleTrackUnmuteEvent),this._constraints=A.getConstraints()),this.processor&&A){const e=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&&(Wi(A,this.processorElement),this.processorElement.muted=!0),yield this.processor.restart({track:A,kind:this.kind,element:this.processorElement}),n=this.processor.processedTrack}finally{e()}}this.sender&&"closed"!==(null===(t=this.sender.transport)||void 0===t?void 0:t.state)&&(yield this.sender.replaceTrack(null!=n?n:A)),this.providedByUser||this._mediaStreamTrack===A||this._mediaStreamTrack.stop(),this._mediaStreamTrack=A,A&&(this._mediaStreamTrack.enabled=!this.isMuted,yield this.resumeUpstream(),this.attachedElements.forEach((e=>{Wi(null!=n?n:A,e)})))}))}waitForDimensions(){return Xt(this,arguments,void 0,(function(){var A=this;let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3;return function*(){var t;if(A.kind===Ji.Kind.Audio)throw new Error("cannot get dimensions for audio tracks");"iOS"===(null===(t=Oi())||void 0===t?void 0:t.os)&&(yield or(10));const n=Date.now();for(;Date.now()-n<e;){const e=A.dimensions;if(e)return e;yield or(50)}throw new Si("unable to get track dimensions after timeout")}()}))}setDeviceId(A){return Xt(this,void 0,void 0,(function*(){return this._constraints.deviceId===A&&this._mediaStreamTrack.getSettings().deviceId===Pr(A)||(this._constraints.deviceId=A,!!this.isMuted||(yield this.restartTrack(),Pr(A)===this._mediaStreamTrack.getSettings().deviceId))}))}getDeviceId(){return Xt(this,arguments,void 0,(function(){var A=this;let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function*(){if(A.source===Ji.Source.ScreenShare)return;const{deviceId:t,groupId:n}=A._mediaStreamTrack.getSettings(),i=A.kind===Ji.Kind.Audio?"audioinput":"videoinput";return e?ns.getInstance().normalizeDeviceId(i,t,n):t}()}))}mute(){return Xt(this,void 0,void 0,(function*(){return this.setTrackMuted(!0),this}))}unmute(){return Xt(this,void 0,void 0,(function*(){return this.setTrackMuted(!1),this}))}replaceTrack(A,e){return Xt(this,void 0,void 0,(function*(){if(!this.sender)throw new Si("unable to replace an unpublished track");let t,n;return"boolean"==typeof e?t=e:void 0!==e&&(t=e.userProvidedTrack,n=e.stopProcessor),this.providedByUser=null==t||t,this.log.debug("replace MediaStreamTrack",this.logContext),yield this.setMediaStreamTrack(A),n&&this.processor&&(yield this.stopProcessor()),this}))}restart(A){return Xt(this,void 0,void 0,(function*(){this.manuallyStopped=!1;const e=yield this.restartLock.lock();try{A||(A=this._constraints);const{deviceId:e,facingMode:t}=A,n=function(A,e){var t={};for(var n in A)Object.prototype.hasOwnProperty.call(A,n)&&e.indexOf(n)<0&&(t[n]=A[n]);if(null!=A&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(A);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(A,n[i])&&(t[n[i]]=A[n[i]])}return t}(A,["deviceId","facingMode"]);this.log.debug("restarting track with constraints",Object.assign(Object.assign({},this.logContext),{constraints:A}));const i={audio:!1,video:!1};this.kind===Ji.Kind.Video?i.video=!e&&!t||{deviceId:e,facingMode:t}:i.audio=!e||{deviceId:e},this.attachedElements.forEach((A=>{Xi(this.mediaStreamTrack,A)})),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.stop();const r=(yield navigator.mediaDevices.getUserMedia(i)).getTracks()[0];return yield r.applyConstraints(n),r.addEventListener("ended",this.handleEnded),this.log.debug("re-acquired MediaStreamTrack",this.logContext),yield this.setMediaStreamTrack(r),this._constraints=A,this.emit(Qi.Restarted,this),this.manuallyStopped&&(this.log.warn("track was stopped during a restart, stopping restarted track",this.logContext),this.stop()),this}finally{e()}}))}setTrackMuted(A){this.log.debug("setting ".concat(this.kind," track ").concat(A?"muted":"unmuted"),this.logContext),this.isMuted===A&&this._mediaStreamTrack.enabled!==A||(this.isMuted=A,this._mediaStreamTrack.enabled=!A,this.emit(A?Qi.Muted:Qi.Unmuted,this))}get needsReAcquisition(){return"live"!==this._mediaStreamTrack.readyState||this._mediaStreamTrack.muted||!this._mediaStreamTrack.enabled||this.reacquireTrack}handleAppVisibilityChanged(){const A=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return Xt(this,void 0,void 0,(function*(){yield A.handleAppVisibilityChanged.call(this),gr()&&(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._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent),null===(A=this.processor)||void 0===A||A.destroy(),this.processor=void 0}pauseUpstream(){return Xt(this,void 0,void 0,(function*(){var A;const e=yield this.pauseUpstreamLock.lock();try{if(!0===this._isUpstreamPaused)return;if(!this.sender)return void this.log.warn("unable to pause upstream for an unpublished track",this.logContext);this._isUpstreamPaused=!0,this.emit(Qi.UpstreamPaused,this);const e=Oi();if("Safari"===(null==e?void 0:e.name)&&Cr(e.version,"12.0")<0)throw new Ti("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{e()}}))}resumeUpstream(){return Xt(this,void 0,void 0,(function*(){var A;const e=yield this.pauseUpstreamLock.lock();try{if(!1===this._isUpstreamPaused)return;if(!this.sender)return void this.log.warn("unable to resume upstream for an unpublished track",this.logContext);this._isUpstreamPaused=!1,this.emit(Qi.UpstreamResumed,this),"closed"!==(null===(A=this.sender.transport)||void 0===A?void 0:A.state)&&(yield this.sender.replaceTrack(this.mediaStreamTrack))}finally{e()}}))}getRTCStatsReport(){return Xt(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 Xt(this,arguments,void 0,(function(A){var e=this;let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return function*(){var n;const i=yield e.processorLock.lock();try{e.log.debug("setting up processor",e.logContext);const i=document.createElement(e.kind),r={kind:e.kind,track:e._mediaStreamTrack,element:i,audioContext:e.audioContext};if(yield A.init(r),e.log.debug("processor initialized",e.logContext),e.processor&&(yield e.stopProcessor()),"unknown"===e.kind)throw TypeError("cannot set processor on track of unknown kind");if(Wi(e._mediaStreamTrack,i),i.muted=!0,i.play().catch((A=>e.log.error("failed to play processor element",Object.assign(Object.assign({},e.logContext),{error:A})))),e.processor=A,e.processorElement=i,e.processor.processedTrack){for(const A of e.attachedElements)A!==e.processorElement&&t&&(Xi(e._mediaStreamTrack,A),Wi(e.processor.processedTrack,A));yield null===(n=e.sender)||void 0===n?void 0:n.replaceTrack(e.processor.processedTrack)}e.emit(Qi.TrackProcessorUpdate,e.processor)}finally{i()}}()}))}getProcessor(){return this.processor}stopProcessor(){return Xt(this,arguments,void 0,(function(){var A=this;let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function*(){var t,n;A.processor&&(A.log.debug("stopping processor",A.logContext),null===(t=A.processor.processedTrack)||void 0===t||t.stop(),yield A.processor.destroy(),A.processor=void 0,e||(null===(n=A.processorElement)||void 0===n||n.remove(),A.processorElement=void 0),yield A._mediaStreamTrack.applyConstraints(A._constraints),yield A.setMediaStreamTrack(A._mediaStreamTrack,!0),A.emit(Qi.TrackProcessorUpdate))}()}))}}class Ws extends Js{get enhancedNoiseCancellation(){return this.isKrispNoiseFilterEnabled}constructor(A,e){let t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;super(A,Ji.Kind.Audio,e,t,i),this.stopOnMute=!1,this.isKrispNoiseFilterEnabled=!1,this.monitorSender=()=>Xt(this,void 0,void 0,(function*(){if(!this.sender)return void(this._currentBitrate=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}))}A&&this.prevStats&&(this._currentBitrate=js(A,this.prevStats)),this.prevStats=A})),this.handleKrispNoiseFilterEnable=()=>{this.isKrispNoiseFilterEnabled=!0,this.log.debug("Krisp noise filter enabled",this.logContext),this.emit(Qi.AudioTrackFeatureUpdate,this,ZA.TF_ENHANCED_NOISE_CANCELLATION,!0)},this.handleKrispNoiseFilterDisable=()=>{this.isKrispNoiseFilterEnabled=!1,this.log.debug("Krisp noise filter disabled",this.logContext),this.emit(Qi.AudioTrackFeatureUpdate,this,ZA.TF_ENHANCED_NOISE_CANCELLATION,!1)},this.audioContext=n,this.checkForSilence()}mute(){const A=Object.create(null,{mute:{get:()=>super.mute}});return Xt(this,void 0,void 0,(function*(){const e=yield this.muteLock.lock();try{return this.isMuted?(this.log.debug("Track already muted",this.logContext),this):(this.source===Ji.Source.Microphone&&this.stopOnMute&&!this.isUserProvided&&(this.log.debug("stopping mic track",this.logContext),this._mediaStreamTrack.stop()),yield A.mute.call(this),this)}finally{e()}}))}unmute(){const A=Object.create(null,{unmute:{get:()=>super.unmute}});return Xt(this,void 0,void 0,(function*(){const e=yield this.muteLock.lock();try{if(!this.isMuted)return this.log.debug("Track already unmuted",this.logContext),this;const e=this._constraints.deviceId&&this._mediaStreamTrack.getSettings().deviceId!==Pr(this._constraints.deviceId);return this.source!==Ji.Source.Microphone||!this.stopOnMute&&"ended"!==this._mediaStreamTrack.readyState&&!e||this.isUserProvided||(this.log.debug("reacquiring mic track",this.logContext),yield this.restartTrack()),yield A.unmute.call(this),this}finally{e()}}))}restartTrack(A){return Xt(this,void 0,void 0,(function*(){let e;if(A){const t=Wr({audio:A});"boolean"!=typeof t.audio&&(e=t.audio)}yield this.restart(e)}))}restart(A){const e=Object.create(null,{restart:{get:()=>super.restart}});return Xt(this,void 0,void 0,(function*(){const t=yield e.restart.call(this,A);return this.checkForSilence(),t}))}startMonitor(){pr()&&(this.monitorInterval||(this.monitorInterval=setInterval((()=>{this.monitorSender()}),Gs)))}setProcessor(A){return Xt(this,void 0,void 0,(function*(){var e;const t=yield this.processorLock.lock();try{if(!mr()&&!this.audioContext)throw Error("Audio context needs to be set on LocalAudioTrack in order to enable processors");this.processor&&(yield this.stopProcessor());const t={kind:this.kind,track:this._mediaStreamTrack,audioContext:this.audioContext};this.log.debug("setting up audio processor ".concat(A.name),this.logContext),yield A.init(t),this.processor=A,this.processor.processedTrack&&(yield null===(e=this.sender)||void 0===e?void 0:e.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(Qi.TrackProcessorUpdate,this.processor)}finally{t()}}))}setAudioContext(A){this.audioContext=A}getSenderStats(){return Xt(this,void 0,void 0,(function*(){var A;if(!(null===(A=this.sender)||void 0===A?void 0:A.getStats))return;let e;return(yield this.sender.getStats()).forEach((A=>{"outbound-rtp"===A.type&&(e={type:"audio",streamId:A.id,packetsSent:A.packetsSent,packetsLost:A.packetsLost,bytesSent:A.bytesSent,timestamp:A.timestamp,roundTripTime:A.roundTripTime,jitter:A.jitter})})),e}))}checkForSilence(){return Xt(this,void 0,void 0,(function*(){const A=yield function(A){return Xt(this,arguments,void 0,(function(A){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200;return function*(){const t=Xr();if(t){const n=t.createAnalyser();n.fftSize=2048;const i=n.frequencyBinCount,r=new Uint8Array(i);t.createMediaStreamSource(new MediaStream([A.mediaStreamTrack])).connect(n),yield or(e),n.getByteTimeDomainData(r);const s=r.some((A=>128!==A&&0!==A));return t.close(),!s}return!1}()}))}(this);return A&&(this.isMuted||this.log.warn("silence detected on local audio track",this.logContext),this.emit(Qi.AudioSilenceDetected)),A}))}}const Xs=Object.values(nr),Ys=Object.values(ir),qs=Object.values(rr),$s=[nr.h180,nr.h360],Zs=[ir.h180,ir.h360],zs=["q","h","f"];function Ao(A,e,t,n){var i,r;let s=null==n?void 0:n.videoEncoding;A&&(s=null==n?void 0:n.screenShareEncoding);const o=null==n?void 0:n.simulcast,a=null==n?void 0:n.scalabilityMode,c=null==n?void 0:n.videoCodec;if(!s&&!o&&!a||!e||!t)return[{}];s||(s=function(A,e,t,n){const i=function(A,e,t){if(A)return qs;const n=e>t?e/t:t/e;return Math.abs(n-16/9)<Math.abs(n-4/3)?Xs:Ys}(A,e,t);let{encoding:r}=i[0];const s=Math.max(e,t);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=.7*r.maxBitrate;break;case"vp9":r=Object.assign({},r),r.maxBitrate=.85*r.maxBitrate}return r}(A,e,t,c),Vt.debug("using video encoding",s));const d=s.maxFramerate,l=new Yi(e,t,s.maxBitrate,s.maxFramerate,s.priority);if(a&&dr(c)){const A=new io(a),e=[];if(A.spatial>3)throw new Error("unsupported scalabilityMode: ".concat(a));const t=Oi();if(hr()||mr()||"Chrome"===(null==t?void 0:t.name)&&Cr(null==t?void 0:t.version,"113")<0){const t="h"==A.suffix?2:3;for(let n=0;n<A.spatial;n+=1)e.push({rid:zs[2-n],maxBitrate:s.maxBitrate/Math.pow(t,n),maxFramerate:l.encoding.maxFramerate});e[0].scalabilityMode=a}else e.push({maxBitrate:s.maxBitrate,maxFramerate:l.encoding.maxFramerate,scalabilityMode:a});return l.encoding.priority&&(e[0].priority=l.encoding.priority,e[0].networkPriority=l.encoding.priority),Vt.debug("using svc encoding",{encodings:e}),e}if(!o)return[s];let u,h=[];if(h=A?null!==(i=no(null==n?void 0:n.screenShareSimulcastLayers))&&void 0!==i?i:eo(A,l):null!==(r=no(null==n?void 0:n.videoSimulcastLayers))&&void 0!==r?r:eo(A,l),h.length>0){const A=h[0];h.length>1&&([,u]=h);const n=Math.max(e,t);if(n>=960&&u)return to(e,t,[A,u,l],d);if(n>=480)return to(e,t,[A,l],d)}return to(e,t,[l])}function eo(A,e){if(A)return[{scaleResolutionDownBy:2,fps:(t=e).encoding.maxFramerate}].map((A=>{var e,n;return new Yi(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)*((null!==(e=t.encoding.maxFramerate)&&void 0!==e?e:30)/(null!==(n=A.fps)&&void 0!==n?n:30))))),A.fps,t.encoding.priority)}));var t;const{width:n,height:i}=e,r=n>i?n/i:i/n;return Math.abs(r-16/9)<Math.abs(r-4/3)?$s:Zs}function to(A,e,t,n){const i=[];if(t.forEach(((t,r)=>{if(r>=zs.length)return;const s=Math.min(A,e),o={rid:zs[r],scaleResolutionDownBy:Math.max(1,s/Math.min(t.width,t.height)),maxBitrate:t.encoding.maxBitrate},a=n&&t.encoding.maxFramerate?Math.min(n,t.encoding.maxFramerate):t.encoding.maxFramerate;a&&(o.maxFramerate=a);const c=ur()||0===r;t.encoding.priority&&c&&(o.priority=t.encoding.priority,o.networkPriority=t.encoding.priority),i.push(o)})),mr()&&"ios"===wr()){let A;i.forEach((e=>{A?e.maxFramerate&&e.maxFramerate>A&&(A=e.maxFramerate):A=e.maxFramerate}));let e=!0;i.forEach((t=>{var n;t.maxFramerate!=A&&(e&&(e=!1,Vt.info("Simulcast on iOS React-Native requires all encodings to share the same framerate.")),Vt.info('Setting framerate of encoding "'.concat(null!==(n=t.rid)&&void 0!==n?n:"",'" to ').concat(A)),t.maxFramerate=A)}))}return i}function no(A){if(A)return A.sort(((A,e)=>{const{encoding:t}=A,{encoding:n}=e;return t.maxBitrate>n.maxBitrate?1:t.maxBitrate<n.maxBitrate?-1:t.maxBitrate===n.maxBitrate&&t.maxFramerate&&n.maxFramerate?t.maxFramerate>n.maxFramerate?1:-1:0}))}class io{constructor(A){const e=A.match(/^L(\d)T(\d)(h|_KEY|_KEY_SHIFT){0,1}$/);if(!e)throw new Error("invalid scalability mode");if(this.spatial=parseInt(e[1]),this.temporal=parseInt(e[2]),e.length>3)switch(e[3]){case"h":case"_KEY":case"_KEY_SHIFT":this.suffix=e[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 Js{get sender(){return this._sender}set sender(A){this._sender=A,this.degradationPreference&&this.setDegradationPreference(this.degradationPreference)}constructor(A,e){let t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3?arguments[3]:void 0;super(A,Ji.Kind.Video,e,t,n),this.simulcastCodecs=new Map,this.degradationPreference="balanced",this.monitorSender=()=>Xt(this,void 0,void 0,(function*(){if(!this.sender)return void(this._currentBitrate=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}))}const e=new Map(A.map((A=>[A.rid,A])));if(this.prevStats){let A=0;e.forEach(((e,t)=>{var n;const i=null===(n=this.prevStats)||void 0===n?void 0:n.get(t);A+=js(e,i)})),this._currentBitrate=A}this.prevStats=e})),this.senderLock=new a}get isSimulcast(){return!!(this.sender&&this.sender.getParameters().encodings.length>1)}startMonitor(A){var e;if(this.signalClient=A,!pr())return;const t=null===(e=this.sender)||void 0===e?void 0:e.getParameters();t&&(this.encodings=t.encodings),this.monitorInterval||(this.monitorInterval=setInterval((()=>{this.monitorSender()}),Gs))}stop(){this._mediaStreamTrack.getConstraints(),this.simulcastCodecs.forEach((A=>{A.mediaStreamTrack.stop()})),super.stop()}pauseUpstream(){const A=Object.create(null,{pauseUpstream:{get:()=>super.pauseUpstream}});return Xt(this,void 0,void 0,(function*(){var e,t,n,i,r;yield A.pauseUpstream.call(this);try{for(var s,o=!0,a=Yt(this.simulcastCodecs.values());!(e=(s=yield a.next()).done);o=!0){i=s.value,o=!1;const A=i;yield null===(r=A.sender)||void 0===r?void 0:r.replaceTrack(null)}}catch(c){t={error:c}}finally{try{o||e||!(n=a.return)||(yield n.call(a))}finally{if(t)throw t.error}}}))}resumeUpstream(){const A=Object.create(null,{resumeUpstream:{get:()=>super.resumeUpstream}});return Xt(this,void 0,void 0,(function*(){var e,t,n,i,r;yield A.resumeUpstream.call(this);try{for(var s,o=!0,a=Yt(this.simulcastCodecs.values());!(e=(s=yield a.next()).done);o=!0){i=s.value,o=!1;const A=i;yield null===(r=A.sender)||void 0===r?void 0:r.replaceTrack(A.mediaStreamTrack)}}catch(c){t={error:c}}finally{try{o||e||!(n=a.return)||(yield n.call(a))}finally{if(t)throw t.error}}}))}mute(){const A=Object.create(null,{mute:{get:()=>super.mute}});return Xt(this,void 0,void 0,(function*(){const e=yield this.muteLock.lock();try{return this.isMuted?(this.log.debug("Track already muted",this.logContext),this):(this.source!==Ji.Source.Camera||this.isUserProvided||(this.log.debug("stopping camera track",this.logContext),this._mediaStreamTrack.stop()),yield A.mute.call(this),this)}finally{e()}}))}unmute(){const A=Object.create(null,{unmute:{get:()=>super.unmute}});return Xt(this,void 0,void 0,(function*(){const e=yield this.muteLock.lock();try{return this.isMuted?(this.source!==Ji.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{e()}}))}setTrackMuted(A){super.setTrackMuted(A);for(const e of this.simulcastCodecs.values())e.mediaStreamTrack.enabled=!A}getSenderStats(){return Xt(this,void 0,void 0,(function*(){var A;if(!(null===(A=this.sender)||void 0===A?void 0:A.getStats))return[];const e=[],t=yield this.sender.getStats();return t.forEach((A=>{var n;if("outbound-rtp"===A.type){const i={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!==(n=A.rid)&&void 0!==n?n:A.id,retransmittedPacketsSent:A.retransmittedPacketsSent,targetBitrate:A.targetBitrate,timestamp:A.timestamp},r=t.get(A.remoteId);r&&(i.jitter=r.jitter,i.packetsLost=r.packetsLost,i.roundTripTime=r.roundTripTime),e.push(i)}})),e.sort(((A,e)=>{var t,n;return(null!==(t=e.frameWidth)&&void 0!==t?t:0)-(null!==(n=A.frameWidth)&&void 0!==n?n:0)})),e}))}setPublishingQuality(A){const e=[];for(let t=Gi.LOW;t<=Gi.HIGH;t+=1)e.push(new gt({quality:t,enabled:t<=A}));this.log.debug("setting publishing quality. max quality ".concat(A),this.logContext),this.setPublishingLayers(e)}restartTrack(A){return Xt(this,void 0,void 0,(function*(){var e,t,n,i,r;let s;if(A){const e=Wr({video:A});"boolean"!=typeof e.video&&(s=e.video)}yield this.restart(s);try{for(var o,a=!0,c=Yt(this.simulcastCodecs.values());!(e=(o=yield c.next()).done);a=!0){i=o.value,a=!1;const A=i;A.sender&&"closed"!==(null===(r=A.sender.transport)||void 0===r?void 0:r.state)&&(A.mediaStreamTrack=this.mediaStreamTrack.clone(),yield A.sender.replaceTrack(A.mediaStreamTrack))}}catch(d){t={error:d}}finally{try{a||e||!(n=c.return)||(yield n.call(c))}finally{if(t)throw t.error}}}))}setProcessor(A){const e=Object.create(null,{setProcessor:{get:()=>super.setProcessor}});return Xt(this,arguments,void 0,(function(A){var t=this;let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return function*(){var i,r,s,o,a,c;if(yield e.setProcessor.call(t,A,n),null===(a=t.processor)||void 0===a?void 0:a.processedTrack)try{for(var d,l=!0,u=Yt(t.simulcastCodecs.values());!(i=(d=yield u.next()).done);l=!0){o=d.value,l=!1;const A=o;yield null===(c=A.sender)||void 0===c?void 0:c.replaceTrack(t.processor.processedTrack)}}catch(h){r={error:h}}finally{try{l||i||!(s=u.return)||(yield s.call(u))}finally{if(r)throw r.error}}}()}))}setDegradationPreference(A){return Xt(this,void 0,void 0,(function*(){if(this.degradationPreference=A,this.sender)try{this.log.debug("setting degradationPreference to ".concat(A),this.logContext);const e=this.sender.getParameters();e.degradationPreference=A,this.sender.setParameters(e)}catch(e){this.log.warn("failed to set degradationPreference",Object.assign({error:e},this.logContext))}}))}addSimulcastTrack(A,e){if(this.simulcastCodecs.has(A))return void this.log.error("".concat(A," already added, skipping adding simulcast codec"),this.logContext);const t={codec:A,mediaStreamTrack:this.mediaStreamTrack.clone(),sender:void 0,encodings:e};return this.simulcastCodecs.set(A,t),t}setSimulcastTrackSender(A,e){const t=this.simulcastCodecs.get(A);t&&(t.sender=e,setTimeout((()=>{this.subscribedCodecs&&this.setPublishingCodecs(this.subscribedCodecs)}),5e3))}setPublishingCodecs(A){return Xt(this,void 0,void 0,(function*(){var e,t,n,i,r,s,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(e=!0,t=Yt(A);!(i=(n=yield t.next()).done);e=!0){o=n.value,e=!1;const A=o;if(this.codec&&this.codec!==A.codec){const e=this.simulcastCodecs.get(A.codec);if(this.log.debug("try setPublishingCodec for ".concat(A.codec),Object.assign(Object.assign({},this.logContext),{simulcastCodecInfo:e})),e&&e.sender)e.encodings&&(this.log.debug("try setPublishingLayersForSender ".concat(A.codec),this.logContext),yield so(e.sender,e.encodings,A.qualities,this.senderLock,this.log,this.logContext));else for(const t of A.qualities)if(t.enabled){a.push(A.codec);break}}else yield this.setPublishingLayers(A.qualities)}}catch(c){r={error:c}}finally{try{e||i||!(s=t.return)||(yield s.call(t))}finally{if(r)throw r.error}}return a}))}setPublishingLayers(A){return Xt(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 so(this.sender,this.encodings,A,this.senderLock,this.log,this.logContext))}))}handleAppVisibilityChanged(){const A=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return Xt(this,void 0,void 0,(function*(){yield A.handleAppVisibilityChanged.call(this),gr()&&this.isInBackground&&this.source===Ji.Source.Camera&&(this._mediaStreamTrack.enabled=!1)}))}}function so(A,e,t,n,i,r){return Xt(this,void 0,void 0,(function*(){const s=yield n.lock();i.debug("setPublishingLayersForSender",Object.assign(Object.assign({},r),{sender:A,qualities:t,senderEncodings:e}));try{const n=A.getParameters(),{encodings:s}=n;if(!s)return;if(s.length!==e.length)return void i.warn("cannot set publishing layers, encodings mismatch",Object.assign(Object.assign({},r),{encodings:s,senderEncodings:e}));let o=!1;const a=Oi();if("Chrome"===(null==a?void 0:a.name)&&Cr(null==a?void 0:a.version,"133")>0&&s[0].scalabilityMode){const A=s[0],n=new io(A.scalabilityMode);let i=JA.OFF;if(t.forEach((A=>{A.enabled&&(i===JA.OFF||A.quality>i)&&(i=A.quality)})),i===JA.OFF)A.active&&(A.active=!1,o=!0);else if(!A.active||n.spatial!==i+1){o=!0,A.active=!0;const t=new io(e[0].scalabilityMode);n.spatial=i+1,n.suffix=t.suffix,1===n.spatial&&(n.suffix=void 0),A.scalabilityMode=n.toString(),A.scaleResolutionDownBy=Math.pow(2,2-i),e[0].maxBitrate&&(A.maxBitrate=e[0].maxBitrate/(A.scaleResolutionDownBy*A.scaleResolutionDownBy))}}else s.forEach(((A,n)=>{var s;let a=null!==(s=A.rid)&&void 0!==s?s:"";""===a&&(a="q");const c=oo(a),d=t.find((A=>A.quality===c));d&&A.active!==d.enabled&&(o=!0,A.active=d.enabled,i.debug("setting layer ".concat(d.quality," to ").concat(A.active?"enabled":"disabled"),r),ur()&&(d.enabled?(A.scaleResolutionDownBy=e[n].scaleResolutionDownBy,A.maxBitrate=e[n].maxBitrate,A.maxFrameRate=e[n].maxFrameRate):(A.scaleResolutionDownBy=4,A.maxBitrate=10,A.maxFrameRate=2)))}));o&&(n.encodings=s,i.debug("setting encodings",Object.assign(Object.assign({},r),{encodings:n.encodings})),yield A.setParameters(n))}finally{s()}}))}function oo(A){switch(A){case"f":default:return Gi.HIGH;case"h":return Gi.MEDIUM;case"q":return Gi.LOW}}function ao(A,e,t,n){if(!t)return[new ce({quality:Gi.HIGH,width:A,height:e,bitrate:0,ssrc:0})];if(n){const n=t[0].scalabilityMode,i=new io(n),r=[],s="h"==i.suffix?1.5:2,o="h"==i.suffix?2:3;for(let a=0;a<i.spatial;a+=1)r.push(new ce({quality:Math.min(Gi.HIGH,i.spatial-1)-a,width:Math.ceil(A/Math.pow(s,a)),height:Math.ceil(e/Math.pow(s,a)),bitrate:t[0].maxBitrate?Math.ceil(t[0].maxBitrate/Math.pow(o,a)):0,ssrc:0}));return r}return t.map((t=>{var n,i,r;const s=null!==(n=t.scaleResolutionDownBy)&&void 0!==n?n:1;let o=oo(null!==(i=t.rid)&&void 0!==i?i:"");return new ce({quality:o,width:Math.ceil(A/s),height:Math.ceil(e/s),bitrate:null!==(r=t.maxBitrate)&&void 0!==r?r:0,ssrc:0})}))}const co="_lossy",lo="_reliable",uo="leave-reconnect";var ho,go,po,mo,fo,Bo,wo,vo,Co,yo,bo;(go=ho||(ho={}))[go.New=0]="New",go[go.Connected=1]="Connected",go[go.Disconnected=2]="Disconnected",go[go.Reconnecting=3]="Reconnecting",go[go.Closed=4]="Closed";class Qo extends Zt.EventEmitter{get isClosed(){return this._isClosed}get pendingReconnect(){return!!this.reconnectTimeout}constructor(A){var e;super(),this.options=A,this.rtcConfig={},this.peerConnectionTimeout=Ls.peerConnectionTimeout,this.fullReconnectOnNext=!1,this.subscriberPrimary=!1,this.pcState=ho.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=Vt,this.handleDataChannel=A=>Xt(this,[A],void 0,(function(A){var e=this;let{channel:t}=A;return function*(){if(t){if(t.label===lo)e.reliableDCSub=t;else{if(t.label!==co)return;e.lossyDCSub=t}e.log.debug("on data channel ".concat(t.id,", ").concat(t.label),e.logContext),t.onmessage=e.handleDataMessage}}()})),this.handleDataMessage=A=>Xt(this,void 0,void 0,(function*(){var e,t;const n=yield this.dataProcessLock.lock();try{let n;if(A.data instanceof ArrayBuffer)n=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}));n=yield A.data.arrayBuffer()}const i=de.fromBinary(new Uint8Array(n));"speaker"===(null===(e=i.value)||void 0===e?void 0:e.case)?this.emit(yi.ActiveSpeakersUpdate,i.value.value.speakers):("user"===(null===(t=i.value)||void 0===t?void 0:t.case)&&function(A,e){const t=A.participantIdentity?A.participantIdentity:e.participantIdentity;A.participantIdentity=t,e.participantIdentity=t;const n=0!==A.destinationIdentities.length?A.destinationIdentities:e.destinationIdentities;A.destinationIdentities=n,e.destinationIdentities=n}(i,i.value.value),this.emit(yi.DataPacketReceived,i))}finally{n()}})),this.handleDataError=A=>{const e=0===A.currentTarget.maxRetransmits?"lossy":"reliable";if(A instanceof ErrorEvent&&A.error){const{error:t}=A.error;this.log.error("DataChannel error on ".concat(e,": ").concat(A.message),Object.assign(Object.assign({},this.logContext),{error:t}))}else this.log.error("Unknown DataChannel error on ".concat(e),Object.assign(Object.assign({},this.logContext),{event:A}))},this.handleBufferedAmountLow=A=>{const e=0===A.currentTarget.maxRetransmits?le.LOSSY:le.RELIABLE;this.updateAndEmitDCBufferStatus(e)},this.handleDisconnect=(A,e)=>{if(this._isClosed)return;this.log.warn("".concat(A," disconnected"),this.logContext),0===this.reconnectAttempts&&(this.reconnectStart=Date.now());const t=Date.now()-this.reconnectStart;let n=this.getNextRetryDelay({elapsedMs:t,retryCount:this.reconnectAttempts});null!==n?(A===uo&&(n=0),this.log.debug("reconnecting in ".concat(n,"ms"),this.logContext),this.clearReconnectTimeout(),this.token&&this.regionUrlProvider&&this.regionUrlProvider.updateToken(this.token),this.reconnectTimeout=_i.setTimeout((()=>this.attemptReconnect(e).finally((()=>this.reconnectTimeout=void 0))),n)):(A=>{this.log.warn("could not recover connection after ".concat(this.reconnectAttempts," attempts, ").concat(A,"ms. giving up"),this.logContext),this.emit(yi.Disconnected),this.close()})(t)},this.waitForRestarted=()=>new Promise(((A,e)=>{this.pcState===ho.Connected&&A();const t=()=>{this.off(yi.Disconnected,n),A()},n=()=>{this.off(yi.Restarted,t),e()};this.once(yi.Restarted,t),this.once(yi.Disconnected,n)})),this.updateAndEmitDCBufferStatus=A=>{const e=this.isBufferStatusLow(A);void 0!==e&&e!==this.dcBufferStatus.get(A)&&(this.dcBufferStatus.set(A,e),this.emit(yi.DCBufferStatusChanged,e,A))},this.isBufferStatusLow=A=>{const e=this.dataChannelForKind(A);if(e)return e.bufferedAmount<=e.bufferedAmountLowThreshold},this.handleBrowserOnLine=()=>{this.client.currentState===cs.RECONNECTING&&(this.clearReconnectTimeout(),this.attemptReconnect(qA.RR_SIGNAL_DISCONNECTED))},this.log=Gt(null!==(e=A.loggerName)&&void 0!==e?e:Mt.Engine),this.loggerOptions={loggerName:A.loggerName,loggerContextCb:()=>this.logContext},this.client=new ls(void 0,this.loggerOptions),this.client.signalLatency=this.options.expSignalLatency,this.reconnectPolicy=this.options.reconnectPolicy,this.registerOnLineListener(),this.closingLock=new a,this.dataProcessLock=new a,this.dcBufferStatus=new Map([[le.LOSSY,!0],[le.RELIABLE,!0]]),this.client.onParticipantUpdate=A=>this.emit(yi.ParticipantUpdate,A),this.client.onConnectionQuality=A=>this.emit(yi.ConnectionQualityUpdate,A),this.client.onRoomUpdate=A=>this.emit(yi.RoomUpdate,A),this.client.onSubscriptionError=A=>this.emit(yi.SubscriptionError,A),this.client.onSubscriptionPermissionUpdate=A=>this.emit(yi.SubscriptionPermissionUpdate,A),this.client.onSpeakersChanged=A=>this.emit(yi.SpeakersChanged,A),this.client.onStreamStateUpdate=A=>this.emit(yi.StreamStateChanged,A),this.client.onRequestResponse=A=>this.emit(yi.SignalRequestResponse,A)}get logContext(){var A,e,t,n,i,r,s,o;return{room:null===(e=null===(A=this.latestJoinResponse)||void 0===A?void 0:A.room)||void 0===e?void 0:e.name,roomID:null===(n=null===(t=this.latestJoinResponse)||void 0===t?void 0:t.room)||void 0===n?void 0:n.sid,participant:null===(r=null===(i=this.latestJoinResponse)||void 0===i?void 0:i.participant)||void 0===r?void 0:r.identity,pID:null===(o=null===(s=this.latestJoinResponse)||void 0===s?void 0:s.participant)||void 0===o?void 0:o.sid}}join(A,e,t,n){return Xt(this,void 0,void 0,(function*(){this.url=A,this.token=e,this.signalOpts=t,this.maxJoinAttempts=t.maxRetries;try{this.joinAttempts+=1,this.setupSignalClientCallbacks();const i=yield this.client.join(A,e,t,n);return this._isClosed=!1,this.latestJoinResponse=i,this.subscriberPrimary=i.subscriberPrimary,this.pcManager||(yield this.configure(i)),this.subscriberPrimary&&!i.fastPublish||this.negotiate(),this.clientConfiguration=i.clientConfiguration,setTimeout((()=>{this.emit(yi.SignalConnected)}),10),i}catch(i){if(i instanceof Fi&&i.reason===ui.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,e,t,n);throw i}}))}close(){return Xt(this,void 0,void 0,(function*(){const A=yield this.closingLock.lock();if(this.isClosed)A();else try{this._isClosed=!0,this.joinAttempts=0,this.emit(yi.Closing),this.removeAllListeners(),this.deregisterOnLineListener(),this.clearPendingReconnect(),yield this.cleanupPeerConnections(),yield this.cleanupClient()}finally{A()}}))}cleanupPeerConnections(){return Xt(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 e=A=>{A&&(A.close(),A.onbufferedamountlow=null,A.onclose=null,A.onclosing=null,A.onerror=null,A.onmessage=null,A.onopen=null)};e(this.lossyDC),e(this.lossyDCSub),e(this.reliableDC),e(this.reliableDCSub),this.lossyDC=void 0,this.lossyDCSub=void 0,this.reliableDC=void 0,this.reliableDCSub=void 0}))}cleanupClient(){return Xt(this,void 0,void 0,(function*(){yield this.client.close(),this.client.resetCallbacks()}))}addTrack(A){if(this.pendingTrackResolvers[A.cid])throw new Si("a track with the same ID has already been published");return new Promise(((e,t)=>{const n=setTimeout((()=>{delete this.pendingTrackResolvers[A.cid],t(new Fi("publication of local track timed out, no response from server",ui.InternalError))}),1e4);this.pendingTrackResolvers[A.cid]={resolve:A=>{clearTimeout(n),e(A)},reject:()=>{clearTimeout(n),t(new Error("Cancelled publication by calling unpublish"))}},this.client.sendAddTrack(A)}))}removeTrack(A){if(A.track&&this.pendingTrackResolvers[A.track.id]){const{reject:e}=this.pendingTrackResolvers[A.track.id];e&&e(),delete this.pendingTrackResolvers[A.track.id]}try{return this.pcManager.removeTrack(A),!0}catch(e){this.log.warn("failed to remove track",Object.assign(Object.assign({},this.logContext),{error:e}))}return!1}updateMuteStatus(A,e){this.client.sendMuteTrack(A,e)}get dataSubscriberReadyState(){var A;return null===(A=this.reliableDCSub)||void 0===A?void 0:A.readyState}getConnectedServerAddress(){return Xt(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 Xt(this,void 0,void 0,(function*(){var e,t;if(this.pcManager&&this.pcManager.currentState!==Os.NEW)return;this.participantSid=null===(e=A.participant)||void 0===e?void 0:e.sid;const n=this.makeRTCConfiguration(A);var i;this.pcManager=new Ns(n,A.subscriberPrimary,this.loggerOptions),this.emit(yi.TransportsCreated,this.pcManager.publisher,this.pcManager.subscriber),this.pcManager.onIceCandidate=(A,e)=>{this.client.sendIceCandidate(A,e)},this.pcManager.onPublisherOffer=A=>{this.client.sendOffer(A)},this.pcManager.onDataChannel=this.handleDataChannel,this.pcManager.onStateChange=(e,t,n)=>Xt(this,void 0,void 0,(function*(){if(this.log.debug("primary PC state changed ".concat(e),this.logContext),["closed","disconnected","failed"].includes(t)&&(this.publisherConnectionPromise=void 0),e===Os.CONNECTED){const e=this.pcState===ho.New;this.pcState=ho.Connected,e&&this.emit(yi.Connected,A)}else e===Os.FAILED&&this.pcState===ho.Connected&&(this.pcState=ho.Disconnected,this.handleDisconnect("peerconnection failed","failed"===n?qA.RR_SUBSCRIBER_FAILED:qA.RR_PUBLISHER_FAILED));const i=this.client.isDisconnected||this.client.currentState===cs.RECONNECTING,r=[Os.FAILED,Os.CLOSING,Os.CLOSED].includes(e);i&&r&&!this._isClosed&&this.emit(yi.Offline)})),this.pcManager.onTrack=A=>{this.emit(yi.MediaTrackAdded,A.track,A.streams[0],A.receiver)},void 0!==(i=null===(t=A.serverInfo)||void 0===t?void 0:t.protocol)&&i>13||this.createDataChannels()}))}setupSignalClientCallbacks(){this.client.onAnswer=A=>Xt(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,e)=>{this.pcManager&&(this.log.debug("got ICE candidate from peer",Object.assign(Object.assign({},this.logContext),{candidate:A,target:e})),this.pcManager.addIceCandidate(A,e))},this.client.onOffer=A=>Xt(this,void 0,void 0,(function*(){if(!this.pcManager)return;const e=yield this.pcManager.createSubscriberAnswerFromOffer(A);this.client.sendAnswer(e)})),this.client.onLocalTrackPublished=A=>{var e;if(this.log.debug("received trackPublishedResponse",Object.assign(Object.assign({},this.logContext),{cid:A.cid,track:null===(e=A.track)||void 0===e?void 0:e.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:t}=this.pendingTrackResolvers[A.cid];delete this.pendingTrackResolvers[A.cid],t(A.track)},this.client.onLocalTrackUnpublished=A=>{this.emit(yi.LocalTrackUnpublished,A)},this.client.onLocalTrackSubscribed=A=>{this.emit(yi.LocalTrackSubscribed,A)},this.client.onTokenRefresh=A=>{this.token=A},this.client.onRemoteMuteChanged=(A,e)=>{this.emit(yi.RemoteMute,A,e)},this.client.onSubscribedQualityUpdate=A=>{this.emit(yi.SubscribedQualityUpdate,A)},this.client.onRoomMoved=A=>{var e;this.participantSid=null===(e=A.participant)||void 0===e?void 0:e.sid,this.emit(yi.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 it.DISCONNECT:this.emit(yi.Disconnected,null==A?void 0:A.reason),this.close();break;case it.RECONNECT:this.fullReconnectOnNext=!0,this.handleDisconnect(uo);break;case it.RESUME:this.handleDisconnect(uo)}}}makeRTCConfiguration(A){var e;const t=Object.assign({},this.rtcConfig);if((null===(e=this.signalOpts)||void 0===e?void 0:e.e2eeEnabled)&&(this.log.debug("E2EE - setting up transports with insertable streams",this.logContext),t.encodedInsertableStreams=!0),A.iceServers&&!t.iceServers){const e=[];A.iceServers.forEach((A=>{const t={urls:A.urls};A.username&&(t.username=A.username),A.credential&&(t.credential=A.credential),e.push(t)})),t.iceServers=e}return A.clientConfiguration&&A.clientConfiguration.forceRelay===XA.ENABLED&&(t.iceTransportPolicy="relay"),t.sdpSemantics="unified-plan",t.continualGatheringPolicy="gather_continually",t}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(co,{ordered:!1,maxRetransmits:0}),this.reliableDC=this.pcManager.createPublisherDataChannel(lo,{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,e,t){return Xt(this,void 0,void 0,(function*(){if(ar())return yield this.createTransceiverRTCRtpSender(A,e,t);if(cr())return this.log.warn("using add-track fallback",this.logContext),yield this.createRTCRtpSender(A.mediaStreamTrack);throw new Pi("Required webRTC APIs not supported on this device")}))}createSimulcastSender(A,e,t,n){return Xt(this,void 0,void 0,(function*(){if(ar())return this.createSimulcastTransceiverSender(A,e,t,n);if(cr())return this.log.debug("using add-track fallback",this.logContext),this.createRTCRtpSender(A.mediaStreamTrack);throw new Pi("Cannot stream on this device")}))}createTransceiverRTCRtpSender(A,e,t){return Xt(this,void 0,void 0,(function*(){if(!this.pcManager)throw new Pi("publisher is closed");const n=[];A.mediaStream&&n.push(A.mediaStream),Mr(A)&&(A.codec=e.videoCodec);const i={direction:"sendonly",streams:n};return t&&(i.sendEncodings=t),(yield this.pcManager.addPublisherTransceiver(A.mediaStreamTrack,i)).sender}))}createSimulcastTransceiverSender(A,e,t,n){return Xt(this,void 0,void 0,(function*(){if(!this.pcManager)throw new Pi("publisher is closed");const i={direction:"sendonly"};n&&(i.sendEncodings=n);const r=yield this.pcManager.addPublisherTransceiver(e.mediaStreamTrack,i);if(t.videoCodec)return A.setSimulcastTrackSender(t.videoCodec,r.sender),r.sender}))}createRTCRtpSender(A){return Xt(this,void 0,void 0,(function*(){if(!this.pcManager)throw new Pi("publisher is closed");return this.pcManager.addPublisherTrack(A)}))}attemptReconnect(A){return Xt(this,void 0,void 0,(function*(){var e,t,n;if(!this._isClosed)if(this.attemptingReconnect)Vt.warn("already attempting reconnect, returning early",this.logContext);else{(null===(e=this.clientConfiguration)||void 0===e?void 0:e.resumeConnection)!==XA.DISABLED&&(null!==(n=null===(t=this.pcManager)||void 0===t?void 0:t.currentState)&&void 0!==n?n:Os.NEW)!==Os.NEW||(this.fullReconnectOnNext=!0);try{this.attemptingReconnect=!0,this.fullReconnectOnNext?yield this.restartConnection():yield this.resumeConnection(A),this.clearPendingReconnect(),this.fullReconnectOnNext=!1}catch(i){this.reconnectAttempts+=1;let A=!0;i instanceof Pi?(this.log.debug("received unrecoverable error",Object.assign(Object.assign({},this.logContext),{error:i})),A=!1):i instanceof Uo||(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(yi.Disconnected),yield this.close())}finally{this.attemptingReconnect=!1}}}))}getNextRetryDelay(A){try{return this.reconnectPolicy.nextRetryDelayInMs(A)}catch(e){this.log.warn("encountered error in reconnect policy",Object.assign(Object.assign({},this.logContext),{error:e}))}return null}restartConnection(A){return Xt(this,void 0,void 0,(function*(){var e,t,n;try{if(!this.url||!this.token)throw new Pi("could not reconnect, url or token not saved");let t;this.log.info("reconnecting, attempt: ".concat(this.reconnectAttempts),this.logContext),this.emit(yi.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 Uo;t=yield this.join(null!=A?A:this.url,this.token,this.signalOpts)}catch(i){if(i instanceof Fi&&i.reason===ui.NotAllowed)throw new Pi("could not reconnect, token might be expired");throw new Uo}if(this.shouldFailNext)throw this.shouldFailNext=!1,new Error("simulated failure");if(this.client.setReconnected(),this.emit(yi.SignalRestarted,t),yield this.waitForPCReconnected(),this.client.currentState!==cs.CONNECTED)throw new Uo("Signal connection got severed during reconnect");null===(e=this.regionUrlProvider)||void 0===e||e.resetAttempts(),this.emit(yi.Restarted)}catch(r){const A=yield null===(t=this.regionUrlProvider)||void 0===t?void 0:t.getNextBestRegionUrl();if(A)return void(yield this.restartConnection(A));throw null===(n=this.regionUrlProvider)||void 0===n||n.resetAttempts(),r}}))}resumeConnection(A){return Xt(this,void 0,void 0,(function*(){var e;if(!this.url||!this.token)throw new Pi("could not reconnect, url or token not saved");if(!this.pcManager)throw new Pi("publisher and subscriber connections unset");let t;this.log.info("resuming signal connection, attempt ".concat(this.reconnectAttempts),this.logContext),this.emit(yi.Resuming);try{this.setupSignalClientCallbacks(),t=yield this.client.reconnect(this.url,this.token,this.participantSid,A)}catch(n){let A="";if(n instanceof Error&&(A=n.message,this.log.error(n.message,Object.assign(Object.assign({},this.logContext),{error:n}))),n instanceof Fi&&n.reason===ui.NotAllowed)throw new Pi("could not reconnect, token might be expired");if(n instanceof Fi&&n.reason===ui.LeaveRequest)throw n;throw new Uo(A)}if(this.emit(yi.SignalResumed),t){const A=this.makeRTCConfiguration(t);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!==cs.CONNECTED)throw new Uo("Signal connection got severed during reconnect");this.client.setReconnected(),"open"===(null===(e=this.reliableDC)||void 0===e?void 0:e.readyState)&&null===this.reliableDC.id&&this.createDataChannels(),this.emit(yi.Resumed)}))}waitForPCInitialConnection(A,e){return Xt(this,void 0,void 0,(function*(){if(!this.pcManager)throw new Pi("PC manager is closed");yield this.pcManager.ensurePCTransportConnection(e,A)}))}waitForPCReconnected(){return Xt(this,void 0,void 0,(function*(){this.pcState=ho.Reconnecting,this.log.debug("waiting for peer connection to reconnect",this.logContext);try{if(yield or(2e3),!this.pcManager)throw new Pi("PC manager is closed");yield this.pcManager.ensurePCTransportConnection(void 0,this.peerConnectionTimeout),this.pcState=ho.Connected}catch(A){throw this.pcState=ho.Disconnected,new Fi("could not establish PC connection, ".concat(A.message),ui.InternalError)}}))}publishRpcResponse(A,e,t,n){return Xt(this,void 0,void 0,(function*(){const i=new de({destinationIdentities:[A],kind:le.RELIABLE,value:{case:"rpcResponse",value:new Ce({requestId:e,value:n?{case:"error",value:n.toProto()}:{case:"payload",value:null!=t?t:""}})}});yield this.sendDataPacket(i,le.RELIABLE)}))}publishRpcAck(A,e){return Xt(this,void 0,void 0,(function*(){const t=new de({destinationIdentities:[A],kind:le.RELIABLE,value:{case:"rpcAck",value:new ve({requestId:e})}});yield this.sendDataPacket(t,le.RELIABLE)}))}sendDataPacket(A,e){return Xt(this,void 0,void 0,(function*(){const t=A.toBinary();yield this.ensurePublisherConnected(e);const n=this.dataChannelForKind(e);n&&n.send(t),this.updateAndEmitDCBufferStatus(e)}))}waitForBufferStatusLow(A){return new Promise(((e,t)=>Xt(this,void 0,void 0,(function*(){if(this.isBufferStatusLow(A))e();else{const n=()=>t("Engine closed");for(this.once(yi.Closing,n);!this.dcBufferStatus.get(A);)yield or(10);this.off(yi.Closing,n),e()}}))))}ensureDataTransportConnected(A){return Xt(this,arguments,void 0,(function(A){var e=this;let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.subscriberPrimary;return function*(){var n;if(!e.pcManager)throw new Pi("PC manager is closed");const i=t?e.pcManager.subscriber:e.pcManager.publisher,r=t?"Subscriber":"Publisher";if(!i)throw new Fi("".concat(r," connection not set"),ui.InternalError);let s=!1;t||e.dataChannelForKind(A,t)||(e.createDataChannels(),s=!0),s||t||e.pcManager.publisher.isICEConnected||"checking"===e.pcManager.publisher.getICEConnectionState()||(s=!0),s&&e.negotiate();const o=e.dataChannelForKind(A,t);if("open"===(null==o?void 0:o.readyState))return;const a=(new Date).getTime()+e.peerConnectionTimeout;for(;(new Date).getTime()<a;){if(i.isICEConnected&&"open"===(null===(n=e.dataChannelForKind(A,t))||void 0===n?void 0:n.readyState))return;yield or(50)}throw new Fi("could not establish ".concat(r," connection, state: ").concat(i.getICEConnectionState()),ui.InternalError)}()}))}ensurePublisherConnected(A){return Xt(this,void 0,void 0,(function*(){this.publisherConnectionPromise||(this.publisherConnectionPromise=this.ensureDataTransportConnected(A,!1)),yield this.publisherConnectionPromise}))}verifyTransport(){return!!this.pcManager&&this.pcManager.currentState===Os.CONNECTED&&!(!this.client.ws||this.client.ws.readyState===WebSocket.CLOSED)}negotiate(){return Xt(this,void 0,void 0,(function*(){return new Promise(((A,e)=>Xt(this,void 0,void 0,(function*(){if(!this.pcManager)return void e(new Hi("PC manager is closed"));this.pcManager.requirePublisher(),0!=this.pcManager.publisher.getTransceivers().length||this.lossyDC||this.reliableDC||this.createDataChannels();const t=new AbortController,n=()=>{t.abort(),this.log.debug("engine disconnected while negotiation was ongoing",this.logContext),A()};this.isClosed&&e("cannot negotiate on closed engine"),this.on(yi.Closing,n),this.pcManager.publisher.once(Fs,(A=>{const e=new Map;A.forEach((A=>{const t=A.codec.toLowerCase();var n;n=t,$i.includes(n)&&e.set(A.payload,t)})),this.emit(yi.RTPVideoMapUpdate,e)}));try{yield this.pcManager.negotiate(t),A()}catch(i){i instanceof Hi&&(this.fullReconnectOnNext=!0),this.handleDisconnect("negotiation",qA.RR_UNKNOWN),e(i)}finally{this.off(yi.Closing,n)}}))))}))}dataChannelForKind(A,e){if(e){if(A===le.LOSSY)return this.lossyDCSub;if(A===le.RELIABLE)return this.reliableDCSub}else{if(A===le.LOSSY)return this.lossyDC;if(A===le.RELIABLE)return this.reliableDC}}sendSyncState(A,e){var t,n;if(!this.pcManager)return void this.log.warn("sync state cannot be sent without peer connection setup",this.logContext);const i=this.pcManager.subscriber.getLocalDescription(),r=this.pcManager.subscriber.getRemoteDescription(),s=null===(n=null===(t=this.signalOpts)||void 0===t?void 0:t.autoSubscribe)||void 0===n||n,o=new Array,a=new Array;A.forEach((A=>{A.isDesired!==s&&o.push(A.trackSid),A.isEnabled||a.push(A.trackSid)})),this.client.sendSyncState(new Ct({answer:i?hs({sdp:i.sdp,type:i.type}):void 0,offer:r?hs({sdp:r.sdp,type:r.type}):void 0,subscription:new ze({trackSids:o,subscribe:!s,participantTracks:[]}),publishTracks:Zr(e),dataChannels:this.dataChannelsInfo(),trackSidsDisabled:a}))}failNext(){this.shouldFailNext=!0}dataChannelsInfo(){const A=[],e=(e,t)=>{void 0!==(null==e?void 0:e.id)&&null!==e.id&&A.push(new yt({label:e.label,id:e.id,target:t}))};return e(this.dataChannelForKind(le.LOSSY),Oe.PUBLISHER),e(this.dataChannelForKind(le.RELIABLE),Oe.PUBLISHER),e(this.dataChannelForKind(le.LOSSY,!0),Oe.SUBSCRIBER),e(this.dataChannelForKind(le.RELIABLE,!0),Oe.SUBSCRIBER),A}clearReconnectTimeout(){this.reconnectTimeout&&_i.clearTimeout(this.reconnectTimeout)}clearPendingReconnect(){this.clearReconnectTimeout(),this.reconnectAttempts=0}registerOnLineListener(){pr()&&window.addEventListener("online",this.handleBrowserOnLine)}deregisterOnLineListener(){pr()&&window.removeEventListener("online",this.handleBrowserOnLine)}}class Uo extends Error{}class ko{constructor(A,e){this.lastUpdateAt=0,this.settingsCacheTime=3e3,this.attemptedRegions=[],this.serverUrl=new URL(A),this.token=e}updateToken(A){this.token=A}isCloud(){return fr(this.serverUrl)}getServerUrl(){return this.serverUrl}getNextBestRegionUrl(A){return Xt(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 e=this.regionSettings.regions.filter((A=>!this.attemptedRegions.find((e=>e.url===A.url))));if(e.length>0){const A=e[0];return this.attemptedRegions.push(A),Vt.debug("next region: ".concat(A.region)),A.url}return null}))}resetAttempts(){this.attemptedRegions=[]}fetchRegionSettings(A){return Xt(this,void 0,void 0,(function*(){const e=yield fetch("".concat((t=this.serverUrl,"".concat(t.protocol.replace("ws","http"),"//").concat(t.host,"/settings")),"/regions"),{headers:{authorization:"Bearer ".concat(this.token)},signal:A});var t;if(e.ok){const A=yield e.json();return this.lastUpdateAt=Date.now(),A}throw new Fi("Could not fetch region settings: ".concat(e.statusText),401===e.status?ui.NotAllowed:ui.InternalError,e.status)}))}setServerReportedRegions(A){this.regionSettings=A,this.lastUpdateAt=Date.now()}}class Eo{get info(){return this._info}constructor(A,e,t){this.reader=e,this.totalByteSize=t,this._info=A,this.bytesReceived=0}}class Fo extends Eo{handleChunkReceived(A){var e;this.bytesReceived+=A.content.byteLength;const t=this.totalByteSize?this.bytesReceived/this.totalByteSize:void 0;null===(e=this.onProgress)||void 0===e||e.call(this,t)}[Symbol.asyncIterator](){const A=this.reader.getReader();return{next:()=>Xt(this,void 0,void 0,(function*(){try{const{done:e,value:t}=yield A.read();return e?{done:!0,value:void 0}:(this.handleChunkReceived(t),{done:!1,value:t.content})}catch(e){return{done:!0,value:void 0}}})),return(){return Xt(this,void 0,void 0,(function*(){return A.releaseLock(),{done:!0,value:void 0}}))}}}readAll(){return Xt(this,void 0,void 0,(function*(){var A,e,t,n;let i=new Set;try{for(var r,s=!0,o=Yt(this);!(A=(r=yield o.next()).done);s=!0){n=r.value,s=!1;const A=n;i.add(A)}}catch(a){e={error:a}}finally{try{s||A||!(t=o.return)||(yield t.call(o))}finally{if(e)throw e.error}}return Array.from(i)}))}}class To extends Eo{constructor(A,e,t){super(A,e,t),this.receivedChunks=new Map}handleChunkReceived(A){var e;const t=Dr(A.chunkIndex),n=this.receivedChunks.get(t);if(n&&n.version>A.version)return;this.receivedChunks.set(t,A),this.bytesReceived+=A.content.byteLength;const i=this.totalByteSize?this.bytesReceived/this.totalByteSize:void 0;null===(e=this.onProgress)||void 0===e||e.call(this,i)}[Symbol.asyncIterator](){const A=this.reader.getReader(),e=new TextDecoder;return{next:()=>Xt(this,void 0,void 0,(function*(){try{const{done:t,value:n}=yield A.read();return t?{done:!0,value:void 0}:(this.handleChunkReceived(n),{done:!1,value:e.decode(n.content)})}catch(t){return{done:!0,value:void 0}}})),return(){return Xt(this,void 0,void 0,(function*(){return A.releaseLock(),{done:!0,value:void 0}}))}}}readAll(){return Xt(this,void 0,void 0,(function*(){var A,e,t,n;let i="";try{for(var r,s=!0,o=Yt(this);!(A=(r=yield o.next()).done);s=!0)n=r.value,s=!1,i+=n}catch(a){e={error:a}}finally{try{s||A||!(t=o.return)||(yield t.call(o))}finally{if(e)throw e.error}}return i}))}}class So{constructor(A,e,t){this.writableStream=A,this.defaultWriter=A.getWriter(),this.onClose=t,this.info=e}write(A){return this.defaultWriter.write(A)}close(){return Xt(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 Io extends So{}class Po extends So{}class Ho extends Ji{constructor(A,e,t,n,i){super(A,t,i),this.sid=e,this.receiver=n}get isLocal(){return!1}setMuted(A){this.isMuted!==A&&(this.isMuted=A,this._mediaStreamTrack.enabled=!A,this.emit(A?Qi.Muted:Qi.Unmuted,this))}setMediaStream(A){this.mediaStream=A;const e=t=>{t.track===this._mediaStreamTrack&&(A.removeEventListener("removetrack",e),this.receiver&&"playoutDelayHint"in this.receiver&&(this.receiver.playoutDelayHint=void 0),this.receiver=void 0,this._currentBitrate=0,this.emit(Qi.Ended,this))};A.addEventListener("removetrack",e)}start(){this.startMonitor(),super.enable()}stop(){this.stopMonitor(),super.disable()}getRTCStatsReport(){return Xt(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()),Gs)),"undefined"!=typeof RTCRtpReceiver&&"getSynchronizationSources"in RTCRtpReceiver&&this.registerTimeSyncUpdate()}registerTimeSyncUpdate(){const A=()=>{var e;this.timeSyncHandle=requestAnimationFrame((()=>A()));const t=null===(e=this.receiver)||void 0===e?void 0:e.getSynchronizationSources()[0];if(t){const{timestamp:A,rtpTimestamp:e}=t;e&&this.rtpTimestamp!==e&&(this.emit(Qi.TimeSyncUpdate,{timestamp:A,rtpTimestamp:e}),this.rtpTimestamp=e)}};A()}}class Ro extends Ho{constructor(A,e,t,n,i,r){super(A,e,Ji.Kind.Audio,t,r),this.monitorReceiver=()=>Xt(this,void 0,void 0,(function*(){if(!this.receiver)return void(this._currentBitrate=0);const A=yield this.getReceiverStats();A&&this.prevStats&&this.receiver&&(this._currentBitrate=js(A,this.prevStats)),this.prevStats=A})),this.audioContext=n,this.webAudioPluginNodes=[],i&&(this.sinkId=i.deviceId)}setVolume(A){var e;for(const t of this.attachedElements)this.audioContext?null===(e=this.gainNode)||void 0===e||e.gain.setTargetAtTime(A,0,.1):t.volume=A;mr()&&this._mediaStreamTrack._setVolume(A),this.elementVolume=A}getVolume(){if(this.elementVolume)return this.elementVolume;if(mr())return 1;let A=0;return this.attachedElements.forEach((e=>{e.volume>A&&(A=e.volume)})),A}setSinkId(A){return Xt(this,void 0,void 0,(function*(){this.sinkId=A,yield Promise.all(this.attachedElements.map((e=>{if(lr(e))return e.setSinkId(A)})))}))}attach(A){const e=0===this.attachedElements.length;return A?super.attach(A):A=super.attach(),this.sinkId&&lr(A)&&A.setSinkId(this.sinkId).catch((A=>{this.log.error("Failed to set sink id on remote audio track",A,this.logContext)})),this.audioContext&&e&&(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 e;return A?(e=super.detach(A),this.audioContext&&(this.attachedElements.length>0?this.connectWebAudio(this.audioContext,this.attachedElements[0]):this.disconnectWebAudio())):(e=super.detach(),this.disconnectWebAudio()),e}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,e){this.disconnectWebAudio(),this.sourceNode=A.createMediaStreamSource(e.srcObject);let t=this.sourceNode;this.webAudioPluginNodes.forEach((A=>{t.connect(A),t=A})),this.gainNode=A.createGain(),t.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(Qi.AudioPlaybackFailed,new Error("Audio Context couldn't be started automatically"))})).catch((A=>{this.emit(Qi.AudioPlaybackFailed,A)}))}disconnectWebAudio(){var A,e;null===(A=this.gainNode)||void 0===A||A.disconnect(),null===(e=this.sourceNode)||void 0===e||e.disconnect(),this.gainNode=void 0,this.sourceNode=void 0}getReceiverStats(){return Xt(this,void 0,void 0,(function*(){if(!this.receiver||!this.receiver.getStats)return;let A;return(yield this.receiver.getStats()).forEach((e=>{"inbound-rtp"===e.type&&(A={type:"audio",streamId:e.id,timestamp:e.timestamp,jitter:e.jitter,bytesReceived:e.bytesReceived,concealedSamples:e.concealedSamples,concealmentEvents:e.concealmentEvents,silentConcealedSamples:e.silentConcealedSamples,silentConcealmentEvents:e.silentConcealmentEvents,totalAudioEnergy:e.totalAudioEnergy,totalSamplesDuration:e.totalSamplesDuration})})),A}))}}class Do extends Ho{constructor(A,e,t,n,i){super(A,e,Ji.Kind.Video,t,i),this.elementInfos=[],this.monitorReceiver=()=>Xt(this,void 0,void 0,(function*(){if(!this.receiver)return void(this._currentBitrate=0);const A=yield this.getReceiverStats();A&&this.prevStats&&this.receiver&&(this._currentBitrate=js(A,this.prevStats)),this.prevStats=A})),this.debouncedHandleResize=Us((()=>{this.updateDimensions()}),100),this.adaptiveStreamSettings=n}get isAdaptiveStream(){return void 0!==this.adaptiveStreamSettings}get mediaStreamTrack(){return this._mediaStreamTrack}setMuted(A){super.setMuted(A),this.attachedElements.forEach((e=>{A?Xi(this._mediaStreamTrack,e):Wi(this._mediaStreamTrack,e)}))}attach(A){if(A?super.attach(A):A=super.attach(),this.adaptiveStreamSettings&&void 0===this.elementInfos.find((e=>e.element===A))){const e=new xo(A);this.observeElementInfo(e)}return A}observeElementInfo(A){this.adaptiveStreamSettings&&void 0===this.elementInfos.find((e=>e===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 e=this.elementInfos.filter((e=>e===A));for(const t of e)t.stopObserving();this.elementInfos=this.elementInfos.filter((e=>e!==A)),this.updateVisibility(),this.debouncedHandleResize()}detach(A){let e=[];if(A)return this.stopObservingElement(A),super.detach(A);e=super.detach();for(const t of e)this.stopObservingElement(t);return e}getDecoderImplementation(){var A;return null===(A=this.prevStats)||void 0===A?void 0:A.decoderImplementation}getReceiverStats(){return Xt(this,void 0,void 0,(function*(){if(!this.receiver||!this.receiver.getStats)return;const A=yield this.receiver.getStats();let e,t="",n=new Map;return A.forEach((A=>{"inbound-rtp"===A.type?(t=A.codecId,e={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&&n.set(A.id,A)})),e&&""!==t&&n.get(t)&&(e.mimeType=n.get(t).mimeType),e}))}stopObservingElement(A){const e=this.elementInfos.filter((e=>e.element===A));for(const t of e)this.stopObservingElementInfo(t)}handleAppVisibilityChanged(){const A=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return Xt(this,void 0,void 0,(function*(){yield A.handleAppVisibilityChanged.call(this),this.isAdaptiveStream&&this.updateVisibility()}))}updateVisibility(){var A,e;const t=this.elementInfos.reduce(((A,e)=>Math.max(A,e.visibilityChangedAt||0)),0),n=!(null!==(e=null===(A=this.adaptiveStreamSettings)||void 0===A?void 0:A.pauseVideoInBackground)&&void 0!==e&&!e)&&this.isInBackground,i=this.elementInfos.some((A=>A.pictureInPicture)),r=this.elementInfos.some((A=>A.visible))&&!n||i;this.lastVisible!==r&&(!r&&Date.now()-t<100?_i.setTimeout((()=>{this.updateVisibility()}),100):(this.lastVisible=r,this.emit(Qi.VisibilityChanged,r,this)))}updateDimensions(){var A,e;let t=0,n=0;const i=this.getPixelDensity();for(const r of this.elementInfos){const A=r.width()*i,e=r.height()*i;A+e>t+n&&(t=A,n=e)}(null===(A=this.lastDimensions)||void 0===A?void 0:A.width)===t&&(null===(e=this.lastDimensions)||void 0===e?void 0:e.height)===n||(this.lastDimensions={width:t,height:n},this.emit(Qi.VideoDimensionsChanged,this.lastDimensions,this))}getPixelDensity(){var A;const e=null===(A=this.adaptiveStreamSettings)||void 0===A?void 0:A.pixelDensity;return"screen"===e?vr():e||(vr()>2?2:1)}}class xo{get visible(){return this.isPiP||this.isIntersecting}get pictureInPicture(){return this.isPiP}constructor(A,e){this.onVisibilityChanged=A=>{var e;const{target:t,isIntersecting:n}=A;t===this.element&&(this.isIntersecting=n,this.isPiP=Lo(this.element),this.visibilityChangedAt=Date.now(),null===(e=this.handleVisibilityChanged)||void 0===e||e.call(this))},this.onEnterPiP=()=>{var A,e,t;null===(e=null===(A=window.documentPictureInPicture)||void 0===A?void 0:A.window)||void 0===e||e.addEventListener("pagehide",this.onLeavePiP),this.isPiP=Lo(this.element),null===(t=this.handleVisibilityChanged)||void 0===t||t.call(this)},this.onLeavePiP=()=>{var A;this.isPiP=Lo(this.element),null===(A=this.handleVisibilityChanged)||void 0===A||A.call(this)},this.element=A,this.isIntersecting=null!=e?e:Oo(A),this.isPiP=pr()&&Lo(A),this.visibilityChangedAt=0}width(){return this.element.clientWidth}height(){return this.element.clientHeight}observe(){var A,e,t;this.isIntersecting=Oo(this.element),this.isPiP=Lo(this.element),this.element.handleResize=()=>{var A;null===(A=this.handleResize)||void 0===A||A.call(this)},this.element.handleVisibilityChanged=this.onVisibilityChanged,Er().observe(this.element),Ur().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===(t=null===(e=window.documentPictureInPicture)||void 0===e?void 0:e.window)||void 0===t||t.addEventListener("pagehide",this.onLeavePiP)}stopObserving(){var A,e,t,n,i;null===(A=Er())||void 0===A||A.unobserve(this.element),null===(e=Ur())||void 0===e||e.unobserve(this.element),this.element.removeEventListener("enterpictureinpicture",this.onEnterPiP),this.element.removeEventListener("leavepictureinpicture",this.onLeavePiP),null===(t=window.documentPictureInPicture)||void 0===t||t.removeEventListener("enter",this.onEnterPiP),null===(i=null===(n=window.documentPictureInPicture)||void 0===n?void 0:n.window)||void 0===i||i.removeEventListener("pagehide",this.onLeavePiP)}}function Lo(A){var e,t;return document.pictureInPictureElement===A||!!(null===(e=window.documentPictureInPicture)||void 0===e?void 0:e.window)&&Oo(A,null===(t=window.documentPictureInPicture)||void 0===t?void 0:t.window)}function Oo(A,e){const t=e||window;let n=A.offsetTop,i=A.offsetLeft;const r=A.offsetWidth,s=A.offsetHeight,{hidden:o}=A,{display:a}=getComputedStyle(A);for(;A.offsetParent;)n+=(A=A.offsetParent).offsetTop,i+=A.offsetLeft;return n<t.pageYOffset+t.innerHeight&&i<t.pageXOffset+t.innerWidth&&n+s>t.pageYOffset&&i+r>t.pageXOffset&&!o&&"none"!==a}class Mo extends Zt.EventEmitter{constructor(A,e,t,n){var i;super(),this.metadataMuted=!1,this.encryption=se.NONE,this.log=Vt,this.handleMuted=()=>{this.emit(Qi.Muted)},this.handleUnmuted=()=>{this.emit(Qi.Unmuted)},this.log=Gt(null!==(i=null==n?void 0:n.loggerName)&&void 0!==i?i:Mt.Publication),this.loggerContextCb=this.loggerContextCb,this.setMaxListeners(100),this.kind=A,this.trackSid=e,this.trackName=t,this.source=Ji.Source.Unknown}setTrack(A){this.track&&(this.track.off(Qi.Muted,this.handleMuted),this.track.off(Qi.Unmuted,this.handleUnmuted)),this.track=A,A&&(A.on(Qi.Muted,this.handleMuted),A.on(Qi.Unmuted,this.handleUnmuted))}get logContext(){var A;return Object.assign(Object.assign({},null===(A=this.loggerContextCb)||void 0===A?void 0:A.call(this)),zr(this))}get isMuted(){return this.metadataMuted}get isEnabled(){return!0}get isSubscribed(){return void 0!==this.track}get isEncrypted(){return this.encryption!==se.NONE}get audioTrack(){if(Or(this.track))return this.track}get videoTrack(){if(Mr(this.track))return this.track}updateInfo(A){this.trackSid=A.sid,this.trackName=A.name,this.source=Ji.sourceFromProto(A.source),this.mimeType=A.mimeType,this.kind===Ji.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}))}}(mo=(po=Mo||(Mo={})).SubscriptionStatus||(po.SubscriptionStatus={})).Desired="desired",mo.Subscribed="subscribed",mo.Unsubscribed="unsubscribed",(fo=po.PermissionStatus||(po.PermissionStatus={})).Allowed="allowed",fo.NotAllowed="not_allowed";class No extends Mo{get isUpstreamPaused(){var A;return null===(A=this.track)||void 0===A?void 0:A.isUpstreamPaused}constructor(A,e,t,n){super(A,e.sid,e.name,n),this.track=void 0,this.handleTrackEnded=()=>{this.emit(Qi.Ended)},this.updateInfo(e),this.setTrack(t)}setTrack(A){this.track&&this.track.off(Qi.Ended,this.handleTrackEnded),super.setTrack(A),A&&A.on(Qi.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 Xt(this,void 0,void 0,(function*(){var A;return null===(A=this.track)||void 0===A?void 0:A.mute()}))}unmute(){return Xt(this,void 0,void 0,(function*(){var A;return null===(A=this.track)||void 0===A?void 0:A.unmute()}))}pauseUpstream(){return Xt(this,void 0,void 0,(function*(){var A;yield null===(A=this.track)||void 0===A?void 0:A.pauseUpstream()}))}resumeUpstream(){return Xt(this,void 0,void 0,(function*(){var A;yield null===(A=this.track)||void 0===A?void 0:A.resumeUpstream()}))}getTrackFeatures(){var A;if(Or(this.track)){const e=this.track.getSourceTrackSettings(),t=new Set;return e.autoGainControl&&t.add(ZA.TF_AUTO_GAIN_CONTROL),e.echoCancellation&&t.add(ZA.TF_ECHO_CANCELLATION),e.noiseSuppression&&t.add(ZA.TF_NOISE_SUPPRESSION),e.channelCount&&e.channelCount>1&&t.add(ZA.TF_STEREO),(null===(A=this.options)||void 0===A?void 0:A.dtx)||t.add(ZA.TF_NO_DTX),this.track.enhancedNoiseCancellation&&t.add(ZA.TF_ENHANCED_NOISE_CANCELLATION),Array.from(t.values())}return[]}}function Ko(A,e){return Xt(this,void 0,void 0,(function*(){null!=A||(A={});let t=!1;const{audioProcessor:n,videoProcessor:i,optionsWithoutProcessor:r}=As(A);let s=r.audio,o=r.video;if(n&&"object"==typeof r.audio&&(r.audio.processor=n),i&&"object"==typeof r.video&&(r.video.processor=i),A.audio&&"object"==typeof r.audio&&"string"==typeof r.audio.deviceId){const A=r.audio.deviceId;r.audio.deviceId={exact:A},t=!0,s=Object.assign(Object.assign({},r.audio),{deviceId:{ideal:A}})}if(r.video&&"object"==typeof r.video&&"string"==typeof r.video.deviceId){const A=r.video.deviceId;r.video.deviceId={exact:A},t=!0,o=Object.assign(Object.assign({},r.video),{deviceId:{ideal:A}})}(!0===r.audio||"object"==typeof r.audio&&!r.audio.deviceId)&&(r.audio={deviceId:"default"}),!0===r.video?r.video={deviceId:"default"}:"object"!=typeof r.video||r.video.deviceId||(r.video.deviceId="default");const a=jr(r,Rs,Ds),c=Wr(a),d=navigator.mediaDevices.getUserMedia(c);r.audio&&(ns.userMediaPromiseMap.set("audioinput",d),d.catch((()=>ns.userMediaPromiseMap.delete("audioinput")))),r.video&&(ns.userMediaPromiseMap.set("videoinput",d),d.catch((()=>ns.userMediaPromiseMap.delete("videoinput"))));try{const A=yield d;return yield Promise.all(A.getTracks().map((t=>Xt(this,void 0,void 0,(function*(){const r="audio"===t.kind;let s,o=r?a.audio:a.video;"boolean"!=typeof o&&o||(o={});const d=r?c.audio:c.video;"boolean"!=typeof d&&(s=d);const l=t.getSettings().deviceId;(null==s?void 0:s.deviceId)&&Pr(s.deviceId)!==l?s.deviceId=l:s||(s={deviceId:l});const u=function(A,e,t){switch(A.kind){case"audio":return new Ws(A,e,!1,void 0,t);case"video":return new ro(A,e,!1,t);default:throw new Si("unsupported track type: ".concat(A.kind))}}(t,s,e);return u.kind===Ji.Kind.Video?u.source=Ji.Source.Camera:u.kind===Ji.Kind.Audio&&(u.source=Ji.Source.Microphone),u.mediaStream=A,Or(u)&&n?yield u.setProcessor(n):Mr(u)&&i&&(yield u.setProcessor(i)),u})))))}catch(l){if(!t)throw l;return Ko(Object.assign(Object.assign({},A),{audio:s,video:o}),e)}}))}(wo=Bo||(Bo={})).Excellent="excellent",wo.Good="good",wo.Poor="poor",wo.Lost="lost",wo.Unknown="unknown";class _o extends Zt.EventEmitter{get logContext(){var A,e;return Object.assign({},null===(e=null===(A=this.loggerOptions)||void 0===A?void 0:A.loggerContextCb)||void 0===e?void 0:e.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===ie.AGENT}get isActive(){var A;return(null===(A=this.participantInfo)||void 0===A?void 0:A.state)===ne.ACTIVE}get kind(){return this._kind}get attributes(){return Object.freeze(Object.assign({},this._attributes))}constructor(A,e,t,n,i,r){let s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:ie.STANDARD;var o;super(),this.audioLevel=0,this.isSpeaking=!1,this._connectionQuality=Bo.Unknown,this.log=Vt,this.log=Gt(null!==(o=null==r?void 0:r.loggerName)&&void 0!==o?o:Mt.Participant),this.loggerOptions=r,this.setMaxListeners(100),this.sid=A,this.identity=e,this.name=t,this.metadata=n,this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.trackPublications=new Map,this._kind=s,this._attributes=null!=i?i:{}}getTrackPublications(){return Array.from(this.trackPublications.values())}getTrackPublication(A){for(const[,e]of this.trackPublications)if(e.source===A)return e}getTrackPublicationByName(A){for(const[,e]of this.trackPublications)if(e.trackName===A)return e}waitUntilActive(){return this.isActive?Promise.resolve():(this.activeFuture||(this.activeFuture=new Ir,this.once(vi.Active,(()=>{var A,e;null===(e=null===(A=this.activeFuture)||void 0===A?void 0:A.resolve)||void 0===e||e.call(A),this.activeFuture=void 0}))),this.activeFuture.promise)}get connectionQuality(){return this._connectionQuality}get isCameraEnabled(){var A;const e=this.getTrackPublication(Ji.Source.Camera);return!(null===(A=null==e?void 0:e.isMuted)||void 0===A||A)}get isMicrophoneEnabled(){var A;const e=this.getTrackPublication(Ji.Source.Microphone);return!(null===(A=null==e?void 0:e.isMuted)||void 0===A||A)}get isScreenShareEnabled(){return!!this.getTrackPublication(Ji.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 e;return!(this.participantInfo&&this.participantInfo.sid===A.sid&&this.participantInfo.version>A.version||(this.identity=A.identity,this.sid=A.sid,this._setName(A.name),this._setMetadata(A.metadata),this._setAttributes(A.attributes),A.state===ne.ACTIVE&&(null===(e=this.participantInfo)||void 0===e?void 0:e.state)!==ne.ACTIVE&&this.emit(vi.Active),A.permission&&this.setPermissions(A.permission),this.participantInfo=A,0))}_setMetadata(A){const e=this.metadata!==A,t=this.metadata;this.metadata=A,e&&this.emit(vi.ParticipantMetadataChanged,t)}_setName(A){const e=this.name!==A;this.name=A,e&&this.emit(vi.ParticipantNameChanged,A)}_setAttributes(A){const e=function(A,e){var t;void 0===A&&(A={}),void 0===e&&(e={});const n=[...Object.keys(e),...Object.keys(A)],i={};for(const r of n)A[r]!==e[r]&&(i[r]=null!==(t=e[r])&&void 0!==t?t:"");return i}(this.attributes,A);this._attributes=A,Object.keys(e).length>0&&this.emit(vi.AttributesChanged,e)}setPermissions(A){var e,t,n,i,r,s;const o=this.permissions,a=A.canPublish!==(null===(e=this.permissions)||void 0===e?void 0:e.canPublish)||A.canSubscribe!==(null===(t=this.permissions)||void 0===t?void 0:t.canSubscribe)||A.canPublishData!==(null===(n=this.permissions)||void 0===n?void 0:n.canPublishData)||A.hidden!==(null===(i=this.permissions)||void 0===i?void 0:i.hidden)||A.recorder!==(null===(r=this.permissions)||void 0===r?void 0:r.recorder)||A.canPublishSources.length!==this.permissions.canPublishSources.length||A.canPublishSources.some(((A,e)=>{var t;return A!==(null===(t=this.permissions)||void 0===t?void 0:t.canPublishSources[e])}))||A.canSubscribeMetrics!==(null===(s=this.permissions)||void 0===s?void 0:s.canSubscribeMetrics);return this.permissions=A,a&&this.emit(vi.ParticipantPermissionsChanged,o),a}setIsSpeaking(A){A!==this.isSpeaking&&(this.isSpeaking=A,A&&(this.lastSpokeAt=new Date),this.emit(vi.IsSpeakingChanged,A))}setConnectionQuality(A){const e=this._connectionQuality;this._connectionQuality=function(A){switch(A){case WA.EXCELLENT:return Bo.Excellent;case WA.GOOD:return Bo.Good;case WA.POOR:return Bo.Poor;case WA.LOST:return Bo.Lost;default:return Bo.Unknown}}(A),e!==this._connectionQuality&&this.emit(vi.ConnectionQualityChanged,this._connectionQuality)}setDisconnected(){var A,e;this.activeFuture&&(null===(e=(A=this.activeFuture).reject)||void 0===e||e.call(A,new Error("Participant disconnected")),this.activeFuture=void 0)}setAudioContext(A){this.audioContext=A,this.audioTrackPublications.forEach((e=>Or(e.track)&&e.track.setAudioContext(A)))}addTrackPublication(A){A.on(Qi.Muted,(()=>{this.emit(vi.TrackMuted,A)})),A.on(Qi.Unmuted,(()=>{this.emit(vi.TrackUnmuted,A)}));const e=A;switch(e.track&&(e.track.sid=A.trackSid),this.trackPublications.set(A.trackSid,A),A.kind){case Ji.Kind.Audio:this.audioTrackPublications.set(A.trackSid,A);break;case Ji.Kind.Video:this.videoTrackPublications.set(A.trackSid,A)}}}class Vo extends _o{constructor(A,e,t,n,i){super(A,e,void 0,void 0,void 0,{loggerName:n.loggerName,loggerContextCb:()=>this.engine.logContext}),this.pendingPublishing=new Set,this.pendingPublishPromises=new Map,this.participantTrackPermissions=[],this.allParticipantsAllowedToSubscribe=!0,this.encryptionType=se.NONE,this.enabledPublishVideoCodecs=[],this.pendingAcks=new Map,this.pendingResponses=new Map,this.handleReconnecting=()=>{this.reconnectFuture||(this.reconnectFuture=new Ir)},this.handleReconnected=()=>{var A,e;null===(e=null===(A=this.reconnectFuture)||void 0===A?void 0:A.resolve)||void 0===e||e.call(A),this.reconnectFuture=void 0,this.updateTrackSubscriptionPermissions()},this.handleDisconnected=()=>{var A,e;this.reconnectFuture&&(this.reconnectFuture.promise.catch((A=>this.log.warn(A.message,this.logContext))),null===(e=null===(A=this.reconnectFuture)||void 0===A?void 0:A.reject)||void 0===e||e.call(A,"Got disconnected during reconnection attempt"),this.reconnectFuture=void 0)},this.handleSignalRequestResponse=A=>{const{requestId:e,reason:t,message:n}=A,i=this.pendingSignalRequests.get(e);i&&(t!==St.OK&&i.reject(new Di(n,t)),this.pendingSignalRequests.delete(e))},this.handleDataPacket=A=>{switch(A.value.case){case"rpcResponse":let e=A.value.value,t=null,n=null;"payload"===e.value.case?t=e.value.value:"error"===e.value.case&&(n=Ks.fromProto(e.value.value)),this.handleIncomingRpcResponse(e.requestId,t,n);break;case"rpcAck":let i=A.value.value;this.handleIncomingRpcAck(i.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 e,t,n;if(!A.participantSid&&!A.participantIdentity)throw new Error("Invalid track permission, must provide at least one of participantIdentity and participantSid");return new ft({participantIdentity:null!==(e=A.participantIdentity)&&void 0!==e?e:"",participantSid:null!==(t=A.participantSid)&&void 0!==t?t:"",allTracks:null!==(n=A.allowAll)&&void 0!==n&&n,trackSids:A.allowedTrackSids||[]})}(A))))},this.onTrackUnmuted=A=>{this.onTrackMuted(A,A.isUpstreamPaused)},this.onTrackMuted=(A,e)=>{void 0===e&&(e=!0),A.sid?this.engine.updateMuteStatus(A.sid,e):this.log.error("could not update mute status for unpublished track",Object.assign(Object.assign({},this.logContext),zr(A)))},this.onTrackUpstreamPaused=A=>{this.log.debug("upstream paused",Object.assign(Object.assign({},this.logContext),zr(A))),this.onTrackMuted(A,!0)},this.onTrackUpstreamResumed=A=>{this.log.debug("upstream resumed",Object.assign(Object.assign({},this.logContext),zr(A))),this.onTrackMuted(A,A.isMuted)},this.onTrackFeatureUpdate=A=>{const e=this.audioTrackPublications.get(A.sid);e?this.engine.client.sendUpdateLocalAudioTrack(e.trackSid,e.getTrackFeatures()):this.log.warn("Could not update local audio track settings, missing publication for track ".concat(A.sid),this.logContext)},this.handleSubscribedQualityUpdate=A=>Xt(this,void 0,void 0,(function*(){var e,t,n,i,r,s;if(!(null===(r=this.roomOptions)||void 0===r?void 0:r.dynacast))return;const o=this.videoTrackPublications.get(A.trackSid);if(o)if(A.subscribedCodecs.length>0){if(!o.videoTrack)return;const r=yield o.videoTrack.setPublishingCodecs(A.subscribedCodecs);try{for(var a,c=!0,d=Yt(r);!(e=(a=yield d.next()).done);c=!0){i=a.value,c=!1;const A=i;Zi(A)&&(this.log.debug("publish ".concat(A," for ").concat(o.videoTrack.sid),Object.assign(Object.assign({},this.logContext),zr(o))),yield this.publishAdditionalCodecForTrack(o.videoTrack,A,o.options))}}catch(l){t={error:l}}finally{try{c||e||!(n=d.return)||(yield n.call(d))}finally{if(t)throw t.error}}}else A.subscribedQualities.length>0&&(yield null===(s=o.videoTrack)||void 0===s?void 0:s.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 e=this.trackPublications.get(A.trackSid);e?this.unpublishTrack(e.track):this.log.warn("received unpublished event for unknown track",Object.assign(Object.assign({},this.logContext),{trackSid:A.trackSid}))},this.handleTrackEnded=A=>Xt(this,void 0,void 0,(function*(){if(A.source===Ji.Source.ScreenShare||A.source===Ji.Source.ScreenShareAudio)this.log.debug("unpublishing local track due to TrackEnded",Object.assign(Object.assign({},this.logContext),zr(A))),this.unpublishTrack(A);else if(A.isUserProvided)yield A.mute();else if(Kr(A)||Nr(A))try{if(pr())try{const e=yield null===navigator||void 0===navigator?void 0:navigator.permissions.query({name:A.source===Ji.Source.Camera?"camera":"microphone"});if(e&&"denied"===e.state)throw this.log.warn("user has revoked access to ".concat(A.source),Object.assign(Object.assign({},this.logContext),zr(A))),e.onchange=()=>{"denied"!==e.state&&(A.isMuted||A.restartTrack(),e.onchange=null)},new Error("GetUserMedia Permission denied")}catch(e){}A.isMuted||(this.log.debug("track ended, attempting to use a different device",Object.assign(Object.assign({},this.logContext),zr(A))),Kr(A)?yield A.restartTrack({deviceId:"default"}):yield A.restartTrack())}catch(e){this.log.warn("could not restart track, muting instead",Object.assign(Object.assign({},this.logContext),zr(A))),yield A.mute()}})),this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.trackPublications=new Map,this.engine=t,this.roomOptions=n,this.setupEngine(t),this.activeDeviceMap=new Map([["audioinput","default"],["videoinput","default"],["audiooutput","default"]]),this.pendingSignalRequests=new Map,this.rpcHandlers=i}get lastCameraError(){return this.cameraError}get lastMicrophoneError(){return this.microphoneError}get isE2EEEnabled(){return this.encryptionType!==se.NONE}getTrackPublication(A){const e=super.getTrackPublication(A);if(e)return e}getTrackPublicationByName(A){const e=super.getTrackPublicationByName(A);if(e)return e}setupEngine(A){this.engine=A,this.engine.on(yi.RemoteMute,((A,e)=>{const t=this.trackPublications.get(A);t&&t.track&&(e?t.mute():t.unmute())})),this.engine.on(yi.Connected,this.handleReconnected).on(yi.SignalRestarted,this.handleReconnected).on(yi.SignalResumed,this.handleReconnected).on(yi.Restarting,this.handleReconnecting).on(yi.Resuming,this.handleReconnecting).on(yi.LocalTrackUnpublished,this.handleLocalTrackUnpublished).on(yi.SubscribedQualityUpdate,this.handleSubscribedQualityUpdate).on(yi.Disconnected,this.handleDisconnected).on(yi.SignalRequestResponse,this.handleSignalRequestResponse).on(yi.DataPacketReceived,this.handleDataPacket)}setMetadata(A){return Xt(this,void 0,void 0,(function*(){yield this.requestMetadataUpdate({metadata:A})}))}setName(A){return Xt(this,void 0,void 0,(function*(){yield this.requestMetadataUpdate({name:A})}))}setAttributes(A){return Xt(this,void 0,void 0,(function*(){yield this.requestMetadataUpdate({attributes:A})}))}requestMetadataUpdate(A){return Xt(this,arguments,void 0,(function(A){var e=this;let{metadata:t,name:n,attributes:i}=A;return function*(){return new Promise(((A,r)=>Xt(e,void 0,void 0,(function*(){var e,s;try{let o=!1;const a=yield this.engine.client.sendUpdateLocalMetadata(null!==(e=null!=t?t:this.metadata)&&void 0!==e?e:"",null!==(s=null!=n?n:this.name)&&void 0!==s?s:"",i),c=performance.now();for(this.pendingSignalRequests.set(a,{resolve:A,reject:A=>{r(A),o=!0},values:{name:n,metadata:t,attributes:i}});performance.now()-c<5e3&&!o;){if((!n||this.name===n)&&(!t||this.metadata===t)&&(!i||Object.entries(i).every((A=>{let[e,t]=A;return this.attributes[e]===t||""===t&&!this.attributes[e]}))))return this.pendingSignalRequests.delete(a),void A();yield or(50)}r(new Di("Request to update local metadata timed out","TimeoutError"))}catch(o){o instanceof Error&&r(o)}}))))}()}))}setCameraEnabled(A,e,t){return this.setTrackEnabled(Ji.Source.Camera,A,e,t)}setMicrophoneEnabled(A,e,t){return this.setTrackEnabled(Ji.Source.Microphone,A,e,t)}setScreenShareEnabled(A,e,t){return this.setTrackEnabled(Ji.Source.ScreenShare,A,e,t)}setPermissions(A){const e=this.permissions,t=super.setPermissions(A);return t&&e&&this.emit(vi.ParticipantPermissionsChanged,e),t}setE2EEEnabled(A){return Xt(this,void 0,void 0,(function*(){this.encryptionType=A?se.GCM:se.NONE,yield this.republishAllTracks(void 0,!1)}))}setTrackEnabled(A,e,t,n){return Xt(this,void 0,void 0,(function*(){var i,r;this.log.debug("setTrackEnabled",Object.assign(Object.assign({},this.logContext),{source:A,enabled:e})),this.republishPromise&&(yield this.republishPromise);let s=this.getTrackPublication(A);if(e)if(s)yield s.unmute();else{let e;if(this.pendingPublishing.has(A)){const e=yield this.waitForPendingPublicationOfSource(A);return e||this.log.info("waiting for pending publication promise timed out",Object.assign(Object.assign({},this.logContext),{source:A})),yield null==e?void 0:e.unmute(),e}this.pendingPublishing.add(A);try{switch(A){case Ji.Source.Camera:e=yield this.createTracks({video:null===(i=t)||void 0===i||i});break;case Ji.Source.Microphone:e=yield this.createTracks({audio:null===(r=t)||void 0===r||r});break;case Ji.Source.ScreenShare:e=yield this.createScreenTracks(Object.assign({},t));break;default:throw new Si(A)}}catch(o){throw null==e||e.forEach((A=>{A.stop()})),o instanceof Error&&this.emit(vi.MediaDevicesError,o),this.pendingPublishing.delete(A),o}try{const A=[];for(const i of e)this.log.info("publishing track",Object.assign(Object.assign({},this.logContext),zr(i))),A.push(this.publishTrack(i,n));const t=yield Promise.all(A);[s]=t}catch(o){throw null==e||e.forEach((A=>{A.stop()})),o}finally{this.pendingPublishing.delete(A)}}else if(!(null==s?void 0:s.track)&&this.pendingPublishing.has(A)&&(s=yield this.waitForPendingPublicationOfSource(A),s||this.log.info("waiting for pending publication promise timed out",Object.assign(Object.assign({},this.logContext),{source:A}))),s&&s.track)if(A===Ji.Source.ScreenShare){s=yield this.unpublishTrack(s.track);const A=this.getTrackPublication(Ji.Source.ScreenShareAudio);A&&A.track&&this.unpublishTrack(A.track)}else yield s.mute();return s}))}enableCameraAndMicrophone(){return Xt(this,void 0,void 0,(function*(){if(!this.pendingPublishing.has(Ji.Source.Camera)&&!this.pendingPublishing.has(Ji.Source.Microphone)){this.pendingPublishing.add(Ji.Source.Camera),this.pendingPublishing.add(Ji.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(Ji.Source.Camera),this.pendingPublishing.delete(Ji.Source.Microphone)}}}))}createTracks(A){return Xt(this,void 0,void 0,(function*(){var e,t;null!=A||(A={});const n=jr(A,null===(e=this.roomOptions)||void 0===e?void 0:e.audioCaptureDefaults,null===(t=this.roomOptions)||void 0===t?void 0:t.videoCaptureDefaults);try{return(yield Ko(n,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext})).map((A=>(Or(A)&&(this.microphoneError=void 0,A.setAudioContext(this.audioContext),A.source=Ji.Source.Microphone,this.emit(vi.AudioStreamAcquired)),Mr(A)&&(this.cameraError=void 0,A.source=Ji.Source.Camera),A)))}catch(i){throw i instanceof Error&&(A.audio&&(this.microphoneError=i),A.video&&(this.cameraError=i)),i}}))}createScreenTracks(A){return Xt(this,void 0,void 0,(function*(){if(void 0===A&&(A={}),void 0===navigator.mediaDevices.getDisplayMedia)throw new Ti("getDisplayMedia not supported");void 0!==A.resolution||function(){const A=Oi();return"Safari"===(null==A?void 0:A.name)&&A.version.startsWith("17.")}()||(A.resolution=rr.h1080fps30.resolution);const e=function(A){var e,t;let n=null===(e=A.video)||void 0===e||e;return A.resolution&&A.resolution.width>0&&A.resolution.height>0&&(n="boolean"==typeof n?{}:n,n=hr()?Object.assign(Object.assign({},n),{width:{max:A.resolution.width},height:{max:A.resolution.height},frameRate:A.resolution.frameRate}):Object.assign(Object.assign({},n),{width:{ideal:A.resolution.width},height:{ideal:A.resolution.height},frameRate:A.resolution.frameRate})),{audio:null!==(t=A.audio)&&void 0!==t&&t,video:n,controller:A.controller,selfBrowserSurface:A.selfBrowserSurface,surfaceSwitching:A.surfaceSwitching,systemAudio:A.systemAudio,preferCurrentTab:A.preferCurrentTab}}(A),t=yield navigator.mediaDevices.getDisplayMedia(e),n=t.getVideoTracks();if(0===n.length)throw new Si("no video track found");const i=new ro(n[0],void 0,!1,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});i.source=Ji.Source.ScreenShare,A.contentHint&&(i.mediaStreamTrack.contentHint=A.contentHint);const r=[i];if(t.getAudioTracks().length>0){this.emit(vi.AudioStreamAcquired);const A=new Ws(t.getAudioTracks()[0],void 0,!1,this.audioContext,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});A.source=Ji.Source.ScreenShareAudio,r.push(A)}return r}))}publishTrack(A,e){return Xt(this,void 0,void 0,(function*(){return this.publishOrRepublishTrack(A,e)}))}publishOrRepublishTrack(A,e){return Xt(this,arguments,void 0,(function(A,e){var t=this;let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function*(){var i,r,s,o;let a,c;if(Kr(A)&&A.setAudioContext(t.audioContext),yield null===(i=t.reconnectFuture)||void 0===i?void 0:i.promise,t.republishPromise&&!n&&(yield t.republishPromise),Lr(A)&&t.pendingPublishPromises.has(A)&&(yield t.pendingPublishPromises.get(A)),A instanceof MediaStreamTrack)a=A.getConstraints();else{let e;switch(a=A.constraints,A.source){case Ji.Source.Microphone:e="audioinput";break;case Ji.Source.Camera:e="videoinput"}e&&t.activeDeviceMap.has(e)&&(a=Object.assign(Object.assign({},a),{deviceId:t.activeDeviceMap.get(e)}))}if(A instanceof MediaStreamTrack)switch(A.kind){case"audio":A=new Ws(A,a,!0,t.audioContext,{loggerName:t.roomOptions.loggerName,loggerContextCb:()=>t.logContext});break;case"video":A=new ro(A,a,!0,{loggerName:t.roomOptions.loggerName,loggerContextCb:()=>t.logContext});break;default:throw new Si("unsupported MediaStreamTrack kind ".concat(A.kind))}else A.updateLoggerOptions({loggerName:t.roomOptions.loggerName,loggerContextCb:()=>t.logContext});if(t.trackPublications.forEach((e=>{e.track&&e.track===A&&(c=e)})),c)return t.log.warn("track has already been published, skipping",Object.assign(Object.assign({},t.logContext),zr(c))),c;const d="channelCount"in A.mediaStreamTrack.getSettings()&&2===A.mediaStreamTrack.getSettings().channelCount||2===A.mediaStreamTrack.getConstraints().channelCount,l=null!==(r=null==e?void 0:e.forceStereo)&&void 0!==r?r:d;l&&(e||(e={}),void 0===e.dtx&&t.log.info("Opus DTX will be disabled for stereo tracks by default. Enable them explicitly to make it work.",Object.assign(Object.assign({},t.logContext),zr(A))),void 0===e.red&&t.log.info("Opus RED will be disabled for stereo tracks by default. Enable them explicitly to make it work."),null!==(s=e.dtx)&&void 0!==s||(e.dtx=!1),null!==(o=e.red)&&void 0!==o||(e.red=!1));const u=Object.assign(Object.assign({},t.roomOptions.publishDefaults),e);!function(){const A=Oi(),e="17.2";if(A)return"Safari"!==A.name&&"iOS"!==A.os||!!("iOS"===A.os&&A.osVersion&&Cr(e,A.osVersion)>=0)||"Safari"===A.name&&Cr(e,A.version)>=0}()&&t.roomOptions.e2ee&&(t.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({},t.logContext)),u.simulcast=!1),u.source&&(A.source=u.source);const h=new Promise(((e,n)=>Xt(t,void 0,void 0,(function*(){try{if(this.engine.client.currentState!==cs.CONNECTED){this.log.debug("deferring track publication until signal is connected",Object.assign(Object.assign({},this.logContext),{track:zr(A)}));const t=()=>Xt(this,void 0,void 0,(function*(){try{const t=yield this.publish(A,u,l);e(t)}catch(t){n(t)}}));setTimeout((()=>{this.engine.off(yi.SignalConnected,t),n(new Ri("publishing rejected as engine not connected within timeout",408))}),15e3),this.engine.once(yi.SignalConnected,t),this.engine.on(yi.Closing,(()=>{this.engine.off(yi.SignalConnected,t),n(new Ri("publishing rejected as engine closed",499))}))}else try{const t=yield this.publish(A,u,l);e(t)}catch(t){n(t)}}catch(t){n(t)}}))));t.pendingPublishPromises.set(A,h);try{return yield h}catch(g){throw g}finally{t.pendingPublishPromises.delete(A)}}()}))}hasPermissionsToPublish(A){if(!this.permissions)return this.log.warn("no permissions present for publishing track",Object.assign(Object.assign({},this.logContext),zr(A))),!1;const{canPublish:e,canPublishSources:t}=this.permissions;return!(!e||0!==t.length&&!t.map((A=>function(A){switch(A){case jA.CAMERA:return Ji.Source.Camera;case jA.MICROPHONE:return Ji.Source.Microphone;case jA.SCREEN_SHARE:return Ji.Source.ScreenShare;case jA.SCREEN_SHARE_AUDIO:return Ji.Source.ScreenShareAudio;default:return Ji.Source.Unknown}}(A))).includes(A.source))||(this.log.warn("insufficient permissions to publish",Object.assign(Object.assign({},this.logContext),zr(A))),!1)}publish(A,e,t){return Xt(this,void 0,void 0,(function*(){var n,i,r,s,o,a,c,d,l,u;if(!this.hasPermissionsToPublish(A))throw new Ri("failed to publish track, insufficient permissions",403);Array.from(this.trackPublications.values()).find((e=>Lr(A)&&e.source===A.source))&&A.source!==Ji.Source.Unknown&&this.log.info("publishing a second track with the same source: ".concat(A.source),Object.assign(Object.assign({},this.logContext),zr(A))),e.stopMicTrackOnMute&&Or(A)&&(A.stopOnMute=!0),A.source===Ji.Source.ScreenShare&&ur()&&(e.simulcast=!1),"av1"!==e.videoCodec||function(){if(!("getCapabilities"in RTCRtpSender))return!1;if(hr())return!1;const A=RTCRtpSender.getCapabilities("video");let e=!1;if(A)for(const t of A.codecs)if("video/AV1"===t.mimeType){e=!0;break}return e}()||(e.videoCodec=void 0),"vp9"!==e.videoCodec||function(){if(!("getCapabilities"in RTCRtpSender))return!1;if(ur())return!1;if(hr()){const A=Oi();if((null==A?void 0:A.version)&&Cr(A.version,"16")<0)return!1}const A=RTCRtpSender.getCapabilities("video");let e=!1;if(A)for(const t of A.codecs)if("video/VP9"===t.mimeType){e=!0;break}return e}()||(e.videoCodec=void 0),void 0===e.videoCodec&&(e.videoCodec=Ps),this.enabledPublishVideoCodecs.length>0&&(this.enabledPublishVideoCodecs.some((A=>e.videoCodec===$r(A.mime)))||(e.videoCodec=$r(this.enabledPublishVideoCodecs[0].mime)));const h=e.videoCodec;A.on(Qi.Muted,this.onTrackMuted),A.on(Qi.Unmuted,this.onTrackUnmuted),A.on(Qi.Ended,this.handleTrackEnded),A.on(Qi.UpstreamPaused,this.onTrackUpstreamPaused),A.on(Qi.UpstreamResumed,this.onTrackUpstreamResumed),A.on(Qi.AudioTrackFeatureUpdate,this.onTrackFeatureUpdate);const g=new Ge({cid:A.mediaStreamTrack.id,name:e.name,type:Ji.kindToProto(A.kind),muted:A.isMuted,source:Ji.sourceToProto(A.source),disableDtx:!(null===(n=e.dtx)||void 0===n||n),encryption:this.encryptionType,stereo:t,disableRed:this.isE2EEEnabled||!(null===(i=e.red)||void 0===i||i),stream:null==e?void 0:e.stream,backupCodecPolicy:null==e?void 0:e.backupCodecPolicy});let p;if(A.kind===Ji.Kind.Video){let t={width:0,height:0};try{t=yield A.waitForDimensions()}catch(w){const e=null!==(s=null===(r=this.roomOptions.videoCaptureDefaults)||void 0===r?void 0:r.resolution)&&void 0!==s?s:nr.h720.resolution;t={width:e.width,height:e.height},this.log.error("could not determine track dimensions, using defaults",Object.assign(Object.assign(Object.assign({},this.logContext),zr(A)),{dims:t}))}g.width=t.width,g.height=t.height,Nr(A)&&(dr(h)&&(A.source===Ji.Source.ScreenShare&&(e.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),zr(A))))),e.scalabilityMode=null!==(o=e.scalabilityMode)&&void 0!==o?o:"L3T3_KEY"),g.simulcastCodecs=[new Ve({codec:h,cid:A.mediaStreamTrack.id})],!0===e.backupCodec&&(e.backupCodec={codec:Ps}),e.backupCodec&&h!==e.backupCodec.codec&&g.encryption===se.NONE&&(this.roomOptions.dynacast||(this.roomOptions.dynacast=!0),g.simulcastCodecs.push(new Ve({codec:e.backupCodec.codec,cid:""})))),p=Ao(A.source===Ji.Source.ScreenShare,g.width,g.height,e),g.layers=ao(g.width,g.height,p,dr(e.videoCodec))}else A.kind===Ji.Kind.Audio&&(p=[{maxBitrate:null===(a=e.audioPreset)||void 0===a?void 0:a.maxBitrate,priority:null!==(d=null===(c=e.audioPreset)||void 0===c?void 0:c.priority)&&void 0!==d?d:"high",networkPriority:null!==(u=null===(l=e.audioPreset)||void 0===l?void 0:l.priority)&&void 0!==u?u:"high"}]);if(!this.engine||this.engine.isClosed)throw new Pi("cannot publish track when not connected");const m=()=>Xt(this,void 0,void 0,(function*(){var t,n,i;if(!this.engine.pcManager)throw new Pi("pcManager is not ready");if(A.sender=yield this.engine.createSender(A,e,p),Nr(A)&&(null!==(t=e.degradationPreference)&&void 0!==t||(e.degradationPreference=function(A){return A.source===Ji.Source.ScreenShare||A.constraints.height&&Pr(A.constraints.height)>=1080?"maintain-resolution":"balanced"}(A)),A.setDegradationPreference(e.degradationPreference)),p)if(ur()&&A.kind===Ji.Kind.Audio){let e;for(const t of this.engine.pcManager.publisher.getTransceivers())if(t.sender===A.sender){e=t;break}e&&this.engine.pcManager.publisher.setTrackCodecBitrate({transceiver:e,codec:"opus",maxbr:(null===(n=p[0])||void 0===n?void 0:n.maxBitrate)?p[0].maxBitrate/1e3:0})}else A.codec&&dr(A.codec)&&(null===(i=p[0])||void 0===i?void 0:i.maxBitrate)&&this.engine.pcManager.publisher.setTrackCodecBitrate({cid:g.cid,codec:A.codec,maxbr:p[0].maxBitrate/1e3});yield this.engine.negotiate()}));let f;if(this.enabledPublishVideoCodecs.length>0)f=(yield Promise.all([this.engine.addTrack(g),m()]))[0];else{let t;if(f=yield this.engine.addTrack(g),f.codecs.forEach((A=>{void 0===t&&(t=A.mimeType)})),t&&A.kind===Ji.Kind.Video){const n=$r(t);n!==h&&(this.log.debug("falling back to server selected codec",Object.assign(Object.assign(Object.assign({},this.logContext),zr(A)),{codec:n})),e.videoCodec=n,p=Ao(A.source===Ji.Source.ScreenShare,g.width,g.height,e))}yield m()}const B=new No(A.kind,f,A,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});return B.options=e,A.sid=f.sid,this.log.debug("publishing ".concat(A.kind," with encodings"),Object.assign(Object.assign({},this.logContext),{encodings:p,trackInfo:f})),Nr(A)?A.startMonitor(this.engine.client):Kr(A)&&A.startMonitor(),this.addTrackPublication(B),this.emit(vi.LocalTrackPublished,B),B}))}get isLocal(){return!0}publishAdditionalCodecForTrack(A,e,t){return Xt(this,void 0,void 0,(function*(){var n;if(this.encryptionType!==se.NONE)return;let i;if(this.trackPublications.forEach((e=>{e.track&&e.track===A&&(i=e)})),!i)throw new Si("track is not published");if(!Nr(A))throw new Si("track is not a video track");const r=Object.assign(Object.assign({},null===(n=this.roomOptions)||void 0===n?void 0:n.publishDefaults),t),s=function(A,e,t){var n,i,r,s;if(!t.backupCodec||!0===t.backupCodec||t.backupCodec.codec===t.videoCodec)return;e!==t.backupCodec.codec&&Vt.warn("requested a different codec than specified as backup",{serverRequested:e,backup:t.backupCodec.codec}),t.videoCodec=e,t.videoEncoding=t.backupCodec.encoding;const o=A.mediaStreamTrack.getSettings(),a=null!==(n=o.width)&&void 0!==n?n:null===(i=A.dimensions)||void 0===i?void 0:i.width,c=null!==(r=o.height)&&void 0!==r?r:null===(s=A.dimensions)||void 0===s?void 0:s.height;return A.source===Ji.Source.ScreenShare&&t.simulcast&&(t.simulcast=!1),Ao(A.source===Ji.Source.ScreenShare,a,c,t)}(A,e,r);if(!s)return void this.log.info("backup codec has been disabled, ignoring request to add additional codec for track",Object.assign(Object.assign({},this.logContext),zr(A)));const o=A.addSimulcastTrack(e,s);if(!o)return;const a=new Ge({cid:o.mediaStreamTrack.id,type:Ji.kindToProto(A.kind),muted:A.isMuted,source:Ji.sourceToProto(A.source),sid:A.sid,simulcastCodecs:[{codec:r.videoCodec,cid:o.mediaStreamTrack.id}]});if(a.layers=ao(a.width,a.height,s),!this.engine||this.engine.isClosed)throw new Pi("cannot publish track when not connected");const c=(yield Promise.all([this.engine.addTrack(a),(()=>Xt(this,void 0,void 0,(function*(){yield this.engine.createSimulcastSender(A,o,r,s),yield this.engine.negotiate()})))()]))[0];this.log.debug("published ".concat(e," for track ").concat(A.sid),Object.assign(Object.assign({},this.logContext),{encodings:s,trackInfo:c}))}))}unpublishTrack(A,e){return Xt(this,void 0,void 0,(function*(){var t,n;if(Lr(A)){const e=this.pendingPublishPromises.get(A);e&&(this.log.info("awaiting publish promise before attempting to unpublish",Object.assign(Object.assign({},this.logContext),zr(A))),yield e)}const i=this.getPublicationForTrack(A),r=i?zr(i):void 0;if(this.log.debug("unpublishing track",Object.assign(Object.assign({},this.logContext),r)),!i||!i.track)return void this.log.warn("track was not unpublished because no publication was found",Object.assign(Object.assign({},this.logContext),r));(A=i.track).off(Qi.Muted,this.onTrackMuted),A.off(Qi.Unmuted,this.onTrackUnmuted),A.off(Qi.Ended,this.handleTrackEnded),A.off(Qi.UpstreamPaused,this.onTrackUpstreamPaused),A.off(Qi.UpstreamResumed,this.onTrackUpstreamResumed),A.off(Qi.AudioTrackFeatureUpdate,this.onTrackFeatureUpdate),void 0===e&&(e=null===(n=null===(t=this.roomOptions)||void 0===t?void 0:t.stopLocalTrackOnUnpublish)||void 0===n||n),e?A.stop():A.stopMonitor();let s=!1;const o=A.sender;if(A.sender=void 0,this.engine.pcManager&&this.engine.pcManager.currentState<Os.FAILED&&o)try{for(const A of this.engine.pcManager.publisher.getTransceivers())A.sender===o&&(A.direction="inactive",s=!0);if(this.engine.removeTrack(o)&&(s=!0),Nr(A)){for(const[,e]of A.simulcastCodecs)e.sender&&(this.engine.removeTrack(e.sender)&&(s=!0),e.sender=void 0);A.simulcastCodecs.clear()}}catch(a){this.log.warn("failed to unpublish track",Object.assign(Object.assign(Object.assign({},this.logContext),r),{error:a}))}switch(this.trackPublications.delete(i.trackSid),i.kind){case Ji.Kind.Audio:this.audioTrackPublications.delete(i.trackSid);break;case Ji.Kind.Video:this.videoTrackPublications.delete(i.trackSid)}return this.emit(vi.LocalTrackUnpublished,i),i.setTrack(void 0),s&&(yield this.engine.negotiate()),i}))}unpublishTracks(A){return Xt(this,void 0,void 0,(function*(){return(yield Promise.all(A.map((A=>this.unpublishTrack(A))))).filter((A=>!!A))}))}republishAllTracks(A){return Xt(this,arguments,void 0,(function(A){var e=this;let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return function*(){e.republishPromise&&(yield e.republishPromise),e.republishPromise=new Promise(((n,i)=>Xt(e,void 0,void 0,(function*(){try{const e=[];this.trackPublications.forEach((t=>{t.track&&(A&&(t.options=Object.assign(Object.assign({},t.options),A)),e.push(t))})),yield Promise.all(e.map((A=>Xt(this,void 0,void 0,(function*(){const e=A.track;yield this.unpublishTrack(e,!1),!t||e.isMuted||e.source===Ji.Source.ScreenShare||e.source===Ji.Source.ScreenShareAudio||!Kr(e)&&!Nr(e)||e.isUserProvided||(this.log.debug("restarting existing track",Object.assign(Object.assign({},this.logContext),{track:A.trackSid})),yield e.restartTrack()),yield this.publishOrRepublishTrack(e,A.options,!0)}))))),n()}catch(e){i(e)}finally{this.republishPromise=void 0}})))),yield e.republishPromise}()}))}publishData(A){return Xt(this,arguments,void 0,(function(A){var e=this;let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){const n=t.reliable?le.RELIABLE:le.LOSSY,i=t.destinationIdentities,r=t.topic,s=new de({kind:n,value:{case:"user",value:new ge({participantIdentity:e.identity,payload:A,destinationIdentities:i,topic:r})}});yield e.engine.sendDataPacket(s,n)}()}))}publishDtmf(A,e){return Xt(this,void 0,void 0,(function*(){const t=new de({kind:le.RELIABLE,value:{case:"sipDtmf",value:new pe({code:A,digit:e})}});yield this.engine.sendDataPacket(t,le.RELIABLE)}))}sendChatMessage(A,e){return Xt(this,void 0,void 0,(function*(){const t={id:crypto.randomUUID(),message:A,timestamp:Date.now(),attachedFiles:null==e?void 0:e.attachments},n=new de({value:{case:"chatMessage",value:new Be(Object.assign(Object.assign({},t),{timestamp:F.parse(t.timestamp)}))}});return yield this.engine.sendDataPacket(n,le.RELIABLE),this.emit(vi.ChatMessage,t),t}))}editChatMessage(A,e){return Xt(this,void 0,void 0,(function*(){const t=Object.assign(Object.assign({},e),{message:A,editTimestamp:Date.now()}),n=new de({value:{case:"chatMessage",value:new Be(Object.assign(Object.assign({},t),{timestamp:F.parse(t.timestamp),editTimestamp:F.parse(t.editTimestamp)}))}});return yield this.engine.sendDataPacket(n,le.RELIABLE),this.emit(vi.ChatMessage,t),t}))}sendText(A,e){return Xt(this,void 0,void 0,(function*(){var t;const n=crypto.randomUUID(),i=(new TextEncoder).encode(A).byteLength,r=null===(t=null==e?void 0:e.attachments)||void 0===t?void 0:t.map((()=>crypto.randomUUID())),s=new Array(r?r.length+1:1).fill(0),o=(A,t)=>{var n;s[t]=A;const i=s.reduce(((A,e)=>A+e),0);null===(n=null==e?void 0:e.onProgress)||void 0===n||n.call(e,i)},a=yield this.streamText({streamId:n,totalSize:i,destinationIdentities:null==e?void 0:e.destinationIdentities,topic:null==e?void 0:e.topic,attachedStreamIds:r,attributes:null==e?void 0:e.attributes});return yield a.write(A),o(1,0),yield a.close(),(null==e?void 0:e.attachments)&&r&&(yield Promise.all(e.attachments.map(((A,t)=>Xt(this,void 0,void 0,(function*(){return this._sendFile(r[t],A,{topic:e.topic,mimeType:A.type,onProgress:A=>{o(A,t+1)}})})))))),a.info}))}streamText(A){return Xt(this,void 0,void 0,(function*(){var e,t;const n=null!==(e=null==A?void 0:A.streamId)&&void 0!==e?e:crypto.randomUUID(),i={id:n,mimeType:"text/plain",timestamp:Date.now(),topic:null!==(t=null==A?void 0:A.topic)&&void 0!==t?t:"",size:null==A?void 0:A.totalSize,attributes:null==A?void 0:A.attributes},r=new De({streamId:n,mimeType:i.mimeType,topic:i.topic,timestamp:xr(i.timestamp),totalLength:xr(null==A?void 0:A.totalSize),attributes:i.attributes,contentHeader:{case:"textHeader",value:new He({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)?Pe.UPDATE:Pe.CREATE})}}),s=null==A?void 0:A.destinationIdentities,o=new de({destinationIdentities:s,value:{case:"streamHeader",value:r}});yield this.engine.sendDataPacket(o,le.RELIABLE);let a=0;const c=this,d=new WritableStream({write(A){return Xt(this,void 0,void 0,(function*(){for(const e of function(A){const e=[];let t=(new TextEncoder).encode(A);for(;t.length>15e3;){let A=15e3;for(;A>0;){const e=t[A];if(void 0!==e&&128!=(192&e))break;A--}e.push(t.slice(0,A)),t=t.slice(A)}return t.length>0&&e.push(t),e}(A)){yield c.engine.waitForBufferStatusLow(le.RELIABLE);const A=new xe({content:e,streamId:n,chunkIndex:xr(a)}),t=new de({destinationIdentities:s,value:{case:"streamChunk",value:A}});yield c.engine.sendDataPacket(t,le.RELIABLE),a+=1}}))},close(){return Xt(this,void 0,void 0,(function*(){const A=new Le({streamId:n}),e=new de({destinationIdentities:s,value:{case:"streamTrailer",value:A}});yield c.engine.sendDataPacket(e,le.RELIABLE)}))},abort(A){console.log("Sink error:",A)}});let l=()=>Xt(this,void 0,void 0,(function*(){yield u.close()}));c.engine.once(yi.Closing,l);const u=new Io(d,i,(()=>this.engine.off(yi.Closing,l)));return u}))}sendFile(A,e){return Xt(this,void 0,void 0,(function*(){const t=crypto.randomUUID();return yield this._sendFile(t,A,e),{id:t}}))}_sendFile(A,e,t){return Xt(this,void 0,void 0,(function*(){var n;const i=yield this.streamBytes({streamId:A,totalSize:e.size,name:e.name,mimeType:null!==(n=null==t?void 0:t.mimeType)&&void 0!==n?n:e.type,topic:null==t?void 0:t.topic,destinationIdentities:null==t?void 0:t.destinationIdentities}),r=e.stream().getReader();for(;;){const{done:A,value:e}=yield r.read();if(A)break;yield i.write(e)}return yield i.close(),i.info}))}streamBytes(A){return Xt(this,void 0,void 0,(function*(){var e,t,n,i,r;const s=null!==(e=null==A?void 0:A.streamId)&&void 0!==e?e:crypto.randomUUID(),o=null==A?void 0:A.destinationIdentities,c={id:s,mimeType:null!==(t=null==A?void 0:A.mimeType)&&void 0!==t?t:"application/octet-stream",topic:null!==(n=null==A?void 0:A.topic)&&void 0!==n?n:"",timestamp:Date.now(),attributes:null==A?void 0:A.attributes,size:null==A?void 0:A.totalSize,name:null!==(i=null==A?void 0:A.name)&&void 0!==i?i:"unknown"},d=new De({totalLength:xr(null!==(r=c.size)&&void 0!==r?r:0),mimeType:c.mimeType,streamId:s,topic:c.topic,timestamp:xr(Date.now()),attributes:c.attributes,contentHeader:{case:"byteHeader",value:new Re({name:c.name})}}),l=new de({destinationIdentities:o,value:{case:"streamHeader",value:d}});yield this.engine.sendDataPacket(l,le.RELIABLE);let u=0;const h=new a,g=this.engine,p=this.log,m=new WritableStream({write(A){return Xt(this,void 0,void 0,(function*(){const e=yield h.lock();let t=0;try{for(;t<A.byteLength;){const e=A.slice(t,t+15e3);yield g.waitForBufferStatusLow(le.RELIABLE);const n=new de({destinationIdentities:o,value:{case:"streamChunk",value:new xe({content:e,streamId:s,chunkIndex:xr(u)})}});yield g.sendDataPacket(n,le.RELIABLE),u+=1,t+=e.byteLength}}finally{e()}}))},close(){return Xt(this,void 0,void 0,(function*(){const A=new Le({streamId:s}),e=new de({destinationIdentities:o,value:{case:"streamTrailer",value:A}});yield g.sendDataPacket(e,le.RELIABLE)}))},abort(A){p.error("Sink error:",A)}});return new Po(m,c)}))}performRpc(A){return Xt(this,arguments,void 0,(function(A){var e=this;let{destinationIdentity:t,method:n,payload:i,responseTimeout:r=1e4}=A;return function*(){return new Promise(((A,s)=>Xt(e,void 0,void 0,(function*(){var e,o,a,c;if(_s(i)>15360)return void s(Ks.builtIn("REQUEST_PAYLOAD_TOO_LARGE"));if((null===(o=null===(e=this.engine.latestJoinResponse)||void 0===e?void 0:e.serverInfo)||void 0===o?void 0:o.version)&&Cr(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 s(Ks.builtIn("UNSUPPORTED_SERVER"));const d=crypto.randomUUID();yield this.publishRpcRequest(t,d,n,i,r-2e3);const l=setTimeout((()=>{this.pendingAcks.delete(d),s(Ks.builtIn("CONNECTION_TIMEOUT")),this.pendingResponses.delete(d),clearTimeout(u)}),2e3);this.pendingAcks.set(d,{resolve:()=>{clearTimeout(l)},participantIdentity:t});const u=setTimeout((()=>{this.pendingResponses.delete(d),s(Ks.builtIn("RESPONSE_TIMEOUT"))}),r);this.pendingResponses.set(d,{resolve:(e,t)=>{clearTimeout(u),this.pendingAcks.has(d)&&(console.warn("RPC response received before ack",d),this.pendingAcks.delete(d),clearTimeout(l)),t?s(t):A(null!=e?e:"")},participantIdentity:t})}))))}()}))}registerRpcMethod(A,e){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,e)}unregisterRpcMethod(A){this.rpcHandlers.delete(A)}setTrackSubscriptionPermissions(A){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.participantTrackPermissions=e,this.allParticipantsAllowedToSubscribe=A,this.engine.client.isDisconnected||this.updateTrackSubscriptionPermissions()}handleIncomingRpcAck(A){const e=this.pendingAcks.get(A);e?(e.resolve(),this.pendingAcks.delete(A)):console.error("Ack received for unexpected RPC request",A)}handleIncomingRpcResponse(A,e,t){const n=this.pendingResponses.get(A);n?(n.resolve(e,t),this.pendingResponses.delete(A)):console.error("Response received for unexpected RPC request",A)}publishRpcRequest(A,e,t,n,i){return Xt(this,void 0,void 0,(function*(){const r=new de({destinationIdentities:[A],kind:le.RELIABLE,value:{case:"rpcRequest",value:new we({id:e,method:t,payload:n,responseTimeoutMs:i,version:1})}});yield this.engine.sendDataPacket(r,le.RELIABLE)}))}handleParticipantDisconnected(A){for(const[e,{participantIdentity:t}]of this.pendingAcks)t===A&&this.pendingAcks.delete(e);for(const[e,{participantIdentity:t,resolve:n}]of this.pendingResponses)t===A&&(n(null,Ks.builtIn("RECIPIENT_DISCONNECTED")),this.pendingResponses.delete(e))}setEnabledPublishCodecs(A){this.enabledPublishVideoCodecs=A.filter((A=>"video"===A.mime.split("/")[0].toLowerCase()))}updateInfo(A){return!!super.updateInfo(A)&&(A.tracks.forEach((A=>{var e,t;const n=this.trackPublications.get(A.sid);if(n){const i=n.isMuted||null!==(t=null===(e=n.track)||void 0===e?void 0:e.isUpstreamPaused)&&void 0!==t&&t;i!==A.muted&&(this.log.debug("updating server mute state after reconcile",Object.assign(Object.assign(Object.assign({},this.logContext),zr(n)),{mutedOnServer:i})),this.engine.client.sendMuteTrack(A.sid,i))}})),!0)}getPublicationForTrack(A){let e;return this.trackPublications.forEach((t=>{const n=t.track;n&&(A instanceof MediaStreamTrack?(Kr(n)||Nr(n))&&n.mediaStreamTrack===A&&(e=t):A===n&&(e=t))})),e}waitForPendingPublicationOfSource(A){return Xt(this,void 0,void 0,(function*(){const e=Date.now();for(;Date.now()<e+1e4;){const e=Array.from(this.pendingPublishPromises.entries()).find((e=>{let[t]=e;return t.source===A}));if(e)return e[1];yield or(20)}}))}}class Go extends Mo{constructor(A,e,t,n){super(A,e.sid,e.name,n),this.track=void 0,this.allowed=!0,this.disabled=!1,this.currentVideoQuality=Gi.HIGH,this.handleEnded=A=>{this.setTrack(void 0),this.emit(Qi.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=t,this.updateInfo(e)}setSubscribed(A){const e=this.subscriptionStatus,t=this.permissionStatus;this.subscribed=A,A&&(this.allowed=!0);const n=new ze({trackSids:[this.trackSid],subscribe:this.subscribed,participantTracks:[new be({participantSid:"",trackSids:[this.trackSid]})]});this.emit(Qi.UpdateSubscription,n),this.emitSubscriptionUpdateIfChanged(e),this.emitPermissionUpdateIfChanged(t)}get subscriptionStatus(){return!1===this.subscribed?Mo.SubscriptionStatus.Unsubscribed:super.isSubscribed?Mo.SubscriptionStatus.Subscribed:Mo.SubscriptionStatus.Desired}get permissionStatus(){return this.allowed?Mo.PermissionStatus.Allowed:Mo.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 e,t;this.isManualOperationAllowed()&&((null===(e=this.videoDimensions)||void 0===e?void 0:e.width)===A.width&&(null===(t=this.videoDimensions)||void 0===t?void 0:t.height)===A.height||(Gr(this.track)&&(this.videoDimensions=A),this.currentVideoQuality=void 0,this.emitTrackUpdate()))}setVideoFPS(A){this.isManualOperationAllowed()&&Gr(this.track)&&this.fps!==A&&(this.fps=A,this.emitTrackUpdate())}get videoQuality(){return this.currentVideoQuality}setTrack(A){const e=this.subscriptionStatus,t=this.permissionStatus,n=this.track;n!==A&&(n&&(n.off(Qi.VideoDimensionsChanged,this.handleVideoDimensionsChange),n.off(Qi.VisibilityChanged,this.handleVisibilityChange),n.off(Qi.Ended,this.handleEnded),n.detach(),n.stopMonitor(),this.emit(Qi.Unsubscribed,n)),super.setTrack(A),A&&(A.sid=this.trackSid,A.on(Qi.VideoDimensionsChanged,this.handleVideoDimensionsChange),A.on(Qi.VisibilityChanged,this.handleVisibilityChange),A.on(Qi.Ended,this.handleEnded),this.emit(Qi.Subscribed,A)),this.emitPermissionUpdateIfChanged(t),this.emitSubscriptionUpdateIfChanged(e))}setAllowed(A){const e=this.subscriptionStatus,t=this.permissionStatus;this.allowed=A,this.emitPermissionUpdateIfChanged(t),this.emitSubscriptionUpdateIfChanged(e)}setSubscriptionError(A){this.emit(Qi.SubscriptionFailed,A)}updateInfo(A){super.updateInfo(A);const e=this.metadataMuted;this.metadataMuted=A.muted,this.track?this.track.setMuted(A.muted):e!==A.muted&&this.emit(A.muted?Qi.Muted:Qi.Unmuted)}emitSubscriptionUpdateIfChanged(A){const e=this.subscriptionStatus;A!==e&&this.emit(Qi.SubscriptionStatusChanged,e,A)}emitPermissionUpdateIfChanged(A){this.permissionStatus!==A&&this.emit(Qi.SubscriptionPermissionChanged,this.permissionStatus,A)}isManualOperationAllowed(){return this.kind===Ji.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 Gr(this.track)&&this.track.isAdaptiveStream}emitTrackUpdate(){const A=new At({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=Gi.HIGH,this.emit(Qi.UpdateSettings,A)}}class jo extends _o{static fromParticipantInfo(A,e,t){return new jo(A,e.sid,e.identity,e.name,e.metadata,e.attributes,t,e.kind)}get logContext(){return Object.assign(Object.assign({},super.logContext),{rpID:this.sid,remoteParticipant:this.identity})}constructor(A,e,t,n,i,r,s){super(e,t||"",n,i,r,s,arguments.length>7&&void 0!==arguments[7]?arguments[7]:ie.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(Qi.UpdateSettings,(e=>{this.log.debug("send update settings",Object.assign(Object.assign({},this.logContext),zr(A))),this.signalClient.sendUpdateTrackSettings(e)})),A.on(Qi.UpdateSubscription,(A=>{A.participantTracks.forEach((A=>{A.participantSid=this.sid})),this.signalClient.sendUpdateSubscription(A)})),A.on(Qi.SubscriptionPermissionChanged,(e=>{this.emit(vi.TrackSubscriptionPermissionChanged,A,e)})),A.on(Qi.SubscriptionStatusChanged,(e=>{this.emit(vi.TrackSubscriptionStatusChanged,A,e)})),A.on(Qi.Subscribed,(e=>{this.emit(vi.TrackSubscribed,e,A)})),A.on(Qi.Unsubscribed,(e=>{this.emit(vi.TrackUnsubscribed,e,A)})),A.on(Qi.SubscriptionFailed,(e=>{this.emit(vi.TrackSubscriptionFailed,A.trackSid,e)}))}getTrackPublication(A){const e=super.getTrackPublication(A);if(e)return e}getTrackPublicationByName(A){const e=super.getTrackPublicationByName(A);if(e)return e}setVolume(A){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ji.Source.Microphone;this.volumeMap.set(e,A);const t=this.getTrackPublication(e);t&&t.track&&t.track.setVolume(A)}getVolume(){let A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ji.Source.Microphone;const e=this.getTrackPublication(A);return e&&e.track?e.track.getVolume():this.volumeMap.get(A)}addSubscribedMediaTrack(A,e,t,n,i,r){let s,o=this.getTrackPublicationBySid(e);return o||e.startsWith("TR")||this.trackPublications.forEach((e=>{o||A.kind!==e.kind.toString()||(o=e)})),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),zr(o))),void this.emit(vi.TrackSubscriptionFailed,e)):(s="video"===A.kind?new Do(A,e,n,i):new Ro(A,e,n,this.audioContext,this.audioOutput),s.source=o.source,s.isMuted=o.isMuted,s.setMediaStream(t),s.start(),o.setTrack(s),this.volumeMap.has(o.source)&&_r(s)&&Or(s)&&s.setVolume(this.volumeMap.get(o.source)),o):0===r?(this.log.error("could not find published track",Object.assign(Object.assign({},this.logContext),{trackSid:e})),void this.emit(vi.TrackSubscriptionFailed,e)):(void 0===r&&(r=20),void setTimeout((()=>{this.addSubscribedMediaTrack(A,e,t,n,i,r-1)}),150))}get hasMetadata(){return!!this.participantInfo}getTrackPublicationBySid(A){return this.trackPublications.get(A)}updateInfo(A){if(!super.updateInfo(A))return!1;const e=new Map,t=new Map;return A.tracks.forEach((A=>{var n,i;let r=this.getTrackPublicationBySid(A.sid);if(r)r.updateInfo(A);else{const e=Ji.kindFromProto(A.type);if(!e)return;r=new Go(e,A,null===(n=this.signalClient.connectOptions)||void 0===n?void 0:n.autoSubscribe,{loggerContextCb:()=>this.logContext,loggerName:null===(i=this.loggerOptions)||void 0===i?void 0:i.loggerName}),r.updateInfo(A),t.set(A.sid,r);const s=Array.from(this.trackPublications.values()).find((A=>A.source===(null==r?void 0:r.source)));s&&r.source!==Ji.Source.Unknown&&this.log.debug("received a second track publication for ".concat(this.identity," with the same source: ").concat(r.source),Object.assign(Object.assign({},this.logContext),{oldTrack:zr(s),newTrack:zr(r)})),this.addTrackPublication(r)}e.set(A.sid,r)})),this.trackPublications.forEach((A=>{e.has(A.trackSid)||(this.log.trace("detected removed track on remote participant, unpublishing",Object.assign(Object.assign({},this.logContext),zr(A))),this.unpublishTrack(A.trackSid,!0))})),t.forEach((A=>{this.emit(vi.TrackPublished,A)})),!0}unpublishTrack(A,e){const t=this.trackPublications.get(A);if(!t)return;const{track:n}=t;switch(n&&(n.stop(),t.setTrack(void 0)),this.trackPublications.delete(A),t.kind){case Ji.Kind.Audio:this.audioTrackPublications.delete(A);break;case Ji.Kind.Video:this.videoTrackPublications.delete(A)}e&&this.emit(vi.TrackUnpublished,t)}setAudioOutput(A){return Xt(this,void 0,void 0,(function*(){this.audioOutput=A;const e=[];this.audioTrackPublications.forEach((t=>{var n;Or(t.track)&&_r(t.track)&&e.push(t.track.setSinkId(null!==(n=A.deviceId)&&void 0!==n?n:"default"))})),yield Promise.all(e)}))}emit(A){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return this.log.trace("participant event",Object.assign(Object.assign({},this.logContext),{event:A,args:t})),super.emit(A,...t)}}(Co=vo||(vo={})).Disconnected="disconnected",Co.Connecting="connecting",Co.Connected="connected",Co.Reconnecting="reconnecting",Co.SignalReconnecting="signalReconnecting";class Jo extends Zt.EventEmitter{constructor(A){var e,t,n,i;if(super(),e=this,this.state=vo.Disconnected,this.activeSpeakers=[],this.isE2EEEnabled=!1,this.audioEnabled=!0,this.isVideoPlaybackBlocked=!1,this.log=Vt,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,e,t)=>Xt(this,void 0,void 0,(function*(){var n;if("undefined"==typeof RTCPeerConnection||!ar()&&!cr())throw mr()?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 i=yield this.disconnectLock.lock();if(this.state===vo.Connected)return this.log.info("already connected to room ".concat(this.name),this.logContext),i(),Promise.resolve();if(this.connectFuture)return i(),this.connectFuture.promise;this.setAndEmitConnectionState(vo.Connecting),(null===(n=this.regionUrlProvider)||void 0===n?void 0:n.getServerUrl().toString())!==A&&(this.regionUrl=void 0,this.regionUrlProvider=void 0),fr(new URL(A))&&(void 0===this.regionUrlProvider?this.regionUrlProvider=new ko(A,e):this.regionUrlProvider.updateToken(e),this.regionUrlProvider.fetchRegionSettings().then((A=>{var e;null===(e=this.regionUrlProvider)||void 0===e||e.setServerReportedRegions(A)})).catch((A=>{this.log.warn("could not fetch region settings",Object.assign(Object.assign({},this.logContext),{error:A}))})));const r=(n,s,o)=>Xt(this,void 0,void 0,(function*(){var a,c;this.abortController&&this.abortController.abort();const d=new AbortController;this.abortController=d,null==i||i();try{yield this.attemptConnection(null!=o?o:A,e,t,d),this.abortController=void 0,n()}catch(l){if(this.regionUrlProvider&&l instanceof Fi&&l.reason!==ui.Cancelled&&l.reason!==ui.NotAllowed){let A=null;try{A=yield this.regionUrlProvider.getNextBestRegionUrl(null===(a=this.abortController)||void 0===a?void 0:a.signal)}catch(u){if(u instanceof Fi&&(401===u.status||u.reason===ui.Cancelled))return this.handleDisconnect(this.options.stopLocalTrackOnUnpublish),void s(u)}A&&!(null===(c=this.abortController)||void 0===c?void 0:c.signal.aborted)?(this.log.info("Initial connection failed with ConnectionError: ".concat(l.message,". Retrying with another region: ").concat(A),this.logContext),this.recreateEngine(),yield r(n,s,A)):(this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,Rr(l)),s(l))}else{let A=YA.UNKNOWN_REASON;l instanceof Fi&&(A=Rr(l)),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,A),s(l)}}})),s=this.regionUrl;return this.regionUrl=void 0,this.connectFuture=new Ir(((A,e)=>{r(A,e,s)}),(()=>{this.clearConnectionFutures()})),this.connectFuture.promise})),this.connectSignal=(A,e,t,n,i,r)=>Xt(this,void 0,void 0,(function*(){var s,o,a;const c=yield t.join(A,e,{autoSubscribe:n.autoSubscribe,adaptiveStream:"object"==typeof i.adaptiveStream||i.adaptiveStream,maxRetries:n.maxRetries,e2eeEnabled:!!this.e2eeManager,websocketTimeout:n.websocketTimeout},r.signal);let d=c.serverInfo;if(d||(d={version:c.serverVersion,region:c.serverRegion}),this.serverInfo=d,this.log.debug("connected to Livekit Server ".concat(Object.entries(d).map((A=>{let[e,t]=A;return"".concat(e,": ").concat(t)})).join(", ")),{room:null===(s=c.room)||void 0===s?void 0:s.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}),!d.version)throw new Ii("unknown server version");return"0.15.1"===d.version&&this.options.dynacast&&(this.log.debug("disabling dynacast due to server version",this.logContext),i.dynacast=!1),c})),this.applyJoinResponse=A=>{const e=A.participant;if(this.localParticipant.sid=e.sid,this.localParticipant.identity=e.identity,this.localParticipant.setEnabledPublishCodecs(A.enabledPublishCodecs),this.options.e2ee&&this.e2eeManager)try{this.e2eeManager.setSifTrailer(A.sifTrailer)}catch(t){this.log.error(t instanceof Error?t.message:"Could not set SifTrailer",Object.assign(Object.assign({},this.logContext),{error:t}))}this.handleParticipantUpdates([e,...A.otherParticipants]),A.room&&this.handleRoomUpdate(A.room)},this.attemptConnection=(A,e,t,n)=>Xt(this,void 0,void 0,(function*(){var i,r;this.state===vo.Reconnecting||this.isResuming||(null===(i=this.engine)||void 0===i?void 0:i.pendingReconnect)?(this.log.info("Reconnection attempt replaced by new connection attempt",this.logContext),this.recreateEngine()):this.maybeCreateEngine(),(null===(r=this.regionUrlProvider)||void 0===r?void 0:r.isCloud())&&this.engine.setRegionUrlProvider(this.regionUrlProvider),this.acquireAudioContext(),this.connOptions=Object.assign(Object.assign({},Ls),t),this.connOptions.rtcConfig&&(this.engine.rtcConfig=this.connOptions.rtcConfig),this.connOptions.peerConnectionTimeout&&(this.engine.peerConnectionTimeout=this.connOptions.peerConnectionTimeout);try{const t=yield this.connectSignal(A,e,this.engine,this.connOptions,this.options,n);this.applyJoinResponse(t),this.setupLocalParticipantEvents(),this.emit(Bi.SignalConnected)}catch(s){yield this.engine.close(),this.recreateEngine();const A=new Fi("could not establish signal connection",ui.ServerUnreachable);throw s instanceof Error&&(A.message="".concat(A.message,": ").concat(s.message)),s instanceof Fi&&(A.reason=s.reason,A.status=s.status),this.log.debug("error trying to establish signal connection",Object.assign(Object.assign({},this.logContext),{error:s})),A}if(n.signal.aborted)throw yield this.engine.close(),this.recreateEngine(),new Fi("Connection attempt aborted",ui.Cancelled);try{yield this.engine.waitForPCInitialConnection(this.connOptions.peerConnectionTimeout,n)}catch(o){throw yield this.engine.close(),this.recreateEngine(),o}pr()&&this.options.disconnectOnPageLeave&&(window.addEventListener("pagehide",this.onPageLeave),window.addEventListener("beforeunload",this.onPageLeave)),pr()&&document.addEventListener("freeze",this.onPageLeave),this.setAndEmitConnectionState(vo.Connected),this.emit(Bi.Connected),this.registerConnectionReconcile()})),this.disconnect=function(){for(var A=arguments.length,t=new Array(A),n=0;n<A;n++)t[n]=arguments[n];return Xt(e,[...t],void 0,(function(){var A=this;let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function*(){var t,n,i,r;const s=yield A.disconnectLock.lock();try{if(A.state===vo.Disconnected)return void A.log.debug("already disconnected",A.logContext);A.log.info("disconnect from room",Object.assign({},A.logContext)),(A.state===vo.Connecting||A.state===vo.Reconnecting||A.isResuming)&&(A.log.warn("abort connection attempt",A.logContext),null===(t=A.abortController)||void 0===t||t.abort(),null===(i=null===(n=A.connectFuture)||void 0===n?void 0:n.reject)||void 0===i||i.call(n,new Fi("Client initiated disconnect",ui.Cancelled)),A.connectFuture=void 0),(null===(r=A.engine)||void 0===r?void 0:r.client.isDisconnected)||(yield A.engine.client.sendLeave()),A.engine&&(yield A.engine.close()),A.handleDisconnect(e,YA.CLIENT_INITIATED),A.engine=void 0}finally{s()}}()}))},this.onPageLeave=()=>Xt(this,void 0,void 0,(function*(){this.log.info("Page leave detected, disconnecting",this.logContext),yield this.disconnect()})),this.startAudio=()=>Xt(this,void 0,void 0,(function*(){const A=[],e=Oi();if(e&&"iOS"===e.os){const e="livekit-dummy-audio-el";let t=document.getElementById(e);if(!t){t=document.createElement("audio"),t.id=e,t.autoplay=!0,t.hidden=!0;const A=Sr();A.enabled=!0;const n=new MediaStream([A]);t.srcObject=n,document.addEventListener("visibilitychange",(()=>{t&&(t.srcObject=document.hidden?null:n,document.hidden||(this.log.debug("page visible again, triggering startAudio to resume playback and update playback status",this.logContext),this.startAudio()))})),document.body.append(t),this.once(Bi.Disconnected,(()=>{null==t||t.remove(),t=null}))}A.push(t)}this.remoteParticipants.forEach((e=>{e.audioTrackPublications.forEach((e=>{e.track&&e.track.attachedElements.forEach((e=>{A.push(e)}))}))}));try{yield Promise.all([this.acquireAudioContext(),...A.map((A=>(A.muted=!1,A.play())))]),this.handleAudioPlaybackStarted()}catch(t){throw this.handleAudioPlaybackFailed(t),t}})),this.startVideo=()=>Xt(this,void 0,void 0,(function*(){const A=[];for(const e of this.remoteParticipants.values())e.videoTrackPublications.forEach((e=>{var t;null===(t=e.track)||void 0===t||t.attachedElements.forEach((e=>{A.includes(e)||A.push(e)}))}));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(vo.Reconnecting)&&this.emit(Bi.Reconnecting)},this.handleSignalRestarted=A=>Xt(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(e){this.log.error("error trying to re-publish tracks after reconnection",Object.assign(Object.assign({},this.logContext),{error:e}))}try{yield this.engine.waitForRestarted(),this.log.debug("fully reconnected to server",Object.assign(Object.assign({},this.logContext),{region:A.serverRegion}))}catch(t){return}this.setAndEmitConnectionState(vo.Connected),this.emit(Bi.Reconnected),this.registerConnectionReconcile(),this.emitBufferedEvents()})),this.handleParticipantUpdates=A=>{A.forEach((A=>{var e;if(A.identity===this.localParticipant.identity)return void this.localParticipant.updateInfo(A);""===A.identity&&(A.identity=null!==(e=this.sidToIdentity.get(A.sid))&&void 0!==e?e:"");let t=this.remoteParticipants.get(A.identity);A.state===ne.DISCONNECTED?this.handleParticipantDisconnected(A.identity,t):t=this.getOrCreateParticipant(A.identity,A)}))},this.handleActiveSpeakersUpdate=A=>{const e=[],t={};A.forEach((A=>{if(t[A.sid]=!0,A.sid===this.localParticipant.sid)this.localParticipant.audioLevel=A.level,this.localParticipant.setIsSpeaking(!0),e.push(this.localParticipant);else{const t=this.getRemoteParticipantBySid(A.sid);t&&(t.audioLevel=A.level,t.setIsSpeaking(!0),e.push(t))}})),t[this.localParticipant.sid]||(this.localParticipant.audioLevel=0,this.localParticipant.setIsSpeaking(!1)),this.remoteParticipants.forEach((A=>{t[A.sid]||(A.audioLevel=0,A.setIsSpeaking(!1))})),this.activeSpeakers=e,this.emitWhenConnected(Bi.ActiveSpeakersChanged,e)},this.handleSpeakersChanged=A=>{const e=new Map;this.activeSpeakers.forEach((A=>{const t=this.remoteParticipants.get(A.identity);t&&t.sid!==A.sid||e.set(A.sid,A)})),A.forEach((A=>{let t=this.getRemoteParticipantBySid(A.sid);A.sid===this.localParticipant.sid&&(t=this.localParticipant),t&&(t.audioLevel=A.level,t.setIsSpeaking(A.active),A.active?e.set(A.sid,t):e.delete(A.sid))}));const t=Array.from(e.values());t.sort(((A,e)=>e.audioLevel-A.audioLevel)),this.activeSpeakers=t,this.emitWhenConnected(Bi.ActiveSpeakersChanged,t)},this.handleStreamStateUpdate=A=>{A.streamStates.forEach((A=>{const e=this.getRemoteParticipantBySid(A.participantSid);if(!e)return;const t=e.getTrackPublicationBySid(A.trackSid);if(!t||!t.track)return;const n=Ji.streamStateFromProto(A.state);n!==t.track.streamState&&(t.track.streamState=n,e.emit(vi.TrackStreamStateChanged,t,t.track.streamState),this.emitWhenConnected(Bi.TrackStreamStateChanged,t,t.track.streamState,e))}))},this.handleSubscriptionPermissionUpdate=A=>{const e=this.getRemoteParticipantBySid(A.participantSid);if(!e)return;const t=e.getTrackPublicationBySid(A.trackSid);t&&t.setAllowed(A.allowed)},this.handleSubscriptionError=A=>{const e=Array.from(this.remoteParticipants.values()).find((e=>e.trackPublications.has(A.trackSid)));if(!e)return;const t=e.getTrackPublicationBySid(A.trackSid);t&&t.setSubscriptionError(A.err)},this.handleDataPacket=A=>{const e=this.remoteParticipants.get(A.participantIdentity);if("user"===A.value.case)this.handleUserPacket(e,A.value.value,A.kind);else if("transcription"===A.value.case)this.handleTranscription(e,A.value.value);else if("sipDtmf"===A.value.case)this.handleSipDtmf(e,A.value.value);else if("chatMessage"===A.value.case)this.handleChatMessage(e,A.value.value);else if("metrics"===A.value.case)this.handleMetrics(A.value.value,e);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 e=A.value.value;this.handleIncomingRpcRequest(A.participantIdentity,e.id,e.method,e.payload,e.responseTimeoutMs,e.version)}},this.handleUserPacket=(A,e,t)=>{this.emit(Bi.DataReceived,e.payload,A,t,e.topic),null==A||A.emit(vi.DataReceived,e.payload,t)},this.handleSipDtmf=(A,e)=>{this.emit(Bi.SipDTMFReceived,e,A),null==A||A.emit(vi.SipDTMFReceived,e)},this.bufferedSegments=new Map,this.handleTranscription=(A,e)=>{const t=e.transcribedParticipantIdentity===this.localParticipant.identity?this.localParticipant:this.getParticipantByIdentity(e.transcribedParticipantIdentity),n=null==t?void 0:t.trackPublications.get(e.trackId),i=function(A,e){return A.segments.map((A=>{let{id:t,text:n,language:i,startTime:r,endTime:s,final:o}=A;var a;const c=null!==(a=e.get(t))&&void 0!==a?a:Date.now(),d=Date.now();return o?e.delete(t):e.set(t,c),{id:t,text:n,startTime:Number.parseInt(r.toString()),endTime:Number.parseInt(s.toString()),final:o,language:i,firstReceivedTime:c,lastReceivedTime:d}}))}(e,this.transcriptionReceivedTimes);null==n||n.emit(Qi.TranscriptionReceived,i),null==t||t.emit(vi.TranscriptionReceived,i,n),this.emit(Bi.TranscriptionReceived,i,t,n)},this.handleChatMessage=(A,e)=>{const t=function(A){const{id:e,timestamp:t,message:n,editTimestamp:i}=A;return{id:e,timestamp:Number.parseInt(t.toString()),editTimestamp:i?Number.parseInt(i.toString()):void 0,message:n}}(e);this.emit(Bi.ChatMessage,t,A)},this.handleMetrics=(A,e)=>{this.emit(Bi.MetricsReceived,A,e)},this.handleAudioPlaybackStarted=()=>{this.canPlaybackAudio||(this.audioEnabled=!0,this.emit(Bi.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(Bi.AudioPlaybackStatusChanged,!1))},this.handleVideoPlaybackStarted=()=>{this.isVideoPlaybackBlocked&&(this.isVideoPlaybackBlocked=!1,this.emit(Bi.VideoPlaybackStatusChanged,!0))},this.handleVideoPlaybackFailed=()=>{this.isVideoPlaybackBlocked||(this.isVideoPlaybackBlocked=!0,this.emit(Bi.VideoPlaybackStatusChanged,!1))},this.handleDeviceChange=()=>Xt(this,void 0,void 0,(function*(){var A,e,t;const n=ns.getInstance().previousDevices,i=yield ns.getInstance().getDevices(void 0,!1),r=Oi();if("Chrome"===(null==r?void 0:r.name)&&"iOS"!==r.os)for(let o of i){const A=n.find((A=>A.deviceId===o.deviceId));A&&""!==A.label&&A.kind===o.kind&&A.label!==o.label&&"default"===this.getActiveDevice(o.kind)&&this.emit(Bi.ActiveDeviceChanged,o.kind,o.deviceId)}const s=["audiooutput","audioinput","videoinput"];for(let o of s){const r=Yr(o),s=this.localParticipant.getTrackPublication(r);if(s&&(null===(A=s.track)||void 0===A?void 0:A.isUserProvided))continue;const a=i.filter((A=>A.kind===o)),c=this.getActiveDevice(o);c===(null===(e=n.filter((A=>A.kind===o))[0])||void 0===e?void 0:e.deviceId)&&a.length>0&&(null===(t=a[0])||void 0===t?void 0:t.deviceId)!==c?yield this.switchActiveDevice(o,a[0].deviceId):"audioinput"===o&&!hr()||"videoinput"===o||a.length>0&&!a.find((A=>A.deviceId===this.getActiveDevice(o)))&&(yield this.switchActiveDevice(o,a[0].deviceId))}this.emit(Bi.MediaDevicesChanged)})),this.handleRoomUpdate=A=>{const e=this.roomInfo;this.roomInfo=A,e&&e.metadata!==A.metadata&&this.emitWhenConnected(Bi.RoomMetadataChanged,A.metadata),(null==e?void 0:e.activeRecording)!==A.activeRecording&&this.emitWhenConnected(Bi.RecordingStatusChanged,A.activeRecording)},this.handleConnectionQualityUpdate=A=>{A.updates.forEach((A=>{if(A.participantSid===this.localParticipant.sid)return void this.localParticipant.setConnectionQuality(A.quality);const e=this.getRemoteParticipantBySid(A.participantSid);e&&e.setConnectionQuality(A.quality)}))},this.onLocalParticipantMetadataChanged=A=>{this.emit(Bi.ParticipantMetadataChanged,A,this.localParticipant)},this.onLocalParticipantNameChanged=A=>{this.emit(Bi.ParticipantNameChanged,A,this.localParticipant)},this.onLocalAttributesChanged=A=>{this.emit(Bi.ParticipantAttributesChanged,A,this.localParticipant)},this.onLocalTrackMuted=A=>{this.emit(Bi.TrackMuted,A,this.localParticipant)},this.onLocalTrackUnmuted=A=>{this.emit(Bi.TrackUnmuted,A,this.localParticipant)},this.onTrackProcessorUpdate=A=>{var e;null===(e=null==A?void 0:A.onPublish)||void 0===e||e.call(A,this)},this.onLocalTrackPublished=A=>Xt(this,void 0,void 0,(function*(){var e,t,n,i,r,s;null===(e=A.track)||void 0===e||e.on(Qi.TrackProcessorUpdate,this.onTrackProcessorUpdate),null===(t=A.track)||void 0===t||t.on(Qi.Restarted,this.onLocalTrackRestarted),null===(r=null===(i=null===(n=A.track)||void 0===n?void 0:n.getProcessor())||void 0===i?void 0:i.onPublish)||void 0===r||r.call(i,this),this.emit(Bi.LocalTrackPublished,A,this.localParticipant),Kr(A.track)&&(yield A.track.checkForSilence())&&this.emit(Bi.LocalAudioSilenceDetected,A);const o=yield null===(s=A.track)||void 0===s?void 0:s.getDeviceId(!1),a=qr(A.source);a&&o&&o!==this.localParticipant.activeDeviceMap.get(a)&&(this.localParticipant.activeDeviceMap.set(a,o),this.emit(Bi.ActiveDeviceChanged,a,o))})),this.onLocalTrackUnpublished=A=>{var e,t;null===(e=A.track)||void 0===e||e.off(Qi.TrackProcessorUpdate,this.onTrackProcessorUpdate),null===(t=A.track)||void 0===t||t.off(Qi.Restarted,this.onLocalTrackRestarted),this.emit(Bi.LocalTrackUnpublished,A,this.localParticipant)},this.onLocalTrackRestarted=A=>Xt(this,void 0,void 0,(function*(){const e=yield A.getDeviceId(!1),t=qr(A.source);t&&e&&e!==this.localParticipant.activeDeviceMap.get(t)&&(this.log.debug("local track restarted, setting ".concat(t," ").concat(e," active"),this.logContext),this.localParticipant.activeDeviceMap.set(t,e),this.emit(Bi.ActiveDeviceChanged,t,e))})),this.onLocalConnectionQualityChanged=A=>{this.emit(Bi.ConnectionQualityChanged,A,this.localParticipant)},this.onMediaDevicesError=A=>{this.emit(Bi.MediaDevicesError,A)},this.onLocalParticipantPermissionsChanged=A=>{this.emit(Bi.ParticipantPermissionsChanged,A,this.localParticipant)},this.onLocalChatMessageSent=A=>{this.emit(Bi.ChatMessage,A,this.localParticipant)},this.setMaxListeners(100),this.remoteParticipants=new Map,this.sidToIdentity=new Map,this.options=Object.assign(Object.assign({},xs),A),this.log=Gt(null!==(t=this.options.loggerName)&&void 0!==t?t:Mt.Room),this.transcriptionReceivedTimes=new Map,this.options.audioCaptureDefaults=Object.assign(Object.assign({},Rs),null==A?void 0:A.audioCaptureDefaults),this.options.videoCaptureDefaults=Object.assign(Object.assign({},Ds),null==A?void 0:A.videoCaptureDefaults),this.options.publishDefaults=Object.assign(Object.assign({},Hs),null==A?void 0:A.publishDefaults),this.maybeCreateEngine(),this.disconnectLock=new a,this.localParticipant=new Vo("","",this.engine,this.options,this.rpcHandlers),this.options.videoCaptureDefaults.deviceId&&this.localParticipant.activeDeviceMap.set("videoinput",Pr(this.options.videoCaptureDefaults.deviceId)),this.options.audioCaptureDefaults.deviceId&&this.localParticipant.activeDeviceMap.set("audioinput",Pr(this.options.audioCaptureDefaults.deviceId)),(null===(n=this.options.audioOutput)||void 0===n?void 0:n.deviceId)&&this.switchActiveDevice("audiooutput",Pr(this.options.audioOutput.deviceId)).catch((A=>this.log.warn("Could not set audio output: ".concat(A.message),this.logContext))),this.options.e2ee&&this.setupE2EE(),pr()){const A=new AbortController;null===(i=navigator.mediaDevices)||void 0===i||i.addEventListener("devicechange",this.handleDeviceChange,{signal:A.signal}),Jo.cleanupRegistry&&Jo.cleanupRegistry.register(this,(()=>{A.abort()}))}}registerTextStreamHandler(A,e){if(this.textStreamHandlers.has(A))throw new TypeError('A text stream handler for topic "'.concat(A,'" has already been set.'));this.textStreamHandlers.set(A,e)}unregisterTextStreamHandler(A){this.textStreamHandlers.delete(A)}registerByteStreamHandler(A,e){if(this.byteStreamHandlers.has(A))throw new TypeError('A byte stream handler for topic "'.concat(A,'" has already been set.'));this.byteStreamHandlers.set(A,e)}unregisterByteStreamHandler(A){this.byteStreamHandlers.delete(A)}registerRpcMethod(A,e){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,e)}unregisterRpcMethod(A){this.rpcHandlers.delete(A)}handleIncomingRpcRequest(A,e,t,n,i,r){return Xt(this,void 0,void 0,(function*(){if(yield this.engine.publishRpcAck(A,e),1!==r)return void(yield this.engine.publishRpcResponse(A,e,null,Ks.builtIn("UNSUPPORTED_VERSION")));const s=this.rpcHandlers.get(t);if(!s)return void(yield this.engine.publishRpcResponse(A,e,null,Ks.builtIn("UNSUPPORTED_METHOD")));let o=null,a=null;try{const r=yield s({requestId:e,callerIdentity:A,payload:n,responseTimeout:i});_s(r)>15360?(o=Ks.builtIn("RESPONSE_PAYLOAD_TOO_LARGE"),console.warn("RPC Response payload too large for ".concat(t))):a=r}catch(c){c instanceof Ks?o=c:(console.warn("Uncaught error returned by RPC handler for ".concat(t,". Returning APPLICATION_ERROR instead."),c),o=Ks.builtIn("APPLICATION_ERROR"))}yield this.engine.publishRpcResponse(A,e,a,o)}))}setE2EEEnabled(A){return Xt(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 es(this.options.e2ee),this.e2eeManager.on(ci.ParticipantEncryptionStatusChanged,((A,e)=>{e.isLocal&&(this.isE2EEEnabled=A),this.emit(Bi.ParticipantEncryptionStatusChanged,A,e)})),this.e2eeManager.on(ci.EncryptionError,(A=>this.emit(Bi.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,e;return null!==(e=null===(A=this.roomInfo)||void 0===A?void 0:A.activeRecording)&&void 0!==e&&e}getSid(){return Xt(this,void 0,void 0,(function*(){return this.state===vo.Disconnected?"":this.roomInfo&&""!==this.roomInfo.sid?this.roomInfo.sid:new Promise(((A,e)=>{const t=e=>{""!==e.sid&&(this.engine.off(yi.RoomUpdate,t),A(e.sid))};this.engine.on(yi.RoomUpdate,t),this.once(Bi.Disconnected,(()=>{this.engine.off(yi.RoomUpdate,t),e("Room disconnected before room server id was available")}))}))}))}get name(){var A,e;return null!==(e=null===(A=this.roomInfo)||void 0===A?void 0:A.name)&&void 0!==e?e:""}get metadata(){var A;return null===(A=this.roomInfo)||void 0===A?void 0:A.metadata}get numParticipants(){var A,e;return null!==(e=null===(A=this.roomInfo)||void 0===A?void 0:A.numParticipants)&&void 0!==e?e:0}get numPublishers(){var A,e;return null!==(e=null===(A=this.roomInfo)||void 0===A?void 0:A.numPublishers)&&void 0!==e?e:0}maybeCreateEngine(){this.engine&&!this.engine.isClosed||(this.engine=new Qo(this.options),this.engine.on(yi.ParticipantUpdate,this.handleParticipantUpdates).on(yi.RoomUpdate,this.handleRoomUpdate).on(yi.SpeakersChanged,this.handleSpeakersChanged).on(yi.StreamStateChanged,this.handleStreamStateUpdate).on(yi.ConnectionQualityUpdate,this.handleConnectionQualityUpdate).on(yi.SubscriptionError,this.handleSubscriptionError).on(yi.SubscriptionPermissionUpdate,this.handleSubscriptionPermissionUpdate).on(yi.MediaTrackAdded,((A,e,t)=>{this.onTrackAdded(A,e,t)})).on(yi.Disconnected,(A=>{this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,A)})).on(yi.ActiveSpeakersUpdate,this.handleActiveSpeakersUpdate).on(yi.DataPacketReceived,this.handleDataPacket).on(yi.Resuming,(()=>{this.clearConnectionReconcile(),this.isResuming=!0,this.log.info("Resuming signal connection",this.logContext),this.setAndEmitConnectionState(vo.SignalReconnecting)&&this.emit(Bi.SignalReconnecting)})).on(yi.Resumed,(()=>{this.registerConnectionReconcile(),this.isResuming=!1,this.log.info("Resumed signal connection",this.logContext),this.updateSubscriptions(),this.emitBufferedEvents(),this.setAndEmitConnectionState(vo.Connected)&&this.emit(Bi.Reconnected)})).on(yi.SignalResumed,(()=>{this.bufferedEvents=[],(this.state===vo.Reconnecting||this.isResuming)&&this.sendSyncState()})).on(yi.Restarting,this.handleRestarting).on(yi.SignalRestarted,this.handleSignalRestarted).on(yi.Offline,(()=>{this.setAndEmitConnectionState(vo.Reconnecting)&&this.emit(Bi.Reconnecting)})).on(yi.DCBufferStatusChanged,((A,e)=>{this.emit(Bi.DCBufferStatusChanged,A,e)})).on(yi.LocalTrackSubscribed,(A=>{const e=this.localParticipant.getTrackPublications().find((e=>{let{trackSid:t}=e;return t===A}));e?(this.localParticipant.emit(vi.LocalTrackSubscribed,e),this.emitWhenConnected(Bi.LocalTrackSubscribed,e,this.localParticipant)):this.log.warn("could not find local track subscription for subscribed event",this.logContext)})).on(yi.RoomMoved,(A=>{this.log.debug("room moved",A),A.room&&this.handleRoomUpdate(A.room),this.remoteParticipants.forEach(((A,e)=>{this.handleParticipantDisconnected(e,A)})),this.emit(Bi.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 e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return ns.getInstance().getDevices(A,e)}prepareConnection(A,e){return Xt(this,void 0,void 0,(function*(){if(this.state===vo.Disconnected){this.log.debug("prepareConnection to ".concat(A),this.logContext);try{if(fr(new URL(A))&&e){this.regionUrlProvider=new ko(A,e);const t=yield this.regionUrlProvider.getNextBestRegionUrl();t&&this.state===vo.Disconnected&&(this.regionUrl=t,yield fetch(Hr(t),{method:"HEAD"}),this.log.debug("prepared connection to ".concat(t),this.logContext))}else yield fetch(Hr(A),{method:"HEAD"})}catch(t){this.log.warn("could not prepare connection",Object.assign(Object.assign({},this.logContext),{error:t}))}}}))}getParticipantByIdentity(A){return this.localParticipant.identity===A?this.localParticipant:this.remoteParticipants.get(A)}clearConnectionFutures(){this.connectFuture=void 0}simulateScenario(A,e){return Xt(this,void 0,void 0,(function*(){let t,n=()=>{};switch(A){case"signal-reconnect":yield this.engine.client.handleOnClose("simulate disconnect");break;case"speaker":t=new bt({scenario:{case:"speakerUpdate",value:3}});break;case"node-failure":t=new bt({scenario:{case:"nodeFailure",value:!0}});break;case"server-leave":t=new bt({scenario:{case:"serverLeave",value:!0}});break;case"migration":t=new bt({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=()=>Xt(this,void 0,void 0,(function*(){yield this.engine.client.handleOnClose("simulate resume-disconnect")})),t=new bt({scenario:{case:"disconnectSignalOnResume",value:!0}});break;case"disconnect-signal-on-resume-no-messages":n=()=>Xt(this,void 0,void 0,(function*(){yield this.engine.client.handleOnClose("simulate resume-disconnect")})),t=new bt({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":t=new bt({scenario:{case:"switchCandidateProtocol",value:"force-tls"===A?2:1}}),n=()=>Xt(this,void 0,void 0,(function*(){const A=this.engine.client.onLeave;A&&A(new nt({reason:YA.CLIENT_INITIATED,action:it.RECONNECT}))}));break;case"subscriber-bandwidth":if(void 0===e||"number"!=typeof e)throw new Error("subscriber-bandwidth requires a number as argument");t=new bt({scenario:{case:"subscriberBandwidth",value:xr(e)}});break;case"leave-full-reconnect":t=new bt({scenario:{case:"leaveRequestFullReconnect",value:!0}})}t&&(yield this.engine.client.sendSimulateScenario(t),yield n())}))}get canPlaybackAudio(){return this.audioEnabled}get canPlaybackVideo(){return!this.isVideoPlaybackBlocked}getActiveDevice(A){return this.localParticipant.activeDeviceMap.get(A)}switchActiveDevice(A,e){return Xt(this,arguments,void 0,(function(A,e){var t=this;let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function*(){var i,r,s,o,a,c,d,l;let u=!0,h=!1;const g=n?{exact:e}:e;if("audioinput"===A){h=0===t.localParticipant.audioTrackPublications.size;const e=null!==(i=t.getActiveDevice(A))&&void 0!==i?i:t.options.audioCaptureDefaults.deviceId;t.options.audioCaptureDefaults.deviceId=g;const n=Array.from(t.localParticipant.audioTrackPublications.values()).filter((A=>A.source===Ji.Source.Microphone));try{u=(yield Promise.all(n.map((A=>{var e;return null===(e=A.audioTrack)||void 0===e?void 0:e.setDeviceId(g)})))).every((A=>!0===A))}catch(p){throw t.options.audioCaptureDefaults.deviceId=e,p}}else if("videoinput"===A){h=0===t.localParticipant.videoTrackPublications.size;const e=null!==(r=t.getActiveDevice(A))&&void 0!==r?r:t.options.videoCaptureDefaults.deviceId;t.options.videoCaptureDefaults.deviceId=g;const n=Array.from(t.localParticipant.videoTrackPublications.values()).filter((A=>A.source===Ji.Source.Camera));try{u=(yield Promise.all(n.map((A=>{var e;return null===(e=A.videoTrack)||void 0===e?void 0:e.setDeviceId(g)})))).every((A=>!0===A))}catch(p){throw t.options.videoCaptureDefaults.deviceId=e,p}}else if("audiooutput"===A){if(!lr()&&!t.options.webAudioMix||t.options.webAudioMix&&t.audioContext&&!("setSinkId"in t.audioContext))throw new Error("cannot switch audio output, setSinkId not supported");t.options.webAudioMix&&(e=null!==(s=yield ns.getInstance().normalizeDeviceId("audiooutput",e))&&void 0!==s?s:""),null!==(o=(l=t.options).audioOutput)&&void 0!==o||(l.audioOutput={});const n=null!==(a=t.getActiveDevice(A))&&void 0!==a?a:t.options.audioOutput.deviceId;t.options.audioOutput.deviceId=e;try{t.options.webAudioMix&&(null===(c=t.audioContext)||void 0===c||c.setSinkId(e)),yield Promise.all(Array.from(t.remoteParticipants.values()).map((A=>A.setAudioOutput({deviceId:e}))))}catch(p){throw t.options.audioOutput.deviceId=n,p}}return(h||"audiooutput"===A)&&(t.localParticipant.activeDeviceMap.set(A,"audiooutput"===A&&(null===(d=t.options.audioOutput)||void 0===d?void 0:d.deviceId)||e),t.emit(Bi.ActiveDeviceChanged,A,e)),u}()}))}setupLocalParticipantEvents(){this.localParticipant.on(vi.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).on(vi.ParticipantNameChanged,this.onLocalParticipantNameChanged).on(vi.AttributesChanged,this.onLocalAttributesChanged).on(vi.TrackMuted,this.onLocalTrackMuted).on(vi.TrackUnmuted,this.onLocalTrackUnmuted).on(vi.LocalTrackPublished,this.onLocalTrackPublished).on(vi.LocalTrackUnpublished,this.onLocalTrackUnpublished).on(vi.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).on(vi.MediaDevicesError,this.onMediaDevicesError).on(vi.AudioStreamAcquired,this.startAudio).on(vi.ChatMessage,this.onLocalChatMessageSent).on(vi.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,e,t){if(this.state===vo.Connecting||this.state===vo.Reconnecting){const n=()=>{this.onTrackAdded(A,e,t),i()},i=()=>{this.off(Bi.Reconnected,n),this.off(Bi.Connected,n),this.off(Bi.Disconnected,i)};return this.once(Bi.Reconnected,n),this.once(Bi.Connected,n),void this.once(Bi.Disconnected,i)}if(this.state===vo.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 n=function(A){const e=A.split("|");return e.length>1?[e[0],A.substr(e[0].length+1)]:[A,""]}(e.id),i=n[0];let r=n[1],s=A.id;if(r&&r.startsWith("TR")&&(s=r),i===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===i));if(!o)return void this.log.error("Tried to add a track for a participant, that's not present. Sid: ".concat(i),this.logContext);let a;this.options.adaptiveStream&&(a="object"==typeof this.options.adaptiveStream?this.options.adaptiveStream:{}),o.addSubscribedMediaTrack(A,s,e,t,a)}handleDisconnect(){let A=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1?arguments[1]:void 0;var t;if(this.clearConnectionReconcile(),this.isResuming=!1,this.bufferedEvents=[],this.transcriptionReceivedTimes.clear(),this.state!==vo.Disconnected){this.regionUrl=void 0;try{this.remoteParticipants.forEach((A=>{A.trackPublications.forEach((e=>{A.unpublishTrack(e.trackSid)}))})),this.localParticipant.trackPublications.forEach((e=>{var t,n,i;e.track&&this.localParticipant.unpublishTrack(e.track,A),A?(null===(t=e.track)||void 0===t||t.detach(),null===(n=e.track)||void 0===n||n.stop()):null===(i=e.track)||void 0===i||i.stopMonitor()})),this.localParticipant.off(vi.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).off(vi.ParticipantNameChanged,this.onLocalParticipantNameChanged).off(vi.AttributesChanged,this.onLocalAttributesChanged).off(vi.TrackMuted,this.onLocalTrackMuted).off(vi.TrackUnmuted,this.onLocalTrackUnmuted).off(vi.LocalTrackPublished,this.onLocalTrackPublished).off(vi.LocalTrackUnpublished,this.onLocalTrackUnpublished).off(vi.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).off(vi.MediaDevicesError,this.onMediaDevicesError).off(vi.AudioStreamAcquired,this.startAudio).off(vi.ChatMessage,this.onLocalChatMessageSent).off(vi.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),pr()&&(window.removeEventListener("beforeunload",this.onPageLeave),window.removeEventListener("pagehide",this.onPageLeave),window.removeEventListener("freeze",this.onPageLeave),null===(t=navigator.mediaDevices)||void 0===t||t.removeEventListener("devicechange",this.handleDeviceChange))}finally{this.setAndEmitConnectionState(vo.Disconnected),this.emit(Bi.Disconnected,e)}}}handleParticipantDisconnected(A,e){var t;this.remoteParticipants.delete(A),e&&(e.trackPublications.forEach((A=>{e.unpublishTrack(A.trackSid,!0)})),this.emit(Bi.ParticipantDisconnected,e),e.setDisconnected(),null===(t=this.localParticipant)||void 0===t||t.handleParticipantDisconnected(e.identity))}handleStreamHeader(A,e){return Xt(this,void 0,void 0,(function*(){var t;if("byteHeader"===A.contentHeader.case){const n=this.byteStreamHandlers.get(A.topic);if(!n)return void this.log.debug("ignoring incoming byte stream due to no handler for topic",A.topic);let i;const r={id:A.streamId,name:null!==(t=A.contentHeader.value.name)&&void 0!==t?t:"unknown",mimeType:A.mimeType,size:A.totalLength?Number(A.totalLength):void 0,topic:A.topic,timestamp:Dr(A.timestamp),attributes:A.attributes},s=new ReadableStream({start:e=>{i=e,this.byteStreamControllers.set(A.streamId,{info:r,controller:i,startTime:Date.now()})}});n(new Fo(r,s,Dr(A.totalLength)),{identity:e})}else if("textHeader"===A.contentHeader.case){const t=this.textStreamHandlers.get(A.topic);if(!t)return void this.log.debug("ignoring incoming text stream due to no handler for topic",A.topic);let n;const i={id:A.streamId,mimeType:A.mimeType,size:A.totalLength?Number(A.totalLength):void 0,topic:A.topic,timestamp:Number(A.timestamp),attributes:A.attributes},r=new ReadableStream({start:e=>{n=e,this.textStreamControllers.set(A.streamId,{info:i,controller:n,startTime:Date.now()})}});t(new To(i,r,Dr(A.totalLength)),{identity:e})}}))}handleStreamChunk(A){const e=this.byteStreamControllers.get(A.streamId);e&&A.content.length>0&&e.controller.enqueue(A);const t=this.textStreamControllers.get(A.streamId);t&&A.content.length>0&&t.controller.enqueue(A)}handleStreamTrailer(A){const e=this.textStreamControllers.get(A.streamId);e&&(e.info.attributes=Object.assign(Object.assign({},e.info.attributes),A.attributes),e.controller.close(),this.textStreamControllers.delete(A.streamId));const t=this.byteStreamControllers.get(A.streamId);t&&(t.info.attributes=Object.assign(Object.assign({},t.info.attributes),A.attributes),t.controller.close(),this.byteStreamControllers.delete(A.streamId))}acquireAudioContext(){return Xt(this,void 0,void 0,(function*(){var A,e;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=Xr())&&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(),or(200)])}catch(n){this.log.warn("Could not resume audio context",Object.assign(Object.assign({},this.logContext),{error:n}))}const t="running"===(null===(e=this.audioContext)||void 0===e?void 0:e.state);t!==this.canPlaybackAudio&&(this.audioEnabled=t,this.emit(Bi.AudioPlaybackStatusChanged,t))}))}createParticipant(A,e){var t;let n;return n=e?jo.fromParticipantInfo(this.engine.client,e,{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&&n.setAudioContext(this.audioContext),(null===(t=this.options.audioOutput)||void 0===t?void 0:t.deviceId)&&n.setAudioOutput(this.options.audioOutput).catch((A=>this.log.warn("Could not set audio output: ".concat(A.message),this.logContext))),n}getOrCreateParticipant(A,e){if(this.remoteParticipants.has(A)){const t=this.remoteParticipants.get(A);return e&&t.updateInfo(e)&&this.sidToIdentity.set(e.sid,e.identity),t}const t=this.createParticipant(A,e);return this.remoteParticipants.set(A,t),this.sidToIdentity.set(e.sid,e.identity),this.emitWhenConnected(Bi.ParticipantConnected,t),t.on(vi.TrackPublished,(A=>{this.emitWhenConnected(Bi.TrackPublished,A,t)})).on(vi.TrackSubscribed,((A,e)=>{A.kind===Ji.Kind.Audio?(A.on(Qi.AudioPlaybackStarted,this.handleAudioPlaybackStarted),A.on(Qi.AudioPlaybackFailed,this.handleAudioPlaybackFailed)):A.kind===Ji.Kind.Video&&(A.on(Qi.VideoPlaybackFailed,this.handleVideoPlaybackFailed),A.on(Qi.VideoPlaybackStarted,this.handleVideoPlaybackStarted)),this.emit(Bi.TrackSubscribed,A,e,t)})).on(vi.TrackUnpublished,(A=>{this.emit(Bi.TrackUnpublished,A,t)})).on(vi.TrackUnsubscribed,((A,e)=>{this.emit(Bi.TrackUnsubscribed,A,e,t)})).on(vi.TrackMuted,(A=>{this.emitWhenConnected(Bi.TrackMuted,A,t)})).on(vi.TrackUnmuted,(A=>{this.emitWhenConnected(Bi.TrackUnmuted,A,t)})).on(vi.ParticipantMetadataChanged,(A=>{this.emitWhenConnected(Bi.ParticipantMetadataChanged,A,t)})).on(vi.ParticipantNameChanged,(A=>{this.emitWhenConnected(Bi.ParticipantNameChanged,A,t)})).on(vi.AttributesChanged,(A=>{this.emitWhenConnected(Bi.ParticipantAttributesChanged,A,t)})).on(vi.ConnectionQualityChanged,(A=>{this.emitWhenConnected(Bi.ConnectionQualityChanged,A,t)})).on(vi.ParticipantPermissionsChanged,(A=>{this.emitWhenConnected(Bi.ParticipantPermissionsChanged,A,t)})).on(vi.TrackSubscriptionStatusChanged,((A,e)=>{this.emitWhenConnected(Bi.TrackSubscriptionStatusChanged,A,e,t)})).on(vi.TrackSubscriptionFailed,((A,e)=>{this.emit(Bi.TrackSubscriptionFailed,A,t,e)})).on(vi.TrackSubscriptionPermissionChanged,((A,e)=>{this.emitWhenConnected(Bi.TrackSubscriptionPermissionChanged,A,e,t)})).on(vi.Active,(()=>{this.emitWhenConnected(Bi.ParticipantActive,t)})),e&&t.updateInfo(e),t}sendSyncState(){const A=Array.from(this.remoteParticipants.values()).reduce(((A,e)=>(A.push(...e.getTrackPublications()),A)),[]),e=this.localParticipant.getTrackPublications();this.engine.sendSyncState(A,e)}updateSubscriptions(){for(const A of this.remoteParticipants.values())for(const e of A.videoTrackPublications.values())e.isSubscribed&&Vr(e)&&e.emitTrackUpdate()}getRemoteParticipantBySid(A){const e=this.sidToIdentity.get(A);if(e)return this.remoteParticipants.get(e)}registerConnectionReconcile(){this.clearConnectionReconcile();let A=0;this.connectionReconcileInterval=_i.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,YA.STATE_MISMATCH)))}),4e3)}clearConnectionReconcile(){this.connectionReconcileInterval&&_i.clearInterval(this.connectionReconcileInterval)}setAndEmitConnectionState(A){return A!==this.state&&(this.state=A,this.emit(Bi.ConnectionStateChanged,this.state),!0)}emitBufferedEvents(){this.bufferedEvents.forEach((A=>{let[e,t]=A;this.emit(e,...t)})),this.bufferedEvents=[]}emitWhenConnected(A){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];if(this.state===vo.Reconnecting||this.isResuming||!this.engine||this.engine.pendingReconnect)this.bufferedEvents.push([A,t]);else if(this.state===vo.Connected)return this.emit(A,...t);return!1}simulateParticipants(A){return Xt(this,void 0,void 0,(function*(){var e,t;const n=Object.assign({audio:!0,video:!0,useRealTracks:!1},A.publish),i=Object.assign({count:9,audio:!1,video:!0,aspectRatios:[1.66,1.7,1.3]},A.participants);if(this.handleDisconnect(),this.roomInfo=new zA({sid:"RM_SIMULATED",name:"simulated-room",emptyTimeout:0,maxParticipants:0,creationTime:F.parse((new Date).getTime()),metadata:"",numParticipants:1,numPublishers:1,turnPassword:"",enabledCodecs:[],activeRecording:!1}),this.localParticipant.updateInfo(new te({identity:"simulated-local",name:"local-name"})),this.setupLocalParticipantEvents(),this.emit(Bi.SignalConnected),this.emit(Bi.Connected),this.setAndEmitConnectionState(vo.Connected),n.video){const A=new No(Ji.Kind.Video,new ae({source:jA.CAMERA,sid:Math.floor(1e4*Math.random()).toString(),type:GA.AUDIO,name:"video-dummy"}),new ro(n.useRealTracks?(yield window.navigator.mediaDevices.getUserMedia({video:!0})).getVideoTracks()[0]:Fr(160*(null!==(e=i.aspectRatios[0])&&void 0!==e?e: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(vi.LocalTrackPublished,A)}if(n.audio){const A=new No(Ji.Kind.Audio,new ae({source:jA.MICROPHONE,sid:Math.floor(1e4*Math.random()).toString(),type:GA.AUDIO}),new Ws(n.useRealTracks?(yield navigator.mediaDevices.getUserMedia({audio:!0})).getAudioTracks()[0]:Sr(),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(vi.LocalTrackPublished,A)}for(let A=0;A<i.count-1;A+=1){let e=new te({sid:Math.floor(1e4*Math.random()).toString(),identity:"simulated-".concat(A),state:ne.ACTIVE,tracks:[],joinedAt:F.parse(Date.now())});const n=this.getOrCreateParticipant(e.identity,e);if(i.video){const r=Fr(160*(null!==(t=i.aspectRatios[A%i.aspectRatios.length])&&void 0!==t?t:1),160,!1,!0),s=new ae({source:jA.CAMERA,sid:Math.floor(1e4*Math.random()).toString(),type:GA.AUDIO});n.addSubscribedMediaTrack(r,s.sid,new MediaStream([r]),new RTCRtpReceiver),e.tracks=[...e.tracks,s]}if(i.audio){const A=Sr(),t=new ae({source:jA.MICROPHONE,sid:Math.floor(1e4*Math.random()).toString(),type:GA.AUDIO});n.addSubscribedMediaTrack(A,t.sid,new MediaStream([A]),new RTCRtpReceiver),e.tracks=[...e.tracks,t]}n.updateInfo(e)}}))}emit(A){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];if(A!==Bi.ActiveSpeakersChanged&&A!==Bi.TranscriptionReceived){const e=Wo(t).filter((A=>void 0!==A));this.log.debug("room event ".concat(A),Object.assign(Object.assign({},this.logContext),{event:A,args:e}))}return super.emit(A,...t)}}function Wo(A){return A.map((A=>{if(A)return Array.isArray(A)?Wo(A):"object"==typeof A?"logContext"in A?A.logContext:void 0:A}))}Jo.cleanupRegistry="undefined"!=typeof FinalizationRegistry&&new FinalizationRegistry((A=>{A()})),(bo=yo||(yo={}))[bo.IDLE=0]="IDLE",bo[bo.RUNNING=1]="RUNNING",bo[bo.SKIPPED=2]="SKIPPED",bo[bo.SUCCESS=3]="SUCCESS",bo[bo.FAILED=4]="FAILED",Zt.EventEmitter,Zt.EventEmitter;const Xo=Symbol.for("@ts-pattern/matcher"),Yo=Symbol.for("@ts-pattern/isVariadic"),qo="@ts-pattern/anonymous-select-key",$o=A=>Boolean(A&&"object"==typeof A),Zo=A=>A&&!!A[Xo],zo=(A,e,t)=>{if(Zo(A)){const n=A[Xo](),{matched:i,selections:r}=n.match(e);return i&&r&&Object.keys(r).forEach((A=>t(A,r[A]))),i}if($o(A)){if(!$o(e))return!1;if(Array.isArray(A)){if(!Array.isArray(e))return!1;let n=[],i=[],r=[];for(const e of A.keys()){const t=A[e];Zo(t)&&t[Yo]?r.push(t):r.length?i.push(t):n.push(t)}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 A=e.slice(0,n.length),s=0===i.length?[]:e.slice(-i.length),o=e.slice(n.length,0===i.length?1/0:-i.length);return n.every(((e,n)=>zo(e,A[n],t)))&&i.every(((A,e)=>zo(A,s[e],t)))&&(0===r.length||zo(r[0],o,t))}return A.length===e.length&&A.every(((A,n)=>zo(A,e[n],t)))}return Reflect.ownKeys(A).every((n=>{const i=A[n];return(n in e||Zo(r=i)&&"optional"===r[Xo]().matcherType)&&zo(i,e[n],t);var r}))}return Object.is(e,A)},Aa=A=>{var e,t,n;return $o(A)?Zo(A)?null!=(e=null==(t=(n=A[Xo]()).getSelectionKeys)?void 0:t.call(n))?e:[]:Array.isArray(A)?ea(A,Aa):ea(Object.values(A),Aa):[]},ea=(A,e)=>A.reduce(((A,t)=>A.concat(e(t))),[]);function ta(A){return Object.assign(A,{optional:()=>ia(A),and:e=>oa(A,e),or:e=>aa(A,e),select:e=>void 0===e?da(A):da(e,A)})}function na(A){return Object.assign((e=A,Object.assign(e,{[Symbol.iterator](){let A=0;const t=[{value:Object.assign(e,{[Yo]:!0}),done:!1},{done:!0,value:void 0}];return{next:()=>{var e;return null!=(e=t[A++])?e:t.at(-1)}}}})),{optional:()=>na(ia(A)),select:e=>na(void 0===e?da(A):da(e,A))});var e}function ia(A){return ta({[Xo]:()=>({match:e=>{let t={};const n=(A,e)=>{t[A]=e};return void 0===e?(Aa(A).forEach((A=>n(A,void 0))),{matched:!0,selections:t}):{matched:zo(A,e,n),selections:t}},getSelectionKeys:()=>Aa(A),matcherType:"optional"})})}const ra=(A,e)=>{for(const t of A)if(!e(t))return!1;return!0},sa=(A,e)=>{for(const[t,n]of A.entries())if(!e(n,t))return!1;return!0};function oa(...A){return ta({[Xo]:()=>({match:e=>{let t={};const n=(A,e)=>{t[A]=e};return{matched:A.every((A=>zo(A,e,n))),selections:t}},getSelectionKeys:()=>ea(A,Aa),matcherType:"and"})})}function aa(...A){return ta({[Xo]:()=>({match:e=>{let t={};const n=(A,e)=>{t[A]=e};return ea(A,Aa).forEach((A=>n(A,void 0))),{matched:A.some((A=>zo(A,e,n))),selections:t}},getSelectionKeys:()=>ea(A,Aa),matcherType:"or"})})}function ca(A){return{[Xo]:()=>({match:e=>({matched:Boolean(A(e))})})}}function da(...A){const e="string"==typeof A[0]?A[0]:void 0,t=2===A.length?A[1]:"string"==typeof A[0]?void 0:A[0];return ta({[Xo]:()=>({match:A=>{let n={[null!=e?e:qo]:A};return{matched:void 0===t||zo(t,A,((A,e)=>{n[A]=e})),selections:n}},getSelectionKeys:()=>[null!=e?e:qo].concat(void 0===t?[]:Aa(t))})})}function la(A){return"number"==typeof A}function ua(A){return"string"==typeof A}function ha(A){return"bigint"==typeof A}const ga=ta(ca((function(A){return!0}))),pa=ga,ma=A=>Object.assign(ta(A),{startsWith:e=>{return ma(oa(A,(t=e,ca((A=>ua(A)&&A.startsWith(t))))));var t},endsWith:e=>{return ma(oa(A,(t=e,ca((A=>ua(A)&&A.endsWith(t))))));var t},minLength:e=>{return ma(oa(A,(t=e,ca((A=>ua(A)&&A.length>=t)))));var t},length:e=>{return ma(oa(A,(t=e,ca((A=>ua(A)&&A.length===t)))));var t},maxLength:e=>{return ma(oa(A,(t=e,ca((A=>ua(A)&&A.length<=t)))));var t},includes:e=>{return ma(oa(A,(t=e,ca((A=>ua(A)&&A.includes(t))))));var t},regex:e=>{return ma(oa(A,(t=e,ca((A=>ua(A)&&Boolean(A.match(t)))))));var t}}),fa=ma(ca(ua)),Ba=A=>Object.assign(ta(A),{between:(e,t)=>{return Ba(oa(A,(n=e,i=t,ca((A=>la(A)&&n<=A&&i>=A)))));var n,i},lt:e=>{return Ba(oa(A,(t=e,ca((A=>la(A)&&A<t)))));var t},gt:e=>{return Ba(oa(A,(t=e,ca((A=>la(A)&&A>t)))));var t},lte:e=>{return Ba(oa(A,(t=e,ca((A=>la(A)&&A<=t)))));var t},gte:e=>{return Ba(oa(A,(t=e,ca((A=>la(A)&&A>=t)))));var t},int:()=>Ba(oa(A,ca((A=>la(A)&&Number.isInteger(A))))),finite:()=>Ba(oa(A,ca((A=>la(A)&&Number.isFinite(A))))),positive:()=>Ba(oa(A,ca((A=>la(A)&&A>0)))),negative:()=>Ba(oa(A,ca((A=>la(A)&&A<0))))}),wa=Ba(ca(la)),va=A=>Object.assign(ta(A),{between:(e,t)=>{return va(oa(A,(n=e,i=t,ca((A=>ha(A)&&n<=A&&i>=A)))));var n,i},lt:e=>{return va(oa(A,(t=e,ca((A=>ha(A)&&A<t)))));var t},gt:e=>{return va(oa(A,(t=e,ca((A=>ha(A)&&A>t)))));var t},lte:e=>{return va(oa(A,(t=e,ca((A=>ha(A)&&A<=t)))));var t},gte:e=>{return va(oa(A,(t=e,ca((A=>ha(A)&&A>=t)))));var t},positive:()=>va(oa(A,ca((A=>ha(A)&&A>0)))),negative:()=>va(oa(A,ca((A=>ha(A)&&A<0))))}),Ca=va(ca(ha)),ya=ta(ca((function(A){return"boolean"==typeof A}))),ba=ta(ca((function(A){return"symbol"==typeof A}))),Qa=ta(ca((function(A){return null==A}))),Ua=ta(ca((function(A){return null!=A})));var ka={__proto__:null,matcher:Xo,optional:ia,array:function(...A){return na({[Xo]:()=>({match:e=>{if(!Array.isArray(e))return{matched:!1};if(0===A.length)return{matched:!0};const t=A[0];let n={};if(0===e.length)return Aa(t).forEach((A=>{n[A]=[]})),{matched:!0,selections:n};const i=(A,e)=>{n[A]=(n[A]||[]).concat([e])};return{matched:e.every((A=>zo(t,A,i))),selections:n}},getSelectionKeys:()=>0===A.length?[]:Aa(A[0])})})},set:function(...A){return ta({[Xo]:()=>({match:e=>{if(!(e instanceof Set))return{matched:!1};let t={};if(0===e.size)return{matched:!0,selections:t};if(0===A.length)return{matched:!0};const n=(A,e)=>{t[A]=(t[A]||[]).concat([e])},i=A[0];return{matched:ra(e,(A=>zo(i,A,n))),selections:t}},getSelectionKeys:()=>0===A.length?[]:Aa(A[0])})})},map:function(...A){return ta({[Xo]:()=>({match:e=>{if(!(e instanceof Map))return{matched:!1};let t={};if(0===e.size)return{matched:!0,selections:t};const n=(A,e)=>{t[A]=(t[A]||[]).concat([e])};if(0===A.length)return{matched:!0};var i;if(1===A.length)throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${null==(i=A[0])?void 0:i.toString()}`);const[r,s]=A;return{matched:sa(e,((A,e)=>{const t=zo(r,e,n),i=zo(s,A,n);return t&&i})),selections:t}},getSelectionKeys:()=>0===A.length?[]:[...Aa(A[0]),...Aa(A[1])]})})},intersection:oa,union:aa,not:function(A){return ta({[Xo]:()=>({match:e=>({matched:!zo(A,e,(()=>{}))}),getSelectionKeys:()=>[],matcherType:"not"})})},when:ca,select:da,any:ga,_:pa,string:fa,number:wa,bigint:Ca,boolean:ya,symbol:ba,nullish:Qa,nonNullable:Ua,instanceOf:function(A){return ta(ca((e=A,A=>A instanceof e)));var e},shape:function(A){return ta(ca(function(...A){if(1===A.length){const[e]=A;return A=>zo(e,A,(()=>{}))}if(2===A.length){const[e,t]=A;return zo(e,t,(()=>{}))}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${A.length}.`)}(A)))}};class Ea extends Error{constructor(A){let e;try{e=JSON.stringify(A)}catch(t){e=A}super(`Pattern matching error: no pattern matches value ${e}`),this.input=void 0,this.input=A}}const Fa={matched:!1,value:void 0};function Ta(A){return new Sa(A,Fa)}let Sa=class A{constructor(A,e){this.input=void 0,this.state=void 0,this.input=A,this.state=e}with(...e){if(this.state.matched)return this;const t=e[e.length-1],n=[e[0]];let i;3===e.length&&"function"==typeof e[1]?i=e[1]:e.length>2&&n.push(...e.slice(1,e.length-1));let r=!1,s={};const o=(A,e)=>{r=!0,s[A]=e},a=!n.some((A=>zo(A,this.input,o)))||i&&!Boolean(i(this.input))?Fa:{matched:!0,value:t(r?qo in s?s[qo]:s:this.input,this.input)};return new A(this.input,a)}when(e,t){if(this.state.matched)return this;const n=Boolean(e(this.input));return new A(this.input,n?{matched:!0,value:t(this.input,this.input)}:Fa)}otherwise(A){return this.state.matched?this.state.value:A(this.input)}exhaustive(A=Ia){return this.state.matched?this.state.value:A(this.input)}run(){return this.exhaustive()}returnType(){return this}};function Ia(A){throw new Ea(A)}var Pa,Ha;(Ha=Pa||(Pa={})).READY="ready",Ha.ERROR="error",Ha.PAUSED="paused",Ha.LOADING="loading",Ha.THINKING="thinking",Ha.RESEARCHING="researching",Ha.AGENT_SPEAKING="agent_speaking",Ha.USER_SPEAKING="user_speaking",Ha.AWAITING_USER_INPUT="awaiting_user_input";class Ra{constructor({sessionId:A,apiBaseUrl:e}){this.currentState=Pa.READY,this.assistantAudioContext=null,this.userAudioContext=null,this._assistantAudioTimer=null,this._userAudioTimer=null,this.sessionId=A,this.apiBaseUrl=e||"https://obi.getcor.io/api",this.emitter=new i}emit(A,e){this.emitter.emit(A,e)}on(A,e){this.emitter.on(A,e)}off(A,e){this.emitter.off(A,e)}setupRoomEventListeners(){this.room&&(this.room.on(Bi.LocalTrackUnpublished,(A=>{A.source===Ji.Source.ScreenShare&&(this.screenStream=void 0)})),this.room.on(Bi.Disconnected,(()=>{console.log("Room disconnected"),this.disconnect()})),this.room.on(Bi.ParticipantDisconnected,(()=>{this.disconnect()})),this.room.on(Bi.TrackSubscribed,((A,e,t)=>{if("audio"===A.kind&&A.attach(),A.source===Ji.Source.Microphone&&t.identity.includes("agent-")){const e=A.mediaStream;if(!e)return void console.error("No media stream available for assistant track");const t=new AudioContext,n=t.createAnalyser();t.createMediaStreamSource(e).connect(n),n.fftSize=2048;const i=new Uint8Array(n.frequencyBinCount);this.analyzeAudio(n,i,"ASSISTANT"),this.assistantAudioContext=t}})),this.room.on(Bi.ParticipantAttributesChanged,(A=>{if(!A["lk.agent.state"])return;if(this.currentState===Pa.RESEARCHING||this.currentState===Pa.PAUSED)return;const e=Ta(A["lk.agent.state"]).with("listening",(()=>Pa.USER_SPEAKING)).with("speaking",(()=>Pa.AGENT_SPEAKING)).with("thinking",(()=>Pa.AGENT_SPEAKING)).otherwise((()=>{}));e&&this.setState(e)})),this.room.on(Bi.DataReceived,(async A=>{try{const e=JSON.parse((new TextDecoder).decode(A));Ta(e.status||e.request).with("using_tool",(()=>{this.currentState=Pa.RESEARCHING,this.emitter.emit("stateChanged",Pa.RESEARCHING)})).with("using_tool_ended",(()=>{this.currentState=Pa.AGENT_SPEAKING,this.emitter.emit("stateChanged",Pa.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",e.value)})).otherwise((()=>{console.warn("Unknown data received:",e)}))}catch(e){console.error("Error parsing data:",e)}})),this.room.localParticipant.registerRpcMethod("screen_capture",(async A=>(this.emitter.emit("screenCaptureRequested"),new Promise((A=>{this.emitter.once("screenCaptureComplete",(async e=>{if("error"!==e)try{await this.room.localParticipant.sendFile(new File([e],"screen_capture.png",{type:"image/png"}),{mimeType:"image/png",topic:"screen_capture"}),A("ok")}catch(t){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 Jo({adaptiveStream:!0,dynacast:!0}),this.setupRoomEventListeners();const A=new URLSearchParams({token:this.sessionId,skip_intro:"true"}),e=`${this.apiBaseUrl}/join-token?${A.toString()}`,t=await fetch(e).then((A=>A.json()));if(await this.room.connect(t.url,t.token),this.microphoneStream){const A=this.microphoneStream.getAudioTracks()[0];await this.room.localParticipant.publishTrack(A,{name:"microphone",source:Ji.Source.Microphone})}return{url:t.url,token:t.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._userAudioTimer&&(window.clearTimeout(this._userAudioTimer),this._userAudioTimer=null),this._assistantAudioTimer&&(window.clearTimeout(this._assistantAudioTimer),this._assistantAudioTimer=null),await(this.userAudioContext?.close().catch((()=>{}))),this.userAudioContext=null,await(this.assistantAudioContext?.close().catch((()=>{}))),this.assistantAudioContext=null,this.setState(Pa.READY)}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 e=new AudioContext;this.userAudioContext=e;const t=e.createAnalyser(),n=e.createMediaStreamSource(A),i=e.createGain();i.gain.value=1.5,n.connect(i),i.connect(t),t.fftSize=2048;const r=new Uint8Array(t.frequencyBinCount);this.analyzeAudio(t,r,"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(Pa.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(Pa.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,e,t){if("USER"===t&&this.currentState===Pa.USER_SPEAKING||"ASSISTANT"===t&&this.currentState===Pa.AGENT_SPEAKING){A.getByteFrequencyData(e);const n=e.reduce(((A,e)=>A+e),0)/e.length,i=Math.max(.01,Math.min(1,n/128));let r;"USER"===t&&this.currentState===Pa.USER_SPEAKING?r="USER":"ASSISTANT"===t&&this.currentState===Pa.AGENT_SPEAKING&&(r="ASSISTANT"),r&&this.emitter.emit("volume",{speaker:r,spectrum:Array.from(e),volume:i})}"USER"===t?this._userAudioTimer=window.setTimeout((()=>this.analyzeAudio(A,e,t)),200):this._assistantAudioTimer=window.setTimeout((()=>this.analyzeAudio(A,e,t)),200)}async sendHTML(A){if(this.room)try{const e={type:"page_content",html:A,timestamp:(new Date).toISOString()},t=JSON.stringify(e),n=(new TextEncoder).encode(t);await this.room.localParticipant.publishData(n,{reliable:!0})}catch(e){console.error("Error sending HTML to LiveKit:",e),this.emitter.emit("error",e instanceof Error?e:new Error(String(e)))}else console.log("Cannot send HTML: Not connected to room")}async reconnect(A,e,t){try{if(!A||!e)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 Jo({adaptiveStream:!0,dynacast:!0}),this.setupRoomEventListeners(),await this.room.connect(A,e),this.microphoneStream){const A=this.microphoneStream.getAudioTracks()[0];await this.room.localParticipant.publishTrack(A,{name:"microphone",source:Ji.Source.Microphone})}return this.setState(t),t===Pa.PAUSED&&this.pauseRecording(),!0}catch(n){return console.error("Failed to reconnect to room:",n),this.disconnect(),this.emitter.emit("error",n instanceof Error?n:new Error(String(n))),!1}}}var Da=function(A,e){return(Da=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(A[t]=e[t])})(A,e)};function xa(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=A}Da(A,e),A.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}var La=function(){return La=Object.assign||function(A){for(var e,t=1,n=arguments.length;t<n;t++)for(var i in e=arguments[t])Object.prototype.hasOwnProperty.call(e,i)&&(A[i]=e[i]);return A},La.apply(this,arguments)};function Oa(A,e,t,n){return new(t||(t=Promise))((function(i,r){function s(A){try{a(n.next(A))}catch(e){r(e)}}function o(A){try{a(n.throw(A))}catch(e){r(e)}}function a(A){var e;A.done?i(A.value):(e=A.value,e instanceof t?e:new t((function(A){A(e)}))).then(s,o)}a((n=n.apply(A,e||[])).next())}))}function Ma(A,e){var t,n,i,r,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function o(o){return function(a){return function(o){if(t)throw new TypeError("Generator is already executing.");for(;r&&(r=0,o[0]&&(s=0)),s;)try{if(t=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(A,s)}catch(a){o=[6,a],n=0}finally{t=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function Na(A,e,t){if(t||2===arguments.length)for(var n,i=0,r=e.length;i<r;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return A.concat(n||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;for(var Ka=function(){function A(A,e,t,n){this.left=A,this.top=e,this.width=t,this.height=n}return A.prototype.add=function(e,t,n,i){return new A(this.left+e,this.top+t,this.width+n,this.height+i)},A.fromClientRect=function(e,t){return new A(t.left+e.windowBounds.left,t.top+e.windowBounds.top,t.width,t.height)},A.fromDOMRectList=function(e,t){var n=Array.from(t).find((function(A){return 0!==A.width}));return n?new A(n.left+e.windowBounds.left,n.top+e.windowBounds.top,n.width,n.height):A.EMPTY},A.EMPTY=new A(0,0,0,0),A}(),_a=function(A,e){return Ka.fromClientRect(A,e.getBoundingClientRect())},Va=function(A){for(var e=[],t=0,n=A.length;t<n;){var i=A.charCodeAt(t++);if(i>=55296&&i<=56319&&t<n){var r=A.charCodeAt(t++);56320==(64512&r)?e.push(((1023&i)<<10)+(1023&r)+65536):(e.push(i),t--)}else e.push(i)}return e},Ga=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,A);var t=A.length;if(!t)return"";for(var n=[],i=-1,r="";++i<t;){var s=A[i];s<=65535?n.push(s):(s-=65536,n.push(55296+(s>>10),s%1024+56320)),(i+1===t||n.length>16384)&&(r+=String.fromCharCode.apply(String,n),n.length=0)}return r},ja="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ja=0;Ja<64;Ja++)ja["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(Ja)]=Ja;for(var Wa="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Xa=0;Xa<64;Xa++)Wa["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(Xa)]=Xa;for(var Ya=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},qa=function(){function A(A,e,t,n,i,r){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=n,this.index=i,this.data=r}return A.prototype.get=function(A){var e;if(A>=0){if(A<55296||A>56319&&A<=65535)return e=((e=this.index[A>>5])<<2)+(31&A),this.data[e];if(A<=65535)return e=((e=this.index[2048+(A-55296>>5)])<<2)+(31&A),this.data[e];if(A<this.highStart)return e=2080+(A>>11),e=this.index[e],e+=A>>5&63,e=((e=this.index[e])<<2)+(31&A),this.data[e];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},A}(),$a="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Za=0;Za<64;Za++)$a["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(Za)]=Za;var za,Ac,ec,tc,nc,ic,rc,sc,oc,ac,cc=10,dc=13,lc=15,uc=17,hc=18,gc=19,pc=20,mc=21,fc=22,Bc=24,wc=25,vc=26,Cc=27,yc=28,bc=30,Qc=32,Uc=33,kc=34,Ec=35,Fc=37,Tc=38,Sc=39,Ic=40,Pc=42,Hc=[9001,65288],Rc="×",Dc="÷",xc=(tc=function(A){var e,t,n,i,r,s=.75*A.length,o=A.length,a=0;"="===A[A.length-1]&&(s--,"="===A[A.length-2]&&s--);var c="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(s):new Array(s),d=Array.isArray(c)?c:new Uint8Array(c);for(e=0;e<o;e+=4)t=Wa[A.charCodeAt(e)],n=Wa[A.charCodeAt(e+1)],i=Wa[A.charCodeAt(e+2)],r=Wa[A.charCodeAt(e+3)],d[a++]=t<<2|n>>4,d[a++]=(15&n)<<4|i>>2,d[a++]=(3&i)<<6|63&r;return c}("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(tc)?function(A){for(var e=A.length,t=[],n=0;n<e;n+=4)t.push(A[n+3]<<24|A[n+2]<<16|A[n+1]<<8|A[n]);return t}(tc):new Uint32Array(tc),rc=Ya(ic=Array.isArray(tc)?function(A){for(var e=A.length,t=[],n=0;n<e;n+=2)t.push(A[n+1]<<8|A[n]);return t}(tc):new Uint16Array(tc),12,nc[4]/2),sc=2===nc[5]?Ya(ic,(24+nc[4])/2):(za=nc,Ac=Math.ceil((24+nc[4])/4),za.slice?za.slice(Ac,ec):new Uint32Array(Array.prototype.slice.call(za,Ac,ec))),new qa(nc[0],nc[1],nc[2],nc[3],rc,sc)),Lc=[bc,36],Oc=[1,2,3,5],Mc=[cc,8],Nc=[Cc,vc],Kc=Oc.concat(Mc),_c=[Tc,Sc,Ic,kc,Ec],Vc=[lc,dc],Gc=function(A,e,t,n){var i=n[t];if(Array.isArray(A)?-1!==A.indexOf(i):A===i)for(var r=t;r<=n.length;){if((a=n[++r])===e)return!0;if(a!==cc)break}if(i===cc)for(r=t;r>0;){var s=n[--r];if(Array.isArray(A)?-1!==A.indexOf(s):A===s)for(var o=t;o<=n.length;){var a;if((a=n[++o])===e)return!0;if(a!==cc)break}if(s!==cc)break}return!1},jc=function(A,e){for(var t=A;t>=0;){var n=e[t];if(n!==cc)return n;t--}return 0},Jc=function(A,e,t,n,i){if(0===t[n])return Rc;var r=n-1;if(Array.isArray(i)&&!0===i[r])return Rc;var s=r-1,o=r+1,a=e[r],c=s>=0?e[s]:0,d=e[o];if(2===a&&3===d)return Rc;if(-1!==Oc.indexOf(a))return"!";if(-1!==Oc.indexOf(d))return Rc;if(-1!==Mc.indexOf(d))return Rc;if(8===jc(r,e))return Dc;if(11===xc.get(A[r]))return Rc;if((a===Qc||a===Uc)&&11===xc.get(A[o]))return Rc;if(7===a||7===d)return Rc;if(9===a)return Rc;if(-1===[cc,dc,lc].indexOf(a)&&9===d)return Rc;if(-1!==[uc,hc,gc,Bc,yc].indexOf(d))return Rc;if(jc(r,e)===fc)return Rc;if(Gc(23,fc,r,e))return Rc;if(Gc([uc,hc],mc,r,e))return Rc;if(Gc(12,12,r,e))return Rc;if(a===cc)return Dc;if(23===a||23===d)return Rc;if(16===d||16===a)return Dc;if(-1!==[dc,lc,mc].indexOf(d)||14===a)return Rc;if(36===c&&-1!==Vc.indexOf(a))return Rc;if(a===yc&&36===d)return Rc;if(d===pc)return Rc;if(-1!==Lc.indexOf(d)&&a===wc||-1!==Lc.indexOf(a)&&d===wc)return Rc;if(a===Cc&&-1!==[Fc,Qc,Uc].indexOf(d)||-1!==[Fc,Qc,Uc].indexOf(a)&&d===vc)return Rc;if(-1!==Lc.indexOf(a)&&-1!==Nc.indexOf(d)||-1!==Nc.indexOf(a)&&-1!==Lc.indexOf(d))return Rc;if(-1!==[Cc,vc].indexOf(a)&&(d===wc||-1!==[fc,lc].indexOf(d)&&e[o+1]===wc)||-1!==[fc,lc].indexOf(a)&&d===wc||a===wc&&-1!==[wc,yc,Bc].indexOf(d))return Rc;if(-1!==[wc,yc,Bc,uc,hc].indexOf(d))for(var l=r;l>=0;){if((u=e[l])===wc)return Rc;if(-1===[yc,Bc].indexOf(u))break;l--}if(-1!==[Cc,vc].indexOf(d))for(l=-1!==[uc,hc].indexOf(a)?s:r;l>=0;){var u;if((u=e[l])===wc)return Rc;if(-1===[yc,Bc].indexOf(u))break;l--}if(Tc===a&&-1!==[Tc,Sc,kc,Ec].indexOf(d)||-1!==[Sc,kc].indexOf(a)&&-1!==[Sc,Ic].indexOf(d)||-1!==[Ic,Ec].indexOf(a)&&d===Ic)return Rc;if(-1!==_c.indexOf(a)&&-1!==[pc,vc].indexOf(d)||-1!==_c.indexOf(d)&&a===Cc)return Rc;if(-1!==Lc.indexOf(a)&&-1!==Lc.indexOf(d))return Rc;if(a===Bc&&-1!==Lc.indexOf(d))return Rc;if(-1!==Lc.concat(wc).indexOf(a)&&d===fc&&-1===Hc.indexOf(A[o])||-1!==Lc.concat(wc).indexOf(d)&&a===hc)return Rc;if(41===a&&41===d){for(var h=t[r],g=1;h>0&&41===e[--h];)g++;if(g%2!=0)return Rc}return a===Qc&&d===Uc?Rc:Dc},Wc=function(){function A(A,e,t,n){this.codePoints=A,this.required="!"===e,this.start=t,this.end=n}return A.prototype.slice=function(){return Ga.apply(void 0,this.codePoints.slice(this.start,this.end))},A}(),Xc=45,Yc=43,qc=-1,$c=function(A){return A>=48&&A<=57},Zc=function(A){return $c(A)||A>=65&&A<=70||A>=97&&A<=102},zc=function(A){return 10===A||9===A||32===A},Ad=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},ed=function(A){return Ad(A)||$c(A)||A===Xc},td=function(A){return A>=0&&A<=8||11===A||A>=14&&A<=31||127===A},nd=function(A,e){return 92===A&&10!==e},id=function(A,e,t){return A===Xc?Ad(e)||nd(e,t):!!Ad(A)||!(92!==A||!nd(A,e))},rd=function(A,e,t){return A===Yc||A===Xc?!!$c(e)||46===e&&$c(t):$c(46===A?e:A)},sd=function(A){var e=0,t=1;A[e]!==Yc&&A[e]!==Xc||(A[e]===Xc&&(t=-1),e++);for(var n=[];$c(A[e]);)n.push(A[e++]);var i=n.length?parseInt(Ga.apply(void 0,n),10):0;46===A[e]&&e++;for(var r=[];$c(A[e]);)r.push(A[e++]);var s=r.length,o=s?parseInt(Ga.apply(void 0,r),10):0;69!==A[e]&&101!==A[e]||e++;var a=1;A[e]!==Yc&&A[e]!==Xc||(A[e]===Xc&&(a=-1),e++);for(var c=[];$c(A[e]);)c.push(A[e++]);var d=c.length?parseInt(Ga.apply(void 0,c),10):0;return t*(i+o*Math.pow(10,-s))*Math.pow(10,a*d)},od={type:2},ad={type:3},cd={type:4},dd={type:13},ld={type:8},ud={type:21},hd={type:9},gd={type:10},pd={type:11},md={type:12},fd={type:14},Bd={type:23},wd={type:1},vd={type:25},Cd={type:24},yd={type:26},bd={type:27},Qd={type:28},Ud={type:29},kd={type:31},Ed={type:32},Fd=function(){function A(){this._value=[]}return A.prototype.write=function(A){this._value=this._value.concat(Va(A))},A.prototype.read=function(){for(var A=[],e=this.consumeToken();e!==Ed;)A.push(e),e=this.consumeToken();return A},A.prototype.consumeToken=function(){var A=this.consumeCodePoint();switch(A){case 34:return this.consumeStringToken(34);case 35:var e=this.peekCodePoint(0),t=this.peekCodePoint(1),n=this.peekCodePoint(2);if(ed(e)||nd(t,n)){var i=id(e,t,n)?2:1;return{type:5,value:this.consumeName(),flags:i}}break;case 36:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),dd;break;case 39:return this.consumeStringToken(39);case 40:return od;case 41:return ad;case 42:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),fd;break;case Yc:if(rd(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case 44:return cd;case Xc:var r=A,s=this.peekCodePoint(0),o=this.peekCodePoint(1);if(rd(r,s,o))return this.reconsumeCodePoint(A),this.consumeNumericToken();if(id(r,s,o))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();if(s===Xc&&62===o)return this.consumeCodePoint(),this.consumeCodePoint(),Cd;break;case 46:if(rd(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 yd;case 59:return bd;case 60:if(33===this.peekCodePoint(0)&&this.peekCodePoint(1)===Xc&&this.peekCodePoint(2)===Xc)return this.consumeCodePoint(),this.consumeCodePoint(),vd;break;case 64:var c=this.peekCodePoint(0),d=this.peekCodePoint(1),l=this.peekCodePoint(2);if(id(c,d,l))return{type:7,value:this.consumeName()};break;case 91:return Qd;case 92:if(nd(A,this.peekCodePoint(0)))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();break;case 93:return Ud;case 61:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),ld;break;case 123:return pd;case 125:return md;case 117:case 85:var u=this.peekCodePoint(0),h=this.peekCodePoint(1);return u!==Yc||!Zc(h)&&63!==h||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(A),this.consumeIdentLikeToken();case 124:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),hd;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),ud;break;case 126:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),gd;break;case qc:return Ed}return zc(A)?(this.consumeWhiteSpace(),kd):$c(A)?(this.reconsumeCodePoint(A),this.consumeNumericToken()):Ad(A)?(this.reconsumeCodePoint(A),this.consumeIdentLikeToken()):{type:6,value:Ga(A)}},A.prototype.consumeCodePoint=function(){var A=this._value.shift();return void 0===A?-1:A},A.prototype.reconsumeCodePoint=function(A){this._value.unshift(A)},A.prototype.peekCodePoint=function(A){return A>=this._value.length?-1:this._value[A]},A.prototype.consumeUnicodeRangeToken=function(){for(var A=[],e=this.consumeCodePoint();Zc(e)&&A.length<6;)A.push(e),e=this.consumeCodePoint();for(var t=!1;63===e&&A.length<6;)A.push(e),e=this.consumeCodePoint(),t=!0;if(t)return{type:30,start:parseInt(Ga.apply(void 0,A.map((function(A){return 63===A?48:A}))),16),end:parseInt(Ga.apply(void 0,A.map((function(A){return 63===A?70:A}))),16)};var n=parseInt(Ga.apply(void 0,A),16);if(this.peekCodePoint(0)===Xc&&Zc(this.peekCodePoint(1))){this.consumeCodePoint(),e=this.consumeCodePoint();for(var i=[];Zc(e)&&i.length<6;)i.push(e),e=this.consumeCodePoint();return{type:30,start:n,end:parseInt(Ga.apply(void 0,i),16)}}return{type:30,start:n,end:n}},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 e=this.peekCodePoint(0);if(39===e||34===e){var t=this.consumeStringToken(this.consumeCodePoint());return 0===t.type&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===qc||41===this.peekCodePoint(0))?(this.consumeCodePoint(),{type:22,value:t.value}):(this.consumeBadUrlRemnants(),Bd)}for(;;){var n=this.consumeCodePoint();if(n===qc||41===n)return{type:22,value:Ga.apply(void 0,A)};if(zc(n))return this.consumeWhiteSpace(),this.peekCodePoint(0)===qc||41===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:22,value:Ga.apply(void 0,A)}):(this.consumeBadUrlRemnants(),Bd);if(34===n||39===n||40===n||td(n))return this.consumeBadUrlRemnants(),Bd;if(92===n){if(!nd(n,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),Bd;A.push(this.consumeEscapedCodePoint())}else A.push(n)}},A.prototype.consumeWhiteSpace=function(){for(;zc(this.peekCodePoint(0));)this.consumeCodePoint()},A.prototype.consumeBadUrlRemnants=function(){for(;;){var A=this.consumeCodePoint();if(41===A||A===qc)return;nd(A,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},A.prototype.consumeStringSlice=function(A){for(var e="";A>0;){var t=Math.min(5e4,A);e+=Ga.apply(void 0,this._value.splice(0,t)),A-=t}return this._value.shift(),e},A.prototype.consumeStringToken=function(A){for(var e="",t=0;;){var n=this._value[t];if(n===qc||void 0===n||n===A)return{type:0,value:e+=this.consumeStringSlice(t)};if(10===n)return this._value.splice(0,t),wd;if(92===n){var i=this._value[t+1];i!==qc&&void 0!==i&&(10===i?(e+=this.consumeStringSlice(t),t=-1,this._value.shift()):nd(n,i)&&(e+=this.consumeStringSlice(t),e+=Ga(this.consumeEscapedCodePoint()),t=-1))}t++}},A.prototype.consumeNumber=function(){var A=[],e=4,t=this.peekCodePoint(0);for(t!==Yc&&t!==Xc||A.push(this.consumeCodePoint());$c(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0);var n=this.peekCodePoint(1);if(46===t&&$c(n))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;$c(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0),n=this.peekCodePoint(1);var i=this.peekCodePoint(2);if((69===t||101===t)&&((n===Yc||n===Xc)&&$c(i)||$c(n)))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;$c(this.peekCodePoint(0));)A.push(this.consumeCodePoint());return[sd(A),e]},A.prototype.consumeNumericToken=function(){var A=this.consumeNumber(),e=A[0],t=A[1],n=this.peekCodePoint(0),i=this.peekCodePoint(1),r=this.peekCodePoint(2);return id(n,i,r)?{type:15,number:e,flags:t,unit:this.consumeName()}:37===n?(this.consumeCodePoint(),{type:16,number:e,flags:t}):{type:17,number:e,flags:t}},A.prototype.consumeEscapedCodePoint=function(){var A=this.consumeCodePoint();if(Zc(A)){for(var e=Ga(A);Zc(this.peekCodePoint(0))&&e.length<6;)e+=Ga(this.consumeCodePoint());zc(this.peekCodePoint(0))&&this.consumeCodePoint();var t=parseInt(e,16);return 0===t||function(A){return A>=55296&&A<=57343}(t)||t>1114111?65533:t}return A===qc?65533:A},A.prototype.consumeName=function(){for(var A="";;){var e=this.consumeCodePoint();if(ed(e))A+=Ga(e);else{if(!nd(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),A;A+=Ga(this.consumeEscapedCodePoint())}}},A}(),Td=function(){function A(A){this._tokens=A}return A.create=function(e){var t=new Fd;return t.write(e),new A(t.read())},A.parseValue=function(e){return A.create(e).parseComponentValue()},A.parseValues=function(e){return A.create(e).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 e=this.consumeComponentValue();do{A=this.consumeToken()}while(31===A.type);if(32===A.type)return e;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},A.prototype.parseComponentValues=function(){for(var A=[];;){var e=this.consumeComponentValue();if(32===e.type)return A;A.push(e),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 e={type:A,values:[]},t=this.consumeToken();;){if(32===t.type||Od(t,A))return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue()),t=this.consumeToken()}},A.prototype.consumeFunction=function(A){for(var e={name:A.value,values:[],type:18};;){var t=this.consumeToken();if(32===t.type||3===t.type)return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue())}},A.prototype.consumeToken=function(){var A=this._tokens.shift();return void 0===A?Ed:A},A.prototype.reconsumeToken=function(A){this._tokens.unshift(A)},A}(),Sd=function(A){return 15===A.type},Id=function(A){return 17===A.type},Pd=function(A){return 20===A.type},Hd=function(A){return 0===A.type},Rd=function(A,e){return Pd(A)&&A.value===e},Dd=function(A){return 31!==A.type},xd=function(A){return 31!==A.type&&4!==A.type},Ld=function(A){var e=[],t=[];return A.forEach((function(A){if(4===A.type){if(0===t.length)throw new Error("Error parsing function args, zero tokens for arg");return e.push(t),void(t=[])}31!==A.type&&t.push(A)})),t.length&&e.push(t),e},Od=function(A,e){return 11===e&&12===A.type||28===e&&29===A.type||2===e&&3===A.type},Md=function(A){return 17===A.type||15===A.type},Nd=function(A){return 16===A.type||Md(A)},Kd=function(A){return A.length>1?[A[0],A[1]]:[A[0]]},_d={type:17,number:0,flags:4},Vd={type:16,number:50,flags:4},Gd={type:16,number:100,flags:4},jd=function(A,e,t){var n=A[0],i=A[1];return[Jd(n,e),Jd(void 0!==i?i:n,t)]},Jd=function(A,e){if(16===A.type)return A.number/100*e;if(Sd(A))switch(A.unit){case"rem":case"em":return 16*A.number;default:return A.number}return A.number},Wd="grad",Xd="turn",Yd=function(A,e){if(15===e.type)switch(e.unit){case"deg":return Math.PI*e.number/180;case Wd:return Math.PI/200*e.number;case"rad":return e.number;case Xd:return 2*Math.PI*e.number}throw new Error("Unsupported angle type")},qd=function(A){return 15===A.type&&("deg"===A.unit||A.unit===Wd||"rad"===A.unit||A.unit===Xd)},$d=function(A){switch(A.filter(Pd).map((function(A){return A.value})).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[_d,_d];case"to top":case"bottom":return Zd(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[_d,Gd];case"to right":case"left":return Zd(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[Gd,Gd];case"to bottom":case"top":return Zd(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[Gd,_d];case"to left":case"right":return Zd(270)}return 0},Zd=function(A){return Math.PI*A/180},zd=function(A){return!(255&A)},Al=function(A){var e=255&A,t=255&A>>8,n=255&A>>16,i=255&A>>24;return e<255?"rgba(".concat(i,",").concat(n,",").concat(t,",").concat(e/255,")"):"rgb(".concat(i,",").concat(n,",").concat(t,")")},el=function(A,e,t,n){return(A<<24|e<<16|t<<8|Math.round(255*n))>>>0},tl=function(A,e){if(17===A.type)return A.number;if(16===A.type){var t=3===e?1:255;return 3===e?A.number/100*t:Math.round(A.number/100*t)}return 0},nl=function(A){return"from"===(20===A[0].type?A[0].value:"unknown")},il=function(A,e,t){return Math.min(Math.max(A,e),t)},rl=function(A,e){return[A[0]*e[0]+A[1]*e[1]+A[2]*e[2],A[3]*e[0]+A[4]*e[1]+A[5]*e[2],A[6]*e[0]+A[7]*e[1]+A[8]*e[2]]},sl=function(A){var e=A[0],t=A[1],n=A[2],i=A[3],r=Ql([e,t,n]);return el(il(Math.round(255*r[0]),0,255),il(Math.round(255*r[1]),0,255),il(Math.round(255*r[2]),0,255),i)},ol=function(A){var e=yl([A[0],A[1],A[2]]);return sl([e[0],e[1],e[2],A[3]])},al=function(A,e){var t=e.filter(xd),n=t[0],i=t[1],r=t[2],s=t[3];return[(17===n.type?Zd(n.number):Yd(0,n))/(2*Math.PI),Nd(i)?i.number/100:0,Nd(r)?r.number/100:0,void 0!==s&&Nd(s)?Jd(s,1):1]},cl=function(A,e){if(nl(e))throw new Error("Relative color not supported for hsl()");var t=al(0,e),n=t[0],i=t[1],r=t[2],s=t[3],o=ml([n,i,r]);return el(255*o[0],255*o[1],255*o[2],0===i?1:s)},dl=function(A){var e=A.filter(xd);return[Nd(e[0])?e[0].number:0,Nd(e[1])?e[1].number:0,Id(e[2])||Sd(e[2])?e[2].number:0,void 0!==e[4]&&Nd(e[4])?Jd(e[4],1):1]},ll=function(A){var e=A.filter(xd);return[16===e[0].type?e[0].number/100:Id(e[0])?e[0].number:0,16===e[1].type?e[1].number/100:Id(e[1])?e[1].number:0,Id(e[2])||Sd(e[2])?e[2].number:0,void 0!==e[4]&&Nd(e[4])?Jd(e[4],1):1]},ul=function(A){var e=A.filter(xd);return[16===e[0].type?e[0].number/100:Id(e[0])?e[0].number:0,16===e[1].type?e[1].number/100:Id(e[1])?e[1].number:0,Id(e[2])||Sd(e[2])?e[2].number:0,void 0!==e[4]&&Nd(e[4])?Jd(e[4],1):1]},hl=function(A){return rl([1.0479297925449969,.022946870601609652,-.05019226628920524,.02962780877005599,.9904344267538799,-.017073799063418826,-.009243040646204504,.015055191490298152,.7518742814281371],A)},gl=function(A){return rl([.955473421488075,-.02309845494876471,.06325924320057072,-.0283697093338637,1.0099953980813041,.021041441191917323,.012314014864481998,-.020507649298898964,1.330365926242124],A)},pl=function(A,e,t){return t<0&&(t+=1),t>=1&&(t-=1),t<1/6?(e-A)*t*6+A:t<.5?e:t<2/3?6*(e-A)*(2/3-t)+A:A},ml=function(A){var e=A[0],t=A[1],n=A[2];if(0===t)return[255*n,255*n,255*n];var i=n<=.5?n*(t+1):n+t-n*t,r=2*n-i;return[pl(r,i,e+1/3),pl(r,i,e),pl(r,i,e-1/3)]},fl=function(A){var e=A[0],t=A[1],n=A[2];return t<0&&(t=0),isNaN(n)&&(n=0),[e,t*Math.cos(n*Math.PI/180),t*Math.sin(n*Math.PI/180)]},Bl=function(A){var e=rl([1,.3963377773761749,.2158037573099136,1,-.1055613458156586,-.0638541728258133,1,-.0894841775298119,-1.2914855480194092],A).map((function(A){return Math.pow(A,3)}));return rl([1.2268798758459243,-.5578149944602171,.2813910456659647,-.0405757452148008,1.112286803280317,-.0717110580655164,-.0763729366746601,-.4214933324022432,1.5869240198367816],e)},wl=function(A){var e=(A[0]+16)/116,t=A[1]/500+e,n=e-A[2]/200,i=24389/27,r=24/116,s=[.3457*(t>r?Math.pow(t,3):(116*t-16)/i)/.3585,A[0]>8?Math.pow(e,3):A[0]/i,.2958*(n>r?Math.pow(n,3):(116*n-16)/i)/.3585];return gl([s[0],s[1],s[2]])},vl=function(A){return A},Cl=function(A){return ol([A[0],A[1],A[2],A[3]])},yl=function(A){return rl([3.2409699419045226,-1.537383177570094,-.4986107602930034,-.9692436362808796,1.8759675015077202,.04155505740717559,.05563007969699366,-.20397695888897652,1.0569715142428786],A)},bl=function(A){return rl([.41239079926595934,.357584339383878,.1804807884018343,.21263900587151027,.715168678767756,.07219231536073371,.01933081871559182,.11919477979462598,.9505321522496607],A)},Ql=function(A){return A.map((function(A){var e=A<0?-1:1,t=Math.abs(A);return t>.0031308?e*(1.055*Math.pow(t,1/2.4)-.055):12.92*A}))},Ul=function(A){return A.map((function(A){var e=A<0?-1:1,t=Math.abs(A);return t<=.04045?A/12.92:e*Math.pow((t+.055)/1.055,2.4)}))},kl=1.09929682680944,El=.018053968510807,Fl=function(A,e){if(18===e.type){var t=Rl[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported color function "'.concat(e.name,'"'));return t(A,e.values)}if(5===e.type){var n=Tl(e),i=n[0],r=n[1],s=n[2],o=n[3];return el(i,r,s,o)}if(20===e.type){var a=xl[e.value.toUpperCase()];if(void 0!==a)return a}return xl.TRANSPARENT},Tl=function(A){if(3===A.value.length){var e=A.value.substring(0,1),t=A.value.substring(1,2),n=A.value.substring(2,3);return[parseInt(e+e,16),parseInt(t+t,16),parseInt(n+n,16),1]}if(4===A.value.length){e=A.value.substring(0,1),t=A.value.substring(1,2),n=A.value.substring(2,3);var i=A.value.substring(3,4);return[parseInt(e+e,16),parseInt(t+t,16),parseInt(n+n,16),parseInt(i+i,16)/255]}return 6===A.value.length?(e=A.value.substring(0,2),t=A.value.substring(2,4),n=A.value.substring(4,6),[parseInt(e,16),parseInt(t,16),parseInt(n,16),1]):8===A.value.length?(e=A.value.substring(0,2),t=A.value.substring(2,4),n=A.value.substring(4,6),i=A.value.substring(6,8),[parseInt(e,16),parseInt(t,16),parseInt(n,16),parseInt(i,16)/255]):[0,0,0,1]},Sl=function(A,e){var t=e.filter(xd);if(nl(t))throw new Error("Relative color not supported for rgb()");if(3===t.length){var n=t.map(tl),i=n[0],r=n[1],s=n[2];return el(i,r,s,1)}if(4===t.length){var o=t.map(tl),a=(i=o[0],r=o[1],s=o[2],o[3]);return el(i,r,s,a)}return 0},Il={srgb:function(A){return el(il(Math.round(255*A[0]),0,255),il(Math.round(255*A[1]),0,255),il(Math.round(255*A[2]),0,255),il(A[3],0,1))},"srgb-linear":sl,"display-p3":function(A){var e=function(A){var e,t=[A[0],A[1],A[2]].map((function(A){var e=A<0?-1:1;return A*e<=.04045?A/12.92:e*Math.pow((A+.055)/1.055,2.4)||0}));return e=[t[0],t[1],t[2]],rl([.4865709486482162,.26566769316909306,.1982172852343625,.2289745640697488,.6917385218365064,.079286914093745,0,.04511338185890264,1.043944368900976],e)}([A[0],A[1],A[2]]);return ol([e[0],e[1],e[2],A[3]])},"a98-rgb":function(A){var e,t,n=yl((e=[(t=[A[0],A[1],A[2]].map((function(A){var e=A<0?-1:1,t=Math.abs(A);return e*Math.pow(t,563/256)})))[0],t[1],t[2]],rl([.5766690429101305,.1855582379065463,.1882286462349947,.29734497525053605,.6273635662554661,.0752914584939978,.02703136138641234,.07068885253582723,.9913375368376388],e)));return sl([n[0],n[1],n[2],A[3]])},"prophoto-rgb":function(A){var e=function(A){var e,t=[A[0],A[1],A[2]].map((function(A){return A<16/512?A/16:Math.pow(A,1.8)}));return gl((e=[t[0],t[1],t[2]],rl([.7977666449006423,.13518129740053308,.0313477341283922,.2880748288194013,.711835234241873,8993693872564e-17,0,0,.8251046025104602],e)))}([A[0],A[1],A[2]]);return ol([e[0],e[1],e[2],A[3]])},xyz:Cl,"xyz-d50":function(A){var e=function(A){return gl([A[0],A[1],A[2]])}([A[0],A[1],A[2]]);return ol([e[0],e[1],e[2],A[3]])},"xyz-d65":Cl,rec2020:function(A){var e=function(A){var e,t=[A[0],A[1],A[2]].map((function(A){return A<4.5*El?A/4.5:Math.pow((A+kl-1)/kl,1/.45)}));return e=[t[0],t[1],t[2]],rl([.6369580483012914,.14461690358620832,.1688809751641721,.2627002120112671,.6779980715188708,.05930171646986196,0,.028072693049087428,1.060985057710791],e)}([A[0],A[1],A[2]]);return ol([e[0],e[1],e[2],A[3]])}},Pl={rgb:function(A,e){var t=e.filter(xd);if(3===t.length){var n=t.map(tl),i=n[0],r=n[1],s=n[2],o=Ul([i/255,r/255,s/255]),a=bl([o[0],o[1],o[2]]);return[a[0],a[1],a[2],1]}if(4===t.length){var c=t.map(tl),d=(i=c[0],r=c[1],s=c[2],c[3]),l=(o=Ul([i/255,r/255,s/255]),bl([o[0],o[1],o[2]]));return[l[0],l[1],l[2],d]}return[0,0,0,1]},hsl:function(A,e){var t=al(0,e),n=t[0],i=t[1],r=t[2],s=t[3],o=Ul(ml([n,i,r])),a=bl([o[0],o[1],o[2]]);return[a[0],a[1],a[2],s]},lab:function(A,e){var t=ll(e),n=t[0],i=t[1],r=t[2],s=t[3],o=wl([n,i,r]);return[o[0],o[1],o[2],s]},lch:function(A,e){var t=dl(e),n=t[0],i=t[1],r=t[2],s=t[3],o=wl(fl([n,i,r]));return[o[0],o[1],o[2],s]},oklab:function(A,e){var t=ll(e),n=t[0],i=t[1],r=t[2],s=t[3],o=Bl([n,i,r]);return[o[0],o[1],o[2],s]},oklch:function(A,e){var t=ul(e),n=t[0],i=t[1],r=t[2],s=t[3],o=Bl(fl([n,i,r]));return[o[0],o[1],o[2],s]}},Hl={srgb:function(A){var e=Ql(yl([A[0],A[1],A[2]]));return[e[0],e[1],e[2],A[3]]},"srgb-linear":function(A){var e=yl([A[0],A[1],A[2]]),t=e[0],n=e[1],i=e[2];return[il(Math.round(255*t),0,255),il(Math.round(255*n),0,255),il(Math.round(255*i),0,255),A[3]]},"display-p3":function(A){var e,t,n=(t=[A[0],A[1],A[2]],e=rl([2.493496911941425,-.9313836179191239,-.40271078445071684,-.8294889695615747,1.7626640603183463,.023624685841943577,.03584583024378447,-.07617238926804182,.9568845240076872],t),Ql(e));return[n[0],n[1],n[2],A[3]]},"a98-rgb":function(A){var e,t,n=(t=[A[0],A[1],A[2]],[(e=rl([2.0415879038107465,-.5650069742788596,-.34473135077832956,-.9692436362808795,1.8759675015077202,.04155505740717557,.013444280632031142,-.11836239223101838,1.0151749943912054],t).map((function(A){var e=A<0?-1:1,t=Math.abs(A);return e*Math.pow(t,256/563)})))[0],e[1],e[2]]);return[n[0],n[1],n[2],A[3]]},"prophoto-rgb":function(A){var e,t=(e=hl([A[0],A[1],A[2]]),rl([1.3457868816471583,-.25557208737979464,-.05110186497554526,-.5446307051249019,1.5082477428451468,.02052744743642139,0,0,1.2119675456389452],e).map((function(A){return A>1/512?Math.pow(A,1/1.8):16*A})));return[t[0],t[1],t[2],A[3]]},xyz:vl,"xyz-d50":function(A){var e=hl([A[0],A[2],A[3]]);return[e[0],e[1],e[2],A[3]]},"xyz-d65":vl,rec2020:function(A){var e,t=(e=[A[0],A[1],A[2]],rl([1.716651187971268,-.355670783776392,-.25336628137366,-.666684351832489,1.616481236634939,.0157685458139111,.017639857445311,-.042770613257809,.942103121235474],e).map((function(A){return A>=El?kl*Math.pow(A,.45)-(kl-1):4.5*A})));return[t[0],t[1],t[2],A[3]]}},Rl={hsl:cl,hsla:cl,rgb:Sl,rgba:Sl,lch:function(A,e){if(nl(e.filter(xd)))throw new Error("Relative color not supported for lch()");var t=dl(e),n=t[0],i=t[1],r=t[2],s=t[3],o=Ql(yl(wl(fl([n,i,r]))));return el(il(Math.round(255*o[0]),0,255),il(Math.round(255*o[1]),0,255),il(Math.round(255*o[2]),0,255),s)},oklch:function(A,e){if(nl(e.filter(xd)))throw new Error("Relative color not supported for oklch()");var t=ul(e),n=t[0],i=t[1],r=t[2],s=t[3],o=Ql(yl(Bl(fl([n,i,r]))));return el(il(Math.round(255*o[0]),0,255),il(Math.round(255*o[1]),0,255),il(Math.round(255*o[2]),0,255),s)},oklab:function(A,e){if(nl(e.filter(xd)))throw new Error("Relative color not supported for oklab()");var t=ll(e),n=t[0],i=t[1],r=t[2],s=t[3],o=Ql(yl(Bl([n,i,r])));return el(il(Math.round(255*o[0]),0,255),il(Math.round(255*o[1]),0,255),il(Math.round(255*o[2]),0,255),s)},lab:function(A,e){if(nl(e.filter(xd)))throw new Error("Relative color not supported for lab()");var t=ll(e),n=t[0],i=t[1],r=t[2],s=t[3],o=Ql(yl(wl([n,i,r])));return el(il(Math.round(255*o[0]),0,255),il(Math.round(255*o[1]),0,255),il(Math.round(255*o[2]),0,255),s)},color:function(A,e){var t=e.filter(xd),n=20===t[0].type?t[0].value:"unknown";if(!nl(t)){var i=Il[n];if(void 0===i)throw new Error('Attempting to parse an unsupported color space "'.concat(n,'" for color() function'));return i([m=Id(t[1])?t[1].number:0,f=Id(t[2])?t[2].number:0,B=Id(t[3])?t[3].number:0,w=t.length>4&&6===t[4].type&&"/"===t[4].value&&Id(t[5])?t[5].number:1])}var r=function(A,e){if(Id(e))return e.number;var t;if(Pd(e))return A["r"===(t=e.value)||"x"===t?0:"g"===t||"y"===t?1:2];var n=function(A){for(var e="(",t=0,i=A.filter(xd);t<i.length;t++){var r=i[t];e+=18===r.type&&"calc"===r.name?n(r.values):Id(r)?r.number:6===r.type||Pd(r)?r.value:""}return e+")"};if(18===e.type){var i=e.values.filter(xd);if("calc"===e.name){var r=n(i).replace(/r|x/,A[0].toString()).replace(/g|y/,A[1].toString()).replace(/b|z/,A[2].toString());return new Function("return "+r)()}}return null},s=18===t[1].type?t[1].name:Pd(t[1])||5===t[1].type?"rgb":"unknown",o=Pd(t[2])?t[2].value:"unknown",a=18===t[1].type?t[1].values:Pd(t[1])?[t[1]]:[];if(Pd(t[1])){if(void 0===xl[t[1].value.toUpperCase()])throw new Error("Attempting to use unknown color in relative color 'from'");var c=Dl(A,t[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:(d=255&c)>1?d/255:d,flags:1}]}else if(5===t[1].type){var d,l=Tl(t[1]);a=[{type:17,number:l[0],flags:1},{type:17,number:l[1],flags:1},{type:17,number:l[2],flags:1},{type:17,number:(d=l[3])>1?d/255:d,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 u=Pl[s],h=Hl[o],g=Il[o];if(void 0===u)throw new Error('Attempting to parse an unsupported color space "'.concat(s,'" for color() function'));if(void 0===h)throw new Error('Attempting to parse an unsupported color space "'.concat(o,'" for color() function'));var p=h(u(A,a)),m=r(p,t[3]),f=r(p,t[4]),B=r(p,t[5]),w=t.length>6&&6===t[6].type&&"/"===t[6].value&&Id(t[7])?t[7].number:1;if(null===m||null===f||null===B)throw new Error("Invalid relative color in color() function");return g([m,f,B,w])}},Dl=function(A,e){return Fl(A,Td.create(e).parseComponentValue())},xl={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},Ll={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(A,e){return e.map((function(A){if(Pd(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},Ol={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Ml=function(A,e){var t=Fl(A,e[0]),n=e[1];return n&&Nd(n)?{color:t,stop:n}:{color:t,stop:null}},Nl=function(A,e){var t=A[0],n=A[A.length-1];null===t.stop&&(t.stop=_d),null===n.stop&&(n.stop=Gd);for(var i=[],r=0,s=0;s<A.length;s++){var o=A[s].stop;if(null!==o){var a=Jd(o,e);a>r?i.push(a):i.push(r),r=a}else i.push(null)}var c=null;for(s=0;s<i.length;s++){var d=i[s];if(null===d)null===c&&(c=s);else if(null!==c){for(var l=s-c,u=(d-i[c-1])/(l+1),h=1;h<=l;h++)i[c+h-1]=u*h;c=null}}return A.map((function(A,t){return{color:A.color,stop:Math.max(Math.min(1,i[t]/e),0)}}))},Kl=function(A,e){return Math.sqrt(A*A+e*e)},_l=function(A,e,t,n,i){return[[0,0],[0,e],[A,0],[A,e]].reduce((function(A,e){var r=e[0],s=e[1],o=Kl(t-r,n-s);return(i?o<A.optimumDistance:o>A.optimumDistance)?{optimumCorner:e,optimumDistance:o}:A}),{optimumDistance:i?1/0:-1/0,optimumCorner:null}).optimumCorner},Vl=function(A,e){var t=Zd(180),n=[];return Ld(e).forEach((function(e,i){if(0===i){var r=e[0];if(20===r.type&&-1!==["top","left","right","bottom"].indexOf(r.value))return void(t=$d(e));if(qd(r))return void(t=(Yd(0,r)+Zd(270))%Zd(360))}var s=Ml(A,e);n.push(s)})),{angle:t,stops:n,type:1}},Gl="closest-side",jl="farthest-side",Jl="closest-corner",Wl="farthest-corner",Xl="circle",Yl="ellipse",ql="cover",$l="contain",Zl=function(A,e){var t=0,n=3,i=[],r=[];return Ld(e).forEach((function(e,s){var o=!0;if(0===s?o=e.reduce((function(A,e){if(Pd(e))switch(e.value){case"center":return r.push(Vd),!1;case"top":case"left":return r.push(_d),!1;case"right":case"bottom":return r.push(Gd),!1}else if(Nd(e)||Md(e))return r.push(e),!1;return A}),o):1===s&&(o=e.reduce((function(A,e){if(Pd(e))switch(e.value){case Xl:return t=0,!1;case Yl:return t=1,!1;case $l:case Gl:return n=0,!1;case jl:return n=1,!1;case Jl:return n=2,!1;case ql:case Wl:return n=3,!1}else if(Md(e)||Nd(e))return Array.isArray(n)||(n=[]),n.push(e),!1;return A}),o)),o){var a=Ml(A,e);i.push(a)}})),{size:n,shape:t,stops:i,position:r,type:2}},zl=function(A,e){if(22===e.type){var t={url:e.value,type:0};return A.cache.addImage(e.value),t}if(18===e.type){var n=Au[e.name];if(void 0===n)throw new Error('Attempting to parse an unsupported image function "'.concat(e.name,'"'));return n(A,e.values)}throw new Error("Unsupported image type ".concat(e.type))},Au={"linear-gradient":function(A,e){var t=Zd(180),n=[];return Ld(e).forEach((function(e,i){if(0===i){var r=e[0];if(20===r.type&&"to"===r.value)return void(t=$d(e));if(qd(r))return void(t=Yd(0,r))}var s=Ml(A,e);n.push(s)})),{angle:t,stops:n,type:1}},"-moz-linear-gradient":Vl,"-ms-linear-gradient":Vl,"-o-linear-gradient":Vl,"-webkit-linear-gradient":Vl,"radial-gradient":function(A,e){var t=0,n=3,i=[],r=[];return Ld(e).forEach((function(e,s){var o=!0;if(0===s){var a=!1;o=e.reduce((function(A,e){if(a)if(Pd(e))switch(e.value){case"center":return r.push(Vd),A;case"top":case"left":return r.push(_d),A;case"right":case"bottom":return r.push(Gd),A}else(Nd(e)||Md(e))&&r.push(e);else if(Pd(e))switch(e.value){case Xl:return t=0,!1;case Yl:return t=1,!1;case"at":return a=!0,!1;case Gl:return n=0,!1;case ql:case jl:return n=1,!1;case $l:case Jl:return n=2,!1;case Wl:return n=3,!1}else if(Md(e)||Nd(e))return Array.isArray(n)||(n=[]),n.push(e),!1;return A}),o)}if(o){var c=Ml(A,e);i.push(c)}})),{size:n,shape:t,stops:i,position:r,type:2}},"-moz-radial-gradient":Zl,"-ms-radial-gradient":Zl,"-o-radial-gradient":Zl,"-webkit-radial-gradient":Zl,"-webkit-gradient":function(A,e){var t=Zd(180),n=[],i=1;return Ld(e).forEach((function(e,t){var r=e[0];if(0===t){if(Pd(r)&&"linear"===r.value)return void(i=1);if(Pd(r)&&"radial"===r.value)return void(i=2)}if(18===r.type)if("from"===r.name){var s=Fl(A,r.values[0]);n.push({stop:_d,color:s})}else if("to"===r.name)s=Fl(A,r.values[0]),n.push({stop:Gd,color:s});else if("color-stop"===r.name){var o=r.values.filter(xd);if(2===o.length){s=Fl(A,o[1]);var a=o[0];Id(a)&&n.push({stop:{type:16,number:100*a.number,flags:a.flags},color:s})}}})),1===i?{angle:(t+Zd(180))%Zd(360),stops:n,type:i}:{size:3,shape:0,stops:n,position:[],type:i}}},eu={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(A,e){if(0===e.length)return[];var t=e[0];return 20===t.type&&"none"===t.value?[]:e.filter((function(A){return xd(A)&&function(A){return!(20===A.type&&"none"===A.value||18===A.type&&!Au[A.name])}(A)})).map((function(e){return zl(A,e)}))}},tu={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(A,e){return e.map((function(A){if(Pd(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},nu={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(A,e){return Ld(e).map((function(A){return A.filter(Nd)})).map(Kd)}},iu={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(A,e){return Ld(e).map((function(A){return A.filter(Pd).map((function(A){return A.value})).join(" ")})).map(ru)}},ru=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}};(ac=oc||(oc={})).AUTO="auto",ac.CONTAIN="contain",ac.COVER="cover";var su,ou,au={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(A,e){return Ld(e).map((function(A){return A.filter(cu)}))}},cu=function(A){return Pd(A)||Nd(A)},du=function(A){return{name:"border-".concat(A,"-color"),initialValue:"transparent",prefix:!1,type:3,format:"color"}},lu=du("top"),uu=du("right"),hu=du("bottom"),gu=du("left"),pu=function(A){return{name:"border-radius-".concat(A),initialValue:"0 0",prefix:!1,type:1,parse:function(A,e){return Kd(e.filter(Nd))}}},mu=pu("top-left"),fu=pu("top-right"),Bu=pu("bottom-right"),wu=pu("bottom-left"),vu=function(A){return{name:"border-".concat(A,"-style"),initialValue:"solid",prefix:!1,type:2,parse:function(A,e){switch(e){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},Cu=vu("top"),yu=vu("right"),bu=vu("bottom"),Qu=vu("left"),Uu=function(A){return{name:"border-".concat(A,"-width"),initialValue:"0",type:0,prefix:!1,parse:function(A,e){return Sd(e)?e.number:0}}},ku=Uu("top"),Eu=Uu("right"),Fu=Uu("bottom"),Tu=Uu("left"),Su={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Iu={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(A,e){return"rtl"===e?1:0}},Pu={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(A,e){return e.filter(Pd).reduce((function(A,e){return A|Hu(e.value)}),0)}},Hu=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},Ru={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},Du={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(A,e){return 20===e.type&&"normal"===e.value?0:17===e.type||15===e.type?e.number:0}};(ou=su||(su={})).NORMAL="normal",ou.STRICT="strict";var xu,Lu,Ou={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){return"strict"===e?su.STRICT:su.NORMAL}},Mu={name:"line-height",initialValue:"normal",prefix:!1,type:4},Nu=function(A,e){return Pd(A)&&"normal"===A.value?1.2*e:17===A.type?e*A.number:Nd(A)?Jd(A,e):e},Ku={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(A,e){return 20===e.type&&"none"===e.value?null:zl(A,e)}},_u={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(A,e){return"inside"===e?0:1}},Vu={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(A,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;default:return-1}}},Gu=function(A){return{name:"margin-".concat(A),initialValue:"0",prefix:!1,type:4}},ju=Gu("top"),Ju=Gu("right"),Wu=Gu("bottom"),Xu=Gu("left"),Yu={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(A,e){return e.filter(Pd).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}}))}},qu={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){return"break-word"===e?"break-word":"normal"}},$u=function(A){return{name:"padding-".concat(A),initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},Zu=$u("top"),zu=$u("right"),Ah=$u("bottom"),eh=$u("left"),th={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(A,e){switch(e){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},nh={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(A,e){switch(e){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},ih={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return 1===e.length&&Rd(e[0],"none")?[]:Ld(e).map((function(e){for(var t={color:xl.TRANSPARENT,offsetX:_d,offsetY:_d,blur:_d},n=0,i=0;i<e.length;i++){var r=e[i];Md(r)?(0===n?t.offsetX=r:1===n?t.offsetY=r:t.blur=r,n++):t.color=Fl(A,r)}return t}))}},rh={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},sh={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(A,e){if(20===e.type&&"none"===e.value)return null;if(18===e.type){var t=oh[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported transform function "'.concat(e.name,'"'));return t(e.values)}return null}},oh={matrix:function(A){var e=A.filter((function(A){return 17===A.type})).map((function(A){return A.number}));return 6===e.length?e:null},matrix3d:function(A){var e=A.filter((function(A){return 17===A.type})).map((function(A){return A.number})),t=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],16===e.length?[t,n,i,r,s,o]:null}},ah={type:16,number:50,flags:4},ch=[ah,ah],dh={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(A,e){var t=e.filter(Nd);return 2!==t.length?ch:[t[0],t[1]]}},lh={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"hidden":return 1;case"collapse":return 2;default:return 0}}};(Lu=xu||(xu={})).NORMAL="normal",Lu.BREAK_ALL="break-all",Lu.KEEP_ALL="keep-all";for(var uh={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){switch(e){case"break-all":return xu.BREAK_ALL;case"keep-all":return xu.KEEP_ALL;default:return xu.NORMAL}}},hh={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(A,e){if(20===e.type)return{auto:!0,order:0};if(Id(e))return{auto:!1,order:e.number};throw new Error("Invalid z-index number parsed")}},gh=function(A,e){if(15===e.type)switch(e.unit.toLowerCase()){case"s":return 1e3*e.number;case"ms":return e.number}throw new Error("Unsupported time type")},ph={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(A,e){return Id(e)?e.number:1}},mh={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},fh={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(A,e){return e.filter(Pd).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}))}},Bh={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(A,e){var t=[],n=[];return e.forEach((function(A){switch(A.type){case 20:case 0:t.push(A.value);break;case 17:t.push(A.number.toString());break;case 4:n.push(t.join(" ")),t.length=0}})),t.length&&n.push(t.join(" ")),n.map((function(A){return-1===A.indexOf(" ")?A:"'".concat(A,"'")}))}},wh={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},vh={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(A,e){return Id(e)?e.number:Pd(e)&&"bold"===e.value?700:400}},Ch={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return e.filter(Pd).map((function(A){return A.value}))}},yh={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){switch(e){case"oblique":return"oblique";case"italic":return"italic";default:return"normal"}}},bh=function(A,e){return 0!==(A&e)},Qh={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(A,e){if(0===e.length)return[];var t=e[0];return 20===t.type&&"none"===t.value?[]:e}},Uh={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(A,e){if(0===e.length)return null;var t=e[0];if(20===t.type&&"none"===t.value)return null;for(var n=[],i=e.filter(Dd),r=0;r<i.length;r++){var s=i[r],o=i[r+1];if(20===s.type){var a=o&&Id(o)?o.number:1;n.push({counter:s.value,increment:a})}}return n}},kh={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(A,e){if(0===e.length)return[];for(var t=[],n=e.filter(Dd),i=0;i<n.length;i++){var r=n[i],s=n[i+1];if(Pd(r)&&"none"!==r.value){var o=s&&Id(s)?s.number:0;t.push({counter:r.value,reset:o})}}return t}},Eh={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(A,e){return e.filter(Sd).map((function(A){return gh(0,A)}))}},Fh={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(A,e){if(0===e.length)return null;var t=e[0];if(20===t.type&&"none"===t.value)return null;var n=[],i=e.filter(Hd);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}},Th=function(A,e,t){if(!A)return"";var n=A[Math.min(e,A.length-1)];return n?t?n.open:n.close:""},Sh={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return 1===e.length&&Rd(e[0],"none")?[]:Ld(e).map((function(e){for(var t={color:255,offsetX:_d,offsetY:_d,blur:_d,spread:_d,inset:!1},n=0,i=0;i<e.length;i++){var r=e[i];Rd(r,"inset")?t.inset=!0:Md(r)?(0===n?t.offsetX=r:1===n?t.offsetY=r:2===n?t.blur=r:t.spread=r,n++):t.color=Fl(A,r)}return t}))}},Ih={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(A,e){var t=[];return e.filter(Pd).forEach((function(A){switch(A.value){case"stroke":t.push(1);break;case"fill":t.push(0);break;case"markers":t.push(2)}})),[0,1,2].forEach((function(A){-1===t.indexOf(A)&&t.push(A)})),t}},Ph={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},Hh={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(A,e){return Sd(e)?e.number:0}},Rh={name:"objectFit",initialValue:"fill",prefix:!1,type:1,parse:function(A,e){return e.filter(Pd).reduce((function(A,e){return A|Dh(e.value)}),0)}},Dh=function(A){switch(A){case"contain":return 2;case"cover":return 4;case"none":return 8;case"scale-down":return 16}return 0},xh=function(){function A(A,e){var t,n;this.animationDuration=Mh(A,Eh,e.animationDuration),this.backgroundClip=Mh(A,Ll,e.backgroundClip),this.backgroundColor=Mh(A,Ol,e.backgroundColor),this.backgroundImage=Mh(A,eu,e.backgroundImage),this.backgroundOrigin=Mh(A,tu,e.backgroundOrigin),this.backgroundPosition=Mh(A,nu,e.backgroundPosition),this.backgroundRepeat=Mh(A,iu,e.backgroundRepeat),this.backgroundSize=Mh(A,au,e.backgroundSize),this.borderTopColor=Mh(A,lu,e.borderTopColor),this.borderRightColor=Mh(A,uu,e.borderRightColor),this.borderBottomColor=Mh(A,hu,e.borderBottomColor),this.borderLeftColor=Mh(A,gu,e.borderLeftColor),this.borderTopLeftRadius=Mh(A,mu,e.borderTopLeftRadius),this.borderTopRightRadius=Mh(A,fu,e.borderTopRightRadius),this.borderBottomRightRadius=Mh(A,Bu,e.borderBottomRightRadius),this.borderBottomLeftRadius=Mh(A,wu,e.borderBottomLeftRadius),this.borderTopStyle=Mh(A,Cu,e.borderTopStyle),this.borderRightStyle=Mh(A,yu,e.borderRightStyle),this.borderBottomStyle=Mh(A,bu,e.borderBottomStyle),this.borderLeftStyle=Mh(A,Qu,e.borderLeftStyle),this.borderTopWidth=Mh(A,ku,e.borderTopWidth),this.borderRightWidth=Mh(A,Eu,e.borderRightWidth),this.borderBottomWidth=Mh(A,Fu,e.borderBottomWidth),this.borderLeftWidth=Mh(A,Tu,e.borderLeftWidth),this.boxShadow=Mh(A,Sh,e.boxShadow),this.color=Mh(A,Su,e.color),this.direction=Mh(A,Iu,e.direction),this.display=Mh(A,Pu,e.display),this.float=Mh(A,Ru,e.cssFloat),this.fontFamily=Mh(A,Bh,e.fontFamily),this.fontSize=Mh(A,wh,e.fontSize),this.fontStyle=Mh(A,yh,e.fontStyle),this.fontVariant=Mh(A,Ch,e.fontVariant),this.fontWeight=Mh(A,vh,e.fontWeight),this.letterSpacing=Mh(A,Du,e.letterSpacing),this.lineBreak=Mh(A,Ou,e.lineBreak),this.lineHeight=Mh(A,Mu,e.lineHeight),this.listStyleImage=Mh(A,Ku,e.listStyleImage),this.listStylePosition=Mh(A,_u,e.listStylePosition),this.listStyleType=Mh(A,Vu,e.listStyleType),this.marginTop=Mh(A,ju,e.marginTop),this.marginRight=Mh(A,Ju,e.marginRight),this.marginBottom=Mh(A,Wu,e.marginBottom),this.marginLeft=Mh(A,Xu,e.marginLeft),this.opacity=Mh(A,ph,e.opacity);var i=Mh(A,Yu,e.overflow);this.overflowX=i[0],this.overflowY=i[i.length>1?1:0],this.overflowWrap=Mh(A,qu,e.overflowWrap),this.paddingTop=Mh(A,Zu,e.paddingTop),this.paddingRight=Mh(A,zu,e.paddingRight),this.paddingBottom=Mh(A,Ah,e.paddingBottom),this.paddingLeft=Mh(A,eh,e.paddingLeft),this.paintOrder=Mh(A,Ih,e.paintOrder),this.position=Mh(A,nh,e.position),this.textAlign=Mh(A,th,e.textAlign),this.textDecorationColor=Mh(A,mh,null!==(t=e.textDecorationColor)&&void 0!==t?t:e.color),this.textDecorationLine=Mh(A,fh,null!==(n=e.textDecorationLine)&&void 0!==n?n:e.textDecoration),this.textShadow=Mh(A,ih,e.textShadow),this.textTransform=Mh(A,rh,e.textTransform),this.transform=Mh(A,sh,e.transform),this.transformOrigin=Mh(A,dh,e.transformOrigin),this.visibility=Mh(A,lh,e.visibility),this.webkitTextStrokeColor=Mh(A,Ph,e.webkitTextStrokeColor),this.webkitTextStrokeWidth=Mh(A,Hh,e.webkitTextStrokeWidth),this.wordBreak=Mh(A,uh,e.wordBreak),this.zIndex=Mh(A,hh,e.zIndex),this.objectFit=Mh(A,Rh,e.objectFit)}return A.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&0===this.visibility},A.prototype.isTransparent=function(){return zd(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 bh(this.display,4)||bh(this.display,33554432)||bh(this.display,268435456)||bh(this.display,536870912)||bh(this.display,67108864)||bh(this.display,134217728)},A}(),Lh=function(A,e){this.content=Mh(A,Qh,e.content),this.quotes=Mh(A,Fh,e.quotes)},Oh=function(A,e){this.counterIncrement=Mh(A,Uh,e.counterIncrement),this.counterReset=Mh(A,kh,e.counterReset)},Mh=function(A,e,t){var n=new Fd,i=null!=t?t.toString():e.initialValue;n.write(i);var r=new Td(n.read());switch(e.type){case 2:var s=r.parseComponentValue();return e.parse(A,Pd(s)?s.value:e.initialValue);case 0:return e.parse(A,r.parseComponentValue());case 1:return e.parse(A,r.parseComponentValues());case 4:return r.parseComponentValue();case 3:switch(e.format){case"angle":return Yd(0,r.parseComponentValue());case"color":return Fl(A,r.parseComponentValue());case"image":return zl(A,r.parseComponentValue());case"length":var o=r.parseComponentValue();return Md(o)?o:_d;case"length-percentage":var a=r.parseComponentValue();return Nd(a)?a:_d;case"time":return gh(0,r.parseComponentValue())}}},Nh=function(A,e){var t=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===t||e===t},Kh=function(A,e){this.context=A,this.textNodes=[],this.elements=[],this.flags=0,Nh(e,3),this.styles=new xh(A,window.getComputedStyle(e,null)),Kg(e)&&(this.styles.animationDuration.some((function(A){return A>0}))&&(e.style.animationDuration="0s"),null!==this.styles.transform&&(e.style.transform="none")),this.bounds=_a(this.context,e),Nh(e,4)&&(this.flags|=16)},_h="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Vh=0;Vh<64;Vh++)_h["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(Vh)]=Vh;for(var Gh=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},jh=function(){function A(A,e,t,n,i,r){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=n,this.index=i,this.data=r}return A.prototype.get=function(A){var e;if(A>=0){if(A<55296||A>56319&&A<=65535)return e=((e=this.index[A>>5])<<2)+(31&A),this.data[e];if(A<=65535)return e=((e=this.index[2048+(A-55296>>5)])<<2)+(31&A),this.data[e];if(A<this.highStart)return e=2080+(A>>11),e=this.index[e],e+=A>>5&63,e=((e=this.index[e])<<2)+(31&A),this.data[e];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},A}(),Jh="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Wh=0;Wh<64;Wh++)Jh["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(Wh)]=Wh;var Xh,Yh,qh=8,$h=9,Zh=11,zh=12,Ag=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,A);var t=A.length;if(!t)return"";for(var n=[],i=-1,r="";++i<t;){var s=A[i];s<=65535?n.push(s):(s-=65536,n.push(55296+(s>>10),s%1024+56320)),(i+1===t||n.length>16384)&&(r+=String.fromCharCode.apply(String,n),n.length=0)}return r},eg=function(){var A=function(A){var e,t,n,i,r,s=.75*A.length,o=A.length,a=0;"="===A[A.length-1]&&(s--,"="===A[A.length-2]&&s--);var c="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(s):new Array(s),d=Array.isArray(c)?c:new Uint8Array(c);for(e=0;e<o;e+=4)t=_h[A.charCodeAt(e)],n=_h[A.charCodeAt(e+1)],i=_h[A.charCodeAt(e+2)],r=_h[A.charCodeAt(e+3)],d[a++]=t<<2|n>>4,d[a++]=(15&n)<<4|i>>2,d[a++]=(3&i)<<6|63&r;return c}("AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA="),e=Array.isArray(A)?function(A){for(var e=A.length,t=[],n=0;n<e;n+=4)t.push(A[n+3]<<24|A[n+2]<<16|A[n+1]<<8|A[n]);return t}(A):new Uint32Array(A),t=Array.isArray(A)?function(A){for(var e=A.length,t=[],n=0;n<e;n+=2)t.push(A[n+1]<<8|A[n]);return t}(A):new Uint16Array(A),n=Gh(t,12,e[4]/2),i=2===e[5]?Gh(t,(24+e[4])/2):function(A,e,t){return A.slice?A.slice(e,t):new Uint32Array(Array.prototype.slice.call(A,e,t))}(e,Math.ceil((24+e[4])/4));return new jh(e[0],e[1],e[2],e[3],n,i)}(),tg="×",ng=function(A){return eg.get(A)},ig=function(A,e,t){var n=t-2,i=e[n],r=e[t-1],s=e[t];if(2===r&&3===s)return tg;if(2===r||3===r||4===r)return"÷";if(2===s||3===s||4===s)return"÷";if(r===qh&&-1!==[qh,$h,Zh,zh].indexOf(s))return tg;if(!(r!==Zh&&r!==$h||s!==$h&&10!==s))return tg;if((r===zh||10===r)&&10===s)return tg;if(13===s||5===s)return tg;if(7===s)return tg;if(1===r)return tg;if(13===r&&14===s){for(;5===i;)i=e[--n];if(14===i)return tg}if(15===r&&15===s){for(var o=0;15===i;)o++,i=e[--n];if(o%2==0)return tg}return"÷"},rg=function(A){var e=function(A){for(var e=[],t=0,n=A.length;t<n;){var i=A.charCodeAt(t++);if(i>=55296&&i<=56319&&t<n){var r=A.charCodeAt(t++);56320==(64512&r)?e.push(((1023&i)<<10)+(1023&r)+65536):(e.push(i),t--)}else e.push(i)}return e}(A),t=e.length,n=0,i=0,r=e.map(ng);return{next:function(){if(n>=t)return{done:!0,value:null};for(var A=tg;n<t&&(A=ig(0,r,++n))===tg;);if(A!==tg||n===t){var s=Ag.apply(null,e.slice(i,n));return i=n,{value:s,done:!1}}return{done:!0,value:null}}}},sg=function(A){return 0===A[0]&&255===A[1]&&0===A[2]&&255===A[3]},og=function(A,e,t,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",A.toString()),s.setAttributeNS(null,"height",e.toString()),o.setAttributeNS(null,"width","100%"),o.setAttributeNS(null,"height","100%"),o.setAttributeNS(null,"x",t.toString()),o.setAttributeNS(null,"y",n.toString()),o.setAttributeNS(null,"externalResourcesRequired","true"),s.appendChild(o),o.appendChild(i),s},ag=function(A){return new Promise((function(e,t){var n=new Image;n.onload=function(){return e(n)},n.onerror=t,n.src="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent((new XMLSerializer).serializeToString(A)))}))},cg={get SUPPORT_RANGE_BOUNDS(){var A=function(A){if(A.createRange){var e=A.createRange();if(e.getBoundingClientRect){var t=A.createElement("boundtest");t.style.height="".concat(123,"px"),t.style.display="block",A.body.appendChild(t),e.selectNode(t);var n=e.getBoundingClientRect(),i=Math.round(n.height);if(A.body.removeChild(t),123===i)return!0}}return!1}(document);return Object.defineProperty(cg,"SUPPORT_RANGE_BOUNDS",{value:A}),A},get SUPPORT_WORD_BREAKING(){var A=cg.SUPPORT_RANGE_BOUNDS&&function(A){var e=A.createElement("boundtest");e.style.width="50px",e.style.display="block",e.style.fontSize="12px",e.style.letterSpacing="0px",e.style.wordSpacing="0px",A.body.appendChild(e);var t=A.createRange();e.innerHTML="function"==typeof"".repeat?"👨".repeat(10):"";var n=e.firstChild,i=Va(n.data).map((function(A){return Ga(A)})),r=0,s={},o=i.every((function(A,e){t.setStart(n,r),t.setEnd(n,r+A.length);var i=t.getBoundingClientRect();r+=A.length;var o=i.x>s.x||i.y>s.y;return s=i,0===e||o}));return A.body.removeChild(e),o}(document);return Object.defineProperty(cg,"SUPPORT_WORD_BREAKING",{value:A}),A},get SUPPORT_SVG_DRAWING(){var A=function(A){var e=new Image,t=A.createElement("canvas"),n=t.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),t.toDataURL()}catch(i){return!1}return!0}(document);return Object.defineProperty(cg,"SUPPORT_SVG_DRAWING",{value:A}),A},get SUPPORT_FOREIGNOBJECT_DRAWING(){var A="function"==typeof Array.from&&"function"==typeof window.fetch?function(A){var e=A.createElement("canvas"),t=100;e.width=t,e.height=t;var n=e.getContext("2d");if(!n)return Promise.reject(!1);n.fillStyle="rgb(0, 255, 0)",n.fillRect(0,0,t,t);var i=new Image,r=e.toDataURL();i.src=r;var s=og(t,t,0,0,i);return n.fillStyle="red",n.fillRect(0,0,t,t),ag(s).then((function(e){n.drawImage(e,0,0);var i=n.getImageData(0,0,t,t).data;n.fillStyle="red",n.fillRect(0,0,t,t);var s=A.createElement("div");return s.style.backgroundImage="url(".concat(r,")"),s.style.height="".concat(t,"px"),sg(i)?ag(og(t,t,0,0,s)):Promise.reject(!1)})).then((function(A){return n.drawImage(A,0,0),sg(n.getImageData(0,0,t,t).data)})).catch((function(){return!1}))}(document):Promise.resolve(!1);return Object.defineProperty(cg,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:A}),A},get SUPPORT_CORS_IMAGES(){var A=void 0!==(new Image).crossOrigin;return Object.defineProperty(cg,"SUPPORT_CORS_IMAGES",{value:A}),A},get SUPPORT_RESPONSE_TYPE(){var A="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(cg,"SUPPORT_RESPONSE_TYPE",{value:A}),A},get SUPPORT_CORS_XHR(){var A="withCredentials"in new XMLHttpRequest;return Object.defineProperty(cg,"SUPPORT_CORS_XHR",{value:A}),A},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var A=!("undefined"==typeof Intl||!Intl.Segmenter);return Object.defineProperty(cg,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:A}),A}},dg=function(A,e){this.text=A,this.bounds=e},lg=function(A,e,t){var n=A.ownerDocument;if(!n)throw new Error("Node has no owner document");var i=n.createRange();return i.setStart(A,e),i.setEnd(A,e+t),i},ug=function(A){if(cg.SUPPORT_NATIVE_TEXT_SEGMENTATION){var e=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(e.segment(A)).map((function(A){return A.segment}))}return function(A){for(var e,t=rg(A),n=[];!(e=t.next()).done;)e.value&&n.push(e.value.slice());return n}(A)},hg=[32,160,4961,65792,65793,4153,4241],gg=function(A,e){for(var t,n=function(A,e){var t=Va(A),n=function(A,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var t=function(A,e){void 0===e&&(e="strict");var t=[],n=[],i=[];return A.forEach((function(A,r){var s=xc.get(A);if(s>50?(i.push(!0),s-=50):i.push(!1),-1!==["normal","auto","loose"].indexOf(e)&&-1!==[8208,8211,12316,12448].indexOf(A))return n.push(r),t.push(16);if(4===s||11===s){if(0===r)return n.push(r),t.push(bc);var o=t[r-1];return-1===Kc.indexOf(o)?(n.push(n[r-1]),t.push(o)):(n.push(r),t.push(bc))}return n.push(r),31===s?t.push("strict"===e?mc:Fc):s===Pc||29===s?t.push(bc):43===s?A>=131072&&A<=196605||A>=196608&&A<=262141?t.push(Fc):t.push(bc):void t.push(s)})),[n,t,i]}(A,e.lineBreak),n=t[0],i=t[1],r=t[2];return"break-all"!==e.wordBreak&&"break-word"!==e.wordBreak||(i=i.map((function(A){return-1!==[wc,bc,Pc].indexOf(A)?Fc:A}))),[n,i,"keep-all"===e.wordBreak?r.map((function(e,t){return e&&A[t]>=19968&&A[t]<=40959})):void 0]}(t,e),i=n[0],r=n[1],s=n[2],o=t.length,a=0,c=0;return{next:function(){if(c>=o)return{done:!0,value:null};for(var A=Rc;c<o&&(A=Jc(t,r,i,++c,s))===Rc;);if(A!==Rc||c===o){var e=new Wc(t,A,a,c);return a=c,{value:e,done:!1}}return{done:!0,value:null}}}}(A,{lineBreak:e.lineBreak,wordBreak:"break-word"===e.overflowWrap?"break-word":e.wordBreak}),i=[],r=function(){if(t.value){var A=t.value.slice(),e=Va(A),n="";e.forEach((function(A){-1===hg.indexOf(A)?n+=Ga(A):(n.length&&i.push(n),i.push(Ga(A)),n="")})),n.length&&i.push(n)}};!(t=n.next()).done;)r();return i},pg=function(A,e,t){this.text=mg(e.data,t.textTransform),this.textBounds=function(A,e,t,n){var i=function(A,e){return 0!==e.letterSpacing?ug(A):function(A,e){if(cg.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(t.segment(A)).map((function(A){return A.segment}))}return gg(A,e)}(A,e)}(e,t),r=[],s=0;return i.forEach((function(e){if(t.textDecorationLine.length||e.trim().length>0)if(cg.SUPPORT_RANGE_BOUNDS){var i=lg(n,s,e.length).getClientRects();if(i.length>1){var o=ug(e),a=0;o.forEach((function(e){r.push(new dg(e,Ka.fromDOMRectList(A,lg(n,a+s,e.length).getClientRects()))),a+=e.length}))}else r.push(new dg(e,Ka.fromDOMRectList(A,i)))}else{var c=n.splitText(e.length);r.push(new dg(e,function(A,e){var t=e.ownerDocument;if(t){var n=t.createElement("html2canvaswrapper");n.appendChild(e.cloneNode(!0));var i=e.parentNode;if(i){i.replaceChild(n,e);var r=_a(A,n);return n.firstChild&&i.replaceChild(n.firstChild,n),r}}return Ka.EMPTY}(A,n))),n=c}else cg.SUPPORT_RANGE_BOUNDS||(n=n.splitText(e.length));s+=e.length})),r}(A,this.text,t,e)},mg=function(A,e){switch(e){case 1:return A.toLowerCase();case 3:return A.replace(fg,Bg);case 2:return A.toUpperCase();default:return A}},fg=/(^|\s|:|-|\(|\))([a-z])/g,Bg=function(A,e,t){return A.length>0?e+t.toUpperCase():A},wg=function(A){function e(e,t){var n=A.call(this,e,t)||this;return n.src=t.currentSrc||t.src,n.intrinsicWidth=t.naturalWidth,n.intrinsicHeight=t.naturalHeight,n.context.cache.addImage(n.src),n}return xa(e,A),e}(Kh),vg=function(A){function e(e,t){var n=A.call(this,e,t)||this;return n.canvas=t,n.intrinsicWidth=t.width,n.intrinsicHeight=t.height,n}return xa(e,A),e}(Kh),Cg=function(A){function e(e,t){var n=A.call(this,e,t)||this,i=new XMLSerializer,r=_a(e,t);return t.setAttribute("width","".concat(r.width,"px")),t.setAttribute("height","".concat(r.height,"px")),n.svg="data:image/svg+xml,".concat(encodeURIComponent(i.serializeToString(t))),n.intrinsicWidth=t.width.baseVal.value,n.intrinsicHeight=t.height.baseVal.value,n.context.cache.addImage(n.svg),n}return xa(e,A),e}(Kh),yg=function(A){function e(e,t){var n=A.call(this,e,t)||this;return n.value=t.value,n}return xa(e,A),e}(Kh),bg=function(A){function e(e,t){var n=A.call(this,e,t)||this;return n.start=t.start,n.reversed="boolean"==typeof t.reversed&&!0===t.reversed,n}return xa(e,A),e}(Kh),Qg=[{type:15,flags:0,unit:"px",number:3}],Ug=[{type:16,flags:0,number:50}],kg="checkbox",Eg="radio",Fg=707406591,Tg=function(A){function e(e,t){var n,i,r,s=A.call(this,e,t)||this;switch(s.type=t.type.toLowerCase(),s.checked=t.checked,s.value=0===(i="password"===(n=t).type?new Array(n.value.length+1).join("•"):n.value).length?n.placeholder||"":i,s.type!==kg&&s.type!==Eg||(s.styles.backgroundColor=3739148031,s.styles.borderTopColor=s.styles.borderRightColor=s.styles.borderBottomColor=s.styles.borderLeftColor=2779096575,s.styles.borderTopWidth=s.styles.borderRightWidth=s.styles.borderBottomWidth=s.styles.borderLeftWidth=1,s.styles.borderTopStyle=s.styles.borderRightStyle=s.styles.borderBottomStyle=s.styles.borderLeftStyle=1,s.styles.backgroundClip=[0],s.styles.backgroundOrigin=[0],s.bounds=(r=s.bounds).width>r.height?new Ka(r.left+(r.width-r.height)/2,r.top,r.height,r.height):r.width<r.height?new Ka(r.left,r.top+(r.height-r.width)/2,r.width,r.width):r),s.type){case kg:s.styles.borderTopRightRadius=s.styles.borderTopLeftRadius=s.styles.borderBottomRightRadius=s.styles.borderBottomLeftRadius=Qg;break;case Eg:s.styles.borderTopRightRadius=s.styles.borderTopLeftRadius=s.styles.borderBottomRightRadius=s.styles.borderBottomLeftRadius=Ug}return s}return xa(e,A),e}(Kh),Sg=function(A){function e(e,t){var n=A.call(this,e,t)||this,i=t.options[t.selectedIndex||0];return n.value=i&&i.text||"",n}return xa(e,A),e}(Kh),Ig=function(A){function e(e,t){var n=A.call(this,e,t)||this;return n.value=t.value,n}return xa(e,A),e}(Kh),Pg=function(A){function e(e,t){var n=A.call(this,e,t)||this;n.src=t.src,n.width=parseInt(t.width,10)||0,n.height=parseInt(t.height,10)||0,n.backgroundColor=n.styles.backgroundColor;try{if(t.contentWindow&&t.contentWindow.document&&t.contentWindow.document.documentElement){n.tree=xg(e,t.contentWindow.document.documentElement);var i=t.contentWindow.document.documentElement?Dl(e,getComputedStyle(t.contentWindow.document.documentElement).backgroundColor):xl.TRANSPARENT,r=t.contentWindow.document.body?Dl(e,getComputedStyle(t.contentWindow.document.body).backgroundColor):xl.TRANSPARENT;n.backgroundColor=zd(i)?zd(r)?n.styles.backgroundColor:r:i}}catch(s){}return n}return xa(e,A),e}(Kh),Hg=["OL","UL","MENU"],Rg=function(A,e,t,n){for(var i=e.firstChild,r=void 0;i;i=r)if(r=i.nextSibling,Mg(i)&&i.data.length>0)t.textNodes.push(new pg(A,i,t.styles));else if(Ng(i))if(ep(i)&&i.assignedNodes)i.assignedNodes().forEach((function(e){return Rg(A,e,t,n)}));else{var s=Dg(A,i);s.styles.isVisible()&&(Lg(i,s,n)?s.flags|=4:Og(s.styles)&&(s.flags|=2),-1!==Hg.indexOf(i.tagName)&&(s.flags|=8),t.elements.push(s),i.slot,i.shadowRoot?Rg(A,i.shadowRoot,s,n):zg(i)||Jg(i)||Ap(i)||Rg(A,i,s,n))}},Dg=function(A,e){return qg(e)?new wg(A,e):Xg(e)?new vg(A,e):Jg(e)?new Cg(A,e):Vg(e)?new yg(A,e):Gg(e)?new bg(A,e):jg(e)?new Tg(A,e):Ap(e)?new Sg(A,e):zg(e)?new Ig(A,e):$g(e)?new Pg(A,e):new Kh(A,e)},xg=function(A,e){var t=Dg(A,e);return t.flags|=4,Rg(A,e,t,t),t},Lg=function(A,e,t){return e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||Wg(A)&&t.styles.isTransparent()},Og=function(A){return A.isPositioned()||A.isFloating()},Mg=function(A){return A.nodeType===Node.TEXT_NODE},Ng=function(A){return A.nodeType===Node.ELEMENT_NODE},Kg=function(A){return Ng(A)&&void 0!==A.style&&!_g(A)},_g=function(A){return"object"==typeof A.className},Vg=function(A){return"LI"===A.tagName},Gg=function(A){return"OL"===A.tagName},jg=function(A){return"INPUT"===A.tagName},Jg=function(A){return"svg"===A.tagName},Wg=function(A){return"BODY"===A.tagName},Xg=function(A){return"CANVAS"===A.tagName},Yg=function(A){return"VIDEO"===A.tagName},qg=function(A){return"IMG"===A.tagName},$g=function(A){return"IFRAME"===A.tagName},Zg=function(A){return"STYLE"===A.tagName},zg=function(A){return"TEXTAREA"===A.tagName},Ap=function(A){return"SELECT"===A.tagName},ep=function(A){return"SLOT"===A.tagName},tp=function(A){return A.tagName.indexOf("-")>0},np=function(){function A(){this.counters={}}return A.prototype.getCounterValue=function(A){var e=this.counters[A];return e&&e.length?e[e.length-1]:1},A.prototype.getCounterValues=function(A){return this.counters[A]||[]},A.prototype.pop=function(A){var e=this;A.forEach((function(A){return e.counters[A].pop()}))},A.prototype.parse=function(A){var e=this,t=A.counterIncrement,n=A.counterReset,i=!0;null!==t&&t.forEach((function(A){var t=e.counters[A.counter];t&&0!==A.increment&&(i=!1,t.length||t.push(1),t[Math.max(0,t.length-1)]+=A.increment)}));var r=[];return i&&n.forEach((function(A){var t=e.counters[A.counter];r.push(A.counter),t||(t=e.counters[A.counter]=[]),t.push(A.reset)})),r},A}(),ip={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"]},rp={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:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},sp={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:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},op={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:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},ap=function(A,e,t,n,i,r){return A<e||A>t?fp(A,i,r.length>0):n.integers.reduce((function(e,t,i){for(;A>=t;)A-=t,e+=n.values[i];return e}),"")+r},cp=function(A,e,t,n){var i="";do{t||A--,i=n(A)+i,A/=e}while(A*e>=e);return i},dp=function(A,e,t,n,i){var r=t-e+1;return(A<0?"-":"")+(cp(Math.abs(A),r,n,(function(A){return Ga(Math.floor(A%r)+e)}))+i)},lp=function(A,e,t){void 0===t&&(t=". ");var n=e.length;return cp(Math.abs(A),n,!1,(function(A){return e[Math.floor(A%n)]}))+t},up=function(A,e,t,n,i,r){if(A<-9999||A>9999)return fp(A,4,i.length>0);var s=Math.abs(A),o=i;if(0===s)return e[0]+o;for(var a=0;s>0&&a<=4;a++){var c=s%10;0===c&&bh(r,1)&&""!==o?o=e[c]+o:c>1||1===c&&0===a||1===c&&1===a&&bh(r,2)||1===c&&1===a&&bh(r,4)&&A>100||1===c&&a>1&&bh(r,8)?o=e[c]+(a>0?t[a-1]:"")+o:1===c&&a>0&&(o=t[a-1]+o),s=Math.floor(s/10)}return(A<0?n:"")+o},hp="十百千萬",gp="拾佰仟萬",pp="マイナス",mp="마이너스",fp=function(A,e,t){var n=t?". ":"",i=t?"、":"",r=t?", ":"",s=t?" ":"";switch(e){case 0:return"•"+s;case 1:return"◦"+s;case 2:return"◾"+s;case 5:var o=dp(A,48,57,!0,n);return o.length<4?"0".concat(o):o;case 4:return lp(A,"〇一二三四五六七八九",i);case 6:return ap(A,1,3999,ip,3,n).toLowerCase();case 7:return ap(A,1,3999,ip,3,n);case 8:return dp(A,945,969,!1,n);case 9:return dp(A,97,122,!1,n);case 10:return dp(A,65,90,!1,n);case 11:return dp(A,1632,1641,!0,n);case 12:case 49:return ap(A,1,9999,rp,3,n);case 35:return ap(A,1,9999,rp,3,n).toLowerCase();case 13:return dp(A,2534,2543,!0,n);case 14:case 30:return dp(A,6112,6121,!0,n);case 15:return lp(A,"子丑寅卯辰巳午未申酉戌亥",i);case 16:return lp(A,"甲乙丙丁戊己庚辛壬癸",i);case 17:case 48:return up(A,"零一二三四五六七八九",hp,"負",i,14);case 47:return up(A,"零壹貳參肆伍陸柒捌玖",gp,"負",i,15);case 42:return up(A,"零一二三四五六七八九",hp,"负",i,14);case 41:return up(A,"零壹贰叁肆伍陆柒捌玖",gp,"负",i,15);case 26:return up(A,"〇一二三四五六七八九","十百千万",pp,i,0);case 25:return up(A,"零壱弐参四伍六七八九","拾百千万",pp,i,7);case 31:return up(A,"영일이삼사오육칠팔구","십백천만",mp,r,7);case 33:return up(A,"零一二三四五六七八九","十百千萬",mp,r,0);case 32:return up(A,"零壹貳參四五六七八九","拾百千",mp,r,7);case 18:return dp(A,2406,2415,!0,n);case 20:return ap(A,1,19999,op,3,n);case 21:return dp(A,2790,2799,!0,n);case 22:return dp(A,2662,2671,!0,n);case 52:return ap(A,1,10999,sp,3,n);case 23:return lp(A,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return lp(A,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return dp(A,3302,3311,!0,n);case 28:return lp(A,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",i);case 29:return lp(A,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",i);case 34:return dp(A,3792,3801,!0,n);case 37:return dp(A,6160,6169,!0,n);case 38:return dp(A,4160,4169,!0,n);case 39:return dp(A,2918,2927,!0,n);case 40:return dp(A,1776,1785,!0,n);case 43:return dp(A,3046,3055,!0,n);case 44:return dp(A,3174,3183,!0,n);case 45:return dp(A,3664,3673,!0,n);case 46:return dp(A,3872,3881,!0,n);default:return dp(A,48,57,!0,n)}},Bp="data-html2canvas-ignore",wp=function(){function A(A,e,t){if(this.context=A,this.options=t,this.scrolledElements=[],this.referenceElement=e,this.counters=new np,this.quoteDepth=0,!e.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(e.ownerDocument.documentElement,!1)}return A.prototype.toIFrame=function(A,e){var t=this,n=yp(A,e);if(!n.contentWindow)return Promise.reject("Unable to find iframe window");var i=A.defaultView.pageXOffset,r=A.defaultView.pageYOffset,s=n.contentWindow,o=s.document,a=Up(n).then((function(){return Oa(t,void 0,void 0,(function(){var A,t;return Ma(this,(function(i){switch(i.label){case 0:return this.scrolledElements.forEach(Sp),s&&(s.scrollTo(e.left,e.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||s.scrollY===e.top&&s.scrollX===e.left||(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(s.scrollX-e.left,s.scrollY-e.top,0,0))),A=this.options.onclone,void 0===(t=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:i.sent(),i.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,Qp(o)]:[3,4];case 3:i.sent(),i.label=4;case 4:return"function"==typeof A?[2,Promise.resolve().then((function(){return A(o,t)})).then((function(){return n}))]:[2,n]}}))}))})),c=o.adoptNode(this.documentElement);return xp(c,o),o.open(),o.write("".concat(Fp(document.doctype),"<html></html>")),Tp(this.referenceElement.ownerDocument,i,r),o.replaceChild(c,o.documentElement),o.close(),a},A.prototype.createElementClone=function(A){if(Nh(A,2),Xg(A))return this.createCanvasClone(A);if(Yg(A))return this.createVideoClone(A);if(Zg(A))return this.createStyleClone(A);var e=A.cloneNode(!1);return qg(e)&&(qg(A)&&A.currentSrc&&A.currentSrc!==A.src&&(e.src=A.currentSrc,e.srcset=""),"lazy"===e.loading&&(e.loading="eager")),tp(e)?this.createCustomElementClone(e):e},A.prototype.createCustomElementClone=function(A){var e=document.createElement("html2canvascustomelement");return Ep(A.style,e),e},A.prototype.createStyleClone=function(A){try{var e=A.sheet;if(e&&e.cssRules){var t=[].slice.call(e.cssRules,0).reduce((function(A,e){return e&&"string"==typeof e.cssText?A+e.cssText:A}),""),n=A.cloneNode(!1);return n.textContent=t,n}}catch(i){if(this.context.logger.error("Unable to access cssRules property",i),"SecurityError"!==i.name)throw i}return A.cloneNode(!1)},A.prototype.createCanvasClone=function(A){var e;if(this.options.inlineImages&&A.ownerDocument){var t=A.ownerDocument.createElement("img");try{return t.src=A.toDataURL(),t}catch(a){this.context.logger.info("Unable to inline canvas contents, canvas is tainted",A)}}var n=A.cloneNode(!1);try{n.width=A.width,n.height=A.height;var i=A.getContext("2d"),r=n.getContext("2d",{willReadFrequently:!0});if(r)if(!this.options.allowTaint&&i)r.putImageData(i.getImageData(0,0,A.width,A.height),0,0);else{var s=null!==(e=A.getContext("webgl2"))&&void 0!==e?e:A.getContext("webgl");if(s){var o=s.getContextAttributes();!1===(null==o?void 0:o.preserveDrawingBuffer)&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",A)}r.drawImage(A,0,0)}return n}catch(a){this.context.logger.info("Unable to clone canvas as it is tainted",A)}return n},A.prototype.createVideoClone=function(A){var e=A.ownerDocument.createElement("canvas");e.width=A.offsetWidth,e.height=A.offsetHeight;var t=e.getContext("2d");try{return t&&(t.drawImage(A,0,0,e.width,e.height),this.options.allowTaint||t.getImageData(0,0,e.width,e.height)),e}catch(i){this.context.logger.info("Unable to clone video as it is tainted",A)}var n=A.ownerDocument.createElement("canvas");return n.width=A.offsetWidth,n.height=A.offsetHeight,n},A.prototype.appendChildNode=function(A,e,t){Ng(e)&&("SCRIPT"===e.tagName||e.hasAttribute(Bp)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(e))||this.options.copyStyles&&Ng(e)&&Zg(e)||A.appendChild(this.cloneNode(e,t))},A.prototype.cloneChildNodes=function(A,e,t){for(var n=this,i=A.shadowRoot?A.shadowRoot.firstChild:A.firstChild;i;i=i.nextSibling)if(Ng(i)&&ep(i)&&"function"==typeof i.assignedNodes){var r=i.assignedNodes();r.length&&r.forEach((function(A){return n.appendChildNode(e,A,t)}))}else this.appendChildNode(e,i,t)},A.prototype.cloneNode=function(A,e){if(Mg(A))return document.createTextNode(A.data);if(!A.ownerDocument)return A.cloneNode(!1);var t=A.ownerDocument.defaultView;if(t&&Ng(A)&&(Kg(A)||_g(A))){var n=this.createElementClone(A);n.style.transitionProperty="none";var i=t.getComputedStyle(A),r=t.getComputedStyle(A,":before"),s=t.getComputedStyle(A,":after");this.referenceElement===A&&Kg(n)&&(this.clonedReferenceElement=n),Wg(n)&&Rp(n);var o=this.counters.parse(new Oh(this.context,i)),a=this.resolvePseudoContent(A,n,r,Xh.BEFORE);tp(A)&&(e=!0),Yg(A)||this.cloneChildNodes(A,n,e),a&&n.insertBefore(a,n.firstChild);var c=this.resolvePseudoContent(A,n,s,Xh.AFTER);return c&&n.appendChild(c),this.counters.pop(o),(i&&(this.options.copyStyles||_g(A))&&!$g(A)||e)&&Ep(i,n),0===A.scrollTop&&0===A.scrollLeft||this.scrolledElements.push([n,A.scrollLeft,A.scrollTop]),(zg(A)||Ap(A))&&(zg(n)||Ap(n))&&(n.value=A.value),n}return A.cloneNode(!1)},A.prototype.resolvePseudoContent=function(A,e,t,n){var i=this;if(t){var r=t.content,s=e.ownerDocument;if(s&&r&&"none"!==r&&"-moz-alt-content"!==r&&"none"!==t.display){this.counters.parse(new Oh(this.context,t));var o=new Lh(this.context,t),a=s.createElement("html2canvaspseudoelement");Ep(t,a),o.content.forEach((function(e){if(0===e.type)a.appendChild(s.createTextNode(e.value));else if(22===e.type){var t=s.createElement("img");t.src=e.value,t.style.opacity="1",a.appendChild(t)}else if(18===e.type){if("attr"===e.name){var n=e.values.filter(Pd);n.length&&a.appendChild(s.createTextNode(A.getAttribute(n[0].value)||""))}else if("counter"===e.name){var r=e.values.filter(xd),c=r[0],d=r[1];if(c&&Pd(c)){var l=i.counters.getCounterValue(c.value),u=d&&Pd(d)?Vu.parse(i.context,d.value):3;a.appendChild(s.createTextNode(fp(l,u,!1)))}}else if("counters"===e.name){var h=e.values.filter(xd),g=(c=h[0],h[1]);if(d=h[2],c&&Pd(c)){var p=i.counters.getCounterValues(c.value),m=d&&Pd(d)?Vu.parse(i.context,d.value):3,f=g&&0===g.type?g.value:"",B=p.map((function(A){return fp(A,m,!1)})).join(f);a.appendChild(s.createTextNode(B))}}}else if(20===e.type)switch(e.value){case"open-quote":a.appendChild(s.createTextNode(Th(o.quotes,i.quoteDepth++,!0)));break;case"close-quote":a.appendChild(s.createTextNode(Th(o.quotes,--i.quoteDepth,!1)));break;default:a.appendChild(s.createTextNode(e.value))}})),a.className="".concat(Ip," ").concat(Pp);var c=n===Xh.BEFORE?" ".concat(Ip):" ".concat(Pp);return _g(e)?e.className.baseValue+=c:e.className+=c,a}}},A.destroy=function(A){return!!A.parentNode&&(A.parentNode.removeChild(A),!0)},A}();(Yh=Xh||(Xh={}))[Yh.BEFORE=0]="BEFORE",Yh[Yh.AFTER=1]="AFTER";var vp,Cp,yp=function(A,e){var t=A.createElement("iframe");return t.className="html2canvas-container",t.style.visibility="hidden",t.style.position="fixed",t.style.left="-10000px",t.style.top="0px",t.style.border="0",t.width=e.width.toString(),t.height=e.height.toString(),t.scrolling="no",t.setAttribute(Bp,"true"),A.body.appendChild(t),t},bp=function(A){return new Promise((function(e){A.complete?e():A.src?(A.onload=e,A.onerror=e):e()}))},Qp=function(A){return Promise.all([].slice.call(A.images,0).map(bp))},Up=function(A){return new Promise((function(e,t){var n=A.contentWindow;if(!n)return t("No window assigned for iframe");var i=n.document;n.onload=A.onload=function(){n.onload=A.onload=null;var t=setInterval((function(){i.body.childNodes.length>0&&"complete"===i.readyState&&(clearInterval(t),e(A))}),50)}}))},kp=["all","d","content"],Ep=function(A,e){for(var t=A.length-1;t>=0;t--){var n=A.item(t);-1===kp.indexOf(n)&&e.style.setProperty(n,A.getPropertyValue(n))}return e},Fp=function(A){var e="";return A&&(e+="<!DOCTYPE ",A.name&&(e+=A.name),A.internalSubset&&(e+=A.internalSubset),A.publicId&&(e+='"'.concat(A.publicId,'"')),A.systemId&&(e+='"'.concat(A.systemId,'"')),e+=">"),e},Tp=function(A,e,t){A&&A.defaultView&&(e!==A.defaultView.pageXOffset||t!==A.defaultView.pageYOffset)&&A.defaultView.scrollTo(e,t)},Sp=function(A){var e=A[0],t=A[1],n=A[2];e.scrollLeft=t,e.scrollTop=n},Ip="___html2canvas___pseudoelement_before",Pp="___html2canvas___pseudoelement_after",Hp='{\n content: "" !important;\n display: none !important;\n}',Rp=function(A){Dp(A,".".concat(Ip).concat(":before").concat(Hp,"\n .").concat(Pp).concat(":after").concat(Hp))},Dp=function(A,e){var t=A.ownerDocument;if(t){var n=t.createElement("style");n.textContent=e,A.appendChild(n)}},xp=function(A,e){var t,n=e.createElement("base");n.href=e.baseURI;var i=A.getElementsByTagName("head").item(0);null==i||i.insertBefore(n,null!==(t=null==i?void 0:i.firstChild)&&void 0!==t?t:null)},Lp=function(){function A(){}return A.getOrigin=function(e){var t=A._link;return t?(t.href=e,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},A.isSameOrigin=function(e){return A.getOrigin(e)===A._origin},A.setContext=function(e){A._link=e.document.createElement("a"),A._origin=A.getOrigin(e.location.href)},A._origin="about:blank",A}(),Op=function(){function A(A,e){this.context=A,this._options=e,this._cache={}}return A.prototype.addImage=function(A){var e=Promise.resolve();return this.has(A)?e:jp(A)||_p(A)?((this._cache[A]=this.loadImage(A)).catch((function(){})),e):e},A.prototype.match=function(A){return this._cache[A]},A.prototype.loadImage=function(A){return Oa(this,void 0,void 0,(function(){var e,t,n,i,r,s=this;return Ma(this,(function(o){switch(o.label){case 0:return"function"!=typeof this._options.customIsSameOrigin?[3,2]:[4,this._options.customIsSameOrigin(A,Lp.isSameOrigin)];case 1:return t=o.sent(),[3,3];case 2:t=Lp.isSameOrigin(A),o.label=3;case 3:return e=t,n=!Vp(A)&&!0===this._options.useCORS&&cg.SUPPORT_CORS_IMAGES&&!e,i=!Vp(A)&&!e&&!jp(A)&&"string"==typeof this._options.proxy&&cg.SUPPORT_CORS_XHR&&!n,e||!1!==this._options.allowTaint||Vp(A)||jp(A)||i||n?(r=A,i?[4,this.proxy(r)]:[3,5]):[2];case 4:r=o.sent(),o.label=5;case 5:return this.context.logger.debug("Added image ".concat(A.substring(0,256))),[4,new Promise((function(A,e){var t=new Image;t.onload=function(){return A(t)},t.onerror=e,(Gp(r)||n)&&(t.crossOrigin="anonymous"),t.src=r,!0===t.complete&&setTimeout((function(){return A(t)}),500),s._options.imageTimeout>0&&setTimeout((function(){return e("Timed out (".concat(s._options.imageTimeout,"ms) loading image"))}),s._options.imageTimeout)}))];case 6:return[2,o.sent()]}}))}))},A.prototype.has=function(A){return void 0!==this._cache[A]},A.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},A.prototype.proxy=function(A){var e=this,t=this._options.proxy;if(!t)throw new Error("No proxy defined");var n=A.substring(0,256);return new Promise((function(i,r){var s=cg.SUPPORT_RESPONSE_TYPE?"blob":"text",o=new XMLHttpRequest;o.onload=function(){if(200===o.status)if("text"===s)i(o.response);else{var A=new FileReader;A.addEventListener("load",(function(){return i(A.result)}),!1),A.addEventListener("error",(function(A){return r(A)}),!1),A.readAsDataURL(o.response)}else r("Failed to proxy resource ".concat(n," with status code ").concat(o.status))},o.onerror=r;var a=t.indexOf("?")>-1?"&":"?";if(o.open("GET","".concat(t).concat(a,"url=").concat(encodeURIComponent(A),"&responseType=").concat(s)),"text"!==s&&o instanceof XMLHttpRequest&&(o.responseType=s),e._options.imageTimeout){var c=e._options.imageTimeout;o.timeout=c,o.ontimeout=function(){return r("Timed out (".concat(c,"ms) proxying ").concat(n))}}o.send()}))},A}(),Mp=/^data:image\/svg\+xml/i,Np=/^data:image\/.*;base64,/i,Kp=/^data:image\/.*/i,_p=function(A){return cg.SUPPORT_SVG_DRAWING||!Jp(A)},Vp=function(A){return Kp.test(A)},Gp=function(A){return Np.test(A)},jp=function(A){return"blob"===A.substr(0,4)},Jp=function(A){return"svg"===A.substr(-3).toLowerCase()||Mp.test(A)},Wp=function(){function A(A,e){this.type=0,this.x=A,this.y=e}return A.prototype.add=function(e,t){return new A(this.x+e,this.y+t)},A}(),Xp=function(A,e,t){return new Wp(A.x+(e.x-A.x)*t,A.y+(e.y-A.y)*t)},Yp=function(){function A(A,e,t,n){this.type=1,this.start=A,this.startControl=e,this.endControl=t,this.end=n}return A.prototype.subdivide=function(e,t){var n=Xp(this.start,this.startControl,e),i=Xp(this.startControl,this.endControl,e),r=Xp(this.endControl,this.end,e),s=Xp(n,i,e),o=Xp(i,r,e),a=Xp(s,o,e);return t?new A(this.start,n,s,a):new A(a,o,r,this.end)},A.prototype.add=function(e,t){return new A(this.start.add(e,t),this.startControl.add(e,t),this.endControl.add(e,t),this.end.add(e,t))},A.prototype.reverse=function(){return new A(this.end,this.endControl,this.startControl,this.start)},A}(),qp=function(A){return 1===A.type},$p=function(A){var e=A.styles,t=A.bounds,n=jd(e.borderTopLeftRadius,t.width,t.height),i=n[0],r=n[1],s=jd(e.borderTopRightRadius,t.width,t.height),o=s[0],a=s[1],c=jd(e.borderBottomRightRadius,t.width,t.height),d=c[0],l=c[1],u=jd(e.borderBottomLeftRadius,t.width,t.height),h=u[0],g=u[1],p=[];p.push((i+o)/t.width),p.push((h+d)/t.width),p.push((r+g)/t.height),p.push((a+l)/t.height);var m=Math.max.apply(Math,p);m>1&&(i/=m,r/=m,o/=m,a/=m,d/=m,l/=m,h/=m,g/=m);var f=t.width-o,B=t.height-l,w=t.width-d,v=t.height-g,C=e.borderTopWidth,y=e.borderRightWidth,b=e.borderBottomWidth,Q=e.borderLeftWidth,U=Jd(e.paddingTop,A.bounds.width),k=Jd(e.paddingRight,A.bounds.width),E=Jd(e.paddingBottom,A.bounds.width),F=Jd(e.paddingLeft,A.bounds.width);this.topLeftBorderDoubleOuterBox=i>0||r>0?Zp(t.left+Q/3,t.top+C/3,i-Q/3,r-C/3,vp.TOP_LEFT):new Wp(t.left+Q/3,t.top+C/3),this.topRightBorderDoubleOuterBox=i>0||r>0?Zp(t.left+f,t.top+C/3,o-y/3,a-C/3,vp.TOP_RIGHT):new Wp(t.left+t.width-y/3,t.top+C/3),this.bottomRightBorderDoubleOuterBox=d>0||l>0?Zp(t.left+w,t.top+B,d-y/3,l-b/3,vp.BOTTOM_RIGHT):new Wp(t.left+t.width-y/3,t.top+t.height-b/3),this.bottomLeftBorderDoubleOuterBox=h>0||g>0?Zp(t.left+Q/3,t.top+v,h-Q/3,g-b/3,vp.BOTTOM_LEFT):new Wp(t.left+Q/3,t.top+t.height-b/3),this.topLeftBorderDoubleInnerBox=i>0||r>0?Zp(t.left+2*Q/3,t.top+2*C/3,i-2*Q/3,r-2*C/3,vp.TOP_LEFT):new Wp(t.left+2*Q/3,t.top+2*C/3),this.topRightBorderDoubleInnerBox=i>0||r>0?Zp(t.left+f,t.top+2*C/3,o-2*y/3,a-2*C/3,vp.TOP_RIGHT):new Wp(t.left+t.width-2*y/3,t.top+2*C/3),this.bottomRightBorderDoubleInnerBox=d>0||l>0?Zp(t.left+w,t.top+B,d-2*y/3,l-2*b/3,vp.BOTTOM_RIGHT):new Wp(t.left+t.width-2*y/3,t.top+t.height-2*b/3),this.bottomLeftBorderDoubleInnerBox=h>0||g>0?Zp(t.left+2*Q/3,t.top+v,h-2*Q/3,g-2*b/3,vp.BOTTOM_LEFT):new Wp(t.left+2*Q/3,t.top+t.height-2*b/3),this.topLeftBorderStroke=i>0||r>0?Zp(t.left+Q/2,t.top+C/2,i-Q/2,r-C/2,vp.TOP_LEFT):new Wp(t.left+Q/2,t.top+C/2),this.topRightBorderStroke=i>0||r>0?Zp(t.left+f,t.top+C/2,o-y/2,a-C/2,vp.TOP_RIGHT):new Wp(t.left+t.width-y/2,t.top+C/2),this.bottomRightBorderStroke=d>0||l>0?Zp(t.left+w,t.top+B,d-y/2,l-b/2,vp.BOTTOM_RIGHT):new Wp(t.left+t.width-y/2,t.top+t.height-b/2),this.bottomLeftBorderStroke=h>0||g>0?Zp(t.left+Q/2,t.top+v,h-Q/2,g-b/2,vp.BOTTOM_LEFT):new Wp(t.left+Q/2,t.top+t.height-b/2),this.topLeftBorderBox=i>0||r>0?Zp(t.left,t.top,i,r,vp.TOP_LEFT):new Wp(t.left,t.top),this.topRightBorderBox=o>0||a>0?Zp(t.left+f,t.top,o,a,vp.TOP_RIGHT):new Wp(t.left+t.width,t.top),this.bottomRightBorderBox=d>0||l>0?Zp(t.left+w,t.top+B,d,l,vp.BOTTOM_RIGHT):new Wp(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=h>0||g>0?Zp(t.left,t.top+v,h,g,vp.BOTTOM_LEFT):new Wp(t.left,t.top+t.height),this.topLeftPaddingBox=i>0||r>0?Zp(t.left+Q,t.top+C,Math.max(0,i-Q),Math.max(0,r-C),vp.TOP_LEFT):new Wp(t.left+Q,t.top+C),this.topRightPaddingBox=o>0||a>0?Zp(t.left+Math.min(f,t.width-y),t.top+C,f>t.width+y?0:Math.max(0,o-y),Math.max(0,a-C),vp.TOP_RIGHT):new Wp(t.left+t.width-y,t.top+C),this.bottomRightPaddingBox=d>0||l>0?Zp(t.left+Math.min(w,t.width-Q),t.top+Math.min(B,t.height-b),Math.max(0,d-y),Math.max(0,l-b),vp.BOTTOM_RIGHT):new Wp(t.left+t.width-y,t.top+t.height-b),this.bottomLeftPaddingBox=h>0||g>0?Zp(t.left+Q,t.top+Math.min(v,t.height-b),Math.max(0,h-Q),Math.max(0,g-b),vp.BOTTOM_LEFT):new Wp(t.left+Q,t.top+t.height-b),this.topLeftContentBox=i>0||r>0?Zp(t.left+Q+F,t.top+C+U,Math.max(0,i-(Q+F)),Math.max(0,r-(C+U)),vp.TOP_LEFT):new Wp(t.left+Q+F,t.top+C+U),this.topRightContentBox=o>0||a>0?Zp(t.left+Math.min(f,t.width+Q+F),t.top+C+U,f>t.width+Q+F?0:o-Q+F,a-(C+U),vp.TOP_RIGHT):new Wp(t.left+t.width-(y+k),t.top+C+U),this.bottomRightContentBox=d>0||l>0?Zp(t.left+Math.min(w,t.width-(Q+F)),t.top+Math.min(B,t.height+C+U),Math.max(0,d-(y+k)),l-(b+E),vp.BOTTOM_RIGHT):new Wp(t.left+t.width-(y+k),t.top+t.height-(b+E)),this.bottomLeftContentBox=h>0||g>0?Zp(t.left+Q+F,t.top+v,Math.max(0,h-(Q+F)),g-(b+E),vp.BOTTOM_LEFT):new Wp(t.left+Q+F,t.top+t.height-(b+E))};(Cp=vp||(vp={}))[Cp.TOP_LEFT=0]="TOP_LEFT",Cp[Cp.TOP_RIGHT=1]="TOP_RIGHT",Cp[Cp.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",Cp[Cp.BOTTOM_LEFT=3]="BOTTOM_LEFT";var Zp=function(A,e,t,n,i){var r=(Math.sqrt(2)-1)/3*4,s=t*r,o=n*r,a=A+t,c=e+n;switch(i){case vp.TOP_LEFT:return new Yp(new Wp(A,c),new Wp(A,c-o),new Wp(a-s,e),new Wp(a,e));case vp.TOP_RIGHT:return new Yp(new Wp(A,e),new Wp(A+s,e),new Wp(a,c-o),new Wp(a,c));case vp.BOTTOM_RIGHT:return new Yp(new Wp(a,e),new Wp(a,e+o),new Wp(A+s,c),new Wp(A,c));case vp.BOTTOM_LEFT:default:return new Yp(new Wp(a,c),new Wp(a-s,c),new Wp(A,e+o),new Wp(A,e))}},zp=function(A){return[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox]},Am=function(A){return[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox]},em=function(A,e,t){this.offsetX=A,this.offsetY=e,this.matrix=t,this.type=0,this.target=6},tm=function(A,e){this.path=A,this.target=e,this.type=1},nm=function(A){this.opacity=A,this.type=2,this.target=6},im=function(A){return 1===A.type},rm=function(A,e){return A.length===e.length&&A.some((function(A,t){return A===e[t]}))},sm=function(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},om=function(){function A(A,e){if(this.container=A,this.parent=e,this.effects=[],this.curves=new $p(this.container),this.container.styles.opacity<1&&this.effects.push(new nm(this.container.styles.opacity)),null!==this.container.styles.transform){var t=this.container.bounds.left+this.container.styles.transformOrigin[0].number,n=this.container.bounds.top+this.container.styles.transformOrigin[1].number,i=this.container.styles.transform;this.effects.push(new em(t,n,i))}if(0!==this.container.styles.overflowX){var r=zp(this.curves),s=Am(this.curves);rm(r,s)?this.effects.push(new tm(r,6)):(this.effects.push(new tm(r,2)),this.effects.push(new tm(s,4)))}}return A.prototype.getEffects=function(A){for(var e=-1===[2,3].indexOf(this.container.styles.position),t=this.parent,n=this.effects.slice(0);t;){var i=t.effects.filter((function(A){return!im(A)}));if(e||0!==t.container.styles.position||!t.parent){if(e=-1===[2,3].indexOf(t.container.styles.position),0!==t.container.styles.overflowX){var r=zp(t.curves),s=Am(t.curves);rm(r,s)||n.unshift(new tm(s,6))}n.unshift.apply(n,i)}else n.unshift.apply(n,i);t=t.parent}return n.filter((function(e){return bh(e.target,A)}))},A}(),am=function(A,e,t,n){A.container.elements.forEach((function(i){var r=bh(i.flags,4),s=bh(i.flags,2),o=new om(i,A);bh(i.styles.display,2048)&&n.push(o);var a=bh(i.flags,8)?[]:n;if(r||s){var c=r||i.styles.isPositioned()?t:e,d=new sm(o);if(i.styles.isPositioned()||i.styles.opacity<1||i.styles.isTransformed()){var l=i.styles.zIndex.order;if(l<0){var u=0;c.negativeZIndex.some((function(A,e){return l>A.element.container.styles.zIndex.order?(u=e,!1):u>0})),c.negativeZIndex.splice(u,0,d)}else if(l>0){var h=0;c.positiveZIndex.some((function(A,e){return l>=A.element.container.styles.zIndex.order?(h=e+1,!1):h>0})),c.positiveZIndex.splice(h,0,d)}else c.zeroOrAutoZIndexOrTransformedOrOpacity.push(d)}else i.styles.isFloating()?c.nonPositionedFloats.push(d):c.nonPositionedInlineLevel.push(d);am(o,d,r?d:t,a)}else i.styles.isInlineLevel()?e.inlineLevel.push(o):e.nonInlineLevel.push(o),am(o,e,t,a);bh(i.flags,8)&&cm(i,a)}))},cm=function(A,e){for(var t=A instanceof bg?A.start:1,n=A instanceof bg&&A.reversed,i=0;i<e.length;i++){var r=e[i];r.container instanceof yg&&"number"==typeof r.container.value&&0!==r.container.value&&(t=r.container.value),r.listValue=fp(t,r.container.styles.listStyleType,!0),t+=n?-1:1}},dm=function(A,e){switch(e){case 0:return um(A.topLeftBorderBox,A.topLeftPaddingBox,A.topRightBorderBox,A.topRightPaddingBox);case 1:return um(A.topRightBorderBox,A.topRightPaddingBox,A.bottomRightBorderBox,A.bottomRightPaddingBox);case 2:return um(A.bottomRightBorderBox,A.bottomRightPaddingBox,A.bottomLeftBorderBox,A.bottomLeftPaddingBox);default:return um(A.bottomLeftBorderBox,A.bottomLeftPaddingBox,A.topLeftBorderBox,A.topLeftPaddingBox)}},lm=function(A,e){var t=[];return qp(A)?t.push(A.subdivide(.5,!1)):t.push(A),qp(e)?t.push(e.subdivide(.5,!0)):t.push(e),t},um=function(A,e,t,n){var i=[];return qp(A)?i.push(A.subdivide(.5,!1)):i.push(A),qp(t)?i.push(t.subdivide(.5,!0)):i.push(t),qp(n)?i.push(n.subdivide(.5,!0).reverse()):i.push(n),qp(e)?i.push(e.subdivide(.5,!1).reverse()):i.push(e),i},hm=function(A){var e=A.bounds,t=A.styles;return e.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},gm=function(A){var e=A.styles,t=A.bounds,n=Jd(e.paddingLeft,t.width),i=Jd(e.paddingRight,t.width),r=Jd(e.paddingTop,t.width),s=Jd(e.paddingBottom,t.width);return t.add(n+e.borderLeftWidth,r+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+n+i),-(e.borderTopWidth+e.borderBottomWidth+r+s))},pm=function(A,e,t){var n,i,r=(i=A,0===(n=wm(A.styles.backgroundOrigin,e))?i.bounds:2===n?gm(i):hm(i)),s=function(A,e){return 0===A?e.bounds:2===A?gm(e):hm(e)}(wm(A.styles.backgroundClip,e),A),o=Bm(wm(A.styles.backgroundSize,e),t,r),a=o[0],c=o[1],d=jd(wm(A.styles.backgroundPosition,e),r.width-a,r.height-c);return[vm(wm(A.styles.backgroundRepeat,e),d,o,r,s),Math.round(r.left+d[0]),Math.round(r.top+d[1]),a=Math.max(1,a),c=Math.max(1,c)]},mm=function(A){return Pd(A)&&A.value===oc.AUTO},fm=function(A){return"number"==typeof A},Bm=function(A,e,t){var n=e[0],i=e[1],r=e[2],s=A[0],o=A[1];if(!s)return[0,0];if(Nd(s)&&o&&Nd(o))return[Jd(s,t.width),Jd(o,t.height)];var a=fm(r);if(Pd(s)&&(s.value===oc.CONTAIN||s.value===oc.COVER))return fm(r)?t.width/t.height<r!=(s.value===oc.COVER)?[t.width,t.width/r]:[t.height*r,t.height]:[t.width,t.height];var c=fm(n),d=fm(i),l=c||d;if(mm(s)&&(!o||mm(o)))return c&&d?[n,i]:a||l?l&&a?[c?n:i*r,d?i:n/r]:[c?n:t.width,d?i:t.height]:[t.width,t.height];if(a){var u=0,h=0;return Nd(s)?u=Jd(s,t.width):Nd(o)&&(h=Jd(o,t.height)),mm(s)?u=h*r:o&&!mm(o)||(h=u/r),[u,h]}var g=null,p=null;if(Nd(s)?g=Jd(s,t.width):o&&Nd(o)&&(p=Jd(o,t.height)),null===g||o&&!mm(o)||(p=c&&d?g/n*i:t.height),null!==p&&mm(s)&&(g=c&&d?p/i*n:t.width),null!==g&&null!==p)return[g,p];throw new Error("Unable to calculate background-size for element")},wm=function(A,e){var t=A[e];return void 0===t?A[0]:t},vm=function(A,e,t,n,i){var r=e[0],s=e[1],o=t[0],a=t[1];switch(A){case 2:return[new Wp(Math.round(n.left),Math.round(n.top+s)),new Wp(Math.round(n.left+n.width),Math.round(n.top+s)),new Wp(Math.round(n.left+n.width),Math.round(a+n.top+s)),new Wp(Math.round(n.left),Math.round(a+n.top+s))];case 3:return[new Wp(Math.round(n.left+r),Math.round(n.top)),new Wp(Math.round(n.left+r+o),Math.round(n.top)),new Wp(Math.round(n.left+r+o),Math.round(n.height+n.top)),new Wp(Math.round(n.left+r),Math.round(n.height+n.top))];case 1:return[new Wp(Math.round(n.left+r),Math.round(n.top+s)),new Wp(Math.round(n.left+r+o),Math.round(n.top+s)),new Wp(Math.round(n.left+r+o),Math.round(n.top+s+a)),new Wp(Math.round(n.left+r),Math.round(n.top+s+a))];default:return[new Wp(Math.round(i.left),Math.round(i.top)),new Wp(Math.round(i.left+i.width),Math.round(i.top)),new Wp(Math.round(i.left+i.width),Math.round(i.height+i.top)),new Wp(Math.round(i.left),Math.round(i.height+i.top))]}},Cm="Hidden Text",ym=function(){function A(A){this._data={},this._document=A}return A.prototype.parseMetrics=function(A,e){var t=this._document.createElement("div"),n=this._document.createElement("img"),i=this._document.createElement("span"),r=this._document.body;t.style.visibility="hidden",t.style.fontFamily=A,t.style.fontSize=e,t.style.margin="0",t.style.padding="0",t.style.whiteSpace="nowrap",r.appendChild(t),n.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",n.width=1,n.height=1,n.style.margin="0",n.style.padding="0",n.style.verticalAlign="baseline",i.style.fontFamily=A,i.style.fontSize=e,i.style.margin="0",i.style.padding="0",i.appendChild(this._document.createTextNode(Cm)),t.appendChild(i),t.appendChild(n);var s=n.offsetTop-i.offsetTop+2;t.removeChild(i),t.appendChild(this._document.createTextNode(Cm)),t.style.lineHeight="normal",n.style.verticalAlign="super";var o=n.offsetTop-t.offsetTop+2;return r.removeChild(t),{baseline:s,middle:o}},A.prototype.getMetrics=function(A,e){var t="".concat(A," ").concat(e);return void 0===this._data[t]&&(this._data[t]=this.parseMetrics(A,e)),this._data[t]},A}(),bm=function(A,e){this.context=A,this.options=e},Qm=function(A){function e(e,t){var n=A.call(this,e,t)||this;return n._activeEffects=[],n.canvas=t.canvas?t.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),t.canvas||(n.canvas.width=Math.floor(t.width*t.scale),n.canvas.height=Math.floor(t.height*t.scale),n.canvas.style.width="".concat(t.width,"px"),n.canvas.style.height="".concat(t.height,"px")),n.fontMetrics=new ym(document),n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-t.x,-t.y),n.ctx.textBaseline="bottom",n._activeEffects=[],n.context.logger.debug("Canvas renderer initialized (".concat(t.width,"x").concat(t.height,") with scale ").concat(t.scale)),n}return xa(e,A),e.prototype.applyEffects=function(A){for(var e=this;this._activeEffects.length;)this.popEffect();A.forEach((function(A){return e.applyEffect(A)}))},e.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)),im(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 Oa(this,void 0,void 0,(function(){return Ma(this,(function(e){switch(e.label){case 0:return A.element.container.styles.isVisible()?[4,this.renderStackContent(A)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e.prototype.renderNode=function(A){return Oa(this,void 0,void 0,(function(){return Ma(this,(function(e){switch(e.label){case 0:return bh(A.container.flags,16),A.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(A)]:[3,3];case 1:return e.sent(),[4,this.renderNodeContent(A)];case 2:e.sent(),e.label=3;case 3:return[2]}}))}))},e.prototype.renderTextWithLetterSpacing=function(A,e,t){var n=this;0===e?-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+t):ug(A.text).reduce((function(e,i){return n.ctx.fillText(i,e,A.bounds.top+t),e+n.ctx.measureText(i).width}),A.bounds.left)},e.prototype.createFontStyle=function(A){var e=A.fontVariant.filter((function(A){return"normal"===A||"small-caps"===A})).join(""),t=Tm(A.fontFamily).join(", "),n=Sd(A.fontSize)?"".concat(A.fontSize.number).concat(A.fontSize.unit):"".concat(A.fontSize.number,"px");return[[A.fontStyle,e,A.fontWeight,n,t].join(" "),t,n]},e.prototype.renderTextNode=function(A,e){return Oa(this,void 0,void 0,(function(){var t,n,i=this;return Ma(this,(function(r){return t=this.createFontStyle(e)[0],this.ctx.font=t,this.ctx.direction=1===e.direction?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",n=e.paintOrder,A.textBounds.forEach((function(A){n.forEach((function(t){switch(t){case 0:i.ctx.fillStyle=Al(e.color),i.renderTextWithLetterSpacing(A,e.letterSpacing,e.fontSize.number);var n=e.textShadow;n.length&&A.text.trim().length&&(n.slice(0).reverse().forEach((function(t){i.ctx.shadowColor=Al(t.color),i.ctx.shadowOffsetX=t.offsetX.number*i.options.scale,i.ctx.shadowOffsetY=t.offsetY.number*i.options.scale,i.ctx.shadowBlur=t.blur.number,i.renderTextWithLetterSpacing(A,e.letterSpacing,e.fontSize.number)})),i.ctx.shadowColor="",i.ctx.shadowOffsetX=0,i.ctx.shadowOffsetY=0,i.ctx.shadowBlur=0),e.textDecorationLine.length&&(i.ctx.fillStyle=Al(e.textDecorationColor||e.color),e.textDecorationLine.forEach((function(e){switch(e){case 1:i.ctx.fillRect(A.bounds.left,A.bounds.top+A.bounds.height-1,A.bounds.width,1);break;case 2:i.ctx.fillRect(A.bounds.left,A.bounds.top,A.bounds.width,1);break;case 3:i.ctx.fillRect(A.bounds.left,A.bounds.top+(A.bounds.height/2-.5),A.bounds.width,1)}})));break;case 1:e.webkitTextStrokeWidth&&A.text.trim().length&&(i.ctx.strokeStyle=Al(e.webkitTextStrokeColor),i.ctx.lineWidth=e.webkitTextStrokeWidth,i.ctx.lineJoin=window.chrome?"miter":"round",i.ctx.strokeText(A.text,A.bounds.left,A.bounds.top+A.bounds.height)),i.ctx.strokeStyle="",i.ctx.lineWidth=0,i.ctx.lineJoin="miter"}}))})),[2]}))}))},e.prototype.renderReplacedElement=function(A,e,t){var n=t.naturalWidth||A.intrinsicWidth,i=t.naturalHeight||A.intrinsicHeight;if(t&&n>0&&i>0){var r=gm(A),s=Am(e);this.path(s),this.ctx.save(),this.ctx.clip();var o=0,a=0,c=n,d=i,l=r.left,u=r.top,h=r.width,g=r.height,p=A.styles.objectFit,m=h/g,f=c/d;2===p?f>m?(g=h/f,u+=(r.height-g)/2):(h=g*f,l+=(r.width-h)/2):4===p?f>m?o+=(n-(c=d*m))/2:a+=(i-(d=c/m))/2:8===p?(c>h?(o+=(c-h)/2,c=h):(l+=(h-c)/2,h=c),d>g?(a+=(d-g)/2,d=g):(u+=(g-d)/2,g=d)):16===p&&((f>m?h:g*f)<(c>h?c:h)?f>m?(g=h/f,u+=(r.height-g)/2):(h=g*f,l+=(r.width-h)/2):(c>h?(o+=(c-h)/2,c=h):(l+=(h-c)/2,h=c),d>g?(a+=(d-g)/2,d=g):(u+=(g-d)/2,g=d))),this.ctx.drawImage(t,o,a,c,d,l,u,h,g),this.ctx.restore()}},e.prototype.renderNodeContent=function(A){return Oa(this,void 0,void 0,(function(){var t,n,i,r,s,o,a,c,d,l,u,h,g,p,m,f,B,w,v;return Ma(this,(function(C){switch(C.label){case 0:this.applyEffects(A.getEffects(4)),t=A.container,n=A.curves,i=t.styles,r=0,s=t.textNodes,C.label=1;case 1:return r<s.length?(o=s[r],[4,this.renderTextNode(o,i)]):[3,4];case 2:C.sent(),C.label=3;case 3:return r++,[3,1];case 4:if(!(t instanceof wg))return[3,8];C.label=5;case 5:return C.trys.push([5,7,,8]),[4,this.context.cache.match(t.src)];case 6:return f=C.sent(),this.renderReplacedElement(t,n,f),[3,8];case 7:return C.sent(),this.context.logger.error("Error loading image ".concat(t.src)),[3,8];case 8:if(t instanceof vg&&this.renderReplacedElement(t,n,t.canvas),!(t instanceof Cg))return[3,12];C.label=9;case 9:return C.trys.push([9,11,,12]),[4,this.context.cache.match(t.svg)];case 10:return f=C.sent(),this.renderReplacedElement(t,n,f),[3,12];case 11:return C.sent(),this.context.logger.error("Error loading svg ".concat(t.svg.substring(0,255))),[3,12];case 12:return t instanceof Pg&&t.tree?[4,new e(this.context,{scale:this.options.scale,backgroundColor:t.backgroundColor,x:0,y:0,width:t.width,height:t.height}).render(t.tree)]:[3,14];case 13:a=C.sent(),t.width&&t.height&&this.ctx.drawImage(a,0,0,t.width,t.height,t.bounds.left,t.bounds.top,t.bounds.width,t.bounds.height),C.label=14;case 14:if(t instanceof Tg&&(c=Math.min(t.bounds.width,t.bounds.height),t.type===kg?t.checked&&(this.ctx.save(),this.path([new Wp(t.bounds.left+.39363*c,t.bounds.top+.79*c),new Wp(t.bounds.left+.16*c,t.bounds.top+.5549*c),new Wp(t.bounds.left+.27347*c,t.bounds.top+.44071*c),new Wp(t.bounds.left+.39694*c,t.bounds.top+.5649*c),new Wp(t.bounds.left+.72983*c,t.bounds.top+.23*c),new Wp(t.bounds.left+.84*c,t.bounds.top+.34085*c),new Wp(t.bounds.left+.39363*c,t.bounds.top+.79*c)]),this.ctx.fillStyle=Al(Fg),this.ctx.fill(),this.ctx.restore()):t.type===Eg&&t.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.bounds.left+c/2,t.bounds.top+c/2,c/4,0,2*Math.PI,!0),this.ctx.fillStyle=Al(Fg),this.ctx.fill(),this.ctx.restore())),Um(t)&&t.value.length){switch(d=this.createFontStyle(i),w=d[0],l=d[1],u=d[2],h=this.fontMetrics.getMetrics(l,u).baseline,this.ctx.font=w,this.ctx.fillStyle=Al(i.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=Em(t.styles.textAlign),v=gm(t),g=0,t.styles.textAlign){case 1:g+=v.width/2;break;case 2:g+=v.width}p=v.add(g,0,0,-v.height/2+1),this.ctx.save(),this.path([new Wp(v.left,v.top),new Wp(v.left+v.width,v.top),new Wp(v.left+v.width,v.top+v.height),new Wp(v.left,v.top+v.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new dg(t.value,p),i.letterSpacing,h),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!bh(t.styles.display,2048))return[3,20];if(null===t.styles.listStyleImage)return[3,19];if(0!==(m=t.styles.listStyleImage).type)return[3,18];f=void 0,B=m.url,C.label=15;case 15:return C.trys.push([15,17,,18]),[4,this.context.cache.match(B)];case 16:return f=C.sent(),this.ctx.drawImage(f,t.bounds.left-(f.width+10),t.bounds.top),[3,18];case 17:return C.sent(),this.context.logger.error("Error loading list-style-image ".concat(B)),[3,18];case 18:return[3,20];case 19:A.listValue&&-1!==t.styles.listStyleType&&(w=this.createFontStyle(i)[0],this.ctx.font=w,this.ctx.fillStyle=Al(i.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",v=new Ka(t.bounds.left,t.bounds.top+Jd(t.styles.paddingTop,t.bounds.width),t.bounds.width,Nu(i.lineHeight,i.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new dg(A.listValue,v),i.letterSpacing,Nu(i.lineHeight,i.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),C.label=20;case 20:return[2]}}))}))},e.prototype.renderStackContent=function(A){return Oa(this,void 0,void 0,(function(){var e,t,n,i,r,s,o,a,c,d,l,u,h,g,p;return Ma(this,(function(m){switch(m.label){case 0:return bh(A.element.container.flags,16),[4,this.renderNodeBackgroundAndBorders(A.element)];case 1:m.sent(),e=0,t=A.negativeZIndex,m.label=2;case 2:return e<t.length?(p=t[e],[4,this.renderStack(p)]):[3,5];case 3:m.sent(),m.label=4;case 4:return e++,[3,2];case 5:return[4,this.renderNodeContent(A.element)];case 6:m.sent(),n=0,i=A.nonInlineLevel,m.label=7;case 7:return n<i.length?(p=i[n],[4,this.renderNode(p)]):[3,10];case 8:m.sent(),m.label=9;case 9:return n++,[3,7];case 10:r=0,s=A.nonPositionedFloats,m.label=11;case 11:return r<s.length?(p=s[r],[4,this.renderStack(p)]):[3,14];case 12:m.sent(),m.label=13;case 13:return r++,[3,11];case 14:o=0,a=A.nonPositionedInlineLevel,m.label=15;case 15:return o<a.length?(p=a[o],[4,this.renderStack(p)]):[3,18];case 16:m.sent(),m.label=17;case 17:return o++,[3,15];case 18:c=0,d=A.inlineLevel,m.label=19;case 19:return c<d.length?(p=d[c],[4,this.renderNode(p)]):[3,22];case 20:m.sent(),m.label=21;case 21:return c++,[3,19];case 22:l=0,u=A.zeroOrAutoZIndexOrTransformedOrOpacity,m.label=23;case 23:return l<u.length?(p=u[l],[4,this.renderStack(p)]):[3,26];case 24:m.sent(),m.label=25;case 25:return l++,[3,23];case 26:h=0,g=A.positiveZIndex,m.label=27;case 27:return h<g.length?(p=g[h],[4,this.renderStack(p)]):[3,30];case 28:m.sent(),m.label=29;case 29:return h++,[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 e=this;A.forEach((function(A,t){var n=qp(A)?A.start:A;0===t?e.ctx.moveTo(n.x,n.y):e.ctx.lineTo(n.x,n.y),qp(A)&&e.ctx.bezierCurveTo(A.startControl.x,A.startControl.y,A.endControl.x,A.endControl.y,A.end.x,A.end.y)}))},e.prototype.renderRepeat=function(A,e,t,n){this.path(A),this.ctx.fillStyle=e,this.ctx.translate(t,n),this.ctx.fill(),this.ctx.translate(-t,-n)},e.prototype.resizeImage=function(A,e,t){var n,i=(null!==(n=this.canvas.ownerDocument)&&void 0!==n?n:document).createElement("canvas");return i.width=Math.max(1,e),i.height=Math.max(1,t),i.getContext("2d").drawImage(A,0,0,A.width,A.height,0,0,e,t),i},e.prototype.renderBackgroundImage=function(A){return Oa(this,void 0,void 0,(function(){var e,t,n,i,r,s;return Ma(this,(function(o){switch(o.label){case 0:e=A.styles.backgroundImage.length-1,t=function(t){var i,r,s,o,a,c,d,l,u,h,g,p,m,f,B,w,v,C,y,b,Q,U,k,E,F,T,S,I,P,H,R,D,x;return Ma(this,(function(L){switch(L.label){case 0:if(0!==t.type)return[3,5];i=void 0,r=t.url,L.label=1;case 1:return L.trys.push([1,3,,4]),[4,n.context.cache.match(r)];case 2:return i=L.sent(),[3,4];case 3:return L.sent(),n.context.logger.error("Error loading background-image ".concat(r)),[3,4];case 4:return i&&(s=isNaN(i.width)||0===i.width?1:i.width,o=isNaN(i.height)||0===i.height?1:i.height,a=pm(A,e,[s,o,s/o]),C=a[0],E=a[1],F=a[2],Q=a[3],U=a[4],w=n.ctx.createPattern(n.resizeImage(i,Q,U),"repeat"),n.renderRepeat(C,w,E,F)),[3,6];case 5:1===t.type?(c=pm(A,e,[null,null,null]),C=c[0],E=c[1],F=c[2],Q=c[3],U=c[4],d=function(A,e,t){var n="number"==typeof A?A:function(A,e,t){var n=e/2,i=t/2,r=Jd(A[0],e)-n,s=i-Jd(A[1],t);return(Math.atan2(s,r)+2*Math.PI)%(2*Math.PI)}(A,e,t),i=Math.abs(e*Math.sin(n))+Math.abs(t*Math.cos(n)),r=e/2,s=t/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]}(t.angle,Q,U),l=d[0],u=d[1],h=d[2],g=d[3],p=d[4],(m=document.createElement("canvas")).width=Q,m.height=U,f=m.getContext("2d"),B=f.createLinearGradient(u,g,h,p),Nl(t.stops,l||1).forEach((function(A){return B.addColorStop(A.stop,Al(A.color))})),f.fillStyle=B,f.fillRect(0,0,Q,U),Q>0&&U>0&&(w=n.ctx.createPattern(m,"repeat"),n.renderRepeat(C,w,E,F))):2===t.type&&(v=pm(A,e,[null,null,null]),C=v[0],y=v[1],b=v[2],Q=v[3],U=v[4],k=0===t.position.length?[Vd]:t.position,E=Jd(k[0],Q),F=Jd(k[k.length-1],U),T=function(A,e,t,n,i){var r=0,s=0;switch(A.size){case 0:0===A.shape?r=s=Math.min(Math.abs(e),Math.abs(e-n),Math.abs(t),Math.abs(t-i)):1===A.shape&&(r=Math.min(Math.abs(e),Math.abs(e-n)),s=Math.min(Math.abs(t),Math.abs(t-i)));break;case 2:if(0===A.shape)r=s=Math.min(Kl(e,t),Kl(e,t-i),Kl(e-n,t),Kl(e-n,t-i));else if(1===A.shape){var o=Math.min(Math.abs(t),Math.abs(t-i))/Math.min(Math.abs(e),Math.abs(e-n)),a=_l(n,i,e,t,!0),c=a[0],d=a[1];s=o*(r=Kl(c-e,(d-t)/o))}break;case 1:0===A.shape?r=s=Math.max(Math.abs(e),Math.abs(e-n),Math.abs(t),Math.abs(t-i)):1===A.shape&&(r=Math.max(Math.abs(e),Math.abs(e-n)),s=Math.max(Math.abs(t),Math.abs(t-i)));break;case 3:if(0===A.shape)r=s=Math.max(Kl(e,t),Kl(e,t-i),Kl(e-n,t),Kl(e-n,t-i));else if(1===A.shape){o=Math.max(Math.abs(t),Math.abs(t-i))/Math.max(Math.abs(e),Math.abs(e-n));var l=_l(n,i,e,t,!1);c=l[0],d=l[1],s=o*(r=Kl(c-e,(d-t)/o))}}return Array.isArray(A.size)&&(r=Jd(A.size[0],n),s=2===A.size.length?Jd(A.size[1],i):r),[r,s]}(t,E,F,Q,U),S=T[0],I=T[1],S>0&&I>0&&(P=n.ctx.createRadialGradient(y+E,b+F,0,y+E,b+F,S),Nl(t.stops,2*S).forEach((function(A){return P.addColorStop(A.stop,Al(A.color))})),n.path(C),n.ctx.fillStyle=P,S!==I?(H=A.bounds.left+.5*A.bounds.width,R=A.bounds.top+.5*A.bounds.height,x=1/(D=I/S),n.ctx.save(),n.ctx.translate(H,R),n.ctx.transform(1,0,0,D,0,0),n.ctx.translate(-H,-R),n.ctx.fillRect(y,x*(b-R)+R,Q,U*x),n.ctx.restore()):n.ctx.fill())),L.label=6;case 6:return e--,[2]}}))},n=this,i=0,r=A.styles.backgroundImage.slice(0).reverse(),o.label=1;case 1:return i<r.length?(s=r[i],[5,t(s)]):[3,4];case 2:o.sent(),o.label=3;case 3:return i++,[3,1];case 4:return[2]}}))}))},e.prototype.renderSolidBorder=function(A,e,t){return Oa(this,void 0,void 0,(function(){return Ma(this,(function(n){return this.path(dm(t,e)),this.ctx.fillStyle=Al(A),this.ctx.fill(),[2]}))}))},e.prototype.renderDoubleBorder=function(A,e,t,n){return Oa(this,void 0,void 0,(function(){var i,r;return Ma(this,(function(s){switch(s.label){case 0:return e<3?[4,this.renderSolidBorder(A,t,n)]:[3,2];case 1:return s.sent(),[2];case 2:return i=function(A,e){switch(e){case 0:return um(A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox,A.topRightBorderBox,A.topRightBorderDoubleOuterBox);case 1:return um(A.topRightBorderBox,A.topRightBorderDoubleOuterBox,A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox);case 2:return um(A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox,A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox);default:return um(A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox,A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox)}}(n,t),this.path(i),this.ctx.fillStyle=Al(A),this.ctx.fill(),r=function(A,e){switch(e){case 0:return um(A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox,A.topRightBorderDoubleInnerBox,A.topRightPaddingBox);case 1:return um(A.topRightBorderDoubleInnerBox,A.topRightPaddingBox,A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox);case 2:return um(A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox,A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox);default:return um(A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox,A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox)}}(n,t),this.path(r),this.ctx.fill(),[2]}}))}))},e.prototype.renderNodeBackgroundAndBorders=function(A){return Oa(this,void 0,void 0,(function(){var e,t,n,i,r,s,o,a,c=this;return Ma(this,(function(d){switch(d.label){case 0:return this.applyEffects(A.getEffects(2)),e=A.container.styles,t=!zd(e.backgroundColor)||e.backgroundImage.length,n=[{style:e.borderTopStyle,color:e.borderTopColor,width:e.borderTopWidth},{style:e.borderRightStyle,color:e.borderRightColor,width:e.borderRightWidth},{style:e.borderBottomStyle,color:e.borderBottomColor,width:e.borderBottomWidth},{style:e.borderLeftStyle,color:e.borderLeftColor,width:e.borderLeftWidth}],i=km(wm(e.backgroundClip,0),A.curves),t||e.boxShadow.length?(this.ctx.save(),this.path(i),this.ctx.clip(),zd(e.backgroundColor)||(this.ctx.fillStyle=Al(e.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(A.container)]):[3,2];case 1:d.sent(),this.ctx.restore(),e.boxShadow.slice(0).reverse().forEach((function(e){c.ctx.save();var t,n,i,r,s,o=zp(A.curves),a=e.inset?0:1e4,d=(t=o,n=-a+(e.inset?1:-1)*e.spread.number,i=(e.inset?1:-1)*e.spread.number,r=e.spread.number*(e.inset?-2:2),s=e.spread.number*(e.inset?-2:2),t.map((function(A,e){switch(e){case 0:return A.add(n,i);case 1:return A.add(n+r,i);case 2:return A.add(n+r,i+s);case 3:return A.add(n,i+s)}return A})));e.inset?(c.path(o),c.ctx.clip(),c.mask(d)):(c.mask(o),c.ctx.clip(),c.path(d)),c.ctx.shadowOffsetX=e.offsetX.number+a,c.ctx.shadowOffsetY=e.offsetY.number,c.ctx.shadowColor=Al(e.color),c.ctx.shadowBlur=e.blur.number,c.ctx.fillStyle=e.inset?Al(e.color):"rgba(0,0,0,1)",c.ctx.fill(),c.ctx.restore()})),d.label=2;case 2:r=0,s=0,o=n,d.label=3;case 3:return s<o.length?0!==(a=o[s]).style&&!zd(a.color)&&a.width>0?2!==a.style?[3,5]:[4,this.renderDashedDottedBorder(a.color,a.width,r,A.curves,2)]:[3,11]:[3,13];case 4:return d.sent(),[3,11];case 5:return 3!==a.style?[3,7]:[4,this.renderDashedDottedBorder(a.color,a.width,r,A.curves,3)];case 6:return d.sent(),[3,11];case 7:return 4!==a.style?[3,9]:[4,this.renderDoubleBorder(a.color,a.width,r,A.curves)];case 8:return d.sent(),[3,11];case 9:return[4,this.renderSolidBorder(a.color,r,A.curves)];case 10:d.sent(),d.label=11;case 11:r++,d.label=12;case 12:return s++,[3,3];case 13:return[2]}}))}))},e.prototype.renderDashedDottedBorder=function(A,e,t,n,i){return Oa(this,void 0,void 0,(function(){var r,s,o,a,c,d,l,u,h,g,p,m,f,B,w,v;return Ma(this,(function(C){return this.ctx.save(),r=function(A,e){switch(e){case 0:return lm(A.topLeftBorderStroke,A.topRightBorderStroke);case 1:return lm(A.topRightBorderStroke,A.bottomRightBorderStroke);case 2:return lm(A.bottomRightBorderStroke,A.bottomLeftBorderStroke);default:return lm(A.bottomLeftBorderStroke,A.topLeftBorderStroke)}}(n,t),s=dm(n,t),2===i&&(this.path(s),this.ctx.clip()),qp(s[0])?(o=s[0].start.x,a=s[0].start.y):(o=s[0].x,a=s[0].y),qp(s[1])?(c=s[1].end.x,d=s[1].end.y):(c=s[1].x,d=s[1].y),l=0===t||2===t?Math.abs(o-c):Math.abs(a-d),this.ctx.beginPath(),3===i?this.formatPath(r):this.formatPath(s.slice(0,2)),u=e<3?3*e:2*e,h=e<3?2*e:e,3===i&&(u=e,h=e),g=!0,l<=2*u?g=!1:l<=2*u+h?(u*=p=l/(2*u+h),h*=p):(m=Math.floor((l+h)/(u+h)),f=(l-m*u)/(m-1),h=(B=(l-(m+1)*u)/m)<=0||Math.abs(h-f)<Math.abs(h-B)?f:B),g&&(3===i?this.ctx.setLineDash([0,u+h]):this.ctx.setLineDash([u,h])),3===i?(this.ctx.lineCap="round",this.ctx.lineWidth=e):this.ctx.lineWidth=2*e+1.1,this.ctx.strokeStyle=Al(A),this.ctx.stroke(),this.ctx.setLineDash([]),2===i&&(qp(s[0])&&(w=s[3],v=s[0],this.ctx.beginPath(),this.formatPath([new Wp(w.end.x,w.end.y),new Wp(v.start.x,v.start.y)]),this.ctx.stroke()),qp(s[1])&&(w=s[1],v=s[2],this.ctx.beginPath(),this.formatPath([new Wp(w.end.x,w.end.y),new Wp(v.start.x,v.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]}))}))},e.prototype.render=function(A){return Oa(this,void 0,void 0,(function(){var e;return Ma(this,(function(t){switch(t.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=Al(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),e=function(A){var e=new om(A,null),t=new sm(e),n=[];return am(e,t,t,n),cm(e.container,n),t}(A),[4,this.renderStack(e)];case 1:return t.sent(),this.applyEffects([]),[2,this.canvas]}}))}))},e}(bm),Um=function(A){return A instanceof Ig||A instanceof Sg||A instanceof Tg&&A.type!==Eg&&A.type!==kg},km=function(A,e){switch(A){case 0:return zp(e);case 2:return function(A){return[A.topLeftContentBox,A.topRightContentBox,A.bottomRightContentBox,A.bottomLeftContentBox]}(e);default:return Am(e)}},Em=function(A){switch(A){case 1:return"center";case 2:return"right";default:return"left"}},Fm=["-apple-system","system-ui"],Tm=function(A){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?A.filter((function(A){return-1===Fm.indexOf(A)})):A},Sm=function(A){function e(e,t){var n=A.call(this,e,t)||this;return n.canvas=t.canvas?t.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),n.options=t,n.canvas.width=Math.floor(t.width*t.scale),n.canvas.height=Math.floor(t.height*t.scale),n.canvas.style.width="".concat(t.width,"px"),n.canvas.style.height="".concat(t.height,"px"),n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-t.x,-t.y),n.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized (".concat(t.width,"x").concat(t.height," at ").concat(t.x,",").concat(t.y,") with scale ").concat(t.scale)),n}return xa(e,A),e.prototype.render=function(A){return Oa(this,void 0,void 0,(function(){var e,t;return Ma(this,(function(n){switch(n.label){case 0:return e=og(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,A),[4,Im(e)];case 1:return t=n.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=Al(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(t,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}}))}))},e}(bm),Im=function(A){return new Promise((function(e,t){var n=new Image;n.onload=function(){e(n)},n.onerror=t,n.src="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent((new XMLSerializer).serializeToString(A)))}))},Pm=function(){function A(A){var e=A.id,t=A.enabled;this.id=e,this.enabled=t,this.start=Date.now()}return A.prototype.debug=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.debug?console.debug.apply(console,Na([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=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&"undefined"!=typeof window&&window.console&&"function"==typeof console.info&&console.info.apply(console,Na([this.id,"".concat(this.getTime(),"ms")],A,!1))},A.prototype.warn=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.warn?console.warn.apply(console,Na([this.id,"".concat(this.getTime(),"ms")],A,!1)):this.info.apply(this,A))},A.prototype.error=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.error?console.error.apply(console,Na([this.id,"".concat(this.getTime(),"ms")],A,!1)):this.info.apply(this,A))},A.instances={},A}(),Hm=function(){function A(e,t){var n;this.windowBounds=t,this.instanceName="#".concat(A.instanceCount++),this.logger=new Pm({id:this.instanceName,enabled:e.logging}),this.cache=null!==(n=e.cache)&&void 0!==n?n:new Op(this,e)}return A.instanceCount=1,A}();"undefined"!=typeof window&&Lp.setContext(window);var Rm=function(A,e,t){var n=e.ownerDocument,i=n.documentElement?Dl(A,getComputedStyle(n.documentElement).backgroundColor):xl.TRANSPARENT,r=n.body?Dl(A,getComputedStyle(n.body).backgroundColor):xl.TRANSPARENT,s="string"==typeof t?Dl(A,t):null===t?xl.TRANSPARENT:4294967295;return e===n.documentElement?zd(i)?zd(r)?s:r:i:s};const Dm=globalThis,xm=Dm.ShadowRoot&&(void 0===Dm.ShadyCSS||Dm.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Lm=Symbol(),Om=new WeakMap;let Mm=class{constructor(A,e,t){if(this._$cssResult$=!0,t!==Lm)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=A,this.t=e}get styleSheet(){let A=this.o;const e=this.t;if(xm&&void 0===A){const t=void 0!==e&&1===e.length;t&&(A=Om.get(e)),void 0===A&&((this.o=A=new CSSStyleSheet).replaceSync(this.cssText),t&&Om.set(e,A))}return A}toString(){return this.cssText}};const Nm=(A,...e)=>{const t=1===A.length?A[0]:e.reduce(((e,t,n)=>e+(A=>{if(!0===A._$cssResult$)return A.cssText;if("number"==typeof A)return A;throw Error("Value passed to 'css' function must be a 'css' function result: "+A+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(t)+A[n+1]),A[0]);return new Mm(t,A,Lm)},Km=xm?A=>A:A=>A instanceof CSSStyleSheet?(A=>{let e="";for(const t of A.cssRules)e+=t.cssText;return(A=>new Mm("string"==typeof A?A:A+"",void 0,Lm))(e)})(A):A,{is:_m,defineProperty:Vm,getOwnPropertyDescriptor:Gm,getOwnPropertyNames:jm,getOwnPropertySymbols:Jm,getPrototypeOf:Wm}=Object,Xm=globalThis,Ym=Xm.trustedTypes,qm=Ym?Ym.emptyScript:"",$m=Xm.reactiveElementPolyfillSupport,Zm=(A,e)=>A,zm={toAttribute(A,e){switch(e){case Boolean:A=A?qm:null;break;case Object:case Array:A=null==A?A:JSON.stringify(A)}return A},fromAttribute(A,e){let t=A;switch(e){case Boolean:t=null!==A;break;case Number:t=null===A?null:Number(A);break;case Object:case Array:try{t=JSON.parse(A)}catch(n){t=null}}return t}},Af=(A,e)=>!_m(A,e),ef={attribute:!0,type:String,converter:zm,reflect:!1,useDefault:!1,hasChanged:Af};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Xm.litPropertyMetadata??(Xm.litPropertyMetadata=new WeakMap);let tf=class extends HTMLElement{static addInitializer(A){this._$Ei(),(this.l??(this.l=[])).push(A)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(A,e=ef){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(A)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(A,e),!e.noAccessor){const t=Symbol(),n=this.getPropertyDescriptor(A,t,e);void 0!==n&&Vm(this.prototype,A,n)}}static getPropertyDescriptor(A,e,t){const{get:n,set:i}=Gm(this.prototype,A)??{get(){return this[e]},set(A){this[e]=A}};return{get:n,set(e){const r=n?.call(this);i?.call(this,e),this.requestUpdate(A,r,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(A){return this.elementProperties.get(A)??ef}static _$Ei(){if(this.hasOwnProperty(Zm("elementProperties")))return;const A=Wm(this);A.finalize(),void 0!==A.l&&(this.l=[...A.l]),this.elementProperties=new Map(A.elementProperties)}static finalize(){if(this.hasOwnProperty(Zm("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Zm("properties"))){const A=this.properties,e=[...jm(A),...Jm(A)];for(const t of e)this.createProperty(t,A[t])}const A=this[Symbol.metadata];if(null!==A){const e=litPropertyMetadata.get(A);if(void 0!==e)for(const[A,t]of e)this.elementProperties.set(A,t)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const A=this._$Eu(e,t);void 0!==A&&this._$Eh.set(A,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(A){const e=[];if(Array.isArray(A)){const t=new Set(A.flat(1/0).reverse());for(const A of t)e.unshift(Km(A))}else void 0!==A&&e.push(Km(A));return e}static _$Eu(A,e){const t=e.attribute;return!1===t?void 0:"string"==typeof t?t:"string"==typeof A?A.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((A=>this.enableUpdating=A)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((A=>A(this)))}addController(A){(this._$EO??(this._$EO=new Set)).add(A),void 0!==this.renderRoot&&this.isConnected&&A.hostConnected?.()}removeController(A){this._$EO?.delete(A)}_$E_(){const A=new Map,e=this.constructor.elementProperties;for(const t of e.keys())this.hasOwnProperty(t)&&(A.set(t,this[t]),delete this[t]);A.size>0&&(this._$Ep=A)}createRenderRoot(){const A=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((A,e)=>{if(xm)A.adoptedStyleSheets=e.map((A=>A instanceof CSSStyleSheet?A:A.styleSheet));else for(const t of e){const e=document.createElement("style"),n=Dm.litNonce;void 0!==n&&e.setAttribute("nonce",n),e.textContent=t.cssText,A.appendChild(e)}})(A,this.constructor.elementStyles),A}connectedCallback(){this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),this._$EO?.forEach((A=>A.hostConnected?.()))}enableUpdating(A){}disconnectedCallback(){this._$EO?.forEach((A=>A.hostDisconnected?.()))}attributeChangedCallback(A,e,t){this._$AK(A,t)}_$ET(A,e){const t=this.constructor.elementProperties.get(A),n=this.constructor._$Eu(A,t);if(void 0!==n&&!0===t.reflect){const i=(void 0!==t.converter?.toAttribute?t.converter:zm).toAttribute(e,t.type);this._$Em=A,null==i?this.removeAttribute(n):this.setAttribute(n,i),this._$Em=null}}_$AK(A,e){const t=this.constructor,n=t._$Eh.get(A);if(void 0!==n&&this._$Em!==n){const A=t.getPropertyOptions(n),i="function"==typeof A.converter?{fromAttribute:A.converter}:void 0!==A.converter?.fromAttribute?A.converter:zm;this._$Em=n,this[n]=i.fromAttribute(e,A.type)??this._$Ej?.get(n)??null,this._$Em=null}}requestUpdate(A,e,t){if(void 0!==A){const n=this.constructor,i=this[A];if(t??(t=n.getPropertyOptions(A)),!((t.hasChanged??Af)(i,e)||t.useDefault&&t.reflect&&i===this._$Ej?.get(A)&&!this.hasAttribute(n._$Eu(A,t))))return;this.C(A,e,t)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(A,e,{useDefault:t,reflect:n,wrapped:i},r){t&&!(this._$Ej??(this._$Ej=new Map)).has(A)&&(this._$Ej.set(A,r??e??this[A]),!0!==i||void 0!==r)||(this._$AL.has(A)||(this.hasUpdated||t||(e=void 0),this._$AL.set(A,e)),!0===n&&this._$Em!==A&&(this._$Eq??(this._$Eq=new Set)).add(A))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}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._$Ep){for(const[A,e]of this._$Ep)this[A]=e;this._$Ep=void 0}const A=this.constructor.elementProperties;if(A.size>0)for(const[e,t]of A){const{wrapped:A}=t,n=this[e];!0!==A||this._$AL.has(e)||void 0===n||this.C(e,void 0,t,n)}}let A=!1;const e=this._$AL;try{A=this.shouldUpdate(e),A?(this.willUpdate(e),this._$EO?.forEach((A=>A.hostUpdate?.())),this.update(e)):this._$EM()}catch(t){throw A=!1,this._$EM(),t}A&&this._$AE(e)}willUpdate(A){}_$AE(A){this._$EO?.forEach((A=>A.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(A)),this.updated(A)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(A){return!0}update(A){this._$Eq&&(this._$Eq=this._$Eq.forEach((A=>this._$ET(A,this[A])))),this._$EM()}updated(A){}firstUpdated(A){}};tf.elementStyles=[],tf.shadowRootOptions={mode:"open"},tf[Zm("elementProperties")]=new Map,tf[Zm("finalized")]=new Map,$m?.({ReactiveElement:tf}),(Xm.reactiveElementVersions??(Xm.reactiveElementVersions=[])).push("2.1.0");const nf=globalThis,rf=nf.trustedTypes,sf=rf?rf.createPolicy("lit-html",{createHTML:A=>A}):void 0,of="$lit$",af=`lit$${Math.random().toFixed(9).slice(2)}$`,cf="?"+af,df=`<${cf}>`,lf=document,uf=()=>lf.createComment(""),hf=A=>null===A||"object"!=typeof A&&"function"!=typeof A,gf=Array.isArray,pf="[ \t\n\f\r]",mf=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ff=/-->/g,Bf=/>/g,wf=RegExp(`>|${pf}(?:([^\\s"'>=/]+)(${pf}*=${pf}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),vf=/'/g,Cf=/"/g,yf=/^(?:script|style|textarea|title)$/i,bf=A=>(e,...t)=>({_$litType$:A,strings:e,values:t}),Qf=bf(1),Uf=bf(2),kf=Symbol.for("lit-noChange"),Ef=Symbol.for("lit-nothing"),Ff=new WeakMap,Tf=lf.createTreeWalker(lf,129);function Sf(A,e){if(!gf(A)||!A.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==sf?sf.createHTML(e):e}class If{constructor({strings:A,_$litType$:e},t){let n;this.parts=[];let i=0,r=0;const s=A.length-1,o=this.parts,[a,c]=((A,e)=>{const t=A.length-1,n=[];let i,r=2===e?"<svg>":3===e?"<math>":"",s=mf;for(let o=0;o<t;o++){const e=A[o];let t,a,c=-1,d=0;for(;d<e.length&&(s.lastIndex=d,a=s.exec(e),null!==a);)d=s.lastIndex,s===mf?"!--"===a[1]?s=ff:void 0!==a[1]?s=Bf:void 0!==a[2]?(yf.test(a[2])&&(i=RegExp("</"+a[2],"g")),s=wf):void 0!==a[3]&&(s=wf):s===wf?">"===a[0]?(s=i??mf,c=-1):void 0===a[1]?c=-2:(c=s.lastIndex-a[2].length,t=a[1],s=void 0===a[3]?wf:'"'===a[3]?Cf:vf):s===Cf||s===vf?s=wf:s===ff||s===Bf?s=mf:(s=wf,i=void 0);const l=s===wf&&A[o+1].startsWith("/>")?" ":"";r+=s===mf?e+df:c>=0?(n.push(t),e.slice(0,c)+of+e.slice(c)+af+l):e+af+(-2===c?o:l)}return[Sf(A,r+(A[t]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),n]})(A,e);if(this.el=If.createElement(a,t),Tf.currentNode=this.el.content,2===e||3===e){const A=this.el.content.firstChild;A.replaceWith(...A.childNodes)}for(;null!==(n=Tf.nextNode())&&o.length<s;){if(1===n.nodeType){if(n.hasAttributes())for(const A of n.getAttributeNames())if(A.endsWith(of)){const e=c[r++],t=n.getAttribute(A).split(af),s=/([.?@])?(.*)/.exec(e);o.push({type:1,index:i,name:s[2],strings:t,ctor:"."===s[1]?xf:"?"===s[1]?Lf:"@"===s[1]?Of:Df}),n.removeAttribute(A)}else A.startsWith(af)&&(o.push({type:6,index:i}),n.removeAttribute(A));if(yf.test(n.tagName)){const A=n.textContent.split(af),e=A.length-1;if(e>0){n.textContent=rf?rf.emptyScript:"";for(let t=0;t<e;t++)n.append(A[t],uf()),Tf.nextNode(),o.push({type:2,index:++i});n.append(A[e],uf())}}}else if(8===n.nodeType)if(n.data===cf)o.push({type:2,index:i});else{let A=-1;for(;-1!==(A=n.data.indexOf(af,A+1));)o.push({type:7,index:i}),A+=af.length-1}i++}}static createElement(A,e){const t=lf.createElement("template");return t.innerHTML=A,t}}function Pf(A,e,t=A,n){if(e===kf)return e;let i=void 0!==n?t._$Co?.[n]:t._$Cl;const r=hf(e)?void 0:e._$litDirective$;return i?.constructor!==r&&(i?._$AO?.(!1),void 0===r?i=void 0:(i=new r(A),i._$AT(A,t,n)),void 0!==n?(t._$Co??(t._$Co=[]))[n]=i:t._$Cl=i),void 0!==i&&(e=Pf(A,i._$AS(A,e.values),i,n)),e}class Hf{constructor(A,e){this._$AV=[],this._$AN=void 0,this._$AD=A,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(A){const{el:{content:e},parts:t}=this._$AD,n=(A?.creationScope??lf).importNode(e,!0);Tf.currentNode=n;let i=Tf.nextNode(),r=0,s=0,o=t[0];for(;void 0!==o;){if(r===o.index){let e;2===o.type?e=new Rf(i,i.nextSibling,this,A):1===o.type?e=new o.ctor(i,o.name,o.strings,this,A):6===o.type&&(e=new Mf(i,this,A)),this._$AV.push(e),o=t[++s]}r!==o?.index&&(i=Tf.nextNode(),r++)}return Tf.currentNode=lf,n}p(A){let e=0;for(const t of this._$AV)void 0!==t&&(void 0!==t.strings?(t._$AI(A,t,e),e+=t.strings.length-2):t._$AI(A[e])),e++}}class Rf{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(A,e,t,n){this.type=2,this._$AH=Ef,this._$AN=void 0,this._$AA=A,this._$AB=e,this._$AM=t,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let A=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===A?.nodeType&&(A=e.parentNode),A}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(A,e=this){A=Pf(this,A,e),hf(A)?A===Ef||null==A||""===A?(this._$AH!==Ef&&this._$AR(),this._$AH=Ef):A!==this._$AH&&A!==kf&&this._(A):void 0!==A._$litType$?this.$(A):void 0!==A.nodeType?this.T(A):(A=>gf(A)||"function"==typeof A?.[Symbol.iterator])(A)?this.k(A):this._(A)}O(A){return this._$AA.parentNode.insertBefore(A,this._$AB)}T(A){this._$AH!==A&&(this._$AR(),this._$AH=this.O(A))}_(A){this._$AH!==Ef&&hf(this._$AH)?this._$AA.nextSibling.data=A:this.T(lf.createTextNode(A)),this._$AH=A}$(A){const{values:e,_$litType$:t}=A,n="number"==typeof t?this._$AC(A):(void 0===t.el&&(t.el=If.createElement(Sf(t.h,t.h[0]),this.options)),t);if(this._$AH?._$AD===n)this._$AH.p(e);else{const A=new Hf(n,this),t=A.u(this.options);A.p(e),this.T(t),this._$AH=A}}_$AC(A){let e=Ff.get(A.strings);return void 0===e&&Ff.set(A.strings,e=new If(A)),e}k(A){gf(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let t,n=0;for(const i of A)n===e.length?e.push(t=new Rf(this.O(uf()),this.O(uf()),this,this.options)):t=e[n],t._$AI(i),n++;n<e.length&&(this._$AR(t&&t._$AB.nextSibling,n),e.length=n)}_$AR(A=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);A&&A!==this._$AB;){const e=A.nextSibling;A.remove(),A=e}}setConnected(A){void 0===this._$AM&&(this._$Cv=A,this._$AP?.(A))}}class Df{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(A,e,t,n,i){this.type=1,this._$AH=Ef,this._$AN=void 0,this.element=A,this.name=e,this._$AM=n,this.options=i,t.length>2||""!==t[0]||""!==t[1]?(this._$AH=Array(t.length-1).fill(new String),this.strings=t):this._$AH=Ef}_$AI(A,e=this,t,n){const i=this.strings;let r=!1;if(void 0===i)A=Pf(this,A,e,0),r=!hf(A)||A!==this._$AH&&A!==kf,r&&(this._$AH=A);else{const n=A;let s,o;for(A=i[0],s=0;s<i.length-1;s++)o=Pf(this,n[t+s],e,s),o===kf&&(o=this._$AH[s]),r||(r=!hf(o)||o!==this._$AH[s]),o===Ef?A=Ef:A!==Ef&&(A+=(o??"")+i[s+1]),this._$AH[s]=o}r&&!n&&this.j(A)}j(A){A===Ef?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,A??"")}}class xf extends Df{constructor(){super(...arguments),this.type=3}j(A){this.element[this.name]=A===Ef?void 0:A}}class Lf extends Df{constructor(){super(...arguments),this.type=4}j(A){this.element.toggleAttribute(this.name,!!A&&A!==Ef)}}class Of extends Df{constructor(A,e,t,n,i){super(A,e,t,n,i),this.type=5}_$AI(A,e=this){if((A=Pf(this,A,e,0)??Ef)===kf)return;const t=this._$AH,n=A===Ef&&t!==Ef||A.capture!==t.capture||A.once!==t.once||A.passive!==t.passive,i=A!==Ef&&(t===Ef||n);n&&this.element.removeEventListener(this.name,this,t),i&&this.element.addEventListener(this.name,this,A),this._$AH=A}handleEvent(A){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,A):this._$AH.handleEvent(A)}}class Mf{constructor(A,e,t){this.element=A,this.type=6,this._$AN=void 0,this._$AM=e,this.options=t}get _$AU(){return this._$AM._$AU}_$AI(A){Pf(this,A)}}const Nf=nf.litHtmlPolyfillSupport;Nf?.(If,Rf),(nf.litHtmlVersions??(nf.litHtmlVersions=[])).push("3.3.0");const Kf=globalThis;let _f=class extends tf{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var A;const e=super.createRenderRoot();return(A=this.renderOptions).renderBefore??(A.renderBefore=e.firstChild),e}update(A){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(A),this._$Do=((A,e,t)=>{const n=t?.renderBefore??e;let i=n._$litPart$;if(void 0===i){const A=t?.renderBefore??null;n._$litPart$=i=new Rf(e.insertBefore(uf(),A),A,void 0,t??{})}return i._$AI(A),i})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return kf}};_f._$litElement$=!0,_f.finalized=!0,Kf.litElementHydrateSupport?.({LitElement:_f});const Vf=Kf.litElementPolyfillSupport;Vf?.({LitElement:_f}),(Kf.litElementVersions??(Kf.litElementVersions=[])).push("4.2.0");const Gf={attribute:!0,type:String,converter:zm,reflect:!1,hasChanged:Af},jf=(A=Gf,e,t)=>{const{kind:n,metadata:i}=t;let r=globalThis.litPropertyMetadata.get(i);if(void 0===r&&globalThis.litPropertyMetadata.set(i,r=new Map),"setter"===n&&((A=Object.create(A)).wrapped=!0),r.set(t.name,A),"accessor"===n){const{name:n}=t;return{set(t){const i=e.get.call(this);e.set.call(this,t),this.requestUpdate(n,i,A)},init(e){return void 0!==e&&this.C(n,void 0,A,e),e}}}if("setter"===n){const{name:n}=t;return function(t){const i=this[n];e.call(this,t),this.requestUpdate(n,i,A)}}throw Error("Unsupported decorator location: "+n)};function Jf(A){return(e,t)=>"object"==typeof t?jf(A,e,t):((A,e,t)=>{const n=e.hasOwnProperty(t);return e.constructor.createProperty(t,A),n?Object.getOwnPropertyDescriptor(e,t):void 0})(A,e,t)}function Wf(A){return Jf({...A,state:!0,attribute:!1})}const Xf="session_data",Yf=new class{constructor(A){this.namespace=A}getItem(A){return localStorage.getItem(`${this.namespace}.${A}`)}setItem(A,e){localStorage.setItem(`${this.namespace}.${A}`,e)}removeItem(A){localStorage.removeItem(`${this.namespace}.${A}`)}clear(){for(let A=0;A<localStorage.length;A++){const e=localStorage.key(A);e&&e.startsWith(`${this.namespace}.`)&&localStorage.removeItem(e)}}}("io.obi.widget");var qf=Object.defineProperty,$f=Object.getOwnPropertyDescriptor,Zf=(A,e,t,n)=>{for(var i,r=n>1?void 0:n?$f(e,t):e,s=A.length-1;s>=0;s--)(i=A[s])&&(r=(n?i(e,t,r):i(r))||r);return n&&r&&qf(e,t,r),r};class zf extends _f{constructor(){super(...arguments),this.id="",this.isActive=!1,this.isSpecial=!1}handleClick(A){A.preventDefault(),A.stopPropagation();const e=new CustomEvent("click",{detail:{id:this.id,isActive:!this.isActive},bubbles:!0,composed:!0});this.dispatchEvent(e),this.onClick&&this.onClick(this.id,!this.isActive)}render(){return Qf`
|
|
1
|
+
var A=function(A){"use strict";const e="https://obi.getcor.io/api";function t(A){return A&&A.__esModule&&Object.prototype.hasOwnProperty.call(A,"default")?A.default:A}var n={exports:{}};!function(A){var e=Object.prototype.hasOwnProperty,t="~";function n(){}function i(A,e,t){this.fn=A,this.context=e,this.once=t||!1}function r(A,e,n,r,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var o=new i(n,r||A,s),a=t?t+e:e;return A._events[a]?A._events[a].fn?A._events[a]=[A._events[a],o]:A._events[a].push(o):(A._events[a]=o,A._eventsCount++),A}function s(A,e){0===--A._eventsCount?A._events=new n:delete A._events[e]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(t=!1)),o.prototype.eventNames=function(){var A,n,i=[];if(0===this._eventsCount)return i;for(n in A=this._events)e.call(A,n)&&i.push(t?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(A)):i},o.prototype.listeners=function(A){var e=t?t+A:A,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,r=n.length,s=new Array(r);i<r;i++)s[i]=n[i].fn;return s},o.prototype.listenerCount=function(A){var e=t?t+A:A,n=this._events[e];return n?n.fn?1:n.length:0},o.prototype.emit=function(A,e,n,i,r,s){var o=t?t+A:A;if(!this._events[o])return!1;var a,c,d=this._events[o],l=arguments.length;if(d.fn){switch(d.once&&this.removeListener(A,d.fn,void 0,!0),l){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,e),!0;case 3:return d.fn.call(d.context,e,n),!0;case 4:return d.fn.call(d.context,e,n,i),!0;case 5:return d.fn.call(d.context,e,n,i,r),!0;case 6:return d.fn.call(d.context,e,n,i,r,s),!0}for(c=1,a=new Array(l-1);c<l;c++)a[c-1]=arguments[c];d.fn.apply(d.context,a)}else{var u,h=d.length;for(c=0;c<h;c++)switch(d[c].once&&this.removeListener(A,d[c].fn,void 0,!0),l){case 1:d[c].fn.call(d[c].context);break;case 2:d[c].fn.call(d[c].context,e);break;case 3:d[c].fn.call(d[c].context,e,n);break;case 4:d[c].fn.call(d[c].context,e,n,i);break;default:if(!a)for(u=1,a=new Array(l-1);u<l;u++)a[u-1]=arguments[u];d[c].fn.apply(d[c].context,a)}}return!0},o.prototype.on=function(A,e,t){return r(this,A,e,t,!1)},o.prototype.once=function(A,e,t){return r(this,A,e,t,!0)},o.prototype.removeListener=function(A,e,n,i){var r=t?t+A:A;if(!this._events[r])return this;if(!e)return s(this,r),this;var o=this._events[r];if(o.fn)o.fn!==e||i&&!o.once||n&&o.context!==n||s(this,r);else{for(var a=0,c=[],d=o.length;a<d;a++)(o[a].fn!==e||i&&!o[a].once||n&&o[a].context!==n)&&c.push(o[a]);c.length?this._events[r]=1===c.length?c[0]:c:s(this,r)}return this},o.prototype.removeAllListeners=function(A){var e;return A?(e=t?t+A:A,this._events[e]&&s(this,e)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=t,o.EventEmitter=o,A.exports=o}(n);const i=t(n.exports);function r(A,e){return e.forEach((function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach((function(t){if("default"!==t&&!(t in A)){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(A,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}}))})),Object.freeze(A)}var s=Object.defineProperty,o=(A,e,t)=>((A,e,t)=>e in A?s(A,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):A[e]=t)(A,"symbol"!=typeof e?e+"":e,t);let a=class{constructor(){o(this,"_locking"),o(this,"_locks"),this._locking=Promise.resolve(),this._locks=0}isLocked(){return this._locks>0}lock(){let A;this._locks+=1;const e=new Promise((e=>A=()=>{this._locks-=1,e()})),t=this._locking.then((()=>A));return this._locking=this._locking.then((()=>e)),t}};function c(A,e){if(!A)throw new Error(e)}function d(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 u(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 h=Symbol("@bufbuild/protobuf/enum-type");function g(A,e,t,n){A[h]=p(e,t.map((e=>({no:e.no,name:e.name,localName:A[e.no]}))))}function p(A,e,t){const n=Object.create(null),i=Object.create(null),r=[];for(const s of e){const A=m(s);r.push(A),n[s.name]=A,i[s.no]=A}return{typeName:A,values:r,findName:A=>n[A],findNumber:A=>i[A]}}function m(A){return"localName"in A?A:Object.assign(Object.assign({},A),{localName:A.name})}class f{equals(A){return this.getType().runtime.util.equals(this.getType(),this,A)}clone(){return this.getType().runtime.util.clone(this)}fromBinary(A,e){const t=this.getType().runtime.bin,n=t.makeReadOptions(e);return t.readMessage(this,n.readerFactory(A),A.byteLength,n),this}fromJson(A,e){const t=this.getType(),n=t.runtime.json,i=n.makeReadOptions(e);return n.readMessage(t,A,i,this),this}fromJsonString(A,e){let t;try{t=JSON.parse(A)}catch(n){throw new Error("cannot decode ".concat(this.getType().typeName," from JSON: ").concat(n instanceof Error?n.message:String(n)))}return this.fromJson(t,e)}toBinary(A){const e=this.getType().runtime.bin,t=e.makeWriteOptions(A),n=t.writerFactory();return e.writeMessage(this,n,t),n.finish()}toJson(A){const e=this.getType().runtime.json,t=e.makeWriteOptions(A);return e.writeMessage(this,t)}toJsonString(A){var e;const t=this.toJson(A);return JSON.stringify(t,null,null!==(e=null==A?void 0:A.prettySpaces)&&void 0!==e?e:0)}toJSON(){return this.toJson({emitDefaultValues:!0})}getType(){return Object.getPrototypeOf(this).constructor}}function B(){let A=0,e=0;for(let n=0;n<28;n+=7){let t=this.buf[this.pos++];if(A|=(127&t)<<n,!(128&t))return this.assertBounds(),[A,e]}let t=this.buf[this.pos++];if(A|=(15&t)<<28,e=(112&t)>>4,!(128&t))return this.assertBounds(),[A,e];for(let n=3;n<=31;n+=7){let t=this.buf[this.pos++];if(e|=(127&t)<<n,!(128&t))return this.assertBounds(),[A,e]}throw new Error("invalid varint")}function w(A,e,t){for(let r=0;r<28;r+=7){const n=A>>>r,i=!(n>>>7==0&&0==e),s=255&(i?128|n:n);if(t.push(s),!i)return}const n=A>>>28&15|(7&e)<<4,i=!!(e>>3);if(t.push(255&(i?128|n:n)),i){for(let A=3;A<31;A+=7){const n=e>>>A,i=!(n>>>7==0),r=255&(i?128|n:n);if(t.push(r),!i)return}t.push(e>>>31&1)}}const v=4294967296;function C(A){const e="-"===A[0];e&&(A=A.slice(1));const t=1e6;let n=0,i=0;function r(e,r){const s=Number(A.slice(e,r));i*=t,n=n*t+s,n>=v&&(i+=n/v|0,n%=v)}return r(-24,-18),r(-18,-12),r(-12,-6),r(-6),e?Q(n,i):b(n,i)}function y(A,e){if(({lo:A,hi:e}=function(A,e){return{lo:A>>>0,hi:e>>>0}}(A,e)),e<=2097151)return String(v*e+A);const t=16777215&(A>>>24|e<<8),n=e>>16&65535;let i=(16777215&A)+6777216*t+6710656*n,r=t+8147497*n,s=2*n;const o=1e7;return i>=o&&(r+=Math.floor(i/o),i%=o),r>=o&&(s+=Math.floor(r/o),r%=o),s.toString()+U(r)+U(i)}function b(A,e){return{lo:0|A,hi:0|e}}function Q(A,e){return e=~e,A?A=1+~A:e+=1,b(A,e)}const U=A=>{const e=String(A);return"0000000".slice(e.length)+e};function k(A,e){if(A>=0){for(;A>127;)e.push(127&A|128),A>>>=7;e.push(A)}else{for(let t=0;t<9;t++)e.push(127&A|128),A>>=7;e.push(1)}}function E(){let A=this.buf[this.pos++],e=127&A;if(!(128&A))return this.assertBounds(),e;if(A=this.buf[this.pos++],e|=(127&A)<<7,!(128&A))return this.assertBounds(),e;if(A=this.buf[this.pos++],e|=(127&A)<<14,!(128&A))return this.assertBounds(),e;if(A=this.buf[this.pos++],e|=(127&A)<<21,!(128&A))return this.assertBounds(),e;A=this.buf[this.pos++],e|=(15&A)<<28;for(let t=5;128&A&&t<10;t++)A=this.buf[this.pos++];if(128&A)throw new Error("invalid varint");return this.assertBounds(),e>>>0}const F=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 e=BigInt("-9223372036854775808"),t=BigInt("9223372036854775807"),n=BigInt("0"),i=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(A){const n="bigint"==typeof A?A:BigInt(A);if(n>t||n<e)throw new Error("int64 invalid: ".concat(A));return n},uParse(A){const e="bigint"==typeof A?A:BigInt(A);if(e>i||e<n)throw new Error("uint64 invalid: ".concat(A));return e},enc(e){return A.setBigInt64(0,this.parse(e),!0),{lo:A.getInt32(0,!0),hi:A.getInt32(4,!0)}},uEnc(e){return A.setBigInt64(0,this.uParse(e),!0),{lo:A.getInt32(0,!0),hi:A.getInt32(4,!0)}},dec:(e,t)=>(A.setInt32(0,e,!0),A.setInt32(4,t,!0),A.getBigInt64(0,!0)),uDec:(e,t)=>(A.setInt32(0,e,!0),A.setInt32(4,t,!0),A.getBigUint64(0,!0))}}const e=A=>c(/^-?[0-9]+$/.test(A),"int64 invalid: ".concat(A)),t=A=>c(/^[0-9]+$/.test(A),"uint64 invalid: ".concat(A));return{zero:"0",supported:!1,parse:A=>("string"!=typeof A&&(A=A.toString()),e(A),A),uParse:A=>("string"!=typeof A&&(A=A.toString()),t(A),A),enc:A=>("string"!=typeof A&&(A=A.toString()),e(A),C(A)),uEnc:A=>("string"!=typeof A&&(A=A.toString()),t(A),C(A)),dec:(A,e)=>function(A,e){let t=b(A,e);const n=2147483648&t.hi;n&&(t=Q(t.lo,t.hi));const i=y(t.lo,t.hi);return n?"-"+i:i}(A,e),uDec:(A,e)=>y(A,e)}}();var T,S,I,P,H,R;function D(A,e,t){if(e===t)return!0;if(A==T.BYTES){if(!(e instanceof Uint8Array&&t instanceof Uint8Array))return!1;if(e.length!==t.length)return!1;for(let A=0;A<e.length;A++)if(e[A]!==t[A])return!1;return!0}switch(A){case T.UINT64:case T.FIXED64:case T.INT64:case T.SFIXED64:case T.SINT64:return e==t}return!1}function x(A,e){switch(A){case T.BOOL:return!1;case T.UINT64:case T.FIXED64:case T.INT64:case T.SFIXED64:case T.SINT64:return 0==e?F.zero:"0";case T.DOUBLE:case T.FLOAT:return 0;case T.BYTES:return new Uint8Array(0);case T.STRING:return"";default:return 0}}function L(A,e){switch(A){case T.BOOL:return!1===e;case T.STRING:return""===e;case T.BYTES:return e instanceof Uint8Array&&!e.byteLength;default:return 0==e}}(S=T||(T={}))[S.DOUBLE=1]="DOUBLE",S[S.FLOAT=2]="FLOAT",S[S.INT64=3]="INT64",S[S.UINT64=4]="UINT64",S[S.INT32=5]="INT32",S[S.FIXED64=6]="FIXED64",S[S.FIXED32=7]="FIXED32",S[S.BOOL=8]="BOOL",S[S.STRING=9]="STRING",S[S.BYTES=12]="BYTES",S[S.UINT32=13]="UINT32",S[S.SFIXED32=15]="SFIXED32",S[S.SFIXED64=16]="SFIXED64",S[S.SINT32=17]="SINT32",S[S.SINT64=18]="SINT64",(P=I||(I={}))[P.BIGINT=0]="BIGINT",P[P.STRING=1]="STRING",(R=H||(H={}))[R.Varint=0]="Varint",R[R.Bit64=1]="Bit64",R[R.LengthDelimited=2]="LengthDelimited",R[R.StartGroup=3]="StartGroup",R[R.EndGroup=4]="EndGroup",R[R.Bit32=5]="Bit32";class O{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 n=0;n<this.chunks.length;n++)A+=this.chunks[n].length;let e=new Uint8Array(A),t=0;for(let n=0;n<this.chunks.length;n++)e.set(this.chunks[n],t),t+=this.chunks[n].length;return this.chunks=[],e}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let A=this.finish(),e=this.stack.pop();if(!e)throw new Error("invalid state, fork stack empty");return this.chunks=e.chunks,this.buf=e.buf,this.uint32(A.byteLength),this.raw(A)}tag(A,e){return this.uint32((A<<3|e)>>>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 d(A),k(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 e=this.textEncoder.encode(A);return this.uint32(e.byteLength),this.raw(e)}float(A){u(A);let e=new Uint8Array(4);return new DataView(e.buffer).setFloat32(0,A,!0),this.raw(e)}double(A){let e=new Uint8Array(8);return new DataView(e.buffer).setFloat64(0,A,!0),this.raw(e)}fixed32(A){l(A);let e=new Uint8Array(4);return new DataView(e.buffer).setUint32(0,A,!0),this.raw(e)}sfixed32(A){d(A);let e=new Uint8Array(4);return new DataView(e.buffer).setInt32(0,A,!0),this.raw(e)}sint32(A){return d(A),k(A=(A<<1^A>>31)>>>0,this.buf),this}sfixed64(A){let e=new Uint8Array(8),t=new DataView(e.buffer),n=F.enc(A);return t.setInt32(0,n.lo,!0),t.setInt32(4,n.hi,!0),this.raw(e)}fixed64(A){let e=new Uint8Array(8),t=new DataView(e.buffer),n=F.uEnc(A);return t.setInt32(0,n.lo,!0),t.setInt32(4,n.hi,!0),this.raw(e)}int64(A){let e=F.enc(A);return w(e.lo,e.hi,this.buf),this}sint64(A){let e=F.enc(A),t=e.hi>>31;return w(e.lo<<1^t,(e.hi<<1|e.lo>>>31)^t,this.buf),this}uint64(A){let e=F.uEnc(A);return w(e.lo,e.hi,this.buf),this}}class M{constructor(A,e){this.varint64=B,this.uint32=E,this.buf=A,this.len=A.length,this.pos=0,this.view=new DataView(A.buffer,A.byteOffset,A.byteLength),this.textDecoder=null!=e?e:new TextDecoder}tag(){let A=this.uint32(),e=A>>>3,t=7&A;if(e<=0||t<0||t>5)throw new Error("illegal tag: field no "+e+" wire type "+t);return[e,t]}skip(A,e){let t=this.pos;switch(A){case H.Varint:for(;128&this.buf[this.pos++];);break;case H.Bit64:this.pos+=4;case H.Bit32:this.pos+=4;break;case H.LengthDelimited:let t=this.uint32();this.pos+=t;break;case H.StartGroup:for(;;){const[A,t]=this.tag();if(t===H.EndGroup){if(void 0!==e&&A!==e)throw new Error("invalid end group tag");break}this.skip(t,A)}break;default:throw new Error("cant skip wire type "+A)}return this.assertBounds(),this.buf.subarray(t,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 F.dec(...this.varint64())}uint64(){return F.uDec(...this.varint64())}sint64(){let[A,e]=this.varint64(),t=-(1&A);return A=(A>>>1|(1&e)<<31)^t,e=e>>>1^t,F.dec(A,e)}bool(){let[A,e]=this.varint64();return 0!==A||0!==e}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return F.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return F.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(),e=this.pos;return this.pos+=A,this.assertBounds(),this.buf.subarray(e,e+A)}string(){return this.textDecoder.decode(this.bytes())}}function N(A){const e=A.field.localName,t=Object.create(null);return t[e]=function(A){const e=A.field;if(e.repeated)return[];if(void 0!==e.default)return e.default;switch(e.kind){case"enum":return e.T.values[0].no;case"scalar":return x(e.T,e.L);case"message":const A=e.T,t=new A;return A.fieldWrapper?A.fieldWrapper.unwrapField(t):t;case"map":throw"map fields are not allowed to be extensions"}}(A),[t,()=>t[e]]}let K="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),_=[];for(let VB=0;VB<K.length;VB++)_[K[VB].charCodeAt(0)]=VB;_["-".charCodeAt(0)]=K.indexOf("+"),_["_".charCodeAt(0)]=K.indexOf("/");const V={dec(A){let e=3*A.length/4;"="==A[A.length-2]?e-=2:"="==A[A.length-1]&&(e-=1);let t,n=new Uint8Array(e),i=0,r=0,s=0;for(let o=0;o<A.length;o++){if(t=_[A.charCodeAt(o)],void 0===t)switch(A[o]){case"=":r=0;case"\n":case"\r":case"\t":case" ":continue;default:throw Error("invalid base64 string.")}switch(r){case 0:s=t,r=1;break;case 1:n[i++]=s<<2|(48&t)>>4,s=t,r=2;break;case 2:n[i++]=(15&s)<<4|(60&t)>>2,s=t,r=3;break;case 3:n[i++]=(3&s)<<6|t,r=0}}if(1==r)throw Error("invalid base64 string.");return n.subarray(0,i)},enc(A){let e,t="",n=0,i=0;for(let r=0;r<A.length;r++)switch(e=A[r],n){case 0:t+=K[e>>2],i=(3&e)<<4,n=1;break;case 1:t+=K[i|e>>4],i=(15&e)<<2,n=2;break;case 2:t+=K[i|e>>6],t+=K[63&e],n=0}return n&&(t+=K[i],t+="=",1==n&&(t+="=")),t}};function G(A,e,t){W(e,A);const n=e.runtime.bin.makeReadOptions(t),i=function(A,e){if(!e.repeated&&("enum"==e.kind||"scalar"==e.kind)){for(let t=A.length-1;t>=0;--t)if(A[t].no==e.no)return[A[t]];return[]}return A.filter((A=>A.no===e.no))}(A.getType().runtime.bin.listUnknownFields(A),e.field),[r,s]=N(e);for(const o of i)e.runtime.bin.readField(r,n.readerFactory(o.data),e.field,o.wireType,n);return s()}function j(A,e,t,n){W(e,A);const i=e.runtime.bin.makeReadOptions(n),r=e.runtime.bin.makeWriteOptions(n);if(J(A,e)){const t=A.getType().runtime.bin.listUnknownFields(A).filter((A=>A.no!=e.field.no));A.getType().runtime.bin.discardUnknownFields(A);for(const e of t)A.getType().runtime.bin.onUnknownField(A,e.no,e.wireType,e.data)}const s=r.writerFactory();let o=e.field;o.opt||o.repeated||"enum"!=o.kind&&"scalar"!=o.kind||(o=Object.assign(Object.assign({},e.field),{opt:!0})),e.runtime.bin.writeField(o,t,s,r);const a=i.readerFactory(s.finish());for(;a.pos<a.len;){const[e,t]=a.tag(),n=a.skip(t,e);A.getType().runtime.bin.onUnknownField(A,e,t,n)}}function J(A,e){const t=A.getType();return e.extendee.typeName===t.typeName&&!!t.runtime.bin.listUnknownFields(A).find((A=>A.no==e.field.no))}function W(A,e){c(A.extendee.typeName==e.getType().typeName,"extension ".concat(A.typeName," can only be applied to message ").concat(A.extendee.typeName))}function X(A,e){const t=A.localName;if(A.repeated)return e[t].length>0;if(A.oneof)return e[A.oneof.localName].case===t;switch(A.kind){case"enum":case"scalar":return A.opt||A.req?void 0!==e[t]:"enum"==A.kind?e[t]!==A.T.values[0].no:!L(A.T,e[t]);case"message":return void 0!==e[t];case"map":return Object.keys(e[t]).length>0}}function Y(A,e){const t=A.localName,n=!A.opt&&!A.req;if(A.repeated)e[t]=[];else if(A.oneof)e[A.oneof.localName]={case:void 0};else switch(A.kind){case"map":e[t]={};break;case"enum":e[t]=n?A.T.values[0].no:void 0;break;case"scalar":e[t]=n?x(A.T,A.L):void 0;break;case"message":e[t]=void 0}}function q(A,e){if(null===A||"object"!=typeof A)return!1;if(!Object.getOwnPropertyNames(f.prototype).every((e=>e in A&&"function"==typeof A[e])))return!1;const t=A.getType();return null!==t&&"function"==typeof t&&"typeName"in t&&"string"==typeof t.typeName&&(void 0===e||t.typeName==e.typeName)}function $(A,e){return q(e)||!A.fieldWrapper?e:A.fieldWrapper.wrapField(e)}T.DOUBLE,T.FLOAT,T.INT64,T.UINT64,T.INT32,T.UINT32,T.BOOL,T.STRING,T.BYTES;const Z={ignoreUnknownFields:!1},z={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0};const AA=Symbol(),eA=Symbol();function tA(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,e,t,n,i){let r=t.localName;if(t.repeated){if(c("map"!=t.kind),null===e)return;if(!Array.isArray(e))throw new Error("cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(tA(e)));const o=A[r];for(const A of e){if(null===A)throw new Error("cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(tA(A)));switch(t.kind){case"message":o.push(t.T.fromJson(A,n));break;case"enum":const e=sA(t.T,A,n.ignoreUnknownFields,!0);e!==eA&&o.push(e);break;case"scalar":try{o.push(rA(t.T,A,t.L,!0))}catch(s){let e="cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(tA(A));throw s instanceof Error&&s.message.length>0&&(e+=": ".concat(s.message)),new Error(e)}}}}else if("map"==t.kind){if(null===e)return;if("object"!=typeof e||Array.isArray(e))throw new Error("cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(tA(e)));const o=A[r];for(const[A,r]of Object.entries(e)){if(null===r)throw new Error("cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: map value null"));let a;try{a=iA(t.K,A)}catch(s){let A="cannot decode map key for field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(tA(e));throw s instanceof Error&&s.message.length>0&&(A+=": ".concat(s.message)),new Error(A)}switch(t.V.kind){case"message":o[a]=t.V.T.fromJson(r,n);break;case"enum":const A=sA(t.V.T,r,n.ignoreUnknownFields,!0);A!==eA&&(o[a]=A);break;case"scalar":try{o[a]=rA(t.V.T,r,I.BIGINT,!0)}catch(s){let A="cannot decode map value for field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(tA(e));throw s instanceof Error&&s.message.length>0&&(A+=": ".concat(s.message)),new Error(A)}}}}else switch(t.oneof&&(A=A[t.oneof.localName]={case:r},r="value"),t.kind){case"message":const o=t.T;if(null===e&&"google.protobuf.Value"!=o.typeName)return;let a=A[r];q(a)?a.fromJson(e,n):(A[r]=a=o.fromJson(e,n),o.fieldWrapper&&!t.oneof&&(A[r]=o.fieldWrapper.unwrapField(a)));break;case"enum":const c=sA(t.T,e,n.ignoreUnknownFields,!1);switch(c){case AA:Y(t,A);break;case eA:break;default:A[r]=c}break;case"scalar":try{const n=rA(t.T,e,t.L,!1);n===AA?Y(t,A):A[r]=n}catch(s){let A="cannot decode field ".concat(i.typeName,".").concat(t.name," from JSON: ").concat(tA(e));throw s instanceof Error&&s.message.length>0&&(A+=": ".concat(s.message)),new Error(A)}}}function iA(A,e){if(A===T.BOOL)switch(e){case"true":e=!0;break;case"false":e=!1}return rA(A,e,I.BIGINT,!0).toString()}function rA(A,e,t,n){if(null===e)return n?x(A,t):AA;switch(A){case T.DOUBLE:case T.FLOAT:if("NaN"===e)return Number.NaN;if("Infinity"===e)return Number.POSITIVE_INFINITY;if("-Infinity"===e)return Number.NEGATIVE_INFINITY;if(""===e)break;if("string"==typeof e&&e.trim().length!==e.length)break;if("string"!=typeof e&&"number"!=typeof e)break;const n=Number(e);if(Number.isNaN(n))break;if(!Number.isFinite(n))break;return A==T.FLOAT&&u(n),n;case T.INT32:case T.FIXED32:case T.SFIXED32:case T.SINT32:case T.UINT32:let r;if("number"==typeof e?r=e:"string"==typeof e&&e.length>0&&e.trim().length===e.length&&(r=Number(e)),void 0===r)break;return A==T.UINT32||A==T.FIXED32?l(r):d(r),r;case T.INT64:case T.SFIXED64:case T.SINT64:if("number"!=typeof e&&"string"!=typeof e)break;const s=F.parse(e);return t?s.toString():s;case T.FIXED64:case T.UINT64:if("number"!=typeof e&&"string"!=typeof e)break;const o=F.uParse(e);return t?o.toString():o;case T.BOOL:if("boolean"!=typeof e)break;return e;case T.STRING:if("string"!=typeof e)break;try{encodeURIComponent(e)}catch(i){throw new Error("invalid UTF8")}return e;case T.BYTES:if(""===e)return new Uint8Array(0);if("string"!=typeof e)break;return V.dec(e)}throw new Error}function sA(A,e,t,n){if(null===e)return"google.protobuf.NullValue"==A.typeName?0:n?A.values[0].no:AA;switch(typeof e){case"number":if(Number.isInteger(e))return e;break;case"string":const n=A.findName(e);if(void 0!==n)return n.no;if(t)return eA}throw new Error("cannot decode enum ".concat(A.typeName," from JSON: ").concat(tA(e)))}function oA(A){return!(!A.repeated&&"map"!=A.kind&&(A.oneof||"message"==A.kind||A.opt||A.req))}function aA(A,e,t){if("map"==A.kind){c("object"==typeof e&&null!=e);const n={},i=Object.entries(e);switch(A.V.kind){case"scalar":for(const[t,r]of i)n[t.toString()]=dA(A.V.T,r);break;case"message":for(const[A,r]of i)n[A.toString()]=r.toJson(t);break;case"enum":const e=A.V.T;for(const[A,r]of i)n[A.toString()]=cA(e,r,t.enumAsInteger)}return t.emitDefaultValues||i.length>0?n:void 0}if(A.repeated){c(Array.isArray(e));const n=[];switch(A.kind){case"scalar":for(let t=0;t<e.length;t++)n.push(dA(A.T,e[t]));break;case"enum":for(let i=0;i<e.length;i++)n.push(cA(A.T,e[i],t.enumAsInteger));break;case"message":for(let A=0;A<e.length;A++)n.push(e[A].toJson(t))}return t.emitDefaultValues||n.length>0?n:void 0}switch(A.kind){case"scalar":return dA(A.T,e);case"enum":return cA(A.T,e,t.enumAsInteger);case"message":return $(A.T,e).toJson(t)}}function cA(A,e,t){var n;if(c("number"==typeof e),"google.protobuf.NullValue"==A.typeName)return null;if(t)return e;const i=A.findNumber(e);return null!==(n=null==i?void 0:i.name)&&void 0!==n?n:e}function dA(A,e){switch(A){case T.INT32:case T.SFIXED32:case T.SINT32:case T.FIXED32:case T.UINT32:return c("number"==typeof e),e;case T.FLOAT:case T.DOUBLE:return c("number"==typeof e),Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":e;case T.STRING:return c("string"==typeof e),e;case T.BOOL:return c("boolean"==typeof e),e;case T.UINT64:case T.FIXED64:case T.INT64:case T.SFIXED64:case T.SINT64:return c("bigint"==typeof e||"string"==typeof e||"number"==typeof e),e.toString();case T.BYTES:return c(e instanceof Uint8Array),V.enc(e)}}const lA=Symbol("@bufbuild/protobuf/unknown-fields"),uA={readUnknownFields:!0,readerFactory:A=>new M(A)},hA={writeUnknownFields:!0,writerFactory:()=>new O};function gA(A,e,t,n,i){let{repeated:r,localName:s}=t;switch(t.oneof&&((A=A[t.oneof.localName]).case!=s&&delete A.value,A.case=s,s="value"),t.kind){case"scalar":case"enum":const o="enum"==t.kind?T.INT32:t.T;let a=fA;if("scalar"==t.kind&&t.L>0&&(a=mA),r){let t=A[s];if(n==H.LengthDelimited&&o!=T.STRING&&o!=T.BYTES){let A=e.uint32()+e.pos;for(;e.pos<A;)t.push(a(e,o))}else t.push(a(e,o))}else A[s]=a(e,o);break;case"message":const c=t.T;r?A[s].push(pA(e,new c,i,t)):q(A[s])?pA(e,A[s],i,t):(A[s]=pA(e,new c,i,t),!c.fieldWrapper||t.oneof||t.repeated||(A[s]=c.fieldWrapper.unwrapField(A[s])));break;case"map":let[d,l]=function(A,e,t){const n=e.uint32(),i=e.pos+n;let r,s;for(;e.pos<i;){const[n]=e.tag();switch(n){case 1:r=fA(e,A.K);break;case 2:switch(A.V.kind){case"scalar":s=fA(e,A.V.T);break;case"enum":s=e.int32();break;case"message":s=pA(e,new A.V.T,t,void 0)}}}if(void 0===r&&(r=x(A.K,I.BIGINT)),"string"!=typeof r&&"number"!=typeof r&&(r=r.toString()),void 0===s)switch(A.V.kind){case"scalar":s=x(A.V.T,I.BIGINT);break;case"enum":s=A.V.T.values[0].no;break;case"message":s=new A.V.T}return[r,s]}(t,e,i);A[s][d]=l}}function pA(A,e,t,n){const i=e.getType().runtime.bin,r=null==n?void 0:n.delimited;return i.readMessage(e,A,r?n.no:A.uint32(),t,r),e}function mA(A,e){const t=fA(A,e);return"bigint"==typeof t?t.toString():t}function fA(A,e){switch(e){case T.STRING:return A.string();case T.BOOL:return A.bool();case T.DOUBLE:return A.double();case T.FLOAT:return A.float();case T.INT32:return A.int32();case T.INT64:return A.int64();case T.UINT64:return A.uint64();case T.FIXED64:return A.fixed64();case T.BYTES:return A.bytes();case T.FIXED32:return A.fixed32();case T.SFIXED32:return A.sfixed32();case T.SFIXED64:return A.sfixed64();case T.SINT64:return A.sint64();case T.UINT32:return A.uint32();case T.SINT32:return A.sint32()}}function BA(A,e,t,n){c(void 0!==e);const i=A.repeated;switch(A.kind){case"scalar":case"enum":let r="enum"==A.kind?T.INT32:A.T;if(i)if(c(Array.isArray(e)),A.packed)!function(A,e,t,n){if(!n.length)return;A.tag(t,H.LengthDelimited).fork();let[,i]=yA(e);for(let r=0;r<n.length;r++)A[i](n[r]);A.join()}(t,r,A.no,e);else for(const n of e)CA(t,r,A.no,n);else CA(t,r,A.no,e);break;case"message":if(i){c(Array.isArray(e));for(const i of e)vA(t,n,A,i)}else vA(t,n,A,e);break;case"map":c("object"==typeof e&&null!=e);for(const[i,s]of Object.entries(e))wA(t,n,A,i,s)}}function wA(A,e,t,n,i){A.tag(t.no,H.LengthDelimited),A.fork();let r=n;switch(t.K){case T.INT32:case T.FIXED32:case T.UINT32:case T.SFIXED32:case T.SINT32:r=Number.parseInt(n);break;case T.BOOL:c("true"==n||"false"==n),r="true"==n}switch(CA(A,t.K,1,r),t.V.kind){case"scalar":CA(A,t.V.T,2,i);break;case"enum":CA(A,T.INT32,2,i);break;case"message":c(void 0!==i),A.tag(2,H.LengthDelimited).bytes(i.toBinary(e))}A.join()}function vA(A,e,t,n){const i=$(t.T,n);t.delimited?A.tag(t.no,H.StartGroup).raw(i.toBinary(e)).tag(t.no,H.EndGroup):A.tag(t.no,H.LengthDelimited).bytes(i.toBinary(e))}function CA(A,e,t,n){c(void 0!==n);let[i,r]=yA(e);A.tag(t,i)[r](n)}function yA(A){let e=H.Varint;switch(A){case T.BYTES:case T.STRING:e=H.LengthDelimited;break;case T.DOUBLE:case T.FIXED64:case T.SFIXED64:e=H.Bit64;break;case T.FIXED32:case T.SFIXED32:case T.FLOAT:e=H.Bit32}return[e,T[A].toLowerCase()]}function bA(A){if(void 0===A)return A;if(q(A))return A.clone();if(A instanceof Uint8Array){const e=new Uint8Array(A.byteLength);return e.set(A),e}return A}function QA(A){return A instanceof Uint8Array?A:new Uint8Array(A)}class UA{constructor(A,e){this._fields=A,this._normalizer=e}findJsonName(A){if(!this.jsonNames){const A={};for(const e of this.list())A[e.jsonName]=A[e.name]=e;this.jsonNames=A}return this.jsonNames[A]}find(A){if(!this.numbers){const A={};for(const e of this.list())A[e.no]=e;this.numbers=A}return this.numbers[A]}list(){return this.all||(this.all=this._normalizer(this._fields)),this.all}byNumber(){return this.numbersAsc||(this.numbersAsc=this.list().concat().sort(((A,e)=>A.no-e.no))),this.numbersAsc}byMember(){if(!this.members){this.members=[];const A=this.members;let e;for(const t of this.list())t.oneof?t.oneof!==e&&(e=t.oneof,A.push(e)):A.push(t)}return this.members}}function kA(A,e){const t=FA(A);return e?t:HA(PA(t))}const EA=FA;function FA(A){let e=!1;const t=[];for(let n=0;n<A.length;n++){let i=A.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":t.push(i),e=!1;break;default:e&&(e=!1,i=i.toUpperCase()),t.push(i)}}return t.join("")}const TA=new Set(["constructor","toString","toJSON","valueOf"]),SA=new Set(["getType","clone","equals","fromBinary","fromJson","fromJsonString","toBinary","toJson","toJsonString","toObject"]),IA=A=>"".concat(A,"$"),PA=A=>SA.has(A)?IA(A):A,HA=A=>TA.has(A)?IA(A):A;class RA{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=kA(A,!1)}addField(A){c(A.oneof===this,"field ".concat(A.name," not one of ").concat(this.name)),this.fields.push(A)}findField(A){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[A]}}const DA=(xA=A=>new UA(A,(A=>function(A){var e,t,n,i,r,s;const o=[];let a;for(const c of"function"==typeof A?A():A){const A=c;if(A.localName=kA(c.name,void 0!==c.oneof),A.jsonName=null!==(e=c.jsonName)&&void 0!==e?e:EA(c.name),A.repeated=null!==(t=c.repeated)&&void 0!==t&&t,"scalar"==c.kind&&(A.L=null!==(n=c.L)&&void 0!==n?n:I.BIGINT),A.delimited=null!==(i=c.delimited)&&void 0!==i&&i,A.req=null!==(r=c.req)&&void 0!==r&&r,A.opt=null!==(s=c.opt)&&void 0!==s&&s,void 0===c.packed&&(A.packed="enum"==c.kind||"scalar"==c.kind&&c.T!=T.BYTES&&c.T!=T.STRING),void 0!==c.oneof){const e="string"==typeof c.oneof?c.oneof:c.oneof.name;a&&a.name==e||(a=new RA(e)),A.oneof=a,a.addField(A)}o.push(A)}return o}(A))),LA=A=>{for(const e of A.getType().fields.byMember()){if(e.opt)continue;const t=e.localName,n=A;if(e.repeated)n[t]=[];else switch(e.kind){case"oneof":n[t]={case:void 0};break;case"enum":n[t]=0;break;case"map":n[t]={};break;case"scalar":n[t]=x(e.T,e.L)}}},{syntax:"proto3",json:{makeReadOptions:function(A){return A?Object.assign(Object.assign({},Z),A):Z},makeWriteOptions:function(A){return A?Object.assign(Object.assign({},z),A):z},readMessage(A,e,t,n){if(null==e||Array.isArray(e)||"object"!=typeof e)throw new Error("cannot decode message ".concat(A.typeName," from JSON: ").concat(tA(e)));n=null!=n?n:new A;const i=new Map,r=t.typeRegistry;for(const[s,o]of Object.entries(e)){const e=A.fields.findJsonName(s);if(e){if(e.oneof){if(null===o&&"scalar"==e.kind)continue;const t=i.get(e.oneof);if(void 0!==t)throw new Error("cannot decode message ".concat(A.typeName,' from JSON: multiple keys for oneof "').concat(e.oneof.name,'" present: "').concat(t,'", "').concat(s,'"'));i.set(e.oneof,s)}nA(n,o,e,t,A)}else{let e=!1;if((null==r?void 0:r.findExtension)&&s.startsWith("[")&&s.endsWith("]")){const i=r.findExtension(s.substring(1,s.length-1));if(i&&i.extendee.typeName==A.typeName){e=!0;const[A,r]=N(i);nA(A,o,i.field,t,i),j(n,i,r(),t)}}if(!e&&!t.ignoreUnknownFields)throw new Error("cannot decode message ".concat(A.typeName,' from JSON: key "').concat(s,'" is unknown'))}}return n},writeMessage(A,e){const t=A.getType(),n={};let i;try{for(i of t.fields.byNumber()){if(!X(i,A)){if(i.req)throw"required field not set";if(!e.emitDefaultValues)continue;if(!oA(i))continue}const t=aA(i,i.oneof?A[i.oneof.localName].value:A[i.localName],e);void 0!==t&&(n[e.useProtoFieldName?i.name:i.jsonName]=t)}const r=e.typeRegistry;if(null==r?void 0:r.findExtensionFor)for(const i of t.runtime.bin.listUnknownFields(A)){const s=r.findExtensionFor(t.typeName,i.no);if(s&&J(A,s)){const t=G(A,s,e),i=aA(s.field,t,e);void 0!==i&&(n[s.field.jsonName]=i)}}}catch(r){const A=i?"cannot encode field ".concat(t.typeName,".").concat(i.name," to JSON"):"cannot encode message ".concat(t.typeName," to JSON"),e=r instanceof Error?r.message:String(r);throw new Error(A+(e.length>0?": ".concat(e):""))}return n},readScalar:(A,e,t)=>rA(A,e,null!=t?t:I.BIGINT,!0),writeScalar(A,e,t){if(void 0!==e)return t||L(A,e)?dA(A,e):void 0},debug:tA},bin:{makeReadOptions:function(A){return A?Object.assign(Object.assign({},uA),A):uA},makeWriteOptions:function(A){return A?Object.assign(Object.assign({},hA),A):hA},listUnknownFields(A){var e;return null!==(e=A[lA])&&void 0!==e?e:[]},discardUnknownFields(A){delete A[lA]},writeUnknownFields(A,e){const t=A[lA];if(t)for(const n of t)e.tag(n.no,n.wireType).raw(n.data)},onUnknownField(A,e,t,n){const i=A;Array.isArray(i[lA])||(i[lA]=[]),i[lA].push({no:e,wireType:t,data:n})},readMessage(A,e,t,n,i){const r=A.getType(),s=i?e.len:e.pos+t;let o,a;for(;e.pos<s&&([o,a]=e.tag(),!0!==i||a!=H.EndGroup);){const t=r.fields.find(o);if(t)gA(A,e,t,a,n);else{const t=e.skip(a,o);n.readUnknownFields&&this.onUnknownField(A,o,a,t)}}if(i&&(a!=H.EndGroup||o!==t))throw new Error("invalid end group tag")},readField:gA,writeMessage(A,e,t){const n=A.getType();for(const i of n.fields.byNumber())if(X(i,A))BA(i,i.oneof?A[i.oneof.localName].value:A[i.localName],e,t);else if(i.req)throw new Error("cannot encode field ".concat(n.typeName,".").concat(i.name," to binary: required field not set"));return t.writeUnknownFields&&this.writeUnknownFields(A,e),e},writeField(A,e,t,n){void 0!==e&&BA(A,e,t,n)}},util:Object.assign(Object.assign({},{setEnumType:g,initPartial(A,e){if(void 0===A)return;const t=e.getType();for(const n of t.fields.byMember()){const t=n.localName,i=e,r=A;if(null!=r[t])switch(n.kind){case"oneof":const A=r[t].case;if(void 0===A)continue;const e=n.findField(A);let s=r[t].value;e&&"message"==e.kind&&!q(s,e.T)?s=new e.T(s):e&&"scalar"===e.kind&&e.T===T.BYTES&&(s=QA(s)),i[t]={case:A,value:s};break;case"scalar":case"enum":let o=r[t];n.T===T.BYTES&&(o=n.repeated?o.map(QA):QA(o)),i[t]=o;break;case"map":switch(n.V.kind){case"scalar":case"enum":if(n.V.T===T.BYTES)for(const[e,n]of Object.entries(r[t]))i[t][e]=QA(n);else Object.assign(i[t],r[t]);break;case"message":const A=n.V.T;for(const e of Object.keys(r[t])){let n=r[t][e];A.fieldWrapper||(n=new A(n)),i[t][e]=n}}break;case"message":const a=n.T;if(n.repeated)i[t]=r[t].map((A=>q(A,a)?A:new a(A)));else{const A=r[t];a.fieldWrapper?"google.protobuf.BytesValue"===a.typeName?i[t]=QA(A):i[t]=A:i[t]=q(A,a)?A:new a(A)}}}},equals:(A,e,t)=>e===t||!(!e||!t)&&A.fields.byMember().every((A=>{const n=e[A.localName],i=t[A.localName];if(A.repeated){if(n.length!==i.length)return!1;switch(A.kind){case"message":return n.every(((e,t)=>A.T.equals(e,i[t])));case"scalar":return n.every(((e,t)=>D(A.T,e,i[t])));case"enum":return n.every(((A,e)=>D(T.INT32,A,i[e])))}throw new Error("repeated cannot contain ".concat(A.kind))}switch(A.kind){case"message":return A.T.equals(n,i);case"enum":return D(T.INT32,n,i);case"scalar":return D(A.T,n,i);case"oneof":if(n.case!==i.case)return!1;const e=A.findField(n.case);if(void 0===e)return!0;switch(e.kind){case"message":return e.T.equals(n.value,i.value);case"enum":return D(T.INT32,n.value,i.value);case"scalar":return D(e.T,n.value,i.value)}throw new Error("oneof cannot contain ".concat(e.kind));case"map":const t=Object.keys(n).concat(Object.keys(i));switch(A.V.kind){case"message":const e=A.V.T;return t.every((A=>e.equals(n[A],i[A])));case"enum":return t.every((A=>D(T.INT32,n[A],i[A])));case"scalar":const r=A.V.T;return t.every((A=>D(r,n[A],i[A])))}}})),clone(A){const e=A.getType(),t=new e,n=t;for(const i of e.fields.byMember()){const e=A[i.localName];let t;if(i.repeated)t=e.map(bA);else if("map"==i.kind){t=n[i.localName];for(const[A,n]of Object.entries(e))t[A]=bA(n)}else t="oneof"==i.kind?i.findField(e.case)?{case:e.case,value:bA(e.value)}:{case:void 0}:bA(e);n[i.localName]=t}for(const i of e.runtime.bin.listUnknownFields(A))e.runtime.bin.onUnknownField(n,i.no,i.wireType,i.data);return t}}),{newFieldList:xA,initFields:LA}),makeMessageType(A,e,t){return function(A,e,t,n){var i;const r=null!==(i=null==n?void 0:n.localName)&&void 0!==i?i:e.substring(e.lastIndexOf(".")+1),s={[r]:function(e){A.util.initFields(this),A.util.initPartial(e,this)}}[r];return Object.setPrototypeOf(s.prototype,new f),Object.assign(s,{runtime:A,typeName:e,fields:A.util.newFieldList(t),fromBinary:(A,e)=>(new s).fromBinary(A,e),fromJson:(A,e)=>(new s).fromJson(A,e),fromJsonString:(A,e)=>(new s).fromJsonString(A,e),equals:(e,t)=>A.util.equals(s,e,t)}),s}(this,A,e,t)},makeEnum:function(A,e,t){const n={};for(const i of e){const A=m(i);n[A.localName]=A.no,n[A.no]=A.localName}return g(n,A,e),n},makeEnumType:p,getEnumType:function(A){const e=A[h];return c(e,"missing enum type on enum object"),e},makeExtension(A,e,t){return function(A,e,t,n){let i;return{typeName:e,extendee:t,get field(){if(!i){const t="function"==typeof n?n():n;t.name=e.split(".").pop(),t.jsonName="[".concat(e,"]"),i=A.util.newFieldList([t]).list()[0]}return i},runtime:A}}(this,A,e,t)}});var xA,LA;class OA extends f{constructor(A){super(),this.seconds=F.zero,this.nanos=0,DA.util.initPartial(A,this)}fromJson(A,e){if("string"!=typeof A)throw new Error("cannot decode google.protobuf.Timestamp from JSON: ".concat(DA.json.debug(A)));const t=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(!t)throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");const n=Date.parse(t[1]+"-"+t[2]+"-"+t[3]+"T"+t[4]+":"+t[5]+":"+t[6]+(t[8]?t[8]:"Z"));if(Number.isNaN(n))throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");if(n<Date.parse("0001-01-01T00:00:00Z")||n>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=F.parse(n/1e3),this.nanos=0,t[7]&&(this.nanos=parseInt("1"+t[7]+"0".repeat(9-t[7].length))-1e9),this}toJson(A){const e=1e3*Number(this.seconds);if(e<Date.parse("0001-01-01T00:00:00Z")||e>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 t="Z";if(this.nanos>0){const A=(this.nanos+1e9).toString().substring(1);t="000000"===A.substring(3)?"."+A.substring(0,3)+"Z":"000"===A.substring(6)?"."+A.substring(0,6)+"Z":"."+A+"Z"}return new Date(e).toISOString().replace(".000Z",t)}toDate(){return new Date(1e3*Number(this.seconds)+Math.ceil(this.nanos/1e6))}static now(){return OA.fromDate(new Date)}static fromDate(A){const e=A.getTime();return new OA({seconds:F.parse(Math.floor(e/1e3)),nanos:e%1e3*1e6})}static fromBinary(A,e){return(new OA).fromBinary(A,e)}static fromJson(A,e){return(new OA).fromJson(A,e)}static fromJsonString(A,e){return(new OA).fromJsonString(A,e)}static equals(A,e){return DA.util.equals(OA,A,e)}}OA.runtime=DA,OA.typeName="google.protobuf.Timestamp",OA.fields=DA.util.newFieldList((()=>[{no:1,name:"seconds",kind:"scalar",T:3},{no:2,name:"nanos",kind:"scalar",T:5}]));const MA=DA.makeMessageType("livekit.MetricsBatch",(()=>[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:OA},{no:3,name:"str_data",kind:"scalar",T:9,repeated:!0},{no:4,name:"time_series",kind:"message",T:NA,repeated:!0},{no:5,name:"events",kind:"message",T:_A,repeated:!0}])),NA=DA.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:KA,repeated:!0},{no:5,name:"rid",kind:"scalar",T:13}])),KA=DA.makeMessageType("livekit.MetricSample",(()=>[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:OA},{no:3,name:"value",kind:"scalar",T:2}])),_A=DA.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:OA},{no:7,name:"normalized_end_timestamp",kind:"message",T:OA,opt:!0},{no:8,name:"metadata",kind:"scalar",T:9},{no:9,name:"rid",kind:"scalar",T:13}])),VA=DA.makeEnum("livekit.BackupCodecPolicy",[{no:0,name:"PREFER_REGRESSION"},{no:1,name:"SIMULCAST"},{no:2,name:"REGRESSION"}]),GA=DA.makeEnum("livekit.TrackType",[{no:0,name:"AUDIO"},{no:1,name:"VIDEO"},{no:2,name:"DATA"}]),jA=DA.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"}]),JA=DA.makeEnum("livekit.VideoQuality",[{no:0,name:"LOW"},{no:1,name:"MEDIUM"},{no:2,name:"HIGH"},{no:3,name:"OFF"}]),WA=DA.makeEnum("livekit.ConnectionQuality",[{no:0,name:"POOR"},{no:1,name:"GOOD"},{no:2,name:"EXCELLENT"},{no:3,name:"LOST"}]),XA=DA.makeEnum("livekit.ClientConfigSetting",[{no:0,name:"UNSET"},{no:1,name:"DISABLED"},{no:2,name:"ENABLED"}]),YA=DA.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=DA.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"}]),$A=DA.makeEnum("livekit.SubscriptionError",[{no:0,name:"SE_UNKNOWN"},{no:1,name:"SE_CODEC_UNSUPPORTED"},{no:2,name:"SE_TRACK_NOTFOUND"}]),ZA=DA.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"}]),zA=DA.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:Ae,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:Ie}])),Ae=DA.makeMessageType("livekit.Codec",(()=>[{no:1,name:"mime",kind:"scalar",T:9},{no:2,name:"fmtp_line",kind:"scalar",T:9}])),ee=DA.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:DA.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}])),te=DA.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:DA.getEnumType(ne)},{no:4,name:"tracks",kind:"message",T:ae,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:ee},{no:12,name:"region",kind:"scalar",T:9},{no:13,name:"is_publisher",kind:"scalar",T:8},{no:14,name:"kind",kind:"enum",T:DA.getEnumType(ie)},{no:15,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:16,name:"disconnect_reason",kind:"enum",T:DA.getEnumType(YA)},{no:18,name:"kind_details",kind:"enum",T:DA.getEnumType(re),repeated:!0}])),ne=DA.makeEnum("livekit.ParticipantInfo.State",[{no:0,name:"JOINING"},{no:1,name:"JOINED"},{no:2,name:"ACTIVE"},{no:3,name:"DISCONNECTED"}]),ie=DA.makeEnum("livekit.ParticipantInfo.Kind",[{no:0,name:"STANDARD"},{no:1,name:"INGRESS"},{no:2,name:"EGRESS"},{no:3,name:"SIP"},{no:4,name:"AGENT"}]),re=DA.makeEnum("livekit.ParticipantInfo.KindDetail",[{no:0,name:"CLOUD_AGENT"},{no:1,name:"FORWARDED"}]),se=DA.makeEnum("livekit.Encryption.Type",[{no:0,name:"NONE"},{no:1,name:"GCM"},{no:2,name:"CUSTOM"}]),oe=DA.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:ce,repeated:!0}])),ae=DA.makeMessageType("livekit.TrackInfo",(()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:DA.getEnumType(GA)},{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:DA.getEnumType(jA)},{no:10,name:"layers",kind:"message",T:ce,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:oe,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:DA.getEnumType(se)},{no:17,name:"stream",kind:"scalar",T:9},{no:18,name:"version",kind:"message",T:Ie},{no:19,name:"audio_features",kind:"enum",T:DA.getEnumType(ZA),repeated:!0},{no:20,name:"backup_codec_policy",kind:"enum",T:DA.getEnumType(VA)}])),ce=DA.makeMessageType("livekit.VideoLayer",(()=>[{no:1,name:"quality",kind:"enum",T:DA.getEnumType(JA)},{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}])),de=DA.makeMessageType("livekit.DataPacket",(()=>[{no:1,name:"kind",kind:"enum",T:DA.getEnumType(le)},{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:ge,oneof:"value"},{no:3,name:"speaker",kind:"message",T:ue,oneof:"value"},{no:6,name:"sip_dtmf",kind:"message",T:pe,oneof:"value"},{no:7,name:"transcription",kind:"message",T:me,oneof:"value"},{no:8,name:"metrics",kind:"message",T:MA,oneof:"value"},{no:9,name:"chat_message",kind:"message",T:Be,oneof:"value"},{no:10,name:"rpc_request",kind:"message",T:we,oneof:"value"},{no:11,name:"rpc_ack",kind:"message",T:ve,oneof:"value"},{no:12,name:"rpc_response",kind:"message",T:Ce,oneof:"value"},{no:13,name:"stream_header",kind:"message",T:De,oneof:"value"},{no:14,name:"stream_chunk",kind:"message",T:xe,oneof:"value"},{no:15,name:"stream_trailer",kind:"message",T:Le,oneof:"value"}])),le=DA.makeEnum("livekit.DataPacket.Kind",[{no:0,name:"RELIABLE"},{no:1,name:"LOSSY"}]),ue=DA.makeMessageType("livekit.ActiveSpeakerUpdate",(()=>[{no:1,name:"speakers",kind:"message",T:he,repeated:!0}])),he=DA.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}])),ge=DA.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}])),pe=DA.makeMessageType("livekit.SipDTMF",(()=>[{no:3,name:"code",kind:"scalar",T:13},{no:4,name:"digit",kind:"scalar",T:9}])),me=DA.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:fe,repeated:!0}])),fe=DA.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}])),Be=DA.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}])),we=DA.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}])),ve=DA.makeMessageType("livekit.RpcAck",(()=>[{no:1,name:"request_id",kind:"scalar",T:9}])),Ce=DA.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:ye,oneof:"value"}])),ye=DA.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}])),be=DA.makeMessageType("livekit.ParticipantTracks",(()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sids",kind:"scalar",T:9,repeated:!0}])),Qe=DA.makeMessageType("livekit.ServerInfo",(()=>[{no:1,name:"edition",kind:"enum",T:DA.getEnumType(Ue)},{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}])),Ue=DA.makeEnum("livekit.ServerInfo.Edition",[{no:0,name:"Standard"},{no:1,name:"Cloud"}]),ke=DA.makeMessageType("livekit.ClientInfo",(()=>[{no:1,name:"sdk",kind:"enum",T:DA.getEnumType(Ee)},{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}])),Ee=DA.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"}]),Fe=DA.makeMessageType("livekit.ClientConfiguration",(()=>[{no:1,name:"video",kind:"message",T:Te},{no:2,name:"screen",kind:"message",T:Te},{no:3,name:"resume_connection",kind:"enum",T:DA.getEnumType(XA)},{no:4,name:"disabled_codecs",kind:"message",T:Se},{no:5,name:"force_relay",kind:"enum",T:DA.getEnumType(XA)}])),Te=DA.makeMessageType("livekit.VideoConfiguration",(()=>[{no:1,name:"hardware_encoder",kind:"enum",T:DA.getEnumType(XA)}])),Se=DA.makeMessageType("livekit.DisabledCodecs",(()=>[{no:1,name:"codecs",kind:"message",T:Ae,repeated:!0},{no:2,name:"publish",kind:"message",T:Ae,repeated:!0}])),Ie=DA.makeMessageType("livekit.TimedVersion",(()=>[{no:1,name:"unix_micro",kind:"scalar",T:3},{no:2,name:"ticks",kind:"scalar",T:5}])),Pe=DA.makeEnum("livekit.DataStream.OperationType",[{no:0,name:"CREATE"},{no:1,name:"UPDATE"},{no:2,name:"DELETE"},{no:3,name:"REACTION"}]),He=DA.makeMessageType("livekit.DataStream.TextHeader",(()=>[{no:1,name:"operation_type",kind:"enum",T:DA.getEnumType(Pe)},{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"}),Re=DA.makeMessageType("livekit.DataStream.ByteHeader",(()=>[{no:1,name:"name",kind:"scalar",T:9}]),{localName:"DataStream_ByteHeader"}),De=DA.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:DA.getEnumType(se)},{no:8,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:9,name:"text_header",kind:"message",T:He,oneof:"content_header"},{no:10,name:"byte_header",kind:"message",T:Re,oneof:"content_header"}]),{localName:"DataStream_Header"}),xe=DA.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"}),Le=DA.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"}),Oe=DA.makeEnum("livekit.SignalTarget",[{no:0,name:"PUBLISHER"},{no:1,name:"SUBSCRIBER"}]),Me=DA.makeEnum("livekit.StreamState",[{no:0,name:"ACTIVE"},{no:1,name:"PAUSED"}]),Ne=DA.makeEnum("livekit.CandidateProtocol",[{no:0,name:"UDP"},{no:1,name:"TCP"},{no:2,name:"TLS"}]),Ke=DA.makeMessageType("livekit.SignalRequest",(()=>[{no:1,name:"offer",kind:"message",T:$e,oneof:"message"},{no:2,name:"answer",kind:"message",T:$e,oneof:"message"},{no:3,name:"trickle",kind:"message",T:je,oneof:"message"},{no:4,name:"add_track",kind:"message",T:Ge,oneof:"message"},{no:5,name:"mute",kind:"message",T:Je,oneof:"message"},{no:6,name:"subscription",kind:"message",T:ze,oneof:"message"},{no:7,name:"track_setting",kind:"message",T:At,oneof:"message"},{no:8,name:"leave",kind:"message",T:nt,oneof:"message"},{no:10,name:"update_layers",kind:"message",T:rt,oneof:"message"},{no:11,name:"subscription_permission",kind:"message",T:Bt,oneof:"message"},{no:12,name:"sync_state",kind:"message",T:Ct,oneof:"message"},{no:13,name:"simulate",kind:"message",T:bt,oneof:"message"},{no:14,name:"ping",kind:"scalar",T:3,oneof:"message"},{no:15,name:"update_metadata",kind:"message",T:st,oneof:"message"},{no:16,name:"ping_req",kind:"message",T:Qt,oneof:"message"},{no:17,name:"update_audio_track",kind:"message",T:et,oneof:"message"},{no:18,name:"update_video_track",kind:"message",T:tt,oneof:"message"}])),_e=DA.makeMessageType("livekit.SignalResponse",(()=>[{no:1,name:"join",kind:"message",T:We,oneof:"message"},{no:2,name:"answer",kind:"message",T:$e,oneof:"message"},{no:3,name:"offer",kind:"message",T:$e,oneof:"message"},{no:4,name:"trickle",kind:"message",T:je,oneof:"message"},{no:5,name:"update",kind:"message",T:Ze,oneof:"message"},{no:6,name:"track_published",kind:"message",T:Ye,oneof:"message"},{no:8,name:"leave",kind:"message",T:nt,oneof:"message"},{no:9,name:"mute",kind:"message",T:Je,oneof:"message"},{no:10,name:"speakers_changed",kind:"message",T:at,oneof:"message"},{no:11,name:"room_update",kind:"message",T:ct,oneof:"message"},{no:12,name:"connection_quality",kind:"message",T:lt,oneof:"message"},{no:13,name:"stream_state_update",kind:"message",T:ht,oneof:"message"},{no:14,name:"subscribed_quality_update",kind:"message",T:mt,oneof:"message"},{no:15,name:"subscription_permission_update",kind:"message",T:wt,oneof:"message"},{no:16,name:"refresh_token",kind:"scalar",T:9,oneof:"message"},{no:17,name:"track_unpublished",kind:"message",T:qe,oneof:"message"},{no:18,name:"pong",kind:"scalar",T:3,oneof:"message"},{no:19,name:"reconnect",kind:"message",T:Xe,oneof:"message"},{no:20,name:"pong_resp",kind:"message",T:Ut,oneof:"message"},{no:21,name:"subscription_response",kind:"message",T:Ft,oneof:"message"},{no:22,name:"request_response",kind:"message",T:Tt,oneof:"message"},{no:23,name:"track_subscribed",kind:"message",T:It,oneof:"message"},{no:24,name:"room_moved",kind:"message",T:vt,oneof:"message"}])),Ve=DA.makeMessageType("livekit.SimulcastCodec",(()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"cid",kind:"scalar",T:9}])),Ge=DA.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:DA.getEnumType(GA)},{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:DA.getEnumType(jA)},{no:9,name:"layers",kind:"message",T:ce,repeated:!0},{no:10,name:"simulcast_codecs",kind:"message",T:Ve,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:DA.getEnumType(se)},{no:15,name:"stream",kind:"scalar",T:9},{no:16,name:"backup_codec_policy",kind:"enum",T:DA.getEnumType(VA)},{no:17,name:"audio_features",kind:"enum",T:DA.getEnumType(ZA),repeated:!0}])),je=DA.makeMessageType("livekit.TrickleRequest",(()=>[{no:1,name:"candidateInit",kind:"scalar",T:9},{no:2,name:"target",kind:"enum",T:DA.getEnumType(Oe)},{no:3,name:"final",kind:"scalar",T:8}])),Je=DA.makeMessageType("livekit.MuteTrackRequest",(()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"muted",kind:"scalar",T:8}])),We=DA.makeMessageType("livekit.JoinResponse",(()=>[{no:1,name:"room",kind:"message",T:zA},{no:2,name:"participant",kind:"message",T:te},{no:3,name:"other_participants",kind:"message",T:te,repeated:!0},{no:4,name:"server_version",kind:"scalar",T:9},{no:5,name:"ice_servers",kind:"message",T:ot,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:Fe},{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:Qe},{no:13,name:"sif_trailer",kind:"scalar",T:12},{no:14,name:"enabled_publish_codecs",kind:"message",T:Ae,repeated:!0},{no:15,name:"fast_publish",kind:"scalar",T:8}])),Xe=DA.makeMessageType("livekit.ReconnectResponse",(()=>[{no:1,name:"ice_servers",kind:"message",T:ot,repeated:!0},{no:2,name:"client_configuration",kind:"message",T:Fe}])),Ye=DA.makeMessageType("livekit.TrackPublishedResponse",(()=>[{no:1,name:"cid",kind:"scalar",T:9},{no:2,name:"track",kind:"message",T:ae}])),qe=DA.makeMessageType("livekit.TrackUnpublishedResponse",(()=>[{no:1,name:"track_sid",kind:"scalar",T:9}])),$e=DA.makeMessageType("livekit.SessionDescription",(()=>[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"sdp",kind:"scalar",T:9}])),Ze=DA.makeMessageType("livekit.ParticipantUpdate",(()=>[{no:1,name:"participants",kind:"message",T:te,repeated:!0}])),ze=DA.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:be,repeated:!0}])),At=DA.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:DA.getEnumType(JA)},{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}])),et=DA.makeMessageType("livekit.UpdateLocalAudioTrack",(()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"features",kind:"enum",T:DA.getEnumType(ZA),repeated:!0}])),tt=DA.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}])),nt=DA.makeMessageType("livekit.LeaveRequest",(()=>[{no:1,name:"can_reconnect",kind:"scalar",T:8},{no:2,name:"reason",kind:"enum",T:DA.getEnumType(YA)},{no:3,name:"action",kind:"enum",T:DA.getEnumType(it)},{no:4,name:"regions",kind:"message",T:kt}])),it=DA.makeEnum("livekit.LeaveRequest.Action",[{no:0,name:"DISCONNECT"},{no:1,name:"RESUME"},{no:2,name:"RECONNECT"}]),rt=DA.makeMessageType("livekit.UpdateVideoLayers",(()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"layers",kind:"message",T:ce,repeated:!0}])),st=DA.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}])),ot=DA.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}])),at=DA.makeMessageType("livekit.SpeakersChanged",(()=>[{no:1,name:"speakers",kind:"message",T:he,repeated:!0}])),ct=DA.makeMessageType("livekit.RoomUpdate",(()=>[{no:1,name:"room",kind:"message",T:zA}])),dt=DA.makeMessageType("livekit.ConnectionQualityInfo",(()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"quality",kind:"enum",T:DA.getEnumType(WA)},{no:3,name:"score",kind:"scalar",T:2}])),lt=DA.makeMessageType("livekit.ConnectionQualityUpdate",(()=>[{no:1,name:"updates",kind:"message",T:dt,repeated:!0}])),ut=DA.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:DA.getEnumType(Me)}])),ht=DA.makeMessageType("livekit.StreamStateUpdate",(()=>[{no:1,name:"stream_states",kind:"message",T:ut,repeated:!0}])),gt=DA.makeMessageType("livekit.SubscribedQuality",(()=>[{no:1,name:"quality",kind:"enum",T:DA.getEnumType(JA)},{no:2,name:"enabled",kind:"scalar",T:8}])),pt=DA.makeMessageType("livekit.SubscribedCodec",(()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"qualities",kind:"message",T:gt,repeated:!0}])),mt=DA.makeMessageType("livekit.SubscribedQualityUpdate",(()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"subscribed_qualities",kind:"message",T:gt,repeated:!0},{no:3,name:"subscribed_codecs",kind:"message",T:pt,repeated:!0}])),ft=DA.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}])),Bt=DA.makeMessageType("livekit.SubscriptionPermission",(()=>[{no:1,name:"all_participants",kind:"scalar",T:8},{no:2,name:"track_permissions",kind:"message",T:ft,repeated:!0}])),wt=DA.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}])),vt=DA.makeMessageType("livekit.RoomMovedResponse",(()=>[{no:1,name:"room",kind:"message",T:zA},{no:2,name:"token",kind:"scalar",T:9},{no:3,name:"participant",kind:"message",T:te},{no:4,name:"other_participants",kind:"message",T:te,repeated:!0}])),Ct=DA.makeMessageType("livekit.SyncState",(()=>[{no:1,name:"answer",kind:"message",T:$e},{no:2,name:"subscription",kind:"message",T:ze},{no:3,name:"publish_tracks",kind:"message",T:Ye,repeated:!0},{no:4,name:"data_channels",kind:"message",T:yt,repeated:!0},{no:5,name:"offer",kind:"message",T:$e},{no:6,name:"track_sids_disabled",kind:"scalar",T:9,repeated:!0}])),yt=DA.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:DA.getEnumType(Oe)}])),bt=DA.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:DA.getEnumType(Ne),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"}])),Qt=DA.makeMessageType("livekit.Ping",(()=>[{no:1,name:"timestamp",kind:"scalar",T:3},{no:2,name:"rtt",kind:"scalar",T:3}])),Ut=DA.makeMessageType("livekit.Pong",(()=>[{no:1,name:"last_ping_timestamp",kind:"scalar",T:3},{no:2,name:"timestamp",kind:"scalar",T:3}])),kt=DA.makeMessageType("livekit.RegionSettings",(()=>[{no:1,name:"regions",kind:"message",T:Et,repeated:!0}])),Et=DA.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}])),Ft=DA.makeMessageType("livekit.SubscriptionResponse",(()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"err",kind:"enum",T:DA.getEnumType($A)}])),Tt=DA.makeMessageType("livekit.RequestResponse",(()=>[{no:1,name:"request_id",kind:"scalar",T:13},{no:2,name:"reason",kind:"enum",T:DA.getEnumType(St)},{no:3,name:"message",kind:"scalar",T:9}])),St=DA.makeEnum("livekit.RequestResponse.Reason",[{no:0,name:"OK"},{no:1,name:"NOT_FOUND"},{no:2,name:"NOT_ALLOWED"},{no:3,name:"LIMIT_EXCEEDED"}]),It=DA.makeMessageType("livekit.TrackSubscribed",(()=>[{no:1,name:"track_sid",kind:"scalar",T:9}]));function Pt(A){return A&&A.__esModule&&Object.prototype.hasOwnProperty.call(A,"default")?A.default:A}var Ht,Rt,Dt,xt,Lt,Ot,Mt,Nt,Kt={exports:{}},_t=(Ht||(Ht=1,Dt=Kt.exports,xt=function(){var A=function(){},e="undefined",t=typeof window!==e&&typeof window.navigator!==e&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"],i={},r=null;function s(A,e){var t=A[e];if("function"==typeof t.bind)return t.bind(A);try{return Function.prototype.bind.call(t,A)}catch(n){return function(){return Function.prototype.apply.apply(t,[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 t=this.getLevel(),i=0;i<n.length;i++){var r=n[i];this[r]=i<t?A:this.methodFactory(r,t,this.name)}if(this.log=this.debug,typeof console===e&&t<this.levels.SILENT)return"No console available for logging"}function c(A){return function(){typeof console!==e&&(a.call(this),this[A].apply(this,arguments))}}function d(n,i,r){return function(n){return"debug"===n&&(n="log"),typeof console!==e&&("trace"===n&&t?o:void 0!==console[n]?s(console,n):void 0!==console.log?s(console,"log"):A)}(n)||c.apply(this,arguments)}function l(A,t){var s,o,c,l=this,u="loglevel";function h(){var A;if(typeof window!==e&&u){try{A=window.localStorage[u]}catch(r){}if(typeof A===e)try{var t=window.document.cookie,n=encodeURIComponent(u),i=t.indexOf(n+"=");-1!==i&&(A=/^([^;]+)/.exec(t.slice(i+n.length+1))[1])}catch(r){}return void 0===l.levels[A]&&(A=void 0),A}}function g(A){var e=A;if("string"==typeof e&&void 0!==l.levels[e.toUpperCase()]&&(e=l.levels[e.toUpperCase()]),"number"==typeof e&&e>=0&&e<=l.levels.SILENT)return e;throw new TypeError("log.setLevel() called with invalid level: "+A)}"string"==typeof A?u+=":"+A:"symbol"==typeof A&&(u=void 0),l.name=A,l.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},l.methodFactory=t||d,l.getLevel=function(){return null!=c?c:null!=o?o:s},l.setLevel=function(A,t){return c=g(A),!1!==t&&function(A){var t=(n[A]||"silent").toUpperCase();if(typeof window!==e&&u){try{return void(window.localStorage[u]=t)}catch(i){}try{window.document.cookie=encodeURIComponent(u)+"="+t+";"}catch(i){}}}(c),a.call(l)},l.setDefaultLevel=function(A){o=g(A),h()||l.setLevel(A,!1)},l.resetLevel=function(){c=null,function(){if(typeof window!==e&&u){try{window.localStorage.removeItem(u)}catch(A){}try{window.document.cookie=encodeURIComponent(u)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(A){}}}(),a.call(l)},l.enableAll=function(A){l.setLevel(l.levels.TRACE,A)},l.disableAll=function(A){l.setLevel(l.levels.SILENT,A)},l.rebuild=function(){if(r!==l&&(s=g(r.getLevel())),a.call(l),r===l)for(var A in i)i[A].rebuild()},s=g(r?r.getLevel():"WARN");var p=h();null!=p&&(c=g(p)),a.call(l)}(r=new l).getLogger=function(A){if("symbol"!=typeof A&&"string"!=typeof A||""===A)throw new TypeError("You must supply a name when creating a logger.");var e=i[A];return e||(e=i[A]=new l(A,r.methodFactory)),e};var u=typeof window!==e?window.log:void 0;return r.noConflict=function(){return typeof window!==e&&window.log===r&&(window.log=u),r},r.getLoggers=function(){return i},r.default=r,r},(Rt=Kt).exports?Rt.exports=xt():Dt.log=xt()),Kt.exports);(Ot=Lt||(Lt={}))[Ot.trace=0]="trace",Ot[Ot.debug=1]="debug",Ot[Ot.info=2]="info",Ot[Ot.warn=3]="warn",Ot[Ot.error=4]="error",Ot[Ot.silent=5]="silent",(Nt=Mt||(Mt={})).Default="livekit",Nt.Room="livekit-room",Nt.Participant="livekit-participant",Nt.Track="livekit-track",Nt.Publication="livekit-track-publication",Nt.Engine="livekit-engine",Nt.Signal="livekit-signal",Nt.PCManager="livekit-pc-manager",Nt.PCTransport="livekit-pc-transport",Nt.E2EE="lk-e2ee";let Vt=_t.getLogger("livekit");function Gt(A){const e=_t.getLogger(A);return e.setDefaultLevel(Vt.getLevel()),e}Object.values(Mt).map((A=>_t.getLogger(A))),Vt.setDefaultLevel(Lt.info);const jt=_t.getLogger("lk-e2ee"),Jt=7e3,Wt=[0,300,1200,2700,4800,Jt,Jt,Jt,Jt,Jt];function Xt(A,e,t,n){return new(t||(t=Promise))((function(i,r){function s(A){try{a(n.next(A))}catch(e){r(e)}}function o(A){try{a(n.throw(A))}catch(e){r(e)}}function a(A){var e;A.done?i(A.value):(e=A.value,e instanceof t?e:new t((function(A){A(e)}))).then(s,o)}a((n=n.apply(A,e||[])).next())}))}function Yt(A){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,t=A[Symbol.asyncIterator];return t?t.call(A):(A=function(A){var e="function"==typeof Symbol&&Symbol.iterator,t=e&&A[e],n=0;if(t)return t.call(A);if(A&&"number"==typeof A.length)return{next:function(){return A&&n>=A.length&&(A=void 0),{value:A&&A[n++],done:!A}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(A),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(t){e[t]=A[t]&&function(e){return new Promise((function(n,i){!function(A,e,t,n){Promise.resolve(n).then((function(e){A({value:e,done:t})}),e)}(n,i,(e=A[t](e)).done,e.value)}))}}}"function"==typeof SuppressedError&&SuppressedError;var qt,$t={exports:{}},Zt=function(){if(qt)return $t.exports;qt=1;var A,e="object"==typeof Reflect?Reflect:null,t=e&&"function"==typeof e.apply?e.apply:function(A,e,t){return Function.prototype.apply.call(A,e,t)};A=e&&"function"==typeof e.ownKeys?e.ownKeys:Object.getOwnPropertySymbols?function(A){return Object.getOwnPropertyNames(A).concat(Object.getOwnPropertySymbols(A))}:function(A){return Object.getOwnPropertyNames(A)};var n=Number.isNaN||function(A){return A!=A};function i(){i.init.call(this)}$t.exports=i,$t.exports.once=function(A,e){return new Promise((function(t,n){function i(t){A.removeListener(e,r),n(t)}function r(){"function"==typeof A.removeListener&&A.removeListener("error",i),t([].slice.call(arguments))}g(A,e,r,{once:!0}),"error"!==e&&function(A,e){"function"==typeof A.on&&g(A,"error",e,{once:!0})}(A,i)}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var r=10;function s(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._maxListeners?i.defaultMaxListeners:A._maxListeners}function a(A,e,t,n){var i,r,a,c;if(s(t),void 0===(r=A._events)?(r=A._events=Object.create(null),A._eventsCount=0):(void 0!==r.newListener&&(A.emit("newListener",e,t.listener?t.listener:t),r=A._events),a=r[e]),void 0===a)a=r[e]=t,++A._eventsCount;else if("function"==typeof a?a=r[e]=n?[t,a]:[a,t]:n?a.unshift(t):a.push(t),(i=o(A))>0&&a.length>i&&!a.warned){a.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=A,d.type=e,d.count=a.length,c=d,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 d(A,e,t){var n={fired:!1,wrapFn:void 0,target:A,type:e,listener:t},i=c.bind(n);return i.listener=t,n.wrapFn=i,i}function l(A,e,t){var n=A._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?t?[i.listener||i]:[i]:t?function(A){for(var e=new Array(A.length),t=0;t<e.length;++t)e[t]=A[t].listener||A[t];return e}(i):h(i,i.length)}function u(A){var e=this._events;if(void 0!==e){var t=e[A];if("function"==typeof t)return 1;if(void 0!==t)return t.length}return 0}function h(A,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=A[n];return t}function g(A,e,t,n){if("function"==typeof A.on)n.once?A.once(e,t):A.on(e,t);else{if("function"!=typeof A.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof A);A.addEventListener(e,(function i(r){n.once&&A.removeEventListener(e,i),t(r)}))}}return Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return r},set:function(A){if("number"!=typeof A||A<0||n(A))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+A+".");r=A}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(A){if("number"!=typeof A||A<0||n(A))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+A+".");return this._maxListeners=A,this},i.prototype.getMaxListeners=function(){return o(this)},i.prototype.emit=function(A){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var i="error"===A,r=this._events;if(void 0!==r)i=i&&void 0===r.error;else if(!i)return!1;if(i){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var a=r[A];if(void 0===a)return!1;if("function"==typeof a)t(a,this,e);else{var c=a.length,d=h(a,c);for(n=0;n<c;++n)t(d[n],this,e)}return!0},i.prototype.addListener=function(A,e){return a(this,A,e,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(A,e){return a(this,A,e,!0)},i.prototype.once=function(A,e){return s(e),this.on(A,d(this,A,e)),this},i.prototype.prependOnceListener=function(A,e){return s(e),this.prependListener(A,d(this,A,e)),this},i.prototype.removeListener=function(A,e){var t,n,i,r,o;if(s(e),void 0===(n=this._events))return this;if(void 0===(t=n[A]))return this;if(t===e||t.listener===e)0===--this._eventsCount?this._events=Object.create(null):(delete n[A],n.removeListener&&this.emit("removeListener",A,t.listener||e));else if("function"!=typeof t){for(i=-1,r=t.length-1;r>=0;r--)if(t[r]===e||t[r].listener===e){o=t[r].listener,i=r;break}if(i<0)return this;0===i?t.shift():function(A,e){for(;e+1<A.length;e++)A[e]=A[e+1];A.pop()}(t,i),1===t.length&&(n[A]=t[0]),void 0!==n.removeListener&&this.emit("removeListener",A,o||e)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(A){var e,t,n;if(void 0===(t=this._events))return this;if(void 0===t.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==t[A]&&(0===--this._eventsCount?this._events=Object.create(null):delete t[A]),this;if(0===arguments.length){var i,r=Object.keys(t);for(n=0;n<r.length;++n)"removeListener"!==(i=r[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=t[A]))this.removeListener(A,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(A,e[n]);return this},i.prototype.listeners=function(A){return l(this,A,!0)},i.prototype.rawListeners=function(A){return l(this,A,!1)},i.listenerCount=function(A,e){return"function"==typeof A.listenerCount?A.listenerCount(e):u.call(A,e)},i.prototype.listenerCount=u,i.prototype.eventNames=function(){return this._eventsCount>0?A(this._events):[]},$t.exports}();let zt=!0,An=!0;function en(A,e,t){const n=A.match(e);return n&&n.length>=t&&parseInt(n[t],10)}function tn(A,e,t){if(!A.RTCPeerConnection)return;const n=A.RTCPeerConnection.prototype,i=n.addEventListener;n.addEventListener=function(A,n){if(A!==e)return i.apply(this,arguments);const r=A=>{const e=t(A);e&&(n.handleEvent?n.handleEvent(e):n(e))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(n,r),i.apply(this,[A,r])};const r=n.removeEventListener;n.removeEventListener=function(A,t){if(A!==e||!this._eventMap||!this._eventMap[e])return r.apply(this,arguments);if(!this._eventMap[e].has(t))return r.apply(this,arguments);const n=this._eventMap[e].get(t);return this._eventMap[e].delete(t),0===this._eventMap[e].size&&delete this._eventMap[e],0===Object.keys(this._eventMap).length&&delete this._eventMap,r.apply(this,[A,n])},Object.defineProperty(n,"on"+e,{get(){return this["_on"+e]},set(A){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),A&&this.addEventListener(e,this["_on"+e]=A)},enumerable:!0,configurable:!0})}function nn(A){return"boolean"!=typeof A?new Error("Argument type: "+typeof A+". Please use a boolean."):(zt=A,A?"adapter.js logging disabled":"adapter.js logging enabled")}function rn(A){return"boolean"!=typeof A?new Error("Argument type: "+typeof A+". Please use a boolean."):(An=!A,"adapter.js deprecation warnings "+(A?"disabled":"enabled"))}function sn(){if("object"==typeof window){if(zt)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function on(A,e){An&&console.warn(A+" is deprecated, please use "+e+" instead.")}function an(A){return"[object Object]"===Object.prototype.toString.call(A)}function cn(A){return an(A)?Object.keys(A).reduce((function(e,t){const n=an(A[t]),i=n?cn(A[t]):A[t],r=n&&!Object.keys(i).length;return void 0===i||r?e:Object.assign(e,{[t]:i})}),{}):A}function dn(A,e,t){e&&!t.has(e.id)&&(t.set(e.id,e),Object.keys(e).forEach((n=>{n.endsWith("Id")?dn(A,A.get(e[n]),t):n.endsWith("Ids")&&e[n].forEach((e=>{dn(A,A.get(e),t)}))})))}function ln(A,e,t){const n=t?"outbound-rtp":"inbound-rtp",i=new Map;if(null===e)return i;const r=[];return A.forEach((A=>{"track"===A.type&&A.trackIdentifier===e.id&&r.push(A)})),r.forEach((e=>{A.forEach((t=>{t.type===n&&t.trackId===e.id&&dn(A,t,i)}))})),i}const un=sn;function hn(A,e){const t=A&&A.navigator;if(!t.mediaDevices)return;const n=function(A){if("object"!=typeof A||A.mandatory||A.optional)return A;const e={};return Object.keys(A).forEach((t=>{if("require"===t||"advanced"===t||"mediaSource"===t)return;const n="object"==typeof A[t]?A[t]:{ideal:A[t]};void 0!==n.exact&&"number"==typeof n.exact&&(n.min=n.max=n.exact);const i=function(A,e){return A?A+e.charAt(0).toUpperCase()+e.slice(1):"deviceId"===e?"sourceId":e};if(void 0!==n.ideal){e.optional=e.optional||[];let A={};"number"==typeof n.ideal?(A[i("min",t)]=n.ideal,e.optional.push(A),A={},A[i("max",t)]=n.ideal,e.optional.push(A)):(A[i("",t)]=n.ideal,e.optional.push(A))}void 0!==n.exact&&"number"!=typeof n.exact?(e.mandatory=e.mandatory||{},e.mandatory[i("",t)]=n.exact):["min","max"].forEach((A=>{void 0!==n[A]&&(e.mandatory=e.mandatory||{},e.mandatory[i(A,t)]=n[A])}))})),A.advanced&&(e.optional=(e.optional||[]).concat(A.advanced)),e},i=function(A,i){if(e.version>=61)return i(A);if((A=JSON.parse(JSON.stringify(A)))&&"object"==typeof A.audio){const e=function(A,e,t){e in A&&!(t in A)&&(A[t]=A[e],delete A[e])};e((A=JSON.parse(JSON.stringify(A))).audio,"autoGainControl","googAutoGainControl"),e(A.audio,"noiseSuppression","googNoiseSuppression"),A.audio=n(A.audio)}if(A&&"object"==typeof A.video){let r=A.video.facingMode;r=r&&("object"==typeof r?r:{ideal:r});const s=e.version<66;if(r&&("user"===r.exact||"environment"===r.exact||"user"===r.ideal||"environment"===r.ideal)&&(!t.mediaDevices.getSupportedConstraints||!t.mediaDevices.getSupportedConstraints().facingMode||s)){let e;if(delete A.video.facingMode,"environment"===r.exact||"environment"===r.ideal?e=["back","rear"]:"user"!==r.exact&&"user"!==r.ideal||(e=["front"]),e)return t.mediaDevices.enumerateDevices().then((t=>{let s=(t=t.filter((A=>"videoinput"===A.kind))).find((A=>e.some((e=>A.label.toLowerCase().includes(e)))));return!s&&t.length&&e.includes("back")&&(s=t[t.length-1]),s&&(A.video.deviceId=r.exact?{exact:s.deviceId}:{ideal:s.deviceId}),A.video=n(A.video),un("chrome: "+JSON.stringify(A)),i(A)}))}A.video=n(A.video)}return un("chrome: "+JSON.stringify(A)),i(A)},r=function(A){return e.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(t.getUserMedia=function(A,e,n){i(A,(A=>{t.webkitGetUserMedia(A,e,(A=>{n&&n(r(A))}))}))}.bind(t),t.mediaDevices.getUserMedia){const A=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return i(e,(e=>A(e).then((A=>{if(e.audio&&!A.getAudioTracks().length||e.video&&!A.getVideoTracks().length)throw A.getTracks().forEach((A=>{A.stop()})),new DOMException("","NotFoundError");return A}),(A=>Promise.reject(r(A))))))}}}function gn(A){A.MediaStream=A.MediaStream||A.webkitMediaStream}function pn(A){if("object"==typeof A&&A.RTCPeerConnection&&!("ontrack"in A.RTCPeerConnection.prototype)){Object.defineProperty(A.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=A.RTCPeerConnection.prototype.setRemoteDescription;A.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=e=>{e.stream.addEventListener("addtrack",(t=>{let n;n=A.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((A=>A.track&&A.track.id===t.track.id)):{track:t.track};const i=new Event("track");i.track=t.track,i.receiver=n,i.transceiver={receiver:n},i.streams=[e.stream],this.dispatchEvent(i)})),e.stream.getTracks().forEach((t=>{let n;n=A.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((A=>A.track&&A.track.id===t.id)):{track:t};const i=new Event("track");i.track=t,i.receiver=n,i.transceiver={receiver:n},i.streams=[e.stream],this.dispatchEvent(i)}))},this.addEventListener("addstream",this._ontrackpoly)),e.apply(this,arguments)}}else tn(A,"track",(A=>(A.transceiver||Object.defineProperty(A,"transceiver",{value:{receiver:A.receiver}}),A)))}function mn(A){if("object"==typeof A&&A.RTCPeerConnection&&!("getSenders"in A.RTCPeerConnection.prototype)&&"createDTMFSender"in A.RTCPeerConnection.prototype){const e=function(A,e){return{track:e,get dtmf(){return void 0===this._dtmf&&("audio"===e.kind?this._dtmf=A.createDTMFSender(e):this._dtmf=null),this._dtmf},_pc:A}};if(!A.RTCPeerConnection.prototype.getSenders){A.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const t=A.RTCPeerConnection.prototype.addTrack;A.RTCPeerConnection.prototype.addTrack=function(A,n){let i=t.apply(this,arguments);return i||(i=e(this,A),this._senders.push(i)),i};const n=A.RTCPeerConnection.prototype.removeTrack;A.RTCPeerConnection.prototype.removeTrack=function(A){n.apply(this,arguments);const e=this._senders.indexOf(A);-1!==e&&this._senders.splice(e,1)}}const t=A.RTCPeerConnection.prototype.addStream;A.RTCPeerConnection.prototype.addStream=function(A){this._senders=this._senders||[],t.apply(this,[A]),A.getTracks().forEach((A=>{this._senders.push(e(this,A))}))};const n=A.RTCPeerConnection.prototype.removeStream;A.RTCPeerConnection.prototype.removeStream=function(A){this._senders=this._senders||[],n.apply(this,[A]),A.getTracks().forEach((A=>{const e=this._senders.find((e=>e.track===A));e&&this._senders.splice(this._senders.indexOf(e),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 e=A.RTCPeerConnection.prototype.getSenders;A.RTCPeerConnection.prototype.getSenders=function(){const A=e.apply(this,[]);return A.forEach((A=>A._pc=this)),A},Object.defineProperty(A.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function fn(A){if(!("object"==typeof A&&A.RTCPeerConnection&&A.RTCRtpSender&&A.RTCRtpReceiver))return;if(!("getStats"in A.RTCRtpSender.prototype)){const e=A.RTCPeerConnection.prototype.getSenders;e&&(A.RTCPeerConnection.prototype.getSenders=function(){const A=e.apply(this,[]);return A.forEach((A=>A._pc=this)),A});const t=A.RTCPeerConnection.prototype.addTrack;t&&(A.RTCPeerConnection.prototype.addTrack=function(){const A=t.apply(this,arguments);return A._pc=this,A}),A.RTCRtpSender.prototype.getStats=function(){const A=this;return this._pc.getStats().then((e=>ln(e,A.track,!0)))}}if(!("getStats"in A.RTCRtpReceiver.prototype)){const e=A.RTCPeerConnection.prototype.getReceivers;e&&(A.RTCPeerConnection.prototype.getReceivers=function(){const A=e.apply(this,[]);return A.forEach((A=>A._pc=this)),A}),tn(A,"track",(A=>(A.receiver._pc=A.srcElement,A))),A.RTCRtpReceiver.prototype.getStats=function(){const A=this;return this._pc.getStats().then((e=>ln(e,A.track,!1)))}}if(!("getStats"in A.RTCRtpSender.prototype)||!("getStats"in A.RTCRtpReceiver.prototype))return;const e=A.RTCPeerConnection.prototype.getStats;A.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof A.MediaStreamTrack){const A=arguments[0];let e,t,n;return this.getSenders().forEach((t=>{t.track===A&&(e?n=!0:e=t)})),this.getReceivers().forEach((e=>(e.track===A&&(t?n=!0:t=e),e.track===A))),n||e&&t?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):e?e.getStats():t?t.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return e.apply(this,arguments)}}function Bn(A){A.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((A=>this._shimmedLocalStreams[A][0]))};const e=A.RTCPeerConnection.prototype.addTrack;A.RTCPeerConnection.prototype.addTrack=function(A,t){if(!t)return e.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const n=e.apply(this,arguments);return this._shimmedLocalStreams[t.id]?-1===this._shimmedLocalStreams[t.id].indexOf(n)&&this._shimmedLocalStreams[t.id].push(n):this._shimmedLocalStreams[t.id]=[t,n],n};const t=A.RTCPeerConnection.prototype.addStream;A.RTCPeerConnection.prototype.addStream=function(A){this._shimmedLocalStreams=this._shimmedLocalStreams||{},A.getTracks().forEach((A=>{if(this.getSenders().find((e=>e.track===A)))throw new DOMException("Track already exists.","InvalidAccessError")}));const e=this.getSenders();t.apply(this,arguments);const n=this.getSenders().filter((A=>-1===e.indexOf(A)));this._shimmedLocalStreams[A.id]=[A].concat(n)};const n=A.RTCPeerConnection.prototype.removeStream;A.RTCPeerConnection.prototype.removeStream=function(A){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[A.id],n.apply(this,arguments)};const i=A.RTCPeerConnection.prototype.removeTrack;A.RTCPeerConnection.prototype.removeTrack=function(A){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},A&&Object.keys(this._shimmedLocalStreams).forEach((e=>{const t=this._shimmedLocalStreams[e].indexOf(A);-1!==t&&this._shimmedLocalStreams[e].splice(t,1),1===this._shimmedLocalStreams[e].length&&delete this._shimmedLocalStreams[e]})),i.apply(this,arguments)}}function wn(A,e){if(!A.RTCPeerConnection)return;if(A.RTCPeerConnection.prototype.addTrack&&e.version>=65)return Bn(A);const t=A.RTCPeerConnection.prototype.getLocalStreams;A.RTCPeerConnection.prototype.getLocalStreams=function(){const A=t.apply(this);return this._reverseStreams=this._reverseStreams||{},A.map((A=>this._reverseStreams[A.id]))};const n=A.RTCPeerConnection.prototype.addStream;A.RTCPeerConnection.prototype.addStream=function(e){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},e.getTracks().forEach((A=>{if(this.getSenders().find((e=>e.track===A)))throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[e.id]){const t=new A.MediaStream(e.getTracks());this._streams[e.id]=t,this._reverseStreams[t.id]=e,e=t}n.apply(this,[e])};const i=A.RTCPeerConnection.prototype.removeStream;function r(A,e){let t=e.sdp;return Object.keys(A._reverseStreams||[]).forEach((e=>{const n=A._reverseStreams[e],i=A._streams[n.id];t=t.replace(new RegExp(i.id,"g"),n.id)})),new RTCSessionDescription({type:e.type,sdp:t})}A.RTCPeerConnection.prototype.removeStream=function(A){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[A.id]||A]),delete this._reverseStreams[this._streams[A.id]?this._streams[A.id].id:A.id],delete this._streams[A.id]},A.RTCPeerConnection.prototype.addTrack=function(e,t){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const n=[].slice.call(arguments,1);if(1!==n.length||!n[0].getTracks().find((A=>A===e)))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===e)))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const i=this._streams[t.id];if(i)i.addTrack(e),Promise.resolve().then((()=>{this.dispatchEvent(new Event("negotiationneeded"))}));else{const n=new A.MediaStream([e]);this._streams[t.id]=n,this._reverseStreams[n.id]=t,this.addStream(n)}return this.getSenders().find((A=>A.track===e))},["createOffer","createAnswer"].forEach((function(e){const t=A.RTCPeerConnection.prototype[e],n={[e](){const A=arguments;return arguments.length&&"function"==typeof arguments[0]?t.apply(this,[e=>{const t=r(this,e);A[0].apply(null,[t])},e=>{A[1]&&A[1].apply(null,e)},arguments[2]]):t.apply(this,arguments).then((A=>r(this,A)))}};A.RTCPeerConnection.prototype[e]=n[e]}));const s=A.RTCPeerConnection.prototype.setLocalDescription;A.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=function(A,e){let t=e.sdp;return Object.keys(A._reverseStreams||[]).forEach((e=>{const n=A._reverseStreams[e],i=A._streams[n.id];t=t.replace(new RegExp(n.id,"g"),i.id)})),new RTCSessionDescription({type:e.type,sdp:t})}(this,arguments[0]),s.apply(this,arguments)):s.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:r(this,A)}}),A.RTCPeerConnection.prototype.removeTrack=function(A){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!A._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(A._pc!==this)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let e;this._streams=this._streams||{},Object.keys(this._streams).forEach((t=>{this._streams[t].getTracks().find((e=>A.track===e))&&(e=this._streams[t])})),e&&(1===e.getTracks().length?this.removeStream(this._reverseStreams[e.id]):e.removeTrack(A.track),this.dispatchEvent(new Event("negotiationneeded")))}}function vn(A,e){!A.RTCPeerConnection&&A.webkitRTCPeerConnection&&(A.RTCPeerConnection=A.webkitRTCPeerConnection),A.RTCPeerConnection&&e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(e){const t=A.RTCPeerConnection.prototype[e],n={[e](){return arguments[0]=new("addIceCandidate"===e?A.RTCIceCandidate:A.RTCSessionDescription)(arguments[0]),t.apply(this,arguments)}};A.RTCPeerConnection.prototype[e]=n[e]}))}function Cn(A,e){tn(A,"negotiationneeded",(A=>{const t=A.target;if(!(e.version<72||t.getConfiguration&&"plan-b"===t.getConfiguration().sdpSemantics)||"stable"===t.signalingState)return A}))}var yn=Object.freeze({__proto__:null,fixNegotiationNeeded:Cn,shimAddTrackRemoveTrack:wn,shimAddTrackRemoveTrackWithNative:Bn,shimGetSendersWithDtmf:mn,shimGetUserMedia:hn,shimMediaStream:gn,shimOnTrack:pn,shimPeerConnection:vn,shimSenderReceiverGetStats:fn});function bn(A,e){const t=A&&A.navigator,n=A&&A.MediaStreamTrack;if(t.getUserMedia=function(A,e,n){on("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),t.mediaDevices.getUserMedia(A).then(e,n)},!(e.version>55&&"autoGainControl"in t.mediaDevices.getSupportedConstraints())){const A=function(A,e,t){e in A&&!(t in A)&&(A[t]=A[e],delete A[e])},e=t.mediaDevices.getUserMedia.bind(t.mediaDevices);if(t.mediaDevices.getUserMedia=function(t){return"object"==typeof t&&"object"==typeof t.audio&&(t=JSON.parse(JSON.stringify(t)),A(t.audio,"autoGainControl","mozAutoGainControl"),A(t.audio,"noiseSuppression","mozNoiseSuppression")),e(t)},n&&n.prototype.getSettings){const e=n.prototype.getSettings;n.prototype.getSettings=function(){const t=e.apply(this,arguments);return A(t,"mozAutoGainControl","autoGainControl"),A(t,"mozNoiseSuppression","noiseSuppression"),t}}if(n&&n.prototype.applyConstraints){const e=n.prototype.applyConstraints;n.prototype.applyConstraints=function(t){return"audio"===this.kind&&"object"==typeof t&&(t=JSON.parse(JSON.stringify(t)),A(t,"autoGainControl","mozAutoGainControl"),A(t,"noiseSuppression","mozNoiseSuppression")),e.apply(this,[t])}}}}function Qn(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 Un(A,e){if("object"!=typeof A||!A.RTCPeerConnection&&!A.mozRTCPeerConnection)return;!A.RTCPeerConnection&&A.mozRTCPeerConnection&&(A.RTCPeerConnection=A.mozRTCPeerConnection),e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(e){const t=A.RTCPeerConnection.prototype[e],n={[e](){return arguments[0]=new("addIceCandidate"===e?A.RTCIceCandidate:A.RTCSessionDescription)(arguments[0]),t.apply(this,arguments)}};A.RTCPeerConnection.prototype[e]=n[e]}));const t={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},n=A.RTCPeerConnection.prototype.getStats;A.RTCPeerConnection.prototype.getStats=function(){const[A,i,r]=arguments;return n.apply(this,[A||null]).then((A=>{if(e.version<53&&!i)try{A.forEach((A=>{A.type=t[A.type]||A.type}))}catch(n){if("TypeError"!==n.name)throw n;A.forEach(((e,n)=>{A.set(n,Object.assign({},e,{type:t[e.type]||e.type}))}))}return A})).then(i,r)}}function kn(A){if("object"!=typeof A||!A.RTCPeerConnection||!A.RTCRtpSender)return;if(A.RTCRtpSender&&"getStats"in A.RTCRtpSender.prototype)return;const e=A.RTCPeerConnection.prototype.getSenders;e&&(A.RTCPeerConnection.prototype.getSenders=function(){const A=e.apply(this,[]);return A.forEach((A=>A._pc=this)),A});const t=A.RTCPeerConnection.prototype.addTrack;t&&(A.RTCPeerConnection.prototype.addTrack=function(){const A=t.apply(this,arguments);return A._pc=this,A}),A.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function En(A){if("object"!=typeof A||!A.RTCPeerConnection||!A.RTCRtpSender)return;if(A.RTCRtpSender&&"getStats"in A.RTCRtpReceiver.prototype)return;const e=A.RTCPeerConnection.prototype.getReceivers;e&&(A.RTCPeerConnection.prototype.getReceivers=function(){const A=e.apply(this,[]);return A.forEach((A=>A._pc=this)),A}),tn(A,"track",(A=>(A.receiver._pc=A.srcElement,A))),A.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function Fn(A){A.RTCPeerConnection&&!("removeStream"in A.RTCPeerConnection.prototype)&&(A.RTCPeerConnection.prototype.removeStream=function(A){on("removeStream","removeTrack"),this.getSenders().forEach((e=>{e.track&&A.getTracks().includes(e.track)&&this.removeTrack(e)}))})}function Tn(A){A.DataChannel&&!A.RTCDataChannel&&(A.RTCDataChannel=A.DataChannel)}function Sn(A){if("object"!=typeof A||!A.RTCPeerConnection)return;const e=A.RTCPeerConnection.prototype.addTransceiver;e&&(A.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let A=arguments[1]&&arguments[1].sendEncodings;void 0===A&&(A=[]),A=[...A];const t=A.length>0;t&&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 n=e.apply(this,arguments);if(t){const{sender:e}=n,t=e.getParameters();(!("encodings"in t)||1===t.encodings.length&&0===Object.keys(t.encodings[0]).length)&&(t.encodings=A,e.sendEncodings=A,this.setParametersPromises.push(e.setParameters(t).then((()=>{delete e.sendEncodings})).catch((()=>{delete e.sendEncodings}))))}return n})}function In(A){if("object"!=typeof A||!A.RTCRtpSender)return;const e=A.RTCRtpSender.prototype.getParameters;e&&(A.RTCRtpSender.prototype.getParameters=function(){const A=e.apply(this,arguments);return"encodings"in A||(A.encodings=[].concat(this.sendEncodings||[{}])),A})}function Pn(A){if("object"!=typeof A||!A.RTCPeerConnection)return;const e=A.RTCPeerConnection.prototype.createOffer;A.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 Hn(A){if("object"!=typeof A||!A.RTCPeerConnection)return;const e=A.RTCPeerConnection.prototype.createAnswer;A.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 Rn=Object.freeze({__proto__:null,shimAddTransceiver:Sn,shimCreateAnswer:Hn,shimCreateOffer:Pn,shimGetDisplayMedia:function(A,e){A.navigator.mediaDevices&&"getDisplayMedia"in A.navigator.mediaDevices||A.navigator.mediaDevices&&(A.navigator.mediaDevices.getDisplayMedia=function(t){if(!t||!t.video){const A=new DOMException("getDisplayMedia without video constraints is undefined");return A.name="NotFoundError",A.code=8,Promise.reject(A)}return!0===t.video?t.video={mediaSource:e}:t.video.mediaSource=e,A.navigator.mediaDevices.getUserMedia(t)})},shimGetParameters:In,shimGetUserMedia:bn,shimOnTrack:Qn,shimPeerConnection:Un,shimRTCDataChannel:Tn,shimReceiverGetStats:En,shimRemoveStream:Fn,shimSenderGetStats:kn});function Dn(A){if("object"==typeof A&&A.RTCPeerConnection){if("getLocalStreams"in A.RTCPeerConnection.prototype||(A.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in A.RTCPeerConnection.prototype)){const e=A.RTCPeerConnection.prototype.addTrack;A.RTCPeerConnection.prototype.addStream=function(A){this._localStreams||(this._localStreams=[]),this._localStreams.includes(A)||this._localStreams.push(A),A.getAudioTracks().forEach((t=>e.call(this,t,A))),A.getVideoTracks().forEach((t=>e.call(this,t,A)))},A.RTCPeerConnection.prototype.addTrack=function(A){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return n&&n.forEach((A=>{this._localStreams?this._localStreams.includes(A)||this._localStreams.push(A):this._localStreams=[A]})),e.apply(this,arguments)}}"removeStream"in A.RTCPeerConnection.prototype||(A.RTCPeerConnection.prototype.removeStream=function(A){this._localStreams||(this._localStreams=[]);const e=this._localStreams.indexOf(A);if(-1===e)return;this._localStreams.splice(e,1);const t=A.getTracks();this.getSenders().forEach((A=>{t.includes(A.track)&&this.removeTrack(A)}))})}}function xn(A){if("object"==typeof A&&A.RTCPeerConnection&&("getRemoteStreams"in A.RTCPeerConnection.prototype||(A.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in A.RTCPeerConnection.prototype))){Object.defineProperty(A.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=A=>{A.streams.forEach((A=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(A))return;this._remoteStreams.push(A);const e=new Event("addstream");e.stream=A,this.dispatchEvent(e)}))})}});const e=A.RTCPeerConnection.prototype.setRemoteDescription;A.RTCPeerConnection.prototype.setRemoteDescription=function(){const A=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(e){e.streams.forEach((e=>{if(A._remoteStreams||(A._remoteStreams=[]),A._remoteStreams.indexOf(e)>=0)return;A._remoteStreams.push(e);const t=new Event("addstream");t.stream=e,A.dispatchEvent(t)}))}),e.apply(A,arguments)}}}function Ln(A){if("object"!=typeof A||!A.RTCPeerConnection)return;const e=A.RTCPeerConnection.prototype,t=e.createOffer,n=e.createAnswer,i=e.setLocalDescription,r=e.setRemoteDescription,s=e.addIceCandidate;e.createOffer=function(A,e){const n=arguments.length>=2?arguments[2]:arguments[0],i=t.apply(this,[n]);return e?(i.then(A,e),Promise.resolve()):i},e.createAnswer=function(A,e){const t=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[t]);return e?(i.then(A,e),Promise.resolve()):i};let o=function(A,e,t){const n=i.apply(this,[A]);return t?(n.then(e,t),Promise.resolve()):n};e.setLocalDescription=o,o=function(A,e,t){const n=r.apply(this,[A]);return t?(n.then(e,t),Promise.resolve()):n},e.setRemoteDescription=o,o=function(A,e,t){const n=s.apply(this,[A]);return t?(n.then(e,t),Promise.resolve()):n},e.addIceCandidate=o}function On(A){const e=A&&A.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){const A=e.mediaDevices,t=A.getUserMedia.bind(A);e.mediaDevices.getUserMedia=A=>t(Mn(A))}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=function(A,t,n){e.mediaDevices.getUserMedia(A).then(t,n)}.bind(e))}function Mn(A){return A&&void 0!==A.video?Object.assign({},A,{video:cn(A.video)}):A}function Nn(A){if(!A.RTCPeerConnection)return;const e=A.RTCPeerConnection;A.RTCPeerConnection=function(A,t){if(A&&A.iceServers){const e=[];for(let t=0;t<A.iceServers.length;t++){let n=A.iceServers[t];void 0===n.urls&&n.url?(on("RTCIceServer.url","RTCIceServer.urls"),n=JSON.parse(JSON.stringify(n)),n.urls=n.url,delete n.url,e.push(n)):e.push(A.iceServers[t])}A.iceServers=e}return new e(A,t)},A.RTCPeerConnection.prototype=e.prototype,"generateCertificate"in e&&Object.defineProperty(A.RTCPeerConnection,"generateCertificate",{get:()=>e.generateCertificate})}function Kn(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 _n(A){const e=A.RTCPeerConnection.prototype.createOffer;A.RTCPeerConnection.prototype.createOffer=function(A){if(A){void 0!==A.offerToReceiveAudio&&(A.offerToReceiveAudio=!!A.offerToReceiveAudio);const e=this.getTransceivers().find((A=>"audio"===A.receiver.track.kind));!1===A.offerToReceiveAudio&&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.offerToReceiveAudio||e||this.addTransceiver("audio",{direction:"recvonly"}),void 0!==A.offerToReceiveVideo&&(A.offerToReceiveVideo=!!A.offerToReceiveVideo);const t=this.getTransceivers().find((A=>"video"===A.receiver.track.kind));!1===A.offerToReceiveVideo&&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.offerToReceiveVideo||t||this.addTransceiver("video",{direction:"recvonly"})}return e.apply(this,arguments)}}function Vn(A){"object"!=typeof A||A.AudioContext||(A.AudioContext=A.webkitAudioContext)}var Gn,jn=Object.freeze({__proto__:null,shimAudioContext:Vn,shimCallbacksAPI:Ln,shimConstraints:Mn,shimCreateOfferLegacy:_n,shimGetUserMedia:On,shimLocalStreamsAPI:Dn,shimRTCIceServerUrls:Nn,shimRemoteStreamsAPI:xn,shimTrackEventTransceiver:Kn}),Jn={exports:{}},Wn=(Gn||(Gn=1,function(A){const e={generateIdentifier:function(){return Math.random().toString(36).substring(2,12)}};e.localCName=e.generateIdentifier(),e.splitLines=function(A){return A.trim().split("\n").map((A=>A.trim()))},e.splitSections=function(A){return A.split("\nm=").map(((A,e)=>(e>0?"m="+A:A).trim()+"\r\n"))},e.getDescription=function(A){const t=e.splitSections(A);return t&&t[0]},e.getMediaSections=function(A){const t=e.splitSections(A);return t.shift(),t},e.matchPrefix=function(A,t){return e.splitLines(A).filter((A=>0===A.indexOf(t)))},e.parseCandidate=function(A){let e;e=0===A.indexOf("a=candidate:")?A.substring(12).split(" "):A.substring(10).split(" ");const t={foundation:e[0],component:{1:"rtp",2:"rtcp"}[e[1]]||e[1],protocol:e[2].toLowerCase(),priority:parseInt(e[3],10),ip:e[4],address:e[4],port:parseInt(e[5],10),type:e[7]};for(let n=8;n<e.length;n+=2)switch(e[n]){case"raddr":t.relatedAddress=e[n+1];break;case"rport":t.relatedPort=parseInt(e[n+1],10);break;case"tcptype":t.tcpType=e[n+1];break;case"ufrag":t.ufrag=e[n+1],t.usernameFragment=e[n+1];break;default:void 0===t[e[n]]&&(t[e[n]]=e[n+1])}return t},e.writeCandidate=function(A){const e=[];e.push(A.foundation);const t=A.component;"rtp"===t?e.push(1):"rtcp"===t?e.push(2):e.push(t),e.push(A.protocol.toUpperCase()),e.push(A.priority),e.push(A.address||A.ip),e.push(A.port);const n=A.type;return e.push("typ"),e.push(n),"host"!==n&&A.relatedAddress&&A.relatedPort&&(e.push("raddr"),e.push(A.relatedAddress),e.push("rport"),e.push(A.relatedPort)),A.tcpType&&"tcp"===A.protocol.toLowerCase()&&(e.push("tcptype"),e.push(A.tcpType)),(A.usernameFragment||A.ufrag)&&(e.push("ufrag"),e.push(A.usernameFragment||A.ufrag)),"candidate:"+e.join(" ")},e.parseIceOptions=function(A){return A.substring(14).split(" ")},e.parseRtpMap=function(A){let e=A.substring(9).split(" ");const t={payloadType:parseInt(e.shift(),10)};return e=e[0].split("/"),t.name=e[0],t.clockRate=parseInt(e[1],10),t.channels=3===e.length?parseInt(e[2],10):1,t.numChannels=t.channels,t},e.writeRtpMap=function(A){let e=A.payloadType;void 0!==A.preferredPayloadType&&(e=A.preferredPayloadType);const t=A.channels||A.numChannels||1;return"a=rtpmap:"+e+" "+A.name+"/"+A.clockRate+(1!==t?"/"+t:"")+"\r\n"},e.parseExtmap=function(A){const e=A.substring(9).split(" ");return{id:parseInt(e[0],10),direction:e[0].indexOf("/")>0?e[0].split("/")[1]:"sendrecv",uri:e[1],attributes:e.slice(2).join(" ")}},e.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"},e.parseFmtp=function(A){const e={};let t;const n=A.substring(A.indexOf(" ")+1).split(";");for(let i=0;i<n.length;i++)t=n[i].trim().split("="),e[t[0].trim()]=t[1];return e},e.writeFmtp=function(A){let e="",t=A.payloadType;if(void 0!==A.preferredPayloadType&&(t=A.preferredPayloadType),A.parameters&&Object.keys(A.parameters).length){const n=[];Object.keys(A.parameters).forEach((e=>{void 0!==A.parameters[e]?n.push(e+"="+A.parameters[e]):n.push(e)})),e+="a=fmtp:"+t+" "+n.join(";")+"\r\n"}return e},e.parseRtcpFb=function(A){const e=A.substring(A.indexOf(" ")+1).split(" ");return{type:e.shift(),parameter:e.join(" ")}},e.writeRtcpFb=function(A){let e="",t=A.payloadType;return void 0!==A.preferredPayloadType&&(t=A.preferredPayloadType),A.rtcpFeedback&&A.rtcpFeedback.length&&A.rtcpFeedback.forEach((A=>{e+="a=rtcp-fb:"+t+" "+A.type+(A.parameter&&A.parameter.length?" "+A.parameter:"")+"\r\n"})),e},e.parseSsrcMedia=function(A){const e=A.indexOf(" "),t={ssrc:parseInt(A.substring(7,e),10)},n=A.indexOf(":",e);return n>-1?(t.attribute=A.substring(e+1,n),t.value=A.substring(n+1)):t.attribute=A.substring(e+1),t},e.parseSsrcGroup=function(A){const e=A.substring(13).split(" ");return{semantics:e.shift(),ssrcs:e.map((A=>parseInt(A,10)))}},e.getMid=function(A){const t=e.matchPrefix(A,"a=mid:")[0];if(t)return t.substring(6)},e.parseFingerprint=function(A){const e=A.substring(14).split(" ");return{algorithm:e[0].toLowerCase(),value:e[1].toUpperCase()}},e.getDtlsParameters=function(A,t){return{role:"auto",fingerprints:e.matchPrefix(A+t,"a=fingerprint:").map(e.parseFingerprint)}},e.writeDtlsParameters=function(A,e){let t="a=setup:"+e+"\r\n";return A.fingerprints.forEach((A=>{t+="a=fingerprint:"+A.algorithm+" "+A.value+"\r\n"})),t},e.parseCryptoLine=function(A){const e=A.substring(9).split(" ");return{tag:parseInt(e[0],10),cryptoSuite:e[1],keyParams:e[2],sessionParams:e.slice(3)}},e.writeCryptoLine=function(A){return"a=crypto:"+A.tag+" "+A.cryptoSuite+" "+("object"==typeof A.keyParams?e.writeCryptoKeyParams(A.keyParams):A.keyParams)+(A.sessionParams?" "+A.sessionParams.join(" "):"")+"\r\n"},e.parseCryptoKeyParams=function(A){if(0!==A.indexOf("inline:"))return null;const e=A.substring(7).split("|");return{keyMethod:"inline",keySalt:e[0],lifeTime:e[1],mkiValue:e[2]?e[2].split(":")[0]:void 0,mkiLength:e[2]?e[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,t){return e.matchPrefix(A+t,"a=crypto:").map(e.parseCryptoLine)},e.getIceParameters=function(A,t){const n=e.matchPrefix(A+t,"a=ice-ufrag:")[0],i=e.matchPrefix(A+t,"a=ice-pwd:")[0];return n&&i?{usernameFragment:n.substring(12),password:i.substring(10)}:null},e.writeIceParameters=function(A){let e="a=ice-ufrag:"+A.usernameFragment+"\r\na=ice-pwd:"+A.password+"\r\n";return A.iceLite&&(e+="a=ice-lite\r\n"),e},e.parseRtpParameters=function(A){const t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=e.splitLines(A)[0].split(" ");t.profile=n[2];for(let r=3;r<n.length;r++){const i=n[r],s=e.matchPrefix(A,"a=rtpmap:"+i+" ")[0];if(s){const n=e.parseRtpMap(s),r=e.matchPrefix(A,"a=fmtp:"+i+" ");switch(n.parameters=r.length?e.parseFmtp(r[0]):{},n.rtcpFeedback=e.matchPrefix(A,"a=rtcp-fb:"+i+" ").map(e.parseRtcpFb),t.codecs.push(n),n.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(n.name.toUpperCase())}}}e.matchPrefix(A,"a=extmap:").forEach((A=>{t.headerExtensions.push(e.parseExtmap(A))}));const i=e.matchPrefix(A,"a=rtcp-fb:* ").map(e.parseRtcpFb);return t.codecs.forEach((A=>{i.forEach((e=>{A.rtcpFeedback.find((A=>A.type===e.type&&A.parameter===e.parameter))||A.rtcpFeedback.push(e)}))})),t},e.writeRtpDescription=function(A,t){let n="";n+="m="+A+" ",n+=t.codecs.length>0?"9":"0",n+=" "+(t.profile||"UDP/TLS/RTP/SAVPF")+" ",n+=t.codecs.map((A=>void 0!==A.preferredPayloadType?A.preferredPayloadType:A.payloadType)).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach((A=>{n+=e.writeRtpMap(A),n+=e.writeFmtp(A),n+=e.writeRtcpFb(A)}));let i=0;return t.codecs.forEach((A=>{A.maxptime>i&&(i=A.maxptime)})),i>0&&(n+="a=maxptime:"+i+"\r\n"),t.headerExtensions&&t.headerExtensions.forEach((A=>{n+=e.writeExtmap(A)})),n},e.parseRtpEncodingParameters=function(A){const t=[],n=e.parseRtpParameters(A),i=-1!==n.fecMechanisms.indexOf("RED"),r=-1!==n.fecMechanisms.indexOf("ULPFEC"),s=e.matchPrefix(A,"a=ssrc:").map((A=>e.parseSsrcMedia(A))).filter((A=>"cname"===A.attribute)),o=s.length>0&&s[0].ssrc;let a;const c=e.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]),n.codecs.forEach((A=>{if("RTX"===A.name.toUpperCase()&&A.parameters.apt){let e={ssrc:o,codecPayloadType:parseInt(A.parameters.apt,10)};o&&a&&(e.rtx={ssrc:a}),t.push(e),i&&(e=JSON.parse(JSON.stringify(e)),e.fec={ssrc:o,mechanism:r?"red+ulpfec":"red"},t.push(e))}})),0===t.length&&o&&t.push({ssrc:o});let d=e.matchPrefix(A,"b=");return d.length&&(d=0===d[0].indexOf("b=TIAS:")?parseInt(d[0].substring(7),10):0===d[0].indexOf("b=AS:")?1e3*parseInt(d[0].substring(5),10)*.95-16e3:void 0,t.forEach((A=>{A.maxBitrate=d}))),t},e.parseRtcpParameters=function(A){const t={},n=e.matchPrefix(A,"a=ssrc:").map((A=>e.parseSsrcMedia(A))).filter((A=>"cname"===A.attribute))[0];n&&(t.cname=n.value,t.ssrc=n.ssrc);const i=e.matchPrefix(A,"a=rtcp-rsize");t.reducedSize=i.length>0,t.compound=0===i.length;const r=e.matchPrefix(A,"a=rtcp-mux");return t.mux=r.length>0,t},e.writeRtcpParameters=function(A){let e="";return A.reducedSize&&(e+="a=rtcp-rsize\r\n"),A.mux&&(e+="a=rtcp-mux\r\n"),void 0!==A.ssrc&&A.cname&&(e+="a=ssrc:"+A.ssrc+" cname:"+A.cname+"\r\n"),e},e.parseMsid=function(A){let t;const n=e.matchPrefix(A,"a=msid:");if(1===n.length)return t=n[0].substring(7).split(" "),{stream:t[0],track:t[1]};const i=e.matchPrefix(A,"a=ssrc:").map((A=>e.parseSsrcMedia(A))).filter((A=>"msid"===A.attribute));return i.length>0?(t=i[0].value.split(" "),{stream:t[0],track:t[1]}):void 0},e.parseSctpDescription=function(A){const t=e.parseMLine(A),n=e.matchPrefix(A,"a=max-message-size:");let i;n.length>0&&(i=parseInt(n[0].substring(19),10)),isNaN(i)&&(i=65536);const r=e.matchPrefix(A,"a=sctp-port:");if(r.length>0)return{port:parseInt(r[0].substring(12),10),protocol:t.fmt,maxMessageSize:i};const s=e.matchPrefix(A,"a=sctpmap:");if(s.length>0){const A=s[0].substring(10).split(" ");return{port:parseInt(A[0],10),protocol:A[1],maxMessageSize:i}}},e.writeSctpDescription=function(A,e){let t=[];return t="DTLS/SCTP"!==A.protocol?["m="+A.kind+" 9 "+A.protocol+" "+e.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+e.port+"\r\n"]:["m="+A.kind+" 9 "+A.protocol+" "+e.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+e.port+" "+e.protocol+" 65535\r\n"],void 0!==e.maxMessageSize&&t.push("a=max-message-size:"+e.maxMessageSize+"\r\n"),t.join("")},e.generateSessionId=function(){return Math.random().toString().substr(2,22)},e.writeSessionBoilerplate=function(A,t,n){let i;const r=void 0!==t?t:2;return i=A||e.generateSessionId(),"v=0\r\no="+(n||"thisisadapterortc")+" "+i+" "+r+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},e.getDirection=function(A,t){const n=e.splitLines(A);for(let e=0;e<n.length;e++)switch(n[e]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[e].substring(2)}return t?e.getDirection(t):"sendrecv"},e.getKind=function(A){return e.splitLines(A)[0].split(" ")[0].substring(2)},e.isRejected=function(A){return"0"===A.split(" ",2)[1]},e.parseMLine=function(A){const t=e.splitLines(A)[0].substring(2).split(" ");return{kind:t[0],port:parseInt(t[1],10),protocol:t[2],fmt:t.slice(3).join(" ")}},e.parseOLine=function(A){const t=e.matchPrefix(A,"o=")[0].substring(2).split(" ");return{username:t[0],sessionId:t[1],sessionVersion:parseInt(t[2],10),netType:t[3],addressType:t[4],address:t[5]}},e.isValidSDP=function(A){if("string"!=typeof A||0===A.length)return!1;const t=e.splitLines(A);for(let e=0;e<t.length;e++)if(t[e].length<2||"="!==t[e].charAt(1))return!1;return!0},A.exports=e}(Jn)),Jn.exports),Xn=Pt(Wn),Yn=r({__proto__:null,default:Xn},[Wn]);function qn(A){if(!A.RTCIceCandidate||A.RTCIceCandidate&&"foundation"in A.RTCIceCandidate.prototype)return;const e=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 t=new e(A),n=Xn.parseCandidate(A.candidate);for(const A in n)A in t||Object.defineProperty(t,A,{value:n[A]});return t.toJSON=function(){return{candidate:t.candidate,sdpMid:t.sdpMid,sdpMLineIndex:t.sdpMLineIndex,usernameFragment:t.usernameFragment}},t}return new e(A)},A.RTCIceCandidate.prototype=e.prototype,tn(A,"icecandidate",(e=>(e.candidate&&Object.defineProperty(e,"candidate",{value:new A.RTCIceCandidate(e.candidate),writable:"false"}),e)))}function $n(A){!A.RTCIceCandidate||A.RTCIceCandidate&&"relayProtocol"in A.RTCIceCandidate.prototype||tn(A,"icecandidate",(A=>{if(A.candidate){const e=Xn.parseCandidate(A.candidate.candidate);"relay"===e.type&&(A.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[e.priority>>24])}return A}))}function Zn(A,e){if(!A.RTCPeerConnection)return;"sctp"in A.RTCPeerConnection.prototype||Object.defineProperty(A.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const t=A.RTCPeerConnection.prototype.setRemoteDescription;A.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===e.browser&&e.version>=76){const{sdpSemantics:A}=this.getConfiguration();"plan-b"===A&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(function(A){if(!A||!A.sdp)return!1;const e=Xn.splitSections(A.sdp);return e.shift(),e.some((A=>{const e=Xn.parseMLine(A);return e&&"application"===e.kind&&-1!==e.protocol.indexOf("SCTP")}))}(arguments[0])){const A=function(A){const e=A.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===e||e.length<2)return-1;const t=parseInt(e[1],10);return t!=t?-1:t}(arguments[0]),t=function(A){let t=65536;return"firefox"===e.browser&&(t=e.version<57?-1===A?16384:2147483637:e.version<60?57===e.version?65535:65536:2147483637),t}(A),n=function(A,t){let n=65536;"firefox"===e.browser&&57===e.version&&(n=65535);const i=Xn.matchPrefix(A.sdp,"a=max-message-size:");return i.length>0?n=parseInt(i[0].substring(19),10):"firefox"===e.browser&&-1!==t&&(n=2147483637),n}(arguments[0],A);let i;i=0===t&&0===n?Number.POSITIVE_INFINITY:0===t||0===n?Math.max(t,n):Math.min(t,n);const r={};Object.defineProperty(r,"maxMessageSize",{get:()=>i}),this._sctp=r}return t.apply(this,arguments)}}function zn(A){if(!A.RTCPeerConnection||!("createDataChannel"in A.RTCPeerConnection.prototype))return;function e(A,e){const t=A.send;A.send=function(){const n=arguments[0],i=n.length||n.size||n.byteLength;if("open"===A.readyState&&e.sctp&&i>e.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+e.sctp.maxMessageSize+" bytes)");return t.apply(A,arguments)}}const t=A.RTCPeerConnection.prototype.createDataChannel;A.RTCPeerConnection.prototype.createDataChannel=function(){const A=t.apply(this,arguments);return e(A,this),A},tn(A,"datachannel",(A=>(e(A.channel,A.target),A)))}function Ai(A){if(!A.RTCPeerConnection||"connectionState"in A.RTCPeerConnection.prototype)return;const e=A.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 t=e[A];e[A]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=A=>{const e=A.target;if(e._lastConnectionState!==e.connectionState){e._lastConnectionState=e.connectionState;const t=new Event("connectionstatechange",A);e.dispatchEvent(t)}return A},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),t.apply(this,arguments)}}))}function ei(A,e){if(!A.RTCPeerConnection)return;if("chrome"===e.browser&&e.version>=71)return;if("safari"===e.browser&&e.version>=605)return;const t=A.RTCPeerConnection.prototype.setRemoteDescription;A.RTCPeerConnection.prototype.setRemoteDescription=function(e){if(e&&e.sdp&&-1!==e.sdp.indexOf("\na=extmap-allow-mixed")){const t=e.sdp.split("\n").filter((A=>"a=extmap-allow-mixed"!==A.trim())).join("\n");A.RTCSessionDescription&&e instanceof A.RTCSessionDescription?arguments[0]=new A.RTCSessionDescription({type:e.type,sdp:t}):e.sdp=t}return t.apply(this,arguments)}}function ti(A,e){if(!A.RTCPeerConnection||!A.RTCPeerConnection.prototype)return;const t=A.RTCPeerConnection.prototype.addIceCandidate;t&&0!==t.length&&(A.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===e.browser&&e.version<78||"firefox"===e.browser&&e.version<68||"safari"===e.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():t.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function ni(A,e){if(!A.RTCPeerConnection||!A.RTCPeerConnection.prototype)return;const t=A.RTCPeerConnection.prototype.setLocalDescription;t&&0!==t.length&&(A.RTCPeerConnection.prototype.setLocalDescription=function(){let A=arguments[0]||{};if("object"!=typeof A||A.type&&A.sdp)return t.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?t.apply(this,[A]):("offer"===A.type?this.createOffer:this.createAnswer).apply(this).then((A=>t.apply(this,[A])))})}var ii=Object.freeze({__proto__:null,removeExtmapAllowMixed:ei,shimAddIceCandidateNullOrEmpty:ti,shimConnectionState:Ai,shimMaxMessageSize:Zn,shimParameterlessSetLocalDescription:ni,shimRTCIceCandidate:qn,shimRTCIceCandidateRelayProtocol:$n,shimSendThrowTypeError:zn});!function(){let{window:A}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimSafari:!0};const t=sn,n=function(A){const e={browser:null,version:null};if(void 0===A||!A.navigator||!A.navigator.userAgent)return e.browser="Not a browser.",e;const{navigator:t}=A;if(t.userAgentData&&t.userAgentData.brands){const A=t.userAgentData.brands.find((A=>"Chromium"===A.brand));if(A)return{browser:"chrome",version:parseInt(A.version,10)}}if(t.mozGetUserMedia)e.browser="firefox",e.version=en(t.userAgent,/Firefox\/(\d+)\./,1);else if(t.webkitGetUserMedia||!1===A.isSecureContext&&A.webkitRTCPeerConnection)e.browser="chrome",e.version=en(t.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!A.RTCPeerConnection||!t.userAgent.match(/AppleWebKit\/(\d+)\./))return e.browser="Not a supported browser.",e;e.browser="safari",e.version=en(t.userAgent,/AppleWebKit\/(\d+)\./,1),e.supportsUnifiedPlan=A.RTCRtpTransceiver&&"currentDirection"in A.RTCRtpTransceiver.prototype}return e}(A),i={browserDetails:n,commonShim:ii,extractVersion:en,disableLog:nn,disableWarnings:rn,sdp:Yn};switch(n.browser){case"chrome":if(!yn||!vn||!e.shimChrome)return t("Chrome shim is not included in this adapter release."),i;if(null===n.version)return t("Chrome shim can not determine version, not shimming."),i;t("adapter.js shimming chrome."),i.browserShim=yn,ti(A,n),ni(A),hn(A,n),gn(A),vn(A,n),pn(A),wn(A,n),mn(A),fn(A),Cn(A,n),qn(A),$n(A),Ai(A),Zn(A,n),zn(A),ei(A,n);break;case"firefox":if(!Rn||!Un||!e.shimFirefox)return t("Firefox shim is not included in this adapter release."),i;t("adapter.js shimming firefox."),i.browserShim=Rn,ti(A,n),ni(A),bn(A,n),Un(A,n),Qn(A),Fn(A),kn(A),En(A),Tn(A),Sn(A),In(A),Pn(A),Hn(A),qn(A),Ai(A),Zn(A,n),zn(A);break;case"safari":if(!jn||!e.shimSafari)return t("Safari shim is not included in this adapter release."),i;t("adapter.js shimming safari."),i.browserShim=jn,ti(A,n),ni(A),Nn(A),_n(A),Ln(A),Dn(A),xn(A),Kn(A),On(A),Vn(A),qn(A),$n(A),Zn(A,n),zn(A),ei(A,n);break;default:t("Unsupported browser!")}}({window:"undefined"==typeof window?void 0:window});const ri="lk_e2ee";var si,oi,ai,ci,di,li,ui,hi,gi,pi,mi,fi,Bi,wi,vi,Ci,yi,bi,Qi,Ui;function ki(){return void 0!==window.RTCRtpScriptTransform}(oi=si||(si={})).SetKey="setKey",oi.RatchetRequest="ratchetRequest",oi.KeyRatcheted="keyRatcheted",(ai||(ai={})).KeyRatcheted="keyRatcheted",(di=ci||(ci={})).ParticipantEncryptionStatusChanged="participantEncryptionStatusChanged",di.EncryptionError="encryptionError",(li||(li={})).Error="cryptorError",Zt.EventEmitter;class Ei extends Error{constructor(A,e){super(e||"an error has occured"),this.name="LiveKitError",this.code=A}}(hi=ui||(ui={}))[hi.NotAllowed=0]="NotAllowed",hi[hi.ServerUnreachable=1]="ServerUnreachable",hi[hi.InternalError=2]="InternalError",hi[hi.Cancelled=3]="Cancelled",hi[hi.LeaveRequest=4]="LeaveRequest";class Fi extends Ei{constructor(A,e,t,n){super(1,A),this.name="ConnectionError",this.status=t,this.reason=e,this.context=n,this.reasonName=ui[e]}}class Ti extends Ei{constructor(A){super(21,null!=A?A:"device is unsupported"),this.name="DeviceUnsupportedError"}}class Si extends Ei{constructor(A){super(20,null!=A?A:"track is invalid"),this.name="TrackInvalidError"}}class Ii extends Ei{constructor(A){super(10,null!=A?A:"unsupported server"),this.name="UnsupportedServer"}}class Pi extends Ei{constructor(A){super(12,null!=A?A:"unexpected connection state"),this.name="UnexpectedConnectionState"}}class Hi extends Ei{constructor(A){super(13,null!=A?A:"unable to negotiate"),this.name="NegotiationError"}}class Ri extends Ei{constructor(A,e){super(15,A),this.name="PublishTrackError",this.status=e}}class Di extends Ei{constructor(A,e){super(15,A),this.reason=e,this.reasonName="string"==typeof e?e:St[e]}}(pi=gi||(gi={})).PermissionDenied="PermissionDenied",pi.NotFound="NotFound",pi.DeviceInUse="DeviceInUse",pi.Other="Other",function(A){A.getFailure=function(e){if(e&&"name"in e)return"NotFoundError"===e.name||"DevicesNotFoundError"===e.name?A.NotFound:"NotAllowedError"===e.name||"PermissionDeniedError"===e.name?A.PermissionDenied:"NotReadableError"===e.name||"TrackStartError"===e.name?A.DeviceInUse:A.Other}}(gi||(gi={})),(fi=mi||(mi={}))[fi.InvalidKey=0]="InvalidKey",fi[fi.MissingKey=1]="MissingKey",fi[fi.InternalError=2]="InternalError",(wi=Bi||(Bi={})).Connected="connected",wi.Reconnecting="reconnecting",wi.SignalReconnecting="signalReconnecting",wi.Reconnected="reconnected",wi.Disconnected="disconnected",wi.ConnectionStateChanged="connectionStateChanged",wi.Moved="moved",wi.MediaDevicesChanged="mediaDevicesChanged",wi.ParticipantConnected="participantConnected",wi.ParticipantDisconnected="participantDisconnected",wi.TrackPublished="trackPublished",wi.TrackSubscribed="trackSubscribed",wi.TrackSubscriptionFailed="trackSubscriptionFailed",wi.TrackUnpublished="trackUnpublished",wi.TrackUnsubscribed="trackUnsubscribed",wi.TrackMuted="trackMuted",wi.TrackUnmuted="trackUnmuted",wi.LocalTrackPublished="localTrackPublished",wi.LocalTrackUnpublished="localTrackUnpublished",wi.LocalAudioSilenceDetected="localAudioSilenceDetected",wi.ActiveSpeakersChanged="activeSpeakersChanged",wi.ParticipantMetadataChanged="participantMetadataChanged",wi.ParticipantNameChanged="participantNameChanged",wi.ParticipantAttributesChanged="participantAttributesChanged",wi.ParticipantActive="participantActive",wi.RoomMetadataChanged="roomMetadataChanged",wi.DataReceived="dataReceived",wi.SipDTMFReceived="sipDTMFReceived",wi.TranscriptionReceived="transcriptionReceived",wi.ConnectionQualityChanged="connectionQualityChanged",wi.TrackStreamStateChanged="trackStreamStateChanged",wi.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",wi.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",wi.AudioPlaybackStatusChanged="audioPlaybackChanged",wi.VideoPlaybackStatusChanged="videoPlaybackChanged",wi.MediaDevicesError="mediaDevicesError",wi.ParticipantPermissionsChanged="participantPermissionsChanged",wi.SignalConnected="signalConnected",wi.RecordingStatusChanged="recordingStatusChanged",wi.ParticipantEncryptionStatusChanged="participantEncryptionStatusChanged",wi.EncryptionError="encryptionError",wi.DCBufferStatusChanged="dcBufferStatusChanged",wi.ActiveDeviceChanged="activeDeviceChanged",wi.ChatMessage="chatMessage",wi.LocalTrackSubscribed="localTrackSubscribed",wi.MetricsReceived="metricsReceived",(Ci=vi||(vi={})).TrackPublished="trackPublished",Ci.TrackSubscribed="trackSubscribed",Ci.TrackSubscriptionFailed="trackSubscriptionFailed",Ci.TrackUnpublished="trackUnpublished",Ci.TrackUnsubscribed="trackUnsubscribed",Ci.TrackMuted="trackMuted",Ci.TrackUnmuted="trackUnmuted",Ci.LocalTrackPublished="localTrackPublished",Ci.LocalTrackUnpublished="localTrackUnpublished",Ci.ParticipantMetadataChanged="participantMetadataChanged",Ci.ParticipantNameChanged="participantNameChanged",Ci.DataReceived="dataReceived",Ci.SipDTMFReceived="sipDTMFReceived",Ci.TranscriptionReceived="transcriptionReceived",Ci.IsSpeakingChanged="isSpeakingChanged",Ci.ConnectionQualityChanged="connectionQualityChanged",Ci.TrackStreamStateChanged="trackStreamStateChanged",Ci.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",Ci.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",Ci.MediaDevicesError="mediaDevicesError",Ci.AudioStreamAcquired="audioStreamAcquired",Ci.ParticipantPermissionsChanged="participantPermissionsChanged",Ci.PCTrackAdded="pcTrackAdded",Ci.AttributesChanged="attributesChanged",Ci.LocalTrackSubscribed="localTrackSubscribed",Ci.ChatMessage="chatMessage",Ci.Active="active",(bi=yi||(yi={})).TransportsCreated="transportsCreated",bi.Connected="connected",bi.Disconnected="disconnected",bi.Resuming="resuming",bi.Resumed="resumed",bi.Restarting="restarting",bi.Restarted="restarted",bi.SignalResumed="signalResumed",bi.SignalRestarted="signalRestarted",bi.Closing="closing",bi.MediaTrackAdded="mediaTrackAdded",bi.ActiveSpeakersUpdate="activeSpeakersUpdate",bi.DataPacketReceived="dataPacketReceived",bi.RTPVideoMapUpdate="rtpVideoMapUpdate",bi.DCBufferStatusChanged="dcBufferStatusChanged",bi.ParticipantUpdate="participantUpdate",bi.RoomUpdate="roomUpdate",bi.SpeakersChanged="speakersChanged",bi.StreamStateChanged="streamStateChanged",bi.ConnectionQualityUpdate="connectionQualityUpdate",bi.SubscriptionError="subscriptionError",bi.SubscriptionPermissionUpdate="subscriptionPermissionUpdate",bi.RemoteMute="remoteMute",bi.SubscribedQualityUpdate="subscribedQualityUpdate",bi.LocalTrackUnpublished="localTrackUnpublished",bi.LocalTrackSubscribed="localTrackSubscribed",bi.Offline="offline",bi.SignalRequestResponse="signalRequestResponse",bi.SignalConnected="signalConnected",bi.RoomMoved="roomMoved",(Ui=Qi||(Qi={})).Message="message",Ui.Muted="muted",Ui.Unmuted="unmuted",Ui.Restarted="restarted",Ui.Ended="ended",Ui.Subscribed="subscribed",Ui.Unsubscribed="unsubscribed",Ui.UpdateSettings="updateSettings",Ui.UpdateSubscription="updateSubscription",Ui.AudioPlaybackStarted="audioPlaybackStarted",Ui.AudioPlaybackFailed="audioPlaybackFailed",Ui.AudioSilenceDetected="audioSilenceDetected",Ui.VisibilityChanged="visibilityChanged",Ui.VideoDimensionsChanged="videoDimensionsChanged",Ui.VideoPlaybackStarted="videoPlaybackStarted",Ui.VideoPlaybackFailed="videoPlaybackFailed",Ui.ElementAttached="elementAttached",Ui.ElementDetached="elementDetached",Ui.UpstreamPaused="upstreamPaused",Ui.UpstreamResumed="upstreamResumed",Ui.SubscriptionPermissionChanged="subscriptionPermissionChanged",Ui.SubscriptionStatusChanged="subscriptionStatusChanged",Ui.SubscriptionFailed="subscriptionFailed",Ui.TrackProcessorUpdate="trackProcessorUpdate",Ui.AudioTrackFeatureUpdate="audioTrackFeatureUpdate",Ui.TranscriptionReceived="transcriptionReceived",Ui.TimeSyncUpdate="timeSyncUpdate";const xi=/version\/(\d+(\.?_?\d+)+)/i;let Li;function Oi(A){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(void 0===A&&"undefined"==typeof navigator)return;const t=(null!=A?A:navigator.userAgent).toLowerCase();if(void 0===Li||e){const A=Mi.find((A=>{let{test:e}=A;return e.test(t)}));Li=null==A?void 0:A.describe(t)}return Li}const Mi=[{test:/firefox|iceweasel|fxios/i,describe:A=>({name:"Firefox",version:Ni(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,A),os:A.toLowerCase().includes("fxios")?"iOS":void 0,osVersion:Ki(A)})},{test:/chrom|crios|crmo/i,describe:A=>({name:"Chrome",version:Ni(/(?:chrome|chromium|crios|crmo)\/(\d+(\.?_?\d+)+)/i,A),os:A.toLowerCase().includes("crios")?"iOS":void 0,osVersion:Ki(A)})},{test:/safari|applewebkit/i,describe:A=>({name:"Safari",version:Ni(xi,A),os:A.includes("mobile/")?"iOS":"macOS",osVersion:Ki(A)})}];function Ni(A,e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const n=e.match(A);return n&&n.length>=t&&n[t]||""}function Ki(A){return A.includes("mac os")?Ni(/\(.+?(\d+_\d+(:?_\d+)?)/,A,1).replace(/_/g,"."):void 0}class _i{}_i.setTimeout=function(){return setTimeout(...arguments)},_i.setInterval=function(){return setInterval(...arguments)},_i.clearTimeout=function(){return clearTimeout(...arguments)},_i.clearInterval=function(){return clearInterval(...arguments)};const Vi=[];var Gi,ji;(ji=Gi||(Gi={}))[ji.LOW=0]="LOW",ji[ji.MEDIUM=1]="MEDIUM",ji[ji.HIGH=2]="HIGH";class Ji extends Zt.EventEmitter{constructor(A,e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var n;super(),this.attachedElements=[],this.isMuted=!1,this.streamState=Ji.StreamState.Active,this.isInBackground=!1,this._currentBitrate=0,this.log=Vt,this.appVisibilityChangedListener=()=>{this.backgroundTimeout&&clearTimeout(this.backgroundTimeout),"hidden"===document.visibilityState?this.backgroundTimeout=setTimeout((()=>this.handleAppVisibilityChanged()),5e3):this.handleAppVisibilityChanged()},this.log=Gt(null!==(n=t.loggerName)&&void 0!==n?n:Mt.Track),this.loggerContextCb=t.loggerContextCb,this.setMaxListeners(100),this.kind=e,this._mediaStreamTrack=A,this._mediaStreamID=A.id,this.source=Ji.Source.Unknown}get logContext(){var A;return Object.assign(Object.assign({},null===(A=this.loggerContextCb)||void 0===A?void 0:A.call(this)),zr(this))}get currentBitrate(){return this._currentBitrate}get mediaStreamTrack(){return this._mediaStreamTrack}get mediaStreamID(){return this._mediaStreamID}attach(A){let e="audio";this.kind===Ji.Kind.Video&&(e="video"),0===this.attachedElements.length&&this.kind===Ji.Kind.Video&&this.addAppVisibilityListener(),A||("audio"===e&&(Vi.forEach((e=>{null!==e.parentElement||A||(A=e)})),A&&Vi.splice(Vi.indexOf(A),1)),A||(A=document.createElement(e))),this.attachedElements.includes(A)||this.attachedElements.push(A),Wi(this.mediaStreamTrack,A);const t=A.srcObject.getTracks(),n=t.some((A=>"audio"===A.kind));return A.play().then((()=>{this.emit(n?Qi.AudioPlaybackStarted:Qi.VideoPlaybackStarted)})).catch((e=>{"NotAllowedError"===e.name?this.emit(n?Qi.AudioPlaybackFailed:Qi.VideoPlaybackFailed,e):"AbortError"===e.name?Vt.debug("".concat(n?"audio":"video"," playback aborted, likely due to new play request")):Vt.warn("could not playback ".concat(n?"audio":"video"),e),n&&A&&t.some((A=>"video"===A.kind))&&"NotAllowedError"===e.name&&(A.muted=!0,A.play().catch((()=>{})))})),this.emit(Qi.ElementAttached,A),A}detach(A){try{if(A){Xi(this.mediaStreamTrack,A);const e=this.attachedElements.indexOf(A);return e>=0&&(this.attachedElements.splice(e,1),this.recycleElement(A),this.emit(Qi.ElementDetached,A)),A}const e=[];return this.attachedElements.forEach((A=>{Xi(this.mediaStreamTrack,A),e.push(A),this.recycleElement(A),this.emit(Qi.ElementDetached,A)})),this.attachedElements=[],e}finally{0===this.attachedElements.length&&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(A){A.loggerName&&(this.log=Gt(A.loggerName)),A.loggerContextCb&&(this.loggerContextCb=A.loggerContextCb)}recycleElement(A){if(A instanceof HTMLAudioElement){let e=!0;A.pause(),Vi.forEach((A=>{A.parentElement||(e=!1)})),e&&Vi.push(A)}}handleAppVisibilityChanged(){return Xt(this,void 0,void 0,(function*(){this.isInBackground="hidden"===document.visibilityState,this.isInBackground||this.kind!==Ji.Kind.Video||setTimeout((()=>this.attachedElements.forEach((A=>A.play().catch((()=>{}))))),0)}))}addAppVisibilityListener(){pr()?(this.isInBackground="hidden"===document.visibilityState,document.addEventListener("visibilitychange",this.appVisibilityChangedListener)):this.isInBackground=!1}removeAppVisibilityListener(){pr()&&document.removeEventListener("visibilitychange",this.appVisibilityChangedListener)}}function Wi(A,e){let t,n;t=e.srcObject instanceof MediaStream?e.srcObject:new MediaStream,n="audio"===A.kind?t.getAudioTracks():t.getVideoTracks(),n.includes(A)||(n.forEach((A=>{t.removeTrack(A)})),t.addTrack(A)),hr()&&e instanceof HTMLVideoElement||(e.autoplay=!0),e.muted=0===t.getAudioTracks().length,e instanceof HTMLVideoElement&&(e.playsInline=!0),e.srcObject!==t&&(e.srcObject=t,(hr()||ur())&&e instanceof HTMLVideoElement&&setTimeout((()=>{e.srcObject=t,e.play().catch((()=>{}))}),0))}function Xi(A,e){if(e.srcObject instanceof MediaStream){const t=e.srcObject;t.removeTrack(A),t.getTracks().length>0?e.srcObject=t:e.srcObject=null}}!function(A){let e;var t;let n;var i;let r;var s;(t=e=A.Kind||(A.Kind={})).Audio="audio",t.Video="video",t.Unknown="unknown",(i=n=A.Source||(A.Source={})).Camera="camera",i.Microphone="microphone",i.ScreenShare="screen_share",i.ScreenShareAudio="screen_share_audio",i.Unknown="unknown",(s=r=A.StreamState||(A.StreamState={})).Active="active",s.Paused="paused",s.Unknown="unknown",A.kindToProto=function(A){switch(A){case e.Audio:return GA.AUDIO;case e.Video:return GA.VIDEO;default:return GA.DATA}},A.kindFromProto=function(A){switch(A){case GA.AUDIO:return e.Audio;case GA.VIDEO:return e.Video;default:return e.Unknown}},A.sourceToProto=function(A){switch(A){case n.Camera:return jA.CAMERA;case n.Microphone:return jA.MICROPHONE;case n.ScreenShare:return jA.SCREEN_SHARE;case n.ScreenShareAudio:return jA.SCREEN_SHARE_AUDIO;default:return jA.UNKNOWN}},A.sourceFromProto=function(A){switch(A){case jA.CAMERA:return n.Camera;case jA.MICROPHONE:return n.Microphone;case jA.SCREEN_SHARE:return n.ScreenShare;case jA.SCREEN_SHARE_AUDIO:return n.ScreenShareAudio;default:return n.Unknown}},A.streamStateFromProto=function(A){switch(A){case Me.ACTIVE:return r.Active;case Me.PAUSED:return r.Paused;default:return r.Unknown}}}(Ji||(Ji={}));class Yi{constructor(A,e,t,n,i){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===e||void 0===t)throw new TypeError("Unsupported options: provide at least width, height and maxBitrate");this.width=A,this.height=e,this.aspectRatio=A/e,this.encoding={maxBitrate:t,maxFramerate:n,priority:i}}}get resolution(){return{width:this.width,height:this.height,frameRate:this.encoding.maxFramerate,aspectRatio:this.aspectRatio}}}const qi=["vp8","h264"],$i=["vp8","h264","vp9","av1"];function Zi(A){return!!qi.find((e=>e===A))}var zi,Ar,er,tr;(Ar=zi||(zi={}))[Ar.PREFER_REGRESSION=0]="PREFER_REGRESSION",Ar[Ar.SIMULCAST=1]="SIMULCAST",Ar[Ar.REGRESSION=2]="REGRESSION",(tr=er||(er={})).telephone={maxBitrate:12e3},tr.speech={maxBitrate:24e3},tr.music={maxBitrate:48e3},tr.musicStereo={maxBitrate:64e3},tr.musicHighQuality={maxBitrate:96e3},tr.musicHighQualityStereo={maxBitrate:128e3};const nr={h90:new Yi(160,90,9e4,20),h180:new Yi(320,180,16e4,20),h216:new Yi(384,216,18e4,20),h360:new Yi(640,360,45e4,20),h540:new Yi(960,540,8e5,25),h720:new Yi(1280,720,17e5,30),h1080:new Yi(1920,1080,3e6,30),h1440:new Yi(2560,1440,5e6,30),h2160:new Yi(3840,2160,8e6,30)},ir={h120:new Yi(160,120,7e4,20),h180:new Yi(240,180,125e3,20),h240:new Yi(320,240,14e4,20),h360:new Yi(480,360,33e4,20),h480:new Yi(640,480,5e5,20),h540:new Yi(720,540,6e5,25),h720:new Yi(960,720,13e5,30),h1080:new Yi(1440,1080,23e5,30),h1440:new Yi(1920,1440,38e5,30)},rr={h360fps3:new Yi(640,360,2e5,3,"medium"),h360fps15:new Yi(640,360,4e5,15,"medium"),h720fps5:new Yi(1280,720,8e5,5,"medium"),h720fps15:new Yi(1280,720,15e5,15,"medium"),h720fps30:new Yi(1280,720,2e6,30,"medium"),h1080fps15:new Yi(1920,1080,25e5,15,"medium"),h1080fps30:new Yi(1920,1080,5e6,30,"medium"),original:new Yi(0,0,7e6,30,"medium")},sr="https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension";function or(A){return Xt(this,void 0,void 0,(function*(){return new Promise((e=>_i.setTimeout(e,A)))}))}function ar(){return"addTransceiver"in RTCPeerConnection.prototype}function cr(){return"addTrack"in RTCPeerConnection.prototype}function dr(A){return"av1"===A||"vp9"===A}function lr(A){return!!document&&(A||(A=document.createElement("audio")),"setSinkId"in A)}function ur(){var A;return"Firefox"===(null===(A=Oi())||void 0===A?void 0:A.name)}function hr(){var A;return"Safari"===(null===(A=Oi())||void 0===A?void 0:A.name)}function gr(){var A,e;return!!pr()&&(null!==(e=null===(A=navigator.userAgentData)||void 0===A?void 0:A.mobile)&&void 0!==e?e:/Tablet|iPad|Mobile|Android|BlackBerry/.test(navigator.userAgent))}function pr(){return"undefined"!=typeof document}function mr(){return"ReactNative"==navigator.product}function fr(A){return A.hostname.endsWith(".livekit.cloud")||A.hostname.endsWith(".livekit.run")}function Br(){if(global&&global.LiveKitReactNativeGlobal)return global.LiveKitReactNativeGlobal}function wr(){if(!mr())return;let A=Br();return A?A.platform:void 0}function vr(){if(pr())return window.devicePixelRatio;if(mr()){let A=Br();if(A)return A.devicePixelRatio}return 1}function Cr(A,e){const t=A.split("."),n=e.split("."),i=Math.min(t.length,n.length);for(let r=0;r<i;++r){const A=parseInt(t[r],10),e=parseInt(n[r],10);if(A>e)return 1;if(A<e)return-1;if(r===i-1&&A===e)return 0}return""===A&&""!==e?-1:""===e?1:t.length==n.length?0:t.length<n.length?-1:1}function yr(A){for(const e of A)e.target.handleResize(e)}function br(A){for(const e of A)e.target.handleVisibilityChanged(e)}let Qr=null;const Ur=()=>(Qr||(Qr=new ResizeObserver(yr)),Qr);let kr=null;const Er=()=>(kr||(kr=new IntersectionObserver(br,{root:null,rootMargin:"0px"})),kr);function Fr(){let A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=document.createElement("canvas");i.width=A,i.height=e;const r=i.getContext("2d");null==r||r.fillRect(0,0,i.width,i.height),n&&r&&(r.beginPath(),r.arc(A/2,e/2,50,0,2*Math.PI,!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=t,o}let Tr;function Sr(){if(!Tr){const A=new AudioContext,e=A.createOscillator(),t=A.createGain();t.gain.setValueAtTime(0,0);const n=A.createMediaStreamDestination();if(e.connect(t),t.connect(n),e.start(),[Tr]=n.stream.getAudioTracks(),!Tr)throw Error("Could not get empty media stream audio track");Tr.enabled=!1}return Tr.clone()}class Ir{constructor(A,e){this.onFinally=e,this.promise=new Promise(((e,t)=>Xt(this,void 0,void 0,(function*(){this.resolve=e,this.reject=t,A&&(yield A(e,t))})))).finally((()=>{var A;return null===(A=this.onFinally)||void 0===A?void 0:A.call(this)}))}}function Pr(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 Hr(A){return A.startsWith("ws")?A.replace(/^(ws)/,"http"):A}function Rr(A){switch(A.reason){case ui.LeaveRequest:return A.context;case ui.Cancelled:return YA.CLIENT_INITIATED;case ui.NotAllowed:return YA.USER_REJECTED;case ui.ServerUnreachable:return YA.JOIN_FAILURE;default:return YA.UNKNOWN_REASON}}function Dr(A){return void 0!==A?Number(A):void 0}function xr(A){return void 0!==A?BigInt(A):void 0}function Lr(A){return!!A&&!(A instanceof MediaStreamTrack)&&A.isLocal}function Or(A){return!!A&&A.kind==Ji.Kind.Audio}function Mr(A){return!!A&&A.kind==Ji.Kind.Video}function Nr(A){return Lr(A)&&Mr(A)}function Kr(A){return Lr(A)&&Or(A)}function _r(A){return!!A&&!A.isLocal}function Vr(A){return!!A&&!A.isLocal}function Gr(A){return _r(A)&&Mr(A)}function jr(A,e,t){var n,i,r,s;const{optionsWithoutProcessor:o,audioProcessor:a,videoProcessor:c}=As(null!=A?A:{}),d=null==e?void 0:e.processor,l=null==t?void 0:t.processor,u=null!=o?o:{};return!0===u.audio&&(u.audio={}),!0===u.video&&(u.video={}),u.audio&&(Jr(u.audio,e),null!==(n=(r=u.audio).deviceId)&&void 0!==n||(r.deviceId={ideal:"default"}),(a||d)&&(u.audio.processor=null!=a?a:d)),u.video&&(Jr(u.video,t),null!==(i=(s=u.video).deviceId)&&void 0!==i||(s.deviceId={ideal:"default"}),(c||l)&&(u.video.processor=null!=c?c:l)),u}function Jr(A,e){return Object.keys(e).forEach((t=>{void 0===A[t]&&(A[t]=e[t])})),A}function Wr(A){var e,t,n,i;const r={};if(A.video)if("object"==typeof A.video){const t={},i=t,s=A.video;Object.keys(s).forEach((A=>{"resolution"===A?Jr(i,s.resolution):i[A]=s[A]})),r.video=t,null!==(e=(n=r.video).deviceId)&&void 0!==e||(n.deviceId={ideal:"default"})}else r.video=!!A.video&&{deviceId:{ideal:"default"}};else r.video=!1;return A.audio?"object"==typeof A.audio?(r.audio=A.audio,null!==(t=(i=r.audio).deviceId)&&void 0!==t||(i.deviceId={ideal:"default"})):r.audio={deviceId:{ideal:"default"}}:r.audio=!1,r}function Xr(){var A;const e="undefined"!=typeof window&&(window.AudioContext||window.webkitAudioContext);if(e){const t=new e({latencyHint:"interactive"});if("suspended"===t.state&&"undefined"!=typeof window&&(null===(A=window.document)||void 0===A?void 0:A.body)){const A=()=>Xt(this,void 0,void 0,(function*(){var e;try{"suspended"===t.state&&(yield t.resume())}catch(n){console.warn("Error trying to auto-resume audio context",n)}null===(e=window.document.body)||void 0===e||e.removeEventListener("click",A)}));window.document.body.addEventListener("click",A)}return t}}function Yr(A){return"audioinput"===A?Ji.Source.Microphone:"videoinput"===A?Ji.Source.Camera:Ji.Source.Unknown}function qr(A){return A===Ji.Source.Microphone?"audioinput":A===Ji.Source.Camera?"videoinput":void 0}function $r(A){return A.split("/")[1].toLowerCase()}function Zr(A){const e=[];return A.forEach((A=>{void 0!==A.track&&e.push(new Ye({cid:A.track.mediaStreamID,track:A.trackInfo}))})),e}function zr(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?zr(A.track):{})}}function As(A){const e=Object.assign({},A);let t,n;return"object"==typeof e.audio&&e.audio.processor&&(t=e.audio.processor,e.audio=Object.assign(Object.assign({},e.audio),{processor:void 0})),"object"==typeof e.video&&e.video.processor&&(n=e.video.processor,e.video=Object.assign(Object.assign({},e.video),{processor:void 0})),{audioProcessor:t,videoProcessor:n,optionsWithoutProcessor:(i=e,void 0===i?i:"function"==typeof structuredClone?structuredClone(i):JSON.parse(JSON.stringify(i)))};var i}class es extends Zt.EventEmitter{constructor(A){super(),this.onWorkerMessage=A=>{var e,t;const{kind:n,data:i}=A.data;switch(n){case"error":Vt.error(i.error.message),this.emit(ci.EncryptionError,i.error);break;case"initAck":i.enabled&&this.keyProvider.getKeys().forEach((A=>{this.postKey(A)}));break;case"enable":if(i.enabled&&this.keyProvider.getKeys().forEach((A=>{this.postKey(A)})),this.encryptionEnabled!==i.enabled&&i.participantIdentity===(null===(e=this.room)||void 0===e?void 0:e.localParticipant.identity))this.emit(ci.ParticipantEncryptionStatusChanged,i.enabled,this.room.localParticipant),this.encryptionEnabled=i.enabled;else if(i.participantIdentity){const A=null===(t=this.room)||void 0===t?void 0:t.getParticipantByIdentity(i.participantIdentity);if(!A)throw TypeError("couldn't set encryption status, participant not found".concat(i.participantIdentity));this.emit(ci.ParticipantEncryptionStatusChanged,i.enabled,A)}break;case"ratchetKey":this.keyProvider.emit(si.KeyRatcheted,i.ratchetResult,i.participantIdentity,i.keyIndex)}},this.onWorkerError=A=>{Vt.error("e2ee worker encountered an error:",{error:A.error}),this.emit(ci.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||ki()))throw new Ti("tried to setup end-to-end encryption on an unsupported browser");if(Vt.info("setting up e2ee"),A!==this.room){this.room=A,this.setupEventListeners(A,this.keyProvider);const e={kind:"init",data:{keyProviderOptions:this.keyProvider.getOptions(),loglevel:jt.getLevel()}};this.worker&&(Vt.info("initializing worker",{worker:this.worker}),this.worker.onmessage=this.onWorkerMessage,this.worker.onerror=this.onWorkerError,this.worker.postMessage(e))}}setParticipantCryptorEnabled(A,e){Vt.debug("set e2ee to ".concat(A," for participant ").concat(e)),this.postEnable(A,e)}setSifTrailer(A){A&&0!==A.length?this.postSifTrailer(A):Vt.warn("ignoring server sent trailer as it's empty")}setupEngine(A){A.on(yi.RTPVideoMapUpdate,(A=>{this.postRTPMap(A)}))}setupEventListeners(A,e){A.on(Bi.TrackPublished,((A,e)=>this.setParticipantCryptorEnabled(A.trackInfo.encryption!==se.NONE,e.identity))),A.on(Bi.ConnectionStateChanged,(e=>{e===vo.Connected&&A.remoteParticipants.forEach((A=>{A.trackPublications.forEach((e=>{this.setParticipantCryptorEnabled(e.trackInfo.encryption!==se.NONE,A.identity)}))}))})).on(Bi.TrackUnsubscribed,((A,e,t)=>{var n;const i={kind:"removeTransform",data:{participantIdentity:t.identity,trackId:A.mediaStreamID}};null===(n=this.worker)||void 0===n||n.postMessage(i)})).on(Bi.TrackSubscribed,((A,e,t)=>{this.setupE2EEReceiver(A,t.identity,e.trackInfo)})).on(Bi.SignalConnected,(()=>{if(!this.room)throw new TypeError("expected room to be present on signal connect");e.getKeys().forEach((A=>{this.postKey(A)})),this.setParticipantCryptorEnabled(this.room.localParticipant.isE2EEEnabled,this.room.localParticipant.identity)})),A.localParticipant.on(vi.LocalTrackPublished,(A=>Xt(this,void 0,void 0,(function*(){this.setupE2EESender(A.track,A.track.sender)})))),e.on(si.SetKey,(A=>this.postKey(A))).on(si.RatchetRequest,((A,e)=>this.postRatchetRequest(A,e)))}postRatchetRequest(A,e){if(!this.worker)throw Error("could not ratchet key, worker is missing");const t={kind:"ratchetRequest",data:{participantIdentity:A,keyIndex:e}};this.worker.postMessage(t)}postKey(A){let{key:e,participantIdentity:t,keyIndex:n}=A;var i;if(!this.worker)throw Error("could not set key, worker is missing");const r={kind:"setKey",data:{participantIdentity:t,isPublisher:t===(null===(i=this.room)||void 0===i?void 0:i.localParticipant.identity),key:e,keyIndex:n}};this.worker.postMessage(r)}postEnable(A,e){if(!this.worker)throw new ReferenceError("failed to enable e2ee, worker is not ready");{const t={kind:"enable",data:{enabled:A,participantIdentity:e}};this.worker.postMessage(t)}}postRTPMap(A){var e;if(!this.worker)throw TypeError("could not post rtp map, worker is missing");if(!(null===(e=this.room)||void 0===e?void 0:e.localParticipant.identity))throw TypeError("could not post rtp map, local participant identity is missing");const t={kind:"setRTPMap",data:{map:A,participantIdentity:this.room.localParticipant.identity}};this.worker.postMessage(t)}postSifTrailer(A){if(!this.worker)throw Error("could not post SIF trailer, worker is missing");const e={kind:"setSifTrailer",data:{trailer:A}};this.worker.postMessage(e)}setupE2EEReceiver(A,e,t){if(A.receiver){if(!(null==t?void 0:t.mimeType)||""===t.mimeType)throw new TypeError("MimeType missing from trackInfo, cannot set up E2EE cryptor");this.handleReceiver(A.receiver,A.mediaStreamID,e,"video"===A.kind?$r(t.mimeType):void 0)}}setupE2EESender(A,e){Lr(A)&&e?this.handleSender(e,A.mediaStreamID,void 0):e||Vt.warn("early return because sender is not ready")}handleReceiver(A,e,t,n){return Xt(this,void 0,void 0,(function*(){if(this.worker){if(ki()){const i={kind:"decode",participantIdentity:t,trackId:e,codec:n};A.transform=new RTCRtpScriptTransform(this.worker,i)}else{if(ri in A&&n){const A={kind:"updateCodec",data:{trackId:e,codec:n,participantIdentity:t}};return void this.worker.postMessage(A)}let i=A.writableStream,r=A.readableStream;if(!i||!r){const e=A.createEncodedStreams();A.writableStream=e.writable,i=e.writable,A.readableStream=e.readable,r=e.readable}const s={kind:"decode",data:{readableStream:r,writableStream:i,trackId:e,codec:n,participantIdentity:t}};this.worker.postMessage(s,[r,i])}A[ri]=!0}}))}handleSender(A,e,t){var n;if(!(ri in A)&&this.worker){if(!(null===(n=this.room)||void 0===n?void 0:n.localParticipant.identity)||""===this.room.localParticipant.identity)throw TypeError("local identity needs to be known in order to set up encrypted sender");if(ki()){Vt.info("initialize script transform");const n={kind:"encode",participantIdentity:this.room.localParticipant.identity,trackId:e,codec:t};A.transform=new RTCRtpScriptTransform(this.worker,n)}else{Vt.info("initialize encoded streams");const n=A.createEncodedStreams(),i={kind:"encode",data:{readableStream:n.readable,writableStream:n.writable,codec:t,trackId:e,participantIdentity:this.room.localParticipant.identity}};this.worker.postMessage(i,[n.readable,n.writable])}A[ri]=!0}}}const ts="default";class ns{constructor(){this._previousDevices=[]}static getInstance(){return void 0===this.instance&&(this.instance=new ns),this.instance}get previousDevices(){return this._previousDevices}getDevices(A){return Xt(this,arguments,void 0,(function(A){var e=this;let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return function*(){var n;if((null===(n=ns.userMediaPromiseMap)||void 0===n?void 0:n.size)>0){Vt.debug("awaiting getUserMedia promise");try{A?yield ns.userMediaPromiseMap.get(A):yield Promise.all(ns.userMediaPromiseMap.values())}catch(r){Vt.warn("error waiting for media permissons")}}let i=yield navigator.mediaDevices.enumerateDevices();if(t&&(!hr()||!e.hasDeviceInUse(A))&&(0===i.filter((e=>e.kind===A)).length||i.some((e=>{const t=""===e.label,n=!A||e.kind===A;return t&&n})))){const e={video:"audioinput"!==A&&"audiooutput"!==A,audio:"videoinput"!==A&&{deviceId:{ideal:"default"}}},t=yield navigator.mediaDevices.getUserMedia(e);i=yield navigator.mediaDevices.enumerateDevices(),t.getTracks().forEach((A=>{A.stop()}))}return e._previousDevices=i,A&&(i=i.filter((e=>e.kind===A))),i}()}))}normalizeDeviceId(A,e,t){return Xt(this,void 0,void 0,(function*(){if(e!==ts)return e;const n=yield this.getDevices(A),i=n.find((A=>A.deviceId===ts));if(!i)return void Vt.warn("could not reliably determine default device");const r=n.find((A=>A.deviceId!==ts&&A.groupId===(null!=t?t:i.groupId)));if(r)return null==r?void 0:r.deviceId;Vt.warn("could not reliably determine default device")}))}hasDeviceInUse(A){return A?ns.userMediaPromiseMap.has(A):ns.userMediaPromiseMap.size>0}}var is,rs;ns.mediaDeviceKinds=["audioinput","audiooutput","videoinput"],ns.userMediaPromiseMap=new Map,(rs=is||(is={}))[rs.WAITING=0]="WAITING",rs[rs.RUNNING=1]="RUNNING",rs[rs.COMPLETED=2]="COMPLETED";class ss{constructor(){this.pendingTasks=new Map,this.taskMutex=new a,this.nextTaskIndex=0}run(A){return Xt(this,void 0,void 0,(function*(){const e={id:this.nextTaskIndex++,enqueuedAt:Date.now(),status:is.WAITING};this.pendingTasks.set(e.id,e);const t=yield this.taskMutex.lock();try{return e.executedAt=Date.now(),e.status=is.RUNNING,yield A()}finally{e.status=is.COMPLETED,this.pendingTasks.delete(e.id),t()}}))}flush(){return Xt(this,void 0,void 0,(function*(){return this.run((()=>Xt(this,void 0,void 0,(function*(){}))))}))}snapshot(){return Array.from(this.pendingTasks.values())}}function os(A,e){return A.pathname="".concat(function(A){return A.endsWith("/")?A:"".concat(A,"/")}(A.pathname)).concat(e),A.toString()}const as=["syncState","trickle","offer","answer","simulate","leave"];var cs,ds;(ds=cs||(cs={}))[ds.CONNECTING=0]="CONNECTING",ds[ds.CONNECTED=1]="CONNECTED",ds[ds.RECONNECTING=2]="RECONNECTING",ds[ds.DISCONNECTING=3]="DISCONNECTING",ds[ds.DISCONNECTED=4]="DISCONNECTED";class ls{get currentState(){return this.state}get isDisconnected(){return this.state===cs.DISCONNECTING||this.state===cs.DISCONNECTED}get isEstablishingConnection(){return this.state===cs.CONNECTING||this.state===cs.RECONNECTING}getNextRequestId(){return this._requestId+=1,this._requestId}constructor(){let A=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var t;this.rtt=0,this.state=cs.DISCONNECTED,this.log=Vt,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=Gt(null!==(t=e.loggerName)&&void 0!==t?t:Mt.Signal),this.loggerContextCb=e.loggerContextCb,this.useJSON=A,this.requestQueue=new ss,this.queuedRequests=[],this.closingLock=new a,this.connectionLock=new a,this.state=cs.DISCONNECTED}get logContext(){var A,e;return null!==(e=null===(A=this.loggerContextCb)||void 0===A?void 0:A.call(this))&&void 0!==e?e:{}}join(A,e,t,n){return Xt(this,void 0,void 0,(function*(){return this.state=cs.CONNECTING,this.options=t,yield this.connect(A,e,t,n)}))}reconnect(A,e,t,n){return Xt(this,void 0,void 0,(function*(){if(this.options)return this.state=cs.RECONNECTING,this.clearPingInterval(),yield this.connect(A,e,Object.assign(Object.assign({},this.options),{reconnect:!0,sid:t,reconnectReason:n}));this.log.warn("attempted to reconnect without signal options being set, ignoring",this.logContext)}))}connect(A,e,t,n){this.connectOptions=t;const i=function(A,e,t){var n;const i=new URLSearchParams;return i.set("access_token",A),t.reconnect&&(i.set("reconnect","1"),t.sid&&i.set("sid",t.sid)),i.set("auto_subscribe",t.autoSubscribe?"1":"0"),i.set("sdk",mr()?"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),t.adaptiveStream&&i.set("adaptive_stream","1"),t.reconnectReason&&i.set("reconnect_reason",t.reconnectReason.toString()),(null===(n=navigator.connection)||void 0===n?void 0:n.type)&&i.set("network",navigator.connection.type),i}(e,function(){var A;const e=new ke({sdk:Ee.JS,protocol:16,version:"2.13.0"});return mr()&&(e.os=null!==(A=wr())&&void 0!==A?A:""),e}(),t),r=function(A,e){const t=new URL(function(A){return A.startsWith("http")?A.replace(/^(http)/,"ws"):A}(A));return e.forEach(((A,e)=>{t.searchParams.set(e,A)})),os(t,"rtc")}(A,i),s=os(new URL(Hr(r)),"validate");return new Promise(((A,e)=>Xt(this,void 0,void 0,(function*(){const i=yield this.connectionLock.lock();try{const i=()=>Xt(this,void 0,void 0,(function*(){this.close(),clearTimeout(o),e(new Fi("room connection has been cancelled (signal)",ui.Cancelled))})),o=setTimeout((()=>{this.close(),e(new Fi("room connection has timed out (signal)",ui.ServerUnreachable))}),t.websocketTimeout);(null==n?void 0:n.aborted)&&i(),null==n||n.addEventListener("abort",i);const a=new URL(r);a.searchParams.has("access_token")&&a.searchParams.set("access_token","<redacted>"),this.log.debug("connecting to ".concat(a),Object.assign({reconnect:t.reconnect,reconnectReason:t.reconnectReason},this.logContext)),this.ws&&(yield this.close(!1)),this.ws=new WebSocket(r),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{clearTimeout(o)},this.ws.onerror=A=>Xt(this,void 0,void 0,(function*(){if(this.state===cs.CONNECTED)this.handleWSError(A);else{this.state=cs.DISCONNECTED,clearTimeout(o);try{const t=yield fetch(s);if(t.status.toFixed(0).startsWith("4")){const A=yield t.text();e(new Fi(A,ui.NotAllowed,t.status))}else e(new Fi("Encountered unknown websocket error during connection: ".concat(A.toString()),ui.InternalError,t.status))}catch(t){e(new Fi(t instanceof Error?t.message:"server was not reachable",ui.ServerUnreachable))}}})),this.ws.onmessage=r=>Xt(this,void 0,void 0,(function*(){var s,o,a;let c;if("string"==typeof r.data){const A=JSON.parse(r.data);c=_e.fromJson(A,{ignoreUnknownFields:!0})}else{if(!(r.data instanceof ArrayBuffer))return void this.log.error("could not decode websocket message: ".concat(typeof r.data),this.logContext);c=_e.fromBinary(new Uint8Array(r.data))}if(this.state!==cs.CONNECTED){let r=!1;if("join"===(null===(s=c.message)||void 0===s?void 0:s.case)?(this.state=cs.CONNECTED,null==n||n.removeEventListener("abort",i),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===cs.RECONNECTING&&"leave"!==c.message.case?(this.state=cs.CONNECTED,null==n||n.removeEventListener("abort",i),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),r=!0)):this.isEstablishingConnection&&"leave"===c.message.case?e(new Fi("Received leave request while trying to (re)connect",ui.LeaveRequest,void 0,c.message.value.reason)):t.reconnect||e(new Fi("did not receive join response, got ".concat(null===(a=c.message)||void 0===a?void 0:a.case," instead"),ui.InternalError)),!r)return}this.signalLatency&&(yield or(this.signalLatency)),this.handleSignalResponse(c)})),this.ws.onclose=A=>{this.isEstablishingConnection&&e(new Fi("Websocket got closed during a (re)connection attempt",ui.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{i()}}))))}close(){return Xt(this,arguments,void 0,(function(){var A=this;let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function*(){const t=yield A.closingLock.lock();try{if(A.clearPingInterval(),e&&(A.state=cs.DISCONNECTING),A.ws){A.ws.onmessage=null,A.ws.onopen=null,A.ws.onclose=null;const e=new Promise((e=>{A.ws?A.ws.onclose=()=>{e()}:e()}));A.ws.readyState<A.ws.CLOSING&&(A.ws.close(),yield Promise.race([e,or(250)])),A.ws=void 0}}finally{e&&(A.state=cs.DISCONNECTED),t()}}()}))}sendOffer(A){this.log.debug("sending offer",Object.assign(Object.assign({},this.logContext),{offerSdp:A.sdp})),this.sendRequest({case:"offer",value:hs(A)})}sendAnswer(A){return this.log.debug("sending answer",Object.assign(Object.assign({},this.logContext),{answerSdp:A.sdp})),this.sendRequest({case:"answer",value:hs(A)})}sendIceCandidate(A,e){return this.log.debug("sending ice candidate",Object.assign(Object.assign({},this.logContext),{candidate:A})),this.sendRequest({case:"trickle",value:new je({candidateInit:JSON.stringify(A),target:e})})}sendMuteTrack(A,e){return this.sendRequest({case:"mute",value:new Je({sid:A,muted:e})})}sendAddTrack(A){return this.sendRequest({case:"addTrack",value:A})}sendUpdateLocalMetadata(A,e){return Xt(this,arguments,void 0,(function(A,e){var t=this;let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){const i=t.getNextRequestId();return yield t.sendRequest({case:"updateMetadata",value:new st({requestId:i,metadata:A,name:e,attributes:n})}),i}()}))}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,e){return this.sendRequest({case:"updateLayers",value:new rt({trackSid:A,layers:e})})}sendUpdateSubscriptionPermissions(A,e){return this.sendRequest({case:"subscriptionPermission",value:new Bt({allParticipants:A,trackPermissions:e})})}sendSimulateScenario(A){return this.sendRequest({case:"simulate",value:A})}sendPing(){return Promise.all([this.sendRequest({case:"ping",value:F.parse(Date.now())}),this.sendRequest({case:"pingReq",value:new Qt({timestamp:F.parse(Date.now()),rtt:F.parse(this.rtt)})})])}sendUpdateLocalAudioTrack(A,e){return this.sendRequest({case:"updateAudioTrack",value:new et({trackSid:A,features:e})})}sendLeave(){return this.sendRequest({case:"leave",value:new nt({reason:YA.CLIENT_INITIATED,action:it.DISCONNECT})})}sendRequest(A){return Xt(this,arguments,void 0,(function(A){var e=this;let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function*(){const n=!t&&!function(A){const e=as.indexOf(A.case)>=0;return Vt.trace("request allowed to bypass queue:",{canPass:e,req:A}),e}(A);if(n&&e.state===cs.RECONNECTING)return void e.queuedRequests.push((()=>Xt(e,void 0,void 0,(function*(){yield this.sendRequest(A,!0)}))));if(t||(yield e.requestQueue.flush()),e.signalLatency&&(yield or(e.signalLatency)),!e.ws||e.ws.readyState!==e.ws.OPEN)return void e.log.error("cannot send signal request before connected, type: ".concat(null==A?void 0:A.case),e.logContext);const i=new Ke({message:A});try{e.useJSON?e.ws.send(i.toJsonString()):e.ws.send(i.toBinary())}catch(r){e.log.error("error sending signal message",Object.assign(Object.assign({},e.logContext),{error:r}))}}()}))}handleSignalResponse(A){var e,t;const n=A.message;if(null==n)return void this.log.debug("received unsupported message",this.logContext);let i=!1;if("answer"===n.case){const A=us(n.value);this.onAnswer&&this.onAnswer(A)}else if("offer"===n.case){const A=us(n.value);this.onOffer&&this.onOffer(A)}else if("trickle"===n.case){const A=JSON.parse(n.value.candidateInit);this.onTrickle&&this.onTrickle(A,n.value.target)}else"update"===n.case?this.onParticipantUpdate&&this.onParticipantUpdate(null!==(e=n.value.participants)&&void 0!==e?e:[]):"trackPublished"===n.case?this.onLocalTrackPublished&&this.onLocalTrackPublished(n.value):"speakersChanged"===n.case?this.onSpeakersChanged&&this.onSpeakersChanged(null!==(t=n.value.speakers)&&void 0!==t?t:[]):"leave"===n.case?this.onLeave&&this.onLeave(n.value):"mute"===n.case?this.onRemoteMuteChanged&&this.onRemoteMuteChanged(n.value.sid,n.value.muted):"roomUpdate"===n.case?this.onRoomUpdate&&n.value.room&&this.onRoomUpdate(n.value.room):"connectionQuality"===n.case?this.onConnectionQuality&&this.onConnectionQuality(n.value):"streamStateUpdate"===n.case?this.onStreamStateUpdate&&this.onStreamStateUpdate(n.value):"subscribedQualityUpdate"===n.case?this.onSubscribedQualityUpdate&&this.onSubscribedQualityUpdate(n.value):"subscriptionPermissionUpdate"===n.case?this.onSubscriptionPermissionUpdate&&this.onSubscriptionPermissionUpdate(n.value):"refreshToken"===n.case?this.onTokenRefresh&&this.onTokenRefresh(n.value):"trackUnpublished"===n.case?this.onLocalTrackUnpublished&&this.onLocalTrackUnpublished(n.value):"subscriptionResponse"===n.case?this.onSubscriptionError&&this.onSubscriptionError(n.value):"pong"===n.case||("pongResp"===n.case?(this.rtt=Date.now()-Number.parseInt(n.value.lastPingTimestamp.toString()),this.resetPingTimeout(),i=!0):"requestResponse"===n.case?this.onRequestResponse&&this.onRequestResponse(n.value):"trackSubscribed"===n.case?this.onLocalTrackSubscribed&&this.onLocalTrackSubscribed(n.value.trackSid):"roomMoved"===n.case?(this.onTokenRefresh&&this.onTokenRefresh(n.value.token),this.onRoomMoved&&this.onRoomMoved(n.value)):this.log.debug("unsupported message",Object.assign(Object.assign({},this.logContext),{msgCase:n.case})));i||this.resetPingTimeout()}setReconnected(){for(;this.queuedRequests.length>0;){const A=this.queuedRequests.shift();A&&this.requestQueue.run(A)}}handleOnClose(A){return Xt(this,void 0,void 0,(function*(){if(this.state===cs.DISCONNECTED)return;const e=this.onClose;yield this.close(),this.log.debug("websocket connection closed: ".concat(A),Object.assign(Object.assign({},this.logContext),{reason:A})),e&&e(A)}))}handleWSError(A){this.log.error("websocket error",Object.assign(Object.assign({},this.logContext),{error:A}))}resetPingTimeout(){this.clearPingTimeout(),this.pingTimeoutDuration?this.pingTimeout=_i.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&&_i.clearTimeout(this.pingTimeout)}startPingInterval(){this.clearPingInterval(),this.resetPingTimeout(),this.pingIntervalDuration?(this.log.debug("start ping interval",this.logContext),this.pingInterval=_i.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&&_i.clearInterval(this.pingInterval)}}function us(A){const e={type:"offer",sdp:A.sdp};switch(A.type){case"answer":case"offer":case"pranswer":case"rollback":e.type=A.type}return e}function hs(A){return new $e({sdp:A.sdp,type:A.type})}var gs,ps,ms,fs,Bs,ws={},vs={},Cs={exports:{}};function ys(){if(gs)return Cs.exports;gs=1;var A=Cs.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 e="candidate:%s %d %s %d %s %d typ %s";return e+=null!=A.raddr?" raddr %s rport %d":"%v%v",e+=null!=A.tcptype?" tcptype %s":"%v",null!=A.generation&&(e+=" generation %d"),(e+=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 e="ssrc:%d";return null!=A.attribute&&(e+=" %s",null!=A.value&&(e+=":%s")),e}},{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 e="mediaclk:";return e+=null!=A.id?"id=%s %s":"%v%s",e+=null!=A.mediaClockValue?"=%s":"",(e+=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(e){A[e].forEach((function(A){A.reg||(A.reg=/(.*)/),A.format||(A.format="%s")}))})),Cs.exports}function bs(){if(fs)return ms;fs=1;var A=ys(),e=/%[sdv%]/g,t=function(A){var t=1,n=arguments,i=n.length;return A.replace(e,(function(A){if(t>=i)return A;var e=n[t];switch(t+=1,A){case"%%":return"%";case"%s":return String(e);case"%d":return Number(e);case"%v":return""}}))},n=function(A,e,n){var i=[A+"="+(e.format instanceof Function?e.format(e.push?n:n[e.name]):e.format)];if(e.names)for(var r=0;r<e.names.length;r+=1){var s=e.names[r];e.name?i.push(n[e.name][s]):i.push(n[e.names[r]])}else i.push(n[e.name]);return t.apply(null,i)},i=["v","o","s","i","u","e","p","c","b","t","r","z","a"],r=["i","c","b","a"];return ms=function(e,t){t=t||{},null==e.version&&(e.version=0),null==e.name&&(e.name=" "),e.media.forEach((function(A){null==A.payloads&&(A.payloads="")}));var s=t.outerOrder||i,o=t.innerOrder||r,a=[];return s.forEach((function(t){A[t].forEach((function(A){A.name in e&&null!=e[A.name]?a.push(n(t,A,e)):A.push in e&&null!=e[A.push]&&e[A.push].forEach((function(e){a.push(n(t,A,e))}))}))})),e.media.forEach((function(e){a.push(n("m",A.m[0],e)),o.forEach((function(t){A[t].forEach((function(A){A.name in e&&null!=e[A.name]?a.push(n(t,A,e)):A.push in e&&null!=e[A.push]&&e[A.push].forEach((function(e){a.push(n(t,A,e))}))}))}))})),a.join("\r\n")+"\r\n"}}var Qs=function(){if(Bs)return ws;Bs=1;var A=(ps||(ps=1,function(A){var e=function(A){return String(Number(A))===A?Number(A):A},t=function(A,t,n){var i=A.name&&A.names;A.push&&!t[A.push]?t[A.push]=[]:i&&!t[A.name]&&(t[A.name]={});var r=A.push?{}:i?t[A.name]:t;!function(A,t,n,i){if(i&&!n)t[i]=e(A[1]);else for(var r=0;r<n.length;r+=1)null!=A[r+1]&&(t[n[r]]=e(A[r+1]))}(n.match(A.reg),r,A.names,A.name),A.push&&t[A.push].push(r)},n=ys(),i=RegExp.prototype.test.bind(/^([a-z])=(.*)/);A.parse=function(A){var e={},r=[],s=e;return A.split(/(\r\n|\r|\n)/).filter(i).forEach((function(A){var e=A[0],i=A.slice(2);"m"===e&&(r.push({rtp:[],fmtp:[]}),s=r[r.length-1]);for(var o=0;o<(n[e]||[]).length;o+=1){var a=n[e][o];if(a.reg.test(i))return t(a,s,i)}})),e.media=r,e};var r=function(A,t){var n=t.split(/=(.+)/,2);return 2===n.length?A[n[0]]=e(n[1]):1===n.length&&t.length>1&&(A[n[0]]=void 0),A};A.parseParams=function(A){return A.split(/;\s?/).reduce(r,{})},A.parseFmtpConfig=A.parseParams,A.parsePayloads=function(A){return A.toString().split(" ").map(Number)},A.parseRemoteCandidates=function(A){for(var t=[],n=A.split(" ").map(e),i=0;i<n.length;i+=3)t.push({component:n[i],ip:n[i+1],port:n[i+2]});return t},A.parseImageAttributes=function(A){return A.split(" ").map((function(A){return A.substring(1,A.length-1).split(",").reduce(r,{})}))},A.parseSimulcastStreamList=function(A){return A.split(";").map((function(A){return A.split(",").map((function(A){var t,n=!1;return"~"!==A[0]?t=e(A):(t=e(A.substring(1,A.length)),n=!0),{scid:t,paused:n}}))}))}}(vs)),vs),e=bs(),t=ys();return ws.grammar=t,ws.write=e,ws.parse=A.parse,ws.parseParams=A.parseParams,ws.parseFmtpConfig=A.parseFmtpConfig,ws.parsePayloads=A.parsePayloads,ws.parseRemoteCandidates=A.parseRemoteCandidates,ws.parseImageAttributes=A.parseImageAttributes,ws.parseSimulcastStreamList=A.parseSimulcastStreamList,ws}();function Us(A,e,t){var n,i,r;void 0===e&&(e=50),void 0===t&&(t={});var s=null!=(n=t.isImmediate)&&n,o=null!=(i=t.callback)&&i,a=t.maxWait,c=Date.now(),d=[],l=function(){var t=[].slice.call(arguments),n=this;return new Promise((function(i,l){var u=s&&void 0===r;if(void 0!==r&&clearTimeout(r),r=setTimeout((function(){if(r=void 0,c=Date.now(),!s){var e=A.apply(n,t);o&&o(e),d.forEach((function(A){return(0,A.resolve)(e)})),d=[]}}),function(){if(void 0!==a){var A=Date.now()-c;if(A+e>=a)return a-A}return e}()),u){var h=A.apply(n,t);return o&&o(h),i(h)}d.push({resolve:i,reject:l})}))};return l.cancel=function(A){void 0!==r&&clearTimeout(r),d.forEach((function(e){return(0,e.reject)(A)})),d=[]},l}const ks="negotiationStarted",Es="negotiationComplete",Fs="rtpVideoPayloadTypes";class Ts extends Zt.EventEmitter{get pc(){return this._pc||(this._pc=this.createPC()),this._pc}constructor(A){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var t;super(),this.log=Vt,this.ddExtID=0,this.pendingCandidates=[],this.restartingIce=!1,this.renegotiate=!1,this.trackBitrates=[],this.remoteStereoMids=[],this.remoteNackMids=[],this.negotiate=Us((A=>Xt(this,void 0,void 0,(function*(){this.emit(ks);try{yield this.createAndSendOffer()}catch(e){if(!A)throw e;A(e)}}))),20),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=Gt(null!==(t=e.loggerName)&&void 0!==t?t:Mt.PCTransport),this.loggerOptions=e,this.config=A,this._pc=this.createPC()}createPC(){const A=new RTCPeerConnection(this.config);return A.onicecandidate=A=>{var e;A.candidate&&(null===(e=this.onIceCandidate)||void 0===e||e.call(this,A.candidate))},A.onicecandidateerror=A=>{var e;null===(e=this.onIceCandidateError)||void 0===e||e.call(this,A)},A.oniceconnectionstatechange=()=>{var e;null===(e=this.onIceConnectionStateChange)||void 0===e||e.call(this,A.iceConnectionState)},A.onsignalingstatechange=()=>{var e;null===(e=this.onSignalingStatechange)||void 0===e||e.call(this,A.signalingState)},A.onconnectionstatechange=()=>{var e;null===(e=this.onConnectionStateChange)||void 0===e||e.call(this,A.connectionState)},A.ondatachannel=A=>{var e;null===(e=this.onDataChannel)||void 0===e||e.call(this,A)},A.ontrack=A=>{var e;null===(e=this.onTrack)||void 0===e||e.call(this,A)},A}get logContext(){var A,e;return Object.assign({},null===(e=(A=this.loggerOptions).loggerContextCb)||void 0===e?void 0:e.call(A))}get isICEConnected(){return null!==this._pc&&("connected"===this.pc.iceConnectionState||"completed"===this.pc.iceConnectionState)}addIceCandidate(A){return Xt(this,void 0,void 0,(function*(){if(this.pc.remoteDescription&&!this.restartingIce)return this.pc.addIceCandidate(A);this.pendingCandidates.push(A)}))}setRemoteDescription(A){return Xt(this,void 0,void 0,(function*(){var e;let t;if("offer"===A.type){let{stereoMids:e,nackMids:t}=function(A){var e;const t=[],n=[],i=Qs.parse(null!==(e=A.sdp)&&void 0!==e?e:"");let r=0;return i.media.forEach((A=>{var e;"audio"===A.type&&(A.rtp.some((A=>"opus"===A.codec&&(r=A.payload,!0))),(null===(e=A.rtcpFb)||void 0===e?void 0:e.some((A=>A.payload===r&&"nack"===A.type)))&&n.push(A.mid),A.fmtp.some((e=>e.payload===r&&(e.config.includes("sprop-stereo=1")&&t.push(A.mid),!0))))})),{stereoMids:t,nackMids:n}}(A);this.remoteStereoMids=e,this.remoteNackMids=t}else if("answer"===A.type){const n=Qs.parse(null!==(e=A.sdp)&&void 0!==e?e:"");n.media.forEach((A=>{"audio"===A.type&&this.trackBitrates.some((e=>{if(!e.transceiver||A.mid!=e.transceiver.mid)return!1;let t=0;if(A.rtp.some((A=>A.codec.toUpperCase()===e.codec.toUpperCase()&&(t=A.payload,!0))),0===t)return!0;let n=!1;for(const i of A.fmtp)if(i.payload===t){i.config=i.config.split(";").filter((A=>!A.includes("maxaveragebitrate"))).join(";"),e.maxbr>0&&(i.config+=";maxaveragebitrate=".concat(1e3*e.maxbr)),n=!0;break}return n||e.maxbr>0&&A.fmtp.push({payload:t,config:"maxaveragebitrate=".concat(1e3*e.maxbr)}),!0}))})),t=Qs.write(n)}yield this.setMungedSDP(A,t,!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(Es),A.sdp)&&Qs.parse(A.sdp).media.forEach((A=>{"video"===A.type&&this.emit(Fs,A.rtp)}))}))}createAndSendOffer(A){return Xt(this,void 0,void 0,(function*(){var e;if(void 0===this.onOffer)return;if((null==A?void 0:A.iceRestart)&&(this.log.debug("restarting ICE",this.logContext),this.restartingIce=!0),this._pc&&"have-local-offer"===this._pc.signalingState){const e=this._pc.remoteDescription;if(!(null==A?void 0:A.iceRestart)||!e)return void(this.renegotiate=!0);yield this._pc.setRemoteDescription(e)}else if(!this._pc||"closed"===this._pc.signalingState)return void this.log.warn("could not createOffer with closed peer connection",this.logContext);this.log.debug("starting to negotiate",this.logContext);const t=yield this.pc.createOffer(A);this.log.debug("original offer",Object.assign({sdp:t.sdp},this.logContext));const n=Qs.parse(null!==(e=t.sdp)&&void 0!==e?e:"");n.media.forEach((A=>{Is(A),"audio"===A.type?Ss(A,[],[]):"video"===A.type&&this.trackBitrates.some((e=>{if(!A.msid||!e.cid||!A.msid.includes(e.cid))return!1;let t=0;if(A.rtp.some((A=>A.codec.toUpperCase()===e.codec.toUpperCase()&&(t=A.payload,!0))),0===t)return!0;if(dr(e.codec)&&this.ensureVideoDDExtensionForSVC(A,n),"av1"!==e.codec)return!0;const i=Math.round(.7*e.maxbr);for(const n of A.fmtp)if(n.payload===t){n.config.includes("x-google-start-bitrate")||(n.config+=";x-google-start-bitrate=".concat(i));break}return!0}))})),yield this.setMungedSDP(t,Qs.write(n)),this.onOffer(t)}))}createAndSetAnswer(){return Xt(this,void 0,void 0,(function*(){var A;const e=yield this.pc.createAnswer(),t=Qs.parse(null!==(A=e.sdp)&&void 0!==A?A:"");return t.media.forEach((A=>{Is(A),"audio"===A.type&&Ss(A,this.remoteStereoMids,this.remoteNackMids)})),yield this.setMungedSDP(e,Qs.write(t)),e}))}createDataChannel(A,e){return this.pc.createDataChannel(A,e)}addTransceiver(A,e){return this.pc.addTransceiver(A,e)}addTrack(A){if(!this._pc)throw new Pi("PC closed, cannot add track");return this._pc.addTrack(A)}setTrackCodecBitrate(A){this.trackBitrates.push(A)}setConfiguration(A){var e;if(!this._pc)throw new Pi("PC closed, cannot configure");return null===(e=this._pc)||void 0===e?void 0:e.setConfiguration(A)}canRemoveTrack(){var A;return!!(null===(A=this._pc)||void 0===A?void 0:A.removeTrack)}removeTrack(A){var e;return null===(e=this._pc)||void 0===e?void 0:e.removeTrack(A)}getConnectionState(){var A,e;return null!==(e=null===(A=this._pc)||void 0===A?void 0:A.connectionState)&&void 0!==e?e:"closed"}getICEConnectionState(){var A,e;return null!==(e=null===(A=this._pc)||void 0===A?void 0:A.iceConnectionState)&&void 0!==e?e:"closed"}getSignallingState(){var A,e;return null!==(e=null===(A=this._pc)||void 0===A?void 0:A.signalingState)&&void 0!==e?e:"closed"}getTransceivers(){var A,e;return null!==(e=null===(A=this._pc)||void 0===A?void 0:A.getTransceivers())&&void 0!==e?e:[]}getSenders(){var A,e;return null!==(e=null===(A=this._pc)||void 0===A?void 0:A.getSenders())&&void 0!==e?e:[]}getLocalDescription(){var A;return null===(A=this._pc)||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 Xt(this,void 0,void 0,(function*(){var A;if(!this._pc)return;let e="";const t=new Map,n=new Map;if((yield this._pc.getStats()).forEach((A=>{switch(A.type){case"transport":e=A.selectedCandidatePairId;break;case"candidate-pair":""===e&&A.selected&&(e=A.id),t.set(A.id,A);break;case"remote-candidate":n.set(A.id,"".concat(A.address,":").concat(A.port))}})),""===e)return;const i=null===(A=t.get(e))||void 0===A?void 0:A.remoteCandidateId;return void 0!==i?n.get(i):void 0}))}setMungedSDP(A,e,t){return Xt(this,void 0,void 0,(function*(){if(e){const i=A.sdp;A.sdp=e;try{return this.log.debug("setting munged ".concat(t?"remote":"local"," description"),this.logContext),void(t?yield this.pc.setRemoteDescription(A):yield this.pc.setLocalDescription(A))}catch(n){this.log.warn("not able to set ".concat(A.type,", falling back to unmodified sdp"),Object.assign(Object.assign({},this.logContext),{error:n,sdp:e})),A.sdp=i}}try{t?yield this.pc.setRemoteDescription(A):yield this.pc.setLocalDescription(A)}catch(n){let e="unknown error";n instanceof Error?e=n.message:"string"==typeof n&&(e=n);const i={error:e,sdp:A.sdp};throw!t&&this.pc.remoteDescription&&(i.remoteSdp=this.pc.remoteDescription),this.log.error("unable to set ".concat(A.type),Object.assign(Object.assign({},this.logContext),{fields:i})),new Hi(e)}}))}ensureVideoDDExtensionForSVC(A,e){var t,n;if(!(null===(t=A.ext)||void 0===t?void 0:t.some((A=>A.uri===sr)))){if(0===this.ddExtID){let A=0;e.media.forEach((e=>{var t;"video"===e.type&&(null===(t=e.ext)||void 0===t||t.forEach((e=>{e.value>A&&(A=e.value)})))})),this.ddExtID=A+1}null===(n=A.ext)||void 0===n||n.push({value:this.ddExtID,uri:sr})}}}function Ss(A,e,t){let n=0;A.rtp.some((A=>"opus"===A.codec&&(n=A.payload,!0))),n>0&&(A.rtcpFb||(A.rtcpFb=[]),t.includes(A.mid)&&!A.rtcpFb.some((A=>A.payload===n&&"nack"===A.type))&&A.rtcpFb.push({payload:n,type:"nack"}),e.includes(A.mid)&&A.fmtp.some((A=>A.payload===n&&(A.config.includes("stereo=1")||(A.config+=";stereo=1"),!0))))}function Is(A){if(A.connection){const e=A.connection.ip.indexOf(":")>=0;(4===A.connection.version&&e||6===A.connection.version&&!e)&&(A.connection.ip="0.0.0.0",A.connection.version=4)}}const Ps="vp8",Hs={audioPreset:er.music,dtx:!0,red:!0,forceStereo:!1,simulcast:!0,screenShareEncoding:rr.h1080fps15.encoding,stopMicTrackOnMute:!1,videoCodec:Ps,backupCodec:!0},Rs={deviceId:{ideal:"default"},autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0,voiceIsolation:!0},Ds={deviceId:{ideal:"default"},resolution:nr.h720.resolution},xs={adaptiveStream:!1,dynacast:!1,stopLocalTrackOnUnpublish:!0,reconnectPolicy:new class{constructor(A){this._retryDelays=void 0!==A?[...A]:Wt}nextRetryDelayInMs(A){if(A.retryCount>=this._retryDelays.length)return null;const e=this._retryDelays[A.retryCount];return A.retryCount<=1?e:e+1e3*Math.random()}},disconnectOnPageLeave:!0,webAudioMix:!1},Ls={autoSubscribe:!0,maxRetries:1,peerConnectionTimeout:15e3,websocketTimeout:15e3};var Os,Ms;(Ms=Os||(Os={}))[Ms.NEW=0]="NEW",Ms[Ms.CONNECTING=1]="CONNECTING",Ms[Ms.CONNECTED=2]="CONNECTED",Ms[Ms.FAILED=3]="FAILED",Ms[Ms.CLOSING=4]="CLOSING",Ms[Ms.CLOSED=5]="CLOSED";class Ns{get needsPublisher(){return this.isPublisherConnectionRequired}get needsSubscriber(){return this.isSubscriberConnectionRequired}get currentState(){return this.state}constructor(A,e,t){var n;this.peerConnectionTimeout=Ls.peerConnectionTimeout,this.log=Vt,this.updateState=()=>{var A;const e=this.state,t=this.requiredTransports.map((A=>A.getConnectionState()));t.every((A=>"connected"===A))?this.state=Os.CONNECTED:t.some((A=>"failed"===A))?this.state=Os.FAILED:t.some((A=>"connecting"===A))?this.state=Os.CONNECTING:t.every((A=>"closed"===A))?this.state=Os.CLOSED:t.some((A=>"closed"===A))?this.state=Os.CLOSING:t.every((A=>"new"===A))&&(this.state=Os.NEW),e!==this.state&&(this.log.debug("pc state change: from ".concat(Os[e]," to ").concat(Os[this.state]),this.logContext),null===(A=this.onStateChange)||void 0===A||A.call(this,this.state,this.publisher.getConnectionState(),this.subscriber.getConnectionState()))},this.log=Gt(null!==(n=t.loggerName)&&void 0!==n?n:Mt.PCManager),this.loggerOptions=t,this.isPublisherConnectionRequired=!e,this.isSubscriberConnectionRequired=e,this.publisher=new Ts(A,t),this.subscriber=new Ts(A,t),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 e;null===(e=this.onIceCandidate)||void 0===e||e.call(this,A,Oe.PUBLISHER)},this.subscriber.onIceCandidate=A=>{var e;null===(e=this.onIceCandidate)||void 0===e||e.call(this,A,Oe.SUBSCRIBER)},this.subscriber.onDataChannel=A=>{var e;null===(e=this.onDataChannel)||void 0===e||e.call(this,A)},this.subscriber.onTrack=A=>{var e;null===(e=this.onTrack)||void 0===e||e.call(this,A)},this.publisher.onOffer=A=>{var e;null===(e=this.onPublisherOffer)||void 0===e||e.call(this,A)},this.state=Os.NEW,this.connectionLock=new a,this.remoteOfferLock=new a}get logContext(){var A,e;return Object.assign({},null===(e=(A=this.loggerOptions).loggerContextCb)||void 0===e?void 0:e.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 Xt(this,void 0,void 0,(function*(){if(this.publisher&&"closed"!==this.publisher.getSignallingState()){const e=this.publisher;for(const t of e.getSenders())try{e.canRemoveTrack()&&e.removeTrack(t)}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 Xt(this,void 0,void 0,(function*(){this.subscriber.restartingIce=!0,this.needsPublisher&&(yield this.createAndSendPublisherOffer({iceRestart:!0}))}))}addIceCandidate(A,e){return Xt(this,void 0,void 0,(function*(){e===Oe.PUBLISHER?yield this.publisher.addIceCandidate(A):yield this.subscriber.addIceCandidate(A)}))}createSubscriberAnswerFromOffer(A){return Xt(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 e=yield this.remoteOfferLock.lock();try{return yield this.subscriber.setRemoteDescription(A),yield this.subscriber.createAndSetAnswer()}finally{e()}}))}updateConfiguration(A,e){this.publisher.setConfiguration(A),this.subscriber.setConfiguration(A),e&&this.triggerIceRestart()}ensurePCTransportConnection(A,e){return Xt(this,void 0,void 0,(function*(){var t;const n=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===(t=this.requiredTransports)||void 0===t?void 0:t.map((t=>this.ensureTransportConnected(t,A,e))))}finally{n()}}))}negotiate(A){return Xt(this,void 0,void 0,(function*(){return new Promise(((e,t)=>Xt(this,void 0,void 0,(function*(){const n=setTimeout((()=>{t("negotiation timed out")}),this.peerConnectionTimeout);A.signal.addEventListener("abort",(()=>{clearTimeout(n),t("negotiation aborted")})),this.publisher.once(ks,(()=>{A.signal.aborted||this.publisher.once(Es,(()=>{clearTimeout(n),e()}))})),yield this.publisher.negotiate((A=>{clearTimeout(n),t(A)}))}))))}))}addPublisherTransceiver(A,e){return this.publisher.addTransceiver(A,e)}addPublisherTrack(A){return this.publisher.addTrack(A)}createPublisherDataChannel(A,e){return this.publisher.createDataChannel(A,e)}getConnectedAddress(A){return A===Oe.PUBLISHER||A===Oe.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,e){return Xt(this,arguments,void 0,(function(A,e){var t=this;let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.peerConnectionTimeout;return function*(){if("connected"!==A.getConnectionState())return new Promise(((A,i)=>Xt(t,void 0,void 0,(function*(){const t=()=>{this.log.warn("abort transport connection",this.logContext),_i.clearTimeout(r),i(new Fi("room connection has been cancelled",ui.Cancelled))};(null==e?void 0:e.signal.aborted)&&t(),null==e||e.signal.addEventListener("abort",t);const r=_i.setTimeout((()=>{null==e||e.signal.removeEventListener("abort",t),i(new Fi("could not establish pc connection",ui.InternalError))}),n);for(;this.state!==Os.CONNECTED;)if(yield or(50),null==e?void 0:e.signal.aborted)return void i(new Fi("room connection has been cancelled",ui.Cancelled));_i.clearTimeout(r),null==e||e.signal.removeEventListener("abort",t),A()}))))}()}))}}class Ks extends Error{constructor(A,e,t){super(e),this.code=A,this.message=Vs(e,Ks.MAX_MESSAGE_BYTES),this.data=t?Vs(t,Ks.MAX_DATA_BYTES):void 0}static fromProto(A){return new Ks(A.code,A.message,A.data)}toProto(){return new ye({code:this.code,message:this.message,data:this.data})}static builtIn(A,e){return new Ks(Ks.ErrorCode[A],Ks.ErrorMessage[A],e)}}function _s(A){return(new TextEncoder).encode(A).length}function Vs(A,e){if(_s(A)<=e)return A;let t=0,n=A.length;const i=new TextEncoder;for(;t<n;){const r=Math.floor((t+n+1)/2);i.encode(A.slice(0,r)).length<=e?t=r:n=r-1}return A.slice(0,t)}Ks.MAX_MESSAGE_BYTES=256,Ks.MAX_DATA_BYTES=15360,Ks.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},Ks.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 Gs=2e3;function js(A,e){if(!e)return 0;let t,n;return"bytesReceived"in A?(t=A.bytesReceived,n=e.bytesReceived):"bytesSent"in A&&(t=A.bytesSent,n=e.bytesSent),void 0===t||void 0===n||void 0===A.timestamp||void 0===e.timestamp?0:8*(t-n)*1e3/(A.timestamp-e.timestamp)}class Js extends Ji{get sender(){return this._sender}set sender(A){this._sender=A}get constraints(){return this._constraints}constructor(A,e,t){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];super(A,e,arguments.length>4?arguments[4]:void 0),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=Us((()=>Xt(this,void 0,void 0,(function*(){yield this.pauseUpstream()}))),5e3),this.handleTrackUnmuteEvent=()=>Xt(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(Qi.Ended,this)},this.reacquireTrack=!1,this.providedByUser=n,this.muteLock=new a,this.pauseUpstreamLock=new a,this.processorLock=new a,this.restartLock=new a,this.setMediaStreamTrack(A,!0),this._constraints=A.getConstraints(),t&&(this._constraints=t)}get id(){return this._mediaStreamTrack.id}get dimensions(){if(this.kind!==Ji.Kind.Video)return;const{width:A,height:e}=this._mediaStreamTrack.getSettings();return A&&e?{width:A,height:e}:void 0}get isUpstreamPaused(){return this._isUpstreamPaused}get isUserProvided(){return this.providedByUser}get mediaStreamTrack(){var A,e;return null!==(e=null===(A=this.processor)||void 0===A?void 0:A.processedTrack)&&void 0!==e?e:this._mediaStreamTrack}get isLocal(){return!0}getSourceTrackSettings(){return this._mediaStreamTrack.getSettings()}setMediaStreamTrack(A,e){return Xt(this,void 0,void 0,(function*(){var t;if(A===this._mediaStreamTrack&&!e)return;let n;if(this._mediaStreamTrack&&(this.attachedElements.forEach((A=>{Xi(this._mediaStreamTrack,A)})),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([A]),A&&(A.addEventListener("ended",this.handleEnded),A.addEventListener("mute",this.handleTrackMuteEvent),A.addEventListener("unmute",this.handleTrackUnmuteEvent),this._constraints=A.getConstraints()),this.processor&&A){const e=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&&(Wi(A,this.processorElement),this.processorElement.muted=!0),yield this.processor.restart({track:A,kind:this.kind,element:this.processorElement}),n=this.processor.processedTrack}finally{e()}}this.sender&&"closed"!==(null===(t=this.sender.transport)||void 0===t?void 0:t.state)&&(yield this.sender.replaceTrack(null!=n?n:A)),this.providedByUser||this._mediaStreamTrack===A||this._mediaStreamTrack.stop(),this._mediaStreamTrack=A,A&&(this._mediaStreamTrack.enabled=!this.isMuted,yield this.resumeUpstream(),this.attachedElements.forEach((e=>{Wi(null!=n?n:A,e)})))}))}waitForDimensions(){return Xt(this,arguments,void 0,(function(){var A=this;let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3;return function*(){var t;if(A.kind===Ji.Kind.Audio)throw new Error("cannot get dimensions for audio tracks");"iOS"===(null===(t=Oi())||void 0===t?void 0:t.os)&&(yield or(10));const n=Date.now();for(;Date.now()-n<e;){const e=A.dimensions;if(e)return e;yield or(50)}throw new Si("unable to get track dimensions after timeout")}()}))}setDeviceId(A){return Xt(this,void 0,void 0,(function*(){return this._constraints.deviceId===A&&this._mediaStreamTrack.getSettings().deviceId===Pr(A)||(this._constraints.deviceId=A,!!this.isMuted||(yield this.restartTrack(),Pr(A)===this._mediaStreamTrack.getSettings().deviceId))}))}getDeviceId(){return Xt(this,arguments,void 0,(function(){var A=this;let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function*(){if(A.source===Ji.Source.ScreenShare)return;const{deviceId:t,groupId:n}=A._mediaStreamTrack.getSettings(),i=A.kind===Ji.Kind.Audio?"audioinput":"videoinput";return e?ns.getInstance().normalizeDeviceId(i,t,n):t}()}))}mute(){return Xt(this,void 0,void 0,(function*(){return this.setTrackMuted(!0),this}))}unmute(){return Xt(this,void 0,void 0,(function*(){return this.setTrackMuted(!1),this}))}replaceTrack(A,e){return Xt(this,void 0,void 0,(function*(){if(!this.sender)throw new Si("unable to replace an unpublished track");let t,n;return"boolean"==typeof e?t=e:void 0!==e&&(t=e.userProvidedTrack,n=e.stopProcessor),this.providedByUser=null==t||t,this.log.debug("replace MediaStreamTrack",this.logContext),yield this.setMediaStreamTrack(A),n&&this.processor&&(yield this.stopProcessor()),this}))}restart(A){return Xt(this,void 0,void 0,(function*(){this.manuallyStopped=!1;const e=yield this.restartLock.lock();try{A||(A=this._constraints);const{deviceId:e,facingMode:t}=A,n=function(A,e){var t={};for(var n in A)Object.prototype.hasOwnProperty.call(A,n)&&e.indexOf(n)<0&&(t[n]=A[n]);if(null!=A&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(A);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(A,n[i])&&(t[n[i]]=A[n[i]])}return t}(A,["deviceId","facingMode"]);this.log.debug("restarting track with constraints",Object.assign(Object.assign({},this.logContext),{constraints:A}));const i={audio:!1,video:!1};this.kind===Ji.Kind.Video?i.video=!e&&!t||{deviceId:e,facingMode:t}:i.audio=!e||{deviceId:e},this.attachedElements.forEach((A=>{Xi(this.mediaStreamTrack,A)})),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.stop();const r=(yield navigator.mediaDevices.getUserMedia(i)).getTracks()[0];return yield r.applyConstraints(n),r.addEventListener("ended",this.handleEnded),this.log.debug("re-acquired MediaStreamTrack",this.logContext),yield this.setMediaStreamTrack(r),this._constraints=A,this.emit(Qi.Restarted,this),this.manuallyStopped&&(this.log.warn("track was stopped during a restart, stopping restarted track",this.logContext),this.stop()),this}finally{e()}}))}setTrackMuted(A){this.log.debug("setting ".concat(this.kind," track ").concat(A?"muted":"unmuted"),this.logContext),this.isMuted===A&&this._mediaStreamTrack.enabled!==A||(this.isMuted=A,this._mediaStreamTrack.enabled=!A,this.emit(A?Qi.Muted:Qi.Unmuted,this))}get needsReAcquisition(){return"live"!==this._mediaStreamTrack.readyState||this._mediaStreamTrack.muted||!this._mediaStreamTrack.enabled||this.reacquireTrack}handleAppVisibilityChanged(){const A=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return Xt(this,void 0,void 0,(function*(){yield A.handleAppVisibilityChanged.call(this),gr()&&(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._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent),null===(A=this.processor)||void 0===A||A.destroy(),this.processor=void 0}pauseUpstream(){return Xt(this,void 0,void 0,(function*(){var A;const e=yield this.pauseUpstreamLock.lock();try{if(!0===this._isUpstreamPaused)return;if(!this.sender)return void this.log.warn("unable to pause upstream for an unpublished track",this.logContext);this._isUpstreamPaused=!0,this.emit(Qi.UpstreamPaused,this);const e=Oi();if("Safari"===(null==e?void 0:e.name)&&Cr(e.version,"12.0")<0)throw new Ti("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{e()}}))}resumeUpstream(){return Xt(this,void 0,void 0,(function*(){var A;const e=yield this.pauseUpstreamLock.lock();try{if(!1===this._isUpstreamPaused)return;if(!this.sender)return void this.log.warn("unable to resume upstream for an unpublished track",this.logContext);this._isUpstreamPaused=!1,this.emit(Qi.UpstreamResumed,this),"closed"!==(null===(A=this.sender.transport)||void 0===A?void 0:A.state)&&(yield this.sender.replaceTrack(this.mediaStreamTrack))}finally{e()}}))}getRTCStatsReport(){return Xt(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 Xt(this,arguments,void 0,(function(A){var e=this;let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return function*(){var n;const i=yield e.processorLock.lock();try{e.log.debug("setting up processor",e.logContext);const i=document.createElement(e.kind),r={kind:e.kind,track:e._mediaStreamTrack,element:i,audioContext:e.audioContext};if(yield A.init(r),e.log.debug("processor initialized",e.logContext),e.processor&&(yield e.stopProcessor()),"unknown"===e.kind)throw TypeError("cannot set processor on track of unknown kind");if(Wi(e._mediaStreamTrack,i),i.muted=!0,i.play().catch((A=>e.log.error("failed to play processor element",Object.assign(Object.assign({},e.logContext),{error:A})))),e.processor=A,e.processorElement=i,e.processor.processedTrack){for(const A of e.attachedElements)A!==e.processorElement&&t&&(Xi(e._mediaStreamTrack,A),Wi(e.processor.processedTrack,A));yield null===(n=e.sender)||void 0===n?void 0:n.replaceTrack(e.processor.processedTrack)}e.emit(Qi.TrackProcessorUpdate,e.processor)}finally{i()}}()}))}getProcessor(){return this.processor}stopProcessor(){return Xt(this,arguments,void 0,(function(){var A=this;let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function*(){var t,n;A.processor&&(A.log.debug("stopping processor",A.logContext),null===(t=A.processor.processedTrack)||void 0===t||t.stop(),yield A.processor.destroy(),A.processor=void 0,e||(null===(n=A.processorElement)||void 0===n||n.remove(),A.processorElement=void 0),yield A._mediaStreamTrack.applyConstraints(A._constraints),yield A.setMediaStreamTrack(A._mediaStreamTrack,!0),A.emit(Qi.TrackProcessorUpdate))}()}))}}class Ws extends Js{get enhancedNoiseCancellation(){return this.isKrispNoiseFilterEnabled}constructor(A,e){let t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;super(A,Ji.Kind.Audio,e,t,i),this.stopOnMute=!1,this.isKrispNoiseFilterEnabled=!1,this.monitorSender=()=>Xt(this,void 0,void 0,(function*(){if(!this.sender)return void(this._currentBitrate=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}))}A&&this.prevStats&&(this._currentBitrate=js(A,this.prevStats)),this.prevStats=A})),this.handleKrispNoiseFilterEnable=()=>{this.isKrispNoiseFilterEnabled=!0,this.log.debug("Krisp noise filter enabled",this.logContext),this.emit(Qi.AudioTrackFeatureUpdate,this,ZA.TF_ENHANCED_NOISE_CANCELLATION,!0)},this.handleKrispNoiseFilterDisable=()=>{this.isKrispNoiseFilterEnabled=!1,this.log.debug("Krisp noise filter disabled",this.logContext),this.emit(Qi.AudioTrackFeatureUpdate,this,ZA.TF_ENHANCED_NOISE_CANCELLATION,!1)},this.audioContext=n,this.checkForSilence()}mute(){const A=Object.create(null,{mute:{get:()=>super.mute}});return Xt(this,void 0,void 0,(function*(){const e=yield this.muteLock.lock();try{return this.isMuted?(this.log.debug("Track already muted",this.logContext),this):(this.source===Ji.Source.Microphone&&this.stopOnMute&&!this.isUserProvided&&(this.log.debug("stopping mic track",this.logContext),this._mediaStreamTrack.stop()),yield A.mute.call(this),this)}finally{e()}}))}unmute(){const A=Object.create(null,{unmute:{get:()=>super.unmute}});return Xt(this,void 0,void 0,(function*(){const e=yield this.muteLock.lock();try{if(!this.isMuted)return this.log.debug("Track already unmuted",this.logContext),this;const e=this._constraints.deviceId&&this._mediaStreamTrack.getSettings().deviceId!==Pr(this._constraints.deviceId);return this.source!==Ji.Source.Microphone||!this.stopOnMute&&"ended"!==this._mediaStreamTrack.readyState&&!e||this.isUserProvided||(this.log.debug("reacquiring mic track",this.logContext),yield this.restartTrack()),yield A.unmute.call(this),this}finally{e()}}))}restartTrack(A){return Xt(this,void 0,void 0,(function*(){let e;if(A){const t=Wr({audio:A});"boolean"!=typeof t.audio&&(e=t.audio)}yield this.restart(e)}))}restart(A){const e=Object.create(null,{restart:{get:()=>super.restart}});return Xt(this,void 0,void 0,(function*(){const t=yield e.restart.call(this,A);return this.checkForSilence(),t}))}startMonitor(){pr()&&(this.monitorInterval||(this.monitorInterval=setInterval((()=>{this.monitorSender()}),Gs)))}setProcessor(A){return Xt(this,void 0,void 0,(function*(){var e;const t=yield this.processorLock.lock();try{if(!mr()&&!this.audioContext)throw Error("Audio context needs to be set on LocalAudioTrack in order to enable processors");this.processor&&(yield this.stopProcessor());const t={kind:this.kind,track:this._mediaStreamTrack,audioContext:this.audioContext};this.log.debug("setting up audio processor ".concat(A.name),this.logContext),yield A.init(t),this.processor=A,this.processor.processedTrack&&(yield null===(e=this.sender)||void 0===e?void 0:e.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(Qi.TrackProcessorUpdate,this.processor)}finally{t()}}))}setAudioContext(A){this.audioContext=A}getSenderStats(){return Xt(this,void 0,void 0,(function*(){var A;if(!(null===(A=this.sender)||void 0===A?void 0:A.getStats))return;let e;return(yield this.sender.getStats()).forEach((A=>{"outbound-rtp"===A.type&&(e={type:"audio",streamId:A.id,packetsSent:A.packetsSent,packetsLost:A.packetsLost,bytesSent:A.bytesSent,timestamp:A.timestamp,roundTripTime:A.roundTripTime,jitter:A.jitter})})),e}))}checkForSilence(){return Xt(this,void 0,void 0,(function*(){const A=yield function(A){return Xt(this,arguments,void 0,(function(A){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200;return function*(){const t=Xr();if(t){const n=t.createAnalyser();n.fftSize=2048;const i=n.frequencyBinCount,r=new Uint8Array(i);t.createMediaStreamSource(new MediaStream([A.mediaStreamTrack])).connect(n),yield or(e),n.getByteTimeDomainData(r);const s=r.some((A=>128!==A&&0!==A));return t.close(),!s}return!1}()}))}(this);return A&&(this.isMuted||this.log.warn("silence detected on local audio track",this.logContext),this.emit(Qi.AudioSilenceDetected)),A}))}}const Xs=Object.values(nr),Ys=Object.values(ir),qs=Object.values(rr),$s=[nr.h180,nr.h360],Zs=[ir.h180,ir.h360],zs=["q","h","f"];function Ao(A,e,t,n){var i,r;let s=null==n?void 0:n.videoEncoding;A&&(s=null==n?void 0:n.screenShareEncoding);const o=null==n?void 0:n.simulcast,a=null==n?void 0:n.scalabilityMode,c=null==n?void 0:n.videoCodec;if(!s&&!o&&!a||!e||!t)return[{}];s||(s=function(A,e,t,n){const i=function(A,e,t){if(A)return qs;const n=e>t?e/t:t/e;return Math.abs(n-16/9)<Math.abs(n-4/3)?Xs:Ys}(A,e,t);let{encoding:r}=i[0];const s=Math.max(e,t);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=.7*r.maxBitrate;break;case"vp9":r=Object.assign({},r),r.maxBitrate=.85*r.maxBitrate}return r}(A,e,t,c),Vt.debug("using video encoding",s));const d=s.maxFramerate,l=new Yi(e,t,s.maxBitrate,s.maxFramerate,s.priority);if(a&&dr(c)){const A=new io(a),e=[];if(A.spatial>3)throw new Error("unsupported scalabilityMode: ".concat(a));const t=Oi();if(hr()||mr()||"Chrome"===(null==t?void 0:t.name)&&Cr(null==t?void 0:t.version,"113")<0){const t="h"==A.suffix?2:3;for(let n=0;n<A.spatial;n+=1)e.push({rid:zs[2-n],maxBitrate:s.maxBitrate/Math.pow(t,n),maxFramerate:l.encoding.maxFramerate});e[0].scalabilityMode=a}else e.push({maxBitrate:s.maxBitrate,maxFramerate:l.encoding.maxFramerate,scalabilityMode:a});return l.encoding.priority&&(e[0].priority=l.encoding.priority,e[0].networkPriority=l.encoding.priority),Vt.debug("using svc encoding",{encodings:e}),e}if(!o)return[s];let u,h=[];if(h=A?null!==(i=no(null==n?void 0:n.screenShareSimulcastLayers))&&void 0!==i?i:eo(A,l):null!==(r=no(null==n?void 0:n.videoSimulcastLayers))&&void 0!==r?r:eo(A,l),h.length>0){const A=h[0];h.length>1&&([,u]=h);const n=Math.max(e,t);if(n>=960&&u)return to(e,t,[A,u,l],d);if(n>=480)return to(e,t,[A,l],d)}return to(e,t,[l])}function eo(A,e){if(A)return[{scaleResolutionDownBy:2,fps:(t=e).encoding.maxFramerate}].map((A=>{var e,n;return new Yi(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)*((null!==(e=t.encoding.maxFramerate)&&void 0!==e?e:30)/(null!==(n=A.fps)&&void 0!==n?n:30))))),A.fps,t.encoding.priority)}));var t;const{width:n,height:i}=e,r=n>i?n/i:i/n;return Math.abs(r-16/9)<Math.abs(r-4/3)?$s:Zs}function to(A,e,t,n){const i=[];if(t.forEach(((t,r)=>{if(r>=zs.length)return;const s=Math.min(A,e),o={rid:zs[r],scaleResolutionDownBy:Math.max(1,s/Math.min(t.width,t.height)),maxBitrate:t.encoding.maxBitrate},a=n&&t.encoding.maxFramerate?Math.min(n,t.encoding.maxFramerate):t.encoding.maxFramerate;a&&(o.maxFramerate=a);const c=ur()||0===r;t.encoding.priority&&c&&(o.priority=t.encoding.priority,o.networkPriority=t.encoding.priority),i.push(o)})),mr()&&"ios"===wr()){let A;i.forEach((e=>{A?e.maxFramerate&&e.maxFramerate>A&&(A=e.maxFramerate):A=e.maxFramerate}));let e=!0;i.forEach((t=>{var n;t.maxFramerate!=A&&(e&&(e=!1,Vt.info("Simulcast on iOS React-Native requires all encodings to share the same framerate.")),Vt.info('Setting framerate of encoding "'.concat(null!==(n=t.rid)&&void 0!==n?n:"",'" to ').concat(A)),t.maxFramerate=A)}))}return i}function no(A){if(A)return A.sort(((A,e)=>{const{encoding:t}=A,{encoding:n}=e;return t.maxBitrate>n.maxBitrate?1:t.maxBitrate<n.maxBitrate?-1:t.maxBitrate===n.maxBitrate&&t.maxFramerate&&n.maxFramerate?t.maxFramerate>n.maxFramerate?1:-1:0}))}class io{constructor(A){const e=A.match(/^L(\d)T(\d)(h|_KEY|_KEY_SHIFT){0,1}$/);if(!e)throw new Error("invalid scalability mode");if(this.spatial=parseInt(e[1]),this.temporal=parseInt(e[2]),e.length>3)switch(e[3]){case"h":case"_KEY":case"_KEY_SHIFT":this.suffix=e[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 Js{get sender(){return this._sender}set sender(A){this._sender=A,this.degradationPreference&&this.setDegradationPreference(this.degradationPreference)}constructor(A,e){let t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3?arguments[3]:void 0;super(A,Ji.Kind.Video,e,t,n),this.simulcastCodecs=new Map,this.degradationPreference="balanced",this.monitorSender=()=>Xt(this,void 0,void 0,(function*(){if(!this.sender)return void(this._currentBitrate=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}))}const e=new Map(A.map((A=>[A.rid,A])));if(this.prevStats){let A=0;e.forEach(((e,t)=>{var n;const i=null===(n=this.prevStats)||void 0===n?void 0:n.get(t);A+=js(e,i)})),this._currentBitrate=A}this.prevStats=e})),this.senderLock=new a}get isSimulcast(){return!!(this.sender&&this.sender.getParameters().encodings.length>1)}startMonitor(A){var e;if(this.signalClient=A,!pr())return;const t=null===(e=this.sender)||void 0===e?void 0:e.getParameters();t&&(this.encodings=t.encodings),this.monitorInterval||(this.monitorInterval=setInterval((()=>{this.monitorSender()}),Gs))}stop(){this._mediaStreamTrack.getConstraints(),this.simulcastCodecs.forEach((A=>{A.mediaStreamTrack.stop()})),super.stop()}pauseUpstream(){const A=Object.create(null,{pauseUpstream:{get:()=>super.pauseUpstream}});return Xt(this,void 0,void 0,(function*(){var e,t,n,i,r;yield A.pauseUpstream.call(this);try{for(var s,o=!0,a=Yt(this.simulcastCodecs.values());!(e=(s=yield a.next()).done);o=!0){i=s.value,o=!1;const A=i;yield null===(r=A.sender)||void 0===r?void 0:r.replaceTrack(null)}}catch(c){t={error:c}}finally{try{o||e||!(n=a.return)||(yield n.call(a))}finally{if(t)throw t.error}}}))}resumeUpstream(){const A=Object.create(null,{resumeUpstream:{get:()=>super.resumeUpstream}});return Xt(this,void 0,void 0,(function*(){var e,t,n,i,r;yield A.resumeUpstream.call(this);try{for(var s,o=!0,a=Yt(this.simulcastCodecs.values());!(e=(s=yield a.next()).done);o=!0){i=s.value,o=!1;const A=i;yield null===(r=A.sender)||void 0===r?void 0:r.replaceTrack(A.mediaStreamTrack)}}catch(c){t={error:c}}finally{try{o||e||!(n=a.return)||(yield n.call(a))}finally{if(t)throw t.error}}}))}mute(){const A=Object.create(null,{mute:{get:()=>super.mute}});return Xt(this,void 0,void 0,(function*(){const e=yield this.muteLock.lock();try{return this.isMuted?(this.log.debug("Track already muted",this.logContext),this):(this.source!==Ji.Source.Camera||this.isUserProvided||(this.log.debug("stopping camera track",this.logContext),this._mediaStreamTrack.stop()),yield A.mute.call(this),this)}finally{e()}}))}unmute(){const A=Object.create(null,{unmute:{get:()=>super.unmute}});return Xt(this,void 0,void 0,(function*(){const e=yield this.muteLock.lock();try{return this.isMuted?(this.source!==Ji.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{e()}}))}setTrackMuted(A){super.setTrackMuted(A);for(const e of this.simulcastCodecs.values())e.mediaStreamTrack.enabled=!A}getSenderStats(){return Xt(this,void 0,void 0,(function*(){var A;if(!(null===(A=this.sender)||void 0===A?void 0:A.getStats))return[];const e=[],t=yield this.sender.getStats();return t.forEach((A=>{var n;if("outbound-rtp"===A.type){const i={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!==(n=A.rid)&&void 0!==n?n:A.id,retransmittedPacketsSent:A.retransmittedPacketsSent,targetBitrate:A.targetBitrate,timestamp:A.timestamp},r=t.get(A.remoteId);r&&(i.jitter=r.jitter,i.packetsLost=r.packetsLost,i.roundTripTime=r.roundTripTime),e.push(i)}})),e.sort(((A,e)=>{var t,n;return(null!==(t=e.frameWidth)&&void 0!==t?t:0)-(null!==(n=A.frameWidth)&&void 0!==n?n:0)})),e}))}setPublishingQuality(A){const e=[];for(let t=Gi.LOW;t<=Gi.HIGH;t+=1)e.push(new gt({quality:t,enabled:t<=A}));this.log.debug("setting publishing quality. max quality ".concat(A),this.logContext),this.setPublishingLayers(e)}restartTrack(A){return Xt(this,void 0,void 0,(function*(){var e,t,n,i,r;let s;if(A){const e=Wr({video:A});"boolean"!=typeof e.video&&(s=e.video)}yield this.restart(s);try{for(var o,a=!0,c=Yt(this.simulcastCodecs.values());!(e=(o=yield c.next()).done);a=!0){i=o.value,a=!1;const A=i;A.sender&&"closed"!==(null===(r=A.sender.transport)||void 0===r?void 0:r.state)&&(A.mediaStreamTrack=this.mediaStreamTrack.clone(),yield A.sender.replaceTrack(A.mediaStreamTrack))}}catch(d){t={error:d}}finally{try{a||e||!(n=c.return)||(yield n.call(c))}finally{if(t)throw t.error}}}))}setProcessor(A){const e=Object.create(null,{setProcessor:{get:()=>super.setProcessor}});return Xt(this,arguments,void 0,(function(A){var t=this;let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return function*(){var i,r,s,o,a,c;if(yield e.setProcessor.call(t,A,n),null===(a=t.processor)||void 0===a?void 0:a.processedTrack)try{for(var d,l=!0,u=Yt(t.simulcastCodecs.values());!(i=(d=yield u.next()).done);l=!0){o=d.value,l=!1;const A=o;yield null===(c=A.sender)||void 0===c?void 0:c.replaceTrack(t.processor.processedTrack)}}catch(h){r={error:h}}finally{try{l||i||!(s=u.return)||(yield s.call(u))}finally{if(r)throw r.error}}}()}))}setDegradationPreference(A){return Xt(this,void 0,void 0,(function*(){if(this.degradationPreference=A,this.sender)try{this.log.debug("setting degradationPreference to ".concat(A),this.logContext);const e=this.sender.getParameters();e.degradationPreference=A,this.sender.setParameters(e)}catch(e){this.log.warn("failed to set degradationPreference",Object.assign({error:e},this.logContext))}}))}addSimulcastTrack(A,e){if(this.simulcastCodecs.has(A))return void this.log.error("".concat(A," already added, skipping adding simulcast codec"),this.logContext);const t={codec:A,mediaStreamTrack:this.mediaStreamTrack.clone(),sender:void 0,encodings:e};return this.simulcastCodecs.set(A,t),t}setSimulcastTrackSender(A,e){const t=this.simulcastCodecs.get(A);t&&(t.sender=e,setTimeout((()=>{this.subscribedCodecs&&this.setPublishingCodecs(this.subscribedCodecs)}),5e3))}setPublishingCodecs(A){return Xt(this,void 0,void 0,(function*(){var e,t,n,i,r,s,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(e=!0,t=Yt(A);!(i=(n=yield t.next()).done);e=!0){o=n.value,e=!1;const A=o;if(this.codec&&this.codec!==A.codec){const e=this.simulcastCodecs.get(A.codec);if(this.log.debug("try setPublishingCodec for ".concat(A.codec),Object.assign(Object.assign({},this.logContext),{simulcastCodecInfo:e})),e&&e.sender)e.encodings&&(this.log.debug("try setPublishingLayersForSender ".concat(A.codec),this.logContext),yield so(e.sender,e.encodings,A.qualities,this.senderLock,this.log,this.logContext));else for(const t of A.qualities)if(t.enabled){a.push(A.codec);break}}else yield this.setPublishingLayers(A.qualities)}}catch(c){r={error:c}}finally{try{e||i||!(s=t.return)||(yield s.call(t))}finally{if(r)throw r.error}}return a}))}setPublishingLayers(A){return Xt(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 so(this.sender,this.encodings,A,this.senderLock,this.log,this.logContext))}))}handleAppVisibilityChanged(){const A=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return Xt(this,void 0,void 0,(function*(){yield A.handleAppVisibilityChanged.call(this),gr()&&this.isInBackground&&this.source===Ji.Source.Camera&&(this._mediaStreamTrack.enabled=!1)}))}}function so(A,e,t,n,i,r){return Xt(this,void 0,void 0,(function*(){const s=yield n.lock();i.debug("setPublishingLayersForSender",Object.assign(Object.assign({},r),{sender:A,qualities:t,senderEncodings:e}));try{const n=A.getParameters(),{encodings:s}=n;if(!s)return;if(s.length!==e.length)return void i.warn("cannot set publishing layers, encodings mismatch",Object.assign(Object.assign({},r),{encodings:s,senderEncodings:e}));let o=!1;const a=Oi();if("Chrome"===(null==a?void 0:a.name)&&Cr(null==a?void 0:a.version,"133")>0&&s[0].scalabilityMode){const A=s[0],n=new io(A.scalabilityMode);let i=JA.OFF;if(t.forEach((A=>{A.enabled&&(i===JA.OFF||A.quality>i)&&(i=A.quality)})),i===JA.OFF)A.active&&(A.active=!1,o=!0);else if(!A.active||n.spatial!==i+1){o=!0,A.active=!0;const t=new io(e[0].scalabilityMode);n.spatial=i+1,n.suffix=t.suffix,1===n.spatial&&(n.suffix=void 0),A.scalabilityMode=n.toString(),A.scaleResolutionDownBy=Math.pow(2,2-i),e[0].maxBitrate&&(A.maxBitrate=e[0].maxBitrate/(A.scaleResolutionDownBy*A.scaleResolutionDownBy))}}else s.forEach(((A,n)=>{var s;let a=null!==(s=A.rid)&&void 0!==s?s:"";""===a&&(a="q");const c=oo(a),d=t.find((A=>A.quality===c));d&&A.active!==d.enabled&&(o=!0,A.active=d.enabled,i.debug("setting layer ".concat(d.quality," to ").concat(A.active?"enabled":"disabled"),r),ur()&&(d.enabled?(A.scaleResolutionDownBy=e[n].scaleResolutionDownBy,A.maxBitrate=e[n].maxBitrate,A.maxFrameRate=e[n].maxFrameRate):(A.scaleResolutionDownBy=4,A.maxBitrate=10,A.maxFrameRate=2)))}));o&&(n.encodings=s,i.debug("setting encodings",Object.assign(Object.assign({},r),{encodings:n.encodings})),yield A.setParameters(n))}finally{s()}}))}function oo(A){switch(A){case"f":default:return Gi.HIGH;case"h":return Gi.MEDIUM;case"q":return Gi.LOW}}function ao(A,e,t,n){if(!t)return[new ce({quality:Gi.HIGH,width:A,height:e,bitrate:0,ssrc:0})];if(n){const n=t[0].scalabilityMode,i=new io(n),r=[],s="h"==i.suffix?1.5:2,o="h"==i.suffix?2:3;for(let a=0;a<i.spatial;a+=1)r.push(new ce({quality:Math.min(Gi.HIGH,i.spatial-1)-a,width:Math.ceil(A/Math.pow(s,a)),height:Math.ceil(e/Math.pow(s,a)),bitrate:t[0].maxBitrate?Math.ceil(t[0].maxBitrate/Math.pow(o,a)):0,ssrc:0}));return r}return t.map((t=>{var n,i,r;const s=null!==(n=t.scaleResolutionDownBy)&&void 0!==n?n:1;let o=oo(null!==(i=t.rid)&&void 0!==i?i:"");return new ce({quality:o,width:Math.ceil(A/s),height:Math.ceil(e/s),bitrate:null!==(r=t.maxBitrate)&&void 0!==r?r:0,ssrc:0})}))}const co="_lossy",lo="_reliable",uo="leave-reconnect";var ho,go,po,mo,fo,Bo,wo,vo,Co,yo,bo;(go=ho||(ho={}))[go.New=0]="New",go[go.Connected=1]="Connected",go[go.Disconnected=2]="Disconnected",go[go.Reconnecting=3]="Reconnecting",go[go.Closed=4]="Closed";class Qo extends Zt.EventEmitter{get isClosed(){return this._isClosed}get pendingReconnect(){return!!this.reconnectTimeout}constructor(A){var e;super(),this.options=A,this.rtcConfig={},this.peerConnectionTimeout=Ls.peerConnectionTimeout,this.fullReconnectOnNext=!1,this.subscriberPrimary=!1,this.pcState=ho.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=Vt,this.handleDataChannel=A=>Xt(this,[A],void 0,(function(A){var e=this;let{channel:t}=A;return function*(){if(t){if(t.label===lo)e.reliableDCSub=t;else{if(t.label!==co)return;e.lossyDCSub=t}e.log.debug("on data channel ".concat(t.id,", ").concat(t.label),e.logContext),t.onmessage=e.handleDataMessage}}()})),this.handleDataMessage=A=>Xt(this,void 0,void 0,(function*(){var e,t;const n=yield this.dataProcessLock.lock();try{let n;if(A.data instanceof ArrayBuffer)n=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}));n=yield A.data.arrayBuffer()}const i=de.fromBinary(new Uint8Array(n));"speaker"===(null===(e=i.value)||void 0===e?void 0:e.case)?this.emit(yi.ActiveSpeakersUpdate,i.value.value.speakers):("user"===(null===(t=i.value)||void 0===t?void 0:t.case)&&function(A,e){const t=A.participantIdentity?A.participantIdentity:e.participantIdentity;A.participantIdentity=t,e.participantIdentity=t;const n=0!==A.destinationIdentities.length?A.destinationIdentities:e.destinationIdentities;A.destinationIdentities=n,e.destinationIdentities=n}(i,i.value.value),this.emit(yi.DataPacketReceived,i))}finally{n()}})),this.handleDataError=A=>{const e=0===A.currentTarget.maxRetransmits?"lossy":"reliable";if(A instanceof ErrorEvent&&A.error){const{error:t}=A.error;this.log.error("DataChannel error on ".concat(e,": ").concat(A.message),Object.assign(Object.assign({},this.logContext),{error:t}))}else this.log.error("Unknown DataChannel error on ".concat(e),Object.assign(Object.assign({},this.logContext),{event:A}))},this.handleBufferedAmountLow=A=>{const e=0===A.currentTarget.maxRetransmits?le.LOSSY:le.RELIABLE;this.updateAndEmitDCBufferStatus(e)},this.handleDisconnect=(A,e)=>{if(this._isClosed)return;this.log.warn("".concat(A," disconnected"),this.logContext),0===this.reconnectAttempts&&(this.reconnectStart=Date.now());const t=Date.now()-this.reconnectStart;let n=this.getNextRetryDelay({elapsedMs:t,retryCount:this.reconnectAttempts});null!==n?(A===uo&&(n=0),this.log.debug("reconnecting in ".concat(n,"ms"),this.logContext),this.clearReconnectTimeout(),this.token&&this.regionUrlProvider&&this.regionUrlProvider.updateToken(this.token),this.reconnectTimeout=_i.setTimeout((()=>this.attemptReconnect(e).finally((()=>this.reconnectTimeout=void 0))),n)):(A=>{this.log.warn("could not recover connection after ".concat(this.reconnectAttempts," attempts, ").concat(A,"ms. giving up"),this.logContext),this.emit(yi.Disconnected),this.close()})(t)},this.waitForRestarted=()=>new Promise(((A,e)=>{this.pcState===ho.Connected&&A();const t=()=>{this.off(yi.Disconnected,n),A()},n=()=>{this.off(yi.Restarted,t),e()};this.once(yi.Restarted,t),this.once(yi.Disconnected,n)})),this.updateAndEmitDCBufferStatus=A=>{const e=this.isBufferStatusLow(A);void 0!==e&&e!==this.dcBufferStatus.get(A)&&(this.dcBufferStatus.set(A,e),this.emit(yi.DCBufferStatusChanged,e,A))},this.isBufferStatusLow=A=>{const e=this.dataChannelForKind(A);if(e)return e.bufferedAmount<=e.bufferedAmountLowThreshold},this.handleBrowserOnLine=()=>{this.client.currentState===cs.RECONNECTING&&(this.clearReconnectTimeout(),this.attemptReconnect(qA.RR_SIGNAL_DISCONNECTED))},this.log=Gt(null!==(e=A.loggerName)&&void 0!==e?e:Mt.Engine),this.loggerOptions={loggerName:A.loggerName,loggerContextCb:()=>this.logContext},this.client=new ls(void 0,this.loggerOptions),this.client.signalLatency=this.options.expSignalLatency,this.reconnectPolicy=this.options.reconnectPolicy,this.registerOnLineListener(),this.closingLock=new a,this.dataProcessLock=new a,this.dcBufferStatus=new Map([[le.LOSSY,!0],[le.RELIABLE,!0]]),this.client.onParticipantUpdate=A=>this.emit(yi.ParticipantUpdate,A),this.client.onConnectionQuality=A=>this.emit(yi.ConnectionQualityUpdate,A),this.client.onRoomUpdate=A=>this.emit(yi.RoomUpdate,A),this.client.onSubscriptionError=A=>this.emit(yi.SubscriptionError,A),this.client.onSubscriptionPermissionUpdate=A=>this.emit(yi.SubscriptionPermissionUpdate,A),this.client.onSpeakersChanged=A=>this.emit(yi.SpeakersChanged,A),this.client.onStreamStateUpdate=A=>this.emit(yi.StreamStateChanged,A),this.client.onRequestResponse=A=>this.emit(yi.SignalRequestResponse,A)}get logContext(){var A,e,t,n,i,r,s,o;return{room:null===(e=null===(A=this.latestJoinResponse)||void 0===A?void 0:A.room)||void 0===e?void 0:e.name,roomID:null===(n=null===(t=this.latestJoinResponse)||void 0===t?void 0:t.room)||void 0===n?void 0:n.sid,participant:null===(r=null===(i=this.latestJoinResponse)||void 0===i?void 0:i.participant)||void 0===r?void 0:r.identity,pID:null===(o=null===(s=this.latestJoinResponse)||void 0===s?void 0:s.participant)||void 0===o?void 0:o.sid}}join(A,e,t,n){return Xt(this,void 0,void 0,(function*(){this.url=A,this.token=e,this.signalOpts=t,this.maxJoinAttempts=t.maxRetries;try{this.joinAttempts+=1,this.setupSignalClientCallbacks();const i=yield this.client.join(A,e,t,n);return this._isClosed=!1,this.latestJoinResponse=i,this.subscriberPrimary=i.subscriberPrimary,this.pcManager||(yield this.configure(i)),this.subscriberPrimary&&!i.fastPublish||this.negotiate(),this.clientConfiguration=i.clientConfiguration,setTimeout((()=>{this.emit(yi.SignalConnected)}),10),i}catch(i){if(i instanceof Fi&&i.reason===ui.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,e,t,n);throw i}}))}close(){return Xt(this,void 0,void 0,(function*(){const A=yield this.closingLock.lock();if(this.isClosed)A();else try{this._isClosed=!0,this.joinAttempts=0,this.emit(yi.Closing),this.removeAllListeners(),this.deregisterOnLineListener(),this.clearPendingReconnect(),yield this.cleanupPeerConnections(),yield this.cleanupClient()}finally{A()}}))}cleanupPeerConnections(){return Xt(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 e=A=>{A&&(A.close(),A.onbufferedamountlow=null,A.onclose=null,A.onclosing=null,A.onerror=null,A.onmessage=null,A.onopen=null)};e(this.lossyDC),e(this.lossyDCSub),e(this.reliableDC),e(this.reliableDCSub),this.lossyDC=void 0,this.lossyDCSub=void 0,this.reliableDC=void 0,this.reliableDCSub=void 0}))}cleanupClient(){return Xt(this,void 0,void 0,(function*(){yield this.client.close(),this.client.resetCallbacks()}))}addTrack(A){if(this.pendingTrackResolvers[A.cid])throw new Si("a track with the same ID has already been published");return new Promise(((e,t)=>{const n=setTimeout((()=>{delete this.pendingTrackResolvers[A.cid],t(new Fi("publication of local track timed out, no response from server",ui.InternalError))}),1e4);this.pendingTrackResolvers[A.cid]={resolve:A=>{clearTimeout(n),e(A)},reject:()=>{clearTimeout(n),t(new Error("Cancelled publication by calling unpublish"))}},this.client.sendAddTrack(A)}))}removeTrack(A){if(A.track&&this.pendingTrackResolvers[A.track.id]){const{reject:e}=this.pendingTrackResolvers[A.track.id];e&&e(),delete this.pendingTrackResolvers[A.track.id]}try{return this.pcManager.removeTrack(A),!0}catch(e){this.log.warn("failed to remove track",Object.assign(Object.assign({},this.logContext),{error:e}))}return!1}updateMuteStatus(A,e){this.client.sendMuteTrack(A,e)}get dataSubscriberReadyState(){var A;return null===(A=this.reliableDCSub)||void 0===A?void 0:A.readyState}getConnectedServerAddress(){return Xt(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 Xt(this,void 0,void 0,(function*(){var e,t;if(this.pcManager&&this.pcManager.currentState!==Os.NEW)return;this.participantSid=null===(e=A.participant)||void 0===e?void 0:e.sid;const n=this.makeRTCConfiguration(A);var i;this.pcManager=new Ns(n,A.subscriberPrimary,this.loggerOptions),this.emit(yi.TransportsCreated,this.pcManager.publisher,this.pcManager.subscriber),this.pcManager.onIceCandidate=(A,e)=>{this.client.sendIceCandidate(A,e)},this.pcManager.onPublisherOffer=A=>{this.client.sendOffer(A)},this.pcManager.onDataChannel=this.handleDataChannel,this.pcManager.onStateChange=(e,t,n)=>Xt(this,void 0,void 0,(function*(){if(this.log.debug("primary PC state changed ".concat(e),this.logContext),["closed","disconnected","failed"].includes(t)&&(this.publisherConnectionPromise=void 0),e===Os.CONNECTED){const e=this.pcState===ho.New;this.pcState=ho.Connected,e&&this.emit(yi.Connected,A)}else e===Os.FAILED&&this.pcState===ho.Connected&&(this.pcState=ho.Disconnected,this.handleDisconnect("peerconnection failed","failed"===n?qA.RR_SUBSCRIBER_FAILED:qA.RR_PUBLISHER_FAILED));const i=this.client.isDisconnected||this.client.currentState===cs.RECONNECTING,r=[Os.FAILED,Os.CLOSING,Os.CLOSED].includes(e);i&&r&&!this._isClosed&&this.emit(yi.Offline)})),this.pcManager.onTrack=A=>{this.emit(yi.MediaTrackAdded,A.track,A.streams[0],A.receiver)},void 0!==(i=null===(t=A.serverInfo)||void 0===t?void 0:t.protocol)&&i>13||this.createDataChannels()}))}setupSignalClientCallbacks(){this.client.onAnswer=A=>Xt(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,e)=>{this.pcManager&&(this.log.debug("got ICE candidate from peer",Object.assign(Object.assign({},this.logContext),{candidate:A,target:e})),this.pcManager.addIceCandidate(A,e))},this.client.onOffer=A=>Xt(this,void 0,void 0,(function*(){if(!this.pcManager)return;const e=yield this.pcManager.createSubscriberAnswerFromOffer(A);this.client.sendAnswer(e)})),this.client.onLocalTrackPublished=A=>{var e;if(this.log.debug("received trackPublishedResponse",Object.assign(Object.assign({},this.logContext),{cid:A.cid,track:null===(e=A.track)||void 0===e?void 0:e.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:t}=this.pendingTrackResolvers[A.cid];delete this.pendingTrackResolvers[A.cid],t(A.track)},this.client.onLocalTrackUnpublished=A=>{this.emit(yi.LocalTrackUnpublished,A)},this.client.onLocalTrackSubscribed=A=>{this.emit(yi.LocalTrackSubscribed,A)},this.client.onTokenRefresh=A=>{this.token=A},this.client.onRemoteMuteChanged=(A,e)=>{this.emit(yi.RemoteMute,A,e)},this.client.onSubscribedQualityUpdate=A=>{this.emit(yi.SubscribedQualityUpdate,A)},this.client.onRoomMoved=A=>{var e;this.participantSid=null===(e=A.participant)||void 0===e?void 0:e.sid,this.emit(yi.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 it.DISCONNECT:this.emit(yi.Disconnected,null==A?void 0:A.reason),this.close();break;case it.RECONNECT:this.fullReconnectOnNext=!0,this.handleDisconnect(uo);break;case it.RESUME:this.handleDisconnect(uo)}}}makeRTCConfiguration(A){var e;const t=Object.assign({},this.rtcConfig);if((null===(e=this.signalOpts)||void 0===e?void 0:e.e2eeEnabled)&&(this.log.debug("E2EE - setting up transports with insertable streams",this.logContext),t.encodedInsertableStreams=!0),A.iceServers&&!t.iceServers){const e=[];A.iceServers.forEach((A=>{const t={urls:A.urls};A.username&&(t.username=A.username),A.credential&&(t.credential=A.credential),e.push(t)})),t.iceServers=e}return A.clientConfiguration&&A.clientConfiguration.forceRelay===XA.ENABLED&&(t.iceTransportPolicy="relay"),t.sdpSemantics="unified-plan",t.continualGatheringPolicy="gather_continually",t}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(co,{ordered:!1,maxRetransmits:0}),this.reliableDC=this.pcManager.createPublisherDataChannel(lo,{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,e,t){return Xt(this,void 0,void 0,(function*(){if(ar())return yield this.createTransceiverRTCRtpSender(A,e,t);if(cr())return this.log.warn("using add-track fallback",this.logContext),yield this.createRTCRtpSender(A.mediaStreamTrack);throw new Pi("Required webRTC APIs not supported on this device")}))}createSimulcastSender(A,e,t,n){return Xt(this,void 0,void 0,(function*(){if(ar())return this.createSimulcastTransceiverSender(A,e,t,n);if(cr())return this.log.debug("using add-track fallback",this.logContext),this.createRTCRtpSender(A.mediaStreamTrack);throw new Pi("Cannot stream on this device")}))}createTransceiverRTCRtpSender(A,e,t){return Xt(this,void 0,void 0,(function*(){if(!this.pcManager)throw new Pi("publisher is closed");const n=[];A.mediaStream&&n.push(A.mediaStream),Mr(A)&&(A.codec=e.videoCodec);const i={direction:"sendonly",streams:n};return t&&(i.sendEncodings=t),(yield this.pcManager.addPublisherTransceiver(A.mediaStreamTrack,i)).sender}))}createSimulcastTransceiverSender(A,e,t,n){return Xt(this,void 0,void 0,(function*(){if(!this.pcManager)throw new Pi("publisher is closed");const i={direction:"sendonly"};n&&(i.sendEncodings=n);const r=yield this.pcManager.addPublisherTransceiver(e.mediaStreamTrack,i);if(t.videoCodec)return A.setSimulcastTrackSender(t.videoCodec,r.sender),r.sender}))}createRTCRtpSender(A){return Xt(this,void 0,void 0,(function*(){if(!this.pcManager)throw new Pi("publisher is closed");return this.pcManager.addPublisherTrack(A)}))}attemptReconnect(A){return Xt(this,void 0,void 0,(function*(){var e,t,n;if(!this._isClosed)if(this.attemptingReconnect)Vt.warn("already attempting reconnect, returning early",this.logContext);else{(null===(e=this.clientConfiguration)||void 0===e?void 0:e.resumeConnection)!==XA.DISABLED&&(null!==(n=null===(t=this.pcManager)||void 0===t?void 0:t.currentState)&&void 0!==n?n:Os.NEW)!==Os.NEW||(this.fullReconnectOnNext=!0);try{this.attemptingReconnect=!0,this.fullReconnectOnNext?yield this.restartConnection():yield this.resumeConnection(A),this.clearPendingReconnect(),this.fullReconnectOnNext=!1}catch(i){this.reconnectAttempts+=1;let A=!0;i instanceof Pi?(this.log.debug("received unrecoverable error",Object.assign(Object.assign({},this.logContext),{error:i})),A=!1):i instanceof Uo||(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(yi.Disconnected),yield this.close())}finally{this.attemptingReconnect=!1}}}))}getNextRetryDelay(A){try{return this.reconnectPolicy.nextRetryDelayInMs(A)}catch(e){this.log.warn("encountered error in reconnect policy",Object.assign(Object.assign({},this.logContext),{error:e}))}return null}restartConnection(A){return Xt(this,void 0,void 0,(function*(){var e,t,n;try{if(!this.url||!this.token)throw new Pi("could not reconnect, url or token not saved");let t;this.log.info("reconnecting, attempt: ".concat(this.reconnectAttempts),this.logContext),this.emit(yi.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 Uo;t=yield this.join(null!=A?A:this.url,this.token,this.signalOpts)}catch(i){if(i instanceof Fi&&i.reason===ui.NotAllowed)throw new Pi("could not reconnect, token might be expired");throw new Uo}if(this.shouldFailNext)throw this.shouldFailNext=!1,new Error("simulated failure");if(this.client.setReconnected(),this.emit(yi.SignalRestarted,t),yield this.waitForPCReconnected(),this.client.currentState!==cs.CONNECTED)throw new Uo("Signal connection got severed during reconnect");null===(e=this.regionUrlProvider)||void 0===e||e.resetAttempts(),this.emit(yi.Restarted)}catch(r){const A=yield null===(t=this.regionUrlProvider)||void 0===t?void 0:t.getNextBestRegionUrl();if(A)return void(yield this.restartConnection(A));throw null===(n=this.regionUrlProvider)||void 0===n||n.resetAttempts(),r}}))}resumeConnection(A){return Xt(this,void 0,void 0,(function*(){var e;if(!this.url||!this.token)throw new Pi("could not reconnect, url or token not saved");if(!this.pcManager)throw new Pi("publisher and subscriber connections unset");let t;this.log.info("resuming signal connection, attempt ".concat(this.reconnectAttempts),this.logContext),this.emit(yi.Resuming);try{this.setupSignalClientCallbacks(),t=yield this.client.reconnect(this.url,this.token,this.participantSid,A)}catch(n){let A="";if(n instanceof Error&&(A=n.message,this.log.error(n.message,Object.assign(Object.assign({},this.logContext),{error:n}))),n instanceof Fi&&n.reason===ui.NotAllowed)throw new Pi("could not reconnect, token might be expired");if(n instanceof Fi&&n.reason===ui.LeaveRequest)throw n;throw new Uo(A)}if(this.emit(yi.SignalResumed),t){const A=this.makeRTCConfiguration(t);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!==cs.CONNECTED)throw new Uo("Signal connection got severed during reconnect");this.client.setReconnected(),"open"===(null===(e=this.reliableDC)||void 0===e?void 0:e.readyState)&&null===this.reliableDC.id&&this.createDataChannels(),this.emit(yi.Resumed)}))}waitForPCInitialConnection(A,e){return Xt(this,void 0,void 0,(function*(){if(!this.pcManager)throw new Pi("PC manager is closed");yield this.pcManager.ensurePCTransportConnection(e,A)}))}waitForPCReconnected(){return Xt(this,void 0,void 0,(function*(){this.pcState=ho.Reconnecting,this.log.debug("waiting for peer connection to reconnect",this.logContext);try{if(yield or(2e3),!this.pcManager)throw new Pi("PC manager is closed");yield this.pcManager.ensurePCTransportConnection(void 0,this.peerConnectionTimeout),this.pcState=ho.Connected}catch(A){throw this.pcState=ho.Disconnected,new Fi("could not establish PC connection, ".concat(A.message),ui.InternalError)}}))}publishRpcResponse(A,e,t,n){return Xt(this,void 0,void 0,(function*(){const i=new de({destinationIdentities:[A],kind:le.RELIABLE,value:{case:"rpcResponse",value:new Ce({requestId:e,value:n?{case:"error",value:n.toProto()}:{case:"payload",value:null!=t?t:""}})}});yield this.sendDataPacket(i,le.RELIABLE)}))}publishRpcAck(A,e){return Xt(this,void 0,void 0,(function*(){const t=new de({destinationIdentities:[A],kind:le.RELIABLE,value:{case:"rpcAck",value:new ve({requestId:e})}});yield this.sendDataPacket(t,le.RELIABLE)}))}sendDataPacket(A,e){return Xt(this,void 0,void 0,(function*(){const t=A.toBinary();yield this.ensurePublisherConnected(e);const n=this.dataChannelForKind(e);n&&n.send(t),this.updateAndEmitDCBufferStatus(e)}))}waitForBufferStatusLow(A){return new Promise(((e,t)=>Xt(this,void 0,void 0,(function*(){if(this.isBufferStatusLow(A))e();else{const n=()=>t("Engine closed");for(this.once(yi.Closing,n);!this.dcBufferStatus.get(A);)yield or(10);this.off(yi.Closing,n),e()}}))))}ensureDataTransportConnected(A){return Xt(this,arguments,void 0,(function(A){var e=this;let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.subscriberPrimary;return function*(){var n;if(!e.pcManager)throw new Pi("PC manager is closed");const i=t?e.pcManager.subscriber:e.pcManager.publisher,r=t?"Subscriber":"Publisher";if(!i)throw new Fi("".concat(r," connection not set"),ui.InternalError);let s=!1;t||e.dataChannelForKind(A,t)||(e.createDataChannels(),s=!0),s||t||e.pcManager.publisher.isICEConnected||"checking"===e.pcManager.publisher.getICEConnectionState()||(s=!0),s&&e.negotiate();const o=e.dataChannelForKind(A,t);if("open"===(null==o?void 0:o.readyState))return;const a=(new Date).getTime()+e.peerConnectionTimeout;for(;(new Date).getTime()<a;){if(i.isICEConnected&&"open"===(null===(n=e.dataChannelForKind(A,t))||void 0===n?void 0:n.readyState))return;yield or(50)}throw new Fi("could not establish ".concat(r," connection, state: ").concat(i.getICEConnectionState()),ui.InternalError)}()}))}ensurePublisherConnected(A){return Xt(this,void 0,void 0,(function*(){this.publisherConnectionPromise||(this.publisherConnectionPromise=this.ensureDataTransportConnected(A,!1)),yield this.publisherConnectionPromise}))}verifyTransport(){return!!this.pcManager&&this.pcManager.currentState===Os.CONNECTED&&!(!this.client.ws||this.client.ws.readyState===WebSocket.CLOSED)}negotiate(){return Xt(this,void 0,void 0,(function*(){return new Promise(((A,e)=>Xt(this,void 0,void 0,(function*(){if(!this.pcManager)return void e(new Hi("PC manager is closed"));this.pcManager.requirePublisher(),0!=this.pcManager.publisher.getTransceivers().length||this.lossyDC||this.reliableDC||this.createDataChannels();const t=new AbortController,n=()=>{t.abort(),this.log.debug("engine disconnected while negotiation was ongoing",this.logContext),A()};this.isClosed&&e("cannot negotiate on closed engine"),this.on(yi.Closing,n),this.pcManager.publisher.once(Fs,(A=>{const e=new Map;A.forEach((A=>{const t=A.codec.toLowerCase();var n;n=t,$i.includes(n)&&e.set(A.payload,t)})),this.emit(yi.RTPVideoMapUpdate,e)}));try{yield this.pcManager.negotiate(t),A()}catch(i){i instanceof Hi&&(this.fullReconnectOnNext=!0),this.handleDisconnect("negotiation",qA.RR_UNKNOWN),e(i)}finally{this.off(yi.Closing,n)}}))))}))}dataChannelForKind(A,e){if(e){if(A===le.LOSSY)return this.lossyDCSub;if(A===le.RELIABLE)return this.reliableDCSub}else{if(A===le.LOSSY)return this.lossyDC;if(A===le.RELIABLE)return this.reliableDC}}sendSyncState(A,e){var t,n;if(!this.pcManager)return void this.log.warn("sync state cannot be sent without peer connection setup",this.logContext);const i=this.pcManager.subscriber.getLocalDescription(),r=this.pcManager.subscriber.getRemoteDescription(),s=null===(n=null===(t=this.signalOpts)||void 0===t?void 0:t.autoSubscribe)||void 0===n||n,o=new Array,a=new Array;A.forEach((A=>{A.isDesired!==s&&o.push(A.trackSid),A.isEnabled||a.push(A.trackSid)})),this.client.sendSyncState(new Ct({answer:i?hs({sdp:i.sdp,type:i.type}):void 0,offer:r?hs({sdp:r.sdp,type:r.type}):void 0,subscription:new ze({trackSids:o,subscribe:!s,participantTracks:[]}),publishTracks:Zr(e),dataChannels:this.dataChannelsInfo(),trackSidsDisabled:a}))}failNext(){this.shouldFailNext=!0}dataChannelsInfo(){const A=[],e=(e,t)=>{void 0!==(null==e?void 0:e.id)&&null!==e.id&&A.push(new yt({label:e.label,id:e.id,target:t}))};return e(this.dataChannelForKind(le.LOSSY),Oe.PUBLISHER),e(this.dataChannelForKind(le.RELIABLE),Oe.PUBLISHER),e(this.dataChannelForKind(le.LOSSY,!0),Oe.SUBSCRIBER),e(this.dataChannelForKind(le.RELIABLE,!0),Oe.SUBSCRIBER),A}clearReconnectTimeout(){this.reconnectTimeout&&_i.clearTimeout(this.reconnectTimeout)}clearPendingReconnect(){this.clearReconnectTimeout(),this.reconnectAttempts=0}registerOnLineListener(){pr()&&window.addEventListener("online",this.handleBrowserOnLine)}deregisterOnLineListener(){pr()&&window.removeEventListener("online",this.handleBrowserOnLine)}}class Uo extends Error{}class ko{constructor(A,e){this.lastUpdateAt=0,this.settingsCacheTime=3e3,this.attemptedRegions=[],this.serverUrl=new URL(A),this.token=e}updateToken(A){this.token=A}isCloud(){return fr(this.serverUrl)}getServerUrl(){return this.serverUrl}getNextBestRegionUrl(A){return Xt(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 e=this.regionSettings.regions.filter((A=>!this.attemptedRegions.find((e=>e.url===A.url))));if(e.length>0){const A=e[0];return this.attemptedRegions.push(A),Vt.debug("next region: ".concat(A.region)),A.url}return null}))}resetAttempts(){this.attemptedRegions=[]}fetchRegionSettings(A){return Xt(this,void 0,void 0,(function*(){const e=yield fetch("".concat((t=this.serverUrl,"".concat(t.protocol.replace("ws","http"),"//").concat(t.host,"/settings")),"/regions"),{headers:{authorization:"Bearer ".concat(this.token)},signal:A});var t;if(e.ok){const A=yield e.json();return this.lastUpdateAt=Date.now(),A}throw new Fi("Could not fetch region settings: ".concat(e.statusText),401===e.status?ui.NotAllowed:ui.InternalError,e.status)}))}setServerReportedRegions(A){this.regionSettings=A,this.lastUpdateAt=Date.now()}}class Eo{get info(){return this._info}constructor(A,e,t){this.reader=e,this.totalByteSize=t,this._info=A,this.bytesReceived=0}}class Fo extends Eo{handleChunkReceived(A){var e;this.bytesReceived+=A.content.byteLength;const t=this.totalByteSize?this.bytesReceived/this.totalByteSize:void 0;null===(e=this.onProgress)||void 0===e||e.call(this,t)}[Symbol.asyncIterator](){const A=this.reader.getReader();return{next:()=>Xt(this,void 0,void 0,(function*(){try{const{done:e,value:t}=yield A.read();return e?{done:!0,value:void 0}:(this.handleChunkReceived(t),{done:!1,value:t.content})}catch(e){return{done:!0,value:void 0}}})),return(){return Xt(this,void 0,void 0,(function*(){return A.releaseLock(),{done:!0,value:void 0}}))}}}readAll(){return Xt(this,void 0,void 0,(function*(){var A,e,t,n;let i=new Set;try{for(var r,s=!0,o=Yt(this);!(A=(r=yield o.next()).done);s=!0){n=r.value,s=!1;const A=n;i.add(A)}}catch(a){e={error:a}}finally{try{s||A||!(t=o.return)||(yield t.call(o))}finally{if(e)throw e.error}}return Array.from(i)}))}}class To extends Eo{constructor(A,e,t){super(A,e,t),this.receivedChunks=new Map}handleChunkReceived(A){var e;const t=Dr(A.chunkIndex),n=this.receivedChunks.get(t);if(n&&n.version>A.version)return;this.receivedChunks.set(t,A),this.bytesReceived+=A.content.byteLength;const i=this.totalByteSize?this.bytesReceived/this.totalByteSize:void 0;null===(e=this.onProgress)||void 0===e||e.call(this,i)}[Symbol.asyncIterator](){const A=this.reader.getReader(),e=new TextDecoder;return{next:()=>Xt(this,void 0,void 0,(function*(){try{const{done:t,value:n}=yield A.read();return t?{done:!0,value:void 0}:(this.handleChunkReceived(n),{done:!1,value:e.decode(n.content)})}catch(t){return{done:!0,value:void 0}}})),return(){return Xt(this,void 0,void 0,(function*(){return A.releaseLock(),{done:!0,value:void 0}}))}}}readAll(){return Xt(this,void 0,void 0,(function*(){var A,e,t,n;let i="";try{for(var r,s=!0,o=Yt(this);!(A=(r=yield o.next()).done);s=!0)n=r.value,s=!1,i+=n}catch(a){e={error:a}}finally{try{s||A||!(t=o.return)||(yield t.call(o))}finally{if(e)throw e.error}}return i}))}}class So{constructor(A,e,t){this.writableStream=A,this.defaultWriter=A.getWriter(),this.onClose=t,this.info=e}write(A){return this.defaultWriter.write(A)}close(){return Xt(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 Io extends So{}class Po extends So{}class Ho extends Ji{constructor(A,e,t,n,i){super(A,t,i),this.sid=e,this.receiver=n}get isLocal(){return!1}setMuted(A){this.isMuted!==A&&(this.isMuted=A,this._mediaStreamTrack.enabled=!A,this.emit(A?Qi.Muted:Qi.Unmuted,this))}setMediaStream(A){this.mediaStream=A;const e=t=>{t.track===this._mediaStreamTrack&&(A.removeEventListener("removetrack",e),this.receiver&&"playoutDelayHint"in this.receiver&&(this.receiver.playoutDelayHint=void 0),this.receiver=void 0,this._currentBitrate=0,this.emit(Qi.Ended,this))};A.addEventListener("removetrack",e)}start(){this.startMonitor(),super.enable()}stop(){this.stopMonitor(),super.disable()}getRTCStatsReport(){return Xt(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()),Gs)),"undefined"!=typeof RTCRtpReceiver&&"getSynchronizationSources"in RTCRtpReceiver&&this.registerTimeSyncUpdate()}registerTimeSyncUpdate(){const A=()=>{var e;this.timeSyncHandle=requestAnimationFrame((()=>A()));const t=null===(e=this.receiver)||void 0===e?void 0:e.getSynchronizationSources()[0];if(t){const{timestamp:A,rtpTimestamp:e}=t;e&&this.rtpTimestamp!==e&&(this.emit(Qi.TimeSyncUpdate,{timestamp:A,rtpTimestamp:e}),this.rtpTimestamp=e)}};A()}}class Ro extends Ho{constructor(A,e,t,n,i,r){super(A,e,Ji.Kind.Audio,t,r),this.monitorReceiver=()=>Xt(this,void 0,void 0,(function*(){if(!this.receiver)return void(this._currentBitrate=0);const A=yield this.getReceiverStats();A&&this.prevStats&&this.receiver&&(this._currentBitrate=js(A,this.prevStats)),this.prevStats=A})),this.audioContext=n,this.webAudioPluginNodes=[],i&&(this.sinkId=i.deviceId)}setVolume(A){var e;for(const t of this.attachedElements)this.audioContext?null===(e=this.gainNode)||void 0===e||e.gain.setTargetAtTime(A,0,.1):t.volume=A;mr()&&this._mediaStreamTrack._setVolume(A),this.elementVolume=A}getVolume(){if(this.elementVolume)return this.elementVolume;if(mr())return 1;let A=0;return this.attachedElements.forEach((e=>{e.volume>A&&(A=e.volume)})),A}setSinkId(A){return Xt(this,void 0,void 0,(function*(){this.sinkId=A,yield Promise.all(this.attachedElements.map((e=>{if(lr(e))return e.setSinkId(A)})))}))}attach(A){const e=0===this.attachedElements.length;return A?super.attach(A):A=super.attach(),this.sinkId&&lr(A)&&A.setSinkId(this.sinkId).catch((A=>{this.log.error("Failed to set sink id on remote audio track",A,this.logContext)})),this.audioContext&&e&&(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 e;return A?(e=super.detach(A),this.audioContext&&(this.attachedElements.length>0?this.connectWebAudio(this.audioContext,this.attachedElements[0]):this.disconnectWebAudio())):(e=super.detach(),this.disconnectWebAudio()),e}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,e){this.disconnectWebAudio(),this.sourceNode=A.createMediaStreamSource(e.srcObject);let t=this.sourceNode;this.webAudioPluginNodes.forEach((A=>{t.connect(A),t=A})),this.gainNode=A.createGain(),t.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(Qi.AudioPlaybackFailed,new Error("Audio Context couldn't be started automatically"))})).catch((A=>{this.emit(Qi.AudioPlaybackFailed,A)}))}disconnectWebAudio(){var A,e;null===(A=this.gainNode)||void 0===A||A.disconnect(),null===(e=this.sourceNode)||void 0===e||e.disconnect(),this.gainNode=void 0,this.sourceNode=void 0}getReceiverStats(){return Xt(this,void 0,void 0,(function*(){if(!this.receiver||!this.receiver.getStats)return;let A;return(yield this.receiver.getStats()).forEach((e=>{"inbound-rtp"===e.type&&(A={type:"audio",streamId:e.id,timestamp:e.timestamp,jitter:e.jitter,bytesReceived:e.bytesReceived,concealedSamples:e.concealedSamples,concealmentEvents:e.concealmentEvents,silentConcealedSamples:e.silentConcealedSamples,silentConcealmentEvents:e.silentConcealmentEvents,totalAudioEnergy:e.totalAudioEnergy,totalSamplesDuration:e.totalSamplesDuration})})),A}))}}class Do extends Ho{constructor(A,e,t,n,i){super(A,e,Ji.Kind.Video,t,i),this.elementInfos=[],this.monitorReceiver=()=>Xt(this,void 0,void 0,(function*(){if(!this.receiver)return void(this._currentBitrate=0);const A=yield this.getReceiverStats();A&&this.prevStats&&this.receiver&&(this._currentBitrate=js(A,this.prevStats)),this.prevStats=A})),this.debouncedHandleResize=Us((()=>{this.updateDimensions()}),100),this.adaptiveStreamSettings=n}get isAdaptiveStream(){return void 0!==this.adaptiveStreamSettings}get mediaStreamTrack(){return this._mediaStreamTrack}setMuted(A){super.setMuted(A),this.attachedElements.forEach((e=>{A?Xi(this._mediaStreamTrack,e):Wi(this._mediaStreamTrack,e)}))}attach(A){if(A?super.attach(A):A=super.attach(),this.adaptiveStreamSettings&&void 0===this.elementInfos.find((e=>e.element===A))){const e=new xo(A);this.observeElementInfo(e)}return A}observeElementInfo(A){this.adaptiveStreamSettings&&void 0===this.elementInfos.find((e=>e===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 e=this.elementInfos.filter((e=>e===A));for(const t of e)t.stopObserving();this.elementInfos=this.elementInfos.filter((e=>e!==A)),this.updateVisibility(),this.debouncedHandleResize()}detach(A){let e=[];if(A)return this.stopObservingElement(A),super.detach(A);e=super.detach();for(const t of e)this.stopObservingElement(t);return e}getDecoderImplementation(){var A;return null===(A=this.prevStats)||void 0===A?void 0:A.decoderImplementation}getReceiverStats(){return Xt(this,void 0,void 0,(function*(){if(!this.receiver||!this.receiver.getStats)return;const A=yield this.receiver.getStats();let e,t="",n=new Map;return A.forEach((A=>{"inbound-rtp"===A.type?(t=A.codecId,e={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&&n.set(A.id,A)})),e&&""!==t&&n.get(t)&&(e.mimeType=n.get(t).mimeType),e}))}stopObservingElement(A){const e=this.elementInfos.filter((e=>e.element===A));for(const t of e)this.stopObservingElementInfo(t)}handleAppVisibilityChanged(){const A=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return Xt(this,void 0,void 0,(function*(){yield A.handleAppVisibilityChanged.call(this),this.isAdaptiveStream&&this.updateVisibility()}))}updateVisibility(){var A,e;const t=this.elementInfos.reduce(((A,e)=>Math.max(A,e.visibilityChangedAt||0)),0),n=!(null!==(e=null===(A=this.adaptiveStreamSettings)||void 0===A?void 0:A.pauseVideoInBackground)&&void 0!==e&&!e)&&this.isInBackground,i=this.elementInfos.some((A=>A.pictureInPicture)),r=this.elementInfos.some((A=>A.visible))&&!n||i;this.lastVisible!==r&&(!r&&Date.now()-t<100?_i.setTimeout((()=>{this.updateVisibility()}),100):(this.lastVisible=r,this.emit(Qi.VisibilityChanged,r,this)))}updateDimensions(){var A,e;let t=0,n=0;const i=this.getPixelDensity();for(const r of this.elementInfos){const A=r.width()*i,e=r.height()*i;A+e>t+n&&(t=A,n=e)}(null===(A=this.lastDimensions)||void 0===A?void 0:A.width)===t&&(null===(e=this.lastDimensions)||void 0===e?void 0:e.height)===n||(this.lastDimensions={width:t,height:n},this.emit(Qi.VideoDimensionsChanged,this.lastDimensions,this))}getPixelDensity(){var A;const e=null===(A=this.adaptiveStreamSettings)||void 0===A?void 0:A.pixelDensity;return"screen"===e?vr():e||(vr()>2?2:1)}}class xo{get visible(){return this.isPiP||this.isIntersecting}get pictureInPicture(){return this.isPiP}constructor(A,e){this.onVisibilityChanged=A=>{var e;const{target:t,isIntersecting:n}=A;t===this.element&&(this.isIntersecting=n,this.isPiP=Lo(this.element),this.visibilityChangedAt=Date.now(),null===(e=this.handleVisibilityChanged)||void 0===e||e.call(this))},this.onEnterPiP=()=>{var A,e,t;null===(e=null===(A=window.documentPictureInPicture)||void 0===A?void 0:A.window)||void 0===e||e.addEventListener("pagehide",this.onLeavePiP),this.isPiP=Lo(this.element),null===(t=this.handleVisibilityChanged)||void 0===t||t.call(this)},this.onLeavePiP=()=>{var A;this.isPiP=Lo(this.element),null===(A=this.handleVisibilityChanged)||void 0===A||A.call(this)},this.element=A,this.isIntersecting=null!=e?e:Oo(A),this.isPiP=pr()&&Lo(A),this.visibilityChangedAt=0}width(){return this.element.clientWidth}height(){return this.element.clientHeight}observe(){var A,e,t;this.isIntersecting=Oo(this.element),this.isPiP=Lo(this.element),this.element.handleResize=()=>{var A;null===(A=this.handleResize)||void 0===A||A.call(this)},this.element.handleVisibilityChanged=this.onVisibilityChanged,Er().observe(this.element),Ur().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===(t=null===(e=window.documentPictureInPicture)||void 0===e?void 0:e.window)||void 0===t||t.addEventListener("pagehide",this.onLeavePiP)}stopObserving(){var A,e,t,n,i;null===(A=Er())||void 0===A||A.unobserve(this.element),null===(e=Ur())||void 0===e||e.unobserve(this.element),this.element.removeEventListener("enterpictureinpicture",this.onEnterPiP),this.element.removeEventListener("leavepictureinpicture",this.onLeavePiP),null===(t=window.documentPictureInPicture)||void 0===t||t.removeEventListener("enter",this.onEnterPiP),null===(i=null===(n=window.documentPictureInPicture)||void 0===n?void 0:n.window)||void 0===i||i.removeEventListener("pagehide",this.onLeavePiP)}}function Lo(A){var e,t;return document.pictureInPictureElement===A||!!(null===(e=window.documentPictureInPicture)||void 0===e?void 0:e.window)&&Oo(A,null===(t=window.documentPictureInPicture)||void 0===t?void 0:t.window)}function Oo(A,e){const t=e||window;let n=A.offsetTop,i=A.offsetLeft;const r=A.offsetWidth,s=A.offsetHeight,{hidden:o}=A,{display:a}=getComputedStyle(A);for(;A.offsetParent;)n+=(A=A.offsetParent).offsetTop,i+=A.offsetLeft;return n<t.pageYOffset+t.innerHeight&&i<t.pageXOffset+t.innerWidth&&n+s>t.pageYOffset&&i+r>t.pageXOffset&&!o&&"none"!==a}class Mo extends Zt.EventEmitter{constructor(A,e,t,n){var i;super(),this.metadataMuted=!1,this.encryption=se.NONE,this.log=Vt,this.handleMuted=()=>{this.emit(Qi.Muted)},this.handleUnmuted=()=>{this.emit(Qi.Unmuted)},this.log=Gt(null!==(i=null==n?void 0:n.loggerName)&&void 0!==i?i:Mt.Publication),this.loggerContextCb=this.loggerContextCb,this.setMaxListeners(100),this.kind=A,this.trackSid=e,this.trackName=t,this.source=Ji.Source.Unknown}setTrack(A){this.track&&(this.track.off(Qi.Muted,this.handleMuted),this.track.off(Qi.Unmuted,this.handleUnmuted)),this.track=A,A&&(A.on(Qi.Muted,this.handleMuted),A.on(Qi.Unmuted,this.handleUnmuted))}get logContext(){var A;return Object.assign(Object.assign({},null===(A=this.loggerContextCb)||void 0===A?void 0:A.call(this)),zr(this))}get isMuted(){return this.metadataMuted}get isEnabled(){return!0}get isSubscribed(){return void 0!==this.track}get isEncrypted(){return this.encryption!==se.NONE}get audioTrack(){if(Or(this.track))return this.track}get videoTrack(){if(Mr(this.track))return this.track}updateInfo(A){this.trackSid=A.sid,this.trackName=A.name,this.source=Ji.sourceFromProto(A.source),this.mimeType=A.mimeType,this.kind===Ji.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}))}}(mo=(po=Mo||(Mo={})).SubscriptionStatus||(po.SubscriptionStatus={})).Desired="desired",mo.Subscribed="subscribed",mo.Unsubscribed="unsubscribed",(fo=po.PermissionStatus||(po.PermissionStatus={})).Allowed="allowed",fo.NotAllowed="not_allowed";class No extends Mo{get isUpstreamPaused(){var A;return null===(A=this.track)||void 0===A?void 0:A.isUpstreamPaused}constructor(A,e,t,n){super(A,e.sid,e.name,n),this.track=void 0,this.handleTrackEnded=()=>{this.emit(Qi.Ended)},this.updateInfo(e),this.setTrack(t)}setTrack(A){this.track&&this.track.off(Qi.Ended,this.handleTrackEnded),super.setTrack(A),A&&A.on(Qi.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 Xt(this,void 0,void 0,(function*(){var A;return null===(A=this.track)||void 0===A?void 0:A.mute()}))}unmute(){return Xt(this,void 0,void 0,(function*(){var A;return null===(A=this.track)||void 0===A?void 0:A.unmute()}))}pauseUpstream(){return Xt(this,void 0,void 0,(function*(){var A;yield null===(A=this.track)||void 0===A?void 0:A.pauseUpstream()}))}resumeUpstream(){return Xt(this,void 0,void 0,(function*(){var A;yield null===(A=this.track)||void 0===A?void 0:A.resumeUpstream()}))}getTrackFeatures(){var A;if(Or(this.track)){const e=this.track.getSourceTrackSettings(),t=new Set;return e.autoGainControl&&t.add(ZA.TF_AUTO_GAIN_CONTROL),e.echoCancellation&&t.add(ZA.TF_ECHO_CANCELLATION),e.noiseSuppression&&t.add(ZA.TF_NOISE_SUPPRESSION),e.channelCount&&e.channelCount>1&&t.add(ZA.TF_STEREO),(null===(A=this.options)||void 0===A?void 0:A.dtx)||t.add(ZA.TF_NO_DTX),this.track.enhancedNoiseCancellation&&t.add(ZA.TF_ENHANCED_NOISE_CANCELLATION),Array.from(t.values())}return[]}}function Ko(A,e){return Xt(this,void 0,void 0,(function*(){null!=A||(A={});let t=!1;const{audioProcessor:n,videoProcessor:i,optionsWithoutProcessor:r}=As(A);let s=r.audio,o=r.video;if(n&&"object"==typeof r.audio&&(r.audio.processor=n),i&&"object"==typeof r.video&&(r.video.processor=i),A.audio&&"object"==typeof r.audio&&"string"==typeof r.audio.deviceId){const A=r.audio.deviceId;r.audio.deviceId={exact:A},t=!0,s=Object.assign(Object.assign({},r.audio),{deviceId:{ideal:A}})}if(r.video&&"object"==typeof r.video&&"string"==typeof r.video.deviceId){const A=r.video.deviceId;r.video.deviceId={exact:A},t=!0,o=Object.assign(Object.assign({},r.video),{deviceId:{ideal:A}})}(!0===r.audio||"object"==typeof r.audio&&!r.audio.deviceId)&&(r.audio={deviceId:"default"}),!0===r.video?r.video={deviceId:"default"}:"object"!=typeof r.video||r.video.deviceId||(r.video.deviceId="default");const a=jr(r,Rs,Ds),c=Wr(a),d=navigator.mediaDevices.getUserMedia(c);r.audio&&(ns.userMediaPromiseMap.set("audioinput",d),d.catch((()=>ns.userMediaPromiseMap.delete("audioinput")))),r.video&&(ns.userMediaPromiseMap.set("videoinput",d),d.catch((()=>ns.userMediaPromiseMap.delete("videoinput"))));try{const A=yield d;return yield Promise.all(A.getTracks().map((t=>Xt(this,void 0,void 0,(function*(){const r="audio"===t.kind;let s,o=r?a.audio:a.video;"boolean"!=typeof o&&o||(o={});const d=r?c.audio:c.video;"boolean"!=typeof d&&(s=d);const l=t.getSettings().deviceId;(null==s?void 0:s.deviceId)&&Pr(s.deviceId)!==l?s.deviceId=l:s||(s={deviceId:l});const u=function(A,e,t){switch(A.kind){case"audio":return new Ws(A,e,!1,void 0,t);case"video":return new ro(A,e,!1,t);default:throw new Si("unsupported track type: ".concat(A.kind))}}(t,s,e);return u.kind===Ji.Kind.Video?u.source=Ji.Source.Camera:u.kind===Ji.Kind.Audio&&(u.source=Ji.Source.Microphone),u.mediaStream=A,Or(u)&&n?yield u.setProcessor(n):Mr(u)&&i&&(yield u.setProcessor(i)),u})))))}catch(l){if(!t)throw l;return Ko(Object.assign(Object.assign({},A),{audio:s,video:o}),e)}}))}(wo=Bo||(Bo={})).Excellent="excellent",wo.Good="good",wo.Poor="poor",wo.Lost="lost",wo.Unknown="unknown";class _o extends Zt.EventEmitter{get logContext(){var A,e;return Object.assign({},null===(e=null===(A=this.loggerOptions)||void 0===A?void 0:A.loggerContextCb)||void 0===e?void 0:e.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===ie.AGENT}get isActive(){var A;return(null===(A=this.participantInfo)||void 0===A?void 0:A.state)===ne.ACTIVE}get kind(){return this._kind}get attributes(){return Object.freeze(Object.assign({},this._attributes))}constructor(A,e,t,n,i,r){let s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:ie.STANDARD;var o;super(),this.audioLevel=0,this.isSpeaking=!1,this._connectionQuality=Bo.Unknown,this.log=Vt,this.log=Gt(null!==(o=null==r?void 0:r.loggerName)&&void 0!==o?o:Mt.Participant),this.loggerOptions=r,this.setMaxListeners(100),this.sid=A,this.identity=e,this.name=t,this.metadata=n,this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.trackPublications=new Map,this._kind=s,this._attributes=null!=i?i:{}}getTrackPublications(){return Array.from(this.trackPublications.values())}getTrackPublication(A){for(const[,e]of this.trackPublications)if(e.source===A)return e}getTrackPublicationByName(A){for(const[,e]of this.trackPublications)if(e.trackName===A)return e}waitUntilActive(){return this.isActive?Promise.resolve():(this.activeFuture||(this.activeFuture=new Ir,this.once(vi.Active,(()=>{var A,e;null===(e=null===(A=this.activeFuture)||void 0===A?void 0:A.resolve)||void 0===e||e.call(A),this.activeFuture=void 0}))),this.activeFuture.promise)}get connectionQuality(){return this._connectionQuality}get isCameraEnabled(){var A;const e=this.getTrackPublication(Ji.Source.Camera);return!(null===(A=null==e?void 0:e.isMuted)||void 0===A||A)}get isMicrophoneEnabled(){var A;const e=this.getTrackPublication(Ji.Source.Microphone);return!(null===(A=null==e?void 0:e.isMuted)||void 0===A||A)}get isScreenShareEnabled(){return!!this.getTrackPublication(Ji.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 e;return!(this.participantInfo&&this.participantInfo.sid===A.sid&&this.participantInfo.version>A.version||(this.identity=A.identity,this.sid=A.sid,this._setName(A.name),this._setMetadata(A.metadata),this._setAttributes(A.attributes),A.state===ne.ACTIVE&&(null===(e=this.participantInfo)||void 0===e?void 0:e.state)!==ne.ACTIVE&&this.emit(vi.Active),A.permission&&this.setPermissions(A.permission),this.participantInfo=A,0))}_setMetadata(A){const e=this.metadata!==A,t=this.metadata;this.metadata=A,e&&this.emit(vi.ParticipantMetadataChanged,t)}_setName(A){const e=this.name!==A;this.name=A,e&&this.emit(vi.ParticipantNameChanged,A)}_setAttributes(A){const e=function(A,e){var t;void 0===A&&(A={}),void 0===e&&(e={});const n=[...Object.keys(e),...Object.keys(A)],i={};for(const r of n)A[r]!==e[r]&&(i[r]=null!==(t=e[r])&&void 0!==t?t:"");return i}(this.attributes,A);this._attributes=A,Object.keys(e).length>0&&this.emit(vi.AttributesChanged,e)}setPermissions(A){var e,t,n,i,r,s;const o=this.permissions,a=A.canPublish!==(null===(e=this.permissions)||void 0===e?void 0:e.canPublish)||A.canSubscribe!==(null===(t=this.permissions)||void 0===t?void 0:t.canSubscribe)||A.canPublishData!==(null===(n=this.permissions)||void 0===n?void 0:n.canPublishData)||A.hidden!==(null===(i=this.permissions)||void 0===i?void 0:i.hidden)||A.recorder!==(null===(r=this.permissions)||void 0===r?void 0:r.recorder)||A.canPublishSources.length!==this.permissions.canPublishSources.length||A.canPublishSources.some(((A,e)=>{var t;return A!==(null===(t=this.permissions)||void 0===t?void 0:t.canPublishSources[e])}))||A.canSubscribeMetrics!==(null===(s=this.permissions)||void 0===s?void 0:s.canSubscribeMetrics);return this.permissions=A,a&&this.emit(vi.ParticipantPermissionsChanged,o),a}setIsSpeaking(A){A!==this.isSpeaking&&(this.isSpeaking=A,A&&(this.lastSpokeAt=new Date),this.emit(vi.IsSpeakingChanged,A))}setConnectionQuality(A){const e=this._connectionQuality;this._connectionQuality=function(A){switch(A){case WA.EXCELLENT:return Bo.Excellent;case WA.GOOD:return Bo.Good;case WA.POOR:return Bo.Poor;case WA.LOST:return Bo.Lost;default:return Bo.Unknown}}(A),e!==this._connectionQuality&&this.emit(vi.ConnectionQualityChanged,this._connectionQuality)}setDisconnected(){var A,e;this.activeFuture&&(null===(e=(A=this.activeFuture).reject)||void 0===e||e.call(A,new Error("Participant disconnected")),this.activeFuture=void 0)}setAudioContext(A){this.audioContext=A,this.audioTrackPublications.forEach((e=>Or(e.track)&&e.track.setAudioContext(A)))}addTrackPublication(A){A.on(Qi.Muted,(()=>{this.emit(vi.TrackMuted,A)})),A.on(Qi.Unmuted,(()=>{this.emit(vi.TrackUnmuted,A)}));const e=A;switch(e.track&&(e.track.sid=A.trackSid),this.trackPublications.set(A.trackSid,A),A.kind){case Ji.Kind.Audio:this.audioTrackPublications.set(A.trackSid,A);break;case Ji.Kind.Video:this.videoTrackPublications.set(A.trackSid,A)}}}class Vo extends _o{constructor(A,e,t,n,i){super(A,e,void 0,void 0,void 0,{loggerName:n.loggerName,loggerContextCb:()=>this.engine.logContext}),this.pendingPublishing=new Set,this.pendingPublishPromises=new Map,this.participantTrackPermissions=[],this.allParticipantsAllowedToSubscribe=!0,this.encryptionType=se.NONE,this.enabledPublishVideoCodecs=[],this.pendingAcks=new Map,this.pendingResponses=new Map,this.handleReconnecting=()=>{this.reconnectFuture||(this.reconnectFuture=new Ir)},this.handleReconnected=()=>{var A,e;null===(e=null===(A=this.reconnectFuture)||void 0===A?void 0:A.resolve)||void 0===e||e.call(A),this.reconnectFuture=void 0,this.updateTrackSubscriptionPermissions()},this.handleDisconnected=()=>{var A,e;this.reconnectFuture&&(this.reconnectFuture.promise.catch((A=>this.log.warn(A.message,this.logContext))),null===(e=null===(A=this.reconnectFuture)||void 0===A?void 0:A.reject)||void 0===e||e.call(A,"Got disconnected during reconnection attempt"),this.reconnectFuture=void 0)},this.handleSignalRequestResponse=A=>{const{requestId:e,reason:t,message:n}=A,i=this.pendingSignalRequests.get(e);i&&(t!==St.OK&&i.reject(new Di(n,t)),this.pendingSignalRequests.delete(e))},this.handleDataPacket=A=>{switch(A.value.case){case"rpcResponse":let e=A.value.value,t=null,n=null;"payload"===e.value.case?t=e.value.value:"error"===e.value.case&&(n=Ks.fromProto(e.value.value)),this.handleIncomingRpcResponse(e.requestId,t,n);break;case"rpcAck":let i=A.value.value;this.handleIncomingRpcAck(i.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 e,t,n;if(!A.participantSid&&!A.participantIdentity)throw new Error("Invalid track permission, must provide at least one of participantIdentity and participantSid");return new ft({participantIdentity:null!==(e=A.participantIdentity)&&void 0!==e?e:"",participantSid:null!==(t=A.participantSid)&&void 0!==t?t:"",allTracks:null!==(n=A.allowAll)&&void 0!==n&&n,trackSids:A.allowedTrackSids||[]})}(A))))},this.onTrackUnmuted=A=>{this.onTrackMuted(A,A.isUpstreamPaused)},this.onTrackMuted=(A,e)=>{void 0===e&&(e=!0),A.sid?this.engine.updateMuteStatus(A.sid,e):this.log.error("could not update mute status for unpublished track",Object.assign(Object.assign({},this.logContext),zr(A)))},this.onTrackUpstreamPaused=A=>{this.log.debug("upstream paused",Object.assign(Object.assign({},this.logContext),zr(A))),this.onTrackMuted(A,!0)},this.onTrackUpstreamResumed=A=>{this.log.debug("upstream resumed",Object.assign(Object.assign({},this.logContext),zr(A))),this.onTrackMuted(A,A.isMuted)},this.onTrackFeatureUpdate=A=>{const e=this.audioTrackPublications.get(A.sid);e?this.engine.client.sendUpdateLocalAudioTrack(e.trackSid,e.getTrackFeatures()):this.log.warn("Could not update local audio track settings, missing publication for track ".concat(A.sid),this.logContext)},this.handleSubscribedQualityUpdate=A=>Xt(this,void 0,void 0,(function*(){var e,t,n,i,r,s;if(!(null===(r=this.roomOptions)||void 0===r?void 0:r.dynacast))return;const o=this.videoTrackPublications.get(A.trackSid);if(o)if(A.subscribedCodecs.length>0){if(!o.videoTrack)return;const r=yield o.videoTrack.setPublishingCodecs(A.subscribedCodecs);try{for(var a,c=!0,d=Yt(r);!(e=(a=yield d.next()).done);c=!0){i=a.value,c=!1;const A=i;Zi(A)&&(this.log.debug("publish ".concat(A," for ").concat(o.videoTrack.sid),Object.assign(Object.assign({},this.logContext),zr(o))),yield this.publishAdditionalCodecForTrack(o.videoTrack,A,o.options))}}catch(l){t={error:l}}finally{try{c||e||!(n=d.return)||(yield n.call(d))}finally{if(t)throw t.error}}}else A.subscribedQualities.length>0&&(yield null===(s=o.videoTrack)||void 0===s?void 0:s.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 e=this.trackPublications.get(A.trackSid);e?this.unpublishTrack(e.track):this.log.warn("received unpublished event for unknown track",Object.assign(Object.assign({},this.logContext),{trackSid:A.trackSid}))},this.handleTrackEnded=A=>Xt(this,void 0,void 0,(function*(){if(A.source===Ji.Source.ScreenShare||A.source===Ji.Source.ScreenShareAudio)this.log.debug("unpublishing local track due to TrackEnded",Object.assign(Object.assign({},this.logContext),zr(A))),this.unpublishTrack(A);else if(A.isUserProvided)yield A.mute();else if(Kr(A)||Nr(A))try{if(pr())try{const e=yield null===navigator||void 0===navigator?void 0:navigator.permissions.query({name:A.source===Ji.Source.Camera?"camera":"microphone"});if(e&&"denied"===e.state)throw this.log.warn("user has revoked access to ".concat(A.source),Object.assign(Object.assign({},this.logContext),zr(A))),e.onchange=()=>{"denied"!==e.state&&(A.isMuted||A.restartTrack(),e.onchange=null)},new Error("GetUserMedia Permission denied")}catch(e){}A.isMuted||(this.log.debug("track ended, attempting to use a different device",Object.assign(Object.assign({},this.logContext),zr(A))),Kr(A)?yield A.restartTrack({deviceId:"default"}):yield A.restartTrack())}catch(e){this.log.warn("could not restart track, muting instead",Object.assign(Object.assign({},this.logContext),zr(A))),yield A.mute()}})),this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.trackPublications=new Map,this.engine=t,this.roomOptions=n,this.setupEngine(t),this.activeDeviceMap=new Map([["audioinput","default"],["videoinput","default"],["audiooutput","default"]]),this.pendingSignalRequests=new Map,this.rpcHandlers=i}get lastCameraError(){return this.cameraError}get lastMicrophoneError(){return this.microphoneError}get isE2EEEnabled(){return this.encryptionType!==se.NONE}getTrackPublication(A){const e=super.getTrackPublication(A);if(e)return e}getTrackPublicationByName(A){const e=super.getTrackPublicationByName(A);if(e)return e}setupEngine(A){this.engine=A,this.engine.on(yi.RemoteMute,((A,e)=>{const t=this.trackPublications.get(A);t&&t.track&&(e?t.mute():t.unmute())})),this.engine.on(yi.Connected,this.handleReconnected).on(yi.SignalRestarted,this.handleReconnected).on(yi.SignalResumed,this.handleReconnected).on(yi.Restarting,this.handleReconnecting).on(yi.Resuming,this.handleReconnecting).on(yi.LocalTrackUnpublished,this.handleLocalTrackUnpublished).on(yi.SubscribedQualityUpdate,this.handleSubscribedQualityUpdate).on(yi.Disconnected,this.handleDisconnected).on(yi.SignalRequestResponse,this.handleSignalRequestResponse).on(yi.DataPacketReceived,this.handleDataPacket)}setMetadata(A){return Xt(this,void 0,void 0,(function*(){yield this.requestMetadataUpdate({metadata:A})}))}setName(A){return Xt(this,void 0,void 0,(function*(){yield this.requestMetadataUpdate({name:A})}))}setAttributes(A){return Xt(this,void 0,void 0,(function*(){yield this.requestMetadataUpdate({attributes:A})}))}requestMetadataUpdate(A){return Xt(this,arguments,void 0,(function(A){var e=this;let{metadata:t,name:n,attributes:i}=A;return function*(){return new Promise(((A,r)=>Xt(e,void 0,void 0,(function*(){var e,s;try{let o=!1;const a=yield this.engine.client.sendUpdateLocalMetadata(null!==(e=null!=t?t:this.metadata)&&void 0!==e?e:"",null!==(s=null!=n?n:this.name)&&void 0!==s?s:"",i),c=performance.now();for(this.pendingSignalRequests.set(a,{resolve:A,reject:A=>{r(A),o=!0},values:{name:n,metadata:t,attributes:i}});performance.now()-c<5e3&&!o;){if((!n||this.name===n)&&(!t||this.metadata===t)&&(!i||Object.entries(i).every((A=>{let[e,t]=A;return this.attributes[e]===t||""===t&&!this.attributes[e]}))))return this.pendingSignalRequests.delete(a),void A();yield or(50)}r(new Di("Request to update local metadata timed out","TimeoutError"))}catch(o){o instanceof Error&&r(o)}}))))}()}))}setCameraEnabled(A,e,t){return this.setTrackEnabled(Ji.Source.Camera,A,e,t)}setMicrophoneEnabled(A,e,t){return this.setTrackEnabled(Ji.Source.Microphone,A,e,t)}setScreenShareEnabled(A,e,t){return this.setTrackEnabled(Ji.Source.ScreenShare,A,e,t)}setPermissions(A){const e=this.permissions,t=super.setPermissions(A);return t&&e&&this.emit(vi.ParticipantPermissionsChanged,e),t}setE2EEEnabled(A){return Xt(this,void 0,void 0,(function*(){this.encryptionType=A?se.GCM:se.NONE,yield this.republishAllTracks(void 0,!1)}))}setTrackEnabled(A,e,t,n){return Xt(this,void 0,void 0,(function*(){var i,r;this.log.debug("setTrackEnabled",Object.assign(Object.assign({},this.logContext),{source:A,enabled:e})),this.republishPromise&&(yield this.republishPromise);let s=this.getTrackPublication(A);if(e)if(s)yield s.unmute();else{let e;if(this.pendingPublishing.has(A)){const e=yield this.waitForPendingPublicationOfSource(A);return e||this.log.info("waiting for pending publication promise timed out",Object.assign(Object.assign({},this.logContext),{source:A})),yield null==e?void 0:e.unmute(),e}this.pendingPublishing.add(A);try{switch(A){case Ji.Source.Camera:e=yield this.createTracks({video:null===(i=t)||void 0===i||i});break;case Ji.Source.Microphone:e=yield this.createTracks({audio:null===(r=t)||void 0===r||r});break;case Ji.Source.ScreenShare:e=yield this.createScreenTracks(Object.assign({},t));break;default:throw new Si(A)}}catch(o){throw null==e||e.forEach((A=>{A.stop()})),o instanceof Error&&this.emit(vi.MediaDevicesError,o),this.pendingPublishing.delete(A),o}try{const A=[];for(const i of e)this.log.info("publishing track",Object.assign(Object.assign({},this.logContext),zr(i))),A.push(this.publishTrack(i,n));const t=yield Promise.all(A);[s]=t}catch(o){throw null==e||e.forEach((A=>{A.stop()})),o}finally{this.pendingPublishing.delete(A)}}else if(!(null==s?void 0:s.track)&&this.pendingPublishing.has(A)&&(s=yield this.waitForPendingPublicationOfSource(A),s||this.log.info("waiting for pending publication promise timed out",Object.assign(Object.assign({},this.logContext),{source:A}))),s&&s.track)if(A===Ji.Source.ScreenShare){s=yield this.unpublishTrack(s.track);const A=this.getTrackPublication(Ji.Source.ScreenShareAudio);A&&A.track&&this.unpublishTrack(A.track)}else yield s.mute();return s}))}enableCameraAndMicrophone(){return Xt(this,void 0,void 0,(function*(){if(!this.pendingPublishing.has(Ji.Source.Camera)&&!this.pendingPublishing.has(Ji.Source.Microphone)){this.pendingPublishing.add(Ji.Source.Camera),this.pendingPublishing.add(Ji.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(Ji.Source.Camera),this.pendingPublishing.delete(Ji.Source.Microphone)}}}))}createTracks(A){return Xt(this,void 0,void 0,(function*(){var e,t;null!=A||(A={});const n=jr(A,null===(e=this.roomOptions)||void 0===e?void 0:e.audioCaptureDefaults,null===(t=this.roomOptions)||void 0===t?void 0:t.videoCaptureDefaults);try{return(yield Ko(n,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext})).map((A=>(Or(A)&&(this.microphoneError=void 0,A.setAudioContext(this.audioContext),A.source=Ji.Source.Microphone,this.emit(vi.AudioStreamAcquired)),Mr(A)&&(this.cameraError=void 0,A.source=Ji.Source.Camera),A)))}catch(i){throw i instanceof Error&&(A.audio&&(this.microphoneError=i),A.video&&(this.cameraError=i)),i}}))}createScreenTracks(A){return Xt(this,void 0,void 0,(function*(){if(void 0===A&&(A={}),void 0===navigator.mediaDevices.getDisplayMedia)throw new Ti("getDisplayMedia not supported");void 0!==A.resolution||function(){const A=Oi();return"Safari"===(null==A?void 0:A.name)&&A.version.startsWith("17.")}()||(A.resolution=rr.h1080fps30.resolution);const e=function(A){var e,t;let n=null===(e=A.video)||void 0===e||e;return A.resolution&&A.resolution.width>0&&A.resolution.height>0&&(n="boolean"==typeof n?{}:n,n=hr()?Object.assign(Object.assign({},n),{width:{max:A.resolution.width},height:{max:A.resolution.height},frameRate:A.resolution.frameRate}):Object.assign(Object.assign({},n),{width:{ideal:A.resolution.width},height:{ideal:A.resolution.height},frameRate:A.resolution.frameRate})),{audio:null!==(t=A.audio)&&void 0!==t&&t,video:n,controller:A.controller,selfBrowserSurface:A.selfBrowserSurface,surfaceSwitching:A.surfaceSwitching,systemAudio:A.systemAudio,preferCurrentTab:A.preferCurrentTab}}(A),t=yield navigator.mediaDevices.getDisplayMedia(e),n=t.getVideoTracks();if(0===n.length)throw new Si("no video track found");const i=new ro(n[0],void 0,!1,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});i.source=Ji.Source.ScreenShare,A.contentHint&&(i.mediaStreamTrack.contentHint=A.contentHint);const r=[i];if(t.getAudioTracks().length>0){this.emit(vi.AudioStreamAcquired);const A=new Ws(t.getAudioTracks()[0],void 0,!1,this.audioContext,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});A.source=Ji.Source.ScreenShareAudio,r.push(A)}return r}))}publishTrack(A,e){return Xt(this,void 0,void 0,(function*(){return this.publishOrRepublishTrack(A,e)}))}publishOrRepublishTrack(A,e){return Xt(this,arguments,void 0,(function(A,e){var t=this;let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function*(){var i,r,s,o;let a,c;if(Kr(A)&&A.setAudioContext(t.audioContext),yield null===(i=t.reconnectFuture)||void 0===i?void 0:i.promise,t.republishPromise&&!n&&(yield t.republishPromise),Lr(A)&&t.pendingPublishPromises.has(A)&&(yield t.pendingPublishPromises.get(A)),A instanceof MediaStreamTrack)a=A.getConstraints();else{let e;switch(a=A.constraints,A.source){case Ji.Source.Microphone:e="audioinput";break;case Ji.Source.Camera:e="videoinput"}e&&t.activeDeviceMap.has(e)&&(a=Object.assign(Object.assign({},a),{deviceId:t.activeDeviceMap.get(e)}))}if(A instanceof MediaStreamTrack)switch(A.kind){case"audio":A=new Ws(A,a,!0,t.audioContext,{loggerName:t.roomOptions.loggerName,loggerContextCb:()=>t.logContext});break;case"video":A=new ro(A,a,!0,{loggerName:t.roomOptions.loggerName,loggerContextCb:()=>t.logContext});break;default:throw new Si("unsupported MediaStreamTrack kind ".concat(A.kind))}else A.updateLoggerOptions({loggerName:t.roomOptions.loggerName,loggerContextCb:()=>t.logContext});if(t.trackPublications.forEach((e=>{e.track&&e.track===A&&(c=e)})),c)return t.log.warn("track has already been published, skipping",Object.assign(Object.assign({},t.logContext),zr(c))),c;const d="channelCount"in A.mediaStreamTrack.getSettings()&&2===A.mediaStreamTrack.getSettings().channelCount||2===A.mediaStreamTrack.getConstraints().channelCount,l=null!==(r=null==e?void 0:e.forceStereo)&&void 0!==r?r:d;l&&(e||(e={}),void 0===e.dtx&&t.log.info("Opus DTX will be disabled for stereo tracks by default. Enable them explicitly to make it work.",Object.assign(Object.assign({},t.logContext),zr(A))),void 0===e.red&&t.log.info("Opus RED will be disabled for stereo tracks by default. Enable them explicitly to make it work."),null!==(s=e.dtx)&&void 0!==s||(e.dtx=!1),null!==(o=e.red)&&void 0!==o||(e.red=!1));const u=Object.assign(Object.assign({},t.roomOptions.publishDefaults),e);!function(){const A=Oi(),e="17.2";if(A)return"Safari"!==A.name&&"iOS"!==A.os||!!("iOS"===A.os&&A.osVersion&&Cr(e,A.osVersion)>=0)||"Safari"===A.name&&Cr(e,A.version)>=0}()&&t.roomOptions.e2ee&&(t.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({},t.logContext)),u.simulcast=!1),u.source&&(A.source=u.source);const h=new Promise(((e,n)=>Xt(t,void 0,void 0,(function*(){try{if(this.engine.client.currentState!==cs.CONNECTED){this.log.debug("deferring track publication until signal is connected",Object.assign(Object.assign({},this.logContext),{track:zr(A)}));const t=()=>Xt(this,void 0,void 0,(function*(){try{const t=yield this.publish(A,u,l);e(t)}catch(t){n(t)}}));setTimeout((()=>{this.engine.off(yi.SignalConnected,t),n(new Ri("publishing rejected as engine not connected within timeout",408))}),15e3),this.engine.once(yi.SignalConnected,t),this.engine.on(yi.Closing,(()=>{this.engine.off(yi.SignalConnected,t),n(new Ri("publishing rejected as engine closed",499))}))}else try{const t=yield this.publish(A,u,l);e(t)}catch(t){n(t)}}catch(t){n(t)}}))));t.pendingPublishPromises.set(A,h);try{return yield h}catch(g){throw g}finally{t.pendingPublishPromises.delete(A)}}()}))}hasPermissionsToPublish(A){if(!this.permissions)return this.log.warn("no permissions present for publishing track",Object.assign(Object.assign({},this.logContext),zr(A))),!1;const{canPublish:e,canPublishSources:t}=this.permissions;return!(!e||0!==t.length&&!t.map((A=>function(A){switch(A){case jA.CAMERA:return Ji.Source.Camera;case jA.MICROPHONE:return Ji.Source.Microphone;case jA.SCREEN_SHARE:return Ji.Source.ScreenShare;case jA.SCREEN_SHARE_AUDIO:return Ji.Source.ScreenShareAudio;default:return Ji.Source.Unknown}}(A))).includes(A.source))||(this.log.warn("insufficient permissions to publish",Object.assign(Object.assign({},this.logContext),zr(A))),!1)}publish(A,e,t){return Xt(this,void 0,void 0,(function*(){var n,i,r,s,o,a,c,d,l,u;if(!this.hasPermissionsToPublish(A))throw new Ri("failed to publish track, insufficient permissions",403);Array.from(this.trackPublications.values()).find((e=>Lr(A)&&e.source===A.source))&&A.source!==Ji.Source.Unknown&&this.log.info("publishing a second track with the same source: ".concat(A.source),Object.assign(Object.assign({},this.logContext),zr(A))),e.stopMicTrackOnMute&&Or(A)&&(A.stopOnMute=!0),A.source===Ji.Source.ScreenShare&&ur()&&(e.simulcast=!1),"av1"!==e.videoCodec||function(){if(!("getCapabilities"in RTCRtpSender))return!1;if(hr())return!1;const A=RTCRtpSender.getCapabilities("video");let e=!1;if(A)for(const t of A.codecs)if("video/AV1"===t.mimeType){e=!0;break}return e}()||(e.videoCodec=void 0),"vp9"!==e.videoCodec||function(){if(!("getCapabilities"in RTCRtpSender))return!1;if(ur())return!1;if(hr()){const A=Oi();if((null==A?void 0:A.version)&&Cr(A.version,"16")<0)return!1}const A=RTCRtpSender.getCapabilities("video");let e=!1;if(A)for(const t of A.codecs)if("video/VP9"===t.mimeType){e=!0;break}return e}()||(e.videoCodec=void 0),void 0===e.videoCodec&&(e.videoCodec=Ps),this.enabledPublishVideoCodecs.length>0&&(this.enabledPublishVideoCodecs.some((A=>e.videoCodec===$r(A.mime)))||(e.videoCodec=$r(this.enabledPublishVideoCodecs[0].mime)));const h=e.videoCodec;A.on(Qi.Muted,this.onTrackMuted),A.on(Qi.Unmuted,this.onTrackUnmuted),A.on(Qi.Ended,this.handleTrackEnded),A.on(Qi.UpstreamPaused,this.onTrackUpstreamPaused),A.on(Qi.UpstreamResumed,this.onTrackUpstreamResumed),A.on(Qi.AudioTrackFeatureUpdate,this.onTrackFeatureUpdate);const g=new Ge({cid:A.mediaStreamTrack.id,name:e.name,type:Ji.kindToProto(A.kind),muted:A.isMuted,source:Ji.sourceToProto(A.source),disableDtx:!(null===(n=e.dtx)||void 0===n||n),encryption:this.encryptionType,stereo:t,disableRed:this.isE2EEEnabled||!(null===(i=e.red)||void 0===i||i),stream:null==e?void 0:e.stream,backupCodecPolicy:null==e?void 0:e.backupCodecPolicy});let p;if(A.kind===Ji.Kind.Video){let t={width:0,height:0};try{t=yield A.waitForDimensions()}catch(w){const e=null!==(s=null===(r=this.roomOptions.videoCaptureDefaults)||void 0===r?void 0:r.resolution)&&void 0!==s?s:nr.h720.resolution;t={width:e.width,height:e.height},this.log.error("could not determine track dimensions, using defaults",Object.assign(Object.assign(Object.assign({},this.logContext),zr(A)),{dims:t}))}g.width=t.width,g.height=t.height,Nr(A)&&(dr(h)&&(A.source===Ji.Source.ScreenShare&&(e.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),zr(A))))),e.scalabilityMode=null!==(o=e.scalabilityMode)&&void 0!==o?o:"L3T3_KEY"),g.simulcastCodecs=[new Ve({codec:h,cid:A.mediaStreamTrack.id})],!0===e.backupCodec&&(e.backupCodec={codec:Ps}),e.backupCodec&&h!==e.backupCodec.codec&&g.encryption===se.NONE&&(this.roomOptions.dynacast||(this.roomOptions.dynacast=!0),g.simulcastCodecs.push(new Ve({codec:e.backupCodec.codec,cid:""})))),p=Ao(A.source===Ji.Source.ScreenShare,g.width,g.height,e),g.layers=ao(g.width,g.height,p,dr(e.videoCodec))}else A.kind===Ji.Kind.Audio&&(p=[{maxBitrate:null===(a=e.audioPreset)||void 0===a?void 0:a.maxBitrate,priority:null!==(d=null===(c=e.audioPreset)||void 0===c?void 0:c.priority)&&void 0!==d?d:"high",networkPriority:null!==(u=null===(l=e.audioPreset)||void 0===l?void 0:l.priority)&&void 0!==u?u:"high"}]);if(!this.engine||this.engine.isClosed)throw new Pi("cannot publish track when not connected");const m=()=>Xt(this,void 0,void 0,(function*(){var t,n,i;if(!this.engine.pcManager)throw new Pi("pcManager is not ready");if(A.sender=yield this.engine.createSender(A,e,p),Nr(A)&&(null!==(t=e.degradationPreference)&&void 0!==t||(e.degradationPreference=function(A){return A.source===Ji.Source.ScreenShare||A.constraints.height&&Pr(A.constraints.height)>=1080?"maintain-resolution":"balanced"}(A)),A.setDegradationPreference(e.degradationPreference)),p)if(ur()&&A.kind===Ji.Kind.Audio){let e;for(const t of this.engine.pcManager.publisher.getTransceivers())if(t.sender===A.sender){e=t;break}e&&this.engine.pcManager.publisher.setTrackCodecBitrate({transceiver:e,codec:"opus",maxbr:(null===(n=p[0])||void 0===n?void 0:n.maxBitrate)?p[0].maxBitrate/1e3:0})}else A.codec&&dr(A.codec)&&(null===(i=p[0])||void 0===i?void 0:i.maxBitrate)&&this.engine.pcManager.publisher.setTrackCodecBitrate({cid:g.cid,codec:A.codec,maxbr:p[0].maxBitrate/1e3});yield this.engine.negotiate()}));let f;if(this.enabledPublishVideoCodecs.length>0)f=(yield Promise.all([this.engine.addTrack(g),m()]))[0];else{let t;if(f=yield this.engine.addTrack(g),f.codecs.forEach((A=>{void 0===t&&(t=A.mimeType)})),t&&A.kind===Ji.Kind.Video){const n=$r(t);n!==h&&(this.log.debug("falling back to server selected codec",Object.assign(Object.assign(Object.assign({},this.logContext),zr(A)),{codec:n})),e.videoCodec=n,p=Ao(A.source===Ji.Source.ScreenShare,g.width,g.height,e))}yield m()}const B=new No(A.kind,f,A,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});return B.options=e,A.sid=f.sid,this.log.debug("publishing ".concat(A.kind," with encodings"),Object.assign(Object.assign({},this.logContext),{encodings:p,trackInfo:f})),Nr(A)?A.startMonitor(this.engine.client):Kr(A)&&A.startMonitor(),this.addTrackPublication(B),this.emit(vi.LocalTrackPublished,B),B}))}get isLocal(){return!0}publishAdditionalCodecForTrack(A,e,t){return Xt(this,void 0,void 0,(function*(){var n;if(this.encryptionType!==se.NONE)return;let i;if(this.trackPublications.forEach((e=>{e.track&&e.track===A&&(i=e)})),!i)throw new Si("track is not published");if(!Nr(A))throw new Si("track is not a video track");const r=Object.assign(Object.assign({},null===(n=this.roomOptions)||void 0===n?void 0:n.publishDefaults),t),s=function(A,e,t){var n,i,r,s;if(!t.backupCodec||!0===t.backupCodec||t.backupCodec.codec===t.videoCodec)return;e!==t.backupCodec.codec&&Vt.warn("requested a different codec than specified as backup",{serverRequested:e,backup:t.backupCodec.codec}),t.videoCodec=e,t.videoEncoding=t.backupCodec.encoding;const o=A.mediaStreamTrack.getSettings(),a=null!==(n=o.width)&&void 0!==n?n:null===(i=A.dimensions)||void 0===i?void 0:i.width,c=null!==(r=o.height)&&void 0!==r?r:null===(s=A.dimensions)||void 0===s?void 0:s.height;return A.source===Ji.Source.ScreenShare&&t.simulcast&&(t.simulcast=!1),Ao(A.source===Ji.Source.ScreenShare,a,c,t)}(A,e,r);if(!s)return void this.log.info("backup codec has been disabled, ignoring request to add additional codec for track",Object.assign(Object.assign({},this.logContext),zr(A)));const o=A.addSimulcastTrack(e,s);if(!o)return;const a=new Ge({cid:o.mediaStreamTrack.id,type:Ji.kindToProto(A.kind),muted:A.isMuted,source:Ji.sourceToProto(A.source),sid:A.sid,simulcastCodecs:[{codec:r.videoCodec,cid:o.mediaStreamTrack.id}]});if(a.layers=ao(a.width,a.height,s),!this.engine||this.engine.isClosed)throw new Pi("cannot publish track when not connected");const c=(yield Promise.all([this.engine.addTrack(a),(()=>Xt(this,void 0,void 0,(function*(){yield this.engine.createSimulcastSender(A,o,r,s),yield this.engine.negotiate()})))()]))[0];this.log.debug("published ".concat(e," for track ").concat(A.sid),Object.assign(Object.assign({},this.logContext),{encodings:s,trackInfo:c}))}))}unpublishTrack(A,e){return Xt(this,void 0,void 0,(function*(){var t,n;if(Lr(A)){const e=this.pendingPublishPromises.get(A);e&&(this.log.info("awaiting publish promise before attempting to unpublish",Object.assign(Object.assign({},this.logContext),zr(A))),yield e)}const i=this.getPublicationForTrack(A),r=i?zr(i):void 0;if(this.log.debug("unpublishing track",Object.assign(Object.assign({},this.logContext),r)),!i||!i.track)return void this.log.warn("track was not unpublished because no publication was found",Object.assign(Object.assign({},this.logContext),r));(A=i.track).off(Qi.Muted,this.onTrackMuted),A.off(Qi.Unmuted,this.onTrackUnmuted),A.off(Qi.Ended,this.handleTrackEnded),A.off(Qi.UpstreamPaused,this.onTrackUpstreamPaused),A.off(Qi.UpstreamResumed,this.onTrackUpstreamResumed),A.off(Qi.AudioTrackFeatureUpdate,this.onTrackFeatureUpdate),void 0===e&&(e=null===(n=null===(t=this.roomOptions)||void 0===t?void 0:t.stopLocalTrackOnUnpublish)||void 0===n||n),e?A.stop():A.stopMonitor();let s=!1;const o=A.sender;if(A.sender=void 0,this.engine.pcManager&&this.engine.pcManager.currentState<Os.FAILED&&o)try{for(const A of this.engine.pcManager.publisher.getTransceivers())A.sender===o&&(A.direction="inactive",s=!0);if(this.engine.removeTrack(o)&&(s=!0),Nr(A)){for(const[,e]of A.simulcastCodecs)e.sender&&(this.engine.removeTrack(e.sender)&&(s=!0),e.sender=void 0);A.simulcastCodecs.clear()}}catch(a){this.log.warn("failed to unpublish track",Object.assign(Object.assign(Object.assign({},this.logContext),r),{error:a}))}switch(this.trackPublications.delete(i.trackSid),i.kind){case Ji.Kind.Audio:this.audioTrackPublications.delete(i.trackSid);break;case Ji.Kind.Video:this.videoTrackPublications.delete(i.trackSid)}return this.emit(vi.LocalTrackUnpublished,i),i.setTrack(void 0),s&&(yield this.engine.negotiate()),i}))}unpublishTracks(A){return Xt(this,void 0,void 0,(function*(){return(yield Promise.all(A.map((A=>this.unpublishTrack(A))))).filter((A=>!!A))}))}republishAllTracks(A){return Xt(this,arguments,void 0,(function(A){var e=this;let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return function*(){e.republishPromise&&(yield e.republishPromise),e.republishPromise=new Promise(((n,i)=>Xt(e,void 0,void 0,(function*(){try{const e=[];this.trackPublications.forEach((t=>{t.track&&(A&&(t.options=Object.assign(Object.assign({},t.options),A)),e.push(t))})),yield Promise.all(e.map((A=>Xt(this,void 0,void 0,(function*(){const e=A.track;yield this.unpublishTrack(e,!1),!t||e.isMuted||e.source===Ji.Source.ScreenShare||e.source===Ji.Source.ScreenShareAudio||!Kr(e)&&!Nr(e)||e.isUserProvided||(this.log.debug("restarting existing track",Object.assign(Object.assign({},this.logContext),{track:A.trackSid})),yield e.restartTrack()),yield this.publishOrRepublishTrack(e,A.options,!0)}))))),n()}catch(e){i(e)}finally{this.republishPromise=void 0}})))),yield e.republishPromise}()}))}publishData(A){return Xt(this,arguments,void 0,(function(A){var e=this;let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){const n=t.reliable?le.RELIABLE:le.LOSSY,i=t.destinationIdentities,r=t.topic,s=new de({kind:n,value:{case:"user",value:new ge({participantIdentity:e.identity,payload:A,destinationIdentities:i,topic:r})}});yield e.engine.sendDataPacket(s,n)}()}))}publishDtmf(A,e){return Xt(this,void 0,void 0,(function*(){const t=new de({kind:le.RELIABLE,value:{case:"sipDtmf",value:new pe({code:A,digit:e})}});yield this.engine.sendDataPacket(t,le.RELIABLE)}))}sendChatMessage(A,e){return Xt(this,void 0,void 0,(function*(){const t={id:crypto.randomUUID(),message:A,timestamp:Date.now(),attachedFiles:null==e?void 0:e.attachments},n=new de({value:{case:"chatMessage",value:new Be(Object.assign(Object.assign({},t),{timestamp:F.parse(t.timestamp)}))}});return yield this.engine.sendDataPacket(n,le.RELIABLE),this.emit(vi.ChatMessage,t),t}))}editChatMessage(A,e){return Xt(this,void 0,void 0,(function*(){const t=Object.assign(Object.assign({},e),{message:A,editTimestamp:Date.now()}),n=new de({value:{case:"chatMessage",value:new Be(Object.assign(Object.assign({},t),{timestamp:F.parse(t.timestamp),editTimestamp:F.parse(t.editTimestamp)}))}});return yield this.engine.sendDataPacket(n,le.RELIABLE),this.emit(vi.ChatMessage,t),t}))}sendText(A,e){return Xt(this,void 0,void 0,(function*(){var t;const n=crypto.randomUUID(),i=(new TextEncoder).encode(A).byteLength,r=null===(t=null==e?void 0:e.attachments)||void 0===t?void 0:t.map((()=>crypto.randomUUID())),s=new Array(r?r.length+1:1).fill(0),o=(A,t)=>{var n;s[t]=A;const i=s.reduce(((A,e)=>A+e),0);null===(n=null==e?void 0:e.onProgress)||void 0===n||n.call(e,i)},a=yield this.streamText({streamId:n,totalSize:i,destinationIdentities:null==e?void 0:e.destinationIdentities,topic:null==e?void 0:e.topic,attachedStreamIds:r,attributes:null==e?void 0:e.attributes});return yield a.write(A),o(1,0),yield a.close(),(null==e?void 0:e.attachments)&&r&&(yield Promise.all(e.attachments.map(((A,t)=>Xt(this,void 0,void 0,(function*(){return this._sendFile(r[t],A,{topic:e.topic,mimeType:A.type,onProgress:A=>{o(A,t+1)}})})))))),a.info}))}streamText(A){return Xt(this,void 0,void 0,(function*(){var e,t;const n=null!==(e=null==A?void 0:A.streamId)&&void 0!==e?e:crypto.randomUUID(),i={id:n,mimeType:"text/plain",timestamp:Date.now(),topic:null!==(t=null==A?void 0:A.topic)&&void 0!==t?t:"",size:null==A?void 0:A.totalSize,attributes:null==A?void 0:A.attributes},r=new De({streamId:n,mimeType:i.mimeType,topic:i.topic,timestamp:xr(i.timestamp),totalLength:xr(null==A?void 0:A.totalSize),attributes:i.attributes,contentHeader:{case:"textHeader",value:new He({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)?Pe.UPDATE:Pe.CREATE})}}),s=null==A?void 0:A.destinationIdentities,o=new de({destinationIdentities:s,value:{case:"streamHeader",value:r}});yield this.engine.sendDataPacket(o,le.RELIABLE);let a=0;const c=this,d=new WritableStream({write(A){return Xt(this,void 0,void 0,(function*(){for(const e of function(A){const e=[];let t=(new TextEncoder).encode(A);for(;t.length>15e3;){let A=15e3;for(;A>0;){const e=t[A];if(void 0!==e&&128!=(192&e))break;A--}e.push(t.slice(0,A)),t=t.slice(A)}return t.length>0&&e.push(t),e}(A)){yield c.engine.waitForBufferStatusLow(le.RELIABLE);const A=new xe({content:e,streamId:n,chunkIndex:xr(a)}),t=new de({destinationIdentities:s,value:{case:"streamChunk",value:A}});yield c.engine.sendDataPacket(t,le.RELIABLE),a+=1}}))},close(){return Xt(this,void 0,void 0,(function*(){const A=new Le({streamId:n}),e=new de({destinationIdentities:s,value:{case:"streamTrailer",value:A}});yield c.engine.sendDataPacket(e,le.RELIABLE)}))},abort(A){console.log("Sink error:",A)}});let l=()=>Xt(this,void 0,void 0,(function*(){yield u.close()}));c.engine.once(yi.Closing,l);const u=new Io(d,i,(()=>this.engine.off(yi.Closing,l)));return u}))}sendFile(A,e){return Xt(this,void 0,void 0,(function*(){const t=crypto.randomUUID();return yield this._sendFile(t,A,e),{id:t}}))}_sendFile(A,e,t){return Xt(this,void 0,void 0,(function*(){var n;const i=yield this.streamBytes({streamId:A,totalSize:e.size,name:e.name,mimeType:null!==(n=null==t?void 0:t.mimeType)&&void 0!==n?n:e.type,topic:null==t?void 0:t.topic,destinationIdentities:null==t?void 0:t.destinationIdentities}),r=e.stream().getReader();for(;;){const{done:A,value:e}=yield r.read();if(A)break;yield i.write(e)}return yield i.close(),i.info}))}streamBytes(A){return Xt(this,void 0,void 0,(function*(){var e,t,n,i,r;const s=null!==(e=null==A?void 0:A.streamId)&&void 0!==e?e:crypto.randomUUID(),o=null==A?void 0:A.destinationIdentities,c={id:s,mimeType:null!==(t=null==A?void 0:A.mimeType)&&void 0!==t?t:"application/octet-stream",topic:null!==(n=null==A?void 0:A.topic)&&void 0!==n?n:"",timestamp:Date.now(),attributes:null==A?void 0:A.attributes,size:null==A?void 0:A.totalSize,name:null!==(i=null==A?void 0:A.name)&&void 0!==i?i:"unknown"},d=new De({totalLength:xr(null!==(r=c.size)&&void 0!==r?r:0),mimeType:c.mimeType,streamId:s,topic:c.topic,timestamp:xr(Date.now()),attributes:c.attributes,contentHeader:{case:"byteHeader",value:new Re({name:c.name})}}),l=new de({destinationIdentities:o,value:{case:"streamHeader",value:d}});yield this.engine.sendDataPacket(l,le.RELIABLE);let u=0;const h=new a,g=this.engine,p=this.log,m=new WritableStream({write(A){return Xt(this,void 0,void 0,(function*(){const e=yield h.lock();let t=0;try{for(;t<A.byteLength;){const e=A.slice(t,t+15e3);yield g.waitForBufferStatusLow(le.RELIABLE);const n=new de({destinationIdentities:o,value:{case:"streamChunk",value:new xe({content:e,streamId:s,chunkIndex:xr(u)})}});yield g.sendDataPacket(n,le.RELIABLE),u+=1,t+=e.byteLength}}finally{e()}}))},close(){return Xt(this,void 0,void 0,(function*(){const A=new Le({streamId:s}),e=new de({destinationIdentities:o,value:{case:"streamTrailer",value:A}});yield g.sendDataPacket(e,le.RELIABLE)}))},abort(A){p.error("Sink error:",A)}});return new Po(m,c)}))}performRpc(A){return Xt(this,arguments,void 0,(function(A){var e=this;let{destinationIdentity:t,method:n,payload:i,responseTimeout:r=1e4}=A;return function*(){return new Promise(((A,s)=>Xt(e,void 0,void 0,(function*(){var e,o,a,c;if(_s(i)>15360)return void s(Ks.builtIn("REQUEST_PAYLOAD_TOO_LARGE"));if((null===(o=null===(e=this.engine.latestJoinResponse)||void 0===e?void 0:e.serverInfo)||void 0===o?void 0:o.version)&&Cr(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 s(Ks.builtIn("UNSUPPORTED_SERVER"));const d=crypto.randomUUID();yield this.publishRpcRequest(t,d,n,i,r-2e3);const l=setTimeout((()=>{this.pendingAcks.delete(d),s(Ks.builtIn("CONNECTION_TIMEOUT")),this.pendingResponses.delete(d),clearTimeout(u)}),2e3);this.pendingAcks.set(d,{resolve:()=>{clearTimeout(l)},participantIdentity:t});const u=setTimeout((()=>{this.pendingResponses.delete(d),s(Ks.builtIn("RESPONSE_TIMEOUT"))}),r);this.pendingResponses.set(d,{resolve:(e,t)=>{clearTimeout(u),this.pendingAcks.has(d)&&(console.warn("RPC response received before ack",d),this.pendingAcks.delete(d),clearTimeout(l)),t?s(t):A(null!=e?e:"")},participantIdentity:t})}))))}()}))}registerRpcMethod(A,e){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,e)}unregisterRpcMethod(A){this.rpcHandlers.delete(A)}setTrackSubscriptionPermissions(A){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.participantTrackPermissions=e,this.allParticipantsAllowedToSubscribe=A,this.engine.client.isDisconnected||this.updateTrackSubscriptionPermissions()}handleIncomingRpcAck(A){const e=this.pendingAcks.get(A);e?(e.resolve(),this.pendingAcks.delete(A)):console.error("Ack received for unexpected RPC request",A)}handleIncomingRpcResponse(A,e,t){const n=this.pendingResponses.get(A);n?(n.resolve(e,t),this.pendingResponses.delete(A)):console.error("Response received for unexpected RPC request",A)}publishRpcRequest(A,e,t,n,i){return Xt(this,void 0,void 0,(function*(){const r=new de({destinationIdentities:[A],kind:le.RELIABLE,value:{case:"rpcRequest",value:new we({id:e,method:t,payload:n,responseTimeoutMs:i,version:1})}});yield this.engine.sendDataPacket(r,le.RELIABLE)}))}handleParticipantDisconnected(A){for(const[e,{participantIdentity:t}]of this.pendingAcks)t===A&&this.pendingAcks.delete(e);for(const[e,{participantIdentity:t,resolve:n}]of this.pendingResponses)t===A&&(n(null,Ks.builtIn("RECIPIENT_DISCONNECTED")),this.pendingResponses.delete(e))}setEnabledPublishCodecs(A){this.enabledPublishVideoCodecs=A.filter((A=>"video"===A.mime.split("/")[0].toLowerCase()))}updateInfo(A){return!!super.updateInfo(A)&&(A.tracks.forEach((A=>{var e,t;const n=this.trackPublications.get(A.sid);if(n){const i=n.isMuted||null!==(t=null===(e=n.track)||void 0===e?void 0:e.isUpstreamPaused)&&void 0!==t&&t;i!==A.muted&&(this.log.debug("updating server mute state after reconcile",Object.assign(Object.assign(Object.assign({},this.logContext),zr(n)),{mutedOnServer:i})),this.engine.client.sendMuteTrack(A.sid,i))}})),!0)}getPublicationForTrack(A){let e;return this.trackPublications.forEach((t=>{const n=t.track;n&&(A instanceof MediaStreamTrack?(Kr(n)||Nr(n))&&n.mediaStreamTrack===A&&(e=t):A===n&&(e=t))})),e}waitForPendingPublicationOfSource(A){return Xt(this,void 0,void 0,(function*(){const e=Date.now();for(;Date.now()<e+1e4;){const e=Array.from(this.pendingPublishPromises.entries()).find((e=>{let[t]=e;return t.source===A}));if(e)return e[1];yield or(20)}}))}}class Go extends Mo{constructor(A,e,t,n){super(A,e.sid,e.name,n),this.track=void 0,this.allowed=!0,this.disabled=!1,this.currentVideoQuality=Gi.HIGH,this.handleEnded=A=>{this.setTrack(void 0),this.emit(Qi.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=t,this.updateInfo(e)}setSubscribed(A){const e=this.subscriptionStatus,t=this.permissionStatus;this.subscribed=A,A&&(this.allowed=!0);const n=new ze({trackSids:[this.trackSid],subscribe:this.subscribed,participantTracks:[new be({participantSid:"",trackSids:[this.trackSid]})]});this.emit(Qi.UpdateSubscription,n),this.emitSubscriptionUpdateIfChanged(e),this.emitPermissionUpdateIfChanged(t)}get subscriptionStatus(){return!1===this.subscribed?Mo.SubscriptionStatus.Unsubscribed:super.isSubscribed?Mo.SubscriptionStatus.Subscribed:Mo.SubscriptionStatus.Desired}get permissionStatus(){return this.allowed?Mo.PermissionStatus.Allowed:Mo.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 e,t;this.isManualOperationAllowed()&&((null===(e=this.videoDimensions)||void 0===e?void 0:e.width)===A.width&&(null===(t=this.videoDimensions)||void 0===t?void 0:t.height)===A.height||(Gr(this.track)&&(this.videoDimensions=A),this.currentVideoQuality=void 0,this.emitTrackUpdate()))}setVideoFPS(A){this.isManualOperationAllowed()&&Gr(this.track)&&this.fps!==A&&(this.fps=A,this.emitTrackUpdate())}get videoQuality(){return this.currentVideoQuality}setTrack(A){const e=this.subscriptionStatus,t=this.permissionStatus,n=this.track;n!==A&&(n&&(n.off(Qi.VideoDimensionsChanged,this.handleVideoDimensionsChange),n.off(Qi.VisibilityChanged,this.handleVisibilityChange),n.off(Qi.Ended,this.handleEnded),n.detach(),n.stopMonitor(),this.emit(Qi.Unsubscribed,n)),super.setTrack(A),A&&(A.sid=this.trackSid,A.on(Qi.VideoDimensionsChanged,this.handleVideoDimensionsChange),A.on(Qi.VisibilityChanged,this.handleVisibilityChange),A.on(Qi.Ended,this.handleEnded),this.emit(Qi.Subscribed,A)),this.emitPermissionUpdateIfChanged(t),this.emitSubscriptionUpdateIfChanged(e))}setAllowed(A){const e=this.subscriptionStatus,t=this.permissionStatus;this.allowed=A,this.emitPermissionUpdateIfChanged(t),this.emitSubscriptionUpdateIfChanged(e)}setSubscriptionError(A){this.emit(Qi.SubscriptionFailed,A)}updateInfo(A){super.updateInfo(A);const e=this.metadataMuted;this.metadataMuted=A.muted,this.track?this.track.setMuted(A.muted):e!==A.muted&&this.emit(A.muted?Qi.Muted:Qi.Unmuted)}emitSubscriptionUpdateIfChanged(A){const e=this.subscriptionStatus;A!==e&&this.emit(Qi.SubscriptionStatusChanged,e,A)}emitPermissionUpdateIfChanged(A){this.permissionStatus!==A&&this.emit(Qi.SubscriptionPermissionChanged,this.permissionStatus,A)}isManualOperationAllowed(){return this.kind===Ji.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 Gr(this.track)&&this.track.isAdaptiveStream}emitTrackUpdate(){const A=new At({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=Gi.HIGH,this.emit(Qi.UpdateSettings,A)}}class jo extends _o{static fromParticipantInfo(A,e,t){return new jo(A,e.sid,e.identity,e.name,e.metadata,e.attributes,t,e.kind)}get logContext(){return Object.assign(Object.assign({},super.logContext),{rpID:this.sid,remoteParticipant:this.identity})}constructor(A,e,t,n,i,r,s){super(e,t||"",n,i,r,s,arguments.length>7&&void 0!==arguments[7]?arguments[7]:ie.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(Qi.UpdateSettings,(e=>{this.log.debug("send update settings",Object.assign(Object.assign({},this.logContext),zr(A))),this.signalClient.sendUpdateTrackSettings(e)})),A.on(Qi.UpdateSubscription,(A=>{A.participantTracks.forEach((A=>{A.participantSid=this.sid})),this.signalClient.sendUpdateSubscription(A)})),A.on(Qi.SubscriptionPermissionChanged,(e=>{this.emit(vi.TrackSubscriptionPermissionChanged,A,e)})),A.on(Qi.SubscriptionStatusChanged,(e=>{this.emit(vi.TrackSubscriptionStatusChanged,A,e)})),A.on(Qi.Subscribed,(e=>{this.emit(vi.TrackSubscribed,e,A)})),A.on(Qi.Unsubscribed,(e=>{this.emit(vi.TrackUnsubscribed,e,A)})),A.on(Qi.SubscriptionFailed,(e=>{this.emit(vi.TrackSubscriptionFailed,A.trackSid,e)}))}getTrackPublication(A){const e=super.getTrackPublication(A);if(e)return e}getTrackPublicationByName(A){const e=super.getTrackPublicationByName(A);if(e)return e}setVolume(A){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ji.Source.Microphone;this.volumeMap.set(e,A);const t=this.getTrackPublication(e);t&&t.track&&t.track.setVolume(A)}getVolume(){let A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ji.Source.Microphone;const e=this.getTrackPublication(A);return e&&e.track?e.track.getVolume():this.volumeMap.get(A)}addSubscribedMediaTrack(A,e,t,n,i,r){let s,o=this.getTrackPublicationBySid(e);return o||e.startsWith("TR")||this.trackPublications.forEach((e=>{o||A.kind!==e.kind.toString()||(o=e)})),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),zr(o))),void this.emit(vi.TrackSubscriptionFailed,e)):(s="video"===A.kind?new Do(A,e,n,i):new Ro(A,e,n,this.audioContext,this.audioOutput),s.source=o.source,s.isMuted=o.isMuted,s.setMediaStream(t),s.start(),o.setTrack(s),this.volumeMap.has(o.source)&&_r(s)&&Or(s)&&s.setVolume(this.volumeMap.get(o.source)),o):0===r?(this.log.error("could not find published track",Object.assign(Object.assign({},this.logContext),{trackSid:e})),void this.emit(vi.TrackSubscriptionFailed,e)):(void 0===r&&(r=20),void setTimeout((()=>{this.addSubscribedMediaTrack(A,e,t,n,i,r-1)}),150))}get hasMetadata(){return!!this.participantInfo}getTrackPublicationBySid(A){return this.trackPublications.get(A)}updateInfo(A){if(!super.updateInfo(A))return!1;const e=new Map,t=new Map;return A.tracks.forEach((A=>{var n,i;let r=this.getTrackPublicationBySid(A.sid);if(r)r.updateInfo(A);else{const e=Ji.kindFromProto(A.type);if(!e)return;r=new Go(e,A,null===(n=this.signalClient.connectOptions)||void 0===n?void 0:n.autoSubscribe,{loggerContextCb:()=>this.logContext,loggerName:null===(i=this.loggerOptions)||void 0===i?void 0:i.loggerName}),r.updateInfo(A),t.set(A.sid,r);const s=Array.from(this.trackPublications.values()).find((A=>A.source===(null==r?void 0:r.source)));s&&r.source!==Ji.Source.Unknown&&this.log.debug("received a second track publication for ".concat(this.identity," with the same source: ").concat(r.source),Object.assign(Object.assign({},this.logContext),{oldTrack:zr(s),newTrack:zr(r)})),this.addTrackPublication(r)}e.set(A.sid,r)})),this.trackPublications.forEach((A=>{e.has(A.trackSid)||(this.log.trace("detected removed track on remote participant, unpublishing",Object.assign(Object.assign({},this.logContext),zr(A))),this.unpublishTrack(A.trackSid,!0))})),t.forEach((A=>{this.emit(vi.TrackPublished,A)})),!0}unpublishTrack(A,e){const t=this.trackPublications.get(A);if(!t)return;const{track:n}=t;switch(n&&(n.stop(),t.setTrack(void 0)),this.trackPublications.delete(A),t.kind){case Ji.Kind.Audio:this.audioTrackPublications.delete(A);break;case Ji.Kind.Video:this.videoTrackPublications.delete(A)}e&&this.emit(vi.TrackUnpublished,t)}setAudioOutput(A){return Xt(this,void 0,void 0,(function*(){this.audioOutput=A;const e=[];this.audioTrackPublications.forEach((t=>{var n;Or(t.track)&&_r(t.track)&&e.push(t.track.setSinkId(null!==(n=A.deviceId)&&void 0!==n?n:"default"))})),yield Promise.all(e)}))}emit(A){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return this.log.trace("participant event",Object.assign(Object.assign({},this.logContext),{event:A,args:t})),super.emit(A,...t)}}(Co=vo||(vo={})).Disconnected="disconnected",Co.Connecting="connecting",Co.Connected="connected",Co.Reconnecting="reconnecting",Co.SignalReconnecting="signalReconnecting";class Jo extends Zt.EventEmitter{constructor(A){var e,t,n,i;if(super(),e=this,this.state=vo.Disconnected,this.activeSpeakers=[],this.isE2EEEnabled=!1,this.audioEnabled=!0,this.isVideoPlaybackBlocked=!1,this.log=Vt,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,e,t)=>Xt(this,void 0,void 0,(function*(){var n;if("undefined"==typeof RTCPeerConnection||!ar()&&!cr())throw mr()?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 i=yield this.disconnectLock.lock();if(this.state===vo.Connected)return this.log.info("already connected to room ".concat(this.name),this.logContext),i(),Promise.resolve();if(this.connectFuture)return i(),this.connectFuture.promise;this.setAndEmitConnectionState(vo.Connecting),(null===(n=this.regionUrlProvider)||void 0===n?void 0:n.getServerUrl().toString())!==A&&(this.regionUrl=void 0,this.regionUrlProvider=void 0),fr(new URL(A))&&(void 0===this.regionUrlProvider?this.regionUrlProvider=new ko(A,e):this.regionUrlProvider.updateToken(e),this.regionUrlProvider.fetchRegionSettings().then((A=>{var e;null===(e=this.regionUrlProvider)||void 0===e||e.setServerReportedRegions(A)})).catch((A=>{this.log.warn("could not fetch region settings",Object.assign(Object.assign({},this.logContext),{error:A}))})));const r=(n,s,o)=>Xt(this,void 0,void 0,(function*(){var a,c;this.abortController&&this.abortController.abort();const d=new AbortController;this.abortController=d,null==i||i();try{yield this.attemptConnection(null!=o?o:A,e,t,d),this.abortController=void 0,n()}catch(l){if(this.regionUrlProvider&&l instanceof Fi&&l.reason!==ui.Cancelled&&l.reason!==ui.NotAllowed){let A=null;try{A=yield this.regionUrlProvider.getNextBestRegionUrl(null===(a=this.abortController)||void 0===a?void 0:a.signal)}catch(u){if(u instanceof Fi&&(401===u.status||u.reason===ui.Cancelled))return this.handleDisconnect(this.options.stopLocalTrackOnUnpublish),void s(u)}A&&!(null===(c=this.abortController)||void 0===c?void 0:c.signal.aborted)?(this.log.info("Initial connection failed with ConnectionError: ".concat(l.message,". Retrying with another region: ").concat(A),this.logContext),this.recreateEngine(),yield r(n,s,A)):(this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,Rr(l)),s(l))}else{let A=YA.UNKNOWN_REASON;l instanceof Fi&&(A=Rr(l)),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,A),s(l)}}})),s=this.regionUrl;return this.regionUrl=void 0,this.connectFuture=new Ir(((A,e)=>{r(A,e,s)}),(()=>{this.clearConnectionFutures()})),this.connectFuture.promise})),this.connectSignal=(A,e,t,n,i,r)=>Xt(this,void 0,void 0,(function*(){var s,o,a;const c=yield t.join(A,e,{autoSubscribe:n.autoSubscribe,adaptiveStream:"object"==typeof i.adaptiveStream||i.adaptiveStream,maxRetries:n.maxRetries,e2eeEnabled:!!this.e2eeManager,websocketTimeout:n.websocketTimeout},r.signal);let d=c.serverInfo;if(d||(d={version:c.serverVersion,region:c.serverRegion}),this.serverInfo=d,this.log.debug("connected to Livekit Server ".concat(Object.entries(d).map((A=>{let[e,t]=A;return"".concat(e,": ").concat(t)})).join(", ")),{room:null===(s=c.room)||void 0===s?void 0:s.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}),!d.version)throw new Ii("unknown server version");return"0.15.1"===d.version&&this.options.dynacast&&(this.log.debug("disabling dynacast due to server version",this.logContext),i.dynacast=!1),c})),this.applyJoinResponse=A=>{const e=A.participant;if(this.localParticipant.sid=e.sid,this.localParticipant.identity=e.identity,this.localParticipant.setEnabledPublishCodecs(A.enabledPublishCodecs),this.options.e2ee&&this.e2eeManager)try{this.e2eeManager.setSifTrailer(A.sifTrailer)}catch(t){this.log.error(t instanceof Error?t.message:"Could not set SifTrailer",Object.assign(Object.assign({},this.logContext),{error:t}))}this.handleParticipantUpdates([e,...A.otherParticipants]),A.room&&this.handleRoomUpdate(A.room)},this.attemptConnection=(A,e,t,n)=>Xt(this,void 0,void 0,(function*(){var i,r;this.state===vo.Reconnecting||this.isResuming||(null===(i=this.engine)||void 0===i?void 0:i.pendingReconnect)?(this.log.info("Reconnection attempt replaced by new connection attempt",this.logContext),this.recreateEngine()):this.maybeCreateEngine(),(null===(r=this.regionUrlProvider)||void 0===r?void 0:r.isCloud())&&this.engine.setRegionUrlProvider(this.regionUrlProvider),this.acquireAudioContext(),this.connOptions=Object.assign(Object.assign({},Ls),t),this.connOptions.rtcConfig&&(this.engine.rtcConfig=this.connOptions.rtcConfig),this.connOptions.peerConnectionTimeout&&(this.engine.peerConnectionTimeout=this.connOptions.peerConnectionTimeout);try{const t=yield this.connectSignal(A,e,this.engine,this.connOptions,this.options,n);this.applyJoinResponse(t),this.setupLocalParticipantEvents(),this.emit(Bi.SignalConnected)}catch(s){yield this.engine.close(),this.recreateEngine();const A=new Fi("could not establish signal connection",ui.ServerUnreachable);throw s instanceof Error&&(A.message="".concat(A.message,": ").concat(s.message)),s instanceof Fi&&(A.reason=s.reason,A.status=s.status),this.log.debug("error trying to establish signal connection",Object.assign(Object.assign({},this.logContext),{error:s})),A}if(n.signal.aborted)throw yield this.engine.close(),this.recreateEngine(),new Fi("Connection attempt aborted",ui.Cancelled);try{yield this.engine.waitForPCInitialConnection(this.connOptions.peerConnectionTimeout,n)}catch(o){throw yield this.engine.close(),this.recreateEngine(),o}pr()&&this.options.disconnectOnPageLeave&&(window.addEventListener("pagehide",this.onPageLeave),window.addEventListener("beforeunload",this.onPageLeave)),pr()&&document.addEventListener("freeze",this.onPageLeave),this.setAndEmitConnectionState(vo.Connected),this.emit(Bi.Connected),this.registerConnectionReconcile()})),this.disconnect=function(){for(var A=arguments.length,t=new Array(A),n=0;n<A;n++)t[n]=arguments[n];return Xt(e,[...t],void 0,(function(){var A=this;let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function*(){var t,n,i,r;const s=yield A.disconnectLock.lock();try{if(A.state===vo.Disconnected)return void A.log.debug("already disconnected",A.logContext);A.log.info("disconnect from room",Object.assign({},A.logContext)),(A.state===vo.Connecting||A.state===vo.Reconnecting||A.isResuming)&&(A.log.warn("abort connection attempt",A.logContext),null===(t=A.abortController)||void 0===t||t.abort(),null===(i=null===(n=A.connectFuture)||void 0===n?void 0:n.reject)||void 0===i||i.call(n,new Fi("Client initiated disconnect",ui.Cancelled)),A.connectFuture=void 0),(null===(r=A.engine)||void 0===r?void 0:r.client.isDisconnected)||(yield A.engine.client.sendLeave()),A.engine&&(yield A.engine.close()),A.handleDisconnect(e,YA.CLIENT_INITIATED),A.engine=void 0}finally{s()}}()}))},this.onPageLeave=()=>Xt(this,void 0,void 0,(function*(){this.log.info("Page leave detected, disconnecting",this.logContext),yield this.disconnect()})),this.startAudio=()=>Xt(this,void 0,void 0,(function*(){const A=[],e=Oi();if(e&&"iOS"===e.os){const e="livekit-dummy-audio-el";let t=document.getElementById(e);if(!t){t=document.createElement("audio"),t.id=e,t.autoplay=!0,t.hidden=!0;const A=Sr();A.enabled=!0;const n=new MediaStream([A]);t.srcObject=n,document.addEventListener("visibilitychange",(()=>{t&&(t.srcObject=document.hidden?null:n,document.hidden||(this.log.debug("page visible again, triggering startAudio to resume playback and update playback status",this.logContext),this.startAudio()))})),document.body.append(t),this.once(Bi.Disconnected,(()=>{null==t||t.remove(),t=null}))}A.push(t)}this.remoteParticipants.forEach((e=>{e.audioTrackPublications.forEach((e=>{e.track&&e.track.attachedElements.forEach((e=>{A.push(e)}))}))}));try{yield Promise.all([this.acquireAudioContext(),...A.map((A=>(A.muted=!1,A.play())))]),this.handleAudioPlaybackStarted()}catch(t){throw this.handleAudioPlaybackFailed(t),t}})),this.startVideo=()=>Xt(this,void 0,void 0,(function*(){const A=[];for(const e of this.remoteParticipants.values())e.videoTrackPublications.forEach((e=>{var t;null===(t=e.track)||void 0===t||t.attachedElements.forEach((e=>{A.includes(e)||A.push(e)}))}));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(vo.Reconnecting)&&this.emit(Bi.Reconnecting)},this.handleSignalRestarted=A=>Xt(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(e){this.log.error("error trying to re-publish tracks after reconnection",Object.assign(Object.assign({},this.logContext),{error:e}))}try{yield this.engine.waitForRestarted(),this.log.debug("fully reconnected to server",Object.assign(Object.assign({},this.logContext),{region:A.serverRegion}))}catch(t){return}this.setAndEmitConnectionState(vo.Connected),this.emit(Bi.Reconnected),this.registerConnectionReconcile(),this.emitBufferedEvents()})),this.handleParticipantUpdates=A=>{A.forEach((A=>{var e;if(A.identity===this.localParticipant.identity)return void this.localParticipant.updateInfo(A);""===A.identity&&(A.identity=null!==(e=this.sidToIdentity.get(A.sid))&&void 0!==e?e:"");let t=this.remoteParticipants.get(A.identity);A.state===ne.DISCONNECTED?this.handleParticipantDisconnected(A.identity,t):t=this.getOrCreateParticipant(A.identity,A)}))},this.handleActiveSpeakersUpdate=A=>{const e=[],t={};A.forEach((A=>{if(t[A.sid]=!0,A.sid===this.localParticipant.sid)this.localParticipant.audioLevel=A.level,this.localParticipant.setIsSpeaking(!0),e.push(this.localParticipant);else{const t=this.getRemoteParticipantBySid(A.sid);t&&(t.audioLevel=A.level,t.setIsSpeaking(!0),e.push(t))}})),t[this.localParticipant.sid]||(this.localParticipant.audioLevel=0,this.localParticipant.setIsSpeaking(!1)),this.remoteParticipants.forEach((A=>{t[A.sid]||(A.audioLevel=0,A.setIsSpeaking(!1))})),this.activeSpeakers=e,this.emitWhenConnected(Bi.ActiveSpeakersChanged,e)},this.handleSpeakersChanged=A=>{const e=new Map;this.activeSpeakers.forEach((A=>{const t=this.remoteParticipants.get(A.identity);t&&t.sid!==A.sid||e.set(A.sid,A)})),A.forEach((A=>{let t=this.getRemoteParticipantBySid(A.sid);A.sid===this.localParticipant.sid&&(t=this.localParticipant),t&&(t.audioLevel=A.level,t.setIsSpeaking(A.active),A.active?e.set(A.sid,t):e.delete(A.sid))}));const t=Array.from(e.values());t.sort(((A,e)=>e.audioLevel-A.audioLevel)),this.activeSpeakers=t,this.emitWhenConnected(Bi.ActiveSpeakersChanged,t)},this.handleStreamStateUpdate=A=>{A.streamStates.forEach((A=>{const e=this.getRemoteParticipantBySid(A.participantSid);if(!e)return;const t=e.getTrackPublicationBySid(A.trackSid);if(!t||!t.track)return;const n=Ji.streamStateFromProto(A.state);n!==t.track.streamState&&(t.track.streamState=n,e.emit(vi.TrackStreamStateChanged,t,t.track.streamState),this.emitWhenConnected(Bi.TrackStreamStateChanged,t,t.track.streamState,e))}))},this.handleSubscriptionPermissionUpdate=A=>{const e=this.getRemoteParticipantBySid(A.participantSid);if(!e)return;const t=e.getTrackPublicationBySid(A.trackSid);t&&t.setAllowed(A.allowed)},this.handleSubscriptionError=A=>{const e=Array.from(this.remoteParticipants.values()).find((e=>e.trackPublications.has(A.trackSid)));if(!e)return;const t=e.getTrackPublicationBySid(A.trackSid);t&&t.setSubscriptionError(A.err)},this.handleDataPacket=A=>{const e=this.remoteParticipants.get(A.participantIdentity);if("user"===A.value.case)this.handleUserPacket(e,A.value.value,A.kind);else if("transcription"===A.value.case)this.handleTranscription(e,A.value.value);else if("sipDtmf"===A.value.case)this.handleSipDtmf(e,A.value.value);else if("chatMessage"===A.value.case)this.handleChatMessage(e,A.value.value);else if("metrics"===A.value.case)this.handleMetrics(A.value.value,e);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 e=A.value.value;this.handleIncomingRpcRequest(A.participantIdentity,e.id,e.method,e.payload,e.responseTimeoutMs,e.version)}},this.handleUserPacket=(A,e,t)=>{this.emit(Bi.DataReceived,e.payload,A,t,e.topic),null==A||A.emit(vi.DataReceived,e.payload,t)},this.handleSipDtmf=(A,e)=>{this.emit(Bi.SipDTMFReceived,e,A),null==A||A.emit(vi.SipDTMFReceived,e)},this.bufferedSegments=new Map,this.handleTranscription=(A,e)=>{const t=e.transcribedParticipantIdentity===this.localParticipant.identity?this.localParticipant:this.getParticipantByIdentity(e.transcribedParticipantIdentity),n=null==t?void 0:t.trackPublications.get(e.trackId),i=function(A,e){return A.segments.map((A=>{let{id:t,text:n,language:i,startTime:r,endTime:s,final:o}=A;var a;const c=null!==(a=e.get(t))&&void 0!==a?a:Date.now(),d=Date.now();return o?e.delete(t):e.set(t,c),{id:t,text:n,startTime:Number.parseInt(r.toString()),endTime:Number.parseInt(s.toString()),final:o,language:i,firstReceivedTime:c,lastReceivedTime:d}}))}(e,this.transcriptionReceivedTimes);null==n||n.emit(Qi.TranscriptionReceived,i),null==t||t.emit(vi.TranscriptionReceived,i,n),this.emit(Bi.TranscriptionReceived,i,t,n)},this.handleChatMessage=(A,e)=>{const t=function(A){const{id:e,timestamp:t,message:n,editTimestamp:i}=A;return{id:e,timestamp:Number.parseInt(t.toString()),editTimestamp:i?Number.parseInt(i.toString()):void 0,message:n}}(e);this.emit(Bi.ChatMessage,t,A)},this.handleMetrics=(A,e)=>{this.emit(Bi.MetricsReceived,A,e)},this.handleAudioPlaybackStarted=()=>{this.canPlaybackAudio||(this.audioEnabled=!0,this.emit(Bi.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(Bi.AudioPlaybackStatusChanged,!1))},this.handleVideoPlaybackStarted=()=>{this.isVideoPlaybackBlocked&&(this.isVideoPlaybackBlocked=!1,this.emit(Bi.VideoPlaybackStatusChanged,!0))},this.handleVideoPlaybackFailed=()=>{this.isVideoPlaybackBlocked||(this.isVideoPlaybackBlocked=!0,this.emit(Bi.VideoPlaybackStatusChanged,!1))},this.handleDeviceChange=()=>Xt(this,void 0,void 0,(function*(){var A,e,t;const n=ns.getInstance().previousDevices,i=yield ns.getInstance().getDevices(void 0,!1),r=Oi();if("Chrome"===(null==r?void 0:r.name)&&"iOS"!==r.os)for(let o of i){const A=n.find((A=>A.deviceId===o.deviceId));A&&""!==A.label&&A.kind===o.kind&&A.label!==o.label&&"default"===this.getActiveDevice(o.kind)&&this.emit(Bi.ActiveDeviceChanged,o.kind,o.deviceId)}const s=["audiooutput","audioinput","videoinput"];for(let o of s){const r=Yr(o),s=this.localParticipant.getTrackPublication(r);if(s&&(null===(A=s.track)||void 0===A?void 0:A.isUserProvided))continue;const a=i.filter((A=>A.kind===o)),c=this.getActiveDevice(o);c===(null===(e=n.filter((A=>A.kind===o))[0])||void 0===e?void 0:e.deviceId)&&a.length>0&&(null===(t=a[0])||void 0===t?void 0:t.deviceId)!==c?yield this.switchActiveDevice(o,a[0].deviceId):"audioinput"===o&&!hr()||"videoinput"===o||a.length>0&&!a.find((A=>A.deviceId===this.getActiveDevice(o)))&&(yield this.switchActiveDevice(o,a[0].deviceId))}this.emit(Bi.MediaDevicesChanged)})),this.handleRoomUpdate=A=>{const e=this.roomInfo;this.roomInfo=A,e&&e.metadata!==A.metadata&&this.emitWhenConnected(Bi.RoomMetadataChanged,A.metadata),(null==e?void 0:e.activeRecording)!==A.activeRecording&&this.emitWhenConnected(Bi.RecordingStatusChanged,A.activeRecording)},this.handleConnectionQualityUpdate=A=>{A.updates.forEach((A=>{if(A.participantSid===this.localParticipant.sid)return void this.localParticipant.setConnectionQuality(A.quality);const e=this.getRemoteParticipantBySid(A.participantSid);e&&e.setConnectionQuality(A.quality)}))},this.onLocalParticipantMetadataChanged=A=>{this.emit(Bi.ParticipantMetadataChanged,A,this.localParticipant)},this.onLocalParticipantNameChanged=A=>{this.emit(Bi.ParticipantNameChanged,A,this.localParticipant)},this.onLocalAttributesChanged=A=>{this.emit(Bi.ParticipantAttributesChanged,A,this.localParticipant)},this.onLocalTrackMuted=A=>{this.emit(Bi.TrackMuted,A,this.localParticipant)},this.onLocalTrackUnmuted=A=>{this.emit(Bi.TrackUnmuted,A,this.localParticipant)},this.onTrackProcessorUpdate=A=>{var e;null===(e=null==A?void 0:A.onPublish)||void 0===e||e.call(A,this)},this.onLocalTrackPublished=A=>Xt(this,void 0,void 0,(function*(){var e,t,n,i,r,s;null===(e=A.track)||void 0===e||e.on(Qi.TrackProcessorUpdate,this.onTrackProcessorUpdate),null===(t=A.track)||void 0===t||t.on(Qi.Restarted,this.onLocalTrackRestarted),null===(r=null===(i=null===(n=A.track)||void 0===n?void 0:n.getProcessor())||void 0===i?void 0:i.onPublish)||void 0===r||r.call(i,this),this.emit(Bi.LocalTrackPublished,A,this.localParticipant),Kr(A.track)&&(yield A.track.checkForSilence())&&this.emit(Bi.LocalAudioSilenceDetected,A);const o=yield null===(s=A.track)||void 0===s?void 0:s.getDeviceId(!1),a=qr(A.source);a&&o&&o!==this.localParticipant.activeDeviceMap.get(a)&&(this.localParticipant.activeDeviceMap.set(a,o),this.emit(Bi.ActiveDeviceChanged,a,o))})),this.onLocalTrackUnpublished=A=>{var e,t;null===(e=A.track)||void 0===e||e.off(Qi.TrackProcessorUpdate,this.onTrackProcessorUpdate),null===(t=A.track)||void 0===t||t.off(Qi.Restarted,this.onLocalTrackRestarted),this.emit(Bi.LocalTrackUnpublished,A,this.localParticipant)},this.onLocalTrackRestarted=A=>Xt(this,void 0,void 0,(function*(){const e=yield A.getDeviceId(!1),t=qr(A.source);t&&e&&e!==this.localParticipant.activeDeviceMap.get(t)&&(this.log.debug("local track restarted, setting ".concat(t," ").concat(e," active"),this.logContext),this.localParticipant.activeDeviceMap.set(t,e),this.emit(Bi.ActiveDeviceChanged,t,e))})),this.onLocalConnectionQualityChanged=A=>{this.emit(Bi.ConnectionQualityChanged,A,this.localParticipant)},this.onMediaDevicesError=A=>{this.emit(Bi.MediaDevicesError,A)},this.onLocalParticipantPermissionsChanged=A=>{this.emit(Bi.ParticipantPermissionsChanged,A,this.localParticipant)},this.onLocalChatMessageSent=A=>{this.emit(Bi.ChatMessage,A,this.localParticipant)},this.setMaxListeners(100),this.remoteParticipants=new Map,this.sidToIdentity=new Map,this.options=Object.assign(Object.assign({},xs),A),this.log=Gt(null!==(t=this.options.loggerName)&&void 0!==t?t:Mt.Room),this.transcriptionReceivedTimes=new Map,this.options.audioCaptureDefaults=Object.assign(Object.assign({},Rs),null==A?void 0:A.audioCaptureDefaults),this.options.videoCaptureDefaults=Object.assign(Object.assign({},Ds),null==A?void 0:A.videoCaptureDefaults),this.options.publishDefaults=Object.assign(Object.assign({},Hs),null==A?void 0:A.publishDefaults),this.maybeCreateEngine(),this.disconnectLock=new a,this.localParticipant=new Vo("","",this.engine,this.options,this.rpcHandlers),this.options.videoCaptureDefaults.deviceId&&this.localParticipant.activeDeviceMap.set("videoinput",Pr(this.options.videoCaptureDefaults.deviceId)),this.options.audioCaptureDefaults.deviceId&&this.localParticipant.activeDeviceMap.set("audioinput",Pr(this.options.audioCaptureDefaults.deviceId)),(null===(n=this.options.audioOutput)||void 0===n?void 0:n.deviceId)&&this.switchActiveDevice("audiooutput",Pr(this.options.audioOutput.deviceId)).catch((A=>this.log.warn("Could not set audio output: ".concat(A.message),this.logContext))),this.options.e2ee&&this.setupE2EE(),pr()){const A=new AbortController;null===(i=navigator.mediaDevices)||void 0===i||i.addEventListener("devicechange",this.handleDeviceChange,{signal:A.signal}),Jo.cleanupRegistry&&Jo.cleanupRegistry.register(this,(()=>{A.abort()}))}}registerTextStreamHandler(A,e){if(this.textStreamHandlers.has(A))throw new TypeError('A text stream handler for topic "'.concat(A,'" has already been set.'));this.textStreamHandlers.set(A,e)}unregisterTextStreamHandler(A){this.textStreamHandlers.delete(A)}registerByteStreamHandler(A,e){if(this.byteStreamHandlers.has(A))throw new TypeError('A byte stream handler for topic "'.concat(A,'" has already been set.'));this.byteStreamHandlers.set(A,e)}unregisterByteStreamHandler(A){this.byteStreamHandlers.delete(A)}registerRpcMethod(A,e){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,e)}unregisterRpcMethod(A){this.rpcHandlers.delete(A)}handleIncomingRpcRequest(A,e,t,n,i,r){return Xt(this,void 0,void 0,(function*(){if(yield this.engine.publishRpcAck(A,e),1!==r)return void(yield this.engine.publishRpcResponse(A,e,null,Ks.builtIn("UNSUPPORTED_VERSION")));const s=this.rpcHandlers.get(t);if(!s)return void(yield this.engine.publishRpcResponse(A,e,null,Ks.builtIn("UNSUPPORTED_METHOD")));let o=null,a=null;try{const r=yield s({requestId:e,callerIdentity:A,payload:n,responseTimeout:i});_s(r)>15360?(o=Ks.builtIn("RESPONSE_PAYLOAD_TOO_LARGE"),console.warn("RPC Response payload too large for ".concat(t))):a=r}catch(c){c instanceof Ks?o=c:(console.warn("Uncaught error returned by RPC handler for ".concat(t,". Returning APPLICATION_ERROR instead."),c),o=Ks.builtIn("APPLICATION_ERROR"))}yield this.engine.publishRpcResponse(A,e,a,o)}))}setE2EEEnabled(A){return Xt(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 es(this.options.e2ee),this.e2eeManager.on(ci.ParticipantEncryptionStatusChanged,((A,e)=>{e.isLocal&&(this.isE2EEEnabled=A),this.emit(Bi.ParticipantEncryptionStatusChanged,A,e)})),this.e2eeManager.on(ci.EncryptionError,(A=>this.emit(Bi.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,e;return null!==(e=null===(A=this.roomInfo)||void 0===A?void 0:A.activeRecording)&&void 0!==e&&e}getSid(){return Xt(this,void 0,void 0,(function*(){return this.state===vo.Disconnected?"":this.roomInfo&&""!==this.roomInfo.sid?this.roomInfo.sid:new Promise(((A,e)=>{const t=e=>{""!==e.sid&&(this.engine.off(yi.RoomUpdate,t),A(e.sid))};this.engine.on(yi.RoomUpdate,t),this.once(Bi.Disconnected,(()=>{this.engine.off(yi.RoomUpdate,t),e("Room disconnected before room server id was available")}))}))}))}get name(){var A,e;return null!==(e=null===(A=this.roomInfo)||void 0===A?void 0:A.name)&&void 0!==e?e:""}get metadata(){var A;return null===(A=this.roomInfo)||void 0===A?void 0:A.metadata}get numParticipants(){var A,e;return null!==(e=null===(A=this.roomInfo)||void 0===A?void 0:A.numParticipants)&&void 0!==e?e:0}get numPublishers(){var A,e;return null!==(e=null===(A=this.roomInfo)||void 0===A?void 0:A.numPublishers)&&void 0!==e?e:0}maybeCreateEngine(){this.engine&&!this.engine.isClosed||(this.engine=new Qo(this.options),this.engine.on(yi.ParticipantUpdate,this.handleParticipantUpdates).on(yi.RoomUpdate,this.handleRoomUpdate).on(yi.SpeakersChanged,this.handleSpeakersChanged).on(yi.StreamStateChanged,this.handleStreamStateUpdate).on(yi.ConnectionQualityUpdate,this.handleConnectionQualityUpdate).on(yi.SubscriptionError,this.handleSubscriptionError).on(yi.SubscriptionPermissionUpdate,this.handleSubscriptionPermissionUpdate).on(yi.MediaTrackAdded,((A,e,t)=>{this.onTrackAdded(A,e,t)})).on(yi.Disconnected,(A=>{this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,A)})).on(yi.ActiveSpeakersUpdate,this.handleActiveSpeakersUpdate).on(yi.DataPacketReceived,this.handleDataPacket).on(yi.Resuming,(()=>{this.clearConnectionReconcile(),this.isResuming=!0,this.log.info("Resuming signal connection",this.logContext),this.setAndEmitConnectionState(vo.SignalReconnecting)&&this.emit(Bi.SignalReconnecting)})).on(yi.Resumed,(()=>{this.registerConnectionReconcile(),this.isResuming=!1,this.log.info("Resumed signal connection",this.logContext),this.updateSubscriptions(),this.emitBufferedEvents(),this.setAndEmitConnectionState(vo.Connected)&&this.emit(Bi.Reconnected)})).on(yi.SignalResumed,(()=>{this.bufferedEvents=[],(this.state===vo.Reconnecting||this.isResuming)&&this.sendSyncState()})).on(yi.Restarting,this.handleRestarting).on(yi.SignalRestarted,this.handleSignalRestarted).on(yi.Offline,(()=>{this.setAndEmitConnectionState(vo.Reconnecting)&&this.emit(Bi.Reconnecting)})).on(yi.DCBufferStatusChanged,((A,e)=>{this.emit(Bi.DCBufferStatusChanged,A,e)})).on(yi.LocalTrackSubscribed,(A=>{const e=this.localParticipant.getTrackPublications().find((e=>{let{trackSid:t}=e;return t===A}));e?(this.localParticipant.emit(vi.LocalTrackSubscribed,e),this.emitWhenConnected(Bi.LocalTrackSubscribed,e,this.localParticipant)):this.log.warn("could not find local track subscription for subscribed event",this.logContext)})).on(yi.RoomMoved,(A=>{this.log.debug("room moved",A),A.room&&this.handleRoomUpdate(A.room),this.remoteParticipants.forEach(((A,e)=>{this.handleParticipantDisconnected(e,A)})),this.emit(Bi.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 e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return ns.getInstance().getDevices(A,e)}prepareConnection(A,e){return Xt(this,void 0,void 0,(function*(){if(this.state===vo.Disconnected){this.log.debug("prepareConnection to ".concat(A),this.logContext);try{if(fr(new URL(A))&&e){this.regionUrlProvider=new ko(A,e);const t=yield this.regionUrlProvider.getNextBestRegionUrl();t&&this.state===vo.Disconnected&&(this.regionUrl=t,yield fetch(Hr(t),{method:"HEAD"}),this.log.debug("prepared connection to ".concat(t),this.logContext))}else yield fetch(Hr(A),{method:"HEAD"})}catch(t){this.log.warn("could not prepare connection",Object.assign(Object.assign({},this.logContext),{error:t}))}}}))}getParticipantByIdentity(A){return this.localParticipant.identity===A?this.localParticipant:this.remoteParticipants.get(A)}clearConnectionFutures(){this.connectFuture=void 0}simulateScenario(A,e){return Xt(this,void 0,void 0,(function*(){let t,n=()=>{};switch(A){case"signal-reconnect":yield this.engine.client.handleOnClose("simulate disconnect");break;case"speaker":t=new bt({scenario:{case:"speakerUpdate",value:3}});break;case"node-failure":t=new bt({scenario:{case:"nodeFailure",value:!0}});break;case"server-leave":t=new bt({scenario:{case:"serverLeave",value:!0}});break;case"migration":t=new bt({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=()=>Xt(this,void 0,void 0,(function*(){yield this.engine.client.handleOnClose("simulate resume-disconnect")})),t=new bt({scenario:{case:"disconnectSignalOnResume",value:!0}});break;case"disconnect-signal-on-resume-no-messages":n=()=>Xt(this,void 0,void 0,(function*(){yield this.engine.client.handleOnClose("simulate resume-disconnect")})),t=new bt({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":t=new bt({scenario:{case:"switchCandidateProtocol",value:"force-tls"===A?2:1}}),n=()=>Xt(this,void 0,void 0,(function*(){const A=this.engine.client.onLeave;A&&A(new nt({reason:YA.CLIENT_INITIATED,action:it.RECONNECT}))}));break;case"subscriber-bandwidth":if(void 0===e||"number"!=typeof e)throw new Error("subscriber-bandwidth requires a number as argument");t=new bt({scenario:{case:"subscriberBandwidth",value:xr(e)}});break;case"leave-full-reconnect":t=new bt({scenario:{case:"leaveRequestFullReconnect",value:!0}})}t&&(yield this.engine.client.sendSimulateScenario(t),yield n())}))}get canPlaybackAudio(){return this.audioEnabled}get canPlaybackVideo(){return!this.isVideoPlaybackBlocked}getActiveDevice(A){return this.localParticipant.activeDeviceMap.get(A)}switchActiveDevice(A,e){return Xt(this,arguments,void 0,(function(A,e){var t=this;let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function*(){var i,r,s,o,a,c,d,l;let u=!0,h=!1;const g=n?{exact:e}:e;if("audioinput"===A){h=0===t.localParticipant.audioTrackPublications.size;const e=null!==(i=t.getActiveDevice(A))&&void 0!==i?i:t.options.audioCaptureDefaults.deviceId;t.options.audioCaptureDefaults.deviceId=g;const n=Array.from(t.localParticipant.audioTrackPublications.values()).filter((A=>A.source===Ji.Source.Microphone));try{u=(yield Promise.all(n.map((A=>{var e;return null===(e=A.audioTrack)||void 0===e?void 0:e.setDeviceId(g)})))).every((A=>!0===A))}catch(p){throw t.options.audioCaptureDefaults.deviceId=e,p}}else if("videoinput"===A){h=0===t.localParticipant.videoTrackPublications.size;const e=null!==(r=t.getActiveDevice(A))&&void 0!==r?r:t.options.videoCaptureDefaults.deviceId;t.options.videoCaptureDefaults.deviceId=g;const n=Array.from(t.localParticipant.videoTrackPublications.values()).filter((A=>A.source===Ji.Source.Camera));try{u=(yield Promise.all(n.map((A=>{var e;return null===(e=A.videoTrack)||void 0===e?void 0:e.setDeviceId(g)})))).every((A=>!0===A))}catch(p){throw t.options.videoCaptureDefaults.deviceId=e,p}}else if("audiooutput"===A){if(!lr()&&!t.options.webAudioMix||t.options.webAudioMix&&t.audioContext&&!("setSinkId"in t.audioContext))throw new Error("cannot switch audio output, setSinkId not supported");t.options.webAudioMix&&(e=null!==(s=yield ns.getInstance().normalizeDeviceId("audiooutput",e))&&void 0!==s?s:""),null!==(o=(l=t.options).audioOutput)&&void 0!==o||(l.audioOutput={});const n=null!==(a=t.getActiveDevice(A))&&void 0!==a?a:t.options.audioOutput.deviceId;t.options.audioOutput.deviceId=e;try{t.options.webAudioMix&&(null===(c=t.audioContext)||void 0===c||c.setSinkId(e)),yield Promise.all(Array.from(t.remoteParticipants.values()).map((A=>A.setAudioOutput({deviceId:e}))))}catch(p){throw t.options.audioOutput.deviceId=n,p}}return(h||"audiooutput"===A)&&(t.localParticipant.activeDeviceMap.set(A,"audiooutput"===A&&(null===(d=t.options.audioOutput)||void 0===d?void 0:d.deviceId)||e),t.emit(Bi.ActiveDeviceChanged,A,e)),u}()}))}setupLocalParticipantEvents(){this.localParticipant.on(vi.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).on(vi.ParticipantNameChanged,this.onLocalParticipantNameChanged).on(vi.AttributesChanged,this.onLocalAttributesChanged).on(vi.TrackMuted,this.onLocalTrackMuted).on(vi.TrackUnmuted,this.onLocalTrackUnmuted).on(vi.LocalTrackPublished,this.onLocalTrackPublished).on(vi.LocalTrackUnpublished,this.onLocalTrackUnpublished).on(vi.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).on(vi.MediaDevicesError,this.onMediaDevicesError).on(vi.AudioStreamAcquired,this.startAudio).on(vi.ChatMessage,this.onLocalChatMessageSent).on(vi.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,e,t){if(this.state===vo.Connecting||this.state===vo.Reconnecting){const n=()=>{this.onTrackAdded(A,e,t),i()},i=()=>{this.off(Bi.Reconnected,n),this.off(Bi.Connected,n),this.off(Bi.Disconnected,i)};return this.once(Bi.Reconnected,n),this.once(Bi.Connected,n),void this.once(Bi.Disconnected,i)}if(this.state===vo.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 n=function(A){const e=A.split("|");return e.length>1?[e[0],A.substr(e[0].length+1)]:[A,""]}(e.id),i=n[0];let r=n[1],s=A.id;if(r&&r.startsWith("TR")&&(s=r),i===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===i));if(!o)return void this.log.error("Tried to add a track for a participant, that's not present. Sid: ".concat(i),this.logContext);let a;this.options.adaptiveStream&&(a="object"==typeof this.options.adaptiveStream?this.options.adaptiveStream:{}),o.addSubscribedMediaTrack(A,s,e,t,a)}handleDisconnect(){let A=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1?arguments[1]:void 0;var t;if(this.clearConnectionReconcile(),this.isResuming=!1,this.bufferedEvents=[],this.transcriptionReceivedTimes.clear(),this.state!==vo.Disconnected){this.regionUrl=void 0;try{this.remoteParticipants.forEach((A=>{A.trackPublications.forEach((e=>{A.unpublishTrack(e.trackSid)}))})),this.localParticipant.trackPublications.forEach((e=>{var t,n,i;e.track&&this.localParticipant.unpublishTrack(e.track,A),A?(null===(t=e.track)||void 0===t||t.detach(),null===(n=e.track)||void 0===n||n.stop()):null===(i=e.track)||void 0===i||i.stopMonitor()})),this.localParticipant.off(vi.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).off(vi.ParticipantNameChanged,this.onLocalParticipantNameChanged).off(vi.AttributesChanged,this.onLocalAttributesChanged).off(vi.TrackMuted,this.onLocalTrackMuted).off(vi.TrackUnmuted,this.onLocalTrackUnmuted).off(vi.LocalTrackPublished,this.onLocalTrackPublished).off(vi.LocalTrackUnpublished,this.onLocalTrackUnpublished).off(vi.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).off(vi.MediaDevicesError,this.onMediaDevicesError).off(vi.AudioStreamAcquired,this.startAudio).off(vi.ChatMessage,this.onLocalChatMessageSent).off(vi.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),pr()&&(window.removeEventListener("beforeunload",this.onPageLeave),window.removeEventListener("pagehide",this.onPageLeave),window.removeEventListener("freeze",this.onPageLeave),null===(t=navigator.mediaDevices)||void 0===t||t.removeEventListener("devicechange",this.handleDeviceChange))}finally{this.setAndEmitConnectionState(vo.Disconnected),this.emit(Bi.Disconnected,e)}}}handleParticipantDisconnected(A,e){var t;this.remoteParticipants.delete(A),e&&(e.trackPublications.forEach((A=>{e.unpublishTrack(A.trackSid,!0)})),this.emit(Bi.ParticipantDisconnected,e),e.setDisconnected(),null===(t=this.localParticipant)||void 0===t||t.handleParticipantDisconnected(e.identity))}handleStreamHeader(A,e){return Xt(this,void 0,void 0,(function*(){var t;if("byteHeader"===A.contentHeader.case){const n=this.byteStreamHandlers.get(A.topic);if(!n)return void this.log.debug("ignoring incoming byte stream due to no handler for topic",A.topic);let i;const r={id:A.streamId,name:null!==(t=A.contentHeader.value.name)&&void 0!==t?t:"unknown",mimeType:A.mimeType,size:A.totalLength?Number(A.totalLength):void 0,topic:A.topic,timestamp:Dr(A.timestamp),attributes:A.attributes},s=new ReadableStream({start:e=>{i=e,this.byteStreamControllers.set(A.streamId,{info:r,controller:i,startTime:Date.now()})}});n(new Fo(r,s,Dr(A.totalLength)),{identity:e})}else if("textHeader"===A.contentHeader.case){const t=this.textStreamHandlers.get(A.topic);if(!t)return void this.log.debug("ignoring incoming text stream due to no handler for topic",A.topic);let n;const i={id:A.streamId,mimeType:A.mimeType,size:A.totalLength?Number(A.totalLength):void 0,topic:A.topic,timestamp:Number(A.timestamp),attributes:A.attributes},r=new ReadableStream({start:e=>{n=e,this.textStreamControllers.set(A.streamId,{info:i,controller:n,startTime:Date.now()})}});t(new To(i,r,Dr(A.totalLength)),{identity:e})}}))}handleStreamChunk(A){const e=this.byteStreamControllers.get(A.streamId);e&&A.content.length>0&&e.controller.enqueue(A);const t=this.textStreamControllers.get(A.streamId);t&&A.content.length>0&&t.controller.enqueue(A)}handleStreamTrailer(A){const e=this.textStreamControllers.get(A.streamId);e&&(e.info.attributes=Object.assign(Object.assign({},e.info.attributes),A.attributes),e.controller.close(),this.textStreamControllers.delete(A.streamId));const t=this.byteStreamControllers.get(A.streamId);t&&(t.info.attributes=Object.assign(Object.assign({},t.info.attributes),A.attributes),t.controller.close(),this.byteStreamControllers.delete(A.streamId))}acquireAudioContext(){return Xt(this,void 0,void 0,(function*(){var A,e;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=Xr())&&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(),or(200)])}catch(n){this.log.warn("Could not resume audio context",Object.assign(Object.assign({},this.logContext),{error:n}))}const t="running"===(null===(e=this.audioContext)||void 0===e?void 0:e.state);t!==this.canPlaybackAudio&&(this.audioEnabled=t,this.emit(Bi.AudioPlaybackStatusChanged,t))}))}createParticipant(A,e){var t;let n;return n=e?jo.fromParticipantInfo(this.engine.client,e,{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&&n.setAudioContext(this.audioContext),(null===(t=this.options.audioOutput)||void 0===t?void 0:t.deviceId)&&n.setAudioOutput(this.options.audioOutput).catch((A=>this.log.warn("Could not set audio output: ".concat(A.message),this.logContext))),n}getOrCreateParticipant(A,e){if(this.remoteParticipants.has(A)){const t=this.remoteParticipants.get(A);return e&&t.updateInfo(e)&&this.sidToIdentity.set(e.sid,e.identity),t}const t=this.createParticipant(A,e);return this.remoteParticipants.set(A,t),this.sidToIdentity.set(e.sid,e.identity),this.emitWhenConnected(Bi.ParticipantConnected,t),t.on(vi.TrackPublished,(A=>{this.emitWhenConnected(Bi.TrackPublished,A,t)})).on(vi.TrackSubscribed,((A,e)=>{A.kind===Ji.Kind.Audio?(A.on(Qi.AudioPlaybackStarted,this.handleAudioPlaybackStarted),A.on(Qi.AudioPlaybackFailed,this.handleAudioPlaybackFailed)):A.kind===Ji.Kind.Video&&(A.on(Qi.VideoPlaybackFailed,this.handleVideoPlaybackFailed),A.on(Qi.VideoPlaybackStarted,this.handleVideoPlaybackStarted)),this.emit(Bi.TrackSubscribed,A,e,t)})).on(vi.TrackUnpublished,(A=>{this.emit(Bi.TrackUnpublished,A,t)})).on(vi.TrackUnsubscribed,((A,e)=>{this.emit(Bi.TrackUnsubscribed,A,e,t)})).on(vi.TrackMuted,(A=>{this.emitWhenConnected(Bi.TrackMuted,A,t)})).on(vi.TrackUnmuted,(A=>{this.emitWhenConnected(Bi.TrackUnmuted,A,t)})).on(vi.ParticipantMetadataChanged,(A=>{this.emitWhenConnected(Bi.ParticipantMetadataChanged,A,t)})).on(vi.ParticipantNameChanged,(A=>{this.emitWhenConnected(Bi.ParticipantNameChanged,A,t)})).on(vi.AttributesChanged,(A=>{this.emitWhenConnected(Bi.ParticipantAttributesChanged,A,t)})).on(vi.ConnectionQualityChanged,(A=>{this.emitWhenConnected(Bi.ConnectionQualityChanged,A,t)})).on(vi.ParticipantPermissionsChanged,(A=>{this.emitWhenConnected(Bi.ParticipantPermissionsChanged,A,t)})).on(vi.TrackSubscriptionStatusChanged,((A,e)=>{this.emitWhenConnected(Bi.TrackSubscriptionStatusChanged,A,e,t)})).on(vi.TrackSubscriptionFailed,((A,e)=>{this.emit(Bi.TrackSubscriptionFailed,A,t,e)})).on(vi.TrackSubscriptionPermissionChanged,((A,e)=>{this.emitWhenConnected(Bi.TrackSubscriptionPermissionChanged,A,e,t)})).on(vi.Active,(()=>{this.emitWhenConnected(Bi.ParticipantActive,t)})),e&&t.updateInfo(e),t}sendSyncState(){const A=Array.from(this.remoteParticipants.values()).reduce(((A,e)=>(A.push(...e.getTrackPublications()),A)),[]),e=this.localParticipant.getTrackPublications();this.engine.sendSyncState(A,e)}updateSubscriptions(){for(const A of this.remoteParticipants.values())for(const e of A.videoTrackPublications.values())e.isSubscribed&&Vr(e)&&e.emitTrackUpdate()}getRemoteParticipantBySid(A){const e=this.sidToIdentity.get(A);if(e)return this.remoteParticipants.get(e)}registerConnectionReconcile(){this.clearConnectionReconcile();let A=0;this.connectionReconcileInterval=_i.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,YA.STATE_MISMATCH)))}),4e3)}clearConnectionReconcile(){this.connectionReconcileInterval&&_i.clearInterval(this.connectionReconcileInterval)}setAndEmitConnectionState(A){return A!==this.state&&(this.state=A,this.emit(Bi.ConnectionStateChanged,this.state),!0)}emitBufferedEvents(){this.bufferedEvents.forEach((A=>{let[e,t]=A;this.emit(e,...t)})),this.bufferedEvents=[]}emitWhenConnected(A){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];if(this.state===vo.Reconnecting||this.isResuming||!this.engine||this.engine.pendingReconnect)this.bufferedEvents.push([A,t]);else if(this.state===vo.Connected)return this.emit(A,...t);return!1}simulateParticipants(A){return Xt(this,void 0,void 0,(function*(){var e,t;const n=Object.assign({audio:!0,video:!0,useRealTracks:!1},A.publish),i=Object.assign({count:9,audio:!1,video:!0,aspectRatios:[1.66,1.7,1.3]},A.participants);if(this.handleDisconnect(),this.roomInfo=new zA({sid:"RM_SIMULATED",name:"simulated-room",emptyTimeout:0,maxParticipants:0,creationTime:F.parse((new Date).getTime()),metadata:"",numParticipants:1,numPublishers:1,turnPassword:"",enabledCodecs:[],activeRecording:!1}),this.localParticipant.updateInfo(new te({identity:"simulated-local",name:"local-name"})),this.setupLocalParticipantEvents(),this.emit(Bi.SignalConnected),this.emit(Bi.Connected),this.setAndEmitConnectionState(vo.Connected),n.video){const A=new No(Ji.Kind.Video,new ae({source:jA.CAMERA,sid:Math.floor(1e4*Math.random()).toString(),type:GA.AUDIO,name:"video-dummy"}),new ro(n.useRealTracks?(yield window.navigator.mediaDevices.getUserMedia({video:!0})).getVideoTracks()[0]:Fr(160*(null!==(e=i.aspectRatios[0])&&void 0!==e?e: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(vi.LocalTrackPublished,A)}if(n.audio){const A=new No(Ji.Kind.Audio,new ae({source:jA.MICROPHONE,sid:Math.floor(1e4*Math.random()).toString(),type:GA.AUDIO}),new Ws(n.useRealTracks?(yield navigator.mediaDevices.getUserMedia({audio:!0})).getAudioTracks()[0]:Sr(),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(vi.LocalTrackPublished,A)}for(let A=0;A<i.count-1;A+=1){let e=new te({sid:Math.floor(1e4*Math.random()).toString(),identity:"simulated-".concat(A),state:ne.ACTIVE,tracks:[],joinedAt:F.parse(Date.now())});const n=this.getOrCreateParticipant(e.identity,e);if(i.video){const r=Fr(160*(null!==(t=i.aspectRatios[A%i.aspectRatios.length])&&void 0!==t?t:1),160,!1,!0),s=new ae({source:jA.CAMERA,sid:Math.floor(1e4*Math.random()).toString(),type:GA.AUDIO});n.addSubscribedMediaTrack(r,s.sid,new MediaStream([r]),new RTCRtpReceiver),e.tracks=[...e.tracks,s]}if(i.audio){const A=Sr(),t=new ae({source:jA.MICROPHONE,sid:Math.floor(1e4*Math.random()).toString(),type:GA.AUDIO});n.addSubscribedMediaTrack(A,t.sid,new MediaStream([A]),new RTCRtpReceiver),e.tracks=[...e.tracks,t]}n.updateInfo(e)}}))}emit(A){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];if(A!==Bi.ActiveSpeakersChanged&&A!==Bi.TranscriptionReceived){const e=Wo(t).filter((A=>void 0!==A));this.log.debug("room event ".concat(A),Object.assign(Object.assign({},this.logContext),{event:A,args:e}))}return super.emit(A,...t)}}function Wo(A){return A.map((A=>{if(A)return Array.isArray(A)?Wo(A):"object"==typeof A?"logContext"in A?A.logContext:void 0:A}))}Jo.cleanupRegistry="undefined"!=typeof FinalizationRegistry&&new FinalizationRegistry((A=>{A()})),(bo=yo||(yo={}))[bo.IDLE=0]="IDLE",bo[bo.RUNNING=1]="RUNNING",bo[bo.SKIPPED=2]="SKIPPED",bo[bo.SUCCESS=3]="SUCCESS",bo[bo.FAILED=4]="FAILED",Zt.EventEmitter,Zt.EventEmitter;const Xo=Symbol.for("@ts-pattern/matcher"),Yo=Symbol.for("@ts-pattern/isVariadic"),qo="@ts-pattern/anonymous-select-key",$o=A=>Boolean(A&&"object"==typeof A),Zo=A=>A&&!!A[Xo],zo=(A,e,t)=>{if(Zo(A)){const n=A[Xo](),{matched:i,selections:r}=n.match(e);return i&&r&&Object.keys(r).forEach((A=>t(A,r[A]))),i}if($o(A)){if(!$o(e))return!1;if(Array.isArray(A)){if(!Array.isArray(e))return!1;let n=[],i=[],r=[];for(const e of A.keys()){const t=A[e];Zo(t)&&t[Yo]?r.push(t):r.length?i.push(t):n.push(t)}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 A=e.slice(0,n.length),s=0===i.length?[]:e.slice(-i.length),o=e.slice(n.length,0===i.length?1/0:-i.length);return n.every(((e,n)=>zo(e,A[n],t)))&&i.every(((A,e)=>zo(A,s[e],t)))&&(0===r.length||zo(r[0],o,t))}return A.length===e.length&&A.every(((A,n)=>zo(A,e[n],t)))}return Reflect.ownKeys(A).every((n=>{const i=A[n];return(n in e||Zo(r=i)&&"optional"===r[Xo]().matcherType)&&zo(i,e[n],t);var r}))}return Object.is(e,A)},Aa=A=>{var e,t,n;return $o(A)?Zo(A)?null!=(e=null==(t=(n=A[Xo]()).getSelectionKeys)?void 0:t.call(n))?e:[]:Array.isArray(A)?ea(A,Aa):ea(Object.values(A),Aa):[]},ea=(A,e)=>A.reduce(((A,t)=>A.concat(e(t))),[]);function ta(A){return Object.assign(A,{optional:()=>ia(A),and:e=>oa(A,e),or:e=>aa(A,e),select:e=>void 0===e?da(A):da(e,A)})}function na(A){return Object.assign((e=A,Object.assign(e,{[Symbol.iterator](){let A=0;const t=[{value:Object.assign(e,{[Yo]:!0}),done:!1},{done:!0,value:void 0}];return{next:()=>{var e;return null!=(e=t[A++])?e:t.at(-1)}}}})),{optional:()=>na(ia(A)),select:e=>na(void 0===e?da(A):da(e,A))});var e}function ia(A){return ta({[Xo]:()=>({match:e=>{let t={};const n=(A,e)=>{t[A]=e};return void 0===e?(Aa(A).forEach((A=>n(A,void 0))),{matched:!0,selections:t}):{matched:zo(A,e,n),selections:t}},getSelectionKeys:()=>Aa(A),matcherType:"optional"})})}const ra=(A,e)=>{for(const t of A)if(!e(t))return!1;return!0},sa=(A,e)=>{for(const[t,n]of A.entries())if(!e(n,t))return!1;return!0};function oa(...A){return ta({[Xo]:()=>({match:e=>{let t={};const n=(A,e)=>{t[A]=e};return{matched:A.every((A=>zo(A,e,n))),selections:t}},getSelectionKeys:()=>ea(A,Aa),matcherType:"and"})})}function aa(...A){return ta({[Xo]:()=>({match:e=>{let t={};const n=(A,e)=>{t[A]=e};return ea(A,Aa).forEach((A=>n(A,void 0))),{matched:A.some((A=>zo(A,e,n))),selections:t}},getSelectionKeys:()=>ea(A,Aa),matcherType:"or"})})}function ca(A){return{[Xo]:()=>({match:e=>({matched:Boolean(A(e))})})}}function da(...A){const e="string"==typeof A[0]?A[0]:void 0,t=2===A.length?A[1]:"string"==typeof A[0]?void 0:A[0];return ta({[Xo]:()=>({match:A=>{let n={[null!=e?e:qo]:A};return{matched:void 0===t||zo(t,A,((A,e)=>{n[A]=e})),selections:n}},getSelectionKeys:()=>[null!=e?e:qo].concat(void 0===t?[]:Aa(t))})})}function la(A){return"number"==typeof A}function ua(A){return"string"==typeof A}function ha(A){return"bigint"==typeof A}const ga=ta(ca((function(A){return!0}))),pa=ga,ma=A=>Object.assign(ta(A),{startsWith:e=>{return ma(oa(A,(t=e,ca((A=>ua(A)&&A.startsWith(t))))));var t},endsWith:e=>{return ma(oa(A,(t=e,ca((A=>ua(A)&&A.endsWith(t))))));var t},minLength:e=>{return ma(oa(A,(t=e,ca((A=>ua(A)&&A.length>=t)))));var t},length:e=>{return ma(oa(A,(t=e,ca((A=>ua(A)&&A.length===t)))));var t},maxLength:e=>{return ma(oa(A,(t=e,ca((A=>ua(A)&&A.length<=t)))));var t},includes:e=>{return ma(oa(A,(t=e,ca((A=>ua(A)&&A.includes(t))))));var t},regex:e=>{return ma(oa(A,(t=e,ca((A=>ua(A)&&Boolean(A.match(t)))))));var t}}),fa=ma(ca(ua)),Ba=A=>Object.assign(ta(A),{between:(e,t)=>{return Ba(oa(A,(n=e,i=t,ca((A=>la(A)&&n<=A&&i>=A)))));var n,i},lt:e=>{return Ba(oa(A,(t=e,ca((A=>la(A)&&A<t)))));var t},gt:e=>{return Ba(oa(A,(t=e,ca((A=>la(A)&&A>t)))));var t},lte:e=>{return Ba(oa(A,(t=e,ca((A=>la(A)&&A<=t)))));var t},gte:e=>{return Ba(oa(A,(t=e,ca((A=>la(A)&&A>=t)))));var t},int:()=>Ba(oa(A,ca((A=>la(A)&&Number.isInteger(A))))),finite:()=>Ba(oa(A,ca((A=>la(A)&&Number.isFinite(A))))),positive:()=>Ba(oa(A,ca((A=>la(A)&&A>0)))),negative:()=>Ba(oa(A,ca((A=>la(A)&&A<0))))}),wa=Ba(ca(la)),va=A=>Object.assign(ta(A),{between:(e,t)=>{return va(oa(A,(n=e,i=t,ca((A=>ha(A)&&n<=A&&i>=A)))));var n,i},lt:e=>{return va(oa(A,(t=e,ca((A=>ha(A)&&A<t)))));var t},gt:e=>{return va(oa(A,(t=e,ca((A=>ha(A)&&A>t)))));var t},lte:e=>{return va(oa(A,(t=e,ca((A=>ha(A)&&A<=t)))));var t},gte:e=>{return va(oa(A,(t=e,ca((A=>ha(A)&&A>=t)))));var t},positive:()=>va(oa(A,ca((A=>ha(A)&&A>0)))),negative:()=>va(oa(A,ca((A=>ha(A)&&A<0))))}),Ca=va(ca(ha)),ya=ta(ca((function(A){return"boolean"==typeof A}))),ba=ta(ca((function(A){return"symbol"==typeof A}))),Qa=ta(ca((function(A){return null==A}))),Ua=ta(ca((function(A){return null!=A})));var ka={__proto__:null,matcher:Xo,optional:ia,array:function(...A){return na({[Xo]:()=>({match:e=>{if(!Array.isArray(e))return{matched:!1};if(0===A.length)return{matched:!0};const t=A[0];let n={};if(0===e.length)return Aa(t).forEach((A=>{n[A]=[]})),{matched:!0,selections:n};const i=(A,e)=>{n[A]=(n[A]||[]).concat([e])};return{matched:e.every((A=>zo(t,A,i))),selections:n}},getSelectionKeys:()=>0===A.length?[]:Aa(A[0])})})},set:function(...A){return ta({[Xo]:()=>({match:e=>{if(!(e instanceof Set))return{matched:!1};let t={};if(0===e.size)return{matched:!0,selections:t};if(0===A.length)return{matched:!0};const n=(A,e)=>{t[A]=(t[A]||[]).concat([e])},i=A[0];return{matched:ra(e,(A=>zo(i,A,n))),selections:t}},getSelectionKeys:()=>0===A.length?[]:Aa(A[0])})})},map:function(...A){return ta({[Xo]:()=>({match:e=>{if(!(e instanceof Map))return{matched:!1};let t={};if(0===e.size)return{matched:!0,selections:t};const n=(A,e)=>{t[A]=(t[A]||[]).concat([e])};if(0===A.length)return{matched:!0};var i;if(1===A.length)throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${null==(i=A[0])?void 0:i.toString()}`);const[r,s]=A;return{matched:sa(e,((A,e)=>{const t=zo(r,e,n),i=zo(s,A,n);return t&&i})),selections:t}},getSelectionKeys:()=>0===A.length?[]:[...Aa(A[0]),...Aa(A[1])]})})},intersection:oa,union:aa,not:function(A){return ta({[Xo]:()=>({match:e=>({matched:!zo(A,e,(()=>{}))}),getSelectionKeys:()=>[],matcherType:"not"})})},when:ca,select:da,any:ga,_:pa,string:fa,number:wa,bigint:Ca,boolean:ya,symbol:ba,nullish:Qa,nonNullable:Ua,instanceOf:function(A){return ta(ca((e=A,A=>A instanceof e)));var e},shape:function(A){return ta(ca(function(...A){if(1===A.length){const[e]=A;return A=>zo(e,A,(()=>{}))}if(2===A.length){const[e,t]=A;return zo(e,t,(()=>{}))}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${A.length}.`)}(A)))}};class Ea extends Error{constructor(A){let e;try{e=JSON.stringify(A)}catch(t){e=A}super(`Pattern matching error: no pattern matches value ${e}`),this.input=void 0,this.input=A}}const Fa={matched:!1,value:void 0};function Ta(A){return new Sa(A,Fa)}let Sa=class A{constructor(A,e){this.input=void 0,this.state=void 0,this.input=A,this.state=e}with(...e){if(this.state.matched)return this;const t=e[e.length-1],n=[e[0]];let i;3===e.length&&"function"==typeof e[1]?i=e[1]:e.length>2&&n.push(...e.slice(1,e.length-1));let r=!1,s={};const o=(A,e)=>{r=!0,s[A]=e},a=!n.some((A=>zo(A,this.input,o)))||i&&!Boolean(i(this.input))?Fa:{matched:!0,value:t(r?qo in s?s[qo]:s:this.input,this.input)};return new A(this.input,a)}when(e,t){if(this.state.matched)return this;const n=Boolean(e(this.input));return new A(this.input,n?{matched:!0,value:t(this.input,this.input)}:Fa)}otherwise(A){return this.state.matched?this.state.value:A(this.input)}exhaustive(A=Ia){return this.state.matched?this.state.value:A(this.input)}run(){return this.exhaustive()}returnType(){return this}};function Ia(A){throw new Ea(A)}var Pa,Ha;(Ha=Pa||(Pa={})).READY="ready",Ha.ERROR="error",Ha.PAUSED="paused",Ha.LOADING="loading",Ha.THINKING="thinking",Ha.RESEARCHING="researching",Ha.AGENT_SPEAKING="agent_speaking",Ha.USER_SPEAKING="user_speaking",Ha.AWAITING_USER_INPUT="awaiting_user_input";class Ra{constructor({sessionId:A,apiBaseUrl:e}){this.currentState=Pa.READY,this.assistantAudioContext=null,this.userAudioContext=null,this._assistantAudioTimer=null,this._userAudioTimer=null,this.sessionId=A,this.apiBaseUrl=e||"https://obi.getcor.io/api",this.emitter=new i}emit(A,e){this.emitter.emit(A,e)}on(A,e){this.emitter.on(A,e)}off(A,e){this.emitter.off(A,e)}setupRoomEventListeners(){this.room&&(this.room.on(Bi.LocalTrackUnpublished,(A=>{A.source===Ji.Source.ScreenShare&&(this.screenStream=void 0)})),this.room.on(Bi.Disconnected,(()=>{console.log("Room disconnected"),this.disconnect()})),this.room.on(Bi.ParticipantDisconnected,(()=>{this.disconnect()})),this.room.on(Bi.TrackSubscribed,((A,e,t)=>{if("audio"===A.kind&&A.attach(),A.source===Ji.Source.Microphone&&t.identity.includes("agent-")){const e=A.mediaStream;if(!e)return void console.error("No media stream available for assistant track");const t=new AudioContext,n=t.createAnalyser();t.createMediaStreamSource(e).connect(n),n.fftSize=2048;const i=new Uint8Array(n.frequencyBinCount);this.analyzeAudio(n,i,"ASSISTANT"),this.assistantAudioContext=t}})),this.room.on(Bi.ParticipantAttributesChanged,(A=>{if(!A["lk.agent.state"])return;if(this.currentState===Pa.RESEARCHING||this.currentState===Pa.PAUSED)return;const e=Ta(A["lk.agent.state"]).with("listening",(()=>Pa.USER_SPEAKING)).with("speaking",(()=>Pa.AGENT_SPEAKING)).with("thinking",(()=>Pa.AGENT_SPEAKING)).otherwise((()=>{}));e&&this.setState(e)})),this.room.on(Bi.DataReceived,(async A=>{try{const e=JSON.parse((new TextDecoder).decode(A));Ta(e.status||e.request).with("using_tool",(()=>{this.currentState=Pa.RESEARCHING,this.emitter.emit("stateChanged",Pa.RESEARCHING)})).with("using_tool_ended",(()=>{this.currentState=Pa.AGENT_SPEAKING,this.emitter.emit("stateChanged",Pa.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",e.value)})).otherwise((()=>{console.warn("Unknown data received:",e)}))}catch(e){console.error("Error parsing data:",e)}})),this.room.localParticipant.registerRpcMethod("screen_capture",(async A=>(this.emitter.emit("screenCaptureRequested"),new Promise((A=>{this.emitter.once("screenCaptureComplete",(async e=>{if("error"!==e)try{await this.room.localParticipant.sendFile(new File([e],"screen_capture.png",{type:"image/png"}),{mimeType:"image/png",topic:"screen_capture"}),A("ok")}catch(t){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 Jo({adaptiveStream:!0,dynacast:!0}),this.setupRoomEventListeners();const A=new URLSearchParams({token:this.sessionId,skip_intro:"true"}),e=`${this.apiBaseUrl}/join-token?${A.toString()}`,t=await fetch(e).then((A=>A.json()));if(await this.room.connect(t.url,t.token),this.microphoneStream){const A=this.microphoneStream.getAudioTracks()[0];await this.room.localParticipant.publishTrack(A,{name:"microphone",source:Ji.Source.Microphone})}return{url:t.url,token:t.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._userAudioTimer&&(window.clearTimeout(this._userAudioTimer),this._userAudioTimer=null),this._assistantAudioTimer&&(window.clearTimeout(this._assistantAudioTimer),this._assistantAudioTimer=null),await(this.userAudioContext?.close().catch((()=>{}))),this.userAudioContext=null,await(this.assistantAudioContext?.close().catch((()=>{}))),this.assistantAudioContext=null,this.setState(Pa.READY)}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 e=new AudioContext;this.userAudioContext=e;const t=e.createAnalyser(),n=e.createMediaStreamSource(A),i=e.createGain();i.gain.value=1.5,n.connect(i),i.connect(t),t.fftSize=2048;const r=new Uint8Array(t.frequencyBinCount);this.analyzeAudio(t,r,"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(Pa.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(Pa.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,e,t){if("USER"===t&&this.currentState===Pa.USER_SPEAKING||"ASSISTANT"===t&&this.currentState===Pa.AGENT_SPEAKING){A.getByteFrequencyData(e);const n=e.reduce(((A,e)=>A+e),0)/e.length,i=Math.max(.01,Math.min(1,n/128));let r;"USER"===t&&this.currentState===Pa.USER_SPEAKING?r="USER":"ASSISTANT"===t&&this.currentState===Pa.AGENT_SPEAKING&&(r="ASSISTANT"),r&&this.emitter.emit("volume",{speaker:r,spectrum:Array.from(e),volume:i})}"USER"===t?this._userAudioTimer=window.setTimeout((()=>this.analyzeAudio(A,e,t)),200):this._assistantAudioTimer=window.setTimeout((()=>this.analyzeAudio(A,e,t)),200)}async sendHTML(A){if(this.room)try{const e={type:"page_content",html:A,timestamp:(new Date).toISOString()},t=JSON.stringify(e),n=(new TextEncoder).encode(t);await this.room.localParticipant.publishData(n,{reliable:!0})}catch(e){console.error("Error sending HTML to LiveKit:",e),this.emitter.emit("error",e instanceof Error?e:new Error(String(e)))}else console.log("Cannot send HTML: Not connected to room")}async reconnect(A,e,t){try{if(!A||!e)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 Jo({adaptiveStream:!0,dynacast:!0}),this.setupRoomEventListeners(),await this.room.connect(A,e),this.microphoneStream){const A=this.microphoneStream.getAudioTracks()[0];await this.room.localParticipant.publishTrack(A,{name:"microphone",source:Ji.Source.Microphone})}return this.setState(t),t===Pa.PAUSED&&this.pauseRecording(),!0}catch(n){return console.error("Failed to reconnect to room:",n),this.disconnect(),this.emitter.emit("error",n instanceof Error?n:new Error(String(n))),!1}}}var Da=function(A,e){return(Da=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(A[t]=e[t])})(A,e)};function xa(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=A}Da(A,e),A.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}var La=function(){return La=Object.assign||function(A){for(var e,t=1,n=arguments.length;t<n;t++)for(var i in e=arguments[t])Object.prototype.hasOwnProperty.call(e,i)&&(A[i]=e[i]);return A},La.apply(this,arguments)};function Oa(A,e,t,n){return new(t||(t=Promise))((function(i,r){function s(A){try{a(n.next(A))}catch(e){r(e)}}function o(A){try{a(n.throw(A))}catch(e){r(e)}}function a(A){var e;A.done?i(A.value):(e=A.value,e instanceof t?e:new t((function(A){A(e)}))).then(s,o)}a((n=n.apply(A,e||[])).next())}))}function Ma(A,e){var t,n,i,r,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function o(o){return function(a){return function(o){if(t)throw new TypeError("Generator is already executing.");for(;r&&(r=0,o[0]&&(s=0)),s;)try{if(t=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(A,s)}catch(a){o=[6,a],n=0}finally{t=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function Na(A,e,t){if(t||2===arguments.length)for(var n,i=0,r=e.length;i<r;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return A.concat(n||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;for(var Ka=function(){function A(A,e,t,n){this.left=A,this.top=e,this.width=t,this.height=n}return A.prototype.add=function(e,t,n,i){return new A(this.left+e,this.top+t,this.width+n,this.height+i)},A.fromClientRect=function(e,t){return new A(t.left+e.windowBounds.left,t.top+e.windowBounds.top,t.width,t.height)},A.fromDOMRectList=function(e,t){var n=Array.from(t).find((function(A){return 0!==A.width}));return n?new A(n.left+e.windowBounds.left,n.top+e.windowBounds.top,n.width,n.height):A.EMPTY},A.EMPTY=new A(0,0,0,0),A}(),_a=function(A,e){return Ka.fromClientRect(A,e.getBoundingClientRect())},Va=function(A){for(var e=[],t=0,n=A.length;t<n;){var i=A.charCodeAt(t++);if(i>=55296&&i<=56319&&t<n){var r=A.charCodeAt(t++);56320==(64512&r)?e.push(((1023&i)<<10)+(1023&r)+65536):(e.push(i),t--)}else e.push(i)}return e},Ga=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,A);var t=A.length;if(!t)return"";for(var n=[],i=-1,r="";++i<t;){var s=A[i];s<=65535?n.push(s):(s-=65536,n.push(55296+(s>>10),s%1024+56320)),(i+1===t||n.length>16384)&&(r+=String.fromCharCode.apply(String,n),n.length=0)}return r},ja="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ja=0;Ja<64;Ja++)ja["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(Ja)]=Ja;for(var Wa="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Xa=0;Xa<64;Xa++)Wa["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(Xa)]=Xa;for(var Ya=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},qa=function(){function A(A,e,t,n,i,r){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=n,this.index=i,this.data=r}return A.prototype.get=function(A){var e;if(A>=0){if(A<55296||A>56319&&A<=65535)return e=((e=this.index[A>>5])<<2)+(31&A),this.data[e];if(A<=65535)return e=((e=this.index[2048+(A-55296>>5)])<<2)+(31&A),this.data[e];if(A<this.highStart)return e=2080+(A>>11),e=this.index[e],e+=A>>5&63,e=((e=this.index[e])<<2)+(31&A),this.data[e];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},A}(),$a="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Za=0;Za<64;Za++)$a["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(Za)]=Za;var za,Ac,ec,tc,nc,ic,rc,sc,oc,ac,cc=10,dc=13,lc=15,uc=17,hc=18,gc=19,pc=20,mc=21,fc=22,Bc=24,wc=25,vc=26,Cc=27,yc=28,bc=30,Qc=32,Uc=33,kc=34,Ec=35,Fc=37,Tc=38,Sc=39,Ic=40,Pc=42,Hc=[9001,65288],Rc="×",Dc="÷",xc=(tc=function(A){var e,t,n,i,r,s=.75*A.length,o=A.length,a=0;"="===A[A.length-1]&&(s--,"="===A[A.length-2]&&s--);var c="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(s):new Array(s),d=Array.isArray(c)?c:new Uint8Array(c);for(e=0;e<o;e+=4)t=Wa[A.charCodeAt(e)],n=Wa[A.charCodeAt(e+1)],i=Wa[A.charCodeAt(e+2)],r=Wa[A.charCodeAt(e+3)],d[a++]=t<<2|n>>4,d[a++]=(15&n)<<4|i>>2,d[a++]=(3&i)<<6|63&r;return c}("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(tc)?function(A){for(var e=A.length,t=[],n=0;n<e;n+=4)t.push(A[n+3]<<24|A[n+2]<<16|A[n+1]<<8|A[n]);return t}(tc):new Uint32Array(tc),rc=Ya(ic=Array.isArray(tc)?function(A){for(var e=A.length,t=[],n=0;n<e;n+=2)t.push(A[n+1]<<8|A[n]);return t}(tc):new Uint16Array(tc),12,nc[4]/2),sc=2===nc[5]?Ya(ic,(24+nc[4])/2):(za=nc,Ac=Math.ceil((24+nc[4])/4),za.slice?za.slice(Ac,ec):new Uint32Array(Array.prototype.slice.call(za,Ac,ec))),new qa(nc[0],nc[1],nc[2],nc[3],rc,sc)),Lc=[bc,36],Oc=[1,2,3,5],Mc=[cc,8],Nc=[Cc,vc],Kc=Oc.concat(Mc),_c=[Tc,Sc,Ic,kc,Ec],Vc=[lc,dc],Gc=function(A,e,t,n){var i=n[t];if(Array.isArray(A)?-1!==A.indexOf(i):A===i)for(var r=t;r<=n.length;){if((a=n[++r])===e)return!0;if(a!==cc)break}if(i===cc)for(r=t;r>0;){var s=n[--r];if(Array.isArray(A)?-1!==A.indexOf(s):A===s)for(var o=t;o<=n.length;){var a;if((a=n[++o])===e)return!0;if(a!==cc)break}if(s!==cc)break}return!1},jc=function(A,e){for(var t=A;t>=0;){var n=e[t];if(n!==cc)return n;t--}return 0},Jc=function(A,e,t,n,i){if(0===t[n])return Rc;var r=n-1;if(Array.isArray(i)&&!0===i[r])return Rc;var s=r-1,o=r+1,a=e[r],c=s>=0?e[s]:0,d=e[o];if(2===a&&3===d)return Rc;if(-1!==Oc.indexOf(a))return"!";if(-1!==Oc.indexOf(d))return Rc;if(-1!==Mc.indexOf(d))return Rc;if(8===jc(r,e))return Dc;if(11===xc.get(A[r]))return Rc;if((a===Qc||a===Uc)&&11===xc.get(A[o]))return Rc;if(7===a||7===d)return Rc;if(9===a)return Rc;if(-1===[cc,dc,lc].indexOf(a)&&9===d)return Rc;if(-1!==[uc,hc,gc,Bc,yc].indexOf(d))return Rc;if(jc(r,e)===fc)return Rc;if(Gc(23,fc,r,e))return Rc;if(Gc([uc,hc],mc,r,e))return Rc;if(Gc(12,12,r,e))return Rc;if(a===cc)return Dc;if(23===a||23===d)return Rc;if(16===d||16===a)return Dc;if(-1!==[dc,lc,mc].indexOf(d)||14===a)return Rc;if(36===c&&-1!==Vc.indexOf(a))return Rc;if(a===yc&&36===d)return Rc;if(d===pc)return Rc;if(-1!==Lc.indexOf(d)&&a===wc||-1!==Lc.indexOf(a)&&d===wc)return Rc;if(a===Cc&&-1!==[Fc,Qc,Uc].indexOf(d)||-1!==[Fc,Qc,Uc].indexOf(a)&&d===vc)return Rc;if(-1!==Lc.indexOf(a)&&-1!==Nc.indexOf(d)||-1!==Nc.indexOf(a)&&-1!==Lc.indexOf(d))return Rc;if(-1!==[Cc,vc].indexOf(a)&&(d===wc||-1!==[fc,lc].indexOf(d)&&e[o+1]===wc)||-1!==[fc,lc].indexOf(a)&&d===wc||a===wc&&-1!==[wc,yc,Bc].indexOf(d))return Rc;if(-1!==[wc,yc,Bc,uc,hc].indexOf(d))for(var l=r;l>=0;){if((u=e[l])===wc)return Rc;if(-1===[yc,Bc].indexOf(u))break;l--}if(-1!==[Cc,vc].indexOf(d))for(l=-1!==[uc,hc].indexOf(a)?s:r;l>=0;){var u;if((u=e[l])===wc)return Rc;if(-1===[yc,Bc].indexOf(u))break;l--}if(Tc===a&&-1!==[Tc,Sc,kc,Ec].indexOf(d)||-1!==[Sc,kc].indexOf(a)&&-1!==[Sc,Ic].indexOf(d)||-1!==[Ic,Ec].indexOf(a)&&d===Ic)return Rc;if(-1!==_c.indexOf(a)&&-1!==[pc,vc].indexOf(d)||-1!==_c.indexOf(d)&&a===Cc)return Rc;if(-1!==Lc.indexOf(a)&&-1!==Lc.indexOf(d))return Rc;if(a===Bc&&-1!==Lc.indexOf(d))return Rc;if(-1!==Lc.concat(wc).indexOf(a)&&d===fc&&-1===Hc.indexOf(A[o])||-1!==Lc.concat(wc).indexOf(d)&&a===hc)return Rc;if(41===a&&41===d){for(var h=t[r],g=1;h>0&&41===e[--h];)g++;if(g%2!=0)return Rc}return a===Qc&&d===Uc?Rc:Dc},Wc=function(){function A(A,e,t,n){this.codePoints=A,this.required="!"===e,this.start=t,this.end=n}return A.prototype.slice=function(){return Ga.apply(void 0,this.codePoints.slice(this.start,this.end))},A}(),Xc=45,Yc=43,qc=-1,$c=function(A){return A>=48&&A<=57},Zc=function(A){return $c(A)||A>=65&&A<=70||A>=97&&A<=102},zc=function(A){return 10===A||9===A||32===A},Ad=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},ed=function(A){return Ad(A)||$c(A)||A===Xc},td=function(A){return A>=0&&A<=8||11===A||A>=14&&A<=31||127===A},nd=function(A,e){return 92===A&&10!==e},id=function(A,e,t){return A===Xc?Ad(e)||nd(e,t):!!Ad(A)||!(92!==A||!nd(A,e))},rd=function(A,e,t){return A===Yc||A===Xc?!!$c(e)||46===e&&$c(t):$c(46===A?e:A)},sd=function(A){var e=0,t=1;A[e]!==Yc&&A[e]!==Xc||(A[e]===Xc&&(t=-1),e++);for(var n=[];$c(A[e]);)n.push(A[e++]);var i=n.length?parseInt(Ga.apply(void 0,n),10):0;46===A[e]&&e++;for(var r=[];$c(A[e]);)r.push(A[e++]);var s=r.length,o=s?parseInt(Ga.apply(void 0,r),10):0;69!==A[e]&&101!==A[e]||e++;var a=1;A[e]!==Yc&&A[e]!==Xc||(A[e]===Xc&&(a=-1),e++);for(var c=[];$c(A[e]);)c.push(A[e++]);var d=c.length?parseInt(Ga.apply(void 0,c),10):0;return t*(i+o*Math.pow(10,-s))*Math.pow(10,a*d)},od={type:2},ad={type:3},cd={type:4},dd={type:13},ld={type:8},ud={type:21},hd={type:9},gd={type:10},pd={type:11},md={type:12},fd={type:14},Bd={type:23},wd={type:1},vd={type:25},Cd={type:24},yd={type:26},bd={type:27},Qd={type:28},Ud={type:29},kd={type:31},Ed={type:32},Fd=function(){function A(){this._value=[]}return A.prototype.write=function(A){this._value=this._value.concat(Va(A))},A.prototype.read=function(){for(var A=[],e=this.consumeToken();e!==Ed;)A.push(e),e=this.consumeToken();return A},A.prototype.consumeToken=function(){var A=this.consumeCodePoint();switch(A){case 34:return this.consumeStringToken(34);case 35:var e=this.peekCodePoint(0),t=this.peekCodePoint(1),n=this.peekCodePoint(2);if(ed(e)||nd(t,n)){var i=id(e,t,n)?2:1;return{type:5,value:this.consumeName(),flags:i}}break;case 36:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),dd;break;case 39:return this.consumeStringToken(39);case 40:return od;case 41:return ad;case 42:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),fd;break;case Yc:if(rd(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case 44:return cd;case Xc:var r=A,s=this.peekCodePoint(0),o=this.peekCodePoint(1);if(rd(r,s,o))return this.reconsumeCodePoint(A),this.consumeNumericToken();if(id(r,s,o))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();if(s===Xc&&62===o)return this.consumeCodePoint(),this.consumeCodePoint(),Cd;break;case 46:if(rd(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 yd;case 59:return bd;case 60:if(33===this.peekCodePoint(0)&&this.peekCodePoint(1)===Xc&&this.peekCodePoint(2)===Xc)return this.consumeCodePoint(),this.consumeCodePoint(),vd;break;case 64:var c=this.peekCodePoint(0),d=this.peekCodePoint(1),l=this.peekCodePoint(2);if(id(c,d,l))return{type:7,value:this.consumeName()};break;case 91:return Qd;case 92:if(nd(A,this.peekCodePoint(0)))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();break;case 93:return Ud;case 61:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),ld;break;case 123:return pd;case 125:return md;case 117:case 85:var u=this.peekCodePoint(0),h=this.peekCodePoint(1);return u!==Yc||!Zc(h)&&63!==h||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(A),this.consumeIdentLikeToken();case 124:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),hd;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),ud;break;case 126:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),gd;break;case qc:return Ed}return zc(A)?(this.consumeWhiteSpace(),kd):$c(A)?(this.reconsumeCodePoint(A),this.consumeNumericToken()):Ad(A)?(this.reconsumeCodePoint(A),this.consumeIdentLikeToken()):{type:6,value:Ga(A)}},A.prototype.consumeCodePoint=function(){var A=this._value.shift();return void 0===A?-1:A},A.prototype.reconsumeCodePoint=function(A){this._value.unshift(A)},A.prototype.peekCodePoint=function(A){return A>=this._value.length?-1:this._value[A]},A.prototype.consumeUnicodeRangeToken=function(){for(var A=[],e=this.consumeCodePoint();Zc(e)&&A.length<6;)A.push(e),e=this.consumeCodePoint();for(var t=!1;63===e&&A.length<6;)A.push(e),e=this.consumeCodePoint(),t=!0;if(t)return{type:30,start:parseInt(Ga.apply(void 0,A.map((function(A){return 63===A?48:A}))),16),end:parseInt(Ga.apply(void 0,A.map((function(A){return 63===A?70:A}))),16)};var n=parseInt(Ga.apply(void 0,A),16);if(this.peekCodePoint(0)===Xc&&Zc(this.peekCodePoint(1))){this.consumeCodePoint(),e=this.consumeCodePoint();for(var i=[];Zc(e)&&i.length<6;)i.push(e),e=this.consumeCodePoint();return{type:30,start:n,end:parseInt(Ga.apply(void 0,i),16)}}return{type:30,start:n,end:n}},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 e=this.peekCodePoint(0);if(39===e||34===e){var t=this.consumeStringToken(this.consumeCodePoint());return 0===t.type&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===qc||41===this.peekCodePoint(0))?(this.consumeCodePoint(),{type:22,value:t.value}):(this.consumeBadUrlRemnants(),Bd)}for(;;){var n=this.consumeCodePoint();if(n===qc||41===n)return{type:22,value:Ga.apply(void 0,A)};if(zc(n))return this.consumeWhiteSpace(),this.peekCodePoint(0)===qc||41===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:22,value:Ga.apply(void 0,A)}):(this.consumeBadUrlRemnants(),Bd);if(34===n||39===n||40===n||td(n))return this.consumeBadUrlRemnants(),Bd;if(92===n){if(!nd(n,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),Bd;A.push(this.consumeEscapedCodePoint())}else A.push(n)}},A.prototype.consumeWhiteSpace=function(){for(;zc(this.peekCodePoint(0));)this.consumeCodePoint()},A.prototype.consumeBadUrlRemnants=function(){for(;;){var A=this.consumeCodePoint();if(41===A||A===qc)return;nd(A,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},A.prototype.consumeStringSlice=function(A){for(var e="";A>0;){var t=Math.min(5e4,A);e+=Ga.apply(void 0,this._value.splice(0,t)),A-=t}return this._value.shift(),e},A.prototype.consumeStringToken=function(A){for(var e="",t=0;;){var n=this._value[t];if(n===qc||void 0===n||n===A)return{type:0,value:e+=this.consumeStringSlice(t)};if(10===n)return this._value.splice(0,t),wd;if(92===n){var i=this._value[t+1];i!==qc&&void 0!==i&&(10===i?(e+=this.consumeStringSlice(t),t=-1,this._value.shift()):nd(n,i)&&(e+=this.consumeStringSlice(t),e+=Ga(this.consumeEscapedCodePoint()),t=-1))}t++}},A.prototype.consumeNumber=function(){var A=[],e=4,t=this.peekCodePoint(0);for(t!==Yc&&t!==Xc||A.push(this.consumeCodePoint());$c(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0);var n=this.peekCodePoint(1);if(46===t&&$c(n))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;$c(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0),n=this.peekCodePoint(1);var i=this.peekCodePoint(2);if((69===t||101===t)&&((n===Yc||n===Xc)&&$c(i)||$c(n)))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;$c(this.peekCodePoint(0));)A.push(this.consumeCodePoint());return[sd(A),e]},A.prototype.consumeNumericToken=function(){var A=this.consumeNumber(),e=A[0],t=A[1],n=this.peekCodePoint(0),i=this.peekCodePoint(1),r=this.peekCodePoint(2);return id(n,i,r)?{type:15,number:e,flags:t,unit:this.consumeName()}:37===n?(this.consumeCodePoint(),{type:16,number:e,flags:t}):{type:17,number:e,flags:t}},A.prototype.consumeEscapedCodePoint=function(){var A=this.consumeCodePoint();if(Zc(A)){for(var e=Ga(A);Zc(this.peekCodePoint(0))&&e.length<6;)e+=Ga(this.consumeCodePoint());zc(this.peekCodePoint(0))&&this.consumeCodePoint();var t=parseInt(e,16);return 0===t||function(A){return A>=55296&&A<=57343}(t)||t>1114111?65533:t}return A===qc?65533:A},A.prototype.consumeName=function(){for(var A="";;){var e=this.consumeCodePoint();if(ed(e))A+=Ga(e);else{if(!nd(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),A;A+=Ga(this.consumeEscapedCodePoint())}}},A}(),Td=function(){function A(A){this._tokens=A}return A.create=function(e){var t=new Fd;return t.write(e),new A(t.read())},A.parseValue=function(e){return A.create(e).parseComponentValue()},A.parseValues=function(e){return A.create(e).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 e=this.consumeComponentValue();do{A=this.consumeToken()}while(31===A.type);if(32===A.type)return e;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},A.prototype.parseComponentValues=function(){for(var A=[];;){var e=this.consumeComponentValue();if(32===e.type)return A;A.push(e),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 e={type:A,values:[]},t=this.consumeToken();;){if(32===t.type||Od(t,A))return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue()),t=this.consumeToken()}},A.prototype.consumeFunction=function(A){for(var e={name:A.value,values:[],type:18};;){var t=this.consumeToken();if(32===t.type||3===t.type)return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue())}},A.prototype.consumeToken=function(){var A=this._tokens.shift();return void 0===A?Ed:A},A.prototype.reconsumeToken=function(A){this._tokens.unshift(A)},A}(),Sd=function(A){return 15===A.type},Id=function(A){return 17===A.type},Pd=function(A){return 20===A.type},Hd=function(A){return 0===A.type},Rd=function(A,e){return Pd(A)&&A.value===e},Dd=function(A){return 31!==A.type},xd=function(A){return 31!==A.type&&4!==A.type},Ld=function(A){var e=[],t=[];return A.forEach((function(A){if(4===A.type){if(0===t.length)throw new Error("Error parsing function args, zero tokens for arg");return e.push(t),void(t=[])}31!==A.type&&t.push(A)})),t.length&&e.push(t),e},Od=function(A,e){return 11===e&&12===A.type||28===e&&29===A.type||2===e&&3===A.type},Md=function(A){return 17===A.type||15===A.type},Nd=function(A){return 16===A.type||Md(A)},Kd=function(A){return A.length>1?[A[0],A[1]]:[A[0]]},_d={type:17,number:0,flags:4},Vd={type:16,number:50,flags:4},Gd={type:16,number:100,flags:4},jd=function(A,e,t){var n=A[0],i=A[1];return[Jd(n,e),Jd(void 0!==i?i:n,t)]},Jd=function(A,e){if(16===A.type)return A.number/100*e;if(Sd(A))switch(A.unit){case"rem":case"em":return 16*A.number;default:return A.number}return A.number},Wd="grad",Xd="turn",Yd=function(A,e){if(15===e.type)switch(e.unit){case"deg":return Math.PI*e.number/180;case Wd:return Math.PI/200*e.number;case"rad":return e.number;case Xd:return 2*Math.PI*e.number}throw new Error("Unsupported angle type")},qd=function(A){return 15===A.type&&("deg"===A.unit||A.unit===Wd||"rad"===A.unit||A.unit===Xd)},$d=function(A){switch(A.filter(Pd).map((function(A){return A.value})).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[_d,_d];case"to top":case"bottom":return Zd(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[_d,Gd];case"to right":case"left":return Zd(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[Gd,Gd];case"to bottom":case"top":return Zd(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[Gd,_d];case"to left":case"right":return Zd(270)}return 0},Zd=function(A){return Math.PI*A/180},zd=function(A){return!(255&A)},Al=function(A){var e=255&A,t=255&A>>8,n=255&A>>16,i=255&A>>24;return e<255?"rgba(".concat(i,",").concat(n,",").concat(t,",").concat(e/255,")"):"rgb(".concat(i,",").concat(n,",").concat(t,")")},el=function(A,e,t,n){return(A<<24|e<<16|t<<8|Math.round(255*n))>>>0},tl=function(A,e){if(17===A.type)return A.number;if(16===A.type){var t=3===e?1:255;return 3===e?A.number/100*t:Math.round(A.number/100*t)}return 0},nl=function(A){return"from"===(20===A[0].type?A[0].value:"unknown")},il=function(A,e,t){return Math.min(Math.max(A,e),t)},rl=function(A,e){return[A[0]*e[0]+A[1]*e[1]+A[2]*e[2],A[3]*e[0]+A[4]*e[1]+A[5]*e[2],A[6]*e[0]+A[7]*e[1]+A[8]*e[2]]},sl=function(A){var e=A[0],t=A[1],n=A[2],i=A[3],r=Ql([e,t,n]);return el(il(Math.round(255*r[0]),0,255),il(Math.round(255*r[1]),0,255),il(Math.round(255*r[2]),0,255),i)},ol=function(A){var e=yl([A[0],A[1],A[2]]);return sl([e[0],e[1],e[2],A[3]])},al=function(A,e){var t=e.filter(xd),n=t[0],i=t[1],r=t[2],s=t[3];return[(17===n.type?Zd(n.number):Yd(0,n))/(2*Math.PI),Nd(i)?i.number/100:0,Nd(r)?r.number/100:0,void 0!==s&&Nd(s)?Jd(s,1):1]},cl=function(A,e){if(nl(e))throw new Error("Relative color not supported for hsl()");var t=al(0,e),n=t[0],i=t[1],r=t[2],s=t[3],o=ml([n,i,r]);return el(255*o[0],255*o[1],255*o[2],0===i?1:s)},dl=function(A){var e=A.filter(xd);return[Nd(e[0])?e[0].number:0,Nd(e[1])?e[1].number:0,Id(e[2])||Sd(e[2])?e[2].number:0,void 0!==e[4]&&Nd(e[4])?Jd(e[4],1):1]},ll=function(A){var e=A.filter(xd);return[16===e[0].type?e[0].number/100:Id(e[0])?e[0].number:0,16===e[1].type?e[1].number/100:Id(e[1])?e[1].number:0,Id(e[2])||Sd(e[2])?e[2].number:0,void 0!==e[4]&&Nd(e[4])?Jd(e[4],1):1]},ul=function(A){var e=A.filter(xd);return[16===e[0].type?e[0].number/100:Id(e[0])?e[0].number:0,16===e[1].type?e[1].number/100:Id(e[1])?e[1].number:0,Id(e[2])||Sd(e[2])?e[2].number:0,void 0!==e[4]&&Nd(e[4])?Jd(e[4],1):1]},hl=function(A){return rl([1.0479297925449969,.022946870601609652,-.05019226628920524,.02962780877005599,.9904344267538799,-.017073799063418826,-.009243040646204504,.015055191490298152,.7518742814281371],A)},gl=function(A){return rl([.955473421488075,-.02309845494876471,.06325924320057072,-.0283697093338637,1.0099953980813041,.021041441191917323,.012314014864481998,-.020507649298898964,1.330365926242124],A)},pl=function(A,e,t){return t<0&&(t+=1),t>=1&&(t-=1),t<1/6?(e-A)*t*6+A:t<.5?e:t<2/3?6*(e-A)*(2/3-t)+A:A},ml=function(A){var e=A[0],t=A[1],n=A[2];if(0===t)return[255*n,255*n,255*n];var i=n<=.5?n*(t+1):n+t-n*t,r=2*n-i;return[pl(r,i,e+1/3),pl(r,i,e),pl(r,i,e-1/3)]},fl=function(A){var e=A[0],t=A[1],n=A[2];return t<0&&(t=0),isNaN(n)&&(n=0),[e,t*Math.cos(n*Math.PI/180),t*Math.sin(n*Math.PI/180)]},Bl=function(A){var e=rl([1,.3963377773761749,.2158037573099136,1,-.1055613458156586,-.0638541728258133,1,-.0894841775298119,-1.2914855480194092],A).map((function(A){return Math.pow(A,3)}));return rl([1.2268798758459243,-.5578149944602171,.2813910456659647,-.0405757452148008,1.112286803280317,-.0717110580655164,-.0763729366746601,-.4214933324022432,1.5869240198367816],e)},wl=function(A){var e=(A[0]+16)/116,t=A[1]/500+e,n=e-A[2]/200,i=24389/27,r=24/116,s=[.3457*(t>r?Math.pow(t,3):(116*t-16)/i)/.3585,A[0]>8?Math.pow(e,3):A[0]/i,.2958*(n>r?Math.pow(n,3):(116*n-16)/i)/.3585];return gl([s[0],s[1],s[2]])},vl=function(A){return A},Cl=function(A){return ol([A[0],A[1],A[2],A[3]])},yl=function(A){return rl([3.2409699419045226,-1.537383177570094,-.4986107602930034,-.9692436362808796,1.8759675015077202,.04155505740717559,.05563007969699366,-.20397695888897652,1.0569715142428786],A)},bl=function(A){return rl([.41239079926595934,.357584339383878,.1804807884018343,.21263900587151027,.715168678767756,.07219231536073371,.01933081871559182,.11919477979462598,.9505321522496607],A)},Ql=function(A){return A.map((function(A){var e=A<0?-1:1,t=Math.abs(A);return t>.0031308?e*(1.055*Math.pow(t,1/2.4)-.055):12.92*A}))},Ul=function(A){return A.map((function(A){var e=A<0?-1:1,t=Math.abs(A);return t<=.04045?A/12.92:e*Math.pow((t+.055)/1.055,2.4)}))},kl=1.09929682680944,El=.018053968510807,Fl=function(A,e){if(18===e.type){var t=Rl[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported color function "'.concat(e.name,'"'));return t(A,e.values)}if(5===e.type){var n=Tl(e),i=n[0],r=n[1],s=n[2],o=n[3];return el(i,r,s,o)}if(20===e.type){var a=xl[e.value.toUpperCase()];if(void 0!==a)return a}return xl.TRANSPARENT},Tl=function(A){if(3===A.value.length){var e=A.value.substring(0,1),t=A.value.substring(1,2),n=A.value.substring(2,3);return[parseInt(e+e,16),parseInt(t+t,16),parseInt(n+n,16),1]}if(4===A.value.length){e=A.value.substring(0,1),t=A.value.substring(1,2),n=A.value.substring(2,3);var i=A.value.substring(3,4);return[parseInt(e+e,16),parseInt(t+t,16),parseInt(n+n,16),parseInt(i+i,16)/255]}return 6===A.value.length?(e=A.value.substring(0,2),t=A.value.substring(2,4),n=A.value.substring(4,6),[parseInt(e,16),parseInt(t,16),parseInt(n,16),1]):8===A.value.length?(e=A.value.substring(0,2),t=A.value.substring(2,4),n=A.value.substring(4,6),i=A.value.substring(6,8),[parseInt(e,16),parseInt(t,16),parseInt(n,16),parseInt(i,16)/255]):[0,0,0,1]},Sl=function(A,e){var t=e.filter(xd);if(nl(t))throw new Error("Relative color not supported for rgb()");if(3===t.length){var n=t.map(tl),i=n[0],r=n[1],s=n[2];return el(i,r,s,1)}if(4===t.length){var o=t.map(tl),a=(i=o[0],r=o[1],s=o[2],o[3]);return el(i,r,s,a)}return 0},Il={srgb:function(A){return el(il(Math.round(255*A[0]),0,255),il(Math.round(255*A[1]),0,255),il(Math.round(255*A[2]),0,255),il(A[3],0,1))},"srgb-linear":sl,"display-p3":function(A){var e=function(A){var e,t=[A[0],A[1],A[2]].map((function(A){var e=A<0?-1:1;return A*e<=.04045?A/12.92:e*Math.pow((A+.055)/1.055,2.4)||0}));return e=[t[0],t[1],t[2]],rl([.4865709486482162,.26566769316909306,.1982172852343625,.2289745640697488,.6917385218365064,.079286914093745,0,.04511338185890264,1.043944368900976],e)}([A[0],A[1],A[2]]);return ol([e[0],e[1],e[2],A[3]])},"a98-rgb":function(A){var e,t,n=yl((e=[(t=[A[0],A[1],A[2]].map((function(A){var e=A<0?-1:1,t=Math.abs(A);return e*Math.pow(t,563/256)})))[0],t[1],t[2]],rl([.5766690429101305,.1855582379065463,.1882286462349947,.29734497525053605,.6273635662554661,.0752914584939978,.02703136138641234,.07068885253582723,.9913375368376388],e)));return sl([n[0],n[1],n[2],A[3]])},"prophoto-rgb":function(A){var e=function(A){var e,t=[A[0],A[1],A[2]].map((function(A){return A<16/512?A/16:Math.pow(A,1.8)}));return gl((e=[t[0],t[1],t[2]],rl([.7977666449006423,.13518129740053308,.0313477341283922,.2880748288194013,.711835234241873,8993693872564e-17,0,0,.8251046025104602],e)))}([A[0],A[1],A[2]]);return ol([e[0],e[1],e[2],A[3]])},xyz:Cl,"xyz-d50":function(A){var e=function(A){return gl([A[0],A[1],A[2]])}([A[0],A[1],A[2]]);return ol([e[0],e[1],e[2],A[3]])},"xyz-d65":Cl,rec2020:function(A){var e=function(A){var e,t=[A[0],A[1],A[2]].map((function(A){return A<4.5*El?A/4.5:Math.pow((A+kl-1)/kl,1/.45)}));return e=[t[0],t[1],t[2]],rl([.6369580483012914,.14461690358620832,.1688809751641721,.2627002120112671,.6779980715188708,.05930171646986196,0,.028072693049087428,1.060985057710791],e)}([A[0],A[1],A[2]]);return ol([e[0],e[1],e[2],A[3]])}},Pl={rgb:function(A,e){var t=e.filter(xd);if(3===t.length){var n=t.map(tl),i=n[0],r=n[1],s=n[2],o=Ul([i/255,r/255,s/255]),a=bl([o[0],o[1],o[2]]);return[a[0],a[1],a[2],1]}if(4===t.length){var c=t.map(tl),d=(i=c[0],r=c[1],s=c[2],c[3]),l=(o=Ul([i/255,r/255,s/255]),bl([o[0],o[1],o[2]]));return[l[0],l[1],l[2],d]}return[0,0,0,1]},hsl:function(A,e){var t=al(0,e),n=t[0],i=t[1],r=t[2],s=t[3],o=Ul(ml([n,i,r])),a=bl([o[0],o[1],o[2]]);return[a[0],a[1],a[2],s]},lab:function(A,e){var t=ll(e),n=t[0],i=t[1],r=t[2],s=t[3],o=wl([n,i,r]);return[o[0],o[1],o[2],s]},lch:function(A,e){var t=dl(e),n=t[0],i=t[1],r=t[2],s=t[3],o=wl(fl([n,i,r]));return[o[0],o[1],o[2],s]},oklab:function(A,e){var t=ll(e),n=t[0],i=t[1],r=t[2],s=t[3],o=Bl([n,i,r]);return[o[0],o[1],o[2],s]},oklch:function(A,e){var t=ul(e),n=t[0],i=t[1],r=t[2],s=t[3],o=Bl(fl([n,i,r]));return[o[0],o[1],o[2],s]}},Hl={srgb:function(A){var e=Ql(yl([A[0],A[1],A[2]]));return[e[0],e[1],e[2],A[3]]},"srgb-linear":function(A){var e=yl([A[0],A[1],A[2]]),t=e[0],n=e[1],i=e[2];return[il(Math.round(255*t),0,255),il(Math.round(255*n),0,255),il(Math.round(255*i),0,255),A[3]]},"display-p3":function(A){var e,t,n=(t=[A[0],A[1],A[2]],e=rl([2.493496911941425,-.9313836179191239,-.40271078445071684,-.8294889695615747,1.7626640603183463,.023624685841943577,.03584583024378447,-.07617238926804182,.9568845240076872],t),Ql(e));return[n[0],n[1],n[2],A[3]]},"a98-rgb":function(A){var e,t,n=(t=[A[0],A[1],A[2]],[(e=rl([2.0415879038107465,-.5650069742788596,-.34473135077832956,-.9692436362808795,1.8759675015077202,.04155505740717557,.013444280632031142,-.11836239223101838,1.0151749943912054],t).map((function(A){var e=A<0?-1:1,t=Math.abs(A);return e*Math.pow(t,256/563)})))[0],e[1],e[2]]);return[n[0],n[1],n[2],A[3]]},"prophoto-rgb":function(A){var e,t=(e=hl([A[0],A[1],A[2]]),rl([1.3457868816471583,-.25557208737979464,-.05110186497554526,-.5446307051249019,1.5082477428451468,.02052744743642139,0,0,1.2119675456389452],e).map((function(A){return A>1/512?Math.pow(A,1/1.8):16*A})));return[t[0],t[1],t[2],A[3]]},xyz:vl,"xyz-d50":function(A){var e=hl([A[0],A[2],A[3]]);return[e[0],e[1],e[2],A[3]]},"xyz-d65":vl,rec2020:function(A){var e,t=(e=[A[0],A[1],A[2]],rl([1.716651187971268,-.355670783776392,-.25336628137366,-.666684351832489,1.616481236634939,.0157685458139111,.017639857445311,-.042770613257809,.942103121235474],e).map((function(A){return A>=El?kl*Math.pow(A,.45)-(kl-1):4.5*A})));return[t[0],t[1],t[2],A[3]]}},Rl={hsl:cl,hsla:cl,rgb:Sl,rgba:Sl,lch:function(A,e){if(nl(e.filter(xd)))throw new Error("Relative color not supported for lch()");var t=dl(e),n=t[0],i=t[1],r=t[2],s=t[3],o=Ql(yl(wl(fl([n,i,r]))));return el(il(Math.round(255*o[0]),0,255),il(Math.round(255*o[1]),0,255),il(Math.round(255*o[2]),0,255),s)},oklch:function(A,e){if(nl(e.filter(xd)))throw new Error("Relative color not supported for oklch()");var t=ul(e),n=t[0],i=t[1],r=t[2],s=t[3],o=Ql(yl(Bl(fl([n,i,r]))));return el(il(Math.round(255*o[0]),0,255),il(Math.round(255*o[1]),0,255),il(Math.round(255*o[2]),0,255),s)},oklab:function(A,e){if(nl(e.filter(xd)))throw new Error("Relative color not supported for oklab()");var t=ll(e),n=t[0],i=t[1],r=t[2],s=t[3],o=Ql(yl(Bl([n,i,r])));return el(il(Math.round(255*o[0]),0,255),il(Math.round(255*o[1]),0,255),il(Math.round(255*o[2]),0,255),s)},lab:function(A,e){if(nl(e.filter(xd)))throw new Error("Relative color not supported for lab()");var t=ll(e),n=t[0],i=t[1],r=t[2],s=t[3],o=Ql(yl(wl([n,i,r])));return el(il(Math.round(255*o[0]),0,255),il(Math.round(255*o[1]),0,255),il(Math.round(255*o[2]),0,255),s)},color:function(A,e){var t=e.filter(xd),n=20===t[0].type?t[0].value:"unknown";if(!nl(t)){var i=Il[n];if(void 0===i)throw new Error('Attempting to parse an unsupported color space "'.concat(n,'" for color() function'));return i([m=Id(t[1])?t[1].number:0,f=Id(t[2])?t[2].number:0,B=Id(t[3])?t[3].number:0,w=t.length>4&&6===t[4].type&&"/"===t[4].value&&Id(t[5])?t[5].number:1])}var r=function(A,e){if(Id(e))return e.number;var t;if(Pd(e))return A["r"===(t=e.value)||"x"===t?0:"g"===t||"y"===t?1:2];var n=function(A){for(var e="(",t=0,i=A.filter(xd);t<i.length;t++){var r=i[t];e+=18===r.type&&"calc"===r.name?n(r.values):Id(r)?r.number:6===r.type||Pd(r)?r.value:""}return e+")"};if(18===e.type){var i=e.values.filter(xd);if("calc"===e.name){var r=n(i).replace(/r|x/,A[0].toString()).replace(/g|y/,A[1].toString()).replace(/b|z/,A[2].toString());return new Function("return "+r)()}}return null},s=18===t[1].type?t[1].name:Pd(t[1])||5===t[1].type?"rgb":"unknown",o=Pd(t[2])?t[2].value:"unknown",a=18===t[1].type?t[1].values:Pd(t[1])?[t[1]]:[];if(Pd(t[1])){if(void 0===xl[t[1].value.toUpperCase()])throw new Error("Attempting to use unknown color in relative color 'from'");var c=Dl(A,t[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:(d=255&c)>1?d/255:d,flags:1}]}else if(5===t[1].type){var d,l=Tl(t[1]);a=[{type:17,number:l[0],flags:1},{type:17,number:l[1],flags:1},{type:17,number:l[2],flags:1},{type:17,number:(d=l[3])>1?d/255:d,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 u=Pl[s],h=Hl[o],g=Il[o];if(void 0===u)throw new Error('Attempting to parse an unsupported color space "'.concat(s,'" for color() function'));if(void 0===h)throw new Error('Attempting to parse an unsupported color space "'.concat(o,'" for color() function'));var p=h(u(A,a)),m=r(p,t[3]),f=r(p,t[4]),B=r(p,t[5]),w=t.length>6&&6===t[6].type&&"/"===t[6].value&&Id(t[7])?t[7].number:1;if(null===m||null===f||null===B)throw new Error("Invalid relative color in color() function");return g([m,f,B,w])}},Dl=function(A,e){return Fl(A,Td.create(e).parseComponentValue())},xl={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},Ll={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(A,e){return e.map((function(A){if(Pd(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},Ol={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Ml=function(A,e){var t=Fl(A,e[0]),n=e[1];return n&&Nd(n)?{color:t,stop:n}:{color:t,stop:null}},Nl=function(A,e){var t=A[0],n=A[A.length-1];null===t.stop&&(t.stop=_d),null===n.stop&&(n.stop=Gd);for(var i=[],r=0,s=0;s<A.length;s++){var o=A[s].stop;if(null!==o){var a=Jd(o,e);a>r?i.push(a):i.push(r),r=a}else i.push(null)}var c=null;for(s=0;s<i.length;s++){var d=i[s];if(null===d)null===c&&(c=s);else if(null!==c){for(var l=s-c,u=(d-i[c-1])/(l+1),h=1;h<=l;h++)i[c+h-1]=u*h;c=null}}return A.map((function(A,t){return{color:A.color,stop:Math.max(Math.min(1,i[t]/e),0)}}))},Kl=function(A,e){return Math.sqrt(A*A+e*e)},_l=function(A,e,t,n,i){return[[0,0],[0,e],[A,0],[A,e]].reduce((function(A,e){var r=e[0],s=e[1],o=Kl(t-r,n-s);return(i?o<A.optimumDistance:o>A.optimumDistance)?{optimumCorner:e,optimumDistance:o}:A}),{optimumDistance:i?1/0:-1/0,optimumCorner:null}).optimumCorner},Vl=function(A,e){var t=Zd(180),n=[];return Ld(e).forEach((function(e,i){if(0===i){var r=e[0];if(20===r.type&&-1!==["top","left","right","bottom"].indexOf(r.value))return void(t=$d(e));if(qd(r))return void(t=(Yd(0,r)+Zd(270))%Zd(360))}var s=Ml(A,e);n.push(s)})),{angle:t,stops:n,type:1}},Gl="closest-side",jl="farthest-side",Jl="closest-corner",Wl="farthest-corner",Xl="circle",Yl="ellipse",ql="cover",$l="contain",Zl=function(A,e){var t=0,n=3,i=[],r=[];return Ld(e).forEach((function(e,s){var o=!0;if(0===s?o=e.reduce((function(A,e){if(Pd(e))switch(e.value){case"center":return r.push(Vd),!1;case"top":case"left":return r.push(_d),!1;case"right":case"bottom":return r.push(Gd),!1}else if(Nd(e)||Md(e))return r.push(e),!1;return A}),o):1===s&&(o=e.reduce((function(A,e){if(Pd(e))switch(e.value){case Xl:return t=0,!1;case Yl:return t=1,!1;case $l:case Gl:return n=0,!1;case jl:return n=1,!1;case Jl:return n=2,!1;case ql:case Wl:return n=3,!1}else if(Md(e)||Nd(e))return Array.isArray(n)||(n=[]),n.push(e),!1;return A}),o)),o){var a=Ml(A,e);i.push(a)}})),{size:n,shape:t,stops:i,position:r,type:2}},zl=function(A,e){if(22===e.type){var t={url:e.value,type:0};return A.cache.addImage(e.value),t}if(18===e.type){var n=Au[e.name];if(void 0===n)throw new Error('Attempting to parse an unsupported image function "'.concat(e.name,'"'));return n(A,e.values)}throw new Error("Unsupported image type ".concat(e.type))},Au={"linear-gradient":function(A,e){var t=Zd(180),n=[];return Ld(e).forEach((function(e,i){if(0===i){var r=e[0];if(20===r.type&&"to"===r.value)return void(t=$d(e));if(qd(r))return void(t=Yd(0,r))}var s=Ml(A,e);n.push(s)})),{angle:t,stops:n,type:1}},"-moz-linear-gradient":Vl,"-ms-linear-gradient":Vl,"-o-linear-gradient":Vl,"-webkit-linear-gradient":Vl,"radial-gradient":function(A,e){var t=0,n=3,i=[],r=[];return Ld(e).forEach((function(e,s){var o=!0;if(0===s){var a=!1;o=e.reduce((function(A,e){if(a)if(Pd(e))switch(e.value){case"center":return r.push(Vd),A;case"top":case"left":return r.push(_d),A;case"right":case"bottom":return r.push(Gd),A}else(Nd(e)||Md(e))&&r.push(e);else if(Pd(e))switch(e.value){case Xl:return t=0,!1;case Yl:return t=1,!1;case"at":return a=!0,!1;case Gl:return n=0,!1;case ql:case jl:return n=1,!1;case $l:case Jl:return n=2,!1;case Wl:return n=3,!1}else if(Md(e)||Nd(e))return Array.isArray(n)||(n=[]),n.push(e),!1;return A}),o)}if(o){var c=Ml(A,e);i.push(c)}})),{size:n,shape:t,stops:i,position:r,type:2}},"-moz-radial-gradient":Zl,"-ms-radial-gradient":Zl,"-o-radial-gradient":Zl,"-webkit-radial-gradient":Zl,"-webkit-gradient":function(A,e){var t=Zd(180),n=[],i=1;return Ld(e).forEach((function(e,t){var r=e[0];if(0===t){if(Pd(r)&&"linear"===r.value)return void(i=1);if(Pd(r)&&"radial"===r.value)return void(i=2)}if(18===r.type)if("from"===r.name){var s=Fl(A,r.values[0]);n.push({stop:_d,color:s})}else if("to"===r.name)s=Fl(A,r.values[0]),n.push({stop:Gd,color:s});else if("color-stop"===r.name){var o=r.values.filter(xd);if(2===o.length){s=Fl(A,o[1]);var a=o[0];Id(a)&&n.push({stop:{type:16,number:100*a.number,flags:a.flags},color:s})}}})),1===i?{angle:(t+Zd(180))%Zd(360),stops:n,type:i}:{size:3,shape:0,stops:n,position:[],type:i}}},eu={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(A,e){if(0===e.length)return[];var t=e[0];return 20===t.type&&"none"===t.value?[]:e.filter((function(A){return xd(A)&&function(A){return!(20===A.type&&"none"===A.value||18===A.type&&!Au[A.name])}(A)})).map((function(e){return zl(A,e)}))}},tu={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(A,e){return e.map((function(A){if(Pd(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},nu={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(A,e){return Ld(e).map((function(A){return A.filter(Nd)})).map(Kd)}},iu={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(A,e){return Ld(e).map((function(A){return A.filter(Pd).map((function(A){return A.value})).join(" ")})).map(ru)}},ru=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}};(ac=oc||(oc={})).AUTO="auto",ac.CONTAIN="contain",ac.COVER="cover";var su,ou,au={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(A,e){return Ld(e).map((function(A){return A.filter(cu)}))}},cu=function(A){return Pd(A)||Nd(A)},du=function(A){return{name:"border-".concat(A,"-color"),initialValue:"transparent",prefix:!1,type:3,format:"color"}},lu=du("top"),uu=du("right"),hu=du("bottom"),gu=du("left"),pu=function(A){return{name:"border-radius-".concat(A),initialValue:"0 0",prefix:!1,type:1,parse:function(A,e){return Kd(e.filter(Nd))}}},mu=pu("top-left"),fu=pu("top-right"),Bu=pu("bottom-right"),wu=pu("bottom-left"),vu=function(A){return{name:"border-".concat(A,"-style"),initialValue:"solid",prefix:!1,type:2,parse:function(A,e){switch(e){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},Cu=vu("top"),yu=vu("right"),bu=vu("bottom"),Qu=vu("left"),Uu=function(A){return{name:"border-".concat(A,"-width"),initialValue:"0",type:0,prefix:!1,parse:function(A,e){return Sd(e)?e.number:0}}},ku=Uu("top"),Eu=Uu("right"),Fu=Uu("bottom"),Tu=Uu("left"),Su={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Iu={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(A,e){return"rtl"===e?1:0}},Pu={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(A,e){return e.filter(Pd).reduce((function(A,e){return A|Hu(e.value)}),0)}},Hu=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},Ru={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},Du={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(A,e){return 20===e.type&&"normal"===e.value?0:17===e.type||15===e.type?e.number:0}};(ou=su||(su={})).NORMAL="normal",ou.STRICT="strict";var xu,Lu,Ou={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){return"strict"===e?su.STRICT:su.NORMAL}},Mu={name:"line-height",initialValue:"normal",prefix:!1,type:4},Nu=function(A,e){return Pd(A)&&"normal"===A.value?1.2*e:17===A.type?e*A.number:Nd(A)?Jd(A,e):e},Ku={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(A,e){return 20===e.type&&"none"===e.value?null:zl(A,e)}},_u={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(A,e){return"inside"===e?0:1}},Vu={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(A,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;default:return-1}}},Gu=function(A){return{name:"margin-".concat(A),initialValue:"0",prefix:!1,type:4}},ju=Gu("top"),Ju=Gu("right"),Wu=Gu("bottom"),Xu=Gu("left"),Yu={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(A,e){return e.filter(Pd).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}}))}},qu={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){return"break-word"===e?"break-word":"normal"}},$u=function(A){return{name:"padding-".concat(A),initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},Zu=$u("top"),zu=$u("right"),Ah=$u("bottom"),eh=$u("left"),th={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(A,e){switch(e){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},nh={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(A,e){switch(e){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},ih={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return 1===e.length&&Rd(e[0],"none")?[]:Ld(e).map((function(e){for(var t={color:xl.TRANSPARENT,offsetX:_d,offsetY:_d,blur:_d},n=0,i=0;i<e.length;i++){var r=e[i];Md(r)?(0===n?t.offsetX=r:1===n?t.offsetY=r:t.blur=r,n++):t.color=Fl(A,r)}return t}))}},rh={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},sh={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(A,e){if(20===e.type&&"none"===e.value)return null;if(18===e.type){var t=oh[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported transform function "'.concat(e.name,'"'));return t(e.values)}return null}},oh={matrix:function(A){var e=A.filter((function(A){return 17===A.type})).map((function(A){return A.number}));return 6===e.length?e:null},matrix3d:function(A){var e=A.filter((function(A){return 17===A.type})).map((function(A){return A.number})),t=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],16===e.length?[t,n,i,r,s,o]:null}},ah={type:16,number:50,flags:4},ch=[ah,ah],dh={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(A,e){var t=e.filter(Nd);return 2!==t.length?ch:[t[0],t[1]]}},lh={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"hidden":return 1;case"collapse":return 2;default:return 0}}};(Lu=xu||(xu={})).NORMAL="normal",Lu.BREAK_ALL="break-all",Lu.KEEP_ALL="keep-all";for(var uh={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){switch(e){case"break-all":return xu.BREAK_ALL;case"keep-all":return xu.KEEP_ALL;default:return xu.NORMAL}}},hh={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(A,e){if(20===e.type)return{auto:!0,order:0};if(Id(e))return{auto:!1,order:e.number};throw new Error("Invalid z-index number parsed")}},gh=function(A,e){if(15===e.type)switch(e.unit.toLowerCase()){case"s":return 1e3*e.number;case"ms":return e.number}throw new Error("Unsupported time type")},ph={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(A,e){return Id(e)?e.number:1}},mh={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},fh={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(A,e){return e.filter(Pd).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}))}},Bh={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(A,e){var t=[],n=[];return e.forEach((function(A){switch(A.type){case 20:case 0:t.push(A.value);break;case 17:t.push(A.number.toString());break;case 4:n.push(t.join(" ")),t.length=0}})),t.length&&n.push(t.join(" ")),n.map((function(A){return-1===A.indexOf(" ")?A:"'".concat(A,"'")}))}},wh={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},vh={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(A,e){return Id(e)?e.number:Pd(e)&&"bold"===e.value?700:400}},Ch={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return e.filter(Pd).map((function(A){return A.value}))}},yh={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){switch(e){case"oblique":return"oblique";case"italic":return"italic";default:return"normal"}}},bh=function(A,e){return 0!==(A&e)},Qh={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(A,e){if(0===e.length)return[];var t=e[0];return 20===t.type&&"none"===t.value?[]:e}},Uh={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(A,e){if(0===e.length)return null;var t=e[0];if(20===t.type&&"none"===t.value)return null;for(var n=[],i=e.filter(Dd),r=0;r<i.length;r++){var s=i[r],o=i[r+1];if(20===s.type){var a=o&&Id(o)?o.number:1;n.push({counter:s.value,increment:a})}}return n}},kh={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(A,e){if(0===e.length)return[];for(var t=[],n=e.filter(Dd),i=0;i<n.length;i++){var r=n[i],s=n[i+1];if(Pd(r)&&"none"!==r.value){var o=s&&Id(s)?s.number:0;t.push({counter:r.value,reset:o})}}return t}},Eh={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(A,e){return e.filter(Sd).map((function(A){return gh(0,A)}))}},Fh={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(A,e){if(0===e.length)return null;var t=e[0];if(20===t.type&&"none"===t.value)return null;var n=[],i=e.filter(Hd);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}},Th=function(A,e,t){if(!A)return"";var n=A[Math.min(e,A.length-1)];return n?t?n.open:n.close:""},Sh={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return 1===e.length&&Rd(e[0],"none")?[]:Ld(e).map((function(e){for(var t={color:255,offsetX:_d,offsetY:_d,blur:_d,spread:_d,inset:!1},n=0,i=0;i<e.length;i++){var r=e[i];Rd(r,"inset")?t.inset=!0:Md(r)?(0===n?t.offsetX=r:1===n?t.offsetY=r:2===n?t.blur=r:t.spread=r,n++):t.color=Fl(A,r)}return t}))}},Ih={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(A,e){var t=[];return e.filter(Pd).forEach((function(A){switch(A.value){case"stroke":t.push(1);break;case"fill":t.push(0);break;case"markers":t.push(2)}})),[0,1,2].forEach((function(A){-1===t.indexOf(A)&&t.push(A)})),t}},Ph={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},Hh={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(A,e){return Sd(e)?e.number:0}},Rh={name:"objectFit",initialValue:"fill",prefix:!1,type:1,parse:function(A,e){return e.filter(Pd).reduce((function(A,e){return A|Dh(e.value)}),0)}},Dh=function(A){switch(A){case"contain":return 2;case"cover":return 4;case"none":return 8;case"scale-down":return 16}return 0},xh=function(){function A(A,e){var t,n;this.animationDuration=Mh(A,Eh,e.animationDuration),this.backgroundClip=Mh(A,Ll,e.backgroundClip),this.backgroundColor=Mh(A,Ol,e.backgroundColor),this.backgroundImage=Mh(A,eu,e.backgroundImage),this.backgroundOrigin=Mh(A,tu,e.backgroundOrigin),this.backgroundPosition=Mh(A,nu,e.backgroundPosition),this.backgroundRepeat=Mh(A,iu,e.backgroundRepeat),this.backgroundSize=Mh(A,au,e.backgroundSize),this.borderTopColor=Mh(A,lu,e.borderTopColor),this.borderRightColor=Mh(A,uu,e.borderRightColor),this.borderBottomColor=Mh(A,hu,e.borderBottomColor),this.borderLeftColor=Mh(A,gu,e.borderLeftColor),this.borderTopLeftRadius=Mh(A,mu,e.borderTopLeftRadius),this.borderTopRightRadius=Mh(A,fu,e.borderTopRightRadius),this.borderBottomRightRadius=Mh(A,Bu,e.borderBottomRightRadius),this.borderBottomLeftRadius=Mh(A,wu,e.borderBottomLeftRadius),this.borderTopStyle=Mh(A,Cu,e.borderTopStyle),this.borderRightStyle=Mh(A,yu,e.borderRightStyle),this.borderBottomStyle=Mh(A,bu,e.borderBottomStyle),this.borderLeftStyle=Mh(A,Qu,e.borderLeftStyle),this.borderTopWidth=Mh(A,ku,e.borderTopWidth),this.borderRightWidth=Mh(A,Eu,e.borderRightWidth),this.borderBottomWidth=Mh(A,Fu,e.borderBottomWidth),this.borderLeftWidth=Mh(A,Tu,e.borderLeftWidth),this.boxShadow=Mh(A,Sh,e.boxShadow),this.color=Mh(A,Su,e.color),this.direction=Mh(A,Iu,e.direction),this.display=Mh(A,Pu,e.display),this.float=Mh(A,Ru,e.cssFloat),this.fontFamily=Mh(A,Bh,e.fontFamily),this.fontSize=Mh(A,wh,e.fontSize),this.fontStyle=Mh(A,yh,e.fontStyle),this.fontVariant=Mh(A,Ch,e.fontVariant),this.fontWeight=Mh(A,vh,e.fontWeight),this.letterSpacing=Mh(A,Du,e.letterSpacing),this.lineBreak=Mh(A,Ou,e.lineBreak),this.lineHeight=Mh(A,Mu,e.lineHeight),this.listStyleImage=Mh(A,Ku,e.listStyleImage),this.listStylePosition=Mh(A,_u,e.listStylePosition),this.listStyleType=Mh(A,Vu,e.listStyleType),this.marginTop=Mh(A,ju,e.marginTop),this.marginRight=Mh(A,Ju,e.marginRight),this.marginBottom=Mh(A,Wu,e.marginBottom),this.marginLeft=Mh(A,Xu,e.marginLeft),this.opacity=Mh(A,ph,e.opacity);var i=Mh(A,Yu,e.overflow);this.overflowX=i[0],this.overflowY=i[i.length>1?1:0],this.overflowWrap=Mh(A,qu,e.overflowWrap),this.paddingTop=Mh(A,Zu,e.paddingTop),this.paddingRight=Mh(A,zu,e.paddingRight),this.paddingBottom=Mh(A,Ah,e.paddingBottom),this.paddingLeft=Mh(A,eh,e.paddingLeft),this.paintOrder=Mh(A,Ih,e.paintOrder),this.position=Mh(A,nh,e.position),this.textAlign=Mh(A,th,e.textAlign),this.textDecorationColor=Mh(A,mh,null!==(t=e.textDecorationColor)&&void 0!==t?t:e.color),this.textDecorationLine=Mh(A,fh,null!==(n=e.textDecorationLine)&&void 0!==n?n:e.textDecoration),this.textShadow=Mh(A,ih,e.textShadow),this.textTransform=Mh(A,rh,e.textTransform),this.transform=Mh(A,sh,e.transform),this.transformOrigin=Mh(A,dh,e.transformOrigin),this.visibility=Mh(A,lh,e.visibility),this.webkitTextStrokeColor=Mh(A,Ph,e.webkitTextStrokeColor),this.webkitTextStrokeWidth=Mh(A,Hh,e.webkitTextStrokeWidth),this.wordBreak=Mh(A,uh,e.wordBreak),this.zIndex=Mh(A,hh,e.zIndex),this.objectFit=Mh(A,Rh,e.objectFit)}return A.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&0===this.visibility},A.prototype.isTransparent=function(){return zd(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 bh(this.display,4)||bh(this.display,33554432)||bh(this.display,268435456)||bh(this.display,536870912)||bh(this.display,67108864)||bh(this.display,134217728)},A}(),Lh=function(A,e){this.content=Mh(A,Qh,e.content),this.quotes=Mh(A,Fh,e.quotes)},Oh=function(A,e){this.counterIncrement=Mh(A,Uh,e.counterIncrement),this.counterReset=Mh(A,kh,e.counterReset)},Mh=function(A,e,t){var n=new Fd,i=null!=t?t.toString():e.initialValue;n.write(i);var r=new Td(n.read());switch(e.type){case 2:var s=r.parseComponentValue();return e.parse(A,Pd(s)?s.value:e.initialValue);case 0:return e.parse(A,r.parseComponentValue());case 1:return e.parse(A,r.parseComponentValues());case 4:return r.parseComponentValue();case 3:switch(e.format){case"angle":return Yd(0,r.parseComponentValue());case"color":return Fl(A,r.parseComponentValue());case"image":return zl(A,r.parseComponentValue());case"length":var o=r.parseComponentValue();return Md(o)?o:_d;case"length-percentage":var a=r.parseComponentValue();return Nd(a)?a:_d;case"time":return gh(0,r.parseComponentValue())}}},Nh=function(A,e){var t=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===t||e===t},Kh=function(A,e){this.context=A,this.textNodes=[],this.elements=[],this.flags=0,Nh(e,3),this.styles=new xh(A,window.getComputedStyle(e,null)),Kg(e)&&(this.styles.animationDuration.some((function(A){return A>0}))&&(e.style.animationDuration="0s"),null!==this.styles.transform&&(e.style.transform="none")),this.bounds=_a(this.context,e),Nh(e,4)&&(this.flags|=16)},_h="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Vh=0;Vh<64;Vh++)_h["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(Vh)]=Vh;for(var Gh=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},jh=function(){function A(A,e,t,n,i,r){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=n,this.index=i,this.data=r}return A.prototype.get=function(A){var e;if(A>=0){if(A<55296||A>56319&&A<=65535)return e=((e=this.index[A>>5])<<2)+(31&A),this.data[e];if(A<=65535)return e=((e=this.index[2048+(A-55296>>5)])<<2)+(31&A),this.data[e];if(A<this.highStart)return e=2080+(A>>11),e=this.index[e],e+=A>>5&63,e=((e=this.index[e])<<2)+(31&A),this.data[e];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},A}(),Jh="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Wh=0;Wh<64;Wh++)Jh["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(Wh)]=Wh;var Xh,Yh,qh=8,$h=9,Zh=11,zh=12,Ag=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,A);var t=A.length;if(!t)return"";for(var n=[],i=-1,r="";++i<t;){var s=A[i];s<=65535?n.push(s):(s-=65536,n.push(55296+(s>>10),s%1024+56320)),(i+1===t||n.length>16384)&&(r+=String.fromCharCode.apply(String,n),n.length=0)}return r},eg=function(){var A=function(A){var e,t,n,i,r,s=.75*A.length,o=A.length,a=0;"="===A[A.length-1]&&(s--,"="===A[A.length-2]&&s--);var c="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(s):new Array(s),d=Array.isArray(c)?c:new Uint8Array(c);for(e=0;e<o;e+=4)t=_h[A.charCodeAt(e)],n=_h[A.charCodeAt(e+1)],i=_h[A.charCodeAt(e+2)],r=_h[A.charCodeAt(e+3)],d[a++]=t<<2|n>>4,d[a++]=(15&n)<<4|i>>2,d[a++]=(3&i)<<6|63&r;return c}("AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA="),e=Array.isArray(A)?function(A){for(var e=A.length,t=[],n=0;n<e;n+=4)t.push(A[n+3]<<24|A[n+2]<<16|A[n+1]<<8|A[n]);return t}(A):new Uint32Array(A),t=Array.isArray(A)?function(A){for(var e=A.length,t=[],n=0;n<e;n+=2)t.push(A[n+1]<<8|A[n]);return t}(A):new Uint16Array(A),n=Gh(t,12,e[4]/2),i=2===e[5]?Gh(t,(24+e[4])/2):function(A,e,t){return A.slice?A.slice(e,t):new Uint32Array(Array.prototype.slice.call(A,e,t))}(e,Math.ceil((24+e[4])/4));return new jh(e[0],e[1],e[2],e[3],n,i)}(),tg="×",ng=function(A){return eg.get(A)},ig=function(A,e,t){var n=t-2,i=e[n],r=e[t-1],s=e[t];if(2===r&&3===s)return tg;if(2===r||3===r||4===r)return"÷";if(2===s||3===s||4===s)return"÷";if(r===qh&&-1!==[qh,$h,Zh,zh].indexOf(s))return tg;if(!(r!==Zh&&r!==$h||s!==$h&&10!==s))return tg;if((r===zh||10===r)&&10===s)return tg;if(13===s||5===s)return tg;if(7===s)return tg;if(1===r)return tg;if(13===r&&14===s){for(;5===i;)i=e[--n];if(14===i)return tg}if(15===r&&15===s){for(var o=0;15===i;)o++,i=e[--n];if(o%2==0)return tg}return"÷"},rg=function(A){var e=function(A){for(var e=[],t=0,n=A.length;t<n;){var i=A.charCodeAt(t++);if(i>=55296&&i<=56319&&t<n){var r=A.charCodeAt(t++);56320==(64512&r)?e.push(((1023&i)<<10)+(1023&r)+65536):(e.push(i),t--)}else e.push(i)}return e}(A),t=e.length,n=0,i=0,r=e.map(ng);return{next:function(){if(n>=t)return{done:!0,value:null};for(var A=tg;n<t&&(A=ig(0,r,++n))===tg;);if(A!==tg||n===t){var s=Ag.apply(null,e.slice(i,n));return i=n,{value:s,done:!1}}return{done:!0,value:null}}}},sg=function(A){return 0===A[0]&&255===A[1]&&0===A[2]&&255===A[3]},og=function(A,e,t,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",A.toString()),s.setAttributeNS(null,"height",e.toString()),o.setAttributeNS(null,"width","100%"),o.setAttributeNS(null,"height","100%"),o.setAttributeNS(null,"x",t.toString()),o.setAttributeNS(null,"y",n.toString()),o.setAttributeNS(null,"externalResourcesRequired","true"),s.appendChild(o),o.appendChild(i),s},ag=function(A){return new Promise((function(e,t){var n=new Image;n.onload=function(){return e(n)},n.onerror=t,n.src="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent((new XMLSerializer).serializeToString(A)))}))},cg={get SUPPORT_RANGE_BOUNDS(){var A=function(A){if(A.createRange){var e=A.createRange();if(e.getBoundingClientRect){var t=A.createElement("boundtest");t.style.height="".concat(123,"px"),t.style.display="block",A.body.appendChild(t),e.selectNode(t);var n=e.getBoundingClientRect(),i=Math.round(n.height);if(A.body.removeChild(t),123===i)return!0}}return!1}(document);return Object.defineProperty(cg,"SUPPORT_RANGE_BOUNDS",{value:A}),A},get SUPPORT_WORD_BREAKING(){var A=cg.SUPPORT_RANGE_BOUNDS&&function(A){var e=A.createElement("boundtest");e.style.width="50px",e.style.display="block",e.style.fontSize="12px",e.style.letterSpacing="0px",e.style.wordSpacing="0px",A.body.appendChild(e);var t=A.createRange();e.innerHTML="function"==typeof"".repeat?"👨".repeat(10):"";var n=e.firstChild,i=Va(n.data).map((function(A){return Ga(A)})),r=0,s={},o=i.every((function(A,e){t.setStart(n,r),t.setEnd(n,r+A.length);var i=t.getBoundingClientRect();r+=A.length;var o=i.x>s.x||i.y>s.y;return s=i,0===e||o}));return A.body.removeChild(e),o}(document);return Object.defineProperty(cg,"SUPPORT_WORD_BREAKING",{value:A}),A},get SUPPORT_SVG_DRAWING(){var A=function(A){var e=new Image,t=A.createElement("canvas"),n=t.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),t.toDataURL()}catch(i){return!1}return!0}(document);return Object.defineProperty(cg,"SUPPORT_SVG_DRAWING",{value:A}),A},get SUPPORT_FOREIGNOBJECT_DRAWING(){var A="function"==typeof Array.from&&"function"==typeof window.fetch?function(A){var e=A.createElement("canvas"),t=100;e.width=t,e.height=t;var n=e.getContext("2d");if(!n)return Promise.reject(!1);n.fillStyle="rgb(0, 255, 0)",n.fillRect(0,0,t,t);var i=new Image,r=e.toDataURL();i.src=r;var s=og(t,t,0,0,i);return n.fillStyle="red",n.fillRect(0,0,t,t),ag(s).then((function(e){n.drawImage(e,0,0);var i=n.getImageData(0,0,t,t).data;n.fillStyle="red",n.fillRect(0,0,t,t);var s=A.createElement("div");return s.style.backgroundImage="url(".concat(r,")"),s.style.height="".concat(t,"px"),sg(i)?ag(og(t,t,0,0,s)):Promise.reject(!1)})).then((function(A){return n.drawImage(A,0,0),sg(n.getImageData(0,0,t,t).data)})).catch((function(){return!1}))}(document):Promise.resolve(!1);return Object.defineProperty(cg,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:A}),A},get SUPPORT_CORS_IMAGES(){var A=void 0!==(new Image).crossOrigin;return Object.defineProperty(cg,"SUPPORT_CORS_IMAGES",{value:A}),A},get SUPPORT_RESPONSE_TYPE(){var A="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(cg,"SUPPORT_RESPONSE_TYPE",{value:A}),A},get SUPPORT_CORS_XHR(){var A="withCredentials"in new XMLHttpRequest;return Object.defineProperty(cg,"SUPPORT_CORS_XHR",{value:A}),A},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var A=!("undefined"==typeof Intl||!Intl.Segmenter);return Object.defineProperty(cg,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:A}),A}},dg=function(A,e){this.text=A,this.bounds=e},lg=function(A,e,t){var n=A.ownerDocument;if(!n)throw new Error("Node has no owner document");var i=n.createRange();return i.setStart(A,e),i.setEnd(A,e+t),i},ug=function(A){if(cg.SUPPORT_NATIVE_TEXT_SEGMENTATION){var e=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(e.segment(A)).map((function(A){return A.segment}))}return function(A){for(var e,t=rg(A),n=[];!(e=t.next()).done;)e.value&&n.push(e.value.slice());return n}(A)},hg=[32,160,4961,65792,65793,4153,4241],gg=function(A,e){for(var t,n=function(A,e){var t=Va(A),n=function(A,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var t=function(A,e){void 0===e&&(e="strict");var t=[],n=[],i=[];return A.forEach((function(A,r){var s=xc.get(A);if(s>50?(i.push(!0),s-=50):i.push(!1),-1!==["normal","auto","loose"].indexOf(e)&&-1!==[8208,8211,12316,12448].indexOf(A))return n.push(r),t.push(16);if(4===s||11===s){if(0===r)return n.push(r),t.push(bc);var o=t[r-1];return-1===Kc.indexOf(o)?(n.push(n[r-1]),t.push(o)):(n.push(r),t.push(bc))}return n.push(r),31===s?t.push("strict"===e?mc:Fc):s===Pc||29===s?t.push(bc):43===s?A>=131072&&A<=196605||A>=196608&&A<=262141?t.push(Fc):t.push(bc):void t.push(s)})),[n,t,i]}(A,e.lineBreak),n=t[0],i=t[1],r=t[2];return"break-all"!==e.wordBreak&&"break-word"!==e.wordBreak||(i=i.map((function(A){return-1!==[wc,bc,Pc].indexOf(A)?Fc:A}))),[n,i,"keep-all"===e.wordBreak?r.map((function(e,t){return e&&A[t]>=19968&&A[t]<=40959})):void 0]}(t,e),i=n[0],r=n[1],s=n[2],o=t.length,a=0,c=0;return{next:function(){if(c>=o)return{done:!0,value:null};for(var A=Rc;c<o&&(A=Jc(t,r,i,++c,s))===Rc;);if(A!==Rc||c===o){var e=new Wc(t,A,a,c);return a=c,{value:e,done:!1}}return{done:!0,value:null}}}}(A,{lineBreak:e.lineBreak,wordBreak:"break-word"===e.overflowWrap?"break-word":e.wordBreak}),i=[],r=function(){if(t.value){var A=t.value.slice(),e=Va(A),n="";e.forEach((function(A){-1===hg.indexOf(A)?n+=Ga(A):(n.length&&i.push(n),i.push(Ga(A)),n="")})),n.length&&i.push(n)}};!(t=n.next()).done;)r();return i},pg=function(A,e,t){this.text=mg(e.data,t.textTransform),this.textBounds=function(A,e,t,n){var i=function(A,e){return 0!==e.letterSpacing?ug(A):function(A,e){if(cg.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(t.segment(A)).map((function(A){return A.segment}))}return gg(A,e)}(A,e)}(e,t),r=[],s=0;return i.forEach((function(e){if(t.textDecorationLine.length||e.trim().length>0)if(cg.SUPPORT_RANGE_BOUNDS){var i=lg(n,s,e.length).getClientRects();if(i.length>1){var o=ug(e),a=0;o.forEach((function(e){r.push(new dg(e,Ka.fromDOMRectList(A,lg(n,a+s,e.length).getClientRects()))),a+=e.length}))}else r.push(new dg(e,Ka.fromDOMRectList(A,i)))}else{var c=n.splitText(e.length);r.push(new dg(e,function(A,e){var t=e.ownerDocument;if(t){var n=t.createElement("html2canvaswrapper");n.appendChild(e.cloneNode(!0));var i=e.parentNode;if(i){i.replaceChild(n,e);var r=_a(A,n);return n.firstChild&&i.replaceChild(n.firstChild,n),r}}return Ka.EMPTY}(A,n))),n=c}else cg.SUPPORT_RANGE_BOUNDS||(n=n.splitText(e.length));s+=e.length})),r}(A,this.text,t,e)},mg=function(A,e){switch(e){case 1:return A.toLowerCase();case 3:return A.replace(fg,Bg);case 2:return A.toUpperCase();default:return A}},fg=/(^|\s|:|-|\(|\))([a-z])/g,Bg=function(A,e,t){return A.length>0?e+t.toUpperCase():A},wg=function(A){function e(e,t){var n=A.call(this,e,t)||this;return n.src=t.currentSrc||t.src,n.intrinsicWidth=t.naturalWidth,n.intrinsicHeight=t.naturalHeight,n.context.cache.addImage(n.src),n}return xa(e,A),e}(Kh),vg=function(A){function e(e,t){var n=A.call(this,e,t)||this;return n.canvas=t,n.intrinsicWidth=t.width,n.intrinsicHeight=t.height,n}return xa(e,A),e}(Kh),Cg=function(A){function e(e,t){var n=A.call(this,e,t)||this,i=new XMLSerializer,r=_a(e,t);return t.setAttribute("width","".concat(r.width,"px")),t.setAttribute("height","".concat(r.height,"px")),n.svg="data:image/svg+xml,".concat(encodeURIComponent(i.serializeToString(t))),n.intrinsicWidth=t.width.baseVal.value,n.intrinsicHeight=t.height.baseVal.value,n.context.cache.addImage(n.svg),n}return xa(e,A),e}(Kh),yg=function(A){function e(e,t){var n=A.call(this,e,t)||this;return n.value=t.value,n}return xa(e,A),e}(Kh),bg=function(A){function e(e,t){var n=A.call(this,e,t)||this;return n.start=t.start,n.reversed="boolean"==typeof t.reversed&&!0===t.reversed,n}return xa(e,A),e}(Kh),Qg=[{type:15,flags:0,unit:"px",number:3}],Ug=[{type:16,flags:0,number:50}],kg="checkbox",Eg="radio",Fg=707406591,Tg=function(A){function e(e,t){var n,i,r,s=A.call(this,e,t)||this;switch(s.type=t.type.toLowerCase(),s.checked=t.checked,s.value=0===(i="password"===(n=t).type?new Array(n.value.length+1).join("•"):n.value).length?n.placeholder||"":i,s.type!==kg&&s.type!==Eg||(s.styles.backgroundColor=3739148031,s.styles.borderTopColor=s.styles.borderRightColor=s.styles.borderBottomColor=s.styles.borderLeftColor=2779096575,s.styles.borderTopWidth=s.styles.borderRightWidth=s.styles.borderBottomWidth=s.styles.borderLeftWidth=1,s.styles.borderTopStyle=s.styles.borderRightStyle=s.styles.borderBottomStyle=s.styles.borderLeftStyle=1,s.styles.backgroundClip=[0],s.styles.backgroundOrigin=[0],s.bounds=(r=s.bounds).width>r.height?new Ka(r.left+(r.width-r.height)/2,r.top,r.height,r.height):r.width<r.height?new Ka(r.left,r.top+(r.height-r.width)/2,r.width,r.width):r),s.type){case kg:s.styles.borderTopRightRadius=s.styles.borderTopLeftRadius=s.styles.borderBottomRightRadius=s.styles.borderBottomLeftRadius=Qg;break;case Eg:s.styles.borderTopRightRadius=s.styles.borderTopLeftRadius=s.styles.borderBottomRightRadius=s.styles.borderBottomLeftRadius=Ug}return s}return xa(e,A),e}(Kh),Sg=function(A){function e(e,t){var n=A.call(this,e,t)||this,i=t.options[t.selectedIndex||0];return n.value=i&&i.text||"",n}return xa(e,A),e}(Kh),Ig=function(A){function e(e,t){var n=A.call(this,e,t)||this;return n.value=t.value,n}return xa(e,A),e}(Kh),Pg=function(A){function e(e,t){var n=A.call(this,e,t)||this;n.src=t.src,n.width=parseInt(t.width,10)||0,n.height=parseInt(t.height,10)||0,n.backgroundColor=n.styles.backgroundColor;try{if(t.contentWindow&&t.contentWindow.document&&t.contentWindow.document.documentElement){n.tree=xg(e,t.contentWindow.document.documentElement);var i=t.contentWindow.document.documentElement?Dl(e,getComputedStyle(t.contentWindow.document.documentElement).backgroundColor):xl.TRANSPARENT,r=t.contentWindow.document.body?Dl(e,getComputedStyle(t.contentWindow.document.body).backgroundColor):xl.TRANSPARENT;n.backgroundColor=zd(i)?zd(r)?n.styles.backgroundColor:r:i}}catch(s){}return n}return xa(e,A),e}(Kh),Hg=["OL","UL","MENU"],Rg=function(A,e,t,n){for(var i=e.firstChild,r=void 0;i;i=r)if(r=i.nextSibling,Mg(i)&&i.data.length>0)t.textNodes.push(new pg(A,i,t.styles));else if(Ng(i))if(ep(i)&&i.assignedNodes)i.assignedNodes().forEach((function(e){return Rg(A,e,t,n)}));else{var s=Dg(A,i);s.styles.isVisible()&&(Lg(i,s,n)?s.flags|=4:Og(s.styles)&&(s.flags|=2),-1!==Hg.indexOf(i.tagName)&&(s.flags|=8),t.elements.push(s),i.slot,i.shadowRoot?Rg(A,i.shadowRoot,s,n):zg(i)||Jg(i)||Ap(i)||Rg(A,i,s,n))}},Dg=function(A,e){return qg(e)?new wg(A,e):Xg(e)?new vg(A,e):Jg(e)?new Cg(A,e):Vg(e)?new yg(A,e):Gg(e)?new bg(A,e):jg(e)?new Tg(A,e):Ap(e)?new Sg(A,e):zg(e)?new Ig(A,e):$g(e)?new Pg(A,e):new Kh(A,e)},xg=function(A,e){var t=Dg(A,e);return t.flags|=4,Rg(A,e,t,t),t},Lg=function(A,e,t){return e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||Wg(A)&&t.styles.isTransparent()},Og=function(A){return A.isPositioned()||A.isFloating()},Mg=function(A){return A.nodeType===Node.TEXT_NODE},Ng=function(A){return A.nodeType===Node.ELEMENT_NODE},Kg=function(A){return Ng(A)&&void 0!==A.style&&!_g(A)},_g=function(A){return"object"==typeof A.className},Vg=function(A){return"LI"===A.tagName},Gg=function(A){return"OL"===A.tagName},jg=function(A){return"INPUT"===A.tagName},Jg=function(A){return"svg"===A.tagName},Wg=function(A){return"BODY"===A.tagName},Xg=function(A){return"CANVAS"===A.tagName},Yg=function(A){return"VIDEO"===A.tagName},qg=function(A){return"IMG"===A.tagName},$g=function(A){return"IFRAME"===A.tagName},Zg=function(A){return"STYLE"===A.tagName},zg=function(A){return"TEXTAREA"===A.tagName},Ap=function(A){return"SELECT"===A.tagName},ep=function(A){return"SLOT"===A.tagName},tp=function(A){return A.tagName.indexOf("-")>0},np=function(){function A(){this.counters={}}return A.prototype.getCounterValue=function(A){var e=this.counters[A];return e&&e.length?e[e.length-1]:1},A.prototype.getCounterValues=function(A){return this.counters[A]||[]},A.prototype.pop=function(A){var e=this;A.forEach((function(A){return e.counters[A].pop()}))},A.prototype.parse=function(A){var e=this,t=A.counterIncrement,n=A.counterReset,i=!0;null!==t&&t.forEach((function(A){var t=e.counters[A.counter];t&&0!==A.increment&&(i=!1,t.length||t.push(1),t[Math.max(0,t.length-1)]+=A.increment)}));var r=[];return i&&n.forEach((function(A){var t=e.counters[A.counter];r.push(A.counter),t||(t=e.counters[A.counter]=[]),t.push(A.reset)})),r},A}(),ip={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"]},rp={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:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},sp={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:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},op={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:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},ap=function(A,e,t,n,i,r){return A<e||A>t?fp(A,i,r.length>0):n.integers.reduce((function(e,t,i){for(;A>=t;)A-=t,e+=n.values[i];return e}),"")+r},cp=function(A,e,t,n){var i="";do{t||A--,i=n(A)+i,A/=e}while(A*e>=e);return i},dp=function(A,e,t,n,i){var r=t-e+1;return(A<0?"-":"")+(cp(Math.abs(A),r,n,(function(A){return Ga(Math.floor(A%r)+e)}))+i)},lp=function(A,e,t){void 0===t&&(t=". ");var n=e.length;return cp(Math.abs(A),n,!1,(function(A){return e[Math.floor(A%n)]}))+t},up=function(A,e,t,n,i,r){if(A<-9999||A>9999)return fp(A,4,i.length>0);var s=Math.abs(A),o=i;if(0===s)return e[0]+o;for(var a=0;s>0&&a<=4;a++){var c=s%10;0===c&&bh(r,1)&&""!==o?o=e[c]+o:c>1||1===c&&0===a||1===c&&1===a&&bh(r,2)||1===c&&1===a&&bh(r,4)&&A>100||1===c&&a>1&&bh(r,8)?o=e[c]+(a>0?t[a-1]:"")+o:1===c&&a>0&&(o=t[a-1]+o),s=Math.floor(s/10)}return(A<0?n:"")+o},hp="十百千萬",gp="拾佰仟萬",pp="マイナス",mp="마이너스",fp=function(A,e,t){var n=t?". ":"",i=t?"、":"",r=t?", ":"",s=t?" ":"";switch(e){case 0:return"•"+s;case 1:return"◦"+s;case 2:return"◾"+s;case 5:var o=dp(A,48,57,!0,n);return o.length<4?"0".concat(o):o;case 4:return lp(A,"〇一二三四五六七八九",i);case 6:return ap(A,1,3999,ip,3,n).toLowerCase();case 7:return ap(A,1,3999,ip,3,n);case 8:return dp(A,945,969,!1,n);case 9:return dp(A,97,122,!1,n);case 10:return dp(A,65,90,!1,n);case 11:return dp(A,1632,1641,!0,n);case 12:case 49:return ap(A,1,9999,rp,3,n);case 35:return ap(A,1,9999,rp,3,n).toLowerCase();case 13:return dp(A,2534,2543,!0,n);case 14:case 30:return dp(A,6112,6121,!0,n);case 15:return lp(A,"子丑寅卯辰巳午未申酉戌亥",i);case 16:return lp(A,"甲乙丙丁戊己庚辛壬癸",i);case 17:case 48:return up(A,"零一二三四五六七八九",hp,"負",i,14);case 47:return up(A,"零壹貳參肆伍陸柒捌玖",gp,"負",i,15);case 42:return up(A,"零一二三四五六七八九",hp,"负",i,14);case 41:return up(A,"零壹贰叁肆伍陆柒捌玖",gp,"负",i,15);case 26:return up(A,"〇一二三四五六七八九","十百千万",pp,i,0);case 25:return up(A,"零壱弐参四伍六七八九","拾百千万",pp,i,7);case 31:return up(A,"영일이삼사오육칠팔구","십백천만",mp,r,7);case 33:return up(A,"零一二三四五六七八九","十百千萬",mp,r,0);case 32:return up(A,"零壹貳參四五六七八九","拾百千",mp,r,7);case 18:return dp(A,2406,2415,!0,n);case 20:return ap(A,1,19999,op,3,n);case 21:return dp(A,2790,2799,!0,n);case 22:return dp(A,2662,2671,!0,n);case 52:return ap(A,1,10999,sp,3,n);case 23:return lp(A,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return lp(A,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return dp(A,3302,3311,!0,n);case 28:return lp(A,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",i);case 29:return lp(A,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",i);case 34:return dp(A,3792,3801,!0,n);case 37:return dp(A,6160,6169,!0,n);case 38:return dp(A,4160,4169,!0,n);case 39:return dp(A,2918,2927,!0,n);case 40:return dp(A,1776,1785,!0,n);case 43:return dp(A,3046,3055,!0,n);case 44:return dp(A,3174,3183,!0,n);case 45:return dp(A,3664,3673,!0,n);case 46:return dp(A,3872,3881,!0,n);default:return dp(A,48,57,!0,n)}},Bp="data-html2canvas-ignore",wp=function(){function A(A,e,t){if(this.context=A,this.options=t,this.scrolledElements=[],this.referenceElement=e,this.counters=new np,this.quoteDepth=0,!e.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(e.ownerDocument.documentElement,!1)}return A.prototype.toIFrame=function(A,e){var t=this,n=yp(A,e);if(!n.contentWindow)return Promise.reject("Unable to find iframe window");var i=A.defaultView.pageXOffset,r=A.defaultView.pageYOffset,s=n.contentWindow,o=s.document,a=Up(n).then((function(){return Oa(t,void 0,void 0,(function(){var A,t;return Ma(this,(function(i){switch(i.label){case 0:return this.scrolledElements.forEach(Sp),s&&(s.scrollTo(e.left,e.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||s.scrollY===e.top&&s.scrollX===e.left||(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(s.scrollX-e.left,s.scrollY-e.top,0,0))),A=this.options.onclone,void 0===(t=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:i.sent(),i.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,Qp(o)]:[3,4];case 3:i.sent(),i.label=4;case 4:return"function"==typeof A?[2,Promise.resolve().then((function(){return A(o,t)})).then((function(){return n}))]:[2,n]}}))}))})),c=o.adoptNode(this.documentElement);return xp(c,o),o.open(),o.write("".concat(Fp(document.doctype),"<html></html>")),Tp(this.referenceElement.ownerDocument,i,r),o.replaceChild(c,o.documentElement),o.close(),a},A.prototype.createElementClone=function(A){if(Nh(A,2),Xg(A))return this.createCanvasClone(A);if(Yg(A))return this.createVideoClone(A);if(Zg(A))return this.createStyleClone(A);var e=A.cloneNode(!1);return qg(e)&&(qg(A)&&A.currentSrc&&A.currentSrc!==A.src&&(e.src=A.currentSrc,e.srcset=""),"lazy"===e.loading&&(e.loading="eager")),tp(e)?this.createCustomElementClone(e):e},A.prototype.createCustomElementClone=function(A){var e=document.createElement("html2canvascustomelement");return Ep(A.style,e),e},A.prototype.createStyleClone=function(A){try{var e=A.sheet;if(e&&e.cssRules){var t=[].slice.call(e.cssRules,0).reduce((function(A,e){return e&&"string"==typeof e.cssText?A+e.cssText:A}),""),n=A.cloneNode(!1);return n.textContent=t,n}}catch(i){if(this.context.logger.error("Unable to access cssRules property",i),"SecurityError"!==i.name)throw i}return A.cloneNode(!1)},A.prototype.createCanvasClone=function(A){var e;if(this.options.inlineImages&&A.ownerDocument){var t=A.ownerDocument.createElement("img");try{return t.src=A.toDataURL(),t}catch(a){this.context.logger.info("Unable to inline canvas contents, canvas is tainted",A)}}var n=A.cloneNode(!1);try{n.width=A.width,n.height=A.height;var i=A.getContext("2d"),r=n.getContext("2d",{willReadFrequently:!0});if(r)if(!this.options.allowTaint&&i)r.putImageData(i.getImageData(0,0,A.width,A.height),0,0);else{var s=null!==(e=A.getContext("webgl2"))&&void 0!==e?e:A.getContext("webgl");if(s){var o=s.getContextAttributes();!1===(null==o?void 0:o.preserveDrawingBuffer)&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",A)}r.drawImage(A,0,0)}return n}catch(a){this.context.logger.info("Unable to clone canvas as it is tainted",A)}return n},A.prototype.createVideoClone=function(A){var e=A.ownerDocument.createElement("canvas");e.width=A.offsetWidth,e.height=A.offsetHeight;var t=e.getContext("2d");try{return t&&(t.drawImage(A,0,0,e.width,e.height),this.options.allowTaint||t.getImageData(0,0,e.width,e.height)),e}catch(i){this.context.logger.info("Unable to clone video as it is tainted",A)}var n=A.ownerDocument.createElement("canvas");return n.width=A.offsetWidth,n.height=A.offsetHeight,n},A.prototype.appendChildNode=function(A,e,t){Ng(e)&&("SCRIPT"===e.tagName||e.hasAttribute(Bp)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(e))||this.options.copyStyles&&Ng(e)&&Zg(e)||A.appendChild(this.cloneNode(e,t))},A.prototype.cloneChildNodes=function(A,e,t){for(var n=this,i=A.shadowRoot?A.shadowRoot.firstChild:A.firstChild;i;i=i.nextSibling)if(Ng(i)&&ep(i)&&"function"==typeof i.assignedNodes){var r=i.assignedNodes();r.length&&r.forEach((function(A){return n.appendChildNode(e,A,t)}))}else this.appendChildNode(e,i,t)},A.prototype.cloneNode=function(A,e){if(Mg(A))return document.createTextNode(A.data);if(!A.ownerDocument)return A.cloneNode(!1);var t=A.ownerDocument.defaultView;if(t&&Ng(A)&&(Kg(A)||_g(A))){var n=this.createElementClone(A);n.style.transitionProperty="none";var i=t.getComputedStyle(A),r=t.getComputedStyle(A,":before"),s=t.getComputedStyle(A,":after");this.referenceElement===A&&Kg(n)&&(this.clonedReferenceElement=n),Wg(n)&&Rp(n);var o=this.counters.parse(new Oh(this.context,i)),a=this.resolvePseudoContent(A,n,r,Xh.BEFORE);tp(A)&&(e=!0),Yg(A)||this.cloneChildNodes(A,n,e),a&&n.insertBefore(a,n.firstChild);var c=this.resolvePseudoContent(A,n,s,Xh.AFTER);return c&&n.appendChild(c),this.counters.pop(o),(i&&(this.options.copyStyles||_g(A))&&!$g(A)||e)&&Ep(i,n),0===A.scrollTop&&0===A.scrollLeft||this.scrolledElements.push([n,A.scrollLeft,A.scrollTop]),(zg(A)||Ap(A))&&(zg(n)||Ap(n))&&(n.value=A.value),n}return A.cloneNode(!1)},A.prototype.resolvePseudoContent=function(A,e,t,n){var i=this;if(t){var r=t.content,s=e.ownerDocument;if(s&&r&&"none"!==r&&"-moz-alt-content"!==r&&"none"!==t.display){this.counters.parse(new Oh(this.context,t));var o=new Lh(this.context,t),a=s.createElement("html2canvaspseudoelement");Ep(t,a),o.content.forEach((function(e){if(0===e.type)a.appendChild(s.createTextNode(e.value));else if(22===e.type){var t=s.createElement("img");t.src=e.value,t.style.opacity="1",a.appendChild(t)}else if(18===e.type){if("attr"===e.name){var n=e.values.filter(Pd);n.length&&a.appendChild(s.createTextNode(A.getAttribute(n[0].value)||""))}else if("counter"===e.name){var r=e.values.filter(xd),c=r[0],d=r[1];if(c&&Pd(c)){var l=i.counters.getCounterValue(c.value),u=d&&Pd(d)?Vu.parse(i.context,d.value):3;a.appendChild(s.createTextNode(fp(l,u,!1)))}}else if("counters"===e.name){var h=e.values.filter(xd),g=(c=h[0],h[1]);if(d=h[2],c&&Pd(c)){var p=i.counters.getCounterValues(c.value),m=d&&Pd(d)?Vu.parse(i.context,d.value):3,f=g&&0===g.type?g.value:"",B=p.map((function(A){return fp(A,m,!1)})).join(f);a.appendChild(s.createTextNode(B))}}}else if(20===e.type)switch(e.value){case"open-quote":a.appendChild(s.createTextNode(Th(o.quotes,i.quoteDepth++,!0)));break;case"close-quote":a.appendChild(s.createTextNode(Th(o.quotes,--i.quoteDepth,!1)));break;default:a.appendChild(s.createTextNode(e.value))}})),a.className="".concat(Ip," ").concat(Pp);var c=n===Xh.BEFORE?" ".concat(Ip):" ".concat(Pp);return _g(e)?e.className.baseValue+=c:e.className+=c,a}}},A.destroy=function(A){return!!A.parentNode&&(A.parentNode.removeChild(A),!0)},A}();(Yh=Xh||(Xh={}))[Yh.BEFORE=0]="BEFORE",Yh[Yh.AFTER=1]="AFTER";var vp,Cp,yp=function(A,e){var t=A.createElement("iframe");return t.className="html2canvas-container",t.style.visibility="hidden",t.style.position="fixed",t.style.left="-10000px",t.style.top="0px",t.style.border="0",t.width=e.width.toString(),t.height=e.height.toString(),t.scrolling="no",t.setAttribute(Bp,"true"),A.body.appendChild(t),t},bp=function(A){return new Promise((function(e){A.complete?e():A.src?(A.onload=e,A.onerror=e):e()}))},Qp=function(A){return Promise.all([].slice.call(A.images,0).map(bp))},Up=function(A){return new Promise((function(e,t){var n=A.contentWindow;if(!n)return t("No window assigned for iframe");var i=n.document;n.onload=A.onload=function(){n.onload=A.onload=null;var t=setInterval((function(){i.body.childNodes.length>0&&"complete"===i.readyState&&(clearInterval(t),e(A))}),50)}}))},kp=["all","d","content"],Ep=function(A,e){for(var t=A.length-1;t>=0;t--){var n=A.item(t);-1===kp.indexOf(n)&&e.style.setProperty(n,A.getPropertyValue(n))}return e},Fp=function(A){var e="";return A&&(e+="<!DOCTYPE ",A.name&&(e+=A.name),A.internalSubset&&(e+=A.internalSubset),A.publicId&&(e+='"'.concat(A.publicId,'"')),A.systemId&&(e+='"'.concat(A.systemId,'"')),e+=">"),e},Tp=function(A,e,t){A&&A.defaultView&&(e!==A.defaultView.pageXOffset||t!==A.defaultView.pageYOffset)&&A.defaultView.scrollTo(e,t)},Sp=function(A){var e=A[0],t=A[1],n=A[2];e.scrollLeft=t,e.scrollTop=n},Ip="___html2canvas___pseudoelement_before",Pp="___html2canvas___pseudoelement_after",Hp='{\n content: "" !important;\n display: none !important;\n}',Rp=function(A){Dp(A,".".concat(Ip).concat(":before").concat(Hp,"\n .").concat(Pp).concat(":after").concat(Hp))},Dp=function(A,e){var t=A.ownerDocument;if(t){var n=t.createElement("style");n.textContent=e,A.appendChild(n)}},xp=function(A,e){var t,n=e.createElement("base");n.href=e.baseURI;var i=A.getElementsByTagName("head").item(0);null==i||i.insertBefore(n,null!==(t=null==i?void 0:i.firstChild)&&void 0!==t?t:null)},Lp=function(){function A(){}return A.getOrigin=function(e){var t=A._link;return t?(t.href=e,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},A.isSameOrigin=function(e){return A.getOrigin(e)===A._origin},A.setContext=function(e){A._link=e.document.createElement("a"),A._origin=A.getOrigin(e.location.href)},A._origin="about:blank",A}(),Op=function(){function A(A,e){this.context=A,this._options=e,this._cache={}}return A.prototype.addImage=function(A){var e=Promise.resolve();return this.has(A)?e:jp(A)||_p(A)?((this._cache[A]=this.loadImage(A)).catch((function(){})),e):e},A.prototype.match=function(A){return this._cache[A]},A.prototype.loadImage=function(A){return Oa(this,void 0,void 0,(function(){var e,t,n,i,r,s=this;return Ma(this,(function(o){switch(o.label){case 0:return"function"!=typeof this._options.customIsSameOrigin?[3,2]:[4,this._options.customIsSameOrigin(A,Lp.isSameOrigin)];case 1:return t=o.sent(),[3,3];case 2:t=Lp.isSameOrigin(A),o.label=3;case 3:return e=t,n=!Vp(A)&&!0===this._options.useCORS&&cg.SUPPORT_CORS_IMAGES&&!e,i=!Vp(A)&&!e&&!jp(A)&&"string"==typeof this._options.proxy&&cg.SUPPORT_CORS_XHR&&!n,e||!1!==this._options.allowTaint||Vp(A)||jp(A)||i||n?(r=A,i?[4,this.proxy(r)]:[3,5]):[2];case 4:r=o.sent(),o.label=5;case 5:return this.context.logger.debug("Added image ".concat(A.substring(0,256))),[4,new Promise((function(A,e){var t=new Image;t.onload=function(){return A(t)},t.onerror=e,(Gp(r)||n)&&(t.crossOrigin="anonymous"),t.src=r,!0===t.complete&&setTimeout((function(){return A(t)}),500),s._options.imageTimeout>0&&setTimeout((function(){return e("Timed out (".concat(s._options.imageTimeout,"ms) loading image"))}),s._options.imageTimeout)}))];case 6:return[2,o.sent()]}}))}))},A.prototype.has=function(A){return void 0!==this._cache[A]},A.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},A.prototype.proxy=function(A){var e=this,t=this._options.proxy;if(!t)throw new Error("No proxy defined");var n=A.substring(0,256);return new Promise((function(i,r){var s=cg.SUPPORT_RESPONSE_TYPE?"blob":"text",o=new XMLHttpRequest;o.onload=function(){if(200===o.status)if("text"===s)i(o.response);else{var A=new FileReader;A.addEventListener("load",(function(){return i(A.result)}),!1),A.addEventListener("error",(function(A){return r(A)}),!1),A.readAsDataURL(o.response)}else r("Failed to proxy resource ".concat(n," with status code ").concat(o.status))},o.onerror=r;var a=t.indexOf("?")>-1?"&":"?";if(o.open("GET","".concat(t).concat(a,"url=").concat(encodeURIComponent(A),"&responseType=").concat(s)),"text"!==s&&o instanceof XMLHttpRequest&&(o.responseType=s),e._options.imageTimeout){var c=e._options.imageTimeout;o.timeout=c,o.ontimeout=function(){return r("Timed out (".concat(c,"ms) proxying ").concat(n))}}o.send()}))},A}(),Mp=/^data:image\/svg\+xml/i,Np=/^data:image\/.*;base64,/i,Kp=/^data:image\/.*/i,_p=function(A){return cg.SUPPORT_SVG_DRAWING||!Jp(A)},Vp=function(A){return Kp.test(A)},Gp=function(A){return Np.test(A)},jp=function(A){return"blob"===A.substr(0,4)},Jp=function(A){return"svg"===A.substr(-3).toLowerCase()||Mp.test(A)},Wp=function(){function A(A,e){this.type=0,this.x=A,this.y=e}return A.prototype.add=function(e,t){return new A(this.x+e,this.y+t)},A}(),Xp=function(A,e,t){return new Wp(A.x+(e.x-A.x)*t,A.y+(e.y-A.y)*t)},Yp=function(){function A(A,e,t,n){this.type=1,this.start=A,this.startControl=e,this.endControl=t,this.end=n}return A.prototype.subdivide=function(e,t){var n=Xp(this.start,this.startControl,e),i=Xp(this.startControl,this.endControl,e),r=Xp(this.endControl,this.end,e),s=Xp(n,i,e),o=Xp(i,r,e),a=Xp(s,o,e);return t?new A(this.start,n,s,a):new A(a,o,r,this.end)},A.prototype.add=function(e,t){return new A(this.start.add(e,t),this.startControl.add(e,t),this.endControl.add(e,t),this.end.add(e,t))},A.prototype.reverse=function(){return new A(this.end,this.endControl,this.startControl,this.start)},A}(),qp=function(A){return 1===A.type},$p=function(A){var e=A.styles,t=A.bounds,n=jd(e.borderTopLeftRadius,t.width,t.height),i=n[0],r=n[1],s=jd(e.borderTopRightRadius,t.width,t.height),o=s[0],a=s[1],c=jd(e.borderBottomRightRadius,t.width,t.height),d=c[0],l=c[1],u=jd(e.borderBottomLeftRadius,t.width,t.height),h=u[0],g=u[1],p=[];p.push((i+o)/t.width),p.push((h+d)/t.width),p.push((r+g)/t.height),p.push((a+l)/t.height);var m=Math.max.apply(Math,p);m>1&&(i/=m,r/=m,o/=m,a/=m,d/=m,l/=m,h/=m,g/=m);var f=t.width-o,B=t.height-l,w=t.width-d,v=t.height-g,C=e.borderTopWidth,y=e.borderRightWidth,b=e.borderBottomWidth,Q=e.borderLeftWidth,U=Jd(e.paddingTop,A.bounds.width),k=Jd(e.paddingRight,A.bounds.width),E=Jd(e.paddingBottom,A.bounds.width),F=Jd(e.paddingLeft,A.bounds.width);this.topLeftBorderDoubleOuterBox=i>0||r>0?Zp(t.left+Q/3,t.top+C/3,i-Q/3,r-C/3,vp.TOP_LEFT):new Wp(t.left+Q/3,t.top+C/3),this.topRightBorderDoubleOuterBox=i>0||r>0?Zp(t.left+f,t.top+C/3,o-y/3,a-C/3,vp.TOP_RIGHT):new Wp(t.left+t.width-y/3,t.top+C/3),this.bottomRightBorderDoubleOuterBox=d>0||l>0?Zp(t.left+w,t.top+B,d-y/3,l-b/3,vp.BOTTOM_RIGHT):new Wp(t.left+t.width-y/3,t.top+t.height-b/3),this.bottomLeftBorderDoubleOuterBox=h>0||g>0?Zp(t.left+Q/3,t.top+v,h-Q/3,g-b/3,vp.BOTTOM_LEFT):new Wp(t.left+Q/3,t.top+t.height-b/3),this.topLeftBorderDoubleInnerBox=i>0||r>0?Zp(t.left+2*Q/3,t.top+2*C/3,i-2*Q/3,r-2*C/3,vp.TOP_LEFT):new Wp(t.left+2*Q/3,t.top+2*C/3),this.topRightBorderDoubleInnerBox=i>0||r>0?Zp(t.left+f,t.top+2*C/3,o-2*y/3,a-2*C/3,vp.TOP_RIGHT):new Wp(t.left+t.width-2*y/3,t.top+2*C/3),this.bottomRightBorderDoubleInnerBox=d>0||l>0?Zp(t.left+w,t.top+B,d-2*y/3,l-2*b/3,vp.BOTTOM_RIGHT):new Wp(t.left+t.width-2*y/3,t.top+t.height-2*b/3),this.bottomLeftBorderDoubleInnerBox=h>0||g>0?Zp(t.left+2*Q/3,t.top+v,h-2*Q/3,g-2*b/3,vp.BOTTOM_LEFT):new Wp(t.left+2*Q/3,t.top+t.height-2*b/3),this.topLeftBorderStroke=i>0||r>0?Zp(t.left+Q/2,t.top+C/2,i-Q/2,r-C/2,vp.TOP_LEFT):new Wp(t.left+Q/2,t.top+C/2),this.topRightBorderStroke=i>0||r>0?Zp(t.left+f,t.top+C/2,o-y/2,a-C/2,vp.TOP_RIGHT):new Wp(t.left+t.width-y/2,t.top+C/2),this.bottomRightBorderStroke=d>0||l>0?Zp(t.left+w,t.top+B,d-y/2,l-b/2,vp.BOTTOM_RIGHT):new Wp(t.left+t.width-y/2,t.top+t.height-b/2),this.bottomLeftBorderStroke=h>0||g>0?Zp(t.left+Q/2,t.top+v,h-Q/2,g-b/2,vp.BOTTOM_LEFT):new Wp(t.left+Q/2,t.top+t.height-b/2),this.topLeftBorderBox=i>0||r>0?Zp(t.left,t.top,i,r,vp.TOP_LEFT):new Wp(t.left,t.top),this.topRightBorderBox=o>0||a>0?Zp(t.left+f,t.top,o,a,vp.TOP_RIGHT):new Wp(t.left+t.width,t.top),this.bottomRightBorderBox=d>0||l>0?Zp(t.left+w,t.top+B,d,l,vp.BOTTOM_RIGHT):new Wp(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=h>0||g>0?Zp(t.left,t.top+v,h,g,vp.BOTTOM_LEFT):new Wp(t.left,t.top+t.height),this.topLeftPaddingBox=i>0||r>0?Zp(t.left+Q,t.top+C,Math.max(0,i-Q),Math.max(0,r-C),vp.TOP_LEFT):new Wp(t.left+Q,t.top+C),this.topRightPaddingBox=o>0||a>0?Zp(t.left+Math.min(f,t.width-y),t.top+C,f>t.width+y?0:Math.max(0,o-y),Math.max(0,a-C),vp.TOP_RIGHT):new Wp(t.left+t.width-y,t.top+C),this.bottomRightPaddingBox=d>0||l>0?Zp(t.left+Math.min(w,t.width-Q),t.top+Math.min(B,t.height-b),Math.max(0,d-y),Math.max(0,l-b),vp.BOTTOM_RIGHT):new Wp(t.left+t.width-y,t.top+t.height-b),this.bottomLeftPaddingBox=h>0||g>0?Zp(t.left+Q,t.top+Math.min(v,t.height-b),Math.max(0,h-Q),Math.max(0,g-b),vp.BOTTOM_LEFT):new Wp(t.left+Q,t.top+t.height-b),this.topLeftContentBox=i>0||r>0?Zp(t.left+Q+F,t.top+C+U,Math.max(0,i-(Q+F)),Math.max(0,r-(C+U)),vp.TOP_LEFT):new Wp(t.left+Q+F,t.top+C+U),this.topRightContentBox=o>0||a>0?Zp(t.left+Math.min(f,t.width+Q+F),t.top+C+U,f>t.width+Q+F?0:o-Q+F,a-(C+U),vp.TOP_RIGHT):new Wp(t.left+t.width-(y+k),t.top+C+U),this.bottomRightContentBox=d>0||l>0?Zp(t.left+Math.min(w,t.width-(Q+F)),t.top+Math.min(B,t.height+C+U),Math.max(0,d-(y+k)),l-(b+E),vp.BOTTOM_RIGHT):new Wp(t.left+t.width-(y+k),t.top+t.height-(b+E)),this.bottomLeftContentBox=h>0||g>0?Zp(t.left+Q+F,t.top+v,Math.max(0,h-(Q+F)),g-(b+E),vp.BOTTOM_LEFT):new Wp(t.left+Q+F,t.top+t.height-(b+E))};(Cp=vp||(vp={}))[Cp.TOP_LEFT=0]="TOP_LEFT",Cp[Cp.TOP_RIGHT=1]="TOP_RIGHT",Cp[Cp.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",Cp[Cp.BOTTOM_LEFT=3]="BOTTOM_LEFT";var Zp=function(A,e,t,n,i){var r=(Math.sqrt(2)-1)/3*4,s=t*r,o=n*r,a=A+t,c=e+n;switch(i){case vp.TOP_LEFT:return new Yp(new Wp(A,c),new Wp(A,c-o),new Wp(a-s,e),new Wp(a,e));case vp.TOP_RIGHT:return new Yp(new Wp(A,e),new Wp(A+s,e),new Wp(a,c-o),new Wp(a,c));case vp.BOTTOM_RIGHT:return new Yp(new Wp(a,e),new Wp(a,e+o),new Wp(A+s,c),new Wp(A,c));case vp.BOTTOM_LEFT:default:return new Yp(new Wp(a,c),new Wp(a-s,c),new Wp(A,e+o),new Wp(A,e))}},zp=function(A){return[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox]},Am=function(A){return[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox]},em=function(A,e,t){this.offsetX=A,this.offsetY=e,this.matrix=t,this.type=0,this.target=6},tm=function(A,e){this.path=A,this.target=e,this.type=1},nm=function(A){this.opacity=A,this.type=2,this.target=6},im=function(A){return 1===A.type},rm=function(A,e){return A.length===e.length&&A.some((function(A,t){return A===e[t]}))},sm=function(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},om=function(){function A(A,e){if(this.container=A,this.parent=e,this.effects=[],this.curves=new $p(this.container),this.container.styles.opacity<1&&this.effects.push(new nm(this.container.styles.opacity)),null!==this.container.styles.transform){var t=this.container.bounds.left+this.container.styles.transformOrigin[0].number,n=this.container.bounds.top+this.container.styles.transformOrigin[1].number,i=this.container.styles.transform;this.effects.push(new em(t,n,i))}if(0!==this.container.styles.overflowX){var r=zp(this.curves),s=Am(this.curves);rm(r,s)?this.effects.push(new tm(r,6)):(this.effects.push(new tm(r,2)),this.effects.push(new tm(s,4)))}}return A.prototype.getEffects=function(A){for(var e=-1===[2,3].indexOf(this.container.styles.position),t=this.parent,n=this.effects.slice(0);t;){var i=t.effects.filter((function(A){return!im(A)}));if(e||0!==t.container.styles.position||!t.parent){if(e=-1===[2,3].indexOf(t.container.styles.position),0!==t.container.styles.overflowX){var r=zp(t.curves),s=Am(t.curves);rm(r,s)||n.unshift(new tm(s,6))}n.unshift.apply(n,i)}else n.unshift.apply(n,i);t=t.parent}return n.filter((function(e){return bh(e.target,A)}))},A}(),am=function(A,e,t,n){A.container.elements.forEach((function(i){var r=bh(i.flags,4),s=bh(i.flags,2),o=new om(i,A);bh(i.styles.display,2048)&&n.push(o);var a=bh(i.flags,8)?[]:n;if(r||s){var c=r||i.styles.isPositioned()?t:e,d=new sm(o);if(i.styles.isPositioned()||i.styles.opacity<1||i.styles.isTransformed()){var l=i.styles.zIndex.order;if(l<0){var u=0;c.negativeZIndex.some((function(A,e){return l>A.element.container.styles.zIndex.order?(u=e,!1):u>0})),c.negativeZIndex.splice(u,0,d)}else if(l>0){var h=0;c.positiveZIndex.some((function(A,e){return l>=A.element.container.styles.zIndex.order?(h=e+1,!1):h>0})),c.positiveZIndex.splice(h,0,d)}else c.zeroOrAutoZIndexOrTransformedOrOpacity.push(d)}else i.styles.isFloating()?c.nonPositionedFloats.push(d):c.nonPositionedInlineLevel.push(d);am(o,d,r?d:t,a)}else i.styles.isInlineLevel()?e.inlineLevel.push(o):e.nonInlineLevel.push(o),am(o,e,t,a);bh(i.flags,8)&&cm(i,a)}))},cm=function(A,e){for(var t=A instanceof bg?A.start:1,n=A instanceof bg&&A.reversed,i=0;i<e.length;i++){var r=e[i];r.container instanceof yg&&"number"==typeof r.container.value&&0!==r.container.value&&(t=r.container.value),r.listValue=fp(t,r.container.styles.listStyleType,!0),t+=n?-1:1}},dm=function(A,e){switch(e){case 0:return um(A.topLeftBorderBox,A.topLeftPaddingBox,A.topRightBorderBox,A.topRightPaddingBox);case 1:return um(A.topRightBorderBox,A.topRightPaddingBox,A.bottomRightBorderBox,A.bottomRightPaddingBox);case 2:return um(A.bottomRightBorderBox,A.bottomRightPaddingBox,A.bottomLeftBorderBox,A.bottomLeftPaddingBox);default:return um(A.bottomLeftBorderBox,A.bottomLeftPaddingBox,A.topLeftBorderBox,A.topLeftPaddingBox)}},lm=function(A,e){var t=[];return qp(A)?t.push(A.subdivide(.5,!1)):t.push(A),qp(e)?t.push(e.subdivide(.5,!0)):t.push(e),t},um=function(A,e,t,n){var i=[];return qp(A)?i.push(A.subdivide(.5,!1)):i.push(A),qp(t)?i.push(t.subdivide(.5,!0)):i.push(t),qp(n)?i.push(n.subdivide(.5,!0).reverse()):i.push(n),qp(e)?i.push(e.subdivide(.5,!1).reverse()):i.push(e),i},hm=function(A){var e=A.bounds,t=A.styles;return e.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},gm=function(A){var e=A.styles,t=A.bounds,n=Jd(e.paddingLeft,t.width),i=Jd(e.paddingRight,t.width),r=Jd(e.paddingTop,t.width),s=Jd(e.paddingBottom,t.width);return t.add(n+e.borderLeftWidth,r+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+n+i),-(e.borderTopWidth+e.borderBottomWidth+r+s))},pm=function(A,e,t){var n,i,r=(i=A,0===(n=wm(A.styles.backgroundOrigin,e))?i.bounds:2===n?gm(i):hm(i)),s=function(A,e){return 0===A?e.bounds:2===A?gm(e):hm(e)}(wm(A.styles.backgroundClip,e),A),o=Bm(wm(A.styles.backgroundSize,e),t,r),a=o[0],c=o[1],d=jd(wm(A.styles.backgroundPosition,e),r.width-a,r.height-c);return[vm(wm(A.styles.backgroundRepeat,e),d,o,r,s),Math.round(r.left+d[0]),Math.round(r.top+d[1]),a=Math.max(1,a),c=Math.max(1,c)]},mm=function(A){return Pd(A)&&A.value===oc.AUTO},fm=function(A){return"number"==typeof A},Bm=function(A,e,t){var n=e[0],i=e[1],r=e[2],s=A[0],o=A[1];if(!s)return[0,0];if(Nd(s)&&o&&Nd(o))return[Jd(s,t.width),Jd(o,t.height)];var a=fm(r);if(Pd(s)&&(s.value===oc.CONTAIN||s.value===oc.COVER))return fm(r)?t.width/t.height<r!=(s.value===oc.COVER)?[t.width,t.width/r]:[t.height*r,t.height]:[t.width,t.height];var c=fm(n),d=fm(i),l=c||d;if(mm(s)&&(!o||mm(o)))return c&&d?[n,i]:a||l?l&&a?[c?n:i*r,d?i:n/r]:[c?n:t.width,d?i:t.height]:[t.width,t.height];if(a){var u=0,h=0;return Nd(s)?u=Jd(s,t.width):Nd(o)&&(h=Jd(o,t.height)),mm(s)?u=h*r:o&&!mm(o)||(h=u/r),[u,h]}var g=null,p=null;if(Nd(s)?g=Jd(s,t.width):o&&Nd(o)&&(p=Jd(o,t.height)),null===g||o&&!mm(o)||(p=c&&d?g/n*i:t.height),null!==p&&mm(s)&&(g=c&&d?p/i*n:t.width),null!==g&&null!==p)return[g,p];throw new Error("Unable to calculate background-size for element")},wm=function(A,e){var t=A[e];return void 0===t?A[0]:t},vm=function(A,e,t,n,i){var r=e[0],s=e[1],o=t[0],a=t[1];switch(A){case 2:return[new Wp(Math.round(n.left),Math.round(n.top+s)),new Wp(Math.round(n.left+n.width),Math.round(n.top+s)),new Wp(Math.round(n.left+n.width),Math.round(a+n.top+s)),new Wp(Math.round(n.left),Math.round(a+n.top+s))];case 3:return[new Wp(Math.round(n.left+r),Math.round(n.top)),new Wp(Math.round(n.left+r+o),Math.round(n.top)),new Wp(Math.round(n.left+r+o),Math.round(n.height+n.top)),new Wp(Math.round(n.left+r),Math.round(n.height+n.top))];case 1:return[new Wp(Math.round(n.left+r),Math.round(n.top+s)),new Wp(Math.round(n.left+r+o),Math.round(n.top+s)),new Wp(Math.round(n.left+r+o),Math.round(n.top+s+a)),new Wp(Math.round(n.left+r),Math.round(n.top+s+a))];default:return[new Wp(Math.round(i.left),Math.round(i.top)),new Wp(Math.round(i.left+i.width),Math.round(i.top)),new Wp(Math.round(i.left+i.width),Math.round(i.height+i.top)),new Wp(Math.round(i.left),Math.round(i.height+i.top))]}},Cm="Hidden Text",ym=function(){function A(A){this._data={},this._document=A}return A.prototype.parseMetrics=function(A,e){var t=this._document.createElement("div"),n=this._document.createElement("img"),i=this._document.createElement("span"),r=this._document.body;t.style.visibility="hidden",t.style.fontFamily=A,t.style.fontSize=e,t.style.margin="0",t.style.padding="0",t.style.whiteSpace="nowrap",r.appendChild(t),n.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",n.width=1,n.height=1,n.style.margin="0",n.style.padding="0",n.style.verticalAlign="baseline",i.style.fontFamily=A,i.style.fontSize=e,i.style.margin="0",i.style.padding="0",i.appendChild(this._document.createTextNode(Cm)),t.appendChild(i),t.appendChild(n);var s=n.offsetTop-i.offsetTop+2;t.removeChild(i),t.appendChild(this._document.createTextNode(Cm)),t.style.lineHeight="normal",n.style.verticalAlign="super";var o=n.offsetTop-t.offsetTop+2;return r.removeChild(t),{baseline:s,middle:o}},A.prototype.getMetrics=function(A,e){var t="".concat(A," ").concat(e);return void 0===this._data[t]&&(this._data[t]=this.parseMetrics(A,e)),this._data[t]},A}(),bm=function(A,e){this.context=A,this.options=e},Qm=function(A){function e(e,t){var n=A.call(this,e,t)||this;return n._activeEffects=[],n.canvas=t.canvas?t.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),t.canvas||(n.canvas.width=Math.floor(t.width*t.scale),n.canvas.height=Math.floor(t.height*t.scale),n.canvas.style.width="".concat(t.width,"px"),n.canvas.style.height="".concat(t.height,"px")),n.fontMetrics=new ym(document),n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-t.x,-t.y),n.ctx.textBaseline="bottom",n._activeEffects=[],n.context.logger.debug("Canvas renderer initialized (".concat(t.width,"x").concat(t.height,") with scale ").concat(t.scale)),n}return xa(e,A),e.prototype.applyEffects=function(A){for(var e=this;this._activeEffects.length;)this.popEffect();A.forEach((function(A){return e.applyEffect(A)}))},e.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)),im(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 Oa(this,void 0,void 0,(function(){return Ma(this,(function(e){switch(e.label){case 0:return A.element.container.styles.isVisible()?[4,this.renderStackContent(A)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e.prototype.renderNode=function(A){return Oa(this,void 0,void 0,(function(){return Ma(this,(function(e){switch(e.label){case 0:return bh(A.container.flags,16),A.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(A)]:[3,3];case 1:return e.sent(),[4,this.renderNodeContent(A)];case 2:e.sent(),e.label=3;case 3:return[2]}}))}))},e.prototype.renderTextWithLetterSpacing=function(A,e,t){var n=this;0===e?-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+t):ug(A.text).reduce((function(e,i){return n.ctx.fillText(i,e,A.bounds.top+t),e+n.ctx.measureText(i).width}),A.bounds.left)},e.prototype.createFontStyle=function(A){var e=A.fontVariant.filter((function(A){return"normal"===A||"small-caps"===A})).join(""),t=Tm(A.fontFamily).join(", "),n=Sd(A.fontSize)?"".concat(A.fontSize.number).concat(A.fontSize.unit):"".concat(A.fontSize.number,"px");return[[A.fontStyle,e,A.fontWeight,n,t].join(" "),t,n]},e.prototype.renderTextNode=function(A,e){return Oa(this,void 0,void 0,(function(){var t,n,i=this;return Ma(this,(function(r){return t=this.createFontStyle(e)[0],this.ctx.font=t,this.ctx.direction=1===e.direction?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",n=e.paintOrder,A.textBounds.forEach((function(A){n.forEach((function(t){switch(t){case 0:i.ctx.fillStyle=Al(e.color),i.renderTextWithLetterSpacing(A,e.letterSpacing,e.fontSize.number);var n=e.textShadow;n.length&&A.text.trim().length&&(n.slice(0).reverse().forEach((function(t){i.ctx.shadowColor=Al(t.color),i.ctx.shadowOffsetX=t.offsetX.number*i.options.scale,i.ctx.shadowOffsetY=t.offsetY.number*i.options.scale,i.ctx.shadowBlur=t.blur.number,i.renderTextWithLetterSpacing(A,e.letterSpacing,e.fontSize.number)})),i.ctx.shadowColor="",i.ctx.shadowOffsetX=0,i.ctx.shadowOffsetY=0,i.ctx.shadowBlur=0),e.textDecorationLine.length&&(i.ctx.fillStyle=Al(e.textDecorationColor||e.color),e.textDecorationLine.forEach((function(e){switch(e){case 1:i.ctx.fillRect(A.bounds.left,A.bounds.top+A.bounds.height-1,A.bounds.width,1);break;case 2:i.ctx.fillRect(A.bounds.left,A.bounds.top,A.bounds.width,1);break;case 3:i.ctx.fillRect(A.bounds.left,A.bounds.top+(A.bounds.height/2-.5),A.bounds.width,1)}})));break;case 1:e.webkitTextStrokeWidth&&A.text.trim().length&&(i.ctx.strokeStyle=Al(e.webkitTextStrokeColor),i.ctx.lineWidth=e.webkitTextStrokeWidth,i.ctx.lineJoin=window.chrome?"miter":"round",i.ctx.strokeText(A.text,A.bounds.left,A.bounds.top+A.bounds.height)),i.ctx.strokeStyle="",i.ctx.lineWidth=0,i.ctx.lineJoin="miter"}}))})),[2]}))}))},e.prototype.renderReplacedElement=function(A,e,t){var n=t.naturalWidth||A.intrinsicWidth,i=t.naturalHeight||A.intrinsicHeight;if(t&&n>0&&i>0){var r=gm(A),s=Am(e);this.path(s),this.ctx.save(),this.ctx.clip();var o=0,a=0,c=n,d=i,l=r.left,u=r.top,h=r.width,g=r.height,p=A.styles.objectFit,m=h/g,f=c/d;2===p?f>m?(g=h/f,u+=(r.height-g)/2):(h=g*f,l+=(r.width-h)/2):4===p?f>m?o+=(n-(c=d*m))/2:a+=(i-(d=c/m))/2:8===p?(c>h?(o+=(c-h)/2,c=h):(l+=(h-c)/2,h=c),d>g?(a+=(d-g)/2,d=g):(u+=(g-d)/2,g=d)):16===p&&((f>m?h:g*f)<(c>h?c:h)?f>m?(g=h/f,u+=(r.height-g)/2):(h=g*f,l+=(r.width-h)/2):(c>h?(o+=(c-h)/2,c=h):(l+=(h-c)/2,h=c),d>g?(a+=(d-g)/2,d=g):(u+=(g-d)/2,g=d))),this.ctx.drawImage(t,o,a,c,d,l,u,h,g),this.ctx.restore()}},e.prototype.renderNodeContent=function(A){return Oa(this,void 0,void 0,(function(){var t,n,i,r,s,o,a,c,d,l,u,h,g,p,m,f,B,w,v;return Ma(this,(function(C){switch(C.label){case 0:this.applyEffects(A.getEffects(4)),t=A.container,n=A.curves,i=t.styles,r=0,s=t.textNodes,C.label=1;case 1:return r<s.length?(o=s[r],[4,this.renderTextNode(o,i)]):[3,4];case 2:C.sent(),C.label=3;case 3:return r++,[3,1];case 4:if(!(t instanceof wg))return[3,8];C.label=5;case 5:return C.trys.push([5,7,,8]),[4,this.context.cache.match(t.src)];case 6:return f=C.sent(),this.renderReplacedElement(t,n,f),[3,8];case 7:return C.sent(),this.context.logger.error("Error loading image ".concat(t.src)),[3,8];case 8:if(t instanceof vg&&this.renderReplacedElement(t,n,t.canvas),!(t instanceof Cg))return[3,12];C.label=9;case 9:return C.trys.push([9,11,,12]),[4,this.context.cache.match(t.svg)];case 10:return f=C.sent(),this.renderReplacedElement(t,n,f),[3,12];case 11:return C.sent(),this.context.logger.error("Error loading svg ".concat(t.svg.substring(0,255))),[3,12];case 12:return t instanceof Pg&&t.tree?[4,new e(this.context,{scale:this.options.scale,backgroundColor:t.backgroundColor,x:0,y:0,width:t.width,height:t.height}).render(t.tree)]:[3,14];case 13:a=C.sent(),t.width&&t.height&&this.ctx.drawImage(a,0,0,t.width,t.height,t.bounds.left,t.bounds.top,t.bounds.width,t.bounds.height),C.label=14;case 14:if(t instanceof Tg&&(c=Math.min(t.bounds.width,t.bounds.height),t.type===kg?t.checked&&(this.ctx.save(),this.path([new Wp(t.bounds.left+.39363*c,t.bounds.top+.79*c),new Wp(t.bounds.left+.16*c,t.bounds.top+.5549*c),new Wp(t.bounds.left+.27347*c,t.bounds.top+.44071*c),new Wp(t.bounds.left+.39694*c,t.bounds.top+.5649*c),new Wp(t.bounds.left+.72983*c,t.bounds.top+.23*c),new Wp(t.bounds.left+.84*c,t.bounds.top+.34085*c),new Wp(t.bounds.left+.39363*c,t.bounds.top+.79*c)]),this.ctx.fillStyle=Al(Fg),this.ctx.fill(),this.ctx.restore()):t.type===Eg&&t.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.bounds.left+c/2,t.bounds.top+c/2,c/4,0,2*Math.PI,!0),this.ctx.fillStyle=Al(Fg),this.ctx.fill(),this.ctx.restore())),Um(t)&&t.value.length){switch(d=this.createFontStyle(i),w=d[0],l=d[1],u=d[2],h=this.fontMetrics.getMetrics(l,u).baseline,this.ctx.font=w,this.ctx.fillStyle=Al(i.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=Em(t.styles.textAlign),v=gm(t),g=0,t.styles.textAlign){case 1:g+=v.width/2;break;case 2:g+=v.width}p=v.add(g,0,0,-v.height/2+1),this.ctx.save(),this.path([new Wp(v.left,v.top),new Wp(v.left+v.width,v.top),new Wp(v.left+v.width,v.top+v.height),new Wp(v.left,v.top+v.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new dg(t.value,p),i.letterSpacing,h),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!bh(t.styles.display,2048))return[3,20];if(null===t.styles.listStyleImage)return[3,19];if(0!==(m=t.styles.listStyleImage).type)return[3,18];f=void 0,B=m.url,C.label=15;case 15:return C.trys.push([15,17,,18]),[4,this.context.cache.match(B)];case 16:return f=C.sent(),this.ctx.drawImage(f,t.bounds.left-(f.width+10),t.bounds.top),[3,18];case 17:return C.sent(),this.context.logger.error("Error loading list-style-image ".concat(B)),[3,18];case 18:return[3,20];case 19:A.listValue&&-1!==t.styles.listStyleType&&(w=this.createFontStyle(i)[0],this.ctx.font=w,this.ctx.fillStyle=Al(i.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",v=new Ka(t.bounds.left,t.bounds.top+Jd(t.styles.paddingTop,t.bounds.width),t.bounds.width,Nu(i.lineHeight,i.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new dg(A.listValue,v),i.letterSpacing,Nu(i.lineHeight,i.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),C.label=20;case 20:return[2]}}))}))},e.prototype.renderStackContent=function(A){return Oa(this,void 0,void 0,(function(){var e,t,n,i,r,s,o,a,c,d,l,u,h,g,p;return Ma(this,(function(m){switch(m.label){case 0:return bh(A.element.container.flags,16),[4,this.renderNodeBackgroundAndBorders(A.element)];case 1:m.sent(),e=0,t=A.negativeZIndex,m.label=2;case 2:return e<t.length?(p=t[e],[4,this.renderStack(p)]):[3,5];case 3:m.sent(),m.label=4;case 4:return e++,[3,2];case 5:return[4,this.renderNodeContent(A.element)];case 6:m.sent(),n=0,i=A.nonInlineLevel,m.label=7;case 7:return n<i.length?(p=i[n],[4,this.renderNode(p)]):[3,10];case 8:m.sent(),m.label=9;case 9:return n++,[3,7];case 10:r=0,s=A.nonPositionedFloats,m.label=11;case 11:return r<s.length?(p=s[r],[4,this.renderStack(p)]):[3,14];case 12:m.sent(),m.label=13;case 13:return r++,[3,11];case 14:o=0,a=A.nonPositionedInlineLevel,m.label=15;case 15:return o<a.length?(p=a[o],[4,this.renderStack(p)]):[3,18];case 16:m.sent(),m.label=17;case 17:return o++,[3,15];case 18:c=0,d=A.inlineLevel,m.label=19;case 19:return c<d.length?(p=d[c],[4,this.renderNode(p)]):[3,22];case 20:m.sent(),m.label=21;case 21:return c++,[3,19];case 22:l=0,u=A.zeroOrAutoZIndexOrTransformedOrOpacity,m.label=23;case 23:return l<u.length?(p=u[l],[4,this.renderStack(p)]):[3,26];case 24:m.sent(),m.label=25;case 25:return l++,[3,23];case 26:h=0,g=A.positiveZIndex,m.label=27;case 27:return h<g.length?(p=g[h],[4,this.renderStack(p)]):[3,30];case 28:m.sent(),m.label=29;case 29:return h++,[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 e=this;A.forEach((function(A,t){var n=qp(A)?A.start:A;0===t?e.ctx.moveTo(n.x,n.y):e.ctx.lineTo(n.x,n.y),qp(A)&&e.ctx.bezierCurveTo(A.startControl.x,A.startControl.y,A.endControl.x,A.endControl.y,A.end.x,A.end.y)}))},e.prototype.renderRepeat=function(A,e,t,n){this.path(A),this.ctx.fillStyle=e,this.ctx.translate(t,n),this.ctx.fill(),this.ctx.translate(-t,-n)},e.prototype.resizeImage=function(A,e,t){var n,i=(null!==(n=this.canvas.ownerDocument)&&void 0!==n?n:document).createElement("canvas");return i.width=Math.max(1,e),i.height=Math.max(1,t),i.getContext("2d").drawImage(A,0,0,A.width,A.height,0,0,e,t),i},e.prototype.renderBackgroundImage=function(A){return Oa(this,void 0,void 0,(function(){var e,t,n,i,r,s;return Ma(this,(function(o){switch(o.label){case 0:e=A.styles.backgroundImage.length-1,t=function(t){var i,r,s,o,a,c,d,l,u,h,g,p,m,f,B,w,v,C,y,b,Q,U,k,E,F,T,S,I,P,H,R,D,x;return Ma(this,(function(L){switch(L.label){case 0:if(0!==t.type)return[3,5];i=void 0,r=t.url,L.label=1;case 1:return L.trys.push([1,3,,4]),[4,n.context.cache.match(r)];case 2:return i=L.sent(),[3,4];case 3:return L.sent(),n.context.logger.error("Error loading background-image ".concat(r)),[3,4];case 4:return i&&(s=isNaN(i.width)||0===i.width?1:i.width,o=isNaN(i.height)||0===i.height?1:i.height,a=pm(A,e,[s,o,s/o]),C=a[0],E=a[1],F=a[2],Q=a[3],U=a[4],w=n.ctx.createPattern(n.resizeImage(i,Q,U),"repeat"),n.renderRepeat(C,w,E,F)),[3,6];case 5:1===t.type?(c=pm(A,e,[null,null,null]),C=c[0],E=c[1],F=c[2],Q=c[3],U=c[4],d=function(A,e,t){var n="number"==typeof A?A:function(A,e,t){var n=e/2,i=t/2,r=Jd(A[0],e)-n,s=i-Jd(A[1],t);return(Math.atan2(s,r)+2*Math.PI)%(2*Math.PI)}(A,e,t),i=Math.abs(e*Math.sin(n))+Math.abs(t*Math.cos(n)),r=e/2,s=t/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]}(t.angle,Q,U),l=d[0],u=d[1],h=d[2],g=d[3],p=d[4],(m=document.createElement("canvas")).width=Q,m.height=U,f=m.getContext("2d"),B=f.createLinearGradient(u,g,h,p),Nl(t.stops,l||1).forEach((function(A){return B.addColorStop(A.stop,Al(A.color))})),f.fillStyle=B,f.fillRect(0,0,Q,U),Q>0&&U>0&&(w=n.ctx.createPattern(m,"repeat"),n.renderRepeat(C,w,E,F))):2===t.type&&(v=pm(A,e,[null,null,null]),C=v[0],y=v[1],b=v[2],Q=v[3],U=v[4],k=0===t.position.length?[Vd]:t.position,E=Jd(k[0],Q),F=Jd(k[k.length-1],U),T=function(A,e,t,n,i){var r=0,s=0;switch(A.size){case 0:0===A.shape?r=s=Math.min(Math.abs(e),Math.abs(e-n),Math.abs(t),Math.abs(t-i)):1===A.shape&&(r=Math.min(Math.abs(e),Math.abs(e-n)),s=Math.min(Math.abs(t),Math.abs(t-i)));break;case 2:if(0===A.shape)r=s=Math.min(Kl(e,t),Kl(e,t-i),Kl(e-n,t),Kl(e-n,t-i));else if(1===A.shape){var o=Math.min(Math.abs(t),Math.abs(t-i))/Math.min(Math.abs(e),Math.abs(e-n)),a=_l(n,i,e,t,!0),c=a[0],d=a[1];s=o*(r=Kl(c-e,(d-t)/o))}break;case 1:0===A.shape?r=s=Math.max(Math.abs(e),Math.abs(e-n),Math.abs(t),Math.abs(t-i)):1===A.shape&&(r=Math.max(Math.abs(e),Math.abs(e-n)),s=Math.max(Math.abs(t),Math.abs(t-i)));break;case 3:if(0===A.shape)r=s=Math.max(Kl(e,t),Kl(e,t-i),Kl(e-n,t),Kl(e-n,t-i));else if(1===A.shape){o=Math.max(Math.abs(t),Math.abs(t-i))/Math.max(Math.abs(e),Math.abs(e-n));var l=_l(n,i,e,t,!1);c=l[0],d=l[1],s=o*(r=Kl(c-e,(d-t)/o))}}return Array.isArray(A.size)&&(r=Jd(A.size[0],n),s=2===A.size.length?Jd(A.size[1],i):r),[r,s]}(t,E,F,Q,U),S=T[0],I=T[1],S>0&&I>0&&(P=n.ctx.createRadialGradient(y+E,b+F,0,y+E,b+F,S),Nl(t.stops,2*S).forEach((function(A){return P.addColorStop(A.stop,Al(A.color))})),n.path(C),n.ctx.fillStyle=P,S!==I?(H=A.bounds.left+.5*A.bounds.width,R=A.bounds.top+.5*A.bounds.height,x=1/(D=I/S),n.ctx.save(),n.ctx.translate(H,R),n.ctx.transform(1,0,0,D,0,0),n.ctx.translate(-H,-R),n.ctx.fillRect(y,x*(b-R)+R,Q,U*x),n.ctx.restore()):n.ctx.fill())),L.label=6;case 6:return e--,[2]}}))},n=this,i=0,r=A.styles.backgroundImage.slice(0).reverse(),o.label=1;case 1:return i<r.length?(s=r[i],[5,t(s)]):[3,4];case 2:o.sent(),o.label=3;case 3:return i++,[3,1];case 4:return[2]}}))}))},e.prototype.renderSolidBorder=function(A,e,t){return Oa(this,void 0,void 0,(function(){return Ma(this,(function(n){return this.path(dm(t,e)),this.ctx.fillStyle=Al(A),this.ctx.fill(),[2]}))}))},e.prototype.renderDoubleBorder=function(A,e,t,n){return Oa(this,void 0,void 0,(function(){var i,r;return Ma(this,(function(s){switch(s.label){case 0:return e<3?[4,this.renderSolidBorder(A,t,n)]:[3,2];case 1:return s.sent(),[2];case 2:return i=function(A,e){switch(e){case 0:return um(A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox,A.topRightBorderBox,A.topRightBorderDoubleOuterBox);case 1:return um(A.topRightBorderBox,A.topRightBorderDoubleOuterBox,A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox);case 2:return um(A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox,A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox);default:return um(A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox,A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox)}}(n,t),this.path(i),this.ctx.fillStyle=Al(A),this.ctx.fill(),r=function(A,e){switch(e){case 0:return um(A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox,A.topRightBorderDoubleInnerBox,A.topRightPaddingBox);case 1:return um(A.topRightBorderDoubleInnerBox,A.topRightPaddingBox,A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox);case 2:return um(A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox,A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox);default:return um(A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox,A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox)}}(n,t),this.path(r),this.ctx.fill(),[2]}}))}))},e.prototype.renderNodeBackgroundAndBorders=function(A){return Oa(this,void 0,void 0,(function(){var e,t,n,i,r,s,o,a,c=this;return Ma(this,(function(d){switch(d.label){case 0:return this.applyEffects(A.getEffects(2)),e=A.container.styles,t=!zd(e.backgroundColor)||e.backgroundImage.length,n=[{style:e.borderTopStyle,color:e.borderTopColor,width:e.borderTopWidth},{style:e.borderRightStyle,color:e.borderRightColor,width:e.borderRightWidth},{style:e.borderBottomStyle,color:e.borderBottomColor,width:e.borderBottomWidth},{style:e.borderLeftStyle,color:e.borderLeftColor,width:e.borderLeftWidth}],i=km(wm(e.backgroundClip,0),A.curves),t||e.boxShadow.length?(this.ctx.save(),this.path(i),this.ctx.clip(),zd(e.backgroundColor)||(this.ctx.fillStyle=Al(e.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(A.container)]):[3,2];case 1:d.sent(),this.ctx.restore(),e.boxShadow.slice(0).reverse().forEach((function(e){c.ctx.save();var t,n,i,r,s,o=zp(A.curves),a=e.inset?0:1e4,d=(t=o,n=-a+(e.inset?1:-1)*e.spread.number,i=(e.inset?1:-1)*e.spread.number,r=e.spread.number*(e.inset?-2:2),s=e.spread.number*(e.inset?-2:2),t.map((function(A,e){switch(e){case 0:return A.add(n,i);case 1:return A.add(n+r,i);case 2:return A.add(n+r,i+s);case 3:return A.add(n,i+s)}return A})));e.inset?(c.path(o),c.ctx.clip(),c.mask(d)):(c.mask(o),c.ctx.clip(),c.path(d)),c.ctx.shadowOffsetX=e.offsetX.number+a,c.ctx.shadowOffsetY=e.offsetY.number,c.ctx.shadowColor=Al(e.color),c.ctx.shadowBlur=e.blur.number,c.ctx.fillStyle=e.inset?Al(e.color):"rgba(0,0,0,1)",c.ctx.fill(),c.ctx.restore()})),d.label=2;case 2:r=0,s=0,o=n,d.label=3;case 3:return s<o.length?0!==(a=o[s]).style&&!zd(a.color)&&a.width>0?2!==a.style?[3,5]:[4,this.renderDashedDottedBorder(a.color,a.width,r,A.curves,2)]:[3,11]:[3,13];case 4:return d.sent(),[3,11];case 5:return 3!==a.style?[3,7]:[4,this.renderDashedDottedBorder(a.color,a.width,r,A.curves,3)];case 6:return d.sent(),[3,11];case 7:return 4!==a.style?[3,9]:[4,this.renderDoubleBorder(a.color,a.width,r,A.curves)];case 8:return d.sent(),[3,11];case 9:return[4,this.renderSolidBorder(a.color,r,A.curves)];case 10:d.sent(),d.label=11;case 11:r++,d.label=12;case 12:return s++,[3,3];case 13:return[2]}}))}))},e.prototype.renderDashedDottedBorder=function(A,e,t,n,i){return Oa(this,void 0,void 0,(function(){var r,s,o,a,c,d,l,u,h,g,p,m,f,B,w,v;return Ma(this,(function(C){return this.ctx.save(),r=function(A,e){switch(e){case 0:return lm(A.topLeftBorderStroke,A.topRightBorderStroke);case 1:return lm(A.topRightBorderStroke,A.bottomRightBorderStroke);case 2:return lm(A.bottomRightBorderStroke,A.bottomLeftBorderStroke);default:return lm(A.bottomLeftBorderStroke,A.topLeftBorderStroke)}}(n,t),s=dm(n,t),2===i&&(this.path(s),this.ctx.clip()),qp(s[0])?(o=s[0].start.x,a=s[0].start.y):(o=s[0].x,a=s[0].y),qp(s[1])?(c=s[1].end.x,d=s[1].end.y):(c=s[1].x,d=s[1].y),l=0===t||2===t?Math.abs(o-c):Math.abs(a-d),this.ctx.beginPath(),3===i?this.formatPath(r):this.formatPath(s.slice(0,2)),u=e<3?3*e:2*e,h=e<3?2*e:e,3===i&&(u=e,h=e),g=!0,l<=2*u?g=!1:l<=2*u+h?(u*=p=l/(2*u+h),h*=p):(m=Math.floor((l+h)/(u+h)),f=(l-m*u)/(m-1),h=(B=(l-(m+1)*u)/m)<=0||Math.abs(h-f)<Math.abs(h-B)?f:B),g&&(3===i?this.ctx.setLineDash([0,u+h]):this.ctx.setLineDash([u,h])),3===i?(this.ctx.lineCap="round",this.ctx.lineWidth=e):this.ctx.lineWidth=2*e+1.1,this.ctx.strokeStyle=Al(A),this.ctx.stroke(),this.ctx.setLineDash([]),2===i&&(qp(s[0])&&(w=s[3],v=s[0],this.ctx.beginPath(),this.formatPath([new Wp(w.end.x,w.end.y),new Wp(v.start.x,v.start.y)]),this.ctx.stroke()),qp(s[1])&&(w=s[1],v=s[2],this.ctx.beginPath(),this.formatPath([new Wp(w.end.x,w.end.y),new Wp(v.start.x,v.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]}))}))},e.prototype.render=function(A){return Oa(this,void 0,void 0,(function(){var e;return Ma(this,(function(t){switch(t.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=Al(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),e=function(A){var e=new om(A,null),t=new sm(e),n=[];return am(e,t,t,n),cm(e.container,n),t}(A),[4,this.renderStack(e)];case 1:return t.sent(),this.applyEffects([]),[2,this.canvas]}}))}))},e}(bm),Um=function(A){return A instanceof Ig||A instanceof Sg||A instanceof Tg&&A.type!==Eg&&A.type!==kg},km=function(A,e){switch(A){case 0:return zp(e);case 2:return function(A){return[A.topLeftContentBox,A.topRightContentBox,A.bottomRightContentBox,A.bottomLeftContentBox]}(e);default:return Am(e)}},Em=function(A){switch(A){case 1:return"center";case 2:return"right";default:return"left"}},Fm=["-apple-system","system-ui"],Tm=function(A){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?A.filter((function(A){return-1===Fm.indexOf(A)})):A},Sm=function(A){function e(e,t){var n=A.call(this,e,t)||this;return n.canvas=t.canvas?t.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),n.options=t,n.canvas.width=Math.floor(t.width*t.scale),n.canvas.height=Math.floor(t.height*t.scale),n.canvas.style.width="".concat(t.width,"px"),n.canvas.style.height="".concat(t.height,"px"),n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-t.x,-t.y),n.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized (".concat(t.width,"x").concat(t.height," at ").concat(t.x,",").concat(t.y,") with scale ").concat(t.scale)),n}return xa(e,A),e.prototype.render=function(A){return Oa(this,void 0,void 0,(function(){var e,t;return Ma(this,(function(n){switch(n.label){case 0:return e=og(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,A),[4,Im(e)];case 1:return t=n.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=Al(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(t,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}}))}))},e}(bm),Im=function(A){return new Promise((function(e,t){var n=new Image;n.onload=function(){e(n)},n.onerror=t,n.src="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent((new XMLSerializer).serializeToString(A)))}))},Pm=function(){function A(A){var e=A.id,t=A.enabled;this.id=e,this.enabled=t,this.start=Date.now()}return A.prototype.debug=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.debug?console.debug.apply(console,Na([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=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&"undefined"!=typeof window&&window.console&&"function"==typeof console.info&&console.info.apply(console,Na([this.id,"".concat(this.getTime(),"ms")],A,!1))},A.prototype.warn=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.warn?console.warn.apply(console,Na([this.id,"".concat(this.getTime(),"ms")],A,!1)):this.info.apply(this,A))},A.prototype.error=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.error?console.error.apply(console,Na([this.id,"".concat(this.getTime(),"ms")],A,!1)):this.info.apply(this,A))},A.instances={},A}(),Hm=function(){function A(e,t){var n;this.windowBounds=t,this.instanceName="#".concat(A.instanceCount++),this.logger=new Pm({id:this.instanceName,enabled:e.logging}),this.cache=null!==(n=e.cache)&&void 0!==n?n:new Op(this,e)}return A.instanceCount=1,A}();"undefined"!=typeof window&&Lp.setContext(window);var Rm=function(A,e,t){var n=e.ownerDocument,i=n.documentElement?Dl(A,getComputedStyle(n.documentElement).backgroundColor):xl.TRANSPARENT,r=n.body?Dl(A,getComputedStyle(n.body).backgroundColor):xl.TRANSPARENT,s="string"==typeof t?Dl(A,t):null===t?xl.TRANSPARENT:4294967295;return e===n.documentElement?zd(i)?zd(r)?s:r:i:s};const Dm=globalThis,xm=Dm.ShadowRoot&&(void 0===Dm.ShadyCSS||Dm.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Lm=Symbol(),Om=new WeakMap;let Mm=class{constructor(A,e,t){if(this._$cssResult$=!0,t!==Lm)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=A,this.t=e}get styleSheet(){let A=this.o;const e=this.t;if(xm&&void 0===A){const t=void 0!==e&&1===e.length;t&&(A=Om.get(e)),void 0===A&&((this.o=A=new CSSStyleSheet).replaceSync(this.cssText),t&&Om.set(e,A))}return A}toString(){return this.cssText}};const Nm=(A,...e)=>{const t=1===A.length?A[0]:e.reduce(((e,t,n)=>e+(A=>{if(!0===A._$cssResult$)return A.cssText;if("number"==typeof A)return A;throw Error("Value passed to 'css' function must be a 'css' function result: "+A+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(t)+A[n+1]),A[0]);return new Mm(t,A,Lm)},Km=xm?A=>A:A=>A instanceof CSSStyleSheet?(A=>{let e="";for(const t of A.cssRules)e+=t.cssText;return(A=>new Mm("string"==typeof A?A:A+"",void 0,Lm))(e)})(A):A,{is:_m,defineProperty:Vm,getOwnPropertyDescriptor:Gm,getOwnPropertyNames:jm,getOwnPropertySymbols:Jm,getPrototypeOf:Wm}=Object,Xm=globalThis,Ym=Xm.trustedTypes,qm=Ym?Ym.emptyScript:"",$m=Xm.reactiveElementPolyfillSupport,Zm=(A,e)=>A,zm={toAttribute(A,e){switch(e){case Boolean:A=A?qm:null;break;case Object:case Array:A=null==A?A:JSON.stringify(A)}return A},fromAttribute(A,e){let t=A;switch(e){case Boolean:t=null!==A;break;case Number:t=null===A?null:Number(A);break;case Object:case Array:try{t=JSON.parse(A)}catch(n){t=null}}return t}},Af=(A,e)=>!_m(A,e),ef={attribute:!0,type:String,converter:zm,reflect:!1,useDefault:!1,hasChanged:Af};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Xm.litPropertyMetadata??(Xm.litPropertyMetadata=new WeakMap);let tf=class extends HTMLElement{static addInitializer(A){this._$Ei(),(this.l??(this.l=[])).push(A)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(A,e=ef){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(A)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(A,e),!e.noAccessor){const t=Symbol(),n=this.getPropertyDescriptor(A,t,e);void 0!==n&&Vm(this.prototype,A,n)}}static getPropertyDescriptor(A,e,t){const{get:n,set:i}=Gm(this.prototype,A)??{get(){return this[e]},set(A){this[e]=A}};return{get:n,set(e){const r=n?.call(this);i?.call(this,e),this.requestUpdate(A,r,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(A){return this.elementProperties.get(A)??ef}static _$Ei(){if(this.hasOwnProperty(Zm("elementProperties")))return;const A=Wm(this);A.finalize(),void 0!==A.l&&(this.l=[...A.l]),this.elementProperties=new Map(A.elementProperties)}static finalize(){if(this.hasOwnProperty(Zm("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Zm("properties"))){const A=this.properties,e=[...jm(A),...Jm(A)];for(const t of e)this.createProperty(t,A[t])}const A=this[Symbol.metadata];if(null!==A){const e=litPropertyMetadata.get(A);if(void 0!==e)for(const[A,t]of e)this.elementProperties.set(A,t)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const A=this._$Eu(e,t);void 0!==A&&this._$Eh.set(A,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(A){const e=[];if(Array.isArray(A)){const t=new Set(A.flat(1/0).reverse());for(const A of t)e.unshift(Km(A))}else void 0!==A&&e.push(Km(A));return e}static _$Eu(A,e){const t=e.attribute;return!1===t?void 0:"string"==typeof t?t:"string"==typeof A?A.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((A=>this.enableUpdating=A)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((A=>A(this)))}addController(A){(this._$EO??(this._$EO=new Set)).add(A),void 0!==this.renderRoot&&this.isConnected&&A.hostConnected?.()}removeController(A){this._$EO?.delete(A)}_$E_(){const A=new Map,e=this.constructor.elementProperties;for(const t of e.keys())this.hasOwnProperty(t)&&(A.set(t,this[t]),delete this[t]);A.size>0&&(this._$Ep=A)}createRenderRoot(){const A=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((A,e)=>{if(xm)A.adoptedStyleSheets=e.map((A=>A instanceof CSSStyleSheet?A:A.styleSheet));else for(const t of e){const e=document.createElement("style"),n=Dm.litNonce;void 0!==n&&e.setAttribute("nonce",n),e.textContent=t.cssText,A.appendChild(e)}})(A,this.constructor.elementStyles),A}connectedCallback(){this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),this._$EO?.forEach((A=>A.hostConnected?.()))}enableUpdating(A){}disconnectedCallback(){this._$EO?.forEach((A=>A.hostDisconnected?.()))}attributeChangedCallback(A,e,t){this._$AK(A,t)}_$ET(A,e){const t=this.constructor.elementProperties.get(A),n=this.constructor._$Eu(A,t);if(void 0!==n&&!0===t.reflect){const i=(void 0!==t.converter?.toAttribute?t.converter:zm).toAttribute(e,t.type);this._$Em=A,null==i?this.removeAttribute(n):this.setAttribute(n,i),this._$Em=null}}_$AK(A,e){const t=this.constructor,n=t._$Eh.get(A);if(void 0!==n&&this._$Em!==n){const A=t.getPropertyOptions(n),i="function"==typeof A.converter?{fromAttribute:A.converter}:void 0!==A.converter?.fromAttribute?A.converter:zm;this._$Em=n,this[n]=i.fromAttribute(e,A.type)??this._$Ej?.get(n)??null,this._$Em=null}}requestUpdate(A,e,t){if(void 0!==A){const n=this.constructor,i=this[A];if(t??(t=n.getPropertyOptions(A)),!((t.hasChanged??Af)(i,e)||t.useDefault&&t.reflect&&i===this._$Ej?.get(A)&&!this.hasAttribute(n._$Eu(A,t))))return;this.C(A,e,t)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(A,e,{useDefault:t,reflect:n,wrapped:i},r){t&&!(this._$Ej??(this._$Ej=new Map)).has(A)&&(this._$Ej.set(A,r??e??this[A]),!0!==i||void 0!==r)||(this._$AL.has(A)||(this.hasUpdated||t||(e=void 0),this._$AL.set(A,e)),!0===n&&this._$Em!==A&&(this._$Eq??(this._$Eq=new Set)).add(A))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}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._$Ep){for(const[A,e]of this._$Ep)this[A]=e;this._$Ep=void 0}const A=this.constructor.elementProperties;if(A.size>0)for(const[e,t]of A){const{wrapped:A}=t,n=this[e];!0!==A||this._$AL.has(e)||void 0===n||this.C(e,void 0,t,n)}}let A=!1;const e=this._$AL;try{A=this.shouldUpdate(e),A?(this.willUpdate(e),this._$EO?.forEach((A=>A.hostUpdate?.())),this.update(e)):this._$EM()}catch(t){throw A=!1,this._$EM(),t}A&&this._$AE(e)}willUpdate(A){}_$AE(A){this._$EO?.forEach((A=>A.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(A)),this.updated(A)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(A){return!0}update(A){this._$Eq&&(this._$Eq=this._$Eq.forEach((A=>this._$ET(A,this[A])))),this._$EM()}updated(A){}firstUpdated(A){}};tf.elementStyles=[],tf.shadowRootOptions={mode:"open"},tf[Zm("elementProperties")]=new Map,tf[Zm("finalized")]=new Map,$m?.({ReactiveElement:tf}),(Xm.reactiveElementVersions??(Xm.reactiveElementVersions=[])).push("2.1.0");const nf=globalThis,rf=nf.trustedTypes,sf=rf?rf.createPolicy("lit-html",{createHTML:A=>A}):void 0,of="$lit$",af=`lit$${Math.random().toFixed(9).slice(2)}$`,cf="?"+af,df=`<${cf}>`,lf=document,uf=()=>lf.createComment(""),hf=A=>null===A||"object"!=typeof A&&"function"!=typeof A,gf=Array.isArray,pf="[ \t\n\f\r]",mf=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ff=/-->/g,Bf=/>/g,wf=RegExp(`>|${pf}(?:([^\\s"'>=/]+)(${pf}*=${pf}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),vf=/'/g,Cf=/"/g,yf=/^(?:script|style|textarea|title)$/i,bf=A=>(e,...t)=>({_$litType$:A,strings:e,values:t}),Qf=bf(1),Uf=bf(2),kf=Symbol.for("lit-noChange"),Ef=Symbol.for("lit-nothing"),Ff=new WeakMap,Tf=lf.createTreeWalker(lf,129);function Sf(A,e){if(!gf(A)||!A.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==sf?sf.createHTML(e):e}class If{constructor({strings:A,_$litType$:e},t){let n;this.parts=[];let i=0,r=0;const s=A.length-1,o=this.parts,[a,c]=((A,e)=>{const t=A.length-1,n=[];let i,r=2===e?"<svg>":3===e?"<math>":"",s=mf;for(let o=0;o<t;o++){const e=A[o];let t,a,c=-1,d=0;for(;d<e.length&&(s.lastIndex=d,a=s.exec(e),null!==a);)d=s.lastIndex,s===mf?"!--"===a[1]?s=ff:void 0!==a[1]?s=Bf:void 0!==a[2]?(yf.test(a[2])&&(i=RegExp("</"+a[2],"g")),s=wf):void 0!==a[3]&&(s=wf):s===wf?">"===a[0]?(s=i??mf,c=-1):void 0===a[1]?c=-2:(c=s.lastIndex-a[2].length,t=a[1],s=void 0===a[3]?wf:'"'===a[3]?Cf:vf):s===Cf||s===vf?s=wf:s===ff||s===Bf?s=mf:(s=wf,i=void 0);const l=s===wf&&A[o+1].startsWith("/>")?" ":"";r+=s===mf?e+df:c>=0?(n.push(t),e.slice(0,c)+of+e.slice(c)+af+l):e+af+(-2===c?o:l)}return[Sf(A,r+(A[t]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),n]})(A,e);if(this.el=If.createElement(a,t),Tf.currentNode=this.el.content,2===e||3===e){const A=this.el.content.firstChild;A.replaceWith(...A.childNodes)}for(;null!==(n=Tf.nextNode())&&o.length<s;){if(1===n.nodeType){if(n.hasAttributes())for(const A of n.getAttributeNames())if(A.endsWith(of)){const e=c[r++],t=n.getAttribute(A).split(af),s=/([.?@])?(.*)/.exec(e);o.push({type:1,index:i,name:s[2],strings:t,ctor:"."===s[1]?xf:"?"===s[1]?Lf:"@"===s[1]?Of:Df}),n.removeAttribute(A)}else A.startsWith(af)&&(o.push({type:6,index:i}),n.removeAttribute(A));if(yf.test(n.tagName)){const A=n.textContent.split(af),e=A.length-1;if(e>0){n.textContent=rf?rf.emptyScript:"";for(let t=0;t<e;t++)n.append(A[t],uf()),Tf.nextNode(),o.push({type:2,index:++i});n.append(A[e],uf())}}}else if(8===n.nodeType)if(n.data===cf)o.push({type:2,index:i});else{let A=-1;for(;-1!==(A=n.data.indexOf(af,A+1));)o.push({type:7,index:i}),A+=af.length-1}i++}}static createElement(A,e){const t=lf.createElement("template");return t.innerHTML=A,t}}function Pf(A,e,t=A,n){if(e===kf)return e;let i=void 0!==n?t._$Co?.[n]:t._$Cl;const r=hf(e)?void 0:e._$litDirective$;return i?.constructor!==r&&(i?._$AO?.(!1),void 0===r?i=void 0:(i=new r(A),i._$AT(A,t,n)),void 0!==n?(t._$Co??(t._$Co=[]))[n]=i:t._$Cl=i),void 0!==i&&(e=Pf(A,i._$AS(A,e.values),i,n)),e}class Hf{constructor(A,e){this._$AV=[],this._$AN=void 0,this._$AD=A,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(A){const{el:{content:e},parts:t}=this._$AD,n=(A?.creationScope??lf).importNode(e,!0);Tf.currentNode=n;let i=Tf.nextNode(),r=0,s=0,o=t[0];for(;void 0!==o;){if(r===o.index){let e;2===o.type?e=new Rf(i,i.nextSibling,this,A):1===o.type?e=new o.ctor(i,o.name,o.strings,this,A):6===o.type&&(e=new Mf(i,this,A)),this._$AV.push(e),o=t[++s]}r!==o?.index&&(i=Tf.nextNode(),r++)}return Tf.currentNode=lf,n}p(A){let e=0;for(const t of this._$AV)void 0!==t&&(void 0!==t.strings?(t._$AI(A,t,e),e+=t.strings.length-2):t._$AI(A[e])),e++}}class Rf{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(A,e,t,n){this.type=2,this._$AH=Ef,this._$AN=void 0,this._$AA=A,this._$AB=e,this._$AM=t,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let A=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===A?.nodeType&&(A=e.parentNode),A}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(A,e=this){A=Pf(this,A,e),hf(A)?A===Ef||null==A||""===A?(this._$AH!==Ef&&this._$AR(),this._$AH=Ef):A!==this._$AH&&A!==kf&&this._(A):void 0!==A._$litType$?this.$(A):void 0!==A.nodeType?this.T(A):(A=>gf(A)||"function"==typeof A?.[Symbol.iterator])(A)?this.k(A):this._(A)}O(A){return this._$AA.parentNode.insertBefore(A,this._$AB)}T(A){this._$AH!==A&&(this._$AR(),this._$AH=this.O(A))}_(A){this._$AH!==Ef&&hf(this._$AH)?this._$AA.nextSibling.data=A:this.T(lf.createTextNode(A)),this._$AH=A}$(A){const{values:e,_$litType$:t}=A,n="number"==typeof t?this._$AC(A):(void 0===t.el&&(t.el=If.createElement(Sf(t.h,t.h[0]),this.options)),t);if(this._$AH?._$AD===n)this._$AH.p(e);else{const A=new Hf(n,this),t=A.u(this.options);A.p(e),this.T(t),this._$AH=A}}_$AC(A){let e=Ff.get(A.strings);return void 0===e&&Ff.set(A.strings,e=new If(A)),e}k(A){gf(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let t,n=0;for(const i of A)n===e.length?e.push(t=new Rf(this.O(uf()),this.O(uf()),this,this.options)):t=e[n],t._$AI(i),n++;n<e.length&&(this._$AR(t&&t._$AB.nextSibling,n),e.length=n)}_$AR(A=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);A&&A!==this._$AB;){const e=A.nextSibling;A.remove(),A=e}}setConnected(A){void 0===this._$AM&&(this._$Cv=A,this._$AP?.(A))}}class Df{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(A,e,t,n,i){this.type=1,this._$AH=Ef,this._$AN=void 0,this.element=A,this.name=e,this._$AM=n,this.options=i,t.length>2||""!==t[0]||""!==t[1]?(this._$AH=Array(t.length-1).fill(new String),this.strings=t):this._$AH=Ef}_$AI(A,e=this,t,n){const i=this.strings;let r=!1;if(void 0===i)A=Pf(this,A,e,0),r=!hf(A)||A!==this._$AH&&A!==kf,r&&(this._$AH=A);else{const n=A;let s,o;for(A=i[0],s=0;s<i.length-1;s++)o=Pf(this,n[t+s],e,s),o===kf&&(o=this._$AH[s]),r||(r=!hf(o)||o!==this._$AH[s]),o===Ef?A=Ef:A!==Ef&&(A+=(o??"")+i[s+1]),this._$AH[s]=o}r&&!n&&this.j(A)}j(A){A===Ef?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,A??"")}}class xf extends Df{constructor(){super(...arguments),this.type=3}j(A){this.element[this.name]=A===Ef?void 0:A}}class Lf extends Df{constructor(){super(...arguments),this.type=4}j(A){this.element.toggleAttribute(this.name,!!A&&A!==Ef)}}class Of extends Df{constructor(A,e,t,n,i){super(A,e,t,n,i),this.type=5}_$AI(A,e=this){if((A=Pf(this,A,e,0)??Ef)===kf)return;const t=this._$AH,n=A===Ef&&t!==Ef||A.capture!==t.capture||A.once!==t.once||A.passive!==t.passive,i=A!==Ef&&(t===Ef||n);n&&this.element.removeEventListener(this.name,this,t),i&&this.element.addEventListener(this.name,this,A),this._$AH=A}handleEvent(A){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,A):this._$AH.handleEvent(A)}}class Mf{constructor(A,e,t){this.element=A,this.type=6,this._$AN=void 0,this._$AM=e,this.options=t}get _$AU(){return this._$AM._$AU}_$AI(A){Pf(this,A)}}const Nf=nf.litHtmlPolyfillSupport;Nf?.(If,Rf),(nf.litHtmlVersions??(nf.litHtmlVersions=[])).push("3.3.0");const Kf=globalThis;let _f=class extends tf{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var A;const e=super.createRenderRoot();return(A=this.renderOptions).renderBefore??(A.renderBefore=e.firstChild),e}update(A){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(A),this._$Do=((A,e,t)=>{const n=t?.renderBefore??e;let i=n._$litPart$;if(void 0===i){const A=t?.renderBefore??null;n._$litPart$=i=new Rf(e.insertBefore(uf(),A),A,void 0,t??{})}return i._$AI(A),i})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return kf}};_f._$litElement$=!0,_f.finalized=!0,Kf.litElementHydrateSupport?.({LitElement:_f});const Vf=Kf.litElementPolyfillSupport;Vf?.({LitElement:_f}),(Kf.litElementVersions??(Kf.litElementVersions=[])).push("4.2.0");const Gf={attribute:!0,type:String,converter:zm,reflect:!1,hasChanged:Af},jf=(A=Gf,e,t)=>{const{kind:n,metadata:i}=t;let r=globalThis.litPropertyMetadata.get(i);if(void 0===r&&globalThis.litPropertyMetadata.set(i,r=new Map),"setter"===n&&((A=Object.create(A)).wrapped=!0),r.set(t.name,A),"accessor"===n){const{name:n}=t;return{set(t){const i=e.get.call(this);e.set.call(this,t),this.requestUpdate(n,i,A)},init(e){return void 0!==e&&this.C(n,void 0,A,e),e}}}if("setter"===n){const{name:n}=t;return function(t){const i=this[n];e.call(this,t),this.requestUpdate(n,i,A)}}throw Error("Unsupported decorator location: "+n)};function Jf(A){return(e,t)=>"object"==typeof t?jf(A,e,t):((A,e,t)=>{const n=e.hasOwnProperty(t);return e.constructor.createProperty(t,A),n?Object.getOwnPropertyDescriptor(e,t):void 0})(A,e,t)}function Wf(A){return Jf({...A,state:!0,attribute:!1})}const Xf="session_data",Yf=new class{constructor(A){this.namespace=A}getItem(A){return localStorage.getItem(`${this.namespace}.${A}`)}setItem(A,e){localStorage.setItem(`${this.namespace}.${A}`,e)}removeItem(A){localStorage.removeItem(`${this.namespace}.${A}`)}clear(){for(let A=0;A<localStorage.length;A++){const e=localStorage.key(A);e&&e.startsWith(`${this.namespace}.`)&&localStorage.removeItem(e)}}}("io.obi.widget");var qf=Object.defineProperty,$f=Object.getOwnPropertyDescriptor,Zf=(A,e,t,n)=>{for(var i,r=n>1?void 0:n?$f(e,t):e,s=A.length-1;s>=0;s--)(i=A[s])&&(r=(n?i(e,t,r):i(r))||r);return n&&r&&qf(e,t,r),r};class zf extends _f{constructor(){super(...arguments),this.id="",this.isActive=!1,this.isSpecial=!1}handleClick(A){A.preventDefault(),A.stopPropagation();const e=new CustomEvent("click",{detail:{id:this.id,isActive:!this.isActive},bubbles:!0,composed:!0});this.dispatchEvent(e),this.onClick&&this.onClick(this.id,!this.isActive)}render(){return Qf`
|
|
2
2
|
<button
|
|
3
3
|
id="obi-nav-${this.id}"
|
|
4
4
|
class=${this.isSpecial?"special":""}
|