@eluvio/elv-player-js 2.1.2 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.vite/manifest.json +16 -16
- package/dist/{dash.all.min-BL6tNUCs.mjs → dash.all.min-DATTS492.mjs} +1 -1
- package/dist/{dash.all.min-DSdDnxBL.js → dash.all.min-vScx1y_P.js} +1 -1
- package/dist/elv-player-js.cjs.js +1 -1
- package/dist/elv-player-js.es.js +1 -1
- package/dist/hls-BSI-ecIH.js +40 -0
- package/dist/{hls-4X0sH40o.mjs → hls-DhmD3Age.mjs} +5730 -5078
- package/dist/{index-BuOaL0fD.js → index-BVuvRKE0.js} +2 -2
- package/dist/{index-BTJyodYy.mjs → index-D1gU_5OD.mjs} +7 -7
- package/dist/{index-DlJMTNdL.mjs → index-D9dnHpEs.mjs} +1 -1
- package/dist/{index-7GwGdyHP.js → index-DMaSMNU9.js} +1 -1
- package/lib/player/Player.js +3 -3
- package/lib/ui/Common.js +1 -1
- package/package.json +3 -3
- package/dist/hls-AJQ_RujU.js +0 -40
|
@@ -324,7 +324,7 @@ ${p} ${e(s)}
|
|
|
324
324
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
325
325
|
* @license MIT
|
|
326
326
|
*/var V9;function Cp(){return V9||(V9=1,(function(r){const e=hL(),t=yL(),a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;r.Buffer=c,r.SlowBuffer=k,r.INSPECT_MAX_BYTES=50;const s=2147483647;r.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 fe=new Uint8Array(1),Y={foo:function(){return 42}};return Object.setPrototypeOf(Y,Uint8Array.prototype),Object.setPrototypeOf(fe,Y),fe.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(fe){if(fe>s)throw new RangeError('The value "'+fe+'" is invalid for option "size"');const Y=new Uint8Array(fe);return Object.setPrototypeOf(Y,c.prototype),Y}function c(fe,Y,F){if(typeof fe=="number"){if(typeof Y=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return b(fe)}return p(fe,Y,F)}c.poolSize=8192;function p(fe,Y,F){if(typeof fe=="string")return g(fe,Y);if(ArrayBuffer.isView(fe))return S(fe);if(fe==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof fe);if(Re(fe,ArrayBuffer)||fe&&Re(fe.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Re(fe,SharedArrayBuffer)||fe&&Re(fe.buffer,SharedArrayBuffer)))return A(fe,Y,F);if(typeof fe=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const ue=fe.valueOf&&fe.valueOf();if(ue!=null&&ue!==fe)return c.from(ue,Y,F);const Ee=C(fe);if(Ee)return Ee;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof fe[Symbol.toPrimitive]=="function")return c.from(fe[Symbol.toPrimitive]("string"),Y,F);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof fe)}c.from=function(fe,Y,F){return p(fe,Y,F)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array);function d(fe){if(typeof fe!="number")throw new TypeError('"size" argument must be of type number');if(fe<0)throw new RangeError('The value "'+fe+'" is invalid for option "size"')}function y(fe,Y,F){return d(fe),fe<=0?o(fe):Y!==void 0?typeof F=="string"?o(fe).fill(Y,F):o(fe).fill(Y):o(fe)}c.alloc=function(fe,Y,F){return y(fe,Y,F)};function b(fe){return d(fe),o(fe<0?0:M(fe)|0)}c.allocUnsafe=function(fe){return b(fe)},c.allocUnsafeSlow=function(fe){return b(fe)};function g(fe,Y){if((typeof Y!="string"||Y==="")&&(Y="utf8"),!c.isEncoding(Y))throw new TypeError("Unknown encoding: "+Y);const F=T(fe,Y)|0;let ue=o(F);const Ee=ue.write(fe,Y);return Ee!==F&&(ue=ue.slice(0,Ee)),ue}function v(fe){const Y=fe.length<0?0:M(fe.length)|0,F=o(Y);for(let ue=0;ue<Y;ue+=1)F[ue]=fe[ue]&255;return F}function S(fe){if(Re(fe,Uint8Array)){const Y=new Uint8Array(fe);return A(Y.buffer,Y.byteOffset,Y.byteLength)}return v(fe)}function A(fe,Y,F){if(Y<0||fe.byteLength<Y)throw new RangeError('"offset" is outside of buffer bounds');if(fe.byteLength<Y+(F||0))throw new RangeError('"length" is outside of buffer bounds');let ue;return Y===void 0&&F===void 0?ue=new Uint8Array(fe):F===void 0?ue=new Uint8Array(fe,Y):ue=new Uint8Array(fe,Y,F),Object.setPrototypeOf(ue,c.prototype),ue}function C(fe){if(c.isBuffer(fe)){const Y=M(fe.length)|0,F=o(Y);return F.length===0||fe.copy(F,0,0,Y),F}if(fe.length!==void 0)return typeof fe.length!="number"||Ye(fe.length)?o(0):v(fe);if(fe.type==="Buffer"&&Array.isArray(fe.data))return v(fe.data)}function M(fe){if(fe>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return fe|0}function k(fe){return+fe!=fe&&(fe=0),c.alloc(+fe)}c.isBuffer=function(Y){return Y!=null&&Y._isBuffer===!0&&Y!==c.prototype},c.compare=function(Y,F){if(Re(Y,Uint8Array)&&(Y=c.from(Y,Y.offset,Y.byteLength)),Re(F,Uint8Array)&&(F=c.from(F,F.offset,F.byteLength)),!c.isBuffer(Y)||!c.isBuffer(F))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Y===F)return 0;let ue=Y.length,Ee=F.length;for(let Le=0,Fe=Math.min(ue,Ee);Le<Fe;++Le)if(Y[Le]!==F[Le]){ue=Y[Le],Ee=F[Le];break}return ue<Ee?-1:Ee<ue?1:0},c.isEncoding=function(Y){switch(String(Y).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(Y,F){if(!Array.isArray(Y))throw new TypeError('"list" argument must be an Array of Buffers');if(Y.length===0)return c.alloc(0);let ue;if(F===void 0)for(F=0,ue=0;ue<Y.length;++ue)F+=Y[ue].length;const Ee=c.allocUnsafe(F);let Le=0;for(ue=0;ue<Y.length;++ue){let Fe=Y[ue];if(Re(Fe,Uint8Array))Le+Fe.length>Ee.length?(c.isBuffer(Fe)||(Fe=c.from(Fe)),Fe.copy(Ee,Le)):Uint8Array.prototype.set.call(Ee,Fe,Le);else if(c.isBuffer(Fe))Fe.copy(Ee,Le);else throw new TypeError('"list" argument must be an Array of Buffers');Le+=Fe.length}return Ee};function T(fe,Y){if(c.isBuffer(fe))return fe.length;if(ArrayBuffer.isView(fe)||Re(fe,ArrayBuffer))return fe.byteLength;if(typeof fe!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof fe);const F=fe.length,ue=arguments.length>2&&arguments[2]===!0;if(!ue&&F===0)return 0;let Ee=!1;for(;;)switch(Y){case"ascii":case"latin1":case"binary":return F;case"utf8":case"utf-8":return B(fe).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F*2;case"hex":return F>>>1;case"base64":return le(fe).length;default:if(Ee)return ue?-1:B(fe).length;Y=(""+Y).toLowerCase(),Ee=!0}}c.byteLength=T;function R(fe,Y,F){let ue=!1;if((Y===void 0||Y<0)&&(Y=0),Y>this.length||((F===void 0||F>this.length)&&(F=this.length),F<=0)||(F>>>=0,Y>>>=0,F<=Y))return"";for(fe||(fe="utf8");;)switch(fe){case"hex":return ee(this,Y,F);case"utf8":case"utf-8":return _(this,Y,F);case"ascii":return q(this,Y,F);case"latin1":case"binary":return z(this,Y,F);case"base64":return x(this,Y,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G(this,Y,F);default:if(ue)throw new TypeError("Unknown encoding: "+fe);fe=(fe+"").toLowerCase(),ue=!0}}c.prototype._isBuffer=!0;function N(fe,Y,F){const ue=fe[Y];fe[Y]=fe[F],fe[F]=ue}c.prototype.swap16=function(){const Y=this.length;if(Y%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let F=0;F<Y;F+=2)N(this,F,F+1);return this},c.prototype.swap32=function(){const Y=this.length;if(Y%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let F=0;F<Y;F+=4)N(this,F,F+3),N(this,F+1,F+2);return this},c.prototype.swap64=function(){const Y=this.length;if(Y%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let F=0;F<Y;F+=8)N(this,F,F+7),N(this,F+1,F+6),N(this,F+2,F+5),N(this,F+3,F+4);return this},c.prototype.toString=function(){const Y=this.length;return Y===0?"":arguments.length===0?_(this,0,Y):R.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(Y){if(!c.isBuffer(Y))throw new TypeError("Argument must be a Buffer");return this===Y?!0:c.compare(this,Y)===0},c.prototype.inspect=function(){let Y="";const F=r.INSPECT_MAX_BYTES;return Y=this.toString("hex",0,F).replace(/(.{2})/g,"$1 ").trim(),this.length>F&&(Y+=" ... "),"<Buffer "+Y+">"},a&&(c.prototype[a]=c.prototype.inspect),c.prototype.compare=function(Y,F,ue,Ee,Le){if(Re(Y,Uint8Array)&&(Y=c.from(Y,Y.offset,Y.byteLength)),!c.isBuffer(Y))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Y);if(F===void 0&&(F=0),ue===void 0&&(ue=Y?Y.length:0),Ee===void 0&&(Ee=0),Le===void 0&&(Le=this.length),F<0||ue>Y.length||Ee<0||Le>this.length)throw new RangeError("out of range index");if(Ee>=Le&&F>=ue)return 0;if(Ee>=Le)return-1;if(F>=ue)return 1;if(F>>>=0,ue>>>=0,Ee>>>=0,Le>>>=0,this===Y)return 0;let Fe=Le-Ee,dt=ue-F;const Pe=Math.min(Fe,dt),He=this.slice(Ee,Le),ye=Y.slice(F,ue);for(let Je=0;Je<Pe;++Je)if(He[Je]!==ye[Je]){Fe=He[Je],dt=ye[Je];break}return Fe<dt?-1:dt<Fe?1:0};function K(fe,Y,F,ue,Ee){if(fe.length===0)return-1;if(typeof F=="string"?(ue=F,F=0):F>2147483647?F=2147483647:F<-2147483648&&(F=-2147483648),F=+F,Ye(F)&&(F=Ee?0:fe.length-1),F<0&&(F=fe.length+F),F>=fe.length){if(Ee)return-1;F=fe.length-1}else if(F<0)if(Ee)F=0;else return-1;if(typeof Y=="string"&&(Y=c.from(Y,ue)),c.isBuffer(Y))return Y.length===0?-1:X(fe,Y,F,ue,Ee);if(typeof Y=="number")return Y=Y&255,typeof Uint8Array.prototype.indexOf=="function"?Ee?Uint8Array.prototype.indexOf.call(fe,Y,F):Uint8Array.prototype.lastIndexOf.call(fe,Y,F):X(fe,[Y],F,ue,Ee);throw new TypeError("val must be string, number or Buffer")}function X(fe,Y,F,ue,Ee){let Le=1,Fe=fe.length,dt=Y.length;if(ue!==void 0&&(ue=String(ue).toLowerCase(),ue==="ucs2"||ue==="ucs-2"||ue==="utf16le"||ue==="utf-16le")){if(fe.length<2||Y.length<2)return-1;Le=2,Fe/=2,dt/=2,F/=2}function Pe(ye,Je){return Le===1?ye[Je]:ye.readUInt16BE(Je*Le)}let He;if(Ee){let ye=-1;for(He=F;He<Fe;He++)if(Pe(fe,He)===Pe(Y,ye===-1?0:He-ye)){if(ye===-1&&(ye=He),He-ye+1===dt)return ye*Le}else ye!==-1&&(He-=He-ye),ye=-1}else for(F+dt>Fe&&(F=Fe-dt),He=F;He>=0;He--){let ye=!0;for(let Je=0;Je<dt;Je++)if(Pe(fe,He+Je)!==Pe(Y,Je)){ye=!1;break}if(ye)return He}return-1}c.prototype.includes=function(Y,F,ue){return this.indexOf(Y,F,ue)!==-1},c.prototype.indexOf=function(Y,F,ue){return K(this,Y,F,ue,!0)},c.prototype.lastIndexOf=function(Y,F,ue){return K(this,Y,F,ue,!1)};function ie(fe,Y,F,ue){F=Number(F)||0;const Ee=fe.length-F;ue?(ue=Number(ue),ue>Ee&&(ue=Ee)):ue=Ee;const Le=Y.length;ue>Le/2&&(ue=Le/2);let Fe;for(Fe=0;Fe<ue;++Fe){const dt=parseInt(Y.substr(Fe*2,2),16);if(Ye(dt))return Fe;fe[F+Fe]=dt}return Fe}function ge(fe,Y,F,ue){return Ae(B(Y,fe.length-F),fe,F,ue)}function pe(fe,Y,F,ue){return Ae(V(Y),fe,F,ue)}function te(fe,Y,F,ue){return Ae(le(Y),fe,F,ue)}function se(fe,Y,F,ue){return Ae(Q(Y,fe.length-F),fe,F,ue)}c.prototype.write=function(Y,F,ue,Ee){if(F===void 0)Ee="utf8",ue=this.length,F=0;else if(ue===void 0&&typeof F=="string")Ee=F,ue=this.length,F=0;else if(isFinite(F))F=F>>>0,isFinite(ue)?(ue=ue>>>0,Ee===void 0&&(Ee="utf8")):(Ee=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),Y.length>0&&(ue<0||F<0)||F>this.length)throw new RangeError("Attempt to write outside buffer bounds");Ee||(Ee="utf8");let Fe=!1;for(;;)switch(Ee){case"hex":return ie(this,Y,F,ue);case"utf8":case"utf-8":return ge(this,Y,F,ue);case"ascii":case"latin1":case"binary":return pe(this,Y,F,ue);case"base64":return te(this,Y,F,ue);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return se(this,Y,F,ue);default:if(Fe)throw new TypeError("Unknown encoding: "+Ee);Ee=(""+Ee).toLowerCase(),Fe=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function x(fe,Y,F){return Y===0&&F===fe.length?e.fromByteArray(fe):e.fromByteArray(fe.slice(Y,F))}function _(fe,Y,F){F=Math.min(fe.length,F);const ue=[];let Ee=Y;for(;Ee<F;){const Le=fe[Ee];let Fe=null,dt=Le>239?4:Le>223?3:Le>191?2:1;if(Ee+dt<=F){let Pe,He,ye,Je;switch(dt){case 1:Le<128&&(Fe=Le);break;case 2:Pe=fe[Ee+1],(Pe&192)===128&&(Je=(Le&31)<<6|Pe&63,Je>127&&(Fe=Je));break;case 3:Pe=fe[Ee+1],He=fe[Ee+2],(Pe&192)===128&&(He&192)===128&&(Je=(Le&15)<<12|(Pe&63)<<6|He&63,Je>2047&&(Je<55296||Je>57343)&&(Fe=Je));break;case 4:Pe=fe[Ee+1],He=fe[Ee+2],ye=fe[Ee+3],(Pe&192)===128&&(He&192)===128&&(ye&192)===128&&(Je=(Le&15)<<18|(Pe&63)<<12|(He&63)<<6|ye&63,Je>65535&&Je<1114112&&(Fe=Je))}}Fe===null?(Fe=65533,dt=1):Fe>65535&&(Fe-=65536,ue.push(Fe>>>10&1023|55296),Fe=56320|Fe&1023),ue.push(Fe),Ee+=dt}return j(ue)}const P=4096;function j(fe){const Y=fe.length;if(Y<=P)return String.fromCharCode.apply(String,fe);let F="",ue=0;for(;ue<Y;)F+=String.fromCharCode.apply(String,fe.slice(ue,ue+=P));return F}function q(fe,Y,F){let ue="";F=Math.min(fe.length,F);for(let Ee=Y;Ee<F;++Ee)ue+=String.fromCharCode(fe[Ee]&127);return ue}function z(fe,Y,F){let ue="";F=Math.min(fe.length,F);for(let Ee=Y;Ee<F;++Ee)ue+=String.fromCharCode(fe[Ee]);return ue}function ee(fe,Y,F){const ue=fe.length;(!Y||Y<0)&&(Y=0),(!F||F<0||F>ue)&&(F=ue);let Ee="";for(let Le=Y;Le<F;++Le)Ee+=lt[fe[Le]];return Ee}function G(fe,Y,F){const ue=fe.slice(Y,F);let Ee="";for(let Le=0;Le<ue.length-1;Le+=2)Ee+=String.fromCharCode(ue[Le]+ue[Le+1]*256);return Ee}c.prototype.slice=function(Y,F){const ue=this.length;Y=~~Y,F=F===void 0?ue:~~F,Y<0?(Y+=ue,Y<0&&(Y=0)):Y>ue&&(Y=ue),F<0?(F+=ue,F<0&&(F=0)):F>ue&&(F=ue),F<Y&&(F=Y);const Ee=this.subarray(Y,F);return Object.setPrototypeOf(Ee,c.prototype),Ee};function D(fe,Y,F){if(fe%1!==0||fe<0)throw new RangeError("offset is not uint");if(fe+Y>F)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(Y,F,ue){Y=Y>>>0,F=F>>>0,ue||D(Y,F,this.length);let Ee=this[Y],Le=1,Fe=0;for(;++Fe<F&&(Le*=256);)Ee+=this[Y+Fe]*Le;return Ee},c.prototype.readUintBE=c.prototype.readUIntBE=function(Y,F,ue){Y=Y>>>0,F=F>>>0,ue||D(Y,F,this.length);let Ee=this[Y+--F],Le=1;for(;F>0&&(Le*=256);)Ee+=this[Y+--F]*Le;return Ee},c.prototype.readUint8=c.prototype.readUInt8=function(Y,F){return Y=Y>>>0,F||D(Y,1,this.length),this[Y]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(Y,F){return Y=Y>>>0,F||D(Y,2,this.length),this[Y]|this[Y+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(Y,F){return Y=Y>>>0,F||D(Y,2,this.length),this[Y]<<8|this[Y+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(Y,F){return Y=Y>>>0,F||D(Y,4,this.length),(this[Y]|this[Y+1]<<8|this[Y+2]<<16)+this[Y+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(Y,F){return Y=Y>>>0,F||D(Y,4,this.length),this[Y]*16777216+(this[Y+1]<<16|this[Y+2]<<8|this[Y+3])},c.prototype.readBigUInt64LE=et(function(Y){Y=Y>>>0,me(Y,"offset");const F=this[Y],ue=this[Y+7];(F===void 0||ue===void 0)&&de(Y,this.length-8);const Ee=F+this[++Y]*2**8+this[++Y]*2**16+this[++Y]*2**24,Le=this[++Y]+this[++Y]*2**8+this[++Y]*2**16+ue*2**24;return BigInt(Ee)+(BigInt(Le)<<BigInt(32))}),c.prototype.readBigUInt64BE=et(function(Y){Y=Y>>>0,me(Y,"offset");const F=this[Y],ue=this[Y+7];(F===void 0||ue===void 0)&&de(Y,this.length-8);const Ee=F*2**24+this[++Y]*2**16+this[++Y]*2**8+this[++Y],Le=this[++Y]*2**24+this[++Y]*2**16+this[++Y]*2**8+ue;return(BigInt(Ee)<<BigInt(32))+BigInt(Le)}),c.prototype.readIntLE=function(Y,F,ue){Y=Y>>>0,F=F>>>0,ue||D(Y,F,this.length);let Ee=this[Y],Le=1,Fe=0;for(;++Fe<F&&(Le*=256);)Ee+=this[Y+Fe]*Le;return Le*=128,Ee>=Le&&(Ee-=Math.pow(2,8*F)),Ee},c.prototype.readIntBE=function(Y,F,ue){Y=Y>>>0,F=F>>>0,ue||D(Y,F,this.length);let Ee=F,Le=1,Fe=this[Y+--Ee];for(;Ee>0&&(Le*=256);)Fe+=this[Y+--Ee]*Le;return Le*=128,Fe>=Le&&(Fe-=Math.pow(2,8*F)),Fe},c.prototype.readInt8=function(Y,F){return Y=Y>>>0,F||D(Y,1,this.length),this[Y]&128?(255-this[Y]+1)*-1:this[Y]},c.prototype.readInt16LE=function(Y,F){Y=Y>>>0,F||D(Y,2,this.length);const ue=this[Y]|this[Y+1]<<8;return ue&32768?ue|4294901760:ue},c.prototype.readInt16BE=function(Y,F){Y=Y>>>0,F||D(Y,2,this.length);const ue=this[Y+1]|this[Y]<<8;return ue&32768?ue|4294901760:ue},c.prototype.readInt32LE=function(Y,F){return Y=Y>>>0,F||D(Y,4,this.length),this[Y]|this[Y+1]<<8|this[Y+2]<<16|this[Y+3]<<24},c.prototype.readInt32BE=function(Y,F){return Y=Y>>>0,F||D(Y,4,this.length),this[Y]<<24|this[Y+1]<<16|this[Y+2]<<8|this[Y+3]},c.prototype.readBigInt64LE=et(function(Y){Y=Y>>>0,me(Y,"offset");const F=this[Y],ue=this[Y+7];(F===void 0||ue===void 0)&&de(Y,this.length-8);const Ee=this[Y+4]+this[Y+5]*2**8+this[Y+6]*2**16+(ue<<24);return(BigInt(Ee)<<BigInt(32))+BigInt(F+this[++Y]*2**8+this[++Y]*2**16+this[++Y]*2**24)}),c.prototype.readBigInt64BE=et(function(Y){Y=Y>>>0,me(Y,"offset");const F=this[Y],ue=this[Y+7];(F===void 0||ue===void 0)&&de(Y,this.length-8);const Ee=(F<<24)+this[++Y]*2**16+this[++Y]*2**8+this[++Y];return(BigInt(Ee)<<BigInt(32))+BigInt(this[++Y]*2**24+this[++Y]*2**16+this[++Y]*2**8+ue)}),c.prototype.readFloatLE=function(Y,F){return Y=Y>>>0,F||D(Y,4,this.length),t.read(this,Y,!0,23,4)},c.prototype.readFloatBE=function(Y,F){return Y=Y>>>0,F||D(Y,4,this.length),t.read(this,Y,!1,23,4)},c.prototype.readDoubleLE=function(Y,F){return Y=Y>>>0,F||D(Y,8,this.length),t.read(this,Y,!0,52,8)},c.prototype.readDoubleBE=function(Y,F){return Y=Y>>>0,F||D(Y,8,this.length),t.read(this,Y,!1,52,8)};function L(fe,Y,F,ue,Ee,Le){if(!c.isBuffer(fe))throw new TypeError('"buffer" argument must be a Buffer instance');if(Y>Ee||Y<Le)throw new RangeError('"value" argument is out of bounds');if(F+ue>fe.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(Y,F,ue,Ee){if(Y=+Y,F=F>>>0,ue=ue>>>0,!Ee){const dt=Math.pow(2,8*ue)-1;L(this,Y,F,ue,dt,0)}let Le=1,Fe=0;for(this[F]=Y&255;++Fe<ue&&(Le*=256);)this[F+Fe]=Y/Le&255;return F+ue},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(Y,F,ue,Ee){if(Y=+Y,F=F>>>0,ue=ue>>>0,!Ee){const dt=Math.pow(2,8*ue)-1;L(this,Y,F,ue,dt,0)}let Le=ue-1,Fe=1;for(this[F+Le]=Y&255;--Le>=0&&(Fe*=256);)this[F+Le]=Y/Fe&255;return F+ue},c.prototype.writeUint8=c.prototype.writeUInt8=function(Y,F,ue){return Y=+Y,F=F>>>0,ue||L(this,Y,F,1,255,0),this[F]=Y&255,F+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(Y,F,ue){return Y=+Y,F=F>>>0,ue||L(this,Y,F,2,65535,0),this[F]=Y&255,this[F+1]=Y>>>8,F+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(Y,F,ue){return Y=+Y,F=F>>>0,ue||L(this,Y,F,2,65535,0),this[F]=Y>>>8,this[F+1]=Y&255,F+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(Y,F,ue){return Y=+Y,F=F>>>0,ue||L(this,Y,F,4,4294967295,0),this[F+3]=Y>>>24,this[F+2]=Y>>>16,this[F+1]=Y>>>8,this[F]=Y&255,F+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(Y,F,ue){return Y=+Y,F=F>>>0,ue||L(this,Y,F,4,4294967295,0),this[F]=Y>>>24,this[F+1]=Y>>>16,this[F+2]=Y>>>8,this[F+3]=Y&255,F+4};function J(fe,Y,F,ue,Ee){be(Y,ue,Ee,fe,F,7);let Le=Number(Y&BigInt(4294967295));fe[F++]=Le,Le=Le>>8,fe[F++]=Le,Le=Le>>8,fe[F++]=Le,Le=Le>>8,fe[F++]=Le;let Fe=Number(Y>>BigInt(32)&BigInt(4294967295));return fe[F++]=Fe,Fe=Fe>>8,fe[F++]=Fe,Fe=Fe>>8,fe[F++]=Fe,Fe=Fe>>8,fe[F++]=Fe,F}function ae(fe,Y,F,ue,Ee){be(Y,ue,Ee,fe,F,7);let Le=Number(Y&BigInt(4294967295));fe[F+7]=Le,Le=Le>>8,fe[F+6]=Le,Le=Le>>8,fe[F+5]=Le,Le=Le>>8,fe[F+4]=Le;let Fe=Number(Y>>BigInt(32)&BigInt(4294967295));return fe[F+3]=Fe,Fe=Fe>>8,fe[F+2]=Fe,Fe=Fe>>8,fe[F+1]=Fe,Fe=Fe>>8,fe[F]=Fe,F+8}c.prototype.writeBigUInt64LE=et(function(Y,F=0){return J(this,Y,F,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=et(function(Y,F=0){return ae(this,Y,F,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(Y,F,ue,Ee){if(Y=+Y,F=F>>>0,!Ee){const Pe=Math.pow(2,8*ue-1);L(this,Y,F,ue,Pe-1,-Pe)}let Le=0,Fe=1,dt=0;for(this[F]=Y&255;++Le<ue&&(Fe*=256);)Y<0&&dt===0&&this[F+Le-1]!==0&&(dt=1),this[F+Le]=(Y/Fe>>0)-dt&255;return F+ue},c.prototype.writeIntBE=function(Y,F,ue,Ee){if(Y=+Y,F=F>>>0,!Ee){const Pe=Math.pow(2,8*ue-1);L(this,Y,F,ue,Pe-1,-Pe)}let Le=ue-1,Fe=1,dt=0;for(this[F+Le]=Y&255;--Le>=0&&(Fe*=256);)Y<0&&dt===0&&this[F+Le+1]!==0&&(dt=1),this[F+Le]=(Y/Fe>>0)-dt&255;return F+ue},c.prototype.writeInt8=function(Y,F,ue){return Y=+Y,F=F>>>0,ue||L(this,Y,F,1,127,-128),Y<0&&(Y=255+Y+1),this[F]=Y&255,F+1},c.prototype.writeInt16LE=function(Y,F,ue){return Y=+Y,F=F>>>0,ue||L(this,Y,F,2,32767,-32768),this[F]=Y&255,this[F+1]=Y>>>8,F+2},c.prototype.writeInt16BE=function(Y,F,ue){return Y=+Y,F=F>>>0,ue||L(this,Y,F,2,32767,-32768),this[F]=Y>>>8,this[F+1]=Y&255,F+2},c.prototype.writeInt32LE=function(Y,F,ue){return Y=+Y,F=F>>>0,ue||L(this,Y,F,4,2147483647,-2147483648),this[F]=Y&255,this[F+1]=Y>>>8,this[F+2]=Y>>>16,this[F+3]=Y>>>24,F+4},c.prototype.writeInt32BE=function(Y,F,ue){return Y=+Y,F=F>>>0,ue||L(this,Y,F,4,2147483647,-2147483648),Y<0&&(Y=4294967295+Y+1),this[F]=Y>>>24,this[F+1]=Y>>>16,this[F+2]=Y>>>8,this[F+3]=Y&255,F+4},c.prototype.writeBigInt64LE=et(function(Y,F=0){return J(this,Y,F,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=et(function(Y,F=0){return ae(this,Y,F,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function H(fe,Y,F,ue,Ee,Le){if(F+ue>fe.length)throw new RangeError("Index out of range");if(F<0)throw new RangeError("Index out of range")}function Ce(fe,Y,F,ue,Ee){return Y=+Y,F=F>>>0,Ee||H(fe,Y,F,4),t.write(fe,Y,F,ue,23,4),F+4}c.prototype.writeFloatLE=function(Y,F,ue){return Ce(this,Y,F,!0,ue)},c.prototype.writeFloatBE=function(Y,F,ue){return Ce(this,Y,F,!1,ue)};function Ie(fe,Y,F,ue,Ee){return Y=+Y,F=F>>>0,Ee||H(fe,Y,F,8),t.write(fe,Y,F,ue,52,8),F+8}c.prototype.writeDoubleLE=function(Y,F,ue){return Ie(this,Y,F,!0,ue)},c.prototype.writeDoubleBE=function(Y,F,ue){return Ie(this,Y,F,!1,ue)},c.prototype.copy=function(Y,F,ue,Ee){if(!c.isBuffer(Y))throw new TypeError("argument should be a Buffer");if(ue||(ue=0),!Ee&&Ee!==0&&(Ee=this.length),F>=Y.length&&(F=Y.length),F||(F=0),Ee>0&&Ee<ue&&(Ee=ue),Ee===ue||Y.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(Ee<0)throw new RangeError("sourceEnd out of bounds");Ee>this.length&&(Ee=this.length),Y.length-F<Ee-ue&&(Ee=Y.length-F+ue);const Le=Ee-ue;return this===Y&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(F,ue,Ee):Uint8Array.prototype.set.call(Y,this.subarray(ue,Ee),F),Le},c.prototype.fill=function(Y,F,ue,Ee){if(typeof Y=="string"){if(typeof F=="string"?(Ee=F,F=0,ue=this.length):typeof ue=="string"&&(Ee=ue,ue=this.length),Ee!==void 0&&typeof Ee!="string")throw new TypeError("encoding must be a string");if(typeof Ee=="string"&&!c.isEncoding(Ee))throw new TypeError("Unknown encoding: "+Ee);if(Y.length===1){const Fe=Y.charCodeAt(0);(Ee==="utf8"&&Fe<128||Ee==="latin1")&&(Y=Fe)}}else typeof Y=="number"?Y=Y&255:typeof Y=="boolean"&&(Y=Number(Y));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,Y||(Y=0);let Le;if(typeof Y=="number")for(Le=F;Le<ue;++Le)this[Le]=Y;else{const Fe=c.isBuffer(Y)?Y:c.from(Y,Ee),dt=Fe.length;if(dt===0)throw new TypeError('The value "'+Y+'" is invalid for argument "value"');for(Le=0;Le<ue-F;++Le)this[Le+F]=Fe[Le%dt]}return this};const Se={};function Me(fe,Y,F){Se[fe]=class extends F{constructor(){super(),Object.defineProperty(this,"message",{value:Y.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${fe}]`,this.stack,delete this.name}get code(){return fe}set code(Ee){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Ee,writable:!0})}toString(){return`${this.name} [${fe}]: ${this.message}`}}}Me("ERR_BUFFER_OUT_OF_BOUNDS",function(fe){return fe?`${fe} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Me("ERR_INVALID_ARG_TYPE",function(fe,Y){return`The "${fe}" argument must be of type number. Received type ${typeof Y}`},TypeError),Me("ERR_OUT_OF_RANGE",function(fe,Y,F){let ue=`The value of "${fe}" is out of range.`,Ee=F;return Number.isInteger(F)&&Math.abs(F)>2**32?Ee=oe(String(F)):typeof F=="bigint"&&(Ee=String(F),(F>BigInt(2)**BigInt(32)||F<-(BigInt(2)**BigInt(32)))&&(Ee=oe(Ee)),Ee+="n"),ue+=` It must be ${Y}. Received ${Ee}`,ue},RangeError);function oe(fe){let Y="",F=fe.length;const ue=fe[0]==="-"?1:0;for(;F>=ue+4;F-=3)Y=`_${fe.slice(F-3,F)}${Y}`;return`${fe.slice(0,F)}${Y}`}function ce(fe,Y,F){me(Y,"offset"),(fe[Y]===void 0||fe[Y+F]===void 0)&&de(Y,fe.length-(F+1))}function be(fe,Y,F,ue,Ee,Le){if(fe>F||fe<Y){const Fe=typeof Y=="bigint"?"n":"";let dt;throw Y===0||Y===BigInt(0)?dt=`>= 0${Fe} and < 2${Fe} ** ${(Le+1)*8}${Fe}`:dt=`>= -(2${Fe} ** ${(Le+1)*8-1}${Fe}) and < 2 ** ${(Le+1)*8-1}${Fe}`,new Se.ERR_OUT_OF_RANGE("value",dt,fe)}ce(ue,Ee,Le)}function me(fe,Y){if(typeof fe!="number")throw new Se.ERR_INVALID_ARG_TYPE(Y,"number",fe)}function de(fe,Y,F){throw Math.floor(fe)!==fe?(me(fe,F),new Se.ERR_OUT_OF_RANGE("offset","an integer",fe)):Y<0?new Se.ERR_BUFFER_OUT_OF_BOUNDS:new Se.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${Y}`,fe)}const xe=/[^+/0-9A-Za-z-_]/g;function ne(fe){if(fe=fe.split("=")[0],fe=fe.trim().replace(xe,""),fe.length<2)return"";for(;fe.length%4!==0;)fe=fe+"=";return fe}function B(fe,Y){Y=Y||1/0;let F;const ue=fe.length;let Ee=null;const Le=[];for(let Fe=0;Fe<ue;++Fe){if(F=fe.charCodeAt(Fe),F>55295&&F<57344){if(!Ee){if(F>56319){(Y-=3)>-1&&Le.push(239,191,189);continue}else if(Fe+1===ue){(Y-=3)>-1&&Le.push(239,191,189);continue}Ee=F;continue}if(F<56320){(Y-=3)>-1&&Le.push(239,191,189),Ee=F;continue}F=(Ee-55296<<10|F-56320)+65536}else Ee&&(Y-=3)>-1&&Le.push(239,191,189);if(Ee=null,F<128){if((Y-=1)<0)break;Le.push(F)}else if(F<2048){if((Y-=2)<0)break;Le.push(F>>6|192,F&63|128)}else if(F<65536){if((Y-=3)<0)break;Le.push(F>>12|224,F>>6&63|128,F&63|128)}else if(F<1114112){if((Y-=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 V(fe){const Y=[];for(let F=0;F<fe.length;++F)Y.push(fe.charCodeAt(F)&255);return Y}function Q(fe,Y){let F,ue,Ee;const Le=[];for(let Fe=0;Fe<fe.length&&!((Y-=2)<0);++Fe)F=fe.charCodeAt(Fe),ue=F>>8,Ee=F%256,Le.push(Ee),Le.push(ue);return Le}function le(fe){return e.toByteArray(ne(fe))}function Ae(fe,Y,F,ue){let Ee;for(Ee=0;Ee<ue&&!(Ee+F>=Y.length||Ee>=fe.length);++Ee)Y[Ee+F]=fe[Ee];return Ee}function Re(fe,Y){return fe instanceof Y||fe!=null&&fe.constructor!=null&&fe.constructor.name!=null&&fe.constructor.name===Y.name}function Ye(fe){return fe!==fe}const lt=(function(){const fe="0123456789abcdef",Y=new Array(256);for(let F=0;F<16;++F){const ue=F*16;for(let Ee=0;Ee<16;++Ee)Y[ue+Ee]=fe[F]+fe[Ee]}return Y})();function et(fe){return typeof BigInt>"u"?xt:fe}function xt(){throw new Error("BigInt not supported")}})(yE)),yE}var mE,$9;function oa(){return $9||($9=1,mE={ArrayIsArray(r){return Array.isArray(r)},ArrayPrototypeIncludes(r,e){return r.includes(e)},ArrayPrototypeIndexOf(r,e){return r.indexOf(e)},ArrayPrototypeJoin(r,e){return r.join(e)},ArrayPrototypeMap(r,e){return r.map(e)},ArrayPrototypePop(r,e){return r.pop(e)},ArrayPrototypePush(r,e){return r.push(e)},ArrayPrototypeSlice(r,e,t){return r.slice(e,t)},Error,FunctionPrototypeCall(r,e,...t){return r.call(e,...t)},FunctionPrototypeSymbolHasInstance(r,e){return Function.prototype[Symbol.hasInstance].call(r,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(r,e){return Object.defineProperties(r,e)},ObjectDefineProperty(r,e,t){return Object.defineProperty(r,e,t)},ObjectGetOwnPropertyDescriptor(r,e){return Object.getOwnPropertyDescriptor(r,e)},ObjectKeys(r){return Object.keys(r)},ObjectSetPrototypeOf(r,e){return Object.setPrototypeOf(r,e)},Promise,PromisePrototypeCatch(r,e){return r.catch(e)},PromisePrototypeThen(r,e,t){return r.then(e,t)},PromiseReject(r){return Promise.reject(r)},PromiseResolve(r){return Promise.resolve(r)},ReflectApply:Reflect.apply,RegExpPrototypeTest(r,e){return r.test(e)},SafeSet:Set,String,StringPrototypeSlice(r,e,t){return r.slice(e,t)},StringPrototypeToLowerCase(r){return r.toLowerCase()},StringPrototypeToUpperCase(r){return r.toUpperCase()},StringPrototypeTrim(r){return r.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(r,e,t){return r.set(e,t)},Boolean,Uint8Array}),mE}var gE={exports:{}},eg={exports:{}},G9;function Mg(){if(G9)return eg.exports;G9=1;const{AbortController:r,AbortSignal:e}=typeof self<"u"?self:typeof window<"u"?window:void 0;return eg.exports=r,eg.exports.AbortSignal=e,eg.exports.default=r,eg.exports}var uw={exports:{}},W9;function jg(){if(W9)return uw.exports;W9=1;var r=typeof Reflect=="object"?Reflect:null,e=r&&typeof r.apply=="function"?r.apply:function(N,K,X){return Function.prototype.apply.call(N,K,X)},t;r&&typeof r.ownKeys=="function"?t=r.ownKeys:Object.getOwnPropertySymbols?t=function(N){return Object.getOwnPropertyNames(N).concat(Object.getOwnPropertySymbols(N))}:t=function(N){return Object.getOwnPropertyNames(N)};function a(R){console&&console.warn&&console.warn(R)}var s=Number.isNaN||function(N){return N!==N};function u(){u.init.call(this)}uw.exports=u,uw.exports.once=M,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var o=10;function c(R){if(typeof R!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof R)}Object.defineProperty(u,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(R){if(typeof R!="number"||R<0||s(R))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+R+".");o=R}}),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(N){if(typeof N!="number"||N<0||s(N))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+N+".");return this._maxListeners=N,this};function p(R){return R._maxListeners===void 0?u.defaultMaxListeners:R._maxListeners}u.prototype.getMaxListeners=function(){return p(this)},u.prototype.emit=function(N){for(var K=[],X=1;X<arguments.length;X++)K.push(arguments[X]);var ie=N==="error",ge=this._events;if(ge!==void 0)ie=ie&&ge.error===void 0;else if(!ie)return!1;if(ie){var pe;if(K.length>0&&(pe=K[0]),pe instanceof Error)throw pe;var te=new Error("Unhandled error."+(pe?" ("+pe.message+")":""));throw te.context=pe,te}var se=ge[N];if(se===void 0)return!1;if(typeof se=="function")e(se,this,K);else for(var x=se.length,_=S(se,x),X=0;X<x;++X)e(_[X],this,K);return!0};function d(R,N,K,X){var ie,ge,pe;if(c(K),ge=R._events,ge===void 0?(ge=R._events=Object.create(null),R._eventsCount=0):(ge.newListener!==void 0&&(R.emit("newListener",N,K.listener?K.listener:K),ge=R._events),pe=ge[N]),pe===void 0)pe=ge[N]=K,++R._eventsCount;else if(typeof pe=="function"?pe=ge[N]=X?[K,pe]:[pe,K]:X?pe.unshift(K):pe.push(K),ie=p(R),ie>0&&pe.length>ie&&!pe.warned){pe.warned=!0;var te=new Error("Possible EventEmitter memory leak detected. "+pe.length+" "+String(N)+" listeners added. Use emitter.setMaxListeners() to increase limit");te.name="MaxListenersExceededWarning",te.emitter=R,te.type=N,te.count=pe.length,a(te)}return R}u.prototype.addListener=function(N,K){return d(this,N,K,!1)},u.prototype.on=u.prototype.addListener,u.prototype.prependListener=function(N,K){return d(this,N,K,!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 b(R,N,K){var X={fired:!1,wrapFn:void 0,target:R,type:N,listener:K},ie=y.bind(X);return ie.listener=K,X.wrapFn=ie,ie}u.prototype.once=function(N,K){return c(K),this.on(N,b(this,N,K)),this},u.prototype.prependOnceListener=function(N,K){return c(K),this.prependListener(N,b(this,N,K)),this},u.prototype.removeListener=function(N,K){var X,ie,ge,pe,te;if(c(K),ie=this._events,ie===void 0)return this;if(X=ie[N],X===void 0)return this;if(X===K||X.listener===K)--this._eventsCount===0?this._events=Object.create(null):(delete ie[N],ie.removeListener&&this.emit("removeListener",N,X.listener||K));else if(typeof X!="function"){for(ge=-1,pe=X.length-1;pe>=0;pe--)if(X[pe]===K||X[pe].listener===K){te=X[pe].listener,ge=pe;break}if(ge<0)return this;ge===0?X.shift():A(X,ge),X.length===1&&(ie[N]=X[0]),ie.removeListener!==void 0&&this.emit("removeListener",N,te||K)}return this},u.prototype.off=u.prototype.removeListener,u.prototype.removeAllListeners=function(N){var K,X,ie;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[N]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete X[N]),this;if(arguments.length===0){var ge=Object.keys(X),pe;for(ie=0;ie<ge.length;++ie)pe=ge[ie],pe!=="removeListener"&&this.removeAllListeners(pe);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(K=X[N],typeof K=="function")this.removeListener(N,K);else if(K!==void 0)for(ie=K.length-1;ie>=0;ie--)this.removeListener(N,K[ie]);return this};function g(R,N,K){var X=R._events;if(X===void 0)return[];var ie=X[N];return ie===void 0?[]:typeof ie=="function"?K?[ie.listener||ie]:[ie]:K?C(ie):S(ie,ie.length)}u.prototype.listeners=function(N){return g(this,N,!0)},u.prototype.rawListeners=function(N){return g(this,N,!1)},u.listenerCount=function(R,N){return typeof R.listenerCount=="function"?R.listenerCount(N):v.call(R,N)},u.prototype.listenerCount=v;function v(R){var N=this._events;if(N!==void 0){var K=N[R];if(typeof K=="function")return 1;if(K!==void 0)return K.length}return 0}u.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function S(R,N){for(var K=new Array(N),X=0;X<N;++X)K[X]=R[X];return K}function A(R,N){for(;N+1<R.length;N++)R[N]=R[N+1];R.pop()}function C(R){for(var N=new Array(R.length),K=0;K<N.length;++K)N[K]=R[K].listener||R[K];return N}function M(R,N){return new Promise(function(K,X){function ie(pe){R.removeListener(N,ge),X(pe)}function ge(){typeof R.removeListener=="function"&&R.removeListener("error",ie),K([].slice.call(arguments))}T(R,N,ge,{once:!0}),N!=="error"&&k(R,ie,{once:!0})})}function k(R,N,K){typeof R.on=="function"&&T(R,"error",N,K)}function T(R,N,K,X){if(typeof R.on=="function")X.once?R.once(N,K):R.on(N,K);else if(typeof R.addEventListener=="function")R.addEventListener(N,function ie(ge){X.once&&R.removeEventListener(N,ie),K(ge)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof R)}return uw.exports}var K9;function as(){return K9||(K9=1,(function(r){const e=Cp(),{kResistStopPropagation:t,SymbolDispose:a}=oa(),s=globalThis.AbortSignal||Mg().AbortSignal,u=globalThis.AbortController||Mg().AbortController,o=Object.getPrototypeOf(async function(){}).constructor,c=globalThis.Blob||e.Blob,p=typeof c<"u"?function(v){return v instanceof c}:function(v){return!1},d=(g,v)=>{if(g!==void 0&&(g===null||typeof g!="object"||!("aborted"in g)))throw new ERR_INVALID_ARG_TYPE(v,"AbortSignal",g)},y=(g,v)=>{if(typeof g!="function")throw new ERR_INVALID_ARG_TYPE(v,"Function",g)};class b extends Error{constructor(v){if(!Array.isArray(v))throw new TypeError(`Expected input to be an Array, got ${typeof v}`);let S="";for(let A=0;A<v.length;A++)S+=` ${v[A].stack}
|
|
327
|
-
`;super(S),this.name="AggregateError",this.errors=v}}r.exports={AggregateError:b,kEmptyObject:Object.freeze({}),once(g){let v=!1;return function(...S){v||(v=!0,g.apply(this,S))}},createDeferredPromise:function(){let g,v;return{promise:new Promise((A,C)=>{g=A,v=C}),resolve:g,reject:v}},promisify(g){return new Promise((v,S)=>{g((A,...C)=>A?S(A):v(...C))})},debuglog(){return function(){}},format(g,...v){return g.replace(/%([sdifj])/g,function(...[S,A]){const C=v.shift();return A==="f"?C.toFixed(6):A==="j"?JSON.stringify(C):A==="s"&&typeof C=="object"?`${C.constructor!==Object?C.constructor.name:""} {}`.trim():C.toString()})},inspect(g){switch(typeof g){case"string":if(g.includes("'"))if(g.includes('"')){if(!g.includes("`")&&!g.includes("${"))return`\`${g}\``}else return`"${g}"`;return`'${g}'`;case"number":return isNaN(g)?"NaN":Object.is(g,-0)?String(g):g;case"bigint":return`${String(g)}n`;case"boolean":case"undefined":return String(g);case"object":return"{}"}},types:{isAsyncFunction(g){return g instanceof o},isArrayBufferView(g){return ArrayBuffer.isView(g)}},isBlob:p,deprecate(g,v){return g},addAbortListener:jg().addAbortListener||function(v,S){if(v===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",v);d(v,"signal"),y(S,"listener");let A;return v.aborted?queueMicrotask(()=>S()):(v.addEventListener("abort",S,{__proto__:null,once:!0,[t]:!0}),A=()=>{v.removeEventListener("abort",S)}),{__proto__:null,[a](){var C;(C=A)===null||C===void 0||C()}}},AbortSignalAny:s.any||function(v){if(v.length===1)return v[0];const S=new u,A=()=>S.abort();return v.forEach(C=>{d(C,"signals"),C.addEventListener("abort",A,{once:!0})}),S.signal.addEventListener("abort",()=>{v.forEach(C=>C.removeEventListener("abort",A))},{once:!0}),S.signal}},r.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(gE)),gE.exports}var lw={},vE,Y9;function Ls(){if(Y9)return vE;Y9=1;const{format:r,inspect:e,AggregateError:t}=as(),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,M){if(!C)throw new p.ERR_INTERNAL_ASSERTION(M)}function y(C){let M="",k=C.length;const T=C[0]==="-"?1:0;for(;k>=T+4;k-=3)M=`_${C.slice(k-3,k)}${M}`;return`${C.slice(0,k)}${M}`}function b(C,M,k){if(typeof M=="function")return d(M.length<=k.length,`Code: ${C}; The provided arguments length (${k.length}) does not match the required ones (${M.length}).`),M(...k);const T=(M.match(/%[dfijoOs]/g)||[]).length;return d(T===k.length,`Code: ${C}; The provided arguments length (${k.length}) does not match the required ones (${T}).`),k.length===0?M:r(M,...k)}function g(C,M,k){k||(k=Error);class T extends k{constructor(...N){super(b(C,M,N))}toString(){return`${this.name} [${C}]: ${this.message}`}}Object.defineProperties(T.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}}),T.prototype.code=C,T.prototype[s]=!0,p[C]=T}function v(C){const M=c+C.name;return Object.defineProperty(C,"name",{value:M}),C}function S(C,M){if(C&&M&&C!==M){if(Array.isArray(M.errors))return M.errors.push(C),M;const k=new a([M,C],M.message);return k.code=M.code,k}return C||M}class A extends Error{constructor(M="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(M,k),this.code="ABORT_ERR",this.name="AbortError"}}return g("ERR_ASSERTION","%s",Error),g("ERR_INVALID_ARG_TYPE",(C,M,k)=>{d(typeof C=="string","'name' must be a string"),Array.isArray(M)||(M=[M]);let T="The ";C.endsWith(" argument")?T+=`${C} `:T+=`"${C}" ${C.includes(".")?"property":"argument"} `,T+="must be ";const R=[],N=[],K=[];for(const ie of M)d(typeof ie=="string","All expected entries have to be of type string"),u.includes(ie)?R.push(ie.toLowerCase()):o.test(ie)?N.push(ie):(d(ie!=="object",'The value "object" should be written as "Object"'),K.push(ie));if(N.length>0){const ie=R.indexOf("object");ie!==-1&&(R.splice(R,ie,1),N.push("Object"))}if(R.length>0){switch(R.length){case 1:T+=`of type ${R[0]}`;break;case 2:T+=`one of type ${R[0]} or ${R[1]}`;break;default:{const ie=R.pop();T+=`one of type ${R.join(", ")}, or ${ie}`}}(N.length>0||K.length>0)&&(T+=" or ")}if(N.length>0){switch(N.length){case 1:T+=`an instance of ${N[0]}`;break;case 2:T+=`an instance of ${N[0]} or ${N[1]}`;break;default:{const ie=N.pop();T+=`an instance of ${N.join(", ")}, or ${ie}`}}K.length>0&&(T+=" or ")}switch(K.length){case 0:break;case 1:K[0].toLowerCase()!==K[0]&&(T+="an "),T+=`${K[0]}`;break;case 2:T+=`one of ${K[0]} or ${K[1]}`;break;default:{const ie=K.pop();T+=`one of ${K.join(", ")}, or ${ie}`}}if(k==null)T+=`. Received ${k}`;else if(typeof k=="function"&&k.name)T+=`. Received function ${k.name}`;else if(typeof k=="object"){var X;if((X=k.constructor)!==null&&X!==void 0&&X.name)T+=`. Received an instance of ${k.constructor.name}`;else{const ie=e(k,{depth:-1});T+=`. Received ${ie}`}}else{let ie=e(k,{colors:!1});ie.length>25&&(ie=`${ie.slice(0,25)}...`),T+=`. Received type ${typeof k} (${ie})`}return T},TypeError),g("ERR_INVALID_ARG_VALUE",(C,M,k="is invalid")=>{let T=e(M);return T.length>128&&(T=T.slice(0,128)+"..."),`The ${C.includes(".")?"property":"argument"} '${C}' ${k}. Received ${T}`},TypeError),g("ERR_INVALID_RETURN_VALUE",(C,M,k)=>{var T;const R=k!=null&&(T=k.constructor)!==null&&T!==void 0&&T.name?`instance of ${k.constructor.name}`:`type ${typeof k}`;return`Expected ${C} to be returned from the "${M}" function but got ${R}.`},TypeError),g("ERR_MISSING_ARGS",(...C)=>{d(C.length>0,"At least one arg needs to be specified");let M;const k=C.length;switch(C=(Array.isArray(C)?C:[C]).map(T=>`"${T}"`).join(" or "),k){case 1:M+=`The ${C[0]} argument`;break;case 2:M+=`The ${C[0]} and ${C[1]} arguments`;break;default:{const T=C.pop();M+=`The ${C.join(", ")}, and ${T} arguments`}break}return`${M} must be specified`},TypeError),g("ERR_OUT_OF_RANGE",(C,M,k)=>{d(M,'Missing "range" argument');let T;return Number.isInteger(k)&&Math.abs(k)>2**32?T=y(String(k)):typeof k=="bigint"?(T=String(k),(k>2n**32n||k<-(2n**32n))&&(T=y(T)),T+="n"):T=e(k),`The value of "${C}" is out of range. It must be ${M}. Received ${T}`},RangeError),g("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),g("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),g("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),g("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),g("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),g("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),g("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),g("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),g("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),g("ERR_STREAM_WRITE_AFTER_END","write after end",Error),g("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),vE={AbortError:A,aggregateTwoErrors:v(S),hideStackFrames:v,codes:p},vE}var bE,J9;function qg(){if(J9)return bE;J9=1;const{ArrayIsArray:r,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:b,StringPrototypeToUpperCase:g,StringPrototypeTrim:v}=oa(),{hideStackFrames:S,codes:{ERR_SOCKET_BAD_PORT:A,ERR_INVALID_ARG_TYPE:C,ERR_INVALID_ARG_VALUE:M,ERR_OUT_OF_RANGE:k,ERR_UNKNOWN_SIGNAL:T}}=Ls(),{normalizeEncoding:R}=as(),{isAsyncFunction:N,isArrayBufferView:K}=as().types,X={};function ie(Q){return Q===(Q|0)}function ge(Q){return Q===Q>>>0}const pe=/^[0-7]+$/,te="must be a 32-bit unsigned integer or an octal string";function se(Q,le,Ae){if(typeof Q>"u"&&(Q=Ae),typeof Q=="string"){if(y(pe,Q)===null)throw new M(le,Q,te);Q=p(Q,8)}return P(Q,le),Q}const x=S((Q,le,Ae=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<Ae||Q>Re)throw new k(le,`>= ${Ae} && <= ${Re}`,Q)}),_=S((Q,le,Ae=-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<Ae||Q>Re)throw new k(le,`>= ${Ae} && <= ${Re}`,Q)}),P=S((Q,le,Ae=!1)=>{if(typeof Q!="number")throw new C(le,"number",Q);if(!s(Q))throw new k(le,"an integer",Q);const Re=Ae?1:0,Ye=4294967295;if(Q<Re||Q>Ye)throw new k(le,`>= ${Re} && <= ${Ye}`,Q)});function j(Q,le){if(typeof Q!="string")throw new C(le,"string",Q)}function q(Q,le,Ae=void 0,Re){if(typeof Q!="number")throw new C(le,"number",Q);if(Ae!=null&&Q<Ae||Re!=null&&Q>Re||(Ae!=null||Re!=null)&&u(Q))throw new k(le,`${Ae!=null?`>= ${Ae}`:""}${Ae!=null&&Re!=null?" && ":""}${Re!=null?`<= ${Re}`:""}`,Q)}const z=S((Q,le,Ae)=>{if(!e(Ae,Q)){const Ye="must be one of: "+t(a(Ae,lt=>typeof lt=="string"?`'${lt}'`:b(lt)),", ");throw new M(le,Q,Ye)}});function ee(Q,le){if(typeof Q!="boolean")throw new C(le,"boolean",Q)}function G(Q,le,Ae){return Q==null||!d(Q,le)?Ae:Q[le]}const D=S((Q,le,Ae=null)=>{const Re=G(Ae,"allowArray",!1),Ye=G(Ae,"allowFunction",!1);if(!G(Ae,"nullable",!1)&&Q===null||!Re&&r(Q)||typeof Q!="object"&&(!Ye||typeof Q!="function"))throw new C(le,"Object",Q)}),L=S((Q,le)=>{if(Q!=null&&typeof Q!="object"&&typeof Q!="function")throw new C(le,"a dictionary",Q)}),J=S((Q,le,Ae=0)=>{if(!r(Q))throw new C(le,"Array",Q);if(Q.length<Ae){const Re=`must be longer than ${Ae}`;throw new M(le,Q,Re)}});function ae(Q,le){J(Q,le);for(let Ae=0;Ae<Q.length;Ae++)j(Q[Ae],`${le}[${Ae}]`)}function H(Q,le){J(Q,le);for(let Ae=0;Ae<Q.length;Ae++)ee(Q[Ae],`${le}[${Ae}]`)}function Ce(Q,le){J(Q,le);for(let Ae=0;Ae<Q.length;Ae++){const Re=Q[Ae],Ye=`${le}[${Ae}]`;if(Re==null)throw new C(Ye,"AbortSignal",Re);ce(Re,Ye)}}function Ie(Q,le="signal"){if(j(Q,le),X[Q]===void 0)throw X[g(Q)]!==void 0?new T(Q+" (signals must use all capital letters)"):new T(Q)}const Se=S((Q,le="buffer")=>{if(!K(Q))throw new C(le,["Buffer","TypedArray","DataView"],Q)});function Me(Q,le){const Ae=R(le),Re=Q.length;if(Ae==="hex"&&Re%2!==0)throw new M("encoding",le,`is invalid for data of length ${Re}`)}function oe(Q,le="Port",Ae=!0){if(typeof Q!="number"&&typeof Q!="string"||typeof Q=="string"&&v(Q).length===0||+Q!==+Q>>>0||Q>65535||Q===0&&!Ae)throw new A(le,Q,Ae);return Q|0}const ce=S((Q,le)=>{if(Q!==void 0&&(Q===null||typeof Q!="object"||!("aborted"in Q)))throw new C(le,"AbortSignal",Q)}),be=S((Q,le)=>{if(typeof Q!="function")throw new C(le,"Function",Q)}),me=S((Q,le)=>{if(typeof Q!="function"||N(Q))throw new C(le,"Function",Q)}),de=S((Q,le)=>{if(Q!==void 0)throw new C(le,"undefined",Q)});function xe(Q,le,Ae){if(!e(Ae,Q))throw new C(le,`('${t(Ae,"|")}')`,Q)}const ne=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function B(Q,le){if(typeof Q>"u"||!y(ne,Q))throw new M(le,Q,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function V(Q){if(typeof Q=="string")return B(Q,"hints"),Q;if(r(Q)){const le=Q.length;let Ae="";if(le===0)return Ae;for(let Re=0;Re<le;Re++){const Ye=Q[Re];B(Ye,"hints"),Ae+=Ye,Re!==le-1&&(Ae+=", ")}return Ae}throw new M("hints",Q,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}return bE={isInt32:ie,isUint32:ge,parseFileMode:se,validateArray:J,validateStringArray:ae,validateBooleanArray:H,validateAbortSignalArray:Ce,validateBoolean:ee,validateBuffer:Se,validateDictionary:L,validateEncoding:Me,validateFunction:be,validateInt32:_,validateInteger:x,validateNumber:q,validateObject:D,validateOneOf:z,validatePlainFunction:me,validatePort:oe,validateSignalName:Ie,validateString:j,validateUint32:P,validateUndefined:de,validateUnion:xe,validateAbortSignal:ce,validateLinkHeaderValue:V},bE}var cw={exports:{}},wE={exports:{}},Q9;function If(){if(Q9)return wE.exports;Q9=1;var r=wE.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(A){if(e===setTimeout)return setTimeout(A,0);if((e===a||!e)&&setTimeout)return e=setTimeout,setTimeout(A,0);try{return e(A,0)}catch{try{return e.call(null,A,0)}catch{return e.call(this,A,0)}}}function o(A){if(t===clearTimeout)return clearTimeout(A);if((t===s||!t)&&clearTimeout)return t=clearTimeout,clearTimeout(A);try{return t(A)}catch{try{return t.call(null,A)}catch{return t.call(this,A)}}}var c=[],p=!1,d,y=-1;function b(){!p||!d||(p=!1,d.length?c=d.concat(c):y=-1,c.length&&g())}function g(){if(!p){var A=u(b);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(A)}}r.nextTick=function(A){var C=new Array(arguments.length-1);if(arguments.length>1)for(var M=1;M<arguments.length;M++)C[M-1]=arguments[M];c.push(new v(A,C)),c.length===1&&!p&&u(g)};function v(A,C){this.fun=A,this.array=C}v.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={};function S(){}return r.on=S,r.addListener=S,r.once=S,r.off=S,r.removeListener=S,r.removeAllListeners=S,r.emit=S,r.prependListener=S,r.prependOnceListener=S,r.listeners=function(A){return[]},r.binding=function(A){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(A){throw new Error("process.chdir is not supported")},r.umask=function(){return 0},wE.exports}var _E,X9;function wc(){if(X9)return _E;X9=1;const{SymbolAsyncIterator:r,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(G,D=!1){var L;return!!(G&&typeof G.pipe=="function"&&typeof G.on=="function"&&(!D||typeof G.pause=="function"&&typeof G.resume=="function")&&(!G._writableState||((L=G._readableState)===null||L===void 0?void 0:L.readable)!==!1)&&(!G._writableState||G._readableState))}function b(G){var D;return!!(G&&typeof G.write=="function"&&typeof G.on=="function"&&(!G._readableState||((D=G._writableState)===null||D===void 0?void 0:D.writable)!==!1))}function g(G){return!!(G&&typeof G.pipe=="function"&&G._readableState&&typeof G.on=="function"&&typeof G.write=="function")}function v(G){return G&&(G._readableState||G._writableState||typeof G.write=="function"&&typeof G.on=="function"||typeof G.pipe=="function"&&typeof G.on=="function")}function S(G){return!!(G&&!v(G)&&typeof G.pipeThrough=="function"&&typeof G.getReader=="function"&&typeof G.cancel=="function")}function A(G){return!!(G&&!v(G)&&typeof G.getWriter=="function"&&typeof G.abort=="function")}function C(G){return!!(G&&!v(G)&&typeof G.readable=="object"&&typeof G.writable=="object")}function M(G){return S(G)||A(G)||C(G)}function k(G,D){return G==null?!1:D===!0?typeof G[r]=="function":D===!1?typeof G[e]=="function":typeof G[r]=="function"||typeof G[e]=="function"}function T(G){if(!v(G))return null;const D=G._writableState,L=G._readableState,J=D||L;return!!(G.destroyed||G[a]||J!=null&&J.destroyed)}function R(G){if(!b(G))return null;if(G.writableEnded===!0)return!0;const D=G._writableState;return D!=null&&D.errored?!1:typeof D?.ended!="boolean"?null:D.ended}function N(G,D){if(!b(G))return null;if(G.writableFinished===!0)return!0;const L=G._writableState;return L!=null&&L.errored?!1:typeof L?.finished!="boolean"?null:!!(L.finished||D===!1&&L.ended===!0&&L.length===0)}function K(G){if(!y(G))return null;if(G.readableEnded===!0)return!0;const D=G._readableState;return!D||D.errored?!1:typeof D?.ended!="boolean"?null:D.ended}function X(G,D){if(!y(G))return null;const L=G._readableState;return L!=null&&L.errored?!1:typeof L?.endEmitted!="boolean"?null:!!(L.endEmitted||D===!1&&L.ended===!0&&L.length===0)}function ie(G){return G&&G[u]!=null?G[u]:typeof G?.readable!="boolean"?null:T(G)?!1:y(G)&&G.readable&&!X(G)}function ge(G){return G&&G[o]!=null?G[o]:typeof G?.writable!="boolean"?null:T(G)?!1:b(G)&&G.writable&&!R(G)}function pe(G,D){return v(G)?T(G)?!0:!(D?.readable!==!1&&ie(G)||D?.writable!==!1&&ge(G)):null}function te(G){var D,L;return v(G)?G.writableErrored?G.writableErrored:(D=(L=G._writableState)===null||L===void 0?void 0:L.errored)!==null&&D!==void 0?D:null:null}function se(G){var D,L;return v(G)?G.readableErrored?G.readableErrored:(D=(L=G._readableState)===null||L===void 0?void 0:L.errored)!==null&&D!==void 0?D:null:null}function x(G){if(!v(G))return null;if(typeof G.closed=="boolean")return G.closed;const D=G._writableState,L=G._readableState;return typeof D?.closed=="boolean"||typeof L?.closed=="boolean"?D?.closed||L?.closed:typeof G._closed=="boolean"&&_(G)?G._closed:null}function _(G){return typeof G._closed=="boolean"&&typeof G._defaultKeepAlive=="boolean"&&typeof G._removedConnection=="boolean"&&typeof G._removedContLen=="boolean"}function P(G){return typeof G._sent100=="boolean"&&_(G)}function j(G){var D;return typeof G._consuming=="boolean"&&typeof G._dumped=="boolean"&&((D=G.req)===null||D===void 0?void 0:D.upgradeOrConnect)===void 0}function q(G){if(!v(G))return null;const D=G._writableState,L=G._readableState,J=D||L;return!J&&P(G)||!!(J&&J.autoDestroy&&J.emitClose&&J.closed===!1)}function z(G){var D;return!!(G&&((D=G[c])!==null&&D!==void 0?D:G.readableDidRead||G.readableAborted))}function ee(G){var D,L,J,ae,H,Ce,Ie,Se,Me,oe;return!!(G&&((D=(L=(J=(ae=(H=(Ce=G[s])!==null&&Ce!==void 0?Ce:G.readableErrored)!==null&&H!==void 0?H:G.writableErrored)!==null&&ae!==void 0?ae:(Ie=G._readableState)===null||Ie===void 0?void 0:Ie.errorEmitted)!==null&&J!==void 0?J:(Se=G._writableState)===null||Se===void 0?void 0:Se.errorEmitted)!==null&&L!==void 0?L:(Me=G._readableState)===null||Me===void 0?void 0:Me.errored)!==null&&D!==void 0?D:!((oe=G._writableState)===null||oe===void 0)&&oe.errored))}return _E={isDestroyed:T,kIsDestroyed:a,isDisturbed:z,kIsDisturbed:c,isErrored:ee,kIsErrored:s,isReadable:ie,kIsReadable:u,kIsClosedPromise:p,kControllerErrorFunction:d,kIsWritable:o,isClosed:x,isDuplexNodeStream:g,isFinished:pe,isIterable:k,isReadableNodeStream:y,isReadableStream:S,isReadableEnded:K,isReadableFinished:X,isReadableErrored:se,isNodeStream:v,isWebStream:M,isWritable:ge,isWritableNodeStream:b,isWritableStream:A,isWritableEnded:R,isWritableFinished:N,isWritableErrored:te,isServerRequest:j,isServerResponse:P,willEmitClose:q,isTransformStream:C},_E}var Z9;function Df(){if(Z9)return cw.exports;Z9=1;const r=If(),{AbortError:e,codes:t}=Ls(),{ERR_INVALID_ARG_TYPE:a,ERR_STREAM_PREMATURE_CLOSE:s}=t,{kEmptyObject:u,once:o}=as(),{validateAbortSignal:c,validateFunction:p,validateObject:d,validateBoolean:y}=qg(),{Promise:b,PromisePrototypeThen:g,SymbolDispose:v}=oa(),{isClosed:S,isReadable:A,isReadableNodeStream:C,isReadableStream:M,isReadableFinished:k,isReadableErrored:T,isWritable:R,isWritableNodeStream:N,isWritableStream:K,isWritableFinished:X,isWritableErrored:ie,isNodeStream:ge,willEmitClose:pe,kIsClosedPromise:te}=wc();let se;function x(z){return z.setHeader&&typeof z.abort=="function"}const _=()=>{};function P(z,ee,G){var D,L;if(arguments.length===2?(G=ee,ee=u):ee==null?ee=u:d(ee,"options"),p(G,"callback"),c(ee.signal,"options.signal"),G=o(G),M(z)||K(z))return j(z,ee,G);if(!ge(z))throw new a("stream",["ReadableStream","WritableStream","Stream"],z);const J=(D=ee.readable)!==null&&D!==void 0?D:C(z),ae=(L=ee.writable)!==null&&L!==void 0?L:N(z),H=z._writableState,Ce=z._readableState,Ie=()=>{z.writable||oe()};let Se=pe(z)&&C(z)===J&&N(z)===ae,Me=X(z,!1);const oe=()=>{Me=!0,z.destroyed&&(Se=!1),!(Se&&(!z.readable||J))&&(!J||ce)&&G.call(z)};let ce=k(z,!1);const be=()=>{ce=!0,z.destroyed&&(Se=!1),!(Se&&(!z.writable||ae))&&(!ae||Me)&&G.call(z)},me=Q=>{G.call(z,Q)};let de=S(z);const xe=()=>{de=!0;const Q=ie(z)||T(z);if(Q&&typeof Q!="boolean")return G.call(z,Q);if(J&&!ce&&C(z,!0)&&!k(z,!1))return G.call(z,new s);if(ae&&!Me&&!X(z,!1))return G.call(z,new s);G.call(z)},ne=()=>{de=!0;const Q=ie(z)||T(z);if(Q&&typeof Q!="boolean")return G.call(z,Q);G.call(z)},B=()=>{z.req.on("finish",oe)};x(z)?(z.on("complete",oe),Se||z.on("abort",xe),z.req?B():z.on("request",B)):ae&&!H&&(z.on("end",Ie),z.on("close",Ie)),!Se&&typeof z.aborted=="boolean"&&z.on("aborted",xe),z.on("end",be),z.on("finish",oe),ee.error!==!1&&z.on("error",me),z.on("close",xe),de?r.nextTick(xe):H!=null&&H.errorEmitted||Ce!=null&&Ce.errorEmitted?Se||r.nextTick(ne):(!J&&(!Se||A(z))&&(Me||R(z)===!1)||!ae&&(!Se||R(z))&&(ce||A(z)===!1)||Ce&&z.req&&z.aborted)&&r.nextTick(ne);const V=()=>{G=_,z.removeListener("aborted",xe),z.removeListener("complete",oe),z.removeListener("abort",xe),z.removeListener("request",B),z.req&&z.req.removeListener("finish",oe),z.removeListener("end",Ie),z.removeListener("close",Ie),z.removeListener("finish",oe),z.removeListener("end",be),z.removeListener("error",me),z.removeListener("close",xe)};if(ee.signal&&!de){const Q=()=>{const le=G;V(),le.call(z,new e(void 0,{cause:ee.signal.reason}))};if(ee.signal.aborted)r.nextTick(Q);else{se=se||as().addAbortListener;const le=se(ee.signal,Q),Ae=G;G=o((...Re)=>{le[v](),Ae.apply(z,Re)})}}return V}function j(z,ee,G){let D=!1,L=_;if(ee.signal)if(L=()=>{D=!0,G.call(z,new e(void 0,{cause:ee.signal.reason}))},ee.signal.aborted)r.nextTick(L);else{se=se||as().addAbortListener;const ae=se(ee.signal,L),H=G;G=o((...Ce)=>{ae[v](),H.apply(z,Ce)})}const J=(...ae)=>{D||r.nextTick(()=>G.apply(z,ae))};return g(z[te].promise,J,J),_}function q(z,ee){var G;let D=!1;return ee===null&&(ee=u),(G=ee)!==null&&G!==void 0&&G.cleanup&&(y(ee.cleanup,"cleanup"),D=ee.cleanup),new b((L,J)=>{const ae=P(z,ee,H=>{D&&ae(),H?J(H):L()})})}return cw.exports=P,cw.exports.finished=q,cw.exports}var xE,eO;function D0(){if(eO)return xE;eO=1;const r=If(),{aggregateTwoErrors:e,codes:{ERR_MULTIPLE_CALLBACK:t},AbortError:a}=Ls(),{Symbol:s}=oa(),{kIsDestroyed:u,isDestroyed:o,isFinished:c,isServerRequest:p}=wc(),d=s("kDestroy"),y=s("kConstruct");function b(pe,te,se){pe&&(pe.stack,te&&!te.errored&&(te.errored=pe),se&&!se.errored&&(se.errored=pe))}function g(pe,te){const se=this._readableState,x=this._writableState,_=x||se;return x!=null&&x.destroyed||se!=null&&se.destroyed?(typeof te=="function"&&te(),this):(b(pe,x,se),x&&(x.destroyed=!0),se&&(se.destroyed=!0),_.constructed?v(this,pe,te):this.once(d,function(P){v(this,e(P,pe),te)}),this)}function v(pe,te,se){let x=!1;function _(P){if(x)return;x=!0;const j=pe._readableState,q=pe._writableState;b(P,q,j),q&&(q.closed=!0),j&&(j.closed=!0),typeof se=="function"&&se(P),P?r.nextTick(S,pe,P):r.nextTick(A,pe)}try{pe._destroy(te||null,_)}catch(P){_(P)}}function S(pe,te){C(pe,te),A(pe)}function A(pe){const te=pe._readableState,se=pe._writableState;se&&(se.closeEmitted=!0),te&&(te.closeEmitted=!0),(se!=null&&se.emitClose||te!=null&&te.emitClose)&&pe.emit("close")}function C(pe,te){const se=pe._readableState,x=pe._writableState;x!=null&&x.errorEmitted||se!=null&&se.errorEmitted||(x&&(x.errorEmitted=!0),se&&(se.errorEmitted=!0),pe.emit("error",te))}function M(){const pe=this._readableState,te=this._writableState;pe&&(pe.constructed=!0,pe.closed=!1,pe.closeEmitted=!1,pe.destroyed=!1,pe.errored=null,pe.errorEmitted=!1,pe.reading=!1,pe.ended=pe.readable===!1,pe.endEmitted=pe.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(pe,te,se){const x=pe._readableState,_=pe._writableState;if(_!=null&&_.destroyed||x!=null&&x.destroyed)return this;x!=null&&x.autoDestroy||_!=null&&_.autoDestroy?pe.destroy(te):te&&(te.stack,_&&!_.errored&&(_.errored=te),x&&!x.errored&&(x.errored=te),se?r.nextTick(C,pe,te):C(pe,te))}function T(pe,te){if(typeof pe._construct!="function")return;const se=pe._readableState,x=pe._writableState;se&&(se.constructed=!1),x&&(x.constructed=!1),pe.once(y,te),!(pe.listenerCount(y)>1)&&r.nextTick(R,pe)}function R(pe){let te=!1;function se(x){if(te){k(pe,x??new t);return}te=!0;const _=pe._readableState,P=pe._writableState,j=P||_;_&&(_.constructed=!0),P&&(P.constructed=!0),j.destroyed?pe.emit(d,x):x?k(pe,x,!0):r.nextTick(N,pe)}try{pe._construct(x=>{r.nextTick(se,x)})}catch(x){r.nextTick(se,x)}}function N(pe){pe.emit(y)}function K(pe){return pe?.setHeader&&typeof pe.abort=="function"}function X(pe){pe.emit("close")}function ie(pe,te){pe.emit("error",te),r.nextTick(X,pe)}function ge(pe,te){!pe||o(pe)||(!te&&!c(pe)&&(te=new a),p(pe)?(pe.socket=null,pe.destroy(te)):K(pe)?pe.abort():K(pe.req)?pe.req.abort():typeof pe.destroy=="function"?pe.destroy(te):typeof pe.close=="function"?pe.close():te?r.nextTick(ie,pe,te):r.nextTick(X,pe),pe.destroyed||(pe[u]=!0))}return xE={construct:T,destroyer:ge,destroy:g,undestroy:M,errorOrDestroy:k},xE}var SE,tO;function r8(){if(tO)return SE;tO=1;const{ArrayIsArray:r,ObjectSetPrototypeOf:e}=oa(),{EventEmitter:t}=jg();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(A){u.writable&&u.write(A)===!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",b),c.on("close",g));let y=!1;function b(){y||(y=!0,u.end())}function g(){y||(y=!0,typeof u.destroy=="function"&&u.destroy())}function v(A){S(),t.listenerCount(this,"error")===0&&this.emit("error",A)}s(c,"error",v),s(u,"error",v);function S(){c.removeListener("data",p),u.removeListener("drain",d),c.removeListener("end",b),c.removeListener("close",g),c.removeListener("error",v),u.removeListener("error",v),c.removeListener("end",S),c.removeListener("close",S),u.removeListener("close",S)}return c.on("end",S),c.on("close",S),u.on("close",S),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):r(u._events[o])?u._events[o].unshift(c):u._events[o]=[c,u._events[o]]}return SE={Stream:a,prependListener:s},SE}var CE={exports:{}},nO;function w_(){return nO||(nO=1,(function(r){const{SymbolDispose:e}=oa(),{AbortError:t,codes:a}=Ls(),{isNodeStream:s,isWebStream:u,kControllerErrorFunction:o}=wc(),c=Df(),{ERR_INVALID_ARG_TYPE:p}=a;let d;const y=(b,g)=>{if(typeof b!="object"||!("aborted"in b))throw new p(g,"AbortSignal",b)};r.exports.addAbortSignal=function(g,v){if(y(g,"signal"),!s(v)&&!u(v))throw new p("stream",["ReadableStream","WritableStream","Stream"],v);return r.exports.addAbortSignalNoValidate(g,v)},r.exports.addAbortSignalNoValidate=function(b,g){if(typeof b!="object"||!("aborted"in b))return g;const v=s(g)?()=>{g.destroy(new t(void 0,{cause:b.reason}))}:()=>{g[o](new t(void 0,{cause:b.reason}))};if(b.aborted)v();else{d=d||as().addAbortListener;const S=d(b,v);c(g,S[e])}return g}})(CE)),CE.exports}var EE,rO;function dY(){if(rO)return EE;rO=1;const{StringPrototypeSlice:r,SymbolIterator:e,TypedArrayPrototypeSet:t,Uint8Array:a}=oa(),{Buffer:s}=Cp(),{inspect:u}=as();return EE=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 b=d.data;if(c>b.length)p+=b,c-=b.length;else{c===b.length?(p+=b,++y,d.next?this.head=d.next:this.head=this.tail=null):(p+=r(b,0,c),this.head=d,d.data=r(b,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,b=0;do{const g=y.data;if(c>g.length)t(p,g,d-c),c-=g.length;else{c===g.length?(t(p,g,d-c),++b,y.next?this.head=y.next:this.head=this.tail=null):(t(p,new a(g.buffer,g.byteOffset,c),d-c),this.head=y,y.data=g.slice(c));break}++b}while((y=y.next)!==null);return this.length-=b,p}[Symbol.for("nodejs.util.inspect.custom")](c,p){return u(this,{...p,depth:0,customInspect:!1})}},EE}var AE,aO;function __(){if(aO)return AE;aO=1;const{MathFloor:r,NumberIsInteger:e}=oa(),{validateInteger:t}=qg(),{ERR_INVALID_ARG_VALUE:a}=Ls().codes;let s=16*1024,u=16;function o(y,b,g){return y.highWaterMark!=null?y.highWaterMark:b?y[g]:null}function c(y){return y?u:s}function p(y,b){t(b,"value",0),y?u=b:s=b}function d(y,b,g,v){const S=o(b,v,g);if(S!=null){if(!e(S)||S<0){const A=v?`options.${g}`:"options.highWaterMark";throw new a(A,S)}return r(S)}return c(y.objectMode)}return AE={getHighWaterMark:d,getDefaultHighWaterMark:c,setDefaultHighWaterMark:p},AE}var kE={},iO;function NP(){if(iO)return kE;iO=1;var r=nP().Buffer,e=r.isEncoding||function(M){switch(M=""+M,M&&M.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(M){if(!M)return"utf8";for(var k;;)switch(M){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 M;default:if(k)return;M=(""+M).toLowerCase(),k=!0}}function a(M){var k=t(M);if(typeof k!="string"&&(r.isEncoding===e||!e(M)))throw new Error("Unknown encoding: "+M);return k||M}kE.StringDecoder=s;function s(M){this.encoding=a(M);var k;switch(this.encoding){case"utf16le":this.text=b,this.end=g,k=4;break;case"utf8":this.fillLast=p,k=4;break;case"base64":this.text=v,this.end=S,k=3;break;default:this.write=A,this.end=C;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(k)}s.prototype.write=function(M){if(M.length===0)return"";var k,T;if(this.lastNeed){if(k=this.fillLast(M),k===void 0)return"";T=this.lastNeed,this.lastNeed=0}else T=0;return T<M.length?k?k+this.text(M,T):this.text(M,T):k||""},s.prototype.end=y,s.prototype.text=d,s.prototype.fillLast=function(M){if(this.lastNeed<=M.length)return M.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);M.copy(this.lastChar,this.lastTotal-this.lastNeed,0,M.length),this.lastNeed-=M.length};function u(M){return M<=127?0:M>>5===6?2:M>>4===14?3:M>>3===30?4:M>>6===2?-1:-2}function o(M,k,T){var R=k.length-1;if(R<T)return 0;var N=u(k[R]);return N>=0?(N>0&&(M.lastNeed=N-1),N):--R<T||N===-2?0:(N=u(k[R]),N>=0?(N>0&&(M.lastNeed=N-2),N):--R<T||N===-2?0:(N=u(k[R]),N>=0?(N>0&&(N===2?N=0:M.lastNeed=N-3),N):0))}function c(M,k,T){if((k[0]&192)!==128)return M.lastNeed=0,"�";if(M.lastNeed>1&&k.length>1){if((k[1]&192)!==128)return M.lastNeed=1,"�";if(M.lastNeed>2&&k.length>2&&(k[2]&192)!==128)return M.lastNeed=2,"�"}}function p(M){var k=this.lastTotal-this.lastNeed,T=c(this,M);if(T!==void 0)return T;if(this.lastNeed<=M.length)return M.copy(this.lastChar,k,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);M.copy(this.lastChar,k,0,M.length),this.lastNeed-=M.length}function d(M,k){var T=o(this,M,k);if(!this.lastNeed)return M.toString("utf8",k);this.lastTotal=T;var R=M.length-(T-this.lastNeed);return M.copy(this.lastChar,0,R),M.toString("utf8",k,R)}function y(M){var k=M&&M.length?this.write(M):"";return this.lastNeed?k+"�":k}function b(M,k){if((M.length-k)%2===0){var T=M.toString("utf16le",k);if(T){var R=T.charCodeAt(T.length-1);if(R>=55296&&R<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=M[M.length-2],this.lastChar[1]=M[M.length-1],T.slice(0,-1)}return T}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=M[M.length-1],M.toString("utf16le",k,M.length-1)}function g(M){var k=M&&M.length?this.write(M):"";if(this.lastNeed){var T=this.lastTotal-this.lastNeed;return k+this.lastChar.toString("utf16le",0,T)}return k}function v(M,k){var T=(M.length-k)%3;return T===0?M.toString("base64",k):(this.lastNeed=3-T,this.lastTotal=3,T===1?this.lastChar[0]=M[M.length-1]:(this.lastChar[0]=M[M.length-2],this.lastChar[1]=M[M.length-1]),M.toString("base64",k,M.length-T))}function S(M){var k=M&&M.length?this.write(M):"";return this.lastNeed?k+this.lastChar.toString("base64",0,3-this.lastNeed):k}function A(M){return M.toString(this.encoding)}function C(M){return M&&M.length?this.write(M):""}return kE}var ME,sO;function PP(){if(sO)return ME;sO=1;const r=If(),{PromisePrototypeThen:e,SymbolAsyncIterator:t,SymbolIterator:a}=oa(),{Buffer:s}=Cp(),{ERR_INVALID_ARG_TYPE:u,ERR_STREAM_NULL_VALUES:o}=Ls().codes;function c(p,d,y){let b;if(typeof d=="string"||d instanceof s)return new p({objectMode:!0,...y,read(){this.push(d),this.push(null)}});let g;if(d&&d[t])g=!0,b=d[t]();else if(d&&d[a])g=!1,b=d[a]();else throw new u("iterable",["Iterable"],d);const v=new p({objectMode:!0,highWaterMark:1,...y});let S=!1;v._read=function(){S||(S=!0,C())},v._destroy=function(M,k){e(A(M),()=>r.nextTick(k,M),T=>r.nextTick(k,T||M))};async function A(M){const k=M!=null,T=typeof b.throw=="function";if(k&&T){const{value:R,done:N}=await b.throw(M);if(await R,N)return}if(typeof b.return=="function"){const{value:R}=await b.return();await R}}async function C(){for(;;){try{const{value:M,done:k}=g?await b.next():b.next();if(k)v.push(null);else{const T=M&&typeof M.then=="function"?await M:M;if(T===null)throw S=!1,new o;if(v.push(T))continue;S=!1}}catch(M){v.destroy(M)}break}}return v}return ME=c,ME}var TE,oO;function x_(){if(oO)return TE;oO=1;const r=If(),{ArrayPrototypeIndexOf:e,NumberIsInteger:t,NumberIsNaN:a,NumberParseInt:s,ObjectDefineProperties:u,ObjectKeys:o,ObjectSetPrototypeOf:c,Promise:p,SafeSet:d,SymbolAsyncDispose:y,SymbolAsyncIterator:b,Symbol:g}=oa();TE=Re,Re.ReadableState=Ae;const{EventEmitter:v}=jg(),{Stream:S,prependListener:A}=r8(),{Buffer:C}=Cp(),{addAbortSignal:M}=w_(),k=Df();let T=as().debuglog("stream",ke=>{T=ke});const R=dY(),N=D0(),{getHighWaterMark:K,getDefaultHighWaterMark:X}=__(),{aggregateTwoErrors:ie,codes:{ERR_INVALID_ARG_TYPE:ge,ERR_METHOD_NOT_IMPLEMENTED:pe,ERR_OUT_OF_RANGE:te,ERR_STREAM_PUSH_AFTER_EOF:se,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:x},AbortError:_}=Ls(),{validateObject:P}=qg(),j=g("kPaused"),{StringDecoder:q}=NP(),z=PP();c(Re.prototype,S.prototype),c(Re,S);const ee=()=>{},{errorOrDestroy:G}=N,D=1,L=2,J=4,ae=8,H=16,Ce=32,Ie=64,Se=128,Me=256,oe=512,ce=1024,be=2048,me=4096,de=8192,xe=16384,ne=32768,B=65536,V=1<<17,Q=1<<18;function le(ke){return{enumerable:!1,get(){return(this.state&ke)!==0},set(I){I?this.state|=ke:this.state&=~ke}}}u(Ae.prototype,{objectMode:le(D),ended:le(L),endEmitted:le(J),reading:le(ae),constructed:le(H),sync:le(Ce),needReadable:le(Ie),emittedReadable:le(Se),readableListening:le(Me),resumeScheduled:le(oe),errorEmitted:le(ce),emitClose:le(be),autoDestroy:le(me),destroyed:le(de),closed:le(xe),closeEmitted:le(ne),multiAwaitDrain:le(B),readingMore:le(V),dataEmitted:le(Q)});function Ae(ke,I,ze){typeof ze!="boolean"&&(ze=I instanceof mc()),this.state=be|me|H|Ce,ke&&ke.objectMode&&(this.state|=D),ze&&ke&&ke.readableObjectMode&&(this.state|=D),this.highWaterMark=ke?K(this,ke,"readableHighWaterMark",ze):X(!1),this.buffer=new R,this.length=0,this.pipes=[],this.flowing=null,this[j]=null,ke&&ke.emitClose===!1&&(this.state&=~be),ke&&ke.autoDestroy===!1&&(this.state&=~me),this.errored=null,this.defaultEncoding=ke&&ke.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,ke&&ke.encoding&&(this.decoder=new q(ke.encoding),this.encoding=ke.encoding)}function Re(ke){if(!(this instanceof Re))return new Re(ke);const I=this instanceof mc();this._readableState=new Ae(ke,this,I),ke&&(typeof ke.read=="function"&&(this._read=ke.read),typeof ke.destroy=="function"&&(this._destroy=ke.destroy),typeof ke.construct=="function"&&(this._construct=ke.construct),ke.signal&&!I&&M(ke.signal,this)),S.call(this,ke),N.construct(this,()=>{this._readableState.needReadable&&Ee(this,this._readableState)})}Re.prototype.destroy=N.destroy,Re.prototype._undestroy=N.undestroy,Re.prototype._destroy=function(ke,I){I(ke)},Re.prototype[v.captureRejectionSymbol]=function(ke){this.destroy(ke)},Re.prototype[y]=function(){let ke;return this.destroyed||(ke=this.readableEnded?null:new _,this.destroy(ke)),new p((I,ze)=>k(this,we=>we&&we!==ke?ze(we):I(null)))},Re.prototype.push=function(ke,I){return Ye(this,ke,I,!1)},Re.prototype.unshift=function(ke,I){return Ye(this,ke,I,!0)};function Ye(ke,I,ze,we){T("readableAddChunk",I);const De=ke._readableState;let $e;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="":S._isUint8Array(I)?(I=S._uint8ArrayToBuffer(I),ze=""):I!=null&&($e=new ge("chunk",["string","Buffer","Uint8Array"],I))),$e)G(ke,$e);else if(I===null)De.state&=~ae,Y(ke,De);else if((De.state&D)!==0||I&&I.length>0)if(we)if((De.state&J)!==0)G(ke,new x);else{if(De.destroyed||De.errored)return!1;lt(ke,De,I,!0)}else if(De.ended)G(ke,new se);else{if(De.destroyed||De.errored)return!1;De.state&=~ae,De.decoder&&!ze?(I=De.decoder.write(I),De.objectMode||I.length!==0?lt(ke,De,I,!1):Ee(ke,De)):lt(ke,De,I,!1)}else we||(De.state&=~ae,Ee(ke,De));return!De.ended&&(De.length<De.highWaterMark||De.length===0)}function lt(ke,I,ze,we){I.flowing&&I.length===0&&!I.sync&&ke.listenerCount("data")>0?((I.state&B)!==0?I.awaitDrainWriters.clear():I.awaitDrainWriters=null,I.dataEmitted=!0,ke.emit("data",ze)):(I.length+=I.objectMode?1:ze.length,we?I.buffer.unshift(ze):I.buffer.push(ze),(I.state&Ie)!==0&&F(ke)),Ee(ke,I)}Re.prototype.isPaused=function(){const ke=this._readableState;return ke[j]===!0||ke.flowing===!1},Re.prototype.setEncoding=function(ke){const I=new q(ke);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(ke){if(ke>et)throw new te("size","<= 1GiB",ke);return ke--,ke|=ke>>>1,ke|=ke>>>2,ke|=ke>>>4,ke|=ke>>>8,ke|=ke>>>16,ke++,ke}function fe(ke,I){return ke<=0||I.length===0&&I.ended?0:(I.state&D)!==0?1:a(ke)?I.flowing&&I.length?I.buffer.first().length:I.length:ke<=I.length?ke:I.ended?I.length:0}Re.prototype.read=function(ke){T("read",ke),ke===void 0?ke=NaN:t(ke)||(ke=s(ke,10));const I=this._readableState,ze=ke;if(ke>I.highWaterMark&&(I.highWaterMark=xt(ke)),ke!==0&&(I.state&=~Se),ke===0&&I.needReadable&&((I.highWaterMark!==0?I.length>=I.highWaterMark:I.length>0)||I.ended))return T("read: emitReadable",I.length,I.ended),I.length===0&&I.ended?vt(this):F(this),null;if(ke=fe(ke,I),ke===0&&I.ended)return I.length===0&&vt(this),null;let we=(I.state&Ie)!==0;if(T("need readable",we),(I.length===0||I.length-ke<I.highWaterMark)&&(we=!0,T("length less than watermark",we)),I.ended||I.reading||I.destroyed||I.errored||!I.constructed)we=!1,T("reading, ended or constructing",we);else if(we){T("do read"),I.state|=ae|Ce,I.length===0&&(I.state|=Ie);try{this._read(I.highWaterMark)}catch($e){G(this,$e)}I.state&=~Ce,I.reading||(ke=fe(ze,I))}let De;return ke>0?De=Bt(ke,I):De=null,De===null?(I.needReadable=I.length<=I.highWaterMark,ke=0):(I.length-=ke,I.multiAwaitDrain?I.awaitDrainWriters.clear():I.awaitDrainWriters=null),I.length===0&&(I.ended||(I.needReadable=!0),ze!==ke&&I.ended&&vt(this)),De!==null&&!I.errorEmitted&&!I.closeEmitted&&(I.dataEmitted=!0,this.emit("data",De)),De};function Y(ke,I){if(T("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(ke):(I.needReadable=!1,I.emittedReadable=!0,ue(ke))}}function F(ke){const I=ke._readableState;T("emitReadable",I.needReadable,I.emittedReadable),I.needReadable=!1,I.emittedReadable||(T("emitReadable",I.flowing),I.emittedReadable=!0,r.nextTick(ue,ke))}function ue(ke){const I=ke._readableState;T("emitReadable_",I.destroyed,I.length,I.ended),!I.destroyed&&!I.errored&&(I.length||I.ended)&&(ke.emit("readable"),I.emittedReadable=!1),I.needReadable=!I.flowing&&!I.ended&&I.length<=I.highWaterMark,Je(ke)}function Ee(ke,I){!I.readingMore&&I.constructed&&(I.readingMore=!0,r.nextTick(Le,ke,I))}function Le(ke,I){for(;!I.reading&&!I.ended&&(I.length<I.highWaterMark||I.flowing&&I.length===0);){const ze=I.length;if(T("maybeReadMore read 0"),ke.read(0),ze===I.length)break}I.readingMore=!1}Re.prototype._read=function(ke){throw new pe("_read()")},Re.prototype.pipe=function(ke,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(ke),T("pipe count=%d opts=%j",we.pipes.length,I);const $e=(!I||I.end!==!1)&&ke!==r.stdout&&ke!==r.stderr?Ot:qt;we.endEmitted?r.nextTick($e):ze.once("end",$e),ke.on("unpipe",ht);function ht(un,Nn){T("onunpipe"),un===ze&&Nn&&Nn.hasUnpiped===!1&&(Nn.hasUnpiped=!0,Ne())}function Ot(){T("onend"),ke.end()}let Mt,dn=!1;function Ne(){T("cleanup"),ke.removeListener("close",Yt),ke.removeListener("finish",Pt),Mt&&ke.removeListener("drain",Mt),ke.removeListener("error",wt),ke.removeListener("unpipe",ht),ze.removeListener("end",Ot),ze.removeListener("end",qt),ze.removeListener("data",bt),dn=!0,Mt&&we.awaitDrainWriters&&(!ke._writableState||ke._writableState.needDrain)&&Mt()}function ct(){dn||(we.pipes.length===1&&we.pipes[0]===ke?(T("false write response, pause",0),we.awaitDrainWriters=ke,we.multiAwaitDrain=!1):we.pipes.length>1&&we.pipes.includes(ke)&&(T("false write response, pause",we.awaitDrainWriters.size),we.awaitDrainWriters.add(ke)),ze.pause()),Mt||(Mt=Fe(ze,ke),ke.on("drain",Mt))}ze.on("data",bt);function bt(un){T("ondata");const Nn=ke.write(un);T("dest.write",Nn),Nn===!1&&ct()}function wt(un){if(T("onerror",un),qt(),ke.removeListener("error",wt),ke.listenerCount("error")===0){const Nn=ke._writableState||ke._readableState;Nn&&!Nn.errorEmitted?G(ke,un):ke.emit("error",un)}}A(ke,"error",wt);function Yt(){ke.removeListener("finish",Pt),qt()}ke.once("close",Yt);function Pt(){T("onfinish"),ke.removeListener("close",Yt),qt()}ke.once("finish",Pt);function qt(){T("unpipe"),ze.unpipe(ke)}return ke.emit("pipe",ze),ke.writableNeedDrain===!0?ct():we.flowing||(T("pipe resume"),ze.resume()),ke};function Fe(ke,I){return function(){const we=ke._readableState;we.awaitDrainWriters===I?(T("pipeOnDrain",1),we.awaitDrainWriters=null):we.multiAwaitDrain&&(T("pipeOnDrain",we.awaitDrainWriters.size),we.awaitDrainWriters.delete(I)),(!we.awaitDrainWriters||we.awaitDrainWriters.size===0)&&ke.listenerCount("data")&&ke.resume()}}Re.prototype.unpipe=function(ke){const I=this._readableState,ze={hasUnpiped:!1};if(I.pipes.length===0)return this;if(!ke){const De=I.pipes;I.pipes=[],this.pause();for(let $e=0;$e<De.length;$e++)De[$e].emit("unpipe",this,{hasUnpiped:!1});return this}const we=e(I.pipes,ke);return we===-1?this:(I.pipes.splice(we,1),I.pipes.length===0&&this.pause(),ke.emit("unpipe",this,ze),this)},Re.prototype.on=function(ke,I){const ze=S.prototype.on.call(this,ke,I),we=this._readableState;return ke==="data"?(we.readableListening=this.listenerCount("readable")>0,we.flowing!==!1&&this.resume()):ke==="readable"&&!we.endEmitted&&!we.readableListening&&(we.readableListening=we.needReadable=!0,we.flowing=!1,we.emittedReadable=!1,T("on readable",we.length,we.reading),we.length?F(this):we.reading||r.nextTick(Pe,this)),ze},Re.prototype.addListener=Re.prototype.on,Re.prototype.removeListener=function(ke,I){const ze=S.prototype.removeListener.call(this,ke,I);return ke==="readable"&&r.nextTick(dt,this),ze},Re.prototype.off=Re.prototype.removeListener,Re.prototype.removeAllListeners=function(ke){const I=S.prototype.removeAllListeners.apply(this,arguments);return(ke==="readable"||ke===void 0)&&r.nextTick(dt,this),I};function dt(ke){const I=ke._readableState;I.readableListening=ke.listenerCount("readable")>0,I.resumeScheduled&&I[j]===!1?I.flowing=!0:ke.listenerCount("data")>0?ke.resume():I.readableListening||(I.flowing=null)}function Pe(ke){T("readable nexttick read 0"),ke.read(0)}Re.prototype.resume=function(){const ke=this._readableState;return ke.flowing||(T("resume"),ke.flowing=!ke.readableListening,He(this,ke)),ke[j]=!1,this};function He(ke,I){I.resumeScheduled||(I.resumeScheduled=!0,r.nextTick(ye,ke,I))}function ye(ke,I){T("resume",I.reading),I.reading||ke.read(0),I.resumeScheduled=!1,ke.emit("resume"),Je(ke),I.flowing&&!I.reading&&ke.read(0)}Re.prototype.pause=function(){return T("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(T("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[j]=!0,this};function Je(ke){const I=ke._readableState;for(T("flow",I.flowing);I.flowing&&ke.read()!==null;);}Re.prototype.wrap=function(ke){let I=!1;ke.on("data",we=>{!this.push(we)&&ke.pause&&(I=!0,ke.pause())}),ke.on("end",()=>{this.push(null)}),ke.on("error",we=>{G(this,we)}),ke.on("close",()=>{this.destroy()}),ke.on("destroy",()=>{this.destroy()}),this._read=()=>{I&&ke.resume&&(I=!1,ke.resume())};const ze=o(ke);for(let we=1;we<ze.length;we++){const De=ze[we];this[De]===void 0&&typeof ke[De]=="function"&&(this[De]=ke[De].bind(ke))}return this},Re.prototype[b]=function(){return kt(this)},Re.prototype.iterator=function(ke){return ke!==void 0&&P(ke,"options"),kt(this,ke)};function kt(ke,I){typeof ke.read!="function"&&(ke=Re.wrap(ke,{objectMode:!0}));const ze=gt(ke,I);return ze.stream=ke,ze}async function*gt(ke,I){let ze=ee;function we(ht){this===ke?(ze(),ze=ee):ze=ht}ke.on("readable",we);let De;const $e=k(ke,{writable:!1},ht=>{De=ht?ie(De,ht):null,ze(),ze=ee});try{for(;;){const ht=ke.destroyed?null:ke.read();if(ht!==null)yield ht;else{if(De)throw De;if(De===null)return;await new p(we)}}}catch(ht){throw De=ie(De,ht),De}finally{(De||I?.destroyOnReturn!==!1)&&(De===void 0||ke._readableState.autoDestroy)?N.destroyer(ke,null):(ke.off("readable",we),$e())}}u(Re.prototype,{readable:{__proto__:null,get(){const ke=this._readableState;return!!ke&&ke.readable!==!1&&!ke.destroyed&&!ke.errorEmitted&&!ke.endEmitted},set(ke){this._readableState&&(this._readableState.readable=!!ke)}},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(ke){this._readableState&&(this._readableState.flowing=ke)}},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(ke){this._readableState&&(this._readableState.destroyed=ke)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),u(Ae.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[j]!==!1},set(ke){this[j]=!!ke}}}),Re._fromList=Bt;function Bt(ke,I){if(I.length===0)return null;let ze;return I.objectMode?ze=I.buffer.shift():!ke||ke>=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(ke,I.decoder),ze}function vt(ke){const I=ke._readableState;T("endReadable",I.endEmitted),I.endEmitted||(I.ended=!0,r.nextTick(wn,I,ke))}function wn(ke,I){if(T("endReadableNT",ke.endEmitted,ke.length),!ke.errored&&!ke.closeEmitted&&!ke.endEmitted&&ke.length===0){if(ke.endEmitted=!0,I.emit("end"),I.writable&&I.allowHalfOpen===!1)r.nextTick(tt,I);else if(ke.autoDestroy){const ze=I._writableState;(!ze||ze.autoDestroy&&(ze.finished||ze.writable===!1))&&I.destroy()}}}function tt(ke){ke.writable&&!ke.writableEnded&&!ke.destroyed&&ke.end()}Re.from=function(ke,I){return z(Re,ke,I)};let rt;function Er(){return rt===void 0&&(rt={}),rt}return Re.fromWeb=function(ke,I){return Er().newStreamReadableFromReadableStream(ke,I)},Re.toWeb=function(ke,I){return Er().newReadableStreamFromStreamReadable(ke,I)},Re.wrap=function(ke,I){var ze,we;return new Re({objectMode:(ze=(we=ke.readableObjectMode)!==null&&we!==void 0?we:ke.objectMode)!==null&&ze!==void 0?ze:!0,...I,destroy(De,$e){N.destroyer(ke,De),$e(De)}}).wrap(ke)},TE}var RE,uO;function a8(){if(uO)return RE;uO=1;const r=If(),{ArrayPrototypeSlice:e,Error:t,FunctionPrototypeSymbolHasInstance:a,ObjectDefineProperty:s,ObjectDefineProperties:u,ObjectSetPrototypeOf:o,StringPrototypeToLowerCase:c,Symbol:p,SymbolHasInstance:d}=oa();RE=P,P.WritableState=x;const{EventEmitter:y}=jg(),b=r8().Stream,{Buffer:g}=Cp(),v=D0(),{addAbortSignal:S}=w_(),{getHighWaterMark:A,getDefaultHighWaterMark:C}=__(),{ERR_INVALID_ARG_TYPE:M,ERR_METHOD_NOT_IMPLEMENTED:k,ERR_MULTIPLE_CALLBACK:T,ERR_STREAM_CANNOT_PIPE:R,ERR_STREAM_DESTROYED:N,ERR_STREAM_ALREADY_FINISHED:K,ERR_STREAM_NULL_VALUES:X,ERR_STREAM_WRITE_AFTER_END:ie,ERR_UNKNOWN_ENCODING:ge}=Ls().codes,{errorOrDestroy:pe}=v;o(P.prototype,b.prototype),o(P,b);function te(){}const se=p("kOnFinished");function x(me,de,xe){typeof xe!="boolean"&&(xe=de instanceof mc()),this.objectMode=!!(me&&me.objectMode),xe&&(this.objectMode=this.objectMode||!!(me&&me.writableObjectMode)),this.highWaterMark=me?A(this,me,"writableHighWaterMark",xe):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=G.bind(void 0,de),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[se]=[]}function _(me){me.buffered=[],me.bufferedIndex=0,me.allBuffers=!0,me.allNoop=!0}x.prototype.getBuffer=function(){return e(this.buffered,this.bufferedIndex)},s(x.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function P(me){const de=this instanceof mc();if(!de&&!a(P,this))return new P(me);this._writableState=new x(me,this,de),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&&S(me.signal,this)),b.call(this,me),v.construct(this,()=>{const xe=this._writableState;xe.writing||ae(this,xe),Se(this,xe)})}s(P,d,{__proto__:null,value:function(me){return a(this,me)?!0:this!==P?!1:me&&me._writableState instanceof x}}),P.prototype.pipe=function(){pe(this,new R)};function j(me,de,xe,ne){const B=me._writableState;if(typeof xe=="function")ne=xe,xe=B.defaultEncoding;else{if(!xe)xe=B.defaultEncoding;else if(xe!=="buffer"&&!g.isEncoding(xe))throw new ge(xe);typeof ne!="function"&&(ne=te)}if(de===null)throw new X;if(!B.objectMode)if(typeof de=="string")B.decodeStrings!==!1&&(de=g.from(de,xe),xe="buffer");else if(de instanceof g)xe="buffer";else if(b._isUint8Array(de))de=b._uint8ArrayToBuffer(de),xe="buffer";else throw new M("chunk",["string","Buffer","Uint8Array"],de);let V;return B.ending?V=new ie:B.destroyed&&(V=new N("write")),V?(r.nextTick(ne,V),pe(me,V,!0),V):(B.pendingcb++,q(me,B,de,xe,ne))}P.prototype.write=function(me,de,xe){return j(this,me,de,xe)===!0},P.prototype.cork=function(){this._writableState.corked++},P.prototype.uncork=function(){const me=this._writableState;me.corked&&(me.corked--,me.writing||ae(this,me))},P.prototype.setDefaultEncoding=function(de){if(typeof de=="string"&&(de=c(de)),!g.isEncoding(de))throw new ge(de);return this._writableState.defaultEncoding=de,this};function q(me,de,xe,ne,B){const V=de.objectMode?1:xe.length;de.length+=V;const Q=de.length<de.highWaterMark;return Q||(de.needDrain=!0),de.writing||de.corked||de.errored||!de.constructed?(de.buffered.push({chunk:xe,encoding:ne,callback:B}),de.allBuffers&&ne!=="buffer"&&(de.allBuffers=!1),de.allNoop&&B!==te&&(de.allNoop=!1)):(de.writelen=V,de.writecb=B,de.writing=!0,de.sync=!0,me._write(xe,ne,de.onwrite),de.sync=!1),Q&&!de.errored&&!de.destroyed}function z(me,de,xe,ne,B,V,Q){de.writelen=ne,de.writecb=Q,de.writing=!0,de.sync=!0,de.destroyed?de.onwrite(new N("write")):xe?me._writev(B,de.onwrite):me._write(B,V,de.onwrite),de.sync=!1}function ee(me,de,xe,ne){--de.pendingcb,ne(xe),J(de),pe(me,xe)}function G(me,de){const xe=me._writableState,ne=xe.sync,B=xe.writecb;if(typeof B!="function"){pe(me,new T);return}xe.writing=!1,xe.writecb=null,xe.length-=xe.writelen,xe.writelen=0,de?(de.stack,xe.errored||(xe.errored=de),me._readableState&&!me._readableState.errored&&(me._readableState.errored=de),ne?r.nextTick(ee,me,xe,de,B):ee(me,xe,de,B)):(xe.buffered.length>xe.bufferedIndex&&ae(me,xe),ne?xe.afterWriteTickInfo!==null&&xe.afterWriteTickInfo.cb===B?xe.afterWriteTickInfo.count++:(xe.afterWriteTickInfo={count:1,cb:B,stream:me,state:xe},r.nextTick(D,xe.afterWriteTickInfo)):L(me,xe,1,B))}function D({stream:me,state:de,count:xe,cb:ne}){return de.afterWriteTickInfo=null,L(me,de,xe,ne)}function L(me,de,xe,ne){for(!de.ending&&!me.destroyed&&de.length===0&&de.needDrain&&(de.needDrain=!1,me.emit("drain"));xe-- >0;)de.pendingcb--,ne();de.destroyed&&J(de),Se(me,de)}function J(me){if(me.writing)return;for(let B=me.bufferedIndex;B<me.buffered.length;++B){var de;const{chunk:V,callback:Q}=me.buffered[B],le=me.objectMode?1:V.length;me.length-=le,Q((de=me.errored)!==null&&de!==void 0?de:new N("write"))}const xe=me[se].splice(0);for(let B=0;B<xe.length;B++){var ne;xe[B]((ne=me.errored)!==null&&ne!==void 0?ne:new N("end"))}_(me)}function ae(me,de){if(de.corked||de.bufferProcessing||de.destroyed||!de.constructed)return;const{buffered:xe,bufferedIndex:ne,objectMode:B}=de,V=xe.length-ne;if(!V)return;let Q=ne;if(de.bufferProcessing=!0,V>1&&me._writev){de.pendingcb-=V-1;const le=de.allNoop?te:Re=>{for(let Ye=Q;Ye<xe.length;++Ye)xe[Ye].callback(Re)},Ae=de.allNoop&&Q===0?xe:e(xe,Q);Ae.allBuffers=de.allBuffers,z(me,de,!0,de.length,Ae,"",le),_(de)}else{do{const{chunk:le,encoding:Ae,callback:Re}=xe[Q];xe[Q++]=null;const Ye=B?1:le.length;z(me,de,!1,Ye,le,Ae,Re)}while(Q<xe.length&&!de.writing);Q===xe.length?_(de):Q>256?(xe.splice(0,Q),de.bufferedIndex=0):de.bufferedIndex=Q}de.bufferProcessing=!1}P.prototype._write=function(me,de,xe){if(this._writev)this._writev([{chunk:me,encoding:de}],xe);else throw new k("_write()")},P.prototype._writev=null,P.prototype.end=function(me,de,xe){const ne=this._writableState;typeof me=="function"?(xe=me,me=null,de=null):typeof de=="function"&&(xe=de,de=null);let B;if(me!=null){const V=j(this,me,de);V instanceof t&&(B=V)}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 K("end"):ne.destroyed&&(B=new N("end"))),typeof xe=="function"&&(B||ne.finished?r.nextTick(xe,B):ne[se].push(xe)),this};function H(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,de){let xe=!1;function ne(B){if(xe){pe(me,B??T());return}if(xe=!0,de.pendingcb--,B){const V=de[se].splice(0);for(let Q=0;Q<V.length;Q++)V[Q](B);pe(me,B,de.sync)}else H(de)&&(de.prefinished=!0,me.emit("prefinish"),de.pendingcb++,r.nextTick(Me,me,de))}de.sync=!0,de.pendingcb++;try{me._final(ne)}catch(B){ne(B)}de.sync=!1}function Ie(me,de){!de.prefinished&&!de.finalCalled&&(typeof me._final=="function"&&!de.destroyed?(de.finalCalled=!0,Ce(me,de)):(de.prefinished=!0,me.emit("prefinish")))}function Se(me,de,xe){H(de)&&(Ie(me,de),de.pendingcb===0&&(xe?(de.pendingcb++,r.nextTick((ne,B)=>{H(B)?Me(ne,B):B.pendingcb--},me,de)):H(de)&&(de.pendingcb++,Me(me,de))))}function Me(me,de){de.pendingcb--,de.finished=!0;const xe=de[se].splice(0);for(let ne=0;ne<xe.length;ne++)xe[ne]();if(me.emit("finish"),de.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=v.destroy;P.prototype.destroy=function(me,de){const xe=this._writableState;return!xe.destroyed&&(xe.bufferedIndex<xe.buffered.length||xe[se].length)&&r.nextTick(J,xe),oe.call(this,me,de),this},P.prototype._undestroy=v.undestroy,P.prototype._destroy=function(me,de){de(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,de){return be().newStreamWritableFromWritableStream(me,de)},P.toWeb=function(me){return be().newWritableStreamFromStreamWritable(me)},RE}var OE,lO;function pY(){if(lO)return OE;lO=1;const r=If(),e=Cp(),{isReadable:t,isWritable:a,isIterable:s,isNodeStream:u,isReadableNodeStream:o,isWritableNodeStream:c,isDuplexNodeStream:p,isReadableStream:d,isWritableStream:y}=wc(),b=Df(),{AbortError:g,codes:{ERR_INVALID_ARG_TYPE:v,ERR_INVALID_RETURN_VALUE:S}}=Ls(),{destroyer:A}=D0(),C=mc(),M=x_(),k=a8(),{createDeferredPromise:T}=as(),R=PP(),N=globalThis.Blob||e.Blob,K=typeof N<"u"?function(x){return x instanceof N}:function(x){return!1},X=globalThis.AbortController||Mg().AbortController,{FunctionPrototypeCall:ie}=oa();class ge extends C{constructor(x){super(x),x?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),x?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}OE=function se(x,_){if(p(x))return x;if(o(x))return te({readable:x});if(c(x))return te({writable:x});if(u(x))return te({writable:!1,readable:!1});if(d(x))return te({readable:M.fromWeb(x)});if(y(x))return te({writable:k.fromWeb(x)});if(typeof x=="function"){const{value:j,write:q,final:z,destroy:ee}=pe(x);if(s(j))return R(ge,j,{objectMode:!0,write:q,final:z,destroy:ee});const G=j?.then;if(typeof G=="function"){let D;const L=ie(G,j,J=>{if(J!=null)throw new S("nully","body",J)},J=>{A(D,J)});return D=new ge({objectMode:!0,readable:!1,write:q,final(J){z(async()=>{try{await L,r.nextTick(J,null)}catch(ae){r.nextTick(J,ae)}})},destroy:ee})}throw new S("Iterable, AsyncIterable or AsyncFunction",_,j)}if(K(x))return se(x.arrayBuffer());if(s(x))return R(ge,x,{objectMode:!0,writable:!1});if(d(x?.readable)&&y(x?.writable))return ge.fromWeb(x);if(typeof x?.writable=="object"||typeof x?.readable=="object"){const j=x!=null&&x.readable?o(x?.readable)?x?.readable:se(x.readable):void 0,q=x!=null&&x.writable?c(x?.writable)?x?.writable:se(x.writable):void 0;return te({readable:j,writable:q})}const P=x?.then;if(typeof P=="function"){let j;return ie(P,x,q=>{q!=null&&j.push(q),j.push(null)},q=>{A(j,q)}),j=new ge({objectMode:!0,writable:!1,read(){}})}throw new v(_,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],x)};function pe(se){let{promise:x,resolve:_}=T();const P=new X,j=P.signal;return{value:se((async function*(){for(;;){const z=x;x=null;const{chunk:ee,done:G,cb:D}=await z;if(r.nextTick(D),G)return;if(j.aborted)throw new g(void 0,{cause:j.reason});({promise:x,resolve:_}=T()),yield ee}})(),{signal:j}),write(z,ee,G){const D=_;_=null,D({chunk:z,done:!1,cb:G})},final(z){const ee=_;_=null,ee({done:!0,cb:z})},destroy(z,ee){P.abort(),ee(z)}}}function te(se){const x=se.readable&&typeof se.readable.read!="function"?M.wrap(se.readable):se.readable,_=se.writable;let P=!!t(x),j=!!a(_),q,z,ee,G,D;function L(J){const ae=G;G=null,ae?ae(J):J&&D.destroy(J)}return D=new ge({readableObjectMode:!!(x!=null&&x.readableObjectMode),writableObjectMode:!!(_!=null&&_.writableObjectMode),readable:P,writable:j}),j&&(b(_,J=>{j=!1,J&&A(x,J),L(J)}),D._write=function(J,ae,H){_.write(J,ae)?H():q=H},D._final=function(J){_.end(),z=J},_.on("drain",function(){if(q){const J=q;q=null,J()}}),_.on("finish",function(){if(z){const J=z;z=null,J()}})),P&&(b(x,J=>{P=!1,J&&A(x,J),L(J)}),x.on("readable",function(){if(ee){const J=ee;ee=null,J()}}),x.on("end",function(){D.push(null)}),D._read=function(){for(;;){const J=x.read();if(J===null){ee=D._read;return}if(!D.push(J))return}}),D._destroy=function(J,ae){!J&&G!==null&&(J=new g),ee=null,q=null,z=null,G===null?ae(J):(G=ae,A(_,J),A(x,J))},D}return OE}var LE,cO;function mc(){if(cO)return LE;cO=1;const{ObjectDefineProperties:r,ObjectGetOwnPropertyDescriptor:e,ObjectKeys:t,ObjectSetPrototypeOf:a}=oa();LE=o;const s=x_(),u=a8();a(o.prototype,s.prototype),a(o,s);{const y=t(u.prototype);for(let b=0;b<y.length;b++){const g=y[b];o.prototype[g]||(o.prototype[g]=u.prototype[g])}}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}r(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,b){return p().newStreamDuplexFromReadableWritablePair(y,b)},o.toWeb=function(y){return p().newReadableWritablePairFromDuplex(y)};let d;return o.from=function(y){return d||(d=pY()),d(y,"body")},LE}var NE,fO;function IP(){if(fO)return NE;fO=1;const{ObjectSetPrototypeOf:r,Symbol:e}=oa();NE=o;const{ERR_METHOD_NOT_IMPLEMENTED:t}=Ls().codes,a=mc(),{getHighWaterMark:s}=__();r(o.prototype,a.prototype),r(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,b)=>{if(y){d?d(y):this.destroy(y);return}b!=null&&this.push(b),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,b){throw new t("_transform()")},o.prototype._write=function(d,y,b){const g=this._readableState,v=this._writableState,S=g.length;this._transform(d,y,(A,C)=>{if(A){b(A);return}C!=null&&this.push(C),v.ended||S===g.length||g.length<g.highWaterMark?b():this[u]=b})},o.prototype._read=function(){if(this[u]){const d=this[u];this[u]=null,d()}},NE}var PE,dO;function DP(){if(dO)return PE;dO=1;const{ObjectSetPrototypeOf:r}=oa();PE=t;const e=IP();r(t.prototype,e.prototype),r(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)},PE}var IE,pO;function i8(){if(pO)return IE;pO=1;const r=If(),{ArrayIsArray:e,Promise:t,SymbolAsyncIterator:a,SymbolDispose:s}=oa(),u=Df(),{once:o}=as(),c=D0(),p=mc(),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:y,ERR_INVALID_RETURN_VALUE:b,ERR_MISSING_ARGS:g,ERR_STREAM_DESTROYED:v,ERR_STREAM_PREMATURE_CLOSE:S},AbortError:A}=Ls(),{validateFunction:C,validateAbortSignal:M}=qg(),{isIterable:k,isReadable:T,isReadableNodeStream:R,isNodeStream:N,isTransformStream:K,isWebStream:X,isReadableStream:ie,isReadableFinished:ge}=wc(),pe=globalThis.AbortController||Mg().AbortController;let te,se,x;function _(J,ae,H){let Ce=!1;J.on("close",()=>{Ce=!0});const Ie=u(J,{readable:ae,writable:H},Se=>{Ce=!Se});return{destroy:Se=>{Ce||(Ce=!0,c.destroyer(J,Se||new v("pipe")))},cleanup:Ie}}function P(J){return C(J[J.length-1],"streams[stream.length - 1]"),J.pop()}function j(J){if(k(J))return J;if(R(J))return q(J);throw new y("val",["Readable","Iterable","AsyncIterable"],J)}async function*q(J){se||(se=x_()),yield*se.prototype[a].call(J)}async function z(J,ae,H,{end:Ce}){let Ie,Se=null;const Me=be=>{if(be&&(Ie=be),Se){const me=Se;Se=null,me()}},oe=()=>new t((be,me)=>{Ie?me(Ie):Se=()=>{Ie?me(Ie):be()}});ae.on("drain",Me);const ce=u(ae,{readable:!1},Me);try{ae.writableNeedDrain&&await oe();for await(const be of J)ae.write(be)||await oe();Ce&&(ae.end(),await oe()),H()}catch(be){H(Ie!==be?d(Ie,be):be)}finally{ce(),ae.off("drain",Me)}}async function ee(J,ae,H,{end:Ce}){K(ae)&&(ae=ae.writable);const Ie=ae.getWriter();try{for await(const Se of J)await Ie.ready,Ie.write(Se).catch(()=>{});await Ie.ready,Ce&&await Ie.close(),H()}catch(Se){try{await Ie.abort(Se),H(Se)}catch(Me){H(Me)}}}function G(...J){return D(J,o(P(J)))}function D(J,ae,H){if(J.length===1&&e(J[0])&&(J=J[0]),J.length<2)throw new g("streams");const Ce=new pe,Ie=Ce.signal,Se=H?.signal,Me=[];M(Se,"options.signal");function oe(){B(new A)}x=x||as().addAbortListener;let ce;Se&&(ce=x(Se,oe));let be,me;const de=[];let xe=0;function ne(Ae){B(Ae,--xe===0)}function B(Ae,Re){var Ye;if(Ae&&(!be||be.code==="ERR_STREAM_PREMATURE_CLOSE")&&(be=Ae),!(!be&&!Re)){for(;de.length;)de.shift()(be);(Ye=ce)===null||Ye===void 0||Ye[s](),Ce.abort(),Re&&(be||Me.forEach(lt=>lt()),r.nextTick(ae,be,me))}}let V;for(let Ae=0;Ae<J.length;Ae++){const Re=J[Ae],Ye=Ae<J.length-1,lt=Ae>0,et=Ye||H?.end!==!1,xt=Ae===J.length-1;if(N(Re)){let fe=function(Y){Y&&Y.name!=="AbortError"&&Y.code!=="ERR_STREAM_PREMATURE_CLOSE"&&ne(Y)};if(et){const{destroy:Y,cleanup:F}=_(Re,Ye,lt);de.push(Y),T(Re)&&xt&&Me.push(F)}Re.on("error",fe),T(Re)&&xt&&Me.push(()=>{Re.removeListener("error",fe)})}if(Ae===0)if(typeof Re=="function"){if(V=Re({signal:Ie}),!k(V))throw new b("Iterable, AsyncIterable or Stream","source",V)}else k(Re)||R(Re)||K(Re)?V=Re:V=p.from(Re);else if(typeof Re=="function"){if(K(V)){var Q;V=j((Q=V)===null||Q===void 0?void 0:Q.readable)}else V=j(V);if(V=Re(V,{signal:Ie}),Ye){if(!k(V,!0))throw new b("AsyncIterable",`transform[${Ae-1}]`,V)}else{var le;te||(te=DP());const fe=new te({objectMode:!0}),Y=(le=V)===null||le===void 0?void 0:le.then;if(typeof Y=="function")xe++,Y.call(V,Ee=>{me=Ee,Ee!=null&&fe.write(Ee),et&&fe.end(),r.nextTick(ne)},Ee=>{fe.destroy(Ee),r.nextTick(ne,Ee)});else if(k(V,!0))xe++,z(V,fe,ne,{end:et});else if(ie(V)||K(V)){const Ee=V.readable||V;xe++,z(Ee,fe,ne,{end:et})}else throw new b("AsyncIterable or Promise","destination",V);V=fe;const{destroy:F,cleanup:ue}=_(V,!1,!0);de.push(F),xt&&Me.push(ue)}}else if(N(Re)){if(R(V)){xe+=2;const fe=L(V,Re,ne,{end:et});T(Re)&&xt&&Me.push(fe)}else if(K(V)||ie(V)){const fe=V.readable||V;xe++,z(fe,Re,ne,{end:et})}else if(k(V))xe++,z(V,Re,ne,{end:et});else throw new y("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],V);V=Re}else if(X(Re)){if(R(V))xe++,ee(j(V),Re,ne,{end:et});else if(ie(V)||k(V))xe++,ee(V,Re,ne,{end:et});else if(K(V))xe++,ee(V.readable,Re,ne,{end:et});else throw new y("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],V);V=Re}else V=p.from(Re)}return(Ie!=null&&Ie.aborted||Se!=null&&Se.aborted)&&r.nextTick(oe),V}function L(J,ae,H,{end:Ce}){let Ie=!1;if(ae.on("close",()=>{Ie||H(new S)}),J.pipe(ae,{end:!1}),Ce){let Se=function(){Ie=!0,ae.end()};ge(J)?r.nextTick(Se):J.once("end",Se)}else H();return u(J,{readable:!0,writable:!1},Se=>{const Me=J._readableState;Se&&Se.code==="ERR_STREAM_PREMATURE_CLOSE"&&Me&&Me.ended&&!Me.errored&&!Me.errorEmitted?J.once("end",H).once("error",H):H(Se)}),u(ae,{readable:!1,writable:!0},H)}return IE={pipelineImpl:D,pipeline:G},IE}var DE,hO;function UP(){if(hO)return DE;hO=1;const{pipeline:r}=i8(),e=mc(),{destroyer:t}=D0(),{isNodeStream:a,isReadable:s,isWritable:u,isWebStream:o,isTransformStream:c,isWritableStream:p,isReadableStream:d}=wc(),{AbortError:y,codes:{ERR_INVALID_ARG_VALUE:b,ERR_MISSING_ARGS:g}}=Ls(),v=Df();return DE=function(...A){if(A.length===0)throw new g("streams");if(A.length===1)return e.from(A[0]);const C=[...A];if(typeof A[0]=="function"&&(A[0]=e.from(A[0])),typeof A[A.length-1]=="function"){const te=A.length-1;A[te]=e.from(A[te])}for(let te=0;te<A.length;++te)if(!(!a(A[te])&&!o(A[te]))){if(te<A.length-1&&!(s(A[te])||d(A[te])||c(A[te])))throw new b(`streams[${te}]`,C[te],"must be readable");if(te>0&&!(u(A[te])||p(A[te])||c(A[te])))throw new b(`streams[${te}]`,C[te],"must be writable")}let M,k,T,R,N;function K(te){const se=R;R=null,se?se(te):te?N.destroy(te):!pe&&!ge&&N.destroy()}const X=A[0],ie=r(A,K),ge=!!(u(X)||p(X)||c(X)),pe=!!(s(ie)||d(ie)||c(ie));if(N=new e({writableObjectMode:!!(X!=null&&X.writableObjectMode),readableObjectMode:!!(ie!=null&&ie.readableObjectMode),writable:ge,readable:pe}),ge){if(a(X))N._write=function(se,x,_){X.write(se,x)?_():M=_},N._final=function(se){X.end(),k=se},X.on("drain",function(){if(M){const se=M;M=null,se()}});else if(o(X)){const x=(c(X)?X.writable:X).getWriter();N._write=async function(_,P,j){try{await x.ready,x.write(_).catch(()=>{}),j()}catch(q){j(q)}},N._final=async function(_){try{await x.ready,x.close().catch(()=>{}),k=_}catch(P){_(P)}}}const te=c(ie)?ie.readable:ie;v(te,()=>{if(k){const se=k;k=null,se()}})}if(pe){if(a(ie))ie.on("readable",function(){if(T){const te=T;T=null,te()}}),ie.on("end",function(){N.push(null)}),N._read=function(){for(;;){const te=ie.read();if(te===null){T=N._read;return}if(!N.push(te))return}};else if(o(ie)){const se=(c(ie)?ie.readable:ie).getReader();N._read=async function(){for(;;)try{const{value:x,done:_}=await se.read();if(!N.push(x))return;if(_){N.push(null);return}}catch{return}}}}return N._destroy=function(te,se){!te&&R!==null&&(te=new y),T=null,M=null,k=null,R===null?se(te):(R=se,a(ie)&&t(ie,te))},N},DE}var yO;function hY(){if(yO)return lw;yO=1;const r=globalThis.AbortController||Mg().AbortController,{codes:{ERR_INVALID_ARG_VALUE:e,ERR_INVALID_ARG_TYPE:t,ERR_MISSING_ARGS:a,ERR_OUT_OF_RANGE:s},AbortError:u}=Ls(),{validateAbortSignal:o,validateInteger:c,validateObject:p}=qg(),d=oa().Symbol("kWeak"),y=oa().Symbol("kResistStopPropagation"),{finished:b}=Df(),g=UP(),{addAbortSignalNoValidate:v}=w_(),{isWritable:S,isNodeStream:A}=wc(),{deprecate:C}=as(),{ArrayPrototypePush:M,Boolean:k,MathFloor:T,Number:R,NumberIsNaN:N,Promise:K,PromiseReject:X,PromiseResolve:ie,PromisePrototypeThen:ge,Symbol:pe}=oa(),te=pe("kEmpty"),se=pe("kEof");function x(Se,Me){if(Me!=null&&p(Me,"options"),Me?.signal!=null&&o(Me.signal,"options.signal"),A(Se)&&!S(Se))throw new e("stream",Se,"must be writable");const oe=g(this,Se);return Me!=null&&Me.signal&&v(Me.signal,oe),oe}function _(Se,Me){if(typeof Se!="function")throw new t("fn",["Function","AsyncFunction"],Se);Me!=null&&p(Me,"options"),Me?.signal!=null&&o(Me.signal,"options.signal");let oe=1;Me?.concurrency!=null&&(oe=T(Me.concurrency));let ce=oe-1;return Me?.highWaterMark!=null&&(ce=T(Me.highWaterMark)),c(oe,"options.concurrency",1),c(ce,"options.highWaterMark",0),ce+=oe,(async function*(){const me=as().AbortSignalAny([Me?.signal].filter(k)),de=this,xe=[],ne={signal:me};let B,V,Q=!1,le=0;function Ae(){Q=!0,Re()}function Re(){le-=1,Ye()}function Ye(){V&&!Q&&le<oe&&xe.length<ce&&(V(),V=null)}async function lt(){try{for await(let et of de){if(Q)return;if(me.aborted)throw new u;try{if(et=Se(et,ne),et===te)continue;et=ie(et)}catch(xt){et=X(xt)}le+=1,ge(et,Re,Ae),xe.push(et),B&&(B(),B=null),!Q&&(xe.length>=ce||le>=oe)&&await new K(xt=>{V=xt})}xe.push(se)}catch(et){const xt=X(et);ge(xt,Re,Ae),xe.push(xt)}finally{Q=!0,B&&(B(),B=null)}}lt();try{for(;;){for(;xe.length>0;){const et=await xe[0];if(et===se)return;if(me.aborted)throw new u;et!==te&&(yield et),xe.shift(),Ye()}await new K(et=>{B=et})}}finally{Q=!0,V&&(V(),V=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,Me=void 0){for await(const oe of G.call(this,Se,Me))return!0;return!1}async function q(Se,Me=void 0){if(typeof Se!="function")throw new t("fn",["Function","AsyncFunction"],Se);return!await j.call(this,async(...oe)=>!await Se(...oe),Me)}async function z(Se,Me){for await(const oe of G.call(this,Se,Me))return oe}async function ee(Se,Me){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,Me));}function G(Se,Me){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,Me)}class D extends a{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function L(Se,Me,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 b(this.destroy(B)),B}const me=new r,de=me.signal;if(oe!=null&&oe.signal){const B={once:!0,[d]:this,[y]:!0};oe.signal.addEventListener("abort",()=>me.abort(),B)}let xe=!1;try{for await(const B of this){var ne;if(xe=!0,oe!=null&&(ne=oe.signal)!==null&&ne!==void 0&&ne.aborted)throw new u;be?Me=await Se(Me,B,{signal:de}):(Me=B,be=!0)}if(!xe&&!be)throw new D}finally{me.abort()}return Me}async function J(Se){Se!=null&&p(Se,"options"),Se?.signal!=null&&o(Se.signal,"options.signal");const Me=[];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});M(Me,ce)}return Me}function ae(Se,Me){const oe=_.call(this,Se,Me);return(async function*(){for await(const be of oe)yield*be}).call(this)}function H(Se){if(Se=R(Se),N(Se))return 0;if(Se<0)throw new s("number",">= 0",Se);return Se}function Ce(Se,Me=void 0){return Me!=null&&p(Me,"options"),Me?.signal!=null&&o(Me.signal,"options.signal"),Se=H(Se),(async function*(){var ce;if(Me!=null&&(ce=Me.signal)!==null&&ce!==void 0&&ce.aborted)throw new u;for await(const me of this){var be;if(Me!=null&&(be=Me.signal)!==null&&be!==void 0&&be.aborted)throw new u;Se--<=0&&(yield me)}}).call(this)}function Ie(Se,Me=void 0){return Me!=null&&p(Me,"options"),Me?.signal!=null&&o(Me.signal,"options.signal"),Se=H(Se),(async function*(){var ce;if(Me!=null&&(ce=Me.signal)!==null&&ce!==void 0&&ce.aborted)throw new u;for await(const me of this){var be;if(Me!=null&&(be=Me.signal)!==null&&be!==void 0&&be.aborted)throw new u;if(Se-- >0&&(yield me),Se<=0)return}}).call(this)}return lw.streamReturningOperators={asIndexedPairs:C(P,"readable.asIndexedPairs will be removed in a future version."),drop:Ce,filter:G,flatMap:ae,map:_,take:Ie,compose:x},lw.promiseReturningOperators={every:q,forEach:ee,reduce:L,toArray:J,some:j,find:z},lw}var UE,mO;function FP(){if(mO)return UE;mO=1;const{ArrayPrototypePop:r,Promise:e}=oa(),{isIterable:t,isNodeStream:a,isWebStream:s}=wc(),{pipelineImpl:u}=i8(),{finished:o}=Df();BP();function c(...p){return new e((d,y)=>{let b,g;const v=p[p.length-1];if(v&&typeof v=="object"&&!a(v)&&!t(v)&&!s(v)){const S=r(p);b=S.signal,g=S.end}u(p,(S,A)=>{S?y(S):d(A)},{signal:b,end:g})})}return UE={finished:o,pipeline:c},UE}var gO;function BP(){if(gO)return hE.exports;gO=1;const{Buffer:r}=Cp(),{ObjectDefineProperty:e,ObjectKeys:t,ReflectApply:a}=oa(),{promisify:{custom:s}}=as(),{streamReturningOperators:u,promiseReturningOperators:o}=hY(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:c}}=Ls(),p=UP(),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:y}=__(),{pipeline:b}=i8(),{destroyer:g}=D0(),v=Df(),S=FP(),A=wc(),C=hE.exports=r8().Stream;C.isDestroyed=A.isDestroyed,C.isDisturbed=A.isDisturbed,C.isErrored=A.isErrored,C.isReadable=A.isReadable,C.isWritable=A.isWritable,C.Readable=x_();for(const k of t(u)){let R=function(...N){if(new.target)throw c();return C.Readable.from(a(T,this,N))};const T=u[k];e(R,"name",{__proto__:null,value:T.name}),e(R,"length",{__proto__:null,value:T.length}),e(C.Readable.prototype,k,{__proto__:null,value:R,enumerable:!1,configurable:!0,writable:!0})}for(const k of t(o)){let R=function(...N){if(new.target)throw c();return a(T,this,N)};const T=o[k];e(R,"name",{__proto__:null,value:T.name}),e(R,"length",{__proto__:null,value:T.length}),e(C.Readable.prototype,k,{__proto__:null,value:R,enumerable:!1,configurable:!0,writable:!0})}C.Writable=a8(),C.Duplex=mc(),C.Transform=IP(),C.PassThrough=DP(),C.pipeline=b;const{addAbortSignal:M}=w_();return C.addAbortSignal=M,C.finished=v,C.destroy=g,C.compose=p,C.setDefaultHighWaterMark=d,C.getDefaultHighWaterMark=y,e(C,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return S}}),e(b,s,{__proto__:null,enumerable:!0,get(){return S.pipeline}}),e(v,s,{__proto__:null,enumerable:!0,get(){return S.finished}}),C.Stream=C,C._isUint8Array=function(T){return T instanceof Uint8Array},C._uint8ArrayToBuffer=function(T){return r.from(T.buffer,T.byteOffset,T.byteLength)},hE.exports}var vO;function yY(){return vO||(vO=1,(function(r){const e=BP(),t=FP(),a=e.Readable.destroy;r.exports=e.Readable,r.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,r.exports._isUint8Array=e._isUint8Array,r.exports.isDisturbed=e.isDisturbed,r.exports.isErrored=e.isErrored,r.exports.isReadable=e.isReadable,r.exports.Readable=e.Readable,r.exports.Writable=e.Writable,r.exports.Duplex=e.Duplex,r.exports.Transform=e.Transform,r.exports.PassThrough=e.PassThrough,r.exports.addAbortSignal=e.addAbortSignal,r.exports.finished=e.finished,r.exports.destroy=e.destroy,r.exports.destroy=a,r.exports.pipeline=e.pipeline,r.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get(){return t}}),r.exports.Stream=e.Stream,r.exports.default=r.exports})(pE)),pE.exports}var FE,bO;function zP(){if(bO)return FE;bO=1,typeof globalThis.Buffer>"u"&&(globalThis.Buffer=Og().Buffer);const r=rP(),e=yY(),t=gi();if(globalThis.process||(globalThis.process=If()),typeof crypto>"u"){const s=e_;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-7GwGdyHP.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 b=Math.floor(s/564)*576;return s%564!==0&&(b+=576),u?b+608:b+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${r.encode(Buffer.from(d))}`,secret_key:`kpsk${r.encode(Buffer.from(c))}`,public_key:`kppk${r.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${r.encode(Buffer.from(u))}`,public_key:`ktpk${r.encode(Buffer.from(o))}`}},CapToConk(s){const u=o=>new Uint8Array(r.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",b=>{p.push(b)}).on("finish",()=>{d()}).on("error",b=>{y(b)})}),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",b=>{p.push(b)}).on("finish",()=>{d()}).on("error",b=>{y(b)})}),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 FE=a,FE}var zr={},wO;function jP(){if(wO)return zr;wO=1;const r=gi();let e;r.Platform()===r.PLATFORM_NODE&&(globalThis.Response=YA().Response,e=e_);const t=ji(),{ValidatePresence:a,ValidateWriteToken:s,ValidatePartHash:u,ValidateParameters:o}=_u();return zr.ListFiles=async function({libraryId:c,objectId:p,path:d="",versionHash:y,writeToken:b}){o({libraryId:c,objectId:p,versionHash:y,writeToken:b}),y&&(p=this.utils.DecodeVersionHash(y).objectId);let g=t("q",b||y||p,"files_list",d);return this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,versionHash:y}),method:"GET",path:g})},zr.UploadFilesFromS3=async function({libraryId:c,objectId:p,writeToken:d,region:y,bucket:b,fileInfo:g,accessKey:v,secret:S,signedUrl:A,encryption:C="none",copy:M=!1,callback:k}){o({libraryId:c,objectId:p}),s(d);const T=/^s3:\/\/([^/]+)\//i;for(let ge=0;ge<g.length;ge++){const pe=g[ge].source,te=T.exec(pe);if(te){if(te[1]!==b)throw Error('Full S3 file path "'+pe+`" specified, but does not match provided bucket name '`+b+"'");g[ge].source=pe.replace(T,"")}}M?this.Log(`Copying files from S3: ${c} ${p} ${d}`):this.Log(`Adding links to files in S3: ${c} ${p} ${d}`);let R;if(C==="cgck"){let ge=await this.EncryptionConk({libraryId:c,objectId:p,writeToken:d});ge={...ge,secret_key:""},R=`kp__${this.utils.B58(Buffer.from(JSON.stringify(ge)))}`}let N={access_key_id:v,secret_access_key:S};A&&(N={signed_url:A});const K={encryption_key:R,access:{protocol:"s3",platform:"aws",path:b,storage_endpoint:{region:y},cloud_credentials:N}},X=g.map(ge=>M?{op:"ingest-copy",path:ge.path,encryption:{scheme:C==="cgck"?"cgck":"none"},ingest:{type:"key",path:ge.source}}:{op:"add-reference",path:ge.path,reference:{type:"key",path:ge.source}}),{id:ie}=await this.CreateFileUploadJob({libraryId:c,objectId:p,writeToken:d,ops:X,defaults:K});for(;;){await new Promise(te=>setTimeout(te,1e3));const ge=await this.UploadStatus({libraryId:c,objectId:p,writeToken:d,uploadId:ie});if(ge.errors&&ge.errors.length>1)throw ge.errors.join(`
|
|
327
|
+
`;super(S),this.name="AggregateError",this.errors=v}}r.exports={AggregateError:b,kEmptyObject:Object.freeze({}),once(g){let v=!1;return function(...S){v||(v=!0,g.apply(this,S))}},createDeferredPromise:function(){let g,v;return{promise:new Promise((A,C)=>{g=A,v=C}),resolve:g,reject:v}},promisify(g){return new Promise((v,S)=>{g((A,...C)=>A?S(A):v(...C))})},debuglog(){return function(){}},format(g,...v){return g.replace(/%([sdifj])/g,function(...[S,A]){const C=v.shift();return A==="f"?C.toFixed(6):A==="j"?JSON.stringify(C):A==="s"&&typeof C=="object"?`${C.constructor!==Object?C.constructor.name:""} {}`.trim():C.toString()})},inspect(g){switch(typeof g){case"string":if(g.includes("'"))if(g.includes('"')){if(!g.includes("`")&&!g.includes("${"))return`\`${g}\``}else return`"${g}"`;return`'${g}'`;case"number":return isNaN(g)?"NaN":Object.is(g,-0)?String(g):g;case"bigint":return`${String(g)}n`;case"boolean":case"undefined":return String(g);case"object":return"{}"}},types:{isAsyncFunction(g){return g instanceof o},isArrayBufferView(g){return ArrayBuffer.isView(g)}},isBlob:p,deprecate(g,v){return g},addAbortListener:jg().addAbortListener||function(v,S){if(v===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",v);d(v,"signal"),y(S,"listener");let A;return v.aborted?queueMicrotask(()=>S()):(v.addEventListener("abort",S,{__proto__:null,once:!0,[t]:!0}),A=()=>{v.removeEventListener("abort",S)}),{__proto__:null,[a](){var C;(C=A)===null||C===void 0||C()}}},AbortSignalAny:s.any||function(v){if(v.length===1)return v[0];const S=new u,A=()=>S.abort();return v.forEach(C=>{d(C,"signals"),C.addEventListener("abort",A,{once:!0})}),S.signal.addEventListener("abort",()=>{v.forEach(C=>C.removeEventListener("abort",A))},{once:!0}),S.signal}},r.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(gE)),gE.exports}var lw={},vE,Y9;function Ls(){if(Y9)return vE;Y9=1;const{format:r,inspect:e,AggregateError:t}=as(),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,M){if(!C)throw new p.ERR_INTERNAL_ASSERTION(M)}function y(C){let M="",k=C.length;const T=C[0]==="-"?1:0;for(;k>=T+4;k-=3)M=`_${C.slice(k-3,k)}${M}`;return`${C.slice(0,k)}${M}`}function b(C,M,k){if(typeof M=="function")return d(M.length<=k.length,`Code: ${C}; The provided arguments length (${k.length}) does not match the required ones (${M.length}).`),M(...k);const T=(M.match(/%[dfijoOs]/g)||[]).length;return d(T===k.length,`Code: ${C}; The provided arguments length (${k.length}) does not match the required ones (${T}).`),k.length===0?M:r(M,...k)}function g(C,M,k){k||(k=Error);class T extends k{constructor(...N){super(b(C,M,N))}toString(){return`${this.name} [${C}]: ${this.message}`}}Object.defineProperties(T.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}}),T.prototype.code=C,T.prototype[s]=!0,p[C]=T}function v(C){const M=c+C.name;return Object.defineProperty(C,"name",{value:M}),C}function S(C,M){if(C&&M&&C!==M){if(Array.isArray(M.errors))return M.errors.push(C),M;const k=new a([M,C],M.message);return k.code=M.code,k}return C||M}class A extends Error{constructor(M="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(M,k),this.code="ABORT_ERR",this.name="AbortError"}}return g("ERR_ASSERTION","%s",Error),g("ERR_INVALID_ARG_TYPE",(C,M,k)=>{d(typeof C=="string","'name' must be a string"),Array.isArray(M)||(M=[M]);let T="The ";C.endsWith(" argument")?T+=`${C} `:T+=`"${C}" ${C.includes(".")?"property":"argument"} `,T+="must be ";const R=[],N=[],K=[];for(const ie of M)d(typeof ie=="string","All expected entries have to be of type string"),u.includes(ie)?R.push(ie.toLowerCase()):o.test(ie)?N.push(ie):(d(ie!=="object",'The value "object" should be written as "Object"'),K.push(ie));if(N.length>0){const ie=R.indexOf("object");ie!==-1&&(R.splice(R,ie,1),N.push("Object"))}if(R.length>0){switch(R.length){case 1:T+=`of type ${R[0]}`;break;case 2:T+=`one of type ${R[0]} or ${R[1]}`;break;default:{const ie=R.pop();T+=`one of type ${R.join(", ")}, or ${ie}`}}(N.length>0||K.length>0)&&(T+=" or ")}if(N.length>0){switch(N.length){case 1:T+=`an instance of ${N[0]}`;break;case 2:T+=`an instance of ${N[0]} or ${N[1]}`;break;default:{const ie=N.pop();T+=`an instance of ${N.join(", ")}, or ${ie}`}}K.length>0&&(T+=" or ")}switch(K.length){case 0:break;case 1:K[0].toLowerCase()!==K[0]&&(T+="an "),T+=`${K[0]}`;break;case 2:T+=`one of ${K[0]} or ${K[1]}`;break;default:{const ie=K.pop();T+=`one of ${K.join(", ")}, or ${ie}`}}if(k==null)T+=`. Received ${k}`;else if(typeof k=="function"&&k.name)T+=`. Received function ${k.name}`;else if(typeof k=="object"){var X;if((X=k.constructor)!==null&&X!==void 0&&X.name)T+=`. Received an instance of ${k.constructor.name}`;else{const ie=e(k,{depth:-1});T+=`. Received ${ie}`}}else{let ie=e(k,{colors:!1});ie.length>25&&(ie=`${ie.slice(0,25)}...`),T+=`. Received type ${typeof k} (${ie})`}return T},TypeError),g("ERR_INVALID_ARG_VALUE",(C,M,k="is invalid")=>{let T=e(M);return T.length>128&&(T=T.slice(0,128)+"..."),`The ${C.includes(".")?"property":"argument"} '${C}' ${k}. Received ${T}`},TypeError),g("ERR_INVALID_RETURN_VALUE",(C,M,k)=>{var T;const R=k!=null&&(T=k.constructor)!==null&&T!==void 0&&T.name?`instance of ${k.constructor.name}`:`type ${typeof k}`;return`Expected ${C} to be returned from the "${M}" function but got ${R}.`},TypeError),g("ERR_MISSING_ARGS",(...C)=>{d(C.length>0,"At least one arg needs to be specified");let M;const k=C.length;switch(C=(Array.isArray(C)?C:[C]).map(T=>`"${T}"`).join(" or "),k){case 1:M+=`The ${C[0]} argument`;break;case 2:M+=`The ${C[0]} and ${C[1]} arguments`;break;default:{const T=C.pop();M+=`The ${C.join(", ")}, and ${T} arguments`}break}return`${M} must be specified`},TypeError),g("ERR_OUT_OF_RANGE",(C,M,k)=>{d(M,'Missing "range" argument');let T;return Number.isInteger(k)&&Math.abs(k)>2**32?T=y(String(k)):typeof k=="bigint"?(T=String(k),(k>2n**32n||k<-(2n**32n))&&(T=y(T)),T+="n"):T=e(k),`The value of "${C}" is out of range. It must be ${M}. Received ${T}`},RangeError),g("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),g("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),g("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),g("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),g("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),g("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),g("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),g("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),g("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),g("ERR_STREAM_WRITE_AFTER_END","write after end",Error),g("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),vE={AbortError:A,aggregateTwoErrors:v(S),hideStackFrames:v,codes:p},vE}var bE,J9;function qg(){if(J9)return bE;J9=1;const{ArrayIsArray:r,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:b,StringPrototypeToUpperCase:g,StringPrototypeTrim:v}=oa(),{hideStackFrames:S,codes:{ERR_SOCKET_BAD_PORT:A,ERR_INVALID_ARG_TYPE:C,ERR_INVALID_ARG_VALUE:M,ERR_OUT_OF_RANGE:k,ERR_UNKNOWN_SIGNAL:T}}=Ls(),{normalizeEncoding:R}=as(),{isAsyncFunction:N,isArrayBufferView:K}=as().types,X={};function ie(Q){return Q===(Q|0)}function ge(Q){return Q===Q>>>0}const pe=/^[0-7]+$/,te="must be a 32-bit unsigned integer or an octal string";function se(Q,le,Ae){if(typeof Q>"u"&&(Q=Ae),typeof Q=="string"){if(y(pe,Q)===null)throw new M(le,Q,te);Q=p(Q,8)}return P(Q,le),Q}const x=S((Q,le,Ae=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<Ae||Q>Re)throw new k(le,`>= ${Ae} && <= ${Re}`,Q)}),_=S((Q,le,Ae=-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<Ae||Q>Re)throw new k(le,`>= ${Ae} && <= ${Re}`,Q)}),P=S((Q,le,Ae=!1)=>{if(typeof Q!="number")throw new C(le,"number",Q);if(!s(Q))throw new k(le,"an integer",Q);const Re=Ae?1:0,Ye=4294967295;if(Q<Re||Q>Ye)throw new k(le,`>= ${Re} && <= ${Ye}`,Q)});function j(Q,le){if(typeof Q!="string")throw new C(le,"string",Q)}function q(Q,le,Ae=void 0,Re){if(typeof Q!="number")throw new C(le,"number",Q);if(Ae!=null&&Q<Ae||Re!=null&&Q>Re||(Ae!=null||Re!=null)&&u(Q))throw new k(le,`${Ae!=null?`>= ${Ae}`:""}${Ae!=null&&Re!=null?" && ":""}${Re!=null?`<= ${Re}`:""}`,Q)}const z=S((Q,le,Ae)=>{if(!e(Ae,Q)){const Ye="must be one of: "+t(a(Ae,lt=>typeof lt=="string"?`'${lt}'`:b(lt)),", ");throw new M(le,Q,Ye)}});function ee(Q,le){if(typeof Q!="boolean")throw new C(le,"boolean",Q)}function G(Q,le,Ae){return Q==null||!d(Q,le)?Ae:Q[le]}const D=S((Q,le,Ae=null)=>{const Re=G(Ae,"allowArray",!1),Ye=G(Ae,"allowFunction",!1);if(!G(Ae,"nullable",!1)&&Q===null||!Re&&r(Q)||typeof Q!="object"&&(!Ye||typeof Q!="function"))throw new C(le,"Object",Q)}),L=S((Q,le)=>{if(Q!=null&&typeof Q!="object"&&typeof Q!="function")throw new C(le,"a dictionary",Q)}),J=S((Q,le,Ae=0)=>{if(!r(Q))throw new C(le,"Array",Q);if(Q.length<Ae){const Re=`must be longer than ${Ae}`;throw new M(le,Q,Re)}});function ae(Q,le){J(Q,le);for(let Ae=0;Ae<Q.length;Ae++)j(Q[Ae],`${le}[${Ae}]`)}function H(Q,le){J(Q,le);for(let Ae=0;Ae<Q.length;Ae++)ee(Q[Ae],`${le}[${Ae}]`)}function Ce(Q,le){J(Q,le);for(let Ae=0;Ae<Q.length;Ae++){const Re=Q[Ae],Ye=`${le}[${Ae}]`;if(Re==null)throw new C(Ye,"AbortSignal",Re);ce(Re,Ye)}}function Ie(Q,le="signal"){if(j(Q,le),X[Q]===void 0)throw X[g(Q)]!==void 0?new T(Q+" (signals must use all capital letters)"):new T(Q)}const Se=S((Q,le="buffer")=>{if(!K(Q))throw new C(le,["Buffer","TypedArray","DataView"],Q)});function Me(Q,le){const Ae=R(le),Re=Q.length;if(Ae==="hex"&&Re%2!==0)throw new M("encoding",le,`is invalid for data of length ${Re}`)}function oe(Q,le="Port",Ae=!0){if(typeof Q!="number"&&typeof Q!="string"||typeof Q=="string"&&v(Q).length===0||+Q!==+Q>>>0||Q>65535||Q===0&&!Ae)throw new A(le,Q,Ae);return Q|0}const ce=S((Q,le)=>{if(Q!==void 0&&(Q===null||typeof Q!="object"||!("aborted"in Q)))throw new C(le,"AbortSignal",Q)}),be=S((Q,le)=>{if(typeof Q!="function")throw new C(le,"Function",Q)}),me=S((Q,le)=>{if(typeof Q!="function"||N(Q))throw new C(le,"Function",Q)}),de=S((Q,le)=>{if(Q!==void 0)throw new C(le,"undefined",Q)});function xe(Q,le,Ae){if(!e(Ae,Q))throw new C(le,`('${t(Ae,"|")}')`,Q)}const ne=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function B(Q,le){if(typeof Q>"u"||!y(ne,Q))throw new M(le,Q,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function V(Q){if(typeof Q=="string")return B(Q,"hints"),Q;if(r(Q)){const le=Q.length;let Ae="";if(le===0)return Ae;for(let Re=0;Re<le;Re++){const Ye=Q[Re];B(Ye,"hints"),Ae+=Ye,Re!==le-1&&(Ae+=", ")}return Ae}throw new M("hints",Q,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}return bE={isInt32:ie,isUint32:ge,parseFileMode:se,validateArray:J,validateStringArray:ae,validateBooleanArray:H,validateAbortSignalArray:Ce,validateBoolean:ee,validateBuffer:Se,validateDictionary:L,validateEncoding:Me,validateFunction:be,validateInt32:_,validateInteger:x,validateNumber:q,validateObject:D,validateOneOf:z,validatePlainFunction:me,validatePort:oe,validateSignalName:Ie,validateString:j,validateUint32:P,validateUndefined:de,validateUnion:xe,validateAbortSignal:ce,validateLinkHeaderValue:V},bE}var cw={exports:{}},wE={exports:{}},Q9;function If(){if(Q9)return wE.exports;Q9=1;var r=wE.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(A){if(e===setTimeout)return setTimeout(A,0);if((e===a||!e)&&setTimeout)return e=setTimeout,setTimeout(A,0);try{return e(A,0)}catch{try{return e.call(null,A,0)}catch{return e.call(this,A,0)}}}function o(A){if(t===clearTimeout)return clearTimeout(A);if((t===s||!t)&&clearTimeout)return t=clearTimeout,clearTimeout(A);try{return t(A)}catch{try{return t.call(null,A)}catch{return t.call(this,A)}}}var c=[],p=!1,d,y=-1;function b(){!p||!d||(p=!1,d.length?c=d.concat(c):y=-1,c.length&&g())}function g(){if(!p){var A=u(b);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(A)}}r.nextTick=function(A){var C=new Array(arguments.length-1);if(arguments.length>1)for(var M=1;M<arguments.length;M++)C[M-1]=arguments[M];c.push(new v(A,C)),c.length===1&&!p&&u(g)};function v(A,C){this.fun=A,this.array=C}v.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={};function S(){}return r.on=S,r.addListener=S,r.once=S,r.off=S,r.removeListener=S,r.removeAllListeners=S,r.emit=S,r.prependListener=S,r.prependOnceListener=S,r.listeners=function(A){return[]},r.binding=function(A){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(A){throw new Error("process.chdir is not supported")},r.umask=function(){return 0},wE.exports}var _E,X9;function wc(){if(X9)return _E;X9=1;const{SymbolAsyncIterator:r,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(G,D=!1){var L;return!!(G&&typeof G.pipe=="function"&&typeof G.on=="function"&&(!D||typeof G.pause=="function"&&typeof G.resume=="function")&&(!G._writableState||((L=G._readableState)===null||L===void 0?void 0:L.readable)!==!1)&&(!G._writableState||G._readableState))}function b(G){var D;return!!(G&&typeof G.write=="function"&&typeof G.on=="function"&&(!G._readableState||((D=G._writableState)===null||D===void 0?void 0:D.writable)!==!1))}function g(G){return!!(G&&typeof G.pipe=="function"&&G._readableState&&typeof G.on=="function"&&typeof G.write=="function")}function v(G){return G&&(G._readableState||G._writableState||typeof G.write=="function"&&typeof G.on=="function"||typeof G.pipe=="function"&&typeof G.on=="function")}function S(G){return!!(G&&!v(G)&&typeof G.pipeThrough=="function"&&typeof G.getReader=="function"&&typeof G.cancel=="function")}function A(G){return!!(G&&!v(G)&&typeof G.getWriter=="function"&&typeof G.abort=="function")}function C(G){return!!(G&&!v(G)&&typeof G.readable=="object"&&typeof G.writable=="object")}function M(G){return S(G)||A(G)||C(G)}function k(G,D){return G==null?!1:D===!0?typeof G[r]=="function":D===!1?typeof G[e]=="function":typeof G[r]=="function"||typeof G[e]=="function"}function T(G){if(!v(G))return null;const D=G._writableState,L=G._readableState,J=D||L;return!!(G.destroyed||G[a]||J!=null&&J.destroyed)}function R(G){if(!b(G))return null;if(G.writableEnded===!0)return!0;const D=G._writableState;return D!=null&&D.errored?!1:typeof D?.ended!="boolean"?null:D.ended}function N(G,D){if(!b(G))return null;if(G.writableFinished===!0)return!0;const L=G._writableState;return L!=null&&L.errored?!1:typeof L?.finished!="boolean"?null:!!(L.finished||D===!1&&L.ended===!0&&L.length===0)}function K(G){if(!y(G))return null;if(G.readableEnded===!0)return!0;const D=G._readableState;return!D||D.errored?!1:typeof D?.ended!="boolean"?null:D.ended}function X(G,D){if(!y(G))return null;const L=G._readableState;return L!=null&&L.errored?!1:typeof L?.endEmitted!="boolean"?null:!!(L.endEmitted||D===!1&&L.ended===!0&&L.length===0)}function ie(G){return G&&G[u]!=null?G[u]:typeof G?.readable!="boolean"?null:T(G)?!1:y(G)&&G.readable&&!X(G)}function ge(G){return G&&G[o]!=null?G[o]:typeof G?.writable!="boolean"?null:T(G)?!1:b(G)&&G.writable&&!R(G)}function pe(G,D){return v(G)?T(G)?!0:!(D?.readable!==!1&&ie(G)||D?.writable!==!1&&ge(G)):null}function te(G){var D,L;return v(G)?G.writableErrored?G.writableErrored:(D=(L=G._writableState)===null||L===void 0?void 0:L.errored)!==null&&D!==void 0?D:null:null}function se(G){var D,L;return v(G)?G.readableErrored?G.readableErrored:(D=(L=G._readableState)===null||L===void 0?void 0:L.errored)!==null&&D!==void 0?D:null:null}function x(G){if(!v(G))return null;if(typeof G.closed=="boolean")return G.closed;const D=G._writableState,L=G._readableState;return typeof D?.closed=="boolean"||typeof L?.closed=="boolean"?D?.closed||L?.closed:typeof G._closed=="boolean"&&_(G)?G._closed:null}function _(G){return typeof G._closed=="boolean"&&typeof G._defaultKeepAlive=="boolean"&&typeof G._removedConnection=="boolean"&&typeof G._removedContLen=="boolean"}function P(G){return typeof G._sent100=="boolean"&&_(G)}function j(G){var D;return typeof G._consuming=="boolean"&&typeof G._dumped=="boolean"&&((D=G.req)===null||D===void 0?void 0:D.upgradeOrConnect)===void 0}function q(G){if(!v(G))return null;const D=G._writableState,L=G._readableState,J=D||L;return!J&&P(G)||!!(J&&J.autoDestroy&&J.emitClose&&J.closed===!1)}function z(G){var D;return!!(G&&((D=G[c])!==null&&D!==void 0?D:G.readableDidRead||G.readableAborted))}function ee(G){var D,L,J,ae,H,Ce,Ie,Se,Me,oe;return!!(G&&((D=(L=(J=(ae=(H=(Ce=G[s])!==null&&Ce!==void 0?Ce:G.readableErrored)!==null&&H!==void 0?H:G.writableErrored)!==null&&ae!==void 0?ae:(Ie=G._readableState)===null||Ie===void 0?void 0:Ie.errorEmitted)!==null&&J!==void 0?J:(Se=G._writableState)===null||Se===void 0?void 0:Se.errorEmitted)!==null&&L!==void 0?L:(Me=G._readableState)===null||Me===void 0?void 0:Me.errored)!==null&&D!==void 0?D:!((oe=G._writableState)===null||oe===void 0)&&oe.errored))}return _E={isDestroyed:T,kIsDestroyed:a,isDisturbed:z,kIsDisturbed:c,isErrored:ee,kIsErrored:s,isReadable:ie,kIsReadable:u,kIsClosedPromise:p,kControllerErrorFunction:d,kIsWritable:o,isClosed:x,isDuplexNodeStream:g,isFinished:pe,isIterable:k,isReadableNodeStream:y,isReadableStream:S,isReadableEnded:K,isReadableFinished:X,isReadableErrored:se,isNodeStream:v,isWebStream:M,isWritable:ge,isWritableNodeStream:b,isWritableStream:A,isWritableEnded:R,isWritableFinished:N,isWritableErrored:te,isServerRequest:j,isServerResponse:P,willEmitClose:q,isTransformStream:C},_E}var Z9;function Df(){if(Z9)return cw.exports;Z9=1;const r=If(),{AbortError:e,codes:t}=Ls(),{ERR_INVALID_ARG_TYPE:a,ERR_STREAM_PREMATURE_CLOSE:s}=t,{kEmptyObject:u,once:o}=as(),{validateAbortSignal:c,validateFunction:p,validateObject:d,validateBoolean:y}=qg(),{Promise:b,PromisePrototypeThen:g,SymbolDispose:v}=oa(),{isClosed:S,isReadable:A,isReadableNodeStream:C,isReadableStream:M,isReadableFinished:k,isReadableErrored:T,isWritable:R,isWritableNodeStream:N,isWritableStream:K,isWritableFinished:X,isWritableErrored:ie,isNodeStream:ge,willEmitClose:pe,kIsClosedPromise:te}=wc();let se;function x(z){return z.setHeader&&typeof z.abort=="function"}const _=()=>{};function P(z,ee,G){var D,L;if(arguments.length===2?(G=ee,ee=u):ee==null?ee=u:d(ee,"options"),p(G,"callback"),c(ee.signal,"options.signal"),G=o(G),M(z)||K(z))return j(z,ee,G);if(!ge(z))throw new a("stream",["ReadableStream","WritableStream","Stream"],z);const J=(D=ee.readable)!==null&&D!==void 0?D:C(z),ae=(L=ee.writable)!==null&&L!==void 0?L:N(z),H=z._writableState,Ce=z._readableState,Ie=()=>{z.writable||oe()};let Se=pe(z)&&C(z)===J&&N(z)===ae,Me=X(z,!1);const oe=()=>{Me=!0,z.destroyed&&(Se=!1),!(Se&&(!z.readable||J))&&(!J||ce)&&G.call(z)};let ce=k(z,!1);const be=()=>{ce=!0,z.destroyed&&(Se=!1),!(Se&&(!z.writable||ae))&&(!ae||Me)&&G.call(z)},me=Q=>{G.call(z,Q)};let de=S(z);const xe=()=>{de=!0;const Q=ie(z)||T(z);if(Q&&typeof Q!="boolean")return G.call(z,Q);if(J&&!ce&&C(z,!0)&&!k(z,!1))return G.call(z,new s);if(ae&&!Me&&!X(z,!1))return G.call(z,new s);G.call(z)},ne=()=>{de=!0;const Q=ie(z)||T(z);if(Q&&typeof Q!="boolean")return G.call(z,Q);G.call(z)},B=()=>{z.req.on("finish",oe)};x(z)?(z.on("complete",oe),Se||z.on("abort",xe),z.req?B():z.on("request",B)):ae&&!H&&(z.on("end",Ie),z.on("close",Ie)),!Se&&typeof z.aborted=="boolean"&&z.on("aborted",xe),z.on("end",be),z.on("finish",oe),ee.error!==!1&&z.on("error",me),z.on("close",xe),de?r.nextTick(xe):H!=null&&H.errorEmitted||Ce!=null&&Ce.errorEmitted?Se||r.nextTick(ne):(!J&&(!Se||A(z))&&(Me||R(z)===!1)||!ae&&(!Se||R(z))&&(ce||A(z)===!1)||Ce&&z.req&&z.aborted)&&r.nextTick(ne);const V=()=>{G=_,z.removeListener("aborted",xe),z.removeListener("complete",oe),z.removeListener("abort",xe),z.removeListener("request",B),z.req&&z.req.removeListener("finish",oe),z.removeListener("end",Ie),z.removeListener("close",Ie),z.removeListener("finish",oe),z.removeListener("end",be),z.removeListener("error",me),z.removeListener("close",xe)};if(ee.signal&&!de){const Q=()=>{const le=G;V(),le.call(z,new e(void 0,{cause:ee.signal.reason}))};if(ee.signal.aborted)r.nextTick(Q);else{se=se||as().addAbortListener;const le=se(ee.signal,Q),Ae=G;G=o((...Re)=>{le[v](),Ae.apply(z,Re)})}}return V}function j(z,ee,G){let D=!1,L=_;if(ee.signal)if(L=()=>{D=!0,G.call(z,new e(void 0,{cause:ee.signal.reason}))},ee.signal.aborted)r.nextTick(L);else{se=se||as().addAbortListener;const ae=se(ee.signal,L),H=G;G=o((...Ce)=>{ae[v](),H.apply(z,Ce)})}const J=(...ae)=>{D||r.nextTick(()=>G.apply(z,ae))};return g(z[te].promise,J,J),_}function q(z,ee){var G;let D=!1;return ee===null&&(ee=u),(G=ee)!==null&&G!==void 0&&G.cleanup&&(y(ee.cleanup,"cleanup"),D=ee.cleanup),new b((L,J)=>{const ae=P(z,ee,H=>{D&&ae(),H?J(H):L()})})}return cw.exports=P,cw.exports.finished=q,cw.exports}var xE,eO;function D0(){if(eO)return xE;eO=1;const r=If(),{aggregateTwoErrors:e,codes:{ERR_MULTIPLE_CALLBACK:t},AbortError:a}=Ls(),{Symbol:s}=oa(),{kIsDestroyed:u,isDestroyed:o,isFinished:c,isServerRequest:p}=wc(),d=s("kDestroy"),y=s("kConstruct");function b(pe,te,se){pe&&(pe.stack,te&&!te.errored&&(te.errored=pe),se&&!se.errored&&(se.errored=pe))}function g(pe,te){const se=this._readableState,x=this._writableState,_=x||se;return x!=null&&x.destroyed||se!=null&&se.destroyed?(typeof te=="function"&&te(),this):(b(pe,x,se),x&&(x.destroyed=!0),se&&(se.destroyed=!0),_.constructed?v(this,pe,te):this.once(d,function(P){v(this,e(P,pe),te)}),this)}function v(pe,te,se){let x=!1;function _(P){if(x)return;x=!0;const j=pe._readableState,q=pe._writableState;b(P,q,j),q&&(q.closed=!0),j&&(j.closed=!0),typeof se=="function"&&se(P),P?r.nextTick(S,pe,P):r.nextTick(A,pe)}try{pe._destroy(te||null,_)}catch(P){_(P)}}function S(pe,te){C(pe,te),A(pe)}function A(pe){const te=pe._readableState,se=pe._writableState;se&&(se.closeEmitted=!0),te&&(te.closeEmitted=!0),(se!=null&&se.emitClose||te!=null&&te.emitClose)&&pe.emit("close")}function C(pe,te){const se=pe._readableState,x=pe._writableState;x!=null&&x.errorEmitted||se!=null&&se.errorEmitted||(x&&(x.errorEmitted=!0),se&&(se.errorEmitted=!0),pe.emit("error",te))}function M(){const pe=this._readableState,te=this._writableState;pe&&(pe.constructed=!0,pe.closed=!1,pe.closeEmitted=!1,pe.destroyed=!1,pe.errored=null,pe.errorEmitted=!1,pe.reading=!1,pe.ended=pe.readable===!1,pe.endEmitted=pe.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(pe,te,se){const x=pe._readableState,_=pe._writableState;if(_!=null&&_.destroyed||x!=null&&x.destroyed)return this;x!=null&&x.autoDestroy||_!=null&&_.autoDestroy?pe.destroy(te):te&&(te.stack,_&&!_.errored&&(_.errored=te),x&&!x.errored&&(x.errored=te),se?r.nextTick(C,pe,te):C(pe,te))}function T(pe,te){if(typeof pe._construct!="function")return;const se=pe._readableState,x=pe._writableState;se&&(se.constructed=!1),x&&(x.constructed=!1),pe.once(y,te),!(pe.listenerCount(y)>1)&&r.nextTick(R,pe)}function R(pe){let te=!1;function se(x){if(te){k(pe,x??new t);return}te=!0;const _=pe._readableState,P=pe._writableState,j=P||_;_&&(_.constructed=!0),P&&(P.constructed=!0),j.destroyed?pe.emit(d,x):x?k(pe,x,!0):r.nextTick(N,pe)}try{pe._construct(x=>{r.nextTick(se,x)})}catch(x){r.nextTick(se,x)}}function N(pe){pe.emit(y)}function K(pe){return pe?.setHeader&&typeof pe.abort=="function"}function X(pe){pe.emit("close")}function ie(pe,te){pe.emit("error",te),r.nextTick(X,pe)}function ge(pe,te){!pe||o(pe)||(!te&&!c(pe)&&(te=new a),p(pe)?(pe.socket=null,pe.destroy(te)):K(pe)?pe.abort():K(pe.req)?pe.req.abort():typeof pe.destroy=="function"?pe.destroy(te):typeof pe.close=="function"?pe.close():te?r.nextTick(ie,pe,te):r.nextTick(X,pe),pe.destroyed||(pe[u]=!0))}return xE={construct:T,destroyer:ge,destroy:g,undestroy:M,errorOrDestroy:k},xE}var SE,tO;function r8(){if(tO)return SE;tO=1;const{ArrayIsArray:r,ObjectSetPrototypeOf:e}=oa(),{EventEmitter:t}=jg();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(A){u.writable&&u.write(A)===!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",b),c.on("close",g));let y=!1;function b(){y||(y=!0,u.end())}function g(){y||(y=!0,typeof u.destroy=="function"&&u.destroy())}function v(A){S(),t.listenerCount(this,"error")===0&&this.emit("error",A)}s(c,"error",v),s(u,"error",v);function S(){c.removeListener("data",p),u.removeListener("drain",d),c.removeListener("end",b),c.removeListener("close",g),c.removeListener("error",v),u.removeListener("error",v),c.removeListener("end",S),c.removeListener("close",S),u.removeListener("close",S)}return c.on("end",S),c.on("close",S),u.on("close",S),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):r(u._events[o])?u._events[o].unshift(c):u._events[o]=[c,u._events[o]]}return SE={Stream:a,prependListener:s},SE}var CE={exports:{}},nO;function w_(){return nO||(nO=1,(function(r){const{SymbolDispose:e}=oa(),{AbortError:t,codes:a}=Ls(),{isNodeStream:s,isWebStream:u,kControllerErrorFunction:o}=wc(),c=Df(),{ERR_INVALID_ARG_TYPE:p}=a;let d;const y=(b,g)=>{if(typeof b!="object"||!("aborted"in b))throw new p(g,"AbortSignal",b)};r.exports.addAbortSignal=function(g,v){if(y(g,"signal"),!s(v)&&!u(v))throw new p("stream",["ReadableStream","WritableStream","Stream"],v);return r.exports.addAbortSignalNoValidate(g,v)},r.exports.addAbortSignalNoValidate=function(b,g){if(typeof b!="object"||!("aborted"in b))return g;const v=s(g)?()=>{g.destroy(new t(void 0,{cause:b.reason}))}:()=>{g[o](new t(void 0,{cause:b.reason}))};if(b.aborted)v();else{d=d||as().addAbortListener;const S=d(b,v);c(g,S[e])}return g}})(CE)),CE.exports}var EE,rO;function dY(){if(rO)return EE;rO=1;const{StringPrototypeSlice:r,SymbolIterator:e,TypedArrayPrototypeSet:t,Uint8Array:a}=oa(),{Buffer:s}=Cp(),{inspect:u}=as();return EE=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 b=d.data;if(c>b.length)p+=b,c-=b.length;else{c===b.length?(p+=b,++y,d.next?this.head=d.next:this.head=this.tail=null):(p+=r(b,0,c),this.head=d,d.data=r(b,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,b=0;do{const g=y.data;if(c>g.length)t(p,g,d-c),c-=g.length;else{c===g.length?(t(p,g,d-c),++b,y.next?this.head=y.next:this.head=this.tail=null):(t(p,new a(g.buffer,g.byteOffset,c),d-c),this.head=y,y.data=g.slice(c));break}++b}while((y=y.next)!==null);return this.length-=b,p}[Symbol.for("nodejs.util.inspect.custom")](c,p){return u(this,{...p,depth:0,customInspect:!1})}},EE}var AE,aO;function __(){if(aO)return AE;aO=1;const{MathFloor:r,NumberIsInteger:e}=oa(),{validateInteger:t}=qg(),{ERR_INVALID_ARG_VALUE:a}=Ls().codes;let s=16*1024,u=16;function o(y,b,g){return y.highWaterMark!=null?y.highWaterMark:b?y[g]:null}function c(y){return y?u:s}function p(y,b){t(b,"value",0),y?u=b:s=b}function d(y,b,g,v){const S=o(b,v,g);if(S!=null){if(!e(S)||S<0){const A=v?`options.${g}`:"options.highWaterMark";throw new a(A,S)}return r(S)}return c(y.objectMode)}return AE={getHighWaterMark:d,getDefaultHighWaterMark:c,setDefaultHighWaterMark:p},AE}var kE={},iO;function NP(){if(iO)return kE;iO=1;var r=nP().Buffer,e=r.isEncoding||function(M){switch(M=""+M,M&&M.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(M){if(!M)return"utf8";for(var k;;)switch(M){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 M;default:if(k)return;M=(""+M).toLowerCase(),k=!0}}function a(M){var k=t(M);if(typeof k!="string"&&(r.isEncoding===e||!e(M)))throw new Error("Unknown encoding: "+M);return k||M}kE.StringDecoder=s;function s(M){this.encoding=a(M);var k;switch(this.encoding){case"utf16le":this.text=b,this.end=g,k=4;break;case"utf8":this.fillLast=p,k=4;break;case"base64":this.text=v,this.end=S,k=3;break;default:this.write=A,this.end=C;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(k)}s.prototype.write=function(M){if(M.length===0)return"";var k,T;if(this.lastNeed){if(k=this.fillLast(M),k===void 0)return"";T=this.lastNeed,this.lastNeed=0}else T=0;return T<M.length?k?k+this.text(M,T):this.text(M,T):k||""},s.prototype.end=y,s.prototype.text=d,s.prototype.fillLast=function(M){if(this.lastNeed<=M.length)return M.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);M.copy(this.lastChar,this.lastTotal-this.lastNeed,0,M.length),this.lastNeed-=M.length};function u(M){return M<=127?0:M>>5===6?2:M>>4===14?3:M>>3===30?4:M>>6===2?-1:-2}function o(M,k,T){var R=k.length-1;if(R<T)return 0;var N=u(k[R]);return N>=0?(N>0&&(M.lastNeed=N-1),N):--R<T||N===-2?0:(N=u(k[R]),N>=0?(N>0&&(M.lastNeed=N-2),N):--R<T||N===-2?0:(N=u(k[R]),N>=0?(N>0&&(N===2?N=0:M.lastNeed=N-3),N):0))}function c(M,k,T){if((k[0]&192)!==128)return M.lastNeed=0,"�";if(M.lastNeed>1&&k.length>1){if((k[1]&192)!==128)return M.lastNeed=1,"�";if(M.lastNeed>2&&k.length>2&&(k[2]&192)!==128)return M.lastNeed=2,"�"}}function p(M){var k=this.lastTotal-this.lastNeed,T=c(this,M);if(T!==void 0)return T;if(this.lastNeed<=M.length)return M.copy(this.lastChar,k,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);M.copy(this.lastChar,k,0,M.length),this.lastNeed-=M.length}function d(M,k){var T=o(this,M,k);if(!this.lastNeed)return M.toString("utf8",k);this.lastTotal=T;var R=M.length-(T-this.lastNeed);return M.copy(this.lastChar,0,R),M.toString("utf8",k,R)}function y(M){var k=M&&M.length?this.write(M):"";return this.lastNeed?k+"�":k}function b(M,k){if((M.length-k)%2===0){var T=M.toString("utf16le",k);if(T){var R=T.charCodeAt(T.length-1);if(R>=55296&&R<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=M[M.length-2],this.lastChar[1]=M[M.length-1],T.slice(0,-1)}return T}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=M[M.length-1],M.toString("utf16le",k,M.length-1)}function g(M){var k=M&&M.length?this.write(M):"";if(this.lastNeed){var T=this.lastTotal-this.lastNeed;return k+this.lastChar.toString("utf16le",0,T)}return k}function v(M,k){var T=(M.length-k)%3;return T===0?M.toString("base64",k):(this.lastNeed=3-T,this.lastTotal=3,T===1?this.lastChar[0]=M[M.length-1]:(this.lastChar[0]=M[M.length-2],this.lastChar[1]=M[M.length-1]),M.toString("base64",k,M.length-T))}function S(M){var k=M&&M.length?this.write(M):"";return this.lastNeed?k+this.lastChar.toString("base64",0,3-this.lastNeed):k}function A(M){return M.toString(this.encoding)}function C(M){return M&&M.length?this.write(M):""}return kE}var ME,sO;function PP(){if(sO)return ME;sO=1;const r=If(),{PromisePrototypeThen:e,SymbolAsyncIterator:t,SymbolIterator:a}=oa(),{Buffer:s}=Cp(),{ERR_INVALID_ARG_TYPE:u,ERR_STREAM_NULL_VALUES:o}=Ls().codes;function c(p,d,y){let b;if(typeof d=="string"||d instanceof s)return new p({objectMode:!0,...y,read(){this.push(d),this.push(null)}});let g;if(d&&d[t])g=!0,b=d[t]();else if(d&&d[a])g=!1,b=d[a]();else throw new u("iterable",["Iterable"],d);const v=new p({objectMode:!0,highWaterMark:1,...y});let S=!1;v._read=function(){S||(S=!0,C())},v._destroy=function(M,k){e(A(M),()=>r.nextTick(k,M),T=>r.nextTick(k,T||M))};async function A(M){const k=M!=null,T=typeof b.throw=="function";if(k&&T){const{value:R,done:N}=await b.throw(M);if(await R,N)return}if(typeof b.return=="function"){const{value:R}=await b.return();await R}}async function C(){for(;;){try{const{value:M,done:k}=g?await b.next():b.next();if(k)v.push(null);else{const T=M&&typeof M.then=="function"?await M:M;if(T===null)throw S=!1,new o;if(v.push(T))continue;S=!1}}catch(M){v.destroy(M)}break}}return v}return ME=c,ME}var TE,oO;function x_(){if(oO)return TE;oO=1;const r=If(),{ArrayPrototypeIndexOf:e,NumberIsInteger:t,NumberIsNaN:a,NumberParseInt:s,ObjectDefineProperties:u,ObjectKeys:o,ObjectSetPrototypeOf:c,Promise:p,SafeSet:d,SymbolAsyncDispose:y,SymbolAsyncIterator:b,Symbol:g}=oa();TE=Re,Re.ReadableState=Ae;const{EventEmitter:v}=jg(),{Stream:S,prependListener:A}=r8(),{Buffer:C}=Cp(),{addAbortSignal:M}=w_(),k=Df();let T=as().debuglog("stream",ke=>{T=ke});const R=dY(),N=D0(),{getHighWaterMark:K,getDefaultHighWaterMark:X}=__(),{aggregateTwoErrors:ie,codes:{ERR_INVALID_ARG_TYPE:ge,ERR_METHOD_NOT_IMPLEMENTED:pe,ERR_OUT_OF_RANGE:te,ERR_STREAM_PUSH_AFTER_EOF:se,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:x},AbortError:_}=Ls(),{validateObject:P}=qg(),j=g("kPaused"),{StringDecoder:q}=NP(),z=PP();c(Re.prototype,S.prototype),c(Re,S);const ee=()=>{},{errorOrDestroy:G}=N,D=1,L=2,J=4,ae=8,H=16,Ce=32,Ie=64,Se=128,Me=256,oe=512,ce=1024,be=2048,me=4096,de=8192,xe=16384,ne=32768,B=65536,V=1<<17,Q=1<<18;function le(ke){return{enumerable:!1,get(){return(this.state&ke)!==0},set(I){I?this.state|=ke:this.state&=~ke}}}u(Ae.prototype,{objectMode:le(D),ended:le(L),endEmitted:le(J),reading:le(ae),constructed:le(H),sync:le(Ce),needReadable:le(Ie),emittedReadable:le(Se),readableListening:le(Me),resumeScheduled:le(oe),errorEmitted:le(ce),emitClose:le(be),autoDestroy:le(me),destroyed:le(de),closed:le(xe),closeEmitted:le(ne),multiAwaitDrain:le(B),readingMore:le(V),dataEmitted:le(Q)});function Ae(ke,I,ze){typeof ze!="boolean"&&(ze=I instanceof mc()),this.state=be|me|H|Ce,ke&&ke.objectMode&&(this.state|=D),ze&&ke&&ke.readableObjectMode&&(this.state|=D),this.highWaterMark=ke?K(this,ke,"readableHighWaterMark",ze):X(!1),this.buffer=new R,this.length=0,this.pipes=[],this.flowing=null,this[j]=null,ke&&ke.emitClose===!1&&(this.state&=~be),ke&&ke.autoDestroy===!1&&(this.state&=~me),this.errored=null,this.defaultEncoding=ke&&ke.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,ke&&ke.encoding&&(this.decoder=new q(ke.encoding),this.encoding=ke.encoding)}function Re(ke){if(!(this instanceof Re))return new Re(ke);const I=this instanceof mc();this._readableState=new Ae(ke,this,I),ke&&(typeof ke.read=="function"&&(this._read=ke.read),typeof ke.destroy=="function"&&(this._destroy=ke.destroy),typeof ke.construct=="function"&&(this._construct=ke.construct),ke.signal&&!I&&M(ke.signal,this)),S.call(this,ke),N.construct(this,()=>{this._readableState.needReadable&&Ee(this,this._readableState)})}Re.prototype.destroy=N.destroy,Re.prototype._undestroy=N.undestroy,Re.prototype._destroy=function(ke,I){I(ke)},Re.prototype[v.captureRejectionSymbol]=function(ke){this.destroy(ke)},Re.prototype[y]=function(){let ke;return this.destroyed||(ke=this.readableEnded?null:new _,this.destroy(ke)),new p((I,ze)=>k(this,we=>we&&we!==ke?ze(we):I(null)))},Re.prototype.push=function(ke,I){return Ye(this,ke,I,!1)},Re.prototype.unshift=function(ke,I){return Ye(this,ke,I,!0)};function Ye(ke,I,ze,we){T("readableAddChunk",I);const De=ke._readableState;let $e;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="":S._isUint8Array(I)?(I=S._uint8ArrayToBuffer(I),ze=""):I!=null&&($e=new ge("chunk",["string","Buffer","Uint8Array"],I))),$e)G(ke,$e);else if(I===null)De.state&=~ae,Y(ke,De);else if((De.state&D)!==0||I&&I.length>0)if(we)if((De.state&J)!==0)G(ke,new x);else{if(De.destroyed||De.errored)return!1;lt(ke,De,I,!0)}else if(De.ended)G(ke,new se);else{if(De.destroyed||De.errored)return!1;De.state&=~ae,De.decoder&&!ze?(I=De.decoder.write(I),De.objectMode||I.length!==0?lt(ke,De,I,!1):Ee(ke,De)):lt(ke,De,I,!1)}else we||(De.state&=~ae,Ee(ke,De));return!De.ended&&(De.length<De.highWaterMark||De.length===0)}function lt(ke,I,ze,we){I.flowing&&I.length===0&&!I.sync&&ke.listenerCount("data")>0?((I.state&B)!==0?I.awaitDrainWriters.clear():I.awaitDrainWriters=null,I.dataEmitted=!0,ke.emit("data",ze)):(I.length+=I.objectMode?1:ze.length,we?I.buffer.unshift(ze):I.buffer.push(ze),(I.state&Ie)!==0&&F(ke)),Ee(ke,I)}Re.prototype.isPaused=function(){const ke=this._readableState;return ke[j]===!0||ke.flowing===!1},Re.prototype.setEncoding=function(ke){const I=new q(ke);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(ke){if(ke>et)throw new te("size","<= 1GiB",ke);return ke--,ke|=ke>>>1,ke|=ke>>>2,ke|=ke>>>4,ke|=ke>>>8,ke|=ke>>>16,ke++,ke}function fe(ke,I){return ke<=0||I.length===0&&I.ended?0:(I.state&D)!==0?1:a(ke)?I.flowing&&I.length?I.buffer.first().length:I.length:ke<=I.length?ke:I.ended?I.length:0}Re.prototype.read=function(ke){T("read",ke),ke===void 0?ke=NaN:t(ke)||(ke=s(ke,10));const I=this._readableState,ze=ke;if(ke>I.highWaterMark&&(I.highWaterMark=xt(ke)),ke!==0&&(I.state&=~Se),ke===0&&I.needReadable&&((I.highWaterMark!==0?I.length>=I.highWaterMark:I.length>0)||I.ended))return T("read: emitReadable",I.length,I.ended),I.length===0&&I.ended?vt(this):F(this),null;if(ke=fe(ke,I),ke===0&&I.ended)return I.length===0&&vt(this),null;let we=(I.state&Ie)!==0;if(T("need readable",we),(I.length===0||I.length-ke<I.highWaterMark)&&(we=!0,T("length less than watermark",we)),I.ended||I.reading||I.destroyed||I.errored||!I.constructed)we=!1,T("reading, ended or constructing",we);else if(we){T("do read"),I.state|=ae|Ce,I.length===0&&(I.state|=Ie);try{this._read(I.highWaterMark)}catch($e){G(this,$e)}I.state&=~Ce,I.reading||(ke=fe(ze,I))}let De;return ke>0?De=Bt(ke,I):De=null,De===null?(I.needReadable=I.length<=I.highWaterMark,ke=0):(I.length-=ke,I.multiAwaitDrain?I.awaitDrainWriters.clear():I.awaitDrainWriters=null),I.length===0&&(I.ended||(I.needReadable=!0),ze!==ke&&I.ended&&vt(this)),De!==null&&!I.errorEmitted&&!I.closeEmitted&&(I.dataEmitted=!0,this.emit("data",De)),De};function Y(ke,I){if(T("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(ke):(I.needReadable=!1,I.emittedReadable=!0,ue(ke))}}function F(ke){const I=ke._readableState;T("emitReadable",I.needReadable,I.emittedReadable),I.needReadable=!1,I.emittedReadable||(T("emitReadable",I.flowing),I.emittedReadable=!0,r.nextTick(ue,ke))}function ue(ke){const I=ke._readableState;T("emitReadable_",I.destroyed,I.length,I.ended),!I.destroyed&&!I.errored&&(I.length||I.ended)&&(ke.emit("readable"),I.emittedReadable=!1),I.needReadable=!I.flowing&&!I.ended&&I.length<=I.highWaterMark,Je(ke)}function Ee(ke,I){!I.readingMore&&I.constructed&&(I.readingMore=!0,r.nextTick(Le,ke,I))}function Le(ke,I){for(;!I.reading&&!I.ended&&(I.length<I.highWaterMark||I.flowing&&I.length===0);){const ze=I.length;if(T("maybeReadMore read 0"),ke.read(0),ze===I.length)break}I.readingMore=!1}Re.prototype._read=function(ke){throw new pe("_read()")},Re.prototype.pipe=function(ke,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(ke),T("pipe count=%d opts=%j",we.pipes.length,I);const $e=(!I||I.end!==!1)&&ke!==r.stdout&&ke!==r.stderr?Ot:qt;we.endEmitted?r.nextTick($e):ze.once("end",$e),ke.on("unpipe",ht);function ht(un,Nn){T("onunpipe"),un===ze&&Nn&&Nn.hasUnpiped===!1&&(Nn.hasUnpiped=!0,Ne())}function Ot(){T("onend"),ke.end()}let Mt,dn=!1;function Ne(){T("cleanup"),ke.removeListener("close",Yt),ke.removeListener("finish",Pt),Mt&&ke.removeListener("drain",Mt),ke.removeListener("error",wt),ke.removeListener("unpipe",ht),ze.removeListener("end",Ot),ze.removeListener("end",qt),ze.removeListener("data",bt),dn=!0,Mt&&we.awaitDrainWriters&&(!ke._writableState||ke._writableState.needDrain)&&Mt()}function ct(){dn||(we.pipes.length===1&&we.pipes[0]===ke?(T("false write response, pause",0),we.awaitDrainWriters=ke,we.multiAwaitDrain=!1):we.pipes.length>1&&we.pipes.includes(ke)&&(T("false write response, pause",we.awaitDrainWriters.size),we.awaitDrainWriters.add(ke)),ze.pause()),Mt||(Mt=Fe(ze,ke),ke.on("drain",Mt))}ze.on("data",bt);function bt(un){T("ondata");const Nn=ke.write(un);T("dest.write",Nn),Nn===!1&&ct()}function wt(un){if(T("onerror",un),qt(),ke.removeListener("error",wt),ke.listenerCount("error")===0){const Nn=ke._writableState||ke._readableState;Nn&&!Nn.errorEmitted?G(ke,un):ke.emit("error",un)}}A(ke,"error",wt);function Yt(){ke.removeListener("finish",Pt),qt()}ke.once("close",Yt);function Pt(){T("onfinish"),ke.removeListener("close",Yt),qt()}ke.once("finish",Pt);function qt(){T("unpipe"),ze.unpipe(ke)}return ke.emit("pipe",ze),ke.writableNeedDrain===!0?ct():we.flowing||(T("pipe resume"),ze.resume()),ke};function Fe(ke,I){return function(){const we=ke._readableState;we.awaitDrainWriters===I?(T("pipeOnDrain",1),we.awaitDrainWriters=null):we.multiAwaitDrain&&(T("pipeOnDrain",we.awaitDrainWriters.size),we.awaitDrainWriters.delete(I)),(!we.awaitDrainWriters||we.awaitDrainWriters.size===0)&&ke.listenerCount("data")&&ke.resume()}}Re.prototype.unpipe=function(ke){const I=this._readableState,ze={hasUnpiped:!1};if(I.pipes.length===0)return this;if(!ke){const De=I.pipes;I.pipes=[],this.pause();for(let $e=0;$e<De.length;$e++)De[$e].emit("unpipe",this,{hasUnpiped:!1});return this}const we=e(I.pipes,ke);return we===-1?this:(I.pipes.splice(we,1),I.pipes.length===0&&this.pause(),ke.emit("unpipe",this,ze),this)},Re.prototype.on=function(ke,I){const ze=S.prototype.on.call(this,ke,I),we=this._readableState;return ke==="data"?(we.readableListening=this.listenerCount("readable")>0,we.flowing!==!1&&this.resume()):ke==="readable"&&!we.endEmitted&&!we.readableListening&&(we.readableListening=we.needReadable=!0,we.flowing=!1,we.emittedReadable=!1,T("on readable",we.length,we.reading),we.length?F(this):we.reading||r.nextTick(Pe,this)),ze},Re.prototype.addListener=Re.prototype.on,Re.prototype.removeListener=function(ke,I){const ze=S.prototype.removeListener.call(this,ke,I);return ke==="readable"&&r.nextTick(dt,this),ze},Re.prototype.off=Re.prototype.removeListener,Re.prototype.removeAllListeners=function(ke){const I=S.prototype.removeAllListeners.apply(this,arguments);return(ke==="readable"||ke===void 0)&&r.nextTick(dt,this),I};function dt(ke){const I=ke._readableState;I.readableListening=ke.listenerCount("readable")>0,I.resumeScheduled&&I[j]===!1?I.flowing=!0:ke.listenerCount("data")>0?ke.resume():I.readableListening||(I.flowing=null)}function Pe(ke){T("readable nexttick read 0"),ke.read(0)}Re.prototype.resume=function(){const ke=this._readableState;return ke.flowing||(T("resume"),ke.flowing=!ke.readableListening,He(this,ke)),ke[j]=!1,this};function He(ke,I){I.resumeScheduled||(I.resumeScheduled=!0,r.nextTick(ye,ke,I))}function ye(ke,I){T("resume",I.reading),I.reading||ke.read(0),I.resumeScheduled=!1,ke.emit("resume"),Je(ke),I.flowing&&!I.reading&&ke.read(0)}Re.prototype.pause=function(){return T("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(T("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[j]=!0,this};function Je(ke){const I=ke._readableState;for(T("flow",I.flowing);I.flowing&&ke.read()!==null;);}Re.prototype.wrap=function(ke){let I=!1;ke.on("data",we=>{!this.push(we)&&ke.pause&&(I=!0,ke.pause())}),ke.on("end",()=>{this.push(null)}),ke.on("error",we=>{G(this,we)}),ke.on("close",()=>{this.destroy()}),ke.on("destroy",()=>{this.destroy()}),this._read=()=>{I&&ke.resume&&(I=!1,ke.resume())};const ze=o(ke);for(let we=1;we<ze.length;we++){const De=ze[we];this[De]===void 0&&typeof ke[De]=="function"&&(this[De]=ke[De].bind(ke))}return this},Re.prototype[b]=function(){return kt(this)},Re.prototype.iterator=function(ke){return ke!==void 0&&P(ke,"options"),kt(this,ke)};function kt(ke,I){typeof ke.read!="function"&&(ke=Re.wrap(ke,{objectMode:!0}));const ze=gt(ke,I);return ze.stream=ke,ze}async function*gt(ke,I){let ze=ee;function we(ht){this===ke?(ze(),ze=ee):ze=ht}ke.on("readable",we);let De;const $e=k(ke,{writable:!1},ht=>{De=ht?ie(De,ht):null,ze(),ze=ee});try{for(;;){const ht=ke.destroyed?null:ke.read();if(ht!==null)yield ht;else{if(De)throw De;if(De===null)return;await new p(we)}}}catch(ht){throw De=ie(De,ht),De}finally{(De||I?.destroyOnReturn!==!1)&&(De===void 0||ke._readableState.autoDestroy)?N.destroyer(ke,null):(ke.off("readable",we),$e())}}u(Re.prototype,{readable:{__proto__:null,get(){const ke=this._readableState;return!!ke&&ke.readable!==!1&&!ke.destroyed&&!ke.errorEmitted&&!ke.endEmitted},set(ke){this._readableState&&(this._readableState.readable=!!ke)}},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(ke){this._readableState&&(this._readableState.flowing=ke)}},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(ke){this._readableState&&(this._readableState.destroyed=ke)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),u(Ae.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[j]!==!1},set(ke){this[j]=!!ke}}}),Re._fromList=Bt;function Bt(ke,I){if(I.length===0)return null;let ze;return I.objectMode?ze=I.buffer.shift():!ke||ke>=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(ke,I.decoder),ze}function vt(ke){const I=ke._readableState;T("endReadable",I.endEmitted),I.endEmitted||(I.ended=!0,r.nextTick(wn,I,ke))}function wn(ke,I){if(T("endReadableNT",ke.endEmitted,ke.length),!ke.errored&&!ke.closeEmitted&&!ke.endEmitted&&ke.length===0){if(ke.endEmitted=!0,I.emit("end"),I.writable&&I.allowHalfOpen===!1)r.nextTick(tt,I);else if(ke.autoDestroy){const ze=I._writableState;(!ze||ze.autoDestroy&&(ze.finished||ze.writable===!1))&&I.destroy()}}}function tt(ke){ke.writable&&!ke.writableEnded&&!ke.destroyed&&ke.end()}Re.from=function(ke,I){return z(Re,ke,I)};let rt;function Er(){return rt===void 0&&(rt={}),rt}return Re.fromWeb=function(ke,I){return Er().newStreamReadableFromReadableStream(ke,I)},Re.toWeb=function(ke,I){return Er().newReadableStreamFromStreamReadable(ke,I)},Re.wrap=function(ke,I){var ze,we;return new Re({objectMode:(ze=(we=ke.readableObjectMode)!==null&&we!==void 0?we:ke.objectMode)!==null&&ze!==void 0?ze:!0,...I,destroy(De,$e){N.destroyer(ke,De),$e(De)}}).wrap(ke)},TE}var RE,uO;function a8(){if(uO)return RE;uO=1;const r=If(),{ArrayPrototypeSlice:e,Error:t,FunctionPrototypeSymbolHasInstance:a,ObjectDefineProperty:s,ObjectDefineProperties:u,ObjectSetPrototypeOf:o,StringPrototypeToLowerCase:c,Symbol:p,SymbolHasInstance:d}=oa();RE=P,P.WritableState=x;const{EventEmitter:y}=jg(),b=r8().Stream,{Buffer:g}=Cp(),v=D0(),{addAbortSignal:S}=w_(),{getHighWaterMark:A,getDefaultHighWaterMark:C}=__(),{ERR_INVALID_ARG_TYPE:M,ERR_METHOD_NOT_IMPLEMENTED:k,ERR_MULTIPLE_CALLBACK:T,ERR_STREAM_CANNOT_PIPE:R,ERR_STREAM_DESTROYED:N,ERR_STREAM_ALREADY_FINISHED:K,ERR_STREAM_NULL_VALUES:X,ERR_STREAM_WRITE_AFTER_END:ie,ERR_UNKNOWN_ENCODING:ge}=Ls().codes,{errorOrDestroy:pe}=v;o(P.prototype,b.prototype),o(P,b);function te(){}const se=p("kOnFinished");function x(me,de,xe){typeof xe!="boolean"&&(xe=de instanceof mc()),this.objectMode=!!(me&&me.objectMode),xe&&(this.objectMode=this.objectMode||!!(me&&me.writableObjectMode)),this.highWaterMark=me?A(this,me,"writableHighWaterMark",xe):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=G.bind(void 0,de),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[se]=[]}function _(me){me.buffered=[],me.bufferedIndex=0,me.allBuffers=!0,me.allNoop=!0}x.prototype.getBuffer=function(){return e(this.buffered,this.bufferedIndex)},s(x.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function P(me){const de=this instanceof mc();if(!de&&!a(P,this))return new P(me);this._writableState=new x(me,this,de),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&&S(me.signal,this)),b.call(this,me),v.construct(this,()=>{const xe=this._writableState;xe.writing||ae(this,xe),Se(this,xe)})}s(P,d,{__proto__:null,value:function(me){return a(this,me)?!0:this!==P?!1:me&&me._writableState instanceof x}}),P.prototype.pipe=function(){pe(this,new R)};function j(me,de,xe,ne){const B=me._writableState;if(typeof xe=="function")ne=xe,xe=B.defaultEncoding;else{if(!xe)xe=B.defaultEncoding;else if(xe!=="buffer"&&!g.isEncoding(xe))throw new ge(xe);typeof ne!="function"&&(ne=te)}if(de===null)throw new X;if(!B.objectMode)if(typeof de=="string")B.decodeStrings!==!1&&(de=g.from(de,xe),xe="buffer");else if(de instanceof g)xe="buffer";else if(b._isUint8Array(de))de=b._uint8ArrayToBuffer(de),xe="buffer";else throw new M("chunk",["string","Buffer","Uint8Array"],de);let V;return B.ending?V=new ie:B.destroyed&&(V=new N("write")),V?(r.nextTick(ne,V),pe(me,V,!0),V):(B.pendingcb++,q(me,B,de,xe,ne))}P.prototype.write=function(me,de,xe){return j(this,me,de,xe)===!0},P.prototype.cork=function(){this._writableState.corked++},P.prototype.uncork=function(){const me=this._writableState;me.corked&&(me.corked--,me.writing||ae(this,me))},P.prototype.setDefaultEncoding=function(de){if(typeof de=="string"&&(de=c(de)),!g.isEncoding(de))throw new ge(de);return this._writableState.defaultEncoding=de,this};function q(me,de,xe,ne,B){const V=de.objectMode?1:xe.length;de.length+=V;const Q=de.length<de.highWaterMark;return Q||(de.needDrain=!0),de.writing||de.corked||de.errored||!de.constructed?(de.buffered.push({chunk:xe,encoding:ne,callback:B}),de.allBuffers&&ne!=="buffer"&&(de.allBuffers=!1),de.allNoop&&B!==te&&(de.allNoop=!1)):(de.writelen=V,de.writecb=B,de.writing=!0,de.sync=!0,me._write(xe,ne,de.onwrite),de.sync=!1),Q&&!de.errored&&!de.destroyed}function z(me,de,xe,ne,B,V,Q){de.writelen=ne,de.writecb=Q,de.writing=!0,de.sync=!0,de.destroyed?de.onwrite(new N("write")):xe?me._writev(B,de.onwrite):me._write(B,V,de.onwrite),de.sync=!1}function ee(me,de,xe,ne){--de.pendingcb,ne(xe),J(de),pe(me,xe)}function G(me,de){const xe=me._writableState,ne=xe.sync,B=xe.writecb;if(typeof B!="function"){pe(me,new T);return}xe.writing=!1,xe.writecb=null,xe.length-=xe.writelen,xe.writelen=0,de?(de.stack,xe.errored||(xe.errored=de),me._readableState&&!me._readableState.errored&&(me._readableState.errored=de),ne?r.nextTick(ee,me,xe,de,B):ee(me,xe,de,B)):(xe.buffered.length>xe.bufferedIndex&&ae(me,xe),ne?xe.afterWriteTickInfo!==null&&xe.afterWriteTickInfo.cb===B?xe.afterWriteTickInfo.count++:(xe.afterWriteTickInfo={count:1,cb:B,stream:me,state:xe},r.nextTick(D,xe.afterWriteTickInfo)):L(me,xe,1,B))}function D({stream:me,state:de,count:xe,cb:ne}){return de.afterWriteTickInfo=null,L(me,de,xe,ne)}function L(me,de,xe,ne){for(!de.ending&&!me.destroyed&&de.length===0&&de.needDrain&&(de.needDrain=!1,me.emit("drain"));xe-- >0;)de.pendingcb--,ne();de.destroyed&&J(de),Se(me,de)}function J(me){if(me.writing)return;for(let B=me.bufferedIndex;B<me.buffered.length;++B){var de;const{chunk:V,callback:Q}=me.buffered[B],le=me.objectMode?1:V.length;me.length-=le,Q((de=me.errored)!==null&&de!==void 0?de:new N("write"))}const xe=me[se].splice(0);for(let B=0;B<xe.length;B++){var ne;xe[B]((ne=me.errored)!==null&&ne!==void 0?ne:new N("end"))}_(me)}function ae(me,de){if(de.corked||de.bufferProcessing||de.destroyed||!de.constructed)return;const{buffered:xe,bufferedIndex:ne,objectMode:B}=de,V=xe.length-ne;if(!V)return;let Q=ne;if(de.bufferProcessing=!0,V>1&&me._writev){de.pendingcb-=V-1;const le=de.allNoop?te:Re=>{for(let Ye=Q;Ye<xe.length;++Ye)xe[Ye].callback(Re)},Ae=de.allNoop&&Q===0?xe:e(xe,Q);Ae.allBuffers=de.allBuffers,z(me,de,!0,de.length,Ae,"",le),_(de)}else{do{const{chunk:le,encoding:Ae,callback:Re}=xe[Q];xe[Q++]=null;const Ye=B?1:le.length;z(me,de,!1,Ye,le,Ae,Re)}while(Q<xe.length&&!de.writing);Q===xe.length?_(de):Q>256?(xe.splice(0,Q),de.bufferedIndex=0):de.bufferedIndex=Q}de.bufferProcessing=!1}P.prototype._write=function(me,de,xe){if(this._writev)this._writev([{chunk:me,encoding:de}],xe);else throw new k("_write()")},P.prototype._writev=null,P.prototype.end=function(me,de,xe){const ne=this._writableState;typeof me=="function"?(xe=me,me=null,de=null):typeof de=="function"&&(xe=de,de=null);let B;if(me!=null){const V=j(this,me,de);V instanceof t&&(B=V)}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 K("end"):ne.destroyed&&(B=new N("end"))),typeof xe=="function"&&(B||ne.finished?r.nextTick(xe,B):ne[se].push(xe)),this};function H(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,de){let xe=!1;function ne(B){if(xe){pe(me,B??T());return}if(xe=!0,de.pendingcb--,B){const V=de[se].splice(0);for(let Q=0;Q<V.length;Q++)V[Q](B);pe(me,B,de.sync)}else H(de)&&(de.prefinished=!0,me.emit("prefinish"),de.pendingcb++,r.nextTick(Me,me,de))}de.sync=!0,de.pendingcb++;try{me._final(ne)}catch(B){ne(B)}de.sync=!1}function Ie(me,de){!de.prefinished&&!de.finalCalled&&(typeof me._final=="function"&&!de.destroyed?(de.finalCalled=!0,Ce(me,de)):(de.prefinished=!0,me.emit("prefinish")))}function Se(me,de,xe){H(de)&&(Ie(me,de),de.pendingcb===0&&(xe?(de.pendingcb++,r.nextTick((ne,B)=>{H(B)?Me(ne,B):B.pendingcb--},me,de)):H(de)&&(de.pendingcb++,Me(me,de))))}function Me(me,de){de.pendingcb--,de.finished=!0;const xe=de[se].splice(0);for(let ne=0;ne<xe.length;ne++)xe[ne]();if(me.emit("finish"),de.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=v.destroy;P.prototype.destroy=function(me,de){const xe=this._writableState;return!xe.destroyed&&(xe.bufferedIndex<xe.buffered.length||xe[se].length)&&r.nextTick(J,xe),oe.call(this,me,de),this},P.prototype._undestroy=v.undestroy,P.prototype._destroy=function(me,de){de(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,de){return be().newStreamWritableFromWritableStream(me,de)},P.toWeb=function(me){return be().newWritableStreamFromStreamWritable(me)},RE}var OE,lO;function pY(){if(lO)return OE;lO=1;const r=If(),e=Cp(),{isReadable:t,isWritable:a,isIterable:s,isNodeStream:u,isReadableNodeStream:o,isWritableNodeStream:c,isDuplexNodeStream:p,isReadableStream:d,isWritableStream:y}=wc(),b=Df(),{AbortError:g,codes:{ERR_INVALID_ARG_TYPE:v,ERR_INVALID_RETURN_VALUE:S}}=Ls(),{destroyer:A}=D0(),C=mc(),M=x_(),k=a8(),{createDeferredPromise:T}=as(),R=PP(),N=globalThis.Blob||e.Blob,K=typeof N<"u"?function(x){return x instanceof N}:function(x){return!1},X=globalThis.AbortController||Mg().AbortController,{FunctionPrototypeCall:ie}=oa();class ge extends C{constructor(x){super(x),x?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),x?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}OE=function se(x,_){if(p(x))return x;if(o(x))return te({readable:x});if(c(x))return te({writable:x});if(u(x))return te({writable:!1,readable:!1});if(d(x))return te({readable:M.fromWeb(x)});if(y(x))return te({writable:k.fromWeb(x)});if(typeof x=="function"){const{value:j,write:q,final:z,destroy:ee}=pe(x);if(s(j))return R(ge,j,{objectMode:!0,write:q,final:z,destroy:ee});const G=j?.then;if(typeof G=="function"){let D;const L=ie(G,j,J=>{if(J!=null)throw new S("nully","body",J)},J=>{A(D,J)});return D=new ge({objectMode:!0,readable:!1,write:q,final(J){z(async()=>{try{await L,r.nextTick(J,null)}catch(ae){r.nextTick(J,ae)}})},destroy:ee})}throw new S("Iterable, AsyncIterable or AsyncFunction",_,j)}if(K(x))return se(x.arrayBuffer());if(s(x))return R(ge,x,{objectMode:!0,writable:!1});if(d(x?.readable)&&y(x?.writable))return ge.fromWeb(x);if(typeof x?.writable=="object"||typeof x?.readable=="object"){const j=x!=null&&x.readable?o(x?.readable)?x?.readable:se(x.readable):void 0,q=x!=null&&x.writable?c(x?.writable)?x?.writable:se(x.writable):void 0;return te({readable:j,writable:q})}const P=x?.then;if(typeof P=="function"){let j;return ie(P,x,q=>{q!=null&&j.push(q),j.push(null)},q=>{A(j,q)}),j=new ge({objectMode:!0,writable:!1,read(){}})}throw new v(_,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],x)};function pe(se){let{promise:x,resolve:_}=T();const P=new X,j=P.signal;return{value:se((async function*(){for(;;){const z=x;x=null;const{chunk:ee,done:G,cb:D}=await z;if(r.nextTick(D),G)return;if(j.aborted)throw new g(void 0,{cause:j.reason});({promise:x,resolve:_}=T()),yield ee}})(),{signal:j}),write(z,ee,G){const D=_;_=null,D({chunk:z,done:!1,cb:G})},final(z){const ee=_;_=null,ee({done:!0,cb:z})},destroy(z,ee){P.abort(),ee(z)}}}function te(se){const x=se.readable&&typeof se.readable.read!="function"?M.wrap(se.readable):se.readable,_=se.writable;let P=!!t(x),j=!!a(_),q,z,ee,G,D;function L(J){const ae=G;G=null,ae?ae(J):J&&D.destroy(J)}return D=new ge({readableObjectMode:!!(x!=null&&x.readableObjectMode),writableObjectMode:!!(_!=null&&_.writableObjectMode),readable:P,writable:j}),j&&(b(_,J=>{j=!1,J&&A(x,J),L(J)}),D._write=function(J,ae,H){_.write(J,ae)?H():q=H},D._final=function(J){_.end(),z=J},_.on("drain",function(){if(q){const J=q;q=null,J()}}),_.on("finish",function(){if(z){const J=z;z=null,J()}})),P&&(b(x,J=>{P=!1,J&&A(x,J),L(J)}),x.on("readable",function(){if(ee){const J=ee;ee=null,J()}}),x.on("end",function(){D.push(null)}),D._read=function(){for(;;){const J=x.read();if(J===null){ee=D._read;return}if(!D.push(J))return}}),D._destroy=function(J,ae){!J&&G!==null&&(J=new g),ee=null,q=null,z=null,G===null?ae(J):(G=ae,A(_,J),A(x,J))},D}return OE}var LE,cO;function mc(){if(cO)return LE;cO=1;const{ObjectDefineProperties:r,ObjectGetOwnPropertyDescriptor:e,ObjectKeys:t,ObjectSetPrototypeOf:a}=oa();LE=o;const s=x_(),u=a8();a(o.prototype,s.prototype),a(o,s);{const y=t(u.prototype);for(let b=0;b<y.length;b++){const g=y[b];o.prototype[g]||(o.prototype[g]=u.prototype[g])}}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}r(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,b){return p().newStreamDuplexFromReadableWritablePair(y,b)},o.toWeb=function(y){return p().newReadableWritablePairFromDuplex(y)};let d;return o.from=function(y){return d||(d=pY()),d(y,"body")},LE}var NE,fO;function IP(){if(fO)return NE;fO=1;const{ObjectSetPrototypeOf:r,Symbol:e}=oa();NE=o;const{ERR_METHOD_NOT_IMPLEMENTED:t}=Ls().codes,a=mc(),{getHighWaterMark:s}=__();r(o.prototype,a.prototype),r(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,b)=>{if(y){d?d(y):this.destroy(y);return}b!=null&&this.push(b),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,b){throw new t("_transform()")},o.prototype._write=function(d,y,b){const g=this._readableState,v=this._writableState,S=g.length;this._transform(d,y,(A,C)=>{if(A){b(A);return}C!=null&&this.push(C),v.ended||S===g.length||g.length<g.highWaterMark?b():this[u]=b})},o.prototype._read=function(){if(this[u]){const d=this[u];this[u]=null,d()}},NE}var PE,dO;function DP(){if(dO)return PE;dO=1;const{ObjectSetPrototypeOf:r}=oa();PE=t;const e=IP();r(t.prototype,e.prototype),r(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)},PE}var IE,pO;function i8(){if(pO)return IE;pO=1;const r=If(),{ArrayIsArray:e,Promise:t,SymbolAsyncIterator:a,SymbolDispose:s}=oa(),u=Df(),{once:o}=as(),c=D0(),p=mc(),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:y,ERR_INVALID_RETURN_VALUE:b,ERR_MISSING_ARGS:g,ERR_STREAM_DESTROYED:v,ERR_STREAM_PREMATURE_CLOSE:S},AbortError:A}=Ls(),{validateFunction:C,validateAbortSignal:M}=qg(),{isIterable:k,isReadable:T,isReadableNodeStream:R,isNodeStream:N,isTransformStream:K,isWebStream:X,isReadableStream:ie,isReadableFinished:ge}=wc(),pe=globalThis.AbortController||Mg().AbortController;let te,se,x;function _(J,ae,H){let Ce=!1;J.on("close",()=>{Ce=!0});const Ie=u(J,{readable:ae,writable:H},Se=>{Ce=!Se});return{destroy:Se=>{Ce||(Ce=!0,c.destroyer(J,Se||new v("pipe")))},cleanup:Ie}}function P(J){return C(J[J.length-1],"streams[stream.length - 1]"),J.pop()}function j(J){if(k(J))return J;if(R(J))return q(J);throw new y("val",["Readable","Iterable","AsyncIterable"],J)}async function*q(J){se||(se=x_()),yield*se.prototype[a].call(J)}async function z(J,ae,H,{end:Ce}){let Ie,Se=null;const Me=be=>{if(be&&(Ie=be),Se){const me=Se;Se=null,me()}},oe=()=>new t((be,me)=>{Ie?me(Ie):Se=()=>{Ie?me(Ie):be()}});ae.on("drain",Me);const ce=u(ae,{readable:!1},Me);try{ae.writableNeedDrain&&await oe();for await(const be of J)ae.write(be)||await oe();Ce&&(ae.end(),await oe()),H()}catch(be){H(Ie!==be?d(Ie,be):be)}finally{ce(),ae.off("drain",Me)}}async function ee(J,ae,H,{end:Ce}){K(ae)&&(ae=ae.writable);const Ie=ae.getWriter();try{for await(const Se of J)await Ie.ready,Ie.write(Se).catch(()=>{});await Ie.ready,Ce&&await Ie.close(),H()}catch(Se){try{await Ie.abort(Se),H(Se)}catch(Me){H(Me)}}}function G(...J){return D(J,o(P(J)))}function D(J,ae,H){if(J.length===1&&e(J[0])&&(J=J[0]),J.length<2)throw new g("streams");const Ce=new pe,Ie=Ce.signal,Se=H?.signal,Me=[];M(Se,"options.signal");function oe(){B(new A)}x=x||as().addAbortListener;let ce;Se&&(ce=x(Se,oe));let be,me;const de=[];let xe=0;function ne(Ae){B(Ae,--xe===0)}function B(Ae,Re){var Ye;if(Ae&&(!be||be.code==="ERR_STREAM_PREMATURE_CLOSE")&&(be=Ae),!(!be&&!Re)){for(;de.length;)de.shift()(be);(Ye=ce)===null||Ye===void 0||Ye[s](),Ce.abort(),Re&&(be||Me.forEach(lt=>lt()),r.nextTick(ae,be,me))}}let V;for(let Ae=0;Ae<J.length;Ae++){const Re=J[Ae],Ye=Ae<J.length-1,lt=Ae>0,et=Ye||H?.end!==!1,xt=Ae===J.length-1;if(N(Re)){let fe=function(Y){Y&&Y.name!=="AbortError"&&Y.code!=="ERR_STREAM_PREMATURE_CLOSE"&&ne(Y)};if(et){const{destroy:Y,cleanup:F}=_(Re,Ye,lt);de.push(Y),T(Re)&&xt&&Me.push(F)}Re.on("error",fe),T(Re)&&xt&&Me.push(()=>{Re.removeListener("error",fe)})}if(Ae===0)if(typeof Re=="function"){if(V=Re({signal:Ie}),!k(V))throw new b("Iterable, AsyncIterable or Stream","source",V)}else k(Re)||R(Re)||K(Re)?V=Re:V=p.from(Re);else if(typeof Re=="function"){if(K(V)){var Q;V=j((Q=V)===null||Q===void 0?void 0:Q.readable)}else V=j(V);if(V=Re(V,{signal:Ie}),Ye){if(!k(V,!0))throw new b("AsyncIterable",`transform[${Ae-1}]`,V)}else{var le;te||(te=DP());const fe=new te({objectMode:!0}),Y=(le=V)===null||le===void 0?void 0:le.then;if(typeof Y=="function")xe++,Y.call(V,Ee=>{me=Ee,Ee!=null&&fe.write(Ee),et&&fe.end(),r.nextTick(ne)},Ee=>{fe.destroy(Ee),r.nextTick(ne,Ee)});else if(k(V,!0))xe++,z(V,fe,ne,{end:et});else if(ie(V)||K(V)){const Ee=V.readable||V;xe++,z(Ee,fe,ne,{end:et})}else throw new b("AsyncIterable or Promise","destination",V);V=fe;const{destroy:F,cleanup:ue}=_(V,!1,!0);de.push(F),xt&&Me.push(ue)}}else if(N(Re)){if(R(V)){xe+=2;const fe=L(V,Re,ne,{end:et});T(Re)&&xt&&Me.push(fe)}else if(K(V)||ie(V)){const fe=V.readable||V;xe++,z(fe,Re,ne,{end:et})}else if(k(V))xe++,z(V,Re,ne,{end:et});else throw new y("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],V);V=Re}else if(X(Re)){if(R(V))xe++,ee(j(V),Re,ne,{end:et});else if(ie(V)||k(V))xe++,ee(V,Re,ne,{end:et});else if(K(V))xe++,ee(V.readable,Re,ne,{end:et});else throw new y("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],V);V=Re}else V=p.from(Re)}return(Ie!=null&&Ie.aborted||Se!=null&&Se.aborted)&&r.nextTick(oe),V}function L(J,ae,H,{end:Ce}){let Ie=!1;if(ae.on("close",()=>{Ie||H(new S)}),J.pipe(ae,{end:!1}),Ce){let Se=function(){Ie=!0,ae.end()};ge(J)?r.nextTick(Se):J.once("end",Se)}else H();return u(J,{readable:!0,writable:!1},Se=>{const Me=J._readableState;Se&&Se.code==="ERR_STREAM_PREMATURE_CLOSE"&&Me&&Me.ended&&!Me.errored&&!Me.errorEmitted?J.once("end",H).once("error",H):H(Se)}),u(ae,{readable:!1,writable:!0},H)}return IE={pipelineImpl:D,pipeline:G},IE}var DE,hO;function UP(){if(hO)return DE;hO=1;const{pipeline:r}=i8(),e=mc(),{destroyer:t}=D0(),{isNodeStream:a,isReadable:s,isWritable:u,isWebStream:o,isTransformStream:c,isWritableStream:p,isReadableStream:d}=wc(),{AbortError:y,codes:{ERR_INVALID_ARG_VALUE:b,ERR_MISSING_ARGS:g}}=Ls(),v=Df();return DE=function(...A){if(A.length===0)throw new g("streams");if(A.length===1)return e.from(A[0]);const C=[...A];if(typeof A[0]=="function"&&(A[0]=e.from(A[0])),typeof A[A.length-1]=="function"){const te=A.length-1;A[te]=e.from(A[te])}for(let te=0;te<A.length;++te)if(!(!a(A[te])&&!o(A[te]))){if(te<A.length-1&&!(s(A[te])||d(A[te])||c(A[te])))throw new b(`streams[${te}]`,C[te],"must be readable");if(te>0&&!(u(A[te])||p(A[te])||c(A[te])))throw new b(`streams[${te}]`,C[te],"must be writable")}let M,k,T,R,N;function K(te){const se=R;R=null,se?se(te):te?N.destroy(te):!pe&&!ge&&N.destroy()}const X=A[0],ie=r(A,K),ge=!!(u(X)||p(X)||c(X)),pe=!!(s(ie)||d(ie)||c(ie));if(N=new e({writableObjectMode:!!(X!=null&&X.writableObjectMode),readableObjectMode:!!(ie!=null&&ie.readableObjectMode),writable:ge,readable:pe}),ge){if(a(X))N._write=function(se,x,_){X.write(se,x)?_():M=_},N._final=function(se){X.end(),k=se},X.on("drain",function(){if(M){const se=M;M=null,se()}});else if(o(X)){const x=(c(X)?X.writable:X).getWriter();N._write=async function(_,P,j){try{await x.ready,x.write(_).catch(()=>{}),j()}catch(q){j(q)}},N._final=async function(_){try{await x.ready,x.close().catch(()=>{}),k=_}catch(P){_(P)}}}const te=c(ie)?ie.readable:ie;v(te,()=>{if(k){const se=k;k=null,se()}})}if(pe){if(a(ie))ie.on("readable",function(){if(T){const te=T;T=null,te()}}),ie.on("end",function(){N.push(null)}),N._read=function(){for(;;){const te=ie.read();if(te===null){T=N._read;return}if(!N.push(te))return}};else if(o(ie)){const se=(c(ie)?ie.readable:ie).getReader();N._read=async function(){for(;;)try{const{value:x,done:_}=await se.read();if(!N.push(x))return;if(_){N.push(null);return}}catch{return}}}}return N._destroy=function(te,se){!te&&R!==null&&(te=new y),T=null,M=null,k=null,R===null?se(te):(R=se,a(ie)&&t(ie,te))},N},DE}var yO;function hY(){if(yO)return lw;yO=1;const r=globalThis.AbortController||Mg().AbortController,{codes:{ERR_INVALID_ARG_VALUE:e,ERR_INVALID_ARG_TYPE:t,ERR_MISSING_ARGS:a,ERR_OUT_OF_RANGE:s},AbortError:u}=Ls(),{validateAbortSignal:o,validateInteger:c,validateObject:p}=qg(),d=oa().Symbol("kWeak"),y=oa().Symbol("kResistStopPropagation"),{finished:b}=Df(),g=UP(),{addAbortSignalNoValidate:v}=w_(),{isWritable:S,isNodeStream:A}=wc(),{deprecate:C}=as(),{ArrayPrototypePush:M,Boolean:k,MathFloor:T,Number:R,NumberIsNaN:N,Promise:K,PromiseReject:X,PromiseResolve:ie,PromisePrototypeThen:ge,Symbol:pe}=oa(),te=pe("kEmpty"),se=pe("kEof");function x(Se,Me){if(Me!=null&&p(Me,"options"),Me?.signal!=null&&o(Me.signal,"options.signal"),A(Se)&&!S(Se))throw new e("stream",Se,"must be writable");const oe=g(this,Se);return Me!=null&&Me.signal&&v(Me.signal,oe),oe}function _(Se,Me){if(typeof Se!="function")throw new t("fn",["Function","AsyncFunction"],Se);Me!=null&&p(Me,"options"),Me?.signal!=null&&o(Me.signal,"options.signal");let oe=1;Me?.concurrency!=null&&(oe=T(Me.concurrency));let ce=oe-1;return Me?.highWaterMark!=null&&(ce=T(Me.highWaterMark)),c(oe,"options.concurrency",1),c(ce,"options.highWaterMark",0),ce+=oe,(async function*(){const me=as().AbortSignalAny([Me?.signal].filter(k)),de=this,xe=[],ne={signal:me};let B,V,Q=!1,le=0;function Ae(){Q=!0,Re()}function Re(){le-=1,Ye()}function Ye(){V&&!Q&&le<oe&&xe.length<ce&&(V(),V=null)}async function lt(){try{for await(let et of de){if(Q)return;if(me.aborted)throw new u;try{if(et=Se(et,ne),et===te)continue;et=ie(et)}catch(xt){et=X(xt)}le+=1,ge(et,Re,Ae),xe.push(et),B&&(B(),B=null),!Q&&(xe.length>=ce||le>=oe)&&await new K(xt=>{V=xt})}xe.push(se)}catch(et){const xt=X(et);ge(xt,Re,Ae),xe.push(xt)}finally{Q=!0,B&&(B(),B=null)}}lt();try{for(;;){for(;xe.length>0;){const et=await xe[0];if(et===se)return;if(me.aborted)throw new u;et!==te&&(yield et),xe.shift(),Ye()}await new K(et=>{B=et})}}finally{Q=!0,V&&(V(),V=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,Me=void 0){for await(const oe of G.call(this,Se,Me))return!0;return!1}async function q(Se,Me=void 0){if(typeof Se!="function")throw new t("fn",["Function","AsyncFunction"],Se);return!await j.call(this,async(...oe)=>!await Se(...oe),Me)}async function z(Se,Me){for await(const oe of G.call(this,Se,Me))return oe}async function ee(Se,Me){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,Me));}function G(Se,Me){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,Me)}class D extends a{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function L(Se,Me,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 b(this.destroy(B)),B}const me=new r,de=me.signal;if(oe!=null&&oe.signal){const B={once:!0,[d]:this,[y]:!0};oe.signal.addEventListener("abort",()=>me.abort(),B)}let xe=!1;try{for await(const B of this){var ne;if(xe=!0,oe!=null&&(ne=oe.signal)!==null&&ne!==void 0&&ne.aborted)throw new u;be?Me=await Se(Me,B,{signal:de}):(Me=B,be=!0)}if(!xe&&!be)throw new D}finally{me.abort()}return Me}async function J(Se){Se!=null&&p(Se,"options"),Se?.signal!=null&&o(Se.signal,"options.signal");const Me=[];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});M(Me,ce)}return Me}function ae(Se,Me){const oe=_.call(this,Se,Me);return(async function*(){for await(const be of oe)yield*be}).call(this)}function H(Se){if(Se=R(Se),N(Se))return 0;if(Se<0)throw new s("number",">= 0",Se);return Se}function Ce(Se,Me=void 0){return Me!=null&&p(Me,"options"),Me?.signal!=null&&o(Me.signal,"options.signal"),Se=H(Se),(async function*(){var ce;if(Me!=null&&(ce=Me.signal)!==null&&ce!==void 0&&ce.aborted)throw new u;for await(const me of this){var be;if(Me!=null&&(be=Me.signal)!==null&&be!==void 0&&be.aborted)throw new u;Se--<=0&&(yield me)}}).call(this)}function Ie(Se,Me=void 0){return Me!=null&&p(Me,"options"),Me?.signal!=null&&o(Me.signal,"options.signal"),Se=H(Se),(async function*(){var ce;if(Me!=null&&(ce=Me.signal)!==null&&ce!==void 0&&ce.aborted)throw new u;for await(const me of this){var be;if(Me!=null&&(be=Me.signal)!==null&&be!==void 0&&be.aborted)throw new u;if(Se-- >0&&(yield me),Se<=0)return}}).call(this)}return lw.streamReturningOperators={asIndexedPairs:C(P,"readable.asIndexedPairs will be removed in a future version."),drop:Ce,filter:G,flatMap:ae,map:_,take:Ie,compose:x},lw.promiseReturningOperators={every:q,forEach:ee,reduce:L,toArray:J,some:j,find:z},lw}var UE,mO;function FP(){if(mO)return UE;mO=1;const{ArrayPrototypePop:r,Promise:e}=oa(),{isIterable:t,isNodeStream:a,isWebStream:s}=wc(),{pipelineImpl:u}=i8(),{finished:o}=Df();BP();function c(...p){return new e((d,y)=>{let b,g;const v=p[p.length-1];if(v&&typeof v=="object"&&!a(v)&&!t(v)&&!s(v)){const S=r(p);b=S.signal,g=S.end}u(p,(S,A)=>{S?y(S):d(A)},{signal:b,end:g})})}return UE={finished:o,pipeline:c},UE}var gO;function BP(){if(gO)return hE.exports;gO=1;const{Buffer:r}=Cp(),{ObjectDefineProperty:e,ObjectKeys:t,ReflectApply:a}=oa(),{promisify:{custom:s}}=as(),{streamReturningOperators:u,promiseReturningOperators:o}=hY(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:c}}=Ls(),p=UP(),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:y}=__(),{pipeline:b}=i8(),{destroyer:g}=D0(),v=Df(),S=FP(),A=wc(),C=hE.exports=r8().Stream;C.isDestroyed=A.isDestroyed,C.isDisturbed=A.isDisturbed,C.isErrored=A.isErrored,C.isReadable=A.isReadable,C.isWritable=A.isWritable,C.Readable=x_();for(const k of t(u)){let R=function(...N){if(new.target)throw c();return C.Readable.from(a(T,this,N))};const T=u[k];e(R,"name",{__proto__:null,value:T.name}),e(R,"length",{__proto__:null,value:T.length}),e(C.Readable.prototype,k,{__proto__:null,value:R,enumerable:!1,configurable:!0,writable:!0})}for(const k of t(o)){let R=function(...N){if(new.target)throw c();return a(T,this,N)};const T=o[k];e(R,"name",{__proto__:null,value:T.name}),e(R,"length",{__proto__:null,value:T.length}),e(C.Readable.prototype,k,{__proto__:null,value:R,enumerable:!1,configurable:!0,writable:!0})}C.Writable=a8(),C.Duplex=mc(),C.Transform=IP(),C.PassThrough=DP(),C.pipeline=b;const{addAbortSignal:M}=w_();return C.addAbortSignal=M,C.finished=v,C.destroy=g,C.compose=p,C.setDefaultHighWaterMark=d,C.getDefaultHighWaterMark=y,e(C,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return S}}),e(b,s,{__proto__:null,enumerable:!0,get(){return S.pipeline}}),e(v,s,{__proto__:null,enumerable:!0,get(){return S.finished}}),C.Stream=C,C._isUint8Array=function(T){return T instanceof Uint8Array},C._uint8ArrayToBuffer=function(T){return r.from(T.buffer,T.byteOffset,T.byteLength)},hE.exports}var vO;function yY(){return vO||(vO=1,(function(r){const e=BP(),t=FP(),a=e.Readable.destroy;r.exports=e.Readable,r.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,r.exports._isUint8Array=e._isUint8Array,r.exports.isDisturbed=e.isDisturbed,r.exports.isErrored=e.isErrored,r.exports.isReadable=e.isReadable,r.exports.Readable=e.Readable,r.exports.Writable=e.Writable,r.exports.Duplex=e.Duplex,r.exports.Transform=e.Transform,r.exports.PassThrough=e.PassThrough,r.exports.addAbortSignal=e.addAbortSignal,r.exports.finished=e.finished,r.exports.destroy=e.destroy,r.exports.destroy=a,r.exports.pipeline=e.pipeline,r.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get(){return t}}),r.exports.Stream=e.Stream,r.exports.default=r.exports})(pE)),pE.exports}var FE,bO;function zP(){if(bO)return FE;bO=1,typeof globalThis.Buffer>"u"&&(globalThis.Buffer=Og().Buffer);const r=rP(),e=yY(),t=gi();if(globalThis.process||(globalThis.process=If()),typeof crypto>"u"){const s=e_;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-DMaSMNU9.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 b=Math.floor(s/564)*576;return s%564!==0&&(b+=576),u?b+608:b+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${r.encode(Buffer.from(d))}`,secret_key:`kpsk${r.encode(Buffer.from(c))}`,public_key:`kppk${r.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${r.encode(Buffer.from(u))}`,public_key:`ktpk${r.encode(Buffer.from(o))}`}},CapToConk(s){const u=o=>new Uint8Array(r.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",b=>{p.push(b)}).on("finish",()=>{d()}).on("error",b=>{y(b)})}),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",b=>{p.push(b)}).on("finish",()=>{d()}).on("error",b=>{y(b)})}),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 FE=a,FE}var zr={},wO;function jP(){if(wO)return zr;wO=1;const r=gi();let e;r.Platform()===r.PLATFORM_NODE&&(globalThis.Response=YA().Response,e=e_);const t=ji(),{ValidatePresence:a,ValidateWriteToken:s,ValidatePartHash:u,ValidateParameters:o}=_u();return zr.ListFiles=async function({libraryId:c,objectId:p,path:d="",versionHash:y,writeToken:b}){o({libraryId:c,objectId:p,versionHash:y,writeToken:b}),y&&(p=this.utils.DecodeVersionHash(y).objectId);let g=t("q",b||y||p,"files_list",d);return this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,versionHash:y}),method:"GET",path:g})},zr.UploadFilesFromS3=async function({libraryId:c,objectId:p,writeToken:d,region:y,bucket:b,fileInfo:g,accessKey:v,secret:S,signedUrl:A,encryption:C="none",copy:M=!1,callback:k}){o({libraryId:c,objectId:p}),s(d);const T=/^s3:\/\/([^/]+)\//i;for(let ge=0;ge<g.length;ge++){const pe=g[ge].source,te=T.exec(pe);if(te){if(te[1]!==b)throw Error('Full S3 file path "'+pe+`" specified, but does not match provided bucket name '`+b+"'");g[ge].source=pe.replace(T,"")}}M?this.Log(`Copying files from S3: ${c} ${p} ${d}`):this.Log(`Adding links to files in S3: ${c} ${p} ${d}`);let R;if(C==="cgck"){let ge=await this.EncryptionConk({libraryId:c,objectId:p,writeToken:d});ge={...ge,secret_key:""},R=`kp__${this.utils.B58(Buffer.from(JSON.stringify(ge)))}`}let N={access_key_id:v,secret_access_key:S};A&&(N={signed_url:A});const K={encryption_key:R,access:{protocol:"s3",platform:"aws",path:b,storage_endpoint:{region:y},cloud_credentials:N}},X=g.map(ge=>M?{op:"ingest-copy",path:ge.path,encryption:{scheme:C==="cgck"?"cgck":"none"},ingest:{type:"key",path:ge.source}}:{op:"add-reference",path:ge.path,reference:{type:"key",path:ge.source}}),{id:ie}=await this.CreateFileUploadJob({libraryId:c,objectId:p,writeToken:d,ops:X,defaults:K});for(;;){await new Promise(te=>setTimeout(te,1e3));const ge=await this.UploadStatus({libraryId:c,objectId:p,writeToken:d,uploadId:ie});if(ge.errors&&ge.errors.length>1)throw ge.errors.join(`
|
|
328
328
|
`);if(ge.error)throw this.Log(`S3 file upload failed:
|
|
329
329
|
${JSON.stringify(ge,null,2)}`),ge.error;if(ge.status.toLowerCase()==="failed")throw"File upload failed";let pe=!1;if(M){if(pe=ge.ingest_copy.done,k){const te=ge.ingest_copy.progress;k({done:pe,uploaded:te.bytes.completed,total:te.bytes.total,uploadedFiles:te.files.completed,totalFiles:te.files.total,fileStatus:te.files.details})}}else if(pe=ge.add_reference.done,k){const te=ge.add_reference.progress;k({done:pe,uploadedFiles:te.completed,totalFiles:te.total})}if(pe)break}},zr.UploadFiles=async function({libraryId:c,objectId:p,writeToken:d,fileInfo:y,encryption:b="none",callback:g}){o({libraryId:c,objectId:p}),s(d),a("fileInfo",y),this.Log(`Uploading files: ${c} ${p} ${d}`);let v;b==="cgck"&&(v=await this.EncryptionConk({libraryId:c,objectId:p,writeToken:d}));let S={},A={},C=y;y=[];for(let x=0;x<C.length;x++){let _={...C[x],data:void 0};_.path=_.path.replace(/^\/+/,""),b==="cgck"&&(_.encryption={scheme:"cgck"}),A[_.path]=C[x].data,_.type="file",S[_.path]={uploaded:0,total:_.size},y.push(_)}this.Log(y),g&&g(S);const{id:M,jobs:k}=await this.CreateFileUploadJob({libraryId:c,objectId:p,writeToken:d,ops:y,encryption:b});this.Log(`Upload ID: ${M}`),this.Log(k);const T=500*1024*1024;let R=[],N=0,K=0;const X=async()=>{for(let x=0;x<k.length;x++){for(;N-K>T;)await new Promise(j=>setTimeout(j,500));const _=k[x];let P=await this.UploadJobStatus({libraryId:c,objectId:p,writeToken:d,uploadId:M,jobId:_});for(let j=0;j<P.files.length;j++){const q=P.files[j];let z;typeof A[q.path]=="number"?(z=Buffer.alloc(q.len),e.readSync(A[q.path],z,0,q.len,q.off)):z=A[q.path].slice(q.off,q.off+q.len),b==="cgck"&&(z=await this.Crypto.Encrypt(v,z)),P.files[j].data=z,N+=q.len}R[x]=P,await new Promise(j=>setTimeout(j,50))}},ie=async(x,_)=>{for(;!R[_];)await new Promise(q=>setTimeout(q,500));const j=R[_].files;for(let q=0;q<j.length;q++){const z=j[q];let ee=0,G=!1;do try{await this.UploadFileData({libraryId:c,objectId:p,writeToken:d,uploadId:M,jobId:x,filePath:z.path,fileData:z.data,encryption:b}),G=!0}catch(D){if(this.Log(D,!0),ee+=1,ee>=10)throw D;await new Promise(L=>setTimeout(L,10*ee*1e3))}while(!G&&ee<10);delete R[_].files[q].data,K+=z.len,g&&(S[z.path]={...S[z.path],uploaded:S[z.path].uploaded+z.len},g(S))}};X().catch(x=>{throw x});const ge=Math.min(3,k.length);let pe=[];for(let x=0;x<ge;x++){const _=new Date().getTime();await ie(k[x],x);const P=(new Date().getTime()-_)/1e3,j=R[x].files.map(q=>q.len).reduce((q,z)=>q+z,0);pe.push(j/P/(1024*1024))}const te=pe.reduce((x,_)=>x+_,0)/ge,se=Math.min(5,Math.ceil(te/2));await this.utils.LimitedMap(se,k,async(x,_)=>{_<ge||await ie(x,_)})},zr.CreateFileUploadJob=async function({libraryId:c,objectId:p,writeToken:d,ops:y,defaults:b={},encryption:g="none"}){o({libraryId:c,objectId:p}),s(d),this.Log(`Creating file upload job: ${c} ${p} ${d}`),this.Log(y),g==="cgck"&&(b.encryption={scheme:"cgck"});const v={seq:0,seq_complete:!0,defaults:b,ops:y},S=t("q",d,"file_jobs");return this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0,encryption:g}),method:"POST",path:S,body:v,allowFailover:!1})},zr.UploadStatus=async function({libraryId:c,objectId:p,writeToken:d,uploadId:y}){o({libraryId:c,objectId:p}),s(d);const b=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:b,allowFailover:!1}))},zr.UploadJobStatus=async function({libraryId:c,objectId:p,writeToken:d,uploadId:y,jobId:b}){o({libraryId:c,objectId:p}),s(d);const g=t("q",d,"file_jobs",y,"uploads",b);let v=await this.utils.ResponseToJson(this.HttpClient.Request({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0}),method:"GET",path:g,allowFailover:!1,queryParams:{start:0,limit:1e4}}));for(;v.next!==v.total&&v.next>=0;){const S=await this.utils.ResponseToJson(this.HttpClient.Request({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0}),method:"GET",path:g,allowFailover:!1,queryParams:{start:v.next}}));v.files=[...v.files,...S.files],v.next=S.next}return v},zr.UploadFileData=async function({libraryId:c,objectId:p,writeToken:d,encryption:y,uploadId:b,jobId:g,filePath:v,fileData:S}){o({libraryId:c,objectId:p}),s(d);let C=(await this.UploadJobStatus({libraryId:c,objectId:p,writeToken:d,uploadId:b,jobId:g})).files.find(k=>k.path===v);if(y&&y!=="none"&&(C=C.encrypted),C.rem===0)return;C.skip&&(S=S.slice(C.skip));let M=t("q",d,"file_jobs",b,g);return await this.utils.ResponseToJson(this.HttpClient.Request({method:"POST",path:M,body:S,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 b=y.map(g=>({op:"add",type:"directory",path:g}));await this.CreateFileUploadJob({libraryId:c,objectId:p,writeToken:d,ops:b})},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 b=y.map(({path:g,to:v})=>({op:"move",copy_move_source_path:g,path:v}));await this.CreateFileUploadJob({libraryId:c,objectId:p,writeToken:d,ops:b})},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 b=y.map(g=>({op:"del",path:g}));await this.CreateFileUploadJob({libraryId:c,objectId:p,writeToken:d,ops:b})},zr.DownloadFile=async function({libraryId:c,objectId:p,versionHash:d,writeToken:y,filePath:b,format:g="arrayBuffer",chunked:v=!1,chunkSize:S,clientSideDecryption:A=!1,callback:C}){o({libraryId:c,objectId:p,versionHash:d}),a("filePath",b),d&&(p=this.utils.DecodeVersionHash(d).objectId);const M=await this.ContentObjectMetadata({libraryId:c,objectId:p,versionHash:d,writeToken:y,metadataSubtree:t("files",b)}),k=M&&M["."].encryption&&M["."].encryption.scheme==="cgck",T=k?"cgck":void 0,R=k&&!A?t("q",y||d||p,"rep","files_download",b):t("q",y||d||p,"files",b),N=await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,versionHash:d,encryption:T,makeAccessRequest:T==="cgck"});N.Accept="*/*";const K=`eluv.caps.iusr${this.utils.AddressToHash(this.signer.address)}`,X=await this.ContentObjectMetadata({libraryId:c,objectId:p,versionHash:d,metadataSubtree:K});k&&!this.utils.EqualAddress(this.signer.address,await this.ContentObjectOwner({objectId:p}))&&!X&&(N["X-Content-Fabric-Decryption-Mode"]="reencrypt"),k&&!A&&(N["X-Content-Fabric-Decryption-Mode"]="decrypt",S=Number.MAX_SAFE_INTEGER);const ie=M["."].size;if(k&&A)return await this.DownloadEncrypted({conk:await this.EncryptionConk({libraryId:c,objectId:p,versionHash:d,download:!0}),downloadPath:R,bytesTotal:ie,headers:N,callback:C,format:g,clientSideDecryption:A,chunked:v});S||(S=1e7);try{return await this.Download({downloadPath:R,bytesTotal:ie,headers:N,callback:C,format:g,chunked:v,chunkSize:S})}catch(ge){if(k&&!A)return this.DownloadFile({...arguments[0],clientSideDecryption:!0});throw ge}},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 b=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:b})},zr.DownloadPart=async function({libraryId:c,objectId:p,versionHash:d,writeToken:y,partHash:b,format:g="arrayBuffer",chunked:v=!1,chunkSize:S=1e7,callback:A}){o({libraryId:c,objectId:p,versionHash:d}),u(b),d&&(p=this.utils.DecodeVersionHash(d).objectId);const C=b.startsWith("hqpe"),M=C?"cgck":void 0,k=t("q",y||d||p,"data",b);let T=await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,versionHash:d,encryption:M,makeAccessRequest:!0});const R=(await this.ContentPart({libraryId:c,objectId:p,versionHash:d,partHash:b})).part.size;return C?(this.utils.EqualAddress(this.signer.address,await this.ContentObjectOwner({objectId:p}))||(T["X-Content-Fabric-Decryption-Mode"]="reencrypt"),await this.DownloadEncrypted({conk:await this.EncryptionConk({libraryId:c,objectId:p,download:!0}),downloadPath:k,bytesTotal:R,headers:T,callback:A,format:g,chunked:v})):await this.Download({downloadPath:k,bytesTotal:R,headers:T,callback:A,format:g,chunked:v,chunkSize:S})},zr.Download=async function({downloadPath:c,headers:p,bytesTotal:d,chunked:y=!1,chunkSize:b=2e6,callback:g,format:v="arrayBuffer"}){if(y&&!g)throw Error("No callback specified for chunked download");let S;y||(S=[]);let A=0;const C=Math.ceil(d/b);for(let M=0;M<C;M++){p.Range=`bytes=${A}-${A+b-1}`;const k=await this.HttpClient.Request({path:c,headers:p,method:"GET"});A=Math.min(A+b,d),y?g({bytesFinished:A,bytesTotal:d,chunk:await this.utils.ResponseToFormat(v,k)}):(S.push(Buffer.from(await k.arrayBuffer())),g&&g({bytesFinished:A,bytesTotal:d}))}if(!y)return await this.utils.ResponseToFormat(v,new Response(Buffer.concat(S)))},zr.DownloadEncrypted=async function({conk:c,downloadPath:p,bytesTotal:d,headers:y,callback:b,format:g="arrayBuffer",chunked:v=!1}){if(v&&!b)throw Error("No callback specified for chunked download");const S=c.public_key.startsWith("ktpk"),A=this.Crypto.EncryptedBlockSize(1e6,S);let C=0;g=g.toLowerCase();let M=[];const k=await this.Crypto.OpenDecryptionStream(c);k.on("data",async R=>{if(v){if(g!=="buffer"){const N=R.buffer.slice(R.byteOffset,R.byteOffset+R.byteLength);g==="arraybuffer"?R=N:R=await this.utils.ResponseToFormat(g,new Response(N))}b({bytesFinished:C,bytesTotal:d,chunk:R})}else b&&b({bytesFinished:C,bytesTotal:d}),M.push(R)});const T=Math.ceil(d/A);for(let R=0;R<T;R++){y.Range=`bytes=${C}-${C+A-1}`;const N=await this.HttpClient.Request({headers:y,method:"GET",path:p});C=Math.min(C+A,d),k.write(new Uint8Array(await N.arrayBuffer()))}if(k.end(),await new Promise(R=>k.on("finish",()=>{R()})),!v)return await this.utils.ResponseToFormat(g,new Response(Buffer.concat(M)))},zr.CreatePart=async function({libraryId:c,objectId:p,writeToken:d,encryption:y}){o({libraryId:c,objectId:p}),s(d);const b=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:b,bodyType:"BINARY",body:"",allowFailover:!1})).part.write_token},zr.UploadPartChunk=async function({libraryId:c,objectId:p,writeToken:d,partWriteToken:y,chunk:b,encryption:g}){if(o({libraryId:c,objectId:p}),s(d),g&&g!=="none"){const S=await this.EncryptionConk({libraryId:c,objectId:p,writeToken:d});b=await this.Crypto.Encrypt(S,b)}const v=t("q",d,"parts");await this.utils.ResponseToJson(this.HttpClient.Request({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0,encryption:g}),method:"POST",path:t(v,y),body:b,bodyType:"BINARY",allowFailover:!1}))},zr.FinalizePart=async function({libraryId:c,objectId:p,writeToken:d,partWriteToken:y,encryption:b}){o({libraryId:c,objectId:p}),s(d);const g=t("q",d,"parts");return await this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0,encryption:b}),method:"POST",path:t(g,y),bodyType:"BINARY",body:"",allowFailover:!1})},zr.UploadPart=async function({libraryId:c,objectId:p,writeToken:d,data:y,encryption:b="none",chunkSize:g=1e7,callback:v}){o({libraryId:c,objectId:p}),s(d);const S=await this.CreatePart({libraryId:c,objectId:p,writeToken:d,encryption:b}),A=y.length||y.byteLength||y.size;v&&v({bytesFinished:0,bytesTotal:A});for(let C=0;C<A;C+=g){const M=y.slice(C,C+g);await this.UploadPartChunk({libraryId:c,objectId:p,writeToken:d,partWriteToken:S,chunk:M,encryption:b}),v&&v({bytesFinished:Math.min(C+g,A),bytesTotal:A})}return await this.FinalizePart({libraryId:c,objectId:p,writeToken:d,partWriteToken:S,encryption:b})},zr.DeletePart=async function({libraryId:c,objectId:p,writeToken:d,partHash:y}){o({libraryId:c,objectId:p}),s(d),u(y);let b=t("q",d,"parts",y);await this.HttpClient.Request({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0}),method:"DELETE",path:b,allowFailover:!1})},zr}var _O;function mY(){if(_O)return b3;_O=1;const r=LW(),e=gi(),t=LP().permissionLevels,{LogMessage:a}=P0(),s=zP();let u=class lA{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 b=>{let g=b&&b.callback;return g&&delete b.callback,await this.SendMessage({options:{calledMethod:y,args:this.utils.MakeClonable(b)},callback:g})};this.userProfileClient={};for(const y of this.AllowedUserProfileMethods())this.userProfileClient[y]=async b=>{let g=b&&b.callback;return g&&delete b.callback,await this.SendMessage({options:{module:"userProfileClient",calledMethod:y,args:this.utils.MakeClonable(b),prompted:lA.PromptedMethods().includes(y)},callback:g})};this.walletClient={};for(const y of this.AllowedWalletClientMethods())this.walletClient[y]=async b=>{let g=b&&b.callback;return g&&delete b.callback,await this.SendMessage({options:{module:"walletClient",calledMethod:y,args:this.utils.MakeClonable(b)},callback:g})}}async PassRequest({request:p,Respond:d}){let y,b;try{let g;p.callbackId&&(g=v=>d({type:"ElvFrameResponse",requestId:p.callbackId,response:v})),y=await this.SendMessage({options:p,callback:g})}catch(g){b=g}return{type:"ElvFrameResponse",requestId:p.requestId,response:y,error:b}}async SendMessage({options:p={},callback:d,noResponse:y=!1}){const b=r.next();let g;if(d&&(g=r.next()),this.target.postMessage({...p,type:"ElvFrameRequest",requestId:b,callbackId:g},"*"),y)return;const v=p.calledMethod||p.operation,S=lA.FileMethods().includes(p.calledMethod);let A=this.timeout;return p.prompted||S?A=0:p.args&&p.args.fcTimeout&&(A=p.args.fcTimeout),await this.AwaitMessage(b,A,d,g,v)}async AwaitMessage(p,d,y,b,g){return await new Promise((v,S)=>{let A,C;const M=()=>{C&&clearTimeout(C),d>0&&(C=setTimeout(()=>{typeof window<"u"&&(window.removeEventListener("message",A),k&&window.removeEventListener("message",k)),S(`Request ${p} timed out (${g})`)},d*1e3))};let k;b&&(k=T=>{try{M();const R=T.data;if(R.type!=="ElvFrameResponse"||R.requestId!==b)return;y(R.response)}catch(R){console.error(R)}},window.addEventListener("message",k)),A=async T=>{try{const R=T.data;if(R.type!=="ElvFrameResponse"||R.requestId!==p)return;clearTimeout(C),window.removeEventListener("message",A),k&&window.removeEventListener("message",k),R.error?S(R.error):v(R.response)}catch(R){clearTimeout(C),window.removeEventListener("message",A),k&&window.removeEventListener("message",k),S(R)}},M(),window.addEventListener("message",A)})}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","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}=jP();return u.prototype.UploadFiles=o,b3.FrameClient=u,b3}var BE,xO;function gY(){if(xO)return BE;xO=1;const r=gi(),e=ji(),{FrameClient:t}=mY(),{LogMessage:a}=P0();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||r.EqualAddress(this.walletAddress,r.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:r.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[r.FormatAddress(this.client.signer.address)]=this.walletAddress}const o=this.client.contentSpaceLibraryId,c=r.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:r.HashToAddress(this.client.contentSpaceId),methodName:"userWallets",methodArgs:[this.client.signer.address]}));const c=await this.walletAddressPromise;return r.EqualAddress(c,r.nullAddress)||(this.walletAddress=c),!this.walletAddress&&o&&await this.CreateWallet(),this.walletAddressRetrieved=!0,this.walletAddress}async UserWalletAddress({address:o}){if(r.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:r.HashToAddress(this.client.contentSpaceId),methodName:"userWallets",methodArgs:[o]});r.EqualAddress(c,r.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?r.AddressToObjectId(c):""}}async PublicUserMetadata({address:o,metadataSubtree:c="/",queryParams:p={},select:d=[],resolveLinks:y=!1,resolveIncludeSource:b=!1,resolveIgnoreErrors:g=!1,linkDepthLimit:v=1}){if(!o||!await this.UserWalletAddress({address:o}))return;c=e("public",c||"/");const{libraryId:A,objectId:C}=await this.UserWalletObjectInfo({address:o});if(C)return await this.client.ContentObjectMetadata({libraryId:A,objectId:C,queryParams:p,select:d,metadataSubtree:c,resolveLinks:y,resolveIncludeSource:b,resolveIgnoreErrors:g,linkDepthLimit:v})}async UserMetadata({metadataSubtree:o="/",queryParams:c={},select:p=[],resolveLinks:d=!1,resolveIncludeSource:y=!1,resolveIgnoreErrors:b=!1,linkDepthLimit:g=1}={}){this.Log(`Accessing private user metadata at ${o}`);const{libraryId:v,objectId:S}=await this.UserWalletObjectInfo();return await this.client.ContentObjectMetadata({libraryId:v,objectId:S,metadataSubtree:o,queryParams:c,select:p,resolveLinks:d,resolveIncludeSource:y,resolveIgnoreErrors:b,linkDepthLimit:g})}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")||!r.ValidHash(o)))throw Error(`Invalid tenant ID: ${o}`);if(c){if(!r.ValidAddress(c))throw Error(`Invalid address: ${c}`);o=`iten${r.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 b=await this.UserWalletObjectInfo(),g=b.libraryId,v=b.objectId,S=await this.client.EditContentObject({libraryId:g,objectId:v});await this.client.ReplaceMetadata({libraryId:g,objectId:v,writeToken:S.write_token,metadataSubtree:e("accessed_content",p),metadata:Date.now()});const A=await this.client.ContentObjectMetadata({libraryId:o,objectId:c,versionHash:p,metadataSubtree:"video_tags"});if(A&&A.length>0){let C=await this.CollectedTags();const M=this.__FormatVideoTags(A);Object.keys(M).forEach(k=>{C[k]?(C[k].occurrences+=1,C[k].aggregate+=M[k]):C[k]={occurrences:1,aggregate:M[k]}}),await this.client.ReplaceMetadata({libraryId:g,objectId:v,writeToken:S.write_token,metadataSubtree:"collected_data",metadata:C})}await this.client.FinalizeContentObject({libraryId:g,objectId:v,writeToken:S.write_token,commitMessage:"Record user tags",awaitCommitConfirmation:!1})}__FormatVideoTags(o){let c={};o.forEach(d=>{d.tags.forEach(b=>{c[b.tag]?(c[b.tag].occurrences+=1,c[b.tag].aggregate+=b.score):c[b.tag]={occurrences:1,aggregate:b.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 BE=s,BE}var zE,SO;function vY(){if(SO)return zE;SO=1;const r=_l,e=gi(),t=Pf(),a=ji(),s=XA;class u extends r.Signer{constructor({signerURIs:c,idToken:p,authToken:d,tenantId:y,provider:b,extraData:g={},unsignedPublicAuth:v=!1}){super(),this.remoteSigner=!0,this.unsignedPublicAuth=v,this.HttpClient=new t({uris:c}),this.idToken=p,this.tenantId=y,this.authToken=d,this.extraLoginData=g||{},this.provider=b,this.signatureCache={}}async Initialize(){if(!this.authToken){const{addr:c,eth:p,token:d}=await e.ResponseToJson(this.HttpClient.Request({path:a("as","wlt","login","jwt"),method:"POST",body:this.tenantId?{tid:this.tenantId,ext:this.extraLoginData||{}}:{ext:this.extraLoginData||{}},headers:{Authorization:`Bearer ${this.idToken}`}}));this.authToken=d,this.address=e.FormatAddress(c),this.id=p}if(!this.address){const c=await e.ResponseToJson(this.HttpClient.Request({method:"GET",path:a("as","wlt","keys"),headers:{Authorization:`Bearer ${this.authToken}`}})),p=c.eth[0];p&&p.startsWith("0x")?this.address=p:this.address=e.HashToAddress(c.eth[0])}this.id=this.address?`ikms${e.AddressToHash(this.address)}`:void 0,this.signer=this.provider.getSigner(this.address)}async RetrieveCSAT({email:c,nonce:p,tenantId:d,force:y=!1,duration:b=24}){p=p||e.B58(s.parse(s.v4()));let g=await e.ResponseToJson(this.HttpClient.Request({method:"POST",body:{email:c,nonce:p,force:y,tid:d,exp:parseInt(b*60*60)},path:a("as","wlt","sign","csat"),headers:{Authorization:`Bearer ${this.authToken}`}}));return g.nonce=p,g}async CSATStatus({accessToken:c}){try{const p=await e.ResponseToJson(this.HttpClient.Request({method:"POST",path:a("as","wlt","login","status"),headers:{Authorization:`Bearer ${c}`}}));return p&&p.is_active}catch(p){return!p||p.status!==403}}async ReleaseCSAT({accessToken:c}){return await e.ResponseToJson(this.HttpClient.Request({method:"POST",path:a("as","wlt","login","release"),headers:{Authorization:`Bearer ${c}`}}))}getAddress(){return this.address}async signDigest(c){return this.signatureCache[c]||(this.signatureCache[c]=new Promise(async(p,d)=>{try{let y=await e.ResponseToJson(this.HttpClient.Request({method:"POST",path:a("as","wlt","sign","eth",this.id),headers:{Authorization:`Bearer ${this.authToken}`},body:{hash:c}}));y.v=parseInt(y.v,16),y.recoveryParam=y.v-27,p(y)}catch(y){d(y)}})),await this.signatureCache[c]}async signMessage(c){return Promise.resolve(r.utils.joinSignature(`0x${await this.signDigest(r.utils.hashMessage(c))}`))}async sign(c){c=await r.utils.resolveProperties(c);const p=await this.signDigest(r.utils.keccak256(r.utils.serializeTransaction(c)));return r.utils.serializeTransaction(c,p)}async sendTransaction(c){return c.nonce==null&&(c=r.utils.shallowCopy(c),c.nonce=await this.provider.getTransactionCount(this.address,"pending")),this.populateTransaction(c,this.provider,this.address).then(p=>this.sign(p).then(d=>this.provider.sendTransaction(d)))}connect(){}}return zE=u,zE}var aa={},CO;function bY(){if(CO)return aa;CO=1;const{ValidatePresence:r,ValidateLibrary:e,ValidateObject:t,ValidateAddress:a,ValidateUserWallet:s}=_u();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 b;if(!y.isV3&&y.accessType===this.authClient.ACCESS_TYPES.GROUP){if(d.isV3)throw Error("Unable to map V3 group to V2 object");b=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 b=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:b,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),b=await this.userProfileClient.TenantContractId();this.Log(`Access group: ${d} ${y}`);const g=await this.EditContentObject({libraryId:this.contentSpaceLibraryId,objectId:y}),v={public:{name:u,description:o},name:u,description:o,...c};if(await this.ReplaceMetadata({libraryId:this.contentSpaceLibraryId,objectId:y,writeToken:g.write_token,metadata:v}),await this.CallContractMethodAndWait({contractAddress:d,methodName:"setVisibility",methodArgs:[p]}),await this.FinalizeContentObject({libraryId:this.contentSpaceLibraryId,objectId:y,writeToken:g.write_token,commitMessage:"Create access group"}),b){const S=await this.SetTenantContractId({contractAddress:d,tenantContractId:b});if(S.tenantId){let A=this.utils.HashToAddress(S.tenantId);await this.AddContentObjectGroupPermission({objectId:y,groupAddress:A,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}),b=this.ExtractValueFromEvent({abi:y,event:d,eventName:p,eventValue:"candidate"});if(this.utils.FormatAddress(b)!==this.utils.FormatAddress(o))throw console.error("Mismatch: "+b+" :: "+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,b,g)=>g.indexOf(y)===b),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,b,g)=>g.indexOf(y)===b),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 b=>{try{return this.utils.FormatAddress(await this.CallContractMethod({contractAddress:this.utils.HashToAddress(u),methodName:p+"Groups",methodArgs:[b]}))}catch(g){console.error(g)}})).forEach(b=>c[b]=[...c[b]||[],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 b=await this.CallContractMethod({contractAddress:y,methodName:p,methodArgs:[o]});if(b===0)return;let g=[];b>=100&&g.push("manage"),b%100>=10&&g.push("access"),b%10>0&&g.push("see"),d[y]=g}catch(b){this.Log(`Failed to retrieve group permissions for ${y}`,!0),this.Log(b,!0)}})),d},aa.AddContentObjectGroupPermission=async function({objectId:u,groupAddress:o,permission:c}){if(r("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(r("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),r("kmsId",o),r("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),b=`eluv.jwtv.iusr${this.utils.AddressToHash(this.signer.address)}`,g=await this.EncryptECIES({message:c}),v=this.utils.AddressToObjectId(u),S=(await this.EditContentObject({libraryId:this.contentSpaceLibraryId,objectId:v})).write_token;await this.ReplaceMetadata({libraryId:this.contentSpaceLibraryId,objectId:v,writeToken:S,metadataSubtree:d,metadata:y}),await this.ReplaceMetadata({libraryId:this.contentSpaceLibraryId,objectId:v,writeToken:S,metadataSubtree:b,metadata:g}),await this.FinalizeContentObject({libraryId:this.contentSpaceLibraryId,objectId:v,writeToken:S,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 _r={},EO;function wY(){if(EO)return _r;EO=1;const r=_l,{ValidateAddress:e,ValidateParameters:t,ValidatePresence:a,ValidateObject:s,ValidateVersion:u}=_u(),o=gi();_r.ContractName=async function({contractAddress:d}){return d=e(d),await this.ethClient.ContractName(d)},_r.ContractAbi=async function({contractAddress:d,id:y}){const b=await this.authClient.ContractInfo({address:d,id:y});if(!b)throw Error(`Unable to determine contract info for ${d}`);return b.abi},_r.ContractInfo=async function({id:d,address:y}){return this.authClient.ContractInfo({id:d,address:y})},_r.FormatContractArguments=function({abi:d,methodName:y,args:b}){return this.ethClient.FormatContractArguments({abi:d,methodName:y,args:b})},_r.DeployContract=async function({abi:d,bytecode:y,constructorArgs:b,overrides:g={}}){return await this.ethClient.DeployContract({abi:d,bytecode:y,constructorArgs:b,overrides:g,signer:this.signer})},_r.ContractEvents=async function({contractAddress:d,abi:y,fromBlock:b=0,toBlock:g,count:v=1e3,topics:S,includeTransaction:A=!1}){d=e(d),y||(y=await this.ContractAbi({contractAddress:d}));const C=await this.FormatBlockNumbers({fromBlock:b,toBlock:g,count:v});return this.Log(`Querying contract events ${d} - Blocks ${C.fromBlock} to ${C.toBlock}`),await this.ethClient.ContractEvents({contractAddress:d,abi:y,fromBlock:C.fromBlock,toBlock:C.toBlock,topics:S,includeTransaction:A})},_r.CallContractMethod=async function({contractAddress:d,abi:y,methodName:b,methodArgs:g=[],value:v,overrides:S={},formatArguments:A=!0,cacheContract:C=!0,overrideCachedContract:M=!1}){return d=e(d),d=this.utils.FormatAddress(d),b==="setVisibility"&&this.visibilityInfo[d]&&delete this.visibilityInfo[d],y||(y=await this.ContractAbi({contractAddress:d})),await this.ethClient.CallContractMethod({contractAddress:d,abi:y,methodName:b,methodArgs:g,value:v,overrides:S,formatArguments:A,cacheContract:C,overrideCachedContract:M})},_r.CallContractMethodAndWait=async function({contractAddress:d,abi:y,methodName:b,methodArgs:g,value:v,overrides:S={},formatArguments:A=!0,cacheContract:C=!0,overrideCachedContract:M=!1}){return d=e(d),d=this.utils.FormatAddress(d),b==="setVisibility"&&this.visibilityInfo[d]&&delete this.visibilityInfo[d],y||(y=await this.ContractAbi({contractAddress:d})),await this.ethClient.CallContractMethodAndWait({contractAddress:d,abi:y,methodName:b,methodArgs:g,value:v,overrides:S,formatArguments:A,cacheContract:C,overrideCachedContract:M})},_r.ContractMetadata=async function({contractAddress:d,metadataKey:y}){a("contractAddress",d),a("metadataKey",y);try{const b=await this.CallContractMethod({contractAddress:d,methodName:"getMeta",methodArgs:[y]}),g=Buffer.from((b||"").replace("0x",""),"hex").toString("utf-8");try{return JSON.parse(g)}catch{return g}}catch{return""}},_r.MergeContractMetadata=async function({contractAddress:d,metadataKey:y,metadata:b}){a("contractAddress",d),a("metadataKey",y);const g=await this.ContractMetadata({contractAddress:d,metadataKey:y})||{};typeof g=="object"&&(b={...g,...b}),await this.CallContractMethodAndWait({contractAddress:d,methodName:"putMeta",methodArgs:[y,JSON.stringify(b)]})},_r.ReplaceContractMetadata=async function({contractAddress:d,metadataKey:y,metadata:b}){a("contractAddress",d),a("metadataKey",y),typeof b=="object"&&(b=JSON.stringify(b)),await this.CallContractMethodAndWait({contractAddress:d,methodName:"putMeta",methodArgs:[y,b]})},_r.CustomContractAddress=async function({libraryId:d,objectId:y,versionHash:b}){if(t({libraryId:d,objectId:y,versionHash:b}),b&&(y=this.utils.DecodeVersionHash(b).objectId),d===this.contentSpaceLibraryId||this.utils.EqualHash(d,y))return;this.Log(`Retrieving custom contract address: ${y}`);const g=await this.ContractAbi({id:y}),v=await this.ethClient.CallContractMethod({contractAddress:this.utils.HashToAddress(y),abi:g,methodName:"contentContractAddress",methodArgs:[]});if(v!==this.utils.nullAddress)return this.utils.FormatAddress(v)},_r.SetCustomContentContract=async function({libraryId:d,objectId:y,customContractAddress:b,name:g,description:v,abi:S,factoryAbi:A,overrides:C={}}){t({libraryId:d,objectId:y}),b=e(b),b=this.utils.FormatAddress(b),this.Log(`Setting custom contract address: ${y} ${b}`);const M=await this.ethClient.SetCustomContentContract({contentContractAddress:this.utils.HashToAddress(y),customContractAddress:b,overrides:C,signer:this.signer}),k=(await this.EditContentObject({libraryId:d,objectId:y})).write_token;return await this.ReplaceMetadata({libraryId:d,objectId:y,writeToken:k,metadataSubtree:"custom_contract",metadata:{name:g,description:v,address:b,abi:S,factoryAbi:A}}),await this.FinalizeContentObject({libraryId:d,objectId:y,writeToken:k,commitMessage:"Set custom contract"}),M},_r.ExtractEventFromLogs=function({abi:d,event:y,eventName:b}){return this.ethClient.ExtractEventFromLogs({abi:d,event:y,eventName:b})},_r.ExtractValueFromEvent=function({abi:d,event:y,eventName:b,eventValue:g}){const v=this.ethClient.ExtractEventFromLogs({abi:d,event:y,eventName:b,eventValue:g});return v?v.args[g]:void 0},_r.FormatBlockNumbers=async function({fromBlock:d,toBlock:y,count:b=10}){const g=await this.BlockNumber();return y?d||(d=y-b+1):d?y=d+b-1:(y=g,d=y-b+1),y>g&&(y=g),d<0&&(d=0),{fromBlock:d,toBlock:y}},_r.Events=async function({toBlock:d,fromBlock:y,count:b=10,includeTransaction:g=!1}={}){const v=await this.FormatBlockNumbers({fromBlock:y,toBlock:d,count:b});return this.Log(`Querying events - Blocks ${v.fromBlock} to ${v.toBlock}`),await this.ethClient.Events({fromBlock:v.fromBlock,toBlock:v.toBlock,includeTransaction:g})},_r.BlockNumber=async function(){return await this.ethClient.MakeProviderCall({methodName:"getBlockNumber"})},_r.GetBalance=async function({address:d}){d=e(d);const y=await this.ethClient.MakeProviderCall({methodName:"getBalance",args:[d]});return r.utils.formatEther(y)},_r.SendFunds=async function({recipient:d,ether:y}){return d=e(d),await(await this.signer.sendTransaction({to:d,value:r.utils.parseEther(y.toString())})).wait()};const c=async function({contractAddress:d,objectId:y,versionHash:b}){if(d)e(d),y=o.AddressToObjectId(d);else if(b)u(b),y=this.utils.DecodeVersionHash(b).objectId,d=o.HashToAddress(y);else if(y)s(y),d=o.HashToAddress(y);else throw Error("contractAddress or objectId or versionHash not specified");return{contractAddress:d,objectId:y}};_r.TenantId=async function({contractAddress:d,objectId:y,versionHash:b}){objectInfo=await c({contractAddress:d,objectId:y,versionHash:b}),d=objectInfo.contractAddress,y=objectInfo.objectId;let g;try{if(await this.authClient.ContractHasMethod({contractAddress:d,methodName:"getMeta"})&&(g=await this.ContractMetadata({contractAddress:d,metadataKey:"_tenantId"})),g===void 0){const S=await this.ContentObjectLibraryId({objectId:y});g=await this.ContentObjectMetadata({libraryId:S,objectId:y,metadataSubtree:"tenantId"})}return g}catch{return""}},_r.TenantContractId=async function({contractAddress:d,objectId:y,versionHash:b}){objectInfo=await c({contractAddress:d,objectId:y,versionHash:b}),d=objectInfo.contractAddress,y=objectInfo.objectId;try{const g=await this.authClient.ContractHasMethod({contractAddress:d,methodName:"getMeta"});let v;if(g&&(v=await this.ContractMetadata({contractAddress:d,metadataKey:"_ELV_TENANT_ID"})),v===void 0){const S=await this.ContentObjectLibraryId({objectId:y});v=await this.ContentObjectMetadata({libraryId:S,objectId:y,metadataSubtree:"tenantContractId"})}return v}catch{return""}},_r.SetTenantId=async function({contractAddress:d,objectId:y,versionHash:b,tenantId:g}){objectInfo=await c({contractAddress:d,objectId:y,versionHash:b}),d=objectInfo.contractAddress,y=objectInfo.objectId;const v=await this.authClient.AccessType(y);if(v!==this.authClient.ACCESS_TYPES.GROUP&&v!==this.authClient.ACCESS_TYPES.WALLET&&v!==this.authClient.ACCESS_TYPES.LIBRARY&&v!==this.authClient.ACCESS_TYPES.TYPE&&v!==this.authClient.ACCESS_TYPES.TENANT)throw Error(`Invalid object ID: ${y},
|
|
330
330
|
applicable only for wallet,group, library or content_type object.`);if(s(g),!g.startsWith("iten")||!o.ValidHash(g))throw Error(`Invalid tenant ID: ${g}`);if(await this.authClient.AccessType(g)!==this.authClient.ACCESS_TYPES.GROUP)throw Error("Invalid tenant ID: "+g);if(tenantContractId=await this.TenantContractId({objectId:g}),tenantContractId)return await this.SetTenantContractId({contractAddress:d,objectId:y,versionHash:b,tenantContractId});throw Error("Invalid tenantId: tenant contract id not found")},_r.SetTenantContractId=async function({contractAddress:d,objectId:y,versionHash:b,tenantContractId:g}){objectInfo=await c({contractAddress:d,objectId:y,versionHash:b}),d=objectInfo.contractAddress,y=objectInfo.objectId;const v=await this.authClient.AccessType(y);if(v!==this.authClient.ACCESS_TYPES.GROUP&&v!==this.authClient.ACCESS_TYPES.WALLET&&v!==this.authClient.ACCESS_TYPES.LIBRARY&&v!==this.authClient.ACCESS_TYPES.TYPE&&v!==this.authClient.ACCESS_TYPES.TENANT)throw Error(`Invalid object ID: ${y},
|
|
@@ -376,4 +376,4 @@ ${K.length}${K}`,"utf-8")),ge=e.utils.recoverAddress(ie,N);return{type:T,message
|
|
|
376
376
|
top=${C},
|
|
377
377
|
left=${A}
|
|
378
378
|
`);return M&&window.focus&&M.focus(),M};return np.ActionPopup=async({mode:o="tab",url:c,onMessage:p,onCancel:d})=>{await new Promise(y=>{const b=o==="popup"?u({url:c,title:"Eluvio Media Wallet",w:500,h:850}):window.open(c),g=setInterval(async()=>{b.closed&&(clearInterval(g),d&&await d(),y())},1e3);window.addEventListener("message",async v=>{await p(v,()=>{clearInterval(g),b.close(),y()})})})},np}var sn={},ZO;function tee(){if(ZO)return sn;ZO=1;const r=gi(),e=ji(),{FormatNFTDetails:t,FormatNFTMetadata:a,FormatNFT:s}=$I(),u=OP();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:b,stripe_payouts_enabled:g}=await this.client.utils.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt","bal"),method:"GET",headers:{Authorization:`Bearer ${this.AuthToken()}`}})),v=b,S=g,A=parseFloat(c||0),C=parseFloat(y||0),M=Math.max(0,A-parseFloat(p||0)-C),k=Math.max(0,A-M),T=Math.max(0,A-parseFloat(Math.max(d,C)||0));if(o&&b&&!g){const N=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:N.toString(),return_url:N.toString()},headers:{Authorization:`Bearer ${this.AuthToken()}`}}),await this.UserWalletBalance(!1)}let R={totalWalletBalance:A,availableWalletBalance:M,lockedWalletBalance:C,pendingWalletBalance:k,withdrawableWalletBalance:T};return S&&(R.userStripeId=v,R.userStripeEnabled=S),R},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:${r.FormatAddress(c)}`),await r.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","names"),method:"GET",queryParams:{filter:p}}))},sn.UserItemEditionNames=async function({displayName:o}){return await r.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:${r.FormatAddress(p)}`),c&&d.push(`meta/display_name:eq:${c}`),(await r.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","attributes"),method:"GET",queryParams:{filter:d}}))).map(({trait_type:b,values:g})=>({name:b,values:g})).filter(({name:b})=>!["Content Fabric Hash","Total Minted Supply","Creator"].includes(b))},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:b}={}){return(await this.FilteredQuery({mode:"listings",start:0,limit:1e4,sortBy:c,sortDesc:p,sellerAddress:o||this.UserAddress(),marketplaceParams:b,contractAddress:d,tokenId:y,includeCheckoutLocked:!0})).results},sn.UserSales=async function({userAddress:o,sortBy:c="created",sortDesc:p=!1,contractAddress:d,tokenId:y,startTime:b,endTime:g,lastNDays:v,marketplaceParams:S}={}){return(await this.FilteredQuery({mode:"sales",start:0,limit:1e4,sortBy:c,sortDesc:p,sellerAddress:o||this.UserAddress(),startTime:b,endTime:g,lastNDays:v,marketplaceParams:S,contractAddress:d,tokenId:y})).results},sn.UserTransfers=async function({userAddress:o,sortBy:c="created",sortDesc:p=!1,contractAddress:d,tokenId:y,startTime:b,endTime:g,lastNDays:v,marketplaceParams:S}={}){return(await this.FilteredQuery({mode:"transfers",start:0,limit:1e4,sortBy:c,sortDesc:p,sellerAddress:o||this.UserAddress(),marketplaceParams:S,contractAddress:d,tokenId:y,startTime:b,endTime:g,lastNDays:v})).results},sn.TenantConfiguration=async function({tenantId:o,contractAddress:c}){try{return c=c?r.FormatAddress(c):void 0,this.tenantConfigs[c||o]||(this.tenantConfigs[c||o]=await r.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 r.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 r.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","nft","info",c),method:"GET",headers:{Authorization:`Bearer ${this.AuthToken()}`}})):await r.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||{},b;if(c&&p?b=(this.availableMarketplaces[c]||{})[p]:(d=y?this.client.utils.DecodeVersionHash(y).objectId:d,b=this.availableMarketplacesById[d]),!b)throw Error(`Eluvio Wallet Client: Unable to find marketplace with parameters ${JSON.stringify(arguments)}`);return b},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 r.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 r.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,b)=>b===null||b===""?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,(b,g)=>g===null||g===""?b: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||!r.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:r.FormatAddress(o),token:c,to_addr:r.FormatAddress(p)},headers:{Authorization:`Bearer ${this.AuthToken()}`}})},sn.ListingStatus=async function({listingId:o}){try{return await r.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 r.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:r.FormatAddress(o)};return c&&(p.filter=[`tenant:eq:${(await this.MarketplaceInfo({marketplaceParams:c})).tenantId}`]),(await r.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=r.FormatAddress(o),d?await r.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 r.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 r.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 r.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 r.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 r.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","mkt","attributes"),method:"GET",queryParams:{filter:p}}))).map(({trait_type:y,values:b})=>({name:y,values:b})).filter(({name:y})=>!["Content Fabric Hash","Total Minted Supply","Creator"].includes(y))},sn.ClaimGift=async function({code:o}){return await r.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 b=await this.MarketplaceInfo({marketplaceParams:o});window.location.href=this.FlowURL({type:"action",flow:"purchase",marketplaceId:b.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 b;o&&(b=await this.MarketplaceInfo({marketplaceParams:o})),window.location.href=this.FlowURL({type:"action",flow:"purchase",marketplaceId:b&&b.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}),b=(await this.MintingStatus({tenantId:d.tenantId})).filter(g=>g.op==="nft-transfer"&&(c&&g.confirmationId===c||p&&g.giftId===p))||{status:"none"};return b.length===0?{status:"none"}:b.find(g=>g.status==="failed")?{status:"failed",op:"nft-transfer",transfer_statuses:b}:b.find(g=>g.status!=="complete")?{status:"pending",op:"nft-transfer",transfer_statuses:b}:{status:"complete",op:"nft-transfer",transfer_statuses:b,items:b.map(g=>({token_addr:g.address,token_id_str:g.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(b=>b.op==="nft-claim-entitlement"&&c&&c==b.confirmationId)||{status:"none"};return y.length===0?{status:"none"}:y.find(b=>b.status==="complete")?{status:"complete",op:"nft-claim-entitlement",items:[{token_addr:y[0].address,token_id:y[0].tokenId}]}:y.find(b=>b.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"&&r.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 b=await this.MintingStatus({marketplaceParams:c,tenantId:o});return p=r.FormatAddress(p),b.find(g=>g.op==="nft-offer-redeem"&&r.EqualAddress(g.address,p)&&g.tokenId===(d||"").toString()&&g.offerId===(y||"").toString())||{status:"none"}}catch(b){return this.Log(b,!0),{status:"unknown"}}},sn.RedeemableCustomFulfillmentInfo=async function({redeemableTransactionId:o}){return await r.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=r.DecodeVersionHash(d["."].source).objectId;d.drops.forEach(b=>{b={...b,eventId:y},this.drops[o][c][b.uuid]=b,this.drops[b.uuid]=b})}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 r.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","act",o.tenant_id,c,p),method:"GET",headers:{Authorization:`Bearer ${this.AuthToken()}`}}))).sort((y,b)=>y.ts>b.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:b=0,limit:g=10}){let v=e("as","mkt","offers","ls");p?v=e(v,"b",r.FormatAddress(p)):d&&(v=e(v,"s",r.FormatAddress(d))),o&&(v=e(v,"c",r.FormatAddress(o)),c&&(v=e(v,"t",c)));let S={start:b,limit:g};return y&&y.length>0&&(S.include=y.join(",")),(await r.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:v,method:"GET",queryParams:S}))).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 b;return p?b=await r.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()}`}})):b=await r.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()}`}})),b.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 r.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 r.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 r.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","votes",o,c,p),method:"DELETE",headers:{Authorization:`Bearer ${this.AuthToken()}`}}))},sn}var rp={},eL;function nee(){if(eL)return rp;eL=1;const r=gi(),e=ji(),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 rp.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 r.ResponseToJson(d))[p]}catch(d){if(d.status===404)return;throw d}},rp.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()}`}})},rp.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()}`}})},rp.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_${r.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:r.FormatAddress(s),userName:u,imageUrl:o,badges:p}},rp.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 r.ResponseToJson(u)).address}catch(u){if(u.status!==404)throw u}},rp}var rg={},tL;function ree(){if(tL)return rg;tL=1;const r=gi(),e=ji(),t=({network:a,path:s})=>e("/push",a==="main"?"/main":"/dv3",s);return rg.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()}`}})},rg.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},rg.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 r.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})},rg}var nL;function aee(){if(nL)return WE;nL=1;const{ElvClient:r}=VI(),e=eee(),{LinkTargetHash:t,FormatNFT:a,ActionPopup:s}=$I(),u=Pf(),o=ji(),c=gi(),p=_l,d=typeof window<"u",y=d&&window.top!==window.self;let b=!1;try{typeof localStorage<"u"&&localStorage.getItem("test"),b=!0}catch{}class g{constructor({appId:S,client:A,network:C,mode:M,localization:k,marketplaceInfo:T,previewMarketplaceHash:R,storeAuthToken:N}){this.appId=S,this.client=A,this.loggedIn=!1,this.localization=k,this.network=C,this.mode=M,this.purchaseMode=e[C][M].purchaseMode,this.mainSiteLibraryId=e[C][M].siteLibraryId,this.mainSiteId=e[C][M].siteId,this.appUrl=e[C][M].appUrl,this.publicStaticToken=A.staticToken,this.storeAuthToken=N,this.selectedMarketplaceInfo=T,this.previewMarketplaceId=R?c.DecodeVersionHash(R).objectId:void 0,this.previewMarketplaceHash=R,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=A.utils,this.ForbiddenMethods=g.ForbiddenMethods}Log(S,A=!1,C){A?console.error("Eluvio Wallet Client:",S):console.log("Eluvio Wallet Client:",S),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(g.prototype).filter(S=>!g.ForbiddenMethods().includes(S)).sort()}static async Initialize({client:S,appId:A="general",network:C="main",mode:M="production",localization:k,marketplaceParams:T,previewMarketplaceId:R,storeAuthToken:N=!0,skipMarketplaceLoad:K=!1}){let{tenantSlug:X,marketplaceSlug:ie,marketplaceId:ge,marketplaceHash:pe}=T||{};if(e[C]){if(!e[C][M])throw Error(`ElvWalletClient: Invalid mode ${M}`)}else throw Error(`ElvWalletClient: Invalid network ${C}`);S||(S=await r.FromNetworkName({networkName:C,assumeV3:!0}));let te=R;te&&!te.startsWith("hq__")&&(te=await S.LatestVersionHash({objectId:R}));const se=new g({appId:A,client:S,network:C,mode:M,localization:k,marketplaceInfo:{tenantSlug:X,marketplaceSlug:ie,marketplaceId:pe?S.utils.DecodeVersionHash(pe).objectId:ge,marketplaceHash:pe},previewMarketplaceHash:te,storeAuthToken:N});if(d&&window.location&&window.location.href){let x=new URL(window.location.href);if(x.searchParams.get("elvToken"))await se.Authenticate({token:x.searchParams.get("elvToken")}),x.searchParams.delete("elvToken"),window.history.replaceState("","",x);else if(N&&b)try{let _=localStorage.getItem(`__elv-token-${C}`);_&&await se.Authenticate({token:_})}catch{}}return K||se.LoadAvailableMarketplaces(),se}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:S}){if(!this.loggedIn)throw Error("ElvWalletClient: Unable to perform signature - Not logged in");if(this.CanSign()){if(this.__authorization.clusterToken)return S=typeof S=="object"?JSON.stringify(S):S,S=p.utils.keccak256(Buffer.from(`Ethereum Signed Message:
|
|
379
|
-
${S.length}${S}`,"utf-8")),await this.client.authClient.Sign(S);if(this.UserInfo().walletName.toLowerCase()==="metamask")return this.SignMetamask({message:S,address:this.UserAddress()});throw Error("ElvWalletClient: Unable to sign")}else if(!d)throw Error("ElvWalletClient: Unable to sign");const A={action:"personal-sign",message:S,logIn:!0};let C=new URL(this.appUrl);if(C.hash=o("/action","sign",c.B58(JSON.stringify(A))),C.searchParams.set("origin",window.location.origin),!y&&window.location.origin===C.origin)throw Error("ElvWalletClient: Unable to sign");return await new Promise(async(M,k)=>{await s({mode:"tab",url:C.toString(),onCancel:()=>k("User cancelled sign"),onMessage:async(T,R)=>{if(!(!T||!T.data||T.data.type!=="FlowResponse"))try{M(T.data.response)}catch(N){k(N)}finally{R()}}})})}async LogInURL({mode:S="login",provider:A,marketplaceParams:C,clearLogin:M}){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),A&&k.searchParams.set("provider",A),S&&k.searchParams.set("mode",S),C?k.searchParams.set("mid",(await this.MarketplaceInfo({marketplaceParams:C})).marketplaceHash):(this.selectedMarketplaceInfo||{}).marketplaceHash&&k.searchParams.set("mid",this.selectedMarketplaceInfo.marketplaceHash),M&&k.searchParams.set("clear",""),k}async LogIn({method:S="redirect",provider:A,mode:C="login",callbackUrl:M,marketplaceParams:k,clearLogin:T=!1,callback:R}){let N=await this.LogInURL({mode:C,provider:A,marketplaceParams:k,clearLogin:T});S==="redirect"?(N.searchParams.set("response","redirect"),N.searchParams.set("source","origin"),N.searchParams.set("redirect",M),window.location=N):(N.searchParams.set("response","message"),N.searchParams.set("source","parent"),await new Promise(async(K,X)=>{await s({mode:"tab",url:N.toString(),onCancel:()=>X("User cancelled login"),onMessage:async(ie,ge)=>{if(!(!ie||!ie.data||ie.data.type!=="LoginResponse"))try{R?await R(ie.data.params):await this.Authenticate({token:ie.data.params.clientSigningToken||ie.data.params.clientAuthToken}),K()}catch(pe){X(pe)}finally{ge()}}})}))}async LogOut(){if(this.__authorization&&this.__authorization.nonce)try{await this.client.signer.ReleaseCSAT({accessToken:this.AuthToken()})}catch(S){this.Log("Failed to release token",!0,S)}if(this.__authorization={},this.loggedIn=!1,this.cachedMarketplaces={},b)try{localStorage.removeItem(`__elv-token-${this.network}`)}catch{}}async TokenStatus(){return!this.__authorization||!this.__authorization.nonce?!0:await this.client.signer.CSATStatus({accessToken:this.AuthToken()})}async Authenticate({token:S}){let A;try{A=JSON.parse(this.utils.FromB58ToStr(S))||{}}catch{throw new Error("Invalid authorization token "+S)}if(!A.expiresAt||Date.now()>A.expiresAt)throw Error("ElvWalletClient: Provided authorization token has expired");return A.clusterToken&&await this.client.SetRemoteSigner({authToken:A.clusterToken,signerURIs:A.signerURIs}),this.client.SetStaticToken({token:A.fabricToken}),this.SetAuthorization({...A})}async AuthenticateOAuth({idToken:S,tenantId:A,email:C,signerURIs:M,shareEmail:k=!1,extraData:T={},nonce:R,createRemoteToken:N=!0,force:K=!1,tokenDuration:X=24}){!A&&this.selectedMarketplaceInfo&&(await this.AvailableMarketplaces(),A=this.selectedMarketplaceInfo.tenantId),await this.client.SetRemoteSigner({idToken:S,tenantId:A,signerURIs:M,extraData:{...T,share_email:k},unsignedPublicAuth:!0});let ie,ge;if(N&&this.client.signer.remoteSigner){ge=Date.now()+X*60*60*1e3;const te=await this.client.signer.RetrieveCSAT({email:C,nonce:R,tenantId:A,force:K,duration:X});ie=te.token,R=te.nonce}else ge=Date.now()+X*60*60*1e3,ie=await this.client.CreateFabricToken({duration:parseInt(X*60*60*1e3),context:C?{usr:{email:C}}:{}});const pe=this.client.utils.FormatAddress(this.client.CurrentAccountAddress());if(!C)try{C=JSON.parse(this.utils.FromB64URL(S.split(".")[1])).email}catch{throw Error("Failed to decode ID token")}return this.client.SetStaticToken({token:ie}),{authToken:this.SetAuthorization({fabricToken:ie,tenantId:A,address:pe,email:C,expiresAt:ge,signerURIs:M,walletType:"Custodial",walletName:"Eluvio",register:!0,nonce:R}),signingToken:this.SetAuthorization({clusterToken:this.client.signer.authToken,fabricToken:ie,tenantId:A,address:pe,email:C,expiresAt:ge,signerURIs:M,walletType:"Custodial",walletName:"Eluvio",nonce:R})}}async AuthenticateExternalWallet({address:S,tokenDuration:A=24,walletName:C="Metamask",Sign:M}){S||(S=window.ethereum.selectedAddress),S=this.utils.FormatAddress(S),M||(M=async R=>this.SignMetamask({message:R,address:S}));const k=Date.now()+A*60*60*1e3,T=await this.client.CreateFabricToken({address:S,duration:A*60*60*1e3,Sign:M,addEthereumPrefix:!1});return this.SetAuthorization({fabricToken:T,address:S,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:S,fabricToken:A,tenantId:C,address:M,email:k,expiresAt:T,signerURIs:R,walletType:N,walletName:K,nonce:X,register:ie=!1}){M=this.client.utils.FormatAddress(M),this.__authorization={fabricToken:A,tenantId:C,address:M,email:k,expiresAt:T,walletType:N,walletName:K,nonce:X},S&&(this.__authorization.clusterToken=S,R&&(this.__authorization.signerURIs=R)),this.loggedIn=!0,this.cachedMarketplaces={};const ge=this.ClientAuthToken();if(this.storeAuthToken&&b)try{localStorage.setItem(`__elv-token-${this.network}`,ge)}catch{}return ie&&this.client.authClient.MakeAuthServiceRequest({path:"/as/wlt/register",method:"POST",headers:{Authorization:`Bearer ${this.AuthToken()}`}}).catch(pe=>{this.Log("Failed to register account: ",!0,pe)}),ge}async SignMetamask({message:S,address:A}){if(!d||!window.ethereum)throw Error("ElvWalletClient: Unable to initialize - Metamask not available");A=A||this.UserAddress();const C=await window.ethereum.request({method:"eth_requestAccounts"});if(A&&!c.EqualAddress(C[0],A))throw Error(`ElvWalletClient: Incorrect MetaMask account selected. Expected ${A}, got ${C[0]}`);return await window.ethereum.request({method:"personal_sign",params:[S,A,""]})}FlowURL({type:S="flow",flow:A,marketplaceId:C,parameters:M={}}){const k=new URL(this.appUrl);return C?k.pathname=o("/",S,A,"marketplace",C,c.B58(JSON.stringify(M))):k.pathname=o("/",S,A,c.B58(JSON.stringify(M))),k.searchParams.set("origin",window.location.origin),k.toString()}async GenerateCodeAuth({url:S}={}){S||(S=await this.LogInURL({mode:"login"}),S.searchParams.set("response","code"),S.searchParams.set("source","code"));const A=await c.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:o("as","wlt","login","redirect","metamask"),method:"POST",body:{op:"create",dest:S.toString()}}));return A.code=A.id,A.url=A.url.startsWith("https://")?A.url:`https://${A.url}`,A.metamask_url=A.metamask_url.startsWith("https://")?A.metamask_url:`https://${A.metamask_url}`,A}async SetCodeAuth({code:S,address:A,type:C,authToken:M,expiresAt:k,...T}){await c.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:o("as","wlt","login","session",S),method:"POST",headers:{Authorization:`Bearer ${this.AuthToken()}`},body:{op:"set",id:S,format:"auth_token",payload:JSON.stringify({addr:c.FormatAddress(A),eth:A?`ikms${c.AddressToHash(A)}`:"",type:C,token:M,expiresAt:k,...T})}}))}async GetCodeAuth({code:S,passcode:A}){try{return await c.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:o("as","wlt","login","redirect","metamask",S,A),method:"GET"}))}catch(C){if(C&&C.status===404)return;throw C}}async TopLevelInfo(S=!1){return(!this.topLevelInfoPromise||S)&&(this.topLevelInfoPromise=this.client.utils.ResponseToJson(this.client.MakeAuthServiceRequest({path:"/as/mw/toplevel",queryParams:{env:this.mode}}))),await this.topLevelInfoPromise}async LoadAvailableMarketplaces(S=!1){(!this.availableMarketplacesPromise||S)&&(this.availableMarketplacesPromise=new Promise(async A=>{const M=(await this.TopLevelInfo()).marketplaces;let k={...this.availableMarketplaces||{}},T={...this.availableMarketplacesById||{}};M.map(R=>{const N=c.DecodeVersionHash(R.source_hash).objectId,K=R.slug||R.name;k[R.tenant_slug]=k[R.tenant_slug]||{},k[R.tenant_slug][K]={...R,tenantName:R.tenant_slug,tenantSlug:R.tenant_slug,tenantId:R.tenant_id,marketplaceSlug:K,marketplaceId:N,marketplaceHash:R.source_hash},T[N]=k[R.tenant_slug][K],this.marketplaceHashes[N]=R.source_hash}),this.availableMarketplaces=k,this.availableMarketplacesById=T,A()})),await this.availableMarketplacesPromise}async LatestMarketplaceHash({marketplaceParams:S}){const A=await this.MarketplaceInfo({marketplaceParams:S});if(this.previewMarketplaceId&&c.EqualHash(this.previewMarketplaceId,A.marketplaceId))return this.previewMarketplaceHash;const C=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:o("/public","asset_metadata","tenants",A.tenantSlug,"marketplaces",A.marketplaceSlug),resolveLinks:!1,noAuth:!0});return t(C)}async LoadMarketplace(S){await this.LoadAvailableMarketplaces();const A=this.MarketplaceInfo({marketplaceParams:S}),C=A.marketplaceId,M=await this.LatestMarketplaceHash({marketplaceParams:S});if(this.cachedMarketplaces[C]&&this.cachedMarketplaces[C].versionHash!==M&&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",A.tenantSlug,"marketplaces",A.marketplaceSlug,"info"),localizationSubtree:this.localization?o("/public","asset_metadata","tenants",A.tenantSlug,"marketplaces",A.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",A.tenantSlug,"info","branding"),authorizationToken:this.publicStaticToken,produceLinkUrls:!0})||{}),k.items=await Promise.all(k.items.map(async(T,R)=>{if(T.requires_permissions){let N;this.loggedIn||(N=await this.client.CreateFabricToken({}));try{await this.client.ContentObjectMetadata({versionHash:t(T.nft_template),metadataSubtree:"permissioned",authorizationToken:N}),T.authorized=!0}catch{T.authorized=!1}}return T.nftTemplateMetadata=(T.nft_template||{}).nft||{},T.nftTemplateHash=((T.nft_template||{})["."]||{}).source,T.itemIndex=R,T})),k.collections=(k.collections||[]).map((T,R)=>({...T,collectionIndex:R})),k.retrievedAt=Date.now(),k.marketplaceId=C,k.versionHash=M,k.marketplaceHash=M,this.previewMarketplaceId&&C===this.previewMarketplaceId&&(k.branding.preview=!0),["purchase_animation","purchase_animation_mobile","reveal_animation","reveal_animation_mobile"].forEach(T=>{try{if(k.storefront[T]){let R=new URL("https://embed.v3.contentfabric.io");const N=t(k.storefront[T]);R.searchParams.set("p",""),R.searchParams.set("net",this.network==="main"?"main":"demo"),R.searchParams.set("ath",(this.__authorization||{}).authToken||this.publicStaticToken),R.searchParams.set("vid",N),R.searchParams.set("ap",""),T.startsWith("reveal")||(R.searchParams.set("m",""),R.searchParams.set("lp","")),k.storefront[`${T}_embed_url`]=R.toString()}}catch{}}),this.cachedMarketplaces[C]=k}return this.cachedMarketplaces[C]}async FilteredQuery({mode:S="listings",sortBy:A="created",sortDesc:C=!1,filter:M,editionFilters:k,attributeFilters:T,contractAddress:R,tokenId:N,currency:K,marketplaceParams:X,tenantId:ie,collectionIndexes:ge,priceRange:pe,tokenIdRange:te,capLimit:se,userAddress:x,sellerAddress:_,lastNDays:P=-1,startTime:j,endTime:q,includeCheckoutLocked:z=!1,start:ee=0,limit:G=50}={}){ge=(ge||[]).map(ae=>parseInt(ae));let D={start:ee,limit:G,sort_descending:C};S==="owned"&&A==="created"&&(A="default"),S!=="leaderboard"&&(D.sort_by=A),S.includes("listings")&&z&&(D.checkout=!0);let L,J;X&&(L=await this.MarketplaceInfo({marketplaceParams:X}),ge.length>0&&(J=await this.Marketplace({marketplaceParams:X})));try{let ae=[];_?ae.push(`seller:eq:${this.client.utils.FormatAddress(_)}`):x&&S!=="owned"&&ae.push(`addr:eq:${this.client.utils.FormatAddress(x)}`),J&&ge.length>=0?ge.forEach(oe=>{J.collections[oe].items.forEach(be=>{if(!be)return;const me=J.items.find(xe=>xe.sku===be);if(!me)return;const de=c.SafeTraverse(me,"nft_template","nft","address");de&&ae.push(`${S==="owned"?"contract_addr":"contract"}:eq:${c.FormatAddress(de)}`)})}):(L||ie)&&ae.push(`tenant:eq:${L?L.tenantId:ie}`),R?(S==="owned"?ae.push(`contract_addr:eq:${c.FormatAddress(R)}`):ae.push(`contract:eq:${c.FormatAddress(R)}`),N&&ae.push(`token:eq:${N}`)):M&&(S.includes("listing")?ae.push(`nft/display_name:eq:${M}`):S==="owned"?ae.push(`meta/display_name:eq:${M}`):ae.push(`name:eq:${M}`)),k&&k.forEach(oe=>{S.includes("listing")?ae.push(`nft/edition_name:eq:${oe}`):S==="owned"?(ae.push(`meta:@>:{"edition_name":"${oe}"}`),D.exact=!1):ae.push(`edition:eq:${oe}`)}),T&&T.map(({name:oe,value:ce})=>{!oe||!ce||ae.push(`nft/attributes/${oe}:eq:${ce}`)}),K&&ae.push("link_type:eq:sol"),j||q?(j&&ae.push(`created:gt:${parseInt(j)/1e3}`),q&&ae.push(`created:lt:${parseInt(q)/1e3}`)):P&&P>0&&ae.push(`created:gt:${(Date.now()/1e3-P*24*60*60).toFixed(0)}`),pe&&(pe.min&&ae.push(`price:ge:${parseFloat(pe.min)}`),pe.max&&ae.push(`price:le:${parseFloat(pe.max)}`)),te&&(te.min&&ae.push(`info/token_id:ge:${parseInt(te.min)}`),te.max&&ae.push(`info/token_id:le:${parseInt(te.max)}`)),se&&ae.push(`info/cap:le:${parseInt(se)}`);let H,Ce;switch(S){case"owned":Ce=o("as","wlt",x||this.UserAddress());break;case"owned-full-meta":Ce=o("as","apigw","nfts"),H={Authorization:`Bearer ${this.AuthToken()}`};break;case"listings":Ce=o("as","mkt","f");break;case"transfers":Ce=o("as","mkt","hst","f"),ae.push("action:eq:TRANSFERRED"),ae.push("action:eq:SOLD");break;case"sales":Ce=o("as","mkt","hst","f"),ae.push("action:eq:SOLD"),ae.push("seller:co:0x");break;case"listing-stats":Ce=o("as","mkt","stats","listed");break;case"sales-stats":Ce=o("as","mkt","stats","sold"),ae.push("seller:co:0x");break;case"leaderboard":Ce=o("as","wlt","leaders");break}if(ae.length>0&&(D.filter=ae),S.includes("stats"))return await c.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:Ce,method:"GET",queryParams:D,headers:H}));const{contents:Ie,paging:Se}=await c.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:Ce,method:"GET",queryParams:D,headers:H}))||[],Me=["owned","listings","owned-full-meta"];return{paging:{start:D.start,limit:D.limit,total:Se.total,more:Se.total>ee+G},results:(Ie||[]).map(oe=>Me.includes(S)?a(this,oe):oe)}}catch(ae){if(ae.status&&ae.status.toString()==="404")return{paging:{start:D.start,limit:D.limit,total:0,more:!1},results:[]};throw ae}}async MintingStatus({marketplaceParams:S,tenantId:A}){A||(A=(await this.MarketplaceInfo({marketplaceParams:S||this.selectedMarketplaceInfo})).tenantId);try{return(await c.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:o("as","wlt","status","act",A),method:"GET",headers:{Authorization:`Bearer ${this.AuthToken()}`}}))).map(M=>{let[k,T,R]=M.op.split(":");T=T.startsWith("0x")?c.FormatAddress(T):T;let N,K,X,ie;if(k==="nft-buy"?N=R:k==="nft-claim"?(N=R,M.marketplaceId=T,M.extra&&M.extra[0]&&(T=M.extra.token_addr,K=M.extra.token_id_str)):k==="nft-redeem"?N=M.op.split(":").slice(-1)[0]:K=R,k==="nft-transfer"&&(N=M.extra&&M.extra.trans_id,K=M.extra&&M.extra.token_id_str||K,M.extra&&M.extra.gift_action==="nft-gift-claim"&&(ie=M.extra.gift_id)),k==="nft-offer-redeem"&&(X=M.op.split(":")[3]),k==="nft-claim-entitlement"){let[ge,pe,te,se]=M.op.split(":");N=se,M.extra&&M.extra[0]&&(T=M.extra[0].token_addr,K=M.extra[0].token_id,T=T.startsWith("0x")?c.FormatAddress(T):T,M.marketplaceId=pe)}return{...M,timestamp:new Date(M.ts),state:M.state&&typeof M.state=="object"?Object.values(M.state):M.state,extra:M.extra&&typeof M.extra=="object"?Object.values(M.extra):M.extra,confirmationId:N,op:k,address:c.FormatAddress(T),tokenId:K,offerId:X,giftId:ie}}).sort((M,k)=>M.ts<k.ts?1:-1)}catch(C){return this.Log("Failed to retrieve minting status",!0,C),[]}}async DeployTenant({tenantId:S,tenantSlug:A="",tenantHash:C,environment:M="production"}){if(!C){const R=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:o("public/asset_metadata/tenants",A),resolveLinks:!0,linkDepthLimit:1,resolveIncludeSource:!0,resolveIgnoreErrors:!0,select:["."]});if(!R)throw Error(`Eluvio Wallet Client: Invalid or missing tenancy: ${A}`);const N=R["."].source;C=await this.client.LatestVersionHash({versionHash:N})}const k={content_hash:C,env:M,ts:Date.now()},T=await this.client.Sign(JSON.stringify(k));await this.client.authClient.MakeAuthServiceRequest({path:o("as","tnt","config",S,"metadata"),method:"POST",body:k,headers:{Authorization:`Bearer ${T}`}})}async PurgeUrl({tenantId:S,url:A}){const C={url:A},M=await this.client.CreateFabricToken({});await this.client.authClient.MakeAuthServiceRequest({path:o("as","tnt",S,"purge"),method:"POST",body:C,headers:{Authorization:`Bearer ${M}`}})}}return Object.assign(g.prototype,tee()),Object.assign(g.prototype,nee()),Object.assign(g.prototype,ree()),WE.ElvWalletClient=g,WE}var rL;function iee(){if(rL)return Gm;rL=1;const{ElvClient:r}=VI(),{ElvWalletClient:e}=aee(),t=gi();return Gm.ElvClient=r,Gm.ElvWalletClient=e,Gm.Utils=t,Gm}var Mf=iee();const GI=eq({__proto__:null},[Mf]),aL={default:{label:"Default",hlsSettings:Mf.Utils.HLSJSSettings({profile:"default"})},low_latency:{label:"Low Latency Live",hlsSettings:Mf.Utils.HLSJSSettings({profile:"ll"})},ultra_low_latency:{label:"Ultra Low Latency Live",hlsSettings:Mf.Utils.HLSJSSettings({profile:"ull"})},custom:{label:"Custom",hlsSettings:{}}};class see{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}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.getBitrateInfoListFor("video").map(t=>({index:t.qualityIndex,active:t.qualityIndex===this.player.dashPlayer.getQualityFor("video"),resolution:`${t.width}x${t.height}`,bitrate:t.bitrate,label:`${t.width}x${t.height} (${(t.bitrate/1e3/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.setQualityFor("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(aL).map(t=>({index:t,label:aL[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}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()}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"},WI=({player:r,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?(r.controls.Seek({relativeSeconds:-10}),e({action:Un.SEEK_BACK,text:"10 seconds"})):y>=1-t?(r.controls.Seek({relativeSeconds:10}),e({action:Un.SEEK_FORWARD,text:"10 seconds"})):r.controls.ToggleFullscreen()}else u=setTimeout(()=>{const d=r.controls.TogglePlay();e({action:d?Un.PLAY:Un.PAUSE})},a);o=p.target,s=Date.now()}},KI=(r,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(),r.controls.Seek({relativeSeconds:-s}),e({action:Un.SEEK_BACK,text:`${s} seconds`});break;case"ArrowRight":a.preventDefault(),r.controls.Seek({relativeSeconds:s}),e({action:Un.SEEK_FORWARD,text:`${s} seconds`});break;default:return}t+=1}},oee=r=>e=>{switch(e.key){case"ArrowLeft":e.preventDefault(),r.controls.SetVolume({relativeFraction:-.05});break;case"ArrowRight":e.preventDefault(),r.controls.IsMuted()?r.controls.SetVolume({fraction:.05}):r.controls.SetVolume({relativeFraction:.05});break}},Ww=(r,e)=>{if(isNaN(e)||!isFinite(e)||e===0)return"00:00";const t=r>3600,a=Math.floor(r/60/60),s=Math.floor(r/60%60),u=Math.floor(r%60);let o=`${s.toString().padStart(t?2:1,"0")}:${u.toString().padStart(2,"0")}`;return t&&(o=`${a.toString()}:${o}`),o},w8=async({player:r,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 r.__Client();let s;const{mediaCatalogObjectId:u,mediaCatalogVersionHash:o}=r.sourceOptions&&r.sourceOptions.mediaCollectionOptions||{},c=r.sourceOptions&&r.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})):""},_8=(r,e={},t=1)=>{if(t>10)return{};let a={};return Object.keys(r).forEach(s=>{if(s==="client")a.client=e.client;else if(typeof r[s]=="object"&&!Array.isArray(r[s]))a[s]=_8(r[s],(e||{})[s],t+1);else{const u=(e||{})[s];a[s]=typeof u<"u"?u:r[s]}}),a},YI=r=>_8(tq,r),uee=/iPhone|iPad|iPod/i.test(navigator.userAgent),iL=window.__chromecastAvailable||!!(window.chrome&&window.chrome.cast),lee={default:{label:"Default",hlsSettings:Mf.Utils.HLSJSSettings({profile:"default"})},low_latency:{label:"Low Latency Live",hlsSettings:Mf.Utils.HLSJSSettings({profile:"ll"})},ultra_low_latency:{label:"Ultra Low Latency Live",hlsSettings:Mf.Utils.HLSJSSettings({profile:"ull"})},custom:{label:"Custom",hlsSettings:{}}};class Kw{__RegisterVideoEventListener(e,t){this.video.addEventListener(e,t),this.__listenerDisposers.push(()=>this.video.removeEventListener(e,t))}__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 see({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=iL&&a.playerOptions.allowCasting,this.casting=!1,this.usePlayerControls=[Kt.controls.ON,Kt.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=Kt.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(()=>GI);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(Mf.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 v=this.collectionInfo.content[this.collectionInfo.mediaIndex];t.objectId=e.utils.DecodeVersionHash(v.mediaHash).objectId,t.versionHash=v.mediaHash,this.sourceOptions.playoutOptions=void 0}let a,s,u={ignore_trimming:t.ignoreTrimming,resolve:t.resolve,...t.options||{}};if((t.clipStart||t.clipEnd)&&(u.clip_start=parseFloat(t.clipStart||0),t.clipEnd&&(u.clip_end=parseFloat(t.clipEnd))),!t.channel){let v=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=v.default?"default":Object.keys(v)[0],t.offering?a=v[t.offering]?t.offering:void 0:(t.offerings||[]).length>0?a=t.offerings.find(A=>v[A]):t.offerings&&t.offerings.length>0&&(a=t.offerings.find(A=>v[A])),!a)throw new Error(`Unable to find offering from '${t.offering||t.offerings}'`);const S=v[a]&&v[a].properties||{};s=v[a].uri,this.sourceOptions.contentInfo.liveDVR===Kt.liveDVR.ON&&S.dvr_available?(u.dvr=1,this.dvrAvailable=!0):this.dvrAvailable=!1,this.isLive=S.live}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 o=(await e.AvailableDRMs()).filter(v=>(this.sourceOptions.drms||[]).includes(v)),c=this.sourceOptions.protocols,p,d;for(;!(p&&d);){p=c.find(S=>this.sourceOptions.playoutOptions[S]);const v=Object.keys(this.sourceOptions.playoutOptions[p].playoutMethods);if(d=(this.sourceOptions.drms||[]).length===0?v.find(S=>S!=="clear")||v[0]:this.sourceOptions.drms.sort().reverse().find(S=>o.includes(S)&&this.sourceOptions.playoutOptions[p].playoutMethods[S]),!d&&(c=c.filter(S=>S!==p),c.length===0))throw Error("No valid protocol / DRM combination available")}const{playoutUrl:y,drms:b}=this.sourceOptions.playoutOptions[p].playoutMethods[d],g=y.split("/").find(v=>v.startsWith("hq__"));return{playoutParameters:{...t,options:u},protocol:p,drm:d,playoutUrl:y,versionHash:g,drms:b,availableDRMs:o,offeringURI:s,offering:a,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=YI(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=Kt.autoplay.ON),t.currentTime&&this.__RegisterVideoEventListener("loadedmetadata",()=>this.video.currentTime=t.currentTime)),this.usePlayerControls&&this.playerOptions.allowCasting&&(this.castHandler=new Oq({player:this,onReady:()=>{this.chromecastAvailable=!0,this.__SettingsUpdate()},onUpdate:()=>{this.__SettingsUpdate()}})),this.__RegisterVideoEventListener("webkitplaybacktargetavailabilitychanged",b=>{this.airplayAvailable=b.availability==="available",this.__SettingsUpdate()}),this.__RegisterVideoEventListener("play",()=>{this.reloads=0,this.playbackStarted=!0,this.__SettingsUpdate()}),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===Kt.autoplay.ON&&this.controls.Play())}),this.__RegisterVideoEventListener("seeking",()=>{if(!this.isLive||!this.dvrAvailable)return;const b=this.video.duration-this.video.currentTime;this.behindLiveEdge=b>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{versionHash:a,playoutUrl:s,protocol:u,drm:o,drms:c,multiviewOptions:p,playoutParameters:d}=await this.__PlayoutOptions();this.contentHash=a,s=new URL(s);const y=this.sourceOptions.playoutParameters.authorizationToken||s.searchParams.get("authorization");if(this.authorizationToken=y,this.playoutUrl=s.toString(),this.castHandler&&this.castHandler.SetMedia({playoutOptions:this.sourceOptions.playoutOptions,playoutParameters:d}),this.__destroyed)return;u==="hls"?await this.__InitializeHLS({playoutUrl:s,authorizationToken:y,drm:o,drms:c,multiviewOptions:p}):await this.__InitializeDash({playoutUrl:s,authorizationToken:y,drm:o,drms:c,multiviewOptions:p}),this.playerOptions.collectVideoAnalytics&&Promise.resolve().then(()=>require("./Analytics-BX8nHI9d.js")).then(({InitializeMuxMonitoring:b})=>b({appName:this.playerOptions.appName||"elv-player-js",elvPlayer:this,playoutUrl:s,authorizationToken:y,disableCookies:this.playerOptions.collectVideoAnalytics===Kt.collectVideoAnalytics.DISABLE_COOKIES})),this.playerOptions.verifyContent&&setTimeout(()=>{this.__VerifyContent()},1e3),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}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-AJQ_RujU.js"))).default;const o=this.video.canPlayType("application/vnd.apple.mpegURL");if(o&&uee&&this.playerOptions.preferNativeHLS||[Kt.drms.FAIRPLAY,Kt.drms.SAMPLE_AES].includes(a)||!this.HLS.isSupported()){if(this.nativeHLS=!0,a===Kt.drms.FAIRPLAY?Rq({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===Kt.drms.PLAYREADY||a===Kt.drms.WIDEVINE)&&(c={drmSystems:{},emeEnabled:!0,licenseXhrSetup:(b,g)=>{b.open("POST",g,!0),b.setRequestHeader("Authorization",`Bearer ${t}`)}},a===Kt.drms.PLAYREADY?c.drmSystems={"com.microsoft.playready":{licenseUrl:s[a].licenseServers[0]}}:a===Kt.drms.WIDEVINE&&(c.drmSystems={"com.widevine.alpha":{licenseUrl:s[a].licenseServers[0]}}));let p=(lee[this.playerOptions.playerProfile]||{}).hlsSettings||{};const d=this.playerOptions.playerProfile===Kt.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:b=>(b.setRequestHeader("Authorization",`Bearer ${t}`),(this.playerOptions.hlsjsOptions||{}).xhrSetup&&this.playerOptions.hlsjsOptions.xhrSetup(b),b),...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,(b,{levels:g,firstLevel:v})=>{let S=g.map((A,C)=>A.bitrate>this.playerOptions.maxBitrate?C:void 0).filter(A=>typeof A<"u").reverse();S.length===g.length&&(this.Log(`Warning: Max bitrate '${this.playerOptions.maxBitrate}bps' is less than all available levels for this content.`),S=S.filter(A=>A>0)),this.Log("Removing the following levels due to maxBitrate setting:"),this.Log(S.map(A=>[g[A].width,"x",g[A].height,` (${(g[A].bitrate/1e3/1e3).toFixed(1)}Mbps)`].join("")).join(", ")),S.find(A=>v===A)&&(y.startLevel=g.map((A,C)=>C).filter(A=>!S.includes(A)).reverse()[0]),S.map(A=>y.removeLevel(A))}),y.loadSource(e.toString()),y.attachMedia(this.video),this.controls&&u.enabled){const b=u.SwitchView;u.SwitchView=async g=>{await b(g),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(b=>y.on(b,()=>this.__SettingsUpdate())),typeof this.sourceOptions.playoutParameters.audioTrackLabel<"u"&&y.on(this.HLS.Events.AUDIO_TRACKS_UPDATED,()=>{const b=(this.controls.GetAudioTracks().options||[]).find(g=>g.label===this.sourceOptions.playoutParameters.audioTrackLabel);b&&this.controls.SetAudioTrack(b.index)}),this.SetPlayerProfile=async({profile:b,customHLSOptions:g={}})=>{if(this.playoutUrl&&this.playoutUrl.includes("hls-widevine")){this.__UpdateParameters({playerOptions:{playerProfile:b,hlsjsOptions:g}}),this.__ReloadComponent();return}this.videoDuration=void 0,this.playerOptions.playerProfile=b,this.customHLSOptions=g;const v=!this.video.paused,S=this.video.currentTime;try{this.hlsPlayer.destroy()}catch(A){this.Log("Failed to destroy HLS player",!0),this.Log(A,!0)}await this.__InitializeHLS({playoutUrl:e,authorizationToken:t,drm:a,drms:s,multiviewOptions:u}),v?this.video.play():this.video.pause(),this.isLive||(this.video.currentTime=S)},y.on(this.HLS.Events.FRAG_LOADED,()=>{this.errors=0,clearTimeout(this.stallTimeout)}),y.on(this.HLS.Events.ERROR,async(b,g)=>{if(this.errors+=1,this.Log(`Encountered ${g.details}`,!0),this.Log(g,!0),g.response&&g.response.code===403)this.SetErrorMessage("Insufficient permissions",g);else if(this.errors<5){if(g.fatal)g.data&&g.data.type===this.HLS.ErrorTypes.MEDIA_ERROR?(this.Log("Attempting to recover using hlsPlayer.recoverMediaError",!0),y.recoverMediaError()):this.__HardReload(g);else if(g.details==="bufferStalledError"){clearTimeout(this.stallTimeout);let v=this.video&&this.video.currentTime;setTimeout(()=>{this.video&&this.video.currentTime>v||(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(g,0,v)},5e3))},2e3)}}else this.__HardReload(g)}),this.hlsPlayer=y,this.player=y,o){const b=document.createElement("source");b.src=this.playoutUrl.toString(),this.video.appendChild(b),this.video.disableRemotePlayback=!1}}}async __InitializeDash({playoutUrl:e,authorizationToken:t,drm:a,drms:s}){this.Dash=(await Promise.resolve().then(()=>require("./dash.all.min-DSdDnxBL.js")).then(c=>c.dash_all_min)).default;const u=this.Dash.MediaPlayer().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}}}}),e.searchParams.delete("authorization"),u.extend("RequestModifier",function(){return{modifyRequestHeader:c=>(c.setRequestHeader("Authorization",`Bearer ${t}`),c),modifyRequestURL:c=>c}}),a===Kt.drms.WIDEVINE){const c=s.widevine.licenseServers[0];u.setProtectionData({"com.widevine.alpha":{serverURL:c}})}u.initialize(this.video,e.toString(),this.playerOptions.autoplay===Kt.autoplay.ON),[this.Dash.MediaPlayer.events.TRACK_CHANGE_RENDERED,this.Dash.MediaPlayer.events.QUALITY_CHANGE_RENDERED,this.Dash.MediaPlayer.events.REPRESENTATION_SWITCH,this.Dash.MediaPlayer.events.TEXT_TRACKS_ADDED,this.Dash.MediaPlayer.events.TEXT_TRACK_ADDED,this.Dash.MediaPlayer.events.MANIFEST_LOADED,this.Dash.MediaPlayer.events.CAN_PLAY].map(c=>u.on(c,()=>this.__SettingsUpdate())),typeof this.sourceOptions.playoutParameters.audioTrackLabel<"u"&&u.on(this.Dash.MediaPlayer.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(this.Log("Unable to autoplay",!0),this.Log(e,!0),this.playbackStarted=!1,this.playerOptions.muted===Kt.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.canPlay=!1,this.isLive=!1,this.behindLiveEdge=!1,this.dvrAvailable=!1,this.dvrEnabled=!1,this.publicMetadataUrl=void 0,this.airplayAvailable=!1,this.chromecastAvailable=iL&&this.playerOptions.allowCasting,this.casting=!1,this.__error=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()}}Kw.EluvioPlayerParameters=Kt;Kw.EluvioPlayer=Kw;var JI=(function(){if(typeof Map<"u")return Map;function r(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=r(this.__entries__,t),s=this.__entries__[a];return s&&s[1]},e.prototype.set=function(t,a){var s=r(this.__entries__,t);~s?this.__entries__[s][1]=a:this.__entries__.push([t,a])},e.prototype.delete=function(t){var a=this.__entries__,s=r(a,t);~s&&a.splice(s,1)},e.prototype.has=function(t){return!!~r(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})()})(),pA=typeof window<"u"&&typeof document<"u"&&window.document===document,Yw=(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")()})(),cee=(function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Yw):function(r){return setTimeout(function(){return r(Date.now())},1e3/60)}})(),fee=2;function dee(r,e){var t=!1,a=!1,s=0;function u(){t&&(t=!1,r()),a&&c()}function o(){cee(u)}function c(){var p=Date.now();if(t){if(p-s<fee)return;a=!0}else t=!0,a=!1,setTimeout(o,e);s=p}return c}var pee=20,hee=["top","right","bottom","left","width","height","size","weight"],yee=typeof MutationObserver<"u",mee=(function(){function r(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=dee(this.refresh.bind(this),pee)}return r.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},r.prototype.removeObserver=function(e){var t=this.observers_,a=t.indexOf(e);~a&&t.splice(a,1),!t.length&&this.connected_&&this.disconnect_()},r.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},r.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},r.prototype.connect_=function(){!pA||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),yee?(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)},r.prototype.disconnect_=function(){!pA||!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)},r.prototype.onTransitionEnd_=function(e){var t=e.propertyName,a=t===void 0?"":t,s=hee.some(function(u){return!!~a.indexOf(u)});s&&this.refresh()},r.getInstance=function(){return this.instance_||(this.instance_=new r),this.instance_},r.instance_=null,r})(),QI=(function(r,e){for(var t=0,a=Object.keys(e);t<a.length;t++){var s=a[t];Object.defineProperty(r,s,{value:e[s],enumerable:!1,writable:!1,configurable:!0})}return r}),O0=(function(r){var e=r&&r.ownerDocument&&r.ownerDocument.defaultView;return e||Yw}),XI=D_(0,0,0,0);function Jw(r){return parseFloat(r)||0}function sL(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.reduce(function(a,s){var u=r["border-"+s+"-width"];return a+Jw(u)},0)}function gee(r){for(var e=["top","right","bottom","left"],t={},a=0,s=e;a<s.length;a++){var u=s[a],o=r["padding-"+u];t[u]=Jw(o)}return t}function vee(r){var e=r.getBBox();return D_(0,0,e.width,e.height)}function bee(r){var e=r.clientWidth,t=r.clientHeight;if(!e&&!t)return XI;var a=O0(r).getComputedStyle(r),s=gee(a),u=s.left+s.right,o=s.top+s.bottom,c=Jw(a.width),p=Jw(a.height);if(a.boxSizing==="border-box"&&(Math.round(c+u)!==e&&(c-=sL(a,"left","right")+u),Math.round(p+o)!==t&&(p-=sL(a,"top","bottom")+o)),!_ee(r)){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 D_(s.left,s.top,c,p)}var wee=(function(){return typeof SVGGraphicsElement<"u"?function(r){return r instanceof O0(r).SVGGraphicsElement}:function(r){return r instanceof O0(r).SVGElement&&typeof r.getBBox=="function"}})();function _ee(r){return r===O0(r).document.documentElement}function xee(r){return pA?wee(r)?vee(r):bee(r):XI}function See(r){var e=r.x,t=r.y,a=r.width,s=r.height,u=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,o=Object.create(u.prototype);return QI(o,{x:e,y:t,width:a,height:s,top:t,right:e+a,bottom:s+t,left:e}),o}function D_(r,e,t,a){return{x:r,y:e,width:t,height:a}}var Cee=(function(){function r(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=D_(0,0,0,0),this.target=e}return r.prototype.isActive=function(){var e=xee(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},r.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},r})(),Eee=(function(){function r(e,t){var a=See(t);QI(this,{target:e,contentRect:a})}return r})(),Aee=(function(){function r(e,t,a){if(this.activeObservations_=[],this.observations_=new JI,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 r.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 O0(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new Cee(e)),this.controller_.addObserver(this),this.controller_.refresh())}},r.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 O0(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))}},r.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},r.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},r.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(a){return new Eee(a.target,a.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},r.prototype.clearActive=function(){this.activeObservations_.splice(0)},r.prototype.hasActive=function(){return this.activeObservations_.length>0},r})(),ZI=typeof WeakMap<"u"?new WeakMap:new JI,eD=(function(){function r(e){if(!(this instanceof r))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=mee.getInstance(),a=new Aee(e,t,this);ZI.set(this,a)}return r})();["observe","unobserve","disconnect"].forEach(function(r){eD.prototype[r]=function(){var e;return(e=ZI.get(this))[r].apply(e,arguments)}});var kee=(function(){return typeof Yw.ResizeObserver<"u"?Yw.ResizeObserver:eD})();const U_=({element:r,Hide:e})=>{if(!r)return;const t=u=>{u&&(u.key||"").toLowerCase()==="escape"&&e()},a=u=>{r.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)}},tD=({player:r,setVideoState:e})=>{const t=function(){if(!r||!r.controls)return;const u=r.video.buffered;let o=0;for(let c=0;c<u.length;c++)u.start(c)>r.controls.GetCurrentTime()||u.end(c)>o&&(o=u.end(c));e({playing:r.controls.IsPlaying(),duration:r.controls.GetDuration(),volume:r.controls.GetVolume(),muted:r.controls.IsMuted(),rate:r.controls.GetPlaybackRate(),fullscreen:!!(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)})},a=["play","pause","volumechange","seeked","durationchange","ratechange"];a.map(u=>r.video.addEventListener(u,t)),r.target.addEventListener("fullscreenchange",t);const s=r.castHandler&&r.castHandler.RegisterListener(t);return()=>{a.map(u=>r.video.removeEventListener(u,t)),r.target.removeEventListener("fullscreenchange",t),s&&s()}},Mee=({video:r,setBufferFraction:e})=>{const t=()=>{if(!isFinite(r.duration))return 1;const a=r.buffered;let s=0;for(let u=0;u<a.length;u++)a.start(u)>r.currentTime||a.end(u)>s&&(s=a.end(u));e(1-(r.duration-s)/r.duration)};return r.addEventListener("progress",t),()=>r.removeEventListener("progress",t)},x8=({player:r,rate:e=10,setCurrentTime:t})=>{const a=setInterval(()=>{r.controls&&t(r.controls.GetCurrentTime())},1e3/e);return()=>{clearInterval(a)}},Tee=({target:r,setSize:e,setOrientation:t,setDimensions:a})=>{let s;const u=()=>{clearTimeout(s);const c=r.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 kee(u);return o.observe(r),()=>o.disconnect()},Ree=({player:r})=>{const e=r.video,t=r.playerOptions.autoplay===Kt.autoplay.WHEN_VISIBLE,a=r.playerOptions.muted===Kt.muted.WHEN_NOT_VISIBLE;if(!t&&!a)return;let s,u;const o=async([p])=>{t&&(s!=="play"&&p.isIntersecting&&e.paused?(r.controls.Play(),s="play"):s!=="pause"&&!p.isIntersecting&&!e.paused&&(r.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()},Oee=({player:r,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=>r.video.addEventListener(p,u));const c=["click","dblclick","keydown","mousemove","touchmove","blur","mouseout","fullscreenchange"];return c.forEach(p=>r.target.addEventListener(p,u)),()=>{o.map(p=>r.video.removeEventListener(p,u)),c.map(p=>r.target.removeEventListener(p,u))}},Lee=({player:r,setRecentUserAction:e})=>{if(r.playerOptions.keyboardControls===Kt.keyboardControls.OFF)return;const t=r.playerOptions.keyboardControls===Kt.keyboardControls.ARROW_KEYS_DISABLED,a=KI(r,e)(),s=u=>{if(!(r.target===u.target||r.target.contains(u.target))||["button","input"].includes(document.activeElement&&document.activeElement.tagName.toLowerCase())||r.__showPlayerProfileForm)return;let o;switch(u.key){case" ":case"k":o=r.controls.TogglePlay(),e({action:o?Un.PLAY:Un.PAUSE});break;case"f":r.controls.ToggleFullscreen();break;case"m":o=r.controls.ToggleMuted(),e({action:o?Un.MUTE:Un.UNMUTE});break;case"ArrowDown":t||(o=r.controls.SetVolume({relativeFraction:-.1}),e({action:o===0?Un.MUTE:Un.VOLUME_DOWN,text:(o*100).toFixed(0)+"%"}));break;case"ArrowUp":t||(o=r.controls.SetVolume({relativeFraction:.1}),e({action:Un.VOLUME_UP,text:(o*100).toFixed(0)+"%"}));break;case",":r.video.paused&&(r.controls.Seek({relativeSeconds:-1/60}),e({action:Un.SEEK_BACK}));break;case".":r.video.paused&&(r.controls.Seek({relativeSeconds:1/60}),e({action:Un.SEEK_FORWARD}));break;case"ArrowLeft":case"ArrowRight":t||a(u);break;case"j":r.controls.Seek({relativeSeconds:-10}),e({action:Un.SEEK_BACK,text:"10 seconds"});break;case"l":r.controls.Seek({relativeSeconds:10}),e({action:Un.SEEK_FORWARD,text:"10 seconds"});break;case"<":case">":const c=r.controls.GetPlaybackRates();c.active?o=r.controls.SetPlaybackRate({index:c.active.index+(u.key==="<"?-1:1)}):o=r.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=r.controls.ToggleTextTrack(),e({action:o?Un.SUBTITLES_ON:Un.SUBTITLES_OFF});break;case"P":r.controls.CollectionPlayPrevious(),e({action:Un.PLAY_PREVIOUS});break;case"N":r.controls.CollectionPlayNext(),e({action:Un.PLAY_NEXT});break;case"Home":r.controls.Seek({fraction:0}),e({action:Un.SEEK_BACK});break;case"End":r.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=r.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)},Nee=({player:r})=>{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":r.controls.Play();break;case"pause":r.controls.Pause();break;case"stop":r.controls.Stop();break;case"seekbackward":r.controls.Seek({relativeSeconds:u&&u.seekOffset||-10});break;case"seekforward":r.controls.Seek({relativeSeconds:u&&u.seekOffset||10});break;case"seekto":u&&typeof u.seekTime<"u"&&r.controls.Seek({time:u.seekTime});break;case"previoustrack":r.controls.CollectionPlayPrevious();break;case"nexttrack":r.controls.CollectionPlayNext();break}})});let t=setInterval(()=>{navigator.mediaSession.playbackState=r.video.paused?"paused":"playing",navigator.mediaSession.setPositionState({duration:isFinite(r.video.duration)?r.video.duration||0:r.video.currentTime+1,playbackRate:r.video.playbackRate,position:r.video.currentTime})},1e3);const a=r.controls.RegisterSettingsListener(()=>{const{title:s}=r.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)})}}},Pee="_container_fm2ri_1",Iee="_autohide_fm2ri_41",Dee="_seek_fm2ri_174",Uee="_controls_fm2ri_207",Fee="_time_fm2ri_221",Bee="_spacer_fm2ri_279",zee="_watermark_fm2ri_291",Bn={container:Pee,"container--default-controls":"_container--default-controls_fm2ri_33","bottom-controls-container":"_bottom-controls-container_fm2ri_37",autohide:Iee,"info-container":"_info-container_fm2ri_44","bottom-controls-container--autohide":"_bottom-controls-container--autohide_fm2ri_45","icon-button":"_icon-button_fm2ri_51","icon-button-active":"_icon-button-active_fm2ri_65","info-image-container":"_info-image-container_fm2ri_106","info-image":"_info-image_fm2ri_106","info-text":"_info-text_fm2ri_122","info-headers":"_info-headers_fm2ri_131","info-description":"_info-description_fm2ri_141","info-title":"_info-title_fm2ri_147","info-subtitle":"_info-subtitle_fm2ri_152","center-play-button":"_center-play-button_fm2ri_160","center-play-button--hidden":"_center-play-button--hidden_fm2ri_167",seek:Dee,"bottom-controls-gradient":"_bottom-controls-gradient_fm2ri_194",controls:Uee,"play-pause-button":"_play-pause-button_fm2ri_217",time:Fee,"live-indicator":"_live-indicator_fm2ri_231","collection-button-container":"_collection-button-container_fm2ri_249","collection-button-text":"_collection-button-text_fm2ri_254","collection-button-container--loading":"_collection-button-container--loading_fm2ri_263",spacer:Bee,"floating-volume-toggle":"_floating-volume-toggle_fm2ri_283",watermark:zee,"content-verified-badge":"_content-verified-badge_fm2ri_302","content-verification-menu-button":"_content-verification-menu-button_fm2ri_303","menu-control-container":"_menu-control-container_fm2ri_317"},nD='<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>',rD='<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>',aD='<?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>',jee='<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>',iD='<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>',qee='<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>',Hee='<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>',Vee='<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>',S8='<?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>',sD='<?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>',$ee='<?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>',Qw='<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>',Gee='<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>',oL='<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>',Wee='<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>',uL='<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>',Kee='<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>',C8='<?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>',E8='<?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>',Yee='<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>',ip='<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>',Jee='<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>',Qee='<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>',Xee='<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>',Zee='<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>',Xw='<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>',lL='<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>',ete='<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>',oD='<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>',tte='<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>',nte='<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>';var hA={exports:{}},rte=hA.exports,cL;function ate(){return cL||(cL=1,(function(r,e){(function(t,a){a()})(rte,(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(N){return!!(N&&N!==document&&N.nodeName!=="HTML"&&N.nodeName!=="BODY"&&"classList"in N&&"contains"in N.classList)}function y(N){var K=N.type,X=N.tagName;return!!(X==="INPUT"&&p[K]&&!N.readOnly||X==="TEXTAREA"&&!N.readOnly||N.isContentEditable)}function b(N){N.classList.contains("focus-visible")||(N.classList.add("focus-visible"),N.setAttribute("data-focus-visible-added",""))}function g(N){N.hasAttribute("data-focus-visible-added")&&(N.classList.remove("focus-visible"),N.removeAttribute("data-focus-visible-added"))}function v(N){N.metaKey||N.altKey||N.ctrlKey||(d(s.activeElement)&&b(s.activeElement),u=!0)}function S(N){u=!1}function A(N){d(N.target)&&(u||y(N.target))&&b(N.target)}function C(N){d(N.target)&&(N.target.classList.contains("focus-visible")||N.target.hasAttribute("data-focus-visible-added"))&&(o=!0,window.clearTimeout(c),c=window.setTimeout(function(){o=!1},100),g(N.target))}function M(N){document.visibilityState==="hidden"&&(o&&(u=!0),k())}function k(){document.addEventListener("mousemove",R),document.addEventListener("mousedown",R),document.addEventListener("mouseup",R),document.addEventListener("pointermove",R),document.addEventListener("pointerdown",R),document.addEventListener("pointerup",R),document.addEventListener("touchmove",R),document.addEventListener("touchstart",R),document.addEventListener("touchend",R)}function T(){document.removeEventListener("mousemove",R),document.removeEventListener("mousedown",R),document.removeEventListener("mouseup",R),document.removeEventListener("pointermove",R),document.removeEventListener("pointerdown",R),document.removeEventListener("pointerup",R),document.removeEventListener("touchmove",R),document.removeEventListener("touchstart",R),document.removeEventListener("touchend",R)}function R(N){N.target.nodeName&&N.target.nodeName.toLowerCase()==="html"||(u=!1,T())}document.addEventListener("keydown",v,!0),document.addEventListener("mousedown",S,!0),document.addEventListener("pointerdown",S,!0),document.addEventListener("touchstart",S,!0),document.addEventListener("visibilitychange",M,!0),k(),s.addEventListener("focus",A,!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)}))})()),hA.exports}ate();const uD="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=",ite="_spinner_vz46q_1",ste="_svg_vz46q_16",ote="_menu_vz46q_276",Ut={spinner:ite,"spinner--light":"_spinner--light_vz46q_12",svg:ste,"user-action-indicator-container":"_user-action-indicator-container_vz46q_23","user-action-indicator-text":"_user-action-indicator-text_vz46q_40","user-action-indicator":"_user-action-indicator_vz46q_23","user-action-indicator-icon":"_user-action-indicator-icon_vz46q_60","seek-container":"_seek-container_vz46q_69","seek-playhead":"_seek-playhead_vz46q_92","seek-buffer":"_seek-buffer_vz46q_93","seek-input":"_seek-input_vz46q_94","volume-controls":"_volume-controls_vz46q_201","volume-slider":"_volume-slider_vz46q_208","volume-input":"_volume-input_vz46q_224","volume-progress":"_volume-progress_vz46q_225",menu:ote,"menu-option":"_menu-option_vz46q_296","menu-option-back":"_menu-option-back_vz46q_313","menu-option-back-icon":"_menu-option-back-icon_vz46q_317","menu-option-active":"_menu-option-active_vz46q_332","menu-option-icon":"_menu-option-icon_vz46q_336","menu-header":"_menu-header_vz46q_346","verification-menu":"_verification-menu_vz46q_353","verification-menu__group":"_verification-menu__group_vz46q_357","verification-menu__group-icon":"_verification-menu__group-icon_vz46q_362","verification-menu__group-icon--cc":"_verification-menu__group-icon--cc_vz46q_366","verification-menu__group-text":"_verification-menu__group-text_vz46q_374","verification-menu__group-title":"_verification-menu__group-title_vz46q_378","verification-menu__group-subtitle":"_verification-menu__group-subtitle_vz46q_378","verification-menu__loader":"_verification-menu__loader_vz46q_393","verification-menu__details":"_verification-menu__details_vz46q_400","verification-menu__detail":"_verification-menu__detail_vz46q_400","verification-menu__detail-label":"_verification-menu__detail-label_vz46q_419","verification-menu__detail-value":"_verification-menu__detail-value_vz46q_423","verification-menu__detail-copy":"_verification-menu__detail-copy_vz46q_430","verification-menu__inline-icon":"_verification-menu__inline-icon_vz46q_440","verification-menu--details":"_verification-menu--details_vz46q_448","dvr-toggle":"_dvr-toggle_vz46q_466","dvr-toggle__border":"_dvr-toggle__border_vz46q_472","dvr-toggle__live":"_dvr-toggle__live_vz46q_481","dvr-toggle__dvr":"_dvr-toggle__dvr_vz46q_481","dvr-toggle__live--active":"_dvr-toggle__live--active_vz46q_496","dvr-toggle__dvr--active":"_dvr-toggle__dvr--active_vz46q_496","copy-button":"_copy-button_vz46q_619","copy-button--copied":"_copy-button--copied_vz46q_622"},Tg=({light:r,className:e=""})=>Be.jsx("div",{className:`${e} ${Ut.spinner} ${r?Ut["spinner--light"]:""}`,children:Be.jsx("div",{className:Ut["spinner-inner"]})}),cl=({icon:r,className:e=""})=>Be.jsx("div",{className:`${Ut.svg} ${e}`,dangerouslySetInnerHTML:{__html:r}}),A8=async r=>{try{r=(r||"").toString(),await navigator.clipboard.writeText(r)}catch{const t=document.createElement("input");t.value=r,t.select(),t.setSelectionRange(0,99999),document.execCommand("copy")}},fL={[Un.PLAY]:rD,[Un.PAUSE]:jee,[Un.MUTE]:S8,[Un.UNMUTE]:Qw,[Un.VOLUME_DOWN]:sD,[Un.VOLUME_UP]:Qw,[Un.SEEK_BACK]:oL,[Un.SEEK_FORWARD]:uL,[Un.PLAYBACK_RATE_DOWN]:oL,[Un.PLAYBACK_RATE_UP]:uL,[Un.SUBTITLES_ON]:Qee,[Un.SUBTITLES_OFF]:Xee,[Un.PLAY_PREVIOUS]:C8,[Un.PLAY_NEXT]:E8},ute=({action:r})=>{if(!(!r||!fL[r.action]))return Be.jsxs("div",{className:Ut["user-action-indicator-container"],children:[Be.jsx("div",{className:Ut["user-action-indicator"],children:Be.jsx(cl,{icon:fL[r.action],"aria-label":`Action indicator ${r}`,className:Ut["user-action-indicator-icon"]})}),r.text?Be.jsx("div",{className:Ut["user-action-indicator-text"],children:r.text}):null]})},lD=({player:r,videoState:e,setRecentUserAction:t,className:a=""})=>{const[s,u]=Ft.useState(r.controls.GetCurrentTime()),[o,c]=Ft.useState(0),[p,d]=Ft.useState(void 0),[y,b]=Ft.useState(r.controls.IsDVREnabled());return Ft.useEffect(()=>{d(KI(r,t));const g=x8({player:r,setCurrentTime:u,rate:60}),v=Mee({video:r.video,setBufferFraction:c}),S=r.controls.RegisterSettingsListener(()=>{r.controls&&b(r.controls.IsDVREnabled())});return()=>{g&&g(),v&&v(),S&&S()}},[r&&r.controls]),r.isLive&&!y?null:Be.jsxs("div",{className:`${a} ${Ut["seek-container"]} ${a}`,children:[Be.jsx("progress",{max:1,value:r.casting?0:o,className:Ut["seek-buffer"]}),Be.jsx("progress",{max:1,value:s/e.duration||0,className:Ut["seek-playhead"]}),Be.jsx("input",{"aria-label":"Seek slider",type:"range",min:0,max:1,step:1e-5,value:s/e.duration||0,onInput:g=>r.controls.Seek({fraction:g.currentTarget.value}),onKeyDown:p,className:Ut["seek-input"]})]})},lte=({player:r,videoState:e})=>Be.jsxs("div",{className:Ut["volume-controls"],children:[Be.jsx(dl,{"aria-label":e.muted?"Unmute":"Mute",icon:e.muted||e.volume===0?S8:e.volume<.4?sD:e.volume<.8?$ee:Qw,onClick:()=>r.controls.ToggleMuted(),className:Ut["volume-button"]},"mute-button"),Be.jsxs("div",{className:Ut["volume-slider"],children:[Be.jsx("progress",{max:1,value:e.muted?0:e.volume,className:Ut["volume-progress"]}),Be.jsx("input",{"aria-label":"Volume slider",type:"range",min:0,max:1,step:.001,value:e.muted?0:e.volume,onInput:t=>r.controls.SetVolume({fraction:t.currentTarget.value}),onKeyDown:oee(r),className:Ut["volume-input"]})]})]}),cD=({player:r,Hide:e,className:t=""})=>{const[a,s]=Ft.useState(void 0),[u,o]=Ft.useState(void 0),c=Ft.createRef();if(Ft.useEffect(()=>{const b=()=>o(r.controls.GetOptions());b();const g=r.controls.RegisterSettingsListener(b);return()=>g&&g()},[]),Ft.useEffect(()=>{if(!c||!c.current)return;const b=U_({element:c.current.parentElement,Hide:e});return()=>{b&&b()}},[c]),!u)return null;const p=b=>setTimeout(()=>s(b)),d={quality:{label:"Quality",Update:b=>r.controls.SetQualityLevel(b)},audio:{label:"Audio",Update:b=>r.controls.SetAudioTrack(b)},text:{label:"Subtitles",Update:b=>r.controls.SetTextTrack(b)},profile:{label:"Player Profile",Update:b=>{b==="custom"?(r.controls.ShowPlayerProfileForm(),e()):r.controls.SetPlayerProfile({profile:b})}},rate:{label:"Playback Rate",Update:b=>r.controls.SetPlaybackRate({index:b})},advanced:{label:"Advanced",Update:b=>{b==="copy_debug_info"&&(A8(JSON.stringify(r.controls.GetDebugInfo(),null,2)),e())}}};let y;return a?y=Be.jsxs("div",{role:"menu",className:`${Ut.menu} ${Ut.submenu} ${t}`,children:[Be.jsxs("button",{onClick:()=>p(void 0),"aria-label":"Back to settings menu",className:`${Ut["menu-option"]} ${Ut["menu-option-back"]}`,children:[Be.jsx("div",{dangerouslySetInnerHTML:{__html:Gee},className:Ut["menu-option-back-icon"]}),Be.jsx("div",{children:d[a].label})]}),a==="advanced"?Be.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(b=>Be.jsxs("button",{role:"menuitemradio","aria-checked":b.active,autoFocus:b.active,"aria-label":`${d[a].label}: ${b.label||""}`,onClick:()=>{d[a].Update(b.index),p(void 0)},className:`${Ut["menu-option"]} ${b.active?Ut["menu-option-active"]:""}`,children:[b.label||"",b.active?Be.jsx(cl,{icon:Jee,className:Ut["menu-option-icon"]}):null]},`option-${b.index}`))]},"submenu"):y=Be.jsxs("div",{role:"menu",className:`${Ut.menu} ${t}`,children:[u.hasQualityOptions?Be.jsxs("button",{autoFocus:!0,role:"menuitem",onClick:()=>p("quality"),className:Ut["menu-option"],children:[`${d.quality.label}: ${u.quality.active&&u.quality.active.activeLabel||""}`,Be.jsx(cl,{icon:ip,className:Ut["menu-option-icon"]})]}):null,u.hasAudioOptions?Be.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||""}`,Be.jsx(cl,{icon:ip,className:Ut["menu-option-icon"]})]}):null,u.hasTextOptions?Be.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||""}`,Be.jsx(cl,{icon:ip,className:Ut["menu-option-icon"]})]}):null,u.hasProfileOptons?Be.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||""}`,Be.jsx(cl,{icon:ip,className:Ut["menu-option-icon"]})]}):null,u.hasRateOptions?Be.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||""}`,Be.jsx(cl,{icon:ip,className:Ut["menu-option-icon"]})]}):null,Be.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,Be.jsx(cl,{icon:ip,className:Ut["menu-option-icon"]})]})]},"menu"),Be.jsx("div",{ref:c,children:y})},fD=({player:r})=>{const[e,t]=Ft.useState(r.dvrEnabled);return Ft.useEffect(()=>{const a=r.controls.RegisterSettingsListener(()=>{r.controls&&t(r.controls.IsDVREnabled())});return()=>a&&a()},[r&&r.controls]),Be.jsxs("div",{className:Ut["dvr-toggle"],children:[Be.jsx("button",{onClick:()=>r.controls.SetDVREnabled(!1),className:`${Ut["dvr-toggle__live"]} ${e?"":Ut["dvr-toggle__live--active"]}`,children:"LIVE"}),Be.jsx("button",{onClick:()=>r.controls.SetDVREnabled(!0),className:`${Ut["dvr-toggle__dvr"]} ${e?Ut["dvr-toggle__dvr--active"]:""}`,children:"DVR"}),Be.jsx("div",{className:Ut["dvr-toggle__border"]})]})},cte=({label:r,value:e,className:t=""})=>{const[a,s]=Ft.useState(!1);return Be.jsx("button",{onClick:()=>{a||(A8(e),s(!0),setTimeout(()=>s(!1),100))},dangerouslySetInnerHTML:{__html:ete},className:[Ut["copy-button"],a?Ut["copy-button--copied"]:"",t].join(" "),title:`Copy ${r}`})},To=({label:r,value:e,copyable:t})=>e?Be.jsxs("div",{className:Ut["verification-menu__detail"],children:[Be.jsxs("label",{className:Ut["verification-menu__detail-label"],children:[r,":"]}),Be.jsx("div",{className:Ut["verification-menu__detail-value"],children:e}),t?Be.jsx(cte,{label:r,value:e,className:Ut["verification-menu__detail-copy"]}):null]}):null,dD=({player:r,Hide:e,className:t=""})=>{const a=Ft.createRef(),[s,u]=Ft.useState(),[o,c]=Ft.useState(!1),[p,d]=Ft.useState(!1);if(Ft.useEffect(()=>{r.__LoadVerificationDetails().then(()=>d(!0));const b=()=>u(r.controls.GetContentVerificationDetails());b();const g=r.controls.RegisterSettingsListener(b);return()=>g&&g()},[]),Ft.useEffect(()=>{if(!a||!a.current)return;const b=U_({element:a.current.parentElement,Hide:e});return()=>{b&&b()}},[a]),!s)return null;let y;return o?y=Be.jsxs(Be.Fragment,{children:[Be.jsxs("div",{className:Ut["verification-menu__group"],children:[Be.jsx("div",{dangerouslySetInnerHTML:{__html:Xw},className:Ut["verification-menu__group-icon"]}),Be.jsxs("div",{className:Ut["verification-menu__group-text"],children:[Be.jsx("div",{className:Ut["verification-menu__group-title"],children:"This content has been verified as authentic"}),Be.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"})]})]})]}),Be.jsxs("div",{className:Ut["verification-menu__group"],children:[Be.jsx("div",{dangerouslySetInnerHTML:{__html:lL},className:[Ut["verification-menu__group-icon"],Ut["verification-menu__group-icon--cc"]].join(" ")}),Be.jsxs("div",{className:Ut["verification-menu__group-text"],children:[Be.jsx("button",{onClick:()=>c(!0),className:Ut["verification-menu__group-title"],children:"Content Credentials"}),Be.jsxs("div",{className:Ut["verification-menu__group-subtitle"],children:["Issued by the",Be.jsx("a",{href:"https://main.net955305.contentfabric.io/config",target:"_blank",rel:"noreferrer",children:"Content Fabric"})]})]})]}),Be.jsxs("div",{className:Ut["verification-menu__details"],children:[Be.jsx(To,{label:"Content Fabric Object ID",value:s.details.objectId,copyable:!0}),Be.jsx(To,{label:"Organization Address",value:s.details.tenantAddress,copyable:!0}),Be.jsx(To,{label:"Organization Name",value:s.details.tenantName&&s.details.tenantName.toString()}),Be.jsx(To,{label:"Owner Address",value:s.details.ownerAddress,copyable:!0}),Be.jsx(To,{label:"Content Object Contract Address",value:s.details.explorerUrl?Be.jsx("a",{href:s.details.explorerUrl,target:"_blank",rel:"noreferrer",children:s.details.address}):s.details.address,copyable:!0}),Be.jsx(To,{label:"Versions",value:s.details.versionCount}),Be.jsx(To,{label:"Content Version Hash",value:s.details.versionHash,copyable:!0}),s.details.lastCommittedAt?Be.jsx(To,{label:"Latest Commit",value:new Date(s.details.lastCommittedAt).toLocaleTimeString(navigator.language||"en-us",{year:"numeric",month:"long",day:"numeric"})}):null,Be.jsx(To,{label:"Latest Version Hash",value:s.details.latestVersionHash,copyable:!0}),Be.jsx(To,{label:"Latest Transaction",value:s.details._state!=="full"?Be.jsx(Tg,{className:Ut["verification-menu__loader"]}):s.details.latestTransactionHashUrl?Be.jsx("a",{href:s.details.latestTransactionHashUrl,target:"_blank",rel:"noreferrer",children:s.details.latestTransactionHash&&s.details.latestTransactionHash.toString()}):void 0}),Be.jsx(To,{label:"Signature Algorithm",value:s.details.signatureMethod}),r.publicMetadataUrl?Be.jsx(To,{label:"Public Metadata",value:Be.jsx("a",{href:r.publicMetadataUrl,target:"_blank",rel:"noreferrer",children:r.publicMetadataUrl})}):null]},`details-${s.details._state}`)]}):y=Be.jsxs(Be.Fragment,{children:[Be.jsxs("div",{className:Ut["verification-menu__group"],children:[Be.jsx("div",{dangerouslySetInnerHTML:{__html:Xw},className:Ut["verification-menu__group-icon"]}),Be.jsxs("div",{className:Ut["verification-menu__group-text"],children:[Be.jsx("div",{className:Ut["verification-menu__group-title"],children:"This content has been verified as authentic"}),Be.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"})]})]})]}),Be.jsxs("div",{className:Ut["verification-menu__group"],children:[Be.jsx("div",{dangerouslySetInnerHTML:{__html:lL},className:[Ut["verification-menu__group-icon"],Ut["verification-menu__group-icon--cc"]].join(" ")}),Be.jsx("div",{className:Ut["verification-menu__group-text"],children:Be.jsxs("button",{onClick:()=>c(!0),className:Ut["verification-menu__group-title"],children:["View Content Credentials",Be.jsx("div",{className:Ut["verification-menu__inline-icon"],dangerouslySetInnerHTML:{__html:ip}})]})})]})]}),Be.jsx("div",{ref:a,children:Be.jsx("div",{role:"menu",className:`${Ut.menu} ${Ut["verification-menu"]} ${o?Ut["verification-menu--details"]:""} ${t}`,children:y},"menu")})},fte=({player:r,Hide:e,className:t=""})=>{const a=Ft.createRef(),[s,u]=Ft.useState(void 0);if(Ft.useEffect(()=>{const c=()=>u(r.controls.GetCollectionInfo());c();const p=r.controls.RegisterSettingsListener(c);return()=>p&&p()},[]),Ft.useEffect(()=>{if(!a||!a.current)return;const c=U_({element:a.current.parentElement,Hide:e});return()=>c&&c()},[a]),!s)return null;const o=c=>{r.controls.CollectionPlay({mediaIndex:c}),e()};return Be.jsxs("div",{role:"menu",className:`${Ut.menu} ${Ut["collection-menu"]} ${t}`,ref:a,children:[Be.jsx("div",{className:`${Ut["menu-option"]} ${Ut["menu-header"]}`,children:s.title}),s.content.map((c=>Be.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")},dl=({icon:r,className:e="",...t})=>Be.jsx("button",{...t,className:`${Bn["icon-button"]} ${e}`,dangerouslySetInnerHTML:{__html:r}}),dte=({player:r,videoState:e})=>{const[t,a]=Ft.useState(r.video.currentTime);return Ft.useEffect(()=>{const s=x8({player:r,setCurrentTime:a,rate:10});return()=>s&&s()},[]),r.isLive&&!r.controls.IsDVRAvailable()?Be.jsx("div",{className:Bn["live-indicator"],children:"Live"}):Be.jsxs("div",{className:Bn.time,children:[!r.isLive||!r.controls.IsDVRAvailable()?null:Be.jsx(fD,{player:r}),r.isLive&&!r.behindLiveEdge?null:`${Ww(t,e.duration)} / `,r.isLive&&!r.dvrEnabled?null:Ww(e.duration,e.duration)]})},pte=({player:r})=>{const e=r.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=r.controls.IsReady();return Be.jsxs(Be.Fragment,{children:[t?Be.jsxs("div",{className:`${Bn["collection-button-container"]} ${s?"":Bn["collection-button-container--loading"]}`,children:[Be.jsx(dl,{"aria-label":`Play Previous: ${t.title}`,disabled:!s,icon:C8,onClick:()=>r.controls.CollectionPlayPrevious()}),Be.jsx("div",{className:Bn["collection-button-text"],children:t.title})]},`media-previous-${e.mediaIndex}`):null,a?Be.jsxs("div",{className:`${Bn["collection-button-container"]} ${s?"":Bn["collection-button-container--loading"]}`,children:[Be.jsx(dl,{"aria-label":`Play Next: ${a.title}`,disabled:!s,icon:E8,onClick:()=>r.controls.CollectionPlayNext()}),Be.jsx("div",{className:Bn["collection-button-text"],children:a.title})]},`media-next-${e.mediaIndex}`):null]})},pD=({label:r,icon:e,player:t,MenuComponent:a,className:s=""})=>{const[u,o]=Ft.useState(!1);return Be.jsxs("div",{className:[Bn["menu-control-container"],s].join(" "),children:[Be.jsx(dl,{"aria-label":u?`Hide ${r} Menu`:r,"aria-haspopup":!0,icon:e,onClick:()=>{t.controls.__ToggleMenu(!u),o(!u)},className:u?Bn["icon-button-active"]:""}),u?Be.jsx(a,{player:t,Hide:()=>{o(!1),t.controls.__ToggleMenu(!1)}}):null]})},hte=({player:r})=>{const[e,t]=Ft.useState(void 0),{title:a,subtitle:s,description:u,image:o,headers:c}=r.controls.GetContentInfo()||{};return Ft.useEffect(()=>{t(void 0),o&&w8({player:r,pathOrUrl:o,width:200}).then(p=>t(p))},[o]),!a||r.playerOptions.title===Kt.title.FULLSCREEN_ONLY&&!r.controls.IsFullscreen()||r.playerOptions.title===Kt.title.OFF?null:Be.jsxs("div",{className:Bn["info-container"],children:[e?Be.jsx("div",{className:Bn["info-image-container"],children:Be.jsx("img",{src:e,alt:"Image",className:Bn["info-image"]})}):null,Be.jsxs("div",{className:Bn["info-text"],children:[c.length===0?null:Be.jsx("div",{className:Bn["info-headers"],children:c.map((p,d)=>Be.jsx("div",{className:Bn["info-header"],children:p},`header-${d}`))}),a?Be.jsx("div",{className:Bn["info-title"],children:a}):null,s?Be.jsx("div",{className:Bn["info-subtitle"],children:s}):null,u?Be.jsx("div",{className:Bn["info-description"],children:u}):null]})]})},yte=({player:r})=>{const[e,t]=Ft.useState(!1);return Ft.useEffect(()=>{const a=()=>r&&r.controls&&t(r.controls.ContentVerified());a();const s=r.controls&&r.controls.RegisterSettingsListener(a);return()=>s&&s()},[]),e?Be.jsxs(Be.Fragment,{children:[Be.jsx("div",{className:Bn["content-verified-badge"],children:"VERIFIED"}),Be.jsx(pD,{label:"Content Verification Menu",icon:Xw,player:r,MenuComponent:dD,className:Bn["content-verification-menu-button"]})]}):null},mte=({player:r,playbackStarted:e,canPlay:t,recentlyInteracted:a,setRecentUserAction:s,className:u=""})=>{const[o,c]=Ft.useState(void 0),[p,d]=Ft.useState(void 0),[y,b]=Ft.useState(r.controls.IsMenuVisible());if(Ft.useEffect(()=>{if(!r.controls)return;d(WI({player:r,setRecentUserAction:s}));const A=()=>r&&r.controls&&b(r.controls.IsMenuVisible()),C=r.controls.RegisterSettingsListener(A),M=tD({player:r,setVideoState:c});return()=>{C&&C(),M&&M()}},[]),!o)return null;const g=r.controls.GetCollectionInfo(),v=a||!e||y,S=!v&&r.playerOptions.controls===Kt.controls.AUTO_HIDE;return r.__SetControlsVisibility(!S),Be.jsxs("div",{onClick:p,className:[u,Bn.container,v?"":Bn.autohide,r.playerOptions.controls!==Kt.controls.DEFAULT?"":Bn["container--default-controls"],r.controls.IsMenuVisible()?"menu-active":""].join(" "),children:[Be.jsx(hte,{player:r},`content-info-${g&&g.mediaIndex}`),[Kt.controls.DEFAULT,Kt.controls.OFF,Kt.controls.OFF_WITH_VOLUME_TOGGLE].includes(r.playerOptions.controls)?null:Be.jsxs(Be.Fragment,{children:[Be.jsx(dl,{"aria-label":"Play",tabIndex:e?-1:0,icon:nD,onClick:()=>{r.controls.Play(),r.target.firstChild.focus()},className:`${Bn["center-play-button"]} ${t&&!e&&!(r&&r.casting)?"":Bn["center-play-button--hidden"]}`}),Be.jsxs("div",{className:`${Bn["bottom-controls-container"]} ${S?Bn["bottom-controls-container--autohide"]:""}`,children:[Be.jsx("div",{className:Bn["bottom-controls-gradient"]}),Be.jsx(lD,{player:r,videoState:o,setRecentUserAction:s,className:Bn.seek}),Be.jsxs("div",{className:Bn.controls,children:[Be.jsx(dl,{"aria-label":o.playing?"Pause":"Play",icon:o.playing?iD:aD,onClick:()=>r.controls.TogglePlay(),className:Bn["play-pause-button"]}),Be.jsx(pte,{player:r}),Be.jsx(lte,{player:r,videoState:o}),Be.jsx(dte,{player:r,videoState:o}),Be.jsx("div",{className:Bn.spacer}),Be.jsx(yte,{player:r}),r.chromecastAvailable?Be.jsx("google-cast-launcher",{}):null,r.airplayAvailable?Be.jsx(dl,{"aria-label":"Airplay",onClick:()=>r.video.webkitShowPlaybackTargetPicker(),icon:oD}):null,r.controls.IsRotatable()?Be.jsx(dl,{"aria-label":"Rotate Video",icon:Zee,onClick:()=>r.controls.SetAllowRotation(!r.controls.AllowRotation()),className:Bn["right-control-button"]}):null,r.controls.GetOptions().hasAnyOptions?Be.jsx(pD,{label:"Settings Menu",icon:Vee,player:r,MenuComponent:cD}):null,Be.jsx(dl,{"aria-label":o.fullscreen?"Exit Fullscreen":"Fullscreen",icon:o.fullscreen?Hee:qee,onClick:()=>r.controls.ToggleFullscreen(),className:Bn["right-control-button"]})]})]})]}),r.playerOptions.controls!==Kt.controls.OFF_WITH_VOLUME_TOGGLE?null:Be.jsx("div",{className:Bn["floating-volume-toggle"],children:Be.jsx(dl,{"aria-label":o.muted?"Unmute":"Mute",icon:o.muted||o.volume===0?S8:Qw,onClick:()=>r.controls.ToggleMuted(),className:Bn["volume-button"]},"mute-button")}),r.playerOptions.watermark===Kt.watermark.OFF?null:Be.jsx("div",{className:Bn.watermark,children:Be.jsx("img",{src:uD,alt:"Eluvio"})})]})},gte="_spinner_1c6ar_17",vte="_text_1c6ar_33",bte="_title_1c6ar_39",wte="_description_1c6ar_43",_te="_inputs_1c6ar_47",xte="_input_1c6ar_47",Ste="_submit_1c6ar_77",ci={"ticket-form-container":"_ticket-form-container_1c6ar_1","ticket-form-overlay":"_ticket-form-overlay_1c6ar_8",spinner:gte,"ticket-form":"_ticket-form_1c6ar_1",text:vte,title:bte,description:wte,inputs:_te,input:xte,submit:Ste,"error-message":"_error-message_1c6ar_88","size-md":"_size-md_1c6ar_102","size-sm":"_size-sm_1c6ar_103"},Cte=({parameters:r,dimensions:e,onComplete:t})=>{let{tenantId:a,ntpId:s,ticketCode:u,ticketSubject:o}=r.clientOptions||{};const c=!a||!s,[p,d]=Ft.useState(u||""),[y,b]=Ft.useState(!!u),[g,v]=Ft.useState(!1),[S,A]=Ft.useState(c?"Error: Tenant ID or NTP ID not specified":""),[C,M]=Ft.useState(void 0),k=async({client:T,code:R})=>{if(!(!R||!T)){A(""),v(!0);try{let N=o;R.includes(":")&&(N=R.split(":")[0],R=R.split(":")[1]),await T.RedeemCode({tenantId:a,ntpId:s,code:R.trim(),email:N}),t(T)}catch(N){console.log(N),A("Invalid Code"),b(!1)}finally{v(!1)}}};return Ft.useEffect(()=>{Promise.resolve().then(()=>GI).then(async({ElvClient:T})=>{const R=await T.FromConfigurationUrl({configUrl:r.clientOptions.network});M(R),u&&k({client:R,code:u})})},[]),y?Be.jsx("div",{role:"complementary",tabIndex:-1,style:{backgroundColor:r.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:Be.jsx("div",{className:ci["ticket-form-overlay"],children:Be.jsx(Tg,{className:ci.spinner})})}):Be.jsx("div",{role:"complementary",tabIndex:-1,style:{backgroundColor:r.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:Be.jsx("div",{className:ci["ticket-form-overlay"],children:Be.jsxs("form",{onSubmit:T=>{T.preventDefault(),k({client:C,code:p})},className:ci["ticket-form"],children:[Be.jsxs("div",{className:ci.text,children:[Be.jsx("h2",{className:ci.title,children:r.clientOptions.ticketTitle||"This content requires a code to view"}),Be.jsx("p",{className:ci.description,children:r.clientOptions.ticketDescription||"Please enter your code below"})]}),Be.jsxs("div",{className:ci.inputs,children:[Be.jsx("input",{disabled:c,autoFocus:!0,type:"text",placeholder:"Ticket Code",value:p,"aria-label":"Ticket Code","aria-invalid":!!S&&!c,"aria-errormessage":S,onKeyDown:T=>T.key==="Enter"&&k({client:C,code:p}),onChange:T=>{A(""),d(T.target.value)},className:ci.input}),Be.jsx("button",{type:"submit","aria-label":"Submit Code",disabled:!p||!C||c,className:ci.submit,children:g?Be.jsx(Tg,{light:!0}):"Submit"})]}),Be.jsxs("div",{className:ci["error-message"],children:[S," "]})]})})})},Ete="_container_m8dfx_1",Ate="_autohide_m8dfx_34",kte="_title_m8dfx_134",Mte="_spacer_m8dfx_319",Tte="_watermark_m8dfx_323",Rte="_menu_m8dfx_145",vn={container:Ete,"container--default-controls":"_container--default-controls_m8dfx_29",autohide:Ate,"bottom-controls-container--autohide":"_bottom-controls-container--autohide_m8dfx_37","icon-button":"_icon-button_m8dfx_43","icon-button--drop-shadow-focus":"_icon-button--drop-shadow-focus_m8dfx_60","icon-button-active":"_icon-button-active_m8dfx_73","icon-button--circle-focus":"_icon-button--circle-focus_m8dfx_73","text-button":"_text-button_m8dfx_86","text-button--active":"_text-button--active_m8dfx_91","bottom-controls-container":"_bottom-controls-container_m8dfx_37","bottom-controls-gradient":"_bottom-controls-gradient_m8dfx_108","center-play-button":"_center-play-button_m8dfx_120","center-play-button--hidden":"_center-play-button--hidden_m8dfx_127","title-container":"_title-container_m8dfx_134",title:kte,"menu-control-container":"_menu-control-container_m8dfx_145","time-container":"_time-container_m8dfx_149","live-indicator":"_live-indicator_m8dfx_156","bottom-controls":"_bottom-controls_m8dfx_37","center-buttons":"_center-buttons_m8dfx_184","play-pause-button":"_play-pause-button_m8dfx_194","track-button":"_track-button_m8dfx_197","bottom-left-controls":"_bottom-left-controls_m8dfx_201","bottom-right-controls":"_bottom-right-controls_m8dfx_202","info-box-container":"_info-box-container_m8dfx_219","info-box":"_info-box_m8dfx_219","info-box-image-container":"_info-box-image-container_m8dfx_242","info-box-image":"_info-box-image_m8dfx_242","info-box-text":"_info-box-text_m8dfx_258","info-box-text--top-padding":"_info-box-text--top-padding_m8dfx_265","info-box-headers":"_info-box-headers_m8dfx_269","info-box-description":"_info-box-description_m8dfx_277","info-box-title":"_info-box-title_m8dfx_281","info-box-button":"_info-box-button_m8dfx_286","info-box-button--restart":"_info-box-button--restart_m8dfx_301",spacer:Mte,watermark:Tte,menu:Rte},Sf=({icon:r,...e})=>Be.jsx("button",{...e,className:`${vn["icon-button"]} ${e.className||""}`,dangerouslySetInnerHTML:{__html:r}}),Ote=({player:r,videoState:e})=>{const[t,a]=Ft.useState(r.video.currentTime);return Ft.useEffect(()=>{const s=x8({player:r,setCurrentTime:a,rate:10});return()=>s&&s()},[]),r.isLive&&!r.dvrEnabled?null:Be.jsxs("div",{className:vn["time-container"],children:[r.isLive&&!r.behindLiveEdge?null:Be.jsx("div",{className:vn.time,children:Ww(t,e.duration)}),Be.jsx("div",{className:vn.spacer}),Be.jsx("div",{className:vn.time,children:Ww(e.duration,e.duration)})]})},Lte=({player:r,videoState:e})=>{const t=r.controls.GetCollectionInfo(),a=t&&t.isPlaylist&&t.content[t.mediaIndex-1],s=t&&t.isPlaylist&&t.content[t.mediaIndex+1],u=r.controls.IsReady();return Be.jsxs("div",{className:vn["center-buttons"],children:[!a&&!s?null:Be.jsx(Sf,{disabled:!u||!a,icon:C8,onClick:()=>r.controls.CollectionPlayPrevious(),className:`${vn["track-button"]} ${vn["icon-button--drop-shadow-focus"]}`}),Be.jsx(Sf,{"aria-label":"Back 10 Seconds",icon:Wee,onClick:()=>r.controls.Seek({relativeSeconds:-10}),className:vn["icon-button--drop-shadow-focus"]}),Be.jsx(Sf,{"aria-label":e.playing?"Pause":"Play",icon:e.playing?iD:aD,onClick:()=>r.controls.TogglePlay(),className:`${vn["play-pause-button"]} ${vn["icon-button--drop-shadow-focus"]}`}),Be.jsx(Sf,{"aria-label":"Forward 10 Seconds",icon:Kee,onClick:()=>r.controls.Seek({relativeSeconds:10}),className:vn["icon-button--drop-shadow-focus"]}),!a&&!s?null:Be.jsx(Sf,{disabled:!u||!s,icon:E8,onClick:()=>r.controls.CollectionPlayNext(),className:`${vn["track-button"]} ${vn["icon-button--drop-shadow-focus"]}`})]})},yA=({label:r,icon:e,children:t,player:a,MenuComponent:s})=>{const[u,o]=Ft.useState(!1);return Be.jsxs("div",{className:vn["menu-control-container"],children:[e?Be.jsx(Sf,{"aria-label":u?`Hide ${r} Menu`:r,"aria-haspopup":!0,icon:e,onClick:()=>{a.controls.__ToggleMenu(!u),o(!u)},className:`${vn["icon-button--circle-focus"]} ${u?vn["icon-button-active"]:""}`}):Be.jsx("button",{onClick:()=>{a.controls.__ToggleMenu(!u),o(!u)},className:`${vn["text-button"]} ${u?vn["text-button--active"]:""}`,children:t}),u?Be.jsx(s,{player:a,Hide:()=>{a.controls.__ToggleMenu(!1),o(!1)},className:vn.menu}):null]})},Nte=({player:r,Hide:e})=>{const[t,a]=Ft.useState(void 0),{title:s,description:u,image:o,headers:c}=r.controls.GetContentInfo()||{};return Ft.useEffect(()=>{a(void 0),o&&w8({player:r,pathOrUrl:o,width:200}).then(p=>a(p))},[o]),Ft.useEffect(()=>{const p=d=>{d&&(d.key||"").toLowerCase()==="escape"&&e()};return document.body.addEventListener("keydown",p),()=>document.body.removeEventListener("keydown",p)},[]),Be.jsxs("div",{className:vn["info-box-container"],children:[Be.jsx("button",{autoFocus:!0,onClick:()=>e(),className:`${vn["info-box-button"]} ${vn["info-box-button--info"]}`,children:"Info"}),Be.jsxs("div",{className:vn["info-box"],children:[t?Be.jsx("div",{className:vn["info-box-image-container"],children:Be.jsx("img",{src:t,alt:"Image",className:vn["info-box-image"]})}):null,Be.jsxs("div",{className:`${vn["info-box-text"]} ${t&&c&&c.length===0?vn["info-box-text--top-padding"]:""}`,children:[!c||c.length===0?null:Be.jsx("div",{className:vn["info-box-headers"],children:c.map((p,d)=>Be.jsx("div",{className:vn["info-box-header"],children:p},`header-${d}`))}),Be.jsx("div",{className:vn["info-box-title"],children:s||""}),Be.jsx("div",{className:vn["info-box-description"],children:u||""})]}),Be.jsx("div",{className:vn["info-box-actions"],children:Be.jsxs("button",{onClick:()=>{r.controls.Seek({time:0}),e()},className:`${vn["info-box-button"]} ${vn["info-box-button--restart"]}`,children:[Be.jsx(cl,{icon:rD}),"From Beginning"]})})]})]})},Pte=({player:r})=>{const[e,t]=Ft.useState(!1);return Ft.useEffect(()=>{const a=()=>t(r.controls.ContentVerified());a(),r.controls.RegisterSettingsListener(a)},[]),e?Be.jsx(yA,{label:"Content Verification Menu",icon:Xw,player:r,MenuComponent:dD,className:vn["content-verification-menu-button"],children:"Verified"}):null},Ite=({player:r,playbackStarted:e,canPlay:t,recentlyInteracted:a,setRecentUserAction:s,className:u=""})=>{const[o,c]=Ft.useState(void 0),[p,d]=Ft.useState(void 0),[y,b]=Ft.useState(!1);if(Ft.useEffect(()=>{d(WI({player:r,setRecentUserAction:s}));const C=tD({player:r,setVideoState:c});return()=>C&&C()},[]),!o)return null;const{title:g}=r.controls.GetContentInfo()||{},v=r.controls.GetCollectionInfo(),S=a||!e||r.controls.IsMenuVisible(),A=!S&&r.playerOptions.controls===Kt.controls.AUTO_HIDE;return r.__SetControlsVisibility(!A),Be.jsxs("div",{onClick:p,className:[u,vn.container,S?"":vn.autohide,r.playerOptions.controls!==Kt.controls.DEFAULT?"":vn["container--default-controls"],r.controls.IsMenuVisible()?"menu-active":""].join(" "),children:[Be.jsx(Sf,{"aria-label":"Play",tabIndex:e?-1:0,icon:nD,onClick:()=>{r.controls.Play(),r.target.firstChild.focus()},className:`${vn["center-play-button"]} ${vn["icon-button--drop-shadow-focus"]} ${t&&!e&&!r.casting?"":vn["center-play-button--hidden"]}`}),y?Be.jsx(Nte,{player:r,Hide:()=>b(!1)}):Be.jsxs("div",{className:`${vn["bottom-controls-container"]} ${A?vn["bottom-controls-container--autohide"]:""}`,children:[Be.jsx("div",{className:vn["bottom-controls-gradient"]}),Be.jsxs("div",{className:vn["title-container"],children:[Be.jsx("div",{className:vn.title,children:r.playerOptions.title===Kt.title.OFF||r.playerOptions.title===Kt.title.FULLSCREEN_ONLY&&!r.controls.IsFullscreen()?"":g||""}),Be.jsx("div",{className:vn.spacer}),r.isLive?r.controls.IsDVRAvailable()?Be.jsx(fD,{player:r}):Be.jsx("div",{className:vn["live-indicator"],children:"Live"}):null,v?Be.jsx(yA,{label:"Collection Menu",icon:Yee,player:r,MenuComponent:fte}):null]}),Be.jsx(lD,{player:r,videoState:o,setRecentUserAction:s}),Be.jsx(Ote,{player:r,videoState:o}),Be.jsxs("div",{className:vn["bottom-controls"],children:[Be.jsx("div",{className:vn["bottom-left-controls"],children:!g||r.playerOptions.title===Kt.title.OFF?null:Be.jsx("button",{className:vn["text-button"],onClick:()=>b(!0),children:"Info"})}),Be.jsx(Lte,{player:r,videoState:o}),Be.jsxs("div",{className:vn["bottom-right-controls"],children:[Be.jsx(Pte,{player:r}),r.airplayAvailable?Be.jsx(Sf,{"aria-label":"Airplay",onClick:()=>r.video.webkitShowPlaybackTargetPicker(),icon:oD}):null,r.chromecastAvailable?Be.jsx("google-cast-launcher",{}):null,r.controls.GetOptions().hasAnyOptions?Be.jsx(yA,{label:"Settings",player:r,MenuComponent:cD,children:"Settings"},"settings-button"):null]})]})]}),r.playerOptions.watermark===Kt.watermark.OFF?null:Be.jsx("div",{className:vn.watermark,children:Be.jsx("img",{src:uD,alt:"Eluvio"})})]},"controls")},Dte="_container_1l7ln_1",Ute="_overlay_1l7ln_9",Fte="_form_1l7ln_22",Bte="_header_1l7ln_39",zte="_input_1l7ln_45",jte="_actions_1l7ln_92",qte="_submit_1l7ln_98",Hte="_cancel_1l7ln_99",Ks={container:Dte,overlay:Ute,form:Fte,header:Bte,"input-container":"_input-container_1l7ln_45",input:zte,"input--invalid":"_input--invalid_1l7ln_65","player-info":"_player-info_1l7ln_74","api-link":"_api-link_1l7ln_83",actions:jte,submit:qte,cancel:Hte},Vte=({player:r,Close:e})=>{const[t,a]=Ft.useState(),[s,u]=Ft.useState(!1),[o,c]=Ft.useState(""),p=Ft.useRef();Ft.useEffect(()=>{if(!p||!p.current)return;const y=U_({element:p.current,Hide:e});return()=>y&&y()},[p]),Ft.useEffect(()=>{let y={...r.hlsOptions||{}};delete y.drmSystems,delete y.emeEnabled,a(JSON.stringify(y,null,2))},[]);const d=async y=>{y.preventDefault();try{u(!0),await r.controls.SetPlayerProfile({profile:"custom",customOptions:JSON.parse(t)}),e()}catch(b){c(b.toString()),u(!1)}};return Be.jsx("div",{role:"complementary",tabIndex:-1,className:Ks.container,children:Be.jsx("div",{className:Ks.overlay,children:Be.jsxs("form",{onSubmit:d,className:Ks.form,ref:p,children:[Be.jsx("h2",{className:Ks.header,children:"Custom hls.js Options"}),Be.jsxs("div",{className:Ks["input-container"],children:[Be.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:`${Ks.input} ${o?Ks["input--invalid"]:""}`}),Be.jsxs("div",{className:Ks["player-info"],children:[Be.jsx("a",{tabIndex:0,href:"https://github.com/video-dev/hls.js/blob/master/docs/API.md",rel:"noreferrer",target:"_blank",className:Ks["api-link"],children:"API Docs"}),Be.jsxs("div",{className:Ks["player-version"],children:["hls.js ",r.HLS.version]})]})]}),Be.jsxs("div",{className:Ks.actions,children:[Be.jsx("button",{type:"button","aria-label":"Cancel",onClick:()=>e(),className:Ks.cancel,children:"Cancel"}),Be.jsx("button",{type:"submit","aria-label":"Submit",disabled:!!o,className:Ks.submit,children:s?Be.jsx(Tg,{light:!0}):"Submit"})]})]})})})},$te=({player:r})=>{const[e,t]=Ft.useState(void 0),{posterImage:a}=r.controls.GetContentInfo()||{};return Ft.useEffect(()=>{t(void 0),a&&w8({player:r,pathOrUrl:a,width:200}).then(s=>t(s))},[a]),e?Be.jsx("img",{alt:"Video Poster",src:e,className:Ts.poster}):null};let Gte;const Wte=({target:r,parameters:e,InitCallback:t,ErrorCallback:a,Unmount:s,Reset:u,SetAdditionalParameters:o})=>{const[c,p]=Ft.useState(void 0),[d,y]=Ft.useState(void 0),[b,g]=Ft.useState("lg"),[v,S]=Ft.useState("landscape"),[A,C]=Ft.useState({width:r.getBoundingClientRect().width,height:r.getBoundingClientRect().height}),[M,k]=Ft.useState(void 0),[T,R]=Ft.useState(!1),[N,K]=Ft.useState(!1),[X,ie]=Ft.useState(!1),[ge,pe]=Ft.useState(!1),[te,se]=Ft.useState(!1),[x,_]=Ft.useState(!0),[P,j]=Ft.useState(void 0),[q,z]=Ft.useState(void 0),[ee,G]=Ft.useState(!1),D=Ft.useRef(),L=!!c,J=({action:H,text:Ce})=>j({action:H,text:Ce,key:Math.random()});if(Ft.useEffect(()=>{pe(!0);const H=Tee({target:r,setSize:g,setOrientation:S,setDimensions:C});return()=>{pe(!1),H&&H()}},[]),Ft.useEffect(()=>{if(!(!D||!D.current||!ge))try{R(!1),K(!1),e.clientOptions.client=d||e.clientOptions.client;const H=new Kw({target:r,video:D.current,parameters:e,SetErrorMessage:k,Reload:u,UpdateParameters:be=>{o(be)}});window.__elvPlayer=H;const Ce=H.controls.RegisterSettingsListener(()=>{z(H.controls.AllowRotation()),K(H.playbackStarted),R(!H.loading),se(H.__showPlayerProfileForm),G(H&&H.casting)});H.Destroy=()=>{H.__DestroyPlayer(),s()},H.Reset=()=>{u()};const Ie=Ree({player:H}),Se=Oee({player:H,inactivityPeriod:5e3,onWake:()=>_(!0),onSleep:()=>_(!1)}),Me=Lee({player:H,setRecentUserAction:J}),oe=Nee({player:H});t(H),p(H);const ce=H.controls.RegisterVideoEventListener("canplay",()=>ie(!0));return()=>{D&&D.current&&D.current.removeEventListener("play",K),Ce&&Ce(),Ie&&Ie(),Se&&Se(),Me&&Me(),oe&&oe(),ce&&ce(),H&&H.__DestroyPlayer()}}catch(H){a(H),s()}},[D,ge,d]),Ft.useEffect(()=>{if(L)return()=>{c&&c.__DestroyPlayer(),p(void 0)}},[L]),Ft.useEffect(()=>{P&&(clearTimeout(Gte),setTimeout(()=>{j(void 0)},1e3))},[P]),e.clientOptions.promptTicket&&!d)return Be.jsx(Cte,{parameters:e,dimensions:{size:b,orientation:v,...A},onComplete:H=>y(H)});const ae=e.playerOptions.ui===Kt.ui.WEB&&c&&c.controls.IsRotatable()&&q;return Be.jsxs("div",{role:"complementary","aria-label":"Eluvio Video Player",tabIndex:0,style:{backgroundColor:e.playerOptions.backgroundColor||"transparent","--portal-width":`${ae?A.height:A.width}px`,"--portal-height":`${ae?A.width:A.height}px`},className:[Ts["player-container"],ae?Ts["player-container--rotated"]:"",`__eluvio-player--size-${b}`,`__eluvio-player--orientation-${v}`].join(" "),children:[!te||!T?null:Be.jsx(Vte,{player:c,Close:()=>c.controls.HidePlayerProfileForm()}),Be.jsx("video",{playsInline:!0,disablePictureInPicture:!0,ref:D,muted:[Kt.muted.ON,Kt.muted.WHEN_NOT_VISIBLE].includes(e.playerOptions.muted),controls:e.playerOptions.controls===Kt.controls.DEFAULT,loop:e.playerOptions.loop===Kt.loop.ON,crossOrigin:"anonymous",className:Ts.video}),!c||!X||N&&!e.playerOptions.permanentPoster?null:Be.jsx($te,{player:c}),T||M||!e.playerOptions.showLoader?null:Be.jsx("div",{className:Ts["spinner-container"],children:Be.jsx(Tg,{className:Ts.spinner})}),ee?Be.jsx("div",{className:Ts["cast-indicator-container"],children:Be.jsx("div",{dangerouslySetInnerHTML:{__html:tte}})}):null,M?Be.jsxs("div",{className:Ts["error-message"],children:[Be.jsx("div",{className:Ts["error-message__message"],children:M}),Be.jsxs("button",{className:Ts["error-message__copy-debug-button"],onClick:()=>A8(JSON.stringify(c.controls.GetDebugInfo(),null,2)),children:[Be.jsx(cl,{icon:nte,className:Ts["error-message__icon"]}),"Copy Troubleshooting Info"]})]}):null,c?e.playerOptions.ui===Kt.ui.WEB?Be.jsx(mte,{player:c,playbackStarted:!!N,canPlay:X,recentlyInteracted:x,setRecentUserAction:J,className:Ts.controls}):Be.jsx(Ite,{player:c,playbackStarted:!!N,canPlay:X,recentlyInteracted:x,setRecentUserAction:J,className:Ts.controls}):null,P?Be.jsx(ute,{action:P},`action-indicator-${P&&P.key}`):null]})},Kte=({parameters:r,...e})=>{const[t,a]=Ft.useState(Math.random()),[s,u]=Ft.useState();return Ft.createElement(Wte,{...e,SetAdditionalParameters:u,parameters:s?_8(r,s):r,key:`player-${t}`,Reset:()=>a(Math.random())})},Yte=(r,e)=>(r.innerHTML="",r.classList.add(lq.reset),r.classList.add(Ts["player-target"]),e=YI(e),e.playerOptions&&e.playerOptions.backgroundColor&&(r.style.backgroundColor=e.playerOptions.backgroundColor),new Promise((t,a)=>{const s=_q.createRoot(r);s.render(Be.jsx(oq.StrictMode,{children:Be.jsx(Kte,{target:r,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=Yte;exports.PlayerParameters=Kt;exports.commonjsGlobal=vu;exports.crypto=mL;exports.getDefaultExportFromCjs=gc;exports.require$$3=e_;exports.requireBuffer=Og;exports.requireEvents=jg;exports.requireInherits_browser=rN;exports.requireString_decoder=NP;
|
|
379
|
+
${S.length}${S}`,"utf-8")),await this.client.authClient.Sign(S);if(this.UserInfo().walletName.toLowerCase()==="metamask")return this.SignMetamask({message:S,address:this.UserAddress()});throw Error("ElvWalletClient: Unable to sign")}else if(!d)throw Error("ElvWalletClient: Unable to sign");const A={action:"personal-sign",message:S,logIn:!0};let C=new URL(this.appUrl);if(C.hash=o("/action","sign",c.B58(JSON.stringify(A))),C.searchParams.set("origin",window.location.origin),!y&&window.location.origin===C.origin)throw Error("ElvWalletClient: Unable to sign");return await new Promise(async(M,k)=>{await s({mode:"tab",url:C.toString(),onCancel:()=>k("User cancelled sign"),onMessage:async(T,R)=>{if(!(!T||!T.data||T.data.type!=="FlowResponse"))try{M(T.data.response)}catch(N){k(N)}finally{R()}}})})}async LogInURL({mode:S="login",provider:A,marketplaceParams:C,clearLogin:M}){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),A&&k.searchParams.set("provider",A),S&&k.searchParams.set("mode",S),C?k.searchParams.set("mid",(await this.MarketplaceInfo({marketplaceParams:C})).marketplaceHash):(this.selectedMarketplaceInfo||{}).marketplaceHash&&k.searchParams.set("mid",this.selectedMarketplaceInfo.marketplaceHash),M&&k.searchParams.set("clear",""),k}async LogIn({method:S="redirect",provider:A,mode:C="login",callbackUrl:M,marketplaceParams:k,clearLogin:T=!1,callback:R}){let N=await this.LogInURL({mode:C,provider:A,marketplaceParams:k,clearLogin:T});S==="redirect"?(N.searchParams.set("response","redirect"),N.searchParams.set("source","origin"),N.searchParams.set("redirect",M),window.location=N):(N.searchParams.set("response","message"),N.searchParams.set("source","parent"),await new Promise(async(K,X)=>{await s({mode:"tab",url:N.toString(),onCancel:()=>X("User cancelled login"),onMessage:async(ie,ge)=>{if(!(!ie||!ie.data||ie.data.type!=="LoginResponse"))try{R?await R(ie.data.params):await this.Authenticate({token:ie.data.params.clientSigningToken||ie.data.params.clientAuthToken}),K()}catch(pe){X(pe)}finally{ge()}}})}))}async LogOut(){if(this.__authorization&&this.__authorization.nonce)try{await this.client.signer.ReleaseCSAT({accessToken:this.AuthToken()})}catch(S){this.Log("Failed to release token",!0,S)}if(this.__authorization={},this.loggedIn=!1,this.cachedMarketplaces={},b)try{localStorage.removeItem(`__elv-token-${this.network}`)}catch{}}async TokenStatus(){return!this.__authorization||!this.__authorization.nonce?!0:await this.client.signer.CSATStatus({accessToken:this.AuthToken()})}async Authenticate({token:S}){let A;try{A=JSON.parse(this.utils.FromB58ToStr(S))||{}}catch{throw new Error("Invalid authorization token "+S)}if(!A.expiresAt||Date.now()>A.expiresAt)throw Error("ElvWalletClient: Provided authorization token has expired");return A.clusterToken&&await this.client.SetRemoteSigner({authToken:A.clusterToken,signerURIs:A.signerURIs}),this.client.SetStaticToken({token:A.fabricToken}),this.SetAuthorization({...A})}async AuthenticateOAuth({idToken:S,tenantId:A,email:C,signerURIs:M,shareEmail:k=!1,extraData:T={},nonce:R,createRemoteToken:N=!0,force:K=!1,tokenDuration:X=24}){!A&&this.selectedMarketplaceInfo&&(await this.AvailableMarketplaces(),A=this.selectedMarketplaceInfo.tenantId),await this.client.SetRemoteSigner({idToken:S,tenantId:A,signerURIs:M,extraData:{...T,share_email:k},unsignedPublicAuth:!0});let ie,ge;if(N&&this.client.signer.remoteSigner){ge=Date.now()+X*60*60*1e3;const te=await this.client.signer.RetrieveCSAT({email:C,nonce:R,tenantId:A,force:K,duration:X});ie=te.token,R=te.nonce}else ge=Date.now()+X*60*60*1e3,ie=await this.client.CreateFabricToken({duration:parseInt(X*60*60*1e3),context:C?{usr:{email:C}}:{}});const pe=this.client.utils.FormatAddress(this.client.CurrentAccountAddress());if(!C)try{C=JSON.parse(this.utils.FromB64URL(S.split(".")[1])).email}catch{throw Error("Failed to decode ID token")}return this.client.SetStaticToken({token:ie}),{authToken:this.SetAuthorization({fabricToken:ie,tenantId:A,address:pe,email:C,expiresAt:ge,signerURIs:M,walletType:"Custodial",walletName:"Eluvio",register:!0,nonce:R}),signingToken:this.SetAuthorization({clusterToken:this.client.signer.authToken,fabricToken:ie,tenantId:A,address:pe,email:C,expiresAt:ge,signerURIs:M,walletType:"Custodial",walletName:"Eluvio",nonce:R})}}async AuthenticateExternalWallet({address:S,tokenDuration:A=24,walletName:C="Metamask",Sign:M}){S||(S=window.ethereum.selectedAddress),S=this.utils.FormatAddress(S),M||(M=async R=>this.SignMetamask({message:R,address:S}));const k=Date.now()+A*60*60*1e3,T=await this.client.CreateFabricToken({address:S,duration:A*60*60*1e3,Sign:M,addEthereumPrefix:!1});return this.SetAuthorization({fabricToken:T,address:S,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:S,fabricToken:A,tenantId:C,address:M,email:k,expiresAt:T,signerURIs:R,walletType:N,walletName:K,nonce:X,register:ie=!1}){M=this.client.utils.FormatAddress(M),this.__authorization={fabricToken:A,tenantId:C,address:M,email:k,expiresAt:T,walletType:N,walletName:K,nonce:X},S&&(this.__authorization.clusterToken=S,R&&(this.__authorization.signerURIs=R)),this.loggedIn=!0,this.cachedMarketplaces={};const ge=this.ClientAuthToken();if(this.storeAuthToken&&b)try{localStorage.setItem(`__elv-token-${this.network}`,ge)}catch{}return ie&&this.client.authClient.MakeAuthServiceRequest({path:"/as/wlt/register",method:"POST",headers:{Authorization:`Bearer ${this.AuthToken()}`}}).catch(pe=>{this.Log("Failed to register account: ",!0,pe)}),ge}async SignMetamask({message:S,address:A}){if(!d||!window.ethereum)throw Error("ElvWalletClient: Unable to initialize - Metamask not available");A=A||this.UserAddress();const C=await window.ethereum.request({method:"eth_requestAccounts"});if(A&&!c.EqualAddress(C[0],A))throw Error(`ElvWalletClient: Incorrect MetaMask account selected. Expected ${A}, got ${C[0]}`);return await window.ethereum.request({method:"personal_sign",params:[S,A,""]})}FlowURL({type:S="flow",flow:A,marketplaceId:C,parameters:M={}}){const k=new URL(this.appUrl);return C?k.pathname=o("/",S,A,"marketplace",C,c.B58(JSON.stringify(M))):k.pathname=o("/",S,A,c.B58(JSON.stringify(M))),k.searchParams.set("origin",window.location.origin),k.toString()}async GenerateCodeAuth({url:S}={}){S||(S=await this.LogInURL({mode:"login"}),S.searchParams.set("response","code"),S.searchParams.set("source","code"));const A=await c.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:o("as","wlt","login","redirect","metamask"),method:"POST",body:{op:"create",dest:S.toString()}}));return A.code=A.id,A.url=A.url.startsWith("https://")?A.url:`https://${A.url}`,A.metamask_url=A.metamask_url.startsWith("https://")?A.metamask_url:`https://${A.metamask_url}`,A}async SetCodeAuth({code:S,address:A,type:C,authToken:M,expiresAt:k,...T}){await c.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:o("as","wlt","login","session",S),method:"POST",headers:{Authorization:`Bearer ${this.AuthToken()}`},body:{op:"set",id:S,format:"auth_token",payload:JSON.stringify({addr:c.FormatAddress(A),eth:A?`ikms${c.AddressToHash(A)}`:"",type:C,token:M,expiresAt:k,...T})}}))}async GetCodeAuth({code:S,passcode:A}){try{return await c.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:o("as","wlt","login","redirect","metamask",S,A),method:"GET"}))}catch(C){if(C&&C.status===404)return;throw C}}async TopLevelInfo(S=!1){return(!this.topLevelInfoPromise||S)&&(this.topLevelInfoPromise=this.client.utils.ResponseToJson(this.client.MakeAuthServiceRequest({path:"/as/mw/toplevel",queryParams:{env:this.mode}}))),await this.topLevelInfoPromise}async LoadAvailableMarketplaces(S=!1){(!this.availableMarketplacesPromise||S)&&(this.availableMarketplacesPromise=new Promise(async A=>{const M=(await this.TopLevelInfo()).marketplaces;let k={...this.availableMarketplaces||{}},T={...this.availableMarketplacesById||{}};M.map(R=>{const N=c.DecodeVersionHash(R.source_hash).objectId,K=R.slug||R.name;k[R.tenant_slug]=k[R.tenant_slug]||{},k[R.tenant_slug][K]={...R,tenantName:R.tenant_slug,tenantSlug:R.tenant_slug,tenantId:R.tenant_id,marketplaceSlug:K,marketplaceId:N,marketplaceHash:R.source_hash},T[N]=k[R.tenant_slug][K],this.marketplaceHashes[N]=R.source_hash}),this.availableMarketplaces=k,this.availableMarketplacesById=T,A()})),await this.availableMarketplacesPromise}async LatestMarketplaceHash({marketplaceParams:S}){const A=await this.MarketplaceInfo({marketplaceParams:S});if(this.previewMarketplaceId&&c.EqualHash(this.previewMarketplaceId,A.marketplaceId))return this.previewMarketplaceHash;const C=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:o("/public","asset_metadata","tenants",A.tenantSlug,"marketplaces",A.marketplaceSlug),resolveLinks:!1,noAuth:!0});return t(C)}async LoadMarketplace(S){await this.LoadAvailableMarketplaces();const A=this.MarketplaceInfo({marketplaceParams:S}),C=A.marketplaceId,M=await this.LatestMarketplaceHash({marketplaceParams:S});if(this.cachedMarketplaces[C]&&this.cachedMarketplaces[C].versionHash!==M&&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",A.tenantSlug,"marketplaces",A.marketplaceSlug,"info"),localizationSubtree:this.localization?o("/public","asset_metadata","tenants",A.tenantSlug,"marketplaces",A.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",A.tenantSlug,"info","branding"),authorizationToken:this.publicStaticToken,produceLinkUrls:!0})||{}),k.items=await Promise.all(k.items.map(async(T,R)=>{if(T.requires_permissions){let N;this.loggedIn||(N=await this.client.CreateFabricToken({}));try{await this.client.ContentObjectMetadata({versionHash:t(T.nft_template),metadataSubtree:"permissioned",authorizationToken:N}),T.authorized=!0}catch{T.authorized=!1}}return T.nftTemplateMetadata=(T.nft_template||{}).nft||{},T.nftTemplateHash=((T.nft_template||{})["."]||{}).source,T.itemIndex=R,T})),k.collections=(k.collections||[]).map((T,R)=>({...T,collectionIndex:R})),k.retrievedAt=Date.now(),k.marketplaceId=C,k.versionHash=M,k.marketplaceHash=M,this.previewMarketplaceId&&C===this.previewMarketplaceId&&(k.branding.preview=!0),["purchase_animation","purchase_animation_mobile","reveal_animation","reveal_animation_mobile"].forEach(T=>{try{if(k.storefront[T]){let R=new URL("https://embed.v3.contentfabric.io");const N=t(k.storefront[T]);R.searchParams.set("p",""),R.searchParams.set("net",this.network==="main"?"main":"demo"),R.searchParams.set("ath",(this.__authorization||{}).authToken||this.publicStaticToken),R.searchParams.set("vid",N),R.searchParams.set("ap",""),T.startsWith("reveal")||(R.searchParams.set("m",""),R.searchParams.set("lp","")),k.storefront[`${T}_embed_url`]=R.toString()}}catch{}}),this.cachedMarketplaces[C]=k}return this.cachedMarketplaces[C]}async FilteredQuery({mode:S="listings",sortBy:A="created",sortDesc:C=!1,filter:M,editionFilters:k,attributeFilters:T,contractAddress:R,tokenId:N,currency:K,marketplaceParams:X,tenantId:ie,collectionIndexes:ge,priceRange:pe,tokenIdRange:te,capLimit:se,userAddress:x,sellerAddress:_,lastNDays:P=-1,startTime:j,endTime:q,includeCheckoutLocked:z=!1,start:ee=0,limit:G=50}={}){ge=(ge||[]).map(ae=>parseInt(ae));let D={start:ee,limit:G,sort_descending:C};S==="owned"&&A==="created"&&(A="default"),S!=="leaderboard"&&(D.sort_by=A),S.includes("listings")&&z&&(D.checkout=!0);let L,J;X&&(L=await this.MarketplaceInfo({marketplaceParams:X}),ge.length>0&&(J=await this.Marketplace({marketplaceParams:X})));try{let ae=[];_?ae.push(`seller:eq:${this.client.utils.FormatAddress(_)}`):x&&S!=="owned"&&ae.push(`addr:eq:${this.client.utils.FormatAddress(x)}`),J&&ge.length>=0?ge.forEach(oe=>{J.collections[oe].items.forEach(be=>{if(!be)return;const me=J.items.find(xe=>xe.sku===be);if(!me)return;const de=c.SafeTraverse(me,"nft_template","nft","address");de&&ae.push(`${S==="owned"?"contract_addr":"contract"}:eq:${c.FormatAddress(de)}`)})}):(L||ie)&&ae.push(`tenant:eq:${L?L.tenantId:ie}`),R?(S==="owned"?ae.push(`contract_addr:eq:${c.FormatAddress(R)}`):ae.push(`contract:eq:${c.FormatAddress(R)}`),N&&ae.push(`token:eq:${N}`)):M&&(S.includes("listing")?ae.push(`nft/display_name:eq:${M}`):S==="owned"?ae.push(`meta/display_name:eq:${M}`):ae.push(`name:eq:${M}`)),k&&k.forEach(oe=>{S.includes("listing")?ae.push(`nft/edition_name:eq:${oe}`):S==="owned"?(ae.push(`meta:@>:{"edition_name":"${oe}"}`),D.exact=!1):ae.push(`edition:eq:${oe}`)}),T&&T.map(({name:oe,value:ce})=>{!oe||!ce||ae.push(`nft/attributes/${oe}:eq:${ce}`)}),K&&ae.push("link_type:eq:sol"),j||q?(j&&ae.push(`created:gt:${parseInt(j)/1e3}`),q&&ae.push(`created:lt:${parseInt(q)/1e3}`)):P&&P>0&&ae.push(`created:gt:${(Date.now()/1e3-P*24*60*60).toFixed(0)}`),pe&&(pe.min&&ae.push(`price:ge:${parseFloat(pe.min)}`),pe.max&&ae.push(`price:le:${parseFloat(pe.max)}`)),te&&(te.min&&ae.push(`info/token_id:ge:${parseInt(te.min)}`),te.max&&ae.push(`info/token_id:le:${parseInt(te.max)}`)),se&&ae.push(`info/cap:le:${parseInt(se)}`);let H,Ce;switch(S){case"owned":Ce=o("as","wlt",x||this.UserAddress());break;case"owned-full-meta":Ce=o("as","apigw","nfts"),H={Authorization:`Bearer ${this.AuthToken()}`};break;case"listings":Ce=o("as","mkt","f");break;case"transfers":Ce=o("as","mkt","hst","f"),ae.push("action:eq:TRANSFERRED"),ae.push("action:eq:SOLD");break;case"sales":Ce=o("as","mkt","hst","f"),ae.push("action:eq:SOLD"),ae.push("seller:co:0x");break;case"listing-stats":Ce=o("as","mkt","stats","listed");break;case"sales-stats":Ce=o("as","mkt","stats","sold"),ae.push("seller:co:0x");break;case"leaderboard":Ce=o("as","wlt","leaders");break}if(ae.length>0&&(D.filter=ae),S.includes("stats"))return await c.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:Ce,method:"GET",queryParams:D,headers:H}));const{contents:Ie,paging:Se}=await c.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:Ce,method:"GET",queryParams:D,headers:H}))||[],Me=["owned","listings","owned-full-meta"];return{paging:{start:D.start,limit:D.limit,total:Se.total,more:Se.total>ee+G},results:(Ie||[]).map(oe=>Me.includes(S)?a(this,oe):oe)}}catch(ae){if(ae.status&&ae.status.toString()==="404")return{paging:{start:D.start,limit:D.limit,total:0,more:!1},results:[]};throw ae}}async MintingStatus({marketplaceParams:S,tenantId:A}){A||(A=(await this.MarketplaceInfo({marketplaceParams:S||this.selectedMarketplaceInfo})).tenantId);try{return(await c.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:o("as","wlt","status","act",A),method:"GET",headers:{Authorization:`Bearer ${this.AuthToken()}`}}))).map(M=>{let[k,T,R]=M.op.split(":");T=T.startsWith("0x")?c.FormatAddress(T):T;let N,K,X,ie;if(k==="nft-buy"?N=R:k==="nft-claim"?(N=R,M.marketplaceId=T,M.extra&&M.extra[0]&&(T=M.extra.token_addr,K=M.extra.token_id_str)):k==="nft-redeem"?N=M.op.split(":").slice(-1)[0]:K=R,k==="nft-transfer"&&(N=M.extra&&M.extra.trans_id,K=M.extra&&M.extra.token_id_str||K,M.extra&&M.extra.gift_action==="nft-gift-claim"&&(ie=M.extra.gift_id)),k==="nft-offer-redeem"&&(X=M.op.split(":")[3]),k==="nft-claim-entitlement"){let[ge,pe,te,se]=M.op.split(":");N=se,M.extra&&M.extra[0]&&(T=M.extra[0].token_addr,K=M.extra[0].token_id,T=T.startsWith("0x")?c.FormatAddress(T):T,M.marketplaceId=pe)}return{...M,timestamp:new Date(M.ts),state:M.state&&typeof M.state=="object"?Object.values(M.state):M.state,extra:M.extra&&typeof M.extra=="object"?Object.values(M.extra):M.extra,confirmationId:N,op:k,address:c.FormatAddress(T),tokenId:K,offerId:X,giftId:ie}}).sort((M,k)=>M.ts<k.ts?1:-1)}catch(C){return this.Log("Failed to retrieve minting status",!0,C),[]}}async DeployTenant({tenantId:S,tenantSlug:A="",tenantHash:C,environment:M="production"}){if(!C){const R=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:o("public/asset_metadata/tenants",A),resolveLinks:!0,linkDepthLimit:1,resolveIncludeSource:!0,resolveIgnoreErrors:!0,select:["."]});if(!R)throw Error(`Eluvio Wallet Client: Invalid or missing tenancy: ${A}`);const N=R["."].source;C=await this.client.LatestVersionHash({versionHash:N})}const k={content_hash:C,env:M,ts:Date.now()},T=await this.client.Sign(JSON.stringify(k));await this.client.authClient.MakeAuthServiceRequest({path:o("as","tnt","config",S,"metadata"),method:"POST",body:k,headers:{Authorization:`Bearer ${T}`}})}async PurgeUrl({tenantId:S,url:A}){const C={url:A},M=await this.client.CreateFabricToken({});await this.client.authClient.MakeAuthServiceRequest({path:o("as","tnt",S,"purge"),method:"POST",body:C,headers:{Authorization:`Bearer ${M}`}})}}return Object.assign(g.prototype,tee()),Object.assign(g.prototype,nee()),Object.assign(g.prototype,ree()),WE.ElvWalletClient=g,WE}var rL;function iee(){if(rL)return Gm;rL=1;const{ElvClient:r}=VI(),{ElvWalletClient:e}=aee(),t=gi();return Gm.ElvClient=r,Gm.ElvWalletClient=e,Gm.Utils=t,Gm}var Mf=iee();const GI=eq({__proto__:null},[Mf]),aL={default:{label:"Default",hlsSettings:Mf.Utils.HLSJSSettings({profile:"default"})},low_latency:{label:"Low Latency Live",hlsSettings:Mf.Utils.HLSJSSettings({profile:"ll"})},ultra_low_latency:{label:"Ultra Low Latency Live",hlsSettings:Mf.Utils.HLSJSSettings({profile:"ull"})},custom:{label:"Custom",hlsSettings:{}}};class see{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}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.getBitrateInfoListFor("video").map(t=>({index:t.qualityIndex,active:t.qualityIndex===this.player.dashPlayer.getQualityFor("video"),resolution:`${t.width}x${t.height}`,bitrate:t.bitrate,label:`${t.width}x${t.height} (${(t.bitrate/1e3/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.setQualityFor("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(aL).map(t=>({index:t,label:aL[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}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()}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"},WI=({player:r,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?(r.controls.Seek({relativeSeconds:-10}),e({action:Un.SEEK_BACK,text:"10 seconds"})):y>=1-t?(r.controls.Seek({relativeSeconds:10}),e({action:Un.SEEK_FORWARD,text:"10 seconds"})):r.controls.ToggleFullscreen()}else u=setTimeout(()=>{const d=r.controls.TogglePlay();e({action:d?Un.PLAY:Un.PAUSE})},a);o=p.target,s=Date.now()}},KI=(r,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(),r.controls.Seek({relativeSeconds:-s}),e({action:Un.SEEK_BACK,text:`${s} seconds`});break;case"ArrowRight":a.preventDefault(),r.controls.Seek({relativeSeconds:s}),e({action:Un.SEEK_FORWARD,text:`${s} seconds`});break;default:return}t+=1}},oee=r=>e=>{switch(e.key){case"ArrowLeft":e.preventDefault(),r.controls.SetVolume({relativeFraction:-.05});break;case"ArrowRight":e.preventDefault(),r.controls.IsMuted()?r.controls.SetVolume({fraction:.05}):r.controls.SetVolume({relativeFraction:.05});break}},Ww=(r,e)=>{if(isNaN(e)||!isFinite(e)||e===0)return"00:00";const t=r>3600,a=Math.floor(r/60/60),s=Math.floor(r/60%60),u=Math.floor(r%60);let o=`${s.toString().padStart(t?2:1,"0")}:${u.toString().padStart(2,"0")}`;return t&&(o=`${a.toString()}:${o}`),o},w8=async({player:r,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 r.__Client();let s;const{mediaCatalogObjectId:u,mediaCatalogVersionHash:o}=r.sourceOptions&&r.sourceOptions.mediaCollectionOptions||{},c=r.sourceOptions&&r.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})):""},_8=(r,e={},t=1)=>{if(t>10)return{};let a={};return Object.keys(r).forEach(s=>{if(s==="client")a.client=e.client||r.client;else if(typeof r[s]=="object"&&!Array.isArray(r[s]))a[s]=_8(r[s],(e||{})[s],t+1);else{const u=(e||{})[s];a[s]=typeof u<"u"?u:r[s]}}),a},YI=r=>_8(tq,r),uee=/iPhone|iPad|iPod/i.test(navigator.userAgent),iL=window.__chromecastAvailable||!!(window.chrome&&window.chrome.cast),lee={default:{label:"Default",hlsSettings:Mf.Utils.HLSJSSettings({profile:"default"})},low_latency:{label:"Low Latency Live",hlsSettings:Mf.Utils.HLSJSSettings({profile:"ll"})},ultra_low_latency:{label:"Ultra Low Latency Live",hlsSettings:Mf.Utils.HLSJSSettings({profile:"ull"})},custom:{label:"Custom",hlsSettings:{}}};class Kw{__RegisterVideoEventListener(e,t){this.video.addEventListener(e,t),this.__listenerDisposers.push(()=>this.video.removeEventListener(e,t))}__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 see({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=iL&&a.playerOptions.allowCasting,this.casting=!1,this.usePlayerControls=[Kt.controls.ON,Kt.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=Kt.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(()=>GI);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(Mf.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 v=this.collectionInfo.content[this.collectionInfo.mediaIndex];t.objectId=e.utils.DecodeVersionHash(v.mediaHash).objectId,t.versionHash=v.mediaHash,this.sourceOptions.playoutOptions=void 0}let a,s,u={ignore_trimming:t.ignoreTrimming,resolve:t.resolve,...t.options||{}};if((t.clipStart||t.clipEnd)&&(u.clip_start=parseFloat(t.clipStart||0),t.clipEnd&&(u.clip_end=parseFloat(t.clipEnd))),!t.channel){let v=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=v.default?"default":Object.keys(v)[0],t.offering?a=v[t.offering]?t.offering:void 0:(t.offerings||[]).length>0?a=t.offerings.find(A=>v[A]):t.offerings&&t.offerings.length>0&&(a=t.offerings.find(A=>v[A])),!a)throw new Error(`Unable to find offering from '${t.offering||t.offerings}'`);const S=v[a]&&v[a].properties||{};s=v[a].uri,this.sourceOptions.contentInfo.liveDVR===Kt.liveDVR.ON&&S.dvr_available?(u.dvr=1,this.dvrAvailable=!0):this.dvrAvailable=!1,this.isLive=S.live}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 o=(await e.AvailableDRMs()).filter(v=>(this.sourceOptions.drms||[]).includes(v)),c=this.sourceOptions.protocols,p,d;for(;!(p&&d);){p=c.find(S=>this.sourceOptions.playoutOptions[S]);const v=Object.keys(this.sourceOptions.playoutOptions[p].playoutMethods);if(d=(this.sourceOptions.drms||[]).length===0?v.find(S=>S!=="clear")||v[0]:this.sourceOptions.drms.sort().reverse().find(S=>o.includes(S)&&this.sourceOptions.playoutOptions[p].playoutMethods[S]),!d&&(c=c.filter(S=>S!==p),c.length===0))throw Error("No valid protocol / DRM combination available")}const{playoutUrl:y,drms:b}=this.sourceOptions.playoutOptions[p].playoutMethods[d],g=y.split("/").find(v=>v.startsWith("hq__"));return{playoutParameters:{...t,options:u},protocol:p,drm:d,playoutUrl:y,versionHash:g,drms:b,availableDRMs:o,offeringURI:s,offering:a,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=YI(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=Kt.autoplay.ON),t.currentTime&&this.__RegisterVideoEventListener("loadedmetadata",()=>this.video.currentTime=t.currentTime)),this.usePlayerControls&&this.playerOptions.allowCasting&&(this.castHandler=new Oq({player:this,onReady:()=>{this.chromecastAvailable=!0,this.__SettingsUpdate()},onUpdate:()=>{this.__SettingsUpdate()}})),this.__RegisterVideoEventListener("webkitplaybacktargetavailabilitychanged",b=>{this.airplayAvailable=b.availability==="available",this.__SettingsUpdate()}),this.__RegisterVideoEventListener("play",()=>{this.reloads=0,this.playbackStarted=!0,this.__SettingsUpdate()}),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===Kt.autoplay.ON&&this.controls.Play())}),this.__RegisterVideoEventListener("seeking",()=>{if(!this.isLive||!this.dvrAvailable)return;const b=this.video.duration-this.video.currentTime;this.behindLiveEdge=b>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{versionHash:a,playoutUrl:s,protocol:u,drm:o,drms:c,multiviewOptions:p,playoutParameters:d}=await this.__PlayoutOptions();this.contentHash=a,s=new URL(s);const y=this.sourceOptions.playoutParameters.authorizationToken||s.searchParams.get("authorization");if(this.authorizationToken=y,this.playoutUrl=s.toString(),this.castHandler&&this.castHandler.SetMedia({playoutOptions:this.sourceOptions.playoutOptions,playoutParameters:d}),this.__destroyed)return;u==="hls"?await this.__InitializeHLS({playoutUrl:s,authorizationToken:y,drm:o,drms:c,multiviewOptions:p}):await this.__InitializeDash({playoutUrl:s,authorizationToken:y,drm:o,drms:c,multiviewOptions:p}),this.playerOptions.collectVideoAnalytics&&Promise.resolve().then(()=>require("./Analytics-BX8nHI9d.js")).then(({InitializeMuxMonitoring:b})=>b({appName:this.playerOptions.appName||"elv-player-js",elvPlayer:this,playoutUrl:s,authorizationToken:y,disableCookies:this.playerOptions.collectVideoAnalytics===Kt.collectVideoAnalytics.DISABLE_COOKIES})),this.playerOptions.verifyContent&&setTimeout(()=>{this.__VerifyContent()},1e3),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}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-BSI-ecIH.js"))).default;const o=this.video.canPlayType("application/vnd.apple.mpegURL");if(o&&uee&&this.playerOptions.preferNativeHLS||[Kt.drms.FAIRPLAY,Kt.drms.SAMPLE_AES].includes(a)||!this.HLS.isSupported()){if(this.nativeHLS=!0,a===Kt.drms.FAIRPLAY?Rq({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===Kt.drms.PLAYREADY||a===Kt.drms.WIDEVINE)&&(c={drmSystems:{},emeEnabled:!0,licenseXhrSetup:(b,g)=>{b.open("POST",g,!0),b.setRequestHeader("Authorization",`Bearer ${t}`)}},a===Kt.drms.PLAYREADY?c.drmSystems={"com.microsoft.playready":{licenseUrl:s[a].licenseServers[0]}}:a===Kt.drms.WIDEVINE&&(c.drmSystems={"com.widevine.alpha":{licenseUrl:s[a].licenseServers[0]}}));let p=(lee[this.playerOptions.playerProfile]||{}).hlsSettings||{};const d=this.playerOptions.playerProfile===Kt.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:b=>(b.setRequestHeader("Authorization",`Bearer ${t}`),(this.playerOptions.hlsjsOptions||{}).xhrSetup&&this.playerOptions.hlsjsOptions.xhrSetup(b),b),...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,(b,{levels:g,firstLevel:v})=>{let S=g.map((A,C)=>A.bitrate>this.playerOptions.maxBitrate?C:void 0).filter(A=>typeof A<"u").reverse();S.length===g.length&&(this.Log(`Warning: Max bitrate '${this.playerOptions.maxBitrate}bps' is less than all available levels for this content.`),S=S.filter(A=>A>0)),this.Log("Removing the following levels due to maxBitrate setting:"),this.Log(S.map(A=>[g[A].width,"x",g[A].height,` (${(g[A].bitrate/1e3/1e3).toFixed(1)}Mbps)`].join("")).join(", ")),S.find(A=>v===A)&&(y.startLevel=g.map((A,C)=>C).filter(A=>!S.includes(A)).reverse()[0]),S.map(A=>y.removeLevel(A))}),y.loadSource(e.toString()),y.attachMedia(this.video),this.controls&&u.enabled){const b=u.SwitchView;u.SwitchView=async g=>{await b(g),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(b=>y.on(b,()=>this.__SettingsUpdate())),typeof this.sourceOptions.playoutParameters.audioTrackLabel<"u"&&y.on(this.HLS.Events.AUDIO_TRACKS_UPDATED,()=>{const b=(this.controls.GetAudioTracks().options||[]).find(g=>g.label===this.sourceOptions.playoutParameters.audioTrackLabel);b&&this.controls.SetAudioTrack(b.index)}),this.SetPlayerProfile=async({profile:b,customHLSOptions:g={}})=>{if(this.playoutUrl&&this.playoutUrl.includes("hls-widevine")){this.__UpdateParameters({playerOptions:{playerProfile:b,hlsjsOptions:g}}),this.__ReloadComponent();return}this.videoDuration=void 0,this.playerOptions.playerProfile=b,this.customHLSOptions=g;const v=!this.video.paused,S=this.video.currentTime;try{this.hlsPlayer.destroy()}catch(A){this.Log("Failed to destroy HLS player",!0),this.Log(A,!0)}await this.__InitializeHLS({playoutUrl:e,authorizationToken:t,drm:a,drms:s,multiviewOptions:u}),v?this.video.play():this.video.pause(),this.isLive||(this.video.currentTime=S)},y.on(this.HLS.Events.FRAG_LOADED,()=>{this.errors=0,clearTimeout(this.stallTimeout)}),y.on(this.HLS.Events.ERROR,async(b,g)=>{if(this.errors+=1,this.Log(`Encountered ${g.details}`,!0),this.Log(g,!0),g.response&&g.response.code===403)this.SetErrorMessage("Insufficient permissions",g);else if(this.errors<5){if(g.fatal)g.data&&g.data.type===this.HLS.ErrorTypes.MEDIA_ERROR?(this.Log("Attempting to recover using hlsPlayer.recoverMediaError",!0),y.recoverMediaError()):this.__HardReload(g);else if(g.details==="bufferStalledError"){clearTimeout(this.stallTimeout);let v=this.video&&this.video.currentTime;this.stallTimeout=setTimeout(()=>{this.video&&this.video.currentTime>v||(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(g,0,v)},6e3))},6e3)}}else this.__HardReload(g)}),this.hlsPlayer=y,this.player=y,o){const b=document.createElement("source");b.src=this.playoutUrl.toString(),this.video.appendChild(b),this.video.disableRemotePlayback=!1}}}async __InitializeDash({playoutUrl:e,authorizationToken:t,drm:a,drms:s}){this.Dash=(await Promise.resolve().then(()=>require("./dash.all.min-vScx1y_P.js")).then(c=>c.dash_all_min)).default;const u=this.Dash.MediaPlayer().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}}}}),e.searchParams.delete("authorization"),u.extend("RequestModifier",function(){return{modifyRequestHeader:c=>(c.setRequestHeader("Authorization",`Bearer ${t}`),c),modifyRequestURL:c=>c}}),a===Kt.drms.WIDEVINE){const c=s.widevine.licenseServers[0];u.setProtectionData({"com.widevine.alpha":{serverURL:c}})}u.initialize(this.video,e.toString(),this.playerOptions.autoplay===Kt.autoplay.ON),[this.Dash.MediaPlayer.events.TRACK_CHANGE_RENDERED,this.Dash.MediaPlayer.events.QUALITY_CHANGE_RENDERED,this.Dash.MediaPlayer.events.REPRESENTATION_SWITCH,this.Dash.MediaPlayer.events.TEXT_TRACKS_ADDED,this.Dash.MediaPlayer.events.TEXT_TRACK_ADDED,this.Dash.MediaPlayer.events.MANIFEST_LOADED,this.Dash.MediaPlayer.events.CAN_PLAY].map(c=>u.on(c,()=>this.__SettingsUpdate())),typeof this.sourceOptions.playoutParameters.audioTrackLabel<"u"&&u.on(this.Dash.MediaPlayer.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(this.Log("Unable to autoplay",!0),this.Log(e,!0),this.playbackStarted=!1,this.playerOptions.muted===Kt.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.canPlay=!1,this.isLive=!1,this.behindLiveEdge=!1,this.dvrAvailable=!1,this.dvrEnabled=!1,this.publicMetadataUrl=void 0,this.airplayAvailable=!1,this.chromecastAvailable=iL&&this.playerOptions.allowCasting,this.casting=!1,this.__error=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()}}Kw.EluvioPlayerParameters=Kt;Kw.EluvioPlayer=Kw;var JI=(function(){if(typeof Map<"u")return Map;function r(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=r(this.__entries__,t),s=this.__entries__[a];return s&&s[1]},e.prototype.set=function(t,a){var s=r(this.__entries__,t);~s?this.__entries__[s][1]=a:this.__entries__.push([t,a])},e.prototype.delete=function(t){var a=this.__entries__,s=r(a,t);~s&&a.splice(s,1)},e.prototype.has=function(t){return!!~r(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})()})(),pA=typeof window<"u"&&typeof document<"u"&&window.document===document,Yw=(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")()})(),cee=(function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Yw):function(r){return setTimeout(function(){return r(Date.now())},1e3/60)}})(),fee=2;function dee(r,e){var t=!1,a=!1,s=0;function u(){t&&(t=!1,r()),a&&c()}function o(){cee(u)}function c(){var p=Date.now();if(t){if(p-s<fee)return;a=!0}else t=!0,a=!1,setTimeout(o,e);s=p}return c}var pee=20,hee=["top","right","bottom","left","width","height","size","weight"],yee=typeof MutationObserver<"u",mee=(function(){function r(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=dee(this.refresh.bind(this),pee)}return r.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},r.prototype.removeObserver=function(e){var t=this.observers_,a=t.indexOf(e);~a&&t.splice(a,1),!t.length&&this.connected_&&this.disconnect_()},r.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},r.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},r.prototype.connect_=function(){!pA||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),yee?(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)},r.prototype.disconnect_=function(){!pA||!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)},r.prototype.onTransitionEnd_=function(e){var t=e.propertyName,a=t===void 0?"":t,s=hee.some(function(u){return!!~a.indexOf(u)});s&&this.refresh()},r.getInstance=function(){return this.instance_||(this.instance_=new r),this.instance_},r.instance_=null,r})(),QI=(function(r,e){for(var t=0,a=Object.keys(e);t<a.length;t++){var s=a[t];Object.defineProperty(r,s,{value:e[s],enumerable:!1,writable:!1,configurable:!0})}return r}),O0=(function(r){var e=r&&r.ownerDocument&&r.ownerDocument.defaultView;return e||Yw}),XI=D_(0,0,0,0);function Jw(r){return parseFloat(r)||0}function sL(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.reduce(function(a,s){var u=r["border-"+s+"-width"];return a+Jw(u)},0)}function gee(r){for(var e=["top","right","bottom","left"],t={},a=0,s=e;a<s.length;a++){var u=s[a],o=r["padding-"+u];t[u]=Jw(o)}return t}function vee(r){var e=r.getBBox();return D_(0,0,e.width,e.height)}function bee(r){var e=r.clientWidth,t=r.clientHeight;if(!e&&!t)return XI;var a=O0(r).getComputedStyle(r),s=gee(a),u=s.left+s.right,o=s.top+s.bottom,c=Jw(a.width),p=Jw(a.height);if(a.boxSizing==="border-box"&&(Math.round(c+u)!==e&&(c-=sL(a,"left","right")+u),Math.round(p+o)!==t&&(p-=sL(a,"top","bottom")+o)),!_ee(r)){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 D_(s.left,s.top,c,p)}var wee=(function(){return typeof SVGGraphicsElement<"u"?function(r){return r instanceof O0(r).SVGGraphicsElement}:function(r){return r instanceof O0(r).SVGElement&&typeof r.getBBox=="function"}})();function _ee(r){return r===O0(r).document.documentElement}function xee(r){return pA?wee(r)?vee(r):bee(r):XI}function See(r){var e=r.x,t=r.y,a=r.width,s=r.height,u=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,o=Object.create(u.prototype);return QI(o,{x:e,y:t,width:a,height:s,top:t,right:e+a,bottom:s+t,left:e}),o}function D_(r,e,t,a){return{x:r,y:e,width:t,height:a}}var Cee=(function(){function r(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=D_(0,0,0,0),this.target=e}return r.prototype.isActive=function(){var e=xee(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},r.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},r})(),Eee=(function(){function r(e,t){var a=See(t);QI(this,{target:e,contentRect:a})}return r})(),Aee=(function(){function r(e,t,a){if(this.activeObservations_=[],this.observations_=new JI,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 r.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 O0(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new Cee(e)),this.controller_.addObserver(this),this.controller_.refresh())}},r.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 O0(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))}},r.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},r.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},r.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(a){return new Eee(a.target,a.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},r.prototype.clearActive=function(){this.activeObservations_.splice(0)},r.prototype.hasActive=function(){return this.activeObservations_.length>0},r})(),ZI=typeof WeakMap<"u"?new WeakMap:new JI,eD=(function(){function r(e){if(!(this instanceof r))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=mee.getInstance(),a=new Aee(e,t,this);ZI.set(this,a)}return r})();["observe","unobserve","disconnect"].forEach(function(r){eD.prototype[r]=function(){var e;return(e=ZI.get(this))[r].apply(e,arguments)}});var kee=(function(){return typeof Yw.ResizeObserver<"u"?Yw.ResizeObserver:eD})();const U_=({element:r,Hide:e})=>{if(!r)return;const t=u=>{u&&(u.key||"").toLowerCase()==="escape"&&e()},a=u=>{r.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)}},tD=({player:r,setVideoState:e})=>{const t=function(){if(!r||!r.controls)return;const u=r.video.buffered;let o=0;for(let c=0;c<u.length;c++)u.start(c)>r.controls.GetCurrentTime()||u.end(c)>o&&(o=u.end(c));e({playing:r.controls.IsPlaying(),duration:r.controls.GetDuration(),volume:r.controls.GetVolume(),muted:r.controls.IsMuted(),rate:r.controls.GetPlaybackRate(),fullscreen:!!(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)})},a=["play","pause","volumechange","seeked","durationchange","ratechange"];a.map(u=>r.video.addEventListener(u,t)),r.target.addEventListener("fullscreenchange",t);const s=r.castHandler&&r.castHandler.RegisterListener(t);return()=>{a.map(u=>r.video.removeEventListener(u,t)),r.target.removeEventListener("fullscreenchange",t),s&&s()}},Mee=({video:r,setBufferFraction:e})=>{const t=()=>{if(!isFinite(r.duration))return 1;const a=r.buffered;let s=0;for(let u=0;u<a.length;u++)a.start(u)>r.currentTime||a.end(u)>s&&(s=a.end(u));e(1-(r.duration-s)/r.duration)};return r.addEventListener("progress",t),()=>r.removeEventListener("progress",t)},x8=({player:r,rate:e=10,setCurrentTime:t})=>{const a=setInterval(()=>{r.controls&&t(r.controls.GetCurrentTime())},1e3/e);return()=>{clearInterval(a)}},Tee=({target:r,setSize:e,setOrientation:t,setDimensions:a})=>{let s;const u=()=>{clearTimeout(s);const c=r.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 kee(u);return o.observe(r),()=>o.disconnect()},Ree=({player:r})=>{const e=r.video,t=r.playerOptions.autoplay===Kt.autoplay.WHEN_VISIBLE,a=r.playerOptions.muted===Kt.muted.WHEN_NOT_VISIBLE;if(!t&&!a)return;let s,u;const o=async([p])=>{t&&(s!=="play"&&p.isIntersecting&&e.paused?(r.controls.Play(),s="play"):s!=="pause"&&!p.isIntersecting&&!e.paused&&(r.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()},Oee=({player:r,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=>r.video.addEventListener(p,u));const c=["click","dblclick","keydown","mousemove","touchmove","blur","mouseout","fullscreenchange"];return c.forEach(p=>r.target.addEventListener(p,u)),()=>{o.map(p=>r.video.removeEventListener(p,u)),c.map(p=>r.target.removeEventListener(p,u))}},Lee=({player:r,setRecentUserAction:e})=>{if(r.playerOptions.keyboardControls===Kt.keyboardControls.OFF)return;const t=r.playerOptions.keyboardControls===Kt.keyboardControls.ARROW_KEYS_DISABLED,a=KI(r,e)(),s=u=>{if(!(r.target===u.target||r.target.contains(u.target))||["button","input"].includes(document.activeElement&&document.activeElement.tagName.toLowerCase())||r.__showPlayerProfileForm)return;let o;switch(u.key){case" ":case"k":o=r.controls.TogglePlay(),e({action:o?Un.PLAY:Un.PAUSE});break;case"f":r.controls.ToggleFullscreen();break;case"m":o=r.controls.ToggleMuted(),e({action:o?Un.MUTE:Un.UNMUTE});break;case"ArrowDown":t||(o=r.controls.SetVolume({relativeFraction:-.1}),e({action:o===0?Un.MUTE:Un.VOLUME_DOWN,text:(o*100).toFixed(0)+"%"}));break;case"ArrowUp":t||(o=r.controls.SetVolume({relativeFraction:.1}),e({action:Un.VOLUME_UP,text:(o*100).toFixed(0)+"%"}));break;case",":r.video.paused&&(r.controls.Seek({relativeSeconds:-1/60}),e({action:Un.SEEK_BACK}));break;case".":r.video.paused&&(r.controls.Seek({relativeSeconds:1/60}),e({action:Un.SEEK_FORWARD}));break;case"ArrowLeft":case"ArrowRight":t||a(u);break;case"j":r.controls.Seek({relativeSeconds:-10}),e({action:Un.SEEK_BACK,text:"10 seconds"});break;case"l":r.controls.Seek({relativeSeconds:10}),e({action:Un.SEEK_FORWARD,text:"10 seconds"});break;case"<":case">":const c=r.controls.GetPlaybackRates();c.active?o=r.controls.SetPlaybackRate({index:c.active.index+(u.key==="<"?-1:1)}):o=r.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=r.controls.ToggleTextTrack(),e({action:o?Un.SUBTITLES_ON:Un.SUBTITLES_OFF});break;case"P":r.controls.CollectionPlayPrevious(),e({action:Un.PLAY_PREVIOUS});break;case"N":r.controls.CollectionPlayNext(),e({action:Un.PLAY_NEXT});break;case"Home":r.controls.Seek({fraction:0}),e({action:Un.SEEK_BACK});break;case"End":r.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=r.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)},Nee=({player:r})=>{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":r.controls.Play();break;case"pause":r.controls.Pause();break;case"stop":r.controls.Stop();break;case"seekbackward":r.controls.Seek({relativeSeconds:u&&u.seekOffset||-10});break;case"seekforward":r.controls.Seek({relativeSeconds:u&&u.seekOffset||10});break;case"seekto":u&&typeof u.seekTime<"u"&&r.controls.Seek({time:u.seekTime});break;case"previoustrack":r.controls.CollectionPlayPrevious();break;case"nexttrack":r.controls.CollectionPlayNext();break}})});let t=setInterval(()=>{navigator.mediaSession.playbackState=r.video.paused?"paused":"playing",navigator.mediaSession.setPositionState({duration:isFinite(r.video.duration)?r.video.duration||0:r.video.currentTime+1,playbackRate:r.video.playbackRate,position:r.video.currentTime})},1e3);const a=r.controls.RegisterSettingsListener(()=>{const{title:s}=r.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)})}}},Pee="_container_fm2ri_1",Iee="_autohide_fm2ri_41",Dee="_seek_fm2ri_174",Uee="_controls_fm2ri_207",Fee="_time_fm2ri_221",Bee="_spacer_fm2ri_279",zee="_watermark_fm2ri_291",Bn={container:Pee,"container--default-controls":"_container--default-controls_fm2ri_33","bottom-controls-container":"_bottom-controls-container_fm2ri_37",autohide:Iee,"info-container":"_info-container_fm2ri_44","bottom-controls-container--autohide":"_bottom-controls-container--autohide_fm2ri_45","icon-button":"_icon-button_fm2ri_51","icon-button-active":"_icon-button-active_fm2ri_65","info-image-container":"_info-image-container_fm2ri_106","info-image":"_info-image_fm2ri_106","info-text":"_info-text_fm2ri_122","info-headers":"_info-headers_fm2ri_131","info-description":"_info-description_fm2ri_141","info-title":"_info-title_fm2ri_147","info-subtitle":"_info-subtitle_fm2ri_152","center-play-button":"_center-play-button_fm2ri_160","center-play-button--hidden":"_center-play-button--hidden_fm2ri_167",seek:Dee,"bottom-controls-gradient":"_bottom-controls-gradient_fm2ri_194",controls:Uee,"play-pause-button":"_play-pause-button_fm2ri_217",time:Fee,"live-indicator":"_live-indicator_fm2ri_231","collection-button-container":"_collection-button-container_fm2ri_249","collection-button-text":"_collection-button-text_fm2ri_254","collection-button-container--loading":"_collection-button-container--loading_fm2ri_263",spacer:Bee,"floating-volume-toggle":"_floating-volume-toggle_fm2ri_283",watermark:zee,"content-verified-badge":"_content-verified-badge_fm2ri_302","content-verification-menu-button":"_content-verification-menu-button_fm2ri_303","menu-control-container":"_menu-control-container_fm2ri_317"},nD='<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>',rD='<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>',aD='<?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>',jee='<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>',iD='<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>',qee='<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>',Hee='<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>',Vee='<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>',S8='<?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>',sD='<?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>',$ee='<?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>',Qw='<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>',Gee='<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>',oL='<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>',Wee='<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>',uL='<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>',Kee='<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>',C8='<?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>',E8='<?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>',Yee='<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>',ip='<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>',Jee='<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>',Qee='<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>',Xee='<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>',Zee='<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>',Xw='<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>',lL='<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>',ete='<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>',oD='<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>',tte='<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>',nte='<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>';var hA={exports:{}},rte=hA.exports,cL;function ate(){return cL||(cL=1,(function(r,e){(function(t,a){a()})(rte,(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(N){return!!(N&&N!==document&&N.nodeName!=="HTML"&&N.nodeName!=="BODY"&&"classList"in N&&"contains"in N.classList)}function y(N){var K=N.type,X=N.tagName;return!!(X==="INPUT"&&p[K]&&!N.readOnly||X==="TEXTAREA"&&!N.readOnly||N.isContentEditable)}function b(N){N.classList.contains("focus-visible")||(N.classList.add("focus-visible"),N.setAttribute("data-focus-visible-added",""))}function g(N){N.hasAttribute("data-focus-visible-added")&&(N.classList.remove("focus-visible"),N.removeAttribute("data-focus-visible-added"))}function v(N){N.metaKey||N.altKey||N.ctrlKey||(d(s.activeElement)&&b(s.activeElement),u=!0)}function S(N){u=!1}function A(N){d(N.target)&&(u||y(N.target))&&b(N.target)}function C(N){d(N.target)&&(N.target.classList.contains("focus-visible")||N.target.hasAttribute("data-focus-visible-added"))&&(o=!0,window.clearTimeout(c),c=window.setTimeout(function(){o=!1},100),g(N.target))}function M(N){document.visibilityState==="hidden"&&(o&&(u=!0),k())}function k(){document.addEventListener("mousemove",R),document.addEventListener("mousedown",R),document.addEventListener("mouseup",R),document.addEventListener("pointermove",R),document.addEventListener("pointerdown",R),document.addEventListener("pointerup",R),document.addEventListener("touchmove",R),document.addEventListener("touchstart",R),document.addEventListener("touchend",R)}function T(){document.removeEventListener("mousemove",R),document.removeEventListener("mousedown",R),document.removeEventListener("mouseup",R),document.removeEventListener("pointermove",R),document.removeEventListener("pointerdown",R),document.removeEventListener("pointerup",R),document.removeEventListener("touchmove",R),document.removeEventListener("touchstart",R),document.removeEventListener("touchend",R)}function R(N){N.target.nodeName&&N.target.nodeName.toLowerCase()==="html"||(u=!1,T())}document.addEventListener("keydown",v,!0),document.addEventListener("mousedown",S,!0),document.addEventListener("pointerdown",S,!0),document.addEventListener("touchstart",S,!0),document.addEventListener("visibilitychange",M,!0),k(),s.addEventListener("focus",A,!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)}))})()),hA.exports}ate();const uD="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=",ite="_spinner_vz46q_1",ste="_svg_vz46q_16",ote="_menu_vz46q_276",Ut={spinner:ite,"spinner--light":"_spinner--light_vz46q_12",svg:ste,"user-action-indicator-container":"_user-action-indicator-container_vz46q_23","user-action-indicator-text":"_user-action-indicator-text_vz46q_40","user-action-indicator":"_user-action-indicator_vz46q_23","user-action-indicator-icon":"_user-action-indicator-icon_vz46q_60","seek-container":"_seek-container_vz46q_69","seek-playhead":"_seek-playhead_vz46q_92","seek-buffer":"_seek-buffer_vz46q_93","seek-input":"_seek-input_vz46q_94","volume-controls":"_volume-controls_vz46q_201","volume-slider":"_volume-slider_vz46q_208","volume-input":"_volume-input_vz46q_224","volume-progress":"_volume-progress_vz46q_225",menu:ote,"menu-option":"_menu-option_vz46q_296","menu-option-back":"_menu-option-back_vz46q_313","menu-option-back-icon":"_menu-option-back-icon_vz46q_317","menu-option-active":"_menu-option-active_vz46q_332","menu-option-icon":"_menu-option-icon_vz46q_336","menu-header":"_menu-header_vz46q_346","verification-menu":"_verification-menu_vz46q_353","verification-menu__group":"_verification-menu__group_vz46q_357","verification-menu__group-icon":"_verification-menu__group-icon_vz46q_362","verification-menu__group-icon--cc":"_verification-menu__group-icon--cc_vz46q_366","verification-menu__group-text":"_verification-menu__group-text_vz46q_374","verification-menu__group-title":"_verification-menu__group-title_vz46q_378","verification-menu__group-subtitle":"_verification-menu__group-subtitle_vz46q_378","verification-menu__loader":"_verification-menu__loader_vz46q_393","verification-menu__details":"_verification-menu__details_vz46q_400","verification-menu__detail":"_verification-menu__detail_vz46q_400","verification-menu__detail-label":"_verification-menu__detail-label_vz46q_419","verification-menu__detail-value":"_verification-menu__detail-value_vz46q_423","verification-menu__detail-copy":"_verification-menu__detail-copy_vz46q_430","verification-menu__inline-icon":"_verification-menu__inline-icon_vz46q_440","verification-menu--details":"_verification-menu--details_vz46q_448","dvr-toggle":"_dvr-toggle_vz46q_466","dvr-toggle__border":"_dvr-toggle__border_vz46q_472","dvr-toggle__live":"_dvr-toggle__live_vz46q_481","dvr-toggle__dvr":"_dvr-toggle__dvr_vz46q_481","dvr-toggle__live--active":"_dvr-toggle__live--active_vz46q_496","dvr-toggle__dvr--active":"_dvr-toggle__dvr--active_vz46q_496","copy-button":"_copy-button_vz46q_619","copy-button--copied":"_copy-button--copied_vz46q_622"},Tg=({light:r,className:e=""})=>Be.jsx("div",{className:`${e} ${Ut.spinner} ${r?Ut["spinner--light"]:""}`,children:Be.jsx("div",{className:Ut["spinner-inner"]})}),cl=({icon:r,className:e=""})=>Be.jsx("div",{className:`${Ut.svg} ${e}`,dangerouslySetInnerHTML:{__html:r}}),A8=async r=>{try{r=(r||"").toString(),await navigator.clipboard.writeText(r)}catch{const t=document.createElement("input");t.value=r,t.select(),t.setSelectionRange(0,99999),document.execCommand("copy")}},fL={[Un.PLAY]:rD,[Un.PAUSE]:jee,[Un.MUTE]:S8,[Un.UNMUTE]:Qw,[Un.VOLUME_DOWN]:sD,[Un.VOLUME_UP]:Qw,[Un.SEEK_BACK]:oL,[Un.SEEK_FORWARD]:uL,[Un.PLAYBACK_RATE_DOWN]:oL,[Un.PLAYBACK_RATE_UP]:uL,[Un.SUBTITLES_ON]:Qee,[Un.SUBTITLES_OFF]:Xee,[Un.PLAY_PREVIOUS]:C8,[Un.PLAY_NEXT]:E8},ute=({action:r})=>{if(!(!r||!fL[r.action]))return Be.jsxs("div",{className:Ut["user-action-indicator-container"],children:[Be.jsx("div",{className:Ut["user-action-indicator"],children:Be.jsx(cl,{icon:fL[r.action],"aria-label":`Action indicator ${r}`,className:Ut["user-action-indicator-icon"]})}),r.text?Be.jsx("div",{className:Ut["user-action-indicator-text"],children:r.text}):null]})},lD=({player:r,videoState:e,setRecentUserAction:t,className:a=""})=>{const[s,u]=Ft.useState(r.controls.GetCurrentTime()),[o,c]=Ft.useState(0),[p,d]=Ft.useState(void 0),[y,b]=Ft.useState(r.controls.IsDVREnabled());return Ft.useEffect(()=>{d(KI(r,t));const g=x8({player:r,setCurrentTime:u,rate:60}),v=Mee({video:r.video,setBufferFraction:c}),S=r.controls.RegisterSettingsListener(()=>{r.controls&&b(r.controls.IsDVREnabled())});return()=>{g&&g(),v&&v(),S&&S()}},[r&&r.controls]),r.isLive&&!y?null:Be.jsxs("div",{className:`${a} ${Ut["seek-container"]} ${a}`,children:[Be.jsx("progress",{max:1,value:r.casting?0:o,className:Ut["seek-buffer"]}),Be.jsx("progress",{max:1,value:s/e.duration||0,className:Ut["seek-playhead"]}),Be.jsx("input",{"aria-label":"Seek slider",type:"range",min:0,max:1,step:1e-5,value:s/e.duration||0,onInput:g=>r.controls.Seek({fraction:g.currentTarget.value}),onKeyDown:p,className:Ut["seek-input"]})]})},lte=({player:r,videoState:e})=>Be.jsxs("div",{className:Ut["volume-controls"],children:[Be.jsx(dl,{"aria-label":e.muted?"Unmute":"Mute",icon:e.muted||e.volume===0?S8:e.volume<.4?sD:e.volume<.8?$ee:Qw,onClick:()=>r.controls.ToggleMuted(),className:Ut["volume-button"]},"mute-button"),Be.jsxs("div",{className:Ut["volume-slider"],children:[Be.jsx("progress",{max:1,value:e.muted?0:e.volume,className:Ut["volume-progress"]}),Be.jsx("input",{"aria-label":"Volume slider",type:"range",min:0,max:1,step:.001,value:e.muted?0:e.volume,onInput:t=>r.controls.SetVolume({fraction:t.currentTarget.value}),onKeyDown:oee(r),className:Ut["volume-input"]})]})]}),cD=({player:r,Hide:e,className:t=""})=>{const[a,s]=Ft.useState(void 0),[u,o]=Ft.useState(void 0),c=Ft.createRef();if(Ft.useEffect(()=>{const b=()=>o(r.controls.GetOptions());b();const g=r.controls.RegisterSettingsListener(b);return()=>g&&g()},[]),Ft.useEffect(()=>{if(!c||!c.current)return;const b=U_({element:c.current.parentElement,Hide:e});return()=>{b&&b()}},[c]),!u)return null;const p=b=>setTimeout(()=>s(b)),d={quality:{label:"Quality",Update:b=>r.controls.SetQualityLevel(b)},audio:{label:"Audio",Update:b=>r.controls.SetAudioTrack(b)},text:{label:"Subtitles",Update:b=>r.controls.SetTextTrack(b)},profile:{label:"Player Profile",Update:b=>{b==="custom"?(r.controls.ShowPlayerProfileForm(),e()):r.controls.SetPlayerProfile({profile:b})}},rate:{label:"Playback Rate",Update:b=>r.controls.SetPlaybackRate({index:b})},advanced:{label:"Advanced",Update:b=>{b==="copy_debug_info"&&(A8(JSON.stringify(r.controls.GetDebugInfo(),null,2)),e())}}};let y;return a?y=Be.jsxs("div",{role:"menu",className:`${Ut.menu} ${Ut.submenu} ${t}`,children:[Be.jsxs("button",{onClick:()=>p(void 0),"aria-label":"Back to settings menu",className:`${Ut["menu-option"]} ${Ut["menu-option-back"]}`,children:[Be.jsx("div",{dangerouslySetInnerHTML:{__html:Gee},className:Ut["menu-option-back-icon"]}),Be.jsx("div",{children:d[a].label})]}),a==="advanced"?Be.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(b=>Be.jsxs("button",{role:"menuitemradio","aria-checked":b.active,autoFocus:b.active,"aria-label":`${d[a].label}: ${b.label||""}`,onClick:()=>{d[a].Update(b.index),p(void 0)},className:`${Ut["menu-option"]} ${b.active?Ut["menu-option-active"]:""}`,children:[b.label||"",b.active?Be.jsx(cl,{icon:Jee,className:Ut["menu-option-icon"]}):null]},`option-${b.index}`))]},"submenu"):y=Be.jsxs("div",{role:"menu",className:`${Ut.menu} ${t}`,children:[u.hasQualityOptions?Be.jsxs("button",{autoFocus:!0,role:"menuitem",onClick:()=>p("quality"),className:Ut["menu-option"],children:[`${d.quality.label}: ${u.quality.active&&u.quality.active.activeLabel||""}`,Be.jsx(cl,{icon:ip,className:Ut["menu-option-icon"]})]}):null,u.hasAudioOptions?Be.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||""}`,Be.jsx(cl,{icon:ip,className:Ut["menu-option-icon"]})]}):null,u.hasTextOptions?Be.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||""}`,Be.jsx(cl,{icon:ip,className:Ut["menu-option-icon"]})]}):null,u.hasProfileOptons?Be.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||""}`,Be.jsx(cl,{icon:ip,className:Ut["menu-option-icon"]})]}):null,u.hasRateOptions?Be.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||""}`,Be.jsx(cl,{icon:ip,className:Ut["menu-option-icon"]})]}):null,Be.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,Be.jsx(cl,{icon:ip,className:Ut["menu-option-icon"]})]})]},"menu"),Be.jsx("div",{ref:c,children:y})},fD=({player:r})=>{const[e,t]=Ft.useState(r.dvrEnabled);return Ft.useEffect(()=>{const a=r.controls.RegisterSettingsListener(()=>{r.controls&&t(r.controls.IsDVREnabled())});return()=>a&&a()},[r&&r.controls]),Be.jsxs("div",{className:Ut["dvr-toggle"],children:[Be.jsx("button",{onClick:()=>r.controls.SetDVREnabled(!1),className:`${Ut["dvr-toggle__live"]} ${e?"":Ut["dvr-toggle__live--active"]}`,children:"LIVE"}),Be.jsx("button",{onClick:()=>r.controls.SetDVREnabled(!0),className:`${Ut["dvr-toggle__dvr"]} ${e?Ut["dvr-toggle__dvr--active"]:""}`,children:"DVR"}),Be.jsx("div",{className:Ut["dvr-toggle__border"]})]})},cte=({label:r,value:e,className:t=""})=>{const[a,s]=Ft.useState(!1);return Be.jsx("button",{onClick:()=>{a||(A8(e),s(!0),setTimeout(()=>s(!1),100))},dangerouslySetInnerHTML:{__html:ete},className:[Ut["copy-button"],a?Ut["copy-button--copied"]:"",t].join(" "),title:`Copy ${r}`})},To=({label:r,value:e,copyable:t})=>e?Be.jsxs("div",{className:Ut["verification-menu__detail"],children:[Be.jsxs("label",{className:Ut["verification-menu__detail-label"],children:[r,":"]}),Be.jsx("div",{className:Ut["verification-menu__detail-value"],children:e}),t?Be.jsx(cte,{label:r,value:e,className:Ut["verification-menu__detail-copy"]}):null]}):null,dD=({player:r,Hide:e,className:t=""})=>{const a=Ft.createRef(),[s,u]=Ft.useState(),[o,c]=Ft.useState(!1),[p,d]=Ft.useState(!1);if(Ft.useEffect(()=>{r.__LoadVerificationDetails().then(()=>d(!0));const b=()=>u(r.controls.GetContentVerificationDetails());b();const g=r.controls.RegisterSettingsListener(b);return()=>g&&g()},[]),Ft.useEffect(()=>{if(!a||!a.current)return;const b=U_({element:a.current.parentElement,Hide:e});return()=>{b&&b()}},[a]),!s)return null;let y;return o?y=Be.jsxs(Be.Fragment,{children:[Be.jsxs("div",{className:Ut["verification-menu__group"],children:[Be.jsx("div",{dangerouslySetInnerHTML:{__html:Xw},className:Ut["verification-menu__group-icon"]}),Be.jsxs("div",{className:Ut["verification-menu__group-text"],children:[Be.jsx("div",{className:Ut["verification-menu__group-title"],children:"This content has been verified as authentic"}),Be.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"})]})]})]}),Be.jsxs("div",{className:Ut["verification-menu__group"],children:[Be.jsx("div",{dangerouslySetInnerHTML:{__html:lL},className:[Ut["verification-menu__group-icon"],Ut["verification-menu__group-icon--cc"]].join(" ")}),Be.jsxs("div",{className:Ut["verification-menu__group-text"],children:[Be.jsx("button",{onClick:()=>c(!0),className:Ut["verification-menu__group-title"],children:"Content Credentials"}),Be.jsxs("div",{className:Ut["verification-menu__group-subtitle"],children:["Issued by the",Be.jsx("a",{href:"https://main.net955305.contentfabric.io/config",target:"_blank",rel:"noreferrer",children:"Content Fabric"})]})]})]}),Be.jsxs("div",{className:Ut["verification-menu__details"],children:[Be.jsx(To,{label:"Content Fabric Object ID",value:s.details.objectId,copyable:!0}),Be.jsx(To,{label:"Organization Address",value:s.details.tenantAddress,copyable:!0}),Be.jsx(To,{label:"Organization Name",value:s.details.tenantName&&s.details.tenantName.toString()}),Be.jsx(To,{label:"Owner Address",value:s.details.ownerAddress,copyable:!0}),Be.jsx(To,{label:"Content Object Contract Address",value:s.details.explorerUrl?Be.jsx("a",{href:s.details.explorerUrl,target:"_blank",rel:"noreferrer",children:s.details.address}):s.details.address,copyable:!0}),Be.jsx(To,{label:"Versions",value:s.details.versionCount}),Be.jsx(To,{label:"Content Version Hash",value:s.details.versionHash,copyable:!0}),s.details.lastCommittedAt?Be.jsx(To,{label:"Latest Commit",value:new Date(s.details.lastCommittedAt).toLocaleTimeString(navigator.language||"en-us",{year:"numeric",month:"long",day:"numeric"})}):null,Be.jsx(To,{label:"Latest Version Hash",value:s.details.latestVersionHash,copyable:!0}),Be.jsx(To,{label:"Latest Transaction",value:s.details._state!=="full"?Be.jsx(Tg,{className:Ut["verification-menu__loader"]}):s.details.latestTransactionHashUrl?Be.jsx("a",{href:s.details.latestTransactionHashUrl,target:"_blank",rel:"noreferrer",children:s.details.latestTransactionHash&&s.details.latestTransactionHash.toString()}):void 0}),Be.jsx(To,{label:"Signature Algorithm",value:s.details.signatureMethod}),r.publicMetadataUrl?Be.jsx(To,{label:"Public Metadata",value:Be.jsx("a",{href:r.publicMetadataUrl,target:"_blank",rel:"noreferrer",children:r.publicMetadataUrl})}):null]},`details-${s.details._state}`)]}):y=Be.jsxs(Be.Fragment,{children:[Be.jsxs("div",{className:Ut["verification-menu__group"],children:[Be.jsx("div",{dangerouslySetInnerHTML:{__html:Xw},className:Ut["verification-menu__group-icon"]}),Be.jsxs("div",{className:Ut["verification-menu__group-text"],children:[Be.jsx("div",{className:Ut["verification-menu__group-title"],children:"This content has been verified as authentic"}),Be.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"})]})]})]}),Be.jsxs("div",{className:Ut["verification-menu__group"],children:[Be.jsx("div",{dangerouslySetInnerHTML:{__html:lL},className:[Ut["verification-menu__group-icon"],Ut["verification-menu__group-icon--cc"]].join(" ")}),Be.jsx("div",{className:Ut["verification-menu__group-text"],children:Be.jsxs("button",{onClick:()=>c(!0),className:Ut["verification-menu__group-title"],children:["View Content Credentials",Be.jsx("div",{className:Ut["verification-menu__inline-icon"],dangerouslySetInnerHTML:{__html:ip}})]})})]})]}),Be.jsx("div",{ref:a,children:Be.jsx("div",{role:"menu",className:`${Ut.menu} ${Ut["verification-menu"]} ${o?Ut["verification-menu--details"]:""} ${t}`,children:y},"menu")})},fte=({player:r,Hide:e,className:t=""})=>{const a=Ft.createRef(),[s,u]=Ft.useState(void 0);if(Ft.useEffect(()=>{const c=()=>u(r.controls.GetCollectionInfo());c();const p=r.controls.RegisterSettingsListener(c);return()=>p&&p()},[]),Ft.useEffect(()=>{if(!a||!a.current)return;const c=U_({element:a.current.parentElement,Hide:e});return()=>c&&c()},[a]),!s)return null;const o=c=>{r.controls.CollectionPlay({mediaIndex:c}),e()};return Be.jsxs("div",{role:"menu",className:`${Ut.menu} ${Ut["collection-menu"]} ${t}`,ref:a,children:[Be.jsx("div",{className:`${Ut["menu-option"]} ${Ut["menu-header"]}`,children:s.title}),s.content.map((c=>Be.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")},dl=({icon:r,className:e="",...t})=>Be.jsx("button",{...t,className:`${Bn["icon-button"]} ${e}`,dangerouslySetInnerHTML:{__html:r}}),dte=({player:r,videoState:e})=>{const[t,a]=Ft.useState(r.video.currentTime);return Ft.useEffect(()=>{const s=x8({player:r,setCurrentTime:a,rate:10});return()=>s&&s()},[]),r.isLive&&!r.controls.IsDVRAvailable()?Be.jsx("div",{className:Bn["live-indicator"],children:"Live"}):Be.jsxs("div",{className:Bn.time,children:[!r.isLive||!r.controls.IsDVRAvailable()?null:Be.jsx(fD,{player:r}),r.isLive&&!r.behindLiveEdge?null:`${Ww(t,e.duration)} / `,r.isLive&&!r.dvrEnabled?null:Ww(e.duration,e.duration)]})},pte=({player:r})=>{const e=r.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=r.controls.IsReady();return Be.jsxs(Be.Fragment,{children:[t?Be.jsxs("div",{className:`${Bn["collection-button-container"]} ${s?"":Bn["collection-button-container--loading"]}`,children:[Be.jsx(dl,{"aria-label":`Play Previous: ${t.title}`,disabled:!s,icon:C8,onClick:()=>r.controls.CollectionPlayPrevious()}),Be.jsx("div",{className:Bn["collection-button-text"],children:t.title})]},`media-previous-${e.mediaIndex}`):null,a?Be.jsxs("div",{className:`${Bn["collection-button-container"]} ${s?"":Bn["collection-button-container--loading"]}`,children:[Be.jsx(dl,{"aria-label":`Play Next: ${a.title}`,disabled:!s,icon:E8,onClick:()=>r.controls.CollectionPlayNext()}),Be.jsx("div",{className:Bn["collection-button-text"],children:a.title})]},`media-next-${e.mediaIndex}`):null]})},pD=({label:r,icon:e,player:t,MenuComponent:a,className:s=""})=>{const[u,o]=Ft.useState(!1);return Be.jsxs("div",{className:[Bn["menu-control-container"],s].join(" "),children:[Be.jsx(dl,{"aria-label":u?`Hide ${r} Menu`:r,"aria-haspopup":!0,icon:e,onClick:()=>{t.controls.__ToggleMenu(!u),o(!u)},className:u?Bn["icon-button-active"]:""}),u?Be.jsx(a,{player:t,Hide:()=>{o(!1),t.controls.__ToggleMenu(!1)}}):null]})},hte=({player:r})=>{const[e,t]=Ft.useState(void 0),{title:a,subtitle:s,description:u,image:o,headers:c}=r.controls.GetContentInfo()||{};return Ft.useEffect(()=>{t(void 0),o&&w8({player:r,pathOrUrl:o,width:200}).then(p=>t(p))},[o]),!a||r.playerOptions.title===Kt.title.FULLSCREEN_ONLY&&!r.controls.IsFullscreen()||r.playerOptions.title===Kt.title.OFF?null:Be.jsxs("div",{className:Bn["info-container"],children:[e?Be.jsx("div",{className:Bn["info-image-container"],children:Be.jsx("img",{src:e,alt:"Image",className:Bn["info-image"]})}):null,Be.jsxs("div",{className:Bn["info-text"],children:[c.length===0?null:Be.jsx("div",{className:Bn["info-headers"],children:c.map((p,d)=>Be.jsx("div",{className:Bn["info-header"],children:p},`header-${d}`))}),a?Be.jsx("div",{className:Bn["info-title"],children:a}):null,s?Be.jsx("div",{className:Bn["info-subtitle"],children:s}):null,u?Be.jsx("div",{className:Bn["info-description"],children:u}):null]})]})},yte=({player:r})=>{const[e,t]=Ft.useState(!1);return Ft.useEffect(()=>{const a=()=>r&&r.controls&&t(r.controls.ContentVerified());a();const s=r.controls&&r.controls.RegisterSettingsListener(a);return()=>s&&s()},[]),e?Be.jsxs(Be.Fragment,{children:[Be.jsx("div",{className:Bn["content-verified-badge"],children:"VERIFIED"}),Be.jsx(pD,{label:"Content Verification Menu",icon:Xw,player:r,MenuComponent:dD,className:Bn["content-verification-menu-button"]})]}):null},mte=({player:r,playbackStarted:e,canPlay:t,recentlyInteracted:a,setRecentUserAction:s,className:u=""})=>{const[o,c]=Ft.useState(void 0),[p,d]=Ft.useState(void 0),[y,b]=Ft.useState(r.controls.IsMenuVisible());if(Ft.useEffect(()=>{if(!r.controls)return;d(WI({player:r,setRecentUserAction:s}));const A=()=>r&&r.controls&&b(r.controls.IsMenuVisible()),C=r.controls.RegisterSettingsListener(A),M=tD({player:r,setVideoState:c});return()=>{C&&C(),M&&M()}},[]),!o)return null;const g=r.controls.GetCollectionInfo(),v=a||!e||y,S=!v&&r.playerOptions.controls===Kt.controls.AUTO_HIDE;return r.__SetControlsVisibility(!S),Be.jsxs("div",{onClick:p,className:[u,Bn.container,v?"":Bn.autohide,r.playerOptions.controls!==Kt.controls.DEFAULT?"":Bn["container--default-controls"],r.controls.IsMenuVisible()?"menu-active":""].join(" "),children:[Be.jsx(hte,{player:r},`content-info-${g&&g.mediaIndex}`),[Kt.controls.DEFAULT,Kt.controls.OFF,Kt.controls.OFF_WITH_VOLUME_TOGGLE].includes(r.playerOptions.controls)?null:Be.jsxs(Be.Fragment,{children:[Be.jsx(dl,{"aria-label":"Play",tabIndex:e?-1:0,icon:nD,onClick:()=>{r.controls.Play(),r.target.firstChild.focus()},className:`${Bn["center-play-button"]} ${t&&!e&&!(r&&r.casting)?"":Bn["center-play-button--hidden"]}`}),Be.jsxs("div",{className:`${Bn["bottom-controls-container"]} ${S?Bn["bottom-controls-container--autohide"]:""}`,children:[Be.jsx("div",{className:Bn["bottom-controls-gradient"]}),Be.jsx(lD,{player:r,videoState:o,setRecentUserAction:s,className:Bn.seek}),Be.jsxs("div",{className:Bn.controls,children:[Be.jsx(dl,{"aria-label":o.playing?"Pause":"Play",icon:o.playing?iD:aD,onClick:()=>r.controls.TogglePlay(),className:Bn["play-pause-button"]}),Be.jsx(pte,{player:r}),Be.jsx(lte,{player:r,videoState:o}),Be.jsx(dte,{player:r,videoState:o}),Be.jsx("div",{className:Bn.spacer}),Be.jsx(yte,{player:r}),r.chromecastAvailable?Be.jsx("google-cast-launcher",{}):null,r.airplayAvailable?Be.jsx(dl,{"aria-label":"Airplay",onClick:()=>r.video.webkitShowPlaybackTargetPicker(),icon:oD}):null,r.controls.IsRotatable()?Be.jsx(dl,{"aria-label":"Rotate Video",icon:Zee,onClick:()=>r.controls.SetAllowRotation(!r.controls.AllowRotation()),className:Bn["right-control-button"]}):null,r.controls.GetOptions().hasAnyOptions?Be.jsx(pD,{label:"Settings Menu",icon:Vee,player:r,MenuComponent:cD}):null,Be.jsx(dl,{"aria-label":o.fullscreen?"Exit Fullscreen":"Fullscreen",icon:o.fullscreen?Hee:qee,onClick:()=>r.controls.ToggleFullscreen(),className:Bn["right-control-button"]})]})]})]}),r.playerOptions.controls!==Kt.controls.OFF_WITH_VOLUME_TOGGLE?null:Be.jsx("div",{className:Bn["floating-volume-toggle"],children:Be.jsx(dl,{"aria-label":o.muted?"Unmute":"Mute",icon:o.muted||o.volume===0?S8:Qw,onClick:()=>r.controls.ToggleMuted(),className:Bn["volume-button"]},"mute-button")}),r.playerOptions.watermark===Kt.watermark.OFF?null:Be.jsx("div",{className:Bn.watermark,children:Be.jsx("img",{src:uD,alt:"Eluvio"})})]})},gte="_spinner_1c6ar_17",vte="_text_1c6ar_33",bte="_title_1c6ar_39",wte="_description_1c6ar_43",_te="_inputs_1c6ar_47",xte="_input_1c6ar_47",Ste="_submit_1c6ar_77",ci={"ticket-form-container":"_ticket-form-container_1c6ar_1","ticket-form-overlay":"_ticket-form-overlay_1c6ar_8",spinner:gte,"ticket-form":"_ticket-form_1c6ar_1",text:vte,title:bte,description:wte,inputs:_te,input:xte,submit:Ste,"error-message":"_error-message_1c6ar_88","size-md":"_size-md_1c6ar_102","size-sm":"_size-sm_1c6ar_103"},Cte=({parameters:r,dimensions:e,onComplete:t})=>{let{tenantId:a,ntpId:s,ticketCode:u,ticketSubject:o}=r.clientOptions||{};const c=!a||!s,[p,d]=Ft.useState(u||""),[y,b]=Ft.useState(!!u),[g,v]=Ft.useState(!1),[S,A]=Ft.useState(c?"Error: Tenant ID or NTP ID not specified":""),[C,M]=Ft.useState(void 0),k=async({client:T,code:R})=>{if(!(!R||!T)){A(""),v(!0);try{let N=o;R.includes(":")&&(N=R.split(":")[0],R=R.split(":")[1]),await T.RedeemCode({tenantId:a,ntpId:s,code:R.trim(),email:N}),t(T)}catch(N){console.log(N),A("Invalid Code"),b(!1)}finally{v(!1)}}};return Ft.useEffect(()=>{Promise.resolve().then(()=>GI).then(async({ElvClient:T})=>{const R=await T.FromConfigurationUrl({configUrl:r.clientOptions.network});M(R),u&&k({client:R,code:u})})},[]),y?Be.jsx("div",{role:"complementary",tabIndex:-1,style:{backgroundColor:r.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:Be.jsx("div",{className:ci["ticket-form-overlay"],children:Be.jsx(Tg,{className:ci.spinner})})}):Be.jsx("div",{role:"complementary",tabIndex:-1,style:{backgroundColor:r.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:Be.jsx("div",{className:ci["ticket-form-overlay"],children:Be.jsxs("form",{onSubmit:T=>{T.preventDefault(),k({client:C,code:p})},className:ci["ticket-form"],children:[Be.jsxs("div",{className:ci.text,children:[Be.jsx("h2",{className:ci.title,children:r.clientOptions.ticketTitle||"This content requires a code to view"}),Be.jsx("p",{className:ci.description,children:r.clientOptions.ticketDescription||"Please enter your code below"})]}),Be.jsxs("div",{className:ci.inputs,children:[Be.jsx("input",{disabled:c,autoFocus:!0,type:"text",placeholder:"Ticket Code",value:p,"aria-label":"Ticket Code","aria-invalid":!!S&&!c,"aria-errormessage":S,onKeyDown:T=>T.key==="Enter"&&k({client:C,code:p}),onChange:T=>{A(""),d(T.target.value)},className:ci.input}),Be.jsx("button",{type:"submit","aria-label":"Submit Code",disabled:!p||!C||c,className:ci.submit,children:g?Be.jsx(Tg,{light:!0}):"Submit"})]}),Be.jsxs("div",{className:ci["error-message"],children:[S," "]})]})})})},Ete="_container_m8dfx_1",Ate="_autohide_m8dfx_34",kte="_title_m8dfx_134",Mte="_spacer_m8dfx_319",Tte="_watermark_m8dfx_323",Rte="_menu_m8dfx_145",vn={container:Ete,"container--default-controls":"_container--default-controls_m8dfx_29",autohide:Ate,"bottom-controls-container--autohide":"_bottom-controls-container--autohide_m8dfx_37","icon-button":"_icon-button_m8dfx_43","icon-button--drop-shadow-focus":"_icon-button--drop-shadow-focus_m8dfx_60","icon-button-active":"_icon-button-active_m8dfx_73","icon-button--circle-focus":"_icon-button--circle-focus_m8dfx_73","text-button":"_text-button_m8dfx_86","text-button--active":"_text-button--active_m8dfx_91","bottom-controls-container":"_bottom-controls-container_m8dfx_37","bottom-controls-gradient":"_bottom-controls-gradient_m8dfx_108","center-play-button":"_center-play-button_m8dfx_120","center-play-button--hidden":"_center-play-button--hidden_m8dfx_127","title-container":"_title-container_m8dfx_134",title:kte,"menu-control-container":"_menu-control-container_m8dfx_145","time-container":"_time-container_m8dfx_149","live-indicator":"_live-indicator_m8dfx_156","bottom-controls":"_bottom-controls_m8dfx_37","center-buttons":"_center-buttons_m8dfx_184","play-pause-button":"_play-pause-button_m8dfx_194","track-button":"_track-button_m8dfx_197","bottom-left-controls":"_bottom-left-controls_m8dfx_201","bottom-right-controls":"_bottom-right-controls_m8dfx_202","info-box-container":"_info-box-container_m8dfx_219","info-box":"_info-box_m8dfx_219","info-box-image-container":"_info-box-image-container_m8dfx_242","info-box-image":"_info-box-image_m8dfx_242","info-box-text":"_info-box-text_m8dfx_258","info-box-text--top-padding":"_info-box-text--top-padding_m8dfx_265","info-box-headers":"_info-box-headers_m8dfx_269","info-box-description":"_info-box-description_m8dfx_277","info-box-title":"_info-box-title_m8dfx_281","info-box-button":"_info-box-button_m8dfx_286","info-box-button--restart":"_info-box-button--restart_m8dfx_301",spacer:Mte,watermark:Tte,menu:Rte},Sf=({icon:r,...e})=>Be.jsx("button",{...e,className:`${vn["icon-button"]} ${e.className||""}`,dangerouslySetInnerHTML:{__html:r}}),Ote=({player:r,videoState:e})=>{const[t,a]=Ft.useState(r.video.currentTime);return Ft.useEffect(()=>{const s=x8({player:r,setCurrentTime:a,rate:10});return()=>s&&s()},[]),r.isLive&&!r.dvrEnabled?null:Be.jsxs("div",{className:vn["time-container"],children:[r.isLive&&!r.behindLiveEdge?null:Be.jsx("div",{className:vn.time,children:Ww(t,e.duration)}),Be.jsx("div",{className:vn.spacer}),Be.jsx("div",{className:vn.time,children:Ww(e.duration,e.duration)})]})},Lte=({player:r,videoState:e})=>{const t=r.controls.GetCollectionInfo(),a=t&&t.isPlaylist&&t.content[t.mediaIndex-1],s=t&&t.isPlaylist&&t.content[t.mediaIndex+1],u=r.controls.IsReady();return Be.jsxs("div",{className:vn["center-buttons"],children:[!a&&!s?null:Be.jsx(Sf,{disabled:!u||!a,icon:C8,onClick:()=>r.controls.CollectionPlayPrevious(),className:`${vn["track-button"]} ${vn["icon-button--drop-shadow-focus"]}`}),Be.jsx(Sf,{"aria-label":"Back 10 Seconds",icon:Wee,onClick:()=>r.controls.Seek({relativeSeconds:-10}),className:vn["icon-button--drop-shadow-focus"]}),Be.jsx(Sf,{"aria-label":e.playing?"Pause":"Play",icon:e.playing?iD:aD,onClick:()=>r.controls.TogglePlay(),className:`${vn["play-pause-button"]} ${vn["icon-button--drop-shadow-focus"]}`}),Be.jsx(Sf,{"aria-label":"Forward 10 Seconds",icon:Kee,onClick:()=>r.controls.Seek({relativeSeconds:10}),className:vn["icon-button--drop-shadow-focus"]}),!a&&!s?null:Be.jsx(Sf,{disabled:!u||!s,icon:E8,onClick:()=>r.controls.CollectionPlayNext(),className:`${vn["track-button"]} ${vn["icon-button--drop-shadow-focus"]}`})]})},yA=({label:r,icon:e,children:t,player:a,MenuComponent:s})=>{const[u,o]=Ft.useState(!1);return Be.jsxs("div",{className:vn["menu-control-container"],children:[e?Be.jsx(Sf,{"aria-label":u?`Hide ${r} Menu`:r,"aria-haspopup":!0,icon:e,onClick:()=>{a.controls.__ToggleMenu(!u),o(!u)},className:`${vn["icon-button--circle-focus"]} ${u?vn["icon-button-active"]:""}`}):Be.jsx("button",{onClick:()=>{a.controls.__ToggleMenu(!u),o(!u)},className:`${vn["text-button"]} ${u?vn["text-button--active"]:""}`,children:t}),u?Be.jsx(s,{player:a,Hide:()=>{a.controls.__ToggleMenu(!1),o(!1)},className:vn.menu}):null]})},Nte=({player:r,Hide:e})=>{const[t,a]=Ft.useState(void 0),{title:s,description:u,image:o,headers:c}=r.controls.GetContentInfo()||{};return Ft.useEffect(()=>{a(void 0),o&&w8({player:r,pathOrUrl:o,width:200}).then(p=>a(p))},[o]),Ft.useEffect(()=>{const p=d=>{d&&(d.key||"").toLowerCase()==="escape"&&e()};return document.body.addEventListener("keydown",p),()=>document.body.removeEventListener("keydown",p)},[]),Be.jsxs("div",{className:vn["info-box-container"],children:[Be.jsx("button",{autoFocus:!0,onClick:()=>e(),className:`${vn["info-box-button"]} ${vn["info-box-button--info"]}`,children:"Info"}),Be.jsxs("div",{className:vn["info-box"],children:[t?Be.jsx("div",{className:vn["info-box-image-container"],children:Be.jsx("img",{src:t,alt:"Image",className:vn["info-box-image"]})}):null,Be.jsxs("div",{className:`${vn["info-box-text"]} ${t&&c&&c.length===0?vn["info-box-text--top-padding"]:""}`,children:[!c||c.length===0?null:Be.jsx("div",{className:vn["info-box-headers"],children:c.map((p,d)=>Be.jsx("div",{className:vn["info-box-header"],children:p},`header-${d}`))}),Be.jsx("div",{className:vn["info-box-title"],children:s||""}),Be.jsx("div",{className:vn["info-box-description"],children:u||""})]}),Be.jsx("div",{className:vn["info-box-actions"],children:Be.jsxs("button",{onClick:()=>{r.controls.Seek({time:0}),e()},className:`${vn["info-box-button"]} ${vn["info-box-button--restart"]}`,children:[Be.jsx(cl,{icon:rD}),"From Beginning"]})})]})]})},Pte=({player:r})=>{const[e,t]=Ft.useState(!1);return Ft.useEffect(()=>{const a=()=>t(r.controls.ContentVerified());a(),r.controls.RegisterSettingsListener(a)},[]),e?Be.jsx(yA,{label:"Content Verification Menu",icon:Xw,player:r,MenuComponent:dD,className:vn["content-verification-menu-button"],children:"Verified"}):null},Ite=({player:r,playbackStarted:e,canPlay:t,recentlyInteracted:a,setRecentUserAction:s,className:u=""})=>{const[o,c]=Ft.useState(void 0),[p,d]=Ft.useState(void 0),[y,b]=Ft.useState(!1);if(Ft.useEffect(()=>{d(WI({player:r,setRecentUserAction:s}));const C=tD({player:r,setVideoState:c});return()=>C&&C()},[]),!o)return null;const{title:g}=r.controls.GetContentInfo()||{},v=r.controls.GetCollectionInfo(),S=a||!e||r.controls.IsMenuVisible(),A=!S&&r.playerOptions.controls===Kt.controls.AUTO_HIDE;return r.__SetControlsVisibility(!A),Be.jsxs("div",{onClick:p,className:[u,vn.container,S?"":vn.autohide,r.playerOptions.controls!==Kt.controls.DEFAULT?"":vn["container--default-controls"],r.controls.IsMenuVisible()?"menu-active":""].join(" "),children:[Be.jsx(Sf,{"aria-label":"Play",tabIndex:e?-1:0,icon:nD,onClick:()=>{r.controls.Play(),r.target.firstChild.focus()},className:`${vn["center-play-button"]} ${vn["icon-button--drop-shadow-focus"]} ${t&&!e&&!r.casting?"":vn["center-play-button--hidden"]}`}),y?Be.jsx(Nte,{player:r,Hide:()=>b(!1)}):Be.jsxs("div",{className:`${vn["bottom-controls-container"]} ${A?vn["bottom-controls-container--autohide"]:""}`,children:[Be.jsx("div",{className:vn["bottom-controls-gradient"]}),Be.jsxs("div",{className:vn["title-container"],children:[Be.jsx("div",{className:vn.title,children:r.playerOptions.title===Kt.title.OFF||r.playerOptions.title===Kt.title.FULLSCREEN_ONLY&&!r.controls.IsFullscreen()?"":g||""}),Be.jsx("div",{className:vn.spacer}),r.isLive?r.controls.IsDVRAvailable()?Be.jsx(fD,{player:r}):Be.jsx("div",{className:vn["live-indicator"],children:"Live"}):null,v?Be.jsx(yA,{label:"Collection Menu",icon:Yee,player:r,MenuComponent:fte}):null]}),Be.jsx(lD,{player:r,videoState:o,setRecentUserAction:s}),Be.jsx(Ote,{player:r,videoState:o}),Be.jsxs("div",{className:vn["bottom-controls"],children:[Be.jsx("div",{className:vn["bottom-left-controls"],children:!g||r.playerOptions.title===Kt.title.OFF?null:Be.jsx("button",{className:vn["text-button"],onClick:()=>b(!0),children:"Info"})}),Be.jsx(Lte,{player:r,videoState:o}),Be.jsxs("div",{className:vn["bottom-right-controls"],children:[Be.jsx(Pte,{player:r}),r.airplayAvailable?Be.jsx(Sf,{"aria-label":"Airplay",onClick:()=>r.video.webkitShowPlaybackTargetPicker(),icon:oD}):null,r.chromecastAvailable?Be.jsx("google-cast-launcher",{}):null,r.controls.GetOptions().hasAnyOptions?Be.jsx(yA,{label:"Settings",player:r,MenuComponent:cD,children:"Settings"},"settings-button"):null]})]})]}),r.playerOptions.watermark===Kt.watermark.OFF?null:Be.jsx("div",{className:vn.watermark,children:Be.jsx("img",{src:uD,alt:"Eluvio"})})]},"controls")},Dte="_container_1l7ln_1",Ute="_overlay_1l7ln_9",Fte="_form_1l7ln_22",Bte="_header_1l7ln_39",zte="_input_1l7ln_45",jte="_actions_1l7ln_92",qte="_submit_1l7ln_98",Hte="_cancel_1l7ln_99",Ks={container:Dte,overlay:Ute,form:Fte,header:Bte,"input-container":"_input-container_1l7ln_45",input:zte,"input--invalid":"_input--invalid_1l7ln_65","player-info":"_player-info_1l7ln_74","api-link":"_api-link_1l7ln_83",actions:jte,submit:qte,cancel:Hte},Vte=({player:r,Close:e})=>{const[t,a]=Ft.useState(),[s,u]=Ft.useState(!1),[o,c]=Ft.useState(""),p=Ft.useRef();Ft.useEffect(()=>{if(!p||!p.current)return;const y=U_({element:p.current,Hide:e});return()=>y&&y()},[p]),Ft.useEffect(()=>{let y={...r.hlsOptions||{}};delete y.drmSystems,delete y.emeEnabled,a(JSON.stringify(y,null,2))},[]);const d=async y=>{y.preventDefault();try{u(!0),await r.controls.SetPlayerProfile({profile:"custom",customOptions:JSON.parse(t)}),e()}catch(b){c(b.toString()),u(!1)}};return Be.jsx("div",{role:"complementary",tabIndex:-1,className:Ks.container,children:Be.jsx("div",{className:Ks.overlay,children:Be.jsxs("form",{onSubmit:d,className:Ks.form,ref:p,children:[Be.jsx("h2",{className:Ks.header,children:"Custom hls.js Options"}),Be.jsxs("div",{className:Ks["input-container"],children:[Be.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:`${Ks.input} ${o?Ks["input--invalid"]:""}`}),Be.jsxs("div",{className:Ks["player-info"],children:[Be.jsx("a",{tabIndex:0,href:"https://github.com/video-dev/hls.js/blob/master/docs/API.md",rel:"noreferrer",target:"_blank",className:Ks["api-link"],children:"API Docs"}),Be.jsxs("div",{className:Ks["player-version"],children:["hls.js ",r.HLS.version]})]})]}),Be.jsxs("div",{className:Ks.actions,children:[Be.jsx("button",{type:"button","aria-label":"Cancel",onClick:()=>e(),className:Ks.cancel,children:"Cancel"}),Be.jsx("button",{type:"submit","aria-label":"Submit",disabled:!!o,className:Ks.submit,children:s?Be.jsx(Tg,{light:!0}):"Submit"})]})]})})})},$te=({player:r})=>{const[e,t]=Ft.useState(void 0),{posterImage:a}=r.controls.GetContentInfo()||{};return Ft.useEffect(()=>{t(void 0),a&&w8({player:r,pathOrUrl:a,width:200}).then(s=>t(s))},[a]),e?Be.jsx("img",{alt:"Video Poster",src:e,className:Ts.poster}):null};let Gte;const Wte=({target:r,parameters:e,InitCallback:t,ErrorCallback:a,Unmount:s,Reset:u,SetAdditionalParameters:o})=>{const[c,p]=Ft.useState(void 0),[d,y]=Ft.useState(void 0),[b,g]=Ft.useState("lg"),[v,S]=Ft.useState("landscape"),[A,C]=Ft.useState({width:r.getBoundingClientRect().width,height:r.getBoundingClientRect().height}),[M,k]=Ft.useState(void 0),[T,R]=Ft.useState(!1),[N,K]=Ft.useState(!1),[X,ie]=Ft.useState(!1),[ge,pe]=Ft.useState(!1),[te,se]=Ft.useState(!1),[x,_]=Ft.useState(!0),[P,j]=Ft.useState(void 0),[q,z]=Ft.useState(void 0),[ee,G]=Ft.useState(!1),D=Ft.useRef(),L=!!c,J=({action:H,text:Ce})=>j({action:H,text:Ce,key:Math.random()});if(Ft.useEffect(()=>{pe(!0);const H=Tee({target:r,setSize:g,setOrientation:S,setDimensions:C});return()=>{pe(!1),H&&H()}},[]),Ft.useEffect(()=>{if(!(!D||!D.current||!ge))try{R(!1),K(!1),e.clientOptions.client=d||e.clientOptions.client;const H=new Kw({target:r,video:D.current,parameters:e,SetErrorMessage:k,Reload:u,UpdateParameters:be=>{o(be)}});window.__elvPlayer=H;const Ce=H.controls.RegisterSettingsListener(()=>{z(H.controls.AllowRotation()),K(H.playbackStarted),R(!H.loading),se(H.__showPlayerProfileForm),G(H&&H.casting)});H.Destroy=()=>{H.__DestroyPlayer(),s()},H.Reset=()=>{u()};const Ie=Ree({player:H}),Se=Oee({player:H,inactivityPeriod:5e3,onWake:()=>_(!0),onSleep:()=>_(!1)}),Me=Lee({player:H,setRecentUserAction:J}),oe=Nee({player:H});t(H),p(H);const ce=H.controls.RegisterVideoEventListener("canplay",()=>ie(!0));return()=>{D&&D.current&&D.current.removeEventListener("play",K),Ce&&Ce(),Ie&&Ie(),Se&&Se(),Me&&Me(),oe&&oe(),ce&&ce(),H&&H.__DestroyPlayer()}}catch(H){a(H),s()}},[D,ge,d]),Ft.useEffect(()=>{if(L)return()=>{c&&c.__DestroyPlayer(),p(void 0)}},[L]),Ft.useEffect(()=>{P&&(clearTimeout(Gte),setTimeout(()=>{j(void 0)},1e3))},[P]),e.clientOptions.promptTicket&&!d)return Be.jsx(Cte,{parameters:e,dimensions:{size:b,orientation:v,...A},onComplete:H=>y(H)});const ae=e.playerOptions.ui===Kt.ui.WEB&&c&&c.controls.IsRotatable()&&q;return Be.jsxs("div",{role:"complementary","aria-label":"Eluvio Video Player",tabIndex:0,style:{backgroundColor:e.playerOptions.backgroundColor||"transparent","--portal-width":`${ae?A.height:A.width}px`,"--portal-height":`${ae?A.width:A.height}px`},className:[Ts["player-container"],ae?Ts["player-container--rotated"]:"",`__eluvio-player--size-${b}`,`__eluvio-player--orientation-${v}`].join(" "),children:[!te||!T?null:Be.jsx(Vte,{player:c,Close:()=>c.controls.HidePlayerProfileForm()}),Be.jsx("video",{playsInline:!0,disablePictureInPicture:!0,ref:D,muted:[Kt.muted.ON,Kt.muted.WHEN_NOT_VISIBLE].includes(e.playerOptions.muted),controls:e.playerOptions.controls===Kt.controls.DEFAULT,loop:e.playerOptions.loop===Kt.loop.ON,crossOrigin:"anonymous",className:Ts.video}),!c||!X||N&&!e.playerOptions.permanentPoster?null:Be.jsx($te,{player:c}),T||M||!e.playerOptions.showLoader?null:Be.jsx("div",{className:Ts["spinner-container"],children:Be.jsx(Tg,{className:Ts.spinner})}),ee?Be.jsx("div",{className:Ts["cast-indicator-container"],children:Be.jsx("div",{dangerouslySetInnerHTML:{__html:tte}})}):null,M?Be.jsxs("div",{className:Ts["error-message"],children:[Be.jsx("div",{className:Ts["error-message__message"],children:M}),Be.jsxs("button",{className:Ts["error-message__copy-debug-button"],onClick:()=>A8(JSON.stringify(c.controls.GetDebugInfo(),null,2)),children:[Be.jsx(cl,{icon:nte,className:Ts["error-message__icon"]}),"Copy Troubleshooting Info"]})]}):null,c?e.playerOptions.ui===Kt.ui.WEB?Be.jsx(mte,{player:c,playbackStarted:!!N,canPlay:X,recentlyInteracted:x,setRecentUserAction:J,className:Ts.controls}):Be.jsx(Ite,{player:c,playbackStarted:!!N,canPlay:X,recentlyInteracted:x,setRecentUserAction:J,className:Ts.controls}):null,P?Be.jsx(ute,{action:P},`action-indicator-${P&&P.key}`):null]})},Kte=({parameters:r,...e})=>{const[t,a]=Ft.useState(Math.random()),[s,u]=Ft.useState();return Ft.createElement(Wte,{...e,SetAdditionalParameters:u,parameters:s?_8(r,s):r,key:`player-${t}`,Reset:()=>a(Math.random())})},Yte=(r,e)=>(r.innerHTML="",r.classList.add(lq.reset),r.classList.add(Ts["player-target"]),e=YI(e),e.playerOptions&&e.playerOptions.backgroundColor&&(r.style.backgroundColor=e.playerOptions.backgroundColor),new Promise((t,a)=>{const s=_q.createRoot(r);s.render(Be.jsx(oq.StrictMode,{children:Be.jsx(Kte,{target:r,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=Yte;exports.PlayerParameters=Kt;exports.commonjsGlobal=vu;exports.crypto=mL;exports.getDefaultExportFromCjs=gc;exports.require$$3=e_;exports.requireBuffer=Og;exports.requireEvents=jg;exports.requireInherits_browser=rN;exports.requireString_decoder=NP;
|