libpgs
Version:
Renderer for graphical subtitles (PGS) in the browser.
1 lines • 61.8 kB
JavaScript
var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=function(t){return t&&t.Math===Math&&t},r=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof t&&t)||e("object"==typeof t&&t)||function(){return this}()||Function("return this")(),n={},o=function(t){try{return!!t()}catch(t){return!0}},i=!o((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),a=!o((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),s=a,u=Function.prototype.call,c=s?u.bind(u):function(){return u.apply(u,arguments)},f={},h={}.propertyIsEnumerable,p=Object.getOwnPropertyDescriptor,d=p&&!h.call({1:2},1);f.f=d?function(t){var e=p(this,t);return!!e&&e.enumerable}:h;var l,y,v=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},m=a,b=Function.prototype,g=b.call,w=m&&b.bind.bind(g,g),T=m?w:function(t){return function(){return g.apply(t,arguments)}},O=T,S=O({}.toString),P=O("".slice),j=function(t){return P(S(t),8,-1)},E=o,A=j,I=Object,U=T("".split),R=E((function(){return!I("z").propertyIsEnumerable(0)}))?function(t){return"String"===A(t)?U(t,""):I(t)}:I,x=function(t){return null==t},D=x,C=TypeError,B=function(t){if(D(t))throw new C("Can't call method on "+t);return t},k=R,_=B,F=function(t){return k(_(t))},L="object"==typeof document&&document.all,N=void 0===L&&void 0!==L?function(t){return"function"==typeof t||t===L}:function(t){return"function"==typeof t},M=N,$=function(t){return"object"==typeof t?null!==t:M(t)},H=r,W=N,q=function(t,e){return arguments.length<2?(r=H[t],W(r)?r:void 0):H[t]&&H[t][e];var r},G=T({}.isPrototypeOf),V=r.navigator,z=V&&V.userAgent,X=z?String(z):"",J=r,Y=X,K=J.process,Z=J.Deno,Q=K&&K.versions||Z&&Z.version,tt=Q&&Q.v8;tt&&(y=(l=tt.split("."))[0]>0&&l[0]<4?1:+(l[0]+l[1])),!y&&Y&&(!(l=Y.match(/Edge\/(\d+)/))||l[1]>=74)&&(l=Y.match(/Chrome\/(\d+)/))&&(y=+l[1]);var et=y,rt=et,nt=o,ot=r.String,it=!!Object.getOwnPropertySymbols&&!nt((function(){var t=Symbol("symbol detection");return!ot(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&rt&&rt<41})),at=it&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,st=q,ut=N,ct=G,ft=Object,ht=at?function(t){return"symbol"==typeof t}:function(t){var e=st("Symbol");return ut(e)&&ct(e.prototype,ft(t))},pt=String,dt=function(t){try{return pt(t)}catch(t){return"Object"}},lt=N,yt=dt,vt=TypeError,mt=function(t){if(lt(t))return t;throw new vt(yt(t)+" is not a function")},bt=mt,gt=x,wt=function(t,e){var r=t[e];return gt(r)?void 0:bt(r)},Tt=c,Ot=N,St=$,Pt=TypeError,jt={exports:{}},Et=r,At=Object.defineProperty,It=function(t,e){try{At(Et,t,{value:e,configurable:!0,writable:!0})}catch(r){Et[t]=e}return e},Ut=r,Rt=It,xt="__core-js_shared__",Dt=jt.exports=Ut[xt]||Rt(xt,{});(Dt.versions||(Dt.versions=[])).push({version:"3.38.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Ct=jt.exports,Bt=Ct,kt=function(t,e){return Bt[t]||(Bt[t]=e||{})},_t=B,Ft=Object,Lt=function(t){return Ft(_t(t))},Nt=Lt,Mt=T({}.hasOwnProperty),$t=Object.hasOwn||function(t,e){return Mt(Nt(t),e)},Ht=T,Wt=0,qt=Math.random(),Gt=Ht(1..toString),Vt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Gt(++Wt+qt,36)},zt=kt,Xt=$t,Jt=Vt,Yt=it,Kt=at,Zt=r.Symbol,Qt=zt("wks"),te=Kt?Zt.for||Zt:Zt&&Zt.withoutSetter||Jt,ee=function(t){return Xt(Qt,t)||(Qt[t]=Yt&&Xt(Zt,t)?Zt[t]:te("Symbol."+t)),Qt[t]},re=c,ne=$,oe=ht,ie=wt,ae=function(t,e){var r,n;if("string"===e&&Ot(r=t.toString)&&!St(n=Tt(r,t)))return n;if(Ot(r=t.valueOf)&&!St(n=Tt(r,t)))return n;if("string"!==e&&Ot(r=t.toString)&&!St(n=Tt(r,t)))return n;throw new Pt("Can't convert object to primitive value")},se=TypeError,ue=ee("toPrimitive"),ce=function(t,e){if(!ne(t)||oe(t))return t;var r,n=ie(t,ue);if(n){if(void 0===e&&(e="default"),r=re(n,t,e),!ne(r)||oe(r))return r;throw new se("Can't convert object to primitive value")}return void 0===e&&(e="number"),ae(t,e)},fe=ht,he=function(t){var e=ce(t,"string");return fe(e)?e:e+""},pe=$,de=r.document,le=pe(de)&&pe(de.createElement),ye=function(t){return le?de.createElement(t):{}},ve=ye,me=!i&&!o((function(){return 7!==Object.defineProperty(ve("div"),"a",{get:function(){return 7}}).a})),be=i,ge=c,we=f,Te=v,Oe=F,Se=he,Pe=$t,je=me,Ee=Object.getOwnPropertyDescriptor;n.f=be?Ee:function(t,e){if(t=Oe(t),e=Se(e),je)try{return Ee(t,e)}catch(t){}if(Pe(t,e))return Te(!ge(we.f,t,e),t[e])};var Ae={},Ie=i&&o((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Ue=$,Re=String,xe=TypeError,De=function(t){if(Ue(t))return t;throw new xe(Re(t)+" is not an object")},Ce=i,Be=me,ke=Ie,_e=De,Fe=he,Le=TypeError,Ne=Object.defineProperty,Me=Object.getOwnPropertyDescriptor,$e="enumerable",He="configurable",We="writable";Ae.f=Ce?ke?function(t,e,r){if(_e(t),e=Fe(e),_e(r),"function"==typeof t&&"prototype"===e&&"value"in r&&We in r&&!r[We]){var n=Me(t,e);n&&n[We]&&(t[e]=r.value,r={configurable:He in r?r[He]:n[He],enumerable:$e in r?r[$e]:n[$e],writable:!1})}return Ne(t,e,r)}:Ne:function(t,e,r){if(_e(t),e=Fe(e),_e(r),Be)try{return Ne(t,e,r)}catch(t){}if("get"in r||"set"in r)throw new Le("Accessors not supported");return"value"in r&&(t[e]=r.value),t};var qe=Ae,Ge=v,Ve=i?function(t,e,r){return qe.f(t,e,Ge(1,r))}:function(t,e,r){return t[e]=r,t},ze={exports:{}},Xe=i,Je=$t,Ye=Function.prototype,Ke=Xe&&Object.getOwnPropertyDescriptor,Ze=Je(Ye,"name"),Qe={EXISTS:Ze,PROPER:Ze&&"something"===function(){}.name,CONFIGURABLE:Ze&&(!Xe||Xe&&Ke(Ye,"name").configurable)},tr=N,er=Ct,rr=T(Function.toString);tr(er.inspectSource)||(er.inspectSource=function(t){return rr(t)});var nr,or,ir,ar=er.inspectSource,sr=N,ur=r.WeakMap,cr=sr(ur)&&/native code/.test(String(ur)),fr=Vt,hr=kt("keys"),pr=function(t){return hr[t]||(hr[t]=fr(t))},dr={},lr=cr,yr=r,vr=$,mr=Ve,br=$t,gr=Ct,wr=pr,Tr=dr,Or="Object already initialized",Sr=yr.TypeError,Pr=yr.WeakMap;if(lr||gr.state){var jr=gr.state||(gr.state=new Pr);jr.get=jr.get,jr.has=jr.has,jr.set=jr.set,nr=function(t,e){if(jr.has(t))throw new Sr(Or);return e.facade=t,jr.set(t,e),e},or=function(t){return jr.get(t)||{}},ir=function(t){return jr.has(t)}}else{var Er=wr("state");Tr[Er]=!0,nr=function(t,e){if(br(t,Er))throw new Sr(Or);return e.facade=t,mr(t,Er,e),e},or=function(t){return br(t,Er)?t[Er]:{}},ir=function(t){return br(t,Er)}}var Ar={set:nr,get:or,has:ir,enforce:function(t){return ir(t)?or(t):nr(t,{})},getterFor:function(t){return function(e){var r;if(!vr(e)||(r=or(e)).type!==t)throw new Sr("Incompatible receiver, "+t+" required");return r}}},Ir=T,Ur=o,Rr=N,xr=$t,Dr=i,Cr=Qe.CONFIGURABLE,Br=ar,kr=Ar.enforce,_r=Ar.get,Fr=String,Lr=Object.defineProperty,Nr=Ir("".slice),Mr=Ir("".replace),$r=Ir([].join),Hr=Dr&&!Ur((function(){return 8!==Lr((function(){}),"length",{value:8}).length})),Wr=String(String).split("String"),qr=ze.exports=function(t,e,r){"Symbol("===Nr(Fr(e),0,7)&&(e="["+Mr(Fr(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!xr(t,"name")||Cr&&t.name!==e)&&(Dr?Lr(t,"name",{value:e,configurable:!0}):t.name=e),Hr&&r&&xr(r,"arity")&&t.length!==r.arity&&Lr(t,"length",{value:r.arity});try{r&&xr(r,"constructor")&&r.constructor?Dr&&Lr(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=kr(t);return xr(n,"source")||(n.source=$r(Wr,"string"==typeof e?e:"")),t};Function.prototype.toString=qr((function(){return Rr(this)&&_r(this).source||Br(this)}),"toString");var Gr=ze.exports,Vr=N,zr=Ae,Xr=Gr,Jr=It,Yr=function(t,e,r,n){n||(n={});var o=n.enumerable,i=void 0!==n.name?n.name:e;if(Vr(r)&&Xr(r,i,n),n.global)o?t[e]=r:Jr(e,r);else{try{n.unsafe?t[e]&&(o=!0):delete t[e]}catch(t){}o?t[e]=r:zr.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},Kr={},Zr=Math.ceil,Qr=Math.floor,tn=Math.trunc||function(t){var e=+t;return(e>0?Qr:Zr)(e)},en=function(t){var e=+t;return e!=e||0===e?0:tn(e)},rn=en,nn=Math.max,on=Math.min,an=en,sn=Math.min,un=function(t){var e=an(t);return e>0?sn(e,9007199254740991):0},cn=function(t){return un(t.length)},fn=F,hn=function(t,e){var r=rn(t);return r<0?nn(r+e,0):on(r,e)},pn=cn,dn=function(t){return function(e,r,n){var o=fn(e),i=pn(o);if(0===i)return!t&&-1;var a,s=hn(n,i);if(t&&r!=r){for(;i>s;)if((a=o[s++])!=a)return!0}else for(;i>s;s++)if((t||s in o)&&o[s]===r)return t||s||0;return!t&&-1}},ln={includes:dn(!0),indexOf:dn(!1)},yn=$t,vn=F,mn=ln.indexOf,bn=dr,gn=T([].push),wn=function(t,e){var r,n=vn(t),o=0,i=[];for(r in n)!yn(bn,r)&&yn(n,r)&&gn(i,r);for(;e.length>o;)yn(n,r=e[o++])&&(~mn(i,r)||gn(i,r));return i},Tn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],On=wn,Sn=Tn.concat("length","prototype");Kr.f=Object.getOwnPropertyNames||function(t){return On(t,Sn)};var Pn={};Pn.f=Object.getOwnPropertySymbols;var jn=q,En=Kr,An=Pn,In=De,Un=T([].concat),Rn=jn("Reflect","ownKeys")||function(t){var e=En.f(In(t)),r=An.f;return r?Un(e,r(t)):e},xn=$t,Dn=Rn,Cn=n,Bn=Ae,kn=function(t,e,r){for(var n=Dn(e),o=Bn.f,i=Cn.f,a=0;a<n.length;a++){var s=n[a];xn(t,s)||r&&xn(r,s)||o(t,s,i(e,s))}},_n=o,Fn=N,Ln=/#|\.prototype\./,Nn=function(t,e){var r=$n[Mn(t)];return r===Wn||r!==Hn&&(Fn(e)?_n(e):!!e)},Mn=Nn.normalize=function(t){return String(t).replace(Ln,".").toLowerCase()},$n=Nn.data={},Hn=Nn.NATIVE="N",Wn=Nn.POLYFILL="P",qn=Nn,Gn=r,Vn=n.f,zn=Ve,Xn=Yr,Jn=It,Yn=kn,Kn=qn,Zn=function(t,e){var r,n,o,i,a,s=t.target,u=t.global,c=t.stat;if(r=u?Gn:c?Gn[s]||Jn(s,{}):Gn[s]&&Gn[s].prototype)for(n in e){if(i=e[n],o=t.dontCallGetSet?(a=Vn(r,n))&&a.value:r[n],!Kn(u?n:s+(c?".":"#")+n,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;Yn(i,o)}(t.sham||o&&o.sham)&&zn(i,"sham",!0),Xn(r,n,i,t)}},Qn=!o((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),to=$t,eo=N,ro=Lt,no=Qn,oo=pr("IE_PROTO"),io=Object,ao=io.prototype,so=no?io.getPrototypeOf:function(t){var e=ro(t);if(to(e,oo))return e[oo];var r=e.constructor;return eo(r)&&e instanceof r?r.prototype:e instanceof io?ao:null},uo=T,co=mt,fo=$,ho=function(t){return fo(t)||null===t},po=String,lo=TypeError,yo=function(t,e,r){try{return uo(co(Object.getOwnPropertyDescriptor(t,e)[r]))}catch(t){}},vo=$,mo=B,bo=function(t){if(ho(t))return t;throw new lo("Can't set "+po(t)+" as a prototype")},go=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=yo(Object.prototype,"__proto__","set"))(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return mo(r),bo(n),vo(r)?(e?t(r,n):r.__proto__=n,r):r}}():void 0),wo={},To=wn,Oo=Tn,So=Object.keys||function(t){return To(t,Oo)},Po=i,jo=Ie,Eo=Ae,Ao=De,Io=F,Uo=So;wo.f=Po&&!jo?Object.defineProperties:function(t,e){Ao(t);for(var r,n=Io(e),o=Uo(e),i=o.length,a=0;i>a;)Eo.f(t,r=o[a++],n[r]);return t};var Ro,xo=q("document","documentElement"),Do=De,Co=wo,Bo=Tn,ko=dr,_o=xo,Fo=ye,Lo="prototype",No="script",Mo=pr("IE_PROTO"),$o=function(){},Ho=function(t){return"<"+No+">"+t+"</"+No+">"},Wo=function(t){t.write(Ho("")),t.close();var e=t.parentWindow.Object;return t=null,e},qo=function(){try{Ro=new ActiveXObject("htmlfile")}catch(t){}var t,e,r;qo="undefined"!=typeof document?document.domain&&Ro?Wo(Ro):(e=Fo("iframe"),r="java"+No+":",e.style.display="none",_o.appendChild(e),e.src=String(r),(t=e.contentWindow.document).open(),t.write(Ho("document.F=Object")),t.close(),t.F):Wo(Ro);for(var n=Bo.length;n--;)delete qo[Lo][Bo[n]];return qo()};ko[Mo]=!0;var Go=Object.create||function(t,e){var r;return null!==t?($o[Lo]=Do(t),r=new $o,$o[Lo]=null,r[Mo]=t):r=qo(),void 0===e?r:Co.f(r,e)},Vo=$,zo=Ve,Xo=Error,Jo=T("".replace),Yo=String(new Xo("zxcasd").stack),Ko=/\n\s*at [^:]*:[^\n]*/,Zo=Ko.test(Yo),Qo=v,ti=!o((function(){var t=new Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",Qo(1,7)),7!==t.stack)})),ei=Ve,ri=function(t,e){if(Zo&&"string"==typeof t&&!Xo.prepareStackTrace)for(;e--;)t=Jo(t,Ko,"");return t},ni=ti,oi=Error.captureStackTrace,ii=j,ai=T,si=function(t){if("Function"===ii(t))return ai(t)},ui=mt,ci=a,fi=si(si.bind),hi=function(t,e){return ui(t),void 0===e?t:ci?fi(t,e):function(){return t.apply(e,arguments)}},pi={},di=pi,li=ee("iterator"),yi=Array.prototype,vi={};vi[ee("toStringTag")]="z";var mi="[object z]"===String(vi),bi=mi,gi=N,wi=j,Ti=ee("toStringTag"),Oi=Object,Si="Arguments"===wi(function(){return arguments}()),Pi=bi?wi:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=Oi(t),Ti))?r:Si?wi(e):"Object"===(n=wi(e))&&gi(e.callee)?"Arguments":n},ji=Pi,Ei=wt,Ai=x,Ii=pi,Ui=ee("iterator"),Ri=function(t){if(!Ai(t))return Ei(t,Ui)||Ei(t,"@@iterator")||Ii[ji(t)]},xi=c,Di=mt,Ci=De,Bi=dt,ki=Ri,_i=TypeError,Fi=c,Li=De,Ni=wt,Mi=hi,$i=c,Hi=De,Wi=dt,qi=function(t){return void 0!==t&&(di.Array===t||yi[li]===t)},Gi=cn,Vi=G,zi=function(t,e){var r=arguments.length<2?ki(t):e;if(Di(r))return Ci(xi(r,t));throw new _i(Bi(t)+" is not iterable")},Xi=Ri,Ji=function(t,e,r){var n,o;Li(t);try{if(!(n=Ni(t,"return"))){if("throw"===e)throw r;return r}n=Fi(n,t)}catch(t){o=!0,n=t}if("throw"===e)throw r;if(o)throw n;return Li(n),r},Yi=TypeError,Ki=function(t,e){this.stopped=t,this.result=e},Zi=Ki.prototype,Qi=function(t,e,r){var n,o,i,a,s,u,c,f=r&&r.that,h=!(!r||!r.AS_ENTRIES),p=!(!r||!r.IS_RECORD),d=!(!r||!r.IS_ITERATOR),l=!(!r||!r.INTERRUPTED),y=Mi(e,f),v=function(t){return n&&Ji(n,"normal",t),new Ki(!0,t)},m=function(t){return h?(Hi(t),l?y(t[0],t[1],v):y(t[0],t[1])):l?y(t,v):y(t)};if(p)n=t.iterator;else if(d)n=t;else{if(!(o=Xi(t)))throw new Yi(Wi(t)+" is not iterable");if(qi(o)){for(i=0,a=Gi(t);a>i;i++)if((s=m(t[i]))&&Vi(Zi,s))return s;return new Ki(!1)}n=zi(t,o)}for(u=p?t.next:n.next;!(c=$i(u,n)).done;){try{s=m(c.value)}catch(t){Ji(n,"throw",t)}if("object"==typeof s&&s&&Vi(Zi,s))return s}return new Ki(!1)},ta=Pi,ea=String,ra=function(t){if("Symbol"===ta(t))throw new TypeError("Cannot convert a Symbol value to a string");return ea(t)},na=ra,oa=Zn,ia=G,aa=so,sa=go,ua=kn,ca=Go,fa=Ve,ha=v,pa=function(t,e){Vo(e)&&"cause"in e&&zo(t,"cause",e.cause)},da=function(t,e,r,n){ni&&(oi?oi(t,e):ei(t,"stack",ri(r,n)))},la=Qi,ya=function(t,e){return void 0===t?arguments.length<2?"":e:na(t)},va=ee("toStringTag"),ma=Error,ba=[].push,ga=function(t,e){var r,n=ia(wa,this);sa?r=sa(new ma,n?aa(this):wa):(r=n?this:ca(wa),fa(r,va,"Error")),void 0!==e&&fa(r,"message",ya(e)),da(r,ga,r.stack,1),arguments.length>2&&pa(r,arguments[2]);var o=[];return la(t,ba,{that:o}),fa(r,"errors",o),r};sa?sa(ga,ma):ua(ga,ma,{name:!0});var wa=ga.prototype=ca(ma.prototype,{constructor:ha(1,ga),message:ha(1,""),name:ha(1,"AggregateError")});oa({global:!0,constructor:!0,arity:2},{AggregateError:ga});var Ta=ee,Oa=Go,Sa=Ae.f,Pa=Ta("unscopables"),ja=Array.prototype;void 0===ja[Pa]&&Sa(ja,Pa,{configurable:!0,value:Oa(null)});var Ea,Aa,Ia,Ua=o,Ra=N,xa=$,Da=so,Ca=Yr,Ba=ee("iterator"),ka=!1;[].keys&&("next"in(Ia=[].keys())?(Aa=Da(Da(Ia)))!==Object.prototype&&(Ea=Aa):ka=!0);var _a=!xa(Ea)||Ua((function(){var t={};return Ea[Ba].call(t)!==t}));_a&&(Ea={}),Ra(Ea[Ba])||Ca(Ea,Ba,(function(){return this}));var Fa={IteratorPrototype:Ea,BUGGY_SAFARI_ITERATORS:ka},La=Ae.f,Na=$t,Ma=ee("toStringTag"),$a=function(t,e,r){t&&!r&&(t=t.prototype),t&&!Na(t,Ma)&&La(t,Ma,{configurable:!0,value:e})},Ha=Fa.IteratorPrototype,Wa=Go,qa=v,Ga=$a,Va=pi,za=function(){return this},Xa=Zn,Ja=c,Ya=N,Ka=function(t,e,r,n){var o=e+" Iterator";return t.prototype=Wa(Ha,{next:qa(+!n,r)}),Ga(t,o,!1),Va[o]=za,t},Za=so,Qa=go,ts=$a,es=Ve,rs=Yr,ns=pi,os=Qe.PROPER,is=Qe.CONFIGURABLE,as=Fa.IteratorPrototype,ss=Fa.BUGGY_SAFARI_ITERATORS,us=ee("iterator"),cs="keys",fs="values",hs="entries",ps=function(){return this},ds=function(t,e,r,n,o,i,a){Ka(r,e,n);var s,u,c,f=function(t){if(t===o&&y)return y;if(!ss&&t&&t in d)return d[t];switch(t){case cs:case fs:case hs:return function(){return new r(this,t)}}return function(){return new r(this)}},h=e+" Iterator",p=!1,d=t.prototype,l=d[us]||d["@@iterator"]||o&&d[o],y=!ss&&l||f(o),v="Array"===e&&d.entries||l;if(v&&(s=Za(v.call(new t)))!==Object.prototype&&s.next&&(Za(s)!==as&&(Qa?Qa(s,as):Ya(s[us])||rs(s,us,ps)),ts(s,h,!0)),os&&o===fs&&l&&l.name!==fs&&(is?es(d,"name",fs):(p=!0,y=function(){return Ja(l,this)})),o)if(u={values:f(fs),keys:i?y:f(cs),entries:f(hs)},a)for(c in u)(ss||p||!(c in d))&&rs(d,c,u[c]);else Xa({target:e,proto:!0,forced:ss||p},u);return d[us]!==y&&rs(d,us,y,{name:o}),ns[e]=y,u},ls=function(t,e){return{value:t,done:e}},ys=F,vs=function(t){ja[Pa][t]=!0},ms=pi,bs=Ar,gs=Ae.f,ws=ds,Ts=ls,Os=i,Ss="Array Iterator",Ps=bs.set,js=bs.getterFor(Ss),Es=ws(Array,"Array",(function(t,e){Ps(this,{type:Ss,target:ys(t),index:0,kind:e})}),(function(){var t=js(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=null,Ts(void 0,!0);switch(t.kind){case"keys":return Ts(r,!1);case"values":return Ts(e[r],!1)}return Ts([r,e[r]],!1)}),"values"),As=ms.Arguments=ms.Array;if(vs("keys"),vs("values"),vs("entries"),Os&&"values"!==As.name)try{gs(As,"name",{value:"values"})}catch(t){}var Is=Pi,Us=mi?{}.toString:function(){return"[object "+Is(this)+"]"};mi||Yr(Object.prototype,"toString",Us,{unsafe:!0});var Rs=r,xs=X,Ds=j,Cs=function(t){return xs.slice(0,t.length)===t},Bs=Cs("Bun/")?"BUN":Cs("Cloudflare-Workers")?"CLOUDFLARE":Cs("Deno/")?"DENO":Cs("Node.js/")?"NODE":Rs.Bun&&"string"==typeof Bun.version?"BUN":Rs.Deno&&"object"==typeof Deno.version?"DENO":"process"===Ds(Rs.process)?"NODE":Rs.window&&Rs.document?"BROWSER":"REST",ks="NODE"===Bs,_s=Gr,Fs=Ae,Ls=q,Ns=function(t,e,r){return r.get&&_s(r.get,e,{getter:!0}),r.set&&_s(r.set,e,{setter:!0}),Fs.f(t,e,r)},Ms=i,$s=ee("species"),Hs=G,Ws=TypeError,qs=T,Gs=o,Vs=N,zs=Pi,Xs=ar,Js=function(){},Ys=q("Reflect","construct"),Ks=/^\s*(?:class|function)\b/,Zs=qs(Ks.exec),Qs=!Ks.test(Js),tu=function(t){if(!Vs(t))return!1;try{return Ys(Js,[],t),!0}catch(t){return!1}},eu=function(t){if(!Vs(t))return!1;switch(zs(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Qs||!!Zs(Ks,Xs(t))}catch(t){return!0}};eu.sham=!0;var ru,nu,ou,iu,au=!Ys||Gs((function(){var t;return tu(tu.call)||!tu(Object)||!tu((function(){t=!0}))||t}))?eu:tu,su=au,uu=dt,cu=TypeError,fu=De,hu=function(t){if(su(t))return t;throw new cu(uu(t)+" is not a constructor")},pu=x,du=ee("species"),lu=function(t,e){var r,n=fu(t).constructor;return void 0===n||pu(r=fu(n)[du])?e:hu(r)},yu=a,vu=Function.prototype,mu=vu.apply,bu=vu.call,gu="object"==typeof Reflect&&Reflect.apply||(yu?bu.bind(mu):function(){return bu.apply(mu,arguments)}),wu=T([].slice),Tu=TypeError,Ou=/(?:ipad|iphone|ipod).*applewebkit/i.test(X),Su=r,Pu=gu,ju=hi,Eu=N,Au=$t,Iu=o,Uu=xo,Ru=wu,xu=ye,Du=function(t,e){if(t<e)throw new Tu("Not enough arguments");return t},Cu=Ou,Bu=ks,ku=Su.setImmediate,_u=Su.clearImmediate,Fu=Su.process,Lu=Su.Dispatch,Nu=Su.Function,Mu=Su.MessageChannel,$u=Su.String,Hu=0,Wu={},qu="onreadystatechange";Iu((function(){ru=Su.location}));var Gu=function(t){if(Au(Wu,t)){var e=Wu[t];delete Wu[t],e()}},Vu=function(t){return function(){Gu(t)}},zu=function(t){Gu(t.data)},Xu=function(t){Su.postMessage($u(t),ru.protocol+"//"+ru.host)};ku&&_u||(ku=function(t){Du(arguments.length,1);var e=Eu(t)?t:Nu(t),r=Ru(arguments,1);return Wu[++Hu]=function(){Pu(e,void 0,r)},nu(Hu),Hu},_u=function(t){delete Wu[t]},Bu?nu=function(t){Fu.nextTick(Vu(t))}:Lu&&Lu.now?nu=function(t){Lu.now(Vu(t))}:Mu&&!Cu?(iu=(ou=new Mu).port2,ou.port1.onmessage=zu,nu=ju(iu.postMessage,iu)):Su.addEventListener&&Eu(Su.postMessage)&&!Su.importScripts&&ru&&"file:"!==ru.protocol&&!Iu(Xu)?(nu=Xu,Su.addEventListener("message",zu,!1)):nu=qu in xu("script")?function(t){Uu.appendChild(xu("script"))[qu]=function(){Uu.removeChild(this),Gu(t)}}:function(t){setTimeout(Vu(t),0)});var Ju={set:ku,clear:_u},Yu=r,Ku=i,Zu=Object.getOwnPropertyDescriptor,Qu=function(){this.head=null,this.tail=null};Qu.prototype={add:function(t){var e={item:t,next:null},r=this.tail;r?r.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}};var tc,ec,rc,nc,oc,ic=Qu,ac=/ipad|iphone|ipod/i.test(X)&&"undefined"!=typeof Pebble,sc=/web0s(?!.*chrome)/i.test(X),uc=r,cc=function(t){if(!Ku)return Yu[t];var e=Zu(Yu,t);return e&&e.value},fc=hi,hc=Ju.set,pc=ic,dc=Ou,lc=ac,yc=sc,vc=ks,mc=uc.MutationObserver||uc.WebKitMutationObserver,bc=uc.document,gc=uc.process,wc=uc.Promise,Tc=cc("queueMicrotask");if(!Tc){var Oc=new pc,Sc=function(){var t,e;for(vc&&(t=gc.domain)&&t.exit();e=Oc.get();)try{e()}catch(t){throw Oc.head&&tc(),t}t&&t.enter()};dc||vc||yc||!mc||!bc?!lc&&wc&&wc.resolve?((nc=wc.resolve(void 0)).constructor=wc,oc=fc(nc.then,nc),tc=function(){oc(Sc)}):vc?tc=function(){gc.nextTick(Sc)}:(hc=fc(hc,uc),tc=function(){hc(Sc)}):(ec=!0,rc=bc.createTextNode(""),new mc(Sc).observe(rc,{characterData:!0}),tc=function(){rc.data=ec=!ec}),Tc=function(t){Oc.head||tc(),Oc.add(t)}}var Pc=Tc,jc=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},Ec=r.Promise,Ac=r,Ic=Ec,Uc=N,Rc=qn,xc=ar,Dc=ee,Cc=Bs,Bc=et;Ic&&Ic.prototype;var kc=Dc("species"),_c=!1,Fc=Uc(Ac.PromiseRejectionEvent),Lc=Rc("Promise",(function(){var t=xc(Ic),e=t!==String(Ic);if(!e&&66===Bc)return!0;if(!Bc||Bc<51||!/native code/.test(t)){var r=new Ic((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))};if((r.constructor={})[kc]=n,!(_c=r.then((function(){}))instanceof n))return!0}return!(e||"BROWSER"!==Cc&&"DENO"!==Cc||Fc)})),Nc={CONSTRUCTOR:Lc,REJECTION_EVENT:Fc,SUBCLASSING:_c},Mc={},$c=mt,Hc=TypeError,Wc=function(t){var e,r;this.promise=new t((function(t,n){if(void 0!==e||void 0!==r)throw new Hc("Bad Promise constructor");e=t,r=n})),this.resolve=$c(e),this.reject=$c(r)};Mc.f=function(t){return new Wc(t)};var qc,Gc,Vc,zc=Zn,Xc=ks,Jc=r,Yc=c,Kc=Yr,Zc=go,Qc=$a,tf=function(t){var e=Ls(t);Ms&&e&&!e[$s]&&Ns(e,$s,{configurable:!0,get:function(){return this}})},ef=mt,rf=N,nf=$,of=function(t,e){if(Hs(e,t))return t;throw new Ws("Incorrect invocation")},af=lu,sf=Ju.set,uf=Pc,cf=function(t,e){try{1===arguments.length?console.error(t):console.error(t,e)}catch(t){}},ff=jc,hf=ic,pf=Ar,df=Ec,lf=Mc,yf="Promise",vf=Nc.CONSTRUCTOR,mf=Nc.REJECTION_EVENT,bf=Nc.SUBCLASSING,gf=pf.getterFor(yf),wf=pf.set,Tf=df&&df.prototype,Of=df,Sf=Tf,Pf=Jc.TypeError,jf=Jc.document,Ef=Jc.process,Af=lf.f,If=Af,Uf=!!(jf&&jf.createEvent&&Jc.dispatchEvent),Rf="unhandledrejection",xf=function(t){var e;return!(!nf(t)||!rf(e=t.then))&&e},Df=function(t,e){var r,n,o,i=e.value,a=1===e.state,s=a?t.ok:t.fail,u=t.resolve,c=t.reject,f=t.domain;try{s?(a||(2===e.rejection&&Ff(e),e.rejection=1),!0===s?r=i:(f&&f.enter(),r=s(i),f&&(f.exit(),o=!0)),r===t.promise?c(new Pf("Promise-chain cycle")):(n=xf(r))?Yc(n,r,u,c):u(r)):c(i)}catch(t){f&&!o&&f.exit(),c(t)}},Cf=function(t,e){t.notified||(t.notified=!0,uf((function(){for(var r,n=t.reactions;r=n.get();)Df(r,t);t.notified=!1,e&&!t.rejection&&kf(t)})))},Bf=function(t,e,r){var n,o;Uf?((n=jf.createEvent("Event")).promise=e,n.reason=r,n.initEvent(t,!1,!0),Jc.dispatchEvent(n)):n={promise:e,reason:r},!mf&&(o=Jc["on"+t])?o(n):t===Rf&&cf("Unhandled promise rejection",r)},kf=function(t){Yc(sf,Jc,(function(){var e,r=t.facade,n=t.value;if(_f(t)&&(e=ff((function(){Xc?Ef.emit("unhandledRejection",n,r):Bf(Rf,r,n)})),t.rejection=Xc||_f(t)?2:1,e.error))throw e.value}))},_f=function(t){return 1!==t.rejection&&!t.parent},Ff=function(t){Yc(sf,Jc,(function(){var e=t.facade;Xc?Ef.emit("rejectionHandled",e):Bf("rejectionhandled",e,t.value)}))},Lf=function(t,e,r){return function(n){t(e,n,r)}},Nf=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=2,Cf(t,!0))},Mf=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw new Pf("Promise can't be resolved itself");var n=xf(e);n?uf((function(){var r={done:!1};try{Yc(n,e,Lf(Mf,r,t),Lf(Nf,r,t))}catch(e){Nf(r,e,t)}})):(t.value=e,t.state=1,Cf(t,!1))}catch(e){Nf({done:!1},e,t)}}};if(vf&&(Sf=(Of=function(t){of(this,Sf),ef(t),Yc(qc,this);var e=gf(this);try{t(Lf(Mf,e),Lf(Nf,e))}catch(t){Nf(e,t)}}).prototype,(qc=function(t){wf(this,{type:yf,done:!1,notified:!1,parent:!1,reactions:new hf,rejection:!1,state:0,value:null})}).prototype=Kc(Sf,"then",(function(t,e){var r=gf(this),n=Af(af(this,Of));return r.parent=!0,n.ok=!rf(t)||t,n.fail=rf(e)&&e,n.domain=Xc?Ef.domain:void 0,0===r.state?r.reactions.add(n):uf((function(){Df(n,r)})),n.promise})),Gc=function(){var t=new qc,e=gf(t);this.promise=t,this.resolve=Lf(Mf,e),this.reject=Lf(Nf,e)},lf.f=Af=function(t){return t===Of||undefined===t?new Gc(t):If(t)},rf(df)&&Tf!==Object.prototype)){Vc=Tf.then,bf||Kc(Tf,"then",(function(t,e){var r=this;return new Of((function(t,e){Yc(Vc,r,t,e)})).then(t,e)}),{unsafe:!0});try{delete Tf.constructor}catch(t){}Zc&&Zc(Tf,Sf)}zc({global:!0,constructor:!0,wrap:!0,forced:vf},{Promise:Of}),Qc(Of,yf,!1),tf(yf);var $f=ee("iterator"),Hf=!1;try{var Wf=0,qf={next:function(){return{done:!!Wf++}},return:function(){Hf=!0}};qf[$f]=function(){return this},Array.from(qf,(function(){throw 2}))}catch(t){}var Gf=Ec,Vf=function(t,e){try{if(!e&&!Hf)return!1}catch(t){return!1}var r=!1;try{var n={};n[$f]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch(t){}return r},zf=Nc.CONSTRUCTOR||!Vf((function(t){Gf.all(t).then(void 0,(function(){}))})),Xf=c,Jf=mt,Yf=Mc,Kf=jc,Zf=Qi;Zn({target:"Promise",stat:!0,forced:zf},{all:function(t){var e=this,r=Yf.f(e),n=r.resolve,o=r.reject,i=Kf((function(){var r=Jf(e.resolve),i=[],a=0,s=1;Zf(t,(function(t){var u=a++,c=!1;s++,Xf(r,e,t).then((function(t){c||(c=!0,i[u]=t,--s||n(i))}),o)})),--s||n(i)}));return i.error&&o(i.value),r.promise}});var Qf=Zn,th=Nc.CONSTRUCTOR,eh=Ec,rh=q,nh=N,oh=Yr,ih=eh&&eh.prototype;if(Qf({target:"Promise",proto:!0,forced:th,real:!0},{catch:function(t){return this.then(void 0,t)}}),nh(eh)){var ah=rh("Promise").prototype.catch;ih.catch!==ah&&oh(ih,"catch",ah,{unsafe:!0})}var sh=c,uh=mt,ch=Mc,fh=jc,hh=Qi;Zn({target:"Promise",stat:!0,forced:zf},{race:function(t){var e=this,r=ch.f(e),n=r.reject,o=fh((function(){var o=uh(e.resolve);hh(t,(function(t){sh(o,e,t).then(r.resolve,n)}))}));return o.error&&n(o.value),r.promise}});var ph=Mc;Zn({target:"Promise",stat:!0,forced:Nc.CONSTRUCTOR},{reject:function(t){var e=ph.f(this);return(0,e.reject)(t),e.promise}});var dh=De,lh=$,yh=Mc,vh=function(t,e){if(dh(t),lh(e)&&e.constructor===t)return e;var r=yh.f(t);return(0,r.resolve)(e),r.promise},mh=Zn,bh=Nc.CONSTRUCTOR,gh=vh;q("Promise"),mh({target:"Promise",stat:!0,forced:bh},{resolve:function(t){return gh(this,t)}});var wh=c,Th=mt,Oh=Mc,Sh=jc,Ph=Qi;Zn({target:"Promise",stat:!0,forced:zf},{allSettled:function(t){var e=this,r=Oh.f(e),n=r.resolve,o=r.reject,i=Sh((function(){var r=Th(e.resolve),o=[],i=0,a=1;Ph(t,(function(t){var s=i++,u=!1;a++,wh(r,e,t).then((function(t){u||(u=!0,o[s]={status:"fulfilled",value:t},--a||n(o))}),(function(t){u||(u=!0,o[s]={status:"rejected",reason:t},--a||n(o))}))})),--a||n(o)}));return i.error&&o(i.value),r.promise}});var jh=c,Eh=mt,Ah=q,Ih=Mc,Uh=jc,Rh=Qi,xh="No one promise resolved";Zn({target:"Promise",stat:!0,forced:zf},{any:function(t){var e=this,r=Ah("AggregateError"),n=Ih.f(e),o=n.resolve,i=n.reject,a=Uh((function(){var n=Eh(e.resolve),a=[],s=0,u=1,c=!1;Rh(t,(function(t){var f=s++,h=!1;u++,jh(n,e,t).then((function(t){h||c||(c=!0,o(t))}),(function(t){h||c||(h=!0,a[f]=t,--u||i(new r(a,xh)))}))})),--u||i(new r(a,xh))}));return a.error&&i(a.value),n.promise}});var Dh=Mc;Zn({target:"Promise",stat:!0},{withResolvers:function(){var t=Dh.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}});var Ch=Zn,Bh=Ec,kh=o,_h=q,Fh=N,Lh=lu,Nh=vh,Mh=Yr,$h=Bh&&Bh.prototype;if(Ch({target:"Promise",proto:!0,real:!0,forced:!!Bh&&kh((function(){$h.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var e=Lh(this,_h("Promise")),r=Fh(t);return this.then(r?function(r){return Nh(e,t()).then((function(){return r}))}:t,r?function(r){return Nh(e,t()).then((function(){throw r}))}:t)}}),Fh(Bh)){var Hh=_h("Promise").prototype.finally;$h.finally!==Hh&&Mh($h,"finally",Hh,{unsafe:!0})}var Wh=T,qh=en,Gh=ra,Vh=B,zh=Wh("".charAt),Xh=Wh("".charCodeAt),Jh=Wh("".slice),Yh=function(t){return function(e,r){var n,o,i=Gh(Vh(e)),a=qh(r),s=i.length;return a<0||a>=s?t?"":void 0:(n=Xh(i,a))<55296||n>56319||a+1===s||(o=Xh(i,a+1))<56320||o>57343?t?zh(i,a):n:t?Jh(i,a,a+2):o-56320+(n-55296<<10)+65536}},Kh={codeAt:Yh(!1),charAt:Yh(!0)}.charAt,Zh=ra,Qh=Ar,tp=ds,ep=ls,rp="String Iterator",np=Qh.set,op=Qh.getterFor(rp);tp(String,"String",(function(t){np(this,{type:rp,string:Zh(t),index:0})}),(function(){var t,e=op(this),r=e.string,n=e.index;return n>=r.length?ep(void 0,!0):(t=Kh(r,n),e.index+=t.length,ep(t,!1))})),r.Promise;var ip=ye("span").classList,ap=ip&&ip.constructor&&ip.constructor.prototype,sp=ap===Object.prototype?void 0:ap,up=r,cp={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},fp=sp,hp=Es,pp=Ve,dp=$a,lp=ee("iterator"),yp=hp.values,vp=function(t,e){if(t){if(t[lp]!==yp)try{pp(t,lp,yp)}catch(e){t[lp]=yp}if(dp(t,e,!0),cp[e])for(var r in hp)if(t[r]!==hp[r])try{pp(t,r,hp[r])}catch(e){t[r]=hp[r]}}};for(var mp in cp)vp(up[mp]&&up[mp].prototype,mp);vp(fp,"DOMTokenList");var bp="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||{},gp="URLSearchParams"in bp,wp="Symbol"in bp&&"iterator"in Symbol,Tp="FileReader"in bp&&"Blob"in bp&&function(){try{return new Blob,!0}catch(t){return!1}}(),Op="FormData"in bp,Sp="ArrayBuffer"in bp;if(Sp)var Pp=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],jp=ArrayBuffer.isView||function(t){return t&&Pp.indexOf(Object.prototype.toString.call(t))>-1};function Ep(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function Ap(t){return"string"!=typeof t&&(t=String(t)),t}function Ip(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return wp&&(e[Symbol.iterator]=function(){return e}),e}function Up(t){this.map={},t instanceof Up?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){if(2!=t.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function Rp(t){if(!t._noBody)return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function xp(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function Dp(t){var e=new FileReader,r=xp(e);return e.readAsArrayBuffer(t),r}function Cp(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function Bp(){return this.bodyUsed=!1,this._initBody=function(t){var e;this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:Tp&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:Op&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:gp&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():Sp&&Tp&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=Cp(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Sp&&(ArrayBuffer.prototype.isPrototypeOf(t)||jp(t))?this._bodyArrayBuffer=Cp(t):this._bodyText=t=Object.prototype.toString.call(t):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):gp&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Tp&&(this.blob=function(){var t=Rp(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var t=Rp(this);return t||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(Tp)return this.blob().then(Dp);throw new Error("could not read as ArrayBuffer")},this.text=function(){var t=Rp(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,r=xp(e),n=/charset=([A-Za-z0-9_-]+)/.exec(t.type),o=n?n[1]:"utf-8";return e.readAsText(t,o),r}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},Op&&(this.formData=function(){return this.text().then(Fp)}),this.json=function(){return this.text().then(JSON.parse)},this}Up.prototype.append=function(t,e){t=Ep(t),e=Ap(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},Up.prototype.delete=function(t){delete this.map[Ep(t)]},Up.prototype.get=function(t){return t=Ep(t),this.has(t)?this.map[t]:null},Up.prototype.has=function(t){return this.map.hasOwnProperty(Ep(t))},Up.prototype.set=function(t,e){this.map[Ep(t)]=Ap(e)},Up.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},Up.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),Ip(t)},Up.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),Ip(t)},Up.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),Ip(t)},wp&&(Up.prototype[Symbol.iterator]=Up.prototype.entries);var kp=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function _p(t,e){if(!(this instanceof _p))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r=(e=e||{}).body;if(t instanceof _p){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new Up(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,r||null==t._bodyInit||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new Up(e.headers)),this.method=function(t){var e=t.toUpperCase();return kp.indexOf(e)>-1?e:t}(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||function(){if("AbortController"in bp)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function Fp(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(o))}})),e}function Lp(t,e){if(!(this instanceof Lp))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new Up(e.headers),this.url=e.url||"",this._initBody(t)}_p.prototype.clone=function(){return new _p(this,{body:this._bodyInit})},Bp.call(_p.prototype),Bp.call(Lp.prototype),Lp.prototype.clone=function(){return new Lp(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Up(this.headers),url:this.url})},Lp.error=function(){var t=new Lp(null,{status:200,statusText:""});return t.ok=!1,t.status=0,t.type="error",t};var Np=[301,302,303,307,308];Lp.redirect=function(t,e){if(-1===Np.indexOf(e))throw new RangeError("Invalid status code");return new Lp(null,{status:e,headers:{location:t}})};var Mp=bp.DOMException;try{new Mp}catch(t){(Mp=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack}).prototype=Object.create(Error.prototype),Mp.prototype.constructor=Mp}function $p(t,e){return new Promise((function(r,n){var o=new _p(t,e);if(o.signal&&o.signal.aborted)return n(new Mp("Aborted","AbortError"));var i=new XMLHttpRequest;function a(){i.abort()}if(i.onload=function(){var t,e,n={statusText:i.statusText,headers:(t=i.getAllResponseHeaders()||"",e=new Up,t.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t})).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();try{e.append(n,o)}catch(t){console.warn("Response "+t.message)}}})),e)};0===o.url.indexOf("file://")&&(i.status<200||i.status>599)?n.status=200:n.status=i.status,n.url="responseURL"in i?i.responseURL:n.headers.get("X-Request-URL");var a="response"in i?i.response:i.responseText;setTimeout((function(){r(new Lp(a,n))}),0)},i.onerror=function(){setTimeout((function(){n(new TypeError("Network request failed"))}),0)},i.ontimeout=function(){setTimeout((function(){n(new TypeError("Network request timed out"))}),0)},i.onabort=function(){setTimeout((function(){n(new Mp("Aborted","AbortError"))}),0)},i.open(o.method,function(t){try{return""===t&&bp.location.href?bp.location.href:t}catch(e){return t}}(o.url),!0),"include"===o.credentials?i.withCredentials=!0:"omit"===o.credentials&&(i.withCredentials=!1),"responseType"in i&&(Tp?i.responseType="blob":Sp&&(i.responseType="arraybuffer")),e&&"object"==typeof e.headers&&!(e.headers instanceof Up||bp.Headers&&e.headers instanceof bp.Headers)){var s=[];Object.getOwnPropertyNames(e.headers).forEach((function(t){s.push(Ep(t)),i.setRequestHeader(t,Ap(e.headers[t]))})),o.headers.forEach((function(t,e){-1===s.indexOf(e)&&i.setRequestHeader(e,t)}))}else o.headers.forEach((function(t,e){i.setRequestHeader(e,t)}));o.signal&&(o.signal.addEventListener("abort",a),i.onreadystatechange=function(){4===i.readyState&&o.signal.removeEventListener("abort",a)}),i.send(void 0===o._bodyInit?null:o._bodyInit)}))}$p.polyfill=!0,bp.fetch||(bp.fetch=$p,bp.Headers=Up,bp.Request=_p,bp.Response=Lp);var Hp=function(t,e){return Hp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},Hp(t,e)};function Wp(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}Hp(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function qp(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))}function Gp(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}"function"==typeof SuppressedError&&SuppressedError;var Vp,zp=function(){function t(){}return t.getIndexFromTimestamps=function(t,e){var r=1e3*t*90,n=-1;if(e.length>0&&r<e[e.length-1])for(var o=0,i=e;o<i.length;o++){if(i[o]>r)break;n++}return n},t}(),Xp=function(){function t(){this.updateTimestamps=[],this.previousTimestampIndex=0}return t.prototype.setUpdateTimestamps=function(t){this.updateTimestamps=t,this.onTimestampsUpdated&&this.onTimestampsUpdated()},t.prototype.renderAtTimestamp=function(t){var e=zp.getIndexFromTimestamps(t,this.updateTimestamps);this.renderAtIndex(e)},t.prototype.renderAtIndex=function(t){this.previousTimestampIndex!==t&&(this.previousTimestampIndex=t,this.render(t))},t}(),Jp=function(t){function e(e){var r,n=t.call(this)||this;n.$onWorkerMessage=function(t){n.onWorkerMessage(t)};var o=null!==(r=e.workerUrl)&&void 0!==r?r:"libpgs.worker.js";return n.worker=new Worker(o),n.worker.onmessage=n.$onWorkerMessage,n}return Wp(e,t),e.prototype.loadFromUrl=function(t){this.worker.postMessage({op:"loadFromUrl",url:t})},e.prototype.loadFromBuffer=function(t){this.worker.postMessage({op:"loadFromBuffer",buffer:t})},e.prototype.onWorkerMessage=function(t){if("updateTimestamps"===t.data.op)this.setUpdateTimestamps(t.data.updateTimestamps)},e.prototype.dispose=function(){this.worker.terminate()},e}(Xp),Yp=function(t){function e(e,r){var n=t.call(this,e)||this,o=r.transferControlToOffscreen();return n.worker.postMessage({op:"init",canvas:o},[o]),n}return Wp(e,t),e.prototype.render=function(t){this.worker.postMessage({op:"render",index:t})},e}(Jp),Kp=function(){function t(){this.empty=!0,this.x=0,this.y=0,this.width=0,this.height=0}return t.prototype.reset=function(){this.empty=!0,this.x=0,this.y=0,this.width=0,this.height=0},t.prototype.set=function(t,e,r,n){void 0===r&&(r=0),void 0===n&&(n=0),this.empty=!1,this.x=t,this.y=e,this.width=r,this.height=n},t.prototype.union=function(t,e,r,n){void 0===r&&(r=0),void 0===n&&(n=0),this.empty?(this.empty=!1,this.x=t,this.y=e,this.width=r,this.height=n):(t<this.x&&(this.width+=this.x-t,this.x=t),e<this.y&&(this.height+=this.y-e,this.y=e),t+r>this.x+this.width&&(this.width=t+r-this.x),e+n>this.y+this.height&&(this.height=e+n-this.y))},t}(),Zp=function(){function t(t){this.dirtyArea=new Kp,this.canvas=t,this.context=t.getContext("2d")}return t.prototype.draw=function(t){this.canvas&&this.context&&(this.dirtyArea.empty||(this.context.clearRect(this.dirtyArea.x,this.dirtyArea.y,this.dirtyArea.width,this.dirtyArea.height),this.dirtyArea.reset()),t&&(this.canvas.width==t.width&&this.canvas.height==t.height||(this.canvas.width=t.width,this.canvas.height=t.height),this.drawSubtitleData(t,this.dirtyArea)))},t.prototype.drawSubtitleData=function(t,e){for(var r=0,n=t.compositionData;r<n.length;r++){var o=n[r];this.drawSubtitleCompositionData(o,e)}},t.prototype.drawSubtitleCompositionData=function(t,e){var r,n,o=t.compositionObject;o.hasCropping?(null===(r=this.context)||void 0===r||r.putImageData(t.pixelData,o.horizontalPosition,o.verticalPosition,o.croppingHorizontalPosition,o.croppingVerticalPosition,o.croppingWidth,o.croppingHeight),null==e||e.union(o.horizontalPosition,o.verticalPosition,o.croppingWidth,o.croppingHeight)):(null===(n=this.context)||void 0===n||n.putImageData(t.pixelData,o.horizontalPosition,o.verticalPosition),null==e||e.union(o.horizontalPosition,o.verticalPosition,t.pixelData.width,t.pixelData.height))},t}(),Qp=function(){function t(t){this.$position=0,this.array=t}return Object.defineProperty(t.prototype,"position",{get:function(){return this.$position},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this.array.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"eof",{get:function(){return this.position>=this.length},enumerable:!1,configurable:!0}),t.prototype.readByte=function(){return this.array[this.$position++]},t.prototype.readBytes=function(t){var e=this.array.slice(this.$position,this.$position+t);return this.$position+=t,e},t}(),td=function(){function t(t){t instanceof Uint8Array?this.baseReader=new Qp(t):this.baseReader=t}return Object.defineProperty(t.prototype,"position",{get:function(){return this.baseReader.position},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this.baseReader.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"eof",{get:function(){return this.baseReader.eof},enumerable:!1,configurable:!0}),t.prototype.readUInt8=function(){return this.baseReader.readByte()},t.prototype.readUInt16=function(){return(this.baseReader.readByte()<<8)+this.baseReader.readByte()},t.prototype.readUInt24=function(){return(this.baseReader.readByte()<<16)+(this.baseReader.readByte()<<8)+this.baseReader.readByte()},t.prototype.readUInt32=function(){return(this.baseReader.readByte()<<24)+(this.baseReader.readByte()<<16)+(this.baseReader.readByte()<<8)+this.baseReader.readByte()},t.prototype.readBytes=function(t){return this.baseReader.readBytes(t)},t}();!function(t){t[t.paletteDefinition=20]="paletteDefinition",t[t.objectDefinition=21]="objectDefinition",t[t.presentationComposition=22]="presentationComposition",t[t.windowDefinition=23]="windowDefinition",t[t.end=128]="end"}(Vp||(Vp={}));var ed,rd=function(){function t(){this.id=0,this.windowId=0,this.croppedFlag=0,this.horizontalPosition=0,this.verticalPosition=0,this.croppingHorizontalPosition=0,this.croppingVerticalPosition=0,this.croppingWidth=0,this.croppingHeight=0}return Object.defineProperty(t.prototype,"hasCropping",{get:function(){return!!(128&this.croppedFlag)},enumerable:!1,configurable:!0}),t}(),nd=function(){function t(){this.width=0,this.height=0,this.frameRate=0,this.compositionNumber=0,this.compositionState=0,this.paletteUpdateFlag=0,this.paletteId=0,this.compositionObjects=[]}return Object.defineProperty(t.prototype,"segmentType",{get:function(){return Vp.presentationComposition},enumerable:!1,configurable:!0}),t.prototype.read=function(t,e){this.width=t.readUInt16(),this.height=t.readUInt16(),this.frameRate=t.readUInt8(),this.compositionNumber=t.readUInt16(),this.compositionState=t.readUInt8(),this.paletteUpdateFlag=t.readUInt8(),this.paletteId=t.readUInt8();var r=t.readUInt8();this.compositionObjects=[];for(var n=0;n<r;n++){var o=new rd;o.id=t.readUInt16(),o.windowId=t.readUInt8(),o.croppedFlag=t.readUInt8(),o.horizontalPosition=t.readUInt16(),o.verticalPosition=t.readUInt16(),o.hasCropping&&(o.croppingHorizontalPosition=t.readUInt16(),o.croppingVerticalPosition=t.readUInt16(),o.croppingWidth=t.readUInt16(),o.croppingHeight=t.readUInt16()),this.compositionObjects.push(o)}},t}(),od=function(){function t(){this.id=0,this.versionNumber=0,this.rgba=[]}return Object.defineProperty(t.prototype,"segmentType",{get:function(){return Vp.paletteDefinition},enumerable:!1,configurable:!0}),t.prototype.read=function(e,r){this.id=e.readUInt8(),this.versionNumber=e.readUInt8();var n=(r-2)/5,o=new Uint32Array(1),i=new Uint8Array(o.buffer);this.rgba=[];for(var a=0;a<n;a++){var s=e.readUInt8(),u=e.readUInt8(),c=e.readUInt8()-128,f=e.readUInt8()-128,h=e.readUInt8(),p=t.clamp(Math.round(u+1.402*c),0,255),d=t.clamp(Math.round(u-.34414*f-.71414*c),0,255),l=t.clamp(Math.round(u+1.772*f),0,255);i[0]=p,i[1]=d,i[2]=l,i[3]=h,this.rgba[s]=o[0]}},t.clamp=function(t,e,r){return t<e?e:t>r?r:t},t}(),id=function(){function t(){this.id=0,this.versionNumber=0,this.lastInSequenceFlag=0,this.width=0,this.height=0,this.dataLength=0}return Object.defineProperty(t.prototype,"isFirstInSequence",{get:function(){return!!(128&this.lastInSequenceFlag)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isLastInSequence",{get:function(){return!!(64&this.lastInSequenceFlag)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"segmentType",{get:function(){return Vp.objectDefinition},enumerable:!1,configurable:!0}),t.prototype.read=function(t,e){this.id=t.readUInt16(),this.versionNumber=t.readUInt8(),this.lastInSequenceFlag=t.readUInt8(),this.isFirstInSequence?(this.dataLength=t.readUInt24(),this.width=t.readUInt16(),this.height=t.readUInt16(),this.data=t.readBytes(e-11)):this.data=t.readBytes(e-4)},t}(),ad=function(){this.id=0,this.horizontalPosition=0,this.verticalPosition=0,this.width=0,this.height=0},sd=function(){function t(){this.windows=[]}return Object.defineProperty(t.prototype,"segmentType",{get:function(){return Vp.windowDefinition},enumerable:!1,configurable:!0}),t.prototype.read=function(t,e){var r=t.readUInt8();this.windows=[];for(var n=0;n<r;n++){va