@eluvio/elv-player-js 2.1.34 → 2.1.36
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/.vite/manifest.json +7 -7
- package/dist/elv-player-js.cjs.js +1 -1
- package/dist/elv-player-js.es.js +1 -1
- package/dist/{index-DMGKQjFi.mjs → index-B1gRiRD2.mjs} +3 -3
- package/dist/{index-DC2PyES4.js → index-B2qdKLww.js} +2 -2
- package/dist/{index-BzoP9Fdl.mjs → index-Dy_Z1b9T.mjs} +1 -1
- package/dist/{index-jSw7wEzz.js → index-GolQhNCt.js} +1 -1
- package/lib/player/Player.js +2 -2
- package/package.json +1 -1
|
@@ -324,7 +324,7 @@ ${p} ${e(s)}
|
|
|
324
324
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
325
325
|
* @license MIT
|
|
326
326
|
*/var W9;function Ap(){return W9||(W9=1,(function(n){const e=wL(),t=_L(),a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;n.Buffer=c,n.SlowBuffer=k,n.INSPECT_MAX_BYTES=50;const s=2147483647;n.kMaxLength=s,c.TYPED_ARRAY_SUPPORT=u(),!c.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function u(){try{const de=new Uint8Array(1),J={foo:function(){return 42}};return Object.setPrototypeOf(J,Uint8Array.prototype),Object.setPrototypeOf(de,J),de.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function o(de){if(de>s)throw new RangeError('The value "'+de+'" is invalid for option "size"');const J=new Uint8Array(de);return Object.setPrototypeOf(J,c.prototype),J}function c(de,J,F){if(typeof de=="number"){if(typeof J=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return m(de)}return p(de,J,F)}c.poolSize=8192;function p(de,J,F){if(typeof de=="string")return v(de,J);if(ArrayBuffer.isView(de))return x(de);if(de==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof de);if(Re(de,ArrayBuffer)||de&&Re(de.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Re(de,SharedArrayBuffer)||de&&Re(de.buffer,SharedArrayBuffer)))return E(de,J,F);if(typeof de=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const ue=de.valueOf&&de.valueOf();if(ue!=null&&ue!==de)return c.from(ue,J,F);const Ae=C(de);if(Ae)return Ae;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof de[Symbol.toPrimitive]=="function")return c.from(de[Symbol.toPrimitive]("string"),J,F);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof de)}c.from=function(de,J,F){return p(de,J,F)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array);function d(de){if(typeof de!="number")throw new TypeError('"size" argument must be of type number');if(de<0)throw new RangeError('The value "'+de+'" is invalid for option "size"')}function y(de,J,F){return d(de),de<=0?o(de):J!==void 0?typeof F=="string"?o(de).fill(J,F):o(de).fill(J):o(de)}c.alloc=function(de,J,F){return y(de,J,F)};function m(de){return d(de),o(de<0?0:T(de)|0)}c.allocUnsafe=function(de){return m(de)},c.allocUnsafeSlow=function(de){return m(de)};function v(de,J){if((typeof J!="string"||J==="")&&(J="utf8"),!c.isEncoding(J))throw new TypeError("Unknown encoding: "+J);const F=M(de,J)|0;let ue=o(F);const Ae=ue.write(de,J);return Ae!==F&&(ue=ue.slice(0,Ae)),ue}function b(de){const J=de.length<0?0:T(de.length)|0,F=o(J);for(let ue=0;ue<J;ue+=1)F[ue]=de[ue]&255;return F}function x(de){if(Re(de,Uint8Array)){const J=new Uint8Array(de);return E(J.buffer,J.byteOffset,J.byteLength)}return b(de)}function E(de,J,F){if(J<0||de.byteLength<J)throw new RangeError('"offset" is outside of buffer bounds');if(de.byteLength<J+(F||0))throw new RangeError('"length" is outside of buffer bounds');let ue;return J===void 0&&F===void 0?ue=new Uint8Array(de):F===void 0?ue=new Uint8Array(de,J):ue=new Uint8Array(de,J,F),Object.setPrototypeOf(ue,c.prototype),ue}function C(de){if(c.isBuffer(de)){const J=T(de.length)|0,F=o(J);return F.length===0||de.copy(F,0,0,J),F}if(de.length!==void 0)return typeof de.length!="number"||Je(de.length)?o(0):b(de);if(de.type==="Buffer"&&Array.isArray(de.data))return b(de.data)}function T(de){if(de>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return de|0}function k(de){return+de!=de&&(de=0),c.alloc(+de)}c.isBuffer=function(J){return J!=null&&J._isBuffer===!0&&J!==c.prototype},c.compare=function(J,F){if(Re(J,Uint8Array)&&(J=c.from(J,J.offset,J.byteLength)),Re(F,Uint8Array)&&(F=c.from(F,F.offset,F.byteLength)),!c.isBuffer(J)||!c.isBuffer(F))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(J===F)return 0;let ue=J.length,Ae=F.length;for(let Le=0,Be=Math.min(ue,Ae);Le<Be;++Le)if(J[Le]!==F[Le]){ue=J[Le],Ae=F[Le];break}return ue<Ae?-1:Ae<ue?1:0},c.isEncoding=function(J){switch(String(J).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(J,F){if(!Array.isArray(J))throw new TypeError('"list" argument must be an Array of Buffers');if(J.length===0)return c.alloc(0);let ue;if(F===void 0)for(F=0,ue=0;ue<J.length;++ue)F+=J[ue].length;const Ae=c.allocUnsafe(F);let Le=0;for(ue=0;ue<J.length;++ue){let Be=J[ue];if(Re(Be,Uint8Array))Le+Be.length>Ae.length?(c.isBuffer(Be)||(Be=c.from(Be)),Be.copy(Ae,Le)):Uint8Array.prototype.set.call(Ae,Be,Le);else if(c.isBuffer(Be))Be.copy(Ae,Le);else throw new TypeError('"list" argument must be an Array of Buffers');Le+=Be.length}return Ae};function M(de,J){if(c.isBuffer(de))return de.length;if(ArrayBuffer.isView(de)||Re(de,ArrayBuffer))return de.byteLength;if(typeof de!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof de);const F=de.length,ue=arguments.length>2&&arguments[2]===!0;if(!ue&&F===0)return 0;let Ae=!1;for(;;)switch(J){case"ascii":case"latin1":case"binary":return F;case"utf8":case"utf-8":return B(de).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F*2;case"hex":return F>>>1;case"base64":return le(de).length;default:if(Ae)return ue?-1:B(de).length;J=(""+J).toLowerCase(),Ae=!0}}c.byteLength=M;function O(de,J,F){let ue=!1;if((J===void 0||J<0)&&(J=0),J>this.length||((F===void 0||F>this.length)&&(F=this.length),F<=0)||(F>>>=0,J>>>=0,F<=J))return"";for(de||(de="utf8");;)switch(de){case"hex":return Z(this,J,F);case"utf8":case"utf-8":return _(this,J,F);case"ascii":return q(this,J,F);case"latin1":case"binary":return z(this,J,F);case"base64":return S(this,J,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return W(this,J,F);default:if(ue)throw new TypeError("Unknown encoding: "+de);de=(de+"").toLowerCase(),ue=!0}}c.prototype._isBuffer=!0;function R(de,J,F){const ue=de[J];de[J]=de[F],de[F]=ue}c.prototype.swap16=function(){const J=this.length;if(J%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let F=0;F<J;F+=2)R(this,F,F+1);return this},c.prototype.swap32=function(){const J=this.length;if(J%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let F=0;F<J;F+=4)R(this,F,F+3),R(this,F+1,F+2);return this},c.prototype.swap64=function(){const J=this.length;if(J%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let F=0;F<J;F+=8)R(this,F,F+7),R(this,F+1,F+6),R(this,F+2,F+5),R(this,F+3,F+4);return this},c.prototype.toString=function(){const J=this.length;return J===0?"":arguments.length===0?_(this,0,J):O.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(J){if(!c.isBuffer(J))throw new TypeError("Argument must be a Buffer");return this===J?!0:c.compare(this,J)===0},c.prototype.inspect=function(){let J="";const F=n.INSPECT_MAX_BYTES;return J=this.toString("hex",0,F).replace(/(.{2})/g,"$1 ").trim(),this.length>F&&(J+=" ... "),"<Buffer "+J+">"},a&&(c.prototype[a]=c.prototype.inspect),c.prototype.compare=function(J,F,ue,Ae,Le){if(Re(J,Uint8Array)&&(J=c.from(J,J.offset,J.byteLength)),!c.isBuffer(J))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof J);if(F===void 0&&(F=0),ue===void 0&&(ue=J?J.length:0),Ae===void 0&&(Ae=0),Le===void 0&&(Le=this.length),F<0||ue>J.length||Ae<0||Le>this.length)throw new RangeError("out of range index");if(Ae>=Le&&F>=ue)return 0;if(Ae>=Le)return-1;if(F>=ue)return 1;if(F>>>=0,ue>>>=0,Ae>>>=0,Le>>>=0,this===J)return 0;let Be=Le-Ae,dt=ue-F;const Ie=Math.min(Be,dt),He=this.slice(Ae,Le),ge=J.slice(F,ue);for(let Ye=0;Ye<Ie;++Ye)if(He[Ye]!==ge[Ye]){Be=He[Ye],dt=ge[Ye];break}return Be<dt?-1:dt<Be?1:0};function $(de,J,F,ue,Ae){if(de.length===0)return-1;if(typeof F=="string"?(ue=F,F=0):F>2147483647?F=2147483647:F<-2147483648&&(F=-2147483648),F=+F,Je(F)&&(F=Ae?0:de.length-1),F<0&&(F=de.length+F),F>=de.length){if(Ae)return-1;F=de.length-1}else if(F<0)if(Ae)F=0;else return-1;if(typeof J=="string"&&(J=c.from(J,ue)),c.isBuffer(J))return J.length===0?-1:X(de,J,F,ue,Ae);if(typeof J=="number")return J=J&255,typeof Uint8Array.prototype.indexOf=="function"?Ae?Uint8Array.prototype.indexOf.call(de,J,F):Uint8Array.prototype.lastIndexOf.call(de,J,F):X(de,[J],F,ue,Ae);throw new TypeError("val must be string, number or Buffer")}function X(de,J,F,ue,Ae){let Le=1,Be=de.length,dt=J.length;if(ue!==void 0&&(ue=String(ue).toLowerCase(),ue==="ucs2"||ue==="ucs-2"||ue==="utf16le"||ue==="utf-16le")){if(de.length<2||J.length<2)return-1;Le=2,Be/=2,dt/=2,F/=2}function Ie(ge,Ye){return Le===1?ge[Ye]:ge.readUInt16BE(Ye*Le)}let He;if(Ae){let ge=-1;for(He=F;He<Be;He++)if(Ie(de,He)===Ie(J,ge===-1?0:He-ge)){if(ge===-1&&(ge=He),He-ge+1===dt)return ge*Le}else ge!==-1&&(He-=He-ge),ge=-1}else for(F+dt>Be&&(F=Be-dt),He=F;He>=0;He--){let ge=!0;for(let Ye=0;Ye<dt;Ye++)if(Ie(de,He+Ye)!==Ie(J,Ye)){ge=!1;break}if(ge)return He}return-1}c.prototype.includes=function(J,F,ue){return this.indexOf(J,F,ue)!==-1},c.prototype.indexOf=function(J,F,ue){return $(this,J,F,ue,!0)},c.prototype.lastIndexOf=function(J,F,ue){return $(this,J,F,ue,!1)};function se(de,J,F,ue){F=Number(F)||0;const Ae=de.length-F;ue?(ue=Number(ue),ue>Ae&&(ue=Ae)):ue=Ae;const Le=J.length;ue>Le/2&&(ue=Le/2);let Be;for(Be=0;Be<ue;++Be){const dt=parseInt(J.substr(Be*2,2),16);if(Je(dt))return Be;de[F+Be]=dt}return Be}function ye(de,J,F,ue){return ke(B(J,de.length-F),de,F,ue)}function he(de,J,F,ue){return ke(H(J),de,F,ue)}function te(de,J,F,ue){return ke(le(J),de,F,ue)}function re(de,J,F,ue){return ke(Q(J,de.length-F),de,F,ue)}c.prototype.write=function(J,F,ue,Ae){if(F===void 0)Ae="utf8",ue=this.length,F=0;else if(ue===void 0&&typeof F=="string")Ae=F,ue=this.length,F=0;else if(isFinite(F))F=F>>>0,isFinite(ue)?(ue=ue>>>0,Ae===void 0&&(Ae="utf8")):(Ae=ue,ue=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Le=this.length-F;if((ue===void 0||ue>Le)&&(ue=Le),J.length>0&&(ue<0||F<0)||F>this.length)throw new RangeError("Attempt to write outside buffer bounds");Ae||(Ae="utf8");let Be=!1;for(;;)switch(Ae){case"hex":return se(this,J,F,ue);case"utf8":case"utf-8":return ye(this,J,F,ue);case"ascii":case"latin1":case"binary":return he(this,J,F,ue);case"base64":return te(this,J,F,ue);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return re(this,J,F,ue);default:if(Be)throw new TypeError("Unknown encoding: "+Ae);Ae=(""+Ae).toLowerCase(),Be=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function S(de,J,F){return J===0&&F===de.length?e.fromByteArray(de):e.fromByteArray(de.slice(J,F))}function _(de,J,F){F=Math.min(de.length,F);const ue=[];let Ae=J;for(;Ae<F;){const Le=de[Ae];let Be=null,dt=Le>239?4:Le>223?3:Le>191?2:1;if(Ae+dt<=F){let Ie,He,ge,Ye;switch(dt){case 1:Le<128&&(Be=Le);break;case 2:Ie=de[Ae+1],(Ie&192)===128&&(Ye=(Le&31)<<6|Ie&63,Ye>127&&(Be=Ye));break;case 3:Ie=de[Ae+1],He=de[Ae+2],(Ie&192)===128&&(He&192)===128&&(Ye=(Le&15)<<12|(Ie&63)<<6|He&63,Ye>2047&&(Ye<55296||Ye>57343)&&(Be=Ye));break;case 4:Ie=de[Ae+1],He=de[Ae+2],ge=de[Ae+3],(Ie&192)===128&&(He&192)===128&&(ge&192)===128&&(Ye=(Le&15)<<18|(Ie&63)<<12|(He&63)<<6|ge&63,Ye>65535&&Ye<1114112&&(Be=Ye))}}Be===null?(Be=65533,dt=1):Be>65535&&(Be-=65536,ue.push(Be>>>10&1023|55296),Be=56320|Be&1023),ue.push(Be),Ae+=dt}return j(ue)}const P=4096;function j(de){const J=de.length;if(J<=P)return String.fromCharCode.apply(String,de);let F="",ue=0;for(;ue<J;)F+=String.fromCharCode.apply(String,de.slice(ue,ue+=P));return F}function q(de,J,F){let ue="";F=Math.min(de.length,F);for(let Ae=J;Ae<F;++Ae)ue+=String.fromCharCode(de[Ae]&127);return ue}function z(de,J,F){let ue="";F=Math.min(de.length,F);for(let Ae=J;Ae<F;++Ae)ue+=String.fromCharCode(de[Ae]);return ue}function Z(de,J,F){const ue=de.length;(!J||J<0)&&(J=0),(!F||F<0||F>ue)&&(F=ue);let Ae="";for(let Le=J;Le<F;++Le)Ae+=lt[de[Le]];return Ae}function W(de,J,F){const ue=de.slice(J,F);let Ae="";for(let Le=0;Le<ue.length-1;Le+=2)Ae+=String.fromCharCode(ue[Le]+ue[Le+1]*256);return Ae}c.prototype.slice=function(J,F){const ue=this.length;J=~~J,F=F===void 0?ue:~~F,J<0?(J+=ue,J<0&&(J=0)):J>ue&&(J=ue),F<0?(F+=ue,F<0&&(F=0)):F>ue&&(F=ue),F<J&&(F=J);const Ae=this.subarray(J,F);return Object.setPrototypeOf(Ae,c.prototype),Ae};function D(de,J,F){if(de%1!==0||de<0)throw new RangeError("offset is not uint");if(de+J>F)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(J,F,ue){J=J>>>0,F=F>>>0,ue||D(J,F,this.length);let Ae=this[J],Le=1,Be=0;for(;++Be<F&&(Le*=256);)Ae+=this[J+Be]*Le;return Ae},c.prototype.readUintBE=c.prototype.readUIntBE=function(J,F,ue){J=J>>>0,F=F>>>0,ue||D(J,F,this.length);let Ae=this[J+--F],Le=1;for(;F>0&&(Le*=256);)Ae+=this[J+--F]*Le;return Ae},c.prototype.readUint8=c.prototype.readUInt8=function(J,F){return J=J>>>0,F||D(J,1,this.length),this[J]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(J,F){return J=J>>>0,F||D(J,2,this.length),this[J]|this[J+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(J,F){return J=J>>>0,F||D(J,2,this.length),this[J]<<8|this[J+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(J,F){return J=J>>>0,F||D(J,4,this.length),(this[J]|this[J+1]<<8|this[J+2]<<16)+this[J+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(J,F){return J=J>>>0,F||D(J,4,this.length),this[J]*16777216+(this[J+1]<<16|this[J+2]<<8|this[J+3])},c.prototype.readBigUInt64LE=et(function(J){J=J>>>0,me(J,"offset");const F=this[J],ue=this[J+7];(F===void 0||ue===void 0)&&fe(J,this.length-8);const Ae=F+this[++J]*2**8+this[++J]*2**16+this[++J]*2**24,Le=this[++J]+this[++J]*2**8+this[++J]*2**16+ue*2**24;return BigInt(Ae)+(BigInt(Le)<<BigInt(32))}),c.prototype.readBigUInt64BE=et(function(J){J=J>>>0,me(J,"offset");const F=this[J],ue=this[J+7];(F===void 0||ue===void 0)&&fe(J,this.length-8);const Ae=F*2**24+this[++J]*2**16+this[++J]*2**8+this[++J],Le=this[++J]*2**24+this[++J]*2**16+this[++J]*2**8+ue;return(BigInt(Ae)<<BigInt(32))+BigInt(Le)}),c.prototype.readIntLE=function(J,F,ue){J=J>>>0,F=F>>>0,ue||D(J,F,this.length);let Ae=this[J],Le=1,Be=0;for(;++Be<F&&(Le*=256);)Ae+=this[J+Be]*Le;return Le*=128,Ae>=Le&&(Ae-=Math.pow(2,8*F)),Ae},c.prototype.readIntBE=function(J,F,ue){J=J>>>0,F=F>>>0,ue||D(J,F,this.length);let Ae=F,Le=1,Be=this[J+--Ae];for(;Ae>0&&(Le*=256);)Be+=this[J+--Ae]*Le;return Le*=128,Be>=Le&&(Be-=Math.pow(2,8*F)),Be},c.prototype.readInt8=function(J,F){return J=J>>>0,F||D(J,1,this.length),this[J]&128?(255-this[J]+1)*-1:this[J]},c.prototype.readInt16LE=function(J,F){J=J>>>0,F||D(J,2,this.length);const ue=this[J]|this[J+1]<<8;return ue&32768?ue|4294901760:ue},c.prototype.readInt16BE=function(J,F){J=J>>>0,F||D(J,2,this.length);const ue=this[J+1]|this[J]<<8;return ue&32768?ue|4294901760:ue},c.prototype.readInt32LE=function(J,F){return J=J>>>0,F||D(J,4,this.length),this[J]|this[J+1]<<8|this[J+2]<<16|this[J+3]<<24},c.prototype.readInt32BE=function(J,F){return J=J>>>0,F||D(J,4,this.length),this[J]<<24|this[J+1]<<16|this[J+2]<<8|this[J+3]},c.prototype.readBigInt64LE=et(function(J){J=J>>>0,me(J,"offset");const F=this[J],ue=this[J+7];(F===void 0||ue===void 0)&&fe(J,this.length-8);const Ae=this[J+4]+this[J+5]*2**8+this[J+6]*2**16+(ue<<24);return(BigInt(Ae)<<BigInt(32))+BigInt(F+this[++J]*2**8+this[++J]*2**16+this[++J]*2**24)}),c.prototype.readBigInt64BE=et(function(J){J=J>>>0,me(J,"offset");const F=this[J],ue=this[J+7];(F===void 0||ue===void 0)&&fe(J,this.length-8);const Ae=(F<<24)+this[++J]*2**16+this[++J]*2**8+this[++J];return(BigInt(Ae)<<BigInt(32))+BigInt(this[++J]*2**24+this[++J]*2**16+this[++J]*2**8+ue)}),c.prototype.readFloatLE=function(J,F){return J=J>>>0,F||D(J,4,this.length),t.read(this,J,!0,23,4)},c.prototype.readFloatBE=function(J,F){return J=J>>>0,F||D(J,4,this.length),t.read(this,J,!1,23,4)},c.prototype.readDoubleLE=function(J,F){return J=J>>>0,F||D(J,8,this.length),t.read(this,J,!0,52,8)},c.prototype.readDoubleBE=function(J,F){return J=J>>>0,F||D(J,8,this.length),t.read(this,J,!1,52,8)};function N(de,J,F,ue,Ae,Le){if(!c.isBuffer(de))throw new TypeError('"buffer" argument must be a Buffer instance');if(J>Ae||J<Le)throw new RangeError('"value" argument is out of bounds');if(F+ue>de.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(J,F,ue,Ae){if(J=+J,F=F>>>0,ue=ue>>>0,!Ae){const dt=Math.pow(2,8*ue)-1;N(this,J,F,ue,dt,0)}let Le=1,Be=0;for(this[F]=J&255;++Be<ue&&(Le*=256);)this[F+Be]=J/Le&255;return F+ue},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(J,F,ue,Ae){if(J=+J,F=F>>>0,ue=ue>>>0,!Ae){const dt=Math.pow(2,8*ue)-1;N(this,J,F,ue,dt,0)}let Le=ue-1,Be=1;for(this[F+Le]=J&255;--Le>=0&&(Be*=256);)this[F+Le]=J/Be&255;return F+ue},c.prototype.writeUint8=c.prototype.writeUInt8=function(J,F,ue){return J=+J,F=F>>>0,ue||N(this,J,F,1,255,0),this[F]=J&255,F+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(J,F,ue){return J=+J,F=F>>>0,ue||N(this,J,F,2,65535,0),this[F]=J&255,this[F+1]=J>>>8,F+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(J,F,ue){return J=+J,F=F>>>0,ue||N(this,J,F,2,65535,0),this[F]=J>>>8,this[F+1]=J&255,F+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(J,F,ue){return J=+J,F=F>>>0,ue||N(this,J,F,4,4294967295,0),this[F+3]=J>>>24,this[F+2]=J>>>16,this[F+1]=J>>>8,this[F]=J&255,F+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(J,F,ue){return J=+J,F=F>>>0,ue||N(this,J,F,4,4294967295,0),this[F]=J>>>24,this[F+1]=J>>>16,this[F+2]=J>>>8,this[F+3]=J&255,F+4};function Y(de,J,F,ue,Ae){be(J,ue,Ae,de,F,7);let Le=Number(J&BigInt(4294967295));de[F++]=Le,Le=Le>>8,de[F++]=Le,Le=Le>>8,de[F++]=Le,Le=Le>>8,de[F++]=Le;let Be=Number(J>>BigInt(32)&BigInt(4294967295));return de[F++]=Be,Be=Be>>8,de[F++]=Be,Be=Be>>8,de[F++]=Be,Be=Be>>8,de[F++]=Be,F}function ie(de,J,F,ue,Ae){be(J,ue,Ae,de,F,7);let Le=Number(J&BigInt(4294967295));de[F+7]=Le,Le=Le>>8,de[F+6]=Le,Le=Le>>8,de[F+5]=Le,Le=Le>>8,de[F+4]=Le;let Be=Number(J>>BigInt(32)&BigInt(4294967295));return de[F+3]=Be,Be=Be>>8,de[F+2]=Be,Be=Be>>8,de[F+1]=Be,Be=Be>>8,de[F]=Be,F+8}c.prototype.writeBigUInt64LE=et(function(J,F=0){return Y(this,J,F,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=et(function(J,F=0){return ie(this,J,F,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(J,F,ue,Ae){if(J=+J,F=F>>>0,!Ae){const Ie=Math.pow(2,8*ue-1);N(this,J,F,ue,Ie-1,-Ie)}let Le=0,Be=1,dt=0;for(this[F]=J&255;++Le<ue&&(Be*=256);)J<0&&dt===0&&this[F+Le-1]!==0&&(dt=1),this[F+Le]=(J/Be>>0)-dt&255;return F+ue},c.prototype.writeIntBE=function(J,F,ue,Ae){if(J=+J,F=F>>>0,!Ae){const Ie=Math.pow(2,8*ue-1);N(this,J,F,ue,Ie-1,-Ie)}let Le=ue-1,Be=1,dt=0;for(this[F+Le]=J&255;--Le>=0&&(Be*=256);)J<0&&dt===0&&this[F+Le+1]!==0&&(dt=1),this[F+Le]=(J/Be>>0)-dt&255;return F+ue},c.prototype.writeInt8=function(J,F,ue){return J=+J,F=F>>>0,ue||N(this,J,F,1,127,-128),J<0&&(J=255+J+1),this[F]=J&255,F+1},c.prototype.writeInt16LE=function(J,F,ue){return J=+J,F=F>>>0,ue||N(this,J,F,2,32767,-32768),this[F]=J&255,this[F+1]=J>>>8,F+2},c.prototype.writeInt16BE=function(J,F,ue){return J=+J,F=F>>>0,ue||N(this,J,F,2,32767,-32768),this[F]=J>>>8,this[F+1]=J&255,F+2},c.prototype.writeInt32LE=function(J,F,ue){return J=+J,F=F>>>0,ue||N(this,J,F,4,2147483647,-2147483648),this[F]=J&255,this[F+1]=J>>>8,this[F+2]=J>>>16,this[F+3]=J>>>24,F+4},c.prototype.writeInt32BE=function(J,F,ue){return J=+J,F=F>>>0,ue||N(this,J,F,4,2147483647,-2147483648),J<0&&(J=4294967295+J+1),this[F]=J>>>24,this[F+1]=J>>>16,this[F+2]=J>>>8,this[F+3]=J&255,F+4},c.prototype.writeBigInt64LE=et(function(J,F=0){return Y(this,J,F,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=et(function(J,F=0){return ie(this,J,F,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function V(de,J,F,ue,Ae,Le){if(F+ue>de.length)throw new RangeError("Index out of range");if(F<0)throw new RangeError("Index out of range")}function Ce(de,J,F,ue,Ae){return J=+J,F=F>>>0,Ae||V(de,J,F,4),t.write(de,J,F,ue,23,4),F+4}c.prototype.writeFloatLE=function(J,F,ue){return Ce(this,J,F,!0,ue)},c.prototype.writeFloatBE=function(J,F,ue){return Ce(this,J,F,!1,ue)};function Pe(de,J,F,ue,Ae){return J=+J,F=F>>>0,Ae||V(de,J,F,8),t.write(de,J,F,ue,52,8),F+8}c.prototype.writeDoubleLE=function(J,F,ue){return Pe(this,J,F,!0,ue)},c.prototype.writeDoubleBE=function(J,F,ue){return Pe(this,J,F,!1,ue)},c.prototype.copy=function(J,F,ue,Ae){if(!c.isBuffer(J))throw new TypeError("argument should be a Buffer");if(ue||(ue=0),!Ae&&Ae!==0&&(Ae=this.length),F>=J.length&&(F=J.length),F||(F=0),Ae>0&&Ae<ue&&(Ae=ue),Ae===ue||J.length===0||this.length===0)return 0;if(F<0)throw new RangeError("targetStart out of bounds");if(ue<0||ue>=this.length)throw new RangeError("Index out of range");if(Ae<0)throw new RangeError("sourceEnd out of bounds");Ae>this.length&&(Ae=this.length),J.length-F<Ae-ue&&(Ae=J.length-F+ue);const Le=Ae-ue;return this===J&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(F,ue,Ae):Uint8Array.prototype.set.call(J,this.subarray(ue,Ae),F),Le},c.prototype.fill=function(J,F,ue,Ae){if(typeof J=="string"){if(typeof F=="string"?(Ae=F,F=0,ue=this.length):typeof ue=="string"&&(Ae=ue,ue=this.length),Ae!==void 0&&typeof Ae!="string")throw new TypeError("encoding must be a string");if(typeof Ae=="string"&&!c.isEncoding(Ae))throw new TypeError("Unknown encoding: "+Ae);if(J.length===1){const Be=J.charCodeAt(0);(Ae==="utf8"&&Be<128||Ae==="latin1")&&(J=Be)}}else typeof J=="number"?J=J&255:typeof J=="boolean"&&(J=Number(J));if(F<0||this.length<F||this.length<ue)throw new RangeError("Out of range index");if(ue<=F)return this;F=F>>>0,ue=ue===void 0?this.length:ue>>>0,J||(J=0);let Le;if(typeof J=="number")for(Le=F;Le<ue;++Le)this[Le]=J;else{const Be=c.isBuffer(J)?J:c.from(J,Ae),dt=Be.length;if(dt===0)throw new TypeError('The value "'+J+'" is invalid for argument "value"');for(Le=0;Le<ue-F;++Le)this[Le+F]=Be[Le%dt]}return this};const Se={};function Ee(de,J,F){Se[de]=class extends F{constructor(){super(),Object.defineProperty(this,"message",{value:J.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${de}]`,this.stack,delete this.name}get code(){return de}set code(Ae){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Ae,writable:!0})}toString(){return`${this.name} [${de}]: ${this.message}`}}}Ee("ERR_BUFFER_OUT_OF_BOUNDS",function(de){return de?`${de} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Ee("ERR_INVALID_ARG_TYPE",function(de,J){return`The "${de}" argument must be of type number. Received type ${typeof J}`},TypeError),Ee("ERR_OUT_OF_RANGE",function(de,J,F){let ue=`The value of "${de}" is out of range.`,Ae=F;return Number.isInteger(F)&&Math.abs(F)>2**32?Ae=oe(String(F)):typeof F=="bigint"&&(Ae=String(F),(F>BigInt(2)**BigInt(32)||F<-(BigInt(2)**BigInt(32)))&&(Ae=oe(Ae)),Ae+="n"),ue+=` It must be ${J}. Received ${Ae}`,ue},RangeError);function oe(de){let J="",F=de.length;const ue=de[0]==="-"?1:0;for(;F>=ue+4;F-=3)J=`_${de.slice(F-3,F)}${J}`;return`${de.slice(0,F)}${J}`}function ce(de,J,F){me(J,"offset"),(de[J]===void 0||de[J+F]===void 0)&&fe(J,de.length-(F+1))}function be(de,J,F,ue,Ae,Le){if(de>F||de<J){const Be=typeof J=="bigint"?"n":"";let dt;throw J===0||J===BigInt(0)?dt=`>= 0${Be} and < 2${Be} ** ${(Le+1)*8}${Be}`:dt=`>= -(2${Be} ** ${(Le+1)*8-1}${Be}) and < 2 ** ${(Le+1)*8-1}${Be}`,new Se.ERR_OUT_OF_RANGE("value",dt,de)}ce(ue,Ae,Le)}function me(de,J){if(typeof de!="number")throw new Se.ERR_INVALID_ARG_TYPE(J,"number",de)}function fe(de,J,F){throw Math.floor(de)!==de?(me(de,F),new Se.ERR_OUT_OF_RANGE("offset","an integer",de)):J<0?new Se.ERR_BUFFER_OUT_OF_BOUNDS:new Se.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${J}`,de)}const _e=/[^+/0-9A-Za-z-_]/g;function ne(de){if(de=de.split("=")[0],de=de.trim().replace(_e,""),de.length<2)return"";for(;de.length%4!==0;)de=de+"=";return de}function B(de,J){J=J||1/0;let F;const ue=de.length;let Ae=null;const Le=[];for(let Be=0;Be<ue;++Be){if(F=de.charCodeAt(Be),F>55295&&F<57344){if(!Ae){if(F>56319){(J-=3)>-1&&Le.push(239,191,189);continue}else if(Be+1===ue){(J-=3)>-1&&Le.push(239,191,189);continue}Ae=F;continue}if(F<56320){(J-=3)>-1&&Le.push(239,191,189),Ae=F;continue}F=(Ae-55296<<10|F-56320)+65536}else Ae&&(J-=3)>-1&&Le.push(239,191,189);if(Ae=null,F<128){if((J-=1)<0)break;Le.push(F)}else if(F<2048){if((J-=2)<0)break;Le.push(F>>6|192,F&63|128)}else if(F<65536){if((J-=3)<0)break;Le.push(F>>12|224,F>>6&63|128,F&63|128)}else if(F<1114112){if((J-=4)<0)break;Le.push(F>>18|240,F>>12&63|128,F>>6&63|128,F&63|128)}else throw new Error("Invalid code point")}return Le}function H(de){const J=[];for(let F=0;F<de.length;++F)J.push(de.charCodeAt(F)&255);return J}function Q(de,J){let F,ue,Ae;const Le=[];for(let Be=0;Be<de.length&&!((J-=2)<0);++Be)F=de.charCodeAt(Be),ue=F>>8,Ae=F%256,Le.push(Ae),Le.push(ue);return Le}function le(de){return e.toByteArray(ne(de))}function ke(de,J,F,ue){let Ae;for(Ae=0;Ae<ue&&!(Ae+F>=J.length||Ae>=de.length);++Ae)J[Ae+F]=de[Ae];return Ae}function Re(de,J){return de instanceof J||de!=null&&de.constructor!=null&&de.constructor.name!=null&&de.constructor.name===J.name}function Je(de){return de!==de}const lt=(function(){const de="0123456789abcdef",J=new Array(256);for(let F=0;F<16;++F){const ue=F*16;for(let Ae=0;Ae<16;++Ae)J[ue+Ae]=de[F]+de[Ae]}return J})();function et(de){return typeof BigInt>"u"?xt:de}function xt(){throw new Error("BigInt not supported")}})(gE)),gE}var vE,K9;function oa(){return K9||(K9=1,vE={ArrayIsArray(n){return Array.isArray(n)},ArrayPrototypeIncludes(n,e){return n.includes(e)},ArrayPrototypeIndexOf(n,e){return n.indexOf(e)},ArrayPrototypeJoin(n,e){return n.join(e)},ArrayPrototypeMap(n,e){return n.map(e)},ArrayPrototypePop(n,e){return n.pop(e)},ArrayPrototypePush(n,e){return n.push(e)},ArrayPrototypeSlice(n,e,t){return n.slice(e,t)},Error,FunctionPrototypeCall(n,e,...t){return n.call(e,...t)},FunctionPrototypeSymbolHasInstance(n,e){return Function.prototype[Symbol.hasInstance].call(n,e)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(n,e){return Object.defineProperties(n,e)},ObjectDefineProperty(n,e,t){return Object.defineProperty(n,e,t)},ObjectGetOwnPropertyDescriptor(n,e){return Object.getOwnPropertyDescriptor(n,e)},ObjectKeys(n){return Object.keys(n)},ObjectSetPrototypeOf(n,e){return Object.setPrototypeOf(n,e)},Promise,PromisePrototypeCatch(n,e){return n.catch(e)},PromisePrototypeThen(n,e,t){return n.then(e,t)},PromiseReject(n){return Promise.reject(n)},PromiseResolve(n){return Promise.resolve(n)},ReflectApply:Reflect.apply,RegExpPrototypeTest(n,e){return n.test(e)},SafeSet:Set,String,StringPrototypeSlice(n,e,t){return n.slice(e,t)},StringPrototypeToLowerCase(n){return n.toLowerCase()},StringPrototypeToUpperCase(n){return n.toUpperCase()},StringPrototypeTrim(n){return n.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(n,e,t){return n.set(e,t)},Boolean,Uint8Array}),vE}var bE={exports:{}},ng={exports:{}},J9;function Rg(){if(J9)return ng.exports;J9=1;const{AbortController:n,AbortSignal:e}=typeof self<"u"?self:typeof window<"u"?window:void 0;return ng.exports=n,ng.exports.AbortSignal=e,ng.exports.default=n,ng.exports}var fw={exports:{}},Y9;function Vg(){if(Y9)return fw.exports;Y9=1;var n=typeof Reflect=="object"?Reflect:null,e=n&&typeof n.apply=="function"?n.apply:function(R,$,X){return Function.prototype.apply.call(R,$,X)},t;n&&typeof n.ownKeys=="function"?t=n.ownKeys:Object.getOwnPropertySymbols?t=function(R){return Object.getOwnPropertyNames(R).concat(Object.getOwnPropertySymbols(R))}:t=function(R){return Object.getOwnPropertyNames(R)};function a(O){console&&console.warn&&console.warn(O)}var s=Number.isNaN||function(R){return R!==R};function u(){u.init.call(this)}fw.exports=u,fw.exports.once=T,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var o=10;function c(O){if(typeof O!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof O)}Object.defineProperty(u,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(O){if(typeof O!="number"||O<0||s(O))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+O+".");o=O}}),u.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},u.prototype.setMaxListeners=function(R){if(typeof R!="number"||R<0||s(R))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+R+".");return this._maxListeners=R,this};function p(O){return O._maxListeners===void 0?u.defaultMaxListeners:O._maxListeners}u.prototype.getMaxListeners=function(){return p(this)},u.prototype.emit=function(R){for(var $=[],X=1;X<arguments.length;X++)$.push(arguments[X]);var se=R==="error",ye=this._events;if(ye!==void 0)se=se&&ye.error===void 0;else if(!se)return!1;if(se){var he;if($.length>0&&(he=$[0]),he instanceof Error)throw he;var te=new Error("Unhandled error."+(he?" ("+he.message+")":""));throw te.context=he,te}var re=ye[R];if(re===void 0)return!1;if(typeof re=="function")e(re,this,$);else for(var S=re.length,_=x(re,S),X=0;X<S;++X)e(_[X],this,$);return!0};function d(O,R,$,X){var se,ye,he;if(c($),ye=O._events,ye===void 0?(ye=O._events=Object.create(null),O._eventsCount=0):(ye.newListener!==void 0&&(O.emit("newListener",R,$.listener?$.listener:$),ye=O._events),he=ye[R]),he===void 0)he=ye[R]=$,++O._eventsCount;else if(typeof he=="function"?he=ye[R]=X?[$,he]:[he,$]:X?he.unshift($):he.push($),se=p(O),se>0&&he.length>se&&!he.warned){he.warned=!0;var te=new Error("Possible EventEmitter memory leak detected. "+he.length+" "+String(R)+" listeners added. Use emitter.setMaxListeners() to increase limit");te.name="MaxListenersExceededWarning",te.emitter=O,te.type=R,te.count=he.length,a(te)}return O}u.prototype.addListener=function(R,$){return d(this,R,$,!1)},u.prototype.on=u.prototype.addListener,u.prototype.prependListener=function(R,$){return d(this,R,$,!0)};function y(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function m(O,R,$){var X={fired:!1,wrapFn:void 0,target:O,type:R,listener:$},se=y.bind(X);return se.listener=$,X.wrapFn=se,se}u.prototype.once=function(R,$){return c($),this.on(R,m(this,R,$)),this},u.prototype.prependOnceListener=function(R,$){return c($),this.prependListener(R,m(this,R,$)),this},u.prototype.removeListener=function(R,$){var X,se,ye,he,te;if(c($),se=this._events,se===void 0)return this;if(X=se[R],X===void 0)return this;if(X===$||X.listener===$)--this._eventsCount===0?this._events=Object.create(null):(delete se[R],se.removeListener&&this.emit("removeListener",R,X.listener||$));else if(typeof X!="function"){for(ye=-1,he=X.length-1;he>=0;he--)if(X[he]===$||X[he].listener===$){te=X[he].listener,ye=he;break}if(ye<0)return this;ye===0?X.shift():E(X,ye),X.length===1&&(se[R]=X[0]),se.removeListener!==void 0&&this.emit("removeListener",R,te||$)}return this},u.prototype.off=u.prototype.removeListener,u.prototype.removeAllListeners=function(R){var $,X,se;if(X=this._events,X===void 0)return this;if(X.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):X[R]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete X[R]),this;if(arguments.length===0){var ye=Object.keys(X),he;for(se=0;se<ye.length;++se)he=ye[se],he!=="removeListener"&&this.removeAllListeners(he);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if($=X[R],typeof $=="function")this.removeListener(R,$);else if($!==void 0)for(se=$.length-1;se>=0;se--)this.removeListener(R,$[se]);return this};function v(O,R,$){var X=O._events;if(X===void 0)return[];var se=X[R];return se===void 0?[]:typeof se=="function"?$?[se.listener||se]:[se]:$?C(se):x(se,se.length)}u.prototype.listeners=function(R){return v(this,R,!0)},u.prototype.rawListeners=function(R){return v(this,R,!1)},u.listenerCount=function(O,R){return typeof O.listenerCount=="function"?O.listenerCount(R):b.call(O,R)},u.prototype.listenerCount=b;function b(O){var R=this._events;if(R!==void 0){var $=R[O];if(typeof $=="function")return 1;if($!==void 0)return $.length}return 0}u.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function x(O,R){for(var $=new Array(R),X=0;X<R;++X)$[X]=O[X];return $}function E(O,R){for(;R+1<O.length;R++)O[R]=O[R+1];O.pop()}function C(O){for(var R=new Array(O.length),$=0;$<R.length;++$)R[$]=O[$].listener||O[$];return R}function T(O,R){return new Promise(function($,X){function se(he){O.removeListener(R,ye),X(he)}function ye(){typeof O.removeListener=="function"&&O.removeListener("error",se),$([].slice.call(arguments))}M(O,R,ye,{once:!0}),R!=="error"&&k(O,se,{once:!0})})}function k(O,R,$){typeof O.on=="function"&&M(O,"error",R,$)}function M(O,R,$,X){if(typeof O.on=="function")X.once?O.once(R,$):O.on(R,$);else if(typeof O.addEventListener=="function")O.addEventListener(R,function se(ye){X.once&&O.removeEventListener(R,se),$(ye)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof O)}return fw.exports}var Q9;function is(){return Q9||(Q9=1,(function(n){const e=Ap(),{kResistStopPropagation:t,SymbolDispose:a}=oa(),s=globalThis.AbortSignal||Rg().AbortSignal,u=globalThis.AbortController||Rg().AbortController,o=Object.getPrototypeOf(async function(){}).constructor,c=globalThis.Blob||e.Blob,p=typeof c<"u"?function(b){return b instanceof c}:function(b){return!1},d=(v,b)=>{if(v!==void 0&&(v===null||typeof v!="object"||!("aborted"in v)))throw new ERR_INVALID_ARG_TYPE(b,"AbortSignal",v)},y=(v,b)=>{if(typeof v!="function")throw new ERR_INVALID_ARG_TYPE(b,"Function",v)};class m extends Error{constructor(b){if(!Array.isArray(b))throw new TypeError(`Expected input to be an Array, got ${typeof b}`);let x="";for(let E=0;E<b.length;E++)x+=` ${b[E].stack}
|
|
327
|
-
`;super(x),this.name="AggregateError",this.errors=b}}n.exports={AggregateError:m,kEmptyObject:Object.freeze({}),once(v){let b=!1;return function(...x){b||(b=!0,v.apply(this,x))}},createDeferredPromise:function(){let v,b;return{promise:new Promise((E,C)=>{v=E,b=C}),resolve:v,reject:b}},promisify(v){return new Promise((b,x)=>{v((E,...C)=>E?x(E):b(...C))})},debuglog(){return function(){}},format(v,...b){return v.replace(/%([sdifj])/g,function(...[x,E]){const C=b.shift();return E==="f"?C.toFixed(6):E==="j"?JSON.stringify(C):E==="s"&&typeof C=="object"?`${C.constructor!==Object?C.constructor.name:""} {}`.trim():C.toString()})},inspect(v){switch(typeof v){case"string":if(v.includes("'"))if(v.includes('"')){if(!v.includes("`")&&!v.includes("${"))return`\`${v}\``}else return`"${v}"`;return`'${v}'`;case"number":return isNaN(v)?"NaN":Object.is(v,-0)?String(v):v;case"bigint":return`${String(v)}n`;case"boolean":case"undefined":return String(v);case"object":return"{}"}},types:{isAsyncFunction(v){return v instanceof o},isArrayBufferView(v){return ArrayBuffer.isView(v)}},isBlob:p,deprecate(v,b){return v},addAbortListener:Vg().addAbortListener||function(b,x){if(b===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",b);d(b,"signal"),y(x,"listener");let E;return b.aborted?queueMicrotask(()=>x()):(b.addEventListener("abort",x,{__proto__:null,once:!0,[t]:!0}),E=()=>{b.removeEventListener("abort",x)}),{__proto__:null,[a](){var C;(C=E)===null||C===void 0||C()}}},AbortSignalAny:s.any||function(b){if(b.length===1)return b[0];const x=new u,E=()=>x.abort();return b.forEach(C=>{d(C,"signals"),C.addEventListener("abort",E,{once:!0})}),x.signal.addEventListener("abort",()=>{b.forEach(C=>C.removeEventListener("abort",E))},{once:!0}),x.signal}},n.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(bE)),bE.exports}var dw={},wE,X9;function Ns(){if(X9)return wE;X9=1;const{format:n,inspect:e,AggregateError:t}=is(),a=globalThis.AggregateError||t,s=Symbol("kIsNodeError"),u=["string","function","number","object","Function","Object","boolean","bigint","symbol"],o=/^([A-Z][a-z0-9]*)+$/,c="__node_internal_",p={};function d(C,T){if(!C)throw new p.ERR_INTERNAL_ASSERTION(T)}function y(C){let T="",k=C.length;const M=C[0]==="-"?1:0;for(;k>=M+4;k-=3)T=`_${C.slice(k-3,k)}${T}`;return`${C.slice(0,k)}${T}`}function m(C,T,k){if(typeof T=="function")return d(T.length<=k.length,`Code: ${C}; The provided arguments length (${k.length}) does not match the required ones (${T.length}).`),T(...k);const M=(T.match(/%[dfijoOs]/g)||[]).length;return d(M===k.length,`Code: ${C}; The provided arguments length (${k.length}) does not match the required ones (${M}).`),k.length===0?T:n(T,...k)}function v(C,T,k){k||(k=Error);class M extends k{constructor(...R){super(m(C,T,R))}toString(){return`${this.name} [${C}]: ${this.message}`}}Object.defineProperties(M.prototype,{name:{value:k.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${C}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),M.prototype.code=C,M.prototype[s]=!0,p[C]=M}function b(C){const T=c+C.name;return Object.defineProperty(C,"name",{value:T}),C}function x(C,T){if(C&&T&&C!==T){if(Array.isArray(T.errors))return T.errors.push(C),T;const k=new a([T,C],T.message);return k.code=T.code,k}return C||T}class E extends Error{constructor(T="The operation was aborted",k=void 0){if(k!==void 0&&typeof k!="object")throw new p.ERR_INVALID_ARG_TYPE("options","Object",k);super(T,k),this.code="ABORT_ERR",this.name="AbortError"}}return v("ERR_ASSERTION","%s",Error),v("ERR_INVALID_ARG_TYPE",(C,T,k)=>{d(typeof C=="string","'name' must be a string"),Array.isArray(T)||(T=[T]);let M="The ";C.endsWith(" argument")?M+=`${C} `:M+=`"${C}" ${C.includes(".")?"property":"argument"} `,M+="must be ";const O=[],R=[],$=[];for(const se of T)d(typeof se=="string","All expected entries have to be of type string"),u.includes(se)?O.push(se.toLowerCase()):o.test(se)?R.push(se):(d(se!=="object",'The value "object" should be written as "Object"'),$.push(se));if(R.length>0){const se=O.indexOf("object");se!==-1&&(O.splice(O,se,1),R.push("Object"))}if(O.length>0){switch(O.length){case 1:M+=`of type ${O[0]}`;break;case 2:M+=`one of type ${O[0]} or ${O[1]}`;break;default:{const se=O.pop();M+=`one of type ${O.join(", ")}, or ${se}`}}(R.length>0||$.length>0)&&(M+=" or ")}if(R.length>0){switch(R.length){case 1:M+=`an instance of ${R[0]}`;break;case 2:M+=`an instance of ${R[0]} or ${R[1]}`;break;default:{const se=R.pop();M+=`an instance of ${R.join(", ")}, or ${se}`}}$.length>0&&(M+=" or ")}switch($.length){case 0:break;case 1:$[0].toLowerCase()!==$[0]&&(M+="an "),M+=`${$[0]}`;break;case 2:M+=`one of ${$[0]} or ${$[1]}`;break;default:{const se=$.pop();M+=`one of ${$.join(", ")}, or ${se}`}}if(k==null)M+=`. Received ${k}`;else if(typeof k=="function"&&k.name)M+=`. Received function ${k.name}`;else if(typeof k=="object"){var X;if((X=k.constructor)!==null&&X!==void 0&&X.name)M+=`. Received an instance of ${k.constructor.name}`;else{const se=e(k,{depth:-1});M+=`. Received ${se}`}}else{let se=e(k,{colors:!1});se.length>25&&(se=`${se.slice(0,25)}...`),M+=`. Received type ${typeof k} (${se})`}return M},TypeError),v("ERR_INVALID_ARG_VALUE",(C,T,k="is invalid")=>{let M=e(T);return M.length>128&&(M=M.slice(0,128)+"..."),`The ${C.includes(".")?"property":"argument"} '${C}' ${k}. Received ${M}`},TypeError),v("ERR_INVALID_RETURN_VALUE",(C,T,k)=>{var M;const O=k!=null&&(M=k.constructor)!==null&&M!==void 0&&M.name?`instance of ${k.constructor.name}`:`type ${typeof k}`;return`Expected ${C} to be returned from the "${T}" function but got ${O}.`},TypeError),v("ERR_MISSING_ARGS",(...C)=>{d(C.length>0,"At least one arg needs to be specified");let T;const k=C.length;switch(C=(Array.isArray(C)?C:[C]).map(M=>`"${M}"`).join(" or "),k){case 1:T+=`The ${C[0]} argument`;break;case 2:T+=`The ${C[0]} and ${C[1]} arguments`;break;default:{const M=C.pop();T+=`The ${C.join(", ")}, and ${M} arguments`}break}return`${T} must be specified`},TypeError),v("ERR_OUT_OF_RANGE",(C,T,k)=>{d(T,'Missing "range" argument');let M;return Number.isInteger(k)&&Math.abs(k)>2**32?M=y(String(k)):typeof k=="bigint"?(M=String(k),(k>2n**32n||k<-(2n**32n))&&(M=y(M)),M+="n"):M=e(k),`The value of "${C}" is out of range. It must be ${T}. Received ${M}`},RangeError),v("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),v("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),v("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),v("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),v("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),v("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),v("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),v("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),v("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),v("ERR_STREAM_WRITE_AFTER_END","write after end",Error),v("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),wE={AbortError:E,aggregateTwoErrors:b(x),hideStackFrames:b,codes:p},wE}var _E,Z9;function Gg(){if(Z9)return _E;Z9=1;const{ArrayIsArray:n,ArrayPrototypeIncludes:e,ArrayPrototypeJoin:t,ArrayPrototypeMap:a,NumberIsInteger:s,NumberIsNaN:u,NumberMAX_SAFE_INTEGER:o,NumberMIN_SAFE_INTEGER:c,NumberParseInt:p,ObjectPrototypeHasOwnProperty:d,RegExpPrototypeExec:y,String:m,StringPrototypeToUpperCase:v,StringPrototypeTrim:b}=oa(),{hideStackFrames:x,codes:{ERR_SOCKET_BAD_PORT:E,ERR_INVALID_ARG_TYPE:C,ERR_INVALID_ARG_VALUE:T,ERR_OUT_OF_RANGE:k,ERR_UNKNOWN_SIGNAL:M}}=Ns(),{normalizeEncoding:O}=is(),{isAsyncFunction:R,isArrayBufferView:$}=is().types,X={};function se(Q){return Q===(Q|0)}function ye(Q){return Q===Q>>>0}const he=/^[0-7]+$/,te="must be a 32-bit unsigned integer or an octal string";function re(Q,le,ke){if(typeof Q>"u"&&(Q=ke),typeof Q=="string"){if(y(he,Q)===null)throw new T(le,Q,te);Q=p(Q,8)}return P(Q,le),Q}const S=x((Q,le,ke=c,Re=o)=>{if(typeof Q!="number")throw new C(le,"number",Q);if(!s(Q))throw new k(le,"an integer",Q);if(Q<ke||Q>Re)throw new k(le,`>= ${ke} && <= ${Re}`,Q)}),_=x((Q,le,ke=-2147483648,Re=2147483647)=>{if(typeof Q!="number")throw new C(le,"number",Q);if(!s(Q))throw new k(le,"an integer",Q);if(Q<ke||Q>Re)throw new k(le,`>= ${ke} && <= ${Re}`,Q)}),P=x((Q,le,ke=!1)=>{if(typeof Q!="number")throw new C(le,"number",Q);if(!s(Q))throw new k(le,"an integer",Q);const Re=ke?1:0,Je=4294967295;if(Q<Re||Q>Je)throw new k(le,`>= ${Re} && <= ${Je}`,Q)});function j(Q,le){if(typeof Q!="string")throw new C(le,"string",Q)}function q(Q,le,ke=void 0,Re){if(typeof Q!="number")throw new C(le,"number",Q);if(ke!=null&&Q<ke||Re!=null&&Q>Re||(ke!=null||Re!=null)&&u(Q))throw new k(le,`${ke!=null?`>= ${ke}`:""}${ke!=null&&Re!=null?" && ":""}${Re!=null?`<= ${Re}`:""}`,Q)}const z=x((Q,le,ke)=>{if(!e(ke,Q)){const Je="must be one of: "+t(a(ke,lt=>typeof lt=="string"?`'${lt}'`:m(lt)),", ");throw new T(le,Q,Je)}});function Z(Q,le){if(typeof Q!="boolean")throw new C(le,"boolean",Q)}function W(Q,le,ke){return Q==null||!d(Q,le)?ke:Q[le]}const D=x((Q,le,ke=null)=>{const Re=W(ke,"allowArray",!1),Je=W(ke,"allowFunction",!1);if(!W(ke,"nullable",!1)&&Q===null||!Re&&n(Q)||typeof Q!="object"&&(!Je||typeof Q!="function"))throw new C(le,"Object",Q)}),N=x((Q,le)=>{if(Q!=null&&typeof Q!="object"&&typeof Q!="function")throw new C(le,"a dictionary",Q)}),Y=x((Q,le,ke=0)=>{if(!n(Q))throw new C(le,"Array",Q);if(Q.length<ke){const Re=`must be longer than ${ke}`;throw new T(le,Q,Re)}});function ie(Q,le){Y(Q,le);for(let ke=0;ke<Q.length;ke++)j(Q[ke],`${le}[${ke}]`)}function V(Q,le){Y(Q,le);for(let ke=0;ke<Q.length;ke++)Z(Q[ke],`${le}[${ke}]`)}function Ce(Q,le){Y(Q,le);for(let ke=0;ke<Q.length;ke++){const Re=Q[ke],Je=`${le}[${ke}]`;if(Re==null)throw new C(Je,"AbortSignal",Re);ce(Re,Je)}}function Pe(Q,le="signal"){if(j(Q,le),X[Q]===void 0)throw X[v(Q)]!==void 0?new M(Q+" (signals must use all capital letters)"):new M(Q)}const Se=x((Q,le="buffer")=>{if(!$(Q))throw new C(le,["Buffer","TypedArray","DataView"],Q)});function Ee(Q,le){const ke=O(le),Re=Q.length;if(ke==="hex"&&Re%2!==0)throw new T("encoding",le,`is invalid for data of length ${Re}`)}function oe(Q,le="Port",ke=!0){if(typeof Q!="number"&&typeof Q!="string"||typeof Q=="string"&&b(Q).length===0||+Q!==+Q>>>0||Q>65535||Q===0&&!ke)throw new E(le,Q,ke);return Q|0}const ce=x((Q,le)=>{if(Q!==void 0&&(Q===null||typeof Q!="object"||!("aborted"in Q)))throw new C(le,"AbortSignal",Q)}),be=x((Q,le)=>{if(typeof Q!="function")throw new C(le,"Function",Q)}),me=x((Q,le)=>{if(typeof Q!="function"||R(Q))throw new C(le,"Function",Q)}),fe=x((Q,le)=>{if(Q!==void 0)throw new C(le,"undefined",Q)});function _e(Q,le,ke){if(!e(ke,Q))throw new C(le,`('${t(ke,"|")}')`,Q)}const ne=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function B(Q,le){if(typeof Q>"u"||!y(ne,Q))throw new T(le,Q,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function H(Q){if(typeof Q=="string")return B(Q,"hints"),Q;if(n(Q)){const le=Q.length;let ke="";if(le===0)return ke;for(let Re=0;Re<le;Re++){const Je=Q[Re];B(Je,"hints"),ke+=Je,Re!==le-1&&(ke+=", ")}return ke}throw new T("hints",Q,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}return _E={isInt32:se,isUint32:ye,parseFileMode:re,validateArray:Y,validateStringArray:ie,validateBooleanArray:V,validateAbortSignalArray:Ce,validateBoolean:Z,validateBuffer:Se,validateDictionary:N,validateEncoding:Ee,validateFunction:be,validateInt32:_,validateInteger:S,validateNumber:q,validateObject:D,validateOneOf:z,validatePlainFunction:me,validatePort:oe,validateSignalName:Pe,validateString:j,validateUint32:P,validateUndefined:fe,validateUnion:_e,validateAbortSignal:ce,validateLinkHeaderValue:H},_E}var pw={exports:{}},xE={exports:{}},eO;function Df(){if(eO)return xE.exports;eO=1;var n=xE.exports={},e,t;function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=a}catch{e=a}try{typeof clearTimeout=="function"?t=clearTimeout:t=s}catch{t=s}})();function u(E){if(e===setTimeout)return setTimeout(E,0);if((e===a||!e)&&setTimeout)return e=setTimeout,setTimeout(E,0);try{return e(E,0)}catch{try{return e.call(null,E,0)}catch{return e.call(this,E,0)}}}function o(E){if(t===clearTimeout)return clearTimeout(E);if((t===s||!t)&&clearTimeout)return t=clearTimeout,clearTimeout(E);try{return t(E)}catch{try{return t.call(null,E)}catch{return t.call(this,E)}}}var c=[],p=!1,d,y=-1;function m(){!p||!d||(p=!1,d.length?c=d.concat(c):y=-1,c.length&&v())}function v(){if(!p){var E=u(m);p=!0;for(var C=c.length;C;){for(d=c,c=[];++y<C;)d&&d[y].run();y=-1,C=c.length}d=null,p=!1,o(E)}}n.nextTick=function(E){var C=new Array(arguments.length-1);if(arguments.length>1)for(var T=1;T<arguments.length;T++)C[T-1]=arguments[T];c.push(new b(E,C)),c.length===1&&!p&&u(v)};function b(E,C){this.fun=E,this.array=C}b.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={};function x(){}return n.on=x,n.addListener=x,n.once=x,n.off=x,n.removeListener=x,n.removeAllListeners=x,n.emit=x,n.prependListener=x,n.prependOnceListener=x,n.listeners=function(E){return[]},n.binding=function(E){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(E){throw new Error("process.chdir is not supported")},n.umask=function(){return 0},xE.exports}var SE,tO;function xc(){if(tO)return SE;tO=1;const{SymbolAsyncIterator:n,SymbolIterator:e,SymbolFor:t}=oa(),a=t("nodejs.stream.destroyed"),s=t("nodejs.stream.errored"),u=t("nodejs.stream.readable"),o=t("nodejs.stream.writable"),c=t("nodejs.stream.disturbed"),p=t("nodejs.webstream.isClosedPromise"),d=t("nodejs.webstream.controllerErrorFunction");function y(W,D=!1){var N;return!!(W&&typeof W.pipe=="function"&&typeof W.on=="function"&&(!D||typeof W.pause=="function"&&typeof W.resume=="function")&&(!W._writableState||((N=W._readableState)===null||N===void 0?void 0:N.readable)!==!1)&&(!W._writableState||W._readableState))}function m(W){var D;return!!(W&&typeof W.write=="function"&&typeof W.on=="function"&&(!W._readableState||((D=W._writableState)===null||D===void 0?void 0:D.writable)!==!1))}function v(W){return!!(W&&typeof W.pipe=="function"&&W._readableState&&typeof W.on=="function"&&typeof W.write=="function")}function b(W){return W&&(W._readableState||W._writableState||typeof W.write=="function"&&typeof W.on=="function"||typeof W.pipe=="function"&&typeof W.on=="function")}function x(W){return!!(W&&!b(W)&&typeof W.pipeThrough=="function"&&typeof W.getReader=="function"&&typeof W.cancel=="function")}function E(W){return!!(W&&!b(W)&&typeof W.getWriter=="function"&&typeof W.abort=="function")}function C(W){return!!(W&&!b(W)&&typeof W.readable=="object"&&typeof W.writable=="object")}function T(W){return x(W)||E(W)||C(W)}function k(W,D){return W==null?!1:D===!0?typeof W[n]=="function":D===!1?typeof W[e]=="function":typeof W[n]=="function"||typeof W[e]=="function"}function M(W){if(!b(W))return null;const D=W._writableState,N=W._readableState,Y=D||N;return!!(W.destroyed||W[a]||Y!=null&&Y.destroyed)}function O(W){if(!m(W))return null;if(W.writableEnded===!0)return!0;const D=W._writableState;return D!=null&&D.errored?!1:typeof D?.ended!="boolean"?null:D.ended}function R(W,D){if(!m(W))return null;if(W.writableFinished===!0)return!0;const N=W._writableState;return N!=null&&N.errored?!1:typeof N?.finished!="boolean"?null:!!(N.finished||D===!1&&N.ended===!0&&N.length===0)}function $(W){if(!y(W))return null;if(W.readableEnded===!0)return!0;const D=W._readableState;return!D||D.errored?!1:typeof D?.ended!="boolean"?null:D.ended}function X(W,D){if(!y(W))return null;const N=W._readableState;return N!=null&&N.errored?!1:typeof N?.endEmitted!="boolean"?null:!!(N.endEmitted||D===!1&&N.ended===!0&&N.length===0)}function se(W){return W&&W[u]!=null?W[u]:typeof W?.readable!="boolean"?null:M(W)?!1:y(W)&&W.readable&&!X(W)}function ye(W){return W&&W[o]!=null?W[o]:typeof W?.writable!="boolean"?null:M(W)?!1:m(W)&&W.writable&&!O(W)}function he(W,D){return b(W)?M(W)?!0:!(D?.readable!==!1&&se(W)||D?.writable!==!1&&ye(W)):null}function te(W){var D,N;return b(W)?W.writableErrored?W.writableErrored:(D=(N=W._writableState)===null||N===void 0?void 0:N.errored)!==null&&D!==void 0?D:null:null}function re(W){var D,N;return b(W)?W.readableErrored?W.readableErrored:(D=(N=W._readableState)===null||N===void 0?void 0:N.errored)!==null&&D!==void 0?D:null:null}function S(W){if(!b(W))return null;if(typeof W.closed=="boolean")return W.closed;const D=W._writableState,N=W._readableState;return typeof D?.closed=="boolean"||typeof N?.closed=="boolean"?D?.closed||N?.closed:typeof W._closed=="boolean"&&_(W)?W._closed:null}function _(W){return typeof W._closed=="boolean"&&typeof W._defaultKeepAlive=="boolean"&&typeof W._removedConnection=="boolean"&&typeof W._removedContLen=="boolean"}function P(W){return typeof W._sent100=="boolean"&&_(W)}function j(W){var D;return typeof W._consuming=="boolean"&&typeof W._dumped=="boolean"&&((D=W.req)===null||D===void 0?void 0:D.upgradeOrConnect)===void 0}function q(W){if(!b(W))return null;const D=W._writableState,N=W._readableState,Y=D||N;return!Y&&P(W)||!!(Y&&Y.autoDestroy&&Y.emitClose&&Y.closed===!1)}function z(W){var D;return!!(W&&((D=W[c])!==null&&D!==void 0?D:W.readableDidRead||W.readableAborted))}function Z(W){var D,N,Y,ie,V,Ce,Pe,Se,Ee,oe;return!!(W&&((D=(N=(Y=(ie=(V=(Ce=W[s])!==null&&Ce!==void 0?Ce:W.readableErrored)!==null&&V!==void 0?V:W.writableErrored)!==null&&ie!==void 0?ie:(Pe=W._readableState)===null||Pe===void 0?void 0:Pe.errorEmitted)!==null&&Y!==void 0?Y:(Se=W._writableState)===null||Se===void 0?void 0:Se.errorEmitted)!==null&&N!==void 0?N:(Ee=W._readableState)===null||Ee===void 0?void 0:Ee.errored)!==null&&D!==void 0?D:!((oe=W._writableState)===null||oe===void 0)&&oe.errored))}return SE={isDestroyed:M,kIsDestroyed:a,isDisturbed:z,kIsDisturbed:c,isErrored:Z,kIsErrored:s,isReadable:se,kIsReadable:u,kIsClosedPromise:p,kControllerErrorFunction:d,kIsWritable:o,isClosed:S,isDuplexNodeStream:v,isFinished:he,isIterable:k,isReadableNodeStream:y,isReadableStream:x,isReadableEnded:$,isReadableFinished:X,isReadableErrored:re,isNodeStream:b,isWebStream:T,isWritable:ye,isWritableNodeStream:m,isWritableStream:E,isWritableEnded:O,isWritableFinished:R,isWritableErrored:te,isServerRequest:j,isServerResponse:P,willEmitClose:q,isTransformStream:C},SE}var nO;function Uf(){if(nO)return pw.exports;nO=1;const n=Df(),{AbortError:e,codes:t}=Ns(),{ERR_INVALID_ARG_TYPE:a,ERR_STREAM_PREMATURE_CLOSE:s}=t,{kEmptyObject:u,once:o}=is(),{validateAbortSignal:c,validateFunction:p,validateObject:d,validateBoolean:y}=Gg(),{Promise:m,PromisePrototypeThen:v,SymbolDispose:b}=oa(),{isClosed:x,isReadable:E,isReadableNodeStream:C,isReadableStream:T,isReadableFinished:k,isReadableErrored:M,isWritable:O,isWritableNodeStream:R,isWritableStream:$,isWritableFinished:X,isWritableErrored:se,isNodeStream:ye,willEmitClose:he,kIsClosedPromise:te}=xc();let re;function S(z){return z.setHeader&&typeof z.abort=="function"}const _=()=>{};function P(z,Z,W){var D,N;if(arguments.length===2?(W=Z,Z=u):Z==null?Z=u:d(Z,"options"),p(W,"callback"),c(Z.signal,"options.signal"),W=o(W),T(z)||$(z))return j(z,Z,W);if(!ye(z))throw new a("stream",["ReadableStream","WritableStream","Stream"],z);const Y=(D=Z.readable)!==null&&D!==void 0?D:C(z),ie=(N=Z.writable)!==null&&N!==void 0?N:R(z),V=z._writableState,Ce=z._readableState,Pe=()=>{z.writable||oe()};let Se=he(z)&&C(z)===Y&&R(z)===ie,Ee=X(z,!1);const oe=()=>{Ee=!0,z.destroyed&&(Se=!1),!(Se&&(!z.readable||Y))&&(!Y||ce)&&W.call(z)};let ce=k(z,!1);const be=()=>{ce=!0,z.destroyed&&(Se=!1),!(Se&&(!z.writable||ie))&&(!ie||Ee)&&W.call(z)},me=Q=>{W.call(z,Q)};let fe=x(z);const _e=()=>{fe=!0;const Q=se(z)||M(z);if(Q&&typeof Q!="boolean")return W.call(z,Q);if(Y&&!ce&&C(z,!0)&&!k(z,!1))return W.call(z,new s);if(ie&&!Ee&&!X(z,!1))return W.call(z,new s);W.call(z)},ne=()=>{fe=!0;const Q=se(z)||M(z);if(Q&&typeof Q!="boolean")return W.call(z,Q);W.call(z)},B=()=>{z.req.on("finish",oe)};S(z)?(z.on("complete",oe),Se||z.on("abort",_e),z.req?B():z.on("request",B)):ie&&!V&&(z.on("end",Pe),z.on("close",Pe)),!Se&&typeof z.aborted=="boolean"&&z.on("aborted",_e),z.on("end",be),z.on("finish",oe),Z.error!==!1&&z.on("error",me),z.on("close",_e),fe?n.nextTick(_e):V!=null&&V.errorEmitted||Ce!=null&&Ce.errorEmitted?Se||n.nextTick(ne):(!Y&&(!Se||E(z))&&(Ee||O(z)===!1)||!ie&&(!Se||O(z))&&(ce||E(z)===!1)||Ce&&z.req&&z.aborted)&&n.nextTick(ne);const H=()=>{W=_,z.removeListener("aborted",_e),z.removeListener("complete",oe),z.removeListener("abort",_e),z.removeListener("request",B),z.req&&z.req.removeListener("finish",oe),z.removeListener("end",Pe),z.removeListener("close",Pe),z.removeListener("finish",oe),z.removeListener("end",be),z.removeListener("error",me),z.removeListener("close",_e)};if(Z.signal&&!fe){const Q=()=>{const le=W;H(),le.call(z,new e(void 0,{cause:Z.signal.reason}))};if(Z.signal.aborted)n.nextTick(Q);else{re=re||is().addAbortListener;const le=re(Z.signal,Q),ke=W;W=o((...Re)=>{le[b](),ke.apply(z,Re)})}}return H}function j(z,Z,W){let D=!1,N=_;if(Z.signal)if(N=()=>{D=!0,W.call(z,new e(void 0,{cause:Z.signal.reason}))},Z.signal.aborted)n.nextTick(N);else{re=re||is().addAbortListener;const ie=re(Z.signal,N),V=W;W=o((...Ce)=>{ie[b](),V.apply(z,Ce)})}const Y=(...ie)=>{D||n.nextTick(()=>W.apply(z,ie))};return v(z[te].promise,Y,Y),_}function q(z,Z){var W;let D=!1;return Z===null&&(Z=u),(W=Z)!==null&&W!==void 0&&W.cleanup&&(y(Z.cleanup,"cleanup"),D=Z.cleanup),new m((N,Y)=>{const ie=P(z,Z,V=>{D&&ie(),V?Y(V):N()})})}return pw.exports=P,pw.exports.finished=q,pw.exports}var CE,rO;function F0(){if(rO)return CE;rO=1;const n=Df(),{aggregateTwoErrors:e,codes:{ERR_MULTIPLE_CALLBACK:t},AbortError:a}=Ns(),{Symbol:s}=oa(),{kIsDestroyed:u,isDestroyed:o,isFinished:c,isServerRequest:p}=xc(),d=s("kDestroy"),y=s("kConstruct");function m(he,te,re){he&&(he.stack,te&&!te.errored&&(te.errored=he),re&&!re.errored&&(re.errored=he))}function v(he,te){const re=this._readableState,S=this._writableState,_=S||re;return S!=null&&S.destroyed||re!=null&&re.destroyed?(typeof te=="function"&&te(),this):(m(he,S,re),S&&(S.destroyed=!0),re&&(re.destroyed=!0),_.constructed?b(this,he,te):this.once(d,function(P){b(this,e(P,he),te)}),this)}function b(he,te,re){let S=!1;function _(P){if(S)return;S=!0;const j=he._readableState,q=he._writableState;m(P,q,j),q&&(q.closed=!0),j&&(j.closed=!0),typeof re=="function"&&re(P),P?n.nextTick(x,he,P):n.nextTick(E,he)}try{he._destroy(te||null,_)}catch(P){_(P)}}function x(he,te){C(he,te),E(he)}function E(he){const te=he._readableState,re=he._writableState;re&&(re.closeEmitted=!0),te&&(te.closeEmitted=!0),(re!=null&&re.emitClose||te!=null&&te.emitClose)&&he.emit("close")}function C(he,te){const re=he._readableState,S=he._writableState;S!=null&&S.errorEmitted||re!=null&&re.errorEmitted||(S&&(S.errorEmitted=!0),re&&(re.errorEmitted=!0),he.emit("error",te))}function T(){const he=this._readableState,te=this._writableState;he&&(he.constructed=!0,he.closed=!1,he.closeEmitted=!1,he.destroyed=!1,he.errored=null,he.errorEmitted=!1,he.reading=!1,he.ended=he.readable===!1,he.endEmitted=he.readable===!1),te&&(te.constructed=!0,te.destroyed=!1,te.closed=!1,te.closeEmitted=!1,te.errored=null,te.errorEmitted=!1,te.finalCalled=!1,te.prefinished=!1,te.ended=te.writable===!1,te.ending=te.writable===!1,te.finished=te.writable===!1)}function k(he,te,re){const S=he._readableState,_=he._writableState;if(_!=null&&_.destroyed||S!=null&&S.destroyed)return this;S!=null&&S.autoDestroy||_!=null&&_.autoDestroy?he.destroy(te):te&&(te.stack,_&&!_.errored&&(_.errored=te),S&&!S.errored&&(S.errored=te),re?n.nextTick(C,he,te):C(he,te))}function M(he,te){if(typeof he._construct!="function")return;const re=he._readableState,S=he._writableState;re&&(re.constructed=!1),S&&(S.constructed=!1),he.once(y,te),!(he.listenerCount(y)>1)&&n.nextTick(O,he)}function O(he){let te=!1;function re(S){if(te){k(he,S??new t);return}te=!0;const _=he._readableState,P=he._writableState,j=P||_;_&&(_.constructed=!0),P&&(P.constructed=!0),j.destroyed?he.emit(d,S):S?k(he,S,!0):n.nextTick(R,he)}try{he._construct(S=>{n.nextTick(re,S)})}catch(S){n.nextTick(re,S)}}function R(he){he.emit(y)}function $(he){return he?.setHeader&&typeof he.abort=="function"}function X(he){he.emit("close")}function se(he,te){he.emit("error",te),n.nextTick(X,he)}function ye(he,te){!he||o(he)||(!te&&!c(he)&&(te=new a),p(he)?(he.socket=null,he.destroy(te)):$(he)?he.abort():$(he.req)?he.req.abort():typeof he.destroy=="function"?he.destroy(te):typeof he.close=="function"?he.close():te?n.nextTick(se,he,te):n.nextTick(X,he),he.destroyed||(he[u]=!0))}return CE={construct:M,destroyer:ye,destroy:v,undestroy:T,errorOrDestroy:k},CE}var EE,aO;function s5(){if(aO)return EE;aO=1;const{ArrayIsArray:n,ObjectSetPrototypeOf:e}=oa(),{EventEmitter:t}=Vg();function a(u){t.call(this,u)}e(a.prototype,t.prototype),e(a,t),a.prototype.pipe=function(u,o){const c=this;function p(E){u.writable&&u.write(E)===!1&&c.pause&&c.pause()}c.on("data",p);function d(){c.readable&&c.resume&&c.resume()}u.on("drain",d),!u._isStdio&&(!o||o.end!==!1)&&(c.on("end",m),c.on("close",v));let y=!1;function m(){y||(y=!0,u.end())}function v(){y||(y=!0,typeof u.destroy=="function"&&u.destroy())}function b(E){x(),t.listenerCount(this,"error")===0&&this.emit("error",E)}s(c,"error",b),s(u,"error",b);function x(){c.removeListener("data",p),u.removeListener("drain",d),c.removeListener("end",m),c.removeListener("close",v),c.removeListener("error",b),u.removeListener("error",b),c.removeListener("end",x),c.removeListener("close",x),u.removeListener("close",x)}return c.on("end",x),c.on("close",x),u.on("close",x),u.emit("pipe",c),u};function s(u,o,c){if(typeof u.prependListener=="function")return u.prependListener(o,c);!u._events||!u._events[o]?u.on(o,c):n(u._events[o])?u._events[o].unshift(c):u._events[o]=[c,u._events[o]]}return EE={Stream:a,prependListener:s},EE}var AE={exports:{}},iO;function x_(){return iO||(iO=1,(function(n){const{SymbolDispose:e}=oa(),{AbortError:t,codes:a}=Ns(),{isNodeStream:s,isWebStream:u,kControllerErrorFunction:o}=xc(),c=Uf(),{ERR_INVALID_ARG_TYPE:p}=a;let d;const y=(m,v)=>{if(typeof m!="object"||!("aborted"in m))throw new p(v,"AbortSignal",m)};n.exports.addAbortSignal=function(v,b){if(y(v,"signal"),!s(b)&&!u(b))throw new p("stream",["ReadableStream","WritableStream","Stream"],b);return n.exports.addAbortSignalNoValidate(v,b)},n.exports.addAbortSignalNoValidate=function(m,v){if(typeof m!="object"||!("aborted"in m))return v;const b=s(v)?()=>{v.destroy(new t(void 0,{cause:m.reason}))}:()=>{v[o](new t(void 0,{cause:m.reason}))};if(m.aborted)b();else{d=d||is().addAbortListener;const x=d(m,b);c(v,x[e])}return v}})(AE)),AE.exports}var kE,sO;function wJ(){if(sO)return kE;sO=1;const{StringPrototypeSlice:n,SymbolIterator:e,TypedArrayPrototypeSet:t,Uint8Array:a}=oa(),{Buffer:s}=Ap(),{inspect:u}=is();return kE=class{constructor(){this.head=null,this.tail=null,this.length=0}push(c){const p={data:c,next:null};this.length>0?this.tail.next=p:this.head=p,this.tail=p,++this.length}unshift(c){const p={data:c,next:this.head};this.length===0&&(this.tail=p),this.head=p,++this.length}shift(){if(this.length===0)return;const c=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,c}clear(){this.head=this.tail=null,this.length=0}join(c){if(this.length===0)return"";let p=this.head,d=""+p.data;for(;(p=p.next)!==null;)d+=c+p.data;return d}concat(c){if(this.length===0)return s.alloc(0);const p=s.allocUnsafe(c>>>0);let d=this.head,y=0;for(;d;)t(p,d.data,y),y+=d.data.length,d=d.next;return p}consume(c,p){const d=this.head.data;if(c<d.length){const y=d.slice(0,c);return this.head.data=d.slice(c),y}return c===d.length?this.shift():p?this._getString(c):this._getBuffer(c)}first(){return this.head.data}*[e](){for(let c=this.head;c;c=c.next)yield c.data}_getString(c){let p="",d=this.head,y=0;do{const m=d.data;if(c>m.length)p+=m,c-=m.length;else{c===m.length?(p+=m,++y,d.next?this.head=d.next:this.head=this.tail=null):(p+=n(m,0,c),this.head=d,d.data=n(m,c));break}++y}while((d=d.next)!==null);return this.length-=y,p}_getBuffer(c){const p=s.allocUnsafe(c),d=c;let y=this.head,m=0;do{const v=y.data;if(c>v.length)t(p,v,d-c),c-=v.length;else{c===v.length?(t(p,v,d-c),++m,y.next?this.head=y.next:this.head=this.tail=null):(t(p,new a(v.buffer,v.byteOffset,c),d-c),this.head=y,y.data=v.slice(c));break}++m}while((y=y.next)!==null);return this.length-=m,p}[Symbol.for("nodejs.util.inspect.custom")](c,p){return u(this,{...p,depth:0,customInspect:!1})}},kE}var TE,oO;function S_(){if(oO)return TE;oO=1;const{MathFloor:n,NumberIsInteger:e}=oa(),{validateInteger:t}=Gg(),{ERR_INVALID_ARG_VALUE:a}=Ns().codes;let s=16*1024,u=16;function o(y,m,v){return y.highWaterMark!=null?y.highWaterMark:m?y[v]:null}function c(y){return y?u:s}function p(y,m){t(m,"value",0),y?u=m:s=m}function d(y,m,v,b){const x=o(m,b,v);if(x!=null){if(!e(x)||x<0){const E=b?`options.${v}`:"options.highWaterMark";throw new a(E,x)}return n(x)}return c(y.objectMode)}return TE={getHighWaterMark:d,getDefaultHighWaterMark:c,setDefaultHighWaterMark:p},TE}var ME={},uO;function zP(){if(uO)return ME;uO=1;var n=uP().Buffer,e=n.isEncoding||function(T){switch(T=""+T,T&&T.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function t(T){if(!T)return"utf8";for(var k;;)switch(T){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return T;default:if(k)return;T=(""+T).toLowerCase(),k=!0}}function a(T){var k=t(T);if(typeof k!="string"&&(n.isEncoding===e||!e(T)))throw new Error("Unknown encoding: "+T);return k||T}ME.StringDecoder=s;function s(T){this.encoding=a(T);var k;switch(this.encoding){case"utf16le":this.text=m,this.end=v,k=4;break;case"utf8":this.fillLast=p,k=4;break;case"base64":this.text=b,this.end=x,k=3;break;default:this.write=E,this.end=C;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(k)}s.prototype.write=function(T){if(T.length===0)return"";var k,M;if(this.lastNeed){if(k=this.fillLast(T),k===void 0)return"";M=this.lastNeed,this.lastNeed=0}else M=0;return M<T.length?k?k+this.text(T,M):this.text(T,M):k||""},s.prototype.end=y,s.prototype.text=d,s.prototype.fillLast=function(T){if(this.lastNeed<=T.length)return T.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);T.copy(this.lastChar,this.lastTotal-this.lastNeed,0,T.length),this.lastNeed-=T.length};function u(T){return T<=127?0:T>>5===6?2:T>>4===14?3:T>>3===30?4:T>>6===2?-1:-2}function o(T,k,M){var O=k.length-1;if(O<M)return 0;var R=u(k[O]);return R>=0?(R>0&&(T.lastNeed=R-1),R):--O<M||R===-2?0:(R=u(k[O]),R>=0?(R>0&&(T.lastNeed=R-2),R):--O<M||R===-2?0:(R=u(k[O]),R>=0?(R>0&&(R===2?R=0:T.lastNeed=R-3),R):0))}function c(T,k,M){if((k[0]&192)!==128)return T.lastNeed=0,"�";if(T.lastNeed>1&&k.length>1){if((k[1]&192)!==128)return T.lastNeed=1,"�";if(T.lastNeed>2&&k.length>2&&(k[2]&192)!==128)return T.lastNeed=2,"�"}}function p(T){var k=this.lastTotal-this.lastNeed,M=c(this,T);if(M!==void 0)return M;if(this.lastNeed<=T.length)return T.copy(this.lastChar,k,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);T.copy(this.lastChar,k,0,T.length),this.lastNeed-=T.length}function d(T,k){var M=o(this,T,k);if(!this.lastNeed)return T.toString("utf8",k);this.lastTotal=M;var O=T.length-(M-this.lastNeed);return T.copy(this.lastChar,0,O),T.toString("utf8",k,O)}function y(T){var k=T&&T.length?this.write(T):"";return this.lastNeed?k+"�":k}function m(T,k){if((T.length-k)%2===0){var M=T.toString("utf16le",k);if(M){var O=M.charCodeAt(M.length-1);if(O>=55296&&O<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1],M.slice(0,-1)}return M}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=T[T.length-1],T.toString("utf16le",k,T.length-1)}function v(T){var k=T&&T.length?this.write(T):"";if(this.lastNeed){var M=this.lastTotal-this.lastNeed;return k+this.lastChar.toString("utf16le",0,M)}return k}function b(T,k){var M=(T.length-k)%3;return M===0?T.toString("base64",k):(this.lastNeed=3-M,this.lastTotal=3,M===1?this.lastChar[0]=T[T.length-1]:(this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1]),T.toString("base64",k,T.length-M))}function x(T){var k=T&&T.length?this.write(T):"";return this.lastNeed?k+this.lastChar.toString("base64",0,3-this.lastNeed):k}function E(T){return T.toString(this.encoding)}function C(T){return T&&T.length?this.write(T):""}return ME}var RE,lO;function jP(){if(lO)return RE;lO=1;const n=Df(),{PromisePrototypeThen:e,SymbolAsyncIterator:t,SymbolIterator:a}=oa(),{Buffer:s}=Ap(),{ERR_INVALID_ARG_TYPE:u,ERR_STREAM_NULL_VALUES:o}=Ns().codes;function c(p,d,y){let m;if(typeof d=="string"||d instanceof s)return new p({objectMode:!0,...y,read(){this.push(d),this.push(null)}});let v;if(d&&d[t])v=!0,m=d[t]();else if(d&&d[a])v=!1,m=d[a]();else throw new u("iterable",["Iterable"],d);const b=new p({objectMode:!0,highWaterMark:1,...y});let x=!1;b._read=function(){x||(x=!0,C())},b._destroy=function(T,k){e(E(T),()=>n.nextTick(k,T),M=>n.nextTick(k,M||T))};async function E(T){const k=T!=null,M=typeof m.throw=="function";if(k&&M){const{value:O,done:R}=await m.throw(T);if(await O,R)return}if(typeof m.return=="function"){const{value:O}=await m.return();await O}}async function C(){for(;;){try{const{value:T,done:k}=v?await m.next():m.next();if(k)b.push(null);else{const M=T&&typeof T.then=="function"?await T:T;if(M===null)throw x=!1,new o;if(b.push(M))continue;x=!1}}catch(T){b.destroy(T)}break}}return b}return RE=c,RE}var OE,cO;function C_(){if(cO)return OE;cO=1;const n=Df(),{ArrayPrototypeIndexOf:e,NumberIsInteger:t,NumberIsNaN:a,NumberParseInt:s,ObjectDefineProperties:u,ObjectKeys:o,ObjectSetPrototypeOf:c,Promise:p,SafeSet:d,SymbolAsyncDispose:y,SymbolAsyncIterator:m,Symbol:v}=oa();OE=Re,Re.ReadableState=ke;const{EventEmitter:b}=Vg(),{Stream:x,prependListener:E}=s5(),{Buffer:C}=Ap(),{addAbortSignal:T}=x_(),k=Uf();let M=is().debuglog("stream",Te=>{M=Te});const O=wJ(),R=F0(),{getHighWaterMark:$,getDefaultHighWaterMark:X}=S_(),{aggregateTwoErrors:se,codes:{ERR_INVALID_ARG_TYPE:ye,ERR_METHOD_NOT_IMPLEMENTED:he,ERR_OUT_OF_RANGE:te,ERR_STREAM_PUSH_AFTER_EOF:re,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:S},AbortError:_}=Ns(),{validateObject:P}=Gg(),j=v("kPaused"),{StringDecoder:q}=zP(),z=jP();c(Re.prototype,x.prototype),c(Re,x);const Z=()=>{},{errorOrDestroy:W}=R,D=1,N=2,Y=4,ie=8,V=16,Ce=32,Pe=64,Se=128,Ee=256,oe=512,ce=1024,be=2048,me=4096,fe=8192,_e=16384,ne=32768,B=65536,H=1<<17,Q=1<<18;function le(Te){return{enumerable:!1,get(){return(this.state&Te)!==0},set(I){I?this.state|=Te:this.state&=~Te}}}u(ke.prototype,{objectMode:le(D),ended:le(N),endEmitted:le(Y),reading:le(ie),constructed:le(V),sync:le(Ce),needReadable:le(Pe),emittedReadable:le(Se),readableListening:le(Ee),resumeScheduled:le(oe),errorEmitted:le(ce),emitClose:le(be),autoDestroy:le(me),destroyed:le(fe),closed:le(_e),closeEmitted:le(ne),multiAwaitDrain:le(B),readingMore:le(H),dataEmitted:le(Q)});function ke(Te,I,ze){typeof ze!="boolean"&&(ze=I instanceof bc()),this.state=be|me|V|Ce,Te&&Te.objectMode&&(this.state|=D),ze&&Te&&Te.readableObjectMode&&(this.state|=D),this.highWaterMark=Te?$(this,Te,"readableHighWaterMark",ze):X(!1),this.buffer=new O,this.length=0,this.pipes=[],this.flowing=null,this[j]=null,Te&&Te.emitClose===!1&&(this.state&=~be),Te&&Te.autoDestroy===!1&&(this.state&=~me),this.errored=null,this.defaultEncoding=Te&&Te.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,Te&&Te.encoding&&(this.decoder=new q(Te.encoding),this.encoding=Te.encoding)}function Re(Te){if(!(this instanceof Re))return new Re(Te);const I=this instanceof bc();this._readableState=new ke(Te,this,I),Te&&(typeof Te.read=="function"&&(this._read=Te.read),typeof Te.destroy=="function"&&(this._destroy=Te.destroy),typeof Te.construct=="function"&&(this._construct=Te.construct),Te.signal&&!I&&T(Te.signal,this)),x.call(this,Te),R.construct(this,()=>{this._readableState.needReadable&&Ae(this,this._readableState)})}Re.prototype.destroy=R.destroy,Re.prototype._undestroy=R.undestroy,Re.prototype._destroy=function(Te,I){I(Te)},Re.prototype[b.captureRejectionSymbol]=function(Te){this.destroy(Te)},Re.prototype[y]=function(){let Te;return this.destroyed||(Te=this.readableEnded?null:new _,this.destroy(Te)),new p((I,ze)=>k(this,we=>we&&we!==Te?ze(we):I(null)))},Re.prototype.push=function(Te,I){return Je(this,Te,I,!1)},Re.prototype.unshift=function(Te,I){return Je(this,Te,I,!0)};function Je(Te,I,ze,we){M("readableAddChunk",I);const De=Te._readableState;let Ge;if((De.state&D)===0&&(typeof I=="string"?(ze=ze||De.defaultEncoding,De.encoding!==ze&&(we&&De.encoding?I=C.from(I,ze).toString(De.encoding):(I=C.from(I,ze),ze=""))):I instanceof C?ze="":x._isUint8Array(I)?(I=x._uint8ArrayToBuffer(I),ze=""):I!=null&&(Ge=new ye("chunk",["string","Buffer","Uint8Array"],I))),Ge)W(Te,Ge);else if(I===null)De.state&=~ie,J(Te,De);else if((De.state&D)!==0||I&&I.length>0)if(we)if((De.state&Y)!==0)W(Te,new S);else{if(De.destroyed||De.errored)return!1;lt(Te,De,I,!0)}else if(De.ended)W(Te,new re);else{if(De.destroyed||De.errored)return!1;De.state&=~ie,De.decoder&&!ze?(I=De.decoder.write(I),De.objectMode||I.length!==0?lt(Te,De,I,!1):Ae(Te,De)):lt(Te,De,I,!1)}else we||(De.state&=~ie,Ae(Te,De));return!De.ended&&(De.length<De.highWaterMark||De.length===0)}function lt(Te,I,ze,we){I.flowing&&I.length===0&&!I.sync&&Te.listenerCount("data")>0?((I.state&B)!==0?I.awaitDrainWriters.clear():I.awaitDrainWriters=null,I.dataEmitted=!0,Te.emit("data",ze)):(I.length+=I.objectMode?1:ze.length,we?I.buffer.unshift(ze):I.buffer.push(ze),(I.state&Pe)!==0&&F(Te)),Ae(Te,I)}Re.prototype.isPaused=function(){const Te=this._readableState;return Te[j]===!0||Te.flowing===!1},Re.prototype.setEncoding=function(Te){const I=new q(Te);this._readableState.decoder=I,this._readableState.encoding=this._readableState.decoder.encoding;const ze=this._readableState.buffer;let we="";for(const De of ze)we+=I.write(De);return ze.clear(),we!==""&&ze.push(we),this._readableState.length=we.length,this};const et=1073741824;function xt(Te){if(Te>et)throw new te("size","<= 1GiB",Te);return Te--,Te|=Te>>>1,Te|=Te>>>2,Te|=Te>>>4,Te|=Te>>>8,Te|=Te>>>16,Te++,Te}function de(Te,I){return Te<=0||I.length===0&&I.ended?0:(I.state&D)!==0?1:a(Te)?I.flowing&&I.length?I.buffer.first().length:I.length:Te<=I.length?Te:I.ended?I.length:0}Re.prototype.read=function(Te){M("read",Te),Te===void 0?Te=NaN:t(Te)||(Te=s(Te,10));const I=this._readableState,ze=Te;if(Te>I.highWaterMark&&(I.highWaterMark=xt(Te)),Te!==0&&(I.state&=~Se),Te===0&&I.needReadable&&((I.highWaterMark!==0?I.length>=I.highWaterMark:I.length>0)||I.ended))return M("read: emitReadable",I.length,I.ended),I.length===0&&I.ended?vt(this):F(this),null;if(Te=de(Te,I),Te===0&&I.ended)return I.length===0&&vt(this),null;let we=(I.state&Pe)!==0;if(M("need readable",we),(I.length===0||I.length-Te<I.highWaterMark)&&(we=!0,M("length less than watermark",we)),I.ended||I.reading||I.destroyed||I.errored||!I.constructed)we=!1,M("reading, ended or constructing",we);else if(we){M("do read"),I.state|=ie|Ce,I.length===0&&(I.state|=Pe);try{this._read(I.highWaterMark)}catch(Ge){W(this,Ge)}I.state&=~Ce,I.reading||(Te=de(ze,I))}let De;return Te>0?De=Bt(Te,I):De=null,De===null?(I.needReadable=I.length<=I.highWaterMark,Te=0):(I.length-=Te,I.multiAwaitDrain?I.awaitDrainWriters.clear():I.awaitDrainWriters=null),I.length===0&&(I.ended||(I.needReadable=!0),ze!==Te&&I.ended&&vt(this)),De!==null&&!I.errorEmitted&&!I.closeEmitted&&(I.dataEmitted=!0,this.emit("data",De)),De};function J(Te,I){if(M("onEofChunk"),!I.ended){if(I.decoder){const ze=I.decoder.end();ze&&ze.length&&(I.buffer.push(ze),I.length+=I.objectMode?1:ze.length)}I.ended=!0,I.sync?F(Te):(I.needReadable=!1,I.emittedReadable=!0,ue(Te))}}function F(Te){const I=Te._readableState;M("emitReadable",I.needReadable,I.emittedReadable),I.needReadable=!1,I.emittedReadable||(M("emitReadable",I.flowing),I.emittedReadable=!0,n.nextTick(ue,Te))}function ue(Te){const I=Te._readableState;M("emitReadable_",I.destroyed,I.length,I.ended),!I.destroyed&&!I.errored&&(I.length||I.ended)&&(Te.emit("readable"),I.emittedReadable=!1),I.needReadable=!I.flowing&&!I.ended&&I.length<=I.highWaterMark,Ye(Te)}function Ae(Te,I){!I.readingMore&&I.constructed&&(I.readingMore=!0,n.nextTick(Le,Te,I))}function Le(Te,I){for(;!I.reading&&!I.ended&&(I.length<I.highWaterMark||I.flowing&&I.length===0);){const ze=I.length;if(M("maybeReadMore read 0"),Te.read(0),ze===I.length)break}I.readingMore=!1}Re.prototype._read=function(Te){throw new he("_read()")},Re.prototype.pipe=function(Te,I){const ze=this,we=this._readableState;we.pipes.length===1&&(we.multiAwaitDrain||(we.multiAwaitDrain=!0,we.awaitDrainWriters=new d(we.awaitDrainWriters?[we.awaitDrainWriters]:[]))),we.pipes.push(Te),M("pipe count=%d opts=%j",we.pipes.length,I);const Ge=(!I||I.end!==!1)&&Te!==n.stdout&&Te!==n.stderr?Ot:qt;we.endEmitted?n.nextTick(Ge):ze.once("end",Ge),Te.on("unpipe",ht);function ht(un,Nn){M("onunpipe"),un===ze&&Nn&&Nn.hasUnpiped===!1&&(Nn.hasUnpiped=!0,Ne())}function Ot(){M("onend"),Te.end()}let Tt,dn=!1;function Ne(){M("cleanup"),Te.removeListener("close",Jt),Te.removeListener("finish",It),Tt&&Te.removeListener("drain",Tt),Te.removeListener("error",wt),Te.removeListener("unpipe",ht),ze.removeListener("end",Ot),ze.removeListener("end",qt),ze.removeListener("data",bt),dn=!0,Tt&&we.awaitDrainWriters&&(!Te._writableState||Te._writableState.needDrain)&&Tt()}function ct(){dn||(we.pipes.length===1&&we.pipes[0]===Te?(M("false write response, pause",0),we.awaitDrainWriters=Te,we.multiAwaitDrain=!1):we.pipes.length>1&&we.pipes.includes(Te)&&(M("false write response, pause",we.awaitDrainWriters.size),we.awaitDrainWriters.add(Te)),ze.pause()),Tt||(Tt=Be(ze,Te),Te.on("drain",Tt))}ze.on("data",bt);function bt(un){M("ondata");const Nn=Te.write(un);M("dest.write",Nn),Nn===!1&&ct()}function wt(un){if(M("onerror",un),qt(),Te.removeListener("error",wt),Te.listenerCount("error")===0){const Nn=Te._writableState||Te._readableState;Nn&&!Nn.errorEmitted?W(Te,un):Te.emit("error",un)}}E(Te,"error",wt);function Jt(){Te.removeListener("finish",It),qt()}Te.once("close",Jt);function It(){M("onfinish"),Te.removeListener("close",Jt),qt()}Te.once("finish",It);function qt(){M("unpipe"),ze.unpipe(Te)}return Te.emit("pipe",ze),Te.writableNeedDrain===!0?ct():we.flowing||(M("pipe resume"),ze.resume()),Te};function Be(Te,I){return function(){const we=Te._readableState;we.awaitDrainWriters===I?(M("pipeOnDrain",1),we.awaitDrainWriters=null):we.multiAwaitDrain&&(M("pipeOnDrain",we.awaitDrainWriters.size),we.awaitDrainWriters.delete(I)),(!we.awaitDrainWriters||we.awaitDrainWriters.size===0)&&Te.listenerCount("data")&&Te.resume()}}Re.prototype.unpipe=function(Te){const I=this._readableState,ze={hasUnpiped:!1};if(I.pipes.length===0)return this;if(!Te){const De=I.pipes;I.pipes=[],this.pause();for(let Ge=0;Ge<De.length;Ge++)De[Ge].emit("unpipe",this,{hasUnpiped:!1});return this}const we=e(I.pipes,Te);return we===-1?this:(I.pipes.splice(we,1),I.pipes.length===0&&this.pause(),Te.emit("unpipe",this,ze),this)},Re.prototype.on=function(Te,I){const ze=x.prototype.on.call(this,Te,I),we=this._readableState;return Te==="data"?(we.readableListening=this.listenerCount("readable")>0,we.flowing!==!1&&this.resume()):Te==="readable"&&!we.endEmitted&&!we.readableListening&&(we.readableListening=we.needReadable=!0,we.flowing=!1,we.emittedReadable=!1,M("on readable",we.length,we.reading),we.length?F(this):we.reading||n.nextTick(Ie,this)),ze},Re.prototype.addListener=Re.prototype.on,Re.prototype.removeListener=function(Te,I){const ze=x.prototype.removeListener.call(this,Te,I);return Te==="readable"&&n.nextTick(dt,this),ze},Re.prototype.off=Re.prototype.removeListener,Re.prototype.removeAllListeners=function(Te){const I=x.prototype.removeAllListeners.apply(this,arguments);return(Te==="readable"||Te===void 0)&&n.nextTick(dt,this),I};function dt(Te){const I=Te._readableState;I.readableListening=Te.listenerCount("readable")>0,I.resumeScheduled&&I[j]===!1?I.flowing=!0:Te.listenerCount("data")>0?Te.resume():I.readableListening||(I.flowing=null)}function Ie(Te){M("readable nexttick read 0"),Te.read(0)}Re.prototype.resume=function(){const Te=this._readableState;return Te.flowing||(M("resume"),Te.flowing=!Te.readableListening,He(this,Te)),Te[j]=!1,this};function He(Te,I){I.resumeScheduled||(I.resumeScheduled=!0,n.nextTick(ge,Te,I))}function ge(Te,I){M("resume",I.reading),I.reading||Te.read(0),I.resumeScheduled=!1,Te.emit("resume"),Ye(Te),I.flowing&&!I.reading&&Te.read(0)}Re.prototype.pause=function(){return M("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(M("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[j]=!0,this};function Ye(Te){const I=Te._readableState;for(M("flow",I.flowing);I.flowing&&Te.read()!==null;);}Re.prototype.wrap=function(Te){let I=!1;Te.on("data",we=>{!this.push(we)&&Te.pause&&(I=!0,Te.pause())}),Te.on("end",()=>{this.push(null)}),Te.on("error",we=>{W(this,we)}),Te.on("close",()=>{this.destroy()}),Te.on("destroy",()=>{this.destroy()}),this._read=()=>{I&&Te.resume&&(I=!1,Te.resume())};const ze=o(Te);for(let we=1;we<ze.length;we++){const De=ze[we];this[De]===void 0&&typeof Te[De]=="function"&&(this[De]=Te[De].bind(Te))}return this},Re.prototype[m]=function(){return kt(this)},Re.prototype.iterator=function(Te){return Te!==void 0&&P(Te,"options"),kt(this,Te)};function kt(Te,I){typeof Te.read!="function"&&(Te=Re.wrap(Te,{objectMode:!0}));const ze=gt(Te,I);return ze.stream=Te,ze}async function*gt(Te,I){let ze=Z;function we(ht){this===Te?(ze(),ze=Z):ze=ht}Te.on("readable",we);let De;const Ge=k(Te,{writable:!1},ht=>{De=ht?se(De,ht):null,ze(),ze=Z});try{for(;;){const ht=Te.destroyed?null:Te.read();if(ht!==null)yield ht;else{if(De)throw De;if(De===null)return;await new p(we)}}}catch(ht){throw De=se(De,ht),De}finally{(De||I?.destroyOnReturn!==!1)&&(De===void 0||Te._readableState.autoDestroy)?R.destroyer(Te,null):(Te.off("readable",we),Ge())}}u(Re.prototype,{readable:{__proto__:null,get(){const Te=this._readableState;return!!Te&&Te.readable!==!1&&!Te.destroyed&&!Te.errorEmitted&&!Te.endEmitted},set(Te){this._readableState&&(this._readableState.readable=!!Te)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(Te){this._readableState&&(this._readableState.flowing=Te)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(Te){this._readableState&&(this._readableState.destroyed=Te)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),u(ke.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[j]!==!1},set(Te){this[j]=!!Te}}}),Re._fromList=Bt;function Bt(Te,I){if(I.length===0)return null;let ze;return I.objectMode?ze=I.buffer.shift():!Te||Te>=I.length?(I.decoder?ze=I.buffer.join(""):I.buffer.length===1?ze=I.buffer.first():ze=I.buffer.concat(I.length),I.buffer.clear()):ze=I.buffer.consume(Te,I.decoder),ze}function vt(Te){const I=Te._readableState;M("endReadable",I.endEmitted),I.endEmitted||(I.ended=!0,n.nextTick(wn,I,Te))}function wn(Te,I){if(M("endReadableNT",Te.endEmitted,Te.length),!Te.errored&&!Te.closeEmitted&&!Te.endEmitted&&Te.length===0){if(Te.endEmitted=!0,I.emit("end"),I.writable&&I.allowHalfOpen===!1)n.nextTick(tt,I);else if(Te.autoDestroy){const ze=I._writableState;(!ze||ze.autoDestroy&&(ze.finished||ze.writable===!1))&&I.destroy()}}}function tt(Te){Te.writable&&!Te.writableEnded&&!Te.destroyed&&Te.end()}Re.from=function(Te,I){return z(Re,Te,I)};let rt;function Er(){return rt===void 0&&(rt={}),rt}return Re.fromWeb=function(Te,I){return Er().newStreamReadableFromReadableStream(Te,I)},Re.toWeb=function(Te,I){return Er().newReadableStreamFromStreamReadable(Te,I)},Re.wrap=function(Te,I){var ze,we;return new Re({objectMode:(ze=(we=Te.readableObjectMode)!==null&&we!==void 0?we:Te.objectMode)!==null&&ze!==void 0?ze:!0,...I,destroy(De,Ge){R.destroyer(Te,De),Ge(De)}}).wrap(Te)},OE}var LE,fO;function o5(){if(fO)return LE;fO=1;const n=Df(),{ArrayPrototypeSlice:e,Error:t,FunctionPrototypeSymbolHasInstance:a,ObjectDefineProperty:s,ObjectDefineProperties:u,ObjectSetPrototypeOf:o,StringPrototypeToLowerCase:c,Symbol:p,SymbolHasInstance:d}=oa();LE=P,P.WritableState=S;const{EventEmitter:y}=Vg(),m=s5().Stream,{Buffer:v}=Ap(),b=F0(),{addAbortSignal:x}=x_(),{getHighWaterMark:E,getDefaultHighWaterMark:C}=S_(),{ERR_INVALID_ARG_TYPE:T,ERR_METHOD_NOT_IMPLEMENTED:k,ERR_MULTIPLE_CALLBACK:M,ERR_STREAM_CANNOT_PIPE:O,ERR_STREAM_DESTROYED:R,ERR_STREAM_ALREADY_FINISHED:$,ERR_STREAM_NULL_VALUES:X,ERR_STREAM_WRITE_AFTER_END:se,ERR_UNKNOWN_ENCODING:ye}=Ns().codes,{errorOrDestroy:he}=b;o(P.prototype,m.prototype),o(P,m);function te(){}const re=p("kOnFinished");function S(me,fe,_e){typeof _e!="boolean"&&(_e=fe instanceof bc()),this.objectMode=!!(me&&me.objectMode),_e&&(this.objectMode=this.objectMode||!!(me&&me.writableObjectMode)),this.highWaterMark=me?E(this,me,"writableHighWaterMark",_e):C(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const ne=!!(me&&me.decodeStrings===!1);this.decodeStrings=!ne,this.defaultEncoding=me&&me.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=W.bind(void 0,fe),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,_(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!me||me.emitClose!==!1,this.autoDestroy=!me||me.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[re]=[]}function _(me){me.buffered=[],me.bufferedIndex=0,me.allBuffers=!0,me.allNoop=!0}S.prototype.getBuffer=function(){return e(this.buffered,this.bufferedIndex)},s(S.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function P(me){const fe=this instanceof bc();if(!fe&&!a(P,this))return new P(me);this._writableState=new S(me,this,fe),me&&(typeof me.write=="function"&&(this._write=me.write),typeof me.writev=="function"&&(this._writev=me.writev),typeof me.destroy=="function"&&(this._destroy=me.destroy),typeof me.final=="function"&&(this._final=me.final),typeof me.construct=="function"&&(this._construct=me.construct),me.signal&&x(me.signal,this)),m.call(this,me),b.construct(this,()=>{const _e=this._writableState;_e.writing||ie(this,_e),Se(this,_e)})}s(P,d,{__proto__:null,value:function(me){return a(this,me)?!0:this!==P?!1:me&&me._writableState instanceof S}}),P.prototype.pipe=function(){he(this,new O)};function j(me,fe,_e,ne){const B=me._writableState;if(typeof _e=="function")ne=_e,_e=B.defaultEncoding;else{if(!_e)_e=B.defaultEncoding;else if(_e!=="buffer"&&!v.isEncoding(_e))throw new ye(_e);typeof ne!="function"&&(ne=te)}if(fe===null)throw new X;if(!B.objectMode)if(typeof fe=="string")B.decodeStrings!==!1&&(fe=v.from(fe,_e),_e="buffer");else if(fe instanceof v)_e="buffer";else if(m._isUint8Array(fe))fe=m._uint8ArrayToBuffer(fe),_e="buffer";else throw new T("chunk",["string","Buffer","Uint8Array"],fe);let H;return B.ending?H=new se:B.destroyed&&(H=new R("write")),H?(n.nextTick(ne,H),he(me,H,!0),H):(B.pendingcb++,q(me,B,fe,_e,ne))}P.prototype.write=function(me,fe,_e){return j(this,me,fe,_e)===!0},P.prototype.cork=function(){this._writableState.corked++},P.prototype.uncork=function(){const me=this._writableState;me.corked&&(me.corked--,me.writing||ie(this,me))},P.prototype.setDefaultEncoding=function(fe){if(typeof fe=="string"&&(fe=c(fe)),!v.isEncoding(fe))throw new ye(fe);return this._writableState.defaultEncoding=fe,this};function q(me,fe,_e,ne,B){const H=fe.objectMode?1:_e.length;fe.length+=H;const Q=fe.length<fe.highWaterMark;return Q||(fe.needDrain=!0),fe.writing||fe.corked||fe.errored||!fe.constructed?(fe.buffered.push({chunk:_e,encoding:ne,callback:B}),fe.allBuffers&&ne!=="buffer"&&(fe.allBuffers=!1),fe.allNoop&&B!==te&&(fe.allNoop=!1)):(fe.writelen=H,fe.writecb=B,fe.writing=!0,fe.sync=!0,me._write(_e,ne,fe.onwrite),fe.sync=!1),Q&&!fe.errored&&!fe.destroyed}function z(me,fe,_e,ne,B,H,Q){fe.writelen=ne,fe.writecb=Q,fe.writing=!0,fe.sync=!0,fe.destroyed?fe.onwrite(new R("write")):_e?me._writev(B,fe.onwrite):me._write(B,H,fe.onwrite),fe.sync=!1}function Z(me,fe,_e,ne){--fe.pendingcb,ne(_e),Y(fe),he(me,_e)}function W(me,fe){const _e=me._writableState,ne=_e.sync,B=_e.writecb;if(typeof B!="function"){he(me,new M);return}_e.writing=!1,_e.writecb=null,_e.length-=_e.writelen,_e.writelen=0,fe?(fe.stack,_e.errored||(_e.errored=fe),me._readableState&&!me._readableState.errored&&(me._readableState.errored=fe),ne?n.nextTick(Z,me,_e,fe,B):Z(me,_e,fe,B)):(_e.buffered.length>_e.bufferedIndex&&ie(me,_e),ne?_e.afterWriteTickInfo!==null&&_e.afterWriteTickInfo.cb===B?_e.afterWriteTickInfo.count++:(_e.afterWriteTickInfo={count:1,cb:B,stream:me,state:_e},n.nextTick(D,_e.afterWriteTickInfo)):N(me,_e,1,B))}function D({stream:me,state:fe,count:_e,cb:ne}){return fe.afterWriteTickInfo=null,N(me,fe,_e,ne)}function N(me,fe,_e,ne){for(!fe.ending&&!me.destroyed&&fe.length===0&&fe.needDrain&&(fe.needDrain=!1,me.emit("drain"));_e-- >0;)fe.pendingcb--,ne();fe.destroyed&&Y(fe),Se(me,fe)}function Y(me){if(me.writing)return;for(let B=me.bufferedIndex;B<me.buffered.length;++B){var fe;const{chunk:H,callback:Q}=me.buffered[B],le=me.objectMode?1:H.length;me.length-=le,Q((fe=me.errored)!==null&&fe!==void 0?fe:new R("write"))}const _e=me[re].splice(0);for(let B=0;B<_e.length;B++){var ne;_e[B]((ne=me.errored)!==null&&ne!==void 0?ne:new R("end"))}_(me)}function ie(me,fe){if(fe.corked||fe.bufferProcessing||fe.destroyed||!fe.constructed)return;const{buffered:_e,bufferedIndex:ne,objectMode:B}=fe,H=_e.length-ne;if(!H)return;let Q=ne;if(fe.bufferProcessing=!0,H>1&&me._writev){fe.pendingcb-=H-1;const le=fe.allNoop?te:Re=>{for(let Je=Q;Je<_e.length;++Je)_e[Je].callback(Re)},ke=fe.allNoop&&Q===0?_e:e(_e,Q);ke.allBuffers=fe.allBuffers,z(me,fe,!0,fe.length,ke,"",le),_(fe)}else{do{const{chunk:le,encoding:ke,callback:Re}=_e[Q];_e[Q++]=null;const Je=B?1:le.length;z(me,fe,!1,Je,le,ke,Re)}while(Q<_e.length&&!fe.writing);Q===_e.length?_(fe):Q>256?(_e.splice(0,Q),fe.bufferedIndex=0):fe.bufferedIndex=Q}fe.bufferProcessing=!1}P.prototype._write=function(me,fe,_e){if(this._writev)this._writev([{chunk:me,encoding:fe}],_e);else throw new k("_write()")},P.prototype._writev=null,P.prototype.end=function(me,fe,_e){const ne=this._writableState;typeof me=="function"?(_e=me,me=null,fe=null):typeof fe=="function"&&(_e=fe,fe=null);let B;if(me!=null){const H=j(this,me,fe);H instanceof t&&(B=H)}return ne.corked&&(ne.corked=1,this.uncork()),B||(!ne.errored&&!ne.ending?(ne.ending=!0,Se(this,ne,!0),ne.ended=!0):ne.finished?B=new $("end"):ne.destroyed&&(B=new R("end"))),typeof _e=="function"&&(B||ne.finished?n.nextTick(_e,B):ne[re].push(_e)),this};function V(me){return me.ending&&!me.destroyed&&me.constructed&&me.length===0&&!me.errored&&me.buffered.length===0&&!me.finished&&!me.writing&&!me.errorEmitted&&!me.closeEmitted}function Ce(me,fe){let _e=!1;function ne(B){if(_e){he(me,B??M());return}if(_e=!0,fe.pendingcb--,B){const H=fe[re].splice(0);for(let Q=0;Q<H.length;Q++)H[Q](B);he(me,B,fe.sync)}else V(fe)&&(fe.prefinished=!0,me.emit("prefinish"),fe.pendingcb++,n.nextTick(Ee,me,fe))}fe.sync=!0,fe.pendingcb++;try{me._final(ne)}catch(B){ne(B)}fe.sync=!1}function Pe(me,fe){!fe.prefinished&&!fe.finalCalled&&(typeof me._final=="function"&&!fe.destroyed?(fe.finalCalled=!0,Ce(me,fe)):(fe.prefinished=!0,me.emit("prefinish")))}function Se(me,fe,_e){V(fe)&&(Pe(me,fe),fe.pendingcb===0&&(_e?(fe.pendingcb++,n.nextTick((ne,B)=>{V(B)?Ee(ne,B):B.pendingcb--},me,fe)):V(fe)&&(fe.pendingcb++,Ee(me,fe))))}function Ee(me,fe){fe.pendingcb--,fe.finished=!0;const _e=fe[re].splice(0);for(let ne=0;ne<_e.length;ne++)_e[ne]();if(me.emit("finish"),fe.autoDestroy){const ne=me._readableState;(!ne||ne.autoDestroy&&(ne.endEmitted||ne.readable===!1))&&me.destroy()}}u(P.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(me){this._writableState&&(this._writableState.destroyed=me)}},writable:{__proto__:null,get(){const me=this._writableState;return!!me&&me.writable!==!1&&!me.destroyed&&!me.errored&&!me.ending&&!me.ended},set(me){this._writableState&&(this._writableState.writable=!!me)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const me=this._writableState;return me?!me.destroyed&&!me.ending&&me.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const oe=b.destroy;P.prototype.destroy=function(me,fe){const _e=this._writableState;return!_e.destroyed&&(_e.bufferedIndex<_e.buffered.length||_e[re].length)&&n.nextTick(Y,_e),oe.call(this,me,fe),this},P.prototype._undestroy=b.undestroy,P.prototype._destroy=function(me,fe){fe(me)},P.prototype[y.captureRejectionSymbol]=function(me){this.destroy(me)};let ce;function be(){return ce===void 0&&(ce={}),ce}return P.fromWeb=function(me,fe){return be().newStreamWritableFromWritableStream(me,fe)},P.toWeb=function(me){return be().newWritableStreamFromStreamWritable(me)},LE}var NE,dO;function _J(){if(dO)return NE;dO=1;const n=Df(),e=Ap(),{isReadable:t,isWritable:a,isIterable:s,isNodeStream:u,isReadableNodeStream:o,isWritableNodeStream:c,isDuplexNodeStream:p,isReadableStream:d,isWritableStream:y}=xc(),m=Uf(),{AbortError:v,codes:{ERR_INVALID_ARG_TYPE:b,ERR_INVALID_RETURN_VALUE:x}}=Ns(),{destroyer:E}=F0(),C=bc(),T=C_(),k=o5(),{createDeferredPromise:M}=is(),O=jP(),R=globalThis.Blob||e.Blob,$=typeof R<"u"?function(S){return S instanceof R}:function(S){return!1},X=globalThis.AbortController||Rg().AbortController,{FunctionPrototypeCall:se}=oa();class ye extends C{constructor(S){super(S),S?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),S?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}NE=function re(S,_){if(p(S))return S;if(o(S))return te({readable:S});if(c(S))return te({writable:S});if(u(S))return te({writable:!1,readable:!1});if(d(S))return te({readable:T.fromWeb(S)});if(y(S))return te({writable:k.fromWeb(S)});if(typeof S=="function"){const{value:j,write:q,final:z,destroy:Z}=he(S);if(s(j))return O(ye,j,{objectMode:!0,write:q,final:z,destroy:Z});const W=j?.then;if(typeof W=="function"){let D;const N=se(W,j,Y=>{if(Y!=null)throw new x("nully","body",Y)},Y=>{E(D,Y)});return D=new ye({objectMode:!0,readable:!1,write:q,final(Y){z(async()=>{try{await N,n.nextTick(Y,null)}catch(ie){n.nextTick(Y,ie)}})},destroy:Z})}throw new x("Iterable, AsyncIterable or AsyncFunction",_,j)}if($(S))return re(S.arrayBuffer());if(s(S))return O(ye,S,{objectMode:!0,writable:!1});if(d(S?.readable)&&y(S?.writable))return ye.fromWeb(S);if(typeof S?.writable=="object"||typeof S?.readable=="object"){const j=S!=null&&S.readable?o(S?.readable)?S?.readable:re(S.readable):void 0,q=S!=null&&S.writable?c(S?.writable)?S?.writable:re(S.writable):void 0;return te({readable:j,writable:q})}const P=S?.then;if(typeof P=="function"){let j;return se(P,S,q=>{q!=null&&j.push(q),j.push(null)},q=>{E(j,q)}),j=new ye({objectMode:!0,writable:!1,read(){}})}throw new b(_,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],S)};function he(re){let{promise:S,resolve:_}=M();const P=new X,j=P.signal;return{value:re((async function*(){for(;;){const z=S;S=null;const{chunk:Z,done:W,cb:D}=await z;if(n.nextTick(D),W)return;if(j.aborted)throw new v(void 0,{cause:j.reason});({promise:S,resolve:_}=M()),yield Z}})(),{signal:j}),write(z,Z,W){const D=_;_=null,D({chunk:z,done:!1,cb:W})},final(z){const Z=_;_=null,Z({done:!0,cb:z})},destroy(z,Z){P.abort(),Z(z)}}}function te(re){const S=re.readable&&typeof re.readable.read!="function"?T.wrap(re.readable):re.readable,_=re.writable;let P=!!t(S),j=!!a(_),q,z,Z,W,D;function N(Y){const ie=W;W=null,ie?ie(Y):Y&&D.destroy(Y)}return D=new ye({readableObjectMode:!!(S!=null&&S.readableObjectMode),writableObjectMode:!!(_!=null&&_.writableObjectMode),readable:P,writable:j}),j&&(m(_,Y=>{j=!1,Y&&E(S,Y),N(Y)}),D._write=function(Y,ie,V){_.write(Y,ie)?V():q=V},D._final=function(Y){_.end(),z=Y},_.on("drain",function(){if(q){const Y=q;q=null,Y()}}),_.on("finish",function(){if(z){const Y=z;z=null,Y()}})),P&&(m(S,Y=>{P=!1,Y&&E(S,Y),N(Y)}),S.on("readable",function(){if(Z){const Y=Z;Z=null,Y()}}),S.on("end",function(){D.push(null)}),D._read=function(){for(;;){const Y=S.read();if(Y===null){Z=D._read;return}if(!D.push(Y))return}}),D._destroy=function(Y,ie){!Y&&W!==null&&(Y=new v),Z=null,q=null,z=null,W===null?ie(Y):(W=ie,E(_,Y),E(S,Y))},D}return NE}var PE,pO;function bc(){if(pO)return PE;pO=1;const{ObjectDefineProperties:n,ObjectGetOwnPropertyDescriptor:e,ObjectKeys:t,ObjectSetPrototypeOf:a}=oa();PE=o;const s=C_(),u=o5();a(o.prototype,s.prototype),a(o,s);{const y=t(u.prototype);for(let m=0;m<y.length;m++){const v=y[m];o.prototype[v]||(o.prototype[v]=u.prototype[v])}}function o(y){if(!(this instanceof o))return new o(y);s.call(this,y),u.call(this,y),y?(this.allowHalfOpen=y.allowHalfOpen!==!1,y.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),y.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}n(o.prototype,{writable:{__proto__:null,...e(u.prototype,"writable")},writableHighWaterMark:{__proto__:null,...e(u.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...e(u.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...e(u.prototype,"writableBuffer")},writableLength:{__proto__:null,...e(u.prototype,"writableLength")},writableFinished:{__proto__:null,...e(u.prototype,"writableFinished")},writableCorked:{__proto__:null,...e(u.prototype,"writableCorked")},writableEnded:{__proto__:null,...e(u.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...e(u.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(y){this._readableState&&this._writableState&&(this._readableState.destroyed=y,this._writableState.destroyed=y)}}});let c;function p(){return c===void 0&&(c={}),c}o.fromWeb=function(y,m){return p().newStreamDuplexFromReadableWritablePair(y,m)},o.toWeb=function(y){return p().newReadableWritablePairFromDuplex(y)};let d;return o.from=function(y){return d||(d=_J()),d(y,"body")},PE}var IE,hO;function qP(){if(hO)return IE;hO=1;const{ObjectSetPrototypeOf:n,Symbol:e}=oa();IE=o;const{ERR_METHOD_NOT_IMPLEMENTED:t}=Ns().codes,a=bc(),{getHighWaterMark:s}=S_();n(o.prototype,a.prototype),n(o,a);const u=e("kCallback");function o(d){if(!(this instanceof o))return new o(d);const y=d?s(this,d,"readableHighWaterMark",!0):null;y===0&&(d={...d,highWaterMark:null,readableHighWaterMark:y,writableHighWaterMark:d.writableHighWaterMark||0}),a.call(this,d),this._readableState.sync=!1,this[u]=null,d&&(typeof d.transform=="function"&&(this._transform=d.transform),typeof d.flush=="function"&&(this._flush=d.flush)),this.on("prefinish",p)}function c(d){typeof this._flush=="function"&&!this.destroyed?this._flush((y,m)=>{if(y){d?d(y):this.destroy(y);return}m!=null&&this.push(m),this.push(null),d&&d()}):(this.push(null),d&&d())}function p(){this._final!==c&&c.call(this)}return o.prototype._final=c,o.prototype._transform=function(d,y,m){throw new t("_transform()")},o.prototype._write=function(d,y,m){const v=this._readableState,b=this._writableState,x=v.length;this._transform(d,y,(E,C)=>{if(E){m(E);return}C!=null&&this.push(C),b.ended||x===v.length||v.length<v.highWaterMark?m():this[u]=m})},o.prototype._read=function(){if(this[u]){const d=this[u];this[u]=null,d()}},IE}var DE,yO;function HP(){if(yO)return DE;yO=1;const{ObjectSetPrototypeOf:n}=oa();DE=t;const e=qP();n(t.prototype,e.prototype),n(t,e);function t(a){if(!(this instanceof t))return new t(a);e.call(this,a)}return t.prototype._transform=function(a,s,u){u(null,a)},DE}var UE,mO;function u5(){if(mO)return UE;mO=1;const n=Df(),{ArrayIsArray:e,Promise:t,SymbolAsyncIterator:a,SymbolDispose:s}=oa(),u=Uf(),{once:o}=is(),c=F0(),p=bc(),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:y,ERR_INVALID_RETURN_VALUE:m,ERR_MISSING_ARGS:v,ERR_STREAM_DESTROYED:b,ERR_STREAM_PREMATURE_CLOSE:x},AbortError:E}=Ns(),{validateFunction:C,validateAbortSignal:T}=Gg(),{isIterable:k,isReadable:M,isReadableNodeStream:O,isNodeStream:R,isTransformStream:$,isWebStream:X,isReadableStream:se,isReadableFinished:ye}=xc(),he=globalThis.AbortController||Rg().AbortController;let te,re,S;function _(Y,ie,V){let Ce=!1;Y.on("close",()=>{Ce=!0});const Pe=u(Y,{readable:ie,writable:V},Se=>{Ce=!Se});return{destroy:Se=>{Ce||(Ce=!0,c.destroyer(Y,Se||new b("pipe")))},cleanup:Pe}}function P(Y){return C(Y[Y.length-1],"streams[stream.length - 1]"),Y.pop()}function j(Y){if(k(Y))return Y;if(O(Y))return q(Y);throw new y("val",["Readable","Iterable","AsyncIterable"],Y)}async function*q(Y){re||(re=C_()),yield*re.prototype[a].call(Y)}async function z(Y,ie,V,{end:Ce}){let Pe,Se=null;const Ee=be=>{if(be&&(Pe=be),Se){const me=Se;Se=null,me()}},oe=()=>new t((be,me)=>{Pe?me(Pe):Se=()=>{Pe?me(Pe):be()}});ie.on("drain",Ee);const ce=u(ie,{readable:!1},Ee);try{ie.writableNeedDrain&&await oe();for await(const be of Y)ie.write(be)||await oe();Ce&&(ie.end(),await oe()),V()}catch(be){V(Pe!==be?d(Pe,be):be)}finally{ce(),ie.off("drain",Ee)}}async function Z(Y,ie,V,{end:Ce}){$(ie)&&(ie=ie.writable);const Pe=ie.getWriter();try{for await(const Se of Y)await Pe.ready,Pe.write(Se).catch(()=>{});await Pe.ready,Ce&&await Pe.close(),V()}catch(Se){try{await Pe.abort(Se),V(Se)}catch(Ee){V(Ee)}}}function W(...Y){return D(Y,o(P(Y)))}function D(Y,ie,V){if(Y.length===1&&e(Y[0])&&(Y=Y[0]),Y.length<2)throw new v("streams");const Ce=new he,Pe=Ce.signal,Se=V?.signal,Ee=[];T(Se,"options.signal");function oe(){B(new E)}S=S||is().addAbortListener;let ce;Se&&(ce=S(Se,oe));let be,me;const fe=[];let _e=0;function ne(ke){B(ke,--_e===0)}function B(ke,Re){var Je;if(ke&&(!be||be.code==="ERR_STREAM_PREMATURE_CLOSE")&&(be=ke),!(!be&&!Re)){for(;fe.length;)fe.shift()(be);(Je=ce)===null||Je===void 0||Je[s](),Ce.abort(),Re&&(be||Ee.forEach(lt=>lt()),n.nextTick(ie,be,me))}}let H;for(let ke=0;ke<Y.length;ke++){const Re=Y[ke],Je=ke<Y.length-1,lt=ke>0,et=Je||V?.end!==!1,xt=ke===Y.length-1;if(R(Re)){let de=function(J){J&&J.name!=="AbortError"&&J.code!=="ERR_STREAM_PREMATURE_CLOSE"&&ne(J)};if(et){const{destroy:J,cleanup:F}=_(Re,Je,lt);fe.push(J),M(Re)&&xt&&Ee.push(F)}Re.on("error",de),M(Re)&&xt&&Ee.push(()=>{Re.removeListener("error",de)})}if(ke===0)if(typeof Re=="function"){if(H=Re({signal:Pe}),!k(H))throw new m("Iterable, AsyncIterable or Stream","source",H)}else k(Re)||O(Re)||$(Re)?H=Re:H=p.from(Re);else if(typeof Re=="function"){if($(H)){var Q;H=j((Q=H)===null||Q===void 0?void 0:Q.readable)}else H=j(H);if(H=Re(H,{signal:Pe}),Je){if(!k(H,!0))throw new m("AsyncIterable",`transform[${ke-1}]`,H)}else{var le;te||(te=HP());const de=new te({objectMode:!0}),J=(le=H)===null||le===void 0?void 0:le.then;if(typeof J=="function")_e++,J.call(H,Ae=>{me=Ae,Ae!=null&&de.write(Ae),et&&de.end(),n.nextTick(ne)},Ae=>{de.destroy(Ae),n.nextTick(ne,Ae)});else if(k(H,!0))_e++,z(H,de,ne,{end:et});else if(se(H)||$(H)){const Ae=H.readable||H;_e++,z(Ae,de,ne,{end:et})}else throw new m("AsyncIterable or Promise","destination",H);H=de;const{destroy:F,cleanup:ue}=_(H,!1,!0);fe.push(F),xt&&Ee.push(ue)}}else if(R(Re)){if(O(H)){_e+=2;const de=N(H,Re,ne,{end:et});M(Re)&&xt&&Ee.push(de)}else if($(H)||se(H)){const de=H.readable||H;_e++,z(de,Re,ne,{end:et})}else if(k(H))_e++,z(H,Re,ne,{end:et});else throw new y("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],H);H=Re}else if(X(Re)){if(O(H))_e++,Z(j(H),Re,ne,{end:et});else if(se(H)||k(H))_e++,Z(H,Re,ne,{end:et});else if($(H))_e++,Z(H.readable,Re,ne,{end:et});else throw new y("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],H);H=Re}else H=p.from(Re)}return(Pe!=null&&Pe.aborted||Se!=null&&Se.aborted)&&n.nextTick(oe),H}function N(Y,ie,V,{end:Ce}){let Pe=!1;if(ie.on("close",()=>{Pe||V(new x)}),Y.pipe(ie,{end:!1}),Ce){let Se=function(){Pe=!0,ie.end()};ye(Y)?n.nextTick(Se):Y.once("end",Se)}else V();return u(Y,{readable:!0,writable:!1},Se=>{const Ee=Y._readableState;Se&&Se.code==="ERR_STREAM_PREMATURE_CLOSE"&&Ee&&Ee.ended&&!Ee.errored&&!Ee.errorEmitted?Y.once("end",V).once("error",V):V(Se)}),u(ie,{readable:!1,writable:!0},V)}return UE={pipelineImpl:D,pipeline:W},UE}var FE,gO;function VP(){if(gO)return FE;gO=1;const{pipeline:n}=u5(),e=bc(),{destroyer:t}=F0(),{isNodeStream:a,isReadable:s,isWritable:u,isWebStream:o,isTransformStream:c,isWritableStream:p,isReadableStream:d}=xc(),{AbortError:y,codes:{ERR_INVALID_ARG_VALUE:m,ERR_MISSING_ARGS:v}}=Ns(),b=Uf();return FE=function(...E){if(E.length===0)throw new v("streams");if(E.length===1)return e.from(E[0]);const C=[...E];if(typeof E[0]=="function"&&(E[0]=e.from(E[0])),typeof E[E.length-1]=="function"){const te=E.length-1;E[te]=e.from(E[te])}for(let te=0;te<E.length;++te)if(!(!a(E[te])&&!o(E[te]))){if(te<E.length-1&&!(s(E[te])||d(E[te])||c(E[te])))throw new m(`streams[${te}]`,C[te],"must be readable");if(te>0&&!(u(E[te])||p(E[te])||c(E[te])))throw new m(`streams[${te}]`,C[te],"must be writable")}let T,k,M,O,R;function $(te){const re=O;O=null,re?re(te):te?R.destroy(te):!he&&!ye&&R.destroy()}const X=E[0],se=n(E,$),ye=!!(u(X)||p(X)||c(X)),he=!!(s(se)||d(se)||c(se));if(R=new e({writableObjectMode:!!(X!=null&&X.writableObjectMode),readableObjectMode:!!(se!=null&&se.readableObjectMode),writable:ye,readable:he}),ye){if(a(X))R._write=function(re,S,_){X.write(re,S)?_():T=_},R._final=function(re){X.end(),k=re},X.on("drain",function(){if(T){const re=T;T=null,re()}});else if(o(X)){const S=(c(X)?X.writable:X).getWriter();R._write=async function(_,P,j){try{await S.ready,S.write(_).catch(()=>{}),j()}catch(q){j(q)}},R._final=async function(_){try{await S.ready,S.close().catch(()=>{}),k=_}catch(P){_(P)}}}const te=c(se)?se.readable:se;b(te,()=>{if(k){const re=k;k=null,re()}})}if(he){if(a(se))se.on("readable",function(){if(M){const te=M;M=null,te()}}),se.on("end",function(){R.push(null)}),R._read=function(){for(;;){const te=se.read();if(te===null){M=R._read;return}if(!R.push(te))return}};else if(o(se)){const re=(c(se)?se.readable:se).getReader();R._read=async function(){for(;;)try{const{value:S,done:_}=await re.read();if(!R.push(S))return;if(_){R.push(null);return}}catch{return}}}}return R._destroy=function(te,re){!te&&O!==null&&(te=new y),M=null,T=null,k=null,O===null?re(te):(O=re,a(se)&&t(se,te))},R},FE}var vO;function xJ(){if(vO)return dw;vO=1;const n=globalThis.AbortController||Rg().AbortController,{codes:{ERR_INVALID_ARG_VALUE:e,ERR_INVALID_ARG_TYPE:t,ERR_MISSING_ARGS:a,ERR_OUT_OF_RANGE:s},AbortError:u}=Ns(),{validateAbortSignal:o,validateInteger:c,validateObject:p}=Gg(),d=oa().Symbol("kWeak"),y=oa().Symbol("kResistStopPropagation"),{finished:m}=Uf(),v=VP(),{addAbortSignalNoValidate:b}=x_(),{isWritable:x,isNodeStream:E}=xc(),{deprecate:C}=is(),{ArrayPrototypePush:T,Boolean:k,MathFloor:M,Number:O,NumberIsNaN:R,Promise:$,PromiseReject:X,PromiseResolve:se,PromisePrototypeThen:ye,Symbol:he}=oa(),te=he("kEmpty"),re=he("kEof");function S(Se,Ee){if(Ee!=null&&p(Ee,"options"),Ee?.signal!=null&&o(Ee.signal,"options.signal"),E(Se)&&!x(Se))throw new e("stream",Se,"must be writable");const oe=v(this,Se);return Ee!=null&&Ee.signal&&b(Ee.signal,oe),oe}function _(Se,Ee){if(typeof Se!="function")throw new t("fn",["Function","AsyncFunction"],Se);Ee!=null&&p(Ee,"options"),Ee?.signal!=null&&o(Ee.signal,"options.signal");let oe=1;Ee?.concurrency!=null&&(oe=M(Ee.concurrency));let ce=oe-1;return Ee?.highWaterMark!=null&&(ce=M(Ee.highWaterMark)),c(oe,"options.concurrency",1),c(ce,"options.highWaterMark",0),ce+=oe,(async function*(){const me=is().AbortSignalAny([Ee?.signal].filter(k)),fe=this,_e=[],ne={signal:me};let B,H,Q=!1,le=0;function ke(){Q=!0,Re()}function Re(){le-=1,Je()}function Je(){H&&!Q&&le<oe&&_e.length<ce&&(H(),H=null)}async function lt(){try{for await(let et of fe){if(Q)return;if(me.aborted)throw new u;try{if(et=Se(et,ne),et===te)continue;et=se(et)}catch(xt){et=X(xt)}le+=1,ye(et,Re,ke),_e.push(et),B&&(B(),B=null),!Q&&(_e.length>=ce||le>=oe)&&await new $(xt=>{H=xt})}_e.push(re)}catch(et){const xt=X(et);ye(xt,Re,ke),_e.push(xt)}finally{Q=!0,B&&(B(),B=null)}}lt();try{for(;;){for(;_e.length>0;){const et=await _e[0];if(et===re)return;if(me.aborted)throw new u;et!==te&&(yield et),_e.shift(),Je()}await new $(et=>{B=et})}}finally{Q=!0,H&&(H(),H=null)}}).call(this)}function P(Se=void 0){return Se!=null&&p(Se,"options"),Se?.signal!=null&&o(Se.signal,"options.signal"),(async function*(){let oe=0;for await(const be of this){var ce;if(Se!=null&&(ce=Se.signal)!==null&&ce!==void 0&&ce.aborted)throw new u({cause:Se.signal.reason});yield[oe++,be]}}).call(this)}async function j(Se,Ee=void 0){for await(const oe of W.call(this,Se,Ee))return!0;return!1}async function q(Se,Ee=void 0){if(typeof Se!="function")throw new t("fn",["Function","AsyncFunction"],Se);return!await j.call(this,async(...oe)=>!await Se(...oe),Ee)}async function z(Se,Ee){for await(const oe of W.call(this,Se,Ee))return oe}async function Z(Se,Ee){if(typeof Se!="function")throw new t("fn",["Function","AsyncFunction"],Se);async function oe(ce,be){return await Se(ce,be),te}for await(const ce of _.call(this,oe,Ee));}function W(Se,Ee){if(typeof Se!="function")throw new t("fn",["Function","AsyncFunction"],Se);async function oe(ce,be){return await Se(ce,be)?ce:te}return _.call(this,oe,Ee)}class D extends a{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function N(Se,Ee,oe){var ce;if(typeof Se!="function")throw new t("reducer",["Function","AsyncFunction"],Se);oe!=null&&p(oe,"options"),oe?.signal!=null&&o(oe.signal,"options.signal");let be=arguments.length>1;if(oe!=null&&(ce=oe.signal)!==null&&ce!==void 0&&ce.aborted){const B=new u(void 0,{cause:oe.signal.reason});throw this.once("error",()=>{}),await m(this.destroy(B)),B}const me=new n,fe=me.signal;if(oe!=null&&oe.signal){const B={once:!0,[d]:this,[y]:!0};oe.signal.addEventListener("abort",()=>me.abort(),B)}let _e=!1;try{for await(const B of this){var ne;if(_e=!0,oe!=null&&(ne=oe.signal)!==null&&ne!==void 0&&ne.aborted)throw new u;be?Ee=await Se(Ee,B,{signal:fe}):(Ee=B,be=!0)}if(!_e&&!be)throw new D}finally{me.abort()}return Ee}async function Y(Se){Se!=null&&p(Se,"options"),Se?.signal!=null&&o(Se.signal,"options.signal");const Ee=[];for await(const ce of this){var oe;if(Se!=null&&(oe=Se.signal)!==null&&oe!==void 0&&oe.aborted)throw new u(void 0,{cause:Se.signal.reason});T(Ee,ce)}return Ee}function ie(Se,Ee){const oe=_.call(this,Se,Ee);return(async function*(){for await(const be of oe)yield*be}).call(this)}function V(Se){if(Se=O(Se),R(Se))return 0;if(Se<0)throw new s("number",">= 0",Se);return Se}function Ce(Se,Ee=void 0){return Ee!=null&&p(Ee,"options"),Ee?.signal!=null&&o(Ee.signal,"options.signal"),Se=V(Se),(async function*(){var ce;if(Ee!=null&&(ce=Ee.signal)!==null&&ce!==void 0&&ce.aborted)throw new u;for await(const me of this){var be;if(Ee!=null&&(be=Ee.signal)!==null&&be!==void 0&&be.aborted)throw new u;Se--<=0&&(yield me)}}).call(this)}function Pe(Se,Ee=void 0){return Ee!=null&&p(Ee,"options"),Ee?.signal!=null&&o(Ee.signal,"options.signal"),Se=V(Se),(async function*(){var ce;if(Ee!=null&&(ce=Ee.signal)!==null&&ce!==void 0&&ce.aborted)throw new u;for await(const me of this){var be;if(Ee!=null&&(be=Ee.signal)!==null&&be!==void 0&&be.aborted)throw new u;if(Se-- >0&&(yield me),Se<=0)return}}).call(this)}return dw.streamReturningOperators={asIndexedPairs:C(P,"readable.asIndexedPairs will be removed in a future version."),drop:Ce,filter:W,flatMap:ie,map:_,take:Pe,compose:S},dw.promiseReturningOperators={every:q,forEach:Z,reduce:N,toArray:Y,some:j,find:z},dw}var BE,bO;function GP(){if(bO)return BE;bO=1;const{ArrayPrototypePop:n,Promise:e}=oa(),{isIterable:t,isNodeStream:a,isWebStream:s}=xc(),{pipelineImpl:u}=u5(),{finished:o}=Uf();$P();function c(...p){return new e((d,y)=>{let m,v;const b=p[p.length-1];if(b&&typeof b=="object"&&!a(b)&&!t(b)&&!s(b)){const x=n(p);m=x.signal,v=x.end}u(p,(x,E)=>{x?y(x):d(E)},{signal:m,end:v})})}return BE={finished:o,pipeline:c},BE}var wO;function $P(){if(wO)return mE.exports;wO=1;const{Buffer:n}=Ap(),{ObjectDefineProperty:e,ObjectKeys:t,ReflectApply:a}=oa(),{promisify:{custom:s}}=is(),{streamReturningOperators:u,promiseReturningOperators:o}=xJ(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:c}}=Ns(),p=VP(),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:y}=S_(),{pipeline:m}=u5(),{destroyer:v}=F0(),b=Uf(),x=GP(),E=xc(),C=mE.exports=s5().Stream;C.isDestroyed=E.isDestroyed,C.isDisturbed=E.isDisturbed,C.isErrored=E.isErrored,C.isReadable=E.isReadable,C.isWritable=E.isWritable,C.Readable=C_();for(const k of t(u)){let O=function(...R){if(new.target)throw c();return C.Readable.from(a(M,this,R))};const M=u[k];e(O,"name",{__proto__:null,value:M.name}),e(O,"length",{__proto__:null,value:M.length}),e(C.Readable.prototype,k,{__proto__:null,value:O,enumerable:!1,configurable:!0,writable:!0})}for(const k of t(o)){let O=function(...R){if(new.target)throw c();return a(M,this,R)};const M=o[k];e(O,"name",{__proto__:null,value:M.name}),e(O,"length",{__proto__:null,value:M.length}),e(C.Readable.prototype,k,{__proto__:null,value:O,enumerable:!1,configurable:!0,writable:!0})}C.Writable=o5(),C.Duplex=bc(),C.Transform=qP(),C.PassThrough=HP(),C.pipeline=m;const{addAbortSignal:T}=x_();return C.addAbortSignal=T,C.finished=b,C.destroy=v,C.compose=p,C.setDefaultHighWaterMark=d,C.getDefaultHighWaterMark=y,e(C,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return x}}),e(m,s,{__proto__:null,enumerable:!0,get(){return x.pipeline}}),e(b,s,{__proto__:null,enumerable:!0,get(){return x.finished}}),C.Stream=C,C._isUint8Array=function(M){return M instanceof Uint8Array},C._uint8ArrayToBuffer=function(M){return n.from(M.buffer,M.byteOffset,M.byteLength)},mE.exports}var _O;function SJ(){return _O||(_O=1,(function(n){const e=$P(),t=GP(),a=e.Readable.destroy;n.exports=e.Readable,n.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,n.exports._isUint8Array=e._isUint8Array,n.exports.isDisturbed=e.isDisturbed,n.exports.isErrored=e.isErrored,n.exports.isReadable=e.isReadable,n.exports.Readable=e.Readable,n.exports.Writable=e.Writable,n.exports.Duplex=e.Duplex,n.exports.Transform=e.Transform,n.exports.PassThrough=e.PassThrough,n.exports.addAbortSignal=e.addAbortSignal,n.exports.finished=e.finished,n.exports.destroy=e.destroy,n.exports.destroy=a,n.exports.pipeline=e.pipeline,n.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get(){return t}}),n.exports.Stream=e.Stream,n.exports.default=n.exports})(yE)),yE.exports}var zE,xO;function WP(){if(xO)return zE;xO=1,typeof globalThis.Buffer>"u"&&(globalThis.Buffer=Pg().Buffer);const n=lP(),e=SJ(),t=gi();if(globalThis.process||(globalThis.process=Df()),typeof crypto>"u"){const s=n_;s.getRandomValues=u=>s.randomBytes(u.length),globalThis.crypto=s}const a={ElvCrypto:async()=>{try{if(!a.elvCrypto){const s=(await Promise.resolve().then(()=>require("./index-jSw7wEzz.js"))).default;a.elvCrypto=await new s().init()}return a.elvCrypto}catch(s){console.error("Error initializing ElvCrypto:"),console.error(s)}},EncryptedSize:s=>{const o=Math.floor(s/1e6);let c=a.EncryptedBlockSize(1e6),p=o*c;return s%1e6!==0&&(p+=a.EncryptedBlockSize(s%1e6)),p},EncryptedBlockSize:(s,u=!1)=>{let m=Math.floor(s/564)*576;return s%564!==0&&(m+=576),u?m+608:m+129},async EncryptConk(s,u){const o=await a.ElvCrypto();u=new Uint8Array(Buffer.from(u.replace("0x",""),"hex")),s=new Uint8Array(Buffer.from(JSON.stringify(s)));const{data:c,ephemeralKey:p,tag:d}=await o.encryptECIES(s,u),y=Buffer.concat([Buffer.from(p),Buffer.from(d),Buffer.from(c)]);return t.B64(y)},async DecryptCap(s,u){const o=await a.ElvCrypto();u=new Uint8Array(Buffer.from(u.replace("0x",""),"hex")),s=Buffer.from(s,"base64");const c=s.slice(0,65),p=s.slice(65,81),d=s.slice(81),y=o.decryptECIES(new Uint8Array(d),u,new Uint8Array(c),new Uint8Array(p));return JSON.parse(Buffer.from(y).toString())},async GeneratePrimaryConk({spaceId:s,objectId:u}){const o=await a.ElvCrypto(),{secretKey:c,publicKey:p}=o.generatePrimaryKeys(),d=o.generateSymmetricKey().key;return{symm_key:`kpsy${n.encode(Buffer.from(d))}`,secret_key:`kpsk${n.encode(Buffer.from(c))}`,public_key:`kppk${n.encode(Buffer.from(p))}`,sid:s,qid:u}},async GenerateTargetConk(){const s=await a.ElvCrypto(),{secretKey:u,publicKey:o}=s.generateTargetKeys();return{secret_key:`kpsk${n.encode(Buffer.from(u))}`,public_key:`ktpk${n.encode(Buffer.from(o))}`}},CapToConk(s){const u=o=>new Uint8Array(n.decode(o.slice(4)));return{symmetricKey:u(s.symm_key),secretKey:u(s.secret_key),publicKey:u(s.public_key)}},async EncryptionContext(s){const u=await a.ElvCrypto(),{symmetricKey:o,secretKey:c,publicKey:p}=a.CapToConk(s);let d,y;return p.length===u.PRIMARY_PK_KEY_SIZE?(y=u.CRYPTO_TYPE_PRIMARY,d=u.newPrimaryContext(p,c,o)):(y=u.CRYPTO_TYPE_TARGET,d=u.newTargetDecryptionContext(c,o)),{context:d,type:y}},Encrypt:async(s,u)=>{const o=await a.OpenEncryptionStream(s);!Buffer.isBuffer(u)&&!(u instanceof ArrayBuffer)&&(u=Buffer.from(await new Response(u).arrayBuffer()));const c=new Uint8Array(u);for(let d=0;d<c.length;d+=1e6){const y=Math.min(c.length,d+1e6);o.write(c.slice(d,y))}o.end();let p=[];return await new Promise((d,y)=>{o.on("data",m=>{p.push(m)}).on("finish",()=>{d()}).on("error",m=>{y(m)})}),Buffer.concat(p)},OpenEncryptionStream:async s=>{const u=await a.ElvCrypto(),{context:o}=await a.EncryptionContext(s),c=new e.PassThrough,p=u.createCipher(o);return c.pipe(p).on("finish",()=>{o.free()}).on("error",d=>{throw Error(d)})},Decrypt:async(s,u)=>{const o=await a.OpenDecryptionStream(s),c=new Uint8Array(u);for(let d=0;d<c.length;d+=1e6){const y=Math.min(c.length,d+1e6);o.write(c.slice(d,y))}o.end();let p=[];return await new Promise((d,y)=>{o.on("data",m=>{p.push(m)}).on("finish",()=>{d()}).on("error",m=>{y(m)})}),Buffer.concat(p)},OpenDecryptionStream:async s=>{const u=await a.ElvCrypto(),{context:o,type:c}=await a.EncryptionContext(s),p=new e.PassThrough,d=u.createDecipher(c,o);return p.pipe(d).on("finish",()=>{o.free()}).on("error",y=>{throw Error(y)})}};return zE=a,zE}var zr={},SO;function KP(){if(SO)return zr;SO=1;const n=gi();let e;n.Platform()===n.PLATFORM_NODE&&(globalThis.Response=ZA().Response,e=n_);const t=vi(),{ValidatePresence:a,ValidateWriteToken:s,ValidatePartHash:u,ValidateParameters:o}=Cu();return zr.ListFiles=async function({libraryId:c,objectId:p,path:d="",versionHash:y,writeToken:m}){o({libraryId:c,objectId:p,versionHash:y,writeToken:m}),y&&(p=this.utils.DecodeVersionHash(y).objectId);let v=t("q",m||y||p,"files_list",d);return this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,versionHash:y}),method:"GET",path:v})},zr.UploadFilesFromS3=async function({libraryId:c,objectId:p,writeToken:d,region:y,bucket:m,fileInfo:v,accessKey:b,secret:x,signedUrl:E,encryption:C="none",copy:T=!1,callback:k}){o({libraryId:c,objectId:p}),s(d);const M=/^s3:\/\/([^/]+)\//i;for(let ye=0;ye<v.length;ye++){const he=v[ye].source,te=M.exec(he);if(te){if(te[1]!==m)throw Error('Full S3 file path "'+he+`" specified, but does not match provided bucket name '`+m+"'");v[ye].source=he.replace(M,"")}}T?this.Log(`Copying files from S3: ${c} ${p} ${d}`):this.Log(`Adding links to files in S3: ${c} ${p} ${d}`);let O;if(C==="cgck"){let ye=await this.EncryptionConk({libraryId:c,objectId:p,writeToken:d});ye={...ye,secret_key:""},O=`kp__${this.utils.B58(Buffer.from(JSON.stringify(ye)))}`}let R={access_key_id:b,secret_access_key:x};E&&(R={signed_url:E});const $={encryption_key:O,access:{protocol:"s3",platform:"aws",path:m,storage_endpoint:{region:y},cloud_credentials:R}},X=v.map(ye=>T?{op:"ingest-copy",path:ye.path,encryption:{scheme:C==="cgck"?"cgck":"none"},ingest:{type:"key",path:ye.source}}:{op:"add-reference",path:ye.path,reference:{type:"key",path:ye.source}}),{id:se}=await this.CreateFileUploadJob({libraryId:c,objectId:p,writeToken:d,ops:X,defaults:$});for(;;){await new Promise(te=>setTimeout(te,1e3));const ye=await this.UploadStatus({libraryId:c,objectId:p,writeToken:d,uploadId:se});if(ye.errors&&ye.errors.length>1)throw ye.errors.join(`
|
|
327
|
+
`;super(x),this.name="AggregateError",this.errors=b}}n.exports={AggregateError:m,kEmptyObject:Object.freeze({}),once(v){let b=!1;return function(...x){b||(b=!0,v.apply(this,x))}},createDeferredPromise:function(){let v,b;return{promise:new Promise((E,C)=>{v=E,b=C}),resolve:v,reject:b}},promisify(v){return new Promise((b,x)=>{v((E,...C)=>E?x(E):b(...C))})},debuglog(){return function(){}},format(v,...b){return v.replace(/%([sdifj])/g,function(...[x,E]){const C=b.shift();return E==="f"?C.toFixed(6):E==="j"?JSON.stringify(C):E==="s"&&typeof C=="object"?`${C.constructor!==Object?C.constructor.name:""} {}`.trim():C.toString()})},inspect(v){switch(typeof v){case"string":if(v.includes("'"))if(v.includes('"')){if(!v.includes("`")&&!v.includes("${"))return`\`${v}\``}else return`"${v}"`;return`'${v}'`;case"number":return isNaN(v)?"NaN":Object.is(v,-0)?String(v):v;case"bigint":return`${String(v)}n`;case"boolean":case"undefined":return String(v);case"object":return"{}"}},types:{isAsyncFunction(v){return v instanceof o},isArrayBufferView(v){return ArrayBuffer.isView(v)}},isBlob:p,deprecate(v,b){return v},addAbortListener:Vg().addAbortListener||function(b,x){if(b===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",b);d(b,"signal"),y(x,"listener");let E;return b.aborted?queueMicrotask(()=>x()):(b.addEventListener("abort",x,{__proto__:null,once:!0,[t]:!0}),E=()=>{b.removeEventListener("abort",x)}),{__proto__:null,[a](){var C;(C=E)===null||C===void 0||C()}}},AbortSignalAny:s.any||function(b){if(b.length===1)return b[0];const x=new u,E=()=>x.abort();return b.forEach(C=>{d(C,"signals"),C.addEventListener("abort",E,{once:!0})}),x.signal.addEventListener("abort",()=>{b.forEach(C=>C.removeEventListener("abort",E))},{once:!0}),x.signal}},n.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(bE)),bE.exports}var dw={},wE,X9;function Ns(){if(X9)return wE;X9=1;const{format:n,inspect:e,AggregateError:t}=is(),a=globalThis.AggregateError||t,s=Symbol("kIsNodeError"),u=["string","function","number","object","Function","Object","boolean","bigint","symbol"],o=/^([A-Z][a-z0-9]*)+$/,c="__node_internal_",p={};function d(C,T){if(!C)throw new p.ERR_INTERNAL_ASSERTION(T)}function y(C){let T="",k=C.length;const M=C[0]==="-"?1:0;for(;k>=M+4;k-=3)T=`_${C.slice(k-3,k)}${T}`;return`${C.slice(0,k)}${T}`}function m(C,T,k){if(typeof T=="function")return d(T.length<=k.length,`Code: ${C}; The provided arguments length (${k.length}) does not match the required ones (${T.length}).`),T(...k);const M=(T.match(/%[dfijoOs]/g)||[]).length;return d(M===k.length,`Code: ${C}; The provided arguments length (${k.length}) does not match the required ones (${M}).`),k.length===0?T:n(T,...k)}function v(C,T,k){k||(k=Error);class M extends k{constructor(...R){super(m(C,T,R))}toString(){return`${this.name} [${C}]: ${this.message}`}}Object.defineProperties(M.prototype,{name:{value:k.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${C}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),M.prototype.code=C,M.prototype[s]=!0,p[C]=M}function b(C){const T=c+C.name;return Object.defineProperty(C,"name",{value:T}),C}function x(C,T){if(C&&T&&C!==T){if(Array.isArray(T.errors))return T.errors.push(C),T;const k=new a([T,C],T.message);return k.code=T.code,k}return C||T}class E extends Error{constructor(T="The operation was aborted",k=void 0){if(k!==void 0&&typeof k!="object")throw new p.ERR_INVALID_ARG_TYPE("options","Object",k);super(T,k),this.code="ABORT_ERR",this.name="AbortError"}}return v("ERR_ASSERTION","%s",Error),v("ERR_INVALID_ARG_TYPE",(C,T,k)=>{d(typeof C=="string","'name' must be a string"),Array.isArray(T)||(T=[T]);let M="The ";C.endsWith(" argument")?M+=`${C} `:M+=`"${C}" ${C.includes(".")?"property":"argument"} `,M+="must be ";const O=[],R=[],$=[];for(const se of T)d(typeof se=="string","All expected entries have to be of type string"),u.includes(se)?O.push(se.toLowerCase()):o.test(se)?R.push(se):(d(se!=="object",'The value "object" should be written as "Object"'),$.push(se));if(R.length>0){const se=O.indexOf("object");se!==-1&&(O.splice(O,se,1),R.push("Object"))}if(O.length>0){switch(O.length){case 1:M+=`of type ${O[0]}`;break;case 2:M+=`one of type ${O[0]} or ${O[1]}`;break;default:{const se=O.pop();M+=`one of type ${O.join(", ")}, or ${se}`}}(R.length>0||$.length>0)&&(M+=" or ")}if(R.length>0){switch(R.length){case 1:M+=`an instance of ${R[0]}`;break;case 2:M+=`an instance of ${R[0]} or ${R[1]}`;break;default:{const se=R.pop();M+=`an instance of ${R.join(", ")}, or ${se}`}}$.length>0&&(M+=" or ")}switch($.length){case 0:break;case 1:$[0].toLowerCase()!==$[0]&&(M+="an "),M+=`${$[0]}`;break;case 2:M+=`one of ${$[0]} or ${$[1]}`;break;default:{const se=$.pop();M+=`one of ${$.join(", ")}, or ${se}`}}if(k==null)M+=`. Received ${k}`;else if(typeof k=="function"&&k.name)M+=`. Received function ${k.name}`;else if(typeof k=="object"){var X;if((X=k.constructor)!==null&&X!==void 0&&X.name)M+=`. Received an instance of ${k.constructor.name}`;else{const se=e(k,{depth:-1});M+=`. Received ${se}`}}else{let se=e(k,{colors:!1});se.length>25&&(se=`${se.slice(0,25)}...`),M+=`. Received type ${typeof k} (${se})`}return M},TypeError),v("ERR_INVALID_ARG_VALUE",(C,T,k="is invalid")=>{let M=e(T);return M.length>128&&(M=M.slice(0,128)+"..."),`The ${C.includes(".")?"property":"argument"} '${C}' ${k}. Received ${M}`},TypeError),v("ERR_INVALID_RETURN_VALUE",(C,T,k)=>{var M;const O=k!=null&&(M=k.constructor)!==null&&M!==void 0&&M.name?`instance of ${k.constructor.name}`:`type ${typeof k}`;return`Expected ${C} to be returned from the "${T}" function but got ${O}.`},TypeError),v("ERR_MISSING_ARGS",(...C)=>{d(C.length>0,"At least one arg needs to be specified");let T;const k=C.length;switch(C=(Array.isArray(C)?C:[C]).map(M=>`"${M}"`).join(" or "),k){case 1:T+=`The ${C[0]} argument`;break;case 2:T+=`The ${C[0]} and ${C[1]} arguments`;break;default:{const M=C.pop();T+=`The ${C.join(", ")}, and ${M} arguments`}break}return`${T} must be specified`},TypeError),v("ERR_OUT_OF_RANGE",(C,T,k)=>{d(T,'Missing "range" argument');let M;return Number.isInteger(k)&&Math.abs(k)>2**32?M=y(String(k)):typeof k=="bigint"?(M=String(k),(k>2n**32n||k<-(2n**32n))&&(M=y(M)),M+="n"):M=e(k),`The value of "${C}" is out of range. It must be ${T}. Received ${M}`},RangeError),v("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),v("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),v("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),v("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),v("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),v("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),v("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),v("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),v("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),v("ERR_STREAM_WRITE_AFTER_END","write after end",Error),v("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),wE={AbortError:E,aggregateTwoErrors:b(x),hideStackFrames:b,codes:p},wE}var _E,Z9;function Gg(){if(Z9)return _E;Z9=1;const{ArrayIsArray:n,ArrayPrototypeIncludes:e,ArrayPrototypeJoin:t,ArrayPrototypeMap:a,NumberIsInteger:s,NumberIsNaN:u,NumberMAX_SAFE_INTEGER:o,NumberMIN_SAFE_INTEGER:c,NumberParseInt:p,ObjectPrototypeHasOwnProperty:d,RegExpPrototypeExec:y,String:m,StringPrototypeToUpperCase:v,StringPrototypeTrim:b}=oa(),{hideStackFrames:x,codes:{ERR_SOCKET_BAD_PORT:E,ERR_INVALID_ARG_TYPE:C,ERR_INVALID_ARG_VALUE:T,ERR_OUT_OF_RANGE:k,ERR_UNKNOWN_SIGNAL:M}}=Ns(),{normalizeEncoding:O}=is(),{isAsyncFunction:R,isArrayBufferView:$}=is().types,X={};function se(Q){return Q===(Q|0)}function ye(Q){return Q===Q>>>0}const he=/^[0-7]+$/,te="must be a 32-bit unsigned integer or an octal string";function re(Q,le,ke){if(typeof Q>"u"&&(Q=ke),typeof Q=="string"){if(y(he,Q)===null)throw new T(le,Q,te);Q=p(Q,8)}return P(Q,le),Q}const S=x((Q,le,ke=c,Re=o)=>{if(typeof Q!="number")throw new C(le,"number",Q);if(!s(Q))throw new k(le,"an integer",Q);if(Q<ke||Q>Re)throw new k(le,`>= ${ke} && <= ${Re}`,Q)}),_=x((Q,le,ke=-2147483648,Re=2147483647)=>{if(typeof Q!="number")throw new C(le,"number",Q);if(!s(Q))throw new k(le,"an integer",Q);if(Q<ke||Q>Re)throw new k(le,`>= ${ke} && <= ${Re}`,Q)}),P=x((Q,le,ke=!1)=>{if(typeof Q!="number")throw new C(le,"number",Q);if(!s(Q))throw new k(le,"an integer",Q);const Re=ke?1:0,Je=4294967295;if(Q<Re||Q>Je)throw new k(le,`>= ${Re} && <= ${Je}`,Q)});function j(Q,le){if(typeof Q!="string")throw new C(le,"string",Q)}function q(Q,le,ke=void 0,Re){if(typeof Q!="number")throw new C(le,"number",Q);if(ke!=null&&Q<ke||Re!=null&&Q>Re||(ke!=null||Re!=null)&&u(Q))throw new k(le,`${ke!=null?`>= ${ke}`:""}${ke!=null&&Re!=null?" && ":""}${Re!=null?`<= ${Re}`:""}`,Q)}const z=x((Q,le,ke)=>{if(!e(ke,Q)){const Je="must be one of: "+t(a(ke,lt=>typeof lt=="string"?`'${lt}'`:m(lt)),", ");throw new T(le,Q,Je)}});function Z(Q,le){if(typeof Q!="boolean")throw new C(le,"boolean",Q)}function W(Q,le,ke){return Q==null||!d(Q,le)?ke:Q[le]}const D=x((Q,le,ke=null)=>{const Re=W(ke,"allowArray",!1),Je=W(ke,"allowFunction",!1);if(!W(ke,"nullable",!1)&&Q===null||!Re&&n(Q)||typeof Q!="object"&&(!Je||typeof Q!="function"))throw new C(le,"Object",Q)}),N=x((Q,le)=>{if(Q!=null&&typeof Q!="object"&&typeof Q!="function")throw new C(le,"a dictionary",Q)}),Y=x((Q,le,ke=0)=>{if(!n(Q))throw new C(le,"Array",Q);if(Q.length<ke){const Re=`must be longer than ${ke}`;throw new T(le,Q,Re)}});function ie(Q,le){Y(Q,le);for(let ke=0;ke<Q.length;ke++)j(Q[ke],`${le}[${ke}]`)}function V(Q,le){Y(Q,le);for(let ke=0;ke<Q.length;ke++)Z(Q[ke],`${le}[${ke}]`)}function Ce(Q,le){Y(Q,le);for(let ke=0;ke<Q.length;ke++){const Re=Q[ke],Je=`${le}[${ke}]`;if(Re==null)throw new C(Je,"AbortSignal",Re);ce(Re,Je)}}function Pe(Q,le="signal"){if(j(Q,le),X[Q]===void 0)throw X[v(Q)]!==void 0?new M(Q+" (signals must use all capital letters)"):new M(Q)}const Se=x((Q,le="buffer")=>{if(!$(Q))throw new C(le,["Buffer","TypedArray","DataView"],Q)});function Ee(Q,le){const ke=O(le),Re=Q.length;if(ke==="hex"&&Re%2!==0)throw new T("encoding",le,`is invalid for data of length ${Re}`)}function oe(Q,le="Port",ke=!0){if(typeof Q!="number"&&typeof Q!="string"||typeof Q=="string"&&b(Q).length===0||+Q!==+Q>>>0||Q>65535||Q===0&&!ke)throw new E(le,Q,ke);return Q|0}const ce=x((Q,le)=>{if(Q!==void 0&&(Q===null||typeof Q!="object"||!("aborted"in Q)))throw new C(le,"AbortSignal",Q)}),be=x((Q,le)=>{if(typeof Q!="function")throw new C(le,"Function",Q)}),me=x((Q,le)=>{if(typeof Q!="function"||R(Q))throw new C(le,"Function",Q)}),fe=x((Q,le)=>{if(Q!==void 0)throw new C(le,"undefined",Q)});function _e(Q,le,ke){if(!e(ke,Q))throw new C(le,`('${t(ke,"|")}')`,Q)}const ne=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function B(Q,le){if(typeof Q>"u"||!y(ne,Q))throw new T(le,Q,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function H(Q){if(typeof Q=="string")return B(Q,"hints"),Q;if(n(Q)){const le=Q.length;let ke="";if(le===0)return ke;for(let Re=0;Re<le;Re++){const Je=Q[Re];B(Je,"hints"),ke+=Je,Re!==le-1&&(ke+=", ")}return ke}throw new T("hints",Q,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}return _E={isInt32:se,isUint32:ye,parseFileMode:re,validateArray:Y,validateStringArray:ie,validateBooleanArray:V,validateAbortSignalArray:Ce,validateBoolean:Z,validateBuffer:Se,validateDictionary:N,validateEncoding:Ee,validateFunction:be,validateInt32:_,validateInteger:S,validateNumber:q,validateObject:D,validateOneOf:z,validatePlainFunction:me,validatePort:oe,validateSignalName:Pe,validateString:j,validateUint32:P,validateUndefined:fe,validateUnion:_e,validateAbortSignal:ce,validateLinkHeaderValue:H},_E}var pw={exports:{}},xE={exports:{}},eO;function Df(){if(eO)return xE.exports;eO=1;var n=xE.exports={},e,t;function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=a}catch{e=a}try{typeof clearTimeout=="function"?t=clearTimeout:t=s}catch{t=s}})();function u(E){if(e===setTimeout)return setTimeout(E,0);if((e===a||!e)&&setTimeout)return e=setTimeout,setTimeout(E,0);try{return e(E,0)}catch{try{return e.call(null,E,0)}catch{return e.call(this,E,0)}}}function o(E){if(t===clearTimeout)return clearTimeout(E);if((t===s||!t)&&clearTimeout)return t=clearTimeout,clearTimeout(E);try{return t(E)}catch{try{return t.call(null,E)}catch{return t.call(this,E)}}}var c=[],p=!1,d,y=-1;function m(){!p||!d||(p=!1,d.length?c=d.concat(c):y=-1,c.length&&v())}function v(){if(!p){var E=u(m);p=!0;for(var C=c.length;C;){for(d=c,c=[];++y<C;)d&&d[y].run();y=-1,C=c.length}d=null,p=!1,o(E)}}n.nextTick=function(E){var C=new Array(arguments.length-1);if(arguments.length>1)for(var T=1;T<arguments.length;T++)C[T-1]=arguments[T];c.push(new b(E,C)),c.length===1&&!p&&u(v)};function b(E,C){this.fun=E,this.array=C}b.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={};function x(){}return n.on=x,n.addListener=x,n.once=x,n.off=x,n.removeListener=x,n.removeAllListeners=x,n.emit=x,n.prependListener=x,n.prependOnceListener=x,n.listeners=function(E){return[]},n.binding=function(E){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(E){throw new Error("process.chdir is not supported")},n.umask=function(){return 0},xE.exports}var SE,tO;function xc(){if(tO)return SE;tO=1;const{SymbolAsyncIterator:n,SymbolIterator:e,SymbolFor:t}=oa(),a=t("nodejs.stream.destroyed"),s=t("nodejs.stream.errored"),u=t("nodejs.stream.readable"),o=t("nodejs.stream.writable"),c=t("nodejs.stream.disturbed"),p=t("nodejs.webstream.isClosedPromise"),d=t("nodejs.webstream.controllerErrorFunction");function y(W,D=!1){var N;return!!(W&&typeof W.pipe=="function"&&typeof W.on=="function"&&(!D||typeof W.pause=="function"&&typeof W.resume=="function")&&(!W._writableState||((N=W._readableState)===null||N===void 0?void 0:N.readable)!==!1)&&(!W._writableState||W._readableState))}function m(W){var D;return!!(W&&typeof W.write=="function"&&typeof W.on=="function"&&(!W._readableState||((D=W._writableState)===null||D===void 0?void 0:D.writable)!==!1))}function v(W){return!!(W&&typeof W.pipe=="function"&&W._readableState&&typeof W.on=="function"&&typeof W.write=="function")}function b(W){return W&&(W._readableState||W._writableState||typeof W.write=="function"&&typeof W.on=="function"||typeof W.pipe=="function"&&typeof W.on=="function")}function x(W){return!!(W&&!b(W)&&typeof W.pipeThrough=="function"&&typeof W.getReader=="function"&&typeof W.cancel=="function")}function E(W){return!!(W&&!b(W)&&typeof W.getWriter=="function"&&typeof W.abort=="function")}function C(W){return!!(W&&!b(W)&&typeof W.readable=="object"&&typeof W.writable=="object")}function T(W){return x(W)||E(W)||C(W)}function k(W,D){return W==null?!1:D===!0?typeof W[n]=="function":D===!1?typeof W[e]=="function":typeof W[n]=="function"||typeof W[e]=="function"}function M(W){if(!b(W))return null;const D=W._writableState,N=W._readableState,Y=D||N;return!!(W.destroyed||W[a]||Y!=null&&Y.destroyed)}function O(W){if(!m(W))return null;if(W.writableEnded===!0)return!0;const D=W._writableState;return D!=null&&D.errored?!1:typeof D?.ended!="boolean"?null:D.ended}function R(W,D){if(!m(W))return null;if(W.writableFinished===!0)return!0;const N=W._writableState;return N!=null&&N.errored?!1:typeof N?.finished!="boolean"?null:!!(N.finished||D===!1&&N.ended===!0&&N.length===0)}function $(W){if(!y(W))return null;if(W.readableEnded===!0)return!0;const D=W._readableState;return!D||D.errored?!1:typeof D?.ended!="boolean"?null:D.ended}function X(W,D){if(!y(W))return null;const N=W._readableState;return N!=null&&N.errored?!1:typeof N?.endEmitted!="boolean"?null:!!(N.endEmitted||D===!1&&N.ended===!0&&N.length===0)}function se(W){return W&&W[u]!=null?W[u]:typeof W?.readable!="boolean"?null:M(W)?!1:y(W)&&W.readable&&!X(W)}function ye(W){return W&&W[o]!=null?W[o]:typeof W?.writable!="boolean"?null:M(W)?!1:m(W)&&W.writable&&!O(W)}function he(W,D){return b(W)?M(W)?!0:!(D?.readable!==!1&&se(W)||D?.writable!==!1&&ye(W)):null}function te(W){var D,N;return b(W)?W.writableErrored?W.writableErrored:(D=(N=W._writableState)===null||N===void 0?void 0:N.errored)!==null&&D!==void 0?D:null:null}function re(W){var D,N;return b(W)?W.readableErrored?W.readableErrored:(D=(N=W._readableState)===null||N===void 0?void 0:N.errored)!==null&&D!==void 0?D:null:null}function S(W){if(!b(W))return null;if(typeof W.closed=="boolean")return W.closed;const D=W._writableState,N=W._readableState;return typeof D?.closed=="boolean"||typeof N?.closed=="boolean"?D?.closed||N?.closed:typeof W._closed=="boolean"&&_(W)?W._closed:null}function _(W){return typeof W._closed=="boolean"&&typeof W._defaultKeepAlive=="boolean"&&typeof W._removedConnection=="boolean"&&typeof W._removedContLen=="boolean"}function P(W){return typeof W._sent100=="boolean"&&_(W)}function j(W){var D;return typeof W._consuming=="boolean"&&typeof W._dumped=="boolean"&&((D=W.req)===null||D===void 0?void 0:D.upgradeOrConnect)===void 0}function q(W){if(!b(W))return null;const D=W._writableState,N=W._readableState,Y=D||N;return!Y&&P(W)||!!(Y&&Y.autoDestroy&&Y.emitClose&&Y.closed===!1)}function z(W){var D;return!!(W&&((D=W[c])!==null&&D!==void 0?D:W.readableDidRead||W.readableAborted))}function Z(W){var D,N,Y,ie,V,Ce,Pe,Se,Ee,oe;return!!(W&&((D=(N=(Y=(ie=(V=(Ce=W[s])!==null&&Ce!==void 0?Ce:W.readableErrored)!==null&&V!==void 0?V:W.writableErrored)!==null&&ie!==void 0?ie:(Pe=W._readableState)===null||Pe===void 0?void 0:Pe.errorEmitted)!==null&&Y!==void 0?Y:(Se=W._writableState)===null||Se===void 0?void 0:Se.errorEmitted)!==null&&N!==void 0?N:(Ee=W._readableState)===null||Ee===void 0?void 0:Ee.errored)!==null&&D!==void 0?D:!((oe=W._writableState)===null||oe===void 0)&&oe.errored))}return SE={isDestroyed:M,kIsDestroyed:a,isDisturbed:z,kIsDisturbed:c,isErrored:Z,kIsErrored:s,isReadable:se,kIsReadable:u,kIsClosedPromise:p,kControllerErrorFunction:d,kIsWritable:o,isClosed:S,isDuplexNodeStream:v,isFinished:he,isIterable:k,isReadableNodeStream:y,isReadableStream:x,isReadableEnded:$,isReadableFinished:X,isReadableErrored:re,isNodeStream:b,isWebStream:T,isWritable:ye,isWritableNodeStream:m,isWritableStream:E,isWritableEnded:O,isWritableFinished:R,isWritableErrored:te,isServerRequest:j,isServerResponse:P,willEmitClose:q,isTransformStream:C},SE}var nO;function Uf(){if(nO)return pw.exports;nO=1;const n=Df(),{AbortError:e,codes:t}=Ns(),{ERR_INVALID_ARG_TYPE:a,ERR_STREAM_PREMATURE_CLOSE:s}=t,{kEmptyObject:u,once:o}=is(),{validateAbortSignal:c,validateFunction:p,validateObject:d,validateBoolean:y}=Gg(),{Promise:m,PromisePrototypeThen:v,SymbolDispose:b}=oa(),{isClosed:x,isReadable:E,isReadableNodeStream:C,isReadableStream:T,isReadableFinished:k,isReadableErrored:M,isWritable:O,isWritableNodeStream:R,isWritableStream:$,isWritableFinished:X,isWritableErrored:se,isNodeStream:ye,willEmitClose:he,kIsClosedPromise:te}=xc();let re;function S(z){return z.setHeader&&typeof z.abort=="function"}const _=()=>{};function P(z,Z,W){var D,N;if(arguments.length===2?(W=Z,Z=u):Z==null?Z=u:d(Z,"options"),p(W,"callback"),c(Z.signal,"options.signal"),W=o(W),T(z)||$(z))return j(z,Z,W);if(!ye(z))throw new a("stream",["ReadableStream","WritableStream","Stream"],z);const Y=(D=Z.readable)!==null&&D!==void 0?D:C(z),ie=(N=Z.writable)!==null&&N!==void 0?N:R(z),V=z._writableState,Ce=z._readableState,Pe=()=>{z.writable||oe()};let Se=he(z)&&C(z)===Y&&R(z)===ie,Ee=X(z,!1);const oe=()=>{Ee=!0,z.destroyed&&(Se=!1),!(Se&&(!z.readable||Y))&&(!Y||ce)&&W.call(z)};let ce=k(z,!1);const be=()=>{ce=!0,z.destroyed&&(Se=!1),!(Se&&(!z.writable||ie))&&(!ie||Ee)&&W.call(z)},me=Q=>{W.call(z,Q)};let fe=x(z);const _e=()=>{fe=!0;const Q=se(z)||M(z);if(Q&&typeof Q!="boolean")return W.call(z,Q);if(Y&&!ce&&C(z,!0)&&!k(z,!1))return W.call(z,new s);if(ie&&!Ee&&!X(z,!1))return W.call(z,new s);W.call(z)},ne=()=>{fe=!0;const Q=se(z)||M(z);if(Q&&typeof Q!="boolean")return W.call(z,Q);W.call(z)},B=()=>{z.req.on("finish",oe)};S(z)?(z.on("complete",oe),Se||z.on("abort",_e),z.req?B():z.on("request",B)):ie&&!V&&(z.on("end",Pe),z.on("close",Pe)),!Se&&typeof z.aborted=="boolean"&&z.on("aborted",_e),z.on("end",be),z.on("finish",oe),Z.error!==!1&&z.on("error",me),z.on("close",_e),fe?n.nextTick(_e):V!=null&&V.errorEmitted||Ce!=null&&Ce.errorEmitted?Se||n.nextTick(ne):(!Y&&(!Se||E(z))&&(Ee||O(z)===!1)||!ie&&(!Se||O(z))&&(ce||E(z)===!1)||Ce&&z.req&&z.aborted)&&n.nextTick(ne);const H=()=>{W=_,z.removeListener("aborted",_e),z.removeListener("complete",oe),z.removeListener("abort",_e),z.removeListener("request",B),z.req&&z.req.removeListener("finish",oe),z.removeListener("end",Pe),z.removeListener("close",Pe),z.removeListener("finish",oe),z.removeListener("end",be),z.removeListener("error",me),z.removeListener("close",_e)};if(Z.signal&&!fe){const Q=()=>{const le=W;H(),le.call(z,new e(void 0,{cause:Z.signal.reason}))};if(Z.signal.aborted)n.nextTick(Q);else{re=re||is().addAbortListener;const le=re(Z.signal,Q),ke=W;W=o((...Re)=>{le[b](),ke.apply(z,Re)})}}return H}function j(z,Z,W){let D=!1,N=_;if(Z.signal)if(N=()=>{D=!0,W.call(z,new e(void 0,{cause:Z.signal.reason}))},Z.signal.aborted)n.nextTick(N);else{re=re||is().addAbortListener;const ie=re(Z.signal,N),V=W;W=o((...Ce)=>{ie[b](),V.apply(z,Ce)})}const Y=(...ie)=>{D||n.nextTick(()=>W.apply(z,ie))};return v(z[te].promise,Y,Y),_}function q(z,Z){var W;let D=!1;return Z===null&&(Z=u),(W=Z)!==null&&W!==void 0&&W.cleanup&&(y(Z.cleanup,"cleanup"),D=Z.cleanup),new m((N,Y)=>{const ie=P(z,Z,V=>{D&&ie(),V?Y(V):N()})})}return pw.exports=P,pw.exports.finished=q,pw.exports}var CE,rO;function F0(){if(rO)return CE;rO=1;const n=Df(),{aggregateTwoErrors:e,codes:{ERR_MULTIPLE_CALLBACK:t},AbortError:a}=Ns(),{Symbol:s}=oa(),{kIsDestroyed:u,isDestroyed:o,isFinished:c,isServerRequest:p}=xc(),d=s("kDestroy"),y=s("kConstruct");function m(he,te,re){he&&(he.stack,te&&!te.errored&&(te.errored=he),re&&!re.errored&&(re.errored=he))}function v(he,te){const re=this._readableState,S=this._writableState,_=S||re;return S!=null&&S.destroyed||re!=null&&re.destroyed?(typeof te=="function"&&te(),this):(m(he,S,re),S&&(S.destroyed=!0),re&&(re.destroyed=!0),_.constructed?b(this,he,te):this.once(d,function(P){b(this,e(P,he),te)}),this)}function b(he,te,re){let S=!1;function _(P){if(S)return;S=!0;const j=he._readableState,q=he._writableState;m(P,q,j),q&&(q.closed=!0),j&&(j.closed=!0),typeof re=="function"&&re(P),P?n.nextTick(x,he,P):n.nextTick(E,he)}try{he._destroy(te||null,_)}catch(P){_(P)}}function x(he,te){C(he,te),E(he)}function E(he){const te=he._readableState,re=he._writableState;re&&(re.closeEmitted=!0),te&&(te.closeEmitted=!0),(re!=null&&re.emitClose||te!=null&&te.emitClose)&&he.emit("close")}function C(he,te){const re=he._readableState,S=he._writableState;S!=null&&S.errorEmitted||re!=null&&re.errorEmitted||(S&&(S.errorEmitted=!0),re&&(re.errorEmitted=!0),he.emit("error",te))}function T(){const he=this._readableState,te=this._writableState;he&&(he.constructed=!0,he.closed=!1,he.closeEmitted=!1,he.destroyed=!1,he.errored=null,he.errorEmitted=!1,he.reading=!1,he.ended=he.readable===!1,he.endEmitted=he.readable===!1),te&&(te.constructed=!0,te.destroyed=!1,te.closed=!1,te.closeEmitted=!1,te.errored=null,te.errorEmitted=!1,te.finalCalled=!1,te.prefinished=!1,te.ended=te.writable===!1,te.ending=te.writable===!1,te.finished=te.writable===!1)}function k(he,te,re){const S=he._readableState,_=he._writableState;if(_!=null&&_.destroyed||S!=null&&S.destroyed)return this;S!=null&&S.autoDestroy||_!=null&&_.autoDestroy?he.destroy(te):te&&(te.stack,_&&!_.errored&&(_.errored=te),S&&!S.errored&&(S.errored=te),re?n.nextTick(C,he,te):C(he,te))}function M(he,te){if(typeof he._construct!="function")return;const re=he._readableState,S=he._writableState;re&&(re.constructed=!1),S&&(S.constructed=!1),he.once(y,te),!(he.listenerCount(y)>1)&&n.nextTick(O,he)}function O(he){let te=!1;function re(S){if(te){k(he,S??new t);return}te=!0;const _=he._readableState,P=he._writableState,j=P||_;_&&(_.constructed=!0),P&&(P.constructed=!0),j.destroyed?he.emit(d,S):S?k(he,S,!0):n.nextTick(R,he)}try{he._construct(S=>{n.nextTick(re,S)})}catch(S){n.nextTick(re,S)}}function R(he){he.emit(y)}function $(he){return he?.setHeader&&typeof he.abort=="function"}function X(he){he.emit("close")}function se(he,te){he.emit("error",te),n.nextTick(X,he)}function ye(he,te){!he||o(he)||(!te&&!c(he)&&(te=new a),p(he)?(he.socket=null,he.destroy(te)):$(he)?he.abort():$(he.req)?he.req.abort():typeof he.destroy=="function"?he.destroy(te):typeof he.close=="function"?he.close():te?n.nextTick(se,he,te):n.nextTick(X,he),he.destroyed||(he[u]=!0))}return CE={construct:M,destroyer:ye,destroy:v,undestroy:T,errorOrDestroy:k},CE}var EE,aO;function s5(){if(aO)return EE;aO=1;const{ArrayIsArray:n,ObjectSetPrototypeOf:e}=oa(),{EventEmitter:t}=Vg();function a(u){t.call(this,u)}e(a.prototype,t.prototype),e(a,t),a.prototype.pipe=function(u,o){const c=this;function p(E){u.writable&&u.write(E)===!1&&c.pause&&c.pause()}c.on("data",p);function d(){c.readable&&c.resume&&c.resume()}u.on("drain",d),!u._isStdio&&(!o||o.end!==!1)&&(c.on("end",m),c.on("close",v));let y=!1;function m(){y||(y=!0,u.end())}function v(){y||(y=!0,typeof u.destroy=="function"&&u.destroy())}function b(E){x(),t.listenerCount(this,"error")===0&&this.emit("error",E)}s(c,"error",b),s(u,"error",b);function x(){c.removeListener("data",p),u.removeListener("drain",d),c.removeListener("end",m),c.removeListener("close",v),c.removeListener("error",b),u.removeListener("error",b),c.removeListener("end",x),c.removeListener("close",x),u.removeListener("close",x)}return c.on("end",x),c.on("close",x),u.on("close",x),u.emit("pipe",c),u};function s(u,o,c){if(typeof u.prependListener=="function")return u.prependListener(o,c);!u._events||!u._events[o]?u.on(o,c):n(u._events[o])?u._events[o].unshift(c):u._events[o]=[c,u._events[o]]}return EE={Stream:a,prependListener:s},EE}var AE={exports:{}},iO;function x_(){return iO||(iO=1,(function(n){const{SymbolDispose:e}=oa(),{AbortError:t,codes:a}=Ns(),{isNodeStream:s,isWebStream:u,kControllerErrorFunction:o}=xc(),c=Uf(),{ERR_INVALID_ARG_TYPE:p}=a;let d;const y=(m,v)=>{if(typeof m!="object"||!("aborted"in m))throw new p(v,"AbortSignal",m)};n.exports.addAbortSignal=function(v,b){if(y(v,"signal"),!s(b)&&!u(b))throw new p("stream",["ReadableStream","WritableStream","Stream"],b);return n.exports.addAbortSignalNoValidate(v,b)},n.exports.addAbortSignalNoValidate=function(m,v){if(typeof m!="object"||!("aborted"in m))return v;const b=s(v)?()=>{v.destroy(new t(void 0,{cause:m.reason}))}:()=>{v[o](new t(void 0,{cause:m.reason}))};if(m.aborted)b();else{d=d||is().addAbortListener;const x=d(m,b);c(v,x[e])}return v}})(AE)),AE.exports}var kE,sO;function wJ(){if(sO)return kE;sO=1;const{StringPrototypeSlice:n,SymbolIterator:e,TypedArrayPrototypeSet:t,Uint8Array:a}=oa(),{Buffer:s}=Ap(),{inspect:u}=is();return kE=class{constructor(){this.head=null,this.tail=null,this.length=0}push(c){const p={data:c,next:null};this.length>0?this.tail.next=p:this.head=p,this.tail=p,++this.length}unshift(c){const p={data:c,next:this.head};this.length===0&&(this.tail=p),this.head=p,++this.length}shift(){if(this.length===0)return;const c=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,c}clear(){this.head=this.tail=null,this.length=0}join(c){if(this.length===0)return"";let p=this.head,d=""+p.data;for(;(p=p.next)!==null;)d+=c+p.data;return d}concat(c){if(this.length===0)return s.alloc(0);const p=s.allocUnsafe(c>>>0);let d=this.head,y=0;for(;d;)t(p,d.data,y),y+=d.data.length,d=d.next;return p}consume(c,p){const d=this.head.data;if(c<d.length){const y=d.slice(0,c);return this.head.data=d.slice(c),y}return c===d.length?this.shift():p?this._getString(c):this._getBuffer(c)}first(){return this.head.data}*[e](){for(let c=this.head;c;c=c.next)yield c.data}_getString(c){let p="",d=this.head,y=0;do{const m=d.data;if(c>m.length)p+=m,c-=m.length;else{c===m.length?(p+=m,++y,d.next?this.head=d.next:this.head=this.tail=null):(p+=n(m,0,c),this.head=d,d.data=n(m,c));break}++y}while((d=d.next)!==null);return this.length-=y,p}_getBuffer(c){const p=s.allocUnsafe(c),d=c;let y=this.head,m=0;do{const v=y.data;if(c>v.length)t(p,v,d-c),c-=v.length;else{c===v.length?(t(p,v,d-c),++m,y.next?this.head=y.next:this.head=this.tail=null):(t(p,new a(v.buffer,v.byteOffset,c),d-c),this.head=y,y.data=v.slice(c));break}++m}while((y=y.next)!==null);return this.length-=m,p}[Symbol.for("nodejs.util.inspect.custom")](c,p){return u(this,{...p,depth:0,customInspect:!1})}},kE}var TE,oO;function S_(){if(oO)return TE;oO=1;const{MathFloor:n,NumberIsInteger:e}=oa(),{validateInteger:t}=Gg(),{ERR_INVALID_ARG_VALUE:a}=Ns().codes;let s=16*1024,u=16;function o(y,m,v){return y.highWaterMark!=null?y.highWaterMark:m?y[v]:null}function c(y){return y?u:s}function p(y,m){t(m,"value",0),y?u=m:s=m}function d(y,m,v,b){const x=o(m,b,v);if(x!=null){if(!e(x)||x<0){const E=b?`options.${v}`:"options.highWaterMark";throw new a(E,x)}return n(x)}return c(y.objectMode)}return TE={getHighWaterMark:d,getDefaultHighWaterMark:c,setDefaultHighWaterMark:p},TE}var ME={},uO;function zP(){if(uO)return ME;uO=1;var n=uP().Buffer,e=n.isEncoding||function(T){switch(T=""+T,T&&T.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function t(T){if(!T)return"utf8";for(var k;;)switch(T){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return T;default:if(k)return;T=(""+T).toLowerCase(),k=!0}}function a(T){var k=t(T);if(typeof k!="string"&&(n.isEncoding===e||!e(T)))throw new Error("Unknown encoding: "+T);return k||T}ME.StringDecoder=s;function s(T){this.encoding=a(T);var k;switch(this.encoding){case"utf16le":this.text=m,this.end=v,k=4;break;case"utf8":this.fillLast=p,k=4;break;case"base64":this.text=b,this.end=x,k=3;break;default:this.write=E,this.end=C;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(k)}s.prototype.write=function(T){if(T.length===0)return"";var k,M;if(this.lastNeed){if(k=this.fillLast(T),k===void 0)return"";M=this.lastNeed,this.lastNeed=0}else M=0;return M<T.length?k?k+this.text(T,M):this.text(T,M):k||""},s.prototype.end=y,s.prototype.text=d,s.prototype.fillLast=function(T){if(this.lastNeed<=T.length)return T.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);T.copy(this.lastChar,this.lastTotal-this.lastNeed,0,T.length),this.lastNeed-=T.length};function u(T){return T<=127?0:T>>5===6?2:T>>4===14?3:T>>3===30?4:T>>6===2?-1:-2}function o(T,k,M){var O=k.length-1;if(O<M)return 0;var R=u(k[O]);return R>=0?(R>0&&(T.lastNeed=R-1),R):--O<M||R===-2?0:(R=u(k[O]),R>=0?(R>0&&(T.lastNeed=R-2),R):--O<M||R===-2?0:(R=u(k[O]),R>=0?(R>0&&(R===2?R=0:T.lastNeed=R-3),R):0))}function c(T,k,M){if((k[0]&192)!==128)return T.lastNeed=0,"�";if(T.lastNeed>1&&k.length>1){if((k[1]&192)!==128)return T.lastNeed=1,"�";if(T.lastNeed>2&&k.length>2&&(k[2]&192)!==128)return T.lastNeed=2,"�"}}function p(T){var k=this.lastTotal-this.lastNeed,M=c(this,T);if(M!==void 0)return M;if(this.lastNeed<=T.length)return T.copy(this.lastChar,k,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);T.copy(this.lastChar,k,0,T.length),this.lastNeed-=T.length}function d(T,k){var M=o(this,T,k);if(!this.lastNeed)return T.toString("utf8",k);this.lastTotal=M;var O=T.length-(M-this.lastNeed);return T.copy(this.lastChar,0,O),T.toString("utf8",k,O)}function y(T){var k=T&&T.length?this.write(T):"";return this.lastNeed?k+"�":k}function m(T,k){if((T.length-k)%2===0){var M=T.toString("utf16le",k);if(M){var O=M.charCodeAt(M.length-1);if(O>=55296&&O<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1],M.slice(0,-1)}return M}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=T[T.length-1],T.toString("utf16le",k,T.length-1)}function v(T){var k=T&&T.length?this.write(T):"";if(this.lastNeed){var M=this.lastTotal-this.lastNeed;return k+this.lastChar.toString("utf16le",0,M)}return k}function b(T,k){var M=(T.length-k)%3;return M===0?T.toString("base64",k):(this.lastNeed=3-M,this.lastTotal=3,M===1?this.lastChar[0]=T[T.length-1]:(this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1]),T.toString("base64",k,T.length-M))}function x(T){var k=T&&T.length?this.write(T):"";return this.lastNeed?k+this.lastChar.toString("base64",0,3-this.lastNeed):k}function E(T){return T.toString(this.encoding)}function C(T){return T&&T.length?this.write(T):""}return ME}var RE,lO;function jP(){if(lO)return RE;lO=1;const n=Df(),{PromisePrototypeThen:e,SymbolAsyncIterator:t,SymbolIterator:a}=oa(),{Buffer:s}=Ap(),{ERR_INVALID_ARG_TYPE:u,ERR_STREAM_NULL_VALUES:o}=Ns().codes;function c(p,d,y){let m;if(typeof d=="string"||d instanceof s)return new p({objectMode:!0,...y,read(){this.push(d),this.push(null)}});let v;if(d&&d[t])v=!0,m=d[t]();else if(d&&d[a])v=!1,m=d[a]();else throw new u("iterable",["Iterable"],d);const b=new p({objectMode:!0,highWaterMark:1,...y});let x=!1;b._read=function(){x||(x=!0,C())},b._destroy=function(T,k){e(E(T),()=>n.nextTick(k,T),M=>n.nextTick(k,M||T))};async function E(T){const k=T!=null,M=typeof m.throw=="function";if(k&&M){const{value:O,done:R}=await m.throw(T);if(await O,R)return}if(typeof m.return=="function"){const{value:O}=await m.return();await O}}async function C(){for(;;){try{const{value:T,done:k}=v?await m.next():m.next();if(k)b.push(null);else{const M=T&&typeof T.then=="function"?await T:T;if(M===null)throw x=!1,new o;if(b.push(M))continue;x=!1}}catch(T){b.destroy(T)}break}}return b}return RE=c,RE}var OE,cO;function C_(){if(cO)return OE;cO=1;const n=Df(),{ArrayPrototypeIndexOf:e,NumberIsInteger:t,NumberIsNaN:a,NumberParseInt:s,ObjectDefineProperties:u,ObjectKeys:o,ObjectSetPrototypeOf:c,Promise:p,SafeSet:d,SymbolAsyncDispose:y,SymbolAsyncIterator:m,Symbol:v}=oa();OE=Re,Re.ReadableState=ke;const{EventEmitter:b}=Vg(),{Stream:x,prependListener:E}=s5(),{Buffer:C}=Ap(),{addAbortSignal:T}=x_(),k=Uf();let M=is().debuglog("stream",Te=>{M=Te});const O=wJ(),R=F0(),{getHighWaterMark:$,getDefaultHighWaterMark:X}=S_(),{aggregateTwoErrors:se,codes:{ERR_INVALID_ARG_TYPE:ye,ERR_METHOD_NOT_IMPLEMENTED:he,ERR_OUT_OF_RANGE:te,ERR_STREAM_PUSH_AFTER_EOF:re,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:S},AbortError:_}=Ns(),{validateObject:P}=Gg(),j=v("kPaused"),{StringDecoder:q}=zP(),z=jP();c(Re.prototype,x.prototype),c(Re,x);const Z=()=>{},{errorOrDestroy:W}=R,D=1,N=2,Y=4,ie=8,V=16,Ce=32,Pe=64,Se=128,Ee=256,oe=512,ce=1024,be=2048,me=4096,fe=8192,_e=16384,ne=32768,B=65536,H=1<<17,Q=1<<18;function le(Te){return{enumerable:!1,get(){return(this.state&Te)!==0},set(I){I?this.state|=Te:this.state&=~Te}}}u(ke.prototype,{objectMode:le(D),ended:le(N),endEmitted:le(Y),reading:le(ie),constructed:le(V),sync:le(Ce),needReadable:le(Pe),emittedReadable:le(Se),readableListening:le(Ee),resumeScheduled:le(oe),errorEmitted:le(ce),emitClose:le(be),autoDestroy:le(me),destroyed:le(fe),closed:le(_e),closeEmitted:le(ne),multiAwaitDrain:le(B),readingMore:le(H),dataEmitted:le(Q)});function ke(Te,I,ze){typeof ze!="boolean"&&(ze=I instanceof bc()),this.state=be|me|V|Ce,Te&&Te.objectMode&&(this.state|=D),ze&&Te&&Te.readableObjectMode&&(this.state|=D),this.highWaterMark=Te?$(this,Te,"readableHighWaterMark",ze):X(!1),this.buffer=new O,this.length=0,this.pipes=[],this.flowing=null,this[j]=null,Te&&Te.emitClose===!1&&(this.state&=~be),Te&&Te.autoDestroy===!1&&(this.state&=~me),this.errored=null,this.defaultEncoding=Te&&Te.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,Te&&Te.encoding&&(this.decoder=new q(Te.encoding),this.encoding=Te.encoding)}function Re(Te){if(!(this instanceof Re))return new Re(Te);const I=this instanceof bc();this._readableState=new ke(Te,this,I),Te&&(typeof Te.read=="function"&&(this._read=Te.read),typeof Te.destroy=="function"&&(this._destroy=Te.destroy),typeof Te.construct=="function"&&(this._construct=Te.construct),Te.signal&&!I&&T(Te.signal,this)),x.call(this,Te),R.construct(this,()=>{this._readableState.needReadable&&Ae(this,this._readableState)})}Re.prototype.destroy=R.destroy,Re.prototype._undestroy=R.undestroy,Re.prototype._destroy=function(Te,I){I(Te)},Re.prototype[b.captureRejectionSymbol]=function(Te){this.destroy(Te)},Re.prototype[y]=function(){let Te;return this.destroyed||(Te=this.readableEnded?null:new _,this.destroy(Te)),new p((I,ze)=>k(this,we=>we&&we!==Te?ze(we):I(null)))},Re.prototype.push=function(Te,I){return Je(this,Te,I,!1)},Re.prototype.unshift=function(Te,I){return Je(this,Te,I,!0)};function Je(Te,I,ze,we){M("readableAddChunk",I);const De=Te._readableState;let Ge;if((De.state&D)===0&&(typeof I=="string"?(ze=ze||De.defaultEncoding,De.encoding!==ze&&(we&&De.encoding?I=C.from(I,ze).toString(De.encoding):(I=C.from(I,ze),ze=""))):I instanceof C?ze="":x._isUint8Array(I)?(I=x._uint8ArrayToBuffer(I),ze=""):I!=null&&(Ge=new ye("chunk",["string","Buffer","Uint8Array"],I))),Ge)W(Te,Ge);else if(I===null)De.state&=~ie,J(Te,De);else if((De.state&D)!==0||I&&I.length>0)if(we)if((De.state&Y)!==0)W(Te,new S);else{if(De.destroyed||De.errored)return!1;lt(Te,De,I,!0)}else if(De.ended)W(Te,new re);else{if(De.destroyed||De.errored)return!1;De.state&=~ie,De.decoder&&!ze?(I=De.decoder.write(I),De.objectMode||I.length!==0?lt(Te,De,I,!1):Ae(Te,De)):lt(Te,De,I,!1)}else we||(De.state&=~ie,Ae(Te,De));return!De.ended&&(De.length<De.highWaterMark||De.length===0)}function lt(Te,I,ze,we){I.flowing&&I.length===0&&!I.sync&&Te.listenerCount("data")>0?((I.state&B)!==0?I.awaitDrainWriters.clear():I.awaitDrainWriters=null,I.dataEmitted=!0,Te.emit("data",ze)):(I.length+=I.objectMode?1:ze.length,we?I.buffer.unshift(ze):I.buffer.push(ze),(I.state&Pe)!==0&&F(Te)),Ae(Te,I)}Re.prototype.isPaused=function(){const Te=this._readableState;return Te[j]===!0||Te.flowing===!1},Re.prototype.setEncoding=function(Te){const I=new q(Te);this._readableState.decoder=I,this._readableState.encoding=this._readableState.decoder.encoding;const ze=this._readableState.buffer;let we="";for(const De of ze)we+=I.write(De);return ze.clear(),we!==""&&ze.push(we),this._readableState.length=we.length,this};const et=1073741824;function xt(Te){if(Te>et)throw new te("size","<= 1GiB",Te);return Te--,Te|=Te>>>1,Te|=Te>>>2,Te|=Te>>>4,Te|=Te>>>8,Te|=Te>>>16,Te++,Te}function de(Te,I){return Te<=0||I.length===0&&I.ended?0:(I.state&D)!==0?1:a(Te)?I.flowing&&I.length?I.buffer.first().length:I.length:Te<=I.length?Te:I.ended?I.length:0}Re.prototype.read=function(Te){M("read",Te),Te===void 0?Te=NaN:t(Te)||(Te=s(Te,10));const I=this._readableState,ze=Te;if(Te>I.highWaterMark&&(I.highWaterMark=xt(Te)),Te!==0&&(I.state&=~Se),Te===0&&I.needReadable&&((I.highWaterMark!==0?I.length>=I.highWaterMark:I.length>0)||I.ended))return M("read: emitReadable",I.length,I.ended),I.length===0&&I.ended?vt(this):F(this),null;if(Te=de(Te,I),Te===0&&I.ended)return I.length===0&&vt(this),null;let we=(I.state&Pe)!==0;if(M("need readable",we),(I.length===0||I.length-Te<I.highWaterMark)&&(we=!0,M("length less than watermark",we)),I.ended||I.reading||I.destroyed||I.errored||!I.constructed)we=!1,M("reading, ended or constructing",we);else if(we){M("do read"),I.state|=ie|Ce,I.length===0&&(I.state|=Pe);try{this._read(I.highWaterMark)}catch(Ge){W(this,Ge)}I.state&=~Ce,I.reading||(Te=de(ze,I))}let De;return Te>0?De=Bt(Te,I):De=null,De===null?(I.needReadable=I.length<=I.highWaterMark,Te=0):(I.length-=Te,I.multiAwaitDrain?I.awaitDrainWriters.clear():I.awaitDrainWriters=null),I.length===0&&(I.ended||(I.needReadable=!0),ze!==Te&&I.ended&&vt(this)),De!==null&&!I.errorEmitted&&!I.closeEmitted&&(I.dataEmitted=!0,this.emit("data",De)),De};function J(Te,I){if(M("onEofChunk"),!I.ended){if(I.decoder){const ze=I.decoder.end();ze&&ze.length&&(I.buffer.push(ze),I.length+=I.objectMode?1:ze.length)}I.ended=!0,I.sync?F(Te):(I.needReadable=!1,I.emittedReadable=!0,ue(Te))}}function F(Te){const I=Te._readableState;M("emitReadable",I.needReadable,I.emittedReadable),I.needReadable=!1,I.emittedReadable||(M("emitReadable",I.flowing),I.emittedReadable=!0,n.nextTick(ue,Te))}function ue(Te){const I=Te._readableState;M("emitReadable_",I.destroyed,I.length,I.ended),!I.destroyed&&!I.errored&&(I.length||I.ended)&&(Te.emit("readable"),I.emittedReadable=!1),I.needReadable=!I.flowing&&!I.ended&&I.length<=I.highWaterMark,Ye(Te)}function Ae(Te,I){!I.readingMore&&I.constructed&&(I.readingMore=!0,n.nextTick(Le,Te,I))}function Le(Te,I){for(;!I.reading&&!I.ended&&(I.length<I.highWaterMark||I.flowing&&I.length===0);){const ze=I.length;if(M("maybeReadMore read 0"),Te.read(0),ze===I.length)break}I.readingMore=!1}Re.prototype._read=function(Te){throw new he("_read()")},Re.prototype.pipe=function(Te,I){const ze=this,we=this._readableState;we.pipes.length===1&&(we.multiAwaitDrain||(we.multiAwaitDrain=!0,we.awaitDrainWriters=new d(we.awaitDrainWriters?[we.awaitDrainWriters]:[]))),we.pipes.push(Te),M("pipe count=%d opts=%j",we.pipes.length,I);const Ge=(!I||I.end!==!1)&&Te!==n.stdout&&Te!==n.stderr?Ot:qt;we.endEmitted?n.nextTick(Ge):ze.once("end",Ge),Te.on("unpipe",ht);function ht(un,Nn){M("onunpipe"),un===ze&&Nn&&Nn.hasUnpiped===!1&&(Nn.hasUnpiped=!0,Ne())}function Ot(){M("onend"),Te.end()}let Tt,dn=!1;function Ne(){M("cleanup"),Te.removeListener("close",Jt),Te.removeListener("finish",It),Tt&&Te.removeListener("drain",Tt),Te.removeListener("error",wt),Te.removeListener("unpipe",ht),ze.removeListener("end",Ot),ze.removeListener("end",qt),ze.removeListener("data",bt),dn=!0,Tt&&we.awaitDrainWriters&&(!Te._writableState||Te._writableState.needDrain)&&Tt()}function ct(){dn||(we.pipes.length===1&&we.pipes[0]===Te?(M("false write response, pause",0),we.awaitDrainWriters=Te,we.multiAwaitDrain=!1):we.pipes.length>1&&we.pipes.includes(Te)&&(M("false write response, pause",we.awaitDrainWriters.size),we.awaitDrainWriters.add(Te)),ze.pause()),Tt||(Tt=Be(ze,Te),Te.on("drain",Tt))}ze.on("data",bt);function bt(un){M("ondata");const Nn=Te.write(un);M("dest.write",Nn),Nn===!1&&ct()}function wt(un){if(M("onerror",un),qt(),Te.removeListener("error",wt),Te.listenerCount("error")===0){const Nn=Te._writableState||Te._readableState;Nn&&!Nn.errorEmitted?W(Te,un):Te.emit("error",un)}}E(Te,"error",wt);function Jt(){Te.removeListener("finish",It),qt()}Te.once("close",Jt);function It(){M("onfinish"),Te.removeListener("close",Jt),qt()}Te.once("finish",It);function qt(){M("unpipe"),ze.unpipe(Te)}return Te.emit("pipe",ze),Te.writableNeedDrain===!0?ct():we.flowing||(M("pipe resume"),ze.resume()),Te};function Be(Te,I){return function(){const we=Te._readableState;we.awaitDrainWriters===I?(M("pipeOnDrain",1),we.awaitDrainWriters=null):we.multiAwaitDrain&&(M("pipeOnDrain",we.awaitDrainWriters.size),we.awaitDrainWriters.delete(I)),(!we.awaitDrainWriters||we.awaitDrainWriters.size===0)&&Te.listenerCount("data")&&Te.resume()}}Re.prototype.unpipe=function(Te){const I=this._readableState,ze={hasUnpiped:!1};if(I.pipes.length===0)return this;if(!Te){const De=I.pipes;I.pipes=[],this.pause();for(let Ge=0;Ge<De.length;Ge++)De[Ge].emit("unpipe",this,{hasUnpiped:!1});return this}const we=e(I.pipes,Te);return we===-1?this:(I.pipes.splice(we,1),I.pipes.length===0&&this.pause(),Te.emit("unpipe",this,ze),this)},Re.prototype.on=function(Te,I){const ze=x.prototype.on.call(this,Te,I),we=this._readableState;return Te==="data"?(we.readableListening=this.listenerCount("readable")>0,we.flowing!==!1&&this.resume()):Te==="readable"&&!we.endEmitted&&!we.readableListening&&(we.readableListening=we.needReadable=!0,we.flowing=!1,we.emittedReadable=!1,M("on readable",we.length,we.reading),we.length?F(this):we.reading||n.nextTick(Ie,this)),ze},Re.prototype.addListener=Re.prototype.on,Re.prototype.removeListener=function(Te,I){const ze=x.prototype.removeListener.call(this,Te,I);return Te==="readable"&&n.nextTick(dt,this),ze},Re.prototype.off=Re.prototype.removeListener,Re.prototype.removeAllListeners=function(Te){const I=x.prototype.removeAllListeners.apply(this,arguments);return(Te==="readable"||Te===void 0)&&n.nextTick(dt,this),I};function dt(Te){const I=Te._readableState;I.readableListening=Te.listenerCount("readable")>0,I.resumeScheduled&&I[j]===!1?I.flowing=!0:Te.listenerCount("data")>0?Te.resume():I.readableListening||(I.flowing=null)}function Ie(Te){M("readable nexttick read 0"),Te.read(0)}Re.prototype.resume=function(){const Te=this._readableState;return Te.flowing||(M("resume"),Te.flowing=!Te.readableListening,He(this,Te)),Te[j]=!1,this};function He(Te,I){I.resumeScheduled||(I.resumeScheduled=!0,n.nextTick(ge,Te,I))}function ge(Te,I){M("resume",I.reading),I.reading||Te.read(0),I.resumeScheduled=!1,Te.emit("resume"),Ye(Te),I.flowing&&!I.reading&&Te.read(0)}Re.prototype.pause=function(){return M("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(M("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[j]=!0,this};function Ye(Te){const I=Te._readableState;for(M("flow",I.flowing);I.flowing&&Te.read()!==null;);}Re.prototype.wrap=function(Te){let I=!1;Te.on("data",we=>{!this.push(we)&&Te.pause&&(I=!0,Te.pause())}),Te.on("end",()=>{this.push(null)}),Te.on("error",we=>{W(this,we)}),Te.on("close",()=>{this.destroy()}),Te.on("destroy",()=>{this.destroy()}),this._read=()=>{I&&Te.resume&&(I=!1,Te.resume())};const ze=o(Te);for(let we=1;we<ze.length;we++){const De=ze[we];this[De]===void 0&&typeof Te[De]=="function"&&(this[De]=Te[De].bind(Te))}return this},Re.prototype[m]=function(){return kt(this)},Re.prototype.iterator=function(Te){return Te!==void 0&&P(Te,"options"),kt(this,Te)};function kt(Te,I){typeof Te.read!="function"&&(Te=Re.wrap(Te,{objectMode:!0}));const ze=gt(Te,I);return ze.stream=Te,ze}async function*gt(Te,I){let ze=Z;function we(ht){this===Te?(ze(),ze=Z):ze=ht}Te.on("readable",we);let De;const Ge=k(Te,{writable:!1},ht=>{De=ht?se(De,ht):null,ze(),ze=Z});try{for(;;){const ht=Te.destroyed?null:Te.read();if(ht!==null)yield ht;else{if(De)throw De;if(De===null)return;await new p(we)}}}catch(ht){throw De=se(De,ht),De}finally{(De||I?.destroyOnReturn!==!1)&&(De===void 0||Te._readableState.autoDestroy)?R.destroyer(Te,null):(Te.off("readable",we),Ge())}}u(Re.prototype,{readable:{__proto__:null,get(){const Te=this._readableState;return!!Te&&Te.readable!==!1&&!Te.destroyed&&!Te.errorEmitted&&!Te.endEmitted},set(Te){this._readableState&&(this._readableState.readable=!!Te)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(Te){this._readableState&&(this._readableState.flowing=Te)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(Te){this._readableState&&(this._readableState.destroyed=Te)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),u(ke.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[j]!==!1},set(Te){this[j]=!!Te}}}),Re._fromList=Bt;function Bt(Te,I){if(I.length===0)return null;let ze;return I.objectMode?ze=I.buffer.shift():!Te||Te>=I.length?(I.decoder?ze=I.buffer.join(""):I.buffer.length===1?ze=I.buffer.first():ze=I.buffer.concat(I.length),I.buffer.clear()):ze=I.buffer.consume(Te,I.decoder),ze}function vt(Te){const I=Te._readableState;M("endReadable",I.endEmitted),I.endEmitted||(I.ended=!0,n.nextTick(wn,I,Te))}function wn(Te,I){if(M("endReadableNT",Te.endEmitted,Te.length),!Te.errored&&!Te.closeEmitted&&!Te.endEmitted&&Te.length===0){if(Te.endEmitted=!0,I.emit("end"),I.writable&&I.allowHalfOpen===!1)n.nextTick(tt,I);else if(Te.autoDestroy){const ze=I._writableState;(!ze||ze.autoDestroy&&(ze.finished||ze.writable===!1))&&I.destroy()}}}function tt(Te){Te.writable&&!Te.writableEnded&&!Te.destroyed&&Te.end()}Re.from=function(Te,I){return z(Re,Te,I)};let rt;function Er(){return rt===void 0&&(rt={}),rt}return Re.fromWeb=function(Te,I){return Er().newStreamReadableFromReadableStream(Te,I)},Re.toWeb=function(Te,I){return Er().newReadableStreamFromStreamReadable(Te,I)},Re.wrap=function(Te,I){var ze,we;return new Re({objectMode:(ze=(we=Te.readableObjectMode)!==null&&we!==void 0?we:Te.objectMode)!==null&&ze!==void 0?ze:!0,...I,destroy(De,Ge){R.destroyer(Te,De),Ge(De)}}).wrap(Te)},OE}var LE,fO;function o5(){if(fO)return LE;fO=1;const n=Df(),{ArrayPrototypeSlice:e,Error:t,FunctionPrototypeSymbolHasInstance:a,ObjectDefineProperty:s,ObjectDefineProperties:u,ObjectSetPrototypeOf:o,StringPrototypeToLowerCase:c,Symbol:p,SymbolHasInstance:d}=oa();LE=P,P.WritableState=S;const{EventEmitter:y}=Vg(),m=s5().Stream,{Buffer:v}=Ap(),b=F0(),{addAbortSignal:x}=x_(),{getHighWaterMark:E,getDefaultHighWaterMark:C}=S_(),{ERR_INVALID_ARG_TYPE:T,ERR_METHOD_NOT_IMPLEMENTED:k,ERR_MULTIPLE_CALLBACK:M,ERR_STREAM_CANNOT_PIPE:O,ERR_STREAM_DESTROYED:R,ERR_STREAM_ALREADY_FINISHED:$,ERR_STREAM_NULL_VALUES:X,ERR_STREAM_WRITE_AFTER_END:se,ERR_UNKNOWN_ENCODING:ye}=Ns().codes,{errorOrDestroy:he}=b;o(P.prototype,m.prototype),o(P,m);function te(){}const re=p("kOnFinished");function S(me,fe,_e){typeof _e!="boolean"&&(_e=fe instanceof bc()),this.objectMode=!!(me&&me.objectMode),_e&&(this.objectMode=this.objectMode||!!(me&&me.writableObjectMode)),this.highWaterMark=me?E(this,me,"writableHighWaterMark",_e):C(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const ne=!!(me&&me.decodeStrings===!1);this.decodeStrings=!ne,this.defaultEncoding=me&&me.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=W.bind(void 0,fe),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,_(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!me||me.emitClose!==!1,this.autoDestroy=!me||me.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[re]=[]}function _(me){me.buffered=[],me.bufferedIndex=0,me.allBuffers=!0,me.allNoop=!0}S.prototype.getBuffer=function(){return e(this.buffered,this.bufferedIndex)},s(S.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function P(me){const fe=this instanceof bc();if(!fe&&!a(P,this))return new P(me);this._writableState=new S(me,this,fe),me&&(typeof me.write=="function"&&(this._write=me.write),typeof me.writev=="function"&&(this._writev=me.writev),typeof me.destroy=="function"&&(this._destroy=me.destroy),typeof me.final=="function"&&(this._final=me.final),typeof me.construct=="function"&&(this._construct=me.construct),me.signal&&x(me.signal,this)),m.call(this,me),b.construct(this,()=>{const _e=this._writableState;_e.writing||ie(this,_e),Se(this,_e)})}s(P,d,{__proto__:null,value:function(me){return a(this,me)?!0:this!==P?!1:me&&me._writableState instanceof S}}),P.prototype.pipe=function(){he(this,new O)};function j(me,fe,_e,ne){const B=me._writableState;if(typeof _e=="function")ne=_e,_e=B.defaultEncoding;else{if(!_e)_e=B.defaultEncoding;else if(_e!=="buffer"&&!v.isEncoding(_e))throw new ye(_e);typeof ne!="function"&&(ne=te)}if(fe===null)throw new X;if(!B.objectMode)if(typeof fe=="string")B.decodeStrings!==!1&&(fe=v.from(fe,_e),_e="buffer");else if(fe instanceof v)_e="buffer";else if(m._isUint8Array(fe))fe=m._uint8ArrayToBuffer(fe),_e="buffer";else throw new T("chunk",["string","Buffer","Uint8Array"],fe);let H;return B.ending?H=new se:B.destroyed&&(H=new R("write")),H?(n.nextTick(ne,H),he(me,H,!0),H):(B.pendingcb++,q(me,B,fe,_e,ne))}P.prototype.write=function(me,fe,_e){return j(this,me,fe,_e)===!0},P.prototype.cork=function(){this._writableState.corked++},P.prototype.uncork=function(){const me=this._writableState;me.corked&&(me.corked--,me.writing||ie(this,me))},P.prototype.setDefaultEncoding=function(fe){if(typeof fe=="string"&&(fe=c(fe)),!v.isEncoding(fe))throw new ye(fe);return this._writableState.defaultEncoding=fe,this};function q(me,fe,_e,ne,B){const H=fe.objectMode?1:_e.length;fe.length+=H;const Q=fe.length<fe.highWaterMark;return Q||(fe.needDrain=!0),fe.writing||fe.corked||fe.errored||!fe.constructed?(fe.buffered.push({chunk:_e,encoding:ne,callback:B}),fe.allBuffers&&ne!=="buffer"&&(fe.allBuffers=!1),fe.allNoop&&B!==te&&(fe.allNoop=!1)):(fe.writelen=H,fe.writecb=B,fe.writing=!0,fe.sync=!0,me._write(_e,ne,fe.onwrite),fe.sync=!1),Q&&!fe.errored&&!fe.destroyed}function z(me,fe,_e,ne,B,H,Q){fe.writelen=ne,fe.writecb=Q,fe.writing=!0,fe.sync=!0,fe.destroyed?fe.onwrite(new R("write")):_e?me._writev(B,fe.onwrite):me._write(B,H,fe.onwrite),fe.sync=!1}function Z(me,fe,_e,ne){--fe.pendingcb,ne(_e),Y(fe),he(me,_e)}function W(me,fe){const _e=me._writableState,ne=_e.sync,B=_e.writecb;if(typeof B!="function"){he(me,new M);return}_e.writing=!1,_e.writecb=null,_e.length-=_e.writelen,_e.writelen=0,fe?(fe.stack,_e.errored||(_e.errored=fe),me._readableState&&!me._readableState.errored&&(me._readableState.errored=fe),ne?n.nextTick(Z,me,_e,fe,B):Z(me,_e,fe,B)):(_e.buffered.length>_e.bufferedIndex&&ie(me,_e),ne?_e.afterWriteTickInfo!==null&&_e.afterWriteTickInfo.cb===B?_e.afterWriteTickInfo.count++:(_e.afterWriteTickInfo={count:1,cb:B,stream:me,state:_e},n.nextTick(D,_e.afterWriteTickInfo)):N(me,_e,1,B))}function D({stream:me,state:fe,count:_e,cb:ne}){return fe.afterWriteTickInfo=null,N(me,fe,_e,ne)}function N(me,fe,_e,ne){for(!fe.ending&&!me.destroyed&&fe.length===0&&fe.needDrain&&(fe.needDrain=!1,me.emit("drain"));_e-- >0;)fe.pendingcb--,ne();fe.destroyed&&Y(fe),Se(me,fe)}function Y(me){if(me.writing)return;for(let B=me.bufferedIndex;B<me.buffered.length;++B){var fe;const{chunk:H,callback:Q}=me.buffered[B],le=me.objectMode?1:H.length;me.length-=le,Q((fe=me.errored)!==null&&fe!==void 0?fe:new R("write"))}const _e=me[re].splice(0);for(let B=0;B<_e.length;B++){var ne;_e[B]((ne=me.errored)!==null&&ne!==void 0?ne:new R("end"))}_(me)}function ie(me,fe){if(fe.corked||fe.bufferProcessing||fe.destroyed||!fe.constructed)return;const{buffered:_e,bufferedIndex:ne,objectMode:B}=fe,H=_e.length-ne;if(!H)return;let Q=ne;if(fe.bufferProcessing=!0,H>1&&me._writev){fe.pendingcb-=H-1;const le=fe.allNoop?te:Re=>{for(let Je=Q;Je<_e.length;++Je)_e[Je].callback(Re)},ke=fe.allNoop&&Q===0?_e:e(_e,Q);ke.allBuffers=fe.allBuffers,z(me,fe,!0,fe.length,ke,"",le),_(fe)}else{do{const{chunk:le,encoding:ke,callback:Re}=_e[Q];_e[Q++]=null;const Je=B?1:le.length;z(me,fe,!1,Je,le,ke,Re)}while(Q<_e.length&&!fe.writing);Q===_e.length?_(fe):Q>256?(_e.splice(0,Q),fe.bufferedIndex=0):fe.bufferedIndex=Q}fe.bufferProcessing=!1}P.prototype._write=function(me,fe,_e){if(this._writev)this._writev([{chunk:me,encoding:fe}],_e);else throw new k("_write()")},P.prototype._writev=null,P.prototype.end=function(me,fe,_e){const ne=this._writableState;typeof me=="function"?(_e=me,me=null,fe=null):typeof fe=="function"&&(_e=fe,fe=null);let B;if(me!=null){const H=j(this,me,fe);H instanceof t&&(B=H)}return ne.corked&&(ne.corked=1,this.uncork()),B||(!ne.errored&&!ne.ending?(ne.ending=!0,Se(this,ne,!0),ne.ended=!0):ne.finished?B=new $("end"):ne.destroyed&&(B=new R("end"))),typeof _e=="function"&&(B||ne.finished?n.nextTick(_e,B):ne[re].push(_e)),this};function V(me){return me.ending&&!me.destroyed&&me.constructed&&me.length===0&&!me.errored&&me.buffered.length===0&&!me.finished&&!me.writing&&!me.errorEmitted&&!me.closeEmitted}function Ce(me,fe){let _e=!1;function ne(B){if(_e){he(me,B??M());return}if(_e=!0,fe.pendingcb--,B){const H=fe[re].splice(0);for(let Q=0;Q<H.length;Q++)H[Q](B);he(me,B,fe.sync)}else V(fe)&&(fe.prefinished=!0,me.emit("prefinish"),fe.pendingcb++,n.nextTick(Ee,me,fe))}fe.sync=!0,fe.pendingcb++;try{me._final(ne)}catch(B){ne(B)}fe.sync=!1}function Pe(me,fe){!fe.prefinished&&!fe.finalCalled&&(typeof me._final=="function"&&!fe.destroyed?(fe.finalCalled=!0,Ce(me,fe)):(fe.prefinished=!0,me.emit("prefinish")))}function Se(me,fe,_e){V(fe)&&(Pe(me,fe),fe.pendingcb===0&&(_e?(fe.pendingcb++,n.nextTick((ne,B)=>{V(B)?Ee(ne,B):B.pendingcb--},me,fe)):V(fe)&&(fe.pendingcb++,Ee(me,fe))))}function Ee(me,fe){fe.pendingcb--,fe.finished=!0;const _e=fe[re].splice(0);for(let ne=0;ne<_e.length;ne++)_e[ne]();if(me.emit("finish"),fe.autoDestroy){const ne=me._readableState;(!ne||ne.autoDestroy&&(ne.endEmitted||ne.readable===!1))&&me.destroy()}}u(P.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(me){this._writableState&&(this._writableState.destroyed=me)}},writable:{__proto__:null,get(){const me=this._writableState;return!!me&&me.writable!==!1&&!me.destroyed&&!me.errored&&!me.ending&&!me.ended},set(me){this._writableState&&(this._writableState.writable=!!me)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const me=this._writableState;return me?!me.destroyed&&!me.ending&&me.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const oe=b.destroy;P.prototype.destroy=function(me,fe){const _e=this._writableState;return!_e.destroyed&&(_e.bufferedIndex<_e.buffered.length||_e[re].length)&&n.nextTick(Y,_e),oe.call(this,me,fe),this},P.prototype._undestroy=b.undestroy,P.prototype._destroy=function(me,fe){fe(me)},P.prototype[y.captureRejectionSymbol]=function(me){this.destroy(me)};let ce;function be(){return ce===void 0&&(ce={}),ce}return P.fromWeb=function(me,fe){return be().newStreamWritableFromWritableStream(me,fe)},P.toWeb=function(me){return be().newWritableStreamFromStreamWritable(me)},LE}var NE,dO;function _J(){if(dO)return NE;dO=1;const n=Df(),e=Ap(),{isReadable:t,isWritable:a,isIterable:s,isNodeStream:u,isReadableNodeStream:o,isWritableNodeStream:c,isDuplexNodeStream:p,isReadableStream:d,isWritableStream:y}=xc(),m=Uf(),{AbortError:v,codes:{ERR_INVALID_ARG_TYPE:b,ERR_INVALID_RETURN_VALUE:x}}=Ns(),{destroyer:E}=F0(),C=bc(),T=C_(),k=o5(),{createDeferredPromise:M}=is(),O=jP(),R=globalThis.Blob||e.Blob,$=typeof R<"u"?function(S){return S instanceof R}:function(S){return!1},X=globalThis.AbortController||Rg().AbortController,{FunctionPrototypeCall:se}=oa();class ye extends C{constructor(S){super(S),S?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),S?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}NE=function re(S,_){if(p(S))return S;if(o(S))return te({readable:S});if(c(S))return te({writable:S});if(u(S))return te({writable:!1,readable:!1});if(d(S))return te({readable:T.fromWeb(S)});if(y(S))return te({writable:k.fromWeb(S)});if(typeof S=="function"){const{value:j,write:q,final:z,destroy:Z}=he(S);if(s(j))return O(ye,j,{objectMode:!0,write:q,final:z,destroy:Z});const W=j?.then;if(typeof W=="function"){let D;const N=se(W,j,Y=>{if(Y!=null)throw new x("nully","body",Y)},Y=>{E(D,Y)});return D=new ye({objectMode:!0,readable:!1,write:q,final(Y){z(async()=>{try{await N,n.nextTick(Y,null)}catch(ie){n.nextTick(Y,ie)}})},destroy:Z})}throw new x("Iterable, AsyncIterable or AsyncFunction",_,j)}if($(S))return re(S.arrayBuffer());if(s(S))return O(ye,S,{objectMode:!0,writable:!1});if(d(S?.readable)&&y(S?.writable))return ye.fromWeb(S);if(typeof S?.writable=="object"||typeof S?.readable=="object"){const j=S!=null&&S.readable?o(S?.readable)?S?.readable:re(S.readable):void 0,q=S!=null&&S.writable?c(S?.writable)?S?.writable:re(S.writable):void 0;return te({readable:j,writable:q})}const P=S?.then;if(typeof P=="function"){let j;return se(P,S,q=>{q!=null&&j.push(q),j.push(null)},q=>{E(j,q)}),j=new ye({objectMode:!0,writable:!1,read(){}})}throw new b(_,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],S)};function he(re){let{promise:S,resolve:_}=M();const P=new X,j=P.signal;return{value:re((async function*(){for(;;){const z=S;S=null;const{chunk:Z,done:W,cb:D}=await z;if(n.nextTick(D),W)return;if(j.aborted)throw new v(void 0,{cause:j.reason});({promise:S,resolve:_}=M()),yield Z}})(),{signal:j}),write(z,Z,W){const D=_;_=null,D({chunk:z,done:!1,cb:W})},final(z){const Z=_;_=null,Z({done:!0,cb:z})},destroy(z,Z){P.abort(),Z(z)}}}function te(re){const S=re.readable&&typeof re.readable.read!="function"?T.wrap(re.readable):re.readable,_=re.writable;let P=!!t(S),j=!!a(_),q,z,Z,W,D;function N(Y){const ie=W;W=null,ie?ie(Y):Y&&D.destroy(Y)}return D=new ye({readableObjectMode:!!(S!=null&&S.readableObjectMode),writableObjectMode:!!(_!=null&&_.writableObjectMode),readable:P,writable:j}),j&&(m(_,Y=>{j=!1,Y&&E(S,Y),N(Y)}),D._write=function(Y,ie,V){_.write(Y,ie)?V():q=V},D._final=function(Y){_.end(),z=Y},_.on("drain",function(){if(q){const Y=q;q=null,Y()}}),_.on("finish",function(){if(z){const Y=z;z=null,Y()}})),P&&(m(S,Y=>{P=!1,Y&&E(S,Y),N(Y)}),S.on("readable",function(){if(Z){const Y=Z;Z=null,Y()}}),S.on("end",function(){D.push(null)}),D._read=function(){for(;;){const Y=S.read();if(Y===null){Z=D._read;return}if(!D.push(Y))return}}),D._destroy=function(Y,ie){!Y&&W!==null&&(Y=new v),Z=null,q=null,z=null,W===null?ie(Y):(W=ie,E(_,Y),E(S,Y))},D}return NE}var PE,pO;function bc(){if(pO)return PE;pO=1;const{ObjectDefineProperties:n,ObjectGetOwnPropertyDescriptor:e,ObjectKeys:t,ObjectSetPrototypeOf:a}=oa();PE=o;const s=C_(),u=o5();a(o.prototype,s.prototype),a(o,s);{const y=t(u.prototype);for(let m=0;m<y.length;m++){const v=y[m];o.prototype[v]||(o.prototype[v]=u.prototype[v])}}function o(y){if(!(this instanceof o))return new o(y);s.call(this,y),u.call(this,y),y?(this.allowHalfOpen=y.allowHalfOpen!==!1,y.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),y.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}n(o.prototype,{writable:{__proto__:null,...e(u.prototype,"writable")},writableHighWaterMark:{__proto__:null,...e(u.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...e(u.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...e(u.prototype,"writableBuffer")},writableLength:{__proto__:null,...e(u.prototype,"writableLength")},writableFinished:{__proto__:null,...e(u.prototype,"writableFinished")},writableCorked:{__proto__:null,...e(u.prototype,"writableCorked")},writableEnded:{__proto__:null,...e(u.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...e(u.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(y){this._readableState&&this._writableState&&(this._readableState.destroyed=y,this._writableState.destroyed=y)}}});let c;function p(){return c===void 0&&(c={}),c}o.fromWeb=function(y,m){return p().newStreamDuplexFromReadableWritablePair(y,m)},o.toWeb=function(y){return p().newReadableWritablePairFromDuplex(y)};let d;return o.from=function(y){return d||(d=_J()),d(y,"body")},PE}var IE,hO;function qP(){if(hO)return IE;hO=1;const{ObjectSetPrototypeOf:n,Symbol:e}=oa();IE=o;const{ERR_METHOD_NOT_IMPLEMENTED:t}=Ns().codes,a=bc(),{getHighWaterMark:s}=S_();n(o.prototype,a.prototype),n(o,a);const u=e("kCallback");function o(d){if(!(this instanceof o))return new o(d);const y=d?s(this,d,"readableHighWaterMark",!0):null;y===0&&(d={...d,highWaterMark:null,readableHighWaterMark:y,writableHighWaterMark:d.writableHighWaterMark||0}),a.call(this,d),this._readableState.sync=!1,this[u]=null,d&&(typeof d.transform=="function"&&(this._transform=d.transform),typeof d.flush=="function"&&(this._flush=d.flush)),this.on("prefinish",p)}function c(d){typeof this._flush=="function"&&!this.destroyed?this._flush((y,m)=>{if(y){d?d(y):this.destroy(y);return}m!=null&&this.push(m),this.push(null),d&&d()}):(this.push(null),d&&d())}function p(){this._final!==c&&c.call(this)}return o.prototype._final=c,o.prototype._transform=function(d,y,m){throw new t("_transform()")},o.prototype._write=function(d,y,m){const v=this._readableState,b=this._writableState,x=v.length;this._transform(d,y,(E,C)=>{if(E){m(E);return}C!=null&&this.push(C),b.ended||x===v.length||v.length<v.highWaterMark?m():this[u]=m})},o.prototype._read=function(){if(this[u]){const d=this[u];this[u]=null,d()}},IE}var DE,yO;function HP(){if(yO)return DE;yO=1;const{ObjectSetPrototypeOf:n}=oa();DE=t;const e=qP();n(t.prototype,e.prototype),n(t,e);function t(a){if(!(this instanceof t))return new t(a);e.call(this,a)}return t.prototype._transform=function(a,s,u){u(null,a)},DE}var UE,mO;function u5(){if(mO)return UE;mO=1;const n=Df(),{ArrayIsArray:e,Promise:t,SymbolAsyncIterator:a,SymbolDispose:s}=oa(),u=Uf(),{once:o}=is(),c=F0(),p=bc(),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:y,ERR_INVALID_RETURN_VALUE:m,ERR_MISSING_ARGS:v,ERR_STREAM_DESTROYED:b,ERR_STREAM_PREMATURE_CLOSE:x},AbortError:E}=Ns(),{validateFunction:C,validateAbortSignal:T}=Gg(),{isIterable:k,isReadable:M,isReadableNodeStream:O,isNodeStream:R,isTransformStream:$,isWebStream:X,isReadableStream:se,isReadableFinished:ye}=xc(),he=globalThis.AbortController||Rg().AbortController;let te,re,S;function _(Y,ie,V){let Ce=!1;Y.on("close",()=>{Ce=!0});const Pe=u(Y,{readable:ie,writable:V},Se=>{Ce=!Se});return{destroy:Se=>{Ce||(Ce=!0,c.destroyer(Y,Se||new b("pipe")))},cleanup:Pe}}function P(Y){return C(Y[Y.length-1],"streams[stream.length - 1]"),Y.pop()}function j(Y){if(k(Y))return Y;if(O(Y))return q(Y);throw new y("val",["Readable","Iterable","AsyncIterable"],Y)}async function*q(Y){re||(re=C_()),yield*re.prototype[a].call(Y)}async function z(Y,ie,V,{end:Ce}){let Pe,Se=null;const Ee=be=>{if(be&&(Pe=be),Se){const me=Se;Se=null,me()}},oe=()=>new t((be,me)=>{Pe?me(Pe):Se=()=>{Pe?me(Pe):be()}});ie.on("drain",Ee);const ce=u(ie,{readable:!1},Ee);try{ie.writableNeedDrain&&await oe();for await(const be of Y)ie.write(be)||await oe();Ce&&(ie.end(),await oe()),V()}catch(be){V(Pe!==be?d(Pe,be):be)}finally{ce(),ie.off("drain",Ee)}}async function Z(Y,ie,V,{end:Ce}){$(ie)&&(ie=ie.writable);const Pe=ie.getWriter();try{for await(const Se of Y)await Pe.ready,Pe.write(Se).catch(()=>{});await Pe.ready,Ce&&await Pe.close(),V()}catch(Se){try{await Pe.abort(Se),V(Se)}catch(Ee){V(Ee)}}}function W(...Y){return D(Y,o(P(Y)))}function D(Y,ie,V){if(Y.length===1&&e(Y[0])&&(Y=Y[0]),Y.length<2)throw new v("streams");const Ce=new he,Pe=Ce.signal,Se=V?.signal,Ee=[];T(Se,"options.signal");function oe(){B(new E)}S=S||is().addAbortListener;let ce;Se&&(ce=S(Se,oe));let be,me;const fe=[];let _e=0;function ne(ke){B(ke,--_e===0)}function B(ke,Re){var Je;if(ke&&(!be||be.code==="ERR_STREAM_PREMATURE_CLOSE")&&(be=ke),!(!be&&!Re)){for(;fe.length;)fe.shift()(be);(Je=ce)===null||Je===void 0||Je[s](),Ce.abort(),Re&&(be||Ee.forEach(lt=>lt()),n.nextTick(ie,be,me))}}let H;for(let ke=0;ke<Y.length;ke++){const Re=Y[ke],Je=ke<Y.length-1,lt=ke>0,et=Je||V?.end!==!1,xt=ke===Y.length-1;if(R(Re)){let de=function(J){J&&J.name!=="AbortError"&&J.code!=="ERR_STREAM_PREMATURE_CLOSE"&&ne(J)};if(et){const{destroy:J,cleanup:F}=_(Re,Je,lt);fe.push(J),M(Re)&&xt&&Ee.push(F)}Re.on("error",de),M(Re)&&xt&&Ee.push(()=>{Re.removeListener("error",de)})}if(ke===0)if(typeof Re=="function"){if(H=Re({signal:Pe}),!k(H))throw new m("Iterable, AsyncIterable or Stream","source",H)}else k(Re)||O(Re)||$(Re)?H=Re:H=p.from(Re);else if(typeof Re=="function"){if($(H)){var Q;H=j((Q=H)===null||Q===void 0?void 0:Q.readable)}else H=j(H);if(H=Re(H,{signal:Pe}),Je){if(!k(H,!0))throw new m("AsyncIterable",`transform[${ke-1}]`,H)}else{var le;te||(te=HP());const de=new te({objectMode:!0}),J=(le=H)===null||le===void 0?void 0:le.then;if(typeof J=="function")_e++,J.call(H,Ae=>{me=Ae,Ae!=null&&de.write(Ae),et&&de.end(),n.nextTick(ne)},Ae=>{de.destroy(Ae),n.nextTick(ne,Ae)});else if(k(H,!0))_e++,z(H,de,ne,{end:et});else if(se(H)||$(H)){const Ae=H.readable||H;_e++,z(Ae,de,ne,{end:et})}else throw new m("AsyncIterable or Promise","destination",H);H=de;const{destroy:F,cleanup:ue}=_(H,!1,!0);fe.push(F),xt&&Ee.push(ue)}}else if(R(Re)){if(O(H)){_e+=2;const de=N(H,Re,ne,{end:et});M(Re)&&xt&&Ee.push(de)}else if($(H)||se(H)){const de=H.readable||H;_e++,z(de,Re,ne,{end:et})}else if(k(H))_e++,z(H,Re,ne,{end:et});else throw new y("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],H);H=Re}else if(X(Re)){if(O(H))_e++,Z(j(H),Re,ne,{end:et});else if(se(H)||k(H))_e++,Z(H,Re,ne,{end:et});else if($(H))_e++,Z(H.readable,Re,ne,{end:et});else throw new y("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],H);H=Re}else H=p.from(Re)}return(Pe!=null&&Pe.aborted||Se!=null&&Se.aborted)&&n.nextTick(oe),H}function N(Y,ie,V,{end:Ce}){let Pe=!1;if(ie.on("close",()=>{Pe||V(new x)}),Y.pipe(ie,{end:!1}),Ce){let Se=function(){Pe=!0,ie.end()};ye(Y)?n.nextTick(Se):Y.once("end",Se)}else V();return u(Y,{readable:!0,writable:!1},Se=>{const Ee=Y._readableState;Se&&Se.code==="ERR_STREAM_PREMATURE_CLOSE"&&Ee&&Ee.ended&&!Ee.errored&&!Ee.errorEmitted?Y.once("end",V).once("error",V):V(Se)}),u(ie,{readable:!1,writable:!0},V)}return UE={pipelineImpl:D,pipeline:W},UE}var FE,gO;function VP(){if(gO)return FE;gO=1;const{pipeline:n}=u5(),e=bc(),{destroyer:t}=F0(),{isNodeStream:a,isReadable:s,isWritable:u,isWebStream:o,isTransformStream:c,isWritableStream:p,isReadableStream:d}=xc(),{AbortError:y,codes:{ERR_INVALID_ARG_VALUE:m,ERR_MISSING_ARGS:v}}=Ns(),b=Uf();return FE=function(...E){if(E.length===0)throw new v("streams");if(E.length===1)return e.from(E[0]);const C=[...E];if(typeof E[0]=="function"&&(E[0]=e.from(E[0])),typeof E[E.length-1]=="function"){const te=E.length-1;E[te]=e.from(E[te])}for(let te=0;te<E.length;++te)if(!(!a(E[te])&&!o(E[te]))){if(te<E.length-1&&!(s(E[te])||d(E[te])||c(E[te])))throw new m(`streams[${te}]`,C[te],"must be readable");if(te>0&&!(u(E[te])||p(E[te])||c(E[te])))throw new m(`streams[${te}]`,C[te],"must be writable")}let T,k,M,O,R;function $(te){const re=O;O=null,re?re(te):te?R.destroy(te):!he&&!ye&&R.destroy()}const X=E[0],se=n(E,$),ye=!!(u(X)||p(X)||c(X)),he=!!(s(se)||d(se)||c(se));if(R=new e({writableObjectMode:!!(X!=null&&X.writableObjectMode),readableObjectMode:!!(se!=null&&se.readableObjectMode),writable:ye,readable:he}),ye){if(a(X))R._write=function(re,S,_){X.write(re,S)?_():T=_},R._final=function(re){X.end(),k=re},X.on("drain",function(){if(T){const re=T;T=null,re()}});else if(o(X)){const S=(c(X)?X.writable:X).getWriter();R._write=async function(_,P,j){try{await S.ready,S.write(_).catch(()=>{}),j()}catch(q){j(q)}},R._final=async function(_){try{await S.ready,S.close().catch(()=>{}),k=_}catch(P){_(P)}}}const te=c(se)?se.readable:se;b(te,()=>{if(k){const re=k;k=null,re()}})}if(he){if(a(se))se.on("readable",function(){if(M){const te=M;M=null,te()}}),se.on("end",function(){R.push(null)}),R._read=function(){for(;;){const te=se.read();if(te===null){M=R._read;return}if(!R.push(te))return}};else if(o(se)){const re=(c(se)?se.readable:se).getReader();R._read=async function(){for(;;)try{const{value:S,done:_}=await re.read();if(!R.push(S))return;if(_){R.push(null);return}}catch{return}}}}return R._destroy=function(te,re){!te&&O!==null&&(te=new y),M=null,T=null,k=null,O===null?re(te):(O=re,a(se)&&t(se,te))},R},FE}var vO;function xJ(){if(vO)return dw;vO=1;const n=globalThis.AbortController||Rg().AbortController,{codes:{ERR_INVALID_ARG_VALUE:e,ERR_INVALID_ARG_TYPE:t,ERR_MISSING_ARGS:a,ERR_OUT_OF_RANGE:s},AbortError:u}=Ns(),{validateAbortSignal:o,validateInteger:c,validateObject:p}=Gg(),d=oa().Symbol("kWeak"),y=oa().Symbol("kResistStopPropagation"),{finished:m}=Uf(),v=VP(),{addAbortSignalNoValidate:b}=x_(),{isWritable:x,isNodeStream:E}=xc(),{deprecate:C}=is(),{ArrayPrototypePush:T,Boolean:k,MathFloor:M,Number:O,NumberIsNaN:R,Promise:$,PromiseReject:X,PromiseResolve:se,PromisePrototypeThen:ye,Symbol:he}=oa(),te=he("kEmpty"),re=he("kEof");function S(Se,Ee){if(Ee!=null&&p(Ee,"options"),Ee?.signal!=null&&o(Ee.signal,"options.signal"),E(Se)&&!x(Se))throw new e("stream",Se,"must be writable");const oe=v(this,Se);return Ee!=null&&Ee.signal&&b(Ee.signal,oe),oe}function _(Se,Ee){if(typeof Se!="function")throw new t("fn",["Function","AsyncFunction"],Se);Ee!=null&&p(Ee,"options"),Ee?.signal!=null&&o(Ee.signal,"options.signal");let oe=1;Ee?.concurrency!=null&&(oe=M(Ee.concurrency));let ce=oe-1;return Ee?.highWaterMark!=null&&(ce=M(Ee.highWaterMark)),c(oe,"options.concurrency",1),c(ce,"options.highWaterMark",0),ce+=oe,(async function*(){const me=is().AbortSignalAny([Ee?.signal].filter(k)),fe=this,_e=[],ne={signal:me};let B,H,Q=!1,le=0;function ke(){Q=!0,Re()}function Re(){le-=1,Je()}function Je(){H&&!Q&&le<oe&&_e.length<ce&&(H(),H=null)}async function lt(){try{for await(let et of fe){if(Q)return;if(me.aborted)throw new u;try{if(et=Se(et,ne),et===te)continue;et=se(et)}catch(xt){et=X(xt)}le+=1,ye(et,Re,ke),_e.push(et),B&&(B(),B=null),!Q&&(_e.length>=ce||le>=oe)&&await new $(xt=>{H=xt})}_e.push(re)}catch(et){const xt=X(et);ye(xt,Re,ke),_e.push(xt)}finally{Q=!0,B&&(B(),B=null)}}lt();try{for(;;){for(;_e.length>0;){const et=await _e[0];if(et===re)return;if(me.aborted)throw new u;et!==te&&(yield et),_e.shift(),Je()}await new $(et=>{B=et})}}finally{Q=!0,H&&(H(),H=null)}}).call(this)}function P(Se=void 0){return Se!=null&&p(Se,"options"),Se?.signal!=null&&o(Se.signal,"options.signal"),(async function*(){let oe=0;for await(const be of this){var ce;if(Se!=null&&(ce=Se.signal)!==null&&ce!==void 0&&ce.aborted)throw new u({cause:Se.signal.reason});yield[oe++,be]}}).call(this)}async function j(Se,Ee=void 0){for await(const oe of W.call(this,Se,Ee))return!0;return!1}async function q(Se,Ee=void 0){if(typeof Se!="function")throw new t("fn",["Function","AsyncFunction"],Se);return!await j.call(this,async(...oe)=>!await Se(...oe),Ee)}async function z(Se,Ee){for await(const oe of W.call(this,Se,Ee))return oe}async function Z(Se,Ee){if(typeof Se!="function")throw new t("fn",["Function","AsyncFunction"],Se);async function oe(ce,be){return await Se(ce,be),te}for await(const ce of _.call(this,oe,Ee));}function W(Se,Ee){if(typeof Se!="function")throw new t("fn",["Function","AsyncFunction"],Se);async function oe(ce,be){return await Se(ce,be)?ce:te}return _.call(this,oe,Ee)}class D extends a{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function N(Se,Ee,oe){var ce;if(typeof Se!="function")throw new t("reducer",["Function","AsyncFunction"],Se);oe!=null&&p(oe,"options"),oe?.signal!=null&&o(oe.signal,"options.signal");let be=arguments.length>1;if(oe!=null&&(ce=oe.signal)!==null&&ce!==void 0&&ce.aborted){const B=new u(void 0,{cause:oe.signal.reason});throw this.once("error",()=>{}),await m(this.destroy(B)),B}const me=new n,fe=me.signal;if(oe!=null&&oe.signal){const B={once:!0,[d]:this,[y]:!0};oe.signal.addEventListener("abort",()=>me.abort(),B)}let _e=!1;try{for await(const B of this){var ne;if(_e=!0,oe!=null&&(ne=oe.signal)!==null&&ne!==void 0&&ne.aborted)throw new u;be?Ee=await Se(Ee,B,{signal:fe}):(Ee=B,be=!0)}if(!_e&&!be)throw new D}finally{me.abort()}return Ee}async function Y(Se){Se!=null&&p(Se,"options"),Se?.signal!=null&&o(Se.signal,"options.signal");const Ee=[];for await(const ce of this){var oe;if(Se!=null&&(oe=Se.signal)!==null&&oe!==void 0&&oe.aborted)throw new u(void 0,{cause:Se.signal.reason});T(Ee,ce)}return Ee}function ie(Se,Ee){const oe=_.call(this,Se,Ee);return(async function*(){for await(const be of oe)yield*be}).call(this)}function V(Se){if(Se=O(Se),R(Se))return 0;if(Se<0)throw new s("number",">= 0",Se);return Se}function Ce(Se,Ee=void 0){return Ee!=null&&p(Ee,"options"),Ee?.signal!=null&&o(Ee.signal,"options.signal"),Se=V(Se),(async function*(){var ce;if(Ee!=null&&(ce=Ee.signal)!==null&&ce!==void 0&&ce.aborted)throw new u;for await(const me of this){var be;if(Ee!=null&&(be=Ee.signal)!==null&&be!==void 0&&be.aborted)throw new u;Se--<=0&&(yield me)}}).call(this)}function Pe(Se,Ee=void 0){return Ee!=null&&p(Ee,"options"),Ee?.signal!=null&&o(Ee.signal,"options.signal"),Se=V(Se),(async function*(){var ce;if(Ee!=null&&(ce=Ee.signal)!==null&&ce!==void 0&&ce.aborted)throw new u;for await(const me of this){var be;if(Ee!=null&&(be=Ee.signal)!==null&&be!==void 0&&be.aborted)throw new u;if(Se-- >0&&(yield me),Se<=0)return}}).call(this)}return dw.streamReturningOperators={asIndexedPairs:C(P,"readable.asIndexedPairs will be removed in a future version."),drop:Ce,filter:W,flatMap:ie,map:_,take:Pe,compose:S},dw.promiseReturningOperators={every:q,forEach:Z,reduce:N,toArray:Y,some:j,find:z},dw}var BE,bO;function GP(){if(bO)return BE;bO=1;const{ArrayPrototypePop:n,Promise:e}=oa(),{isIterable:t,isNodeStream:a,isWebStream:s}=xc(),{pipelineImpl:u}=u5(),{finished:o}=Uf();$P();function c(...p){return new e((d,y)=>{let m,v;const b=p[p.length-1];if(b&&typeof b=="object"&&!a(b)&&!t(b)&&!s(b)){const x=n(p);m=x.signal,v=x.end}u(p,(x,E)=>{x?y(x):d(E)},{signal:m,end:v})})}return BE={finished:o,pipeline:c},BE}var wO;function $P(){if(wO)return mE.exports;wO=1;const{Buffer:n}=Ap(),{ObjectDefineProperty:e,ObjectKeys:t,ReflectApply:a}=oa(),{promisify:{custom:s}}=is(),{streamReturningOperators:u,promiseReturningOperators:o}=xJ(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:c}}=Ns(),p=VP(),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:y}=S_(),{pipeline:m}=u5(),{destroyer:v}=F0(),b=Uf(),x=GP(),E=xc(),C=mE.exports=s5().Stream;C.isDestroyed=E.isDestroyed,C.isDisturbed=E.isDisturbed,C.isErrored=E.isErrored,C.isReadable=E.isReadable,C.isWritable=E.isWritable,C.Readable=C_();for(const k of t(u)){let O=function(...R){if(new.target)throw c();return C.Readable.from(a(M,this,R))};const M=u[k];e(O,"name",{__proto__:null,value:M.name}),e(O,"length",{__proto__:null,value:M.length}),e(C.Readable.prototype,k,{__proto__:null,value:O,enumerable:!1,configurable:!0,writable:!0})}for(const k of t(o)){let O=function(...R){if(new.target)throw c();return a(M,this,R)};const M=o[k];e(O,"name",{__proto__:null,value:M.name}),e(O,"length",{__proto__:null,value:M.length}),e(C.Readable.prototype,k,{__proto__:null,value:O,enumerable:!1,configurable:!0,writable:!0})}C.Writable=o5(),C.Duplex=bc(),C.Transform=qP(),C.PassThrough=HP(),C.pipeline=m;const{addAbortSignal:T}=x_();return C.addAbortSignal=T,C.finished=b,C.destroy=v,C.compose=p,C.setDefaultHighWaterMark=d,C.getDefaultHighWaterMark=y,e(C,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return x}}),e(m,s,{__proto__:null,enumerable:!0,get(){return x.pipeline}}),e(b,s,{__proto__:null,enumerable:!0,get(){return x.finished}}),C.Stream=C,C._isUint8Array=function(M){return M instanceof Uint8Array},C._uint8ArrayToBuffer=function(M){return n.from(M.buffer,M.byteOffset,M.byteLength)},mE.exports}var _O;function SJ(){return _O||(_O=1,(function(n){const e=$P(),t=GP(),a=e.Readable.destroy;n.exports=e.Readable,n.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,n.exports._isUint8Array=e._isUint8Array,n.exports.isDisturbed=e.isDisturbed,n.exports.isErrored=e.isErrored,n.exports.isReadable=e.isReadable,n.exports.Readable=e.Readable,n.exports.Writable=e.Writable,n.exports.Duplex=e.Duplex,n.exports.Transform=e.Transform,n.exports.PassThrough=e.PassThrough,n.exports.addAbortSignal=e.addAbortSignal,n.exports.finished=e.finished,n.exports.destroy=e.destroy,n.exports.destroy=a,n.exports.pipeline=e.pipeline,n.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get(){return t}}),n.exports.Stream=e.Stream,n.exports.default=n.exports})(yE)),yE.exports}var zE,xO;function WP(){if(xO)return zE;xO=1,typeof globalThis.Buffer>"u"&&(globalThis.Buffer=Pg().Buffer);const n=lP(),e=SJ(),t=gi();if(globalThis.process||(globalThis.process=Df()),typeof crypto>"u"){const s=n_;s.getRandomValues=u=>s.randomBytes(u.length),globalThis.crypto=s}const a={ElvCrypto:async()=>{try{if(!a.elvCrypto){const s=(await Promise.resolve().then(()=>require("./index-GolQhNCt.js"))).default;a.elvCrypto=await new s().init()}return a.elvCrypto}catch(s){console.error("Error initializing ElvCrypto:"),console.error(s)}},EncryptedSize:s=>{const o=Math.floor(s/1e6);let c=a.EncryptedBlockSize(1e6),p=o*c;return s%1e6!==0&&(p+=a.EncryptedBlockSize(s%1e6)),p},EncryptedBlockSize:(s,u=!1)=>{let m=Math.floor(s/564)*576;return s%564!==0&&(m+=576),u?m+608:m+129},async EncryptConk(s,u){const o=await a.ElvCrypto();u=new Uint8Array(Buffer.from(u.replace("0x",""),"hex")),s=new Uint8Array(Buffer.from(JSON.stringify(s)));const{data:c,ephemeralKey:p,tag:d}=await o.encryptECIES(s,u),y=Buffer.concat([Buffer.from(p),Buffer.from(d),Buffer.from(c)]);return t.B64(y)},async DecryptCap(s,u){const o=await a.ElvCrypto();u=new Uint8Array(Buffer.from(u.replace("0x",""),"hex")),s=Buffer.from(s,"base64");const c=s.slice(0,65),p=s.slice(65,81),d=s.slice(81),y=o.decryptECIES(new Uint8Array(d),u,new Uint8Array(c),new Uint8Array(p));return JSON.parse(Buffer.from(y).toString())},async GeneratePrimaryConk({spaceId:s,objectId:u}){const o=await a.ElvCrypto(),{secretKey:c,publicKey:p}=o.generatePrimaryKeys(),d=o.generateSymmetricKey().key;return{symm_key:`kpsy${n.encode(Buffer.from(d))}`,secret_key:`kpsk${n.encode(Buffer.from(c))}`,public_key:`kppk${n.encode(Buffer.from(p))}`,sid:s,qid:u}},async GenerateTargetConk(){const s=await a.ElvCrypto(),{secretKey:u,publicKey:o}=s.generateTargetKeys();return{secret_key:`kpsk${n.encode(Buffer.from(u))}`,public_key:`ktpk${n.encode(Buffer.from(o))}`}},CapToConk(s){const u=o=>new Uint8Array(n.decode(o.slice(4)));return{symmetricKey:u(s.symm_key),secretKey:u(s.secret_key),publicKey:u(s.public_key)}},async EncryptionContext(s){const u=await a.ElvCrypto(),{symmetricKey:o,secretKey:c,publicKey:p}=a.CapToConk(s);let d,y;return p.length===u.PRIMARY_PK_KEY_SIZE?(y=u.CRYPTO_TYPE_PRIMARY,d=u.newPrimaryContext(p,c,o)):(y=u.CRYPTO_TYPE_TARGET,d=u.newTargetDecryptionContext(c,o)),{context:d,type:y}},Encrypt:async(s,u)=>{const o=await a.OpenEncryptionStream(s);!Buffer.isBuffer(u)&&!(u instanceof ArrayBuffer)&&(u=Buffer.from(await new Response(u).arrayBuffer()));const c=new Uint8Array(u);for(let d=0;d<c.length;d+=1e6){const y=Math.min(c.length,d+1e6);o.write(c.slice(d,y))}o.end();let p=[];return await new Promise((d,y)=>{o.on("data",m=>{p.push(m)}).on("finish",()=>{d()}).on("error",m=>{y(m)})}),Buffer.concat(p)},OpenEncryptionStream:async s=>{const u=await a.ElvCrypto(),{context:o}=await a.EncryptionContext(s),c=new e.PassThrough,p=u.createCipher(o);return c.pipe(p).on("finish",()=>{o.free()}).on("error",d=>{throw Error(d)})},Decrypt:async(s,u)=>{const o=await a.OpenDecryptionStream(s),c=new Uint8Array(u);for(let d=0;d<c.length;d+=1e6){const y=Math.min(c.length,d+1e6);o.write(c.slice(d,y))}o.end();let p=[];return await new Promise((d,y)=>{o.on("data",m=>{p.push(m)}).on("finish",()=>{d()}).on("error",m=>{y(m)})}),Buffer.concat(p)},OpenDecryptionStream:async s=>{const u=await a.ElvCrypto(),{context:o,type:c}=await a.EncryptionContext(s),p=new e.PassThrough,d=u.createDecipher(c,o);return p.pipe(d).on("finish",()=>{o.free()}).on("error",y=>{throw Error(y)})}};return zE=a,zE}var zr={},SO;function KP(){if(SO)return zr;SO=1;const n=gi();let e;n.Platform()===n.PLATFORM_NODE&&(globalThis.Response=ZA().Response,e=n_);const t=vi(),{ValidatePresence:a,ValidateWriteToken:s,ValidatePartHash:u,ValidateParameters:o}=Cu();return zr.ListFiles=async function({libraryId:c,objectId:p,path:d="",versionHash:y,writeToken:m}){o({libraryId:c,objectId:p,versionHash:y,writeToken:m}),y&&(p=this.utils.DecodeVersionHash(y).objectId);let v=t("q",m||y||p,"files_list",d);return this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,versionHash:y}),method:"GET",path:v})},zr.UploadFilesFromS3=async function({libraryId:c,objectId:p,writeToken:d,region:y,bucket:m,fileInfo:v,accessKey:b,secret:x,signedUrl:E,encryption:C="none",copy:T=!1,callback:k}){o({libraryId:c,objectId:p}),s(d);const M=/^s3:\/\/([^/]+)\//i;for(let ye=0;ye<v.length;ye++){const he=v[ye].source,te=M.exec(he);if(te){if(te[1]!==m)throw Error('Full S3 file path "'+he+`" specified, but does not match provided bucket name '`+m+"'");v[ye].source=he.replace(M,"")}}T?this.Log(`Copying files from S3: ${c} ${p} ${d}`):this.Log(`Adding links to files in S3: ${c} ${p} ${d}`);let O;if(C==="cgck"){let ye=await this.EncryptionConk({libraryId:c,objectId:p,writeToken:d});ye={...ye,secret_key:""},O=`kp__${this.utils.B58(Buffer.from(JSON.stringify(ye)))}`}let R={access_key_id:b,secret_access_key:x};E&&(R={signed_url:E});const $={encryption_key:O,access:{protocol:"s3",platform:"aws",path:m,storage_endpoint:{region:y},cloud_credentials:R}},X=v.map(ye=>T?{op:"ingest-copy",path:ye.path,encryption:{scheme:C==="cgck"?"cgck":"none"},ingest:{type:"key",path:ye.source}}:{op:"add-reference",path:ye.path,reference:{type:"key",path:ye.source}}),{id:se}=await this.CreateFileUploadJob({libraryId:c,objectId:p,writeToken:d,ops:X,defaults:$});for(;;){await new Promise(te=>setTimeout(te,1e3));const ye=await this.UploadStatus({libraryId:c,objectId:p,writeToken:d,uploadId:se});if(ye.errors&&ye.errors.length>1)throw ye.errors.join(`
|
|
328
328
|
`);if(ye.error)throw this.Log(`S3 file upload failed:
|
|
329
329
|
${JSON.stringify(ye,null,2)}`),ye.error;if(ye.status.toLowerCase()==="failed")throw"File upload failed";let he=!1;if(T){if(he=ye.ingest_copy.done,k){const te=ye.ingest_copy.progress;k({done:he,uploaded:te.bytes.completed,total:te.bytes.total,uploadedFiles:te.files.completed,totalFiles:te.files.total,fileStatus:te.files.details})}}else if(he=ye.add_reference.done,k){const te=ye.add_reference.progress;k({done:he,uploadedFiles:te.completed,totalFiles:te.total})}if(he)break}},zr.UploadFiles=async function({libraryId:c,objectId:p,writeToken:d,fileInfo:y,encryption:m="none",callback:v}){o({libraryId:c,objectId:p}),s(d),a("fileInfo",y),this.Log(`Uploading files: ${c} ${p} ${d}`);let b;m==="cgck"&&(b=await this.EncryptionConk({libraryId:c,objectId:p,writeToken:d}));let x={},E={},C=y;y=[];for(let S=0;S<C.length;S++){let _={...C[S],data:void 0};_.path=_.path.replace(/^\/+/,""),m==="cgck"&&(_.encryption={scheme:"cgck"}),E[_.path]=C[S].data,_.type="file",x[_.path]={uploaded:0,total:_.size},y.push(_)}this.Log(y),v&&v(x);const{id:T,jobs:k}=await this.CreateFileUploadJob({libraryId:c,objectId:p,writeToken:d,ops:y,encryption:m});this.Log(`Upload ID: ${T}`),this.Log(k);const M=500*1024*1024;let O=[],R=0,$=0;const X=async()=>{for(let S=0;S<k.length;S++){for(;R-$>M;)await new Promise(j=>setTimeout(j,500));const _=k[S];let P=await this.UploadJobStatus({libraryId:c,objectId:p,writeToken:d,uploadId:T,jobId:_});for(let j=0;j<P.files.length;j++){const q=P.files[j];let z;typeof E[q.path]=="number"?(z=Buffer.alloc(q.len),e.readSync(E[q.path],z,0,q.len,q.off)):z=E[q.path].slice(q.off,q.off+q.len),m==="cgck"&&(z=await this.Crypto.Encrypt(b,z)),P.files[j].data=z,R+=q.len}O[S]=P,await new Promise(j=>setTimeout(j,50))}},se=async(S,_)=>{for(;!O[_];)await new Promise(q=>setTimeout(q,500));const j=O[_].files;for(let q=0;q<j.length;q++){const z=j[q];let Z=0,W=!1;do try{await this.UploadFileData({libraryId:c,objectId:p,writeToken:d,uploadId:T,jobId:S,filePath:z.path,fileData:z.data,encryption:m}),W=!0}catch(D){if(this.Log(D,!0),Z+=1,Z>=10)throw D;await new Promise(N=>setTimeout(N,10*Z*1e3))}while(!W&&Z<10);delete O[_].files[q].data,$+=z.len,v&&(x[z.path]={...x[z.path],uploaded:x[z.path].uploaded+z.len},v(x))}};X().catch(S=>{throw S});const ye=Math.min(3,k.length);let he=[];for(let S=0;S<ye;S++){const _=new Date().getTime();await se(k[S],S);const P=(new Date().getTime()-_)/1e3,j=O[S].files.map(q=>q.len).reduce((q,z)=>q+z,0);he.push(j/P/(1024*1024))}const te=he.reduce((S,_)=>S+_,0)/ye,re=Math.min(5,Math.ceil(te/2));await this.utils.LimitedMap(re,k,async(S,_)=>{_<ye||await se(S,_)})},zr.CreateFileUploadJob=async function({libraryId:c,objectId:p,writeToken:d,ops:y,defaults:m={},encryption:v="none"}){o({libraryId:c,objectId:p}),s(d),this.Log(`Creating file upload job: ${c} ${p} ${d}`),this.Log(y),v==="cgck"&&(m.encryption={scheme:"cgck"});const b={seq:0,seq_complete:!0,defaults:m,ops:y},x=t("q",d,"file_jobs");return this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0,encryption:v}),method:"POST",path:x,body:b,allowFailover:!1})},zr.UploadStatus=async function({libraryId:c,objectId:p,writeToken:d,uploadId:y}){o({libraryId:c,objectId:p}),s(d);const m=t("q",d,"file_jobs",y);return this.utils.ResponseToJson(this.HttpClient.Request({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0}),method:"GET",path:m,allowFailover:!1}))},zr.UploadJobStatus=async function({libraryId:c,objectId:p,writeToken:d,uploadId:y,jobId:m}){o({libraryId:c,objectId:p}),s(d);const v=t("q",d,"file_jobs",y,"uploads",m);let b=await this.utils.ResponseToJson(this.HttpClient.Request({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0}),method:"GET",path:v,allowFailover:!1,queryParams:{start:0,limit:1e4}}));for(;b.next!==b.total&&b.next>=0;){const x=await this.utils.ResponseToJson(this.HttpClient.Request({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0}),method:"GET",path:v,allowFailover:!1,queryParams:{start:b.next}}));b.files=[...b.files,...x.files],b.next=x.next}return b},zr.UploadFileData=async function({libraryId:c,objectId:p,writeToken:d,encryption:y,uploadId:m,jobId:v,filePath:b,fileData:x}){o({libraryId:c,objectId:p}),s(d);let C=(await this.UploadJobStatus({libraryId:c,objectId:p,writeToken:d,uploadId:m,jobId:v})).files.find(k=>k.path===b);if(y&&y!=="none"&&(C=C.encrypted),C.rem===0)return;C.skip&&(x=x.slice(C.skip));let T=t("q",d,"file_jobs",m,v);return await this.utils.ResponseToJson(this.HttpClient.Request({method:"POST",path:T,body:x,bodyType:"BINARY",headers:{"Content-type":"application/octet-stream",...await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0})},allowFailover:!1,allowRetry:!1}))},zr.FinalizeUploadJob=async function({libraryId:c,objectId:p,writeToken:d}){o({libraryId:c,objectId:p}),s(d),this.Log(`Finalizing upload job: ${c} ${p} ${d}`);const y=t("q",d,"files");await this.HttpClient.Request({method:"POST",path:y,bodyType:"BINARY",headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0}),allowFailover:!1})},zr.CreateFileDirectories=async function({libraryId:c,objectId:p,writeToken:d,filePaths:y}){o({libraryId:c,objectId:p}),s(d),this.Log(`Creating Directories: ${c} ${p} ${d}`),this.Log(y);const m=y.map(v=>({op:"add",type:"directory",path:v}));await this.CreateFileUploadJob({libraryId:c,objectId:p,writeToken:d,ops:m})},zr.MoveFiles=async function({libraryId:c,objectId:p,writeToken:d,filePaths:y}){o({libraryId:c,objectId:p}),s(d),this.Log(`Moving Files: ${c} ${p} ${d}`),this.Log(y);const m=y.map(({path:v,to:b})=>({op:"move",copy_move_source_path:v,path:b}));await this.CreateFileUploadJob({libraryId:c,objectId:p,writeToken:d,ops:m})},zr.DeleteFiles=async function({libraryId:c,objectId:p,writeToken:d,filePaths:y}){o({libraryId:c,objectId:p}),s(d),this.Log(`Deleting Files: ${c} ${p} ${d}`),this.Log(y);const m=y.map(v=>({op:"del",path:v}));await this.CreateFileUploadJob({libraryId:c,objectId:p,writeToken:d,ops:m})},zr.DownloadFile=async function({libraryId:c,objectId:p,versionHash:d,writeToken:y,filePath:m,format:v="arrayBuffer",chunked:b=!1,chunkSize:x,clientSideDecryption:E=!1,callback:C}){o({libraryId:c,objectId:p,versionHash:d}),a("filePath",m),d&&(p=this.utils.DecodeVersionHash(d).objectId);const T=await this.ContentObjectMetadata({libraryId:c,objectId:p,versionHash:d,writeToken:y,metadataSubtree:t("files",m)}),k=T&&T["."].encryption&&T["."].encryption.scheme==="cgck",M=k?"cgck":void 0,O=k&&!E?t("q",y||d||p,"rep","files_download",m):t("q",y||d||p,"files",m),R=await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,versionHash:d,encryption:M,makeAccessRequest:M==="cgck"});R.Accept="*/*";const $=`eluv.caps.iusr${this.utils.AddressToHash(this.signer.address)}`,X=await this.ContentObjectMetadata({libraryId:c,objectId:p,versionHash:d,metadataSubtree:$});k&&!this.utils.EqualAddress(this.signer.address,await this.ContentObjectOwner({objectId:p}))&&!X&&(R["X-Content-Fabric-Decryption-Mode"]="reencrypt"),k&&!E&&(R["X-Content-Fabric-Decryption-Mode"]="decrypt",x=Number.MAX_SAFE_INTEGER);const se=T["."].size;if(k&&E)return await this.DownloadEncrypted({conk:await this.EncryptionConk({libraryId:c,objectId:p,versionHash:d,download:!0}),downloadPath:O,bytesTotal:se,headers:R,callback:C,format:v,clientSideDecryption:E,chunked:b});x||(x=1e7);try{return await this.Download({downloadPath:O,bytesTotal:se,headers:R,callback:C,format:v,chunked:b,chunkSize:x})}catch(ye){if(k&&!E)return this.DownloadFile({...arguments[0],clientSideDecryption:!0});throw ye}},zr.ContentParts=async function({libraryId:c,objectId:p,versionHash:d}){o({libraryId:c,objectId:p,versionHash:d}),this.Log(`Retrieving parts: ${c} ${p||d}`),d&&(p=this.utils.DecodeVersionHash(d).objectId);const y=t("q",d||p,"parts");return(await this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,versionHash:d}),method:"GET",path:y})).parts},zr.ContentPart=async function({libraryId:c,objectId:p,versionHash:d,partHash:y}){o({libraryId:c,objectId:p,versionHash:d}),u(y),this.Log(`Retrieving part: ${c} ${p||d} ${y}`),d&&(p=this.utils.DecodeVersionHash(d).objectId);let m=t("q",d||p,"parts",y);return await this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,versionHash:d}),method:"GET",path:m})},zr.DownloadPart=async function({libraryId:c,objectId:p,versionHash:d,writeToken:y,partHash:m,format:v="arrayBuffer",chunked:b=!1,chunkSize:x=1e7,callback:E}){o({libraryId:c,objectId:p,versionHash:d}),u(m),d&&(p=this.utils.DecodeVersionHash(d).objectId);const C=m.startsWith("hqpe"),T=C?"cgck":void 0,k=t("q",y||d||p,"data",m);let M=await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,versionHash:d,encryption:T,makeAccessRequest:!0});const O=(await this.ContentPart({libraryId:c,objectId:p,versionHash:d,partHash:m})).part.size;return C?(this.utils.EqualAddress(this.signer.address,await this.ContentObjectOwner({objectId:p}))||(M["X-Content-Fabric-Decryption-Mode"]="reencrypt"),await this.DownloadEncrypted({conk:await this.EncryptionConk({libraryId:c,objectId:p,download:!0}),downloadPath:k,bytesTotal:O,headers:M,callback:E,format:v,chunked:b})):await this.Download({downloadPath:k,bytesTotal:O,headers:M,callback:E,format:v,chunked:b,chunkSize:x})},zr.Download=async function({downloadPath:c,headers:p,bytesTotal:d,chunked:y=!1,chunkSize:m=2e6,callback:v,format:b="arrayBuffer"}){if(y&&!v)throw Error("No callback specified for chunked download");let x;y||(x=[]);let E=0;const C=Math.ceil(d/m);for(let T=0;T<C;T++){p.Range=`bytes=${E}-${E+m-1}`;const k=await this.HttpClient.Request({path:c,headers:p,method:"GET"});E=Math.min(E+m,d),y?v({bytesFinished:E,bytesTotal:d,chunk:await this.utils.ResponseToFormat(b,k)}):(x.push(Buffer.from(await k.arrayBuffer())),v&&v({bytesFinished:E,bytesTotal:d}))}if(!y)return await this.utils.ResponseToFormat(b,new Response(Buffer.concat(x)))},zr.DownloadEncrypted=async function({conk:c,downloadPath:p,bytesTotal:d,headers:y,callback:m,format:v="arrayBuffer",chunked:b=!1}){if(b&&!m)throw Error("No callback specified for chunked download");const x=c.public_key.startsWith("ktpk"),E=this.Crypto.EncryptedBlockSize(1e6,x);let C=0;v=v.toLowerCase();let T=[];const k=await this.Crypto.OpenDecryptionStream(c);k.on("data",async O=>{if(b){if(v!=="buffer"){const R=O.buffer.slice(O.byteOffset,O.byteOffset+O.byteLength);v==="arraybuffer"?O=R:O=await this.utils.ResponseToFormat(v,new Response(R))}m({bytesFinished:C,bytesTotal:d,chunk:O})}else m&&m({bytesFinished:C,bytesTotal:d}),T.push(O)});const M=Math.ceil(d/E);for(let O=0;O<M;O++){y.Range=`bytes=${C}-${C+E-1}`;const R=await this.HttpClient.Request({headers:y,method:"GET",path:p});C=Math.min(C+E,d),k.write(new Uint8Array(await R.arrayBuffer()))}if(k.end(),await new Promise(O=>k.on("finish",()=>{O()})),!b)return await this.utils.ResponseToFormat(v,new Response(Buffer.concat(T)))},zr.CreatePart=async function({libraryId:c,objectId:p,writeToken:d,encryption:y}){o({libraryId:c,objectId:p}),s(d);const m=t("q",d,"parts");return(await this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0,encryption:y}),method:"POST",path:m,bodyType:"BINARY",body:"",allowFailover:!1})).part.write_token},zr.UploadPartChunk=async function({libraryId:c,objectId:p,writeToken:d,partWriteToken:y,chunk:m,encryption:v}){if(o({libraryId:c,objectId:p}),s(d),v&&v!=="none"){const x=await this.EncryptionConk({libraryId:c,objectId:p,writeToken:d});m=await this.Crypto.Encrypt(x,m)}const b=t("q",d,"parts");await this.utils.ResponseToJson(this.HttpClient.Request({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0,encryption:v}),method:"POST",path:t(b,y),body:m,bodyType:"BINARY",allowFailover:!1}))},zr.FinalizePart=async function({libraryId:c,objectId:p,writeToken:d,partWriteToken:y,encryption:m}){o({libraryId:c,objectId:p}),s(d);const v=t("q",d,"parts");return await this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0,encryption:m}),method:"POST",path:t(v,y),bodyType:"BINARY",body:"",allowFailover:!1})},zr.UploadPart=async function({libraryId:c,objectId:p,writeToken:d,data:y,encryption:m="none",chunkSize:v=1e7,callback:b}){o({libraryId:c,objectId:p}),s(d);const x=await this.CreatePart({libraryId:c,objectId:p,writeToken:d,encryption:m}),E=y.length||y.byteLength||y.size;b&&b({bytesFinished:0,bytesTotal:E});for(let C=0;C<E;C+=v){const T=y.slice(C,C+v);await this.UploadPartChunk({libraryId:c,objectId:p,writeToken:d,partWriteToken:x,chunk:T,encryption:m}),b&&b({bytesFinished:Math.min(C+v,E),bytesTotal:E})}return await this.FinalizePart({libraryId:c,objectId:p,writeToken:d,partWriteToken:x,encryption:m})},zr.DeletePart=async function({libraryId:c,objectId:p,writeToken:d,partHash:y}){o({libraryId:c,objectId:p}),s(d),u(y);let m=t("q",d,"parts",y);await this.HttpClient.Request({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0}),method:"DELETE",path:m,allowFailover:!1})},zr}var CO;function CJ(){if(CO)return _3;CO=1;const n=zW(),e=gi(),t=BP().permissionLevels,{LogMessage:a}=D0(),s=WP();let u=class pA{Log(p,d=!1){a(this,p,d)}constructor({target:p,timeout:d=30}={}){this.permissionLevels=t,!p&&typeof window<"u"&&window.parent&&(p=window.parent),this.target=p,this.timeout=d,this.utils=e,this.Crypto=s,this.Crypto.ElvCrypto();for(const y of this.AllowedMethods())this[y]=async m=>{let v=m&&m.callback;return v&&delete m.callback,await this.SendMessage({options:{calledMethod:y,args:this.utils.MakeClonable(m)},callback:v})};this.userProfileClient={};for(const y of this.AllowedUserProfileMethods())this.userProfileClient[y]=async m=>{let v=m&&m.callback;return v&&delete m.callback,await this.SendMessage({options:{module:"userProfileClient",calledMethod:y,args:this.utils.MakeClonable(m),prompted:pA.PromptedMethods().includes(y)},callback:v})};this.walletClient={};for(const y of this.AllowedWalletClientMethods())this.walletClient[y]=async m=>{let v=m&&m.callback;return v&&delete m.callback,await this.SendMessage({options:{module:"walletClient",calledMethod:y,args:this.utils.MakeClonable(m)},callback:v})}}async PassRequest({request:p,Respond:d}){let y,m;try{let v;p.callbackId&&(v=b=>d({type:"ElvFrameResponse",requestId:p.callbackId,response:b})),y=await this.SendMessage({options:p,callback:v})}catch(v){m=v}return{type:"ElvFrameResponse",requestId:p.requestId,response:y,error:m}}async SendMessage({options:p={},callback:d,noResponse:y=!1}){const m=n.next();let v;if(d&&(v=n.next()),this.target.postMessage({...p,type:"ElvFrameRequest",requestId:m,callbackId:v},"*"),y)return;const b=p.calledMethod||p.operation,x=pA.FileMethods().includes(p.calledMethod);let E=this.timeout;return p.prompted||x?E=0:p.args&&p.args.fcTimeout&&(E=p.args.fcTimeout),await this.AwaitMessage(m,E,d,v,b)}async AwaitMessage(p,d,y,m,v){return await new Promise((b,x)=>{let E,C;const T=()=>{C&&clearTimeout(C),d>0&&(C=setTimeout(()=>{typeof window<"u"&&(window.removeEventListener("message",E),k&&window.removeEventListener("message",k)),x(`Request ${p} timed out (${v})`)},d*1e3))};let k;m&&(k=M=>{try{T();const O=M.data;if(O.type!=="ElvFrameResponse"||O.requestId!==m)return;y(O.response)}catch(O){console.error(O)}},window.addEventListener("message",k)),E=async M=>{try{const O=M.data;if(O.type!=="ElvFrameResponse"||O.requestId!==p)return;clearTimeout(C),window.removeEventListener("message",E),k&&window.removeEventListener("message",k),O.error?x(O.error):b(O.response)}catch(O){clearTimeout(C),window.removeEventListener("message",E),k&&window.removeEventListener("message",k),x(O)}},T(),window.addEventListener("message",E)})}static PromptedMethods(){return["CollectedTags","DeleteUserMetadata","MergeUserMetadata","ReplaceUserMetadata","UserMetadata"]}static MetadataMethods(){return["DeleteUserMetadata","MergeUserMetadata","ReplaceUserMetadata","UserMetadata"]}static FileMethods(){return["CreateFileUploadJob","DownloadEncrypted","DownloadFile","DownloadPart","FinalizeUploadJob","UpdateContentObjectGraph","UploadFileData","UploadFiles","UploadFilesFromS3","UploadJobStatus","UploadPart","UploadPartChunk","UploadStatus"]}OverriddenMethods(){return["UploadFiles"]}AllowedMethods(){return["AccessGroupManagers","AccessGroupMembers","AccessGroupOwner","AccessInfo","AccessRequest","AccessType","AddAccessGroupManager","AddAccessGroupMember","AddContentLibraryGroup","AddContentObjectGroupPermission","AddLibraryContentType","AssetMetadata","AuditContentObject","AuditStream","AvailableDRMs","AvailableOfferings","AwaitPending","BitmovinPlayoutOptions","BlockNumber","CallBitcodeMethod","CallContractMethod","CallContractMethodAndWait","ClearCache","ClearStaticToken","Collection","CollectionTransactions","ConfigUrl","ContentLibraries","ContentLibrary","ContentLibraryGroupPermissions","ContentLibraryOwner","ContentObject","ContentObjectAccessComplete","ContentObjectGraph","ContentObjectGroupPermissions","ContentObjectImageUrl","ContentObjectLibraryId","ContentObjectMetadata","ContentObjectOwner","ContentObjectTenantId","ContentObjectVersions","ContentObjects","ContentPart","ContentParts","ContentSpaceId","ContentType","ContentTypeOwner","ContentTypes","ContractAbi","ContractEvents","ContractInfo","ContractMetadata","ContractName","CopyContentObject","CreateABRMezzanine","CreateAccessGroup","CreateAndFinalizeContentObject","CreateAuthorizationToken","CreateContentLibrary","CreateContentObject","CreateContentType","CreateEncryptionConk","CreateFabricToken","CreateFileDirectories","CreateFileUploadJob","CreateLinks","CreateNTPInstance","CreateNonOwnerCap","CreatePart","CreateProductionMaster","CreateShare","CreateSignedMessageJSON","CreateSignedToken","CreateStaticToken","CurrentAccountAddress","CustomContractAddress","DecodeSignedMessageJSON","Decrypt","DecryptECIES","DefaultKMSAddress","DeleteAccessGroup","DeleteContentLibrary","DeleteContentObject","DeleteContentVersion","DeleteFiles","DeleteMetadata","DeleteNTPInstance","DeletePart","DeleteWriteToken","DeployContract","Download","DownloadEncrypted","DownloadFile","DownloadPart","EditAndFinalizeContentObject","EditContentObject","EmbedUrl","Encrypt","EncryptECIES","EncryptionConk","Events","ExtractEventFromLogs","ExtractValueFromEvent","FabricUrl","FileUrl","FinalizeABRMezzanine","FinalizeContentObject","FinalizePart","FinalizeStateChannelAccess","FinalizeUploadJob","FormatContractArguments","GenerateStateChannelToken","GenerateSignedLinkToken","GetBalance","GlobalUrl","InitializeAuthPolicy","IssueNTPCode","IssueSignedNTPCode","LatestVersionHash","LibraryContentTypes","LinkAccessGroupToOauth","LinkData","LinkTarget","LinkUrl","ListAccessGroups","ListFiles","ListNTPInstances","LRODraftInfo","LROStatus","MakeAuthServiceRequest","MakeFileServiceRequest","MergeContractMetadata","MergeMetadata","MetadataAuth","MintNFT","MoveFiles","NetworkInfo","NodeId","Nodes","NTPInstance","ObjectCleanup","Permission","PlayoutOptions","PlayoutPathResolution","ProduceMetadataLinks","Proofs","PublicRep","PublishContentVersion","QParts","RecordWriteToken","RedeemCode","RedeemShareToken","RemoveAccessGroupManager","RemoveAccessGroupMember","RemoveContentObjectGroupPermission","RemoveContentLibraryGroup","RemoveLibraryContentType","Rep","ReplaceContractMetadata","ReplaceMetadata","Request","ResetRegion","ResetTenantId","RevokeShare","SendFunds","SetAccessCharge","SetAuth","SetAuthContext","SetAuthPolicy","SetContentLibraryImage","SetContentObjectImage","SetCustomContentContract","SetGroupPermission","SetNodes","SetOauthToken","SetPolicyAuthorization","SetSignerFromOauthToken","SetStaticToken","SetTenantContractId","SetTenantId","TenantAdminGroup","ContentAdminGroup","TenantUsersGroup","SetVisibility","SetPermission","ShareInfo","Shares","SpaceNodes","StartABRMezzanineJobs","StreamAddWatermark","StreamConfig","StreamCopyToVod","StreamCreate","StreamInitialize","StreamInsertion","StreamListUrls","StreamRemoveWatermark","StreamSetOfferingAndDRM","StreamStatus","StreamStartOrStopOrReset","StreamStopSession","SuspendNTPInstance","TenantContractId","TenantId","UnlinkAccessGroupFromOauth","UpdateContentObjectGraph","UpdateNTPInstance","UpdateShare","UploadFileData","UploadFilesFromS3","UploadJobStatus","UploadPart","UploadPartChunk","UploadStatus","UseRegion","Visibility","WriteTokenNodeUrlLocal","WriteTokenNodeUrlNetwork"]}AllowedUserProfileMethods(){return["AccessLevel","CollectedTags","CreateWallet","DeleteUserMetadata","MergeUserMetadata","PublicUserMetadata","ReplaceUserMetadata","ResetTenantId","SetTenantContractId","TenantContractId","TenantId","UserMetadata","UserProfileImage","UserWalletAddress","UserWalletObjectInfo","WalletAddress"]}AllowedWalletClientMethods(){return["AcceptMarketplaceOffer","AddNotificationListener","AvailableMarketplaces","CanSign","CastVote","ClaimItem","ClaimStatus","CollectionRedemptionStatus","CreateListing","CreateMarketplaceOffer","DeployTenant","DropStatus","ExchangeRate","FilteredQuery","LatestMarketplaceHash","Leaderboard","Listing","ListingAttributes","ListingEditionNames","ListingNames","ListingPurchaseStatus","ListingStats","ListingStatus","Listings","LoadAvailableMarketplaces","LoadDrop","LoadMarketplace","Marketplace","MarketplaceCSS","MarketplaceInfo","MarketplaceOffers","MarketplaceStock","MintingStatus","NFT","NFTContractStats","Notifications","PackOpenStatus","Profile","ProfileMetadata","PurchaseStatus","PurgeUrl","PushNotification","RejectMarketplaceOffer","RemoveListing","RemoveMarketplaceOffer","RemoveProfileMetadata","RevokeVote","Sales","SalesNames","SalesStats","SetProfileMetadata","SubmitDropVote","TenantConfiguration","TransferNFT","Transfers","UserAddress","UserInfo","UserItemAttributes","UserItemEditionNames","UserItemNames","UserItems","UserListings","UserNameToAddress","UserSales","UserTransfers","UserWalletBalance","VoteStatus"]}};const{UploadFiles:o}=KP();return u.prototype.UploadFiles=o,_3.FrameClient=u,_3}var jE,EO;function EJ(){if(EO)return jE;EO=1;const n=gi(),e=vi(),{FrameClient:t}=CJ(),{LogMessage:a}=D0();class s{Log(o,c=!1){a(this,o,c)}constructor({client:o,debug:c}){this.client=o,this.debug=c,this.userWalletAddresses={},this.walletAddress=void 0,this.walletAddressRetrieved=!1}async CreateWallet(){if(this.creatingWallet)for(;this.creatingWallet;)await new Promise(o=>setTimeout(o,500));this.creatingWallet=!0;try{if(!this.walletAddress||n.EqualAddress(this.walletAddress,n.nullAddress)){if(this.Log(`Creating user wallet for user ${this.client.signer.address}`),await this.client.GetBalance({address:this.client.signer.address})<.05)return;const d=await this.client.CallContractMethodAndWait({contractAddress:n.HashToAddress(this.client.contentSpaceId),methodName:"createAccessWallet",methodArgs:[]}),y=await this.client.ContractAbi({contractAddress:this.client.contentSpaceAddress});this.walletAddress=this.client.ExtractValueFromEvent({abi:y,event:d,eventName:"CreateAccessWallet",eventValue:"wallet"}),this.userWalletAddresses[n.FormatAddress(this.client.signer.address)]=this.walletAddress}const o=this.client.contentSpaceLibraryId,c=n.AddressToObjectId(this.walletAddress);try{await this.client.ContentObject({libraryId:o,objectId:c})}catch(p){if(p.status===404){this.Log(`Creating wallet object for user ${this.client.signer.address}`);const d=await this.client.CreateContentObject({libraryId:o,objectId:c});await this.client.FinalizeContentObject({libraryId:o,objectId:c,writeToken:d.write_token,commitMessage:"Create user wallet object"})}}}catch(o){console.error("Failed to create wallet contract:"),console.error(o)}finally{this.creatingWallet=!1}}async WalletAddress(o=!0){if(this.walletAddress||this.walletAddressRetrieved)return this.walletAddress;this.walletAddressPromise||(this.walletAddressPromise=this.client.CallContractMethod({contractAddress:n.HashToAddress(this.client.contentSpaceId),methodName:"userWallets",methodArgs:[this.client.signer.address]}));const c=await this.walletAddressPromise;return n.EqualAddress(c,n.nullAddress)||(this.walletAddress=c),!this.walletAddress&&o&&await this.CreateWallet(),this.walletAddressRetrieved=!0,this.walletAddress}async UserWalletAddress({address:o}){if(n.EqualAddress(o,this.client.signer.address))return await this.WalletAddress();if(!this.userWalletAddresses[o]){this.Log(`Retrieving user wallet address for user ${o}`);const c=await this.client.CallContractMethod({contractAddress:n.HashToAddress(this.client.contentSpaceId),methodName:"userWallets",methodArgs:[o]});n.EqualAddress(c,n.nullAddress)||(this.userWalletAddresses[o]=c)}return this.userWalletAddresses[o]}async UserWalletObjectInfo({address:o}={}){const c=o?await this.UserWalletAddress({address:o}):await this.WalletAddress();return{libraryId:this.client.contentSpaceLibraryId,objectId:c?n.AddressToObjectId(c):""}}async PublicUserMetadata({address:o,metadataSubtree:c="/",queryParams:p={},select:d=[],resolveLinks:y=!1,resolveIncludeSource:m=!1,resolveIgnoreErrors:v=!1,linkDepthLimit:b=1}){if(!o||!await this.UserWalletAddress({address:o}))return;c=e("public",c||"/");const{libraryId:E,objectId:C}=await this.UserWalletObjectInfo({address:o});if(C)return await this.client.ContentObjectMetadata({libraryId:E,objectId:C,queryParams:p,select:d,metadataSubtree:c,resolveLinks:y,resolveIncludeSource:m,resolveIgnoreErrors:v,linkDepthLimit:b})}async UserMetadata({metadataSubtree:o="/",queryParams:c={},select:p=[],resolveLinks:d=!1,resolveIncludeSource:y=!1,resolveIgnoreErrors:m=!1,linkDepthLimit:v=1}={}){this.Log(`Accessing private user metadata at ${o}`);const{libraryId:b,objectId:x}=await this.UserWalletObjectInfo();return await this.client.ContentObjectMetadata({libraryId:b,objectId:x,metadataSubtree:o,queryParams:c,select:p,resolveLinks:d,resolveIncludeSource:y,resolveIgnoreErrors:m,linkDepthLimit:v})}async MergeUserMetadata({metadataSubtree:o="/",metadata:c={}}){this.Log(`Merging user metadata at ${o}`);const{libraryId:p,objectId:d}=await this.UserWalletObjectInfo(),y=await this.client.EditContentObject({libraryId:p,objectId:d});await this.client.MergeMetadata({libraryId:p,objectId:d,writeToken:y.write_token,metadataSubtree:o,metadata:c}),await this.client.FinalizeContentObject({libraryId:p,objectId:d,writeToken:y.write_token,commitMessage:"Merge user metadata"})}async ReplaceUserMetadata({metadataSubtree:o="/",metadata:c={}}){this.Log(`Replacing user metadata at ${o}`);const{libraryId:p,objectId:d}=await this.UserWalletObjectInfo(),y=await this.client.EditContentObject({libraryId:p,objectId:d});await this.client.ReplaceMetadata({libraryId:p,objectId:d,writeToken:y.write_token,metadataSubtree:o,metadata:c}),await this.client.FinalizeContentObject({libraryId:p,objectId:d,writeToken:y.write_token,commitMessage:"Replace user metadata"})}async DeleteUserMetadata({metadataSubtree:o="/"}){this.Log(`Deleting user metadata at ${o}`);const{libraryId:c,objectId:p}=await this.UserWalletObjectInfo(),d=await this.client.EditContentObject({libraryId:c,objectId:p});await this.client.DeleteMetadata({libraryId:c,objectId:p,writeToken:d.write_token,metadataSubtree:o}),await this.client.FinalizeContentObject({libraryId:c,objectId:p,writeToken:d.write_token,commitMessage:"Delete user metadata"})}async AccessLevel(){return await this.UserMetadata({metadataSubtree:"access_level"})||"prompt"}async SetAccessLevel({level:o}){if(o=o.toLowerCase(),!["private","prompt","public"].includes(o))throw new Error("Invalid access level: "+o);await this.ReplaceUserMetadata({metadataSubtree:"access_level",metadata:o})}async TenantId(){if(!this.tenantId){const{objectId:o}=await this.UserWalletObjectInfo();this.tenantId=await this.client.TenantId({objectId:o})}return this.tenantId}async SetTenantId({id:o,address:c}){if(o&&(!o.startsWith("iten")||!n.ValidHash(o)))throw Error(`Invalid tenant ID: ${o}`);if(c){if(!n.ValidAddress(c))throw Error(`Invalid address: ${c}`);o=`iten${n.AddressToHash(c)}`}const{objectId:p}=await this.UserWalletObjectInfo(),d=await this.client.SetTenantId({objectId:p,tenantId:o});this.tenantContractId=d.tenantContractId,this.tenantId=d.tenantId}async TenantContractId(){if(!this.tenantContractId){const{objectId:o}=await this.UserWalletObjectInfo();this.tenantContractId=await this.client.TenantContractId({objectId:o})}return this.tenantContractId}async SetTenantContractId({tenantContractId:o}){const{objectId:c}=await this.UserWalletObjectInfo(),p=await this.client.SetTenantContractId({objectId:c,tenantContractId:o});this.tenantContractId=p.tenantContractId,this.tenantId=p.tenantId}async ResetTenantId(){const{objectId:o}=await this.UserWalletObjectInfo();await this.client.ResetTenantId({objectId:o}),this.tenantId=this.client.TenantId({objectId:o}),this.tenantContractId=this.client.TenantContractId({objectId:o})}async UserProfileImage({address:o,height:c}={}){let p;if(o?p=await this.UserWalletAddress({address:o}):(o=this.client.signer.address,p=this.walletAddress),!p)return;const{libraryId:d,objectId:y}=await this.UserWalletObjectInfo({address:o});return this.client.ContentObjectImageUrl({libraryId:d,objectId:y,height:c,imagePath:"public/profile_image"})}async SetUserProfileImage({image:o}){if(this.Log(`Setting profile image for user ${this.client.signer.address}`),(o.length||o.byteLength||o.size)>5e6)throw Error("Maximum profile image size is 5MB");const{libraryId:p,objectId:d}=await this.UserWalletObjectInfo(),y=await this.client.EditContentObject({libraryId:p,objectId:d});await this.client.SetContentObjectImage({libraryId:p,objectId:d,writeToken:y.write_token,image:o,imageName:"profile_image",imagePath:"public/profile_image"}),await this.client.FinalizeContentObject({libraryId:p,objectId:d,writeToken:y.write_token,commitMessage:"Set user profile image"})}async CollectedTags(){return await this.UserMetadata({metadataSubtree:"collected_data"})||{}}async RecordTags({libraryId:o,objectId:c,versionHash:p}){try{await this.__RecordTags({libraryId:o,objectId:c,versionHash:p})}catch(d){console.error(d)}}async __RecordTags({libraryId:o,objectId:c,versionHash:p}){if(await this.client.AccessType({id:c})!=="object"||(!p&&!o&&(o=await this.client.ContentObjectLibraryId({objectId:c})),p||(p=(await this.client.ContentObject({libraryId:o,objectId:c})).hash),await this.UserMetadata({metadataSubtree:e("accessed_content",p)})))return;const m=await this.UserWalletObjectInfo(),v=m.libraryId,b=m.objectId,x=await this.client.EditContentObject({libraryId:v,objectId:b});await this.client.ReplaceMetadata({libraryId:v,objectId:b,writeToken:x.write_token,metadataSubtree:e("accessed_content",p),metadata:Date.now()});const E=await this.client.ContentObjectMetadata({libraryId:o,objectId:c,versionHash:p,metadataSubtree:"video_tags"});if(E&&E.length>0){let C=await this.CollectedTags();const T=this.__FormatVideoTags(E);Object.keys(T).forEach(k=>{C[k]?(C[k].occurrences+=1,C[k].aggregate+=T[k]):C[k]={occurrences:1,aggregate:T[k]}}),await this.client.ReplaceMetadata({libraryId:v,objectId:b,writeToken:x.write_token,metadataSubtree:"collected_data",metadata:C})}await this.client.FinalizeContentObject({libraryId:v,objectId:b,writeToken:x.write_token,commitMessage:"Record user tags",awaitCommitConfirmation:!1})}__FormatVideoTags(o){let c={};o.forEach(d=>{d.tags.forEach(m=>{c[m.tag]?(c[m.tag].occurrences+=1,c[m.tag].aggregate+=m.score):c[m.tag]={occurrences:1,aggregate:m.score}})});let p={};return Object.keys(c).forEach(d=>{p[d]=c[d].aggregate/c[d].occurrences}),p}PromptedMethods(){return t.PromptedMethods()}MetadataMethods(){return t.MetadataMethods()}FrameAllowedMethods(){const o=["constructor","FrameAllowedMethods","Log","MetadataMethods","PromptedMethods","RecordTags","SetAccessLevel","SetTenantId","SetUserProfileImage","__IsLibraryCreated","__TouchLibrary","__FormatVideoTags","__RecordTags"];return Object.getOwnPropertyNames(Object.getPrototypeOf(this)).filter(c=>!o.includes(c))}}return jE=s,jE}var qE,AO;function AJ(){if(AO)return qE;AO=1;const n=Sl,e=gi(),t=If(),a=vi();class s extends n.Signer{constructor({signerURIs:o,idToken:c,userIdCode:p,authToken:d,tenantId:y,provider:m,extraData:v={},unsignedPublicAuth:b=!1}){super(),this.remoteSigner=!0,this.unsignedPublicAuth=b,this.HttpClient=new t({uris:o}),this.idToken=c,this.userIdCode=p,this.tenantId=y,this.authToken=d,this.extraLoginData=v||{},this.provider=m,this.signatureCache={}}async Initialize(){if(!this.authToken){let o={ext:this.extraLoginData||{}};this.tenantId&&(o.tid=this.tenantId),this.userIdCode&&(o.code=this.userIdCode);const{addr:c,eth:p,token:d}=await e.ResponseToJson(this.HttpClient.Request({path:a("as","wlt","login",this.userIdCode?"code":"jwt"),method:"POST",body:o,headers:{Authorization:`Bearer ${this.userIdCode||this.idToken}`}}));this.authToken=d,this.address=e.FormatAddress(c),this.id=p}if(!this.address){const o=await e.ResponseToJson(this.HttpClient.Request({method:"GET",path:a("as","wlt","keys"),headers:{Authorization:`Bearer ${this.authToken}`}})),c=o.eth[0];c&&c.startsWith("0x")?this.address=c:this.address=e.HashToAddress(o.eth[0])}this.id=this.address?`ikms${e.AddressToHash(this.address)}`:void 0,this.signer=this.provider.getSigner(this.address)}async RetrieveCSAT({email:o,nonce:c,installId:p,tenantId:d,force:y=!1,duration:m=24,appName:v}){if(c&&!p){const x=await crypto.subtle.digest("SHA-512",new TextEncoder("utf-8").encode(c));p=Array.prototype.map.call(new Uint8Array(x),E=>("00"+E.toString(16)).slice(-2)).join("")}let b=await e.ResponseToJson(this.HttpClient.Request({method:"POST",body:{email:o,install_id:p,force:y,tid:d,app_name:v,exp:parseInt(m*60*60)},path:a("as","wlt","sign","csat"),headers:{Authorization:`Bearer ${this.authToken}`}}));return b.nonce=c,b.installId=p,b}async CSATStatus({accessToken:o}){try{const c=await e.ResponseToJson(this.HttpClient.Request({method:"POST",path:a("as","wlt","login","status"),headers:{Authorization:`Bearer ${o}`}}));return c&&c.is_active}catch(c){return!c||c.status!==403}}async ReleaseCSAT({accessToken:o}){return await e.ResponseToJson(this.HttpClient.Request({method:"POST",path:a("as","wlt","login","release"),headers:{Authorization:`Bearer ${o}`}}))}async RefreshCSAT({accessToken:o,refreshToken:c,nonce:p}){return await e.ResponseToJson(this.HttpClient.Request({method:"POST",path:a("as","wlt","refresh","csat"),body:{last_csat:o,refresh_token:c,nonce:p},headers:{Authorization:`Bearer ${o}`}}))}getAddress(){return this.address}async signDigest(o){return this.signatureCache[o]||(this.signatureCache[o]=new Promise(async(c,p)=>{try{let d=await e.ResponseToJson(this.HttpClient.Request({method:"POST",path:a("as","wlt","sign","eth",this.id),headers:{Authorization:`Bearer ${this.authToken}`},body:{hash:o}}));d.v=parseInt(d.v,16),d.recoveryParam=d.v-27,c(d)}catch(d){p(d)}})),await this.signatureCache[o]}async signMessage(o){return Promise.resolve(n.utils.joinSignature(`0x${await this.signDigest(n.utils.hashMessage(o))}`))}async sign(o){o=await n.utils.resolveProperties(o);const c=await this.signDigest(n.utils.keccak256(n.utils.serializeTransaction(o)));return n.utils.serializeTransaction(o,c)}async sendTransaction(o){return o.nonce==null&&(o=n.utils.shallowCopy(o),o.nonce=await this.provider.getTransactionCount(this.address,"pending")),this.populateTransaction(o,this.provider,this.address).then(c=>this.sign(c).then(p=>this.provider.sendTransaction(p)))}connect(){}}return qE=s,qE}var aa={},kO;function kJ(){if(kO)return aa;kO=1;const{ValidatePresence:n,ValidateLibrary:e,ValidateObject:t,ValidateAddress:a,ValidateUserWallet:s}=Cu();return aa.ListAccessGroups=async function(){const u=(await this.Collection({collectionType:"accessGroups"})).map(c=>this.utils.FormatAddress(c));return(await this.utils.LimitedMap(5,u,async c=>{try{const p=this.utils.AddressToHash(c),d=await this.ContentObjectMetadata({libraryId:this.contentSpaceLibraryId,objectId:`iq__${p}`})||{};return{address:c,id:`igrp${p}`,meta:d}}catch(p){this.Log(p,!0)}})).filter(c=>c).sort((c,p)=>{const d=(c.meta.public||{}).name||`zz__${c.address}`,y=(p.meta.public||{}).name||`zz__${p.address}`;return d<y?-1:1})},aa.SetGroupPermission=async function({groupAddress:u,objectId:o,permission:c,remove:p=!1}){const d=await this.authClient.ContractInfo({address:u}),y=await this.authClient.ContractInfo({id:o});if(Object.keys(d).length===0)throw Error(`No information returned for group address ${u}`);let m;if(!y.isV3&&y.accessType===this.authClient.ACCESS_TYPES.GROUP){if(d.isV3)throw Error("Unable to map V3 group to V2 object");m=await this.CallContractMethodAndWait({contractAddress:u,methodName:"setAccessGroupRights",methodArgs:[this.utils.HashToAddress(o),c==="manage"?2:c==="access"?1:0,c==="none"||p?0:2]})}else m=await this.CallContractMethodAndWait({contractAddress:this.utils.HashToAddress(o),methodName:"setRights",methodArgs:[u,c==="manage"?2:c==="access"?1:0,c==="none"||p?0:2]});return await this.ExtractEventFromLogs({abi:d.abi,event:m,eventName:"RightsChanged"})},aa.AccessGroupOwner=async function({contractAddress:u}){return u=a(u),this.Log(`Retrieving owner of access group ${u}`),await this.authClient.Owner({address:u})},aa.AccessGroupMembers=async function({contractAddress:u}){if(u=a(u),this.Log(`Retrieving members for group ${u}`),await this.authClient.ContractHasMethod({contractAddress:u,methodName:"membersList"})){const c=(await this.CallContractMethod({contractAddress:u,methodName:"membersNum"})).toNumber();return await Promise.all([...Array(c)].map(async(p,d)=>this.utils.FormatAddress(await this.CallContractMethod({contractAddress:u,methodName:"membersList",methodArgs:[d]}))))}else{const c=this.utils.FromHex(await this.CallContractMethod({contractAddress:u,methodName:"getMeta",methodArgs:["members"]}));return c&&JSON.parse(c)?JSON.parse(c):[]}},aa.AccessGroupManagers=async function({contractAddress:u}){if(u=a(u),this.Log(`Retrieving managers for group ${u}`),await this.authClient.ContractHasMethod({contractAddress:u,methodName:"managersList"})){const c=(await this.CallContractMethod({contractAddress:u,methodName:"managersNum"})).toNumber();return await Promise.all([...Array(c)].map(async(p,d)=>this.utils.FormatAddress(await this.CallContractMethod({contractAddress:u,methodName:"managersList",methodArgs:[d]}))))}else{const c=this.utils.FromHex(await this.CallContractMethod({contractAddress:u,methodName:"getMeta",methodArgs:["managers"]}));return c&&JSON.parse(c)?JSON.parse(c):[]}},aa.CreateAccessGroup=async function({name:u,description:o,metadata:c={},visibility:p=1}={}){this.Log(`Creating access group: ${u||""} ${o||""}`);let{contractAddress:d}=await this.authClient.CreateAccessGroup();d=this.utils.FormatAddress(d);const y=this.utils.AddressToObjectId(d),m=await this.userProfileClient.TenantContractId();this.Log(`Access group: ${d} ${y}`);const v=await this.EditContentObject({libraryId:this.contentSpaceLibraryId,objectId:y}),b={public:{name:u,description:o},name:u,description:o,...c};if(await this.ReplaceMetadata({libraryId:this.contentSpaceLibraryId,objectId:y,writeToken:v.write_token,metadata:b}),await this.CallContractMethodAndWait({contractAddress:d,methodName:"setVisibility",methodArgs:[p]}),await this.FinalizeContentObject({libraryId:this.contentSpaceLibraryId,objectId:y,writeToken:v.write_token,commitMessage:"Create access group"}),m){const x=await this.SetTenantContractId({contractAddress:d,tenantContractId:m});if(x.tenantId){let E=this.utils.HashToAddress(x.tenantId);await this.AddContentObjectGroupPermission({objectId:y,groupAddress:E,permission:"manage"})}else console.warn("No tenant ID associated with current tenant.")}return d},aa.DeleteAccessGroup=async function({contractAddress:u}){throw Error("Not supported")},aa.AccessGroupMembershipMethod=async function({contractAddress:u,memberAddress:o,methodName:c,eventName:p}){if(u=a(u),o=a(o),!this.utils.EqualAddress(this.signer.address,o)&&!await this.CallContractMethod({contractAddress:u,methodName:"hasManagerAccess",methodArgs:[this.utils.FormatAddress(this.signer.address)]}))throw Error("Manager access required");this.Log(`Calling ${c} on group ${u} for user ${o}`);const d=await this.CallContractMethodAndWait({contractAddress:u,methodName:c,methodArgs:[o],eventName:p,eventValue:"candidate"}),y=await this.ContractAbi({contractAddress:u}),m=this.ExtractValueFromEvent({abi:y,event:d,eventName:p,eventValue:"candidate"});if(this.utils.FormatAddress(m)!==this.utils.FormatAddress(o))throw console.error("Mismatch: "+m+" :: "+o),console.error("Is target user address wallet created?"),Error("Access group method "+c+" failed. Is target user address wallet created?");return d.transactionHash},aa.AddAccessGroupMember=async function({contractAddress:u,memberAddress:o}){u=a(u),o=a(o),await s({address:o,client:this});const c=await this.authClient.ContractHasMethod({contractAddress:u,methodName:"membersList"}),p=await this.AccessGroupMembershipMethod({contractAddress:u,memberAddress:o,methodName:"grantAccess",eventName:"MemberAdded"});if(!c){let d=await this.AccessGroupMembers({contractAddress:u});d.push(o),d=d.filter((y,m,v)=>v.indexOf(y)===m),await this.ReplaceContractMetadata({contractAddress:u,metadataKey:"members",metadata:d})}return p},aa.RemoveAccessGroupMember=async function({contractAddress:u,memberAddress:o}){u=a(u),o=a(o);const c=await this.authClient.ContractHasMethod({contractAddress:u,methodName:"membersList"}),p=await this.AccessGroupMembershipMethod({contractAddress:u,memberAddress:o,methodName:"revokeAccess",eventName:"MemberRevoked"});if(!c){let d=await this.AccessGroupMembers({contractAddress:u});return d=d.filter(y=>y!==o),await this.ReplaceContractMetadata({contractAddress:u,metadataKey:"members",metadata:d})}return p},aa.AddAccessGroupManager=async function({contractAddress:u,memberAddress:o}){u=a(u),o=a(o),await s({address:o,client:this});const c=await this.authClient.ContractHasMethod({contractAddress:u,methodName:"membersList"}),p=await this.AccessGroupMembershipMethod({contractAddress:u,memberAddress:o,methodName:"grantManagerAccess",eventName:"ManagerAccessGranted"});if(!c){let d=await this.AccessGroupManagers({contractAddress:u});d.push(o),d=d.filter((y,m,v)=>v.indexOf(y)===m),await this.ReplaceContractMetadata({contractAddress:u,metadataKey:"managers",metadata:d})}return p},aa.RemoveAccessGroupManager=async function({contractAddress:u,memberAddress:o}){if(u=a(u),o=a(o),!await this.authClient.ContractHasMethod({contractAddress:u,methodName:"managersList"})){let d=await this.AccessGroupManagers({contractAddress:u});d=d.filter(y=>y!==o),await this.ReplaceContractMetadata({contractAddress:u,metadataKey:"managers",metadata:d})}return await this.AccessGroupMembershipMethod({contractAddress:u,memberAddress:o,methodName:"revokeManagerAccess",eventName:"ManagerAccessRevoked"})},aa.ContentLibraryGroupPermissions=async function({libraryId:u,permissions:o=[]}){e(u);let c={};return!o||o.length===0?o=["accessor","contributor","reviewer"]:o=o.map(p=>{if(p=p.toLowerCase(),!["accessor","contributor","reviewer"].includes(p))throw Error(`Invalid permission: ${p}`);return p}),this.Log(`Retrieving ${o.join(", ")} group(s) for library ${u}`),await Promise.all(o.map(async p=>{let d=await this.CallContractMethod({contractAddress:this.utils.HashToAddress(u),methodName:p+"GroupsLength"});d=parseInt(d._hex,16),(await this.utils.LimitedMap(3,[...Array(d).keys()],async m=>{try{return this.utils.FormatAddress(await this.CallContractMethod({contractAddress:this.utils.HashToAddress(u),methodName:p+"Groups",methodArgs:[m]}))}catch(v){console.error(v)}})).forEach(m=>c[m]=[...c[m]||[],p].sort())})),c},aa.AddContentLibraryGroup=async function({libraryId:u,groupAddress:o,permission:c}){if(e(u),o=a(o),!["accessor","contributor","reviewer"].includes(c.toLowerCase()))throw Error(`Invalid group type: ${c}`);if(this.Log(`Adding ${c} group ${o} to library ${u}`),(await this.ContentLibraryGroupPermissions({libraryId:u,permissions:[c]}))[o])return;c=c.charAt(0).toUpperCase()+c.substr(1).toLowerCase();const d=await this.CallContractMethodAndWait({contractAddress:this.utils.HashToAddress(u),methodName:`add${c}Group`,methodArgs:[o]}),y=await this.ContractAbi({id:u});await this.ExtractEventFromLogs({abi:y,event:d,eventName:`${c}GroupAdded`})},aa.RemoveContentLibraryGroup=async function({libraryId:u,groupAddress:o,permission:c}){if(e(u),o=a(o),!["accessor","contributor","reviewer"].includes(c.toLowerCase()))throw Error(`Invalid group type: ${c}`);if(this.Log(`Removing ${c} group ${o} from library ${u}`),!(await this.ContentLibraryGroupPermissions({libraryId:u,permissions:[c]}))[o])return;c=c.charAt(0).toUpperCase()+c.substr(1).toLowerCase();const d=await this.CallContractMethodAndWait({contractAddress:this.utils.HashToAddress(u),methodName:`remove${c}Group`,methodArgs:[o]}),y=await this.ContractAbi({id:u});await this.ExtractEventFromLogs({abi:y,event:d,eventName:`${c}GroupRemoved`})},aa.ContentObjectGroupPermissions=async function({objectId:u}){t(u),this.Log(`Retrieving group permissions for object ${u}`);const o=this.utils.HashToAddress(u),c=await this.Collection({collectionType:"accessGroups"});let p;switch(await this.AccessType({id:u})){case this.authClient.ACCESS_TYPES.OBJECT:p="getContentObjectRights";break;case this.authClient.ACCESS_TYPES.TYPE:p="getContentTypeRights";break;case this.authClient.ACCESS_TYPES.GROUP:p="getAccessGroupRights";break;case this.authClient.ACCESS_TYPES.LIBRARY:p="getLibraryRights"}const d={};return await Promise.all(c.map(async y=>{try{y=this.utils.FormatAddress(y);let m=await this.CallContractMethod({contractAddress:y,methodName:p,methodArgs:[o]});if(m===0)return;let v=[];m>=100&&v.push("manage"),m%100>=10&&v.push("access"),m%10>0&&v.push("see"),d[y]=v}catch(m){this.Log(`Failed to retrieve group permissions for ${y}`,!0),this.Log(m,!0)}})),d},aa.AddContentObjectGroupPermission=async function({objectId:u,groupAddress:o,permission:c}){if(n("permission",c),t(u),o=a(o),this.utils.EqualAddress(o,this.utils.HashToAddress(u)))throw Error("Group rights cannot be set on the same group");if(c=c.toLowerCase(),!["see","access","manage"].includes(c))throw Error(`Invalid permission type: ${c}`);return this.Log(`Adding ${c} permission to group ${o} for ${u}`),await this.SetGroupPermission({groupAddress:o,objectId:u,permission:c})},aa.RemoveContentObjectGroupPermission=async function({objectId:u,groupAddress:o,permission:c}){if(n("permission",c),t(u),o=a(o),c=c.toLowerCase(),!["see","access","manage"].includes(c))throw Error(`Invalid permission type: ${c}`);return this.Log(`Removing ${c} permission from group ${o} for ${u}`),await this.SetGroupPermission({groupAddress:o,objectId:u,permission:c,remove:!0})},aa.LinkAccessGroupToOauth=async function({groupAddress:u,kmsId:o,oauthConfig:c}){a(u),n("kmsId",o),n("oauthConfig",c),typeof c=="string"&&(c=JSON.parse(c));const{publicKey:p}=await this.authClient.KMSInfo({kmsId:o}),d=`eluv.jwtv.${o}`,y=await this.Crypto.EncryptConk(c,p),m=`eluv.jwtv.iusr${this.utils.AddressToHash(this.signer.address)}`,v=await this.EncryptECIES({message:c}),b=this.utils.AddressToObjectId(u),x=(await this.EditContentObject({libraryId:this.contentSpaceLibraryId,objectId:b})).write_token;await this.ReplaceMetadata({libraryId:this.contentSpaceLibraryId,objectId:b,writeToken:x,metadataSubtree:d,metadata:y}),await this.ReplaceMetadata({libraryId:this.contentSpaceLibraryId,objectId:b,writeToken:x,metadataSubtree:m,metadata:v}),await this.FinalizeContentObject({libraryId:this.contentSpaceLibraryId,objectId:b,writeToken:x,commitMessage:"Bind access group to OAuth"}),await this.CallContractMethodAndWait({contractAddress:u,methodName:"setOAuthEnabled",methodArgs:[!1]}),await this.CallContractMethodAndWait({contractAddress:u,methodName:"setOAuthEnabled",methodArgs:[!0]})},aa.UnlinkAccessGroupFromOauth=async function({groupAddress:u}){a(u),await this.CallContractMethodAndWait({contractAddress:u,methodName:"setOAuthEnabled",methodArgs:[!1]})},aa}var lr={},TO;function TJ(){if(TO)return lr;TO=1;const n=Sl,{ValidateAddress:e,ValidateParameters:t,ValidatePresence:a,ValidateObject:s,ValidateVersion:u}=Cu(),o=gi();lr.ContractName=async function({contractAddress:y}){return y=e(y),await this.ethClient.ContractName(y)},lr.ContractAbi=async function({contractAddress:y,id:m}){const v=await this.authClient.ContractInfo({address:y,id:m});if(!v)throw Error(`Unable to determine contract info for ${y}`);return v.abi},lr.ContractInfo=async function({id:y,address:m}){return this.authClient.ContractInfo({id:y,address:m})},lr.FormatContractArguments=function({abi:y,methodName:m,args:v}){return this.ethClient.FormatContractArguments({abi:y,methodName:m,args:v})},lr.DeployContract=async function({abi:y,bytecode:m,constructorArgs:v,overrides:b={}}){return await this.ethClient.DeployContract({abi:y,bytecode:m,constructorArgs:v,overrides:b,signer:this.signer})},lr.ContractEvents=async function({contractAddress:y,abi:m,fromBlock:v=0,toBlock:b,count:x=1e3,topics:E,includeTransaction:C=!1}){y=e(y),m||(m=await this.ContractAbi({contractAddress:y}));const T=await this.FormatBlockNumbers({fromBlock:v,toBlock:b,count:x});return this.Log(`Querying contract events ${y} - Blocks ${T.fromBlock} to ${T.toBlock}`),await this.ethClient.ContractEvents({contractAddress:y,abi:m,fromBlock:T.fromBlock,toBlock:T.toBlock,topics:E,includeTransaction:C})},lr.CallContractMethod=async function({contractAddress:y,abi:m,methodName:v,methodArgs:b=[],value:x,overrides:E={},formatArguments:C=!0,cacheContract:T=!0,overrideCachedContract:k=!1}){return y=e(y),y=this.utils.FormatAddress(y),v==="setVisibility"&&this.visibilityInfo[y]&&delete this.visibilityInfo[y],m||(m=await this.ContractAbi({contractAddress:y})),await this.ethClient.CallContractMethod({contractAddress:y,abi:m,methodName:v,methodArgs:b,value:x,overrides:E,formatArguments:C,cacheContract:T,overrideCachedContract:k})},lr.CallContractMethodAndWait=async function({contractAddress:y,abi:m,methodName:v,methodArgs:b,value:x,overrides:E={},formatArguments:C=!0,cacheContract:T=!0,overrideCachedContract:k=!1}){return y=e(y),y=this.utils.FormatAddress(y),v==="setVisibility"&&this.visibilityInfo[y]&&delete this.visibilityInfo[y],m||(m=await this.ContractAbi({contractAddress:y})),await this.ethClient.CallContractMethodAndWait({contractAddress:y,abi:m,methodName:v,methodArgs:b,value:x,overrides:E,formatArguments:C,cacheContract:T,overrideCachedContract:k})},lr.ContractMetadata=async function({contractAddress:y,metadataKey:m}){a("contractAddress",y),a("metadataKey",m);try{const v=await this.CallContractMethod({contractAddress:y,methodName:"getMeta",methodArgs:[m]}),b=Buffer.from((v||"").replace("0x",""),"hex").toString("utf-8");try{return JSON.parse(b)}catch{return b}}catch{return""}},lr.MergeContractMetadata=async function({contractAddress:y,metadataKey:m,metadata:v}){a("contractAddress",y),a("metadataKey",m);const b=await this.ContractMetadata({contractAddress:y,metadataKey:m})||{};typeof b=="object"&&(v={...b,...v}),await this.CallContractMethodAndWait({contractAddress:y,methodName:"putMeta",methodArgs:[m,JSON.stringify(v)]})},lr.ReplaceContractMetadata=async function({contractAddress:y,metadataKey:m,metadata:v}){a("contractAddress",y),a("metadataKey",m),typeof v=="object"&&(v=JSON.stringify(v)),await this.CallContractMethodAndWait({contractAddress:y,methodName:"putMeta",methodArgs:[m,v]})},lr.CustomContractAddress=async function({libraryId:y,objectId:m,versionHash:v}){if(t({libraryId:y,objectId:m,versionHash:v}),v&&(m=this.utils.DecodeVersionHash(v).objectId),y===this.contentSpaceLibraryId||this.utils.EqualHash(y,m))return;this.Log(`Retrieving custom contract address: ${m}`);const b=await this.ContractAbi({id:m}),x=await this.ethClient.CallContractMethod({contractAddress:this.utils.HashToAddress(m),abi:b,methodName:"contentContractAddress",methodArgs:[]});if(x!==this.utils.nullAddress)return this.utils.FormatAddress(x)},lr.SetCustomContentContract=async function({libraryId:y,objectId:m,customContractAddress:v,name:b,description:x,abi:E,factoryAbi:C,overrides:T={}}){t({libraryId:y,objectId:m}),v=e(v),v=this.utils.FormatAddress(v),this.Log(`Setting custom contract address: ${m} ${v}`);const k=await this.ethClient.SetCustomContentContract({contentContractAddress:this.utils.HashToAddress(m),customContractAddress:v,overrides:T,signer:this.signer}),M=(await this.EditContentObject({libraryId:y,objectId:m})).write_token;return await this.ReplaceMetadata({libraryId:y,objectId:m,writeToken:M,metadataSubtree:"custom_contract",metadata:{name:b,description:x,address:v,abi:E,factoryAbi:C}}),await this.FinalizeContentObject({libraryId:y,objectId:m,writeToken:M,commitMessage:"Set custom contract"}),k},lr.ExtractEventFromLogs=function({abi:y,event:m,eventName:v}){return this.ethClient.ExtractEventFromLogs({abi:y,event:m,eventName:v})},lr.ExtractValueFromEvent=function({abi:y,event:m,eventName:v,eventValue:b}){const x=this.ethClient.ExtractEventFromLogs({abi:y,event:m,eventName:v,eventValue:b});return x?x.args[b]:void 0},lr.FormatBlockNumbers=async function({fromBlock:y,toBlock:m,count:v=10}){const b=await this.BlockNumber();return m?y||(y=m-v+1):y?m=y+v-1:(m=b,y=m-v+1),m>b&&(m=b),y<0&&(y=0),{fromBlock:y,toBlock:m}},lr.Events=async function({toBlock:y,fromBlock:m,count:v=10,includeTransaction:b=!1}={}){const x=await this.FormatBlockNumbers({fromBlock:m,toBlock:y,count:v});return this.Log(`Querying events - Blocks ${x.fromBlock} to ${x.toBlock}`),await this.ethClient.Events({fromBlock:x.fromBlock,toBlock:x.toBlock,includeTransaction:b})},lr.BlockNumber=async function(){return await this.ethClient.MakeProviderCall({methodName:"getBlockNumber"})},lr.GetBalance=async function({address:y}){y=e(y);const m=await this.ethClient.MakeProviderCall({methodName:"getBalance",args:[y]});return n.utils.formatEther(m)},lr.SendFunds=async function({recipient:y,ether:m}){return y=e(y),await(await this.signer.sendTransaction({to:y,value:n.utils.parseEther(m.toString())})).wait()};const c=async function({contractAddress:y,objectId:m,versionHash:v}){if(y)e(y),m=o.AddressToObjectId(y);else if(v)u(v),m=this.utils.DecodeVersionHash(v).objectId,y=o.HashToAddress(m);else if(m)s(m),y=o.HashToAddress(m);else throw Error("contractAddress or objectId or versionHash not specified");return{contractAddress:y,objectId:m}};lr.TenantId=async function({contractAddress:y,objectId:m,versionHash:v}){objectInfo=await c({contractAddress:y,objectId:m,versionHash:v}),y=objectInfo.contractAddress,m=objectInfo.objectId;let b;try{if(await this.authClient.ContractHasMethod({contractAddress:y,methodName:"getMeta"})&&(b=await this.ContractMetadata({contractAddress:y,metadataKey:"_tenantId"})),b===void 0){const E=await this.ContentObjectLibraryId({objectId:m});b=await this.ContentObjectMetadata({libraryId:E,objectId:m,metadataSubtree:"tenantId"})}return b}catch{return""}},lr.TenantContractId=async function({contractAddress:y,objectId:m,versionHash:v}){objectInfo=await c({contractAddress:y,objectId:m,versionHash:v}),y=objectInfo.contractAddress,m=objectInfo.objectId;try{const b=await this.authClient.ContractHasMethod({contractAddress:y,methodName:"getMeta"});let x;if(b&&(x=await this.ContractMetadata({contractAddress:y,metadataKey:"_ELV_TENANT_ID"})),x===void 0){const E=await this.ContentObjectLibraryId({objectId:m});x=await this.ContentObjectMetadata({libraryId:E,objectId:m,metadataSubtree:"tenantContractId"})}return x}catch{return""}},lr.SetTenantId=async function({contractAddress:y,objectId:m,versionHash:v,tenantId:b}){objectInfo=await c({contractAddress:y,objectId:m,versionHash:v}),y=objectInfo.contractAddress,m=objectInfo.objectId;const x=await this.authClient.AccessType(m);if(x!==this.authClient.ACCESS_TYPES.GROUP&&x!==this.authClient.ACCESS_TYPES.WALLET&&x!==this.authClient.ACCESS_TYPES.LIBRARY&&x!==this.authClient.ACCESS_TYPES.TYPE&&x!==this.authClient.ACCESS_TYPES.TENANT)throw Error(`Invalid object ID: ${m},
|
|
330
330
|
applicable only for wallet,group, library or content_type object.`);if(s(b),!b.startsWith("iten")||!o.ValidHash(b))throw Error(`Invalid tenant ID: ${b}`);if(await this.authClient.AccessType(b)!==this.authClient.ACCESS_TYPES.GROUP)throw Error("Invalid tenant ID: "+b);if(tenantContractId=await this.TenantContractId({objectId:b}),tenantContractId)return await this.SetTenantContractId({contractAddress:y,objectId:m,versionHash:v,tenantContractId});throw Error("Invalid tenantId: tenant contract id not found")},lr.SetTenantContractId=async function({contractAddress:y,objectId:m,versionHash:v,tenantContractId:b}){objectInfo=await c({contractAddress:y,objectId:m,versionHash:v}),y=objectInfo.contractAddress,m=objectInfo.objectId;const x=await this.authClient.AccessType(m);if(x!==this.authClient.ACCESS_TYPES.GROUP&&x!==this.authClient.ACCESS_TYPES.WALLET&&x!==this.authClient.ACCESS_TYPES.LIBRARY&&x!==this.authClient.ACCESS_TYPES.TYPE&&x!==this.authClient.ACCESS_TYPES.TENANT)throw Error(`Invalid object ID: ${m},
|
|
@@ -377,4 +377,4 @@ ${$.length}${$}`,"utf-8")),ye=e.utils.recoverAddress(se,R);return{type:M,message
|
|
|
377
377
|
left=${E}
|
|
378
378
|
`);return T&&window.focus&&T.focus(),T};return rp.ActionPopup=async({mode:o="tab",url:c,onMessage:p,onCancel:d})=>{await new Promise(y=>{const m=o==="popup"?u({url:c,title:"Eluvio Media Wallet",w:500,h:850}):window.open(c),v=setInterval(async()=>{m.closed&&(clearInterval(v),d&&await d(),y())},1e3);window.addEventListener("message",async b=>{await p(b,()=>{clearInterval(v),m.close(),y()})})})},rp}var sn={},nL;function lee(){if(nL)return sn;nL=1;const n=gi(),e=vi(),{FormatNFTDetails:t,FormatNFTMetadata:a,FormatNFT:s}=XI(),u=FP();return sn.UserInfo=function(){if(this.loggedIn)return{name:this.__authorization.email||this.UserAddress(),address:this.UserAddress(),email:this.__authorization.email,walletType:this.__authorization.walletType,walletName:this.__authorization.walletName}},sn.UserAddress=function(){if(this.loggedIn)return this.client.utils.DecodeSignedToken(this.AuthToken()).payload.adr},sn.UserWalletBalance=async function(o=!1){if(!this.loggedIn)return;const{balance:c,usage_hold:p,payout_hold:d,locked_offer_balance:y,stripe_id:m,stripe_payouts_enabled:v}=await this.client.utils.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt","bal"),method:"GET",headers:{Authorization:`Bearer ${this.AuthToken()}`}})),b=m,x=v,E=parseFloat(c||0),C=parseFloat(y||0),T=Math.max(0,E-parseFloat(p||0)-C),k=Math.max(0,E-T),M=Math.max(0,E-parseFloat(Math.max(d,C)||0));if(o&&m&&!v){const R=new URL(e(window.location.origin,window.location.pathname)).toString();return await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","onb","stripe"),method:"POST",body:{country:"US",mode:this.mode,refresh_url:R.toString(),return_url:R.toString()},headers:{Authorization:`Bearer ${this.AuthToken()}`}}),await this.UserWalletBalance(!1)}let O={totalWalletBalance:E,availableWalletBalance:T,lockedWalletBalance:C,pendingWalletBalance:k,withdrawableWalletBalance:M};return x&&(O.userStripeId=b,O.userStripeEnabled=x),O},sn.UserItemNames=async function({marketplaceParams:o,userAddress:c}={}){let p=[];return o&&p.push(`tenant:eq:${(await this.MarketplaceInfo({marketplaceParams:o})).tenantId}`),c&&p.push(`wlt:eq:${n.FormatAddress(c)}`),await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","names"),method:"GET",queryParams:{filter:p}}))},sn.UserItemEditionNames=async function({displayName:o}){return await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","editions"),method:"GET",queryParams:{filter:`meta/display_name:eq:${o}`}}))},sn.UserItemAttributes=async function({marketplaceParams:o,displayName:c,userAddress:p}={}){let d=[];return o&&d.push(`tenant:eq:${(await this.MarketplaceInfo({marketplaceParams:o})).tenantId}`),p&&d.push(`wlt:eq:${n.FormatAddress(p)}`),c&&d.push(`meta/display_name:eq:${c}`),(await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","attributes"),method:"GET",queryParams:{filter:d}}))).map(({trait_type:m,values:v})=>({name:m,values:v})).filter(({name:m})=>!["Content Fabric Hash","Total Minted Supply","Creator"].includes(m))},sn.UserItems=async function({sortBy:o="default",includeFullMetadata:c=!1}={}){return c&&this.loggedIn?this.FilteredQuery({mode:"owned-full-meta",sortBy:o,...arguments[0]||{}}):this.FilteredQuery({mode:"owned",sortBy:o,...arguments[0]||{}})},sn.UserListings=async function({userAddress:o,sortBy:c="created",sortDesc:p=!1,contractAddress:d,tokenId:y,marketplaceParams:m}={}){return(await this.FilteredQuery({mode:"listings",start:0,limit:1e4,sortBy:c,sortDesc:p,sellerAddress:o||this.UserAddress(),marketplaceParams:m,contractAddress:d,tokenId:y,includeCheckoutLocked:!0})).results},sn.UserSales=async function({userAddress:o,sortBy:c="created",sortDesc:p=!1,contractAddress:d,tokenId:y,startTime:m,endTime:v,lastNDays:b,marketplaceParams:x}={}){return(await this.FilteredQuery({mode:"sales",start:0,limit:1e4,sortBy:c,sortDesc:p,sellerAddress:o||this.UserAddress(),startTime:m,endTime:v,lastNDays:b,marketplaceParams:x,contractAddress:d,tokenId:y})).results},sn.UserTransfers=async function({userAddress:o,sortBy:c="created",sortDesc:p=!1,contractAddress:d,tokenId:y,startTime:m,endTime:v,lastNDays:b,marketplaceParams:x}={}){return(await this.FilteredQuery({mode:"transfers",start:0,limit:1e4,sortBy:c,sortDesc:p,sellerAddress:o||this.UserAddress(),marketplaceParams:x,contractAddress:d,tokenId:y,startTime:m,endTime:v,lastNDays:b})).results},sn.TenantConfiguration=async function({tenantId:o,contractAddress:c}){try{return c=c?n.FormatAddress(c):void 0,this.tenantConfigs[c||o]||(this.tenantConfigs[c||o]=await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:c?e("as","config","nft",c):e("as","config","tnt",o),method:"GET"}))),this.tenantConfigs[c||o]}catch(p){return this.Log("Failed to load tenant configuration",!0,p),{}}},sn.ExchangeRate=async function({currency:o}){if(!o)throw Error("Eluvio Wallet Client: Invalid or missing currency in ExchangeRate");return await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","xr","ebanx",o),method:"GET"}))},sn.TenantCSS=async function({tenantSlug:o}){return this.cachedCSS[o]||(this.cachedCSS[o]=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:e("/public","asset_metadata","tenants",o,"info","branding","wallet_css"),authorizationToken:this.publicStaticToken})),this.cachedCSS[o]||""},sn.MarketplaceStock=async function({marketplaceParams:o,tenantId:c}){return c||(c=this.MarketplaceInfo({marketplaceParams:o}).tenantId),this.loggedIn?await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","nft","info",c),method:"GET",headers:{Authorization:`Bearer ${this.AuthToken()}`}})):await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","nft","stock",c),method:"GET"}))},sn.MarketplaceInfo=function({marketplaceParams:o}){let{tenantSlug:c,marketplaceSlug:p,marketplaceId:d,marketplaceHash:y}=o||{},m;if(c&&p?m=(this.availableMarketplaces[c]||{})[p]:(d=y?this.client.utils.DecodeVersionHash(y).objectId:d,m=this.availableMarketplacesById[d]),!m)throw Error(`Eluvio Wallet Client: Unable to find marketplace with parameters ${JSON.stringify(arguments)}`);return m},sn.MarketplaceCSS=async function({marketplaceParams:o}){const p=this.MarketplaceInfo({marketplaceParams:o}).marketplaceHash;return this.cachedCSS[p]||(this.cachedCSS[p]=await this.client.ContentObjectMetadata({versionHash:p,metadataSubtree:"public/asset_metadata/info/branding/custom_css",authorizationToken:this.publicStaticToken,noAuth:!0})),this.cachedCSS[p]||""},sn.AvailableMarketplaces=async function({organizeById:o,forceReload:c=!1}={}){return c&&await this.LoadAvailableMarketplaces(!0),{...o?this.availableMarketplacesById:this.availableMarketplaces}},sn.Marketplace=async function({marketplaceParams:o}){return this.LoadMarketplace(o)},sn.NFTContractStats=async function({contractAddress:o}){return await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","nft","info",o),method:"GET"}))},sn.NFT=async function({tokenId:o,contractAddress:c}){let p=t(await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","nft","info",c,o),method:"GET"})));const d=await this.client.ContentObjectMetadata({versionHash:p.details.VersionHash,metadataSubtree:"public/asset_metadata/nft",produceLinkUrls:!0})||{};if(p.metadata=u({},d,p.metadata,(y,m)=>m===null||m===""?y:void 0),this.localization){const y=await this.client.ContentObjectMetadata({versionHash:p.details.VersionHash,metadataSubtree:e("public","asset_metadata","localizations",this.localization,"nft"),produceLinkUrls:!0})||{};p.metadata=u({},p.metadata,y,(m,v)=>v===null||v===""?m:void 0)}return p.config=await this.TenantConfiguration({contractAddress:c}),a(this,p)},sn.TransferNFT=async function({contractAddress:o,tokenId:c,targetAddress:p}){if(!p||!n.ValidAddress(p))throw Error("Eluvio Wallet Client: Invalid or missing target address in UserTransferNFT");return await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt","xfer"),method:"POST",body:{contract:n.FormatAddress(o),token:c,to_addr:n.FormatAddress(p)},headers:{Authorization:`Bearer ${this.AuthToken()}`}})},sn.ListingStatus=async function({listingId:o}){try{return await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","mkt","status",o),method:"GET"}))}catch(c){if(c.status===404)return;throw c}},sn.Listing=async function({listingId:o}){return s(this,await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","mkt","l",o),method:"GET"})))},sn.Listings=async function(){return this.FilteredQuery({mode:"listings",...arguments[0]||{}})},sn.ListingStats=async function(){return this.FilteredQuery({mode:"listing-stats",...arguments[0]||{}})},sn.Sales=async function(){return this.FilteredQuery({mode:"sales",...arguments[0]||{}})},sn.Transfers=async function(){return this.FilteredQuery({mode:"transfers",...arguments[0]||{}})},sn.SalesStats=async function(){return this.FilteredQuery({mode:"sales-stats",...arguments[0]||{}})},sn.Leaderboard=async function({userAddress:o,marketplaceParams:c}){if(o){let p={addr:n.FormatAddress(o)};return c&&(p.filter=[`tenant:eq:${(await this.MarketplaceInfo({marketplaceParams:c})).tenantId}`]),(await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","ranks"),method:"GET",queryParams:p}))||[])[0]}return this.FilteredQuery({mode:"leaderboard",...arguments[0]||{}})},sn.CreateListing=async function({contractAddress:o,tokenId:c,price:p,listingId:d}){return o=n.FormatAddress(o),d?await n.ResponseToFormat("text",await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt"),method:"PUT",body:{id:d,price:parseFloat(p)},headers:{Authorization:`Bearer ${this.AuthToken()}`}})):await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt"),method:"POST",body:{contract:o,token:c,price:parseFloat(p)},headers:{Authorization:`Bearer ${this.AuthToken()}`}}))},sn.RemoveListing=async function({listingId:o}){await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt",o),method:"DELETE",headers:{Authorization:`Bearer ${this.AuthToken()}`}})},sn.SalesNames=async function({marketplaceParams:o}){let c;return o&&(c=(await this.MarketplaceInfo({marketplaceParams:o})).tenantId),await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","mkt","names","hst"),method:"GET",queryParams:c?{filter:`tenant:eq:${c}`}:{}}))},sn.ListingNames=async function({marketplaceParams:o}){let c;return o&&(c=(await this.MarketplaceInfo({marketplaceParams:o})).tenantId),await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","mkt","names"),method:"GET",queryParams:c?{filter:`tenant:eq:${c}`}:{}}))},sn.ListingEditionNames=async function({displayName:o}){return await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","mkt","editions"),queryParams:{filter:`nft/display_name:eq:${o}`},method:"GET"}))},sn.ListingAttributes=async function({marketplaceParams:o,displayName:c}={}){let p=[];return o&&p.push(`tenant:eq:${(await this.MarketplaceInfo({marketplaceParams:o})).tenantId}`),c&&p.push(`nft/display_name:eq:${c}`),(await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","mkt","attributes"),method:"GET",queryParams:{filter:p}}))).map(({trait_type:y,values:m})=>({name:y,values:m})).filter(({name:y})=>!["Content Fabric Hash","Total Minted Supply","Creator"].includes(y))},sn.ClaimGift=async function({code:o}){return await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({method:"POST",path:e("as","wlt","gifts","claim"),body:{otp_code:o},headers:{Authorization:`Bearer ${this.AuthToken()}`}}))},sn.ClaimItem=async function({marketplaceParams:o,sku:c,email:p}){const d=await this.MarketplaceInfo({marketplaceParams:o});await this.client.authClient.MakeAuthServiceRequest({method:"POST",path:e("as","wlt","act",d.tenant_id),body:{op:"nft-claim",sid:d.marketplaceId,sku:c,email:p},headers:{Authorization:`Bearer ${this.AuthToken()}`}})},sn.PurchaseItem=async function({marketplaceParams:o,sku:c,confirmationId:p,successUrl:d,cancelUrl:y}){const m=await this.MarketplaceInfo({marketplaceParams:o});window.location.href=this.FlowURL({type:"action",flow:"purchase",marketplaceId:m.marketplaceId,parameters:{sku:c,confirmationId:p,successUrl:d,cancelUrl:y,login:!0,auth:this.ClientAuthToken()}})},sn.PurchaseListing=async function({marketplaceParams:o,listingId:c,confirmationId:p,successUrl:d,cancelUrl:y}){let m;o&&(m=await this.MarketplaceInfo({marketplaceParams:o})),window.location.href=this.FlowURL({type:"action",flow:"purchase",marketplaceId:m&&m.marketplaceId,parameters:{listingId:c,confirmationId:p,successUrl:d,cancelUrl:y,login:!0,auth:this.ClientAuthToken()}})},sn.ListingPurchaseStatus=async function({listingId:o,confirmationId:c}){try{const p=await this.ListingStatus({listingId:o});if(!p)throw Error("Unable to find info for listing "+o);return(await this.MintingStatus({tenantId:p.tenant})).find(y=>y.op==="nft-transfer"&&y.extra&&y.extra[0]===c)||{status:"none"}}catch(p){return this.Log(p,!0),{status:"unknown"}}},sn.PurchaseStatus=async function({marketplaceParams:o,confirmationId:c}){try{const p=await this.MarketplaceInfo({marketplaceParams:o});return(await this.MintingStatus({tenantId:p.tenantId})).find(y=>y.op==="nft-buy"&&y.confirmationId===c)||{status:"none"}}catch(p){return this.Log(p,!0),{status:"unknown"}}},sn.ClaimStatus=async function({marketplaceParams:o,sku:c}){try{const p=await this.MarketplaceInfo({marketplaceParams:o});return(await this.MintingStatus({tenantId:p.tenantId})).find(y=>y.op==="nft-claim"&&y.marketplaceId===p.marketplaceId&&y.confirmationId===c)||{status:"none"}}catch(p){return this.Log(p,!0),{status:"unknown"}}},sn.GiftClaimStatus=async function({marketplaceParams:o,confirmationId:c,giftId:p}){try{const d=await this.MarketplaceInfo({marketplaceParams:o}),m=(await this.MintingStatus({tenantId:d.tenantId})).filter(v=>v.op==="nft-transfer"&&(c&&v.confirmationId===c||p&&v.giftId===p))||{status:"none"};return m.length===0?{status:"none"}:m.find(v=>v.status==="failed")?{status:"failed",op:"nft-transfer",transfer_statuses:m}:m.find(v=>v.status!=="complete")?{status:"pending",op:"nft-transfer",transfer_statuses:m}:{status:"complete",op:"nft-transfer",transfer_statuses:m,items:m.map(v=>({token_addr:v.address,token_id_str:v.tokenId}))}}catch(d){return this.Log(d,!0),{status:"unknown"}}},sn.EntitlementClaimStatus=async function({marketplaceParams:o,purchaseId:c}){try{const p=await this.MarketplaceInfo({marketplaceParams:o}),y=(await this.MintingStatus({tenantId:p.tenantId})).filter(m=>m.op==="nft-claim-entitlement"&&c&&c==m.confirmationId)||{status:"none"};return y.length===0?{status:"none"}:y.find(m=>m.status==="complete")?{status:"complete",op:"nft-claim-entitlement",items:[{token_addr:y[0].address,token_id:y[0].tokenId}]}:y.find(m=>m.status==="error")?{status:"error",op:"nft-claim-entitlement"}:{status:"pending",op:"nft-claim-entitlement"}}catch(p){return this.Log(p,!0),{status:"unknown"}}},sn.PackOpenStatus=async function({contractAddress:o,tokenId:c}){try{const p=await this.TenantConfiguration({contractAddress:o});return(await this.MintingStatus({tenantId:p.tenant})).find(y=>y.op==="nft-open"&&n.EqualAddress(o,y.address)&&y.tokenId===c)||{status:"none"}}catch(p){return this.Log(p,!0),{status:"unknown"}}},sn.CollectionRedemptionStatus=async function({marketplaceParams:o,confirmationId:c}){try{return(await this.MintingStatus({marketplaceParams:o})).find(d=>d.op==="nft-redeem"&&d.confirmationId===c)||{status:"none"}}catch(p){return this.Log(p,!0),{status:"unknown"}}},sn.RedeemableOfferStatus=async function({tenantId:o,marketplaceParams:c,contractAddress:p,tokenId:d,offerId:y}){try{const m=await this.MintingStatus({marketplaceParams:c,tenantId:o});return p=n.FormatAddress(p),m.find(v=>v.op==="nft-offer-redeem"&&n.EqualAddress(v.address,p)&&v.tokenId===(d||"").toString()&&v.offerId===(y||"").toString())||{status:"none"}}catch(m){return this.Log(m,!0),{status:"unknown"}}},sn.RedeemableCustomFulfillmentInfo=async function({redeemableTransactionId:o}){return await n.ResponseToJson(this.stateStoreClient.Request({method:"GET",path:e("code-fulfillment",this.network==="main"?"main":"demov3","fulfill",o),headers:{Authorization:`Bearer ${this.AuthToken()}`}}))},sn.LoadDrop=async function({tenantSlug:o,eventSlug:c,dropId:p}){if(this.drops||(this.drops={}),this.drops[o]||(this.drops[o]={}),this.drops[o][c]||(this.drops[o][c]={}),!this.drops[o][c][p]){const d=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:e("public","asset_metadata","tenants",o,"sites",c,"info"),resolveLinks:!0,linkDepthLimit:2,resolveIncludeSource:!0,produceLinkUrls:!0,select:[".","drops"],noAuth:!0})||[],y=n.DecodeVersionHash(d["."].source).objectId;d.drops.forEach(m=>{m={...m,eventId:y},this.drops[o][c][m.uuid]=m,this.drops[m.uuid]=m})}return this.drops[p]},sn.SubmitDropVote=async function({marketplaceParams:o,eventId:c,dropId:p,sku:d}){const y=await this.MarketplaceInfo({marketplaceParams:o});await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","act",y.tenant_id),method:"POST",body:{op:"vote-drop",evt:c,id:p,itm:d},headers:{Authorization:`Bearer ${this.AuthToken()}`}})},sn.DropStatus=async function({marketplace:o,eventId:c,dropId:p}){try{return(await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","act",o.tenant_id,c,p),method:"GET",headers:{Authorization:`Bearer ${this.AuthToken()}`}}))).sort((y,m)=>y.ts>m.ts?1:-1)[0]||{status:"none"}}catch(d){return this.Log(d,!0),""}},sn.MarketplaceOffers=async function({contractAddress:o,tokenId:c,buyerAddress:p,sellerAddress:d,statuses:y,start:m=0,limit:v=10}){let b=e("as","mkt","offers","ls");p?b=e(b,"b",n.FormatAddress(p)):d&&(b=e(b,"s",n.FormatAddress(d))),o&&(b=e(b,"c",n.FormatAddress(o)),c&&(b=e(b,"t",c)));let x={start:m,limit:v};return y&&y.length>0&&(x.include=y.join(",")),(await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:b,method:"GET",queryParams:x}))).map(C=>({...C,created:C.created*1e3,updated:C.updated*1e3,expiration:C.expiration*1e3}))},sn.CreateMarketplaceOffer=async function({contractAddress:o,tokenId:c,offerId:p,price:d,expiresAt:y}){let m;return p?m=await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt","offers",p),method:"PUT",body:{price:d,expiration:Math.floor(y/1e3)},headers:{Authorization:`Bearer ${this.AuthToken()}`}})):m=await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt","offers",o,c),method:"POST",body:{contract:o,token:c,price:d,expiration:Math.floor(y/1e3)},headers:{Authorization:`Bearer ${this.AuthToken()}`}})),m.offer_id},sn.RemoveMarketplaceOffer=async function({offerId:o}){return await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt","offers",o),method:"DELETE",headers:{Authorization:`Bearer ${this.AuthToken()}`}})},sn.AcceptMarketplaceOffer=async function({offerId:o}){return await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt","offers","accept",o),method:"PUT",headers:{Authorization:`Bearer ${this.AuthToken()}`}})},sn.RejectMarketplaceOffer=async function({offerId:o}){return await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt","offers","decline",o),method:"PUT",headers:{Authorization:`Bearer ${this.AuthToken()}`}})},sn.VoteStatus=async function({tenantId:o,votingEventId:c}){return await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","votes",o,c),headers:{Authorization:`Bearer ${this.AuthToken()}`}}))},sn.CastVote=async function({tenantId:o,votingEventId:c,sku:p}){return await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","votes",o,c,p),method:"POST",headers:{Authorization:`Bearer ${this.AuthToken()}`}}))},sn.RevokeVote=async function({tenantId:o,votingEventId:c,sku:p}){return await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","votes",o,c,p),method:"DELETE",headers:{Authorization:`Bearer ${this.AuthToken()}`}}))},sn}var ap={},rL;function cee(){if(rL)return ap;rL=1;const n=gi(),e=vi(),t=({network:s,path:u})=>e(s==="main"?"/main":"/dv3",u),a=({network:s,appId:u,userAddress:o,key:c,type:p,mode:d})=>t({network:s,path:e(p==="app"?"app":"usr",p==="app"?u:"",o,d==="public"?"pub":"pri",c||"")});return ap.ProfileMetadata=async function({type:s="app",mode:u="public",appId:o,userAddress:c,key:p}){try{const d=await this.stateStoreClient.Request({path:a({network:this.network,appId:o||this.appId,userAddress:c||this.UserAddress(),type:s,mode:u,key:p}),headers:u==="private"?{Authorization:`Bearer ${this.AuthToken()}`}:void 0});if(!d.ok)throw d;return(await n.ResponseToJson(d))[p]}catch(d){if(d.status===404)return;throw d}},ap.SetProfileMetadata=async function({type:s="app",mode:u="public",appId:o,key:c,value:p}){await this.stateStoreClient.Request({method:"POST",path:a({network:this.network,appId:o||this.appId,userAddress:this.UserAddress(),type:s,mode:u,key:c}),body:p,bodyType:typeof p=="object"?"JSON":"string",headers:{Authorization:`Bearer ${this.AuthToken()}`}})},ap.RemoveProfileMetadata=async function({type:s="app",mode:u="public",appId:o,key:c}){await this.stateStoreClient.Request({method:"DELETE",path:a({network:this.network,appId:o||this.appId,userAddress:this.UserAddress(),type:s,mode:u,key:c}),headers:{Authorization:`Bearer ${this.AuthToken()}`}})},ap.Profile=async function({userAddress:s,userName:u}){if(u&&(s=await this.UserNameToAddress({userName:u})),!s)throw Error("Eluvio Wallet Client: Unable to determine profile - user address not specified");u||(u=await this.ProfileMetadata({type:"user",userAddress:s,key:"username"}));const o=await this.ProfileMetadata({type:"user",userAddress:s,key:"icon_url"});let c=await this.ProfileMetadata({type:"app",mode:"public",appId:"elv-badge-srv",userAddress:this.badgerAddress,key:`badges_${n.FormatAddress(s)}`}),p=[];if(c)try{c=JSON.parse(c).badges,p=Object.keys(c).map(d=>({...c[d],name:d}))}catch(d){this.Log(`Failed to load badge info for ${u||s}`,!0),this.Log(d,!0)}return{userAddress:n.FormatAddress(s),userName:u,imageUrl:o,badges:p}},ap.UserNameToAddress=async function({userName:s}){try{const u=await this.stateStoreClient.Request({method:"GET",path:t({network:this.network,path:e("usr","profile_for_username",s)})});if(!u.ok)throw u;return(await n.ResponseToJson(u)).address}catch(u){if(u.status!==404)throw u}},ap}var ig={},aL;function fee(){if(aL)return ig;aL=1;const n=gi(),e=vi(),t=({network:a,path:s})=>e("/push",a==="main"?"/main":"/dv3",s);return ig.PushNotification=async function({tenantId:a,eventType:s,data:u,userAddress:o}){await this.stateStoreClient.Request({method:"POST",path:t({network:this.network,path:e("notify_user",o||this.UserAddress(),a,s)}),body:u,headers:{Authorization:`Bearer ${this.AuthToken()}`}})},ig.AddNotificationListener=async function({onMessage:a}){if(!a)throw Error("Eluvio Wallet Client: No onMessage callback provided to AddNotificationListener");const s=new URL(this.stateStoreClient.BaseURI().toString());s.pathname=t({network:this.network,path:e("register",this.UserAddress(),this.AuthToken())});const u=new EventSource(s);return u.onmessage=o=>{let c=JSON.parse(o.data);try{c.data=JSON.parse(c.data)}catch{}a(c)},u},ig.Notifications=async function({tenantId:a,types:s,offsetId:u,limit:o=10}={}){let c={limit:o};a&&(c.tenant_id=a),s&&(c.types=Array.isArray(s)?s.join(","):s),u&&(c.offset_by=u);const{records:p}=await n.ResponseToJson(this.stateStoreClient.Request({method:"GET",path:t({network:this.network,path:e("history",this.UserAddress())}),queryParams:c,headers:{Authorization:`Bearer ${this.AuthToken()}`}}));return p.map(d=>{try{d.data=JSON.parse(d.data)}catch{}return d})},ig}var iL;function dee(){if(iL)return JE;iL=1;const{ElvClient:n}=QI(),e=uee(),{LinkTargetHash:t,FormatNFT:a,ActionPopup:s}=XI(),u=If(),o=vi(),c=gi(),p=Sl,d=typeof window<"u",y=d&&window.top!==window.self;let m=!1;try{typeof localStorage<"u"&&localStorage.getItem("test"),m=!0}catch{}class v{constructor({appId:x,client:E,network:C,mode:T,localization:k,marketplaceInfo:M,previewMarketplaceHash:O,storeAuthToken:R}){this.appId=x,this.client=E,this.loggedIn=!1,this.localization=k,this.network=C,this.mode=T,this.purchaseMode=e[C][T].purchaseMode,this.mainSiteLibraryId=e[C][T].siteLibraryId,this.mainSiteId=e[C][T].siteId,this.appUrl=e[C][T].appUrl,this.publicStaticToken=E.staticToken,this.storeAuthToken=R,this.selectedMarketplaceInfo=M,this.previewMarketplaceId=O?c.DecodeVersionHash(O).objectId:void 0,this.previewMarketplaceHash=O,this.availableMarketplaces={},this.availableMarketplacesById={},this.marketplaceHashes={},this.tenantConfigs={},this.stateStoreUrls=e[C].stateStoreUrls,this.stateStoreClient=new u({uris:this.stateStoreUrls}),this.badgerAddress=e[C].badgerAddress,this.cachedMarketplaces={},this.cachedCSS={},this.utils=E.utils,this.ForbiddenMethods=v.ForbiddenMethods}Log(x,E=!1,C){E?console.error("Eluvio Wallet Client:",x):console.log("Eluvio Wallet Client:",x),C&&console.error(C)}static ForbiddenMethods(){return["constructor","Authenticate","AuthenticateOAuth","AuthenticateExternalWallet","AuthToken","ClientAuthToken","Initialize","Log","LogIn","LogOut","PersonalSign","SetAuthorization","SignMetamask"]}static AllowedMethods(){return Object.getOwnPropertyNames(v.prototype).filter(x=>!v.ForbiddenMethods().includes(x)).sort()}static async Initialize({client:x,appId:E="general",network:C="main",mode:T="production",localization:k,marketplaceParams:M,previewMarketplaceId:O,storeAuthToken:R=!0,skipMarketplaceLoad:$=!1}){let{tenantSlug:X,marketplaceSlug:se,marketplaceId:ye,marketplaceHash:he}=M||{};if(e[C]){if(!e[C][T])throw Error(`ElvWalletClient: Invalid mode ${T}`)}else throw Error(`ElvWalletClient: Invalid network ${C}`);x||(x=await n.FromNetworkName({networkName:C,assumeV3:!0}));let te=O;te&&!te.startsWith("hq__")&&(te=await x.LatestVersionHash({objectId:O}));const re=new v({appId:E,client:x,network:C,mode:T,localization:k,marketplaceInfo:{tenantSlug:X,marketplaceSlug:se,marketplaceId:he?x.utils.DecodeVersionHash(he).objectId:ye,marketplaceHash:he},previewMarketplaceHash:te,storeAuthToken:R});if(d&&window.location&&window.location.href){let S=new URL(window.location.href);if(S.searchParams.get("elvToken"))await re.Authenticate({token:S.searchParams.get("elvToken")}),S.searchParams.delete("elvToken"),window.history.replaceState("","",S);else if(R&&m)try{let _=localStorage.getItem(`__elv-token-${C}`);_&&await re.Authenticate({token:_})}catch{}}return $||re.LoadAvailableMarketplaces(),re}CanSign(){return this.loggedIn?!!this.__authorization.clusterToken||d&&!!(this.UserInfo().walletName.toLowerCase()==="metamask"&&window.ethereum&&window.ethereum.isMetaMask&&window.ethereum.chainId):!1}async PersonalSign({message:x}){if(!this.loggedIn)throw Error("ElvWalletClient: Unable to perform signature - Not logged in");if(this.CanSign()){if(this.__authorization.clusterToken)return x=typeof x=="object"?JSON.stringify(x):x,x=p.utils.keccak256(Buffer.from(`Ethereum Signed Message:
|
|
379
379
|
${x.length}${x}`,"utf-8")),await this.client.authClient.Sign(x);if(this.UserInfo().walletName.toLowerCase()==="metamask")return this.SignMetamask({message:x,address:this.UserAddress()});throw Error("ElvWalletClient: Unable to sign")}else if(!d)throw Error("ElvWalletClient: Unable to sign");const E={action:"personal-sign",message:x,logIn:!0};let C=new URL(this.appUrl);if(C.hash=o("/action","sign",c.B58(JSON.stringify(E))),C.searchParams.set("origin",window.location.origin),!y&&window.location.origin===C.origin)throw Error("ElvWalletClient: Unable to sign");return await new Promise(async(T,k)=>{await s({mode:"tab",url:C.toString(),onCancel:()=>k("User cancelled sign"),onMessage:async(M,O)=>{if(!(!M||!M.data||M.data.type!=="FlowResponse"))try{T(M.data.response)}catch(R){k(R)}finally{O()}}})})}async LogInURL({mode:x="login",provider:E,marketplaceParams:C,clearLogin:T}){let k=new URL(this.appUrl);return k.hash="/login",k.searchParams.set("action","login"),typeof window<"u"&&k.searchParams.set("origin",window.location.origin),E&&k.searchParams.set("provider",E),x&&k.searchParams.set("mode",x),C?k.searchParams.set("mid",(await this.MarketplaceInfo({marketplaceParams:C})).marketplaceHash):(this.selectedMarketplaceInfo||{}).marketplaceHash&&k.searchParams.set("mid",this.selectedMarketplaceInfo.marketplaceHash),T&&k.searchParams.set("clear",""),k}async LogIn({method:x="redirect",provider:E,mode:C="login",callbackUrl:T,marketplaceParams:k,clearLogin:M=!1,callback:O}){let R=await this.LogInURL({mode:C,provider:E,marketplaceParams:k,clearLogin:M});x==="redirect"?(R.searchParams.set("response","redirect"),R.searchParams.set("source","origin"),R.searchParams.set("redirect",T),window.location=R):(R.searchParams.set("response","message"),R.searchParams.set("source","parent"),await new Promise(async($,X)=>{await s({mode:"tab",url:R.toString(),onCancel:()=>X("User cancelled login"),onMessage:async(se,ye)=>{if(!(!se||!se.data||se.data.type!=="LoginResponse"))try{O?await O(se.data.params):await this.Authenticate({token:se.data.params.clientSigningToken||se.data.params.clientAuthToken}),$()}catch(he){X(he)}finally{ye()}}})}))}async LogOut(){if(this.__authorization&&(this.__authorization.nonce||this.__authorization.installId))try{await this.client.signer.ReleaseCSAT({accessToken:this.AuthToken()})}catch(x){this.Log("Failed to release token",!0,x)}if(this.__authorization={},this.loggedIn=!1,this.cachedMarketplaces={},m)try{localStorage.removeItem(`__elv-token-${this.network}`)}catch{}}async TokenStatus(){return!this.__authorization||!(this.__authorization.nonce||this.__authorization.installId)?!0:await this.client.signer.CSATStatus({accessToken:this.AuthToken()})}async Authenticate({token:x}){let E;try{E=JSON.parse(this.utils.FromB58ToStr(x))||{}}catch{throw new Error("Invalid authorization token "+x)}if(!E.expiresAt||Date.now()>E.expiresAt)throw Error("ElvWalletClient: Provided authorization token has expired");return E.clusterToken&&await this.client.SetRemoteSigner({authToken:E.clusterToken,signerURIs:E.signerURIs}),this.client.SetStaticToken({token:E.fabricToken}),this.SetAuthorization({...E})}async AuthenticateOAuth({idToken:x,userIdCode:E,tenantId:C,email:T,signerURIs:k,shareEmail:M=!1,extraData:O={},nonce:R,installId:$,appName:X,createRemoteToken:se=!0,force:ye=!1,tokenDuration:he=24}){!C&&this.selectedMarketplaceInfo&&(await this.AvailableMarketplaces(),C=this.selectedMarketplaceInfo.tenantId),await this.client.SetRemoteSigner({idToken:x,userIdCode:E,tenantId:C,signerURIs:k,extraData:{...O,share_email:M},unsignedPublicAuth:!0});let te,re,S;if(se&&this.client.signer.remoteSigner){S=Date.now()+he*60*60*1e3;const P=await this.client.signer.RetrieveCSAT({email:T,nonce:R,installId:$,appName:X,tenantId:C,force:ye,duration:he});te=P.token,R=P.nonce||R,$=P.installId||$,re=P.refresh_token}else S=Date.now()+he*60*60*1e3,te=await this.client.CreateFabricToken({duration:parseInt(he*60*60*1e3),context:T?{usr:{email:T}}:{}});const _=this.client.utils.FormatAddress(this.client.CurrentAccountAddress());if(!T&&x)try{T=JSON.parse(this.utils.FromB64URL(x.split(".")[1])).email}catch{throw Error("Failed to decode ID token")}return this.client.SetStaticToken({token:te}),{authToken:this.SetAuthorization({fabricToken:te,refreshToken:re,tenantId:C,address:_,email:T,expiresAt:S,signerURIs:k,walletType:"Custodial",walletName:"Eluvio",register:!0,nonce:R,installId:$}),signingToken:this.SetAuthorization({clusterToken:this.client.signer.authToken,fabricToken:te,refreshToken:re,tenantId:C,address:_,email:T,expiresAt:S,signerURIs:k,walletType:"Custodial",walletName:"Eluvio",nonce:R,installId:$})}}async AuthenticateExternalWallet({address:x,tokenDuration:E=24,walletName:C="Metamask",Sign:T}){x||(x=window.ethereum.selectedAddress),x=this.utils.FormatAddress(x),T||(T=async O=>this.SignMetamask({message:O,address:x}));const k=Date.now()+E*60*60*1e3,M=await this.client.CreateFabricToken({address:x,duration:E*60*60*1e3,Sign:T,addEthereumPrefix:!1});return this.SetAuthorization({fabricToken:M,address:x,expiresAt:k,walletType:"External",walletName:C,register:!0})}ClientAuthToken(){return this.loggedIn?this.utils.B58(JSON.stringify(this.__authorization)):""}AuthToken(){return this.loggedIn?this.__authorization.fabricToken:this.publicStaticToken}SetAuthorization({clusterToken:x,fabricToken:E,refreshToken:C,tenantId:T,address:k,email:M,expiresAt:O,signerURIs:R,walletType:$,walletName:X,nonce:se,installId:ye,register:he=!1}){k=this.client.utils.FormatAddress(k),this.__authorization={fabricToken:E,refreshToken:C,tenantId:T,address:k,email:M,expiresAt:O,walletType:$,walletName:X,nonce:se,installId:ye},x&&(this.__authorization.clusterToken=x,R&&(this.__authorization.signerURIs=R)),this.loggedIn=!0,this.cachedMarketplaces={};const te=this.ClientAuthToken();if(this.storeAuthToken&&m)try{localStorage.setItem(`__elv-token-${this.network}`,te)}catch{}return he&&this.client.authClient.MakeAuthServiceRequest({path:"/as/wlt/register",method:"POST",headers:{Authorization:`Bearer ${this.AuthToken()}`}}).catch(re=>{this.Log("Failed to register account: ",!0,re)}),te}async SignMetamask({message:x,address:E}){if(!d||!window.ethereum)throw Error("ElvWalletClient: Unable to initialize - Metamask not available");E=E||this.UserAddress();const C=await window.ethereum.request({method:"eth_requestAccounts"});if(E&&!c.EqualAddress(C[0],E))throw Error(`ElvWalletClient: Incorrect MetaMask account selected. Expected ${E}, got ${C[0]}`);return await window.ethereum.request({method:"personal_sign",params:[x,E,""]})}FlowURL({type:x="flow",flow:E,marketplaceId:C,parameters:T={}}){const k=new URL(this.appUrl);return C?k.pathname=o("/",x,E,"marketplace",C,c.B58(JSON.stringify(T))):k.pathname=o("/",x,E,c.B58(JSON.stringify(T))),k.searchParams.set("origin",window.location.origin),k.toString()}async GenerateCodeAuth({url:x}={}){x||(x=await this.LogInURL({mode:"login"}),x.searchParams.set("response","code"),x.searchParams.set("source","code"));const E=await c.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:o("as","wlt","login","redirect","metamask"),method:"POST",body:{op:"create",dest:x.toString()}}));return E.code=E.id,E.url=E.url.startsWith("https://")?E.url:`https://${E.url}`,E.metamask_url=E.metamask_url.startsWith("https://")?E.metamask_url:`https://${E.metamask_url}`,E}async SetCodeAuth({code:x,address:E,type:C,authToken:T,expiresAt:k,...M}){await c.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:o("as","wlt","login","session",x),method:"POST",headers:{Authorization:`Bearer ${this.AuthToken()}`},body:{op:"set",id:x,format:"auth_token",payload:JSON.stringify({addr:c.FormatAddress(E),eth:E?`ikms${c.AddressToHash(E)}`:"",type:C,token:T,expiresAt:k,...M})}}))}async GetCodeAuth({code:x,passcode:E}){try{return await c.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:o("as","wlt","login","redirect","metamask",x,E),method:"GET"}))}catch(C){if(C&&C.status===404)return;throw C}}async TopLevelInfo(x=!1){return(!this.topLevelInfoPromise||x)&&(this.topLevelInfoPromise=this.client.utils.ResponseToJson(this.client.MakeAuthServiceRequest({path:"/as/mw/toplevel",queryParams:{env:this.mode}}))),await this.topLevelInfoPromise}async LoadAvailableMarketplaces(x=!1){(!this.availableMarketplacesPromise||x)&&(this.availableMarketplacesPromise=new Promise(async E=>{const T=(await this.TopLevelInfo()).marketplaces;let k={...this.availableMarketplaces||{}},M={...this.availableMarketplacesById||{}};T.map(O=>{const R=c.DecodeVersionHash(O.source_hash).objectId,$=O.slug||O.name;k[O.tenant_slug]=k[O.tenant_slug]||{},k[O.tenant_slug][$]={...O,tenantName:O.tenant_slug,tenantSlug:O.tenant_slug,tenantId:O.tenant_id,marketplaceSlug:$,marketplaceId:R,marketplaceHash:O.source_hash},M[R]=k[O.tenant_slug][$],this.marketplaceHashes[R]=O.source_hash}),this.availableMarketplaces=k,this.availableMarketplacesById=M,E()})),await this.availableMarketplacesPromise}async LatestMarketplaceHash({marketplaceParams:x}){const E=await this.MarketplaceInfo({marketplaceParams:x});if(this.previewMarketplaceId&&c.EqualHash(this.previewMarketplaceId,E.marketplaceId))return this.previewMarketplaceHash;const C=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:o("/public","asset_metadata","tenants",E.tenantSlug,"marketplaces",E.marketplaceSlug),resolveLinks:!1,noAuth:!0});return t(C)}async LoadMarketplace(x){await this.LoadAvailableMarketplaces();const E=this.MarketplaceInfo({marketplaceParams:x}),C=E.marketplaceId,T=await this.LatestMarketplaceHash({marketplaceParams:x});if(this.cachedMarketplaces[C]&&this.cachedMarketplaces[C].versionHash!==T&&delete this.cachedMarketplaces[C],!this.cachedMarketplaces[C]){let k;this.previewMarketplaceId&&c.EqualHash(C,this.previewMarketplaceId)?k=await this.client.ContentObjectMetadata({versionHash:this.previewMarketplaceHash,metadataSubtree:"/public/asset_metadata/info",localizationSubtree:this.localization?o("public","asset_metadata","localizations",this.localization,"info"):void 0,linkDepthLimit:1,resolveLinks:!0,resolveIgnoreErrors:!0,resolveIncludeSource:!0,produceLinkUrls:!0,authorizationToken:this.publicStaticToken}):k=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:o("/public","asset_metadata","tenants",E.tenantSlug,"marketplaces",E.marketplaceSlug,"info"),localizationSubtree:this.localization?o("/public","asset_metadata","tenants",E.tenantSlug,"marketplaces",E.marketplaceSlug,"localizations",this.localization,"info"):void 0,linkDepthLimit:1,resolveLinks:!0,resolveIgnoreErrors:!0,resolveIncludeSource:!0,produceLinkUrls:!0,authorizationToken:this.publicStaticToken}),k.branding.use_tenant_styling&&(k.tenantBranding=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:o("/public","asset_metadata","tenants",E.tenantSlug,"info","branding"),authorizationToken:this.publicStaticToken,produceLinkUrls:!0})||{}),k.items=await Promise.all(k.items.map(async(M,O)=>{if(M.requires_permissions){let R;this.loggedIn||(R=await this.client.CreateFabricToken({}));try{await this.client.ContentObjectMetadata({versionHash:t(M.nft_template),metadataSubtree:"permissioned",authorizationToken:R}),M.authorized=!0}catch{M.authorized=!1}}return M.nftTemplateMetadata=(M.nft_template||{}).nft||{},M.nftTemplateHash=((M.nft_template||{})["."]||{}).source,M.itemIndex=O,M})),k.collections=(k.collections||[]).map((M,O)=>({...M,collectionIndex:O})),k.retrievedAt=Date.now(),k.marketplaceId=C,k.versionHash=T,k.marketplaceHash=T,this.previewMarketplaceId&&C===this.previewMarketplaceId&&(k.branding.preview=!0),["purchase_animation","purchase_animation_mobile","reveal_animation","reveal_animation_mobile"].forEach(M=>{try{if(k.storefront[M]){let O=new URL("https://embed.v3.contentfabric.io");const R=t(k.storefront[M]);O.searchParams.set("p",""),O.searchParams.set("net",this.network==="main"?"main":"demo"),O.searchParams.set("ath",(this.__authorization||{}).authToken||this.publicStaticToken),O.searchParams.set("vid",R),O.searchParams.set("ap",""),M.startsWith("reveal")||(O.searchParams.set("m",""),O.searchParams.set("lp","")),k.storefront[`${M}_embed_url`]=O.toString()}}catch{}}),this.cachedMarketplaces[C]=k}return this.cachedMarketplaces[C]}async FilteredQuery({mode:x="listings",sortBy:E="created",sortDesc:C=!1,filter:T,editionFilters:k,attributeFilters:M,contractAddress:O,tokenId:R,currency:$,marketplaceParams:X,tenantId:se,collectionIndexes:ye,priceRange:he,tokenIdRange:te,capLimit:re,userAddress:S,sellerAddress:_,lastNDays:P=-1,startTime:j,endTime:q,includeCheckoutLocked:z=!1,start:Z=0,limit:W=50}={}){ye=(ye||[]).map(ie=>parseInt(ie));let D={start:Z,limit:W,sort_descending:C};x==="owned"&&E==="created"&&(E="default"),x!=="leaderboard"&&(D.sort_by=E),x.includes("listings")&&z&&(D.checkout=!0);let N,Y;X&&(N=await this.MarketplaceInfo({marketplaceParams:X}),ye.length>0&&(Y=await this.Marketplace({marketplaceParams:X})));try{let ie=[];_?ie.push(`seller:eq:${this.client.utils.FormatAddress(_)}`):S&&x!=="owned"&&ie.push(`addr:eq:${this.client.utils.FormatAddress(S)}`),Y&&ye.length>=0?ye.forEach(oe=>{Y.collections[oe].items.forEach(be=>{if(!be)return;const me=Y.items.find(_e=>_e.sku===be);if(!me)return;const fe=c.SafeTraverse(me,"nft_template","nft","address");fe&&ie.push(`${x==="owned"?"contract_addr":"contract"}:eq:${c.FormatAddress(fe)}`)})}):(N||se)&&ie.push(`tenant:eq:${N?N.tenantId:se}`),O?(x==="owned"?ie.push(`contract_addr:eq:${c.FormatAddress(O)}`):ie.push(`contract:eq:${c.FormatAddress(O)}`),R&&ie.push(`token:eq:${R}`)):T&&(x.includes("listing")?ie.push(`nft/display_name:eq:${T}`):x==="owned"?ie.push(`meta/display_name:eq:${T}`):ie.push(`name:eq:${T}`)),k&&k.forEach(oe=>{x.includes("listing")?ie.push(`nft/edition_name:eq:${oe}`):x==="owned"?(ie.push(`meta:@>:{"edition_name":"${oe}"}`),D.exact=!1):ie.push(`edition:eq:${oe}`)}),M&&M.map(({name:oe,value:ce})=>{!oe||!ce||ie.push(`nft/attributes/${oe}:eq:${ce}`)}),$&&ie.push("link_type:eq:sol"),j||q?(j&&ie.push(`created:gt:${parseInt(j)/1e3}`),q&&ie.push(`created:lt:${parseInt(q)/1e3}`)):P&&P>0&&ie.push(`created:gt:${(Date.now()/1e3-P*24*60*60).toFixed(0)}`),he&&(he.min&&ie.push(`price:ge:${parseFloat(he.min)}`),he.max&&ie.push(`price:le:${parseFloat(he.max)}`)),te&&(te.min&&ie.push(`info/token_id:ge:${parseInt(te.min)}`),te.max&&ie.push(`info/token_id:le:${parseInt(te.max)}`)),re&&ie.push(`info/cap:le:${parseInt(re)}`);let V,Ce;switch(x){case"owned":Ce=o("as","wlt",S||this.UserAddress());break;case"owned-full-meta":Ce=o("as","apigw","nfts"),V={Authorization:`Bearer ${this.AuthToken()}`};break;case"listings":Ce=o("as","mkt","f");break;case"transfers":Ce=o("as","mkt","hst","f"),ie.push("action:eq:TRANSFERRED"),ie.push("action:eq:SOLD");break;case"sales":Ce=o("as","mkt","hst","f"),ie.push("action:eq:SOLD"),ie.push("seller:co:0x");break;case"listing-stats":Ce=o("as","mkt","stats","listed");break;case"sales-stats":Ce=o("as","mkt","stats","sold"),ie.push("seller:co:0x");break;case"leaderboard":Ce=o("as","wlt","leaders");break}if(ie.length>0&&(D.filter=ie),x.includes("stats"))return await c.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:Ce,method:"GET",queryParams:D,headers:V}));const{contents:Pe,paging:Se}=await c.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:Ce,method:"GET",queryParams:D,headers:V}))||[],Ee=["owned","listings","owned-full-meta"];return{paging:{start:D.start,limit:D.limit,total:Se.total,more:Se.total>Z+W},results:(Pe||[]).map(oe=>Ee.includes(x)?a(this,oe):oe)}}catch(ie){if(ie.status&&ie.status.toString()==="404")return{paging:{start:D.start,limit:D.limit,total:0,more:!1},results:[]};throw ie}}async MintingStatus({marketplaceParams:x,tenantId:E}){E||(E=(await this.MarketplaceInfo({marketplaceParams:x||this.selectedMarketplaceInfo})).tenantId);try{return(await c.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:o("as","wlt","status","act",E),method:"GET",headers:{Authorization:`Bearer ${this.AuthToken()}`}}))).map(T=>{let[k,M,O]=T.op.split(":");M=M&&M.startsWith("0x")?c.FormatAddress(M):M;let R,$,X,se;if(k==="nft-buy"?R=O:k==="nft-claim"?(R=O,T.marketplaceId=M,T.extra&&T.extra[0]&&(M=T.extra.token_addr,$=T.extra.token_id_str)):k==="nft-redeem"?R=T.op.split(":").slice(-1)[0]:$=O,k==="nft-transfer"&&(R=T.extra&&T.extra.trans_id,$=T.extra&&T.extra.token_id_str||$,T.extra&&T.extra.gift_action==="nft-gift-claim"&&(se=T.extra.gift_id)),k==="nft-offer-redeem"&&(X=T.op.split(":")[3]),k==="nft-claim-entitlement"){let[ye,he,te,re]=T.op.split(":");R=re,T.extra&&T.extra[0]&&(M=T.extra[0].token_addr,$=T.extra[0].token_id,M=M.startsWith("0x")?c.FormatAddress(M):M,T.marketplaceId=he)}return{...T,timestamp:new Date(T.ts),state:T.state&&typeof T.state=="object"?Object.values(T.state):T.state,extra:T.extra&&typeof T.extra=="object"?Object.values(T.extra):T.extra,confirmationId:R,op:k,address:c.FormatAddress(M),tokenId:$,offerId:X,giftId:se}}).sort((T,k)=>T.ts<k.ts?1:-1)}catch(C){return this.Log("Failed to retrieve minting status",!0,C),[]}}async DeployTenant({tenantId:x,tenantSlug:E="",tenantHash:C,environment:T="production"}){if(!C){const O=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:o("public/asset_metadata/tenants",E),resolveLinks:!0,linkDepthLimit:1,resolveIncludeSource:!0,resolveIgnoreErrors:!0,select:["."]});if(!O)throw Error(`Eluvio Wallet Client: Invalid or missing tenancy: ${E}`);const R=O["."].source;C=await this.client.LatestVersionHash({versionHash:R})}const k={content_hash:C,env:T,ts:Date.now()},M=await this.client.Sign(JSON.stringify(k));await this.client.authClient.MakeAuthServiceRequest({path:o("as","tnt","config",x,"metadata"),method:"POST",body:k,headers:{Authorization:`Bearer ${M}`}})}async PurgeUrl({tenantId:x,url:E}){const C={url:E},T=await this.client.CreateFabricToken({});await this.client.authClient.MakeAuthServiceRequest({path:o("as","tnt",x,"purge"),method:"POST",body:C,headers:{Authorization:`Bearer ${T}`}})}}return Object.assign(v.prototype,lee()),Object.assign(v.prototype,cee()),Object.assign(v.prototype,fee()),JE.ElvWalletClient=v,JE}var sL;function pee(){if(sL)return Km;sL=1;const{ElvClient:n}=QI(),{ElvWalletClient:e}=dee(),t=gi();return Km.ElvClient=n,Km.ElvWalletClient=e,Km.Utils=t,Km}var gc=pee();const ZI=oq({__proto__:null},[gc]),oL={default:{label:"Default",hlsSettings:gc.Utils.HLSJSSettings({profile:"default"})},low_latency:{label:"Low Latency Live",hlsSettings:gc.Utils.HLSJSSettings({profile:"ll"})},ultra_low_latency:{label:"Ultra Low Latency Live",hlsSettings:gc.Utils.HLSJSSettings({profile:"ull"})},custom:{label:"Custom",hlsSettings:{}}};class hee{constructor({player:e}){this.player=e,this.visible=!0,this.allowRotation=!0,this._activeMenus=0}__ToggleMenu(e){this._activeMenus=e?this._activeMenus+1:Math.max(0,this._activeMenus-1),this.player.__SettingsUpdate()}IsVisible(){return this.visible}IsMenuVisible(){return this._activeMenus>0}IsReady(){return!this.player.loading}IsPlaying(){return this.player.casting?this.player.castHandler.IsPlaying():!this.player.video.paused}HasPlaybackStarted(){return this.player.playbackStarted}HasAudio(){return!this.player||!this.player.video?!1:this.player.video.mozHasAudio||!!this.player.video.webkitAudioDecodedByteCount||!!this.player.video.audioTracks&&this.player.video.audioTracks.length}async Play(){return this.player.casting?this.player.castHandler.Play():await this.player.__Play()}Pause(){if(this.player.casting)return this.player.castHandler.Pause();this.player.video.pause()}TogglePlay(){return this.player.casting?this.player.castHandler.TogglePlay():this.player.video.paused?(this.Play(),!0):(this.Pause(),!1)}Stop(){if(this.player.casting)return this.player.castHandler.Stop();this.Pause(),this.Seek({time:0}),this.player.playbackStarted=!1,this.player.__SettingsUpdate()}GetCurrentTime(){return this.player.casting?this.player.castHandler.GetCurrentTime():this.player.video.currentTime}GetDuration(){return this.player.casting?this.player.castHandler.GetDuration():this.player.video.duration}Seek({fraction:e,time:t,relativeSeconds:a}){if(this.player.casting)return this.player.castHandler.Seek({fraction:e,time:t,relativeSeconds:a});if(!this.player.video||e&&!this.player.video.duration)return;this.player.canPlay||(this.Play(),this.Pause());const s=this.player.video.currentTime;return a?this.player.video.currentTime=Math.max(0,Math.min(this.player.video.duration,this.player.video.currentTime+a)):typeof e<"u"?this.player.video.currentTime=this.player.video.duration*e:this.player.video.currentTime=t,s<=this.player.video.currentTime}GetVolume(){return this.player.casting?this.player.castHandler.GetVolume():this.player.video.volume}SetVolume({fraction:e,relativeFraction:t}){return this.player.casting?this.player.castHandler.SetVolume({fraction:e,relativeFraction:t}):(t?this.player.video.volume=Math.min(1,Math.max(0,this.GetVolume()+t)):this.player.video.volume=e,this.player.video.volume>0&&this.Unmute(!1),this.player.video.volume)}IsMuted(){return this.player.casting?this.player.castHandler.IsMuted():this.player.video.muted}Mute(){if(this.player.casting)return this.player.castHandler.Mute();this.player.video.muted=!0}Unmute(){if(this.player.casting)return this.player.castHandler.Unmute();this.player.video.muted=!1}ToggleMuted(){return this.player.casting?this.player.castHandler.ToggleMuted():(this.player.video.muted=!this.player.video.muted,this.player.video.muted)}IsFullscreen(){return(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)===this.player.target}Fullscreen(){this.player.target.requestFullscreen?this.player.target.requestFullscreen({navigationUI:"hide"}):this.player.target.mozRequestFullScreen?this.player.target.mozRequestFullScreen({navigationUI:"hide"}):this.player.target.webkitRequestFullscreen?this.player.target.webkitRequestFullscreen({navigationUI:"hide"}):this.player.target.msRequestFullscreen?this.player.target.msRequestFullscreen({navigationUI:"hide"}):this.player.target.querySelector("video").webkitEnterFullScreen()}ExitFullscreen(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen()}ToggleFullscreen(){return this.IsFullscreen()?(this.ExitFullscreen(),!1):(this.Fullscreen(),!0)}GetCollectionInfo(){if(!this.player.collectionInfo)return;const e={...this.player.collectionInfo};return e.content=e.content.map(t=>({...t,active:t.mediaIndex===e.mediaIndex})),e.active=e.content[e.mediaIndex],e}CollectionPlay({mediaIndex:e,mediaId:t,autoplay:a}){this.player.loading||(this.player.__CollectionPlay({mediaId:t,mediaIndex:e,autoplay:a}),this.player.__SettingsUpdate())}CollectionPlayNext({autoplay:e}={}){const t=this.GetCollectionInfo();if(!t)return;const a=Math.min(t.mediaIndex+1,t.mediaLength-1);a!==t.mediaIndex&&this.CollectionPlay({mediaIndex:a,autoplay:e})}CollectionPlayPrevious({autoplay:e}={}){const t=this.GetCollectionInfo();if(!t)return;const a=Math.max(0,t.mediaIndex-1);a!==t.mediaIndex&&this.CollectionPlay({mediaIndex:a,autoplay:e})}IsLive(){return this.player.isLive}GetContentInfo(){if(this.player.playerOptions.title!==!1){const e=this.GetCollectionInfo();if(e&&e.active)return{title:e.active.title||"",subtitle:e.active.title||"",description:e.active.description||"",image:e.active.image&&e.active.image.url||"",posterImage:e.active.poster_image&&e.active.poster_image.url||"",headers:e.active.headers||[]};if(this.player.sourceOptions.contentInfo)return{title:this.player.sourceOptions.contentInfo.title,subtitle:this.player.sourceOptions.contentInfo.subtitle,description:this.player.sourceOptions.contentInfo.description,image:this.player.sourceOptions.contentInfo.image,posterImage:this.player.sourceOptions.contentInfo.posterImage,headers:this.player.sourceOptions.contentInfo.headers||[]}}}GetQualityLevels(){let e=[];if(this.player.hlsPlayer){if(e=this.player.hlsPlayer.levels.map((t,a)=>({index:a,active:this.player.hlsPlayer.currentLevel===a&&!this.player.hlsPlayer.autoLevelEnabled,resolution:t.attrs.RESOLUTION,bitrate:t.bitrate,audioTrack:!t.videoCodec,label:t.audioTrack?`${t.bitrate/1e3}kbps`:`${t.attrs.RESOLUTION} (${(t.bitrate/1e3/1e3).toFixed(1)}Mbps)`,activeLabel:t.audioTrack?`${t.bitrate/1e3}kbps`:`${t.attrs.RESOLUTION}`})).sort((t,a)=>t.bitrate<a.bitrate?1:-1),e.length>0){const t=e.find(a=>this.player.hlsPlayer.currentLevel===a.index);e.unshift({index:-1,label:"Auto",activeLabel:t?`Auto (${t.activeLabel})`:"Auto",active:this.player.hlsPlayer.autoLevelEnabled})}}else this.player.dashPlayer&&(e=this.player.dashPlayer.getRepresentationsByType("video").map(t=>({index:t.index,active:t.index===this.player.dashPlayer.getCurrentRepresentationForType("video").index,resolution:`${t.width}x${t.height}`,bitrate:t.bitrateInKbit*1e3,label:`${t.width}x${t.height} (${(t.bitrateInKbit/1e3).toFixed(1)}Mbps)`,activeLabel:`${t.width}x${t.height}`})).sort((t,a)=>t.bitrate<a.bitrate?1:-1));return{options:e,active:e.find(t=>t.active)}}SetQualityLevel(e){this.player.hlsPlayer?(this.player.hlsPlayer.nextLevel=e,this.player.hlsPlayer.streamController.immediateLevelSwitch()):this.player.dashPlayer&&(this.player.dashPlayer.setRepresentationForTypeByIndex("video",e),this.player.dashPlayer.updateSettings({streaming:{trackSwitchMode:"alwaysReplace",buffer:{fastSwitchEnabled:!0,flushBufferAtTrackSwitch:!0},abr:{autoSwitchBitrate:{video:e===-1}}}})),this.player.__SettingsUpdate()}GetAudioTracks(){let e=[];return this.player.nativeHLS?e=Array.from(this.player.video.audioTracks).map(t=>({index:t.id,label:t.label||t.language,active:t.enabled})):this.player.hlsPlayer?e=this.player.hlsPlayer.audioTracks.map(t=>({index:t.id,label:t.name,active:t.id===this.player.hlsPlayer.audioTrack})):this.player.dashPlayer&&(e=this.player.dashPlayer.getTracksFor("audio").map(t=>({index:t.index,label:t.labels&&t.labels.length>0?t.labels[0].text:t.lang,active:t.index===this.player.dashPlayer.getCurrentTrackFor("audio").index}))),{options:e,active:e.find(t=>t.active)}}SetAudioTrack(e){if(this.player.nativeHLS)Array.from(this.player.video.audioTracks).forEach(t=>t.enabled=e.toString()===t.id),this.Seek({time:this.GetCurrentTime()-.1});else if(this.player.hlsPlayer)this.player.hlsPlayer.audioTrack=e,this.player.hlsPlayer.streamController.immediateLevelSwitch();else if(this.player.dashPlayer){const t=this.player.dashPlayer.getTracksFor("audio").find(a=>a.index===e);this.player.dashPlayer.setCurrentTrack(t)}}GetTextTracks(){let e=[],t;return this.player.nativeHLS||this.player.hlsPlayer?(t=Array.from(this.player.video.textTracks).findIndex(a=>a.mode==="showing"),e=Array.from(this.player.video.textTracks).map((a,s)=>({index:s,label:a.label||a.language,language:a.language,active:a.mode==="showing"}))):this.player.dashPlayer&&(t=this.player.dashPlayer.getCurrentTextTrackIndex(),e=this.player.dashPlayer.getTracksFor("text").map((a,s)=>({index:s,label:a.labels&&a.labels.length>0?a.labels[0].text:a.lang,language:a.lang,active:s===t}))),e.length>0&&e.unshift({index:-1,label:"Disabled",active:t<0}),{options:e,active:e.find(a=>a.active)}}SetTextTrack(e){if(e=parseInt(e),this.player.nativeHLS||this.player.hlsPlayer){const t=Array.from(this.player.video.textTracks);t.map(a=>a.mode="disabled"),e>=0&&(t[e].mode="showing")}else this.player.dashPlayer&&this.player.dashPlayer.setTextTrack(e);e>=0&&(this.__lastTextTrackIndex=e),setTimeout(()=>this.player.__SettingsUpdate(),500)}ToggleTextTrack(){const{active:e,options:t}=this.GetTextTracks();if(t.length!==0){if(e&&e.index>=0)return this.SetTextTrack(-1),!1;if(this.__lastTextTrackIndex>=0)return this.SetTextTrack(this.__lastTextTrackIndex),!0;for(const a of navigator.languages){const s=t.find(u=>u.language===a||u.language===a.split("-")[0]);if(s)return this.SetTextTrack(s.index),!0}return this.SetTextTrack(0),!0}}GetPlaybackRate(){return this.player.casting?this.player.castHandler.GetPlaybackRate():this.player.video.playbackRate||1}GetPlaybackRates(){const e=this.GetPlaybackRate();let t=["0.25","0.5","0.75","1","1.25","1.5","1.75","2"];this.player.casting&&(t=["0.5","0.75","1","1.25","1.5","1.75","2"]),t=t.map((s,u)=>({index:u,rate:parseFloat(s),label:`${s}x`,active:e.toFixed(2)===parseFloat(s).toFixed(2)}));let a=t.find(s=>s.active);return a||(a={index:-1,rate:this.GetPlaybackRate(),label:`${this.GetPlaybackRate()}x`,active:!0}),{options:t,active:a}}SetPlaybackRate({index:e,rate:t}){if(this.player.casting)return this.player.castHandler.SetPlaybackRate({index:e,rate:t});const a=this.player.video.playbackRate;if(t)return this.player.video.playbackRate=t,this.player.__SettingsUpdate(),{rate:t,increase:a<=t};{const s=this.GetPlaybackRates().options[e];if(s)return this.player.video.playbackRate=s.rate,this.player.__SettingsUpdate(),{rate:s.rate,increase:a<=s.rate}}}IsDVRAvailable(){return this.player.dvrAvailable&&!this.player.casting&&isFinite(this.GetDuration())}IsDVREnabled(){return this.player.dvrEnabled}SetDVREnabled(e){const t=this.player.dvrEnabled;return this.player.dvrEnabled=this.IsDVRAvailable()&&e,this.player.__SettingsUpdate(),t&&!this.player.dvrEnabled&&this.Seek({time:this.GetDuration()-2}),this.player.dvrEnabled}GetPlayerProfiles(){let e=[];return this.player.hlsPlayer&&(e=Object.keys(oL).map(t=>({index:t,label:oL[t].label,active:this.player.playerOptions.playerProfile===t}))),{options:e,active:e.find(t=>t.active)}}SetPlayerProfile({profile:e,customOptions:t={}}){this.player.SetPlayerProfile({profile:e,customHLSOptions:t})}ShowPlayerProfileForm(){this.player.__showPlayerProfileForm=!0,this.player.__SettingsUpdate()}HidePlayerProfileForm(){this.player.__showPlayerProfileForm=!1,this.player.__SettingsUpdate()}ContentVerified(){return this.player.contentVerified||!1}GetContentVerificationDetails(){return this.player.contentAudit||!1}ThumbnailsAvailable(){return this.player.thumbnailHandler&&this.player.thumbnailHandler.loaded||!1}GetThumbnailImage(e){if(this.ThumbnailsAvailable())return this.player.thumbnailHandler.ThumbnailImage(e)}GetVideoDimensions(){return this.player.video.getBoundingClientRect()}GetOptions(){let e={quality:this.GetQualityLevels(),audio:this.GetAudioTracks(),text:this.GetTextTracks(),profile:this.GetPlayerProfiles(),rate:this.GetPlaybackRates()};return e.hasQualityOptions=e.quality.options.length>0,e.hasAudioOptions=e.audio.options.length>0,e.hasTextOptions=e.text.options.length>0,e.hasProfileOptons=e.profile.options.length>0,e.hasRateOptions=!this.IsLive(),e.hasAnyOptions=e.hasQualityOptions||e.hasAudioOptions||e.hasTextOptions||e.hasProfileOptons||e.hasRateOptions,e}AllowRotation(){return this.allowRotation}SetAllowRotation(e){this.allowRotation=e,this.player.__SettingsUpdate()}IsRotatable(){return this.IsFullscreen()&&window.innerWidth<900&&window.innerHeight>window.innerWidth&&this.player.video.videoWidth>this.player.video.videoHeight}RegisterVideoEventListener(e,t){return this.player.__RegisterVideoEventListener(e,t)}RegisterSettingsListener(e){return this.player.__RegisterSettingsListener(e)}Reset(){this.player.Reset()}Destroy(){this.player.Destroy()}OverlayAvailable(){return!!this.player.__poseOverlayTags}OverlayVisible(){return this.player.__showOverlay}ToggleOverlayVisibility(){this.player.__showOverlay=!this.player.__showOverlay,this.player.__SettingsUpdate()}GetDebugInfo(){const e=JSON.parse(JSON.stringify(this.player.sourceOptions));delete e.playoutOptions;let t=this.player.__error&&JSON.parse(JSON.stringify(this.player.__error));return t&&Object.keys(t).length===0&&(t=this.player.__error.toString()),{appUrl:window.location.href,userAddress:this.player.userAddress,userAgent:navigator.userAgent,userLanguage:navigator.language,playoutUrl:this.player.playoutUrl,sourceOptions:e,error:t}}}const Un={PLAY:"play",PAUSE:"pause",MUTE:"muted",UNMUTE:"unmuted",VOLUME_UP:"volumeup",VOLUME_DOWN:"volumedown",SEEK_BACK:"seekback",SEEK_FORWARD:"seekforward",PLAYBACK_RATE_UP:"playbackrateup",PLAYBACK_RATE_DOWN:"playbackratedown",SUBTITLES_ON:"subtitleson",SUBTITLES_OFF:"subtitlesoff",PLAY_NEXT:"playnext",PLAY_PREVIOUS:"playprevious"},eD=({player:n,setRecentUserAction:e,sideClickRatio:t=.1,doubleClickDelay:a=300})=>{let s,u,o,c;return window.addEventListener("focus",()=>{o=c||document.activeElement,c=document.activeElement},!0),()=>p=>{if(clearTimeout(u),p.target===p.currentTarget&&p.currentTarget.contains(o)&&!p.currentTarget.classList.contains("menu-active"))if(Date.now()-s<a){const d=p.target.getBoundingClientRect(),y=(p.clientX-d.left)/d.width;y<=t?(n.controls.Seek({relativeSeconds:-10}),e({action:Un.SEEK_BACK,text:"10 seconds"})):y>=1-t?(n.controls.Seek({relativeSeconds:10}),e({action:Un.SEEK_FORWARD,text:"10 seconds"})):n.controls.ToggleFullscreen()}else u=setTimeout(()=>{const d=n.controls.TogglePlay();e({action:d?Un.PLAY:Un.PAUSE})},a);o=p.target,s=Date.now()}},tD=(n,e)=>{let t=0;return()=>a=>{a.repeat||(t=0);const s=t<5?5:t<15?10:t<40?30:60;switch(a.key){case"ArrowLeft":a.preventDefault(),n.controls.Seek({relativeSeconds:-s}),e({action:Un.SEEK_BACK,text:`${s} seconds`});break;case"ArrowRight":a.preventDefault(),n.controls.Seek({relativeSeconds:s}),e({action:Un.SEEK_FORWARD,text:`${s} seconds`});break;default:return}t+=1}},yee=n=>e=>{switch(e.key){case"ArrowLeft":e.preventDefault(),n.controls.SetVolume({relativeFraction:-.05});break;case"ArrowRight":e.preventDefault(),n.controls.IsMuted()?n.controls.SetVolume({fraction:.05}):n.controls.SetVolume({relativeFraction:.05});break}},Og=(n,e)=>{if(isNaN(e)||!isFinite(e)||e===0)return"00:00";const t=n>3600,a=Math.floor(n/60/60),s=Math.floor(n/60%60),u=Math.floor(n%60);let o=`${s.toString().padStart(t?2:1,"0")}:${u.toString().padStart(2,"0")}`;return t&&(o=`${a.toString()}:${o}`),o},S5=async({player:n,pathOrUrl:e="",width:t})=>{if(typeof e=="string"&&(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("data:")))return e;if(e&&e.url)return e.url;const a=await n.__Client();let s;const{mediaCatalogObjectId:u,mediaCatalogVersionHash:o}=n.sourceOptions&&n.sourceOptions.mediaCollectionOptions||{},c=n.sourceOptions&&n.sourceOptions.playoutParameters||{};return o?s=o:u?s=await a.LatestVersionHash({objectId:u}):c.versionHash?s=c.versionHash:s=await a.LatestVersionHash({objectId:c.objectId}),s?(e=e&&e.toString().trim().replace(/^\./,"").replace(/\/+/,""),e.startsWith("files")?await a.FileUrl({versionHash:s,filePath:e.replace(/^files/,""),queryParams:{width:t},authorizationToken:c.authorizationToken}):await a.LinkUrl({versionHash:s,linkPath:e,queryParams:{width:t},authorizationToken:c.authorizationToken})):""},C5=(n,e={},t=1)=>{if(t>10)return{};let a={};return Object.keys(n).forEach(s=>{if(s==="client")a.client=e.client||n.client;else if(typeof n[s]=="object"&&!Array.isArray(n[s]))a[s]=C5(n[s],(e||{})[s],t+1);else{const u=(e||{})[s];a[s]=typeof u<"u"?u:n[s]}}),a},nD=n=>C5(uq,n);var mee=vi();const sp=Su(mee);var Rs={},QE,uL;function gee(){return uL||(uL=1,QE=function(e,t,a,s){var u=a?a.call(s,e,t):void 0;if(u!==void 0)return!!u;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;var o=Object.keys(e),c=Object.keys(t);if(o.length!==c.length)return!1;for(var p=Object.prototype.hasOwnProperty.bind(t),d=0;d<o.length;d++){var y=o[d];if(!p(y))return!1;var m=e[y],v=t[y];if(u=a?a.call(s,m,v,y):void 0,u===!1||u===void 0&&m!==v)return!1}return!0}),QE}var lL;function vee(){if(lL)return Rs;lL=1,Object.defineProperty(Rs,"__esModule",{value:!0}),Rs.PreOrder=Rs.ReverseInOrder=Rs.InOrder=Rs.IntervalTree=Rs.Node=void 0;var n=gee();function e(d,y){return d<y?y:d}function t(d){return d===void 0?-1:d.height}var a=(function(){function d(y,m){this.intervalTree=y,this.records=[],this.height=0,this.key=m.low,this.max=m.high,this.records.push(m)}return d.prototype.getNodeHigh=function(){for(var y=this.records[0].high,m=1;m<this.records.length;m++)this.records[m].high>y&&(y=this.records[m].high);return y},d.prototype.updateHeight=function(){this.height=e(t(this.left),t(this.right))+1},d.prototype.updateMaxOfParents=function(){if(this!==void 0){var y=this.getNodeHigh();this.left!==void 0&&this.right!==void 0?this.max=e(e(this.left.max,this.right.max),y):this.left!==void 0&&this.right===void 0?this.max=e(this.left.max,y):this.left===void 0&&this.right!==void 0?this.max=e(this.right.max,y):this.max=y,this.parent&&this.parent.updateMaxOfParents()}},d.prototype._updateMaxAfterRightRotate=function(){var y=this.parent,m=y.left,v=m.getNodeHigh();m.left===void 0&&m.right!==void 0?m.max=e(v,m.right.max):m.left!==void 0&&m.right===void 0?m.max=e(v,m.left.max):m.left===void 0&&m.right===void 0?m.max=v:m.max=e(e(m.left.max,m.right.max),v);var b=this.getNodeHigh();this.left===void 0&&this.right!==void 0?this.max=e(b,this.right.max):this.left!==void 0&&this.right===void 0?this.max=e(b,this.left.max):this.left===void 0&&this.right===void 0?this.max=b:this.max=e(e(this.left.max,this.right.max),b),y.max=e(e(y.left.max,y.right.max),y.getNodeHigh())},d.prototype._updateMaxAfterLeftRotate=function(){var y=this.parent,m=y.right,v=m.getNodeHigh();m.left===void 0&&m.right!==void 0?m.max=e(v,m.right.max):m.left!==void 0&&m.right===void 0?m.max=e(v,m.left.max):m.left===void 0&&m.right===void 0?m.max=v:m.max=e(e(m.left.max,m.right.max),v);var b=this.getNodeHigh();this.left===void 0&&this.right!==void 0?this.max=e(b,this.right.max):this.left!==void 0&&this.right===void 0?this.max=e(b,this.left.max):this.left===void 0&&this.right===void 0?this.max=b:this.max=e(e(this.left.max,this.right.max),b),y.max=e(e(y.left.max,m.max),y.getNodeHigh())},d.prototype._leftRotate=function(){var y=this.right;y.parent=this.parent,y.parent===void 0?this.intervalTree.root=y:y.parent.left===this?y.parent.left=y:y.parent.right===this&&(y.parent.right=y),this.right=y.left,this.right!==void 0&&(this.right.parent=this),y.left=this,this.parent=y,this.updateHeight(),y.updateHeight()},d.prototype._rightRotate=function(){var y=this.left;y.parent=this.parent,y.parent===void 0?this.intervalTree.root=y:y.parent.left===this?y.parent.left=y:y.parent.right===this&&(y.parent.right=y),this.left=y.right,this.left!==void 0&&(this.left.parent=this),y.right=this,this.parent=y,this.updateHeight(),y.updateHeight()},d.prototype._rebalance=function(){if(t(this.left)>=2+t(this.right)){var y=this.left;t(y.left)>=t(y.right)?(this._rightRotate(),this._updateMaxAfterRightRotate()):(y._leftRotate(),this._rightRotate(),this._updateMaxAfterRightRotate())}else if(t(this.right)>=2+t(this.left)){var m=this.right;t(m.right)>=t(m.left)?(this._leftRotate(),this._updateMaxAfterLeftRotate()):(m._rightRotate(),this._leftRotate(),this._updateMaxAfterLeftRotate())}},d.prototype.insert=function(y){y.low<this.key?this.left===void 0?(this.left=new d(this.intervalTree,y),this.left.parent=this):this.left.insert(y):this.right===void 0?(this.right=new d(this.intervalTree,y),this.right.parent=this):this.right.insert(y),this.max<y.high&&(this.max=y.high),this.updateHeight(),this._rebalance()},d.prototype._getOverlappingRecords=function(y,m,v){if(y.key<=v&&m<=y.getNodeHigh()){for(var b=[],x=0;x<y.records.length;x++)y.records[x].high>=m&&b.push(y.records[x]);return b}return[]},d.prototype.search=function(y,m){if(this===void 0)return[];var v=[],b=[],x=[];return y>this.max?[]:(this.left!==void 0&&this.left.max>=y&&(v=this.left.search(y,m)),b=this._getOverlappingRecords(this,y,m),m<this.key?v.concat(b):(this.right!==void 0&&(x=this.right.search(y,m)),v.concat(b,x)))},d.prototype.searchExisting=function(y){if(this!==void 0){if(this.key===y)return this;if(y<this.key){if(this.left!==void 0)return this.left.searchExisting(y)}else if(this.right!==void 0)return this.right.searchExisting(y)}},d.prototype._minValue=function(){return this.left===void 0?this:this.left._minValue()},d.prototype.remove=function(y){var m=this.parent;if(y.key<this.key)return this.left!==void 0?this.left.remove(y):void 0;if(y.key>this.key)return this.right!==void 0?this.right.remove(y):void 0;if(this.left!==void 0&&this.right!==void 0){var v=this.right._minValue();return this.key=v.key,this.records=v.records,this.right.remove(this)}else{if(m.left===this)return this.right!==void 0?(m.left=this.right,this.right.parent=m):(m.left=this.left,this.left!==void 0&&(this.left.parent=m)),m.updateMaxOfParents(),m.updateHeight(),m._rebalance(),this;if(m.right===this)return this.right!==void 0?(m.right=this.right,this.right.parent=m):(m.right=this.left,this.left!==void 0&&(this.left.parent=m)),m.updateMaxOfParents(),m.updateHeight(),m._rebalance(),this}},d})();Rs.Node=a;var s=(function(){function d(){this.count=0}return d.prototype.insert=function(y){if(y.low>y.high)throw new Error("`low` value must be lower or equal to `high` value");if(this.root===void 0)return this.root=new a(this,y),this.count++,!0;var m=this.root.searchExisting(y.low);if(m!==void 0){for(var v=0;v<m.records.length;v++)if(n(m.records[v],y))return!1;return m.records.push(y),y.high>m.max&&(m.max=y.high,m.parent&&m.parent.updateMaxOfParents()),this.count++,!0}else return this.root.insert(y),this.count++,!0},d.prototype.search=function(y,m){return this.root===void 0?[]:this.root.search(y,m)},d.prototype.remove=function(y){if(this.root===void 0)return!1;var m=this.root.searchExisting(y.low);if(m===void 0)return!1;if(m.records.length>1){for(var v=void 0,b=0;b<m.records.length;b++)if(n(m.records[b],y)){v=m.records[b],m.records.splice(b,1);break}if(v){if(v=void 0,y.high===m.max){var x=m.getNodeHigh();m.left!==void 0&&m.right!==void 0?m.max=e(e(m.left.max,m.right.max),x):m.left!==void 0&&m.right===void 0?m.max=e(m.left.max,x):m.left===void 0&&m.right!==void 0?m.max=e(m.right.max,x):m.max=x,m.parent&&m.parent.updateMaxOfParents()}return this.count--,!0}else return!1}else if(m.records.length===1)if(n(m.records[0],y))if(this.root.key===m.key){var E=new a(this,{low:y.low,high:y.low});E.left=this.root,this.root.parent=E;var C=this.root.remove(m);return this.root=E.left,this.root!==void 0&&(this.root.parent=void 0),C?(C=void 0,this.count--,!0):!1}else{var C=this.root.remove(m);return C?(C=void 0,this.count--,!0):!1}else return!1;else return!1},d.prototype.inOrder=function(){return new o(this.root)},d.prototype.reverseInOrder=function(){return new c(this.root)},d.prototype.preOrder=function(){return new p(this.root)},d})();Rs.IntervalTree=s;var u=(function(){function d(){this.tree=new s}return d.prototype.insert=function(y,m,v){return this.tree.insert({low:y,high:m,data:v})},d.prototype.remove=function(y,m,v){return this.tree.remove({low:y,high:m,data:v})},d.prototype.search=function(y,m){return this.tree.search(y,m).map(function(v){return v.data})},d.prototype.inOrder=function(){return this.tree.inOrder()},d.prototype.reverseInOrder=function(){return this.tree.reverseInOrder()},d.prototype.preOrder=function(){return this.tree.preOrder()},Object.defineProperty(d.prototype,"count",{get:function(){return this.tree.count},enumerable:!1,configurable:!0}),d})();Rs.default=u;var o=(function(){function d(y){this.stack=[],y!==void 0&&this.push(y)}return d.prototype[Symbol.iterator]=function(){return this},d.prototype.next=function(){return this.currentNode===void 0?{done:!0,value:void 0}:this.i<this.currentNode.records.length?{done:!1,value:this.currentNode.records[this.i++]}:(this.currentNode.right!==void 0?this.push(this.currentNode.right):this.pop(),this.next())},d.prototype.push=function(y){for(this.currentNode=y,this.i=0;this.currentNode.left!==void 0;)this.stack.push(this.currentNode),this.currentNode=this.currentNode.left},d.prototype.pop=function(){this.currentNode=this.stack.pop(),this.i=0},d})();Rs.InOrder=o;var c=(function(){function d(y){this.stack=[],y!==void 0&&this.push(y)}return d.prototype[Symbol.iterator]=function(){return this},d.prototype.next=function(){return this.currentNode===void 0?{done:!0,value:void 0}:this.currentNode.records.length&&this.i>=0?{done:!1,value:this.currentNode.records[this.i--]}:(this.currentNode.left!==void 0?this.push(this.currentNode.left):this.pop(),this.next())},d.prototype.push=function(y){var m,v,b,x;for(this.currentNode=y,this.i=((v=(m=this.currentNode)===null||m===void 0?void 0:m.records.length)!==null&&v!==void 0?v:0)-1;this.currentNode.right!==void 0;)this.stack.push(this.currentNode),this.currentNode=this.currentNode.right,this.i=((x=(b=this.currentNode)===null||b===void 0?void 0:b.records.length)!==null&&x!==void 0?x:0)-1},d.prototype.pop=function(){var y,m;this.currentNode=this.stack.pop(),this.i=((m=(y=this.currentNode)===null||y===void 0?void 0:y.records.length)!==null&&m!==void 0?m:0)-1},d})();Rs.ReverseInOrder=c;var p=(function(){function d(y){this.stack=[],this.i=0,this.currentNode=y}return d.prototype[Symbol.iterator]=function(){return this},d.prototype.next=function(){return this.currentNode===void 0?{done:!0,value:void 0}:this.i<this.currentNode.records.length?{done:!1,value:this.currentNode.records[this.i++]}:(this.currentNode.right!==void 0&&this.push(this.currentNode.right),this.currentNode.left!==void 0&&this.push(this.currentNode.left),this.pop(),this.next())},d.prototype.push=function(y){this.stack.push(y)},d.prototype.pop=function(){this.currentNode=this.stack.pop(),this.i=0},d})();return Rs.PreOrder=p,Rs}var bee=vee();const wee=Su(bee);let cL=1;const _ee=({tagType:n,tagId:e,label:t,startTime:a,endTime:s,text:u,tag:o,...c})=>{let p;if(Array.isArray(u))u=u.join(", ");else if(typeof u=="object"){p=u;try{u=JSON.stringify(u,null,2)}catch{u=""}}return{tagId:e,tagType:n,label:t,startTime:a,endTime:s,text:u,content:p,tag:o,...c}},xee=({label:n,cue:e,offset:t=0})=>{const a=["align","endTime","id","line","lineAlign","position","positionAlign","region","size","snapToLines","startTime","text","vertical"],s={};a.forEach(o=>s[o]=e[o]);const u=cL;return cL+=1,_ee({tagId:u,tagType:"vtt",label:n,startTime:e.startTime-t,endTime:e.endTime-t,text:e.text,tag:s})},See=async n=>{const e=document.createElement("video"),t=document.createElement("track"),a="data:text/plain;base64,"+gc.Utils.B64(n.vttData),s=t.track;e.append(t),t.src=a,s.mode="hidden",await new Promise(o=>setTimeout(o,500));let u={};return Array.from(s.cues).forEach(o=>{const c=xee({label:n.label,cue:o,offset:n.offset});u[c.tagId]=c}),u},Cee=(n,e)=>{const t=new wee;return Object.values(n).forEach(a=>{try{t.insert(a.startTime,a.startTime+1,a.tagId)}catch(s){console.warn(`Invalid tag in track '${e}'`),console.warn(JSON.stringify(a,null,2)),console.warn(s)}}),t};class Eee{constructor(e,t){this.thumbnailTrackUrl=e,this.loaded=!1,this.offset=t||0}async LoadThumbnails(){const e=new URL(this.thumbnailTrackUrl),t=e.searchParams.get("authorization");e.searchParams.delete("authorization");const a=await(await fetch(e,{headers:{Authorization:`Bearer ${t}`}})).text();let s=await See({label:"Thumbnails",vttData:a,offset:this.offset}),u=0,o=0;Object.keys(s||{}).forEach(p=>{s[p].endTime=s[p].startTime,u=Math.max(u,s[p].startTime-o),o=s[p].startTime});let c={};Object.keys(s).map(p=>{const[d,y]=s[p].tag.text.split(`
|
|
380
|
-
`)[0].split("?"),[m,v]=y.split("#"),b=v.split("=")[1].split(",").map(C=>parseInt(C)),x=new URLSearchParams(`?${m}`),E=new URL(e);E.searchParams.set("authorization",t),E.pathname=sp(E.pathname.split("/").slice(0,-1).join("/"),d),x.forEach((C,T)=>E.searchParams.set(C,T)),s[p].imageUrl=E.toString(),s[p].thumbnailPosition=b,c[E.toString()]=!0,delete s[p].tag.text,delete s[p].text}),await Promise.all(Object.keys(c).map(async p=>{const d=new Image;await new Promise(y=>{d.src=p,d.crossOrigin="anonymous",d.onload=()=>{y()}}),c[p]=d})),this.maxInterval=Math.ceil(u),this.thumbnailImages=c,this.thumbnails=s,this.intervalTree=Cee(s,"Thumbnails"),this.loaded=!0}ThumbnailImage(e){if(!this.intervalTree)return;const t=this.intervalTree.search(e,e+this.maxInterval)[0];if(!t)return;const a=this.thumbnails&&this.thumbnails[t.toString()];if(!a)return;this.thumbnailCanvas||(this.thumbnailCanvas=document.createElement("canvas"));const s=this.thumbnailImages[a.imageUrl];if(s){const[u,o,c,p]=a.thumbnailPosition;return this.thumbnailCanvas.height=p,this.thumbnailCanvas.width=c,this.thumbnailCanvas.getContext("2d").drawImage(s,u,o,c,p,0,0,c,p),this.thumbnailCanvas.toDataURL("image/png")}}}const Aee=/iPhone|iPad|iPod/i.test(navigator.userAgent),fL=window.__chromecastAvailable||!!(window.chrome&&window.chrome.cast),kee={default:{label:"Default",hlsSettings:gc.Utils.HLSJSSettings({profile:"default"})},low_latency:{label:"Low Latency Live",hlsSettings:gc.Utils.HLSJSSettings({profile:"ll"})},ultra_low_latency:{label:"Ultra Low Latency Live",hlsSettings:gc.Utils.HLSJSSettings({profile:"ull"})},custom:{label:"Custom",hlsSettings:{}}};class Yw{__RegisterVideoEventListener(e,t){this.video.addEventListener(e,t);const a=()=>this.video.removeEventListener(e,t);return this.__listenerDisposers.push(a),()=>{a(),this.__listenerDisposers=this.__listenerDisposers.filter(s=>s!==a)}}__RegisterSettingsListener(e){return this.__settingsListeners.push(e),()=>this.__settingsListeners=this.__settingsListeners.filter(t=>t!==e)}constructor({target:e,video:t,parameters:a,Reload:s,UpdateParameters:u,SetErrorMessage:o}){this.latest=!0,this.loading=!0,this.target=e,this.video=t,this.controls=new hee({player:this}),this.__settingsListeners=[],this.__listenerDisposers=[],this.__showPlayerProfileForm=!1,this.playbackStarted=!1,this.reloads=0,this.canPlay=!1,this.isLive=!1,this.dvrEnabled=!1,this.dvrAvailable=!1,this.behindLiveEdge=!1,this.publicMetadataUrl=void 0,this.airplayAvailable=!1,this.chromecastAvailable=fL&&a.playerOptions.allowCasting,this.casting=!1,this.usePlayerControls=[Gt.controls.ON,Gt.controls.AUTO_HIDE].includes(a.playerOptions.controls),this.__error=void 0,this.__ReloadComponent=s,this.__UpdateParameters=u,this.SetErrorMessage=(c,p)=>{o(c),this.__error=p};try{a.playerOptions.hlsjsOptions&&Object.keys(a.playerOptions.hlsjsOptions).length>0&&(this.customHLSOptions=a.playerOptions.hlsjsOptions,a.playerOptions.playerProfile=Gt.playerProfile.CUSTOM)}catch(c){this.Log(c,!0)}this.__Initialize(a)}async __Client(){if(this.clientPromise&&await this.clientPromise,this.clientOptions.client||(this.clientPromise=(async()=>{const{ElvClient:e}=await Promise.resolve().then(()=>ZI);return this.clientOptions.client=await e.FromConfigurationUrl({configUrl:this.clientOptions.network}),this.clientOptions.staticToken&&this.clientOptions.client.SetStaticToken({token:this.clientOptions.staticToken}),this.clientOptions.client})(),await this.clientPromise),!this.__tokenResolved){const e=(this.sourceOptions.playoutParameters||{}).authorizationToken||this.clientOptions.client.staticToken;if(e)try{JSON.parse(gc.Utils.FromB64(e)).qspace_id&&(this.sourceOptions.playoutParameters.authorizationToken=await this.clientOptions.client.CreateFabricToken({duration:10080*60*1e3}))}catch{}this.__tokenResolved=!0}return this.userAddress=this.clientOptions.client.CurrentAccountAddress(),this.clientOptions.client}async __PlayoutOptions(){const e=await this.__Client(),t=this.sourceOptions.playoutParameters||{};if(this.collectionInfo){const R=this.collectionInfo.content[this.collectionInfo.mediaIndex];t.objectId=e.utils.DecodeVersionHash(R.mediaHash).objectId,t.versionHash=R.mediaHash,this.sourceOptions.playoutOptions=void 0}let a,s,u={ignore_trimming:t.ignoreTrimming,resolve:t.resolve,...t.options||{},clip_start:(t.options||{}).clip_start||t.clipStart,clip_end:(t.options||{}).clip_end||t.clipEnd};t.vertical&&(u.v=1);let o,c;if((u.clip_start||u.clip_end)&&(o=parseFloat(u.clip_start||0),c=parseFloat(u.clip_end||0),delete u.clip_start,delete u.clip_end),!t.channel){let R=await e.AvailableOfferings({objectId:t.objectId,versionHash:t.versionHash,writeToken:t.writeToken,linkPath:t.linkPath,directLink:t.directLink,resolveIncludeSource:!0,authorizationToken:t.authorizationToken})||{};if(a=R.default?"default":Object.keys(R)[0],t.offering?a=R[t.offering]?t.offering:void 0:(t.offerings||[]).length>0?a=t.offerings.find(X=>R[X]):t.offerings&&t.offerings.length>0&&(a=t.offerings.find(X=>R[X])),!a)throw new Error(`Unable to find offering from '${t.offering||t.offerings}'`);const $=R[a]&&R[a].properties||{};s=R[a].uri,this.sourceOptions.contentInfo.liveDVR===Gt.liveDVR.ON&&$.dvr_available?(u.dvr=1,this.dvrAvailable=!0):this.dvrAvailable=!1,this.isLive=$.live}const p=async R=>t.directLink?await e.PlayoutOptions({offeringURI:s,options:R}):await e.PlayoutOptions({...t,handler:t.channel?"channel":"playout",offering:t.channel||a,options:R});if(!this.sourceOptions.playoutOptions){let R;if(!o&&!c)R=await p(u);else if(!t.clipRelativeToUntrimmed)R=await p({...u,clip_start:o,clip_end:c});else{R=await p(u);let $;try{for(const X of Object.keys(R||{})){for(const se of Object.keys(R[X].playoutMethods||{}))if(typeof(R[X].playoutMethods[se].properties||{}).start_offset_float<"u"){$=parseFloat(R[X].playoutMethods[se].properties.start_offset_float);break}if(typeof $<"u")break}}catch(X){this.Log("Failed to load content offset for clip adjustment:"),this.Log(X,!0)}R=await p({...u,clip_start:(o||0)-($||0),clip_end:(c||0)-($||0)||9999999})}this.sourceOptions.playoutOptions=R}t.directLink?this.sourceOptions.playoutOptions||(this.sourceOptions.playoutOptions=await e.PlayoutOptions({offeringURI:s,options:u})):this.sourceOptions.playoutOptions||(this.sourceOptions.playoutOptions=await e.PlayoutOptions({...t,handler:t.channel?"channel":"playout",offering:t.channel||a,options:u}));let d=(await e.AvailableDRMs()).filter(R=>(this.sourceOptions.drms||[]).includes(R)),y=this.sourceOptions.protocols,m,v;for(;!(m&&v);){m=y.find($=>this.sourceOptions.playoutOptions[$]);const R=Object.keys(this.sourceOptions.playoutOptions[m].playoutMethods);if(v=(this.sourceOptions.drms||[]).length===0?R.find($=>$!=="clear")||R[0]:this.sourceOptions.drms.sort().reverse().find($=>d.includes($)&&this.sourceOptions.playoutOptions[m].playoutMethods[$]),!v&&(y=y.filter($=>$!==m),y.length===0))throw Error("No valid protocol / DRM combination available")}const{playoutUrl:b,drms:x,thumbnailTrack:E,properties:C}=this.sourceOptions.playoutOptions[m].playoutMethods[v],T=b.split("/").find(R=>R.startsWith("hq__")),k=(C||{}).start_offset_float||0,M=(o||0)+(k||0);let O=C.rate;if(O&&typeof O=="string"){const[R,$]=O.split("/");$?O=parseInt(R)/parseInt($):O=parseInt(R)}return{playoutParameters:{...t,options:u},protocol:m,drm:v,playoutUrl:b,thumbnailTrackUrl:E,objectId:e.utils.DecodeVersionHash(T).objectId,versionHash:T,drms:x,availableDRMs:d,offeringURI:s,offering:a,compositionKey:t.channel,clipStart:u.clip_start,clipEnd:u.clip_end,trimOffset:k,thumbnailOffset:M,frameRateRat:C.rate,frameRate:O,sessionId:this.sourceOptions.playoutOptions.sessionId,multiviewOptions:{enabled:this.sourceOptions.playoutOptions.multiview,AvailableViews:this.sourceOptions.playoutOptions.AvailableViews,SwitchView:this.sourceOptions.playoutOptions.SwitchView}}}__CollectionPlay({mediaIndex:e,mediaId:t,autoplay:a}){t&&(e=this.collectionInfo.content.find(s=>s.id===t)),this.collectionInfo.mediaIndex=e,this.__SettingsUpdate(),this.__Initialize(this.originalParameters,this.video?{muted:this.video.muted,volume:this.video.volume,playing:typeof a<"u"?a:!this.video.paused}:null)}async __LoadCollection(){if(this.collectionInfo)return;let{mediaCatalogObjectId:e,mediaCatalogVersionHash:t,collectionId:a}=this.sourceOptions&&this.sourceOptions.mediaCollectionOptions||{};if(!a)return;if(!e&&!t)throw{displayMessage:"Invalid collection options: Media catalog not specified"};const s=await this.__Client();try{const u=this.sourceOptions.playoutParameters.authorizationToken;t=t||await s.LatestVersionHash({objectId:e});const c=(await s.ContentObjectMetadata({versionHash:t,metadataSubtree:"public/asset_metadata/info/collections",authorizationToken:u,produceLinkUrls:!0})||[]).find(p=>p.id===a);if(!c)throw{displayMessage:`No collection with ID ${a} found for media catalog ${e||t}`};c.content=c.content.filter(p=>p.media).map((p,d)=>({...p,active:d===0,mediaId:p.id,mediaIndex:d,mediaHash:p.media&&p.media["/"]&&p.media["/"].split("/").find(y=>y.startsWith("hq__"))})),this.collectionInfo={...c,isPlaylist:c.type==="playlist",mediaIndex:0,mediaLength:c.content.length}}catch(u){throw this.Log("Failed to load collection:"),u}}async __Initialize(e,t){if(!this.__destroyed){this.__Reset(),this.initialized=!1,this.loading=!0,this.initTime=Date.now(),this.restartParameters=t,this.__SettingsUpdate(),e&&(this.originalParameters=nD(e),this.clientOptions=e.clientOptions,this.sourceOptions=e.sourceOptions,this.playerOptions=e.playerOptions),this.errors=0,this.__Client();try{t&&(this.video.volume=t.volume,this.video.muted=t.muted,t.playing&&(this.playerOptions.autoplay=Gt.autoplay.ON),t.currentTime&&this.__RegisterVideoEventListener("loadedmetadata",()=>this.video.currentTime=t.currentTime)),this.usePlayerControls&&this.playerOptions.allowCasting&&(this.castHandler=new Bq({player:this,onReady:()=>{this.chromecastAvailable=!0,this.__SettingsUpdate()},onUpdate:()=>{this.__SettingsUpdate()}})),this.__RegisterVideoEventListener("webkitplaybacktargetavailabilitychanged",$=>{this.airplayAvailable=$.availability==="available",this.__SettingsUpdate()});const a=this.__RegisterVideoEventListener("timeupdate",()=>{this.reloads=0,this.playbackStarted=!0,this.__SettingsUpdate(),a()});this.__RegisterVideoEventListener("canplay",()=>{this.initTime&&!this.initTimeLogged&&(this.Log(`Player initialization: ${((Date.now()-this.initTime)/1e3).toFixed(2)} seconds`),this.initTimeLogged=!0,this.canPlay=!0,this.video.textTracks&&this.video.textTracks.addEventListener("change",()=>this.__SettingsUpdate()),this.video.audioTracks&&this.video.audioTracks.addEventListener("change",()=>this.__SettingsUpdate()),this.playerOptions.startTime?this.controls.Seek({time:parseFloat(this.playerOptions.startTime)}):this.playerOptions.startProgress&&this.controls.Seek({fraction:parseFloat(this.playerOptions.startProgress)}),this.playerOptions.autoplay===Gt.autoplay.ON&&this.controls.Play())}),this.__RegisterVideoEventListener("seeking",()=>{if(!this.isLive||!this.dvrAvailable)return;const $=this.video.duration-this.video.currentTime;this.behindLiveEdge=$>15,this.__SettingsUpdate()}),await this.__LoadCollection(),this.collectionInfo&&this.collectionInfo.isPlaylist&&this.collectionInfo.mediaIndex<this.collectionInfo.mediaLength-1&&this.__RegisterVideoEventListener("ended",()=>this.controls&&this.controls.CollectionPlayNext({autoplay:!0}));let{objectId:s,versionHash:u,playoutUrl:o,thumbnailTrackUrl:c,protocol:p,drm:d,drms:y,multiviewOptions:m,playoutParameters:v,trimOffset:b,thumbnailOffset:x,offering:E,compositionKey:C,clipStart:T,clipEnd:k,frameRate:M,frameRateRat:O}=await this.__PlayoutOptions();this.playoutInfo={objectId:s,versionHash:u,offering:E,compositionKey:C,trimOffset:b,thumbnailOffset:x,clipStart:T,clipEnd:k,frameRate:M,frameRateRat:O},this.contentHash=u,o=new URL(o);const R=this.sourceOptions.playoutParameters.authorizationToken||o.searchParams.get("authorization");if(this.authorizationToken=R,this.playoutUrl=o.toString(),this.thumbnailTrackUrl=c,this.castHandler&&this.castHandler.SetMedia({playoutOptions:this.sourceOptions.playoutOptions,playoutParameters:v}),this.__destroyed)return;p==="hls"?await this.__InitializeHLS({playoutUrl:o,authorizationToken:R,drm:d,drms:y,multiviewOptions:m}):await this.__InitializeDash({playoutUrl:o,authorizationToken:R,drm:d,drms:y,multiviewOptions:m}),this.playerOptions.collectVideoAnalytics&&Promise.resolve().then(()=>require("./Analytics-B0HNzKyF.js")).then(({InitializeMuxMonitoring:$})=>$({appName:this.playerOptions.appName||"elv-player-js",elvPlayer:this,playoutUrl:o,authorizationToken:R,disableCookies:this.playerOptions.collectVideoAnalytics===Gt.collectVideoAnalytics.DISABLE_COOKIES})),this.playerOptions.verifyContent&&setTimeout(()=>{this.__VerifyContent()},1e3),this.playerOptions.loadChapters&&this.__LoadChapters({...this.playoutInfo||{}}).then($=>this.__chapterTags=$).catch($=>this.Log($,!0)),this.playerOptions.loadPoseOverlay&&this.__LoadPoseOverlayTags({...this.playoutInfo||{}}).then($=>{this.__poseOverlayTags=$,this.__showOverlay=!0}).catch($=>this.Log($,!0)),this.playerOptions.playerCallback&&this.playerOptions.playerCallback({player:this,videoElement:this.video,hlsPlayer:this.hlsPlayer,dashPlayer:this.dashPlayer}),this.__destroyed&&this.__DestroyPlayer(),this.initialized=!0,this.restartParameters=void 0,this.thumbnailTrackUrl&&(this.thumbnailHandler=new Eee(this.thumbnailTrackUrl,x||b||0),this.thumbnailHandler.LoadThumbnails().then(()=>{this.thumbnailsLoaded=!0,this.__SettingsUpdate()}))}catch(a){let s;if(a&&[401,403].includes(a.status)||[401,403].includes(a.code))try{const u=await this.__Client(),o=this.sourceOptions.playoutParameters.linkPath?await u.LinkTarget({...this.sourceOptions.playoutParameters}):this.sourceOptions.playoutParameters.versionHash||await u.LatestVersionHash({objectId:this.sourceOptions.playoutParameters.objectId});s=await u.ContentObjectMetadata({versionHash:o,metadataSubtree:"public/asset_metadata/permission_message",authorizationToken:this.sourceOptions.playoutParameters.authorizationToken}),s?(a.permission_message=s,this.SetErrorMessage(s,a),typeof a=="object"?a.permission_message=s:this.Log(s,!0)):this.SetErrorMessage(a.displayMessage||"Insufficient permissions",a)}catch(u){this.SetErrorMessage(u.displayMessage||"Insufficient permissions",u)}else a.status>=500?this.__HardReload(a,1e4):this.__HardReload(a,2e4);this.playerOptions.errorCallback&&this.playerOptions.errorCallback(a,this)}finally{this.loading=!1,this.__SettingsUpdate()}}}async __InitializeHLS({playoutUrl:e,authorizationToken:t,drm:a,drms:s,multiviewOptions:u}){this.HLS=(await Promise.resolve().then(()=>require("./hls-DM9gWZ70.js"))).default;const o=this.video.canPlayType("application/vnd.apple.mpegURL");if(o&&Aee&&this.playerOptions.preferNativeHLS||[Gt.drms.FAIRPLAY,Gt.drms.SAMPLE_AES].includes(a)||!this.HLS.isSupported()){if(this.nativeHLS=!0,a===Gt.drms.FAIRPLAY?Fq({playoutOptions:this.sourceOptions.playoutOptions,video:this.video}):this.video.src=e.toString(),u.enabled){const c=u.SwitchView;u.SwitchView=async p=>{await c(p)}}}else{e.searchParams.delete("authorization");let c={};(a===Gt.drms.PLAYREADY||a===Gt.drms.WIDEVINE)&&(c={drmSystems:{},emeEnabled:!0,licenseXhrSetup:(m,v)=>{m.open("POST",v,!0),m.setRequestHeader("Authorization",`Bearer ${t}`)}},a===Gt.drms.PLAYREADY?c.drmSystems={"com.microsoft.playready":{licenseUrl:s[a].licenseServers[0]}}:a===Gt.drms.WIDEVINE&&(c.drmSystems={"com.widevine.alpha":{licenseUrl:s[a].licenseServers[0]}}));let p=(kee[this.playerOptions.playerProfile]||{}).hlsSettings||{};const d=this.playerOptions.playerProfile===Gt.playerProfile.CUSTOM?this.customHLSOptions:{};this.sourceOptions.playoutParameters&&this.sourceOptions.playoutParameters.channel&&Object.keys(d).length===0&&(p.maxBufferHole=4.2),this.hlsOptions={capLevelToPlayerSize:this.playerOptions.capLevelToPlayerSize,xhrSetup:m=>(m.setRequestHeader("Authorization",`Bearer ${t}`),(this.playerOptions.hlsjsOptions||{}).xhrSetup&&this.playerOptions.hlsjsOptions.xhrSetup(m),m),...c,...p,...d},this.dvrAvailable&&(delete this.hlsOptions.liveMaxLatencyDuration,delete this.hlsOptions.liveMaxLatencyDurationCount);const y=new this.HLS(this.hlsOptions);if(this.playerOptions.maxBitrate&&y.on(this.HLS.Events.MANIFEST_PARSED,(m,{levels:v,firstLevel:b})=>{let x=v.map((E,C)=>E.bitrate>this.playerOptions.maxBitrate?C:void 0).filter(E=>typeof E<"u").reverse();x.length===v.length&&(this.Log(`Warning: Max bitrate '${this.playerOptions.maxBitrate}bps' is less than all available levels for this content.`),x=x.filter(E=>E>0)),this.Log("Removing the following levels due to maxBitrate setting:"),this.Log(x.map(E=>[v[E].width,"x",v[E].height,` (${(v[E].bitrate/1e3/1e3).toFixed(1)}Mbps)`].join("")).join(", ")),x.find(E=>b===E)&&(y.startLevel=v.map((E,C)=>C).filter(E=>!x.includes(E)).reverse()[0]),x.map(E=>y.removeLevel(E))}),this.playerOptions.minBitrate&&y.on(this.HLS.Events.MANIFEST_PARSED,(m,{levels:v,firstLevel:b})=>{let x=v.map((E,C)=>E.bitrate<this.playerOptions.minBitrate?C:void 0).filter(E=>typeof E<"u");x.length===v.length&&(this.Log(`Warning: Min bitrate '${this.playerOptions.minBitrate}bps' is greater than all available levels for this content.`),x=x.slice(0,-1)),this.Log("Removing the following levels due to minBitrate setting:"),this.Log(x.map(E=>[v[E].width,"x",v[E].height,` (${(v[E].bitrate/1e3/1e3).toFixed(1)}Mbps)`].join("")).join(", ")),x.find(E=>b===E)&&(y.startLevel=v.map((E,C)=>C).filter(E=>!x.includes(E)).reverse()[0]),x.reverse().map(E=>y.removeLevel(E))}),y.loadSource(e.toString()),y.attachMedia(this.video),this.controls&&u.enabled){const m=u.SwitchView;u.SwitchView=async v=>{await m(v),y.nextLevel=y.currentLevel},this.controls.InitializeMultiViewControls(u)}if([this.HLS.Events.SUBTITLE_TRACKS_UPDATED,this.HLS.Events.SUBTITLE_TRACK_SWITCH,this.HLS.Events.LEVEL_UPDATED,this.HLS.Events.LEVEL_SWITCHED,this.HLS.Events.AUDIO_TRACKS_UPDATED,this.HLS.Events.AUDIO_TRACK_SWITCHED,this.HLS.Events.MANIFEST_LOADED].map(m=>y.on(m,()=>this.__SettingsUpdate())),typeof this.sourceOptions.playoutParameters.audioTrackLabel<"u"&&y.on(this.HLS.Events.AUDIO_TRACKS_UPDATED,()=>{const m=(this.controls.GetAudioTracks().options||[]).find(v=>v.label===this.sourceOptions.playoutParameters.audioTrackLabel);m&&this.controls.SetAudioTrack(m.index)}),this.SetPlayerProfile=async({profile:m,customHLSOptions:v={}})=>{if(this.playoutUrl&&this.playoutUrl.includes("hls-widevine")){this.__UpdateParameters({playerOptions:{playerProfile:m,hlsjsOptions:v}}),this.__ReloadComponent();return}this.videoDuration=void 0,this.playerOptions.playerProfile=m,this.customHLSOptions=v;const b=!this.video.paused,x=this.video.currentTime;try{this.hlsPlayer.destroy()}catch(E){this.Log("Failed to destroy HLS player",!0),this.Log(E,!0)}await this.__InitializeHLS({playoutUrl:e,authorizationToken:t,drm:a,drms:s,multiviewOptions:u}),b?this.video.play():this.video.pause(),this.isLive||(this.video.currentTime=x)},y.on(this.HLS.Events.FRAG_LOADED,()=>{this.errors=0,clearTimeout(this.stallTimeout)}),y.on(this.HLS.Events.ERROR,async(m,v)=>{if(this.errors+=1,this.Log(`Encountered ${v.details}`,!0),this.Log(v,!0),v.response&&v.response.code===403)this.SetErrorMessage("Insufficient permissions",v);else if(this.errors<5){if(v.fatal)v.data&&v.data.type===this.HLS.ErrorTypes.MEDIA_ERROR?(this.Log("Attempting to recover using hlsPlayer.recoverMediaError",!0),y.recoverMediaError()):this.__HardReload(v);else if(v.details==="bufferStalledError"){clearTimeout(this.stallTimeout);let b=this.video&&this.video.currentTime;this.stallTimeout=setTimeout(()=>{this.video&&this.video.currentTime>b||(this.Log("Buffer Stalled. Attempting to recover using hlsPlayer.recoverMediaError",!0),y.recoverMediaError(),this.stallTimeout=setTimeout(()=>{this.Log("Buffer Stalled. Reloading player...",!0),this.__HardReload(v,0,b)},6e3))},6e3)}}else this.__HardReload(v)}),this.hlsPlayer=y,this.player=y,o){const m=document.createElement("source");m.src=this.playoutUrl.toString(),this.video.appendChild(m),this.video.disableRemotePlayback=!1}}}async __InitializeDash({playoutUrl:e,authorizationToken:t,drm:a,drms:s}){this.Dash=(await Promise.resolve().then(()=>require("./dash.all.min-27fvn-N6.js"))).MediaPlayer;const u=this.Dash().create(),o=this.playerOptions.dashjsOptions||{};if(u.updateSettings({...o,streaming:{buffer:{fastSwitchEnabled:!0,flushBufferAtTrackSwitch:!0,...(o.streaming||{}).buffer||{}},text:{defaultEnabled:!1,...(o.streaming||{}).text||{}},...o.streaming||{}}}),this.playerOptions.capLevelToPlayerSize&&u.updateSettings({streaming:{abr:{limitBitrateByPortal:!0}}}),this.playerOptions.maxBitrate&&u.updateSettings({streaming:{abr:{maxBitrate:{video:this.playerOptions.maxBitrate/1e3}}}}),this.playerOptions.minBitrate&&u.updateSettings({streaming:{abr:{minBitrate:{video:this.playerOptions.minBitrate/1e3}}}}),e.searchParams.delete("authorization"),u.addRequestInterceptor(function(c){return c.headers.Authorization=`Bearer ${t}`,c}),a===Gt.drms.WIDEVINE){const c=s.widevine.licenseServers[0];u.setProtectionData({"com.widevine.alpha":{serverURL:c}})}u.initialize(this.video,e.toString(),this.playerOptions.autoplay===Gt.autoplay.ON),[this.Dash.events.TRACK_CHANGE_RENDERED,this.Dash.events.QUALITY_CHANGE_RENDERED,this.Dash.events.REPRESENTATION_SWITCH,this.Dash.events.TEXT_TRACKS_ADDED,this.Dash.events.TEXT_TRACK_ADDED,this.Dash.events.MANIFEST_LOADED,this.Dash.events.CAN_PLAY].map(c=>u.on(c,()=>this.__SettingsUpdate())),typeof this.sourceOptions.playoutParameters.audioTrackLabel<"u"&&u.on(this.Dash.events.CAN_PLAY,()=>{const c=(this.controls.GetAudioTracks().options||[]).find(p=>p.label===this.sourceOptions.playoutParameters.audioTrackLabel);c&&this.controls.SetAudioTrack(c.index)}),this.video.textTracks.addEventListener("change",()=>this.__SettingsUpdate()),this.player=u,this.dashPlayer=u}async __Play(){try{return await this.video.play(),!0}catch(e){if(e&&(e.toString()||"").includes("AbortError"))return!1;if(this.Log("Unable to autoplay",!0),this.Log(e,!0),this.playbackStarted=!1,this.playerOptions.muted===Gt.muted.OFF_IF_POSSIBLE&&this.video.paused&&!this.video.muted){await new Promise(t=>setTimeout(t,250)),this.Log("Attempting to autoplay muted"),this.video.muted=!0;try{return await this.video.play(),!0}catch{return this.playbackStarted=!1,!1}}else return this.playbackStarted=!1,!1}}async __PublicMetadataUrl({versionHash:e,authorizationToken:t}){const a=await this.__Client();let s=!1;try{await a.ContentObjectMetadata({versionHash:e,metadataSubtree:"/public/name",noAuth:!0})}catch{s=!0}let u=new URL((await a.NetworkInfo()).name==="demov3"?"https://demov3.net955210.contentfabric.io":"https://main.net955305.contentfabric.io"),o=`s/${a.NetworkInfo().name}`;return s&&(o=`t/${t}`),u.pathname=`${o}/q/${e}/meta/public`,u.toString()}async __VerifyContent(){if(!this.contentHash)return;const e=await this.__Client(),t=this.isLive?await e.AuditStream({versionHash:this.contentHash,authorizationToken:this.authorizationToken}):await e.AuditContentObject({versionHash:this.contentHash,authorizationToken:this.authorizationToken});if(!t.verified)return;t.verifiedAt=Date.now();const a=e.utils.DecodeVersionHash(this.contentHash).objectId;t.details={_state:"initial",versionHash:this.contentHash,objectId:a,address:e.utils.HashToAddress(a),signatureMethod:"ECDSA secp256k1"},this.contentAudit=t,this.contentVerified=t.verified,this.publicMetadataUrl=await this.__PublicMetadataUrl({versionHash:this.contentHash,authorizationToken:this.authorizationToken}),this.__SettingsUpdate()}async __LoadVerificationDetails(){if(!this.contentHash||!this.contentAudit||this.contentAudit.details._state!=="initial"||this.contentAudit.loading)return;this.contentAudit.loading=!0;const e=await this.__Client(),t=e.utils.DecodeVersionHash(this.contentHash).objectId,a=await e.ContentObjectTenantId({objectId:t}),s=await e.ContentSpaceId();let u,o,c;try{o=await e.CallContractMethod({contractAddress:e.utils.HashToAddress(t),methodName:"objectTimestamp"}),o&&(o=new Date(parseInt(o._hex,16)*1e3)),c=await e.CallContractMethod({contractAddress:e.utils.HashToAddress(t),methodName:"countVersionHashes"}),c&&(c=parseInt(c._hex,16))}catch{}try{u=await e.ContentObjectMetadata({libraryId:s.replace("ispc","ilib"),objectId:a.replace("iten","iq__"),metadataSubtree:"/public/name"})}catch{}this.contentAudit.details={_state:"minus-tx",versionHash:this.contentHash,objectId:t,address:e.utils.HashToAddress(t),explorerUrl:e.NetworkInfo().name!=="main"?void 0:`https://explorer.contentfabric.io/address/${e.utils.HashToAddress(t)}`,tenantId:a,tenantAddress:e.utils.HashToAddress(a),tenantName:u,ownerAddress:await e.ContentObjectOwner({objectId:t}),lastCommittedAt:o,versionCount:c,latestVersionHash:await e.LatestVersionHash({objectId:t}),signatureMethod:"ECDSA secp256k1"},this.__SettingsUpdate();try{if(e.NetworkInfo().name==="main"){const p=new URL("https://explorer.contentfabric.io/api");p.searchParams.set("module","account"),p.searchParams.set("action","txlist"),p.searchParams.set("offset","1"),p.searchParams.set("address",e.utils.HashToAddress(t)),this.contentAudit.details.latestTransactionHash=(await(await fetch(p)).json()).result[0].hash,this.contentAudit.details.latestTransactionHashUrl=`https://explorer.contentfabric.io/tx/${this.contentAudit.details.latestTransactionHash}`}}catch{}finally{this.contentAudit.details._state="full",delete this.contentAudit.loading,this.__SettingsUpdate()}}__SettingsUpdate(){this.__settingsListeners.forEach(e=>{try{e()}catch(t){this.Log("Failed to call settings listener",!0),this.Log(t,!0)}})}__SetControlsVisibility(e){this.controls.visible!==e&&(this.controls.visible=e,this.__SettingsUpdate())}__DestroyPlayer(){this.castHandler&&this.castHandler.Destroy(),this.__destroyed=!0,this.__Reset()}__Reset(){if(this.player){this.Log("Destroying player"),this.video&&this.video.pause();try{this.hlsPlayer?this.hlsPlayer.destroy():this.dashPlayer&&this.dashPlayer.destroy()}catch(e){this.Log("Failed to destroy abr player",!0),this.Log(e,!0)}if(this.__listenerDisposers.forEach(e=>{try{e()}catch(t){this.Log("Failed to dispose of video event listener",!0),this.Log(t,!0)}}),this.__settingsListeners=[],this.__listenerDisposers=[],this.__showPlayerProfileForm=!1,this.video.mux)try{this.video.mux.destroy()}catch(e){this.Log("Error destroying mux monitoring:"),this.Log(e)}this.contentHash=void 0,this.nativeHLS=!1,this.hlsPlayer=void 0,this.dashPlayer=void 0,this.player=void 0,this.initTimeLogged=!1,this.playoutUrl=void 0,this.thumbnailTrackUrl=void 0,this.thumbnailHandler=void 0,this.thumbnailsLoaded=void 0,this.canPlay=!1,this.isLive=!1,this.behindLiveEdge=!1,this.dvrAvailable=!1,this.dvrEnabled=!1,this.publicMetadataUrl=void 0,this.airplayAvailable=!1,this.chromecastAvailable=fL&&this.playerOptions.allowCasting,this.casting=!1,this.__error=void 0,this.__chapterTags=void 0,this.playoutInfo=void 0}}async __HardReload(e,t=6e3,a){if(!this.reloading){if(this.reloading=!0,this.reloads+=1,this.reloads>10){this.SetErrorMessage(e&&e.displayMessage||"Unable to play content",e);return}this.playoutUrl&&this.playoutUrl.includes("hls-widevine")&&this.__ReloadComponent();try{if(e&&this.playerOptions.restartCallback)try{const s=await this.playerOptions.restartCallback(e);if(s&&typeof s=="boolean"){this.Destroy();return}}catch(s){this.Log("Restart callback failed:"),this.Log(s)}if(t>0&&(this.SetErrorMessage(e&&e.displayMessage||"Something went wrong, reloading player...",e),await new Promise(s=>setTimeout(s,t))),this.__destroyed)return;this.Log("Reloading stream");try{const s=await this.__Client();s.region?await s.UseRegion({region:s.region}):s.Nodes().fabricURIs.length>1&&await s.ResetRegion()}catch(s){this.Log("Client region reset failed:"),this.Log(s)}this.restarted=!0,this.SetErrorMessage(void 0),this.__Initialize(this.originalParameters,!this.video||!this.initialized?this.restartParameters:{muted:this.video.muted,volume:this.video.volume,currentTime:a||this.video.currentTime,playing:!this.video.paused})}finally{this.reloading=!1}}}Log(e,t=!1){t?console.error("ELUVIO PLAYER:",e):this.playerOptions.debugLogging&&console.warn("ELUVIO PLAYER:",e)}__SetCasting(e){e&&(this.controls.SetDVREnabled(!1),this.controls.Pause()),this.casting=e,this.__SettingsUpdate()}async __LoadChapters({objectId:e,offering:t,compositionKey:a,clipStart:s,clipEnd:u}){const{tracks:o}=await this.__QueryAIAPI({objectId:e,path:sp("/tagstore",e,"tracks"),format:"JSON"});if(o.find(c=>c.name==="chapter"))return((await this.__QueryAIAPI({objectId:e,path:t||a?sp("/tagstore",e,"compositions","tags"):sp("/tagstore",e,"tags"),queryParams:{channel_key:a,offering_key:t,limit:1e6,track:"chapter",clip_start:s,clip_end:u},format:"JSON"})).tags||[]).filter(c=>typeof c.start_time<"u"&&typeof c.tag=="string").sort((c,p)=>c.start_time<p.start_time?-1:1).map(c=>({...c,start_time:c.start_time/1e3,end_time:c.end_time/1e3})).map((c,p,d)=>({...c,end_time:(d[p+1]||{}).start_time||c.end_time}))}async __LoadPoseOverlayTags({objectId:e,offering:t,compositionKey:a,clipStart:s,clipEnd:u}){const{tracks:o}=await this.__QueryAIAPI({objectId:e,path:sp("/tagstore",e,"tracks"),queryParams:{has_frame_info:!0},format:"JSON"});if(!o.find(p=>p.name==="pose"))return;let c={};return((await this.__QueryAIAPI({objectId:e,path:t||a?sp("/tagstore",e,"compositions","tags"):sp("/tagstore",e,"tags"),queryParams:{has_frame_info:!0,channel_key:a,offering_key:t,limit:1e6,track:"pose",clip_start:s,clip_end:u},format:"JSON"})).tags||[]).forEach(p=>{const d=parseInt(p.frame_info.frame_idx);c[d]||(c[d]=[]),c[d].push(p)}),c}async __QueryAIAPI({server:e="ai",method:t="GET",path:a,objectId:s,queryParams:u={},body:o,stringifyBody:c=!0,authTokenInBody:p=!1,headers:d={},format:y="json",allowStatus:m=[]}){const v=new URL(`https://${e}.contentfabric.io/`);v.pathname=a,Object.keys(u).forEach(C=>u[C]&&v.searchParams.set(C,u[C]));const b=await this.__Client(),x=(this.sourceOptions.playoutParameters||{}).authorizationToken||new URL(await b.FabricUrl({versionHash:await b.LatestVersionHash({objectId:s}),channelAuth:!0})).searchParams.get("authorization");v.searchParams.set("authorization",x),p&&(o.append?o.append("authorization",x):o.authorization=x),o&&c&&(o=JSON.stringify(o));const E=await fetch(v,{method:t,headers:d,body:o});if(E.status>=400&&!m.includes(E.status))throw E;if(E.status!==204)return y?await b.utils.ResponseToFormat(y,E):E}}Yw.EluvioPlayerParameters=Gt;Yw.EluvioPlayer=Yw;var rD=(function(){if(typeof Map<"u")return Map;function n(e,t){var a=-1;return e.some(function(s,u){return s[0]===t?(a=u,!0):!1}),a}return(function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(t){var a=n(this.__entries__,t),s=this.__entries__[a];return s&&s[1]},e.prototype.set=function(t,a){var s=n(this.__entries__,t);~s?this.__entries__[s][1]=a:this.__entries__.push([t,a])},e.prototype.delete=function(t){var a=this.__entries__,s=n(a,t);~s&&a.splice(s,1)},e.prototype.has=function(t){return!!~n(this.__entries__,t)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,a){a===void 0&&(a=null);for(var s=0,u=this.__entries__;s<u.length;s++){var o=u[s];t.call(a,o[1],o[0])}},e})()})(),gA=typeof window<"u"&&typeof document<"u"&&window.document===document,Qw=(function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()})(),Tee=(function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Qw):function(n){return setTimeout(function(){return n(Date.now())},1e3/60)}})(),Mee=2;function Ree(n,e){var t=!1,a=!1,s=0;function u(){t&&(t=!1,n()),a&&c()}function o(){Tee(u)}function c(){var p=Date.now();if(t){if(p-s<Mee)return;a=!0}else t=!0,a=!1,setTimeout(o,e);s=p}return c}var Oee=20,Lee=["top","right","bottom","left","width","height","size","weight"],Nee=typeof MutationObserver<"u",Pee=(function(){function n(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=Ree(this.refresh.bind(this),Oee)}return n.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},n.prototype.removeObserver=function(e){var t=this.observers_,a=t.indexOf(e);~a&&t.splice(a,1),!t.length&&this.connected_&&this.disconnect_()},n.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},n.prototype.updateObservers_=function(){var e=this.observers_.filter(function(t){return t.gatherActive(),t.hasActive()});return e.forEach(function(t){return t.broadcastActive()}),e.length>0},n.prototype.connect_=function(){!gA||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Nee?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},n.prototype.disconnect_=function(){!gA||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},n.prototype.onTransitionEnd_=function(e){var t=e.propertyName,a=t===void 0?"":t,s=Lee.some(function(u){return!!~a.indexOf(u)});s&&this.refresh()},n.getInstance=function(){return this.instance_||(this.instance_=new n),this.instance_},n.instance_=null,n})(),aD=(function(n,e){for(var t=0,a=Object.keys(e);t<a.length;t++){var s=a[t];Object.defineProperty(n,s,{value:e[s],enumerable:!1,writable:!1,configurable:!0})}return n}),N0=(function(n){var e=n&&n.ownerDocument&&n.ownerDocument.defaultView;return e||Qw}),iD=F_(0,0,0,0);function Xw(n){return parseFloat(n)||0}function dL(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.reduce(function(a,s){var u=n["border-"+s+"-width"];return a+Xw(u)},0)}function Iee(n){for(var e=["top","right","bottom","left"],t={},a=0,s=e;a<s.length;a++){var u=s[a],o=n["padding-"+u];t[u]=Xw(o)}return t}function Dee(n){var e=n.getBBox();return F_(0,0,e.width,e.height)}function Uee(n){var e=n.clientWidth,t=n.clientHeight;if(!e&&!t)return iD;var a=N0(n).getComputedStyle(n),s=Iee(a),u=s.left+s.right,o=s.top+s.bottom,c=Xw(a.width),p=Xw(a.height);if(a.boxSizing==="border-box"&&(Math.round(c+u)!==e&&(c-=dL(a,"left","right")+u),Math.round(p+o)!==t&&(p-=dL(a,"top","bottom")+o)),!Bee(n)){var d=Math.round(c+u)-e,y=Math.round(p+o)-t;Math.abs(d)!==1&&(c-=d),Math.abs(y)!==1&&(p-=y)}return F_(s.left,s.top,c,p)}var Fee=(function(){return typeof SVGGraphicsElement<"u"?function(n){return n instanceof N0(n).SVGGraphicsElement}:function(n){return n instanceof N0(n).SVGElement&&typeof n.getBBox=="function"}})();function Bee(n){return n===N0(n).document.documentElement}function zee(n){return gA?Fee(n)?Dee(n):Uee(n):iD}function jee(n){var e=n.x,t=n.y,a=n.width,s=n.height,u=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,o=Object.create(u.prototype);return aD(o,{x:e,y:t,width:a,height:s,top:t,right:e+a,bottom:s+t,left:e}),o}function F_(n,e,t,a){return{x:n,y:e,width:t,height:a}}var qee=(function(){function n(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=F_(0,0,0,0),this.target=e}return n.prototype.isActive=function(){var e=zee(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},n.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},n})(),Hee=(function(){function n(e,t){var a=jee(t);aD(this,{target:e,contentRect:a})}return n})(),Vee=(function(){function n(e,t,a){if(this.activeObservations_=[],this.observations_=new rD,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=a}return n.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof N0(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new qee(e)),this.controller_.addObserver(this),this.controller_.refresh())}},n.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof N0(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},n.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},n.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},n.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(a){return new Hee(a.target,a.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},n.prototype.clearActive=function(){this.activeObservations_.splice(0)},n.prototype.hasActive=function(){return this.activeObservations_.length>0},n})(),sD=typeof WeakMap<"u"?new WeakMap:new rD,oD=(function(){function n(e){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=Pee.getInstance(),a=new Vee(e,t,this);sD.set(this,a)}return n})();["observe","unobserve","disconnect"].forEach(function(n){oD.prototype[n]=function(){var e;return(e=sD.get(this))[n].apply(e,arguments)}});var Gee=(function(){return typeof Qw.ResizeObserver<"u"?Qw.ResizeObserver:oD})();const B_=({element:n,Hide:e})=>{if(!n)return;const t=u=>{u&&(u.key||"").toLowerCase()==="escape"&&e()},a=u=>{n.contains(u.target)||e()};let s=setTimeout(()=>{document.body.addEventListener("keydown",t),document.body.addEventListener("click",a,!0)},0);return()=>{clearTimeout(s),document.body.removeEventListener("keydown",t),document.body.removeEventListener("click",a,!0)}},uD=({player:n,setVideoState:e})=>{const t=function(){if(!n||!n.controls)return;const u=n.video.buffered;let o=0;for(let c=0;c<u.length;c++)u.start(c)>n.controls.GetCurrentTime()||u.end(c)>o&&(o=u.end(c));e({playing:n.controls.IsPlaying(),duration:n.controls.GetDuration(),volume:n.controls.GetVolume(),muted:n.controls.IsMuted(),rate:n.controls.GetPlaybackRate(),fullscreen:!!(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)})},a=["play","pause","volumechange","seeked","durationchange","ratechange"];a.map(u=>n.video.addEventListener(u,t)),n.target.addEventListener("fullscreenchange",t);const s=n.castHandler&&n.castHandler.RegisterListener(t);return()=>{a.map(u=>n.video.removeEventListener(u,t)),n.target.removeEventListener("fullscreenchange",t),s&&s()}},$ee=({video:n,setBufferFraction:e})=>{const t=()=>{if(!isFinite(n.duration))return 1;const a=n.buffered;let s=0;for(let u=0;u<a.length;u++)a.start(u)>n.currentTime||a.end(u)>s&&(s=a.end(u));e(1-(n.duration-s)/n.duration)};return n.addEventListener("progress",t),()=>n.removeEventListener("progress",t)},E5=({player:n,rate:e=10,setCurrentTime:t})=>{const a=setInterval(()=>{n.controls&&t(n.controls.GetCurrentTime())},1e3/e);return()=>{clearInterval(a)}},Wee=({target:n,setSize:e,setOrientation:t,setDimensions:a})=>{let s;const u=()=>{clearTimeout(s);const c=n.getBoundingClientRect();let p="sm",d="landscape";c.width>1400&&c.height>600?p="xl":c.width>1e3&&c.height>400?p="lg":c.width>650&&c.height>300&&(p="md"),c.width<c.height&&(d="portrait"),e(p),t(d),s=setTimeout(()=>{a({width:c.width,height:c.height})},500)};u();const o=new Gee(u);return o.observe(n),()=>o.disconnect()},Kee=({player:n})=>{const e=n.video,t=n.playerOptions.autoplay===Gt.autoplay.WHEN_VISIBLE,a=n.playerOptions.muted===Gt.muted.WHEN_NOT_VISIBLE;if(!t&&!a)return;let s,u;const o=async([p])=>{t&&(s!=="play"&&p.isIntersecting&&e.paused?(n.controls.Play(),s="play"):s!=="pause"&&!p.isIntersecting&&!e.paused&&(n.controls.Pause(),s="pause")),a&&(u!=="unmute"&&p.isIntersecting&&e.muted?(e.muted=!1,u="unmute"):u!=="mute"&&!p.isIntersecting&&!e.muted&&(e.muted=!0,u="mute"))},c=new window.IntersectionObserver(o,{threshold:.1}).observe(e);return()=>c&&c.disconnect()},Jee=({player:n,inactivityPeriod:e=3e3,onSleep:t,onWake:a})=>{let s;const u=p=>{clearTimeout(s),a&&a(),s=setTimeout(()=>{t&&t()},p.type==="mouseout"?500:e)},o=["play","pause","volumechange","seeking"];o.forEach(p=>n.video.addEventListener(p,u));const c=["click","dblclick","keydown","mousemove","touchmove","blur","fullscreenchange"];return c.forEach(p=>n.target.addEventListener(p,u)),()=>{o.map(p=>n.video.removeEventListener(p,u)),c.map(p=>n.target.removeEventListener(p,u))}},Yee=({player:n,setRecentUserAction:e})=>{if(n.playerOptions.keyboardControls===Gt.keyboardControls.OFF)return;const t=n.playerOptions.keyboardControls===Gt.keyboardControls.ARROW_KEYS_DISABLED,a=tD(n,e)(),s=u=>{if(!(n.target===u.target||n.target.contains(u.target))||["button","input"].includes(document.activeElement&&document.activeElement.tagName.toLowerCase())||n.__showPlayerProfileForm)return;let o;switch(u.key){case" ":case"k":o=n.controls.TogglePlay(),e({action:o?Un.PLAY:Un.PAUSE});break;case"f":n.controls.ToggleFullscreen();break;case"m":o=n.controls.ToggleMuted(),e({action:o?Un.MUTE:Un.UNMUTE});break;case"ArrowDown":t||(o=n.controls.SetVolume({relativeFraction:-.1}),e({action:o===0?Un.MUTE:Un.VOLUME_DOWN,text:(o*100).toFixed(0)+"%"}));break;case"ArrowUp":t||(o=n.controls.SetVolume({relativeFraction:.1}),e({action:Un.VOLUME_UP,text:(o*100).toFixed(0)+"%"}));break;case",":n.video.paused&&(n.controls.Seek({relativeSeconds:-1/60}),e({action:Un.SEEK_BACK}));break;case".":n.video.paused&&(n.controls.Seek({relativeSeconds:1/60}),e({action:Un.SEEK_FORWARD}));break;case"ArrowLeft":case"ArrowRight":t||a(u);break;case"j":n.controls.Seek({relativeSeconds:-10}),e({action:Un.SEEK_BACK,text:"10 seconds"});break;case"l":n.controls.Seek({relativeSeconds:10}),e({action:Un.SEEK_FORWARD,text:"10 seconds"});break;case"<":case">":const c=n.controls.GetPlaybackRates();c.active?o=n.controls.SetPlaybackRate({index:c.active.index+(u.key==="<"?-1:1)}):o=n.controls.SetPlaybackRate({rate:1}),o&&e({action:o.increase?Un.PLAYBACK_RATE_UP:Un.PLAYBACK_RATE_DOWN,text:`${o.rate.toFixed(2)}x`});break;case"c":o=n.controls.ToggleTextTrack(),e({action:o?Un.SUBTITLES_ON:Un.SUBTITLES_OFF});break;case"P":n.controls.CollectionPlayPrevious(),e({action:Un.PLAY_PREVIOUS});break;case"N":n.controls.CollectionPlayNext(),e({action:Un.PLAY_NEXT});break;case"Home":n.controls.Seek({fraction:0}),e({action:Un.SEEK_BACK});break;case"End":n.controls.Seek({fraction:1}),e({action:Un.SEEK_FORWARD});break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":o=n.controls.Seek({fraction:parseFloat(u.key)*.1}),e({action:o?Un.SEEK_FORWARD:Un.SEEK_BACK});break;default:return}u.preventDefault()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},Qee=({player:n})=>{if("mediaSession"in navigator){const e=["play","pause","stop","seekbackward","seekforward","seekto","previoustrack","nexttrack"];e.forEach(s=>{navigator.mediaSession.setActionHandler(s,u=>{switch(s){case"play":n.controls.Play();break;case"pause":n.controls.Pause();break;case"stop":n.controls.Stop();break;case"seekbackward":n.controls.Seek({relativeSeconds:u&&u.seekOffset||-10});break;case"seekforward":n.controls.Seek({relativeSeconds:u&&u.seekOffset||10});break;case"seekto":u&&typeof u.seekTime<"u"&&n.controls.Seek({time:u.seekTime});break;case"previoustrack":n.controls.CollectionPlayPrevious();break;case"nexttrack":n.controls.CollectionPlayNext();break}})});let t=setInterval(()=>{navigator.mediaSession.playbackState=n.video.paused?"paused":"playing",navigator.mediaSession.setPositionState({duration:isFinite(n.video.duration)?n.video.duration||0:n.video.currentTime+1,playbackRate:n.video.playbackRate,position:n.video.currentTime})},1e3);const a=n.controls.RegisterSettingsListener(()=>{const{title:s}=n.controls.GetContentInfo()||{};(!navigator.mediaSession.metadata||navigator.mediaSession.metadata.title!==s)&&(navigator.mediaSession.metadata=new MediaMetadata({title:s}))});return()=>{clearInterval(t),a&&a(),navigator.mediaSession.metadata=null,e.forEach(s=>{navigator.mediaSession.setActionHandler(s,null)})}}},Xee="_container_1lc7b_1",Zee="_autohide_1lc7b_40",ete="_seek_1lc7b_177",tte="_controls_1lc7b_210",nte="_time_1lc7b_224",rte="_spacer_1lc7b_282",ate="_watermark_1lc7b_299",Fn={container:Xee,"container--default-controls":"_container--default-controls_1lc7b_32","bottom-controls-container":"_bottom-controls-container_1lc7b_36",autohide:Zee,"info-container":"_info-container_1lc7b_43","bottom-controls-container--autohide":"_bottom-controls-container--autohide_1lc7b_44","floating-volume-toggle":"_floating-volume-toggle_1lc7b_45","icon-button":"_icon-button_1lc7b_51","icon-button-active":"_icon-button-active_1lc7b_65","icon-button--no-padding":"_icon-button--no-padding_1lc7b_71","info-image-container":"_info-image-container_1lc7b_109","info-image":"_info-image_1lc7b_109","info-text":"_info-text_1lc7b_125","info-headers":"_info-headers_1lc7b_134","info-description":"_info-description_1lc7b_144","info-title":"_info-title_1lc7b_150","info-subtitle":"_info-subtitle_1lc7b_155","center-play-button":"_center-play-button_1lc7b_163","center-play-button--hidden":"_center-play-button--hidden_1lc7b_170",seek:ete,"bottom-controls-gradient":"_bottom-controls-gradient_1lc7b_197",controls:tte,"play-pause-button":"_play-pause-button_1lc7b_220",time:nte,"live-indicator":"_live-indicator_1lc7b_234","collection-button-container":"_collection-button-container_1lc7b_252","collection-button-text":"_collection-button-text_1lc7b_257","collection-button-container--loading":"_collection-button-container--loading_1lc7b_266",spacer:rte,watermark:ate,"content-verified-badge":"_content-verified-badge_1lc7b_310","content-verification-menu-button":"_content-verification-menu-button_1lc7b_311","menu-control-container":"_menu-control-container_1lc7b_325"},lD='<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"> <circle cx="16" cy="16" r="16" fill="currentColor"/> <path d="M22 15.5L13.75 21.1292L13.75 9.87083L22 15.5Z" fill="black"/></svg>',cD='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-play"><polygon points="5 3 19 12 5 21 5 3"></polygon></svg>',fD='<?xml version="1.0" encoding="utf-8"?><!-- Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve"><circle cx="16" cy="16" r="16" fill="currentColor"/><path d="M22.8,16l-11.6,7V9L22.8,16z" fill="black"/></svg>',ite='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-pause"><rect x="6" y="4" width="4" height="16"></rect><rect x="14" y="4" width="4" height="16"></rect></svg>',dD='<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="15" cy="15" r="15" fill="currentColor"/><path d="M10 8H14V22H10V8ZM16 8H20V22H16V8Z" fill="black"/></svg>',ste='<svg width="19" height="19" viewBox="0 0 19 19" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1.46154 18.9985L5.84615 18.9942C6.03997 18.9942 6.22584 18.9172 6.36289 18.7801C6.49993 18.6431 6.57692 18.4572 6.57692 18.2634C6.57692 18.0696 6.49993 17.8837 6.36289 17.7467C6.22584 17.6096 6.03997 17.5326 5.84615 17.5326L1.46154 17.537V13.1538C1.46154 12.96 1.38455 12.7742 1.2475 12.6371C1.11046 12.5001 0.924581 12.4231 0.730769 12.4231C0.536957 12.4231 0.351083 12.5001 0.214037 12.6371C0.0769915 12.7742 0 12.96 0 13.1538V19H1.46154V18.9985ZM1.46154 0.00146249V3.57628e-07H0V5.84615C0 6.03997 0.0769915 6.22584 0.214037 6.36289C0.351083 6.49993 0.536957 6.57692 0.730769 6.57692C0.924581 6.57692 1.11046 6.49993 1.2475 6.36289C1.38455 6.22584 1.46154 6.03997 1.46154 5.84615V1.463L5.84615 1.46738C6.03997 1.46738 6.22584 1.39039 6.36289 1.25335C6.49993 1.1163 6.57692 0.930427 6.57692 0.736615C6.57692 0.542803 6.49993 0.35693 6.36289 0.219884C6.22584 0.0828385 6.03997 0.00584609 5.84615 0.00584609L1.46154 0.00146249V0.00146249ZM17.5385 18.9985V19H19V13.1538C19 12.96 18.923 12.7742 18.786 12.6371C18.6489 12.5001 18.463 12.4231 18.2692 12.4231C18.0754 12.4231 17.8895 12.5001 17.7525 12.6371C17.6155 12.7742 17.5385 12.96 17.5385 13.1538V17.537L13.1538 17.5326C12.96 17.5326 12.7742 17.6096 12.6371 17.7467C12.5001 17.8837 12.4231 18.0696 12.4231 18.2634C12.4231 18.4572 12.5001 18.6431 12.6371 18.7801C12.7742 18.9172 12.96 18.9942 13.1538 18.9942L17.5385 18.9985V18.9985ZM17.5385 0.00146249L13.1538 0.00584609C12.96 0.00584609 12.7742 0.0828385 12.6371 0.219884C12.5001 0.35693 12.4231 0.542803 12.4231 0.736615C12.4231 0.930427 12.5001 1.1163 12.6371 1.25335C12.7742 1.39039 12.96 1.46738 13.1538 1.46738L17.5385 1.463V5.84615C17.5385 6.03997 17.6155 6.22584 17.7525 6.36289C17.8895 6.49993 18.0754 6.57692 18.2692 6.57692C18.463 6.57692 18.6489 6.49993 18.786 6.36289C18.923 6.22584 19 6.03997 19 5.84615V3.57628e-07H17.5385V0.00146249V0.00146249Z" fill="currentColor"/></svg>',ote='<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 51.94 50.82"><defs><style>.cls-1{fill:none;stroke:#fff;stroke-linecap:round;stroke-miterlimit:10;stroke-width:4px;}</style></defs><polyline class="cls-1" points="12.1 49.82 12.1 35.59 1 35.59"/><polyline class="cls-1" points="39.84 1 39.84 15.22 50.94 15.22"/><polyline class="cls-1" points="12.1 1 12.1 15.22 1 15.22"/><polyline class="cls-1" points="39.84 49.82 39.84 35.59 50.94 35.59"/></svg>',ute='<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_363_9540)"><path d="M16.0889 9.77734C12.6223 9.77734 9.8667 12.5329 9.8667 15.9996C9.8667 19.4662 12.6223 22.2218 16.0889 22.2218C19.5556 22.2218 22.3111 19.4662 22.3111 15.9996C22.3111 12.5329 19.5556 9.77734 16.0889 9.77734ZM16.0889 20.444C13.6 20.444 11.6445 18.4885 11.6445 15.9996C11.6445 13.5107 13.6 11.5551 16.0889 11.5551C18.5778 11.5551 20.5334 13.5107 20.5334 15.9996C20.5334 18.4885 18.5778 20.444 16.0889 20.444Z" fill="currentColor"/><path d="M29.1556 13.0662L26.6667 12.2662L26.1334 10.9329L27.3778 8.62179C27.6445 8.08845 27.5556 7.37734 27.1112 6.9329L24.9778 4.79957C24.5334 4.35512 23.8223 4.26623 23.2889 4.5329L20.9778 5.77734L19.6445 5.24401L18.8445 2.75512C18.6667 2.22179 18.1334 1.77734 17.5112 1.77734H14.4889C13.8667 1.77734 13.3334 2.22179 13.2445 2.84401L12.4445 5.3329C11.9112 5.42179 11.4667 5.59957 11.0223 5.86623L8.71117 4.62179C8.17783 4.35512 7.46672 4.44401 7.02228 4.88845L4.88894 7.02179C4.4445 7.46623 4.35561 8.17734 4.62228 8.71068L5.77783 10.9329C5.60005 11.3773 5.42228 11.9107 5.2445 12.3551L2.75561 13.1551C2.22228 13.3329 1.77783 13.8662 1.77783 14.4885V17.5107C1.77783 18.1329 2.22228 18.6662 2.8445 18.844L5.33339 19.644L5.86672 20.9773L4.62228 23.2885C4.35561 23.8218 4.4445 24.5329 4.88894 24.9773L7.02228 27.1107C7.46672 27.5551 8.17783 27.644 8.71117 27.3773L11.0223 26.1329L12.3556 26.6662L13.1556 29.244C13.3334 29.7773 13.8667 30.2218 14.4889 30.2218H17.5112C18.1334 30.2218 18.6667 29.7773 18.8445 29.244L19.6445 26.6662L20.9778 26.1329L23.2889 27.3773C23.8223 27.644 24.5334 27.5551 24.9778 27.1107L27.1112 24.9773C27.5556 24.5329 27.6445 23.8218 27.3778 23.2885L26.1334 20.9773L26.6667 19.644L29.2445 18.844C29.7778 18.6662 30.2223 18.1329 30.2223 17.5107V14.4885C30.2223 13.8662 29.7778 13.244 29.1556 13.0662ZM28.4445 17.244L25.2445 18.2218L25.1556 18.6662L24.3556 20.5329L24.0889 20.9773L25.6889 23.9107L23.9112 25.6885L20.9778 24.0885L20.5334 24.3551C19.9112 24.7107 19.2889 24.9773 18.6667 25.1551L18.2223 25.244L17.2445 28.444H14.7556L13.7778 25.244L13.3334 25.1551L11.4667 24.3551L11.0223 24.0885L8.08894 25.6885L6.31117 23.9107L7.91117 20.9773L7.6445 20.5329C7.28894 19.9107 7.02228 19.2885 6.8445 18.6662L6.75561 18.2218L3.55561 17.244V14.7551L6.57783 13.8662L6.75561 13.4218C6.93339 12.7107 7.20005 12.0885 7.55561 11.4662L7.82228 11.0218L6.31117 8.08846L8.08894 6.31068L10.9334 7.91068L11.3778 7.64401C12.0001 7.28846 12.6223 7.02179 13.3334 6.84401L13.7778 6.66623L14.7556 3.55512H17.2445L18.2223 6.66623L18.6667 6.84401C19.2889 7.02179 19.9112 7.28846 20.5334 7.64401L20.9778 7.91068L23.9112 6.31068L25.6889 8.08846L24.0889 11.0218L24.3556 11.4662C24.7112 12.0885 24.9778 12.7107 25.1556 13.3329L25.2445 13.7773L28.4445 14.7551V17.244Z" fill="currentColor"/></g><defs><clipPath id="clip0_363_9540"><rect width="32" height="32" fill="currentColor"/></clipPath></defs></svg>',A5='<?xml version="1.0" encoding="utf-8"?><!-- Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 13 12" style="enable-background:new 0 0 10.2 12;" xml:space="preserve"><path d="M5.3,1.4c0.1,0,0.1,0.1,0.2,0.2c0,0.1,0.1,0.2,0.1,0.2v7.4c0,0.1,0,0.2-0.1,0.2c0,0.1-0.1,0.1-0.2,0.2c-0.1,0-0.2,0.1-0.3,0 c-0.1,0-0.2,0-0.2-0.1L2.6,7.8H0.5c-0.1,0-0.2,0-0.3-0.1C0,7.6,0,7.5,0,7.4V3.7c0-0.1,0-0.2,0.1-0.3c0.1-0.1,0.2-0.1,0.3-0.1h2.1 l2.2-1.7C4.9,1.4,4.9,1.4,5,1.4C5.1,1.4,5.2,1.4,5.3,1.4L5.3,1.4z" fill="currentColor"/><g> <rect x="7.7" y="3.4" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -1.4992 7.4586)" width="1.2" height="4.2" fill="currentColor"/> <rect x="6.1" y="4.9" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -1.5119 7.4281)" width="4.2" height="1.2" fill="currentColor"/></g></svg>',pD='<?xml version="1.0" encoding="utf-8"?><!-- Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 13 12" style="enable-background:new 0 0 10.2 12;" xml:space="preserve"><path d="M7.1,8.5C7.5,8.1,7.8,7.6,8,7.1c0.2-0.5,0.3-1,0.3-1.6C8.3,5,8.2,4.5,8,4C7.8,3.4,7.5,3,7.1,2.6L6.5,3.3 c0.3,0.3,0.5,0.7,0.7,1c0.2,0.4,0.2,0.8,0.2,1.2c0,0.4-0.1,0.8-0.2,1.2C7,7.2,6.8,7.5,6.5,7.8L7.1,8.5z M5.3,1.4 c0.1,0,0.1,0.1,0.2,0.2c0,0.1,0.1,0.2,0.1,0.2v7.4c0,0.1,0,0.2-0.1,0.2c0,0.1-0.1,0.1-0.2,0.2c-0.1,0-0.2,0.1-0.3,0 c-0.1,0-0.2,0-0.2-0.1L2.6,7.8H0.5c-0.1,0-0.2,0-0.3-0.1C0,7.6,0,7.5,0,7.4V3.7c0-0.1,0-0.2,0.1-0.3c0.1-0.1,0.2-0.1,0.3-0.1h2.1 l2.2-1.7C4.9,1.4,4.9,1.4,5,1.4C5.1,1.4,5.2,1.4,5.3,1.4L5.3,1.4z" fill="currentColor"/></svg>',lte='<?xml version="1.0" encoding="utf-8"?><!-- Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 13 12" style="enable-background:new 0 0 10.2 12;" xml:space="preserve"><path d="M8.4,9.8c0.6-0.6,1-1.2,1.3-1.9c0.3-0.7,0.5-1.5,0.5-2.3c0-0.8-0.2-1.6-0.5-2.3C9.4,2.5,9,1.9,8.4,1.3L7.8,2 c0.5,0.5,0.8,1,1.1,1.6c0.3,0.6,0.4,1.3,0.4,1.9c0,0.7-0.1,1.3-0.4,1.9C8.6,8.1,8.2,8.7,7.8,9.1L8.4,9.8z" fill="currentColor"/><path d="M7.1,8.5C7.5,8.1,7.8,7.6,8,7.1c0.2-0.5,0.3-1,0.3-1.6C8.3,5,8.2,4.5,8,4C7.8,3.4,7.5,3,7.1,2.6L6.5,3.3 c0.3,0.3,0.5,0.7,0.7,1c0.2,0.4,0.2,0.8,0.2,1.2c0,0.4-0.1,0.8-0.2,1.2C7,7.2,6.8,7.5,6.5,7.8L7.1,8.5z M5.3,1.4 c0.1,0,0.1,0.1,0.2,0.2c0,0.1,0.1,0.2,0.1,0.2v7.4c0,0.1,0,0.2-0.1,0.2c0,0.1-0.1,0.1-0.2,0.2c-0.1,0-0.2,0.1-0.3,0 c-0.1,0-0.2,0-0.2-0.1L2.6,7.8H0.5c-0.1,0-0.2,0-0.3-0.1C0,7.6,0,7.5,0,7.4V3.7c0-0.1,0-0.2,0.1-0.3c0.1-0.1,0.2-0.1,0.3-0.1h2.1 l2.2-1.7C4.9,1.4,4.9,1.4,5,1.4C5.1,1.4,5.2,1.4,5.3,1.4L5.3,1.4z" fill="currentColor"/></svg>',Zw='<svg width="13" height="12" viewBox="0 0 13 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.71196 11.08C10.4407 10.3533 11.0186 9.4898 11.4125 8.53906C11.8064 7.58832 12.0085 6.56911 12.0072 5.54C12.0085 4.51089 11.8064 3.49168 11.4125 2.54094C11.0186 1.5902 10.4407 0.726679 9.71196 0L9.05933 0.65171C9.7023 1.2929 10.2122 2.05484 10.5598 2.89374C10.9073 3.73264 11.0856 4.63196 11.0845 5.54C11.0845 7.44904 10.3102 9.17741 9.05933 10.4283L9.71196 11.08V11.08Z" fill="currentColor"/><path d="M8.40781 9.77644C8.96502 9.2207 9.40692 8.56034 9.70812 7.83329C10.0093 7.10624 10.1639 6.32683 10.1629 5.53986C10.1639 4.75289 10.0093 3.97349 9.70812 3.24644C9.40692 2.51939 8.96502 1.85902 8.40781 1.30328L7.7561 1.95499C8.22759 2.42525 8.60149 2.98403 8.85634 3.59924C9.11119 4.21445 9.24195 4.87396 9.24112 5.53986C9.2422 6.20586 9.11164 6.8655 8.85694 7.48087C8.60225 8.09625 8.22845 8.65522 7.75703 9.12565L8.40781 9.77644Z" fill="currentColor"/><path d="M7.10429 8.47307C7.49005 8.08831 7.79596 7.6311 8.00446 7.12773C8.21296 6.62436 8.31993 6.08475 8.31922 5.53991C8.31993 4.99507 8.21296 4.45546 8.00446 3.95209C7.79596 3.44872 7.49005 2.99152 7.10429 2.60675L6.45258 3.25846C6.75261 3.55774 6.99054 3.91337 7.15269 4.30489C7.31483 4.69642 7.39801 5.11614 7.39742 5.53991C7.39795 5.96368 7.31476 6.38338 7.15261 6.7749C6.99047 7.16642 6.75257 7.52205 6.45258 7.82136L7.10429 8.47307ZM5.26991 1.43791C5.348 1.47553 5.4139 1.53441 5.46004 1.60778C5.50618 1.68115 5.5307 1.76605 5.53078 1.85272V9.2271C5.53066 9.31383 5.50607 9.39876 5.45984 9.47214C5.4136 9.54551 5.34761 9.60436 5.26943 9.64191C5.19125 9.67945 5.10407 9.69418 5.01789 9.6844C4.93172 9.67462 4.85005 9.64072 4.78228 9.5866L2.60408 7.8444H0.460899C0.338661 7.8444 0.221429 7.79585 0.134994 7.70941C0.0485588 7.62298 0 7.50574 0 7.38351V3.69632C0 3.57408 0.0485588 3.45685 0.134994 3.37041C0.221429 3.28398 0.338661 3.23542 0.460899 3.23542H2.60408L4.78228 1.49322C4.8501 1.43901 4.93185 1.40506 5.01812 1.39527C5.1044 1.38549 5.19168 1.40027 5.26991 1.43791V1.43791Z" fill="currentColor"/></svg>',cte='<svg width="25" height="16" viewBox="0 0 25 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M1.5 8L24 8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M8.5 1L1.5 8L8.5 15" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',pL='<svg width="91" height="92" viewBox="0 0 91 92" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M62.8896 63.918L62.8897 28.2377L34.8552 46.0779L62.8896 63.918Z" fill="currentColor"/><path d="M45.3281 63.918L45.3281 28.2377L17.2937 46.0779L45.3281 63.918Z" fill="currentColor"/></svg>',fte='<svg width="91" height="92" viewBox="0 0 91 92" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="45.2374" cy="45.798" r="45.2374" fill="currentColor"/><path d="M62.8896 63.918L62.8897 28.2377L34.8552 46.0779L62.8896 63.918Z" fill="black"/><path d="M45.3281 63.918L45.3281 28.2377L17.2937 46.0779L45.3281 63.918Z" fill="black"/></svg>',hL='<svg width="91" height="92" viewBox="0 0 91 92" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M26.8555 28.9512V64.6314L54.8899 46.7913L26.8555 28.9512Z" fill="currentColor"/><path d="M44.417 28.9512V64.6314L72.4515 46.7913L44.417 28.9512Z" fill="currentColor"/></svg>',dte='<svg width="91" height="92" viewBox="0 0 91 92" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="45.7169" cy="45.796" r="45.2374" fill="currentColor"/><path d="M26.8555 28.9512V64.6314L54.8899 46.7913L26.8555 28.9512Z" fill="black"/><path d="M44.417 28.9512V64.6314L72.4515 46.7913L44.417 28.9512Z" fill="black"/></svg>',k5='<?xml version="1.0" encoding="utf-8"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30.8 32" style="enable-background:new 0 0 30.8 32;" xml:space="preserve"><g> <path d="M3.1,16L30.8,0v32L3.1,16z" fill="currentColor"/> <rect y="3.7" width="6.2" height="24.6" fill="currentColor"/></g></svg>',T5='<?xml version="1.0" encoding="utf-8"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30.8 32" style="enable-background:new 0 0 30.8 32;" xml:space="preserve"><g> <path d="M27.7,16L0,32V0L27.7,16z" fill="currentColor"/> <rect x="24.6" y="3.7" width="6.2" height="24.6" fill="currentColor"/></g></svg>',pte='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-list"><line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3.01" y2="6"></line><line x1="3" y1="12" x2="3.01" y2="12"></line><line x1="3" y1="18" x2="3.01" y2="18"></line></svg>',op='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"><polyline points="9 18 15 12 9 6"></polyline></svg>',hte='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-check"><polyline points="20 6 9 17 4 12"></polyline></svg>',yte='<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-badge-cc" width="48" height="48" viewBox="0 0 24 24" stroke="black" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <rect x="3" y="5" width="18" height="14" rx="2" stroke="currentColor"></rect> <path d="M10 10.5a1.5 1.5 0 0 0 -3 0v3a1.5 1.5 0 0 0 3 0" stroke="currentColor"></path> <path d="M17 10.5a1.5 1.5 0 0 0 -3 0v3a1.5 1.5 0 0 0 3 0" stroke="currentColor"></path></svg>',mte='<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-badge-cc" width="48" height="48" viewBox="0 0 24 24" stroke="black" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <rect x="3" y="5" width="18" height="14" rx="2" stroke="currentColor"></rect> <path d="M10 10.5a1.5 1.5 0 0 0 -3 0v3a1.5 1.5 0 0 0 3 0" stroke="currentColor"></path> <path d="M17 10.5a1.5 1.5 0 0 0 -3 0v3a1.5 1.5 0 0 0 3 0" stroke="currentColor"></path> <path d="M3 3l18 18" stroke="currentColor"></path></svg>',gte='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-rotate-cw"><polyline points="23 4 23 10 17 10"></polyline><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"></path></svg>',e_='<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15 27.5C15 27.5 25 22.5 25 15V6.25L15 2.5L5 6.25V15C5 22.5 15 27.5 15 27.5Z" stroke="currentColor" stroke-width="2.14286" stroke-linecap="round" stroke-linejoin="round"/><path d="M19.715 11.3574L13.8221 17.8396L11.1436 14.8931" stroke="currentColor" stroke-width="2.14286" stroke-linecap="round" stroke-linejoin="round"/></svg>',yL='<svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M23.7508 12.9997V23.7508H13.0003C7.05943 23.7508 2.24919 18.9406 2.24919 12.9997C2.24919 7.05888 7.05943 2.24864 13.0003 2.24864C18.9411 2.24864 23.7508 7.05888 23.7508 12.9997ZM0 12.9997C0 5.82396 5.82396 0 12.9997 0C20.1755 0 26 5.82396 26 12.9997V25.9995H13.0003C5.82396 25.9995 0 20.1755 0 12.9997ZM5.174 13.5197C5.174 16.1976 6.98078 18.4599 9.85371 18.4599C12.2198 18.4599 13.8185 16.9 14.2084 14.8589H11.8686C11.5698 15.7951 10.8155 16.367 9.85371 16.367C8.39758 16.367 7.44886 15.2227 7.44886 13.5202C7.44886 11.8178 8.39813 10.6735 9.85371 10.6735C10.7899 10.6735 11.5305 11.2066 11.8429 12.0903H14.1959C13.7797 10.1011 12.1941 8.58055 9.85371 8.58055C6.96822 8.58001 5.174 10.8418 5.174 13.5197ZM17.3419 8.83999H15.132V18.2131H17.4331V13.3253C17.4331 12.4022 17.6931 11.8041 18.1349 11.4273C18.5249 11.0761 19.0318 10.8942 19.8642 10.8942H20.4491V8.72256H19.8773C18.668 8.72256 17.8624 9.16442 17.3424 9.8406V8.82633V8.83999H17.3419Z" fill="currentColor"/></svg>',vte='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-copy"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>',hD='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-airplay"><path d="M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1"></path><polygon points="12 15 17 21 7 21 12 15"></polygon></svg>',bte='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-cast"><path d="M2 16.1A5 5 0 0 1 5.9 20M2 12.05A9 9 0 0 1 9.95 20M2 8V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6"></path><line x1="2" y1="20" x2="2.01" y2="20"></line></svg>',wte='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-info"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg>',_te='<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.16602 7.29169H6.45768C6.91792 7.29169 7.29102 6.91859 7.29102 6.45835V5.16669H12.9576V6.45835C12.9576 6.91859 13.3307 7.29169 13.7909 7.29169H15.0826V12.9584H13.7909C13.3307 12.9584 12.9576 13.3314 12.9576 13.7917V15.0834H7.29102V13.7917C7.29102 13.3314 6.91792 12.9584 6.45768 12.9584H5.16602V7.29169Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M3.75 4.14352C3.75 4.03915 3.79146 3.93906 3.86526 3.86526C3.93906 3.79146 4.03915 3.75 4.14352 3.75H6.89815C7.00252 3.75 7.10261 3.79146 7.17641 3.86526C7.25021 3.93906 7.29167 4.03915 7.29167 4.14352V6.89815C7.29167 7.00252 7.25021 7.10261 7.17641 7.17641C7.10261 7.25021 7.00252 7.29167 6.89815 7.29167H4.14352C4.03915 7.29167 3.93906 7.25021 3.86526 7.17641C3.79146 7.10261 3.75 7.00252 3.75 6.89815V4.14352Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M3.75 13.3518C3.75 13.2475 3.79146 13.1474 3.86526 13.0736C3.93906 12.9998 4.03915 12.9583 4.14352 12.9583H6.89815C7.00252 12.9583 7.10261 12.9998 7.17641 13.0736C7.25021 13.1474 7.29167 13.2475 7.29167 13.3518V16.1065C7.29167 16.2108 7.25021 16.3109 7.17641 16.3847C7.10261 16.4585 7.00252 16.5 6.89815 16.5H4.14352C4.03915 16.5 3.93906 16.4585 3.86526 16.3847C3.79146 16.3109 3.75 16.2108 3.75 16.1065V13.3518Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M12.959 13.3518C12.959 13.2475 13.0004 13.1474 13.0742 13.0736C13.148 12.9998 13.2481 12.9583 13.3525 12.9583H16.1071C16.2115 12.9583 16.3116 12.9998 16.3854 13.0736C16.4592 13.1474 16.5007 13.2475 16.5007 13.3518V16.1065C16.5007 16.2108 16.4592 16.3109 16.3854 16.3847C16.3116 16.4585 16.2115 16.5 16.1071 16.5H13.3525C13.2481 16.5 13.148 16.4585 13.0742 16.3847C13.0004 16.3109 12.959 16.2108 12.959 16.1065V13.3518Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M12.959 4.14352C12.959 4.03915 13.0004 3.93906 13.0742 3.86526C13.148 3.79146 13.2481 3.75 13.3525 3.75H16.1071C16.2115 3.75 16.3116 3.79146 16.3854 3.86526C16.4592 3.93906 16.5007 4.03915 16.5007 4.14352V6.89815C16.5007 7.00252 16.4592 7.10261 16.3854 7.17641C16.3116 7.25021 16.2115 7.29167 16.1071 7.29167H13.3525C13.2481 7.29167 13.148 7.25021 13.0742 7.17641C13.0004 7.10261 12.959 7.00252 12.959 6.89815V4.14352Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>';var vA={exports:{}},xte=vA.exports,mL;function Ste(){return mL||(mL=1,(function(n,e){(function(t,a){a()})(xte,(function(){function t(s){var u=!0,o=!1,c=null,p={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function d(R){return!!(R&&R!==document&&R.nodeName!=="HTML"&&R.nodeName!=="BODY"&&"classList"in R&&"contains"in R.classList)}function y(R){var $=R.type,X=R.tagName;return!!(X==="INPUT"&&p[$]&&!R.readOnly||X==="TEXTAREA"&&!R.readOnly||R.isContentEditable)}function m(R){R.classList.contains("focus-visible")||(R.classList.add("focus-visible"),R.setAttribute("data-focus-visible-added",""))}function v(R){R.hasAttribute("data-focus-visible-added")&&(R.classList.remove("focus-visible"),R.removeAttribute("data-focus-visible-added"))}function b(R){R.metaKey||R.altKey||R.ctrlKey||(d(s.activeElement)&&m(s.activeElement),u=!0)}function x(R){u=!1}function E(R){d(R.target)&&(u||y(R.target))&&m(R.target)}function C(R){d(R.target)&&(R.target.classList.contains("focus-visible")||R.target.hasAttribute("data-focus-visible-added"))&&(o=!0,window.clearTimeout(c),c=window.setTimeout(function(){o=!1},100),v(R.target))}function T(R){document.visibilityState==="hidden"&&(o&&(u=!0),k())}function k(){document.addEventListener("mousemove",O),document.addEventListener("mousedown",O),document.addEventListener("mouseup",O),document.addEventListener("pointermove",O),document.addEventListener("pointerdown",O),document.addEventListener("pointerup",O),document.addEventListener("touchmove",O),document.addEventListener("touchstart",O),document.addEventListener("touchend",O)}function M(){document.removeEventListener("mousemove",O),document.removeEventListener("mousedown",O),document.removeEventListener("mouseup",O),document.removeEventListener("pointermove",O),document.removeEventListener("pointerdown",O),document.removeEventListener("pointerup",O),document.removeEventListener("touchmove",O),document.removeEventListener("touchstart",O),document.removeEventListener("touchend",O)}function O(R){R.target.nodeName&&R.target.nodeName.toLowerCase()==="html"||(u=!1,M())}document.addEventListener("keydown",b,!0),document.addEventListener("mousedown",x,!0),document.addEventListener("pointerdown",x,!0),document.addEventListener("touchstart",x,!0),document.addEventListener("visibilitychange",T,!0),k(),s.addEventListener("focus",E,!0),s.addEventListener("blur",C,!0),s.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&s.host?s.host.setAttribute("data-js-focus-visible",""):s.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if(typeof window<"u"&&typeof document<"u"){window.applyFocusVisiblePolyfill=t;var a;try{a=new CustomEvent("focus-visible-polyfill-ready")}catch{a=document.createEvent("CustomEvent"),a.initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(a)}typeof document<"u"&&t(document)}))})()),vA.exports}Ste();const yD="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAW0AAABSCAYAAACfWoXuAAAACXBIWXMAAC4jAAAuIwF4pT92AAAMX0lEQVR4nO2d/XEbtxbF4Tf+N5ptIEO6gYipQHQDz3QDT0wDkfIKiKUGYvk1IKqBJzoNmKwgZBoINWmApgtQBtJdaSUtDrDLXewCOL8ZjsciRe0H9uDifuC+ur29VYQQQsLgNe8TISRBhkqpUeGVKaWOHC7DV6XUSim1lX8Xhf97Ibe0x5Hds/yC2jCd90ZeoZEPvjIWAZ6PqnFOQ3mVEep9LQM9s77vdSb3qQyvgmZhItdN/zto+LvXct1njtpTm1y0Y/ORLB0nItN5nyulzho+Jh8sgLXwKsDzUTXOST+Q14bPr4G4hISelP4yHO9nuQY+0c/aF8Pfe9uxwaCv1VReTQu1iRul1IUIeOMT1r+a/kJCOmYuD00Zh8AKD4kpONY5B+AdQxFNPbl98CjYSv7WRxmHZ2ClWAuKNokRJFynEZyvSbR3IlQpk4mVq8X6uOPrcCATxk2TK3eKNomRC3BOvl0HTTMCVqPJLZQKExHIk4bOdymvfcnFe9WEe47ZIyRGNuK/Piw5t4H4YEMNzKKVQqpWdibn/q7G7y4LGSAbhyDiuBB4HTtmnOTo8fjHvjEzm2h/bTsS2hIhHjNpFm1tXxq+cRqwaL83/Pwm4HPah5EIdtkEbeJKXGh1/P/5Nc5/NxMLf1Jh0vhQyGKpHKi0ifYqwnRAkgZzINrvLcG8vjKRpXYZKVrZI7GUTdekyE6CgxcNZ3Rs5drPJPh55uhLP5IJYFrVyKRPm8TKViyqMg4CFW10zKmJ9lRcDS6CfS5usbOWc8Y3clxvJPXSxqFMOpX83BRtEjNo+RtaQDIDy+9lREVDLkzBKqqIjmv86EGsn7OR8aVz1P+2fPagqnBTtEnMzGVZXMa7pvNnWwZNMilZ2Vrc/ufwuXP5bJfxLe3++MHB6tbC/bvreKRok9hBFllILhJT1sguoYIa7TPWVul34DM7iVn0paJ5KxPuueVz37sGkinaJHaQFRqKaA9BdsR1j/b2aBs9OSEf9k4CfH2cxPQk8pPlM4eWGoM7KNokdlbi2ywjlLJ25mbfix5K68sFu8/pvjMH4T6xxVso2iQFQre2TQ9xKrnZI8ltNvEtAMHOcRHuK+TfpmiTFAhZtMegbD0VK9t2nj8HVlA3A+moSlxARp88RZukwBZE8Ac936419dzsU4tb5FOg12EK3HZK3CSl45KiTVIBPdh93vnPVLaeQm52Zsm6WAe6733ORFw7JkqDkhRtkgooZ9skjF0zTbxs/dSSLXIaeOaMnnR/Be8flW0jQtEmKWHK2T7oaYWk6ZhSyc3+Bbx3FUkQ9gI07VBlKwmKNkmJkAKSqGw9hdxstMr4Frhb5Dlo7B09T0ulaJOUWAGrpm9l7QxAmvktMn/+wtJs4cm1oGiT1Ailq41JtFPIzUYVoCrSSQuNyyd53RRtkhoh9I9EopWClY0mz6tIs2ZQQ+onMReKNkmNDcjZ7ktZe+pl66l2m0f3lqJNkgY9+H0ISJoszRRys9EqQ1uiqYr2Q+ofRZukyAzkbHct2qmXraP2hrH78jegSnKQrwIp2iRVrg3n3XVZu2nSSCU3G4l2CuePJqa7FRhFm6QKitZ3ZW1noDozlX2z0YSZwo6GaGK6uzYUbZIqKGfbtnVmW7DbutmfvU5k0kITE0WbJI/J2u6qrD31fbNT9mcXQU07KNokafrUrX0IytZTsbKRaySk/bL3BZ3rmKJNUmYDyoePPZe1s9s6vt6xpzoWQeeaUbRJ6jgVNHjAFPxMITc7h5b2PdCv/dryy5nFz9Q3UvJ7kWaYS/eTsgDg1JOVO0q8bD0HWdqpdJy3YhNtPZC+9OA4XXkVxmGSHrGVdLrjkkPKt8Vs29JNPTc7xyTaqC1XjCDjc0j3CCHdu0hMfyOV3Owc02qDVvYjFG1CxLIx5Wy3vfPfhN3WSRUo2oTcYxLItsvaU8/NJhWhaBNyTxetyFDZOq1sUgpFm5B7UM52W2XtLFsnlbGJ9lIyMkJ5EbIPJqFsq6w95X2zSU1oaRPyyFw6fZfRtGizbJ3UgqJNyCM6tez/huvxvuGydjQJpJSbXcTknupTl3wfoPNdUbQJeYpJMJt2kZhSCa+Yl/wC1Jk9RlC20paiTchTUFfspkR7BHKzU7WylW2jJI/H0TXwXCnahLzEJJzvGurWbkohjL1xrQ0k2l22gPMN7N5D0SbkJagVWRPWtimFMGXBVhTtB+geIaQiqCv2voU2KDcbTRYpQNG+B25RS9GOCwawmsMkoId7CojJUl8zN9veHzEBMhDvuMuuoWjHRUobxX9t+fuRq6KutZ0ZtoBVtLIfQP0Rm4gn9B3Uv+Du+aZop0NsA77tCWor6Xdl1PVrMzfbDrK2Q2rIUhc0RijaiRGqaB91+LdNQjqoKdwmC5252Y8g0e6iQ75vrB3pKdokVHz4f7Vo/214r6qADMEERCv7ESTaOuUy5nxtlL//EPOgaMdFbEtLdMy+gnZNlbWjfbMp2o/oFcdn8H7M1jZquPHwbFO00yFE9wg6Zl9B16Z2/jM9kBTslyDjo629zbsG7a2uiuOQoh0XsVnaSLR9WdorkNHgKtpo2cuskZegXQ6PIg1ITkH+/k3RSKFox4dp34xBgNa2Nf3JEyYRcfWxmqxD5maXY3ORxGhtI9fIk4mdoh0fSMxCs1BMgTuT5dsW+7YiM5Wt08o2g67NcWTW9ilYiann44+iHR+xpEyhY/Xd8BZZfjbRRmXr9GebQR3yNWddH2BD6JXaOfiqF+mgFO34QEIQUspUn0RbAWvbVqnH3Oz6IGE+srgUQuECTOqq7BpQtONjY7FQQvAH2iLpXYi2ngx3hvdM4pGBlmK0su3MLGP5PPBK3wnY1kDJxP4i5kHRjhPkgw3BOkEuhc8dWqiXhp+bVgXMzd4fZGQcBHwdM7BNghIDofRZpWjHCRLtQQDWNloWd/mQmq7rwBAYY272/iwsmSSHgTZCXljcIh9NxglFO042oEmq6nkQ5wxE0ncdP6AoZ/v5RDgEvQ2ZNVKNU+CaUuJiCCkNcGbpe7lGzyhFO16QMA96Ktxa6P4L3v/o8VhMmCaN5z545mY3x8bi+1XiugpBuGeWc/lmOw+KdrwsLNb2hx7mumq3wXeG93Y9sVBRt/biw2Z68Ghl12Nu8QGrAITbJtian22FYxTtuLFZ05971BHEtmQ86UmK3Ab4WPPAY1+6rWcyBvQEfitiMAs440K7SWyFVZc99HFncg9sgn3lcuwU7bixWdsH8n7Xwm2zQJY9exBRt/YMBCB95mbre/qnrKjyytJDuc5/BVoKrq/dGGyXm3MsE1QfJqex3AfbvvBL13tC0Y6fqSWIkwt3F9WSmTxcSLB3PRSYGbimU5Bj7svKzuRvfQ8+cxloKbgW7n9bxrSSCWrdYYprJq6wL5b7oOQ4nZ8/inb8uARxtHBfyyDzVTE5lXxl5BJR4hbpY+Du2vDzj4ZULp+52VPLXhY5ofrXV2K52oT7QO7HyvMENRXr+sThs2s5NucVGEU7DbRY/OJwpiciLtMWxXsibptLS56qkoq3vubgVhU8n75sV6st5Ga5K5mYXDYPOxSLd9Hiqi2T797I2LZZ10rcZZUEW/Pq9lbHJ+6CFLHx1qHcOYbzdjnPHJfodc6uENTZdxvUkQzoiaMFqPkUQPXmpsL5vPG4YlhU6K1ZZfyYGIsotvX9iNwN4TquVWFsz/c8tkzOfSIuMZsRUuS8btrt6zq/RIJlWrBybRyI5X0ig/wP+d2Ng/iMC//+WHEwK9nKNIQqtwvH3PE+52aHvmnVVsb1SoTQZawVx7aSmM5Kvssm4mNZnYwcXHtl7CRgXXuyoKUdPnUsmbGkrVUV07bRWQH/6WhDqDoMJRPDhu9J6MLRn3rTkHukS0u7yFCuc5cd/BGfxLrea6KkTztNFrKstxUr+EQP6B8CEmxlydku4nuvkQuHIJ2KsNBnIxPIe8vugL5ZyuR12sTKhqKdLvmy8q0ll7ttluLvbWRAd4BNkLvYN3vjYGlfRVydORer+6cOuhwVycV63KQxQtEmi4Lv+crRQtuXnfytN/K3Q96LA+Vsqw539JvJPX2+ErgRMYu1q3mRmfie33oe25/k2jcq1jm5T5uQnEyi4WN5uWZH2FjLAF5wa9JOGHluhtxXimO7TiCxjHVhXLfu3qNoExtDeY1F0F1K3vMMk60IxYqttUhP0eNaj+l8bNvqE/Kxnb/8xmCUUv8APsi0l8VaI5gAAAAASUVORK5CYII=",Cte="_spinner_1xb2e_1",Ete="_svg_1xb2e_16",Ate="_thumbnail_1xb2e_92",kte="_thumbnail__time_1xb2e_112",Tte="_thumbnail__text_1xb2e_124",Mte="_menu_1xb2e_347",Ut={spinner:Cte,"spinner--light":"_spinner--light_1xb2e_12",svg:Ete,"user-action-indicator-container":"_user-action-indicator-container_1xb2e_23","user-action-indicator-text":"_user-action-indicator-text_1xb2e_40","user-action-indicator":"_user-action-indicator_1xb2e_23","user-action-indicator-icon":"_user-action-indicator-icon_1xb2e_60","seek-container":"_seek-container_1xb2e_69",thumbnail:Ate,"thumbnail--visible":"_thumbnail--visible_1xb2e_106","thumbnail--with-text":"_thumbnail--with-text_1xb2e_109",thumbnail__time:kte,thumbnail__text:Tte,"seek-chapter-indicator":"_seek-chapter-indicator_1xb2e_150","seek-playhead":"_seek-playhead_1xb2e_155","seek-buffer":"_seek-buffer_1xb2e_156","seek-input":"_seek-input_1xb2e_157","volume-controls":"_volume-controls_1xb2e_272","volume-slider":"_volume-slider_1xb2e_279","volume-input":"_volume-input_1xb2e_295","volume-progress":"_volume-progress_1xb2e_296",menu:Mte,"menu-option":"_menu-option_1xb2e_367","menu-option-back":"_menu-option-back_1xb2e_384","menu-option-back-icon":"_menu-option-back-icon_1xb2e_388","menu-option-active":"_menu-option-active_1xb2e_403","menu-option-icon":"_menu-option-icon_1xb2e_407","menu-header":"_menu-header_1xb2e_417","verification-menu":"_verification-menu_1xb2e_424","verification-menu__group":"_verification-menu__group_1xb2e_428","verification-menu__group-icon":"_verification-menu__group-icon_1xb2e_433","verification-menu__group-icon--cc":"_verification-menu__group-icon--cc_1xb2e_437","verification-menu__group-text":"_verification-menu__group-text_1xb2e_445","verification-menu__group-title":"_verification-menu__group-title_1xb2e_450","verification-menu__group-subtitle":"_verification-menu__group-subtitle_1xb2e_450","verification-menu__loader":"_verification-menu__loader_1xb2e_465","verification-menu__details":"_verification-menu__details_1xb2e_472","verification-menu__detail":"_verification-menu__detail_1xb2e_472","verification-menu__detail-label":"_verification-menu__detail-label_1xb2e_492","verification-menu__detail-value":"_verification-menu__detail-value_1xb2e_496","verification-menu__detail-copy":"_verification-menu__detail-copy_1xb2e_503","verification-menu__inline-icon":"_verification-menu__inline-icon_1xb2e_513","verification-menu--details":"_verification-menu--details_1xb2e_521","dvr-toggle":"_dvr-toggle_1xb2e_539","dvr-toggle__border":"_dvr-toggle__border_1xb2e_545","dvr-toggle__live":"_dvr-toggle__live_1xb2e_554","dvr-toggle__dvr":"_dvr-toggle__dvr_1xb2e_554","dvr-toggle__live--active":"_dvr-toggle__live--active_1xb2e_569","dvr-toggle__dvr--active":"_dvr-toggle__dvr--active_1xb2e_569","copy-button":"_copy-button_1xb2e_721","copy-button--copied":"_copy-button--copied_1xb2e_724"},Lg=({light:n,className:e=""})=>Ue.jsx("div",{className:`${e} ${Ut.spinner} ${n?Ut["spinner--light"]:""}`,children:Ue.jsx("div",{className:Ut["spinner-inner"]})}),pl=({icon:n,className:e=""})=>Ue.jsx("div",{className:`${Ut.svg} ${e}`,dangerouslySetInnerHTML:{__html:n}}),M5=async n=>{try{n=(n||"").toString(),await navigator.clipboard.writeText(n)}catch{const t=document.createElement("input");t.value=n,t.select(),t.setSelectionRange(0,99999),document.execCommand("copy")}},gL={[Un.PLAY]:cD,[Un.PAUSE]:ite,[Un.MUTE]:A5,[Un.UNMUTE]:Zw,[Un.VOLUME_DOWN]:pD,[Un.VOLUME_UP]:Zw,[Un.SEEK_BACK]:pL,[Un.SEEK_FORWARD]:hL,[Un.PLAYBACK_RATE_DOWN]:pL,[Un.PLAYBACK_RATE_UP]:hL,[Un.SUBTITLES_ON]:yte,[Un.SUBTITLES_OFF]:mte,[Un.PLAY_PREVIOUS]:k5,[Un.PLAY_NEXT]:T5},Rte=({action:n})=>{if(!(!n||!gL[n.action]))return Ue.jsxs("div",{className:Ut["user-action-indicator-container"],children:[Ue.jsx("div",{className:Ut["user-action-indicator"],children:Ue.jsx(pl,{icon:gL[n.action],"aria-label":`Action indicator ${n}`,className:Ut["user-action-indicator-icon"]})}),n.text?Ue.jsx("div",{className:Ut["user-action-indicator-text"],children:n.text}):null]})},Ote=({player:n,time:e,progress:t,duration:a,visible:s})=>{const[u,o]=Lt.useState(null);if(!(n.thumbnailsLoaded||n.__chapterTags)||!s)return null;e=typeof e<"u"?e:t*a,t=typeof t<"u"?t:e/a;let c=100;if(u){const{width:y}=u.parentElement.getBoundingClientRect(),m=y<650?150:y<1e3?225:350;c=(y-m)/y}const p=((n.__chapterTags||[]).find(y=>y.start_time<e&&y.end_time>e)||{}).tag||"",d=n.thumbnailHandler&&n.thumbnailHandler.ThumbnailImage(e);return Ue.jsxs("div",{ref:o,style:{opacity:s?1:0,left:`${Math.min(t,c)*100}%`},className:`${Ut.thumbnail} ${s?Ut["thumbnail--visible"]:""} ${p?Ut["thumbnail--with-text"]:""}`,children:[d?Ue.jsxs(Ue.Fragment,{children:[Ue.jsx("img",{src:d,alt:"Thumbnail",className:Ut.thumbnail__image}),Ue.jsx("div",{className:Ut.thumbnail__time,children:Og(e,a)})]}):null,p?Ue.jsx("div",{className:Ut.thumbnail__text,children:p}):null]})};let XE;const mD=({player:n,videoState:e,setRecentUserAction:t,className:a=""})=>{const[s,u]=Lt.useState(n.controls.GetCurrentTime()),[o,c]=Lt.useState(0),[p,d]=Lt.useState(void 0),[y,m]=Lt.useState(n.controls.IsDVREnabled()),[v,b]=Lt.useState(0),[x,E]=Lt.useState(!1),[C,T]=Lt.useState(!1);return Lt.useEffect(()=>{d(tD(n,t));const k=E5({player:n,setCurrentTime:u,rate:60}),M=$ee({video:n.video,setBufferFraction:c}),O=n.controls.RegisterSettingsListener(()=>{n.controls&&m(n.controls.IsDVREnabled())});return()=>{k&&k(),M&&M(),O&&O()}},[n&&n.controls]),n.isLive&&!y?null:Ue.jsxs("div",{onMouseEnter:()=>{clearTimeout(XE),E(!0)},onMouseLeave:()=>{clearTimeout(XE),XE=setTimeout(()=>{T(!1),E(!1)},100)},onFocus:()=>T(!0),onBlur:()=>T(!1),onMouseMove:k=>{const{left:M,width:O}=k.currentTarget.getBoundingClientRect();b((k.clientX-M)/O)},className:`${a} ${Ut["seek-container"]} ${a}`,children:[Ue.jsx("progress",{max:1,value:n.casting?0:o,className:Ut["seek-buffer"]}),Ue.jsx("progress",{max:1,value:s/e.duration||0,className:Ut["seek-playhead"]}),Ue.jsx("input",{"aria-label":"Seek slider",type:"range",min:0,max:1,step:1e-5,value:s/e.duration||0,onInput:k=>{n.controls.Seek({fraction:k.currentTarget.value})},onTouchStart:()=>E(!0),onTouchMove:k=>{const{left:M,width:O}=k.currentTarget.getBoundingClientRect(),R=k.touches[0].pageX/(O-M);b(R),n.controls.Seek({fraction:R})},onTouchEnd:()=>E(!1),onKeyDown:p,className:Ut["seek-input"]}),(n.__chapterTags||[]).map((k,M)=>Ue.jsx("div",{style:{width:`${100*(k.end_time-k.start_time)/e.duration}%`,left:`${100*k.start_time/e.duration}%`},className:Ut["seek-chapter-indicator"]},`chapter-${M}`)),Ue.jsx(Ote,{player:n,progress:C?s/e.duration:v,duration:e.duration,visible:x||C})]})},Lte=({player:n,videoState:e})=>Ue.jsxs("div",{className:Ut["volume-controls"],children:[Ue.jsx(gu,{"aria-label":e.muted?"Unmute":"Mute",icon:e.muted||e.volume===0?A5:e.volume<.4?pD:e.volume<.8?lte:Zw,onClick:()=>n.controls.ToggleMuted(),className:Ut["volume-button"]},"mute-button"),Ue.jsxs("div",{className:Ut["volume-slider"],children:[Ue.jsx("progress",{max:1,value:e.muted?0:e.volume,className:Ut["volume-progress"]}),Ue.jsx("input",{"aria-label":"Volume slider",type:"range",min:0,max:1,step:.001,value:e.muted?0:e.volume,onInput:t=>n.controls.SetVolume({fraction:t.currentTarget.value}),onKeyDown:yee(n),className:Ut["volume-input"]})]})]}),gD=({player:n,Hide:e,className:t=""})=>{const[a,s]=Lt.useState(void 0),[u,o]=Lt.useState(void 0),c=Lt.createRef();if(Lt.useEffect(()=>{const m=()=>o(n.controls.GetOptions());m();const v=n.controls.RegisterSettingsListener(m);return()=>v&&v()},[]),Lt.useEffect(()=>{if(!c||!c.current)return;const m=B_({element:c.current.parentElement,Hide:e});return()=>{m&&m()}},[c]),!u)return null;const p=m=>setTimeout(()=>s(m)),d={quality:{label:"Quality",Update:m=>n.controls.SetQualityLevel(m)},audio:{label:"Audio",Update:m=>n.controls.SetAudioTrack(m)},text:{label:"Subtitles",Update:m=>n.controls.SetTextTrack(m)},profile:{label:"Player Profile",Update:m=>{m==="custom"?(n.controls.ShowPlayerProfileForm(),e()):n.controls.SetPlayerProfile({profile:m})}},rate:{label:"Playback Rate",Update:m=>n.controls.SetPlaybackRate({index:m})},advanced:{label:"Advanced",Update:m=>{m==="copy_debug_info"&&(M5(JSON.stringify(n.controls.GetDebugInfo(),null,2)),e())}}};let y;return a?y=Ue.jsxs("div",{role:"menu",className:`${Ut.menu} ${Ut.submenu} ${t}`,children:[Ue.jsxs("button",{onClick:()=>p(void 0),"aria-label":"Back to settings menu",className:`${Ut["menu-option"]} ${Ut["menu-option-back"]}`,children:[Ue.jsx("div",{dangerouslySetInnerHTML:{__html:cte},className:Ut["menu-option-back-icon"]}),Ue.jsx("div",{children:d[a].label})]}),a==="advanced"?Ue.jsx("button",{role:"button",autoFocus:!0,"aria-label":"Copy Debug Info",onClick:()=>{d[a].Update("copy_debug_info"),p(void 0)},className:Ut["menu-option"],children:"Copy Debug Info"}):u[a].options.map(m=>Ue.jsxs("button",{role:"menuitemradio","aria-checked":m.active,autoFocus:m.active,"aria-label":`${d[a].label}: ${m.label||""}`,onClick:()=>{d[a].Update(m.index),p(void 0)},className:`${Ut["menu-option"]} ${m.active?Ut["menu-option-active"]:""}`,children:[m.label||"",m.active?Ue.jsx(pl,{icon:hte,className:Ut["menu-option-icon"]}):null]},`option-${m.index}`))]},"submenu"):y=Ue.jsxs("div",{role:"menu",className:`${Ut.menu} ${t}`,children:[u.hasQualityOptions?Ue.jsxs("button",{autoFocus:!0,role:"menuitem",onClick:()=>p("quality"),className:Ut["menu-option"],children:[`${d.quality.label}: ${u.quality.active&&u.quality.active.activeLabel||""}`,Ue.jsx(pl,{icon:op,className:Ut["menu-option-icon"]})]}):null,u.hasAudioOptions?Ue.jsxs("button",{autoFocus:!u.hasQualityOptions,role:"menuitem",onClick:()=>p("audio"),className:Ut["menu-option"],children:[`${d.audio.label}: ${u.audio.active&&u.audio.active.label||""}`,Ue.jsx(pl,{icon:op,className:Ut["menu-option-icon"]})]}):null,u.hasTextOptions?Ue.jsxs("button",{autoFocus:!u.hasQualityOptions&&!u.hasAudioOptions,role:"menuitem",onClick:()=>p("text"),className:Ut["menu-option"],children:[`${d.text.label}: ${u.text.active&&u.text.active.label||""}`,Ue.jsx(pl,{icon:op,className:Ut["menu-option-icon"]})]}):null,u.hasProfileOptons?Ue.jsxs("button",{autoFocus:!u.hasQualityOptions&&!u.hasAudioOptions&&!u.hasTextOptions,role:"menuitem",onClick:()=>p("profile"),className:Ut["menu-option"],children:[`${d.profile.label}: ${u.profile.active&&u.profile.active.label||""}`,Ue.jsx(pl,{icon:op,className:Ut["menu-option-icon"]})]}):null,u.hasRateOptions?Ue.jsxs("button",{autoFocus:!u.hasQualityOptions&&!u.hasAudioOptions&&!u.hasTextOptions&&!u.hasProfileOptons,role:"menuitem",onClick:()=>p("rate"),className:Ut["menu-option"],children:[`${d.rate.label}: ${u.rate.active&&u.rate.active.label||""}`,Ue.jsx(pl,{icon:op,className:Ut["menu-option-icon"]})]}):null,Ue.jsxs("button",{autoFocus:!u.hasRateOptions&&!u.hasQualityOptions&&!u.hasAudioOptions&&!u.hasTextOptions&&!u.hasProfileOptons,role:"button",onClick:()=>p("advanced"),className:Ut["menu-option"],children:[d.advanced.label,Ue.jsx(pl,{icon:op,className:Ut["menu-option-icon"]})]})]},"menu"),Ue.jsx("div",{ref:c,children:y})},vD=({player:n})=>{const[e,t]=Lt.useState(n.dvrEnabled);return Lt.useEffect(()=>{const a=n.controls.RegisterSettingsListener(()=>{n.controls&&t(n.controls.IsDVREnabled())});return()=>a&&a()},[n&&n.controls]),Ue.jsxs("div",{className:Ut["dvr-toggle"],children:[Ue.jsx("button",{onClick:()=>n.controls.SetDVREnabled(!1),className:`${Ut["dvr-toggle__live"]} ${e?"":Ut["dvr-toggle__live--active"]}`,children:"LIVE"}),Ue.jsx("button",{onClick:()=>n.controls.SetDVREnabled(!0),className:`${Ut["dvr-toggle__dvr"]} ${e?Ut["dvr-toggle__dvr--active"]:""}`,children:"DVR"}),Ue.jsx("div",{className:Ut["dvr-toggle__border"]})]})},Nte=({label:n,value:e,className:t=""})=>{const[a,s]=Lt.useState(!1);return Ue.jsx("button",{onClick:()=>{a||(M5(e),s(!0),setTimeout(()=>s(!1),100))},dangerouslySetInnerHTML:{__html:vte},className:[Ut["copy-button"],a?Ut["copy-button--copied"]:"",t].join(" "),title:`Copy ${n}`})},Ro=({label:n,value:e,copyable:t})=>e?Ue.jsxs("div",{className:Ut["verification-menu__detail"],children:[Ue.jsxs("label",{className:Ut["verification-menu__detail-label"],children:[n,":"]}),Ue.jsx("div",{className:Ut["verification-menu__detail-value"],children:e}),t?Ue.jsx(Nte,{label:n,value:e,className:Ut["verification-menu__detail-copy"]}):null]}):null,bD=({player:n,Hide:e,className:t=""})=>{const a=Lt.createRef(),[s,u]=Lt.useState(),[o,c]=Lt.useState(!1),[,p]=Lt.useState(!1);if(Lt.useEffect(()=>{n.__LoadVerificationDetails().then(()=>p(!0));const y=()=>u(n.controls.GetContentVerificationDetails());y();const m=n.controls.RegisterSettingsListener(y);return()=>m&&m()},[]),Lt.useEffect(()=>{if(!a||!a.current)return;const y=B_({element:a.current.parentElement,Hide:e});return()=>{y&&y()}},[a]),!s)return null;let d;return o?d=Ue.jsxs(Ue.Fragment,{children:[Ue.jsxs("div",{className:Ut["verification-menu__group"],children:[Ue.jsx("div",{dangerouslySetInnerHTML:{__html:e_},className:Ut["verification-menu__group-icon"]}),Ue.jsxs("div",{className:Ut["verification-menu__group-text"],children:[Ue.jsx("div",{className:Ut["verification-menu__group-title"],children:"This content has been verified as authentic"}),Ue.jsxs("div",{className:Ut["verification-menu__group-subtitle"],children:["Last Verified: ",new Date(s.verifiedAt).toLocaleTimeString(navigator.language||"en-us",{year:"numeric",month:"long",day:"numeric"})]})]})]}),Ue.jsxs("div",{className:Ut["verification-menu__group"],children:[Ue.jsx("div",{dangerouslySetInnerHTML:{__html:yL},className:[Ut["verification-menu__group-icon"],Ut["verification-menu__group-icon--cc"]].join(" ")}),Ue.jsxs("div",{className:Ut["verification-menu__group-text"],children:[Ue.jsx("button",{onClick:()=>c(!0),className:Ut["verification-menu__group-title"],children:"Content Credentials"}),Ue.jsxs("div",{className:Ut["verification-menu__group-subtitle"],children:["Issued by the",Ue.jsx("a",{href:"https://main.net955305.contentfabric.io/config",target:"_blank",rel:"noreferrer",children:"Content Fabric"})]})]})]}),Ue.jsxs("div",{className:Ut["verification-menu__details"],children:[Ue.jsx(Ro,{label:"Content Fabric Object ID",value:s.details.objectId,copyable:!0}),Ue.jsx(Ro,{label:"Organization Address",value:s.details.tenantAddress,copyable:!0}),Ue.jsx(Ro,{label:"Organization Name",value:s.details.tenantName&&s.details.tenantName.toString()}),Ue.jsx(Ro,{label:"Owner Address",value:s.details.ownerAddress,copyable:!0}),Ue.jsx(Ro,{label:"Content Object Contract Address",value:s.details.explorerUrl?Ue.jsx("a",{href:s.details.explorerUrl,target:"_blank",rel:"noreferrer",children:s.details.address}):s.details.address,copyable:!0}),Ue.jsx(Ro,{label:"Versions",value:s.details.versionCount}),Ue.jsx(Ro,{label:"Content Version Hash",value:s.details.versionHash,copyable:!0}),s.details.lastCommittedAt?Ue.jsx(Ro,{label:"Latest Commit",value:new Date(s.details.lastCommittedAt).toLocaleTimeString(navigator.language||"en-us",{year:"numeric",month:"long",day:"numeric"})}):null,Ue.jsx(Ro,{label:"Latest Version Hash",value:s.details.latestVersionHash,copyable:!0}),Ue.jsx(Ro,{label:"Latest Transaction",value:s.details._state!=="full"?Ue.jsx(Lg,{className:Ut["verification-menu__loader"]}):s.details.latestTransactionHashUrl?Ue.jsx("a",{href:s.details.latestTransactionHashUrl,target:"_blank",rel:"noreferrer",children:s.details.latestTransactionHash&&s.details.latestTransactionHash.toString()}):void 0}),Ue.jsx(Ro,{label:"Signature Algorithm",value:s.details.signatureMethod}),n.publicMetadataUrl?Ue.jsx(Ro,{label:"Public Metadata",value:Ue.jsx("a",{href:n.publicMetadataUrl,target:"_blank",rel:"noreferrer",children:n.publicMetadataUrl})}):null]},`details-${s.details._state}`)]}):d=Ue.jsxs(Ue.Fragment,{children:[Ue.jsxs("div",{className:Ut["verification-menu__group"],children:[Ue.jsx("div",{dangerouslySetInnerHTML:{__html:e_},className:Ut["verification-menu__group-icon"]}),Ue.jsxs("div",{className:Ut["verification-menu__group-text"],children:[Ue.jsx("div",{className:Ut["verification-menu__group-title"],children:"This content has been verified as authentic"}),Ue.jsxs("div",{className:Ut["verification-menu__group-subtitle"],children:["Last Verified: ",new Date(s.verifiedAt).toLocaleTimeString(navigator.language||"en-us",{year:"numeric",month:"long",day:"numeric"})]})]})]}),Ue.jsxs("div",{className:Ut["verification-menu__group"],children:[Ue.jsx("div",{dangerouslySetInnerHTML:{__html:yL},className:[Ut["verification-menu__group-icon"],Ut["verification-menu__group-icon--cc"]].join(" ")}),Ue.jsx("div",{className:Ut["verification-menu__group-text"],children:Ue.jsxs("button",{onClick:()=>c(!0),className:Ut["verification-menu__group-title"],children:["View Content Credentials",Ue.jsx("div",{className:Ut["verification-menu__inline-icon"],dangerouslySetInnerHTML:{__html:op}})]})})]})]}),Ue.jsx("div",{ref:a,children:Ue.jsx("div",{role:"menu",className:`${Ut.menu} ${Ut["verification-menu"]} ${o?Ut["verification-menu--details"]:""} ${t}`,children:d},"menu")})},Pte=({player:n,Hide:e,className:t=""})=>{const a=Lt.createRef(),[s,u]=Lt.useState(void 0);if(Lt.useEffect(()=>{const c=()=>u(n.controls.GetCollectionInfo());c();const p=n.controls.RegisterSettingsListener(c);return()=>p&&p()},[]),Lt.useEffect(()=>{if(!a||!a.current)return;const c=B_({element:a.current.parentElement,Hide:e});return()=>c&&c()},[a]),!s)return null;const o=c=>{n.controls.CollectionPlay({mediaIndex:c}),e()};return Ue.jsxs("div",{role:"menu",className:`${Ut.menu} ${Ut["collection-menu"]} ${t}`,ref:a,children:[Ue.jsx("div",{className:`${Ut["menu-option"]} ${Ut["menu-header"]}`,children:s.title}),s.content.map((c=>Ue.jsx("button",{"aria-label":`${c.title||c.mediaId} ${c.active?"(active)":""}`,role:"menuitemradio","aria-checked":c.active,autoFocus:c.active,onClick:()=>o(c.mediaIndex),className:`${Ut["menu-option"]} ${c.active?Ut["menu-option-active"]:""}`,children:c.title||c.mediaId},`collection-item-${c.mediaId}`)))]},"menu")},gu=({icon:n,className:e="",...t})=>Ue.jsx("button",{...t,className:`${Fn["icon-button"]} ${e}`,dangerouslySetInnerHTML:{__html:n}}),Ite=({player:n,videoState:e})=>{const[t,a]=Lt.useState(n.video.currentTime);return Lt.useEffect(()=>{const s=E5({player:n,setCurrentTime:a,rate:10});return()=>s&&s()},[]),n.isLive&&!n.controls.IsDVRAvailable()?Ue.jsx("div",{className:Fn["live-indicator"],children:"Live"}):Ue.jsxs("div",{className:Fn.time,children:[!n.isLive||!n.controls.IsDVRAvailable()?null:Ue.jsx(vD,{player:n}),n.isLive&&!n.behindLiveEdge?null:`${Og(t,e.duration)} / `,n.isLive&&!n.dvrEnabled?null:Og(e.duration,e.duration)]})},Dte=({player:n})=>{const e=n.controls.GetCollectionInfo();if(!e||e.mediaLength===0||!e.isPlaylist)return null;const t=e.content[e.mediaIndex-1],a=e.content[e.mediaIndex+1],s=n.controls.IsReady();return Ue.jsxs(Ue.Fragment,{children:[t?Ue.jsxs("div",{className:`${Fn["collection-button-container"]} ${s?"":Fn["collection-button-container--loading"]}`,children:[Ue.jsx(gu,{"aria-label":`Play Previous: ${t.title}`,disabled:!s,icon:k5,onClick:()=>n.controls.CollectionPlayPrevious()}),Ue.jsx("div",{className:Fn["collection-button-text"],children:t.title})]},`media-previous-${e.mediaIndex}`):null,a?Ue.jsxs("div",{className:`${Fn["collection-button-container"]} ${s?"":Fn["collection-button-container--loading"]}`,children:[Ue.jsx(gu,{"aria-label":`Play Next: ${a.title}`,disabled:!s,icon:T5,onClick:()=>n.controls.CollectionPlayNext()}),Ue.jsx("div",{className:Fn["collection-button-text"],children:a.title})]},`media-next-${e.mediaIndex}`):null]})},wD=({label:n,icon:e,player:t,MenuComponent:a,className:s=""})=>{const[u,o]=Lt.useState(!1);return Ue.jsxs("div",{className:[Fn["menu-control-container"],s].join(" "),children:[Ue.jsx(gu,{"aria-label":u?`Hide ${n} Menu`:n,"aria-haspopup":!0,icon:e,onClick:()=>{t.controls.__ToggleMenu(!u),o(!u)},className:u?Fn["icon-button-active"]:""}),u?Ue.jsx(a,{player:t,Hide:()=>{o(!1),t.controls.__ToggleMenu(!1)}}):null]})},Ute=({player:n})=>{const[e,t]=Lt.useState(void 0),{title:a,subtitle:s,description:u,image:o,headers:c}=n.controls.GetContentInfo()||{};return Lt.useEffect(()=>{t(void 0),o&&S5({player:n,pathOrUrl:o,width:200}).then(p=>t(p))},[o]),!a||n.playerOptions.title===Gt.title.FULLSCREEN_ONLY&&!n.controls.IsFullscreen()||n.playerOptions.title===Gt.title.OFF?null:Ue.jsxs("div",{className:Fn["info-container"],children:[e?Ue.jsx("div",{className:Fn["info-image-container"],children:Ue.jsx("img",{src:e,alt:"Image",className:Fn["info-image"]})}):null,Ue.jsxs("div",{className:Fn["info-text"],children:[c.length===0?null:Ue.jsx("div",{className:Fn["info-headers"],children:c.map((p,d)=>Ue.jsx("div",{className:Fn["info-header"],children:p},`header-${d}`))}),a?Ue.jsx("div",{className:Fn["info-title"],children:a}):null,s?Ue.jsx("div",{className:Fn["info-subtitle"],children:s}):null,u?Ue.jsx("div",{className:Fn["info-description"],children:u}):null]})]})},Fte=({player:n})=>{const[e,t]=Lt.useState(!1);return Lt.useEffect(()=>{const a=()=>n&&n.controls&&t(n.controls.ContentVerified());a();const s=n.controls&&n.controls.RegisterSettingsListener(a);return()=>s&&s()},[]),e?Ue.jsxs(Ue.Fragment,{children:[Ue.jsx("div",{className:Fn["content-verified-badge"],children:"VERIFIED"}),Ue.jsx(wD,{label:"Content Verification Menu",icon:e_,player:n,MenuComponent:bD,className:Fn["content-verification-menu-button"]})]}):null},Bte=({player:n,playbackStarted:e,canPlay:t,recentlyInteracted:a,setRecentUserAction:s,className:u=""})=>{const[o,c]=Lt.useState(void 0),[p,d]=Lt.useState(void 0),[y,m]=Lt.useState(n.controls.IsMenuVisible());if(Lt.useEffect(()=>{if(!n.controls)return;d(eD({player:n,setRecentUserAction:s}));const E=()=>n&&n.controls&&m(n.controls.IsMenuVisible()),C=n.controls.RegisterSettingsListener(E),T=uD({player:n,setVideoState:c});return()=>{C&&C(),T&&T()}},[]),!o)return null;const v=n.controls.GetCollectionInfo(),b=a||!e||y,x=!b&&[Gt.controls.AUTO_HIDE,Gt.controls.OFF_WITH_VOLUME_TOGGLE].includes(n.playerOptions.controls);return n.__SetControlsVisibility(!x),Ue.jsxs("div",{onClick:p,className:[u,Fn.container,b?"":Fn.autohide,n.playerOptions.controls!==Gt.controls.DEFAULT?"":Fn["container--default-controls"],n.controls.IsMenuVisible()?"menu-active":""].join(" "),children:[Ue.jsx(Ute,{player:n},`content-info-${v&&v.mediaIndex}`),[Gt.controls.DEFAULT,Gt.controls.OFF,Gt.controls.OFF_WITH_VOLUME_TOGGLE].includes(n.playerOptions.controls)?null:Ue.jsxs(Ue.Fragment,{children:[Ue.jsx(gu,{"aria-label":"Play",tabIndex:e?-1:0,icon:lD,onClick:()=>{n.controls.Play(),n.target.firstChild.focus()},className:`${Fn["center-play-button"]} ${t&&!e&&!(n&&n.casting)&&!(n&&n.controls&&n.controls.IsPlaying()&&!n.casting)?"":Fn["center-play-button--hidden"]}`}),Ue.jsxs("div",{className:`${Fn["bottom-controls-container"]} ${x?Fn["bottom-controls-container--autohide"]:""}`,children:[Ue.jsx("div",{className:Fn["bottom-controls-gradient"]}),Ue.jsx(mD,{player:n,videoState:o,setRecentUserAction:s,className:Fn.seek}),Ue.jsxs("div",{className:Fn.controls,children:[Ue.jsx(gu,{"aria-label":o.playing?"Pause":"Play",icon:o.playing?dD:fD,onClick:()=>n.controls.TogglePlay(),className:Fn["play-pause-button"]}),Ue.jsx(Dte,{player:n}),Ue.jsx(Lte,{player:n,videoState:o}),Ue.jsx(Ite,{player:n,videoState:o}),Ue.jsx("div",{className:Fn.spacer}),Ue.jsx(Fte,{player:n}),n.chromecastAvailable?Ue.jsx("google-cast-launcher",{}):null,n.airplayAvailable?Ue.jsx(gu,{"aria-label":"Airplay",onClick:()=>n.video.webkitShowPlaybackTargetPicker(),icon:hD}):null,n.controls.OverlayAvailable()?Ue.jsx(gu,{"aria-label":"Toggle Overlay",onClick:()=>n.controls.ToggleOverlayVisibility(),icon:_te,className:[Fn["icon-button--no-padding"],n.controls.OverlayVisible()?Fn["icon-button-active"]:""].join(" ")}):null,n.controls.IsRotatable()?Ue.jsx(gu,{"aria-label":"Rotate Video",icon:gte,onClick:()=>n.controls.SetAllowRotation(!n.controls.AllowRotation()),className:Fn["right-control-button"]}):null,n.controls.GetOptions().hasAnyOptions?Ue.jsx(wD,{label:"Settings Menu",icon:ute,player:n,MenuComponent:gD}):null,Ue.jsx(gu,{"aria-label":o.fullscreen?"Exit Fullscreen":"Fullscreen",icon:o.fullscreen?ote:ste,onClick:()=>n.controls.ToggleFullscreen(),className:Fn["right-control-button"]})]})]})]}),n.playerOptions.controls!==Gt.controls.OFF_WITH_VOLUME_TOGGLE||!n.controls.HasAudio()?null:Ue.jsx("div",{className:Fn["floating-volume-toggle"],children:Ue.jsx(gu,{"aria-label":o.muted?"Unmute":"Mute",icon:o.muted||o.volume===0?A5:Zw,onClick:()=>n.controls.ToggleMuted(),className:Fn["volume-button"]},"mute-button")}),n.playerOptions.watermark===Gt.watermark.OFF?null:Ue.jsx("div",{className:Fn.watermark,children:Ue.jsx("img",{src:yD,alt:"Eluvio"})})]})},zte="_spinner_1c6ar_17",jte="_text_1c6ar_33",qte="_title_1c6ar_39",Hte="_description_1c6ar_43",Vte="_inputs_1c6ar_47",Gte="_input_1c6ar_47",$te="_submit_1c6ar_77",ci={"ticket-form-container":"_ticket-form-container_1c6ar_1","ticket-form-overlay":"_ticket-form-overlay_1c6ar_8",spinner:zte,"ticket-form":"_ticket-form_1c6ar_1",text:jte,title:qte,description:Hte,inputs:Vte,input:Gte,submit:$te,"error-message":"_error-message_1c6ar_88","size-md":"_size-md_1c6ar_102","size-sm":"_size-sm_1c6ar_103"},Wte=({parameters:n,dimensions:e,onComplete:t})=>{let{tenantId:a,ntpId:s,ticketCode:u,ticketSubject:o}=n.clientOptions||{};const c=!a||!s,[p,d]=Lt.useState(u||""),[y,m]=Lt.useState(!!u),[v,b]=Lt.useState(!1),[x,E]=Lt.useState(c?"Error: Tenant ID or NTP ID not specified":""),[C,T]=Lt.useState(void 0),k=async({client:M,code:O})=>{if(!(!O||!M)){E(""),b(!0);try{let R=o;O.includes(":")&&(R=O.split(":")[0],O=O.split(":")[1]),await M.RedeemCode({tenantId:a,ntpId:s,code:O.trim(),email:R}),t(M)}catch(R){console.log(R),E("Invalid Code"),m(!1)}finally{b(!1)}}};return Lt.useEffect(()=>{Promise.resolve().then(()=>ZI).then(async({ElvClient:M})=>{const O=await M.FromConfigurationUrl({configUrl:n.clientOptions.network});T(O),u&&k({client:O,code:u})})},[]),y?Ue.jsx("div",{role:"complementary",tabIndex:-1,style:{backgroundColor:n.playerOptions.backgroundColor||"transparent","--portal-width":`${e.width}px`,"--portal-height":`${e.height}px`},className:[ci["ticket-form-container"],ci[`size-${e.size}`],ci[`orientation-${e.orientation}`]].join(" "),children:Ue.jsx("div",{className:ci["ticket-form-overlay"],children:Ue.jsx(Lg,{className:ci.spinner})})}):Ue.jsx("div",{role:"complementary",tabIndex:-1,style:{backgroundColor:n.playerOptions.backgroundColor||"transparent","--portal-width":`${e.width}px`,"--portal-height":`${e.height}px`},className:[ci["ticket-form-container"],ci[`size-${e.size}`],ci[`orientation-${e.orientation}`]].join(" "),children:Ue.jsx("div",{className:ci["ticket-form-overlay"],children:Ue.jsxs("form",{onSubmit:M=>{M.preventDefault(),k({client:C,code:p})},className:ci["ticket-form"],children:[Ue.jsxs("div",{className:ci.text,children:[Ue.jsx("h2",{className:ci.title,children:n.clientOptions.ticketTitle||"This content requires a code to view"}),Ue.jsx("p",{className:ci.description,children:n.clientOptions.ticketDescription||"Please enter your code below"})]}),Ue.jsxs("div",{className:ci.inputs,children:[Ue.jsx("input",{disabled:c,autoFocus:!0,type:"text",placeholder:"Ticket Code",value:p,"aria-label":"Ticket Code","aria-invalid":!!x&&!c,"aria-errormessage":x,onKeyDown:M=>M.key==="Enter"&&k({client:C,code:p}),onChange:M=>{E(""),d(M.target.value)},className:ci.input}),Ue.jsx("button",{type:"submit","aria-label":"Submit Code",disabled:!p||!C||c,className:ci.submit,children:v?Ue.jsx(Lg,{light:!0}):"Submit"})]}),Ue.jsxs("div",{className:ci["error-message"],children:[x," "]})]})})})},Kte="_container_1fkgx_1",Jte="_autohide_1fkgx_33",Yte="_title_1fkgx_133",Qte="_spacer_1fkgx_318",Xte="_watermark_1fkgx_322",Zte="_menu_1fkgx_144",vn={container:Kte,"container--default-controls":"_container--default-controls_1fkgx_28",autohide:Jte,"bottom-controls-container--autohide":"_bottom-controls-container--autohide_1fkgx_36","icon-button":"_icon-button_1fkgx_42","icon-button--drop-shadow-focus":"_icon-button--drop-shadow-focus_1fkgx_59","icon-button-active":"_icon-button-active_1fkgx_72","icon-button--circle-focus":"_icon-button--circle-focus_1fkgx_72","text-button":"_text-button_1fkgx_85","text-button--active":"_text-button--active_1fkgx_90","bottom-controls-container":"_bottom-controls-container_1fkgx_36","bottom-controls-gradient":"_bottom-controls-gradient_1fkgx_107","center-play-button":"_center-play-button_1fkgx_119","center-play-button--hidden":"_center-play-button--hidden_1fkgx_126","title-container":"_title-container_1fkgx_133",title:Yte,"menu-control-container":"_menu-control-container_1fkgx_144","time-container":"_time-container_1fkgx_148","live-indicator":"_live-indicator_1fkgx_155","bottom-controls":"_bottom-controls_1fkgx_36","center-buttons":"_center-buttons_1fkgx_183","play-pause-button":"_play-pause-button_1fkgx_193","track-button":"_track-button_1fkgx_196","bottom-left-controls":"_bottom-left-controls_1fkgx_200","bottom-right-controls":"_bottom-right-controls_1fkgx_201","info-box-container":"_info-box-container_1fkgx_218","info-box":"_info-box_1fkgx_218","info-box-image-container":"_info-box-image-container_1fkgx_241","info-box-image":"_info-box-image_1fkgx_241","info-box-text":"_info-box-text_1fkgx_257","info-box-text--top-padding":"_info-box-text--top-padding_1fkgx_264","info-box-headers":"_info-box-headers_1fkgx_268","info-box-description":"_info-box-description_1fkgx_276","info-box-title":"_info-box-title_1fkgx_280","info-box-button":"_info-box-button_1fkgx_285","info-box-button--restart":"_info-box-button--restart_1fkgx_300",spacer:Qte,watermark:Xte,menu:Zte},Ef=({icon:n,...e})=>Ue.jsx("button",{...e,className:`${vn["icon-button"]} ${e.className||""}`,dangerouslySetInnerHTML:{__html:n}}),ene=({player:n,videoState:e})=>{const[t,a]=Lt.useState(n.video.currentTime);return Lt.useEffect(()=>{const s=E5({player:n,setCurrentTime:a,rate:10});return()=>s&&s()},[]),n.isLive&&!n.dvrEnabled?null:Ue.jsxs("div",{className:vn["time-container"],children:[n.isLive&&!n.behindLiveEdge?null:Ue.jsx("div",{className:vn.time,children:Og(t,e.duration)}),Ue.jsx("div",{className:vn.spacer}),Ue.jsx("div",{className:vn.time,children:Og(e.duration,e.duration)})]})},tne=({player:n,videoState:e})=>{const t=n.controls.GetCollectionInfo(),a=t&&t.isPlaylist&&t.content[t.mediaIndex-1],s=t&&t.isPlaylist&&t.content[t.mediaIndex+1],u=n.controls.IsReady();return Ue.jsxs("div",{className:vn["center-buttons"],children:[!a&&!s?null:Ue.jsx(Ef,{disabled:!u||!a,icon:k5,onClick:()=>n.controls.CollectionPlayPrevious(),className:`${vn["track-button"]} ${vn["icon-button--drop-shadow-focus"]}`}),Ue.jsx(Ef,{"aria-label":"Back 10 Seconds",icon:fte,onClick:()=>n.controls.Seek({relativeSeconds:-10}),className:vn["icon-button--drop-shadow-focus"]}),Ue.jsx(Ef,{"aria-label":e.playing?"Pause":"Play",icon:e.playing?dD:fD,onClick:()=>n.controls.TogglePlay(),className:`${vn["play-pause-button"]} ${vn["icon-button--drop-shadow-focus"]}`}),Ue.jsx(Ef,{"aria-label":"Forward 10 Seconds",icon:dte,onClick:()=>n.controls.Seek({relativeSeconds:10}),className:vn["icon-button--drop-shadow-focus"]}),!a&&!s?null:Ue.jsx(Ef,{disabled:!u||!s,icon:T5,onClick:()=>n.controls.CollectionPlayNext(),className:`${vn["track-button"]} ${vn["icon-button--drop-shadow-focus"]}`})]})},bA=({label:n,icon:e,children:t,player:a,MenuComponent:s})=>{const[u,o]=Lt.useState(!1);return Ue.jsxs("div",{className:vn["menu-control-container"],children:[e?Ue.jsx(Ef,{"aria-label":u?`Hide ${n} Menu`:n,"aria-haspopup":!0,icon:e,onClick:()=>{a.controls.__ToggleMenu(!u),o(!u)},className:`${vn["icon-button--circle-focus"]} ${u?vn["icon-button-active"]:""}`}):Ue.jsx("button",{onClick:()=>{a.controls.__ToggleMenu(!u),o(!u)},className:`${vn["text-button"]} ${u?vn["text-button--active"]:""}`,children:t}),u?Ue.jsx(s,{player:a,Hide:()=>{a.controls.__ToggleMenu(!1),o(!1)},className:vn.menu}):null]})},nne=({player:n,Hide:e})=>{const[t,a]=Lt.useState(void 0),{title:s,description:u,image:o,headers:c}=n.controls.GetContentInfo()||{};return Lt.useEffect(()=>{a(void 0),o&&S5({player:n,pathOrUrl:o,width:200}).then(p=>a(p))},[o]),Lt.useEffect(()=>{const p=d=>{d&&(d.key||"").toLowerCase()==="escape"&&e()};return document.body.addEventListener("keydown",p),()=>document.body.removeEventListener("keydown",p)},[]),Ue.jsxs("div",{className:vn["info-box-container"],children:[Ue.jsx("button",{autoFocus:!0,onClick:()=>e(),className:`${vn["info-box-button"]} ${vn["info-box-button--info"]}`,children:"Info"}),Ue.jsxs("div",{className:vn["info-box"],children:[t?Ue.jsx("div",{className:vn["info-box-image-container"],children:Ue.jsx("img",{src:t,alt:"Image",className:vn["info-box-image"]})}):null,Ue.jsxs("div",{className:`${vn["info-box-text"]} ${t&&c&&c.length===0?vn["info-box-text--top-padding"]:""}`,children:[!c||c.length===0?null:Ue.jsx("div",{className:vn["info-box-headers"],children:c.map((p,d)=>Ue.jsx("div",{className:vn["info-box-header"],children:p},`header-${d}`))}),Ue.jsx("div",{className:vn["info-box-title"],children:s||""}),Ue.jsx("div",{className:vn["info-box-description"],children:u||""})]}),Ue.jsx("div",{className:vn["info-box-actions"],children:Ue.jsxs("button",{onClick:()=>{n.controls.Seek({time:0}),e()},className:`${vn["info-box-button"]} ${vn["info-box-button--restart"]}`,children:[Ue.jsx(pl,{icon:cD}),"From Beginning"]})})]})]})},rne=({player:n})=>{const[e,t]=Lt.useState(!1);return Lt.useEffect(()=>{const a=()=>t(n.controls.ContentVerified());a(),n.controls.RegisterSettingsListener(a)},[]),e?Ue.jsx(bA,{label:"Content Verification Menu",icon:e_,player:n,MenuComponent:bD,className:vn["content-verification-menu-button"],children:"Verified"}):null},ane=({player:n,playbackStarted:e,canPlay:t,recentlyInteracted:a,setRecentUserAction:s,className:u=""})=>{const[o,c]=Lt.useState(void 0),[p,d]=Lt.useState(void 0),[y,m]=Lt.useState(!1);if(Lt.useEffect(()=>{d(eD({player:n,setRecentUserAction:s}));const C=uD({player:n,setVideoState:c});return()=>C&&C()},[]),!o)return null;const{title:v}=n.controls.GetContentInfo()||{},b=n.controls.GetCollectionInfo(),x=a||!e||n.controls.IsMenuVisible(),E=!x&&n.playerOptions.controls===Gt.controls.AUTO_HIDE;return n.__SetControlsVisibility(!E),Ue.jsxs("div",{onClick:p,className:[u,vn.container,x?"":vn.autohide,n.playerOptions.controls!==Gt.controls.DEFAULT?"":vn["container--default-controls"],n.controls.IsMenuVisible()?"menu-active":""].join(" "),children:[Ue.jsx(Ef,{"aria-label":"Play",tabIndex:e?-1:0,icon:lD,onClick:()=>{n.controls.Play(),n.target.firstChild.focus()},className:`${vn["center-play-button"]} ${vn["icon-button--drop-shadow-focus"]} ${t&&!e&&!n.casting?"":vn["center-play-button--hidden"]}`}),y?Ue.jsx(nne,{player:n,Hide:()=>m(!1)}):Ue.jsxs("div",{className:`${vn["bottom-controls-container"]} ${E?vn["bottom-controls-container--autohide"]:""}`,children:[Ue.jsx("div",{className:vn["bottom-controls-gradient"]}),Ue.jsxs("div",{className:vn["title-container"],children:[Ue.jsx("div",{className:vn.title,children:n.playerOptions.title===Gt.title.OFF||n.playerOptions.title===Gt.title.FULLSCREEN_ONLY&&!n.controls.IsFullscreen()?"":v||""}),Ue.jsx("div",{className:vn.spacer}),n.isLive?n.controls.IsDVRAvailable()?Ue.jsx(vD,{player:n}):Ue.jsx("div",{className:vn["live-indicator"],children:"Live"}):null,b?Ue.jsx(bA,{label:"Collection Menu",icon:pte,player:n,MenuComponent:Pte}):null]}),Ue.jsx(mD,{player:n,videoState:o,setRecentUserAction:s}),Ue.jsx(ene,{player:n,videoState:o}),Ue.jsxs("div",{className:vn["bottom-controls"],children:[Ue.jsx("div",{className:vn["bottom-left-controls"],children:!v||n.playerOptions.title===Gt.title.OFF?null:Ue.jsx("button",{className:vn["text-button"],onClick:()=>m(!0),children:"Info"})}),Ue.jsx(tne,{player:n,videoState:o}),Ue.jsxs("div",{className:vn["bottom-right-controls"],children:[Ue.jsx(rne,{player:n}),n.airplayAvailable?Ue.jsx(Ef,{"aria-label":"Airplay",onClick:()=>n.video.webkitShowPlaybackTargetPicker(),icon:hD}):null,n.chromecastAvailable?Ue.jsx("google-cast-launcher",{}):null,n.controls.GetOptions().hasAnyOptions?Ue.jsx(bA,{label:"Settings",player:n,MenuComponent:gD,children:"Settings"},"settings-button"):null]})]})]}),n.playerOptions.watermark===Gt.watermark.OFF?null:Ue.jsx("div",{className:vn.watermark,children:Ue.jsx("img",{src:yD,alt:"Eluvio"})})]},"controls")},ine="_container_1l7ln_1",sne="_overlay_1l7ln_9",one="_form_1l7ln_22",une="_header_1l7ln_39",lne="_input_1l7ln_45",cne="_actions_1l7ln_92",fne="_submit_1l7ln_98",dne="_cancel_1l7ln_99",Js={container:ine,overlay:sne,form:one,header:une,"input-container":"_input-container_1l7ln_45",input:lne,"input--invalid":"_input--invalid_1l7ln_65","player-info":"_player-info_1l7ln_74","api-link":"_api-link_1l7ln_83",actions:cne,submit:fne,cancel:dne},pne=({player:n,Close:e})=>{const[t,a]=Lt.useState(),[s,u]=Lt.useState(!1),[o,c]=Lt.useState(""),p=Lt.useRef();Lt.useEffect(()=>{if(!p||!p.current)return;const y=B_({element:p.current,Hide:e});return()=>y&&y()},[p]),Lt.useEffect(()=>{let y={...n.hlsOptions||{}};delete y.drmSystems,delete y.emeEnabled,a(JSON.stringify(y,null,2))},[]);const d=async y=>{y.preventDefault();try{u(!0),await n.controls.SetPlayerProfile({profile:"custom",customOptions:JSON.parse(t)}),e()}catch(m){c(m.toString()),u(!1)}};return Ue.jsx("div",{role:"complementary",tabIndex:-1,className:Js.container,children:Ue.jsx("div",{className:Js.overlay,children:Ue.jsxs("form",{onSubmit:d,className:Js.form,ref:p,children:[Ue.jsx("h2",{className:Js.header,children:"Custom hls.js Options"}),Ue.jsxs("div",{className:Js["input-container"],children:[Ue.jsx("textarea",{disabled:s,autoFocus:!0,value:t,title:o,"aria-label":"Player Options","aria-invalid":!!o,"aria-errormessage":o||"",onChange:y=>a(y.currentTarget.value),onFocus:()=>c(""),onBlur:()=>{try{c(""),a(JSON.stringify(JSON.parse(t||"{}"),null,2))}catch(y){c(y.toString())}},className:`${Js.input} ${o?Js["input--invalid"]:""}`}),Ue.jsxs("div",{className:Js["player-info"],children:[Ue.jsx("a",{tabIndex:0,href:"https://github.com/video-dev/hls.js/blob/master/docs/API.md",rel:"noreferrer",target:"_blank",className:Js["api-link"],children:"API Docs"}),Ue.jsxs("div",{className:Js["player-version"],children:["hls.js ",n.HLS.version]})]})]}),Ue.jsxs("div",{className:Js.actions,children:[Ue.jsx("button",{type:"button","aria-label":"Cancel",onClick:()=>e(),className:Js.cancel,children:"Cancel"}),Ue.jsx("button",{type:"submit","aria-label":"Submit",disabled:!!o,className:Js.submit,children:s?Ue.jsx(Lg,{light:!0}):"Submit"})]})]})})})},hne=[["Nose","LEyeIn"],["LEyeIn","LEye"],["LEye","REyeOut"],["REyeOut","LEar"],["Nose","REyeIn"],["REyeIn","REye"],["REye","REyeOut"],["REyeOut","REar"],["MouthL","MouthR"],["LShoulder","RShoulder"],["LShoulder","LElbow"],["LElbow","LWrist"],["LWrist","LPinky"],["LWrist","LIndex"],["LWrist","LThumb"],["LPinky","LIndex"],["RShoulder","RElbow"],["RElbow","RWrist"],["RWrist","RPinky"],["RWrist","RIndex"],["RWrist","RThumb"],["RPinky","RIndex"],["LShoulder","LHip"],["RShoulder","RHip"],["LHip","RHip"],["LHip","LKnee"],["RHip","RKnee"],["LKnee","LAnkle"],["RKnee","RAnkle"],["LAnkle","LHeel"],["RAnkle","RHeel"],["LHeel","LFootIdx"],["RHeel","RFootIdx"],["LAnkle","LFootIdx"],["RAnkle","RFootIdx"]];let yne=5;const mne=({tags:n,portalDimensions:e,videoDimensions:t})=>{const[a,s]=Lt.useState(null);if(Lt.useEffect(()=>{if(!a||!e||t.videoWidth===0)return;a.width=a.getBoundingClientRect().width,a.height=a.getBoundingClientRect().height;const p={r:255,g:255,b:255},d=a.getContext("2d"),y=d.canvas.width,m=d.canvas.height,v=b=>b.toString(16).padStart(2,"0");d.clearRect(0,0,d.canvas.width,d.canvas.height),d.lineWidth=3,!(!n||n.length===0)&&n.forEach(b=>{!b||!b.additional_info||!b.additional_info.pose||(d.lineWidth=3,d.strokeStyle=`#${v(p.r)}${v(p.g)}${v(p.b)}`,d.fillStyle=`#${v(p.r)}${v(p.g)}${v(p.b)}`,d.globalAlpha=.7,Object.values(b.additional_info.pose).forEach(([x,E])=>{d.beginPath(),d.arc(x*y,E*m,1.5,0,2*Math.PI),d.fill(),d.stroke()}),hne.forEach(([x,E])=>{if(!b.additional_info.pose[x]||!b.additional_info.pose[E])return;const[C,T]=b.additional_info.pose[x],[k,M]=b.additional_info.pose[E];d.beginPath(),d.moveTo(C*y,T*m),d.lineTo(k*y,M*m),d.stroke()}))})},[n]),!e||t.videoWidth===0)return null;const u=e.width/e.height,o=t.videoWidth/t.videoHeight;let c={};return u<o?(c.width=e.width,c.height=e.width/o,c.left=0,c.top=(e.height-e.width/o)/2):(c.height=e.height,c.width=e.height*o,c.top=0,c.left=(e.width-e.height*o)/2),Ue.jsx("canvas",{ref:s,style:c,className:ts.overlay})},gne=({player:n})=>{const[e,t]=Lt.useState(null),[a,s]=Lt.useState(null);Lt.useEffect(()=>{const o=new ResizeObserver(()=>t(n.video.getBoundingClientRect()));return o.observe(n.video),()=>{o.disconnect()}},[n.video]),Lt.useEffect(()=>{const o=(n.playoutInfo||{}).frameRate;if(!o)return;const c=()=>{clearInterval(n.__frameInterval),n.__frameInterval=setInterval(()=>s(Math.floor(n.video.currentTime*o)),1e3/n.playoutInfo.frameRate)};n.controls.RegisterVideoEventListener("play",c),n.controls.RegisterVideoEventListener("pause",()=>clearInterval(n.__frameInterval)),n.video.paused||c()},[(n.playoutInfo||{}).frameRate]);let u;for(let o=a;o>a-yne&&(u=n.__poseOverlayTags&&n.__poseOverlayTags[o],!(u&&u.length>0));o--);return Ue.jsx(mne,{tags:u,portalDimensions:e,videoDimensions:{videoWidth:n.video.videoWidth,videoHeight:n.video.videoHeight}})},vne=({player:n})=>{const[e,t]=Lt.useState(void 0),{posterImage:a}=n.controls.GetContentInfo()||{};return Lt.useEffect(()=>{t(void 0),a&&S5({player:n,pathOrUrl:a,width:200}).then(s=>t(s))},[a]),e?Ue.jsx("img",{alt:"Video Poster",src:e,className:ts.poster}):null};let bne;const wne=({target:n,parameters:e,InitCallback:t,ErrorCallback:a,Unmount:s,Reset:u,SetAdditionalParameters:o})=>{const[c,p]=Lt.useState(void 0),[d,y]=Lt.useState(void 0),[m,v]=Lt.useState("lg"),[b,x]=Lt.useState("landscape"),[E,C]=Lt.useState({width:n.getBoundingClientRect().width,height:n.getBoundingClientRect().height}),[T,k]=Lt.useState(void 0),[M,O]=Lt.useState(!1),[R,$]=Lt.useState(!1),[X,se]=Lt.useState(!1),[ye,he]=Lt.useState(!1),[te,re]=Lt.useState(!1),[S,_]=Lt.useState(!1),[P,j]=Lt.useState(!0),[q,z]=Lt.useState(void 0),[Z,W]=Lt.useState(void 0),[D,N]=Lt.useState(!1),[Y,ie]=Lt.useState(!1),V=Lt.useRef(),Ce=!!c,Pe=({action:Ee,text:oe})=>z({action:Ee,text:oe,key:Math.random()});if(Lt.useEffect(()=>{re(!0);const Ee=Wee({target:n,setSize:v,setOrientation:x,setDimensions:C});return()=>{re(!1),Ee&&Ee()}},[]),Lt.useEffect(()=>{if(!(!V||!V.current||!te))try{O(!1),se(!1),e.clientOptions.client=d||e.clientOptions.client;const Ee=new Yw({target:n,video:V.current,parameters:e,SetErrorMessage:k,Reload:u,UpdateParameters:B=>{o(B)}});window.__elvPlayer=Ee;const oe=Ee.controls.RegisterSettingsListener(()=>{W(Ee.controls.AllowRotation()),se(Ee.playbackStarted||Ee.controls&&Ee.controls.IsPlaying()),O(!Ee.loading),_(Ee.__showPlayerProfileForm),N(Ee&&Ee.casting),ie(Ee.controls.OverlayVisible())});Ee.Destroy=()=>{Ee.__DestroyPlayer(),s()},Ee.Reset=()=>{u()};const ce=Kee({player:Ee}),be=Jee({player:Ee,inactivityPeriod:5e3,onWake:()=>j(!0),onSleep:()=>j(!1)}),me=Yee({player:Ee,setRecentUserAction:Pe}),fe=Qee({player:Ee});t(Ee),p(Ee);const _e=Ee.controls.RegisterVideoEventListener("canplay",()=>he(!0)),ne=Ee.controls.RegisterVideoEventListener("play",()=>se(!0));return()=>{oe&&oe(),ce&&ce(),be&&be(),me&&me(),fe&&fe(),_e&&_e(),ne&&ne(),Ee&&Ee.__DestroyPlayer()}}catch(Ee){a(Ee),s()}},[V,te,d]),Lt.useEffect(()=>{setTimeout(()=>$(!0),2e3)},[M]),Lt.useEffect(()=>{if(Ce)return()=>{c&&c.__DestroyPlayer(),p(void 0)}},[Ce]),Lt.useEffect(()=>{q&&(clearTimeout(bne),setTimeout(()=>{z(void 0)},1e3))},[q]),e.clientOptions.promptTicket&&!d)return Ue.jsx(Wte,{parameters:e,dimensions:{size:m,orientation:b,...E},onComplete:Ee=>y(Ee)});const Se=e.playerOptions.ui===Gt.ui.WEB&&c&&c.controls.IsRotatable()&&Z;return Ue.jsxs("div",{role:"complementary","aria-label":"Eluvio Video Player",tabIndex:0,style:{backgroundColor:e.playerOptions.backgroundColor||"transparent","--portal-width":`${Se?E.height:E.width}px`,"--portal-height":`${Se?E.width:E.height}px`},className:[ts["player-container"],Se?ts["player-container--rotated"]:"",`__eluvio-player--size-${m}`,`__eluvio-player--orientation-${b}`].join(" "),children:[!S||!M?null:Ue.jsx(pne,{player:c,Close:()=>c.controls.HidePlayerProfileForm()}),Ue.jsx("video",{playsInline:!0,disablePictureInPicture:!0,ref:V,muted:[Gt.muted.ON,Gt.muted.WHEN_NOT_VISIBLE].includes(e.playerOptions.muted),controls:e.playerOptions.controls===Gt.controls.DEFAULT,loop:e.playerOptions.loop===Gt.loop.ON,crossOrigin:"anonymous",className:ts.video}),!R||!ye||X&&!e.playerOptions.permanentPoster?null:Ue.jsx(vne,{player:c}),Y?Ue.jsx(gne,{player:c}):null,M||T||!e.playerOptions.showLoader?null:Ue.jsx("div",{className:ts["spinner-container"],children:Ue.jsx(Lg,{className:ts.spinner})}),D?Ue.jsx("div",{className:ts["cast-indicator-container"],children:Ue.jsx("div",{dangerouslySetInnerHTML:{__html:bte}})}):null,T?Ue.jsxs("div",{className:ts["error-message"],children:[Ue.jsx("div",{className:ts["error-message__message"],children:T}),Ue.jsxs("button",{className:ts["error-message__copy-debug-button"],onClick:()=>M5(JSON.stringify(c.controls.GetDebugInfo(),null,2)),children:[Ue.jsx(pl,{icon:wte,className:ts["error-message__icon"]}),"Copy Troubleshooting Info"]})]}):null,c?e.playerOptions.ui===Gt.ui.WEB?Ue.jsx(Bte,{player:c,playbackStarted:!!X,canPlay:ye,recentlyInteracted:P,setRecentUserAction:Pe,showOverlay:Y,setShowOverlay:ie,className:ts.controls}):Ue.jsx(ane,{player:c,playbackStarted:!!X,canPlay:ye,recentlyInteracted:P,setRecentUserAction:Pe,className:ts.controls}):null,q?Ue.jsx(Rte,{action:q},`action-indicator-${q&&q.key}`):null]})},_ne=({parameters:n,...e})=>{const[t,a]=Lt.useState(Math.random()),[s,u]=Lt.useState();return Lt.createElement(wne,{...e,SetAdditionalParameters:u,parameters:s?C5(n,s):n,key:`player-${t}`,Reset:()=>a(Math.random())})},xne=(n,e)=>(n.innerHTML="",n.classList.add(mq.reset),n.classList.add(ts["player-target"]),e=nD(e),e.playerOptions&&e.playerOptions.backgroundColor&&(n.style.backgroundColor=e.playerOptions.backgroundColor),new Promise((t,a)=>{const s=Mq.createRoot(n);s.render(Ue.jsx(hq.StrictMode,{children:Ue.jsx(_ne,{target:n,parameters:e,InitCallback:t,ErrorCallback:a,Unmount:async()=>{try{await s.unmount()}catch(u){console.error("Failed to unmount Eluvio Player"),console.error(u)}}})}))}));exports.Initialize=xne;exports.PlayerParameters=Gt;exports.commonjsGlobal=wu;exports.crypto=xL;exports.getDefaultExportFromCjs=Su;exports.require$$3=n_;exports.requireBuffer=Pg;exports.requireEvents=Vg;exports.requireInherits_browser=lN;exports.requireString_decoder=zP;
|
|
380
|
+
`)[0].split("?"),[m,v]=y.split("#"),b=v.split("=")[1].split(",").map(C=>parseInt(C)),x=new URLSearchParams(`?${m}`),E=new URL(e);E.searchParams.set("authorization",t),E.pathname=sp(E.pathname.split("/").slice(0,-1).join("/"),d),x.forEach((C,T)=>E.searchParams.set(C,T)),s[p].imageUrl=E.toString(),s[p].thumbnailPosition=b,c[E.toString()]=!0,delete s[p].tag.text,delete s[p].text}),await Promise.all(Object.keys(c).map(async p=>{const d=new Image;await new Promise(y=>{d.src=p,d.crossOrigin="anonymous",d.onload=()=>{y()}}),c[p]=d})),this.maxInterval=Math.ceil(u),this.thumbnailImages=c,this.thumbnails=s,this.intervalTree=Cee(s,"Thumbnails"),this.loaded=!0}ThumbnailImage(e){if(!this.intervalTree)return;const t=this.intervalTree.search(e,e+this.maxInterval)[0];if(!t)return;const a=this.thumbnails&&this.thumbnails[t.toString()];if(!a)return;this.thumbnailCanvas||(this.thumbnailCanvas=document.createElement("canvas"));const s=this.thumbnailImages[a.imageUrl];if(s){const[u,o,c,p]=a.thumbnailPosition;return this.thumbnailCanvas.height=p,this.thumbnailCanvas.width=c,this.thumbnailCanvas.getContext("2d").drawImage(s,u,o,c,p,0,0,c,p),this.thumbnailCanvas.toDataURL("image/png")}}}const Aee=/iPhone|iPad|iPod/i.test(navigator.userAgent),fL=window.__chromecastAvailable||!!(window.chrome&&window.chrome.cast),kee={default:{label:"Default",hlsSettings:gc.Utils.HLSJSSettings({profile:"default"})},low_latency:{label:"Low Latency Live",hlsSettings:gc.Utils.HLSJSSettings({profile:"ll"})},ultra_low_latency:{label:"Ultra Low Latency Live",hlsSettings:gc.Utils.HLSJSSettings({profile:"ull"})},custom:{label:"Custom",hlsSettings:{}}};class Yw{__RegisterVideoEventListener(e,t){this.video.addEventListener(e,t);const a=()=>this.video.removeEventListener(e,t);return this.__listenerDisposers.push(a),()=>{a(),this.__listenerDisposers=this.__listenerDisposers.filter(s=>s!==a)}}__RegisterSettingsListener(e){return this.__settingsListeners.push(e),()=>this.__settingsListeners=this.__settingsListeners.filter(t=>t!==e)}constructor({target:e,video:t,parameters:a,Reload:s,UpdateParameters:u,SetErrorMessage:o}){this.latest=!0,this.loading=!0,this.target=e,this.video=t,this.controls=new hee({player:this}),this.__settingsListeners=[],this.__listenerDisposers=[],this.__showPlayerProfileForm=!1,this.playbackStarted=!1,this.reloads=0,this.canPlay=!1,this.isLive=!1,this.dvrEnabled=!1,this.dvrAvailable=!1,this.behindLiveEdge=!1,this.publicMetadataUrl=void 0,this.airplayAvailable=!1,this.chromecastAvailable=fL&&a.playerOptions.allowCasting,this.casting=!1,this.usePlayerControls=[Gt.controls.ON,Gt.controls.AUTO_HIDE].includes(a.playerOptions.controls),this.__error=void 0,this.__ReloadComponent=s,this.__UpdateParameters=u,this.SetErrorMessage=(c,p)=>{o(c),this.__error=p};try{a.playerOptions.hlsjsOptions&&Object.keys(a.playerOptions.hlsjsOptions).length>0&&(this.customHLSOptions=a.playerOptions.hlsjsOptions,a.playerOptions.playerProfile=Gt.playerProfile.CUSTOM)}catch(c){this.Log(c,!0)}this.__Initialize(a)}async __Client(){if(this.clientPromise&&await this.clientPromise,this.clientOptions.client||(this.clientPromise=(async()=>{const{ElvClient:e}=await Promise.resolve().then(()=>ZI);return this.clientOptions.client=await e.FromConfigurationUrl({configUrl:this.clientOptions.network}),this.clientOptions.staticToken&&this.clientOptions.client.SetStaticToken({token:this.clientOptions.staticToken}),this.clientOptions.client})(),await this.clientPromise),!this.__tokenResolved){const e=(this.sourceOptions.playoutParameters||{}).authorizationToken||this.clientOptions.client.staticToken;if(e)try{JSON.parse(gc.Utils.FromB64(e)).qspace_id&&(this.sourceOptions.playoutParameters.authorizationToken=await this.clientOptions.client.CreateFabricToken({duration:10080*60*1e3}))}catch{}this.__tokenResolved=!0}return this.userAddress=this.clientOptions.client.CurrentAccountAddress(),this.clientOptions.client}async __PlayoutOptions(){const e=await this.__Client(),t=this.sourceOptions.playoutParameters||{};if(this.collectionInfo){const R=this.collectionInfo.content[this.collectionInfo.mediaIndex];t.objectId=e.utils.DecodeVersionHash(R.mediaHash).objectId,t.versionHash=R.mediaHash,this.sourceOptions.playoutOptions=void 0}let a,s,u={ignore_trimming:t.ignoreTrimming,resolve:t.resolve,...t.options||{},clip_start:(t.options||{}).clip_start||t.clipStart,clip_end:(t.options||{}).clip_end||t.clipEnd};t.vertical&&(u.v=1);let o,c;if((u.clip_start||u.clip_end)&&(o=parseFloat(u.clip_start||0),c=parseFloat(u.clip_end||0),delete u.clip_start,delete u.clip_end),!t.channel){let R=await e.AvailableOfferings({objectId:t.objectId,versionHash:t.versionHash,writeToken:t.writeToken,linkPath:t.linkPath,directLink:t.directLink,resolveIncludeSource:!0,authorizationToken:t.authorizationToken})||{};if(a=R.default?"default":Object.keys(R)[0],t.offering?a=R[t.offering]?t.offering:void 0:(t.offerings||[]).length>0?a=t.offerings.find(X=>R[X]):t.offerings&&t.offerings.length>0&&(a=t.offerings.find(X=>R[X])),!a)throw new Error(`Unable to find offering from '${t.offering||t.offerings}'`);const $=R[a]&&R[a].properties||{};s=R[a].uri,this.sourceOptions.contentInfo.liveDVR===Gt.liveDVR.ON&&$.dvr_available?(u.dvr=1,this.dvrAvailable=!0):this.dvrAvailable=!1,this.isLive=$.live}const p=async R=>t.directLink?await e.PlayoutOptions({offeringURI:s,options:R}):await e.PlayoutOptions({...t,handler:t.channel?"channel":"playout",offering:t.channel||a,options:R});if(!this.sourceOptions.playoutOptions){let R;if(!o&&!c)R=await p(u);else if(!t.clipRelativeToUntrimmed)R=await p({...u,clip_start:o,clip_end:c});else{R=await p(u);let $;try{for(const X of Object.keys(R||{})){for(const se of Object.keys(R[X].playoutMethods||{}))if(typeof(R[X].playoutMethods[se].properties||{}).start_offset_float<"u"){$=parseFloat(R[X].playoutMethods[se].properties.start_offset_float);break}if(typeof $<"u")break}}catch(X){this.Log("Failed to load content offset for clip adjustment:"),this.Log(X,!0)}R=await p({...u,clip_start:(o||0)-($||0),clip_end:(c||0)-($||0)||9999999})}this.sourceOptions.playoutOptions=R}t.directLink?this.sourceOptions.playoutOptions||(this.sourceOptions.playoutOptions=await e.PlayoutOptions({offeringURI:s,options:u})):this.sourceOptions.playoutOptions||(this.sourceOptions.playoutOptions=await e.PlayoutOptions({...t,handler:t.channel?"channel":"playout",offering:t.channel||a,options:u}));let d=(await e.AvailableDRMs()).filter(R=>(this.sourceOptions.drms||[]).includes(R)),y=this.sourceOptions.protocols,m,v;for(;!(m&&v);){m=y.find($=>this.sourceOptions.playoutOptions[$]);const R=Object.keys(this.sourceOptions.playoutOptions[m].playoutMethods);if(v=(this.sourceOptions.drms||[]).length===0?R.find($=>$!=="clear")||R[0]:this.sourceOptions.drms.sort().reverse().find($=>d.includes($)&&this.sourceOptions.playoutOptions[m].playoutMethods[$]),!v&&(y=y.filter($=>$!==m),y.length===0))throw Error("No valid protocol / DRM combination available")}const{playoutUrl:b,drms:x,thumbnailTrack:E,properties:C}=this.sourceOptions.playoutOptions[m].playoutMethods[v],T=b.split("/").find(R=>R.startsWith("hq__")),k=(C||{}).start_offset_float||0,M=(o||0)+(k||0);let O=(C||{}).rate;if(O&&typeof O=="string"){const[R,$]=O.split("/");$?O=parseInt(R)/parseInt($):O=parseInt(R)}return{playoutParameters:{...t,options:u},protocol:m,drm:v,playoutUrl:b,thumbnailTrackUrl:E,objectId:e.utils.DecodeVersionHash(T).objectId,versionHash:T,drms:x,availableDRMs:d,offeringURI:s,offering:a,compositionKey:t.channel,clipStart:u.clip_start,clipEnd:u.clip_end,trimOffset:k,thumbnailOffset:M,frameRateRat:(C||{}).rate,frameRate:O,sessionId:this.sourceOptions.playoutOptions.sessionId,multiviewOptions:{enabled:this.sourceOptions.playoutOptions.multiview,AvailableViews:this.sourceOptions.playoutOptions.AvailableViews,SwitchView:this.sourceOptions.playoutOptions.SwitchView}}}__CollectionPlay({mediaIndex:e,mediaId:t,autoplay:a}){t&&(e=this.collectionInfo.content.find(s=>s.id===t)),this.collectionInfo.mediaIndex=e,this.__SettingsUpdate(),this.__Initialize(this.originalParameters,this.video?{muted:this.video.muted,volume:this.video.volume,playing:typeof a<"u"?a:!this.video.paused}:null)}async __LoadCollection(){if(this.collectionInfo)return;let{mediaCatalogObjectId:e,mediaCatalogVersionHash:t,collectionId:a}=this.sourceOptions&&this.sourceOptions.mediaCollectionOptions||{};if(!a)return;if(!e&&!t)throw{displayMessage:"Invalid collection options: Media catalog not specified"};const s=await this.__Client();try{const u=this.sourceOptions.playoutParameters.authorizationToken;t=t||await s.LatestVersionHash({objectId:e});const c=(await s.ContentObjectMetadata({versionHash:t,metadataSubtree:"public/asset_metadata/info/collections",authorizationToken:u,produceLinkUrls:!0})||[]).find(p=>p.id===a);if(!c)throw{displayMessage:`No collection with ID ${a} found for media catalog ${e||t}`};c.content=c.content.filter(p=>p.media).map((p,d)=>({...p,active:d===0,mediaId:p.id,mediaIndex:d,mediaHash:p.media&&p.media["/"]&&p.media["/"].split("/").find(y=>y.startsWith("hq__"))})),this.collectionInfo={...c,isPlaylist:c.type==="playlist",mediaIndex:0,mediaLength:c.content.length}}catch(u){throw this.Log("Failed to load collection:"),u}}async __Initialize(e,t){if(!this.__destroyed){this.__Reset(),this.initialized=!1,this.loading=!0,this.initTime=Date.now(),this.restartParameters=t,this.__SettingsUpdate(),e&&(this.originalParameters=nD(e),this.clientOptions=e.clientOptions,this.sourceOptions=e.sourceOptions,this.playerOptions=e.playerOptions),this.errors=0,this.__Client();try{t&&(this.video.volume=t.volume,this.video.muted=t.muted,t.playing&&(this.playerOptions.autoplay=Gt.autoplay.ON),t.currentTime&&this.__RegisterVideoEventListener("loadedmetadata",()=>this.video.currentTime=t.currentTime)),this.usePlayerControls&&this.playerOptions.allowCasting&&(this.castHandler=new Bq({player:this,onReady:()=>{this.chromecastAvailable=!0,this.__SettingsUpdate()},onUpdate:()=>{this.__SettingsUpdate()}})),this.__RegisterVideoEventListener("webkitplaybacktargetavailabilitychanged",$=>{this.airplayAvailable=$.availability==="available",this.__SettingsUpdate()});const a=this.__RegisterVideoEventListener("timeupdate",()=>{this.reloads=0,this.playbackStarted=!0,this.__SettingsUpdate(),a()});this.__RegisterVideoEventListener("canplay",()=>{this.initTime&&!this.initTimeLogged&&(this.Log(`Player initialization: ${((Date.now()-this.initTime)/1e3).toFixed(2)} seconds`),this.initTimeLogged=!0,this.canPlay=!0,this.video.textTracks&&this.video.textTracks.addEventListener("change",()=>this.__SettingsUpdate()),this.video.audioTracks&&this.video.audioTracks.addEventListener("change",()=>this.__SettingsUpdate()),this.playerOptions.startTime?this.controls.Seek({time:parseFloat(this.playerOptions.startTime)}):this.playerOptions.startProgress&&this.controls.Seek({fraction:parseFloat(this.playerOptions.startProgress)}),this.playerOptions.autoplay===Gt.autoplay.ON&&this.controls.Play())}),this.__RegisterVideoEventListener("seeking",()=>{if(!this.isLive||!this.dvrAvailable)return;const $=this.video.duration-this.video.currentTime;this.behindLiveEdge=$>15,this.__SettingsUpdate()}),await this.__LoadCollection(),this.collectionInfo&&this.collectionInfo.isPlaylist&&this.collectionInfo.mediaIndex<this.collectionInfo.mediaLength-1&&this.__RegisterVideoEventListener("ended",()=>this.controls&&this.controls.CollectionPlayNext({autoplay:!0}));let{objectId:s,versionHash:u,playoutUrl:o,thumbnailTrackUrl:c,protocol:p,drm:d,drms:y,multiviewOptions:m,playoutParameters:v,trimOffset:b,thumbnailOffset:x,offering:E,compositionKey:C,clipStart:T,clipEnd:k,frameRate:M,frameRateRat:O}=await this.__PlayoutOptions();this.playoutInfo={objectId:s,versionHash:u,offering:E,compositionKey:C,trimOffset:b,thumbnailOffset:x,clipStart:T,clipEnd:k,frameRate:M,frameRateRat:O},this.contentHash=u,o=new URL(o);const R=this.sourceOptions.playoutParameters.authorizationToken||o.searchParams.get("authorization");if(this.authorizationToken=R,this.playoutUrl=o.toString(),this.thumbnailTrackUrl=c,this.castHandler&&this.castHandler.SetMedia({playoutOptions:this.sourceOptions.playoutOptions,playoutParameters:v}),this.__destroyed)return;p==="hls"?await this.__InitializeHLS({playoutUrl:o,authorizationToken:R,drm:d,drms:y,multiviewOptions:m}):await this.__InitializeDash({playoutUrl:o,authorizationToken:R,drm:d,drms:y,multiviewOptions:m}),this.playerOptions.collectVideoAnalytics&&Promise.resolve().then(()=>require("./Analytics-B0HNzKyF.js")).then(({InitializeMuxMonitoring:$})=>$({appName:this.playerOptions.appName||"elv-player-js",elvPlayer:this,playoutUrl:o,authorizationToken:R,disableCookies:this.playerOptions.collectVideoAnalytics===Gt.collectVideoAnalytics.DISABLE_COOKIES})),this.playerOptions.verifyContent&&setTimeout(()=>{this.__VerifyContent()},1e3),this.playerOptions.loadChapters&&this.__LoadChapters({...this.playoutInfo||{}}).then($=>this.__chapterTags=$).catch($=>this.Log($,!0)),this.playerOptions.loadPoseOverlay&&this.__LoadPoseOverlayTags({...this.playoutInfo||{}}).then($=>{this.__poseOverlayTags=$,this.__showOverlay=!0}).catch($=>this.Log($,!0)),this.playerOptions.playerCallback&&this.playerOptions.playerCallback({player:this,videoElement:this.video,hlsPlayer:this.hlsPlayer,dashPlayer:this.dashPlayer}),this.__destroyed&&this.__DestroyPlayer(),this.initialized=!0,this.restartParameters=void 0,this.thumbnailTrackUrl&&(this.thumbnailHandler=new Eee(this.thumbnailTrackUrl,x||b||0),this.thumbnailHandler.LoadThumbnails().then(()=>{this.thumbnailsLoaded=!0,this.__SettingsUpdate()}))}catch(a){let s;if(a&&[401,403].includes(a.status)||[401,403].includes(a.code))try{const u=await this.__Client(),o=this.sourceOptions.playoutParameters.linkPath?await u.LinkTarget({...this.sourceOptions.playoutParameters}):this.sourceOptions.playoutParameters.versionHash||await u.LatestVersionHash({objectId:this.sourceOptions.playoutParameters.objectId});s=await u.ContentObjectMetadata({versionHash:o,metadataSubtree:"public/asset_metadata/permission_message",authorizationToken:this.sourceOptions.playoutParameters.authorizationToken}),s?(a.permission_message=s,this.SetErrorMessage(s,a),typeof a=="object"?a.permission_message=s:this.Log(s,!0)):this.SetErrorMessage(a.displayMessage||"Insufficient permissions",a)}catch(u){this.SetErrorMessage(u.displayMessage||"Insufficient permissions",u)}else a.status>=500?this.__HardReload(a,1e4):this.__HardReload(a,2e4);this.playerOptions.errorCallback&&this.playerOptions.errorCallback(a,this)}finally{this.loading=!1,this.__SettingsUpdate()}}}async __InitializeHLS({playoutUrl:e,authorizationToken:t,drm:a,drms:s,multiviewOptions:u}){this.HLS=(await Promise.resolve().then(()=>require("./hls-DM9gWZ70.js"))).default;const o=this.video.canPlayType("application/vnd.apple.mpegURL");if(o&&Aee&&this.playerOptions.preferNativeHLS||[Gt.drms.FAIRPLAY,Gt.drms.SAMPLE_AES].includes(a)||!this.HLS.isSupported()){if(this.nativeHLS=!0,a===Gt.drms.FAIRPLAY?Fq({playoutOptions:this.sourceOptions.playoutOptions,video:this.video}):this.video.src=e.toString(),u.enabled){const c=u.SwitchView;u.SwitchView=async p=>{await c(p)}}}else{e.searchParams.delete("authorization");let c={};(a===Gt.drms.PLAYREADY||a===Gt.drms.WIDEVINE)&&(c={drmSystems:{},emeEnabled:!0,licenseXhrSetup:(m,v)=>{m.open("POST",v,!0),m.setRequestHeader("Authorization",`Bearer ${t}`)}},a===Gt.drms.PLAYREADY?c.drmSystems={"com.microsoft.playready":{licenseUrl:s[a].licenseServers[0]}}:a===Gt.drms.WIDEVINE&&(c.drmSystems={"com.widevine.alpha":{licenseUrl:s[a].licenseServers[0]}}));let p=(kee[this.playerOptions.playerProfile]||{}).hlsSettings||{};const d=this.playerOptions.playerProfile===Gt.playerProfile.CUSTOM?this.customHLSOptions:{};this.sourceOptions.playoutParameters&&this.sourceOptions.playoutParameters.channel&&Object.keys(d).length===0&&(p.maxBufferHole=4.2),this.hlsOptions={capLevelToPlayerSize:this.playerOptions.capLevelToPlayerSize,xhrSetup:m=>(m.setRequestHeader("Authorization",`Bearer ${t}`),(this.playerOptions.hlsjsOptions||{}).xhrSetup&&this.playerOptions.hlsjsOptions.xhrSetup(m),m),...c,...p,...d},this.dvrAvailable&&(delete this.hlsOptions.liveMaxLatencyDuration,delete this.hlsOptions.liveMaxLatencyDurationCount);const y=new this.HLS(this.hlsOptions);if(this.playerOptions.maxBitrate&&y.on(this.HLS.Events.MANIFEST_PARSED,(m,{levels:v,firstLevel:b})=>{let x=v.map((E,C)=>E.bitrate>this.playerOptions.maxBitrate?C:void 0).filter(E=>typeof E<"u").reverse();x.length===v.length&&(this.Log(`Warning: Max bitrate '${this.playerOptions.maxBitrate}bps' is less than all available levels for this content.`),x=x.filter(E=>E>0)),this.Log("Removing the following levels due to maxBitrate setting:"),this.Log(x.map(E=>[v[E].width,"x",v[E].height,` (${(v[E].bitrate/1e3/1e3).toFixed(1)}Mbps)`].join("")).join(", ")),x.find(E=>b===E)&&(y.startLevel=v.map((E,C)=>C).filter(E=>!x.includes(E)).reverse()[0]),x.map(E=>y.removeLevel(E))}),this.playerOptions.minBitrate&&y.on(this.HLS.Events.MANIFEST_PARSED,(m,{levels:v,firstLevel:b})=>{let x=v.map((E,C)=>E.bitrate<this.playerOptions.minBitrate?C:void 0).filter(E=>typeof E<"u");x.length===v.length&&(this.Log(`Warning: Min bitrate '${this.playerOptions.minBitrate}bps' is greater than all available levels for this content.`),x=x.slice(0,-1)),this.Log("Removing the following levels due to minBitrate setting:"),this.Log(x.map(E=>[v[E].width,"x",v[E].height,` (${(v[E].bitrate/1e3/1e3).toFixed(1)}Mbps)`].join("")).join(", ")),x.find(E=>b===E)&&(y.startLevel=v.map((E,C)=>C).filter(E=>!x.includes(E)).reverse()[0]),x.reverse().map(E=>y.removeLevel(E))}),y.loadSource(e.toString()),y.attachMedia(this.video),this.controls&&u.enabled){const m=u.SwitchView;u.SwitchView=async v=>{await m(v),y.nextLevel=y.currentLevel},this.controls.InitializeMultiViewControls(u)}if([this.HLS.Events.SUBTITLE_TRACKS_UPDATED,this.HLS.Events.SUBTITLE_TRACK_SWITCH,this.HLS.Events.LEVEL_UPDATED,this.HLS.Events.LEVEL_SWITCHED,this.HLS.Events.AUDIO_TRACKS_UPDATED,this.HLS.Events.AUDIO_TRACK_SWITCHED,this.HLS.Events.MANIFEST_LOADED].map(m=>y.on(m,()=>this.__SettingsUpdate())),typeof this.sourceOptions.playoutParameters.audioTrackLabel<"u"&&y.on(this.HLS.Events.AUDIO_TRACKS_UPDATED,()=>{const m=(this.controls.GetAudioTracks().options||[]).find(v=>v.label===this.sourceOptions.playoutParameters.audioTrackLabel);m&&this.controls.SetAudioTrack(m.index)}),this.SetPlayerProfile=async({profile:m,customHLSOptions:v={}})=>{if(this.playoutUrl&&this.playoutUrl.includes("hls-widevine")){this.__UpdateParameters({playerOptions:{playerProfile:m,hlsjsOptions:v}}),this.__ReloadComponent();return}this.videoDuration=void 0,this.playerOptions.playerProfile=m,this.customHLSOptions=v;const b=!this.video.paused,x=this.video.currentTime;try{this.hlsPlayer.destroy()}catch(E){this.Log("Failed to destroy HLS player",!0),this.Log(E,!0)}await this.__InitializeHLS({playoutUrl:e,authorizationToken:t,drm:a,drms:s,multiviewOptions:u}),b?this.video.play():this.video.pause(),this.isLive||(this.video.currentTime=x)},y.on(this.HLS.Events.FRAG_LOADED,()=>{this.errors=0,clearTimeout(this.stallTimeout)}),y.on(this.HLS.Events.ERROR,async(m,v)=>{if(this.errors+=1,this.Log(`Encountered ${v.details}`,!0),this.Log(v,!0),v.response&&v.response.code===403)this.SetErrorMessage("Insufficient permissions",v);else if(this.errors<5){if(v.fatal)v.data&&v.data.type===this.HLS.ErrorTypes.MEDIA_ERROR?(this.Log("Attempting to recover using hlsPlayer.recoverMediaError",!0),y.recoverMediaError()):this.__HardReload(v);else if(v.details==="bufferStalledError"){clearTimeout(this.stallTimeout);let b=this.video&&this.video.currentTime;this.stallTimeout=setTimeout(()=>{this.video&&this.video.currentTime>b||(this.Log("Buffer Stalled. Attempting to recover using hlsPlayer.recoverMediaError",!0),y.recoverMediaError(),this.stallTimeout=setTimeout(()=>{this.Log("Buffer Stalled. Reloading player...",!0),this.__HardReload(v,0,b)},6e3))},6e3)}}else this.__HardReload(v)}),this.hlsPlayer=y,this.player=y,o){const m=document.createElement("source");m.src=this.playoutUrl.toString(),this.video.appendChild(m),this.video.disableRemotePlayback=!1}}}async __InitializeDash({playoutUrl:e,authorizationToken:t,drm:a,drms:s}){this.Dash=(await Promise.resolve().then(()=>require("./dash.all.min-27fvn-N6.js"))).MediaPlayer;const u=this.Dash().create(),o=this.playerOptions.dashjsOptions||{};if(u.updateSettings({...o,streaming:{buffer:{fastSwitchEnabled:!0,flushBufferAtTrackSwitch:!0,...(o.streaming||{}).buffer||{}},text:{defaultEnabled:!1,...(o.streaming||{}).text||{}},...o.streaming||{}}}),this.playerOptions.capLevelToPlayerSize&&u.updateSettings({streaming:{abr:{limitBitrateByPortal:!0}}}),this.playerOptions.maxBitrate&&u.updateSettings({streaming:{abr:{maxBitrate:{video:this.playerOptions.maxBitrate/1e3}}}}),this.playerOptions.minBitrate&&u.updateSettings({streaming:{abr:{minBitrate:{video:this.playerOptions.minBitrate/1e3}}}}),e.searchParams.delete("authorization"),u.addRequestInterceptor(function(c){return c.headers.Authorization=`Bearer ${t}`,c}),a===Gt.drms.WIDEVINE){const c=s.widevine.licenseServers[0];u.setProtectionData({"com.widevine.alpha":{serverURL:c}})}u.initialize(this.video,e.toString(),this.playerOptions.autoplay===Gt.autoplay.ON),[this.Dash.events.TRACK_CHANGE_RENDERED,this.Dash.events.QUALITY_CHANGE_RENDERED,this.Dash.events.REPRESENTATION_SWITCH,this.Dash.events.TEXT_TRACKS_ADDED,this.Dash.events.TEXT_TRACK_ADDED,this.Dash.events.MANIFEST_LOADED,this.Dash.events.CAN_PLAY].map(c=>u.on(c,()=>this.__SettingsUpdate())),typeof this.sourceOptions.playoutParameters.audioTrackLabel<"u"&&u.on(this.Dash.events.CAN_PLAY,()=>{const c=(this.controls.GetAudioTracks().options||[]).find(p=>p.label===this.sourceOptions.playoutParameters.audioTrackLabel);c&&this.controls.SetAudioTrack(c.index)}),this.video.textTracks.addEventListener("change",()=>this.__SettingsUpdate()),this.player=u,this.dashPlayer=u}async __Play(){try{return await this.video.play(),!0}catch(e){if(e&&(e.toString()||"").includes("AbortError"))return!1;if(this.Log("Unable to autoplay",!0),this.Log(e,!0),this.playbackStarted=!1,this.playerOptions.muted===Gt.muted.OFF_IF_POSSIBLE&&this.video.paused&&!this.video.muted){await new Promise(t=>setTimeout(t,250)),this.Log("Attempting to autoplay muted"),this.video.muted=!0;try{return await this.video.play(),!0}catch{return this.playbackStarted=!1,!1}}else return this.playbackStarted=!1,!1}}async __PublicMetadataUrl({versionHash:e,authorizationToken:t}){const a=await this.__Client();let s=!1;try{await a.ContentObjectMetadata({versionHash:e,metadataSubtree:"/public/name",noAuth:!0})}catch{s=!0}let u=new URL((await a.NetworkInfo()).name==="demov3"?"https://demov3.net955210.contentfabric.io":"https://main.net955305.contentfabric.io"),o=`s/${a.NetworkInfo().name}`;return s&&(o=`t/${t}`),u.pathname=`${o}/q/${e}/meta/public`,u.toString()}async __VerifyContent(){if(!this.contentHash)return;const e=await this.__Client(),t=this.isLive?await e.AuditStream({versionHash:this.contentHash,authorizationToken:this.authorizationToken}):await e.AuditContentObject({versionHash:this.contentHash,authorizationToken:this.authorizationToken});if(!t.verified)return;t.verifiedAt=Date.now();const a=e.utils.DecodeVersionHash(this.contentHash).objectId;t.details={_state:"initial",versionHash:this.contentHash,objectId:a,address:e.utils.HashToAddress(a),signatureMethod:"ECDSA secp256k1"},this.contentAudit=t,this.contentVerified=t.verified,this.publicMetadataUrl=await this.__PublicMetadataUrl({versionHash:this.contentHash,authorizationToken:this.authorizationToken}),this.__SettingsUpdate()}async __LoadVerificationDetails(){if(!this.contentHash||!this.contentAudit||this.contentAudit.details._state!=="initial"||this.contentAudit.loading)return;this.contentAudit.loading=!0;const e=await this.__Client(),t=e.utils.DecodeVersionHash(this.contentHash).objectId,a=await e.ContentObjectTenantId({objectId:t}),s=await e.ContentSpaceId();let u,o,c;try{o=await e.CallContractMethod({contractAddress:e.utils.HashToAddress(t),methodName:"objectTimestamp"}),o&&(o=new Date(parseInt(o._hex,16)*1e3)),c=await e.CallContractMethod({contractAddress:e.utils.HashToAddress(t),methodName:"countVersionHashes"}),c&&(c=parseInt(c._hex,16))}catch{}try{u=await e.ContentObjectMetadata({libraryId:s.replace("ispc","ilib"),objectId:a.replace("iten","iq__"),metadataSubtree:"/public/name"})}catch{}this.contentAudit.details={_state:"minus-tx",versionHash:this.contentHash,objectId:t,address:e.utils.HashToAddress(t),explorerUrl:e.NetworkInfo().name!=="main"?void 0:`https://explorer.contentfabric.io/address/${e.utils.HashToAddress(t)}`,tenantId:a,tenantAddress:e.utils.HashToAddress(a),tenantName:u,ownerAddress:await e.ContentObjectOwner({objectId:t}),lastCommittedAt:o,versionCount:c,latestVersionHash:await e.LatestVersionHash({objectId:t}),signatureMethod:"ECDSA secp256k1"},this.__SettingsUpdate();try{if(e.NetworkInfo().name==="main"){const p=new URL("https://explorer.contentfabric.io/api");p.searchParams.set("module","account"),p.searchParams.set("action","txlist"),p.searchParams.set("offset","1"),p.searchParams.set("address",e.utils.HashToAddress(t)),this.contentAudit.details.latestTransactionHash=(await(await fetch(p)).json()).result[0].hash,this.contentAudit.details.latestTransactionHashUrl=`https://explorer.contentfabric.io/tx/${this.contentAudit.details.latestTransactionHash}`}}catch{}finally{this.contentAudit.details._state="full",delete this.contentAudit.loading,this.__SettingsUpdate()}}__SettingsUpdate(){this.__settingsListeners.forEach(e=>{try{e()}catch(t){this.Log("Failed to call settings listener",!0),this.Log(t,!0)}})}__SetControlsVisibility(e){this.controls.visible!==e&&(this.controls.visible=e,this.__SettingsUpdate())}__DestroyPlayer(){this.castHandler&&this.castHandler.Destroy(),this.__destroyed=!0,this.__Reset()}__Reset(){if(this.player){this.Log("Destroying player"),this.video&&this.video.pause();try{this.hlsPlayer?this.hlsPlayer.destroy():this.dashPlayer&&this.dashPlayer.destroy()}catch(e){this.Log("Failed to destroy abr player",!0),this.Log(e,!0)}if(this.__listenerDisposers.forEach(e=>{try{e()}catch(t){this.Log("Failed to dispose of video event listener",!0),this.Log(t,!0)}}),this.__settingsListeners=[],this.__listenerDisposers=[],this.__showPlayerProfileForm=!1,this.video.mux)try{this.video.mux.destroy()}catch(e){this.Log("Error destroying mux monitoring:"),this.Log(e)}this.contentHash=void 0,this.nativeHLS=!1,this.hlsPlayer=void 0,this.dashPlayer=void 0,this.player=void 0,this.initTimeLogged=!1,this.playoutUrl=void 0,this.thumbnailTrackUrl=void 0,this.thumbnailHandler=void 0,this.thumbnailsLoaded=void 0,this.canPlay=!1,this.isLive=!1,this.behindLiveEdge=!1,this.dvrAvailable=!1,this.dvrEnabled=!1,this.publicMetadataUrl=void 0,this.airplayAvailable=!1,this.chromecastAvailable=fL&&this.playerOptions.allowCasting,this.casting=!1,this.__error=void 0,this.__chapterTags=void 0,this.playoutInfo=void 0}}async __HardReload(e,t=6e3,a){if(!this.reloading){if(this.reloading=!0,this.reloads+=1,this.reloads>10){this.SetErrorMessage(e&&e.displayMessage||"Unable to play content",e);return}this.playoutUrl&&this.playoutUrl.includes("hls-widevine")&&this.__ReloadComponent();try{if(e&&this.playerOptions.restartCallback)try{const s=await this.playerOptions.restartCallback(e);if(s&&typeof s=="boolean"){this.Destroy();return}}catch(s){this.Log("Restart callback failed:"),this.Log(s)}if(t>0&&(this.SetErrorMessage(e&&e.displayMessage||"Something went wrong, reloading player...",e),await new Promise(s=>setTimeout(s,t))),this.__destroyed)return;this.Log("Reloading stream");try{const s=await this.__Client();s.region?await s.UseRegion({region:s.region}):s.Nodes().fabricURIs.length>1&&await s.ResetRegion()}catch(s){this.Log("Client region reset failed:"),this.Log(s)}this.restarted=!0,this.SetErrorMessage(void 0),this.__Initialize(this.originalParameters,!this.video||!this.initialized?this.restartParameters:{muted:this.video.muted,volume:this.video.volume,currentTime:a||this.video.currentTime,playing:!this.video.paused})}finally{this.reloading=!1}}}Log(e,t=!1){t?console.error("ELUVIO PLAYER:",e):this.playerOptions.debugLogging&&console.warn("ELUVIO PLAYER:",e)}__SetCasting(e){e&&(this.controls.SetDVREnabled(!1),this.controls.Pause()),this.casting=e,this.__SettingsUpdate()}async __LoadChapters({objectId:e,offering:t,compositionKey:a,clipStart:s,clipEnd:u}){const{tracks:o}=await this.__QueryAIAPI({objectId:e,path:sp("/tagstore",e,"tracks"),format:"JSON"});if(o.find(c=>c.name==="chapter"))return((await this.__QueryAIAPI({objectId:e,path:t||a?sp("/tagstore",e,"compositions","tags"):sp("/tagstore",e,"tags"),queryParams:{channel_key:a,offering_key:t,limit:1e6,track:"chapter",clip_start:s,clip_end:u},format:"JSON"})).tags||[]).filter(c=>typeof c.start_time<"u"&&typeof c.tag=="string").sort((c,p)=>c.start_time<p.start_time?-1:1).map(c=>({...c,start_time:c.start_time/1e3,end_time:c.end_time/1e3})).map((c,p,d)=>({...c,end_time:(d[p+1]||{}).start_time||c.end_time}))}async __LoadPoseOverlayTags({objectId:e,offering:t,compositionKey:a,clipStart:s,clipEnd:u}){const{tracks:o}=await this.__QueryAIAPI({objectId:e,path:sp("/tagstore",e,"tracks"),queryParams:{has_frame_info:!0},format:"JSON"});if(!o.find(p=>p.name==="pose"))return;let c={};return((await this.__QueryAIAPI({objectId:e,path:t||a?sp("/tagstore",e,"compositions","tags"):sp("/tagstore",e,"tags"),queryParams:{has_frame_info:!0,channel_key:a,offering_key:t,limit:1e6,track:"pose",clip_start:s,clip_end:u},format:"JSON"})).tags||[]).forEach(p=>{const d=parseInt(p.frame_info.frame_idx);c[d]||(c[d]=[]),c[d].push(p)}),c}async __QueryAIAPI({server:e="ai",method:t="GET",path:a,objectId:s,queryParams:u={},body:o,stringifyBody:c=!0,authTokenInBody:p=!1,headers:d={},format:y="json",allowStatus:m=[]}){const v=new URL(`https://${e}.contentfabric.io/`);v.pathname=a,Object.keys(u).forEach(C=>u[C]&&v.searchParams.set(C,u[C]));const b=await this.__Client(),x=(this.sourceOptions.playoutParameters||{}).authorizationToken||new URL(await b.FabricUrl({versionHash:await b.LatestVersionHash({objectId:s}),channelAuth:!0})).searchParams.get("authorization");v.searchParams.set("authorization",x),p&&(o.append?o.append("authorization",x):o.authorization=x),o&&c&&(o=JSON.stringify(o));const E=await fetch(v,{method:t,headers:d,body:o});if(E.status>=400&&!m.includes(E.status))throw E;if(E.status!==204)return y?await b.utils.ResponseToFormat(y,E):E}}Yw.EluvioPlayerParameters=Gt;Yw.EluvioPlayer=Yw;var rD=(function(){if(typeof Map<"u")return Map;function n(e,t){var a=-1;return e.some(function(s,u){return s[0]===t?(a=u,!0):!1}),a}return(function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(t){var a=n(this.__entries__,t),s=this.__entries__[a];return s&&s[1]},e.prototype.set=function(t,a){var s=n(this.__entries__,t);~s?this.__entries__[s][1]=a:this.__entries__.push([t,a])},e.prototype.delete=function(t){var a=this.__entries__,s=n(a,t);~s&&a.splice(s,1)},e.prototype.has=function(t){return!!~n(this.__entries__,t)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,a){a===void 0&&(a=null);for(var s=0,u=this.__entries__;s<u.length;s++){var o=u[s];t.call(a,o[1],o[0])}},e})()})(),gA=typeof window<"u"&&typeof document<"u"&&window.document===document,Qw=(function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()})(),Tee=(function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Qw):function(n){return setTimeout(function(){return n(Date.now())},1e3/60)}})(),Mee=2;function Ree(n,e){var t=!1,a=!1,s=0;function u(){t&&(t=!1,n()),a&&c()}function o(){Tee(u)}function c(){var p=Date.now();if(t){if(p-s<Mee)return;a=!0}else t=!0,a=!1,setTimeout(o,e);s=p}return c}var Oee=20,Lee=["top","right","bottom","left","width","height","size","weight"],Nee=typeof MutationObserver<"u",Pee=(function(){function n(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=Ree(this.refresh.bind(this),Oee)}return n.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},n.prototype.removeObserver=function(e){var t=this.observers_,a=t.indexOf(e);~a&&t.splice(a,1),!t.length&&this.connected_&&this.disconnect_()},n.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},n.prototype.updateObservers_=function(){var e=this.observers_.filter(function(t){return t.gatherActive(),t.hasActive()});return e.forEach(function(t){return t.broadcastActive()}),e.length>0},n.prototype.connect_=function(){!gA||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Nee?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},n.prototype.disconnect_=function(){!gA||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},n.prototype.onTransitionEnd_=function(e){var t=e.propertyName,a=t===void 0?"":t,s=Lee.some(function(u){return!!~a.indexOf(u)});s&&this.refresh()},n.getInstance=function(){return this.instance_||(this.instance_=new n),this.instance_},n.instance_=null,n})(),aD=(function(n,e){for(var t=0,a=Object.keys(e);t<a.length;t++){var s=a[t];Object.defineProperty(n,s,{value:e[s],enumerable:!1,writable:!1,configurable:!0})}return n}),N0=(function(n){var e=n&&n.ownerDocument&&n.ownerDocument.defaultView;return e||Qw}),iD=F_(0,0,0,0);function Xw(n){return parseFloat(n)||0}function dL(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.reduce(function(a,s){var u=n["border-"+s+"-width"];return a+Xw(u)},0)}function Iee(n){for(var e=["top","right","bottom","left"],t={},a=0,s=e;a<s.length;a++){var u=s[a],o=n["padding-"+u];t[u]=Xw(o)}return t}function Dee(n){var e=n.getBBox();return F_(0,0,e.width,e.height)}function Uee(n){var e=n.clientWidth,t=n.clientHeight;if(!e&&!t)return iD;var a=N0(n).getComputedStyle(n),s=Iee(a),u=s.left+s.right,o=s.top+s.bottom,c=Xw(a.width),p=Xw(a.height);if(a.boxSizing==="border-box"&&(Math.round(c+u)!==e&&(c-=dL(a,"left","right")+u),Math.round(p+o)!==t&&(p-=dL(a,"top","bottom")+o)),!Bee(n)){var d=Math.round(c+u)-e,y=Math.round(p+o)-t;Math.abs(d)!==1&&(c-=d),Math.abs(y)!==1&&(p-=y)}return F_(s.left,s.top,c,p)}var Fee=(function(){return typeof SVGGraphicsElement<"u"?function(n){return n instanceof N0(n).SVGGraphicsElement}:function(n){return n instanceof N0(n).SVGElement&&typeof n.getBBox=="function"}})();function Bee(n){return n===N0(n).document.documentElement}function zee(n){return gA?Fee(n)?Dee(n):Uee(n):iD}function jee(n){var e=n.x,t=n.y,a=n.width,s=n.height,u=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,o=Object.create(u.prototype);return aD(o,{x:e,y:t,width:a,height:s,top:t,right:e+a,bottom:s+t,left:e}),o}function F_(n,e,t,a){return{x:n,y:e,width:t,height:a}}var qee=(function(){function n(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=F_(0,0,0,0),this.target=e}return n.prototype.isActive=function(){var e=zee(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},n.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},n})(),Hee=(function(){function n(e,t){var a=jee(t);aD(this,{target:e,contentRect:a})}return n})(),Vee=(function(){function n(e,t,a){if(this.activeObservations_=[],this.observations_=new rD,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=a}return n.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof N0(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new qee(e)),this.controller_.addObserver(this),this.controller_.refresh())}},n.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof N0(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},n.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},n.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},n.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(a){return new Hee(a.target,a.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},n.prototype.clearActive=function(){this.activeObservations_.splice(0)},n.prototype.hasActive=function(){return this.activeObservations_.length>0},n})(),sD=typeof WeakMap<"u"?new WeakMap:new rD,oD=(function(){function n(e){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=Pee.getInstance(),a=new Vee(e,t,this);sD.set(this,a)}return n})();["observe","unobserve","disconnect"].forEach(function(n){oD.prototype[n]=function(){var e;return(e=sD.get(this))[n].apply(e,arguments)}});var Gee=(function(){return typeof Qw.ResizeObserver<"u"?Qw.ResizeObserver:oD})();const B_=({element:n,Hide:e})=>{if(!n)return;const t=u=>{u&&(u.key||"").toLowerCase()==="escape"&&e()},a=u=>{n.contains(u.target)||e()};let s=setTimeout(()=>{document.body.addEventListener("keydown",t),document.body.addEventListener("click",a,!0)},0);return()=>{clearTimeout(s),document.body.removeEventListener("keydown",t),document.body.removeEventListener("click",a,!0)}},uD=({player:n,setVideoState:e})=>{const t=function(){if(!n||!n.controls)return;const u=n.video.buffered;let o=0;for(let c=0;c<u.length;c++)u.start(c)>n.controls.GetCurrentTime()||u.end(c)>o&&(o=u.end(c));e({playing:n.controls.IsPlaying(),duration:n.controls.GetDuration(),volume:n.controls.GetVolume(),muted:n.controls.IsMuted(),rate:n.controls.GetPlaybackRate(),fullscreen:!!(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)})},a=["play","pause","volumechange","seeked","durationchange","ratechange"];a.map(u=>n.video.addEventListener(u,t)),n.target.addEventListener("fullscreenchange",t);const s=n.castHandler&&n.castHandler.RegisterListener(t);return()=>{a.map(u=>n.video.removeEventListener(u,t)),n.target.removeEventListener("fullscreenchange",t),s&&s()}},$ee=({video:n,setBufferFraction:e})=>{const t=()=>{if(!isFinite(n.duration))return 1;const a=n.buffered;let s=0;for(let u=0;u<a.length;u++)a.start(u)>n.currentTime||a.end(u)>s&&(s=a.end(u));e(1-(n.duration-s)/n.duration)};return n.addEventListener("progress",t),()=>n.removeEventListener("progress",t)},E5=({player:n,rate:e=10,setCurrentTime:t})=>{const a=setInterval(()=>{n.controls&&t(n.controls.GetCurrentTime())},1e3/e);return()=>{clearInterval(a)}},Wee=({target:n,setSize:e,setOrientation:t,setDimensions:a})=>{let s;const u=()=>{clearTimeout(s);const c=n.getBoundingClientRect();let p="sm",d="landscape";c.width>1400&&c.height>600?p="xl":c.width>1e3&&c.height>400?p="lg":c.width>650&&c.height>300&&(p="md"),c.width<c.height&&(d="portrait"),e(p),t(d),s=setTimeout(()=>{a({width:c.width,height:c.height})},500)};u();const o=new Gee(u);return o.observe(n),()=>o.disconnect()},Kee=({player:n})=>{const e=n.video,t=n.playerOptions.autoplay===Gt.autoplay.WHEN_VISIBLE,a=n.playerOptions.muted===Gt.muted.WHEN_NOT_VISIBLE;if(!t&&!a)return;let s,u;const o=async([p])=>{t&&(s!=="play"&&p.isIntersecting&&e.paused?(n.controls.Play(),s="play"):s!=="pause"&&!p.isIntersecting&&!e.paused&&(n.controls.Pause(),s="pause")),a&&(u!=="unmute"&&p.isIntersecting&&e.muted?(e.muted=!1,u="unmute"):u!=="mute"&&!p.isIntersecting&&!e.muted&&(e.muted=!0,u="mute"))},c=new window.IntersectionObserver(o,{threshold:.1}).observe(e);return()=>c&&c.disconnect()},Jee=({player:n,inactivityPeriod:e=3e3,onSleep:t,onWake:a})=>{let s;const u=p=>{clearTimeout(s),a&&a(),s=setTimeout(()=>{t&&t()},p.type==="mouseout"?500:e)},o=["play","pause","volumechange","seeking"];o.forEach(p=>n.video.addEventListener(p,u));const c=["click","dblclick","keydown","mousemove","touchmove","blur","fullscreenchange"];return c.forEach(p=>n.target.addEventListener(p,u)),()=>{o.map(p=>n.video.removeEventListener(p,u)),c.map(p=>n.target.removeEventListener(p,u))}},Yee=({player:n,setRecentUserAction:e})=>{if(n.playerOptions.keyboardControls===Gt.keyboardControls.OFF)return;const t=n.playerOptions.keyboardControls===Gt.keyboardControls.ARROW_KEYS_DISABLED,a=tD(n,e)(),s=u=>{if(!(n.target===u.target||n.target.contains(u.target))||["button","input"].includes(document.activeElement&&document.activeElement.tagName.toLowerCase())||n.__showPlayerProfileForm)return;let o;switch(u.key){case" ":case"k":o=n.controls.TogglePlay(),e({action:o?Un.PLAY:Un.PAUSE});break;case"f":n.controls.ToggleFullscreen();break;case"m":o=n.controls.ToggleMuted(),e({action:o?Un.MUTE:Un.UNMUTE});break;case"ArrowDown":t||(o=n.controls.SetVolume({relativeFraction:-.1}),e({action:o===0?Un.MUTE:Un.VOLUME_DOWN,text:(o*100).toFixed(0)+"%"}));break;case"ArrowUp":t||(o=n.controls.SetVolume({relativeFraction:.1}),e({action:Un.VOLUME_UP,text:(o*100).toFixed(0)+"%"}));break;case",":n.video.paused&&(n.controls.Seek({relativeSeconds:-1/60}),e({action:Un.SEEK_BACK}));break;case".":n.video.paused&&(n.controls.Seek({relativeSeconds:1/60}),e({action:Un.SEEK_FORWARD}));break;case"ArrowLeft":case"ArrowRight":t||a(u);break;case"j":n.controls.Seek({relativeSeconds:-10}),e({action:Un.SEEK_BACK,text:"10 seconds"});break;case"l":n.controls.Seek({relativeSeconds:10}),e({action:Un.SEEK_FORWARD,text:"10 seconds"});break;case"<":case">":const c=n.controls.GetPlaybackRates();c.active?o=n.controls.SetPlaybackRate({index:c.active.index+(u.key==="<"?-1:1)}):o=n.controls.SetPlaybackRate({rate:1}),o&&e({action:o.increase?Un.PLAYBACK_RATE_UP:Un.PLAYBACK_RATE_DOWN,text:`${o.rate.toFixed(2)}x`});break;case"c":o=n.controls.ToggleTextTrack(),e({action:o?Un.SUBTITLES_ON:Un.SUBTITLES_OFF});break;case"P":n.controls.CollectionPlayPrevious(),e({action:Un.PLAY_PREVIOUS});break;case"N":n.controls.CollectionPlayNext(),e({action:Un.PLAY_NEXT});break;case"Home":n.controls.Seek({fraction:0}),e({action:Un.SEEK_BACK});break;case"End":n.controls.Seek({fraction:1}),e({action:Un.SEEK_FORWARD});break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":o=n.controls.Seek({fraction:parseFloat(u.key)*.1}),e({action:o?Un.SEEK_FORWARD:Un.SEEK_BACK});break;default:return}u.preventDefault()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},Qee=({player:n})=>{if("mediaSession"in navigator){const e=["play","pause","stop","seekbackward","seekforward","seekto","previoustrack","nexttrack"];e.forEach(s=>{navigator.mediaSession.setActionHandler(s,u=>{switch(s){case"play":n.controls.Play();break;case"pause":n.controls.Pause();break;case"stop":n.controls.Stop();break;case"seekbackward":n.controls.Seek({relativeSeconds:u&&u.seekOffset||-10});break;case"seekforward":n.controls.Seek({relativeSeconds:u&&u.seekOffset||10});break;case"seekto":u&&typeof u.seekTime<"u"&&n.controls.Seek({time:u.seekTime});break;case"previoustrack":n.controls.CollectionPlayPrevious();break;case"nexttrack":n.controls.CollectionPlayNext();break}})});let t=setInterval(()=>{navigator.mediaSession.playbackState=n.video.paused?"paused":"playing",navigator.mediaSession.setPositionState({duration:isFinite(n.video.duration)?n.video.duration||0:n.video.currentTime+1,playbackRate:n.video.playbackRate,position:n.video.currentTime})},1e3);const a=n.controls.RegisterSettingsListener(()=>{const{title:s}=n.controls.GetContentInfo()||{};(!navigator.mediaSession.metadata||navigator.mediaSession.metadata.title!==s)&&(navigator.mediaSession.metadata=new MediaMetadata({title:s}))});return()=>{clearInterval(t),a&&a(),navigator.mediaSession.metadata=null,e.forEach(s=>{navigator.mediaSession.setActionHandler(s,null)})}}},Xee="_container_1lc7b_1",Zee="_autohide_1lc7b_40",ete="_seek_1lc7b_177",tte="_controls_1lc7b_210",nte="_time_1lc7b_224",rte="_spacer_1lc7b_282",ate="_watermark_1lc7b_299",Fn={container:Xee,"container--default-controls":"_container--default-controls_1lc7b_32","bottom-controls-container":"_bottom-controls-container_1lc7b_36",autohide:Zee,"info-container":"_info-container_1lc7b_43","bottom-controls-container--autohide":"_bottom-controls-container--autohide_1lc7b_44","floating-volume-toggle":"_floating-volume-toggle_1lc7b_45","icon-button":"_icon-button_1lc7b_51","icon-button-active":"_icon-button-active_1lc7b_65","icon-button--no-padding":"_icon-button--no-padding_1lc7b_71","info-image-container":"_info-image-container_1lc7b_109","info-image":"_info-image_1lc7b_109","info-text":"_info-text_1lc7b_125","info-headers":"_info-headers_1lc7b_134","info-description":"_info-description_1lc7b_144","info-title":"_info-title_1lc7b_150","info-subtitle":"_info-subtitle_1lc7b_155","center-play-button":"_center-play-button_1lc7b_163","center-play-button--hidden":"_center-play-button--hidden_1lc7b_170",seek:ete,"bottom-controls-gradient":"_bottom-controls-gradient_1lc7b_197",controls:tte,"play-pause-button":"_play-pause-button_1lc7b_220",time:nte,"live-indicator":"_live-indicator_1lc7b_234","collection-button-container":"_collection-button-container_1lc7b_252","collection-button-text":"_collection-button-text_1lc7b_257","collection-button-container--loading":"_collection-button-container--loading_1lc7b_266",spacer:rte,watermark:ate,"content-verified-badge":"_content-verified-badge_1lc7b_310","content-verification-menu-button":"_content-verification-menu-button_1lc7b_311","menu-control-container":"_menu-control-container_1lc7b_325"},lD='<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"> <circle cx="16" cy="16" r="16" fill="currentColor"/> <path d="M22 15.5L13.75 21.1292L13.75 9.87083L22 15.5Z" fill="black"/></svg>',cD='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-play"><polygon points="5 3 19 12 5 21 5 3"></polygon></svg>',fD='<?xml version="1.0" encoding="utf-8"?><!-- Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve"><circle cx="16" cy="16" r="16" fill="currentColor"/><path d="M22.8,16l-11.6,7V9L22.8,16z" fill="black"/></svg>',ite='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-pause"><rect x="6" y="4" width="4" height="16"></rect><rect x="14" y="4" width="4" height="16"></rect></svg>',dD='<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="15" cy="15" r="15" fill="currentColor"/><path d="M10 8H14V22H10V8ZM16 8H20V22H16V8Z" fill="black"/></svg>',ste='<svg width="19" height="19" viewBox="0 0 19 19" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1.46154 18.9985L5.84615 18.9942C6.03997 18.9942 6.22584 18.9172 6.36289 18.7801C6.49993 18.6431 6.57692 18.4572 6.57692 18.2634C6.57692 18.0696 6.49993 17.8837 6.36289 17.7467C6.22584 17.6096 6.03997 17.5326 5.84615 17.5326L1.46154 17.537V13.1538C1.46154 12.96 1.38455 12.7742 1.2475 12.6371C1.11046 12.5001 0.924581 12.4231 0.730769 12.4231C0.536957 12.4231 0.351083 12.5001 0.214037 12.6371C0.0769915 12.7742 0 12.96 0 13.1538V19H1.46154V18.9985ZM1.46154 0.00146249V3.57628e-07H0V5.84615C0 6.03997 0.0769915 6.22584 0.214037 6.36289C0.351083 6.49993 0.536957 6.57692 0.730769 6.57692C0.924581 6.57692 1.11046 6.49993 1.2475 6.36289C1.38455 6.22584 1.46154 6.03997 1.46154 5.84615V1.463L5.84615 1.46738C6.03997 1.46738 6.22584 1.39039 6.36289 1.25335C6.49993 1.1163 6.57692 0.930427 6.57692 0.736615C6.57692 0.542803 6.49993 0.35693 6.36289 0.219884C6.22584 0.0828385 6.03997 0.00584609 5.84615 0.00584609L1.46154 0.00146249V0.00146249ZM17.5385 18.9985V19H19V13.1538C19 12.96 18.923 12.7742 18.786 12.6371C18.6489 12.5001 18.463 12.4231 18.2692 12.4231C18.0754 12.4231 17.8895 12.5001 17.7525 12.6371C17.6155 12.7742 17.5385 12.96 17.5385 13.1538V17.537L13.1538 17.5326C12.96 17.5326 12.7742 17.6096 12.6371 17.7467C12.5001 17.8837 12.4231 18.0696 12.4231 18.2634C12.4231 18.4572 12.5001 18.6431 12.6371 18.7801C12.7742 18.9172 12.96 18.9942 13.1538 18.9942L17.5385 18.9985V18.9985ZM17.5385 0.00146249L13.1538 0.00584609C12.96 0.00584609 12.7742 0.0828385 12.6371 0.219884C12.5001 0.35693 12.4231 0.542803 12.4231 0.736615C12.4231 0.930427 12.5001 1.1163 12.6371 1.25335C12.7742 1.39039 12.96 1.46738 13.1538 1.46738L17.5385 1.463V5.84615C17.5385 6.03997 17.6155 6.22584 17.7525 6.36289C17.8895 6.49993 18.0754 6.57692 18.2692 6.57692C18.463 6.57692 18.6489 6.49993 18.786 6.36289C18.923 6.22584 19 6.03997 19 5.84615V3.57628e-07H17.5385V0.00146249V0.00146249Z" fill="currentColor"/></svg>',ote='<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 51.94 50.82"><defs><style>.cls-1{fill:none;stroke:#fff;stroke-linecap:round;stroke-miterlimit:10;stroke-width:4px;}</style></defs><polyline class="cls-1" points="12.1 49.82 12.1 35.59 1 35.59"/><polyline class="cls-1" points="39.84 1 39.84 15.22 50.94 15.22"/><polyline class="cls-1" points="12.1 1 12.1 15.22 1 15.22"/><polyline class="cls-1" points="39.84 49.82 39.84 35.59 50.94 35.59"/></svg>',ute='<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_363_9540)"><path d="M16.0889 9.77734C12.6223 9.77734 9.8667 12.5329 9.8667 15.9996C9.8667 19.4662 12.6223 22.2218 16.0889 22.2218C19.5556 22.2218 22.3111 19.4662 22.3111 15.9996C22.3111 12.5329 19.5556 9.77734 16.0889 9.77734ZM16.0889 20.444C13.6 20.444 11.6445 18.4885 11.6445 15.9996C11.6445 13.5107 13.6 11.5551 16.0889 11.5551C18.5778 11.5551 20.5334 13.5107 20.5334 15.9996C20.5334 18.4885 18.5778 20.444 16.0889 20.444Z" fill="currentColor"/><path d="M29.1556 13.0662L26.6667 12.2662L26.1334 10.9329L27.3778 8.62179C27.6445 8.08845 27.5556 7.37734 27.1112 6.9329L24.9778 4.79957C24.5334 4.35512 23.8223 4.26623 23.2889 4.5329L20.9778 5.77734L19.6445 5.24401L18.8445 2.75512C18.6667 2.22179 18.1334 1.77734 17.5112 1.77734H14.4889C13.8667 1.77734 13.3334 2.22179 13.2445 2.84401L12.4445 5.3329C11.9112 5.42179 11.4667 5.59957 11.0223 5.86623L8.71117 4.62179C8.17783 4.35512 7.46672 4.44401 7.02228 4.88845L4.88894 7.02179C4.4445 7.46623 4.35561 8.17734 4.62228 8.71068L5.77783 10.9329C5.60005 11.3773 5.42228 11.9107 5.2445 12.3551L2.75561 13.1551C2.22228 13.3329 1.77783 13.8662 1.77783 14.4885V17.5107C1.77783 18.1329 2.22228 18.6662 2.8445 18.844L5.33339 19.644L5.86672 20.9773L4.62228 23.2885C4.35561 23.8218 4.4445 24.5329 4.88894 24.9773L7.02228 27.1107C7.46672 27.5551 8.17783 27.644 8.71117 27.3773L11.0223 26.1329L12.3556 26.6662L13.1556 29.244C13.3334 29.7773 13.8667 30.2218 14.4889 30.2218H17.5112C18.1334 30.2218 18.6667 29.7773 18.8445 29.244L19.6445 26.6662L20.9778 26.1329L23.2889 27.3773C23.8223 27.644 24.5334 27.5551 24.9778 27.1107L27.1112 24.9773C27.5556 24.5329 27.6445 23.8218 27.3778 23.2885L26.1334 20.9773L26.6667 19.644L29.2445 18.844C29.7778 18.6662 30.2223 18.1329 30.2223 17.5107V14.4885C30.2223 13.8662 29.7778 13.244 29.1556 13.0662ZM28.4445 17.244L25.2445 18.2218L25.1556 18.6662L24.3556 20.5329L24.0889 20.9773L25.6889 23.9107L23.9112 25.6885L20.9778 24.0885L20.5334 24.3551C19.9112 24.7107 19.2889 24.9773 18.6667 25.1551L18.2223 25.244L17.2445 28.444H14.7556L13.7778 25.244L13.3334 25.1551L11.4667 24.3551L11.0223 24.0885L8.08894 25.6885L6.31117 23.9107L7.91117 20.9773L7.6445 20.5329C7.28894 19.9107 7.02228 19.2885 6.8445 18.6662L6.75561 18.2218L3.55561 17.244V14.7551L6.57783 13.8662L6.75561 13.4218C6.93339 12.7107 7.20005 12.0885 7.55561 11.4662L7.82228 11.0218L6.31117 8.08846L8.08894 6.31068L10.9334 7.91068L11.3778 7.64401C12.0001 7.28846 12.6223 7.02179 13.3334 6.84401L13.7778 6.66623L14.7556 3.55512H17.2445L18.2223 6.66623L18.6667 6.84401C19.2889 7.02179 19.9112 7.28846 20.5334 7.64401L20.9778 7.91068L23.9112 6.31068L25.6889 8.08846L24.0889 11.0218L24.3556 11.4662C24.7112 12.0885 24.9778 12.7107 25.1556 13.3329L25.2445 13.7773L28.4445 14.7551V17.244Z" fill="currentColor"/></g><defs><clipPath id="clip0_363_9540"><rect width="32" height="32" fill="currentColor"/></clipPath></defs></svg>',A5='<?xml version="1.0" encoding="utf-8"?><!-- Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 13 12" style="enable-background:new 0 0 10.2 12;" xml:space="preserve"><path d="M5.3,1.4c0.1,0,0.1,0.1,0.2,0.2c0,0.1,0.1,0.2,0.1,0.2v7.4c0,0.1,0,0.2-0.1,0.2c0,0.1-0.1,0.1-0.2,0.2c-0.1,0-0.2,0.1-0.3,0 c-0.1,0-0.2,0-0.2-0.1L2.6,7.8H0.5c-0.1,0-0.2,0-0.3-0.1C0,7.6,0,7.5,0,7.4V3.7c0-0.1,0-0.2,0.1-0.3c0.1-0.1,0.2-0.1,0.3-0.1h2.1 l2.2-1.7C4.9,1.4,4.9,1.4,5,1.4C5.1,1.4,5.2,1.4,5.3,1.4L5.3,1.4z" fill="currentColor"/><g> <rect x="7.7" y="3.4" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -1.4992 7.4586)" width="1.2" height="4.2" fill="currentColor"/> <rect x="6.1" y="4.9" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -1.5119 7.4281)" width="4.2" height="1.2" fill="currentColor"/></g></svg>',pD='<?xml version="1.0" encoding="utf-8"?><!-- Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 13 12" style="enable-background:new 0 0 10.2 12;" xml:space="preserve"><path d="M7.1,8.5C7.5,8.1,7.8,7.6,8,7.1c0.2-0.5,0.3-1,0.3-1.6C8.3,5,8.2,4.5,8,4C7.8,3.4,7.5,3,7.1,2.6L6.5,3.3 c0.3,0.3,0.5,0.7,0.7,1c0.2,0.4,0.2,0.8,0.2,1.2c0,0.4-0.1,0.8-0.2,1.2C7,7.2,6.8,7.5,6.5,7.8L7.1,8.5z M5.3,1.4 c0.1,0,0.1,0.1,0.2,0.2c0,0.1,0.1,0.2,0.1,0.2v7.4c0,0.1,0,0.2-0.1,0.2c0,0.1-0.1,0.1-0.2,0.2c-0.1,0-0.2,0.1-0.3,0 c-0.1,0-0.2,0-0.2-0.1L2.6,7.8H0.5c-0.1,0-0.2,0-0.3-0.1C0,7.6,0,7.5,0,7.4V3.7c0-0.1,0-0.2,0.1-0.3c0.1-0.1,0.2-0.1,0.3-0.1h2.1 l2.2-1.7C4.9,1.4,4.9,1.4,5,1.4C5.1,1.4,5.2,1.4,5.3,1.4L5.3,1.4z" fill="currentColor"/></svg>',lte='<?xml version="1.0" encoding="utf-8"?><!-- Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 13 12" style="enable-background:new 0 0 10.2 12;" xml:space="preserve"><path d="M8.4,9.8c0.6-0.6,1-1.2,1.3-1.9c0.3-0.7,0.5-1.5,0.5-2.3c0-0.8-0.2-1.6-0.5-2.3C9.4,2.5,9,1.9,8.4,1.3L7.8,2 c0.5,0.5,0.8,1,1.1,1.6c0.3,0.6,0.4,1.3,0.4,1.9c0,0.7-0.1,1.3-0.4,1.9C8.6,8.1,8.2,8.7,7.8,9.1L8.4,9.8z" fill="currentColor"/><path d="M7.1,8.5C7.5,8.1,7.8,7.6,8,7.1c0.2-0.5,0.3-1,0.3-1.6C8.3,5,8.2,4.5,8,4C7.8,3.4,7.5,3,7.1,2.6L6.5,3.3 c0.3,0.3,0.5,0.7,0.7,1c0.2,0.4,0.2,0.8,0.2,1.2c0,0.4-0.1,0.8-0.2,1.2C7,7.2,6.8,7.5,6.5,7.8L7.1,8.5z M5.3,1.4 c0.1,0,0.1,0.1,0.2,0.2c0,0.1,0.1,0.2,0.1,0.2v7.4c0,0.1,0,0.2-0.1,0.2c0,0.1-0.1,0.1-0.2,0.2c-0.1,0-0.2,0.1-0.3,0 c-0.1,0-0.2,0-0.2-0.1L2.6,7.8H0.5c-0.1,0-0.2,0-0.3-0.1C0,7.6,0,7.5,0,7.4V3.7c0-0.1,0-0.2,0.1-0.3c0.1-0.1,0.2-0.1,0.3-0.1h2.1 l2.2-1.7C4.9,1.4,4.9,1.4,5,1.4C5.1,1.4,5.2,1.4,5.3,1.4L5.3,1.4z" fill="currentColor"/></svg>',Zw='<svg width="13" height="12" viewBox="0 0 13 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.71196 11.08C10.4407 10.3533 11.0186 9.4898 11.4125 8.53906C11.8064 7.58832 12.0085 6.56911 12.0072 5.54C12.0085 4.51089 11.8064 3.49168 11.4125 2.54094C11.0186 1.5902 10.4407 0.726679 9.71196 0L9.05933 0.65171C9.7023 1.2929 10.2122 2.05484 10.5598 2.89374C10.9073 3.73264 11.0856 4.63196 11.0845 5.54C11.0845 7.44904 10.3102 9.17741 9.05933 10.4283L9.71196 11.08V11.08Z" fill="currentColor"/><path d="M8.40781 9.77644C8.96502 9.2207 9.40692 8.56034 9.70812 7.83329C10.0093 7.10624 10.1639 6.32683 10.1629 5.53986C10.1639 4.75289 10.0093 3.97349 9.70812 3.24644C9.40692 2.51939 8.96502 1.85902 8.40781 1.30328L7.7561 1.95499C8.22759 2.42525 8.60149 2.98403 8.85634 3.59924C9.11119 4.21445 9.24195 4.87396 9.24112 5.53986C9.2422 6.20586 9.11164 6.8655 8.85694 7.48087C8.60225 8.09625 8.22845 8.65522 7.75703 9.12565L8.40781 9.77644Z" fill="currentColor"/><path d="M7.10429 8.47307C7.49005 8.08831 7.79596 7.6311 8.00446 7.12773C8.21296 6.62436 8.31993 6.08475 8.31922 5.53991C8.31993 4.99507 8.21296 4.45546 8.00446 3.95209C7.79596 3.44872 7.49005 2.99152 7.10429 2.60675L6.45258 3.25846C6.75261 3.55774 6.99054 3.91337 7.15269 4.30489C7.31483 4.69642 7.39801 5.11614 7.39742 5.53991C7.39795 5.96368 7.31476 6.38338 7.15261 6.7749C6.99047 7.16642 6.75257 7.52205 6.45258 7.82136L7.10429 8.47307ZM5.26991 1.43791C5.348 1.47553 5.4139 1.53441 5.46004 1.60778C5.50618 1.68115 5.5307 1.76605 5.53078 1.85272V9.2271C5.53066 9.31383 5.50607 9.39876 5.45984 9.47214C5.4136 9.54551 5.34761 9.60436 5.26943 9.64191C5.19125 9.67945 5.10407 9.69418 5.01789 9.6844C4.93172 9.67462 4.85005 9.64072 4.78228 9.5866L2.60408 7.8444H0.460899C0.338661 7.8444 0.221429 7.79585 0.134994 7.70941C0.0485588 7.62298 0 7.50574 0 7.38351V3.69632C0 3.57408 0.0485588 3.45685 0.134994 3.37041C0.221429 3.28398 0.338661 3.23542 0.460899 3.23542H2.60408L4.78228 1.49322C4.8501 1.43901 4.93185 1.40506 5.01812 1.39527C5.1044 1.38549 5.19168 1.40027 5.26991 1.43791V1.43791Z" fill="currentColor"/></svg>',cte='<svg width="25" height="16" viewBox="0 0 25 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M1.5 8L24 8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M8.5 1L1.5 8L8.5 15" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',pL='<svg width="91" height="92" viewBox="0 0 91 92" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M62.8896 63.918L62.8897 28.2377L34.8552 46.0779L62.8896 63.918Z" fill="currentColor"/><path d="M45.3281 63.918L45.3281 28.2377L17.2937 46.0779L45.3281 63.918Z" fill="currentColor"/></svg>',fte='<svg width="91" height="92" viewBox="0 0 91 92" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="45.2374" cy="45.798" r="45.2374" fill="currentColor"/><path d="M62.8896 63.918L62.8897 28.2377L34.8552 46.0779L62.8896 63.918Z" fill="black"/><path d="M45.3281 63.918L45.3281 28.2377L17.2937 46.0779L45.3281 63.918Z" fill="black"/></svg>',hL='<svg width="91" height="92" viewBox="0 0 91 92" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M26.8555 28.9512V64.6314L54.8899 46.7913L26.8555 28.9512Z" fill="currentColor"/><path d="M44.417 28.9512V64.6314L72.4515 46.7913L44.417 28.9512Z" fill="currentColor"/></svg>',dte='<svg width="91" height="92" viewBox="0 0 91 92" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="45.7169" cy="45.796" r="45.2374" fill="currentColor"/><path d="M26.8555 28.9512V64.6314L54.8899 46.7913L26.8555 28.9512Z" fill="black"/><path d="M44.417 28.9512V64.6314L72.4515 46.7913L44.417 28.9512Z" fill="black"/></svg>',k5='<?xml version="1.0" encoding="utf-8"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30.8 32" style="enable-background:new 0 0 30.8 32;" xml:space="preserve"><g> <path d="M3.1,16L30.8,0v32L3.1,16z" fill="currentColor"/> <rect y="3.7" width="6.2" height="24.6" fill="currentColor"/></g></svg>',T5='<?xml version="1.0" encoding="utf-8"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30.8 32" style="enable-background:new 0 0 30.8 32;" xml:space="preserve"><g> <path d="M27.7,16L0,32V0L27.7,16z" fill="currentColor"/> <rect x="24.6" y="3.7" width="6.2" height="24.6" fill="currentColor"/></g></svg>',pte='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-list"><line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3.01" y2="6"></line><line x1="3" y1="12" x2="3.01" y2="12"></line><line x1="3" y1="18" x2="3.01" y2="18"></line></svg>',op='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"><polyline points="9 18 15 12 9 6"></polyline></svg>',hte='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-check"><polyline points="20 6 9 17 4 12"></polyline></svg>',yte='<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-badge-cc" width="48" height="48" viewBox="0 0 24 24" stroke="black" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <rect x="3" y="5" width="18" height="14" rx="2" stroke="currentColor"></rect> <path d="M10 10.5a1.5 1.5 0 0 0 -3 0v3a1.5 1.5 0 0 0 3 0" stroke="currentColor"></path> <path d="M17 10.5a1.5 1.5 0 0 0 -3 0v3a1.5 1.5 0 0 0 3 0" stroke="currentColor"></path></svg>',mte='<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-badge-cc" width="48" height="48" viewBox="0 0 24 24" stroke="black" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <rect x="3" y="5" width="18" height="14" rx="2" stroke="currentColor"></rect> <path d="M10 10.5a1.5 1.5 0 0 0 -3 0v3a1.5 1.5 0 0 0 3 0" stroke="currentColor"></path> <path d="M17 10.5a1.5 1.5 0 0 0 -3 0v3a1.5 1.5 0 0 0 3 0" stroke="currentColor"></path> <path d="M3 3l18 18" stroke="currentColor"></path></svg>',gte='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-rotate-cw"><polyline points="23 4 23 10 17 10"></polyline><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"></path></svg>',e_='<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15 27.5C15 27.5 25 22.5 25 15V6.25L15 2.5L5 6.25V15C5 22.5 15 27.5 15 27.5Z" stroke="currentColor" stroke-width="2.14286" stroke-linecap="round" stroke-linejoin="round"/><path d="M19.715 11.3574L13.8221 17.8396L11.1436 14.8931" stroke="currentColor" stroke-width="2.14286" stroke-linecap="round" stroke-linejoin="round"/></svg>',yL='<svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M23.7508 12.9997V23.7508H13.0003C7.05943 23.7508 2.24919 18.9406 2.24919 12.9997C2.24919 7.05888 7.05943 2.24864 13.0003 2.24864C18.9411 2.24864 23.7508 7.05888 23.7508 12.9997ZM0 12.9997C0 5.82396 5.82396 0 12.9997 0C20.1755 0 26 5.82396 26 12.9997V25.9995H13.0003C5.82396 25.9995 0 20.1755 0 12.9997ZM5.174 13.5197C5.174 16.1976 6.98078 18.4599 9.85371 18.4599C12.2198 18.4599 13.8185 16.9 14.2084 14.8589H11.8686C11.5698 15.7951 10.8155 16.367 9.85371 16.367C8.39758 16.367 7.44886 15.2227 7.44886 13.5202C7.44886 11.8178 8.39813 10.6735 9.85371 10.6735C10.7899 10.6735 11.5305 11.2066 11.8429 12.0903H14.1959C13.7797 10.1011 12.1941 8.58055 9.85371 8.58055C6.96822 8.58001 5.174 10.8418 5.174 13.5197ZM17.3419 8.83999H15.132V18.2131H17.4331V13.3253C17.4331 12.4022 17.6931 11.8041 18.1349 11.4273C18.5249 11.0761 19.0318 10.8942 19.8642 10.8942H20.4491V8.72256H19.8773C18.668 8.72256 17.8624 9.16442 17.3424 9.8406V8.82633V8.83999H17.3419Z" fill="currentColor"/></svg>',vte='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-copy"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>',hD='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-airplay"><path d="M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1"></path><polygon points="12 15 17 21 7 21 12 15"></polygon></svg>',bte='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-cast"><path d="M2 16.1A5 5 0 0 1 5.9 20M2 12.05A9 9 0 0 1 9.95 20M2 8V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6"></path><line x1="2" y1="20" x2="2.01" y2="20"></line></svg>',wte='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-info"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg>',_te='<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.16602 7.29169H6.45768C6.91792 7.29169 7.29102 6.91859 7.29102 6.45835V5.16669H12.9576V6.45835C12.9576 6.91859 13.3307 7.29169 13.7909 7.29169H15.0826V12.9584H13.7909C13.3307 12.9584 12.9576 13.3314 12.9576 13.7917V15.0834H7.29102V13.7917C7.29102 13.3314 6.91792 12.9584 6.45768 12.9584H5.16602V7.29169Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M3.75 4.14352C3.75 4.03915 3.79146 3.93906 3.86526 3.86526C3.93906 3.79146 4.03915 3.75 4.14352 3.75H6.89815C7.00252 3.75 7.10261 3.79146 7.17641 3.86526C7.25021 3.93906 7.29167 4.03915 7.29167 4.14352V6.89815C7.29167 7.00252 7.25021 7.10261 7.17641 7.17641C7.10261 7.25021 7.00252 7.29167 6.89815 7.29167H4.14352C4.03915 7.29167 3.93906 7.25021 3.86526 7.17641C3.79146 7.10261 3.75 7.00252 3.75 6.89815V4.14352Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M3.75 13.3518C3.75 13.2475 3.79146 13.1474 3.86526 13.0736C3.93906 12.9998 4.03915 12.9583 4.14352 12.9583H6.89815C7.00252 12.9583 7.10261 12.9998 7.17641 13.0736C7.25021 13.1474 7.29167 13.2475 7.29167 13.3518V16.1065C7.29167 16.2108 7.25021 16.3109 7.17641 16.3847C7.10261 16.4585 7.00252 16.5 6.89815 16.5H4.14352C4.03915 16.5 3.93906 16.4585 3.86526 16.3847C3.79146 16.3109 3.75 16.2108 3.75 16.1065V13.3518Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M12.959 13.3518C12.959 13.2475 13.0004 13.1474 13.0742 13.0736C13.148 12.9998 13.2481 12.9583 13.3525 12.9583H16.1071C16.2115 12.9583 16.3116 12.9998 16.3854 13.0736C16.4592 13.1474 16.5007 13.2475 16.5007 13.3518V16.1065C16.5007 16.2108 16.4592 16.3109 16.3854 16.3847C16.3116 16.4585 16.2115 16.5 16.1071 16.5H13.3525C13.2481 16.5 13.148 16.4585 13.0742 16.3847C13.0004 16.3109 12.959 16.2108 12.959 16.1065V13.3518Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M12.959 4.14352C12.959 4.03915 13.0004 3.93906 13.0742 3.86526C13.148 3.79146 13.2481 3.75 13.3525 3.75H16.1071C16.2115 3.75 16.3116 3.79146 16.3854 3.86526C16.4592 3.93906 16.5007 4.03915 16.5007 4.14352V6.89815C16.5007 7.00252 16.4592 7.10261 16.3854 7.17641C16.3116 7.25021 16.2115 7.29167 16.1071 7.29167H13.3525C13.2481 7.29167 13.148 7.25021 13.0742 7.17641C13.0004 7.10261 12.959 7.00252 12.959 6.89815V4.14352Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>';var vA={exports:{}},xte=vA.exports,mL;function Ste(){return mL||(mL=1,(function(n,e){(function(t,a){a()})(xte,(function(){function t(s){var u=!0,o=!1,c=null,p={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function d(R){return!!(R&&R!==document&&R.nodeName!=="HTML"&&R.nodeName!=="BODY"&&"classList"in R&&"contains"in R.classList)}function y(R){var $=R.type,X=R.tagName;return!!(X==="INPUT"&&p[$]&&!R.readOnly||X==="TEXTAREA"&&!R.readOnly||R.isContentEditable)}function m(R){R.classList.contains("focus-visible")||(R.classList.add("focus-visible"),R.setAttribute("data-focus-visible-added",""))}function v(R){R.hasAttribute("data-focus-visible-added")&&(R.classList.remove("focus-visible"),R.removeAttribute("data-focus-visible-added"))}function b(R){R.metaKey||R.altKey||R.ctrlKey||(d(s.activeElement)&&m(s.activeElement),u=!0)}function x(R){u=!1}function E(R){d(R.target)&&(u||y(R.target))&&m(R.target)}function C(R){d(R.target)&&(R.target.classList.contains("focus-visible")||R.target.hasAttribute("data-focus-visible-added"))&&(o=!0,window.clearTimeout(c),c=window.setTimeout(function(){o=!1},100),v(R.target))}function T(R){document.visibilityState==="hidden"&&(o&&(u=!0),k())}function k(){document.addEventListener("mousemove",O),document.addEventListener("mousedown",O),document.addEventListener("mouseup",O),document.addEventListener("pointermove",O),document.addEventListener("pointerdown",O),document.addEventListener("pointerup",O),document.addEventListener("touchmove",O),document.addEventListener("touchstart",O),document.addEventListener("touchend",O)}function M(){document.removeEventListener("mousemove",O),document.removeEventListener("mousedown",O),document.removeEventListener("mouseup",O),document.removeEventListener("pointermove",O),document.removeEventListener("pointerdown",O),document.removeEventListener("pointerup",O),document.removeEventListener("touchmove",O),document.removeEventListener("touchstart",O),document.removeEventListener("touchend",O)}function O(R){R.target.nodeName&&R.target.nodeName.toLowerCase()==="html"||(u=!1,M())}document.addEventListener("keydown",b,!0),document.addEventListener("mousedown",x,!0),document.addEventListener("pointerdown",x,!0),document.addEventListener("touchstart",x,!0),document.addEventListener("visibilitychange",T,!0),k(),s.addEventListener("focus",E,!0),s.addEventListener("blur",C,!0),s.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&s.host?s.host.setAttribute("data-js-focus-visible",""):s.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if(typeof window<"u"&&typeof document<"u"){window.applyFocusVisiblePolyfill=t;var a;try{a=new CustomEvent("focus-visible-polyfill-ready")}catch{a=document.createEvent("CustomEvent"),a.initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(a)}typeof document<"u"&&t(document)}))})()),vA.exports}Ste();const yD="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAW0AAABSCAYAAACfWoXuAAAACXBIWXMAAC4jAAAuIwF4pT92AAAMX0lEQVR4nO2d/XEbtxbF4Tf+N5ptIEO6gYipQHQDz3QDT0wDkfIKiKUGYvk1IKqBJzoNmKwgZBoINWmApgtQBtJdaSUtDrDLXewCOL8ZjsciRe0H9uDifuC+ur29VYQQQsLgNe8TISRBhkqpUeGVKaWOHC7DV6XUSim1lX8Xhf97Ibe0x5Hds/yC2jCd90ZeoZEPvjIWAZ6PqnFOQ3mVEep9LQM9s77vdSb3qQyvgmZhItdN/zto+LvXct1njtpTm1y0Y/ORLB0nItN5nyulzho+Jh8sgLXwKsDzUTXOST+Q14bPr4G4hISelP4yHO9nuQY+0c/aF8Pfe9uxwaCv1VReTQu1iRul1IUIeOMT1r+a/kJCOmYuD00Zh8AKD4kpONY5B+AdQxFNPbl98CjYSv7WRxmHZ2ClWAuKNokRJFynEZyvSbR3IlQpk4mVq8X6uOPrcCATxk2TK3eKNomRC3BOvl0HTTMCVqPJLZQKExHIk4bOdymvfcnFe9WEe47ZIyRGNuK/Piw5t4H4YEMNzKKVQqpWdibn/q7G7y4LGSAbhyDiuBB4HTtmnOTo8fjHvjEzm2h/bTsS2hIhHjNpFm1tXxq+cRqwaL83/Pwm4HPah5EIdtkEbeJKXGh1/P/5Nc5/NxMLf1Jh0vhQyGKpHKi0ifYqwnRAkgZzINrvLcG8vjKRpXYZKVrZI7GUTdekyE6CgxcNZ3Rs5drPJPh55uhLP5IJYFrVyKRPm8TKViyqMg4CFW10zKmJ9lRcDS6CfS5usbOWc8Y3clxvJPXSxqFMOpX83BRtEjNo+RtaQDIDy+9lREVDLkzBKqqIjmv86EGsn7OR8aVz1P+2fPagqnBTtEnMzGVZXMa7pvNnWwZNMilZ2Vrc/ufwuXP5bJfxLe3++MHB6tbC/bvreKRok9hBFllILhJT1sguoYIa7TPWVul34DM7iVn0paJ5KxPuueVz37sGkinaJHaQFRqKaA9BdsR1j/b2aBs9OSEf9k4CfH2cxPQk8pPlM4eWGoM7KNokdlbi2ywjlLJ25mbfix5K68sFu8/pvjMH4T6xxVso2iQFQre2TQ9xKrnZI8ltNvEtAMHOcRHuK+TfpmiTFAhZtMegbD0VK9t2nj8HVlA3A+moSlxARp88RZukwBZE8Ac936419dzsU4tb5FOg12EK3HZK3CSl45KiTVIBPdh93vnPVLaeQm52Zsm6WAe6733ORFw7JkqDkhRtkgooZ9skjF0zTbxs/dSSLXIaeOaMnnR/Be8flW0jQtEmKWHK2T7oaYWk6ZhSyc3+Bbx3FUkQ9gI07VBlKwmKNkmJkAKSqGw9hdxstMr4Frhb5Dlo7B09T0ulaJOUWAGrpm9l7QxAmvktMn/+wtJs4cm1oGiT1Ailq41JtFPIzUYVoCrSSQuNyyd53RRtkhoh9I9EopWClY0mz6tIs2ZQQ+onMReKNkmNDcjZ7ktZe+pl66l2m0f3lqJNkgY9+H0ISJoszRRys9EqQ1uiqYr2Q+ofRZukyAzkbHct2qmXraP2hrH78jegSnKQrwIp2iRVrg3n3XVZu2nSSCU3G4l2CuePJqa7FRhFm6QKitZ3ZW1noDozlX2z0YSZwo6GaGK6uzYUbZIqKGfbtnVmW7DbutmfvU5k0kITE0WbJI/J2u6qrD31fbNT9mcXQU07KNokafrUrX0IytZTsbKRaySk/bL3BZ3rmKJNUmYDyoePPZe1s9s6vt6xpzoWQeeaUbRJ6jgVNHjAFPxMITc7h5b2PdCv/dryy5nFz9Q3UvJ7kWaYS/eTsgDg1JOVO0q8bD0HWdqpdJy3YhNtPZC+9OA4XXkVxmGSHrGVdLrjkkPKt8Vs29JNPTc7xyTaqC1XjCDjc0j3CCHdu0hMfyOV3Owc02qDVvYjFG1CxLIx5Wy3vfPfhN3WSRUo2oTcYxLItsvaU8/NJhWhaBNyTxetyFDZOq1sUgpFm5B7UM52W2XtLFsnlbGJ9lIyMkJ5EbIPJqFsq6w95X2zSU1oaRPyyFw6fZfRtGizbJ3UgqJNyCM6tez/huvxvuGydjQJpJSbXcTknupTl3wfoPNdUbQJeYpJMJt2kZhSCa+Yl/wC1Jk9RlC20paiTchTUFfspkR7BHKzU7WylW2jJI/H0TXwXCnahLzEJJzvGurWbkohjL1xrQ0k2l22gPMN7N5D0SbkJagVWRPWtimFMGXBVhTtB+geIaQiqCv2voU2KDcbTRYpQNG+B25RS9GOCwawmsMkoId7CojJUl8zN9veHzEBMhDvuMuuoWjHRUobxX9t+fuRq6KutZ0ZtoBVtLIfQP0Rm4gn9B3Uv+Du+aZop0NsA77tCWor6Xdl1PVrMzfbDrK2Q2rIUhc0RijaiRGqaB91+LdNQjqoKdwmC5252Y8g0e6iQ75vrB3pKdokVHz4f7Vo/214r6qADMEERCv7ESTaOuUy5nxtlL//EPOgaMdFbEtLdMy+gnZNlbWjfbMp2o/oFcdn8H7M1jZquPHwbFO00yFE9wg6Zl9B16Z2/jM9kBTslyDjo629zbsG7a2uiuOQoh0XsVnaSLR9WdorkNHgKtpo2cuskZegXQ6PIg1ITkH+/k3RSKFox4dp34xBgNa2Nf3JEyYRcfWxmqxD5maXY3ORxGhtI9fIk4mdoh0fSMxCs1BMgTuT5dsW+7YiM5Wt08o2g67NcWTW9ilYiann44+iHR+xpEyhY/Xd8BZZfjbRRmXr9GebQR3yNWddH2BD6JXaOfiqF+mgFO34QEIQUspUn0RbAWvbVqnH3Oz6IGE+srgUQuECTOqq7BpQtONjY7FQQvAH2iLpXYi2ngx3hvdM4pGBlmK0su3MLGP5PPBK3wnY1kDJxP4i5kHRjhPkgw3BOkEuhc8dWqiXhp+bVgXMzd4fZGQcBHwdM7BNghIDofRZpWjHCRLtQQDWNloWd/mQmq7rwBAYY272/iwsmSSHgTZCXljcIh9NxglFO042oEmq6nkQ5wxE0ncdP6AoZ/v5RDgEvQ2ZNVKNU+CaUuJiCCkNcGbpe7lGzyhFO16QMA96Ktxa6P4L3v/o8VhMmCaN5z545mY3x8bi+1XiugpBuGeWc/lmOw+KdrwsLNb2hx7mumq3wXeG93Y9sVBRt/biw2Z68Ghl12Nu8QGrAITbJtian22FYxTtuLFZ05971BHEtmQ86UmK3Ab4WPPAY1+6rWcyBvQEfitiMAs440K7SWyFVZc99HFncg9sgn3lcuwU7bixWdsH8n7Xwm2zQJY9exBRt/YMBCB95mbre/qnrKjyytJDuc5/BVoKrq/dGGyXm3MsE1QfJqex3AfbvvBL13tC0Y6fqSWIkwt3F9WSmTxcSLB3PRSYGbimU5Bj7svKzuRvfQ8+cxloKbgW7n9bxrSSCWrdYYprJq6wL5b7oOQ4nZ8/inb8uARxtHBfyyDzVTE5lXxl5BJR4hbpY+Du2vDzj4ZULp+52VPLXhY5ofrXV2K52oT7QO7HyvMENRXr+sThs2s5NucVGEU7DbRY/OJwpiciLtMWxXsibptLS56qkoq3vubgVhU8n75sV6st5Ga5K5mYXDYPOxSLd9Hiqi2T797I2LZZ10rcZZUEW/Pq9lbHJ+6CFLHx1qHcOYbzdjnPHJfodc6uENTZdxvUkQzoiaMFqPkUQPXmpsL5vPG4YlhU6K1ZZfyYGIsotvX9iNwN4TquVWFsz/c8tkzOfSIuMZsRUuS8btrt6zq/RIJlWrBybRyI5X0ig/wP+d2Ng/iMC//+WHEwK9nKNIQqtwvH3PE+52aHvmnVVsb1SoTQZawVx7aSmM5Kvssm4mNZnYwcXHtl7CRgXXuyoKUdPnUsmbGkrVUV07bRWQH/6WhDqDoMJRPDhu9J6MLRn3rTkHukS0u7yFCuc5cd/BGfxLrea6KkTztNFrKstxUr+EQP6B8CEmxlydku4nuvkQuHIJ2KsNBnIxPIe8vugL5ZyuR12sTKhqKdLvmy8q0ll7ttluLvbWRAd4BNkLvYN3vjYGlfRVydORer+6cOuhwVycV63KQxQtEmi4Lv+crRQtuXnfytN/K3Q96LA+Vsqw539JvJPX2+ErgRMYu1q3mRmfie33oe25/k2jcq1jm5T5uQnEyi4WN5uWZH2FjLAF5wa9JOGHluhtxXimO7TiCxjHVhXLfu3qNoExtDeY1F0F1K3vMMk60IxYqttUhP0eNaj+l8bNvqE/Kxnb/8xmCUUv8APsi0l8VaI5gAAAAASUVORK5CYII=",Cte="_spinner_1xb2e_1",Ete="_svg_1xb2e_16",Ate="_thumbnail_1xb2e_92",kte="_thumbnail__time_1xb2e_112",Tte="_thumbnail__text_1xb2e_124",Mte="_menu_1xb2e_347",Ut={spinner:Cte,"spinner--light":"_spinner--light_1xb2e_12",svg:Ete,"user-action-indicator-container":"_user-action-indicator-container_1xb2e_23","user-action-indicator-text":"_user-action-indicator-text_1xb2e_40","user-action-indicator":"_user-action-indicator_1xb2e_23","user-action-indicator-icon":"_user-action-indicator-icon_1xb2e_60","seek-container":"_seek-container_1xb2e_69",thumbnail:Ate,"thumbnail--visible":"_thumbnail--visible_1xb2e_106","thumbnail--with-text":"_thumbnail--with-text_1xb2e_109",thumbnail__time:kte,thumbnail__text:Tte,"seek-chapter-indicator":"_seek-chapter-indicator_1xb2e_150","seek-playhead":"_seek-playhead_1xb2e_155","seek-buffer":"_seek-buffer_1xb2e_156","seek-input":"_seek-input_1xb2e_157","volume-controls":"_volume-controls_1xb2e_272","volume-slider":"_volume-slider_1xb2e_279","volume-input":"_volume-input_1xb2e_295","volume-progress":"_volume-progress_1xb2e_296",menu:Mte,"menu-option":"_menu-option_1xb2e_367","menu-option-back":"_menu-option-back_1xb2e_384","menu-option-back-icon":"_menu-option-back-icon_1xb2e_388","menu-option-active":"_menu-option-active_1xb2e_403","menu-option-icon":"_menu-option-icon_1xb2e_407","menu-header":"_menu-header_1xb2e_417","verification-menu":"_verification-menu_1xb2e_424","verification-menu__group":"_verification-menu__group_1xb2e_428","verification-menu__group-icon":"_verification-menu__group-icon_1xb2e_433","verification-menu__group-icon--cc":"_verification-menu__group-icon--cc_1xb2e_437","verification-menu__group-text":"_verification-menu__group-text_1xb2e_445","verification-menu__group-title":"_verification-menu__group-title_1xb2e_450","verification-menu__group-subtitle":"_verification-menu__group-subtitle_1xb2e_450","verification-menu__loader":"_verification-menu__loader_1xb2e_465","verification-menu__details":"_verification-menu__details_1xb2e_472","verification-menu__detail":"_verification-menu__detail_1xb2e_472","verification-menu__detail-label":"_verification-menu__detail-label_1xb2e_492","verification-menu__detail-value":"_verification-menu__detail-value_1xb2e_496","verification-menu__detail-copy":"_verification-menu__detail-copy_1xb2e_503","verification-menu__inline-icon":"_verification-menu__inline-icon_1xb2e_513","verification-menu--details":"_verification-menu--details_1xb2e_521","dvr-toggle":"_dvr-toggle_1xb2e_539","dvr-toggle__border":"_dvr-toggle__border_1xb2e_545","dvr-toggle__live":"_dvr-toggle__live_1xb2e_554","dvr-toggle__dvr":"_dvr-toggle__dvr_1xb2e_554","dvr-toggle__live--active":"_dvr-toggle__live--active_1xb2e_569","dvr-toggle__dvr--active":"_dvr-toggle__dvr--active_1xb2e_569","copy-button":"_copy-button_1xb2e_721","copy-button--copied":"_copy-button--copied_1xb2e_724"},Lg=({light:n,className:e=""})=>Ue.jsx("div",{className:`${e} ${Ut.spinner} ${n?Ut["spinner--light"]:""}`,children:Ue.jsx("div",{className:Ut["spinner-inner"]})}),pl=({icon:n,className:e=""})=>Ue.jsx("div",{className:`${Ut.svg} ${e}`,dangerouslySetInnerHTML:{__html:n}}),M5=async n=>{try{n=(n||"").toString(),await navigator.clipboard.writeText(n)}catch{const t=document.createElement("input");t.value=n,t.select(),t.setSelectionRange(0,99999),document.execCommand("copy")}},gL={[Un.PLAY]:cD,[Un.PAUSE]:ite,[Un.MUTE]:A5,[Un.UNMUTE]:Zw,[Un.VOLUME_DOWN]:pD,[Un.VOLUME_UP]:Zw,[Un.SEEK_BACK]:pL,[Un.SEEK_FORWARD]:hL,[Un.PLAYBACK_RATE_DOWN]:pL,[Un.PLAYBACK_RATE_UP]:hL,[Un.SUBTITLES_ON]:yte,[Un.SUBTITLES_OFF]:mte,[Un.PLAY_PREVIOUS]:k5,[Un.PLAY_NEXT]:T5},Rte=({action:n})=>{if(!(!n||!gL[n.action]))return Ue.jsxs("div",{className:Ut["user-action-indicator-container"],children:[Ue.jsx("div",{className:Ut["user-action-indicator"],children:Ue.jsx(pl,{icon:gL[n.action],"aria-label":`Action indicator ${n}`,className:Ut["user-action-indicator-icon"]})}),n.text?Ue.jsx("div",{className:Ut["user-action-indicator-text"],children:n.text}):null]})},Ote=({player:n,time:e,progress:t,duration:a,visible:s})=>{const[u,o]=Lt.useState(null);if(!(n.thumbnailsLoaded||n.__chapterTags)||!s)return null;e=typeof e<"u"?e:t*a,t=typeof t<"u"?t:e/a;let c=100;if(u){const{width:y}=u.parentElement.getBoundingClientRect(),m=y<650?150:y<1e3?225:350;c=(y-m)/y}const p=((n.__chapterTags||[]).find(y=>y.start_time<e&&y.end_time>e)||{}).tag||"",d=n.thumbnailHandler&&n.thumbnailHandler.ThumbnailImage(e);return Ue.jsxs("div",{ref:o,style:{opacity:s?1:0,left:`${Math.min(t,c)*100}%`},className:`${Ut.thumbnail} ${s?Ut["thumbnail--visible"]:""} ${p?Ut["thumbnail--with-text"]:""}`,children:[d?Ue.jsxs(Ue.Fragment,{children:[Ue.jsx("img",{src:d,alt:"Thumbnail",className:Ut.thumbnail__image}),Ue.jsx("div",{className:Ut.thumbnail__time,children:Og(e,a)})]}):null,p?Ue.jsx("div",{className:Ut.thumbnail__text,children:p}):null]})};let XE;const mD=({player:n,videoState:e,setRecentUserAction:t,className:a=""})=>{const[s,u]=Lt.useState(n.controls.GetCurrentTime()),[o,c]=Lt.useState(0),[p,d]=Lt.useState(void 0),[y,m]=Lt.useState(n.controls.IsDVREnabled()),[v,b]=Lt.useState(0),[x,E]=Lt.useState(!1),[C,T]=Lt.useState(!1);return Lt.useEffect(()=>{d(tD(n,t));const k=E5({player:n,setCurrentTime:u,rate:60}),M=$ee({video:n.video,setBufferFraction:c}),O=n.controls.RegisterSettingsListener(()=>{n.controls&&m(n.controls.IsDVREnabled())});return()=>{k&&k(),M&&M(),O&&O()}},[n&&n.controls]),n.isLive&&!y?null:Ue.jsxs("div",{onMouseEnter:()=>{clearTimeout(XE),E(!0)},onMouseLeave:()=>{clearTimeout(XE),XE=setTimeout(()=>{T(!1),E(!1)},100)},onFocus:()=>T(!0),onBlur:()=>T(!1),onMouseMove:k=>{const{left:M,width:O}=k.currentTarget.getBoundingClientRect();b((k.clientX-M)/O)},className:`${a} ${Ut["seek-container"]} ${a}`,children:[Ue.jsx("progress",{max:1,value:n.casting?0:o,className:Ut["seek-buffer"]}),Ue.jsx("progress",{max:1,value:s/e.duration||0,className:Ut["seek-playhead"]}),Ue.jsx("input",{"aria-label":"Seek slider",type:"range",min:0,max:1,step:1e-5,value:s/e.duration||0,onInput:k=>{n.controls.Seek({fraction:k.currentTarget.value})},onTouchStart:()=>E(!0),onTouchMove:k=>{const{left:M,width:O}=k.currentTarget.getBoundingClientRect(),R=k.touches[0].pageX/(O-M);b(R),n.controls.Seek({fraction:R})},onTouchEnd:()=>E(!1),onKeyDown:p,className:Ut["seek-input"]}),(n.__chapterTags||[]).map((k,M)=>Ue.jsx("div",{style:{width:`${100*(k.end_time-k.start_time)/e.duration}%`,left:`${100*k.start_time/e.duration}%`},className:Ut["seek-chapter-indicator"]},`chapter-${M}`)),Ue.jsx(Ote,{player:n,progress:C?s/e.duration:v,duration:e.duration,visible:x||C})]})},Lte=({player:n,videoState:e})=>Ue.jsxs("div",{className:Ut["volume-controls"],children:[Ue.jsx(gu,{"aria-label":e.muted?"Unmute":"Mute",icon:e.muted||e.volume===0?A5:e.volume<.4?pD:e.volume<.8?lte:Zw,onClick:()=>n.controls.ToggleMuted(),className:Ut["volume-button"]},"mute-button"),Ue.jsxs("div",{className:Ut["volume-slider"],children:[Ue.jsx("progress",{max:1,value:e.muted?0:e.volume,className:Ut["volume-progress"]}),Ue.jsx("input",{"aria-label":"Volume slider",type:"range",min:0,max:1,step:.001,value:e.muted?0:e.volume,onInput:t=>n.controls.SetVolume({fraction:t.currentTarget.value}),onKeyDown:yee(n),className:Ut["volume-input"]})]})]}),gD=({player:n,Hide:e,className:t=""})=>{const[a,s]=Lt.useState(void 0),[u,o]=Lt.useState(void 0),c=Lt.createRef();if(Lt.useEffect(()=>{const m=()=>o(n.controls.GetOptions());m();const v=n.controls.RegisterSettingsListener(m);return()=>v&&v()},[]),Lt.useEffect(()=>{if(!c||!c.current)return;const m=B_({element:c.current.parentElement,Hide:e});return()=>{m&&m()}},[c]),!u)return null;const p=m=>setTimeout(()=>s(m)),d={quality:{label:"Quality",Update:m=>n.controls.SetQualityLevel(m)},audio:{label:"Audio",Update:m=>n.controls.SetAudioTrack(m)},text:{label:"Subtitles",Update:m=>n.controls.SetTextTrack(m)},profile:{label:"Player Profile",Update:m=>{m==="custom"?(n.controls.ShowPlayerProfileForm(),e()):n.controls.SetPlayerProfile({profile:m})}},rate:{label:"Playback Rate",Update:m=>n.controls.SetPlaybackRate({index:m})},advanced:{label:"Advanced",Update:m=>{m==="copy_debug_info"&&(M5(JSON.stringify(n.controls.GetDebugInfo(),null,2)),e())}}};let y;return a?y=Ue.jsxs("div",{role:"menu",className:`${Ut.menu} ${Ut.submenu} ${t}`,children:[Ue.jsxs("button",{onClick:()=>p(void 0),"aria-label":"Back to settings menu",className:`${Ut["menu-option"]} ${Ut["menu-option-back"]}`,children:[Ue.jsx("div",{dangerouslySetInnerHTML:{__html:cte},className:Ut["menu-option-back-icon"]}),Ue.jsx("div",{children:d[a].label})]}),a==="advanced"?Ue.jsx("button",{role:"button",autoFocus:!0,"aria-label":"Copy Debug Info",onClick:()=>{d[a].Update("copy_debug_info"),p(void 0)},className:Ut["menu-option"],children:"Copy Debug Info"}):u[a].options.map(m=>Ue.jsxs("button",{role:"menuitemradio","aria-checked":m.active,autoFocus:m.active,"aria-label":`${d[a].label}: ${m.label||""}`,onClick:()=>{d[a].Update(m.index),p(void 0)},className:`${Ut["menu-option"]} ${m.active?Ut["menu-option-active"]:""}`,children:[m.label||"",m.active?Ue.jsx(pl,{icon:hte,className:Ut["menu-option-icon"]}):null]},`option-${m.index}`))]},"submenu"):y=Ue.jsxs("div",{role:"menu",className:`${Ut.menu} ${t}`,children:[u.hasQualityOptions?Ue.jsxs("button",{autoFocus:!0,role:"menuitem",onClick:()=>p("quality"),className:Ut["menu-option"],children:[`${d.quality.label}: ${u.quality.active&&u.quality.active.activeLabel||""}`,Ue.jsx(pl,{icon:op,className:Ut["menu-option-icon"]})]}):null,u.hasAudioOptions?Ue.jsxs("button",{autoFocus:!u.hasQualityOptions,role:"menuitem",onClick:()=>p("audio"),className:Ut["menu-option"],children:[`${d.audio.label}: ${u.audio.active&&u.audio.active.label||""}`,Ue.jsx(pl,{icon:op,className:Ut["menu-option-icon"]})]}):null,u.hasTextOptions?Ue.jsxs("button",{autoFocus:!u.hasQualityOptions&&!u.hasAudioOptions,role:"menuitem",onClick:()=>p("text"),className:Ut["menu-option"],children:[`${d.text.label}: ${u.text.active&&u.text.active.label||""}`,Ue.jsx(pl,{icon:op,className:Ut["menu-option-icon"]})]}):null,u.hasProfileOptons?Ue.jsxs("button",{autoFocus:!u.hasQualityOptions&&!u.hasAudioOptions&&!u.hasTextOptions,role:"menuitem",onClick:()=>p("profile"),className:Ut["menu-option"],children:[`${d.profile.label}: ${u.profile.active&&u.profile.active.label||""}`,Ue.jsx(pl,{icon:op,className:Ut["menu-option-icon"]})]}):null,u.hasRateOptions?Ue.jsxs("button",{autoFocus:!u.hasQualityOptions&&!u.hasAudioOptions&&!u.hasTextOptions&&!u.hasProfileOptons,role:"menuitem",onClick:()=>p("rate"),className:Ut["menu-option"],children:[`${d.rate.label}: ${u.rate.active&&u.rate.active.label||""}`,Ue.jsx(pl,{icon:op,className:Ut["menu-option-icon"]})]}):null,Ue.jsxs("button",{autoFocus:!u.hasRateOptions&&!u.hasQualityOptions&&!u.hasAudioOptions&&!u.hasTextOptions&&!u.hasProfileOptons,role:"button",onClick:()=>p("advanced"),className:Ut["menu-option"],children:[d.advanced.label,Ue.jsx(pl,{icon:op,className:Ut["menu-option-icon"]})]})]},"menu"),Ue.jsx("div",{ref:c,children:y})},vD=({player:n})=>{const[e,t]=Lt.useState(n.dvrEnabled);return Lt.useEffect(()=>{const a=n.controls.RegisterSettingsListener(()=>{n.controls&&t(n.controls.IsDVREnabled())});return()=>a&&a()},[n&&n.controls]),Ue.jsxs("div",{className:Ut["dvr-toggle"],children:[Ue.jsx("button",{onClick:()=>n.controls.SetDVREnabled(!1),className:`${Ut["dvr-toggle__live"]} ${e?"":Ut["dvr-toggle__live--active"]}`,children:"LIVE"}),Ue.jsx("button",{onClick:()=>n.controls.SetDVREnabled(!0),className:`${Ut["dvr-toggle__dvr"]} ${e?Ut["dvr-toggle__dvr--active"]:""}`,children:"DVR"}),Ue.jsx("div",{className:Ut["dvr-toggle__border"]})]})},Nte=({label:n,value:e,className:t=""})=>{const[a,s]=Lt.useState(!1);return Ue.jsx("button",{onClick:()=>{a||(M5(e),s(!0),setTimeout(()=>s(!1),100))},dangerouslySetInnerHTML:{__html:vte},className:[Ut["copy-button"],a?Ut["copy-button--copied"]:"",t].join(" "),title:`Copy ${n}`})},Ro=({label:n,value:e,copyable:t})=>e?Ue.jsxs("div",{className:Ut["verification-menu__detail"],children:[Ue.jsxs("label",{className:Ut["verification-menu__detail-label"],children:[n,":"]}),Ue.jsx("div",{className:Ut["verification-menu__detail-value"],children:e}),t?Ue.jsx(Nte,{label:n,value:e,className:Ut["verification-menu__detail-copy"]}):null]}):null,bD=({player:n,Hide:e,className:t=""})=>{const a=Lt.createRef(),[s,u]=Lt.useState(),[o,c]=Lt.useState(!1),[,p]=Lt.useState(!1);if(Lt.useEffect(()=>{n.__LoadVerificationDetails().then(()=>p(!0));const y=()=>u(n.controls.GetContentVerificationDetails());y();const m=n.controls.RegisterSettingsListener(y);return()=>m&&m()},[]),Lt.useEffect(()=>{if(!a||!a.current)return;const y=B_({element:a.current.parentElement,Hide:e});return()=>{y&&y()}},[a]),!s)return null;let d;return o?d=Ue.jsxs(Ue.Fragment,{children:[Ue.jsxs("div",{className:Ut["verification-menu__group"],children:[Ue.jsx("div",{dangerouslySetInnerHTML:{__html:e_},className:Ut["verification-menu__group-icon"]}),Ue.jsxs("div",{className:Ut["verification-menu__group-text"],children:[Ue.jsx("div",{className:Ut["verification-menu__group-title"],children:"This content has been verified as authentic"}),Ue.jsxs("div",{className:Ut["verification-menu__group-subtitle"],children:["Last Verified: ",new Date(s.verifiedAt).toLocaleTimeString(navigator.language||"en-us",{year:"numeric",month:"long",day:"numeric"})]})]})]}),Ue.jsxs("div",{className:Ut["verification-menu__group"],children:[Ue.jsx("div",{dangerouslySetInnerHTML:{__html:yL},className:[Ut["verification-menu__group-icon"],Ut["verification-menu__group-icon--cc"]].join(" ")}),Ue.jsxs("div",{className:Ut["verification-menu__group-text"],children:[Ue.jsx("button",{onClick:()=>c(!0),className:Ut["verification-menu__group-title"],children:"Content Credentials"}),Ue.jsxs("div",{className:Ut["verification-menu__group-subtitle"],children:["Issued by the",Ue.jsx("a",{href:"https://main.net955305.contentfabric.io/config",target:"_blank",rel:"noreferrer",children:"Content Fabric"})]})]})]}),Ue.jsxs("div",{className:Ut["verification-menu__details"],children:[Ue.jsx(Ro,{label:"Content Fabric Object ID",value:s.details.objectId,copyable:!0}),Ue.jsx(Ro,{label:"Organization Address",value:s.details.tenantAddress,copyable:!0}),Ue.jsx(Ro,{label:"Organization Name",value:s.details.tenantName&&s.details.tenantName.toString()}),Ue.jsx(Ro,{label:"Owner Address",value:s.details.ownerAddress,copyable:!0}),Ue.jsx(Ro,{label:"Content Object Contract Address",value:s.details.explorerUrl?Ue.jsx("a",{href:s.details.explorerUrl,target:"_blank",rel:"noreferrer",children:s.details.address}):s.details.address,copyable:!0}),Ue.jsx(Ro,{label:"Versions",value:s.details.versionCount}),Ue.jsx(Ro,{label:"Content Version Hash",value:s.details.versionHash,copyable:!0}),s.details.lastCommittedAt?Ue.jsx(Ro,{label:"Latest Commit",value:new Date(s.details.lastCommittedAt).toLocaleTimeString(navigator.language||"en-us",{year:"numeric",month:"long",day:"numeric"})}):null,Ue.jsx(Ro,{label:"Latest Version Hash",value:s.details.latestVersionHash,copyable:!0}),Ue.jsx(Ro,{label:"Latest Transaction",value:s.details._state!=="full"?Ue.jsx(Lg,{className:Ut["verification-menu__loader"]}):s.details.latestTransactionHashUrl?Ue.jsx("a",{href:s.details.latestTransactionHashUrl,target:"_blank",rel:"noreferrer",children:s.details.latestTransactionHash&&s.details.latestTransactionHash.toString()}):void 0}),Ue.jsx(Ro,{label:"Signature Algorithm",value:s.details.signatureMethod}),n.publicMetadataUrl?Ue.jsx(Ro,{label:"Public Metadata",value:Ue.jsx("a",{href:n.publicMetadataUrl,target:"_blank",rel:"noreferrer",children:n.publicMetadataUrl})}):null]},`details-${s.details._state}`)]}):d=Ue.jsxs(Ue.Fragment,{children:[Ue.jsxs("div",{className:Ut["verification-menu__group"],children:[Ue.jsx("div",{dangerouslySetInnerHTML:{__html:e_},className:Ut["verification-menu__group-icon"]}),Ue.jsxs("div",{className:Ut["verification-menu__group-text"],children:[Ue.jsx("div",{className:Ut["verification-menu__group-title"],children:"This content has been verified as authentic"}),Ue.jsxs("div",{className:Ut["verification-menu__group-subtitle"],children:["Last Verified: ",new Date(s.verifiedAt).toLocaleTimeString(navigator.language||"en-us",{year:"numeric",month:"long",day:"numeric"})]})]})]}),Ue.jsxs("div",{className:Ut["verification-menu__group"],children:[Ue.jsx("div",{dangerouslySetInnerHTML:{__html:yL},className:[Ut["verification-menu__group-icon"],Ut["verification-menu__group-icon--cc"]].join(" ")}),Ue.jsx("div",{className:Ut["verification-menu__group-text"],children:Ue.jsxs("button",{onClick:()=>c(!0),className:Ut["verification-menu__group-title"],children:["View Content Credentials",Ue.jsx("div",{className:Ut["verification-menu__inline-icon"],dangerouslySetInnerHTML:{__html:op}})]})})]})]}),Ue.jsx("div",{ref:a,children:Ue.jsx("div",{role:"menu",className:`${Ut.menu} ${Ut["verification-menu"]} ${o?Ut["verification-menu--details"]:""} ${t}`,children:d},"menu")})},Pte=({player:n,Hide:e,className:t=""})=>{const a=Lt.createRef(),[s,u]=Lt.useState(void 0);if(Lt.useEffect(()=>{const c=()=>u(n.controls.GetCollectionInfo());c();const p=n.controls.RegisterSettingsListener(c);return()=>p&&p()},[]),Lt.useEffect(()=>{if(!a||!a.current)return;const c=B_({element:a.current.parentElement,Hide:e});return()=>c&&c()},[a]),!s)return null;const o=c=>{n.controls.CollectionPlay({mediaIndex:c}),e()};return Ue.jsxs("div",{role:"menu",className:`${Ut.menu} ${Ut["collection-menu"]} ${t}`,ref:a,children:[Ue.jsx("div",{className:`${Ut["menu-option"]} ${Ut["menu-header"]}`,children:s.title}),s.content.map((c=>Ue.jsx("button",{"aria-label":`${c.title||c.mediaId} ${c.active?"(active)":""}`,role:"menuitemradio","aria-checked":c.active,autoFocus:c.active,onClick:()=>o(c.mediaIndex),className:`${Ut["menu-option"]} ${c.active?Ut["menu-option-active"]:""}`,children:c.title||c.mediaId},`collection-item-${c.mediaId}`)))]},"menu")},gu=({icon:n,className:e="",...t})=>Ue.jsx("button",{...t,className:`${Fn["icon-button"]} ${e}`,dangerouslySetInnerHTML:{__html:n}}),Ite=({player:n,videoState:e})=>{const[t,a]=Lt.useState(n.video.currentTime);return Lt.useEffect(()=>{const s=E5({player:n,setCurrentTime:a,rate:10});return()=>s&&s()},[]),n.isLive&&!n.controls.IsDVRAvailable()?Ue.jsx("div",{className:Fn["live-indicator"],children:"Live"}):Ue.jsxs("div",{className:Fn.time,children:[!n.isLive||!n.controls.IsDVRAvailable()?null:Ue.jsx(vD,{player:n}),n.isLive&&!n.behindLiveEdge?null:`${Og(t,e.duration)} / `,n.isLive&&!n.dvrEnabled?null:Og(e.duration,e.duration)]})},Dte=({player:n})=>{const e=n.controls.GetCollectionInfo();if(!e||e.mediaLength===0||!e.isPlaylist)return null;const t=e.content[e.mediaIndex-1],a=e.content[e.mediaIndex+1],s=n.controls.IsReady();return Ue.jsxs(Ue.Fragment,{children:[t?Ue.jsxs("div",{className:`${Fn["collection-button-container"]} ${s?"":Fn["collection-button-container--loading"]}`,children:[Ue.jsx(gu,{"aria-label":`Play Previous: ${t.title}`,disabled:!s,icon:k5,onClick:()=>n.controls.CollectionPlayPrevious()}),Ue.jsx("div",{className:Fn["collection-button-text"],children:t.title})]},`media-previous-${e.mediaIndex}`):null,a?Ue.jsxs("div",{className:`${Fn["collection-button-container"]} ${s?"":Fn["collection-button-container--loading"]}`,children:[Ue.jsx(gu,{"aria-label":`Play Next: ${a.title}`,disabled:!s,icon:T5,onClick:()=>n.controls.CollectionPlayNext()}),Ue.jsx("div",{className:Fn["collection-button-text"],children:a.title})]},`media-next-${e.mediaIndex}`):null]})},wD=({label:n,icon:e,player:t,MenuComponent:a,className:s=""})=>{const[u,o]=Lt.useState(!1);return Ue.jsxs("div",{className:[Fn["menu-control-container"],s].join(" "),children:[Ue.jsx(gu,{"aria-label":u?`Hide ${n} Menu`:n,"aria-haspopup":!0,icon:e,onClick:()=>{t.controls.__ToggleMenu(!u),o(!u)},className:u?Fn["icon-button-active"]:""}),u?Ue.jsx(a,{player:t,Hide:()=>{o(!1),t.controls.__ToggleMenu(!1)}}):null]})},Ute=({player:n})=>{const[e,t]=Lt.useState(void 0),{title:a,subtitle:s,description:u,image:o,headers:c}=n.controls.GetContentInfo()||{};return Lt.useEffect(()=>{t(void 0),o&&S5({player:n,pathOrUrl:o,width:200}).then(p=>t(p))},[o]),!a||n.playerOptions.title===Gt.title.FULLSCREEN_ONLY&&!n.controls.IsFullscreen()||n.playerOptions.title===Gt.title.OFF?null:Ue.jsxs("div",{className:Fn["info-container"],children:[e?Ue.jsx("div",{className:Fn["info-image-container"],children:Ue.jsx("img",{src:e,alt:"Image",className:Fn["info-image"]})}):null,Ue.jsxs("div",{className:Fn["info-text"],children:[c.length===0?null:Ue.jsx("div",{className:Fn["info-headers"],children:c.map((p,d)=>Ue.jsx("div",{className:Fn["info-header"],children:p},`header-${d}`))}),a?Ue.jsx("div",{className:Fn["info-title"],children:a}):null,s?Ue.jsx("div",{className:Fn["info-subtitle"],children:s}):null,u?Ue.jsx("div",{className:Fn["info-description"],children:u}):null]})]})},Fte=({player:n})=>{const[e,t]=Lt.useState(!1);return Lt.useEffect(()=>{const a=()=>n&&n.controls&&t(n.controls.ContentVerified());a();const s=n.controls&&n.controls.RegisterSettingsListener(a);return()=>s&&s()},[]),e?Ue.jsxs(Ue.Fragment,{children:[Ue.jsx("div",{className:Fn["content-verified-badge"],children:"VERIFIED"}),Ue.jsx(wD,{label:"Content Verification Menu",icon:e_,player:n,MenuComponent:bD,className:Fn["content-verification-menu-button"]})]}):null},Bte=({player:n,playbackStarted:e,canPlay:t,recentlyInteracted:a,setRecentUserAction:s,className:u=""})=>{const[o,c]=Lt.useState(void 0),[p,d]=Lt.useState(void 0),[y,m]=Lt.useState(n.controls.IsMenuVisible());if(Lt.useEffect(()=>{if(!n.controls)return;d(eD({player:n,setRecentUserAction:s}));const E=()=>n&&n.controls&&m(n.controls.IsMenuVisible()),C=n.controls.RegisterSettingsListener(E),T=uD({player:n,setVideoState:c});return()=>{C&&C(),T&&T()}},[]),!o)return null;const v=n.controls.GetCollectionInfo(),b=a||!e||y,x=!b&&[Gt.controls.AUTO_HIDE,Gt.controls.OFF_WITH_VOLUME_TOGGLE].includes(n.playerOptions.controls);return n.__SetControlsVisibility(!x),Ue.jsxs("div",{onClick:p,className:[u,Fn.container,b?"":Fn.autohide,n.playerOptions.controls!==Gt.controls.DEFAULT?"":Fn["container--default-controls"],n.controls.IsMenuVisible()?"menu-active":""].join(" "),children:[Ue.jsx(Ute,{player:n},`content-info-${v&&v.mediaIndex}`),[Gt.controls.DEFAULT,Gt.controls.OFF,Gt.controls.OFF_WITH_VOLUME_TOGGLE].includes(n.playerOptions.controls)?null:Ue.jsxs(Ue.Fragment,{children:[Ue.jsx(gu,{"aria-label":"Play",tabIndex:e?-1:0,icon:lD,onClick:()=>{n.controls.Play(),n.target.firstChild.focus()},className:`${Fn["center-play-button"]} ${t&&!e&&!(n&&n.casting)&&!(n&&n.controls&&n.controls.IsPlaying()&&!n.casting)?"":Fn["center-play-button--hidden"]}`}),Ue.jsxs("div",{className:`${Fn["bottom-controls-container"]} ${x?Fn["bottom-controls-container--autohide"]:""}`,children:[Ue.jsx("div",{className:Fn["bottom-controls-gradient"]}),Ue.jsx(mD,{player:n,videoState:o,setRecentUserAction:s,className:Fn.seek}),Ue.jsxs("div",{className:Fn.controls,children:[Ue.jsx(gu,{"aria-label":o.playing?"Pause":"Play",icon:o.playing?dD:fD,onClick:()=>n.controls.TogglePlay(),className:Fn["play-pause-button"]}),Ue.jsx(Dte,{player:n}),Ue.jsx(Lte,{player:n,videoState:o}),Ue.jsx(Ite,{player:n,videoState:o}),Ue.jsx("div",{className:Fn.spacer}),Ue.jsx(Fte,{player:n}),n.chromecastAvailable?Ue.jsx("google-cast-launcher",{}):null,n.airplayAvailable?Ue.jsx(gu,{"aria-label":"Airplay",onClick:()=>n.video.webkitShowPlaybackTargetPicker(),icon:hD}):null,n.controls.OverlayAvailable()?Ue.jsx(gu,{"aria-label":"Toggle Overlay",onClick:()=>n.controls.ToggleOverlayVisibility(),icon:_te,className:[Fn["icon-button--no-padding"],n.controls.OverlayVisible()?Fn["icon-button-active"]:""].join(" ")}):null,n.controls.IsRotatable()?Ue.jsx(gu,{"aria-label":"Rotate Video",icon:gte,onClick:()=>n.controls.SetAllowRotation(!n.controls.AllowRotation()),className:Fn["right-control-button"]}):null,n.controls.GetOptions().hasAnyOptions?Ue.jsx(wD,{label:"Settings Menu",icon:ute,player:n,MenuComponent:gD}):null,Ue.jsx(gu,{"aria-label":o.fullscreen?"Exit Fullscreen":"Fullscreen",icon:o.fullscreen?ote:ste,onClick:()=>n.controls.ToggleFullscreen(),className:Fn["right-control-button"]})]})]})]}),n.playerOptions.controls!==Gt.controls.OFF_WITH_VOLUME_TOGGLE||!n.controls.HasAudio()?null:Ue.jsx("div",{className:Fn["floating-volume-toggle"],children:Ue.jsx(gu,{"aria-label":o.muted?"Unmute":"Mute",icon:o.muted||o.volume===0?A5:Zw,onClick:()=>n.controls.ToggleMuted(),className:Fn["volume-button"]},"mute-button")}),n.playerOptions.watermark===Gt.watermark.OFF?null:Ue.jsx("div",{className:Fn.watermark,children:Ue.jsx("img",{src:yD,alt:"Eluvio"})})]})},zte="_spinner_1c6ar_17",jte="_text_1c6ar_33",qte="_title_1c6ar_39",Hte="_description_1c6ar_43",Vte="_inputs_1c6ar_47",Gte="_input_1c6ar_47",$te="_submit_1c6ar_77",ci={"ticket-form-container":"_ticket-form-container_1c6ar_1","ticket-form-overlay":"_ticket-form-overlay_1c6ar_8",spinner:zte,"ticket-form":"_ticket-form_1c6ar_1",text:jte,title:qte,description:Hte,inputs:Vte,input:Gte,submit:$te,"error-message":"_error-message_1c6ar_88","size-md":"_size-md_1c6ar_102","size-sm":"_size-sm_1c6ar_103"},Wte=({parameters:n,dimensions:e,onComplete:t})=>{let{tenantId:a,ntpId:s,ticketCode:u,ticketSubject:o}=n.clientOptions||{};const c=!a||!s,[p,d]=Lt.useState(u||""),[y,m]=Lt.useState(!!u),[v,b]=Lt.useState(!1),[x,E]=Lt.useState(c?"Error: Tenant ID or NTP ID not specified":""),[C,T]=Lt.useState(void 0),k=async({client:M,code:O})=>{if(!(!O||!M)){E(""),b(!0);try{let R=o;O.includes(":")&&(R=O.split(":")[0],O=O.split(":")[1]),await M.RedeemCode({tenantId:a,ntpId:s,code:O.trim(),email:R}),t(M)}catch(R){console.log(R),E("Invalid Code"),m(!1)}finally{b(!1)}}};return Lt.useEffect(()=>{Promise.resolve().then(()=>ZI).then(async({ElvClient:M})=>{const O=await M.FromConfigurationUrl({configUrl:n.clientOptions.network});T(O),u&&k({client:O,code:u})})},[]),y?Ue.jsx("div",{role:"complementary",tabIndex:-1,style:{backgroundColor:n.playerOptions.backgroundColor||"transparent","--portal-width":`${e.width}px`,"--portal-height":`${e.height}px`},className:[ci["ticket-form-container"],ci[`size-${e.size}`],ci[`orientation-${e.orientation}`]].join(" "),children:Ue.jsx("div",{className:ci["ticket-form-overlay"],children:Ue.jsx(Lg,{className:ci.spinner})})}):Ue.jsx("div",{role:"complementary",tabIndex:-1,style:{backgroundColor:n.playerOptions.backgroundColor||"transparent","--portal-width":`${e.width}px`,"--portal-height":`${e.height}px`},className:[ci["ticket-form-container"],ci[`size-${e.size}`],ci[`orientation-${e.orientation}`]].join(" "),children:Ue.jsx("div",{className:ci["ticket-form-overlay"],children:Ue.jsxs("form",{onSubmit:M=>{M.preventDefault(),k({client:C,code:p})},className:ci["ticket-form"],children:[Ue.jsxs("div",{className:ci.text,children:[Ue.jsx("h2",{className:ci.title,children:n.clientOptions.ticketTitle||"This content requires a code to view"}),Ue.jsx("p",{className:ci.description,children:n.clientOptions.ticketDescription||"Please enter your code below"})]}),Ue.jsxs("div",{className:ci.inputs,children:[Ue.jsx("input",{disabled:c,autoFocus:!0,type:"text",placeholder:"Ticket Code",value:p,"aria-label":"Ticket Code","aria-invalid":!!x&&!c,"aria-errormessage":x,onKeyDown:M=>M.key==="Enter"&&k({client:C,code:p}),onChange:M=>{E(""),d(M.target.value)},className:ci.input}),Ue.jsx("button",{type:"submit","aria-label":"Submit Code",disabled:!p||!C||c,className:ci.submit,children:v?Ue.jsx(Lg,{light:!0}):"Submit"})]}),Ue.jsxs("div",{className:ci["error-message"],children:[x," "]})]})})})},Kte="_container_1fkgx_1",Jte="_autohide_1fkgx_33",Yte="_title_1fkgx_133",Qte="_spacer_1fkgx_318",Xte="_watermark_1fkgx_322",Zte="_menu_1fkgx_144",vn={container:Kte,"container--default-controls":"_container--default-controls_1fkgx_28",autohide:Jte,"bottom-controls-container--autohide":"_bottom-controls-container--autohide_1fkgx_36","icon-button":"_icon-button_1fkgx_42","icon-button--drop-shadow-focus":"_icon-button--drop-shadow-focus_1fkgx_59","icon-button-active":"_icon-button-active_1fkgx_72","icon-button--circle-focus":"_icon-button--circle-focus_1fkgx_72","text-button":"_text-button_1fkgx_85","text-button--active":"_text-button--active_1fkgx_90","bottom-controls-container":"_bottom-controls-container_1fkgx_36","bottom-controls-gradient":"_bottom-controls-gradient_1fkgx_107","center-play-button":"_center-play-button_1fkgx_119","center-play-button--hidden":"_center-play-button--hidden_1fkgx_126","title-container":"_title-container_1fkgx_133",title:Yte,"menu-control-container":"_menu-control-container_1fkgx_144","time-container":"_time-container_1fkgx_148","live-indicator":"_live-indicator_1fkgx_155","bottom-controls":"_bottom-controls_1fkgx_36","center-buttons":"_center-buttons_1fkgx_183","play-pause-button":"_play-pause-button_1fkgx_193","track-button":"_track-button_1fkgx_196","bottom-left-controls":"_bottom-left-controls_1fkgx_200","bottom-right-controls":"_bottom-right-controls_1fkgx_201","info-box-container":"_info-box-container_1fkgx_218","info-box":"_info-box_1fkgx_218","info-box-image-container":"_info-box-image-container_1fkgx_241","info-box-image":"_info-box-image_1fkgx_241","info-box-text":"_info-box-text_1fkgx_257","info-box-text--top-padding":"_info-box-text--top-padding_1fkgx_264","info-box-headers":"_info-box-headers_1fkgx_268","info-box-description":"_info-box-description_1fkgx_276","info-box-title":"_info-box-title_1fkgx_280","info-box-button":"_info-box-button_1fkgx_285","info-box-button--restart":"_info-box-button--restart_1fkgx_300",spacer:Qte,watermark:Xte,menu:Zte},Ef=({icon:n,...e})=>Ue.jsx("button",{...e,className:`${vn["icon-button"]} ${e.className||""}`,dangerouslySetInnerHTML:{__html:n}}),ene=({player:n,videoState:e})=>{const[t,a]=Lt.useState(n.video.currentTime);return Lt.useEffect(()=>{const s=E5({player:n,setCurrentTime:a,rate:10});return()=>s&&s()},[]),n.isLive&&!n.dvrEnabled?null:Ue.jsxs("div",{className:vn["time-container"],children:[n.isLive&&!n.behindLiveEdge?null:Ue.jsx("div",{className:vn.time,children:Og(t,e.duration)}),Ue.jsx("div",{className:vn.spacer}),Ue.jsx("div",{className:vn.time,children:Og(e.duration,e.duration)})]})},tne=({player:n,videoState:e})=>{const t=n.controls.GetCollectionInfo(),a=t&&t.isPlaylist&&t.content[t.mediaIndex-1],s=t&&t.isPlaylist&&t.content[t.mediaIndex+1],u=n.controls.IsReady();return Ue.jsxs("div",{className:vn["center-buttons"],children:[!a&&!s?null:Ue.jsx(Ef,{disabled:!u||!a,icon:k5,onClick:()=>n.controls.CollectionPlayPrevious(),className:`${vn["track-button"]} ${vn["icon-button--drop-shadow-focus"]}`}),Ue.jsx(Ef,{"aria-label":"Back 10 Seconds",icon:fte,onClick:()=>n.controls.Seek({relativeSeconds:-10}),className:vn["icon-button--drop-shadow-focus"]}),Ue.jsx(Ef,{"aria-label":e.playing?"Pause":"Play",icon:e.playing?dD:fD,onClick:()=>n.controls.TogglePlay(),className:`${vn["play-pause-button"]} ${vn["icon-button--drop-shadow-focus"]}`}),Ue.jsx(Ef,{"aria-label":"Forward 10 Seconds",icon:dte,onClick:()=>n.controls.Seek({relativeSeconds:10}),className:vn["icon-button--drop-shadow-focus"]}),!a&&!s?null:Ue.jsx(Ef,{disabled:!u||!s,icon:T5,onClick:()=>n.controls.CollectionPlayNext(),className:`${vn["track-button"]} ${vn["icon-button--drop-shadow-focus"]}`})]})},bA=({label:n,icon:e,children:t,player:a,MenuComponent:s})=>{const[u,o]=Lt.useState(!1);return Ue.jsxs("div",{className:vn["menu-control-container"],children:[e?Ue.jsx(Ef,{"aria-label":u?`Hide ${n} Menu`:n,"aria-haspopup":!0,icon:e,onClick:()=>{a.controls.__ToggleMenu(!u),o(!u)},className:`${vn["icon-button--circle-focus"]} ${u?vn["icon-button-active"]:""}`}):Ue.jsx("button",{onClick:()=>{a.controls.__ToggleMenu(!u),o(!u)},className:`${vn["text-button"]} ${u?vn["text-button--active"]:""}`,children:t}),u?Ue.jsx(s,{player:a,Hide:()=>{a.controls.__ToggleMenu(!1),o(!1)},className:vn.menu}):null]})},nne=({player:n,Hide:e})=>{const[t,a]=Lt.useState(void 0),{title:s,description:u,image:o,headers:c}=n.controls.GetContentInfo()||{};return Lt.useEffect(()=>{a(void 0),o&&S5({player:n,pathOrUrl:o,width:200}).then(p=>a(p))},[o]),Lt.useEffect(()=>{const p=d=>{d&&(d.key||"").toLowerCase()==="escape"&&e()};return document.body.addEventListener("keydown",p),()=>document.body.removeEventListener("keydown",p)},[]),Ue.jsxs("div",{className:vn["info-box-container"],children:[Ue.jsx("button",{autoFocus:!0,onClick:()=>e(),className:`${vn["info-box-button"]} ${vn["info-box-button--info"]}`,children:"Info"}),Ue.jsxs("div",{className:vn["info-box"],children:[t?Ue.jsx("div",{className:vn["info-box-image-container"],children:Ue.jsx("img",{src:t,alt:"Image",className:vn["info-box-image"]})}):null,Ue.jsxs("div",{className:`${vn["info-box-text"]} ${t&&c&&c.length===0?vn["info-box-text--top-padding"]:""}`,children:[!c||c.length===0?null:Ue.jsx("div",{className:vn["info-box-headers"],children:c.map((p,d)=>Ue.jsx("div",{className:vn["info-box-header"],children:p},`header-${d}`))}),Ue.jsx("div",{className:vn["info-box-title"],children:s||""}),Ue.jsx("div",{className:vn["info-box-description"],children:u||""})]}),Ue.jsx("div",{className:vn["info-box-actions"],children:Ue.jsxs("button",{onClick:()=>{n.controls.Seek({time:0}),e()},className:`${vn["info-box-button"]} ${vn["info-box-button--restart"]}`,children:[Ue.jsx(pl,{icon:cD}),"From Beginning"]})})]})]})},rne=({player:n})=>{const[e,t]=Lt.useState(!1);return Lt.useEffect(()=>{const a=()=>t(n.controls.ContentVerified());a(),n.controls.RegisterSettingsListener(a)},[]),e?Ue.jsx(bA,{label:"Content Verification Menu",icon:e_,player:n,MenuComponent:bD,className:vn["content-verification-menu-button"],children:"Verified"}):null},ane=({player:n,playbackStarted:e,canPlay:t,recentlyInteracted:a,setRecentUserAction:s,className:u=""})=>{const[o,c]=Lt.useState(void 0),[p,d]=Lt.useState(void 0),[y,m]=Lt.useState(!1);if(Lt.useEffect(()=>{d(eD({player:n,setRecentUserAction:s}));const C=uD({player:n,setVideoState:c});return()=>C&&C()},[]),!o)return null;const{title:v}=n.controls.GetContentInfo()||{},b=n.controls.GetCollectionInfo(),x=a||!e||n.controls.IsMenuVisible(),E=!x&&n.playerOptions.controls===Gt.controls.AUTO_HIDE;return n.__SetControlsVisibility(!E),Ue.jsxs("div",{onClick:p,className:[u,vn.container,x?"":vn.autohide,n.playerOptions.controls!==Gt.controls.DEFAULT?"":vn["container--default-controls"],n.controls.IsMenuVisible()?"menu-active":""].join(" "),children:[Ue.jsx(Ef,{"aria-label":"Play",tabIndex:e?-1:0,icon:lD,onClick:()=>{n.controls.Play(),n.target.firstChild.focus()},className:`${vn["center-play-button"]} ${vn["icon-button--drop-shadow-focus"]} ${t&&!e&&!n.casting?"":vn["center-play-button--hidden"]}`}),y?Ue.jsx(nne,{player:n,Hide:()=>m(!1)}):Ue.jsxs("div",{className:`${vn["bottom-controls-container"]} ${E?vn["bottom-controls-container--autohide"]:""}`,children:[Ue.jsx("div",{className:vn["bottom-controls-gradient"]}),Ue.jsxs("div",{className:vn["title-container"],children:[Ue.jsx("div",{className:vn.title,children:n.playerOptions.title===Gt.title.OFF||n.playerOptions.title===Gt.title.FULLSCREEN_ONLY&&!n.controls.IsFullscreen()?"":v||""}),Ue.jsx("div",{className:vn.spacer}),n.isLive?n.controls.IsDVRAvailable()?Ue.jsx(vD,{player:n}):Ue.jsx("div",{className:vn["live-indicator"],children:"Live"}):null,b?Ue.jsx(bA,{label:"Collection Menu",icon:pte,player:n,MenuComponent:Pte}):null]}),Ue.jsx(mD,{player:n,videoState:o,setRecentUserAction:s}),Ue.jsx(ene,{player:n,videoState:o}),Ue.jsxs("div",{className:vn["bottom-controls"],children:[Ue.jsx("div",{className:vn["bottom-left-controls"],children:!v||n.playerOptions.title===Gt.title.OFF?null:Ue.jsx("button",{className:vn["text-button"],onClick:()=>m(!0),children:"Info"})}),Ue.jsx(tne,{player:n,videoState:o}),Ue.jsxs("div",{className:vn["bottom-right-controls"],children:[Ue.jsx(rne,{player:n}),n.airplayAvailable?Ue.jsx(Ef,{"aria-label":"Airplay",onClick:()=>n.video.webkitShowPlaybackTargetPicker(),icon:hD}):null,n.chromecastAvailable?Ue.jsx("google-cast-launcher",{}):null,n.controls.GetOptions().hasAnyOptions?Ue.jsx(bA,{label:"Settings",player:n,MenuComponent:gD,children:"Settings"},"settings-button"):null]})]})]}),n.playerOptions.watermark===Gt.watermark.OFF?null:Ue.jsx("div",{className:vn.watermark,children:Ue.jsx("img",{src:yD,alt:"Eluvio"})})]},"controls")},ine="_container_1l7ln_1",sne="_overlay_1l7ln_9",one="_form_1l7ln_22",une="_header_1l7ln_39",lne="_input_1l7ln_45",cne="_actions_1l7ln_92",fne="_submit_1l7ln_98",dne="_cancel_1l7ln_99",Js={container:ine,overlay:sne,form:one,header:une,"input-container":"_input-container_1l7ln_45",input:lne,"input--invalid":"_input--invalid_1l7ln_65","player-info":"_player-info_1l7ln_74","api-link":"_api-link_1l7ln_83",actions:cne,submit:fne,cancel:dne},pne=({player:n,Close:e})=>{const[t,a]=Lt.useState(),[s,u]=Lt.useState(!1),[o,c]=Lt.useState(""),p=Lt.useRef();Lt.useEffect(()=>{if(!p||!p.current)return;const y=B_({element:p.current,Hide:e});return()=>y&&y()},[p]),Lt.useEffect(()=>{let y={...n.hlsOptions||{}};delete y.drmSystems,delete y.emeEnabled,a(JSON.stringify(y,null,2))},[]);const d=async y=>{y.preventDefault();try{u(!0),await n.controls.SetPlayerProfile({profile:"custom",customOptions:JSON.parse(t)}),e()}catch(m){c(m.toString()),u(!1)}};return Ue.jsx("div",{role:"complementary",tabIndex:-1,className:Js.container,children:Ue.jsx("div",{className:Js.overlay,children:Ue.jsxs("form",{onSubmit:d,className:Js.form,ref:p,children:[Ue.jsx("h2",{className:Js.header,children:"Custom hls.js Options"}),Ue.jsxs("div",{className:Js["input-container"],children:[Ue.jsx("textarea",{disabled:s,autoFocus:!0,value:t,title:o,"aria-label":"Player Options","aria-invalid":!!o,"aria-errormessage":o||"",onChange:y=>a(y.currentTarget.value),onFocus:()=>c(""),onBlur:()=>{try{c(""),a(JSON.stringify(JSON.parse(t||"{}"),null,2))}catch(y){c(y.toString())}},className:`${Js.input} ${o?Js["input--invalid"]:""}`}),Ue.jsxs("div",{className:Js["player-info"],children:[Ue.jsx("a",{tabIndex:0,href:"https://github.com/video-dev/hls.js/blob/master/docs/API.md",rel:"noreferrer",target:"_blank",className:Js["api-link"],children:"API Docs"}),Ue.jsxs("div",{className:Js["player-version"],children:["hls.js ",n.HLS.version]})]})]}),Ue.jsxs("div",{className:Js.actions,children:[Ue.jsx("button",{type:"button","aria-label":"Cancel",onClick:()=>e(),className:Js.cancel,children:"Cancel"}),Ue.jsx("button",{type:"submit","aria-label":"Submit",disabled:!!o,className:Js.submit,children:s?Ue.jsx(Lg,{light:!0}):"Submit"})]})]})})})},hne=[["Nose","LEyeIn"],["LEyeIn","LEye"],["LEye","REyeOut"],["REyeOut","LEar"],["Nose","REyeIn"],["REyeIn","REye"],["REye","REyeOut"],["REyeOut","REar"],["MouthL","MouthR"],["LShoulder","RShoulder"],["LShoulder","LElbow"],["LElbow","LWrist"],["LWrist","LPinky"],["LWrist","LIndex"],["LWrist","LThumb"],["LPinky","LIndex"],["RShoulder","RElbow"],["RElbow","RWrist"],["RWrist","RPinky"],["RWrist","RIndex"],["RWrist","RThumb"],["RPinky","RIndex"],["LShoulder","LHip"],["RShoulder","RHip"],["LHip","RHip"],["LHip","LKnee"],["RHip","RKnee"],["LKnee","LAnkle"],["RKnee","RAnkle"],["LAnkle","LHeel"],["RAnkle","RHeel"],["LHeel","LFootIdx"],["RHeel","RFootIdx"],["LAnkle","LFootIdx"],["RAnkle","RFootIdx"]];let yne=5;const mne=({tags:n,portalDimensions:e,videoDimensions:t})=>{const[a,s]=Lt.useState(null);if(Lt.useEffect(()=>{if(!a||!e||t.videoWidth===0)return;a.width=a.getBoundingClientRect().width,a.height=a.getBoundingClientRect().height;const p={r:255,g:255,b:255},d=a.getContext("2d"),y=d.canvas.width,m=d.canvas.height,v=b=>b.toString(16).padStart(2,"0");d.clearRect(0,0,d.canvas.width,d.canvas.height),d.lineWidth=3,!(!n||n.length===0)&&n.forEach(b=>{!b||!b.additional_info||!b.additional_info.pose||(d.lineWidth=3,d.strokeStyle=`#${v(p.r)}${v(p.g)}${v(p.b)}`,d.fillStyle=`#${v(p.r)}${v(p.g)}${v(p.b)}`,d.globalAlpha=.7,Object.values(b.additional_info.pose).forEach(([x,E])=>{d.beginPath(),d.arc(x*y,E*m,1.5,0,2*Math.PI),d.fill(),d.stroke()}),hne.forEach(([x,E])=>{if(!b.additional_info.pose[x]||!b.additional_info.pose[E])return;const[C,T]=b.additional_info.pose[x],[k,M]=b.additional_info.pose[E];d.beginPath(),d.moveTo(C*y,T*m),d.lineTo(k*y,M*m),d.stroke()}))})},[n]),!e||t.videoWidth===0)return null;const u=e.width/e.height,o=t.videoWidth/t.videoHeight;let c={};return u<o?(c.width=e.width,c.height=e.width/o,c.left=0,c.top=(e.height-e.width/o)/2):(c.height=e.height,c.width=e.height*o,c.top=0,c.left=(e.width-e.height*o)/2),Ue.jsx("canvas",{ref:s,style:c,className:ts.overlay})},gne=({player:n})=>{const[e,t]=Lt.useState(null),[a,s]=Lt.useState(null);Lt.useEffect(()=>{const o=new ResizeObserver(()=>t(n.video.getBoundingClientRect()));return o.observe(n.video),()=>{o.disconnect()}},[n.video]),Lt.useEffect(()=>{const o=(n.playoutInfo||{}).frameRate;if(!o)return;const c=()=>{clearInterval(n.__frameInterval),n.__frameInterval=setInterval(()=>s(Math.floor(n.video.currentTime*o)),1e3/n.playoutInfo.frameRate)};n.controls.RegisterVideoEventListener("play",c),n.controls.RegisterVideoEventListener("pause",()=>clearInterval(n.__frameInterval)),n.video.paused||c()},[(n.playoutInfo||{}).frameRate]);let u;for(let o=a;o>a-yne&&(u=n.__poseOverlayTags&&n.__poseOverlayTags[o],!(u&&u.length>0));o--);return Ue.jsx(mne,{tags:u,portalDimensions:e,videoDimensions:{videoWidth:n.video.videoWidth,videoHeight:n.video.videoHeight}})},vne=({player:n})=>{const[e,t]=Lt.useState(void 0),{posterImage:a}=n.controls.GetContentInfo()||{};return Lt.useEffect(()=>{t(void 0),a&&S5({player:n,pathOrUrl:a,width:200}).then(s=>t(s))},[a]),e?Ue.jsx("img",{alt:"Video Poster",src:e,className:ts.poster}):null};let bne;const wne=({target:n,parameters:e,InitCallback:t,ErrorCallback:a,Unmount:s,Reset:u,SetAdditionalParameters:o})=>{const[c,p]=Lt.useState(void 0),[d,y]=Lt.useState(void 0),[m,v]=Lt.useState("lg"),[b,x]=Lt.useState("landscape"),[E,C]=Lt.useState({width:n.getBoundingClientRect().width,height:n.getBoundingClientRect().height}),[T,k]=Lt.useState(void 0),[M,O]=Lt.useState(!1),[R,$]=Lt.useState(!1),[X,se]=Lt.useState(!1),[ye,he]=Lt.useState(!1),[te,re]=Lt.useState(!1),[S,_]=Lt.useState(!1),[P,j]=Lt.useState(!0),[q,z]=Lt.useState(void 0),[Z,W]=Lt.useState(void 0),[D,N]=Lt.useState(!1),[Y,ie]=Lt.useState(!1),V=Lt.useRef(),Ce=!!c,Pe=({action:Ee,text:oe})=>z({action:Ee,text:oe,key:Math.random()});if(Lt.useEffect(()=>{re(!0);const Ee=Wee({target:n,setSize:v,setOrientation:x,setDimensions:C});return()=>{re(!1),Ee&&Ee()}},[]),Lt.useEffect(()=>{if(!(!V||!V.current||!te))try{O(!1),se(!1),e.clientOptions.client=d||e.clientOptions.client;const Ee=new Yw({target:n,video:V.current,parameters:e,SetErrorMessage:k,Reload:u,UpdateParameters:B=>{o(B)}});window.__elvPlayer=Ee;const oe=Ee.controls.RegisterSettingsListener(()=>{W(Ee.controls.AllowRotation()),se(Ee.playbackStarted||Ee.controls&&Ee.controls.IsPlaying()),O(!Ee.loading),_(Ee.__showPlayerProfileForm),N(Ee&&Ee.casting),ie(Ee.controls.OverlayVisible())});Ee.Destroy=()=>{Ee.__DestroyPlayer(),s()},Ee.Reset=()=>{u()};const ce=Kee({player:Ee}),be=Jee({player:Ee,inactivityPeriod:5e3,onWake:()=>j(!0),onSleep:()=>j(!1)}),me=Yee({player:Ee,setRecentUserAction:Pe}),fe=Qee({player:Ee});t(Ee),p(Ee);const _e=Ee.controls.RegisterVideoEventListener("canplay",()=>he(!0)),ne=Ee.controls.RegisterVideoEventListener("play",()=>se(!0));return()=>{oe&&oe(),ce&&ce(),be&&be(),me&&me(),fe&&fe(),_e&&_e(),ne&&ne(),Ee&&Ee.__DestroyPlayer()}}catch(Ee){a(Ee),s()}},[V,te,d]),Lt.useEffect(()=>{setTimeout(()=>$(!0),2e3)},[M]),Lt.useEffect(()=>{if(Ce)return()=>{c&&c.__DestroyPlayer(),p(void 0)}},[Ce]),Lt.useEffect(()=>{q&&(clearTimeout(bne),setTimeout(()=>{z(void 0)},1e3))},[q]),e.clientOptions.promptTicket&&!d)return Ue.jsx(Wte,{parameters:e,dimensions:{size:m,orientation:b,...E},onComplete:Ee=>y(Ee)});const Se=e.playerOptions.ui===Gt.ui.WEB&&c&&c.controls.IsRotatable()&&Z;return Ue.jsxs("div",{role:"complementary","aria-label":"Eluvio Video Player",tabIndex:0,style:{backgroundColor:e.playerOptions.backgroundColor||"transparent","--portal-width":`${Se?E.height:E.width}px`,"--portal-height":`${Se?E.width:E.height}px`},className:[ts["player-container"],Se?ts["player-container--rotated"]:"",`__eluvio-player--size-${m}`,`__eluvio-player--orientation-${b}`].join(" "),children:[!S||!M?null:Ue.jsx(pne,{player:c,Close:()=>c.controls.HidePlayerProfileForm()}),Ue.jsx("video",{playsInline:!0,disablePictureInPicture:!0,ref:V,muted:[Gt.muted.ON,Gt.muted.WHEN_NOT_VISIBLE].includes(e.playerOptions.muted),controls:e.playerOptions.controls===Gt.controls.DEFAULT,loop:e.playerOptions.loop===Gt.loop.ON,crossOrigin:"anonymous",className:ts.video}),!R||!ye||X&&!e.playerOptions.permanentPoster?null:Ue.jsx(vne,{player:c}),Y?Ue.jsx(gne,{player:c}):null,M||T||!e.playerOptions.showLoader?null:Ue.jsx("div",{className:ts["spinner-container"],children:Ue.jsx(Lg,{className:ts.spinner})}),D?Ue.jsx("div",{className:ts["cast-indicator-container"],children:Ue.jsx("div",{dangerouslySetInnerHTML:{__html:bte}})}):null,T?Ue.jsxs("div",{className:ts["error-message"],children:[Ue.jsx("div",{className:ts["error-message__message"],children:T}),Ue.jsxs("button",{className:ts["error-message__copy-debug-button"],onClick:()=>M5(JSON.stringify(c.controls.GetDebugInfo(),null,2)),children:[Ue.jsx(pl,{icon:wte,className:ts["error-message__icon"]}),"Copy Troubleshooting Info"]})]}):null,c?e.playerOptions.ui===Gt.ui.WEB?Ue.jsx(Bte,{player:c,playbackStarted:!!X,canPlay:ye,recentlyInteracted:P,setRecentUserAction:Pe,showOverlay:Y,setShowOverlay:ie,className:ts.controls}):Ue.jsx(ane,{player:c,playbackStarted:!!X,canPlay:ye,recentlyInteracted:P,setRecentUserAction:Pe,className:ts.controls}):null,q?Ue.jsx(Rte,{action:q},`action-indicator-${q&&q.key}`):null]})},_ne=({parameters:n,...e})=>{const[t,a]=Lt.useState(Math.random()),[s,u]=Lt.useState();return Lt.createElement(wne,{...e,SetAdditionalParameters:u,parameters:s?C5(n,s):n,key:`player-${t}`,Reset:()=>a(Math.random())})},xne=(n,e)=>(n.innerHTML="",n.classList.add(mq.reset),n.classList.add(ts["player-target"]),e=nD(e),e.playerOptions&&e.playerOptions.backgroundColor&&(n.style.backgroundColor=e.playerOptions.backgroundColor),new Promise((t,a)=>{const s=Mq.createRoot(n);s.render(Ue.jsx(hq.StrictMode,{children:Ue.jsx(_ne,{target:n,parameters:e,InitCallback:t,ErrorCallback:a,Unmount:async()=>{try{await s.unmount()}catch(u){console.error("Failed to unmount Eluvio Player"),console.error(u)}}})}))}));exports.Initialize=xne;exports.PlayerParameters=Gt;exports.commonjsGlobal=wu;exports.crypto=xL;exports.getDefaultExportFromCjs=Su;exports.require$$3=n_;exports.requireBuffer=Pg;exports.requireEvents=Vg;exports.requireInherits_browser=lN;exports.requireString_decoder=zP;
|