@minimax-ai/code 0.4.2 → 0.4.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.
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __mavis_cR } from "module"; import { basename as __mavis_basename, dirname as __mavis_dirname, join as __mavis_join } from "path"; import { fileURLToPath as __mavis_fileURLToPath, pathToFileURL as __mavis_pathToFileURL } from "url"; const __mavis_tuiCurrentModuleDir = __mavis_dirname(__mavis_fileURLToPath(import.meta.url)); const __mavis_tuiPackageRoot = __mavis_basename(__mavis_tuiCurrentModuleDir) === "chunks" ? __mavis_dirname(__mavis_tuiCurrentModuleDir) : __mavis_tuiCurrentModuleDir; const __mavis_tuiPackageEntryUrl = __mavis_pathToFileURL(__mavis_join(__mavis_tuiPackageRoot, "cli.js")).href; const require = __mavis_cR(__mavis_tuiPackageEntryUrl); const __dirname = __mavis_tuiPackageRoot;
2
- import{a as O5,b as vb,c as B5}from"./chunk-R6GVNV7J.js";import{a as rve,b as kM,c as Us,d as Cw,e as Aw,f as qM,g as pm,h as tve,i as a_}from"./chunk-4ESEMCSG.js";import{$ as po,$a as sb,$b as tM,$c as B,$d as jhe,A as p5,Aa as spe,Ab as Vpe,Ac as A_e,Ad as R5,Ae as zhe,B as KNe,Ba as ope,Bb as Wpe,Bc as R_e,Bd as nhe,Be as Khe,C as VNe,Ca as dpe,Cb as Gpe,Cc as D_e,Cd as she,Ce as Ew,D as WNe,Da as lpe,Db as $pe,Dc as x_e,Dd as ohe,De as gM,E as GNe,Ea as mpe,Eb as Hpe,Ec as M_e,Ee as P5,F as na,Fa as cpe,Fb as Yp,Fc as P_e,Fd as dhe,Fe as Vhe,G as Ke,Ga as upe,Gb as Xpe,Gc as Bs,Gd as lhe,Ge as Whe,H as $Ne,Ha as kw,Hb as Qpe,Hc as L_e,Hd as mhe,He as Ghe,I as or,Ia as fpe,Ib as Jpe,Ic as cb,Id as che,Ie as yM,J as gw,Ja as Npe,Jb as Ype,Jc as tl,Jd as uhe,Je as $he,K as _5,Ka as ppe,Kb as Zpe,Kc as ub,Kd as fhe,Ke as e_,L as yw,La as _pe,Lb as k5,Lc as fb,Ld as Nhe,Le as Hhe,M as HNe,Ma as hpe,Mb as e_e,Mc as O_e,Md as phe,Me as Xhe,N as Ms,Na as g5,Nb as lb,Nc as B_e,Nd as D5,Ne as Qhe,O as ab,Oa as vpe,Ob as a_e,Oc as S5,Od as _he,Oe as Jhe,P as Qp,Pa as wpe,Pb as i_e,Pc as U_e,Pd as hhe,Pe as Yhe,Q as al,Qa as gpe,Qb as r_e,Qc as Iw,Qd as pb,Qe as Zhe,R as hr,Ra as ype,Rb as q5,Rc as T5,Rd as x5,Re as eve,S as Ri,Sa as kpe,Sb as t_e,Sc as F_e,Sd as _M,Se as ave,T as la,Ta as eM,Tb as n_e,Tc as E5,Td as vhe,Te as L5,U as Ln,Ua as qpe,Ub as s_e,Uc as sM,Ud as hM,V as ib,Va as aM,Vb as o_e,Vc as z_e,Vd as vM,W as rb,Wa as jpe,Wb as d_e,Wc as K_e,Wd as whe,X as tb,Xa as iM,Xb as l_e,Xc as oM,Xd as ghe,Y as h5,Ya as bpe,Yb as m_e,Yc as V_e,Yd as yhe,Z as XNe,Za as Ipe,Zb as c_e,Zc as W_e,Zd as khe,_ as QNe,_a as Spe,_b as u_e,_c as Sw,_d as qhe,a as Zj,aa as il,ab as qw,ac as f_e,ad as G_e,ae as M5,b as Rha,ba as JNe,bb as Tpe,bc as N_e,bd as $_e,be as bhe,c as qNe,ca as YNe,cb as _o,cc as jw,cd as H_e,ce as Ihe,d as el,da as ni,db as ob,dc as p_e,dd as dM,de as She,e as m5,ea as Dc,eb as db,ec as xc,ed as X_e,ee as The,f as jNe,fa as kn,fb as Epe,fc as bw,fd as lM,fe as Ehe,g as hw,ga as Qt,gb as Os,gc as j5,gd as C5,ge as Zp,ha as ZNe,hb as Cpe,hc as __e,hd as Q_e,he as Che,ia as epe,ib as Ape,ic as h_e,id as J_e,ie as Ahe,ja as Ps,jb as Rpe,jc as v_e,jd as Y_e,je as Rhe,k as bNe,ka as rl,kb as rM,kc as w_e,kd as Z_e,ke as Dhe,la as Or,lb as y5,lc as g_e,ld as A5,le as xhe,ma as Di,mb as ve,mc as nM,md as mM,me as Mhe,n as PNe,na as v5,nb as Dpe,nc as y_e,nd as ehe,o as LNe,oa as nb,ob as xpe,oc as k_e,od as Mc,oe as Phe,p as ONe,pa as ape,pb as Mpe,pc as q_e,pd as ahe,pe as Lhe,qa as Jp,qb as Ppe,qc as mb,qd as cM,qe as Ohe,r as Hx,ra as ipe,rb as P,rc as j_e,rd as ihe,re as Bhe,s as Xx,sa as rpe,sb as Lpe,sc as b_e,sd as rhe,se as wM,t as BNe,ta as w5,tb as Ope,tc as I_e,td as uM,te as Dha,u as UNe,ua as tpe,ub as Bpe,uc as b5,ud as the,ue as _b,v as Qx,va as Jx,vb as M,vc as S_e,vd as fM,ve as hb,w as FNe,wa as Yx,wb as Upe,wc as T_e,wd as Tw,we as xha,x as zNe,xa as Ls,xb as Fpe,xc as E_e,xd as NM,xe as Pc,y as ww,ya as Zx,yb as zpe,yc as C_e,yd as pM,ye as Uhe,z as eb,za as npe,zb as Kpe,zc as I5,zd as Nb,ze as Fhe}from"./chunk-VFMQBQ74.js";import{d as Vx}from"./chunk-A2CQYOXE.js";import{d as gNe,e as yNe,f as Wx,g as Gx,h as l5,i as kNe,l as u5,q as f5}from"./chunk-XYXCVIX2.js";import{a as ive}from"./chunk-4NX3LPKA.js";import{F as DNe,Xa as $x,k as Nm,l as CNe,m as ANe,v as RNe,va as N5,xa as xNe,za as MNe}from"./chunk-OJA2IAQ6.js";import{a as c5,b as _w}from"./chunk-C3JRMX7L.js";import{b as vw}from"./chunk-X4N2MWNJ.js";import{c as ENe}from"./chunk-6TZEW2D4.js";import{a as nve}from"./chunk-4Y64C4JT.js";import{a as Aha}from"./chunk-HQ2U4QVQ.js";import{a as Y4,e as Kfe,f as Vfe,g as Wfe,j as d5,l as vNe,q as wNe}from"./chunk-AAJMOWWM.js";import{$ as ns,Ca as rNe,D as Hj,Da as Hp,E as sd,Ea as tNe,Fa as od,Ha as nNe,K as Xj,M as No,N as Xfe,Pa as Rc,Qa as _Ne,Ra as Xp,Sa as s5,T as Qfe,Ta as o5,U as Jfe,W as Yfe,Y as Na,Z as Da,_ as Zu,a as Z4,aa as Zfe,ab as hNe,b as Gfe,c as pw,ca as Cx,d as qa,da as Ax,j as e5,ka as Rx,la as Dx,ma as Gp,na as xx,oa as eNe,q as a5,r as i5,ra as ef,sa as sr,ta as aNe,wa as Mx,x as $fe,ya as $p,z as Hfe,za as iNe}from"./chunk-6BYKHQOV.js";import{a as Wp}from"./chunk-2ZG44JU6.js";import{A as Bx,C as dNe,D as r5,E as t5,F as lNe,G as Ux,H as Fx,K as mNe,L as cNe,M as uNe,N as zx,O as fNe,T as Yj,U as NNe,V as pNe,W as n5,X as Kx,b as Px,i as Pn,j as Cc,k as Lx,l as af,m as Qj,n as sNe,o as Ox,p as Jj,v as Ac,z as oNe}from"./chunk-Y27DNFV2.js";import{a as SNe,b as TNe}from"./chunk-SD6SJL3L.js";import{a as INe}from"./chunk-GUFBGYOC.js";import{a as Wi,c as Ie,e as Ii}from"./chunk-D76SO2ME.js";var iJ=Ie((x_r,uEe)=>{"use strict";var tMa=Wi("util"),cEe=Wi("stream"),wl=uEe.exports=function(){cEe.call(this),this._buffers=[],this._buffered=0,this._reads=[],this._paused=!1,this._encoding="utf8",this.writable=!0};tMa.inherits(wl,cEe);wl.prototype.read=function(a,e){this._reads.push({length:Math.abs(a),allowLess:a<0,func:e}),process.nextTick(function(){this._process(),this._paused&&this._reads&&this._reads.length>0&&(this._paused=!1,this.emit("drain"))}.bind(this))};wl.prototype.write=function(a,e){if(!this.writable)return this.emit("error",new Error("Stream not writable")),!1;let i;return Buffer.isBuffer(a)?i=a:i=Buffer.from(a,e||this._encoding),this._buffers.push(i),this._buffered+=i.length,this._process(),this._reads&&this._reads.length===0&&(this._paused=!0),this.writable&&!this._paused};wl.prototype.end=function(a,e){a&&this.write(a,e),this.writable=!1,this._buffers&&(this._buffers.length===0?this._end():(this._buffers.push(null),this._process()))};wl.prototype.destroySoon=wl.prototype.end;wl.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("Unexpected end of input")),this.destroy()};wl.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))};wl.prototype._processReadAllowingLess=function(a){this._reads.shift();let e=this._buffers[0];e.length>a.length?(this._buffered-=a.length,this._buffers[0]=e.slice(a.length),a.func.call(this,e.slice(0,a.length))):(this._buffered-=e.length,this._buffers.shift(),a.func.call(this,e))};wl.prototype._processRead=function(a){this._reads.shift();let e=0,i=0,r=Buffer.alloc(a.length);for(;e<a.length;){let t=this._buffers[i++],n=Math.min(t.length,a.length-e);t.copy(r,e,0,n),e+=n,n!==t.length&&(this._buffers[--i]=t.slice(n))}i>0&&this._buffers.splice(0,i),this._buffered-=a.length,a.func.call(this,r)};wl.prototype._process=function(){try{for(;this._buffered>0&&this._reads&&this._reads.length>0;){let a=this._reads[0];if(a.allowLess)this._processReadAllowingLess(a);else if(this._buffered>=a.length)this._processRead(a);else break}this._buffers&&!this.writable&&this._end()}catch(a){this.emit("error",a)}}});var tJ=Ie(rJ=>{"use strict";var xf=[{x:[0],y:[0]},{x:[4],y:[0]},{x:[0,4],y:[4]},{x:[2,6],y:[0,4]},{x:[0,2,4,6],y:[2,6]},{x:[1,3,5,7],y:[0,2,4,6]},{x:[0,1,2,3,4,5,6,7],y:[1,3,5,7]}];rJ.getImagePasses=function(a,e){let i=[],r=a%8,t=e%8,n=(a-r)/8,s=(e-t)/8;for(let o=0;o<xf.length;o++){let d=xf[o],l=n*d.x.length,m=s*d.y.length;for(let c=0;c<d.x.length&&d.x[c]<r;c++)l++;for(let c=0;c<d.y.length&&d.y[c]<t;c++)m++;l>0&&m>0&&i.push({width:l,height:m,index:o})}return i};rJ.getInterlaceIterator=function(a){return function(e,i,r){let t=e%xf[r].x.length,n=(e-t)/xf[r].x.length*8+xf[r].x[t],s=i%xf[r].y.length,o=(i-s)/xf[r].y.length*8+xf[r].y[s];return n*4+o*a*4}}});var nJ=Ie((P_r,fEe)=>{"use strict";fEe.exports=function(e,i,r){let t=e+i-r,n=Math.abs(t-e),s=Math.abs(t-i),o=Math.abs(t-r);return n<=s&&n<=o?e:s<=o?i:r}});var sJ=Ie((L_r,pEe)=>{"use strict";var nMa=tJ(),sMa=nJ();function NEe(a,e,i){let r=a*e;return i!==8&&(r=Math.ceil(r/(8/i))),r}var Bg=pEe.exports=function(a,e){let i=a.width,r=a.height,t=a.interlace,n=a.bpp,s=a.depth;if(this.read=e.read,this.write=e.write,this.complete=e.complete,this._imageIndex=0,this._images=[],t){let o=nMa.getImagePasses(i,r);for(let d=0;d<o.length;d++)this._images.push({byteWidth:NEe(o[d].width,n,s),height:o[d].height,lineIndex:0})}else this._images.push({byteWidth:NEe(i,n,s),height:r,lineIndex:0});s===8?this._xComparison=n:s===16?this._xComparison=n*2:this._xComparison=1};Bg.prototype.start=function(){this.read(this._images[this._imageIndex].byteWidth+1,this._reverseFilterLine.bind(this))};Bg.prototype._unFilterType1=function(a,e,i){let r=this._xComparison,t=r-1;for(let n=0;n<i;n++){let s=a[1+n],o=n>t?e[n-r]:0;e[n]=s+o}};Bg.prototype._unFilterType2=function(a,e,i){let r=this._lastLine;for(let t=0;t<i;t++){let n=a[1+t],s=r?r[t]:0;e[t]=n+s}};Bg.prototype._unFilterType3=function(a,e,i){let r=this._xComparison,t=r-1,n=this._lastLine;for(let s=0;s<i;s++){let o=a[1+s],d=n?n[s]:0,l=s>t?e[s-r]:0,m=Math.floor((l+d)/2);e[s]=o+m}};Bg.prototype._unFilterType4=function(a,e,i){let r=this._xComparison,t=r-1,n=this._lastLine;for(let s=0;s<i;s++){let o=a[1+s],d=n?n[s]:0,l=s>t?e[s-r]:0,m=s>t&&n?n[s-r]:0,c=sMa(l,d,m);e[s]=o+c}};Bg.prototype._reverseFilterLine=function(a){let e=a[0],i,r=this._images[this._imageIndex],t=r.byteWidth;if(e===0)i=a.slice(1,t+1);else switch(i=Buffer.alloc(t),e){case 1:this._unFilterType1(a,i,t);break;case 2:this._unFilterType2(a,i,t);break;case 3:this._unFilterType3(a,i,t);break;case 4:this._unFilterType4(a,i,t);break;default:throw new Error("Unrecognised filter type - "+e)}this.write(i),r.lineIndex++,r.lineIndex>=r.height?(this._lastLine=null,this._imageIndex++,r=this._images[this._imageIndex]):this._lastLine=i,r?this.read(r.byteWidth+1,this._reverseFilterLine.bind(this)):(this._lastLine=null,this.complete())}});var vEe=Ie((O_r,hEe)=>{"use strict";var oMa=Wi("util"),_Ee=iJ(),dMa=sJ(),lMa=hEe.exports=function(a){_Ee.call(this);let e=[],i=this;this._filter=new dMa(a,{read:this.read.bind(this),write:function(r){e.push(r)},complete:function(){i.emit("complete",Buffer.concat(e))}}),this._filter.start()};oMa.inherits(lMa,_Ee)});var Ug=Ie((B_r,wEe)=>{"use strict";wEe.exports={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5}});var lJ=Ie((U_r,gEe)=>{"use strict";var oJ=[];(function(){for(let a=0;a<256;a++){let e=a;for(let i=0;i<8;i++)e&1?e=3988292384^e>>>1:e=e>>>1;oJ[a]=e}})();var dJ=gEe.exports=function(){this._crc=-1};dJ.prototype.write=function(a){for(let e=0;e<a.length;e++)this._crc=oJ[(this._crc^a[e])&255]^this._crc>>>8;return!0};dJ.prototype.crc32=function(){return this._crc^-1};dJ.crc32=function(a){let e=-1;for(let i=0;i<a.length;i++)e=oJ[(e^a[i])&255]^e>>>8;return e^-1}});var mJ=Ie((F_r,yEe)=>{"use strict";var xt=Ug(),mMa=lJ(),nn=yEe.exports=function(a,e){this._options=a,a.checkCRC=a.checkCRC!==!1,this._hasIHDR=!1,this._hasIEND=!1,this._emittedHeadersFinished=!1,this._palette=[],this._colorType=0,this._chunks={},this._chunks[xt.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[xt.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[xt.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[xt.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[xt.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[xt.TYPE_gAMA]=this._handleGAMA.bind(this),this.read=e.read,this.error=e.error,this.metadata=e.metadata,this.gamma=e.gamma,this.transColor=e.transColor,this.palette=e.palette,this.parsed=e.parsed,this.inflateData=e.inflateData,this.finished=e.finished,this.simpleTransparency=e.simpleTransparency,this.headersFinished=e.headersFinished||function(){}};nn.prototype.start=function(){this.read(xt.PNG_SIGNATURE.length,this._parseSignature.bind(this))};nn.prototype._parseSignature=function(a){let e=xt.PNG_SIGNATURE;for(let i=0;i<e.length;i++)if(a[i]!==e[i]){this.error(new Error("Invalid file signature"));return}this.read(8,this._parseChunkBegin.bind(this))};nn.prototype._parseChunkBegin=function(a){let e=a.readUInt32BE(0),i=a.readUInt32BE(4),r="";for(let n=4;n<8;n++)r+=String.fromCharCode(a[n]);let t=!!(a[4]&32);if(!this._hasIHDR&&i!==xt.TYPE_IHDR){this.error(new Error("Expected IHDR on beggining"));return}if(this._crc=new mMa,this._crc.write(Buffer.from(r)),this._chunks[i])return this._chunks[i](e);if(!t){this.error(new Error("Unsupported critical chunk type "+r));return}this.read(e+4,this._skipChunk.bind(this))};nn.prototype._skipChunk=function(){this.read(8,this._parseChunkBegin.bind(this))};nn.prototype._handleChunkEnd=function(){this.read(4,this._parseChunkEnd.bind(this))};nn.prototype._parseChunkEnd=function(a){let e=a.readInt32BE(0),i=this._crc.crc32();if(this._options.checkCRC&&i!==e){this.error(new Error("Crc error - "+e+" - "+i));return}this._hasIEND||this.read(8,this._parseChunkBegin.bind(this))};nn.prototype._handleIHDR=function(a){this.read(a,this._parseIHDR.bind(this))};nn.prototype._parseIHDR=function(a){this._crc.write(a);let e=a.readUInt32BE(0),i=a.readUInt32BE(4),r=a[8],t=a[9],n=a[10],s=a[11],o=a[12];if(r!==8&&r!==4&&r!==2&&r!==1&&r!==16){this.error(new Error("Unsupported bit depth "+r));return}if(!(t in xt.COLORTYPE_TO_BPP_MAP)){this.error(new Error("Unsupported color type"));return}if(n!==0){this.error(new Error("Unsupported compression method"));return}if(s!==0){this.error(new Error("Unsupported filter method"));return}if(o!==0&&o!==1){this.error(new Error("Unsupported interlace method"));return}this._colorType=t;let d=xt.COLORTYPE_TO_BPP_MAP[this._colorType];this._hasIHDR=!0,this.metadata({width:e,height:i,depth:r,interlace:!!o,palette:!!(t&xt.COLORTYPE_PALETTE),color:!!(t&xt.COLORTYPE_COLOR),alpha:!!(t&xt.COLORTYPE_ALPHA),bpp:d,colorType:t}),this._handleChunkEnd()};nn.prototype._handlePLTE=function(a){this.read(a,this._parsePLTE.bind(this))};nn.prototype._parsePLTE=function(a){this._crc.write(a);let e=Math.floor(a.length/3);for(let i=0;i<e;i++)this._palette.push([a[i*3],a[i*3+1],a[i*3+2],255]);this.palette(this._palette),this._handleChunkEnd()};nn.prototype._handleTRNS=function(a){this.simpleTransparency(),this.read(a,this._parseTRNS.bind(this))};nn.prototype._parseTRNS=function(a){if(this._crc.write(a),this._colorType===xt.COLORTYPE_PALETTE_COLOR){if(this._palette.length===0){this.error(new Error("Transparency chunk must be after palette"));return}if(a.length>this._palette.length){this.error(new Error("More transparent colors than palette size"));return}for(let e=0;e<a.length;e++)this._palette[e][3]=a[e];this.palette(this._palette)}this._colorType===xt.COLORTYPE_GRAYSCALE&&this.transColor([a.readUInt16BE(0)]),this._colorType===xt.COLORTYPE_COLOR&&this.transColor([a.readUInt16BE(0),a.readUInt16BE(2),a.readUInt16BE(4)]),this._handleChunkEnd()};nn.prototype._handleGAMA=function(a){this.read(a,this._parseGAMA.bind(this))};nn.prototype._parseGAMA=function(a){this._crc.write(a),this.gamma(a.readUInt32BE(0)/xt.GAMMA_DIVISION),this._handleChunkEnd()};nn.prototype._handleIDAT=function(a){this._emittedHeadersFinished||(this._emittedHeadersFinished=!0,this.headersFinished()),this.read(-a,this._parseIDAT.bind(this,a))};nn.prototype._parseIDAT=function(a,e){if(this._crc.write(e),this._colorType===xt.COLORTYPE_PALETTE_COLOR&&this._palette.length===0)throw new Error("Expected palette not found");this.inflateData(e);let i=a-e.length;i>0?this._handleIDAT(i):this._handleChunkEnd()};nn.prototype._handleIEND=function(a){this.read(a,this._parseIEND.bind(this))};nn.prototype._parseIEND=function(a){this._crc.write(a),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()}});var cJ=Ie(qEe=>{"use strict";var kEe=tJ(),cMa=[function(){},function(a,e,i,r){if(r===e.length)throw new Error("Ran out of data");let t=e[r];a[i]=t,a[i+1]=t,a[i+2]=t,a[i+3]=255},function(a,e,i,r){if(r+1>=e.length)throw new Error("Ran out of data");let t=e[r];a[i]=t,a[i+1]=t,a[i+2]=t,a[i+3]=e[r+1]},function(a,e,i,r){if(r+2>=e.length)throw new Error("Ran out of data");a[i]=e[r],a[i+1]=e[r+1],a[i+2]=e[r+2],a[i+3]=255},function(a,e,i,r){if(r+3>=e.length)throw new Error("Ran out of data");a[i]=e[r],a[i+1]=e[r+1],a[i+2]=e[r+2],a[i+3]=e[r+3]}],uMa=[function(){},function(a,e,i,r){let t=e[0];a[i]=t,a[i+1]=t,a[i+2]=t,a[i+3]=r},function(a,e,i){let r=e[0];a[i]=r,a[i+1]=r,a[i+2]=r,a[i+3]=e[1]},function(a,e,i,r){a[i]=e[0],a[i+1]=e[1],a[i+2]=e[2],a[i+3]=r},function(a,e,i){a[i]=e[0],a[i+1]=e[1],a[i+2]=e[2],a[i+3]=e[3]}];function fMa(a,e){let i=[],r=0;function t(){if(r===a.length)throw new Error("Ran out of data");let n=a[r];r++;let s,o,d,l,m,c,u,f;switch(e){default:throw new Error("unrecognised depth");case 16:u=a[r],r++,i.push((n<<8)+u);break;case 4:u=n&15,f=n>>4,i.push(f,u);break;case 2:m=n&3,c=n>>2&3,u=n>>4&3,f=n>>6&3,i.push(f,u,c,m);break;case 1:s=n&1,o=n>>1&1,d=n>>2&1,l=n>>3&1,m=n>>4&1,c=n>>5&1,u=n>>6&1,f=n>>7&1,i.push(f,u,c,m,l,d,o,s);break}}return{get:function(n){for(;i.length<n;)t();let s=i.slice(0,n);return i=i.slice(n),s},resetAfterLine:function(){i.length=0},end:function(){if(r!==a.length)throw new Error("extra data found")}}}function NMa(a,e,i,r,t,n){let s=a.width,o=a.height,d=a.index;for(let l=0;l<o;l++)for(let m=0;m<s;m++){let c=i(m,l,d);cMa[r](e,t,c,n),n+=r}return n}function pMa(a,e,i,r,t,n){let s=a.width,o=a.height,d=a.index;for(let l=0;l<o;l++){for(let m=0;m<s;m++){let c=t.get(r),u=i(m,l,d);uMa[r](e,c,u,n)}t.resetAfterLine()}}qEe.dataToBitMap=function(a,e){let i=e.width,r=e.height,t=e.depth,n=e.bpp,s=e.interlace,o;t!==8&&(o=fMa(a,t));let d;t<=8?d=Buffer.alloc(i*r*4):d=new Uint16Array(i*r*4);let l=Math.pow(2,t)-1,m=0,c,u;if(s)c=kEe.getImagePasses(i,r),u=kEe.getInterlaceIterator(i,r);else{let f=0;u=function(){let N=f;return f+=4,N},c=[{width:i,height:r}]}for(let f=0;f<c.length;f++)t===8?m=NMa(c[f],d,u,n,a,m):pMa(c[f],d,u,n,o,l);if(t===8){if(m!==a.length)throw new Error("extra data found")}else o.end();return d}});var uJ=Ie((K_r,jEe)=>{"use strict";function _Ma(a,e,i,r,t){let n=0;for(let s=0;s<r;s++)for(let o=0;o<i;o++){let d=t[a[n]];if(!d)throw new Error("index "+a[n]+" not in palette");for(let l=0;l<4;l++)e[n+l]=d[l];n+=4}}function hMa(a,e,i,r,t){let n=0;for(let s=0;s<r;s++)for(let o=0;o<i;o++){let d=!1;if(t.length===1?t[0]===a[n]&&(d=!0):t[0]===a[n]&&t[1]===a[n+1]&&t[2]===a[n+2]&&(d=!0),d)for(let l=0;l<4;l++)e[n+l]=0;n+=4}}function vMa(a,e,i,r,t){let n=255,s=Math.pow(2,t)-1,o=0;for(let d=0;d<r;d++)for(let l=0;l<i;l++){for(let m=0;m<4;m++)e[o+m]=Math.floor(a[o+m]*n/s+.5);o+=4}}jEe.exports=function(a,e,i=!1){let r=e.depth,t=e.width,n=e.height,s=e.colorType,o=e.transColor,d=e.palette,l=a;return s===3?_Ma(a,l,t,n,d):(o&&hMa(a,l,t,n,o),r!==8&&!i&&(r===16&&(l=Buffer.alloc(t*n*4)),vMa(a,l,t,n,r))),l}});var SEe=Ie((V_r,IEe)=>{"use strict";var wMa=Wi("util"),fJ=Wi("zlib"),bEe=iJ(),gMa=vEe(),yMa=mJ(),kMa=cJ(),qMa=uJ(),Im=IEe.exports=function(a){bEe.call(this),this._parser=new yMa(a,{read:this.read.bind(this),error:this._handleError.bind(this),metadata:this._handleMetaData.bind(this),gamma:this.emit.bind(this,"gamma"),palette:this._handlePalette.bind(this),transColor:this._handleTransColor.bind(this),finished:this._finished.bind(this),inflateData:this._inflateData.bind(this),simpleTransparency:this._simpleTransparency.bind(this),headersFinished:this._headersFinished.bind(this)}),this._options=a,this.writable=!0,this._parser.start()};wMa.inherits(Im,bEe);Im.prototype._handleError=function(a){this.emit("error",a),this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy&&this._inflate.destroy(),this._filter&&(this._filter.destroy(),this._filter.on("error",function(){})),this.errord=!0};Im.prototype._inflateData=function(a){if(!this._inflate)if(this._bitmapInfo.interlace)this._inflate=fJ.createInflate(),this._inflate.on("error",this.emit.bind(this,"error")),this._filter.on("complete",this._complete.bind(this)),this._inflate.pipe(this._filter);else{let i=((this._bitmapInfo.width*this._bitmapInfo.bpp*this._bitmapInfo.depth+7>>3)+1)*this._bitmapInfo.height,r=Math.max(i,fJ.Z_MIN_CHUNK);this._inflate=fJ.createInflate({chunkSize:r});let t=i,n=this.emit.bind(this,"error");this._inflate.on("error",function(o){t&&n(o)}),this._filter.on("complete",this._complete.bind(this));let s=this._filter.write.bind(this._filter);this._inflate.on("data",function(o){t&&(o.length>t&&(o=o.slice(0,t)),t-=o.length,s(o))}),this._inflate.on("end",this._filter.end.bind(this._filter))}this._inflate.write(a)};Im.prototype._handleMetaData=function(a){this._metaData=a,this._bitmapInfo=Object.create(a),this._filter=new gMa(this._bitmapInfo)};Im.prototype._handleTransColor=function(a){this._bitmapInfo.transColor=a};Im.prototype._handlePalette=function(a){this._bitmapInfo.palette=a};Im.prototype._simpleTransparency=function(){this._metaData.alpha=!0};Im.prototype._headersFinished=function(){this.emit("metadata",this._metaData)};Im.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"))};Im.prototype._complete=function(a){if(this.errord)return;let e;try{let i=kMa.dataToBitMap(a,this._bitmapInfo);e=qMa(i,this._bitmapInfo,this._options.skipRescale),i=null}catch(i){this._handleError(i);return}this.emit("parsed",e)}});var EEe=Ie((W_r,TEe)=>{"use strict";var wd=Ug();TEe.exports=function(a,e,i,r){let t=[wd.COLORTYPE_COLOR_ALPHA,wd.COLORTYPE_ALPHA].indexOf(r.colorType)!==-1;if(r.colorType===r.inputColorType){let N=(function(){let _=new ArrayBuffer(2);return new DataView(_).setInt16(0,256,!0),new Int16Array(_)[0]!==256})();if(r.bitDepth===8||r.bitDepth===16&&N)return a}let n=r.bitDepth!==16?a:new Uint16Array(a.buffer),s=255,o=wd.COLORTYPE_TO_BPP_MAP[r.inputColorType];o===4&&!r.inputHasAlpha&&(o=3);let d=wd.COLORTYPE_TO_BPP_MAP[r.colorType];r.bitDepth===16&&(s=65535,d*=2);let l=Buffer.alloc(e*i*d),m=0,c=0,u=r.bgColor||{};u.red===void 0&&(u.red=s),u.green===void 0&&(u.green=s),u.blue===void 0&&(u.blue=s);function f(){let N,_,v,h=s;switch(r.inputColorType){case wd.COLORTYPE_COLOR_ALPHA:h=n[m+3],N=n[m],_=n[m+1],v=n[m+2];break;case wd.COLORTYPE_COLOR:N=n[m],_=n[m+1],v=n[m+2];break;case wd.COLORTYPE_ALPHA:h=n[m+1],N=n[m],_=N,v=N;break;case wd.COLORTYPE_GRAYSCALE:N=n[m],_=N,v=N;break;default:throw new Error("input color type:"+r.inputColorType+" is not supported at present")}return r.inputHasAlpha&&(t||(h/=s,N=Math.min(Math.max(Math.round((1-h)*u.red+h*N),0),s),_=Math.min(Math.max(Math.round((1-h)*u.green+h*_),0),s),v=Math.min(Math.max(Math.round((1-h)*u.blue+h*v),0),s))),{red:N,green:_,blue:v,alpha:h}}for(let N=0;N<i;N++)for(let _=0;_<e;_++){let v=f(n,m);switch(r.colorType){case wd.COLORTYPE_COLOR_ALPHA:case wd.COLORTYPE_COLOR:r.bitDepth===8?(l[c]=v.red,l[c+1]=v.green,l[c+2]=v.blue,t&&(l[c+3]=v.alpha)):(l.writeUInt16BE(v.red,c),l.writeUInt16BE(v.green,c+2),l.writeUInt16BE(v.blue,c+4),t&&l.writeUInt16BE(v.alpha,c+6));break;case wd.COLORTYPE_ALPHA:case wd.COLORTYPE_GRAYSCALE:{let h=(v.red+v.green+v.blue)/3;r.bitDepth===8?(l[c]=h,t&&(l[c+1]=v.alpha)):(l.writeUInt16BE(h,c),t&&l.writeUInt16BE(v.alpha,c+2));break}default:throw new Error("unrecognised color Type "+r.colorType)}m+=o,c+=d}return l}});var REe=Ie((G_r,AEe)=>{"use strict";var CEe=nJ();function jMa(a,e,i,r,t){for(let n=0;n<i;n++)r[t+n]=a[e+n]}function bMa(a,e,i){let r=0,t=e+i;for(let n=e;n<t;n++)r+=Math.abs(a[n]);return r}function IMa(a,e,i,r,t,n){for(let s=0;s<i;s++){let o=s>=n?a[e+s-n]:0,d=a[e+s]-o;r[t+s]=d}}function SMa(a,e,i,r){let t=0;for(let n=0;n<i;n++){let s=n>=r?a[e+n-r]:0,o=a[e+n]-s;t+=Math.abs(o)}return t}function TMa(a,e,i,r,t){for(let n=0;n<i;n++){let s=e>0?a[e+n-i]:0,o=a[e+n]-s;r[t+n]=o}}function EMa(a,e,i){let r=0,t=e+i;for(let n=e;n<t;n++){let s=e>0?a[n-i]:0,o=a[n]-s;r+=Math.abs(o)}return r}function CMa(a,e,i,r,t,n){for(let s=0;s<i;s++){let o=s>=n?a[e+s-n]:0,d=e>0?a[e+s-i]:0,l=a[e+s]-(o+d>>1);r[t+s]=l}}function AMa(a,e,i,r){let t=0;for(let n=0;n<i;n++){let s=n>=r?a[e+n-r]:0,o=e>0?a[e+n-i]:0,d=a[e+n]-(s+o>>1);t+=Math.abs(d)}return t}function RMa(a,e,i,r,t,n){for(let s=0;s<i;s++){let o=s>=n?a[e+s-n]:0,d=e>0?a[e+s-i]:0,l=e>0&&s>=n?a[e+s-(i+n)]:0,m=a[e+s]-CEe(o,d,l);r[t+s]=m}}function DMa(a,e,i,r){let t=0;for(let n=0;n<i;n++){let s=n>=r?a[e+n-r]:0,o=e>0?a[e+n-i]:0,d=e>0&&n>=r?a[e+n-(i+r)]:0,l=a[e+n]-CEe(s,o,d);t+=Math.abs(l)}return t}var xMa={0:jMa,1:IMa,2:TMa,3:CMa,4:RMa},MMa={0:bMa,1:SMa,2:EMa,3:AMa,4:DMa};AEe.exports=function(a,e,i,r,t){let n;if(!("filterType"in r)||r.filterType===-1)n=[0,1,2,3,4];else if(typeof r.filterType=="number")n=[r.filterType];else throw new Error("unrecognised filter types");r.bitDepth===16&&(t*=2);let s=e*t,o=0,d=0,l=Buffer.alloc((s+1)*i),m=n[0];for(let c=0;c<i;c++){if(n.length>1){let u=1/0;for(let f=0;f<n.length;f++){let N=MMa[n[f]](a,d,s,t);N<u&&(m=n[f],u=N)}}l[o]=m,o++,xMa[m](a,d,s,l,o,t),o+=s,d+=s}return l}});var NJ=Ie(($_r,DEe)=>{"use strict";var Vn=Ug(),PMa=lJ(),LMa=EEe(),OMa=REe(),BMa=Wi("zlib"),Mf=DEe.exports=function(a){if(this._options=a,a.deflateChunkSize=a.deflateChunkSize||32*1024,a.deflateLevel=a.deflateLevel!=null?a.deflateLevel:9,a.deflateStrategy=a.deflateStrategy!=null?a.deflateStrategy:3,a.inputHasAlpha=a.inputHasAlpha!=null?a.inputHasAlpha:!0,a.deflateFactory=a.deflateFactory||BMa.createDeflate,a.bitDepth=a.bitDepth||8,a.colorType=typeof a.colorType=="number"?a.colorType:Vn.COLORTYPE_COLOR_ALPHA,a.inputColorType=typeof a.inputColorType=="number"?a.inputColorType:Vn.COLORTYPE_COLOR_ALPHA,[Vn.COLORTYPE_GRAYSCALE,Vn.COLORTYPE_COLOR,Vn.COLORTYPE_COLOR_ALPHA,Vn.COLORTYPE_ALPHA].indexOf(a.colorType)===-1)throw new Error("option color type:"+a.colorType+" is not supported at present");if([Vn.COLORTYPE_GRAYSCALE,Vn.COLORTYPE_COLOR,Vn.COLORTYPE_COLOR_ALPHA,Vn.COLORTYPE_ALPHA].indexOf(a.inputColorType)===-1)throw new Error("option input color type:"+a.inputColorType+" is not supported at present");if(a.bitDepth!==8&&a.bitDepth!==16)throw new Error("option bit depth:"+a.bitDepth+" is not supported at present")};Mf.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}};Mf.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())};Mf.prototype.filterData=function(a,e,i){let r=LMa(a,e,i,this._options),t=Vn.COLORTYPE_TO_BPP_MAP[this._options.colorType];return OMa(r,e,i,this._options,t)};Mf.prototype._packChunk=function(a,e){let i=e?e.length:0,r=Buffer.alloc(i+12);return r.writeUInt32BE(i,0),r.writeUInt32BE(a,4),e&&e.copy(r,8),r.writeInt32BE(PMa.crc32(r.slice(4,r.length-4)),r.length-4),r};Mf.prototype.packGAMA=function(a){let e=Buffer.alloc(4);return e.writeUInt32BE(Math.floor(a*Vn.GAMMA_DIVISION),0),this._packChunk(Vn.TYPE_gAMA,e)};Mf.prototype.packIHDR=function(a,e){let i=Buffer.alloc(13);return i.writeUInt32BE(a,0),i.writeUInt32BE(e,4),i[8]=this._options.bitDepth,i[9]=this._options.colorType,i[10]=0,i[11]=0,i[12]=0,this._packChunk(Vn.TYPE_IHDR,i)};Mf.prototype.packIDAT=function(a){return this._packChunk(Vn.TYPE_IDAT,a)};Mf.prototype.packIEND=function(){return this._packChunk(Vn.TYPE_IEND,null)}});var LEe=Ie((H_r,PEe)=>{"use strict";var UMa=Wi("util"),xEe=Wi("stream"),FMa=Ug(),zMa=NJ(),MEe=PEe.exports=function(a){xEe.call(this);let e=a||{};this._packer=new zMa(e),this._deflate=this._packer.createDeflate(),this.readable=!0};UMa.inherits(MEe,xEe);MEe.prototype.pack=function(a,e,i,r){this.emit("data",Buffer.from(FMa.PNG_SIGNATURE)),this.emit("data",this._packer.packIHDR(e,i)),r&&this.emit("data",this._packer.packGAMA(r));let t=this._packer.filterData(a,e,i);this._deflate.on("error",this.emit.bind(this,"error")),this._deflate.on("data",function(n){this.emit("data",this._packer.packIDAT(n))}.bind(this)),this._deflate.on("end",function(){this.emit("data",this._packer.packIEND()),this.emit("end")}.bind(this)),this._deflate.end(t)}});var KEe=Ie((DS,zEe)=>{"use strict";var OEe=Wi("assert").ok,Fg=Wi("zlib"),KMa=Wi("util"),BEe=Wi("buffer").kMaxLength;function nh(a){if(!(this instanceof nh))return new nh(a);a&&a.chunkSize<Fg.Z_MIN_CHUNK&&(a.chunkSize=Fg.Z_MIN_CHUNK),Fg.Inflate.call(this,a),this._offset=this._offset===void 0?this._outOffset:this._offset,this._buffer=this._buffer||this._outBuffer,a&&a.maxLength!=null&&(this._maxLength=a.maxLength)}function VMa(a){return new nh(a)}function UEe(a,e){e&&process.nextTick(e),a._handle&&(a._handle.close(),a._handle=null)}nh.prototype._processChunk=function(a,e,i){if(typeof i=="function")return Fg.Inflate._processChunk.call(this,a,e,i);let r=this,t=a&&a.length,n=this._chunkSize-this._offset,s=this._maxLength,o=0,d=[],l=0,m;this.on("error",function(N){m=N});function c(N,_){if(r._hadError)return;let v=n-_;if(OEe(v>=0,"have should not go down"),v>0){let h=r._buffer.slice(r._offset,r._offset+v);if(r._offset+=v,h.length>s&&(h=h.slice(0,s)),d.push(h),l+=h.length,s-=h.length,s===0)return!1}return(_===0||r._offset>=r._chunkSize)&&(n=r._chunkSize,r._offset=0,r._buffer=Buffer.allocUnsafe(r._chunkSize)),_===0?(o+=t-N,t=N,!0):!1}OEe(this._handle,"zlib binding closed");let u;do u=this._handle.writeSync(e,a,o,t,this._buffer,this._offset,n),u=u||this._writeState;while(!this._hadError&&c(u[0],u[1]));if(this._hadError)throw m;if(l>=BEe)throw UEe(this),new RangeError("Cannot create final Buffer. It would be larger than 0x"+BEe.toString(16)+" bytes");let f=Buffer.concat(d,l);return UEe(this),f};KMa.inherits(nh,Fg.Inflate);function WMa(a,e){if(typeof e=="string"&&(e=Buffer.from(e)),!(e instanceof Buffer))throw new TypeError("Not a string or buffer");let i=a._finishFlushFlag;return i==null&&(i=Fg.Z_FINISH),a._processChunk(e,i)}function FEe(a,e){return WMa(new nh(e),a)}zEe.exports=DS=FEe;DS.Inflate=nh;DS.createInflate=VMa;DS.inflateSync=FEe});var pJ=Ie((X_r,WEe)=>{"use strict";var VEe=WEe.exports=function(a){this._buffer=a,this._reads=[]};VEe.prototype.read=function(a,e){this._reads.push({length:Math.abs(a),allowLess:a<0,func:e})};VEe.prototype.process=function(){for(;this._reads.length>0&&this._buffer.length;){let a=this._reads[0];if(this._buffer.length&&(this._buffer.length>=a.length||a.allowLess)){this._reads.shift();let e=this._buffer;this._buffer=e.slice(a.length),a.func.call(this,e.slice(0,a.length))}else break}if(this._reads.length>0)throw new Error("There are some read requests waitng on finished stream");if(this._buffer.length>0)throw new Error("unrecognised content at end of stream")}});var $Ee=Ie(GEe=>{"use strict";var GMa=pJ(),$Ma=sJ();GEe.process=function(a,e){let i=[],r=new GMa(a);return new $Ma(e,{read:r.read.bind(r),write:function(n){i.push(n)},complete:function(){}}).start(),r.process(),Buffer.concat(i)}});var JEe=Ie((J_r,QEe)=>{"use strict";var HEe=!0,XEe=Wi("zlib"),HMa=KEe();XEe.deflateSync||(HEe=!1);var XMa=pJ(),QMa=$Ee(),JMa=mJ(),YMa=cJ(),ZMa=uJ();QEe.exports=function(a,e){if(!HEe)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let i;function r(k){i=k}let t;function n(k){t=k}function s(k){t.transColor=k}function o(k){t.palette=k}function d(){t.alpha=!0}let l;function m(k){l=k}let c=[];function u(k){c.push(k)}let f=new XMa(a);if(new JMa(e,{read:f.read.bind(f),error:r,metadata:n,gamma:m,palette:o,transColor:s,inflateData:u,simpleTransparency:d}).start(),f.process(),i)throw i;let _=Buffer.concat(c);c.length=0;let v;if(t.interlace)v=XEe.inflateSync(_);else{let y=((t.width*t.bpp*t.depth+7>>3)+1)*t.height;v=HMa(_,{chunkSize:y,maxLength:y})}if(_=null,!v||!v.length)throw new Error("bad png - invalid inflate data response");let h=QMa.process(v,t);_=null;let w=YMa.dataToBitMap(h,t);h=null;let g=ZMa(w,t,e.skipRescale);return t.data=g,t.gamma=l||0,t}});var aCe=Ie((Y_r,eCe)=>{"use strict";var YEe=!0,ZEe=Wi("zlib");ZEe.deflateSync||(YEe=!1);var ePa=Ug(),aPa=NJ();eCe.exports=function(a,e){if(!YEe)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let i=e||{},r=new aPa(i),t=[];t.push(Buffer.from(ePa.PNG_SIGNATURE)),t.push(r.packIHDR(a.width,a.height)),a.gamma&&t.push(r.packGAMA(a.gamma));let n=r.filterData(a.data,a.width,a.height),s=ZEe.deflateSync(n,r.getDeflateOptions());if(n=null,!s||!s.length)throw new Error("bad png - invalid compressed data response");return t.push(r.packIDAT(s)),t.push(r.packIEND()),Buffer.concat(t)}});var iCe=Ie(_J=>{"use strict";var iPa=JEe(),rPa=aCe();_J.read=function(a,e){return iPa(a,e||{})};_J.write=function(a,e){return rPa(a,e)}});var xS=Ie(tCe=>{"use strict";var tPa=Wi("util"),rCe=Wi("stream"),nPa=SEe(),sPa=LEe(),oPa=iCe(),fs=tCe.PNG=function(a){rCe.call(this),a=a||{},this.width=a.width|0,this.height=a.height|0,this.data=this.width>0&&this.height>0?Buffer.alloc(4*this.width*this.height):null,a.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new nPa(a),this._parser.on("error",this.emit.bind(this,"error")),this._parser.on("close",this._handleClose.bind(this)),this._parser.on("metadata",this._metadata.bind(this)),this._parser.on("gamma",this._gamma.bind(this)),this._parser.on("parsed",function(e){this.data=e,this.emit("parsed",e)}.bind(this)),this._packer=new sPa(a),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};tPa.inherits(fs,rCe);fs.sync=oPa;fs.prototype.pack=function(){return!this.data||!this.data.length?(this.emit("error","No data provided"),this):(process.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this)),this)};fs.prototype.parse=function(a,e){if(e){let i,r;i=function(t){this.removeListener("error",r),this.data=t,e(null,this)}.bind(this),r=function(t){this.removeListener("parsed",i),e(t,null)}.bind(this),this.once("parsed",i),this.once("error",r)}return this.end(a),this};fs.prototype.write=function(a){return this._parser.write(a),!0};fs.prototype.end=function(a){this._parser.end(a)};fs.prototype._metadata=function(a){this.width=a.width,this.height=a.height,this.emit("metadata",a)};fs.prototype._gamma=function(a){this.gamma=a};fs.prototype._handleClose=function(){!this._parser.writable&&!this._packer.readable&&this.emit("close")};fs.bitblt=function(a,e,i,r,t,n,s,o){if(i|=0,r|=0,t|=0,n|=0,s|=0,o|=0,i>a.width||r>a.height||i+t>a.width||r+n>a.height)throw new Error("bitblt reading outside image");if(s>e.width||o>e.height||s+t>e.width||o+n>e.height)throw new Error("bitblt writing outside image");for(let d=0;d<n;d++)a.data.copy(e.data,(o+d)*e.width+s<<2,(r+d)*a.width+i<<2,(r+d)*a.width+i+t<<2)};fs.prototype.bitblt=function(a,e,i,r,t,n,s){return fs.bitblt(this,a,e,i,r,t,n,s),this};fs.adjustGamma=function(a){if(a.gamma){for(let e=0;e<a.height;e++)for(let i=0;i<a.width;i++){let r=a.width*e+i<<2;for(let t=0;t<3;t++){let n=a.data[r+t]/255;n=Math.pow(n,1/2.2/a.gamma),a.data[r+t]=Math.round(n*255)}}a.gamma=0}};fs.prototype.adjustGamma=function(){fs.adjustGamma(this)}});var oCe=Ie((ahr,DO)=>{var sCe=sCe||function(a){return Buffer.from(a).toString("base64")};function dPa(a){var e=this,i=Math.round,r=Math.floor,t=new Array(64),n=new Array(64),s=new Array(64),o=new Array(64),d,l,m,c,u=new Array(65535),f=new Array(65535),N=new Array(64),_=new Array(64),v=[],h=0,w=7,g=new Array(64),k=new Array(64),y=new Array(64),q=new Array(256),b=new Array(2048),O,L=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],Q=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],K=[0,1,2,3,4,5,6,7,8,9,10,11],$=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],X=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],oe=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],ae=[0,1,2,3,4,5,6,7,8,9,10,11],ue=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],de=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function Te(te){for(var Ze=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],fa=0;fa<64;fa++){var da=r((Ze[fa]*te+50)/100);da<1?da=1:da>255&&(da=255),t[L[fa]]=da}for(var Ea=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],Aa=0;Aa<64;Aa++){var fi=r((Ea[Aa]*te+50)/100);fi<1?fi=1:fi>255&&(fi=255),n[L[Aa]]=fi}for(var Ni=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],Ar=0,nr=0;nr<8;nr++)for(var qe=0;qe<8;qe++)s[Ar]=1/(t[L[Ar]]*Ni[nr]*Ni[qe]*8),o[Ar]=1/(n[L[Ar]]*Ni[nr]*Ni[qe]*8),Ar++}function je(te,Ze){for(var fa=0,da=0,Ea=new Array,Aa=1;Aa<=16;Aa++){for(var fi=1;fi<=te[Aa];fi++)Ea[Ze[da]]=[],Ea[Ze[da]][0]=fa,Ea[Ze[da]][1]=Aa,da++,fa++;fa*=2}return Ea}function ze(){d=je(Q,K),l=je(oe,ae),m=je($,X),c=je(ue,de)}function Ae(){for(var te=1,Ze=2,fa=1;fa<=15;fa++){for(var da=te;da<Ze;da++)f[32767+da]=fa,u[32767+da]=[],u[32767+da][1]=fa,u[32767+da][0]=da;for(var Ea=-(Ze-1);Ea<=-te;Ea++)f[32767+Ea]=fa,u[32767+Ea]=[],u[32767+Ea][1]=fa,u[32767+Ea][0]=Ze-1+Ea;te<<=1,Ze<<=1}}function re(){for(var te=0;te<256;te++)b[te]=19595*te,b[te+256>>0]=38470*te,b[te+512>>0]=7471*te+32768,b[te+768>>0]=-11059*te,b[te+1024>>0]=-21709*te,b[te+1280>>0]=32768*te+8421375,b[te+1536>>0]=-27439*te,b[te+1792>>0]=-5329*te}function he(te){for(var Ze=te[0],fa=te[1]-1;fa>=0;)Ze&1<<fa&&(h|=1<<w),fa--,w--,w<0&&(h==255?(H(255),H(0)):H(h),w=7,h=0)}function H(te){v.push(te)}function Y(te){H(te>>8&255),H(te&255)}function ie(te,Ze){var fa,da,Ea,Aa,fi,Ni,Ar,nr,qe=0,Ve,ka=8,br=64;for(Ve=0;Ve<ka;++Ve){fa=te[qe],da=te[qe+1],Ea=te[qe+2],Aa=te[qe+3],fi=te[qe+4],Ni=te[qe+5],Ar=te[qe+6],nr=te[qe+7];var Ra=fa+nr,Za=fa-nr,Vi=da+Ar,wa=da-Ar,bi=Ea+Ni,yn=Ea-Ni,_r=Aa+fi,nd=Aa-fi,fm=Ra+_r,Vp=Ra-_r,fw=Vi+bi,Nw=Vi-bi;te[qe]=fm+fw,te[qe+4]=fm-fw;var Fj=(Nw+Vp)*.707106781;te[qe+2]=Vp+Fj,te[qe+6]=Vp-Fj,fm=nd+yn,fw=yn+wa,Nw=wa+Za;var zj=(fm-Nw)*.382683433,Ix=.5411961*fm+zj,Kj=1.306562965*Nw+zj,Vj=fw*.707106781,Wj=Za+Vj,Gj=Za-Vj;te[qe+5]=Gj+Ix,te[qe+3]=Gj-Ix,te[qe+1]=Wj+Kj,te[qe+7]=Wj-Kj,qe+=8}for(qe=0,Ve=0;Ve<ka;++Ve){fa=te[qe],da=te[qe+8],Ea=te[qe+16],Aa=te[qe+24],fi=te[qe+32],Ni=te[qe+40],Ar=te[qe+48],nr=te[qe+56];var Cfe=fa+nr,Q4=fa-nr,Afe=da+Ar,Rfe=da-Ar,Dfe=Ea+Ni,xfe=Ea-Ni,Mfe=Aa+fi,Cha=Aa-fi,$j=Cfe+Mfe,J4=Cfe-Mfe,Sx=Afe+Dfe,Tx=Afe-Dfe;te[qe]=$j+Sx,te[qe+32]=$j-Sx;var Pfe=(Tx+J4)*.707106781;te[qe+16]=J4+Pfe,te[qe+48]=J4-Pfe,$j=Cha+xfe,Sx=xfe+Rfe,Tx=Rfe+Q4;var Lfe=($j-Tx)*.382683433,Ofe=.5411961*$j+Lfe,Bfe=1.306562965*Tx+Lfe,Ufe=Sx*.707106781,Ffe=Q4+Ufe,zfe=Q4-Ufe;te[qe+40]=zfe+Ofe,te[qe+24]=zfe-Ofe,te[qe+8]=Ffe+Bfe,te[qe+56]=Ffe-Bfe,qe++}var Ex;for(Ve=0;Ve<br;++Ve)Ex=te[Ve]*Ze[Ve],N[Ve]=Ex>0?Ex+.5|0:Ex-.5|0;return N}function se(){Y(65504),Y(16),H(74),H(70),H(73),H(70),H(0),H(1),H(1),H(0),Y(1),Y(1),H(0),H(0)}function ge(te){if(te){Y(65505),te[0]===69&&te[1]===120&&te[2]===105&&te[3]===102?Y(te.length+2):(Y(te.length+5+2),H(69),H(120),H(105),H(102),H(0));for(var Ze=0;Ze<te.length;Ze++)H(te[Ze])}}function ke(te,Ze){Y(65472),Y(17),H(8),Y(Ze),Y(te),H(3),H(1),H(17),H(0),H(2),H(17),H(1),H(3),H(17),H(1)}function Re(){Y(65499),Y(132),H(0);for(var te=0;te<64;te++)H(t[te]);H(1);for(var Ze=0;Ze<64;Ze++)H(n[Ze])}function me(){Y(65476),Y(418),H(0);for(var te=0;te<16;te++)H(Q[te+1]);for(var Ze=0;Ze<=11;Ze++)H(K[Ze]);H(16);for(var fa=0;fa<16;fa++)H($[fa+1]);for(var da=0;da<=161;da++)H(X[da]);H(1);for(var Ea=0;Ea<16;Ea++)H(oe[Ea+1]);for(var Aa=0;Aa<=11;Aa++)H(ae[Aa]);H(17);for(var fi=0;fi<16;fi++)H(ue[fi+1]);for(var Ni=0;Ni<=161;Ni++)H(de[Ni])}function pe(te){typeof te>"u"||te.constructor!==Array||te.forEach(Ze=>{if(typeof Ze=="string"){Y(65534);var fa=Ze.length;Y(fa+2);var da;for(da=0;da<fa;da++)H(Ze.charCodeAt(da))}})}function Qe(){Y(65498),Y(12),H(3),H(1),H(0),H(2),H(17),H(3),H(17),H(0),H(63),H(0)}function Be(te,Ze,fa,da,Ea){for(var Aa=Ea[0],fi=Ea[240],Ni,Ar=16,nr=63,qe=64,Ve=ie(te,Ze),ka=0;ka<qe;++ka)_[L[ka]]=Ve[ka];var br=_[0]-fa;fa=_[0],br==0?he(da[0]):(Ni=32767+br,he(da[f[Ni]]),he(u[Ni]));for(var Ra=63;Ra>0&&_[Ra]==0;Ra--);if(Ra==0)return he(Aa),fa;for(var Za=1,Vi;Za<=Ra;){for(var wa=Za;_[Za]==0&&Za<=Ra;++Za);var bi=Za-wa;if(bi>=Ar){Vi=bi>>4;for(var yn=1;yn<=Vi;++yn)he(fi);bi=bi&15}Ni=32767+_[Za],he(Ea[(bi<<4)+f[Ni]]),he(u[Ni]),Za++}return Ra!=nr&&he(Aa),fa}function Je(){for(var te=String.fromCharCode,Ze=0;Ze<256;Ze++)q[Ze]=te(Ze)}this.encode=function(te,Ze){var fa=new Date().getTime();Ze&&td(Ze),v=new Array,h=0,w=7,Y(65496),se(),pe(te.comments),ge(te.exifBuffer),Re(),ke(te.width,te.height),me(),Qe();var da=0,Ea=0,Aa=0;h=0,w=7,this.encode.displayName="_encode_";for(var fi=te.data,Ni=te.width,Ar=te.height,nr=Ni*4,qe=Ni*3,Ve,ka=0,br,Ra,Za,Vi,wa,bi,yn,_r;ka<Ar;){for(Ve=0;Ve<nr;){for(Vi=nr*ka+Ve,wa=Vi,bi=-1,yn=0,_r=0;_r<64;_r++)yn=_r>>3,bi=(_r&7)*4,wa=Vi+yn*nr+bi,ka+yn>=Ar&&(wa-=nr*(ka+1+yn-Ar)),Ve+bi>=nr&&(wa-=Ve+bi-nr+4),br=fi[wa++],Ra=fi[wa++],Za=fi[wa++],g[_r]=(b[br]+b[Ra+256>>0]+b[Za+512>>0]>>16)-128,k[_r]=(b[br+768>>0]+b[Ra+1024>>0]+b[Za+1280>>0]>>16)-128,y[_r]=(b[br+1280>>0]+b[Ra+1536>>0]+b[Za+1792>>0]>>16)-128;da=Be(g,s,da,d,m),Ea=Be(k,o,Ea,l,c),Aa=Be(y,o,Aa,l,c),Ve+=32}ka+=8}if(w>=0){var nd=[];nd[1]=w+1,nd[0]=(1<<w+1)-1,he(nd)}if(Y(65497),typeof DO>"u")return new Uint8Array(v);return Buffer.from(v);var fm,Vp};function td(te){if(te<=0&&(te=1),te>100&&(te=100),O!=te){var Ze=0;te<50?Ze=Math.floor(5e3/te):Ze=Math.floor(200-te*2),Te(Ze),O=te}}function Zd(){var te=new Date().getTime();a||(a=50),Je(),ze(),Ae(),re(),td(a);var Ze=new Date().getTime()-te}Zd()}typeof DO<"u"?DO.exports=nCe:typeof window<"u"&&(window["jpeg-js"]=window["jpeg-js"]||{},window["jpeg-js"].encode=nCe);function nCe(a,e){typeof e>"u"&&(e=50);var i=new dPa(e),r=i.encode(a,e);return{data:r,width:a.width,height:a.height}}});var lCe=Ie((ihr,vJ)=>{var hJ=(function(){"use strict";var e=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),i=4017,r=799,t=3406,n=2276,s=1567,o=3784,d=5793,l=2896;function m(){}function c(w,g){for(var k=0,y=[],q,b,O=16;O>0&&!w[O-1];)O--;y.push({children:[],index:0});var L=y[0],Q;for(q=0;q<O;q++){for(b=0;b<w[q];b++){for(L=y.pop(),L.children[L.index]=g[k];L.index>0;){if(y.length===0)throw new Error("Could not recreate Huffman Table");L=y.pop()}for(L.index++,y.push(L);y.length<=q;)y.push(Q={children:[],index:0}),L.children[L.index]=Q.children,L=Q;k++}q+1<O&&(y.push(Q={children:[],index:0}),L.children[L.index]=Q.children,L=Q)}return y[0].children}function u(w,g,k,y,q,b,O,L,Q,K){var $=k.precision,X=k.samplesPerLine,oe=k.scanLines,ae=k.mcusPerLine,ue=k.progressive,de=k.maxH,Te=k.maxV,je=g,ze=0,Ae=0;function re(){if(Ae>0)return Ae--,ze>>Ae&1;if(ze=w[g++],ze==255){var qe=w[g++];if(qe)throw new Error("unexpected marker: "+(ze<<8|qe).toString(16))}return Ae=7,ze>>>7}function he(qe){for(var Ve=qe,ka;(ka=re())!==null;){if(Ve=Ve[ka],typeof Ve=="number")return Ve;if(typeof Ve!="object")throw new Error("invalid huffman sequence")}return null}function H(qe){for(var Ve=0;qe>0;){var ka=re();if(ka===null)return;Ve=Ve<<1|ka,qe--}return Ve}function Y(qe){var Ve=H(qe);return Ve>=1<<qe-1?Ve:Ve+(-1<<qe)+1}function ie(qe,Ve){var ka=he(qe.huffmanTableDC),br=ka===0?0:Y(ka);Ve[0]=qe.pred+=br;for(var Ra=1;Ra<64;){var Za=he(qe.huffmanTableAC),Vi=Za&15,wa=Za>>4;if(Vi===0){if(wa<15)break;Ra+=16;continue}Ra+=wa;var bi=e[Ra];Ve[bi]=Y(Vi),Ra++}}function se(qe,Ve){var ka=he(qe.huffmanTableDC),br=ka===0?0:Y(ka)<<Q;Ve[0]=qe.pred+=br}function ge(qe,Ve){Ve[0]|=re()<<Q}var ke=0;function Re(qe,Ve){if(ke>0){ke--;return}for(var ka=b,br=O;ka<=br;){var Ra=he(qe.huffmanTableAC),Za=Ra&15,Vi=Ra>>4;if(Za===0){if(Vi<15){ke=H(Vi)+(1<<Vi)-1;break}ka+=16;continue}ka+=Vi;var wa=e[ka];Ve[wa]=Y(Za)*(1<<Q),ka++}}var me=0,pe;function Qe(qe,Ve){for(var ka=b,br=O,Ra=0;ka<=br;){var Za=e[ka],Vi=Ve[Za]<0?-1:1;switch(me){case 0:var wa=he(qe.huffmanTableAC),bi=wa&15,Ra=wa>>4;if(bi===0)Ra<15?(ke=H(Ra)+(1<<Ra),me=4):(Ra=16,me=1);else{if(bi!==1)throw new Error("invalid ACn encoding");pe=Y(bi),me=Ra?2:3}continue;case 1:case 2:Ve[Za]?Ve[Za]+=(re()<<Q)*Vi:(Ra--,Ra===0&&(me=me==2?3:0));break;case 3:Ve[Za]?Ve[Za]+=(re()<<Q)*Vi:(Ve[Za]=pe<<Q,me=0);break;case 4:Ve[Za]&&(Ve[Za]+=(re()<<Q)*Vi);break}ka++}me===4&&(ke--,ke===0&&(me=0))}function Be(qe,Ve,ka,br,Ra){var Za=ka/ae|0,Vi=ka%ae,wa=Za*qe.v+br,bi=Vi*qe.h+Ra;qe.blocks[wa]===void 0&&K.tolerantDecoding||Ve(qe,qe.blocks[wa][bi])}function Je(qe,Ve,ka){var br=ka/qe.blocksPerLine|0,Ra=ka%qe.blocksPerLine;qe.blocks[br]===void 0&&K.tolerantDecoding||Ve(qe,qe.blocks[br][Ra])}var td=y.length,Zd,te,Ze,fa,da,Ea;ue?b===0?Ea=L===0?se:ge:Ea=L===0?Re:Qe:Ea=ie;var Aa=0,fi,Ni;td==1?Ni=y[0].blocksPerLine*y[0].blocksPerColumn:Ni=ae*k.mcusPerColumn,q||(q=Ni);for(var Ar,nr;Aa<Ni;){for(te=0;te<td;te++)y[te].pred=0;if(ke=0,td==1)for(Zd=y[0],da=0;da<q;da++)Je(Zd,Ea,Aa),Aa++;else for(da=0;da<q;da++){for(te=0;te<td;te++)for(Zd=y[te],Ar=Zd.h,nr=Zd.v,Ze=0;Ze<nr;Ze++)for(fa=0;fa<Ar;fa++)Be(Zd,Ea,Aa,Ze,fa);if(Aa++,Aa===Ni)break}if(Aa===Ni)do{if(w[g]===255&&w[g+1]!==0)break;g+=1}while(g<w.length-2);if(Ae=0,fi=w[g]<<8|w[g+1],fi<65280)throw new Error("marker was not found");if(fi>=65488&&fi<=65495)g+=2;else break}return g-je}function f(w,g){var k=[],y=g.blocksPerLine,q=g.blocksPerColumn,b=y<<3,O=new Int32Array(64),L=new Uint8Array(64);function Q(je,ze,Ae){var re=g.quantizationTable,he,H,Y,ie,se,ge,ke,Re,me,pe=Ae,Qe;for(Qe=0;Qe<64;Qe++)pe[Qe]=je[Qe]*re[Qe];for(Qe=0;Qe<8;++Qe){var Be=8*Qe;if(pe[1+Be]==0&&pe[2+Be]==0&&pe[3+Be]==0&&pe[4+Be]==0&&pe[5+Be]==0&&pe[6+Be]==0&&pe[7+Be]==0){me=d*pe[0+Be]+512>>10,pe[0+Be]=me,pe[1+Be]=me,pe[2+Be]=me,pe[3+Be]=me,pe[4+Be]=me,pe[5+Be]=me,pe[6+Be]=me,pe[7+Be]=me;continue}he=d*pe[0+Be]+128>>8,H=d*pe[4+Be]+128>>8,Y=pe[2+Be],ie=pe[6+Be],se=l*(pe[1+Be]-pe[7+Be])+128>>8,Re=l*(pe[1+Be]+pe[7+Be])+128>>8,ge=pe[3+Be]<<4,ke=pe[5+Be]<<4,me=he-H+1>>1,he=he+H+1>>1,H=me,me=Y*o+ie*s+128>>8,Y=Y*s-ie*o+128>>8,ie=me,me=se-ke+1>>1,se=se+ke+1>>1,ke=me,me=Re+ge+1>>1,ge=Re-ge+1>>1,Re=me,me=he-ie+1>>1,he=he+ie+1>>1,ie=me,me=H-Y+1>>1,H=H+Y+1>>1,Y=me,me=se*n+Re*t+2048>>12,se=se*t-Re*n+2048>>12,Re=me,me=ge*r+ke*i+2048>>12,ge=ge*i-ke*r+2048>>12,ke=me,pe[0+Be]=he+Re,pe[7+Be]=he-Re,pe[1+Be]=H+ke,pe[6+Be]=H-ke,pe[2+Be]=Y+ge,pe[5+Be]=Y-ge,pe[3+Be]=ie+se,pe[4+Be]=ie-se}for(Qe=0;Qe<8;++Qe){var Je=Qe;if(pe[8+Je]==0&&pe[16+Je]==0&&pe[24+Je]==0&&pe[32+Je]==0&&pe[40+Je]==0&&pe[48+Je]==0&&pe[56+Je]==0){me=d*Ae[Qe+0]+8192>>14,pe[0+Je]=me,pe[8+Je]=me,pe[16+Je]=me,pe[24+Je]=me,pe[32+Je]=me,pe[40+Je]=me,pe[48+Je]=me,pe[56+Je]=me;continue}he=d*pe[0+Je]+2048>>12,H=d*pe[32+Je]+2048>>12,Y=pe[16+Je],ie=pe[48+Je],se=l*(pe[8+Je]-pe[56+Je])+2048>>12,Re=l*(pe[8+Je]+pe[56+Je])+2048>>12,ge=pe[24+Je],ke=pe[40+Je],me=he-H+1>>1,he=he+H+1>>1,H=me,me=Y*o+ie*s+2048>>12,Y=Y*s-ie*o+2048>>12,ie=me,me=se-ke+1>>1,se=se+ke+1>>1,ke=me,me=Re+ge+1>>1,ge=Re-ge+1>>1,Re=me,me=he-ie+1>>1,he=he+ie+1>>1,ie=me,me=H-Y+1>>1,H=H+Y+1>>1,Y=me,me=se*n+Re*t+2048>>12,se=se*t-Re*n+2048>>12,Re=me,me=ge*r+ke*i+2048>>12,ge=ge*i-ke*r+2048>>12,ke=me,pe[0+Je]=he+Re,pe[56+Je]=he-Re,pe[8+Je]=H+ke,pe[48+Je]=H-ke,pe[16+Je]=Y+ge,pe[40+Je]=Y-ge,pe[24+Je]=ie+se,pe[32+Je]=ie-se}for(Qe=0;Qe<64;++Qe){var td=128+(pe[Qe]+8>>4);ze[Qe]=td<0?0:td>255?255:td}}h(b*q*8);for(var K,$,X=0;X<q;X++){var oe=X<<3;for(K=0;K<8;K++)k.push(new Uint8Array(b));for(var ae=0;ae<y;ae++){Q(g.blocks[X][ae],L,O);var ue=0,de=ae<<3;for($=0;$<8;$++){var Te=k[oe+$];for(K=0;K<8;K++)Te[de+K]=L[ue++]}}}return k}function N(w){return w<0?0:w>255?255:w}m.prototype={load:function(g){var k=new XMLHttpRequest;k.open("GET",g,!0),k.responseType="arraybuffer",k.onload=(function(){var y=new Uint8Array(k.response||k.mozResponseArrayBuffer);this.parse(y),this.onload&&this.onload()}).bind(this),k.send(null)},parse:function(g){var k=this.opts.maxResolutionInMP*1e3*1e3,y=0,q=g.length;function b(){var wa=g[y]<<8|g[y+1];return y+=2,wa}function O(){var wa=b(),bi=g.subarray(y,y+wa-2);return y+=bi.length,bi}function L(wa){var bi=1,yn=1,_r,nd;for(nd in wa.components)wa.components.hasOwnProperty(nd)&&(_r=wa.components[nd],bi<_r.h&&(bi=_r.h),yn<_r.v&&(yn=_r.v));var fm=Math.ceil(wa.samplesPerLine/8/bi),Vp=Math.ceil(wa.scanLines/8/yn);for(nd in wa.components)if(wa.components.hasOwnProperty(nd)){_r=wa.components[nd];var fw=Math.ceil(Math.ceil(wa.samplesPerLine/8)*_r.h/bi),Nw=Math.ceil(Math.ceil(wa.scanLines/8)*_r.v/yn),Fj=fm*_r.h,zj=Vp*_r.v,Ix=zj*Fj,Kj=[];h(Ix*256);for(var Vj=0;Vj<zj;Vj++){for(var Wj=[],Gj=0;Gj<Fj;Gj++)Wj.push(new Int32Array(64));Kj.push(Wj)}_r.blocksPerLine=fw,_r.blocksPerColumn=Nw,_r.blocks=Kj}wa.maxH=bi,wa.maxV=yn,wa.mcusPerLine=fm,wa.mcusPerColumn=Vp}var Q=null,K=null,$=null,X,oe,ae=[],ue=[],de=[],Te=[],je=b(),ze=-1;if(this.comments=[],je!=65496)throw new Error("SOI not found");for(je=b();je!=65497;){var Ae,re,he;switch(je){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var H=O();if(je===65534){var Y=String.fromCharCode.apply(null,H);this.comments.push(Y)}je===65504&&H[0]===74&&H[1]===70&&H[2]===73&&H[3]===70&&H[4]===0&&(Q={version:{major:H[5],minor:H[6]},densityUnits:H[7],xDensity:H[8]<<8|H[9],yDensity:H[10]<<8|H[11],thumbWidth:H[12],thumbHeight:H[13],thumbData:H.subarray(14,14+3*H[12]*H[13])}),je===65505&&H[0]===69&&H[1]===120&&H[2]===105&&H[3]===102&&H[4]===0&&(this.exifBuffer=H.subarray(5,H.length)),je===65518&&H[0]===65&&H[1]===100&&H[2]===111&&H[3]===98&&H[4]===101&&H[5]===0&&(K={version:H[6],flags0:H[7]<<8|H[8],flags1:H[9]<<8|H[10],transformCode:H[11]});break;case 65499:for(var ie=b(),se=ie+y-2;y<se;){var ge=g[y++];h(256);var ke=new Int32Array(64);if(ge>>4===0)for(re=0;re<64;re++){var Re=e[re];ke[Re]=g[y++]}else if(ge>>4===1)for(re=0;re<64;re++){var Re=e[re];ke[Re]=b()}else throw new Error("DQT: invalid table spec");ae[ge&15]=ke}break;case 65472:case 65473:case 65474:b(),X={},X.extended=je===65473,X.progressive=je===65474,X.precision=g[y++],X.scanLines=b(),X.samplesPerLine=b(),X.components={},X.componentsOrder=[];var me=X.scanLines*X.samplesPerLine;if(me>k){var pe=Math.ceil((me-k)/1e6);throw new Error(`maxResolutionInMP limit exceeded by ${pe}MP`)}var Qe=g[y++],Be,Je=0,td=0;for(Ae=0;Ae<Qe;Ae++){Be=g[y];var Zd=g[y+1]>>4,te=g[y+1]&15,Ze=g[y+2];if(Zd<=0||te<=0)throw new Error("Invalid sampling factor, expected values above 0");X.componentsOrder.push(Be),X.components[Be]={h:Zd,v:te,quantizationIdx:Ze},y+=3}L(X),ue.push(X);break;case 65476:var fa=b();for(Ae=2;Ae<fa;){var da=g[y++],Ea=new Uint8Array(16),Aa=0;for(re=0;re<16;re++,y++)Aa+=Ea[re]=g[y];h(16+Aa);var fi=new Uint8Array(Aa);for(re=0;re<Aa;re++,y++)fi[re]=g[y];Ae+=17+Aa,(da>>4===0?Te:de)[da&15]=c(Ea,fi)}break;case 65501:b(),oe=b();break;case 65500:b(),b();break;case 65498:var Ni=b(),Ar=g[y++],nr=[],qe;for(Ae=0;Ae<Ar;Ae++){qe=X.components[g[y++]];var Ve=g[y++];qe.huffmanTableDC=Te[Ve>>4],qe.huffmanTableAC=de[Ve&15],nr.push(qe)}var ka=g[y++],br=g[y++],Ra=g[y++],Za=u(g,y,X,nr,oe,ka,br,Ra>>4,Ra&15,this.opts);y+=Za;break;case 65535:g[y]!==255&&y--;break;default:if(g[y-3]==255&&g[y-2]>=192&&g[y-2]<=254){y-=3;break}else if(je===224||je==225){if(ze!==-1)throw new Error(`first unknown JPEG marker at offset ${ze.toString(16)}, second unknown JPEG marker ${je.toString(16)} at offset ${(y-1).toString(16)}`);ze=y-1;let wa=b();if(g[y+wa-2]===255){y+=wa-2;break}}throw new Error("unknown JPEG marker "+je.toString(16))}je=b()}if(ue.length!=1)throw new Error("only single frame JPEGs supported");for(var Ae=0;Ae<ue.length;Ae++){var Vi=ue[Ae].components;for(var re in Vi)Vi[re].quantizationTable=ae[Vi[re].quantizationIdx],delete Vi[re].quantizationIdx}this.width=X.samplesPerLine,this.height=X.scanLines,this.jfif=Q,this.adobe=K,this.components=[];for(var Ae=0;Ae<X.componentsOrder.length;Ae++){var qe=X.components[X.componentsOrder[Ae]];this.components.push({lines:f(X,qe),scaleX:qe.h/X.maxH,scaleY:qe.v/X.maxV})}},getData:function(g,k){var y=this.width/g,q=this.height/k,b,O,L,Q,K,$,X,oe,ae,ue,de=0,Te,je,ze,Ae,re,he,H,Y,ie,se,ge,ke=g*k*this.components.length;h(ke);var Re=new Uint8Array(ke);switch(this.components.length){case 1:for(b=this.components[0],ue=0;ue<k;ue++)for(K=b.lines[0|ue*b.scaleY*q],ae=0;ae<g;ae++)Te=K[0|ae*b.scaleX*y],Re[de++]=Te;break;case 2:for(b=this.components[0],O=this.components[1],ue=0;ue<k;ue++)for(K=b.lines[0|ue*b.scaleY*q],$=O.lines[0|ue*O.scaleY*q],ae=0;ae<g;ae++)Te=K[0|ae*b.scaleX*y],Re[de++]=Te,Te=$[0|ae*O.scaleX*y],Re[de++]=Te;break;case 3:for(ge=!0,this.adobe&&this.adobe.transformCode?ge=!0:typeof this.opts.colorTransform<"u"&&(ge=!!this.opts.colorTransform),b=this.components[0],O=this.components[1],L=this.components[2],ue=0;ue<k;ue++)for(K=b.lines[0|ue*b.scaleY*q],$=O.lines[0|ue*O.scaleY*q],X=L.lines[0|ue*L.scaleY*q],ae=0;ae<g;ae++)ge?(Te=K[0|ae*b.scaleX*y],je=$[0|ae*O.scaleX*y],ze=X[0|ae*L.scaleX*y],Y=N(Te+1.402*(ze-128)),ie=N(Te-.3441363*(je-128)-.71413636*(ze-128)),se=N(Te+1.772*(je-128))):(Y=K[0|ae*b.scaleX*y],ie=$[0|ae*O.scaleX*y],se=X[0|ae*L.scaleX*y]),Re[de++]=Y,Re[de++]=ie,Re[de++]=se;break;case 4:if(!this.adobe)throw new Error("Unsupported color mode (4 components)");for(ge=!1,this.adobe&&this.adobe.transformCode?ge=!0:typeof this.opts.colorTransform<"u"&&(ge=!!this.opts.colorTransform),b=this.components[0],O=this.components[1],L=this.components[2],Q=this.components[3],ue=0;ue<k;ue++)for(K=b.lines[0|ue*b.scaleY*q],$=O.lines[0|ue*O.scaleY*q],X=L.lines[0|ue*L.scaleY*q],oe=Q.lines[0|ue*Q.scaleY*q],ae=0;ae<g;ae++)ge?(Te=K[0|ae*b.scaleX*y],je=$[0|ae*O.scaleX*y],ze=X[0|ae*L.scaleX*y],Ae=oe[0|ae*Q.scaleX*y],re=255-N(Te+1.402*(ze-128)),he=255-N(Te-.3441363*(je-128)-.71413636*(ze-128)),H=255-N(Te+1.772*(je-128))):(re=K[0|ae*b.scaleX*y],he=$[0|ae*O.scaleX*y],H=X[0|ae*L.scaleX*y],Ae=oe[0|ae*Q.scaleX*y]),Re[de++]=255-re,Re[de++]=255-he,Re[de++]=255-H,Re[de++]=255-Ae;break;default:throw new Error("Unsupported color mode")}return Re},copyToImageData:function(g,k){var y=g.width,q=g.height,b=g.data,O=this.getData(y,q),L=0,Q=0,K,$,X,oe,ae,ue,de,Te,je;switch(this.components.length){case 1:for($=0;$<q;$++)for(K=0;K<y;K++)X=O[L++],b[Q++]=X,b[Q++]=X,b[Q++]=X,k&&(b[Q++]=255);break;case 3:for($=0;$<q;$++)for(K=0;K<y;K++)de=O[L++],Te=O[L++],je=O[L++],b[Q++]=de,b[Q++]=Te,b[Q++]=je,k&&(b[Q++]=255);break;case 4:for($=0;$<q;$++)for(K=0;K<y;K++)ae=O[L++],ue=O[L++],X=O[L++],oe=O[L++],de=255-N(ae*(1-oe/255)+oe),Te=255-N(ue*(1-oe/255)+oe),je=255-N(X*(1-oe/255)+oe),b[Q++]=de,b[Q++]=Te,b[Q++]=je,k&&(b[Q++]=255);break;default:throw new Error("Unsupported color mode")}}};var _=0,v=0;function h(w=0){var g=_+w;if(g>v){var k=Math.ceil((g-v)/1024/1024);throw new Error(`maxMemoryUsageInMB limit exceeded by at least ${k}MB`)}_=g}return m.resetMaxMemoryUsage=function(w){_=0,v=w},m.getBytesAllocated=function(){return _},m.requestMemoryAllocation=h,m})();typeof vJ<"u"?vJ.exports=dCe:typeof window<"u"&&(window["jpeg-js"]=window["jpeg-js"]||{},window["jpeg-js"].decode=dCe);function dCe(a,e={}){var i={colorTransform:void 0,useTArray:!1,formatAsRGBA:!0,tolerantDecoding:!0,maxResolutionInMP:100,maxMemoryUsageInMB:512},r={...i,...e},t=new Uint8Array(a),n=new hJ;n.opts=r,hJ.resetMaxMemoryUsage(r.maxMemoryUsageInMB*1024*1024),n.parse(t);var s=r.formatAsRGBA?4:3,o=n.width*n.height*s;try{hJ.requestMemoryAllocation(o);var d={width:n.width,height:n.height,exifBuffer:n.exifBuffer,data:r.useTArray?new Uint8Array(o):Buffer.alloc(o)};n.comments.length>0&&(d.comments=n.comments)}catch(l){throw l instanceof RangeError?new Error("Could not allocate enough memory for the image. Required: "+o):l instanceof ReferenceError&&l.message==="Buffer is not defined"?new Error("Buffer is not globally defined in this environment. Consider setting useTArray to true"):l}return n.copyToImageData(d,r.formatAsRGBA),d}});var wJ=Ie((rhr,mCe)=>{var lPa=oCe(),mPa=lCe();mCe.exports={encode:lPa,decode:mPa}});var hLe=Ie((iCr,_Le)=>{function pLe(a){this.buffer=a.data,this.width=a.width,this.height=a.height,this.extraBytes=this.width%4,this.rgbSize=this.height*(3*this.width+this.extraBytes),this.headerInfoSize=40,this.data=[],this.flag="BM",this.reserved=0,this.offset=54,this.fileSize=this.rgbSize+this.offset,this.planes=1,this.bitPP=24,this.compress=0,this.hr=0,this.vr=0,this.colors=0,this.importantColors=0}pLe.prototype.encode=function(){var a=new Buffer(this.offset+this.rgbSize);this.pos=0,a.write(this.flag,this.pos,2),this.pos+=2,a.writeUInt32LE(this.fileSize,this.pos),this.pos+=4,a.writeUInt32LE(this.reserved,this.pos),this.pos+=4,a.writeUInt32LE(this.offset,this.pos),this.pos+=4,a.writeUInt32LE(this.headerInfoSize,this.pos),this.pos+=4,a.writeUInt32LE(this.width,this.pos),this.pos+=4,a.writeInt32LE(-this.height,this.pos),this.pos+=4,a.writeUInt16LE(this.planes,this.pos),this.pos+=2,a.writeUInt16LE(this.bitPP,this.pos),this.pos+=2,a.writeUInt32LE(this.compress,this.pos),this.pos+=4,a.writeUInt32LE(this.rgbSize,this.pos),this.pos+=4,a.writeUInt32LE(this.hr,this.pos),this.pos+=4,a.writeUInt32LE(this.vr,this.pos),this.pos+=4,a.writeUInt32LE(this.colors,this.pos),this.pos+=4,a.writeUInt32LE(this.importantColors,this.pos),this.pos+=4;for(var e=0,i=3*this.width+this.extraBytes,r=0;r<this.height;r++){for(var t=0;t<this.width;t++){var n=this.pos+r*i+t*3;e++,a[n]=this.buffer[e++],a[n+1]=this.buffer[e++],a[n+2]=this.buffer[e++]}if(this.extraBytes>0){var s=this.pos+r*i+this.width*3;a.fill(0,s,s+this.extraBytes)}}return a};_Le.exports=function(a,e){typeof e>"u"&&(e=100);var i=new pLe(a),r=i.encode();return{data:r,width:a.width,height:a.height}}});var wLe=Ie((rCr,vLe)=>{function Cl(a,e){if(this.pos=0,this.buffer=a,this.is_with_alpha=!!e,this.bottom_up=!0,this.flag=this.buffer.toString("utf-8",0,this.pos+=2),this.flag!="BM")throw new Error("Invalid BMP File");this.parseHeader(),this.parseRGBA()}Cl.prototype.parseHeader=function(){if(this.fileSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.reserved=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.offset=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.headerSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.width=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.height=this.buffer.readInt32LE(this.pos),this.pos+=4,this.planes=this.buffer.readUInt16LE(this.pos),this.pos+=2,this.bitPP=this.buffer.readUInt16LE(this.pos),this.pos+=2,this.compress=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.rawSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.hr=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.vr=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.colors=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.importantColors=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var a=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(a);for(var e=0;e<a;e++){var i=this.buffer.readUInt8(this.pos++),r=this.buffer.readUInt8(this.pos++),t=this.buffer.readUInt8(this.pos++),n=this.buffer.readUInt8(this.pos++);this.palette[e]={red:t,green:r,blue:i,quad:n}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)};Cl.prototype.parseRGBA=function(){var a="bit"+this.bitPP,e=this.width*this.height*4;this.data=new Buffer(e),this[a]()};Cl.prototype.bit1=function(){for(var a=Math.ceil(this.width/8),e=a%4,i=this.height>=0?this.height-1:-this.height,i=this.height-1;i>=0;i--){for(var r=this.bottom_up?i:this.height-1-i,t=0;t<a;t++)for(var n=this.buffer.readUInt8(this.pos++),s=r*this.width*4+t*8*4,o=0;o<8&&t*8+o<this.width;o++){var d=this.palette[n>>7-o&1];this.data[s+o*4]=0,this.data[s+o*4+1]=d.blue,this.data[s+o*4+2]=d.green,this.data[s+o*4+3]=d.red}e!=0&&(this.pos+=4-e)}};Cl.prototype.bit4=function(){if(this.compress==2){let v=function(h){var w=this.palette[h];this.data[a]=0,this.data[a+1]=w.blue,this.data[a+2]=w.green,this.data[a+3]=w.red,a+=4};var _=v;this.data.fill(255);for(var a=0,e=this.bottom_up?this.height-1:0,i=!1;a<this.data.length;){var r=this.buffer.readUInt8(this.pos++),t=this.buffer.readUInt8(this.pos++);if(r==0)if(t==0){this.bottom_up?e--:e++,a=e*this.width*4,i=!1;continue}else{if(t==1)break;if(t==2){var n=this.buffer.readUInt8(this.pos++),s=this.buffer.readUInt8(this.pos++);this.bottom_up?e-=s:e+=s,a+=s*this.width*4+n*4}else{for(var o=this.buffer.readUInt8(this.pos++),d=0;d<t;d++)i?v.call(this,o&15):v.call(this,(o&240)>>4),d&1&&d+1<t&&(o=this.buffer.readUInt8(this.pos++)),i=!i;(t+1>>1&1)==1&&this.pos++}}else for(var d=0;d<r;d++)i?v.call(this,t&15):v.call(this,(t&240)>>4),i=!i}}else for(var l=Math.ceil(this.width/2),m=l%4,s=this.height-1;s>=0;s--){for(var c=this.bottom_up?s:this.height-1-s,n=0;n<l;n++){var t=this.buffer.readUInt8(this.pos++),a=c*this.width*4+n*2*4,u=t>>4,f=t&15,N=this.palette[u];if(this.data[a]=0,this.data[a+1]=N.blue,this.data[a+2]=N.green,this.data[a+3]=N.red,n*2+1>=this.width)break;N=this.palette[f],this.data[a+4]=0,this.data[a+4+1]=N.blue,this.data[a+4+2]=N.green,this.data[a+4+3]=N.red}m!=0&&(this.pos+=4-m)}};Cl.prototype.bit8=function(){if(this.compress==1){let u=function(f){var N=this.palette[f];this.data[a]=0,this.data[a+1]=N.blue,this.data[a+2]=N.green,this.data[a+3]=N.red,a+=4};var c=u;this.data.fill(255);for(var a=0,e=this.bottom_up?this.height-1:0;a<this.data.length;){var i=this.buffer.readUInt8(this.pos++),r=this.buffer.readUInt8(this.pos++);if(i==0)if(r==0){this.bottom_up?e--:e++,a=e*this.width*4;continue}else{if(r==1)break;if(r==2){var t=this.buffer.readUInt8(this.pos++),n=this.buffer.readUInt8(this.pos++);this.bottom_up?e-=n:e+=n,a+=n*this.width*4+t*4}else{for(var s=0;s<r;s++){var o=this.buffer.readUInt8(this.pos++);u.call(this,o)}r&!0&&this.pos++}}else for(var s=0;s<i;s++)u.call(this,r)}}else for(var d=this.width%4,n=this.height-1;n>=0;n--){for(var l=this.bottom_up?n:this.height-1-n,t=0;t<this.width;t++){var r=this.buffer.readUInt8(this.pos++),a=l*this.width*4+t*4;if(r<this.palette.length){var m=this.palette[r];this.data[a]=0,this.data[a+1]=m.blue,this.data[a+2]=m.green,this.data[a+3]=m.red}else this.data[a]=0,this.data[a+1]=255,this.data[a+2]=255,this.data[a+3]=255}d!=0&&(this.pos+=4-d)}};Cl.prototype.bit15=function(){for(var a=this.width%3,e=parseInt("11111",2),i=e,r=this.height-1;r>=0;r--){for(var t=this.bottom_up?r:this.height-1-r,n=0;n<this.width;n++){var s=this.buffer.readUInt16LE(this.pos);this.pos+=2;var o=(s&i)/i*255|0,d=(s>>5&i)/i*255|0,l=(s>>10&i)/i*255|0,m=s>>15?255:0,c=t*this.width*4+n*4;this.data[c]=m,this.data[c+1]=o,this.data[c+2]=d,this.data[c+3]=l}this.pos+=a}};Cl.prototype.bit16=function(){var a=this.width%2*2;this.maskRed=31744,this.maskGreen=992,this.maskBlue=31,this.mask0=0,this.compress==3&&(this.maskRed=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.maskGreen=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.maskBlue=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.mask0=this.buffer.readUInt32LE(this.pos),this.pos+=4);for(var e=[0,0,0],i=0;i<16;i++)this.maskRed>>i&1&&e[0]++,this.maskGreen>>i&1&&e[1]++,this.maskBlue>>i&1&&e[2]++;e[1]+=e[0],e[2]+=e[1],e[0]=8-e[0],e[1]-=8,e[2]-=8;for(var r=this.height-1;r>=0;r--){for(var t=this.bottom_up?r:this.height-1-r,n=0;n<this.width;n++){var s=this.buffer.readUInt16LE(this.pos);this.pos+=2;var o=(s&this.maskBlue)<<e[0],d=(s&this.maskGreen)>>e[1],l=(s&this.maskRed)>>e[2],m=t*this.width*4+n*4;this.data[m]=0,this.data[m+1]=o,this.data[m+2]=d,this.data[m+3]=l}this.pos+=a}};Cl.prototype.bit24=function(){for(var a=this.height-1;a>=0;a--){for(var e=this.bottom_up?a:this.height-1-a,i=0;i<this.width;i++){var r=this.buffer.readUInt8(this.pos++),t=this.buffer.readUInt8(this.pos++),n=this.buffer.readUInt8(this.pos++),s=e*this.width*4+i*4;this.data[s]=0,this.data[s+1]=r,this.data[s+2]=t,this.data[s+3]=n}this.pos+=this.width%4}};Cl.prototype.bit32=function(){if(this.compress==3){this.maskRed=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.maskGreen=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.maskBlue=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.mask0=this.buffer.readUInt32LE(this.pos),this.pos+=4;for(var a=this.height-1;a>=0;a--)for(var e=this.bottom_up?a:this.height-1-a,i=0;i<this.width;i++){var r=this.buffer.readUInt8(this.pos++),t=this.buffer.readUInt8(this.pos++),n=this.buffer.readUInt8(this.pos++),s=this.buffer.readUInt8(this.pos++),o=e*this.width*4+i*4;this.data[o]=r,this.data[o+1]=t,this.data[o+2]=n,this.data[o+3]=s}}else for(var a=this.height-1;a>=0;a--)for(var e=this.bottom_up?a:this.height-1-a,i=0;i<this.width;i++){var t=this.buffer.readUInt8(this.pos++),n=this.buffer.readUInt8(this.pos++),s=this.buffer.readUInt8(this.pos++),r=this.buffer.readUInt8(this.pos++),o=e*this.width*4+i*4;this.data[o]=r,this.data[o+1]=t,this.data[o+2]=n,this.data[o+3]=s}};Cl.prototype.getData=function(){return this.data};vLe.exports=function(a){var e=new Cl(a);return e}});var yLe=Ie((tCr,gLe)=>{var kWa=hLe(),qWa=wLe();gLe.exports={encode:kWa,decode:qWa}});var Yae=Ie((j$r,OVe)=>{OVe.exports=Wi("stream")});var wC=Ie((Zae,UVe)=>{var kz=Wi("buffer"),hu=kz.Buffer;function BVe(a,e){for(var i in a)e[i]=a[i]}hu.from&&hu.alloc&&hu.allocUnsafe&&hu.allocUnsafeSlow?UVe.exports=kz:(BVe(kz,Zae),Zae.Buffer=yk);function yk(a,e,i){return hu(a,e,i)}BVe(hu,yk);yk.from=function(a,e,i){if(typeof a=="number")throw new TypeError("Argument must not be a number");return hu(a,e,i)};yk.alloc=function(a,e,i){if(typeof a!="number")throw new TypeError("Argument must be a number");var r=hu(a);return e!==void 0?typeof i=="string"?r.fill(e,i):r.fill(e):r.fill(0),r};yk.allocUnsafe=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return hu(a)};yk.allocUnsafeSlow=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return kz.SlowBuffer(a)}});var zVe=Ie((b$r,eie)=>{"use strict";function nZa(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}var FVe=wC().Buffer,gC=Wi("util");function sZa(a,e,i){a.copy(e,i)}eie.exports=(function(){function a(){nZa(this,a),this.head=null,this.tail=null,this.length=0}return a.prototype.push=function(i){var r={data:i,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length},a.prototype.unshift=function(i){var r={data:i,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length},a.prototype.shift=function(){if(this.length!==0){var i=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,i}},a.prototype.clear=function(){this.head=this.tail=null,this.length=0},a.prototype.join=function(i){if(this.length===0)return"";for(var r=this.head,t=""+r.data;r=r.next;)t+=i+r.data;return t},a.prototype.concat=function(i){if(this.length===0)return FVe.alloc(0);for(var r=FVe.allocUnsafe(i>>>0),t=this.head,n=0;t;)sZa(t.data,r,n),n+=t.data.length,t=t.next;return r},a})();gC&&gC.inspect&&gC.inspect.custom&&(eie.exports.prototype[gC.inspect.custom]=function(){var a=gC.inspect({length:this.length});return this.constructor.name+" "+a})});var aie=Ie((I$r,KVe)=>{"use strict";var qz=wM();function oZa(a,e){var i=this,r=this._readableState&&this._readableState.destroyed,t=this._writableState&&this._writableState.destroyed;return r||t?(e?e(a):a&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,qz.nextTick(jz,this,a)):qz.nextTick(jz,this,a)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(a||null,function(n){!e&&n?i._writableState?i._writableState.errorEmitted||(i._writableState.errorEmitted=!0,qz.nextTick(jz,i,n)):qz.nextTick(jz,i,n):e&&e(n)}),this)}function dZa(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function jz(a,e){a.emit("error",e)}KVe.exports={destroy:oZa,undestroy:dZa}});var rie=Ie((S$r,JVe)=>{"use strict";var $h=wM();JVe.exports=gt;function WVe(a){var e=this;this.next=null,this.entry=null,this.finish=function(){IZa(e,a)}}var lZa=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:$h.nextTick,kk;gt.WritableState=kC;var GVe=Object.create(_b());GVe.inherits=hb();var mZa={deprecate:xha()},$Ve=Yae(),Iz=wC().Buffer,cZa=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function uZa(a){return Iz.from(a)}function fZa(a){return Iz.isBuffer(a)||a instanceof cZa}var HVe=aie();GVe.inherits(gt,$Ve);function NZa(){}function kC(a,e){kk=kk||Hh(),a=a||{};var i=e instanceof kk;this.objectMode=!!a.objectMode,i&&(this.objectMode=this.objectMode||!!a.writableObjectMode);var r=a.highWaterMark,t=a.writableHighWaterMark,n=this.objectMode?16:16*1024;r||r===0?this.highWaterMark=r:i&&(t||t===0)?this.highWaterMark=t:this.highWaterMark=n,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=a.decodeStrings===!1;this.decodeStrings=!s,this.defaultEncoding=a.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(o){yZa(e,o)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new WVe(this)}kC.prototype.getBuffer=function(){for(var e=this.bufferedRequest,i=[];e;)i.push(e),e=e.next;return i};(function(){try{Object.defineProperty(kC.prototype,"buffer",{get:mZa.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var bz;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(bz=Function.prototype[Symbol.hasInstance],Object.defineProperty(gt,Symbol.hasInstance,{value:function(a){return bz.call(this,a)?!0:this!==gt?!1:a&&a._writableState instanceof kC}})):bz=function(a){return a instanceof this};function gt(a){if(kk=kk||Hh(),!bz.call(gt,this)&&!(this instanceof kk))return new gt(a);this._writableState=new kC(a,this),this.writable=!0,a&&(typeof a.write=="function"&&(this._write=a.write),typeof a.writev=="function"&&(this._writev=a.writev),typeof a.destroy=="function"&&(this._destroy=a.destroy),typeof a.final=="function"&&(this._final=a.final)),$Ve.call(this)}gt.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function pZa(a,e){var i=new Error("write after end");a.emit("error",i),$h.nextTick(e,i)}function _Za(a,e,i,r){var t=!0,n=!1;return i===null?n=new TypeError("May not write null values to stream"):typeof i!="string"&&i!==void 0&&!e.objectMode&&(n=new TypeError("Invalid non-string/buffer chunk")),n&&(a.emit("error",n),$h.nextTick(r,n),t=!1),t}gt.prototype.write=function(a,e,i){var r=this._writableState,t=!1,n=!r.objectMode&&fZa(a);return n&&!Iz.isBuffer(a)&&(a=uZa(a)),typeof e=="function"&&(i=e,e=null),n?e="buffer":e||(e=r.defaultEncoding),typeof i!="function"&&(i=NZa),r.ended?pZa(this,i):(n||_Za(this,r,a,i))&&(r.pendingcb++,t=vZa(this,r,n,a,e,i)),t};gt.prototype.cork=function(){var a=this._writableState;a.corked++};gt.prototype.uncork=function(){var a=this._writableState;a.corked&&(a.corked--,!a.writing&&!a.corked&&!a.bufferProcessing&&a.bufferedRequest&&XVe(this,a))};gt.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this};function hZa(a,e,i){return!a.objectMode&&a.decodeStrings!==!1&&typeof e=="string"&&(e=Iz.from(e,i)),e}Object.defineProperty(gt.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function vZa(a,e,i,r,t,n){if(!i){var s=hZa(e,r,t);r!==s&&(i=!0,t="buffer",r=s)}var o=e.objectMode?1:r.length;e.length+=o;var d=e.length<e.highWaterMark;if(d||(e.needDrain=!0),e.writing||e.corked){var l=e.lastBufferedRequest;e.lastBufferedRequest={chunk:r,encoding:t,isBuf:i,callback:n,next:null},l?l.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else iie(a,e,!1,o,r,t,n);return d}function iie(a,e,i,r,t,n,s){e.writelen=r,e.writecb=s,e.writing=!0,e.sync=!0,i?a._writev(t,e.onwrite):a._write(t,n,e.onwrite),e.sync=!1}function wZa(a,e,i,r,t){--e.pendingcb,i?($h.nextTick(t,r),$h.nextTick(yC,a,e),a._writableState.errorEmitted=!0,a.emit("error",r)):(t(r),a._writableState.errorEmitted=!0,a.emit("error",r),yC(a,e))}function gZa(a){a.writing=!1,a.writecb=null,a.length-=a.writelen,a.writelen=0}function yZa(a,e){var i=a._writableState,r=i.sync,t=i.writecb;if(gZa(i),e)wZa(a,i,r,e,t);else{var n=QVe(i);!n&&!i.corked&&!i.bufferProcessing&&i.bufferedRequest&&XVe(a,i),r?lZa(VVe,a,i,n,t):VVe(a,i,n,t)}}function VVe(a,e,i,r){i||kZa(a,e),e.pendingcb--,r(),yC(a,e)}function kZa(a,e){e.length===0&&e.needDrain&&(e.needDrain=!1,a.emit("drain"))}function XVe(a,e){e.bufferProcessing=!0;var i=e.bufferedRequest;if(a._writev&&i&&i.next){var r=e.bufferedRequestCount,t=new Array(r),n=e.corkedRequestsFree;n.entry=i;for(var s=0,o=!0;i;)t[s]=i,i.isBuf||(o=!1),i=i.next,s+=1;t.allBuffers=o,iie(a,e,!0,e.length,t,"",n.finish),e.pendingcb++,e.lastBufferedRequest=null,n.next?(e.corkedRequestsFree=n.next,n.next=null):e.corkedRequestsFree=new WVe(e),e.bufferedRequestCount=0}else{for(;i;){var d=i.chunk,l=i.encoding,m=i.callback,c=e.objectMode?1:d.length;if(iie(a,e,!1,c,d,l,m),i=i.next,e.bufferedRequestCount--,e.writing)break}i===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=i,e.bufferProcessing=!1}gt.prototype._write=function(a,e,i){i(new Error("_write() is not implemented"))};gt.prototype._writev=null;gt.prototype.end=function(a,e,i){var r=this._writableState;typeof a=="function"?(i=a,a=null,e=null):typeof e=="function"&&(i=e,e=null),a!=null&&this.write(a,e),r.corked&&(r.corked=1,this.uncork()),r.ending||bZa(this,r,i)};function QVe(a){return a.ending&&a.length===0&&a.bufferedRequest===null&&!a.finished&&!a.writing}function qZa(a,e){a._final(function(i){e.pendingcb--,i&&a.emit("error",i),e.prefinished=!0,a.emit("prefinish"),yC(a,e)})}function jZa(a,e){!e.prefinished&&!e.finalCalled&&(typeof a._final=="function"?(e.pendingcb++,e.finalCalled=!0,$h.nextTick(qZa,a,e)):(e.prefinished=!0,a.emit("prefinish")))}function yC(a,e){var i=QVe(e);return i&&(jZa(a,e),e.pendingcb===0&&(e.finished=!0,a.emit("finish"))),i}function bZa(a,e,i){e.ending=!0,yC(a,e),i&&(e.finished?$h.nextTick(i):a.once("finish",i)),e.ended=!0,a.writable=!1}function IZa(a,e,i){var r=a.entry;for(a.entry=null;r;){var t=r.callback;e.pendingcb--,t(i),r=r.next}e.corkedRequestsFree.next=a}Object.defineProperty(gt.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(a){this._writableState&&(this._writableState.destroyed=a)}});gt.prototype.destroy=HVe.destroy;gt.prototype._undestroy=HVe.undestroy;gt.prototype._destroy=function(a,e){this.end(),e(a)}});var Hh=Ie((T$r,aWe)=>{"use strict";var YVe=wM(),SZa=Object.keys||function(a){var e=[];for(var i in a)e.push(i);return e};aWe.exports=vu;var ZVe=Object.create(_b());ZVe.inherits=hb();var eWe=sie(),nie=rie();ZVe.inherits(vu,eWe);for(tie=SZa(nie.prototype),Sz=0;Sz<tie.length;Sz++)Tz=tie[Sz],vu.prototype[Tz]||(vu.prototype[Tz]=nie.prototype[Tz]);var tie,Tz,Sz;function vu(a){if(!(this instanceof vu))return new vu(a);eWe.call(this,a),nie.call(this,a),a&&a.readable===!1&&(this.readable=!1),a&&a.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,a&&a.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",TZa)}Object.defineProperty(vu.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function TZa(){this.allowHalfOpen||this._writableState.ended||YVe.nextTick(EZa,this)}function EZa(a){a.end()}Object.defineProperty(vu.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(a){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=a,this._writableState.destroyed=a)}});vu.prototype._destroy=function(a,e){this.push(null),this.end(),YVe.nextTick(e,a)}});var lie=Ie(rWe=>{"use strict";var die=wC().Buffer,iWe=die.isEncoding||function(a){switch(a=""+a,a&&a.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 CZa(a){if(!a)return"utf8";for(var e;;)switch(a){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 a;default:if(e)return;a=(""+a).toLowerCase(),e=!0}}function AZa(a){var e=CZa(a);if(typeof e!="string"&&(die.isEncoding===iWe||!iWe(a)))throw new Error("Unknown encoding: "+a);return e||a}rWe.StringDecoder=qC;function qC(a){this.encoding=AZa(a);var e;switch(this.encoding){case"utf16le":this.text=LZa,this.end=OZa,e=4;break;case"utf8":this.fillLast=xZa,e=4;break;case"base64":this.text=BZa,this.end=UZa,e=3;break;default:this.write=FZa,this.end=zZa;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=die.allocUnsafe(e)}qC.prototype.write=function(a){if(a.length===0)return"";var e,i;if(this.lastNeed){if(e=this.fillLast(a),e===void 0)return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<a.length?e?e+this.text(a,i):this.text(a,i):e||""};qC.prototype.end=PZa;qC.prototype.text=MZa;qC.prototype.fillLast=function(a){if(this.lastNeed<=a.length)return a.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);a.copy(this.lastChar,this.lastTotal-this.lastNeed,0,a.length),this.lastNeed-=a.length};function oie(a){return a<=127?0:a>>5===6?2:a>>4===14?3:a>>3===30?4:a>>6===2?-1:-2}function RZa(a,e,i){var r=e.length-1;if(r<i)return 0;var t=oie(e[r]);return t>=0?(t>0&&(a.lastNeed=t-1),t):--r<i||t===-2?0:(t=oie(e[r]),t>=0?(t>0&&(a.lastNeed=t-2),t):--r<i||t===-2?0:(t=oie(e[r]),t>=0?(t>0&&(t===2?t=0:a.lastNeed=t-3),t):0))}function DZa(a,e,i){if((e[0]&192)!==128)return a.lastNeed=0,"\uFFFD";if(a.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return a.lastNeed=1,"\uFFFD";if(a.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return a.lastNeed=2,"\uFFFD"}}function xZa(a){var e=this.lastTotal-this.lastNeed,i=DZa(this,a,e);if(i!==void 0)return i;if(this.lastNeed<=a.length)return a.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);a.copy(this.lastChar,e,0,a.length),this.lastNeed-=a.length}function MZa(a,e){var i=RZa(this,a,e);if(!this.lastNeed)return a.toString("utf8",e);this.lastTotal=i;var r=a.length-(i-this.lastNeed);return a.copy(this.lastChar,0,r),a.toString("utf8",e,r)}function PZa(a){var e=a&&a.length?this.write(a):"";return this.lastNeed?e+"\uFFFD":e}function LZa(a,e){if((a.length-e)%2===0){var i=a.toString("utf16le",e);if(i){var r=i.charCodeAt(i.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=a[a.length-2],this.lastChar[1]=a[a.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=a[a.length-1],a.toString("utf16le",e,a.length-1)}function OZa(a){var e=a&&a.length?this.write(a):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,i)}return e}function BZa(a,e){var i=(a.length-e)%3;return i===0?a.toString("base64",e):(this.lastNeed=3-i,this.lastTotal=3,i===1?this.lastChar[0]=a[a.length-1]:(this.lastChar[0]=a[a.length-2],this.lastChar[1]=a[a.length-1]),a.toString("base64",e,a.length-i))}function UZa(a){var e=a&&a.length?this.write(a):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function FZa(a){return a.toString(this.encoding)}function zZa(a){return a&&a.length?this.write(a):""}});var sie=Ie((A$r,pWe)=>{"use strict";var jk=wM();pWe.exports=gr;var KZa=Dha(),jC;gr.ReadableState=mWe;var C$r=Wi("events").EventEmitter,oWe=function(a,e){return a.listeners(e).length},Nie=Yae(),bC=wC().Buffer,VZa=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function WZa(a){return bC.from(a)}function GZa(a){return bC.isBuffer(a)||a instanceof VZa}var dWe=Object.create(_b());dWe.inherits=hb();var mie=Wi("util"),Ei=void 0;mie&&mie.debuglog?Ei=mie.debuglog("stream"):Ei=function(){};var $Za=zVe(),lWe=aie(),qk;dWe.inherits(gr,Nie);var cie=["error","close","destroy","pause","resume"];function HZa(a,e,i){if(typeof a.prependListener=="function")return a.prependListener(e,i);!a._events||!a._events[e]?a.on(e,i):KZa(a._events[e])?a._events[e].unshift(i):a._events[e]=[i,a._events[e]]}function mWe(a,e){jC=jC||Hh(),a=a||{};var i=e instanceof jC;this.objectMode=!!a.objectMode,i&&(this.objectMode=this.objectMode||!!a.readableObjectMode);var r=a.highWaterMark,t=a.readableHighWaterMark,n=this.objectMode?16:16*1024;r||r===0?this.highWaterMark=r:i&&(t||t===0)?this.highWaterMark=t:this.highWaterMark=n,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new $Za,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=a.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,a.encoding&&(qk||(qk=lie().StringDecoder),this.decoder=new qk(a.encoding),this.encoding=a.encoding)}function gr(a){if(jC=jC||Hh(),!(this instanceof gr))return new gr(a);this._readableState=new mWe(a,this),this.readable=!0,a&&(typeof a.read=="function"&&(this._read=a.read),typeof a.destroy=="function"&&(this._destroy=a.destroy)),Nie.call(this)}Object.defineProperty(gr.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(a){this._readableState&&(this._readableState.destroyed=a)}});gr.prototype.destroy=lWe.destroy;gr.prototype._undestroy=lWe.undestroy;gr.prototype._destroy=function(a,e){this.push(null),e(a)};gr.prototype.push=function(a,e){var i=this._readableState,r;return i.objectMode?r=!0:typeof a=="string"&&(e=e||i.defaultEncoding,e!==i.encoding&&(a=bC.from(a,e),e=""),r=!0),cWe(this,a,e,!1,r)};gr.prototype.unshift=function(a){return cWe(this,a,null,!0,!1)};function cWe(a,e,i,r,t){var n=a._readableState;if(e===null)n.reading=!1,YZa(a,n);else{var s;t||(s=XZa(n,e)),s?a.emit("error",s):n.objectMode||e&&e.length>0?(typeof e!="string"&&!n.objectMode&&Object.getPrototypeOf(e)!==bC.prototype&&(e=WZa(e)),r?n.endEmitted?a.emit("error",new Error("stream.unshift() after end event")):uie(a,n,e,!0):n.ended?a.emit("error",new Error("stream.push() after EOF")):(n.reading=!1,n.decoder&&!i?(e=n.decoder.write(e),n.objectMode||e.length!==0?uie(a,n,e,!1):uWe(a,n)):uie(a,n,e,!1))):r||(n.reading=!1)}return QZa(n)}function uie(a,e,i,r){e.flowing&&e.length===0&&!e.sync?(a.emit("data",i),a.read(0)):(e.length+=e.objectMode?1:i.length,r?e.buffer.unshift(i):e.buffer.push(i),e.needReadable&&Ez(a)),uWe(a,e)}function XZa(a,e){var i;return!GZa(e)&&typeof e!="string"&&e!==void 0&&!a.objectMode&&(i=new TypeError("Invalid non-string/buffer chunk")),i}function QZa(a){return!a.ended&&(a.needReadable||a.length<a.highWaterMark||a.length===0)}gr.prototype.isPaused=function(){return this._readableState.flowing===!1};gr.prototype.setEncoding=function(a){return qk||(qk=lie().StringDecoder),this._readableState.decoder=new qk(a),this._readableState.encoding=a,this};var tWe=8388608;function JZa(a){return a>=tWe?a=tWe:(a--,a|=a>>>1,a|=a>>>2,a|=a>>>4,a|=a>>>8,a|=a>>>16,a++),a}function nWe(a,e){return a<=0||e.length===0&&e.ended?0:e.objectMode?1:a!==a?e.flowing&&e.length?e.buffer.head.data.length:e.length:(a>e.highWaterMark&&(e.highWaterMark=JZa(a)),a<=e.length?a:e.ended?e.length:(e.needReadable=!0,0))}gr.prototype.read=function(a){Ei("read",a),a=parseInt(a,10);var e=this._readableState,i=a;if(a!==0&&(e.emittedReadable=!1),a===0&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return Ei("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?fie(this):Ez(this),null;if(a=nWe(a,e),a===0&&e.ended)return e.length===0&&fie(this),null;var r=e.needReadable;Ei("need readable",r),(e.length===0||e.length-a<e.highWaterMark)&&(r=!0,Ei("length less than watermark",r)),e.ended||e.reading?(r=!1,Ei("reading or ended",r)):r&&(Ei("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(a=nWe(i,e)));var t;return a>0?t=fWe(a,e):t=null,t===null?(e.needReadable=!0,a=0):e.length-=a,e.length===0&&(e.ended||(e.needReadable=!0),i!==a&&e.ended&&fie(this)),t!==null&&this.emit("data",t),t};function YZa(a,e){if(!e.ended){if(e.decoder){var i=e.decoder.end();i&&i.length&&(e.buffer.push(i),e.length+=e.objectMode?1:i.length)}e.ended=!0,Ez(a)}}function Ez(a){var e=a._readableState;e.needReadable=!1,e.emittedReadable||(Ei("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?jk.nextTick(sWe,a):sWe(a))}function sWe(a){Ei("emit readable"),a.emit("readable"),pie(a)}function uWe(a,e){e.readingMore||(e.readingMore=!0,jk.nextTick(ZZa,a,e))}function ZZa(a,e){for(var i=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(Ei("maybeReadMore read 0"),a.read(0),i!==e.length);)i=e.length;e.readingMore=!1}gr.prototype._read=function(a){this.emit("error",new Error("_read() is not implemented"))};gr.prototype.pipe=function(a,e){var i=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=a;break;case 1:r.pipes=[r.pipes,a];break;default:r.pipes.push(a);break}r.pipesCount+=1,Ei("pipe count=%d opts=%j",r.pipesCount,e);var t=(!e||e.end!==!1)&&a!==process.stdout&&a!==process.stderr,n=t?o:v;r.endEmitted?jk.nextTick(n):i.once("end",n),a.on("unpipe",s);function s(h,w){Ei("onunpipe"),h===i&&w&&w.hasUnpiped===!1&&(w.hasUnpiped=!0,m())}function o(){Ei("onend"),a.end()}var d=eei(i);a.on("drain",d);var l=!1;function m(){Ei("cleanup"),a.removeListener("close",N),a.removeListener("finish",_),a.removeListener("drain",d),a.removeListener("error",f),a.removeListener("unpipe",s),i.removeListener("end",o),i.removeListener("end",v),i.removeListener("data",u),l=!0,r.awaitDrain&&(!a._writableState||a._writableState.needDrain)&&d()}var c=!1;i.on("data",u);function u(h){Ei("ondata"),c=!1;var w=a.write(h);w===!1&&!c&&((r.pipesCount===1&&r.pipes===a||r.pipesCount>1&&NWe(r.pipes,a)!==-1)&&!l&&(Ei("false write response, pause",r.awaitDrain),r.awaitDrain++,c=!0),i.pause())}function f(h){Ei("onerror",h),v(),a.removeListener("error",f),oWe(a,"error")===0&&a.emit("error",h)}HZa(a,"error",f);function N(){a.removeListener("finish",_),v()}a.once("close",N);function _(){Ei("onfinish"),a.removeListener("close",N),v()}a.once("finish",_);function v(){Ei("unpipe"),i.unpipe(a)}return a.emit("pipe",i),r.flowing||(Ei("pipe resume"),i.resume()),a};function eei(a){return function(){var e=a._readableState;Ei("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,e.awaitDrain===0&&oWe(a,"data")&&(e.flowing=!0,pie(a))}}gr.prototype.unpipe=function(a){var e=this._readableState,i={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return a&&a!==e.pipes?this:(a||(a=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,a&&a.emit("unpipe",this,i),this);if(!a){var r=e.pipes,t=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var n=0;n<t;n++)r[n].emit("unpipe",this,{hasUnpiped:!1});return this}var s=NWe(e.pipes,a);return s===-1?this:(e.pipes.splice(s,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),a.emit("unpipe",this,i),this)};gr.prototype.on=function(a,e){var i=Nie.prototype.on.call(this,a,e);if(a==="data")this._readableState.flowing!==!1&&this.resume();else if(a==="readable"){var r=this._readableState;!r.endEmitted&&!r.readableListening&&(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&Ez(this):jk.nextTick(aei,this))}return i};gr.prototype.addListener=gr.prototype.on;function aei(a){Ei("readable nexttick read 0"),a.read(0)}gr.prototype.resume=function(){var a=this._readableState;return a.flowing||(Ei("resume"),a.flowing=!0,iei(this,a)),this};function iei(a,e){e.resumeScheduled||(e.resumeScheduled=!0,jk.nextTick(rei,a,e))}function rei(a,e){e.reading||(Ei("resume read 0"),a.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,a.emit("resume"),pie(a),e.flowing&&!e.reading&&a.read(0)}gr.prototype.pause=function(){return Ei("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(Ei("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function pie(a){var e=a._readableState;for(Ei("flow",e.flowing);e.flowing&&a.read()!==null;);}gr.prototype.wrap=function(a){var e=this,i=this._readableState,r=!1;a.on("end",function(){if(Ei("wrapped end"),i.decoder&&!i.ended){var s=i.decoder.end();s&&s.length&&e.push(s)}e.push(null)}),a.on("data",function(s){if(Ei("wrapped data"),i.decoder&&(s=i.decoder.write(s)),!(i.objectMode&&s==null)&&!(!i.objectMode&&(!s||!s.length))){var o=e.push(s);o||(r=!0,a.pause())}});for(var t in a)this[t]===void 0&&typeof a[t]=="function"&&(this[t]=(function(s){return function(){return a[s].apply(a,arguments)}})(t));for(var n=0;n<cie.length;n++)a.on(cie[n],this.emit.bind(this,cie[n]));return this._read=function(s){Ei("wrapped _read",s),r&&(r=!1,a.resume())},this};Object.defineProperty(gr.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});gr._fromList=fWe;function fWe(a,e){if(e.length===0)return null;var i;return e.objectMode?i=e.buffer.shift():!a||a>=e.length?(e.decoder?i=e.buffer.join(""):e.buffer.length===1?i=e.buffer.head.data:i=e.buffer.concat(e.length),e.buffer.clear()):i=tei(a,e.buffer,e.decoder),i}function tei(a,e,i){var r;return a<e.head.data.length?(r=e.head.data.slice(0,a),e.head.data=e.head.data.slice(a)):a===e.head.data.length?r=e.shift():r=i?nei(a,e):sei(a,e),r}function nei(a,e){var i=e.head,r=1,t=i.data;for(a-=t.length;i=i.next;){var n=i.data,s=a>n.length?n.length:a;if(s===n.length?t+=n:t+=n.slice(0,a),a-=s,a===0){s===n.length?(++r,i.next?e.head=i.next:e.head=e.tail=null):(e.head=i,i.data=n.slice(s));break}++r}return e.length-=r,t}function sei(a,e){var i=bC.allocUnsafe(a),r=e.head,t=1;for(r.data.copy(i),a-=r.data.length;r=r.next;){var n=r.data,s=a>n.length?n.length:a;if(n.copy(i,i.length-a,0,s),a-=s,a===0){s===n.length?(++t,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=n.slice(s));break}++t}return e.length-=t,i}function fie(a){var e=a._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,jk.nextTick(oei,e,a))}function oei(a,e){!a.endEmitted&&a.length===0&&(a.endEmitted=!0,e.readable=!1,e.emit("end"))}function NWe(a,e){for(var i=0,r=a.length;i<r;i++)if(a[i]===e)return i;return-1}});var _ie=Ie((R$r,vWe)=>{"use strict";vWe.exports=wu;var Cz=Hh(),hWe=Object.create(_b());hWe.inherits=hb();hWe.inherits(wu,Cz);function dei(a,e){var i=this._transformState;i.transforming=!1;var r=i.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));i.writechunk=null,i.writecb=null,e!=null&&this.push(e),r(a);var t=this._readableState;t.reading=!1,(t.needReadable||t.length<t.highWaterMark)&&this._read(t.highWaterMark)}function wu(a){if(!(this instanceof wu))return new wu(a);Cz.call(this,a),this._transformState={afterTransform:dei.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,a&&(typeof a.transform=="function"&&(this._transform=a.transform),typeof a.flush=="function"&&(this._flush=a.flush)),this.on("prefinish",lei)}function lei(){var a=this;typeof this._flush=="function"?this._flush(function(e,i){_We(a,e,i)}):_We(this,null,null)}wu.prototype.push=function(a,e){return this._transformState.needTransform=!1,Cz.prototype.push.call(this,a,e)};wu.prototype._transform=function(a,e,i){throw new Error("_transform() is not implemented")};wu.prototype._write=function(a,e,i){var r=this._transformState;if(r.writecb=i,r.writechunk=a,r.writeencoding=e,!r.transforming){var t=this._readableState;(r.needTransform||t.needReadable||t.length<t.highWaterMark)&&this._read(t.highWaterMark)}};wu.prototype._read=function(a){var e=this._transformState;e.writechunk!==null&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};wu.prototype._destroy=function(a,e){var i=this;Cz.prototype._destroy.call(this,a,function(r){e(r),i.emit("close")})};function _We(a,e,i){if(e)return a.emit("error",e);if(i!=null&&a.push(i),a._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(a._transformState.transforming)throw new Error("Calling transform done when still transforming");return a.push(null)}});var kWe=Ie((D$r,yWe)=>{"use strict";yWe.exports=IC;var wWe=_ie(),gWe=Object.create(_b());gWe.inherits=hb();gWe.inherits(IC,wWe);function IC(a){if(!(this instanceof IC))return new IC(a);wWe.call(this,a)}IC.prototype._transform=function(a,e,i){i(null,a)}});var qWe=Ie((En,Az)=>{var Hm=Wi("stream");process.env.READABLE_STREAM==="disable"&&Hm?(Az.exports=Hm,En=Az.exports=Hm.Readable,En.Readable=Hm.Readable,En.Writable=Hm.Writable,En.Duplex=Hm.Duplex,En.Transform=Hm.Transform,En.PassThrough=Hm.PassThrough,En.Stream=Hm):(En=Az.exports=sie(),En.Stream=Hm||En,En.Readable=En,En.Writable=rie(),En.Duplex=Hh(),En.Transform=_ie(),En.PassThrough=kWe())});var bWe=Ie((x$r,jWe)=>{jWe.exports=qWe().PassThrough});var EWe=Ie((M$r,TWe)=>{var IWe=Wi("util"),xz=bWe();TWe.exports={Readable:Rz,Writable:Dz};IWe.inherits(Rz,xz);IWe.inherits(Dz,xz);function SWe(a,e,i){a[e]=function(){return delete a[e],i.apply(this,arguments),this[e].apply(this,arguments)}}function Rz(a,e){if(!(this instanceof Rz))return new Rz(a,e);xz.call(this,e),SWe(this,"_read",function(){var i=a.call(this,e),r=this.emit.bind(this,"error");i.on("error",r),i.pipe(this)}),this.emit("readable")}function Dz(a,e){if(!(this instanceof Dz))return new Dz(a,e);xz.call(this,e),SWe(this,"_write",function(){var i=a.call(this,e),r=this.emit.bind(this,"error");i.on("error",r),this.pipe(i)}),this.emit("writable")}});var La=Ie((ist,YXe)=>{YXe.exports={options:{usePureJavaScript:!1}}});var a8e=Ie((rst,e8e)=>{var Rne={};e8e.exports=Rne;var ZXe={};Rne.encode=function(a,e,i){if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(i!==void 0&&typeof i!="number")throw new TypeError('"maxline" must be a number.');var r="";if(!(a instanceof Uint8Array))r=bwi(a,e);else{var t=0,n=e.length,s=e.charAt(0),o=[0];for(t=0;t<a.length;++t){for(var d=0,l=a[t];d<o.length;++d)l+=o[d]<<8,o[d]=l%n,l=l/n|0;for(;l>0;)o.push(l%n),l=l/n|0}for(t=0;a[t]===0&&t<a.length-1;++t)r+=s;for(t=o.length-1;t>=0;--t)r+=e[o[t]]}if(i){var m=new RegExp(".{1,"+i+"}","g");r=r.match(m).join(`\r
2
+ import{a as O5,b as vb,c as B5}from"./chunk-R6GVNV7J.js";import{a as rve,b as kM,c as Us,d as Cw,e as Aw,f as qM,g as pm,h as tve,i as a_}from"./chunk-4ESEMCSG.js";import{$ as po,$a as sb,$b as tM,$c as B,$d as jhe,A as p5,Aa as spe,Ab as Vpe,Ac as A_e,Ad as R5,Ae as zhe,B as KNe,Ba as ope,Bb as Wpe,Bc as R_e,Bd as nhe,Be as Khe,C as VNe,Ca as dpe,Cb as Gpe,Cc as D_e,Cd as she,Ce as Ew,D as WNe,Da as lpe,Db as $pe,Dc as x_e,Dd as ohe,De as gM,E as GNe,Ea as mpe,Eb as Hpe,Ec as M_e,Ee as P5,F as na,Fa as cpe,Fb as Yp,Fc as P_e,Fd as dhe,Fe as Vhe,G as Ke,Ga as upe,Gb as Xpe,Gc as Bs,Gd as lhe,Ge as Whe,H as $Ne,Ha as kw,Hb as Qpe,Hc as L_e,Hd as mhe,He as Ghe,I as or,Ia as fpe,Ib as Jpe,Ic as cb,Id as che,Ie as yM,J as gw,Ja as Npe,Jb as Ype,Jc as tl,Jd as uhe,Je as $he,K as _5,Ka as ppe,Kb as Zpe,Kc as ub,Kd as fhe,Ke as e_,L as yw,La as _pe,Lb as k5,Lc as fb,Ld as Nhe,Le as Hhe,M as HNe,Ma as hpe,Mb as e_e,Mc as O_e,Md as phe,Me as Xhe,N as Ms,Na as g5,Nb as lb,Nc as B_e,Nd as D5,Ne as Qhe,O as ab,Oa as vpe,Ob as a_e,Oc as S5,Od as _he,Oe as Jhe,P as Qp,Pa as wpe,Pb as i_e,Pc as U_e,Pd as hhe,Pe as Yhe,Q as al,Qa as gpe,Qb as r_e,Qc as Iw,Qd as pb,Qe as Zhe,R as hr,Ra as ype,Rb as q5,Rc as T5,Rd as x5,Re as eve,S as Ri,Sa as kpe,Sb as t_e,Sc as F_e,Sd as _M,Se as ave,T as la,Ta as eM,Tb as n_e,Tc as E5,Td as vhe,Te as L5,U as Ln,Ua as qpe,Ub as s_e,Uc as sM,Ud as hM,V as ib,Va as aM,Vb as o_e,Vc as z_e,Vd as vM,W as rb,Wa as jpe,Wb as d_e,Wc as K_e,Wd as whe,X as tb,Xa as iM,Xb as l_e,Xc as oM,Xd as ghe,Y as h5,Ya as bpe,Yb as m_e,Yc as V_e,Yd as yhe,Z as XNe,Za as Ipe,Zb as c_e,Zc as W_e,Zd as khe,_ as QNe,_a as Spe,_b as u_e,_c as Sw,_d as qhe,a as Zj,aa as il,ab as qw,ac as f_e,ad as G_e,ae as M5,b as Rha,ba as JNe,bb as Tpe,bc as N_e,bd as $_e,be as bhe,c as qNe,ca as YNe,cb as _o,cc as jw,cd as H_e,ce as Ihe,d as el,da as ni,db as ob,dc as p_e,dd as dM,de as She,e as m5,ea as Dc,eb as db,ec as xc,ed as X_e,ee as The,f as jNe,fa as kn,fb as Epe,fc as bw,fd as lM,fe as Ehe,g as hw,ga as Qt,gb as Os,gc as j5,gd as C5,ge as Zp,ha as ZNe,hb as Cpe,hc as __e,hd as Q_e,he as Che,ia as epe,ib as Ape,ic as h_e,id as J_e,ie as Ahe,ja as Ps,jb as Rpe,jc as v_e,jd as Y_e,je as Rhe,k as bNe,ka as rl,kb as rM,kc as w_e,kd as Z_e,ke as Dhe,la as Or,lb as y5,lc as g_e,ld as A5,le as xhe,ma as Di,mb as ve,mc as nM,md as mM,me as Mhe,n as PNe,na as v5,nb as Dpe,nc as y_e,nd as ehe,o as LNe,oa as nb,ob as xpe,oc as k_e,od as Mc,oe as Phe,p as ONe,pa as ape,pb as Mpe,pc as q_e,pd as ahe,pe as Lhe,qa as Jp,qb as Ppe,qc as mb,qd as cM,qe as Ohe,r as Hx,ra as ipe,rb as P,rc as j_e,rd as ihe,re as Bhe,s as Xx,sa as rpe,sb as Lpe,sc as b_e,sd as rhe,se as wM,t as BNe,ta as w5,tb as Ope,tc as I_e,td as uM,te as Dha,u as UNe,ua as tpe,ub as Bpe,uc as b5,ud as the,ue as _b,v as Qx,va as Jx,vb as M,vc as S_e,vd as fM,ve as hb,w as FNe,wa as Yx,wb as Upe,wc as T_e,wd as Tw,we as xha,x as zNe,xa as Ls,xb as Fpe,xc as E_e,xd as NM,xe as Pc,y as ww,ya as Zx,yb as zpe,yc as C_e,yd as pM,ye as Uhe,z as eb,za as npe,zb as Kpe,zc as I5,zd as Nb,ze as Fhe}from"./chunk-WOISMRTU.js";import{d as Vx}from"./chunk-A2CQYOXE.js";import{d as gNe,e as yNe,f as Wx,g as Gx,h as l5,i as kNe,l as u5,q as f5}from"./chunk-XYXCVIX2.js";import{a as ive}from"./chunk-4NX3LPKA.js";import{F as DNe,Xa as $x,k as Nm,l as CNe,m as ANe,v as RNe,va as N5,xa as xNe,za as MNe}from"./chunk-OJA2IAQ6.js";import{a as c5,b as _w}from"./chunk-C3JRMX7L.js";import{b as vw}from"./chunk-X4N2MWNJ.js";import{c as ENe}from"./chunk-6TZEW2D4.js";import{a as nve}from"./chunk-4Y64C4JT.js";import{a as Aha}from"./chunk-HQ2U4QVQ.js";import{a as Y4,e as Kfe,f as Vfe,g as Wfe,j as d5,l as vNe,q as wNe}from"./chunk-AAJMOWWM.js";import{$ as ns,Ca as rNe,D as Hj,Da as Hp,E as sd,Ea as tNe,Fa as od,Ha as nNe,K as Xj,M as No,N as Xfe,Pa as Rc,Qa as _Ne,Ra as Xp,Sa as s5,T as Qfe,Ta as o5,U as Jfe,W as Yfe,Y as Na,Z as Da,_ as Zu,a as Z4,aa as Zfe,ab as hNe,b as Gfe,c as pw,ca as Cx,d as qa,da as Ax,j as e5,ka as Rx,la as Dx,ma as Gp,na as xx,oa as eNe,q as a5,r as i5,ra as ef,sa as sr,ta as aNe,wa as Mx,x as $fe,ya as $p,z as Hfe,za as iNe}from"./chunk-6BYKHQOV.js";import{a as Wp}from"./chunk-2ZG44JU6.js";import{A as Bx,C as dNe,D as r5,E as t5,F as lNe,G as Ux,H as Fx,K as mNe,L as cNe,M as uNe,N as zx,O as fNe,T as Yj,U as NNe,V as pNe,W as n5,X as Kx,b as Px,i as Pn,j as Cc,k as Lx,l as af,m as Qj,n as sNe,o as Ox,p as Jj,v as Ac,z as oNe}from"./chunk-Y27DNFV2.js";import{a as SNe,b as TNe}from"./chunk-SD6SJL3L.js";import{a as INe}from"./chunk-GUFBGYOC.js";import{a as Wi,c as Ie,e as Ii}from"./chunk-D76SO2ME.js";var iJ=Ie((x_r,uEe)=>{"use strict";var tMa=Wi("util"),cEe=Wi("stream"),wl=uEe.exports=function(){cEe.call(this),this._buffers=[],this._buffered=0,this._reads=[],this._paused=!1,this._encoding="utf8",this.writable=!0};tMa.inherits(wl,cEe);wl.prototype.read=function(a,e){this._reads.push({length:Math.abs(a),allowLess:a<0,func:e}),process.nextTick(function(){this._process(),this._paused&&this._reads&&this._reads.length>0&&(this._paused=!1,this.emit("drain"))}.bind(this))};wl.prototype.write=function(a,e){if(!this.writable)return this.emit("error",new Error("Stream not writable")),!1;let i;return Buffer.isBuffer(a)?i=a:i=Buffer.from(a,e||this._encoding),this._buffers.push(i),this._buffered+=i.length,this._process(),this._reads&&this._reads.length===0&&(this._paused=!0),this.writable&&!this._paused};wl.prototype.end=function(a,e){a&&this.write(a,e),this.writable=!1,this._buffers&&(this._buffers.length===0?this._end():(this._buffers.push(null),this._process()))};wl.prototype.destroySoon=wl.prototype.end;wl.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("Unexpected end of input")),this.destroy()};wl.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))};wl.prototype._processReadAllowingLess=function(a){this._reads.shift();let e=this._buffers[0];e.length>a.length?(this._buffered-=a.length,this._buffers[0]=e.slice(a.length),a.func.call(this,e.slice(0,a.length))):(this._buffered-=e.length,this._buffers.shift(),a.func.call(this,e))};wl.prototype._processRead=function(a){this._reads.shift();let e=0,i=0,r=Buffer.alloc(a.length);for(;e<a.length;){let t=this._buffers[i++],n=Math.min(t.length,a.length-e);t.copy(r,e,0,n),e+=n,n!==t.length&&(this._buffers[--i]=t.slice(n))}i>0&&this._buffers.splice(0,i),this._buffered-=a.length,a.func.call(this,r)};wl.prototype._process=function(){try{for(;this._buffered>0&&this._reads&&this._reads.length>0;){let a=this._reads[0];if(a.allowLess)this._processReadAllowingLess(a);else if(this._buffered>=a.length)this._processRead(a);else break}this._buffers&&!this.writable&&this._end()}catch(a){this.emit("error",a)}}});var tJ=Ie(rJ=>{"use strict";var xf=[{x:[0],y:[0]},{x:[4],y:[0]},{x:[0,4],y:[4]},{x:[2,6],y:[0,4]},{x:[0,2,4,6],y:[2,6]},{x:[1,3,5,7],y:[0,2,4,6]},{x:[0,1,2,3,4,5,6,7],y:[1,3,5,7]}];rJ.getImagePasses=function(a,e){let i=[],r=a%8,t=e%8,n=(a-r)/8,s=(e-t)/8;for(let o=0;o<xf.length;o++){let d=xf[o],l=n*d.x.length,m=s*d.y.length;for(let c=0;c<d.x.length&&d.x[c]<r;c++)l++;for(let c=0;c<d.y.length&&d.y[c]<t;c++)m++;l>0&&m>0&&i.push({width:l,height:m,index:o})}return i};rJ.getInterlaceIterator=function(a){return function(e,i,r){let t=e%xf[r].x.length,n=(e-t)/xf[r].x.length*8+xf[r].x[t],s=i%xf[r].y.length,o=(i-s)/xf[r].y.length*8+xf[r].y[s];return n*4+o*a*4}}});var nJ=Ie((P_r,fEe)=>{"use strict";fEe.exports=function(e,i,r){let t=e+i-r,n=Math.abs(t-e),s=Math.abs(t-i),o=Math.abs(t-r);return n<=s&&n<=o?e:s<=o?i:r}});var sJ=Ie((L_r,pEe)=>{"use strict";var nMa=tJ(),sMa=nJ();function NEe(a,e,i){let r=a*e;return i!==8&&(r=Math.ceil(r/(8/i))),r}var Bg=pEe.exports=function(a,e){let i=a.width,r=a.height,t=a.interlace,n=a.bpp,s=a.depth;if(this.read=e.read,this.write=e.write,this.complete=e.complete,this._imageIndex=0,this._images=[],t){let o=nMa.getImagePasses(i,r);for(let d=0;d<o.length;d++)this._images.push({byteWidth:NEe(o[d].width,n,s),height:o[d].height,lineIndex:0})}else this._images.push({byteWidth:NEe(i,n,s),height:r,lineIndex:0});s===8?this._xComparison=n:s===16?this._xComparison=n*2:this._xComparison=1};Bg.prototype.start=function(){this.read(this._images[this._imageIndex].byteWidth+1,this._reverseFilterLine.bind(this))};Bg.prototype._unFilterType1=function(a,e,i){let r=this._xComparison,t=r-1;for(let n=0;n<i;n++){let s=a[1+n],o=n>t?e[n-r]:0;e[n]=s+o}};Bg.prototype._unFilterType2=function(a,e,i){let r=this._lastLine;for(let t=0;t<i;t++){let n=a[1+t],s=r?r[t]:0;e[t]=n+s}};Bg.prototype._unFilterType3=function(a,e,i){let r=this._xComparison,t=r-1,n=this._lastLine;for(let s=0;s<i;s++){let o=a[1+s],d=n?n[s]:0,l=s>t?e[s-r]:0,m=Math.floor((l+d)/2);e[s]=o+m}};Bg.prototype._unFilterType4=function(a,e,i){let r=this._xComparison,t=r-1,n=this._lastLine;for(let s=0;s<i;s++){let o=a[1+s],d=n?n[s]:0,l=s>t?e[s-r]:0,m=s>t&&n?n[s-r]:0,c=sMa(l,d,m);e[s]=o+c}};Bg.prototype._reverseFilterLine=function(a){let e=a[0],i,r=this._images[this._imageIndex],t=r.byteWidth;if(e===0)i=a.slice(1,t+1);else switch(i=Buffer.alloc(t),e){case 1:this._unFilterType1(a,i,t);break;case 2:this._unFilterType2(a,i,t);break;case 3:this._unFilterType3(a,i,t);break;case 4:this._unFilterType4(a,i,t);break;default:throw new Error("Unrecognised filter type - "+e)}this.write(i),r.lineIndex++,r.lineIndex>=r.height?(this._lastLine=null,this._imageIndex++,r=this._images[this._imageIndex]):this._lastLine=i,r?this.read(r.byteWidth+1,this._reverseFilterLine.bind(this)):(this._lastLine=null,this.complete())}});var vEe=Ie((O_r,hEe)=>{"use strict";var oMa=Wi("util"),_Ee=iJ(),dMa=sJ(),lMa=hEe.exports=function(a){_Ee.call(this);let e=[],i=this;this._filter=new dMa(a,{read:this.read.bind(this),write:function(r){e.push(r)},complete:function(){i.emit("complete",Buffer.concat(e))}}),this._filter.start()};oMa.inherits(lMa,_Ee)});var Ug=Ie((B_r,wEe)=>{"use strict";wEe.exports={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5}});var lJ=Ie((U_r,gEe)=>{"use strict";var oJ=[];(function(){for(let a=0;a<256;a++){let e=a;for(let i=0;i<8;i++)e&1?e=3988292384^e>>>1:e=e>>>1;oJ[a]=e}})();var dJ=gEe.exports=function(){this._crc=-1};dJ.prototype.write=function(a){for(let e=0;e<a.length;e++)this._crc=oJ[(this._crc^a[e])&255]^this._crc>>>8;return!0};dJ.prototype.crc32=function(){return this._crc^-1};dJ.crc32=function(a){let e=-1;for(let i=0;i<a.length;i++)e=oJ[(e^a[i])&255]^e>>>8;return e^-1}});var mJ=Ie((F_r,yEe)=>{"use strict";var xt=Ug(),mMa=lJ(),nn=yEe.exports=function(a,e){this._options=a,a.checkCRC=a.checkCRC!==!1,this._hasIHDR=!1,this._hasIEND=!1,this._emittedHeadersFinished=!1,this._palette=[],this._colorType=0,this._chunks={},this._chunks[xt.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[xt.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[xt.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[xt.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[xt.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[xt.TYPE_gAMA]=this._handleGAMA.bind(this),this.read=e.read,this.error=e.error,this.metadata=e.metadata,this.gamma=e.gamma,this.transColor=e.transColor,this.palette=e.palette,this.parsed=e.parsed,this.inflateData=e.inflateData,this.finished=e.finished,this.simpleTransparency=e.simpleTransparency,this.headersFinished=e.headersFinished||function(){}};nn.prototype.start=function(){this.read(xt.PNG_SIGNATURE.length,this._parseSignature.bind(this))};nn.prototype._parseSignature=function(a){let e=xt.PNG_SIGNATURE;for(let i=0;i<e.length;i++)if(a[i]!==e[i]){this.error(new Error("Invalid file signature"));return}this.read(8,this._parseChunkBegin.bind(this))};nn.prototype._parseChunkBegin=function(a){let e=a.readUInt32BE(0),i=a.readUInt32BE(4),r="";for(let n=4;n<8;n++)r+=String.fromCharCode(a[n]);let t=!!(a[4]&32);if(!this._hasIHDR&&i!==xt.TYPE_IHDR){this.error(new Error("Expected IHDR on beggining"));return}if(this._crc=new mMa,this._crc.write(Buffer.from(r)),this._chunks[i])return this._chunks[i](e);if(!t){this.error(new Error("Unsupported critical chunk type "+r));return}this.read(e+4,this._skipChunk.bind(this))};nn.prototype._skipChunk=function(){this.read(8,this._parseChunkBegin.bind(this))};nn.prototype._handleChunkEnd=function(){this.read(4,this._parseChunkEnd.bind(this))};nn.prototype._parseChunkEnd=function(a){let e=a.readInt32BE(0),i=this._crc.crc32();if(this._options.checkCRC&&i!==e){this.error(new Error("Crc error - "+e+" - "+i));return}this._hasIEND||this.read(8,this._parseChunkBegin.bind(this))};nn.prototype._handleIHDR=function(a){this.read(a,this._parseIHDR.bind(this))};nn.prototype._parseIHDR=function(a){this._crc.write(a);let e=a.readUInt32BE(0),i=a.readUInt32BE(4),r=a[8],t=a[9],n=a[10],s=a[11],o=a[12];if(r!==8&&r!==4&&r!==2&&r!==1&&r!==16){this.error(new Error("Unsupported bit depth "+r));return}if(!(t in xt.COLORTYPE_TO_BPP_MAP)){this.error(new Error("Unsupported color type"));return}if(n!==0){this.error(new Error("Unsupported compression method"));return}if(s!==0){this.error(new Error("Unsupported filter method"));return}if(o!==0&&o!==1){this.error(new Error("Unsupported interlace method"));return}this._colorType=t;let d=xt.COLORTYPE_TO_BPP_MAP[this._colorType];this._hasIHDR=!0,this.metadata({width:e,height:i,depth:r,interlace:!!o,palette:!!(t&xt.COLORTYPE_PALETTE),color:!!(t&xt.COLORTYPE_COLOR),alpha:!!(t&xt.COLORTYPE_ALPHA),bpp:d,colorType:t}),this._handleChunkEnd()};nn.prototype._handlePLTE=function(a){this.read(a,this._parsePLTE.bind(this))};nn.prototype._parsePLTE=function(a){this._crc.write(a);let e=Math.floor(a.length/3);for(let i=0;i<e;i++)this._palette.push([a[i*3],a[i*3+1],a[i*3+2],255]);this.palette(this._palette),this._handleChunkEnd()};nn.prototype._handleTRNS=function(a){this.simpleTransparency(),this.read(a,this._parseTRNS.bind(this))};nn.prototype._parseTRNS=function(a){if(this._crc.write(a),this._colorType===xt.COLORTYPE_PALETTE_COLOR){if(this._palette.length===0){this.error(new Error("Transparency chunk must be after palette"));return}if(a.length>this._palette.length){this.error(new Error("More transparent colors than palette size"));return}for(let e=0;e<a.length;e++)this._palette[e][3]=a[e];this.palette(this._palette)}this._colorType===xt.COLORTYPE_GRAYSCALE&&this.transColor([a.readUInt16BE(0)]),this._colorType===xt.COLORTYPE_COLOR&&this.transColor([a.readUInt16BE(0),a.readUInt16BE(2),a.readUInt16BE(4)]),this._handleChunkEnd()};nn.prototype._handleGAMA=function(a){this.read(a,this._parseGAMA.bind(this))};nn.prototype._parseGAMA=function(a){this._crc.write(a),this.gamma(a.readUInt32BE(0)/xt.GAMMA_DIVISION),this._handleChunkEnd()};nn.prototype._handleIDAT=function(a){this._emittedHeadersFinished||(this._emittedHeadersFinished=!0,this.headersFinished()),this.read(-a,this._parseIDAT.bind(this,a))};nn.prototype._parseIDAT=function(a,e){if(this._crc.write(e),this._colorType===xt.COLORTYPE_PALETTE_COLOR&&this._palette.length===0)throw new Error("Expected palette not found");this.inflateData(e);let i=a-e.length;i>0?this._handleIDAT(i):this._handleChunkEnd()};nn.prototype._handleIEND=function(a){this.read(a,this._parseIEND.bind(this))};nn.prototype._parseIEND=function(a){this._crc.write(a),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()}});var cJ=Ie(qEe=>{"use strict";var kEe=tJ(),cMa=[function(){},function(a,e,i,r){if(r===e.length)throw new Error("Ran out of data");let t=e[r];a[i]=t,a[i+1]=t,a[i+2]=t,a[i+3]=255},function(a,e,i,r){if(r+1>=e.length)throw new Error("Ran out of data");let t=e[r];a[i]=t,a[i+1]=t,a[i+2]=t,a[i+3]=e[r+1]},function(a,e,i,r){if(r+2>=e.length)throw new Error("Ran out of data");a[i]=e[r],a[i+1]=e[r+1],a[i+2]=e[r+2],a[i+3]=255},function(a,e,i,r){if(r+3>=e.length)throw new Error("Ran out of data");a[i]=e[r],a[i+1]=e[r+1],a[i+2]=e[r+2],a[i+3]=e[r+3]}],uMa=[function(){},function(a,e,i,r){let t=e[0];a[i]=t,a[i+1]=t,a[i+2]=t,a[i+3]=r},function(a,e,i){let r=e[0];a[i]=r,a[i+1]=r,a[i+2]=r,a[i+3]=e[1]},function(a,e,i,r){a[i]=e[0],a[i+1]=e[1],a[i+2]=e[2],a[i+3]=r},function(a,e,i){a[i]=e[0],a[i+1]=e[1],a[i+2]=e[2],a[i+3]=e[3]}];function fMa(a,e){let i=[],r=0;function t(){if(r===a.length)throw new Error("Ran out of data");let n=a[r];r++;let s,o,d,l,m,c,u,f;switch(e){default:throw new Error("unrecognised depth");case 16:u=a[r],r++,i.push((n<<8)+u);break;case 4:u=n&15,f=n>>4,i.push(f,u);break;case 2:m=n&3,c=n>>2&3,u=n>>4&3,f=n>>6&3,i.push(f,u,c,m);break;case 1:s=n&1,o=n>>1&1,d=n>>2&1,l=n>>3&1,m=n>>4&1,c=n>>5&1,u=n>>6&1,f=n>>7&1,i.push(f,u,c,m,l,d,o,s);break}}return{get:function(n){for(;i.length<n;)t();let s=i.slice(0,n);return i=i.slice(n),s},resetAfterLine:function(){i.length=0},end:function(){if(r!==a.length)throw new Error("extra data found")}}}function NMa(a,e,i,r,t,n){let s=a.width,o=a.height,d=a.index;for(let l=0;l<o;l++)for(let m=0;m<s;m++){let c=i(m,l,d);cMa[r](e,t,c,n),n+=r}return n}function pMa(a,e,i,r,t,n){let s=a.width,o=a.height,d=a.index;for(let l=0;l<o;l++){for(let m=0;m<s;m++){let c=t.get(r),u=i(m,l,d);uMa[r](e,c,u,n)}t.resetAfterLine()}}qEe.dataToBitMap=function(a,e){let i=e.width,r=e.height,t=e.depth,n=e.bpp,s=e.interlace,o;t!==8&&(o=fMa(a,t));let d;t<=8?d=Buffer.alloc(i*r*4):d=new Uint16Array(i*r*4);let l=Math.pow(2,t)-1,m=0,c,u;if(s)c=kEe.getImagePasses(i,r),u=kEe.getInterlaceIterator(i,r);else{let f=0;u=function(){let N=f;return f+=4,N},c=[{width:i,height:r}]}for(let f=0;f<c.length;f++)t===8?m=NMa(c[f],d,u,n,a,m):pMa(c[f],d,u,n,o,l);if(t===8){if(m!==a.length)throw new Error("extra data found")}else o.end();return d}});var uJ=Ie((K_r,jEe)=>{"use strict";function _Ma(a,e,i,r,t){let n=0;for(let s=0;s<r;s++)for(let o=0;o<i;o++){let d=t[a[n]];if(!d)throw new Error("index "+a[n]+" not in palette");for(let l=0;l<4;l++)e[n+l]=d[l];n+=4}}function hMa(a,e,i,r,t){let n=0;for(let s=0;s<r;s++)for(let o=0;o<i;o++){let d=!1;if(t.length===1?t[0]===a[n]&&(d=!0):t[0]===a[n]&&t[1]===a[n+1]&&t[2]===a[n+2]&&(d=!0),d)for(let l=0;l<4;l++)e[n+l]=0;n+=4}}function vMa(a,e,i,r,t){let n=255,s=Math.pow(2,t)-1,o=0;for(let d=0;d<r;d++)for(let l=0;l<i;l++){for(let m=0;m<4;m++)e[o+m]=Math.floor(a[o+m]*n/s+.5);o+=4}}jEe.exports=function(a,e,i=!1){let r=e.depth,t=e.width,n=e.height,s=e.colorType,o=e.transColor,d=e.palette,l=a;return s===3?_Ma(a,l,t,n,d):(o&&hMa(a,l,t,n,o),r!==8&&!i&&(r===16&&(l=Buffer.alloc(t*n*4)),vMa(a,l,t,n,r))),l}});var SEe=Ie((V_r,IEe)=>{"use strict";var wMa=Wi("util"),fJ=Wi("zlib"),bEe=iJ(),gMa=vEe(),yMa=mJ(),kMa=cJ(),qMa=uJ(),Im=IEe.exports=function(a){bEe.call(this),this._parser=new yMa(a,{read:this.read.bind(this),error:this._handleError.bind(this),metadata:this._handleMetaData.bind(this),gamma:this.emit.bind(this,"gamma"),palette:this._handlePalette.bind(this),transColor:this._handleTransColor.bind(this),finished:this._finished.bind(this),inflateData:this._inflateData.bind(this),simpleTransparency:this._simpleTransparency.bind(this),headersFinished:this._headersFinished.bind(this)}),this._options=a,this.writable=!0,this._parser.start()};wMa.inherits(Im,bEe);Im.prototype._handleError=function(a){this.emit("error",a),this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy&&this._inflate.destroy(),this._filter&&(this._filter.destroy(),this._filter.on("error",function(){})),this.errord=!0};Im.prototype._inflateData=function(a){if(!this._inflate)if(this._bitmapInfo.interlace)this._inflate=fJ.createInflate(),this._inflate.on("error",this.emit.bind(this,"error")),this._filter.on("complete",this._complete.bind(this)),this._inflate.pipe(this._filter);else{let i=((this._bitmapInfo.width*this._bitmapInfo.bpp*this._bitmapInfo.depth+7>>3)+1)*this._bitmapInfo.height,r=Math.max(i,fJ.Z_MIN_CHUNK);this._inflate=fJ.createInflate({chunkSize:r});let t=i,n=this.emit.bind(this,"error");this._inflate.on("error",function(o){t&&n(o)}),this._filter.on("complete",this._complete.bind(this));let s=this._filter.write.bind(this._filter);this._inflate.on("data",function(o){t&&(o.length>t&&(o=o.slice(0,t)),t-=o.length,s(o))}),this._inflate.on("end",this._filter.end.bind(this._filter))}this._inflate.write(a)};Im.prototype._handleMetaData=function(a){this._metaData=a,this._bitmapInfo=Object.create(a),this._filter=new gMa(this._bitmapInfo)};Im.prototype._handleTransColor=function(a){this._bitmapInfo.transColor=a};Im.prototype._handlePalette=function(a){this._bitmapInfo.palette=a};Im.prototype._simpleTransparency=function(){this._metaData.alpha=!0};Im.prototype._headersFinished=function(){this.emit("metadata",this._metaData)};Im.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"))};Im.prototype._complete=function(a){if(this.errord)return;let e;try{let i=kMa.dataToBitMap(a,this._bitmapInfo);e=qMa(i,this._bitmapInfo,this._options.skipRescale),i=null}catch(i){this._handleError(i);return}this.emit("parsed",e)}});var EEe=Ie((W_r,TEe)=>{"use strict";var wd=Ug();TEe.exports=function(a,e,i,r){let t=[wd.COLORTYPE_COLOR_ALPHA,wd.COLORTYPE_ALPHA].indexOf(r.colorType)!==-1;if(r.colorType===r.inputColorType){let N=(function(){let _=new ArrayBuffer(2);return new DataView(_).setInt16(0,256,!0),new Int16Array(_)[0]!==256})();if(r.bitDepth===8||r.bitDepth===16&&N)return a}let n=r.bitDepth!==16?a:new Uint16Array(a.buffer),s=255,o=wd.COLORTYPE_TO_BPP_MAP[r.inputColorType];o===4&&!r.inputHasAlpha&&(o=3);let d=wd.COLORTYPE_TO_BPP_MAP[r.colorType];r.bitDepth===16&&(s=65535,d*=2);let l=Buffer.alloc(e*i*d),m=0,c=0,u=r.bgColor||{};u.red===void 0&&(u.red=s),u.green===void 0&&(u.green=s),u.blue===void 0&&(u.blue=s);function f(){let N,_,v,h=s;switch(r.inputColorType){case wd.COLORTYPE_COLOR_ALPHA:h=n[m+3],N=n[m],_=n[m+1],v=n[m+2];break;case wd.COLORTYPE_COLOR:N=n[m],_=n[m+1],v=n[m+2];break;case wd.COLORTYPE_ALPHA:h=n[m+1],N=n[m],_=N,v=N;break;case wd.COLORTYPE_GRAYSCALE:N=n[m],_=N,v=N;break;default:throw new Error("input color type:"+r.inputColorType+" is not supported at present")}return r.inputHasAlpha&&(t||(h/=s,N=Math.min(Math.max(Math.round((1-h)*u.red+h*N),0),s),_=Math.min(Math.max(Math.round((1-h)*u.green+h*_),0),s),v=Math.min(Math.max(Math.round((1-h)*u.blue+h*v),0),s))),{red:N,green:_,blue:v,alpha:h}}for(let N=0;N<i;N++)for(let _=0;_<e;_++){let v=f(n,m);switch(r.colorType){case wd.COLORTYPE_COLOR_ALPHA:case wd.COLORTYPE_COLOR:r.bitDepth===8?(l[c]=v.red,l[c+1]=v.green,l[c+2]=v.blue,t&&(l[c+3]=v.alpha)):(l.writeUInt16BE(v.red,c),l.writeUInt16BE(v.green,c+2),l.writeUInt16BE(v.blue,c+4),t&&l.writeUInt16BE(v.alpha,c+6));break;case wd.COLORTYPE_ALPHA:case wd.COLORTYPE_GRAYSCALE:{let h=(v.red+v.green+v.blue)/3;r.bitDepth===8?(l[c]=h,t&&(l[c+1]=v.alpha)):(l.writeUInt16BE(h,c),t&&l.writeUInt16BE(v.alpha,c+2));break}default:throw new Error("unrecognised color Type "+r.colorType)}m+=o,c+=d}return l}});var REe=Ie((G_r,AEe)=>{"use strict";var CEe=nJ();function jMa(a,e,i,r,t){for(let n=0;n<i;n++)r[t+n]=a[e+n]}function bMa(a,e,i){let r=0,t=e+i;for(let n=e;n<t;n++)r+=Math.abs(a[n]);return r}function IMa(a,e,i,r,t,n){for(let s=0;s<i;s++){let o=s>=n?a[e+s-n]:0,d=a[e+s]-o;r[t+s]=d}}function SMa(a,e,i,r){let t=0;for(let n=0;n<i;n++){let s=n>=r?a[e+n-r]:0,o=a[e+n]-s;t+=Math.abs(o)}return t}function TMa(a,e,i,r,t){for(let n=0;n<i;n++){let s=e>0?a[e+n-i]:0,o=a[e+n]-s;r[t+n]=o}}function EMa(a,e,i){let r=0,t=e+i;for(let n=e;n<t;n++){let s=e>0?a[n-i]:0,o=a[n]-s;r+=Math.abs(o)}return r}function CMa(a,e,i,r,t,n){for(let s=0;s<i;s++){let o=s>=n?a[e+s-n]:0,d=e>0?a[e+s-i]:0,l=a[e+s]-(o+d>>1);r[t+s]=l}}function AMa(a,e,i,r){let t=0;for(let n=0;n<i;n++){let s=n>=r?a[e+n-r]:0,o=e>0?a[e+n-i]:0,d=a[e+n]-(s+o>>1);t+=Math.abs(d)}return t}function RMa(a,e,i,r,t,n){for(let s=0;s<i;s++){let o=s>=n?a[e+s-n]:0,d=e>0?a[e+s-i]:0,l=e>0&&s>=n?a[e+s-(i+n)]:0,m=a[e+s]-CEe(o,d,l);r[t+s]=m}}function DMa(a,e,i,r){let t=0;for(let n=0;n<i;n++){let s=n>=r?a[e+n-r]:0,o=e>0?a[e+n-i]:0,d=e>0&&n>=r?a[e+n-(i+r)]:0,l=a[e+n]-CEe(s,o,d);t+=Math.abs(l)}return t}var xMa={0:jMa,1:IMa,2:TMa,3:CMa,4:RMa},MMa={0:bMa,1:SMa,2:EMa,3:AMa,4:DMa};AEe.exports=function(a,e,i,r,t){let n;if(!("filterType"in r)||r.filterType===-1)n=[0,1,2,3,4];else if(typeof r.filterType=="number")n=[r.filterType];else throw new Error("unrecognised filter types");r.bitDepth===16&&(t*=2);let s=e*t,o=0,d=0,l=Buffer.alloc((s+1)*i),m=n[0];for(let c=0;c<i;c++){if(n.length>1){let u=1/0;for(let f=0;f<n.length;f++){let N=MMa[n[f]](a,d,s,t);N<u&&(m=n[f],u=N)}}l[o]=m,o++,xMa[m](a,d,s,l,o,t),o+=s,d+=s}return l}});var NJ=Ie(($_r,DEe)=>{"use strict";var Vn=Ug(),PMa=lJ(),LMa=EEe(),OMa=REe(),BMa=Wi("zlib"),Mf=DEe.exports=function(a){if(this._options=a,a.deflateChunkSize=a.deflateChunkSize||32*1024,a.deflateLevel=a.deflateLevel!=null?a.deflateLevel:9,a.deflateStrategy=a.deflateStrategy!=null?a.deflateStrategy:3,a.inputHasAlpha=a.inputHasAlpha!=null?a.inputHasAlpha:!0,a.deflateFactory=a.deflateFactory||BMa.createDeflate,a.bitDepth=a.bitDepth||8,a.colorType=typeof a.colorType=="number"?a.colorType:Vn.COLORTYPE_COLOR_ALPHA,a.inputColorType=typeof a.inputColorType=="number"?a.inputColorType:Vn.COLORTYPE_COLOR_ALPHA,[Vn.COLORTYPE_GRAYSCALE,Vn.COLORTYPE_COLOR,Vn.COLORTYPE_COLOR_ALPHA,Vn.COLORTYPE_ALPHA].indexOf(a.colorType)===-1)throw new Error("option color type:"+a.colorType+" is not supported at present");if([Vn.COLORTYPE_GRAYSCALE,Vn.COLORTYPE_COLOR,Vn.COLORTYPE_COLOR_ALPHA,Vn.COLORTYPE_ALPHA].indexOf(a.inputColorType)===-1)throw new Error("option input color type:"+a.inputColorType+" is not supported at present");if(a.bitDepth!==8&&a.bitDepth!==16)throw new Error("option bit depth:"+a.bitDepth+" is not supported at present")};Mf.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}};Mf.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())};Mf.prototype.filterData=function(a,e,i){let r=LMa(a,e,i,this._options),t=Vn.COLORTYPE_TO_BPP_MAP[this._options.colorType];return OMa(r,e,i,this._options,t)};Mf.prototype._packChunk=function(a,e){let i=e?e.length:0,r=Buffer.alloc(i+12);return r.writeUInt32BE(i,0),r.writeUInt32BE(a,4),e&&e.copy(r,8),r.writeInt32BE(PMa.crc32(r.slice(4,r.length-4)),r.length-4),r};Mf.prototype.packGAMA=function(a){let e=Buffer.alloc(4);return e.writeUInt32BE(Math.floor(a*Vn.GAMMA_DIVISION),0),this._packChunk(Vn.TYPE_gAMA,e)};Mf.prototype.packIHDR=function(a,e){let i=Buffer.alloc(13);return i.writeUInt32BE(a,0),i.writeUInt32BE(e,4),i[8]=this._options.bitDepth,i[9]=this._options.colorType,i[10]=0,i[11]=0,i[12]=0,this._packChunk(Vn.TYPE_IHDR,i)};Mf.prototype.packIDAT=function(a){return this._packChunk(Vn.TYPE_IDAT,a)};Mf.prototype.packIEND=function(){return this._packChunk(Vn.TYPE_IEND,null)}});var LEe=Ie((H_r,PEe)=>{"use strict";var UMa=Wi("util"),xEe=Wi("stream"),FMa=Ug(),zMa=NJ(),MEe=PEe.exports=function(a){xEe.call(this);let e=a||{};this._packer=new zMa(e),this._deflate=this._packer.createDeflate(),this.readable=!0};UMa.inherits(MEe,xEe);MEe.prototype.pack=function(a,e,i,r){this.emit("data",Buffer.from(FMa.PNG_SIGNATURE)),this.emit("data",this._packer.packIHDR(e,i)),r&&this.emit("data",this._packer.packGAMA(r));let t=this._packer.filterData(a,e,i);this._deflate.on("error",this.emit.bind(this,"error")),this._deflate.on("data",function(n){this.emit("data",this._packer.packIDAT(n))}.bind(this)),this._deflate.on("end",function(){this.emit("data",this._packer.packIEND()),this.emit("end")}.bind(this)),this._deflate.end(t)}});var KEe=Ie((DS,zEe)=>{"use strict";var OEe=Wi("assert").ok,Fg=Wi("zlib"),KMa=Wi("util"),BEe=Wi("buffer").kMaxLength;function nh(a){if(!(this instanceof nh))return new nh(a);a&&a.chunkSize<Fg.Z_MIN_CHUNK&&(a.chunkSize=Fg.Z_MIN_CHUNK),Fg.Inflate.call(this,a),this._offset=this._offset===void 0?this._outOffset:this._offset,this._buffer=this._buffer||this._outBuffer,a&&a.maxLength!=null&&(this._maxLength=a.maxLength)}function VMa(a){return new nh(a)}function UEe(a,e){e&&process.nextTick(e),a._handle&&(a._handle.close(),a._handle=null)}nh.prototype._processChunk=function(a,e,i){if(typeof i=="function")return Fg.Inflate._processChunk.call(this,a,e,i);let r=this,t=a&&a.length,n=this._chunkSize-this._offset,s=this._maxLength,o=0,d=[],l=0,m;this.on("error",function(N){m=N});function c(N,_){if(r._hadError)return;let v=n-_;if(OEe(v>=0,"have should not go down"),v>0){let h=r._buffer.slice(r._offset,r._offset+v);if(r._offset+=v,h.length>s&&(h=h.slice(0,s)),d.push(h),l+=h.length,s-=h.length,s===0)return!1}return(_===0||r._offset>=r._chunkSize)&&(n=r._chunkSize,r._offset=0,r._buffer=Buffer.allocUnsafe(r._chunkSize)),_===0?(o+=t-N,t=N,!0):!1}OEe(this._handle,"zlib binding closed");let u;do u=this._handle.writeSync(e,a,o,t,this._buffer,this._offset,n),u=u||this._writeState;while(!this._hadError&&c(u[0],u[1]));if(this._hadError)throw m;if(l>=BEe)throw UEe(this),new RangeError("Cannot create final Buffer. It would be larger than 0x"+BEe.toString(16)+" bytes");let f=Buffer.concat(d,l);return UEe(this),f};KMa.inherits(nh,Fg.Inflate);function WMa(a,e){if(typeof e=="string"&&(e=Buffer.from(e)),!(e instanceof Buffer))throw new TypeError("Not a string or buffer");let i=a._finishFlushFlag;return i==null&&(i=Fg.Z_FINISH),a._processChunk(e,i)}function FEe(a,e){return WMa(new nh(e),a)}zEe.exports=DS=FEe;DS.Inflate=nh;DS.createInflate=VMa;DS.inflateSync=FEe});var pJ=Ie((X_r,WEe)=>{"use strict";var VEe=WEe.exports=function(a){this._buffer=a,this._reads=[]};VEe.prototype.read=function(a,e){this._reads.push({length:Math.abs(a),allowLess:a<0,func:e})};VEe.prototype.process=function(){for(;this._reads.length>0&&this._buffer.length;){let a=this._reads[0];if(this._buffer.length&&(this._buffer.length>=a.length||a.allowLess)){this._reads.shift();let e=this._buffer;this._buffer=e.slice(a.length),a.func.call(this,e.slice(0,a.length))}else break}if(this._reads.length>0)throw new Error("There are some read requests waitng on finished stream");if(this._buffer.length>0)throw new Error("unrecognised content at end of stream")}});var $Ee=Ie(GEe=>{"use strict";var GMa=pJ(),$Ma=sJ();GEe.process=function(a,e){let i=[],r=new GMa(a);return new $Ma(e,{read:r.read.bind(r),write:function(n){i.push(n)},complete:function(){}}).start(),r.process(),Buffer.concat(i)}});var JEe=Ie((J_r,QEe)=>{"use strict";var HEe=!0,XEe=Wi("zlib"),HMa=KEe();XEe.deflateSync||(HEe=!1);var XMa=pJ(),QMa=$Ee(),JMa=mJ(),YMa=cJ(),ZMa=uJ();QEe.exports=function(a,e){if(!HEe)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let i;function r(k){i=k}let t;function n(k){t=k}function s(k){t.transColor=k}function o(k){t.palette=k}function d(){t.alpha=!0}let l;function m(k){l=k}let c=[];function u(k){c.push(k)}let f=new XMa(a);if(new JMa(e,{read:f.read.bind(f),error:r,metadata:n,gamma:m,palette:o,transColor:s,inflateData:u,simpleTransparency:d}).start(),f.process(),i)throw i;let _=Buffer.concat(c);c.length=0;let v;if(t.interlace)v=XEe.inflateSync(_);else{let y=((t.width*t.bpp*t.depth+7>>3)+1)*t.height;v=HMa(_,{chunkSize:y,maxLength:y})}if(_=null,!v||!v.length)throw new Error("bad png - invalid inflate data response");let h=QMa.process(v,t);_=null;let w=YMa.dataToBitMap(h,t);h=null;let g=ZMa(w,t,e.skipRescale);return t.data=g,t.gamma=l||0,t}});var aCe=Ie((Y_r,eCe)=>{"use strict";var YEe=!0,ZEe=Wi("zlib");ZEe.deflateSync||(YEe=!1);var ePa=Ug(),aPa=NJ();eCe.exports=function(a,e){if(!YEe)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let i=e||{},r=new aPa(i),t=[];t.push(Buffer.from(ePa.PNG_SIGNATURE)),t.push(r.packIHDR(a.width,a.height)),a.gamma&&t.push(r.packGAMA(a.gamma));let n=r.filterData(a.data,a.width,a.height),s=ZEe.deflateSync(n,r.getDeflateOptions());if(n=null,!s||!s.length)throw new Error("bad png - invalid compressed data response");return t.push(r.packIDAT(s)),t.push(r.packIEND()),Buffer.concat(t)}});var iCe=Ie(_J=>{"use strict";var iPa=JEe(),rPa=aCe();_J.read=function(a,e){return iPa(a,e||{})};_J.write=function(a,e){return rPa(a,e)}});var xS=Ie(tCe=>{"use strict";var tPa=Wi("util"),rCe=Wi("stream"),nPa=SEe(),sPa=LEe(),oPa=iCe(),fs=tCe.PNG=function(a){rCe.call(this),a=a||{},this.width=a.width|0,this.height=a.height|0,this.data=this.width>0&&this.height>0?Buffer.alloc(4*this.width*this.height):null,a.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new nPa(a),this._parser.on("error",this.emit.bind(this,"error")),this._parser.on("close",this._handleClose.bind(this)),this._parser.on("metadata",this._metadata.bind(this)),this._parser.on("gamma",this._gamma.bind(this)),this._parser.on("parsed",function(e){this.data=e,this.emit("parsed",e)}.bind(this)),this._packer=new sPa(a),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};tPa.inherits(fs,rCe);fs.sync=oPa;fs.prototype.pack=function(){return!this.data||!this.data.length?(this.emit("error","No data provided"),this):(process.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this)),this)};fs.prototype.parse=function(a,e){if(e){let i,r;i=function(t){this.removeListener("error",r),this.data=t,e(null,this)}.bind(this),r=function(t){this.removeListener("parsed",i),e(t,null)}.bind(this),this.once("parsed",i),this.once("error",r)}return this.end(a),this};fs.prototype.write=function(a){return this._parser.write(a),!0};fs.prototype.end=function(a){this._parser.end(a)};fs.prototype._metadata=function(a){this.width=a.width,this.height=a.height,this.emit("metadata",a)};fs.prototype._gamma=function(a){this.gamma=a};fs.prototype._handleClose=function(){!this._parser.writable&&!this._packer.readable&&this.emit("close")};fs.bitblt=function(a,e,i,r,t,n,s,o){if(i|=0,r|=0,t|=0,n|=0,s|=0,o|=0,i>a.width||r>a.height||i+t>a.width||r+n>a.height)throw new Error("bitblt reading outside image");if(s>e.width||o>e.height||s+t>e.width||o+n>e.height)throw new Error("bitblt writing outside image");for(let d=0;d<n;d++)a.data.copy(e.data,(o+d)*e.width+s<<2,(r+d)*a.width+i<<2,(r+d)*a.width+i+t<<2)};fs.prototype.bitblt=function(a,e,i,r,t,n,s){return fs.bitblt(this,a,e,i,r,t,n,s),this};fs.adjustGamma=function(a){if(a.gamma){for(let e=0;e<a.height;e++)for(let i=0;i<a.width;i++){let r=a.width*e+i<<2;for(let t=0;t<3;t++){let n=a.data[r+t]/255;n=Math.pow(n,1/2.2/a.gamma),a.data[r+t]=Math.round(n*255)}}a.gamma=0}};fs.prototype.adjustGamma=function(){fs.adjustGamma(this)}});var oCe=Ie((ahr,DO)=>{var sCe=sCe||function(a){return Buffer.from(a).toString("base64")};function dPa(a){var e=this,i=Math.round,r=Math.floor,t=new Array(64),n=new Array(64),s=new Array(64),o=new Array(64),d,l,m,c,u=new Array(65535),f=new Array(65535),N=new Array(64),_=new Array(64),v=[],h=0,w=7,g=new Array(64),k=new Array(64),y=new Array(64),q=new Array(256),b=new Array(2048),O,L=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],Q=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],K=[0,1,2,3,4,5,6,7,8,9,10,11],$=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],X=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],oe=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],ae=[0,1,2,3,4,5,6,7,8,9,10,11],ue=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],de=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function Te(te){for(var Ze=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],fa=0;fa<64;fa++){var da=r((Ze[fa]*te+50)/100);da<1?da=1:da>255&&(da=255),t[L[fa]]=da}for(var Ea=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],Aa=0;Aa<64;Aa++){var fi=r((Ea[Aa]*te+50)/100);fi<1?fi=1:fi>255&&(fi=255),n[L[Aa]]=fi}for(var Ni=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],Ar=0,nr=0;nr<8;nr++)for(var qe=0;qe<8;qe++)s[Ar]=1/(t[L[Ar]]*Ni[nr]*Ni[qe]*8),o[Ar]=1/(n[L[Ar]]*Ni[nr]*Ni[qe]*8),Ar++}function je(te,Ze){for(var fa=0,da=0,Ea=new Array,Aa=1;Aa<=16;Aa++){for(var fi=1;fi<=te[Aa];fi++)Ea[Ze[da]]=[],Ea[Ze[da]][0]=fa,Ea[Ze[da]][1]=Aa,da++,fa++;fa*=2}return Ea}function ze(){d=je(Q,K),l=je(oe,ae),m=je($,X),c=je(ue,de)}function Ae(){for(var te=1,Ze=2,fa=1;fa<=15;fa++){for(var da=te;da<Ze;da++)f[32767+da]=fa,u[32767+da]=[],u[32767+da][1]=fa,u[32767+da][0]=da;for(var Ea=-(Ze-1);Ea<=-te;Ea++)f[32767+Ea]=fa,u[32767+Ea]=[],u[32767+Ea][1]=fa,u[32767+Ea][0]=Ze-1+Ea;te<<=1,Ze<<=1}}function re(){for(var te=0;te<256;te++)b[te]=19595*te,b[te+256>>0]=38470*te,b[te+512>>0]=7471*te+32768,b[te+768>>0]=-11059*te,b[te+1024>>0]=-21709*te,b[te+1280>>0]=32768*te+8421375,b[te+1536>>0]=-27439*te,b[te+1792>>0]=-5329*te}function he(te){for(var Ze=te[0],fa=te[1]-1;fa>=0;)Ze&1<<fa&&(h|=1<<w),fa--,w--,w<0&&(h==255?(H(255),H(0)):H(h),w=7,h=0)}function H(te){v.push(te)}function Y(te){H(te>>8&255),H(te&255)}function ie(te,Ze){var fa,da,Ea,Aa,fi,Ni,Ar,nr,qe=0,Ve,ka=8,br=64;for(Ve=0;Ve<ka;++Ve){fa=te[qe],da=te[qe+1],Ea=te[qe+2],Aa=te[qe+3],fi=te[qe+4],Ni=te[qe+5],Ar=te[qe+6],nr=te[qe+7];var Ra=fa+nr,Za=fa-nr,Vi=da+Ar,wa=da-Ar,bi=Ea+Ni,yn=Ea-Ni,_r=Aa+fi,nd=Aa-fi,fm=Ra+_r,Vp=Ra-_r,fw=Vi+bi,Nw=Vi-bi;te[qe]=fm+fw,te[qe+4]=fm-fw;var Fj=(Nw+Vp)*.707106781;te[qe+2]=Vp+Fj,te[qe+6]=Vp-Fj,fm=nd+yn,fw=yn+wa,Nw=wa+Za;var zj=(fm-Nw)*.382683433,Ix=.5411961*fm+zj,Kj=1.306562965*Nw+zj,Vj=fw*.707106781,Wj=Za+Vj,Gj=Za-Vj;te[qe+5]=Gj+Ix,te[qe+3]=Gj-Ix,te[qe+1]=Wj+Kj,te[qe+7]=Wj-Kj,qe+=8}for(qe=0,Ve=0;Ve<ka;++Ve){fa=te[qe],da=te[qe+8],Ea=te[qe+16],Aa=te[qe+24],fi=te[qe+32],Ni=te[qe+40],Ar=te[qe+48],nr=te[qe+56];var Cfe=fa+nr,Q4=fa-nr,Afe=da+Ar,Rfe=da-Ar,Dfe=Ea+Ni,xfe=Ea-Ni,Mfe=Aa+fi,Cha=Aa-fi,$j=Cfe+Mfe,J4=Cfe-Mfe,Sx=Afe+Dfe,Tx=Afe-Dfe;te[qe]=$j+Sx,te[qe+32]=$j-Sx;var Pfe=(Tx+J4)*.707106781;te[qe+16]=J4+Pfe,te[qe+48]=J4-Pfe,$j=Cha+xfe,Sx=xfe+Rfe,Tx=Rfe+Q4;var Lfe=($j-Tx)*.382683433,Ofe=.5411961*$j+Lfe,Bfe=1.306562965*Tx+Lfe,Ufe=Sx*.707106781,Ffe=Q4+Ufe,zfe=Q4-Ufe;te[qe+40]=zfe+Ofe,te[qe+24]=zfe-Ofe,te[qe+8]=Ffe+Bfe,te[qe+56]=Ffe-Bfe,qe++}var Ex;for(Ve=0;Ve<br;++Ve)Ex=te[Ve]*Ze[Ve],N[Ve]=Ex>0?Ex+.5|0:Ex-.5|0;return N}function se(){Y(65504),Y(16),H(74),H(70),H(73),H(70),H(0),H(1),H(1),H(0),Y(1),Y(1),H(0),H(0)}function ge(te){if(te){Y(65505),te[0]===69&&te[1]===120&&te[2]===105&&te[3]===102?Y(te.length+2):(Y(te.length+5+2),H(69),H(120),H(105),H(102),H(0));for(var Ze=0;Ze<te.length;Ze++)H(te[Ze])}}function ke(te,Ze){Y(65472),Y(17),H(8),Y(Ze),Y(te),H(3),H(1),H(17),H(0),H(2),H(17),H(1),H(3),H(17),H(1)}function Re(){Y(65499),Y(132),H(0);for(var te=0;te<64;te++)H(t[te]);H(1);for(var Ze=0;Ze<64;Ze++)H(n[Ze])}function me(){Y(65476),Y(418),H(0);for(var te=0;te<16;te++)H(Q[te+1]);for(var Ze=0;Ze<=11;Ze++)H(K[Ze]);H(16);for(var fa=0;fa<16;fa++)H($[fa+1]);for(var da=0;da<=161;da++)H(X[da]);H(1);for(var Ea=0;Ea<16;Ea++)H(oe[Ea+1]);for(var Aa=0;Aa<=11;Aa++)H(ae[Aa]);H(17);for(var fi=0;fi<16;fi++)H(ue[fi+1]);for(var Ni=0;Ni<=161;Ni++)H(de[Ni])}function pe(te){typeof te>"u"||te.constructor!==Array||te.forEach(Ze=>{if(typeof Ze=="string"){Y(65534);var fa=Ze.length;Y(fa+2);var da;for(da=0;da<fa;da++)H(Ze.charCodeAt(da))}})}function Qe(){Y(65498),Y(12),H(3),H(1),H(0),H(2),H(17),H(3),H(17),H(0),H(63),H(0)}function Be(te,Ze,fa,da,Ea){for(var Aa=Ea[0],fi=Ea[240],Ni,Ar=16,nr=63,qe=64,Ve=ie(te,Ze),ka=0;ka<qe;++ka)_[L[ka]]=Ve[ka];var br=_[0]-fa;fa=_[0],br==0?he(da[0]):(Ni=32767+br,he(da[f[Ni]]),he(u[Ni]));for(var Ra=63;Ra>0&&_[Ra]==0;Ra--);if(Ra==0)return he(Aa),fa;for(var Za=1,Vi;Za<=Ra;){for(var wa=Za;_[Za]==0&&Za<=Ra;++Za);var bi=Za-wa;if(bi>=Ar){Vi=bi>>4;for(var yn=1;yn<=Vi;++yn)he(fi);bi=bi&15}Ni=32767+_[Za],he(Ea[(bi<<4)+f[Ni]]),he(u[Ni]),Za++}return Ra!=nr&&he(Aa),fa}function Je(){for(var te=String.fromCharCode,Ze=0;Ze<256;Ze++)q[Ze]=te(Ze)}this.encode=function(te,Ze){var fa=new Date().getTime();Ze&&td(Ze),v=new Array,h=0,w=7,Y(65496),se(),pe(te.comments),ge(te.exifBuffer),Re(),ke(te.width,te.height),me(),Qe();var da=0,Ea=0,Aa=0;h=0,w=7,this.encode.displayName="_encode_";for(var fi=te.data,Ni=te.width,Ar=te.height,nr=Ni*4,qe=Ni*3,Ve,ka=0,br,Ra,Za,Vi,wa,bi,yn,_r;ka<Ar;){for(Ve=0;Ve<nr;){for(Vi=nr*ka+Ve,wa=Vi,bi=-1,yn=0,_r=0;_r<64;_r++)yn=_r>>3,bi=(_r&7)*4,wa=Vi+yn*nr+bi,ka+yn>=Ar&&(wa-=nr*(ka+1+yn-Ar)),Ve+bi>=nr&&(wa-=Ve+bi-nr+4),br=fi[wa++],Ra=fi[wa++],Za=fi[wa++],g[_r]=(b[br]+b[Ra+256>>0]+b[Za+512>>0]>>16)-128,k[_r]=(b[br+768>>0]+b[Ra+1024>>0]+b[Za+1280>>0]>>16)-128,y[_r]=(b[br+1280>>0]+b[Ra+1536>>0]+b[Za+1792>>0]>>16)-128;da=Be(g,s,da,d,m),Ea=Be(k,o,Ea,l,c),Aa=Be(y,o,Aa,l,c),Ve+=32}ka+=8}if(w>=0){var nd=[];nd[1]=w+1,nd[0]=(1<<w+1)-1,he(nd)}if(Y(65497),typeof DO>"u")return new Uint8Array(v);return Buffer.from(v);var fm,Vp};function td(te){if(te<=0&&(te=1),te>100&&(te=100),O!=te){var Ze=0;te<50?Ze=Math.floor(5e3/te):Ze=Math.floor(200-te*2),Te(Ze),O=te}}function Zd(){var te=new Date().getTime();a||(a=50),Je(),ze(),Ae(),re(),td(a);var Ze=new Date().getTime()-te}Zd()}typeof DO<"u"?DO.exports=nCe:typeof window<"u"&&(window["jpeg-js"]=window["jpeg-js"]||{},window["jpeg-js"].encode=nCe);function nCe(a,e){typeof e>"u"&&(e=50);var i=new dPa(e),r=i.encode(a,e);return{data:r,width:a.width,height:a.height}}});var lCe=Ie((ihr,vJ)=>{var hJ=(function(){"use strict";var e=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),i=4017,r=799,t=3406,n=2276,s=1567,o=3784,d=5793,l=2896;function m(){}function c(w,g){for(var k=0,y=[],q,b,O=16;O>0&&!w[O-1];)O--;y.push({children:[],index:0});var L=y[0],Q;for(q=0;q<O;q++){for(b=0;b<w[q];b++){for(L=y.pop(),L.children[L.index]=g[k];L.index>0;){if(y.length===0)throw new Error("Could not recreate Huffman Table");L=y.pop()}for(L.index++,y.push(L);y.length<=q;)y.push(Q={children:[],index:0}),L.children[L.index]=Q.children,L=Q;k++}q+1<O&&(y.push(Q={children:[],index:0}),L.children[L.index]=Q.children,L=Q)}return y[0].children}function u(w,g,k,y,q,b,O,L,Q,K){var $=k.precision,X=k.samplesPerLine,oe=k.scanLines,ae=k.mcusPerLine,ue=k.progressive,de=k.maxH,Te=k.maxV,je=g,ze=0,Ae=0;function re(){if(Ae>0)return Ae--,ze>>Ae&1;if(ze=w[g++],ze==255){var qe=w[g++];if(qe)throw new Error("unexpected marker: "+(ze<<8|qe).toString(16))}return Ae=7,ze>>>7}function he(qe){for(var Ve=qe,ka;(ka=re())!==null;){if(Ve=Ve[ka],typeof Ve=="number")return Ve;if(typeof Ve!="object")throw new Error("invalid huffman sequence")}return null}function H(qe){for(var Ve=0;qe>0;){var ka=re();if(ka===null)return;Ve=Ve<<1|ka,qe--}return Ve}function Y(qe){var Ve=H(qe);return Ve>=1<<qe-1?Ve:Ve+(-1<<qe)+1}function ie(qe,Ve){var ka=he(qe.huffmanTableDC),br=ka===0?0:Y(ka);Ve[0]=qe.pred+=br;for(var Ra=1;Ra<64;){var Za=he(qe.huffmanTableAC),Vi=Za&15,wa=Za>>4;if(Vi===0){if(wa<15)break;Ra+=16;continue}Ra+=wa;var bi=e[Ra];Ve[bi]=Y(Vi),Ra++}}function se(qe,Ve){var ka=he(qe.huffmanTableDC),br=ka===0?0:Y(ka)<<Q;Ve[0]=qe.pred+=br}function ge(qe,Ve){Ve[0]|=re()<<Q}var ke=0;function Re(qe,Ve){if(ke>0){ke--;return}for(var ka=b,br=O;ka<=br;){var Ra=he(qe.huffmanTableAC),Za=Ra&15,Vi=Ra>>4;if(Za===0){if(Vi<15){ke=H(Vi)+(1<<Vi)-1;break}ka+=16;continue}ka+=Vi;var wa=e[ka];Ve[wa]=Y(Za)*(1<<Q),ka++}}var me=0,pe;function Qe(qe,Ve){for(var ka=b,br=O,Ra=0;ka<=br;){var Za=e[ka],Vi=Ve[Za]<0?-1:1;switch(me){case 0:var wa=he(qe.huffmanTableAC),bi=wa&15,Ra=wa>>4;if(bi===0)Ra<15?(ke=H(Ra)+(1<<Ra),me=4):(Ra=16,me=1);else{if(bi!==1)throw new Error("invalid ACn encoding");pe=Y(bi),me=Ra?2:3}continue;case 1:case 2:Ve[Za]?Ve[Za]+=(re()<<Q)*Vi:(Ra--,Ra===0&&(me=me==2?3:0));break;case 3:Ve[Za]?Ve[Za]+=(re()<<Q)*Vi:(Ve[Za]=pe<<Q,me=0);break;case 4:Ve[Za]&&(Ve[Za]+=(re()<<Q)*Vi);break}ka++}me===4&&(ke--,ke===0&&(me=0))}function Be(qe,Ve,ka,br,Ra){var Za=ka/ae|0,Vi=ka%ae,wa=Za*qe.v+br,bi=Vi*qe.h+Ra;qe.blocks[wa]===void 0&&K.tolerantDecoding||Ve(qe,qe.blocks[wa][bi])}function Je(qe,Ve,ka){var br=ka/qe.blocksPerLine|0,Ra=ka%qe.blocksPerLine;qe.blocks[br]===void 0&&K.tolerantDecoding||Ve(qe,qe.blocks[br][Ra])}var td=y.length,Zd,te,Ze,fa,da,Ea;ue?b===0?Ea=L===0?se:ge:Ea=L===0?Re:Qe:Ea=ie;var Aa=0,fi,Ni;td==1?Ni=y[0].blocksPerLine*y[0].blocksPerColumn:Ni=ae*k.mcusPerColumn,q||(q=Ni);for(var Ar,nr;Aa<Ni;){for(te=0;te<td;te++)y[te].pred=0;if(ke=0,td==1)for(Zd=y[0],da=0;da<q;da++)Je(Zd,Ea,Aa),Aa++;else for(da=0;da<q;da++){for(te=0;te<td;te++)for(Zd=y[te],Ar=Zd.h,nr=Zd.v,Ze=0;Ze<nr;Ze++)for(fa=0;fa<Ar;fa++)Be(Zd,Ea,Aa,Ze,fa);if(Aa++,Aa===Ni)break}if(Aa===Ni)do{if(w[g]===255&&w[g+1]!==0)break;g+=1}while(g<w.length-2);if(Ae=0,fi=w[g]<<8|w[g+1],fi<65280)throw new Error("marker was not found");if(fi>=65488&&fi<=65495)g+=2;else break}return g-je}function f(w,g){var k=[],y=g.blocksPerLine,q=g.blocksPerColumn,b=y<<3,O=new Int32Array(64),L=new Uint8Array(64);function Q(je,ze,Ae){var re=g.quantizationTable,he,H,Y,ie,se,ge,ke,Re,me,pe=Ae,Qe;for(Qe=0;Qe<64;Qe++)pe[Qe]=je[Qe]*re[Qe];for(Qe=0;Qe<8;++Qe){var Be=8*Qe;if(pe[1+Be]==0&&pe[2+Be]==0&&pe[3+Be]==0&&pe[4+Be]==0&&pe[5+Be]==0&&pe[6+Be]==0&&pe[7+Be]==0){me=d*pe[0+Be]+512>>10,pe[0+Be]=me,pe[1+Be]=me,pe[2+Be]=me,pe[3+Be]=me,pe[4+Be]=me,pe[5+Be]=me,pe[6+Be]=me,pe[7+Be]=me;continue}he=d*pe[0+Be]+128>>8,H=d*pe[4+Be]+128>>8,Y=pe[2+Be],ie=pe[6+Be],se=l*(pe[1+Be]-pe[7+Be])+128>>8,Re=l*(pe[1+Be]+pe[7+Be])+128>>8,ge=pe[3+Be]<<4,ke=pe[5+Be]<<4,me=he-H+1>>1,he=he+H+1>>1,H=me,me=Y*o+ie*s+128>>8,Y=Y*s-ie*o+128>>8,ie=me,me=se-ke+1>>1,se=se+ke+1>>1,ke=me,me=Re+ge+1>>1,ge=Re-ge+1>>1,Re=me,me=he-ie+1>>1,he=he+ie+1>>1,ie=me,me=H-Y+1>>1,H=H+Y+1>>1,Y=me,me=se*n+Re*t+2048>>12,se=se*t-Re*n+2048>>12,Re=me,me=ge*r+ke*i+2048>>12,ge=ge*i-ke*r+2048>>12,ke=me,pe[0+Be]=he+Re,pe[7+Be]=he-Re,pe[1+Be]=H+ke,pe[6+Be]=H-ke,pe[2+Be]=Y+ge,pe[5+Be]=Y-ge,pe[3+Be]=ie+se,pe[4+Be]=ie-se}for(Qe=0;Qe<8;++Qe){var Je=Qe;if(pe[8+Je]==0&&pe[16+Je]==0&&pe[24+Je]==0&&pe[32+Je]==0&&pe[40+Je]==0&&pe[48+Je]==0&&pe[56+Je]==0){me=d*Ae[Qe+0]+8192>>14,pe[0+Je]=me,pe[8+Je]=me,pe[16+Je]=me,pe[24+Je]=me,pe[32+Je]=me,pe[40+Je]=me,pe[48+Je]=me,pe[56+Je]=me;continue}he=d*pe[0+Je]+2048>>12,H=d*pe[32+Je]+2048>>12,Y=pe[16+Je],ie=pe[48+Je],se=l*(pe[8+Je]-pe[56+Je])+2048>>12,Re=l*(pe[8+Je]+pe[56+Je])+2048>>12,ge=pe[24+Je],ke=pe[40+Je],me=he-H+1>>1,he=he+H+1>>1,H=me,me=Y*o+ie*s+2048>>12,Y=Y*s-ie*o+2048>>12,ie=me,me=se-ke+1>>1,se=se+ke+1>>1,ke=me,me=Re+ge+1>>1,ge=Re-ge+1>>1,Re=me,me=he-ie+1>>1,he=he+ie+1>>1,ie=me,me=H-Y+1>>1,H=H+Y+1>>1,Y=me,me=se*n+Re*t+2048>>12,se=se*t-Re*n+2048>>12,Re=me,me=ge*r+ke*i+2048>>12,ge=ge*i-ke*r+2048>>12,ke=me,pe[0+Je]=he+Re,pe[56+Je]=he-Re,pe[8+Je]=H+ke,pe[48+Je]=H-ke,pe[16+Je]=Y+ge,pe[40+Je]=Y-ge,pe[24+Je]=ie+se,pe[32+Je]=ie-se}for(Qe=0;Qe<64;++Qe){var td=128+(pe[Qe]+8>>4);ze[Qe]=td<0?0:td>255?255:td}}h(b*q*8);for(var K,$,X=0;X<q;X++){var oe=X<<3;for(K=0;K<8;K++)k.push(new Uint8Array(b));for(var ae=0;ae<y;ae++){Q(g.blocks[X][ae],L,O);var ue=0,de=ae<<3;for($=0;$<8;$++){var Te=k[oe+$];for(K=0;K<8;K++)Te[de+K]=L[ue++]}}}return k}function N(w){return w<0?0:w>255?255:w}m.prototype={load:function(g){var k=new XMLHttpRequest;k.open("GET",g,!0),k.responseType="arraybuffer",k.onload=(function(){var y=new Uint8Array(k.response||k.mozResponseArrayBuffer);this.parse(y),this.onload&&this.onload()}).bind(this),k.send(null)},parse:function(g){var k=this.opts.maxResolutionInMP*1e3*1e3,y=0,q=g.length;function b(){var wa=g[y]<<8|g[y+1];return y+=2,wa}function O(){var wa=b(),bi=g.subarray(y,y+wa-2);return y+=bi.length,bi}function L(wa){var bi=1,yn=1,_r,nd;for(nd in wa.components)wa.components.hasOwnProperty(nd)&&(_r=wa.components[nd],bi<_r.h&&(bi=_r.h),yn<_r.v&&(yn=_r.v));var fm=Math.ceil(wa.samplesPerLine/8/bi),Vp=Math.ceil(wa.scanLines/8/yn);for(nd in wa.components)if(wa.components.hasOwnProperty(nd)){_r=wa.components[nd];var fw=Math.ceil(Math.ceil(wa.samplesPerLine/8)*_r.h/bi),Nw=Math.ceil(Math.ceil(wa.scanLines/8)*_r.v/yn),Fj=fm*_r.h,zj=Vp*_r.v,Ix=zj*Fj,Kj=[];h(Ix*256);for(var Vj=0;Vj<zj;Vj++){for(var Wj=[],Gj=0;Gj<Fj;Gj++)Wj.push(new Int32Array(64));Kj.push(Wj)}_r.blocksPerLine=fw,_r.blocksPerColumn=Nw,_r.blocks=Kj}wa.maxH=bi,wa.maxV=yn,wa.mcusPerLine=fm,wa.mcusPerColumn=Vp}var Q=null,K=null,$=null,X,oe,ae=[],ue=[],de=[],Te=[],je=b(),ze=-1;if(this.comments=[],je!=65496)throw new Error("SOI not found");for(je=b();je!=65497;){var Ae,re,he;switch(je){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var H=O();if(je===65534){var Y=String.fromCharCode.apply(null,H);this.comments.push(Y)}je===65504&&H[0]===74&&H[1]===70&&H[2]===73&&H[3]===70&&H[4]===0&&(Q={version:{major:H[5],minor:H[6]},densityUnits:H[7],xDensity:H[8]<<8|H[9],yDensity:H[10]<<8|H[11],thumbWidth:H[12],thumbHeight:H[13],thumbData:H.subarray(14,14+3*H[12]*H[13])}),je===65505&&H[0]===69&&H[1]===120&&H[2]===105&&H[3]===102&&H[4]===0&&(this.exifBuffer=H.subarray(5,H.length)),je===65518&&H[0]===65&&H[1]===100&&H[2]===111&&H[3]===98&&H[4]===101&&H[5]===0&&(K={version:H[6],flags0:H[7]<<8|H[8],flags1:H[9]<<8|H[10],transformCode:H[11]});break;case 65499:for(var ie=b(),se=ie+y-2;y<se;){var ge=g[y++];h(256);var ke=new Int32Array(64);if(ge>>4===0)for(re=0;re<64;re++){var Re=e[re];ke[Re]=g[y++]}else if(ge>>4===1)for(re=0;re<64;re++){var Re=e[re];ke[Re]=b()}else throw new Error("DQT: invalid table spec");ae[ge&15]=ke}break;case 65472:case 65473:case 65474:b(),X={},X.extended=je===65473,X.progressive=je===65474,X.precision=g[y++],X.scanLines=b(),X.samplesPerLine=b(),X.components={},X.componentsOrder=[];var me=X.scanLines*X.samplesPerLine;if(me>k){var pe=Math.ceil((me-k)/1e6);throw new Error(`maxResolutionInMP limit exceeded by ${pe}MP`)}var Qe=g[y++],Be,Je=0,td=0;for(Ae=0;Ae<Qe;Ae++){Be=g[y];var Zd=g[y+1]>>4,te=g[y+1]&15,Ze=g[y+2];if(Zd<=0||te<=0)throw new Error("Invalid sampling factor, expected values above 0");X.componentsOrder.push(Be),X.components[Be]={h:Zd,v:te,quantizationIdx:Ze},y+=3}L(X),ue.push(X);break;case 65476:var fa=b();for(Ae=2;Ae<fa;){var da=g[y++],Ea=new Uint8Array(16),Aa=0;for(re=0;re<16;re++,y++)Aa+=Ea[re]=g[y];h(16+Aa);var fi=new Uint8Array(Aa);for(re=0;re<Aa;re++,y++)fi[re]=g[y];Ae+=17+Aa,(da>>4===0?Te:de)[da&15]=c(Ea,fi)}break;case 65501:b(),oe=b();break;case 65500:b(),b();break;case 65498:var Ni=b(),Ar=g[y++],nr=[],qe;for(Ae=0;Ae<Ar;Ae++){qe=X.components[g[y++]];var Ve=g[y++];qe.huffmanTableDC=Te[Ve>>4],qe.huffmanTableAC=de[Ve&15],nr.push(qe)}var ka=g[y++],br=g[y++],Ra=g[y++],Za=u(g,y,X,nr,oe,ka,br,Ra>>4,Ra&15,this.opts);y+=Za;break;case 65535:g[y]!==255&&y--;break;default:if(g[y-3]==255&&g[y-2]>=192&&g[y-2]<=254){y-=3;break}else if(je===224||je==225){if(ze!==-1)throw new Error(`first unknown JPEG marker at offset ${ze.toString(16)}, second unknown JPEG marker ${je.toString(16)} at offset ${(y-1).toString(16)}`);ze=y-1;let wa=b();if(g[y+wa-2]===255){y+=wa-2;break}}throw new Error("unknown JPEG marker "+je.toString(16))}je=b()}if(ue.length!=1)throw new Error("only single frame JPEGs supported");for(var Ae=0;Ae<ue.length;Ae++){var Vi=ue[Ae].components;for(var re in Vi)Vi[re].quantizationTable=ae[Vi[re].quantizationIdx],delete Vi[re].quantizationIdx}this.width=X.samplesPerLine,this.height=X.scanLines,this.jfif=Q,this.adobe=K,this.components=[];for(var Ae=0;Ae<X.componentsOrder.length;Ae++){var qe=X.components[X.componentsOrder[Ae]];this.components.push({lines:f(X,qe),scaleX:qe.h/X.maxH,scaleY:qe.v/X.maxV})}},getData:function(g,k){var y=this.width/g,q=this.height/k,b,O,L,Q,K,$,X,oe,ae,ue,de=0,Te,je,ze,Ae,re,he,H,Y,ie,se,ge,ke=g*k*this.components.length;h(ke);var Re=new Uint8Array(ke);switch(this.components.length){case 1:for(b=this.components[0],ue=0;ue<k;ue++)for(K=b.lines[0|ue*b.scaleY*q],ae=0;ae<g;ae++)Te=K[0|ae*b.scaleX*y],Re[de++]=Te;break;case 2:for(b=this.components[0],O=this.components[1],ue=0;ue<k;ue++)for(K=b.lines[0|ue*b.scaleY*q],$=O.lines[0|ue*O.scaleY*q],ae=0;ae<g;ae++)Te=K[0|ae*b.scaleX*y],Re[de++]=Te,Te=$[0|ae*O.scaleX*y],Re[de++]=Te;break;case 3:for(ge=!0,this.adobe&&this.adobe.transformCode?ge=!0:typeof this.opts.colorTransform<"u"&&(ge=!!this.opts.colorTransform),b=this.components[0],O=this.components[1],L=this.components[2],ue=0;ue<k;ue++)for(K=b.lines[0|ue*b.scaleY*q],$=O.lines[0|ue*O.scaleY*q],X=L.lines[0|ue*L.scaleY*q],ae=0;ae<g;ae++)ge?(Te=K[0|ae*b.scaleX*y],je=$[0|ae*O.scaleX*y],ze=X[0|ae*L.scaleX*y],Y=N(Te+1.402*(ze-128)),ie=N(Te-.3441363*(je-128)-.71413636*(ze-128)),se=N(Te+1.772*(je-128))):(Y=K[0|ae*b.scaleX*y],ie=$[0|ae*O.scaleX*y],se=X[0|ae*L.scaleX*y]),Re[de++]=Y,Re[de++]=ie,Re[de++]=se;break;case 4:if(!this.adobe)throw new Error("Unsupported color mode (4 components)");for(ge=!1,this.adobe&&this.adobe.transformCode?ge=!0:typeof this.opts.colorTransform<"u"&&(ge=!!this.opts.colorTransform),b=this.components[0],O=this.components[1],L=this.components[2],Q=this.components[3],ue=0;ue<k;ue++)for(K=b.lines[0|ue*b.scaleY*q],$=O.lines[0|ue*O.scaleY*q],X=L.lines[0|ue*L.scaleY*q],oe=Q.lines[0|ue*Q.scaleY*q],ae=0;ae<g;ae++)ge?(Te=K[0|ae*b.scaleX*y],je=$[0|ae*O.scaleX*y],ze=X[0|ae*L.scaleX*y],Ae=oe[0|ae*Q.scaleX*y],re=255-N(Te+1.402*(ze-128)),he=255-N(Te-.3441363*(je-128)-.71413636*(ze-128)),H=255-N(Te+1.772*(je-128))):(re=K[0|ae*b.scaleX*y],he=$[0|ae*O.scaleX*y],H=X[0|ae*L.scaleX*y],Ae=oe[0|ae*Q.scaleX*y]),Re[de++]=255-re,Re[de++]=255-he,Re[de++]=255-H,Re[de++]=255-Ae;break;default:throw new Error("Unsupported color mode")}return Re},copyToImageData:function(g,k){var y=g.width,q=g.height,b=g.data,O=this.getData(y,q),L=0,Q=0,K,$,X,oe,ae,ue,de,Te,je;switch(this.components.length){case 1:for($=0;$<q;$++)for(K=0;K<y;K++)X=O[L++],b[Q++]=X,b[Q++]=X,b[Q++]=X,k&&(b[Q++]=255);break;case 3:for($=0;$<q;$++)for(K=0;K<y;K++)de=O[L++],Te=O[L++],je=O[L++],b[Q++]=de,b[Q++]=Te,b[Q++]=je,k&&(b[Q++]=255);break;case 4:for($=0;$<q;$++)for(K=0;K<y;K++)ae=O[L++],ue=O[L++],X=O[L++],oe=O[L++],de=255-N(ae*(1-oe/255)+oe),Te=255-N(ue*(1-oe/255)+oe),je=255-N(X*(1-oe/255)+oe),b[Q++]=de,b[Q++]=Te,b[Q++]=je,k&&(b[Q++]=255);break;default:throw new Error("Unsupported color mode")}}};var _=0,v=0;function h(w=0){var g=_+w;if(g>v){var k=Math.ceil((g-v)/1024/1024);throw new Error(`maxMemoryUsageInMB limit exceeded by at least ${k}MB`)}_=g}return m.resetMaxMemoryUsage=function(w){_=0,v=w},m.getBytesAllocated=function(){return _},m.requestMemoryAllocation=h,m})();typeof vJ<"u"?vJ.exports=dCe:typeof window<"u"&&(window["jpeg-js"]=window["jpeg-js"]||{},window["jpeg-js"].decode=dCe);function dCe(a,e={}){var i={colorTransform:void 0,useTArray:!1,formatAsRGBA:!0,tolerantDecoding:!0,maxResolutionInMP:100,maxMemoryUsageInMB:512},r={...i,...e},t=new Uint8Array(a),n=new hJ;n.opts=r,hJ.resetMaxMemoryUsage(r.maxMemoryUsageInMB*1024*1024),n.parse(t);var s=r.formatAsRGBA?4:3,o=n.width*n.height*s;try{hJ.requestMemoryAllocation(o);var d={width:n.width,height:n.height,exifBuffer:n.exifBuffer,data:r.useTArray?new Uint8Array(o):Buffer.alloc(o)};n.comments.length>0&&(d.comments=n.comments)}catch(l){throw l instanceof RangeError?new Error("Could not allocate enough memory for the image. Required: "+o):l instanceof ReferenceError&&l.message==="Buffer is not defined"?new Error("Buffer is not globally defined in this environment. Consider setting useTArray to true"):l}return n.copyToImageData(d,r.formatAsRGBA),d}});var wJ=Ie((rhr,mCe)=>{var lPa=oCe(),mPa=lCe();mCe.exports={encode:lPa,decode:mPa}});var hLe=Ie((iCr,_Le)=>{function pLe(a){this.buffer=a.data,this.width=a.width,this.height=a.height,this.extraBytes=this.width%4,this.rgbSize=this.height*(3*this.width+this.extraBytes),this.headerInfoSize=40,this.data=[],this.flag="BM",this.reserved=0,this.offset=54,this.fileSize=this.rgbSize+this.offset,this.planes=1,this.bitPP=24,this.compress=0,this.hr=0,this.vr=0,this.colors=0,this.importantColors=0}pLe.prototype.encode=function(){var a=new Buffer(this.offset+this.rgbSize);this.pos=0,a.write(this.flag,this.pos,2),this.pos+=2,a.writeUInt32LE(this.fileSize,this.pos),this.pos+=4,a.writeUInt32LE(this.reserved,this.pos),this.pos+=4,a.writeUInt32LE(this.offset,this.pos),this.pos+=4,a.writeUInt32LE(this.headerInfoSize,this.pos),this.pos+=4,a.writeUInt32LE(this.width,this.pos),this.pos+=4,a.writeInt32LE(-this.height,this.pos),this.pos+=4,a.writeUInt16LE(this.planes,this.pos),this.pos+=2,a.writeUInt16LE(this.bitPP,this.pos),this.pos+=2,a.writeUInt32LE(this.compress,this.pos),this.pos+=4,a.writeUInt32LE(this.rgbSize,this.pos),this.pos+=4,a.writeUInt32LE(this.hr,this.pos),this.pos+=4,a.writeUInt32LE(this.vr,this.pos),this.pos+=4,a.writeUInt32LE(this.colors,this.pos),this.pos+=4,a.writeUInt32LE(this.importantColors,this.pos),this.pos+=4;for(var e=0,i=3*this.width+this.extraBytes,r=0;r<this.height;r++){for(var t=0;t<this.width;t++){var n=this.pos+r*i+t*3;e++,a[n]=this.buffer[e++],a[n+1]=this.buffer[e++],a[n+2]=this.buffer[e++]}if(this.extraBytes>0){var s=this.pos+r*i+this.width*3;a.fill(0,s,s+this.extraBytes)}}return a};_Le.exports=function(a,e){typeof e>"u"&&(e=100);var i=new pLe(a),r=i.encode();return{data:r,width:a.width,height:a.height}}});var wLe=Ie((rCr,vLe)=>{function Cl(a,e){if(this.pos=0,this.buffer=a,this.is_with_alpha=!!e,this.bottom_up=!0,this.flag=this.buffer.toString("utf-8",0,this.pos+=2),this.flag!="BM")throw new Error("Invalid BMP File");this.parseHeader(),this.parseRGBA()}Cl.prototype.parseHeader=function(){if(this.fileSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.reserved=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.offset=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.headerSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.width=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.height=this.buffer.readInt32LE(this.pos),this.pos+=4,this.planes=this.buffer.readUInt16LE(this.pos),this.pos+=2,this.bitPP=this.buffer.readUInt16LE(this.pos),this.pos+=2,this.compress=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.rawSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.hr=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.vr=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.colors=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.importantColors=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var a=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(a);for(var e=0;e<a;e++){var i=this.buffer.readUInt8(this.pos++),r=this.buffer.readUInt8(this.pos++),t=this.buffer.readUInt8(this.pos++),n=this.buffer.readUInt8(this.pos++);this.palette[e]={red:t,green:r,blue:i,quad:n}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)};Cl.prototype.parseRGBA=function(){var a="bit"+this.bitPP,e=this.width*this.height*4;this.data=new Buffer(e),this[a]()};Cl.prototype.bit1=function(){for(var a=Math.ceil(this.width/8),e=a%4,i=this.height>=0?this.height-1:-this.height,i=this.height-1;i>=0;i--){for(var r=this.bottom_up?i:this.height-1-i,t=0;t<a;t++)for(var n=this.buffer.readUInt8(this.pos++),s=r*this.width*4+t*8*4,o=0;o<8&&t*8+o<this.width;o++){var d=this.palette[n>>7-o&1];this.data[s+o*4]=0,this.data[s+o*4+1]=d.blue,this.data[s+o*4+2]=d.green,this.data[s+o*4+3]=d.red}e!=0&&(this.pos+=4-e)}};Cl.prototype.bit4=function(){if(this.compress==2){let v=function(h){var w=this.palette[h];this.data[a]=0,this.data[a+1]=w.blue,this.data[a+2]=w.green,this.data[a+3]=w.red,a+=4};var _=v;this.data.fill(255);for(var a=0,e=this.bottom_up?this.height-1:0,i=!1;a<this.data.length;){var r=this.buffer.readUInt8(this.pos++),t=this.buffer.readUInt8(this.pos++);if(r==0)if(t==0){this.bottom_up?e--:e++,a=e*this.width*4,i=!1;continue}else{if(t==1)break;if(t==2){var n=this.buffer.readUInt8(this.pos++),s=this.buffer.readUInt8(this.pos++);this.bottom_up?e-=s:e+=s,a+=s*this.width*4+n*4}else{for(var o=this.buffer.readUInt8(this.pos++),d=0;d<t;d++)i?v.call(this,o&15):v.call(this,(o&240)>>4),d&1&&d+1<t&&(o=this.buffer.readUInt8(this.pos++)),i=!i;(t+1>>1&1)==1&&this.pos++}}else for(var d=0;d<r;d++)i?v.call(this,t&15):v.call(this,(t&240)>>4),i=!i}}else for(var l=Math.ceil(this.width/2),m=l%4,s=this.height-1;s>=0;s--){for(var c=this.bottom_up?s:this.height-1-s,n=0;n<l;n++){var t=this.buffer.readUInt8(this.pos++),a=c*this.width*4+n*2*4,u=t>>4,f=t&15,N=this.palette[u];if(this.data[a]=0,this.data[a+1]=N.blue,this.data[a+2]=N.green,this.data[a+3]=N.red,n*2+1>=this.width)break;N=this.palette[f],this.data[a+4]=0,this.data[a+4+1]=N.blue,this.data[a+4+2]=N.green,this.data[a+4+3]=N.red}m!=0&&(this.pos+=4-m)}};Cl.prototype.bit8=function(){if(this.compress==1){let u=function(f){var N=this.palette[f];this.data[a]=0,this.data[a+1]=N.blue,this.data[a+2]=N.green,this.data[a+3]=N.red,a+=4};var c=u;this.data.fill(255);for(var a=0,e=this.bottom_up?this.height-1:0;a<this.data.length;){var i=this.buffer.readUInt8(this.pos++),r=this.buffer.readUInt8(this.pos++);if(i==0)if(r==0){this.bottom_up?e--:e++,a=e*this.width*4;continue}else{if(r==1)break;if(r==2){var t=this.buffer.readUInt8(this.pos++),n=this.buffer.readUInt8(this.pos++);this.bottom_up?e-=n:e+=n,a+=n*this.width*4+t*4}else{for(var s=0;s<r;s++){var o=this.buffer.readUInt8(this.pos++);u.call(this,o)}r&!0&&this.pos++}}else for(var s=0;s<i;s++)u.call(this,r)}}else for(var d=this.width%4,n=this.height-1;n>=0;n--){for(var l=this.bottom_up?n:this.height-1-n,t=0;t<this.width;t++){var r=this.buffer.readUInt8(this.pos++),a=l*this.width*4+t*4;if(r<this.palette.length){var m=this.palette[r];this.data[a]=0,this.data[a+1]=m.blue,this.data[a+2]=m.green,this.data[a+3]=m.red}else this.data[a]=0,this.data[a+1]=255,this.data[a+2]=255,this.data[a+3]=255}d!=0&&(this.pos+=4-d)}};Cl.prototype.bit15=function(){for(var a=this.width%3,e=parseInt("11111",2),i=e,r=this.height-1;r>=0;r--){for(var t=this.bottom_up?r:this.height-1-r,n=0;n<this.width;n++){var s=this.buffer.readUInt16LE(this.pos);this.pos+=2;var o=(s&i)/i*255|0,d=(s>>5&i)/i*255|0,l=(s>>10&i)/i*255|0,m=s>>15?255:0,c=t*this.width*4+n*4;this.data[c]=m,this.data[c+1]=o,this.data[c+2]=d,this.data[c+3]=l}this.pos+=a}};Cl.prototype.bit16=function(){var a=this.width%2*2;this.maskRed=31744,this.maskGreen=992,this.maskBlue=31,this.mask0=0,this.compress==3&&(this.maskRed=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.maskGreen=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.maskBlue=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.mask0=this.buffer.readUInt32LE(this.pos),this.pos+=4);for(var e=[0,0,0],i=0;i<16;i++)this.maskRed>>i&1&&e[0]++,this.maskGreen>>i&1&&e[1]++,this.maskBlue>>i&1&&e[2]++;e[1]+=e[0],e[2]+=e[1],e[0]=8-e[0],e[1]-=8,e[2]-=8;for(var r=this.height-1;r>=0;r--){for(var t=this.bottom_up?r:this.height-1-r,n=0;n<this.width;n++){var s=this.buffer.readUInt16LE(this.pos);this.pos+=2;var o=(s&this.maskBlue)<<e[0],d=(s&this.maskGreen)>>e[1],l=(s&this.maskRed)>>e[2],m=t*this.width*4+n*4;this.data[m]=0,this.data[m+1]=o,this.data[m+2]=d,this.data[m+3]=l}this.pos+=a}};Cl.prototype.bit24=function(){for(var a=this.height-1;a>=0;a--){for(var e=this.bottom_up?a:this.height-1-a,i=0;i<this.width;i++){var r=this.buffer.readUInt8(this.pos++),t=this.buffer.readUInt8(this.pos++),n=this.buffer.readUInt8(this.pos++),s=e*this.width*4+i*4;this.data[s]=0,this.data[s+1]=r,this.data[s+2]=t,this.data[s+3]=n}this.pos+=this.width%4}};Cl.prototype.bit32=function(){if(this.compress==3){this.maskRed=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.maskGreen=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.maskBlue=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.mask0=this.buffer.readUInt32LE(this.pos),this.pos+=4;for(var a=this.height-1;a>=0;a--)for(var e=this.bottom_up?a:this.height-1-a,i=0;i<this.width;i++){var r=this.buffer.readUInt8(this.pos++),t=this.buffer.readUInt8(this.pos++),n=this.buffer.readUInt8(this.pos++),s=this.buffer.readUInt8(this.pos++),o=e*this.width*4+i*4;this.data[o]=r,this.data[o+1]=t,this.data[o+2]=n,this.data[o+3]=s}}else for(var a=this.height-1;a>=0;a--)for(var e=this.bottom_up?a:this.height-1-a,i=0;i<this.width;i++){var t=this.buffer.readUInt8(this.pos++),n=this.buffer.readUInt8(this.pos++),s=this.buffer.readUInt8(this.pos++),r=this.buffer.readUInt8(this.pos++),o=e*this.width*4+i*4;this.data[o]=r,this.data[o+1]=t,this.data[o+2]=n,this.data[o+3]=s}};Cl.prototype.getData=function(){return this.data};vLe.exports=function(a){var e=new Cl(a);return e}});var yLe=Ie((tCr,gLe)=>{var kWa=hLe(),qWa=wLe();gLe.exports={encode:kWa,decode:qWa}});var Yae=Ie((j$r,OVe)=>{OVe.exports=Wi("stream")});var wC=Ie((Zae,UVe)=>{var kz=Wi("buffer"),hu=kz.Buffer;function BVe(a,e){for(var i in a)e[i]=a[i]}hu.from&&hu.alloc&&hu.allocUnsafe&&hu.allocUnsafeSlow?UVe.exports=kz:(BVe(kz,Zae),Zae.Buffer=yk);function yk(a,e,i){return hu(a,e,i)}BVe(hu,yk);yk.from=function(a,e,i){if(typeof a=="number")throw new TypeError("Argument must not be a number");return hu(a,e,i)};yk.alloc=function(a,e,i){if(typeof a!="number")throw new TypeError("Argument must be a number");var r=hu(a);return e!==void 0?typeof i=="string"?r.fill(e,i):r.fill(e):r.fill(0),r};yk.allocUnsafe=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return hu(a)};yk.allocUnsafeSlow=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return kz.SlowBuffer(a)}});var zVe=Ie((b$r,eie)=>{"use strict";function nZa(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}var FVe=wC().Buffer,gC=Wi("util");function sZa(a,e,i){a.copy(e,i)}eie.exports=(function(){function a(){nZa(this,a),this.head=null,this.tail=null,this.length=0}return a.prototype.push=function(i){var r={data:i,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length},a.prototype.unshift=function(i){var r={data:i,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length},a.prototype.shift=function(){if(this.length!==0){var i=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,i}},a.prototype.clear=function(){this.head=this.tail=null,this.length=0},a.prototype.join=function(i){if(this.length===0)return"";for(var r=this.head,t=""+r.data;r=r.next;)t+=i+r.data;return t},a.prototype.concat=function(i){if(this.length===0)return FVe.alloc(0);for(var r=FVe.allocUnsafe(i>>>0),t=this.head,n=0;t;)sZa(t.data,r,n),n+=t.data.length,t=t.next;return r},a})();gC&&gC.inspect&&gC.inspect.custom&&(eie.exports.prototype[gC.inspect.custom]=function(){var a=gC.inspect({length:this.length});return this.constructor.name+" "+a})});var aie=Ie((I$r,KVe)=>{"use strict";var qz=wM();function oZa(a,e){var i=this,r=this._readableState&&this._readableState.destroyed,t=this._writableState&&this._writableState.destroyed;return r||t?(e?e(a):a&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,qz.nextTick(jz,this,a)):qz.nextTick(jz,this,a)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(a||null,function(n){!e&&n?i._writableState?i._writableState.errorEmitted||(i._writableState.errorEmitted=!0,qz.nextTick(jz,i,n)):qz.nextTick(jz,i,n):e&&e(n)}),this)}function dZa(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function jz(a,e){a.emit("error",e)}KVe.exports={destroy:oZa,undestroy:dZa}});var rie=Ie((S$r,JVe)=>{"use strict";var $h=wM();JVe.exports=gt;function WVe(a){var e=this;this.next=null,this.entry=null,this.finish=function(){IZa(e,a)}}var lZa=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:$h.nextTick,kk;gt.WritableState=kC;var GVe=Object.create(_b());GVe.inherits=hb();var mZa={deprecate:xha()},$Ve=Yae(),Iz=wC().Buffer,cZa=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function uZa(a){return Iz.from(a)}function fZa(a){return Iz.isBuffer(a)||a instanceof cZa}var HVe=aie();GVe.inherits(gt,$Ve);function NZa(){}function kC(a,e){kk=kk||Hh(),a=a||{};var i=e instanceof kk;this.objectMode=!!a.objectMode,i&&(this.objectMode=this.objectMode||!!a.writableObjectMode);var r=a.highWaterMark,t=a.writableHighWaterMark,n=this.objectMode?16:16*1024;r||r===0?this.highWaterMark=r:i&&(t||t===0)?this.highWaterMark=t:this.highWaterMark=n,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=a.decodeStrings===!1;this.decodeStrings=!s,this.defaultEncoding=a.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(o){yZa(e,o)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new WVe(this)}kC.prototype.getBuffer=function(){for(var e=this.bufferedRequest,i=[];e;)i.push(e),e=e.next;return i};(function(){try{Object.defineProperty(kC.prototype,"buffer",{get:mZa.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var bz;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(bz=Function.prototype[Symbol.hasInstance],Object.defineProperty(gt,Symbol.hasInstance,{value:function(a){return bz.call(this,a)?!0:this!==gt?!1:a&&a._writableState instanceof kC}})):bz=function(a){return a instanceof this};function gt(a){if(kk=kk||Hh(),!bz.call(gt,this)&&!(this instanceof kk))return new gt(a);this._writableState=new kC(a,this),this.writable=!0,a&&(typeof a.write=="function"&&(this._write=a.write),typeof a.writev=="function"&&(this._writev=a.writev),typeof a.destroy=="function"&&(this._destroy=a.destroy),typeof a.final=="function"&&(this._final=a.final)),$Ve.call(this)}gt.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function pZa(a,e){var i=new Error("write after end");a.emit("error",i),$h.nextTick(e,i)}function _Za(a,e,i,r){var t=!0,n=!1;return i===null?n=new TypeError("May not write null values to stream"):typeof i!="string"&&i!==void 0&&!e.objectMode&&(n=new TypeError("Invalid non-string/buffer chunk")),n&&(a.emit("error",n),$h.nextTick(r,n),t=!1),t}gt.prototype.write=function(a,e,i){var r=this._writableState,t=!1,n=!r.objectMode&&fZa(a);return n&&!Iz.isBuffer(a)&&(a=uZa(a)),typeof e=="function"&&(i=e,e=null),n?e="buffer":e||(e=r.defaultEncoding),typeof i!="function"&&(i=NZa),r.ended?pZa(this,i):(n||_Za(this,r,a,i))&&(r.pendingcb++,t=vZa(this,r,n,a,e,i)),t};gt.prototype.cork=function(){var a=this._writableState;a.corked++};gt.prototype.uncork=function(){var a=this._writableState;a.corked&&(a.corked--,!a.writing&&!a.corked&&!a.bufferProcessing&&a.bufferedRequest&&XVe(this,a))};gt.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this};function hZa(a,e,i){return!a.objectMode&&a.decodeStrings!==!1&&typeof e=="string"&&(e=Iz.from(e,i)),e}Object.defineProperty(gt.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function vZa(a,e,i,r,t,n){if(!i){var s=hZa(e,r,t);r!==s&&(i=!0,t="buffer",r=s)}var o=e.objectMode?1:r.length;e.length+=o;var d=e.length<e.highWaterMark;if(d||(e.needDrain=!0),e.writing||e.corked){var l=e.lastBufferedRequest;e.lastBufferedRequest={chunk:r,encoding:t,isBuf:i,callback:n,next:null},l?l.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else iie(a,e,!1,o,r,t,n);return d}function iie(a,e,i,r,t,n,s){e.writelen=r,e.writecb=s,e.writing=!0,e.sync=!0,i?a._writev(t,e.onwrite):a._write(t,n,e.onwrite),e.sync=!1}function wZa(a,e,i,r,t){--e.pendingcb,i?($h.nextTick(t,r),$h.nextTick(yC,a,e),a._writableState.errorEmitted=!0,a.emit("error",r)):(t(r),a._writableState.errorEmitted=!0,a.emit("error",r),yC(a,e))}function gZa(a){a.writing=!1,a.writecb=null,a.length-=a.writelen,a.writelen=0}function yZa(a,e){var i=a._writableState,r=i.sync,t=i.writecb;if(gZa(i),e)wZa(a,i,r,e,t);else{var n=QVe(i);!n&&!i.corked&&!i.bufferProcessing&&i.bufferedRequest&&XVe(a,i),r?lZa(VVe,a,i,n,t):VVe(a,i,n,t)}}function VVe(a,e,i,r){i||kZa(a,e),e.pendingcb--,r(),yC(a,e)}function kZa(a,e){e.length===0&&e.needDrain&&(e.needDrain=!1,a.emit("drain"))}function XVe(a,e){e.bufferProcessing=!0;var i=e.bufferedRequest;if(a._writev&&i&&i.next){var r=e.bufferedRequestCount,t=new Array(r),n=e.corkedRequestsFree;n.entry=i;for(var s=0,o=!0;i;)t[s]=i,i.isBuf||(o=!1),i=i.next,s+=1;t.allBuffers=o,iie(a,e,!0,e.length,t,"",n.finish),e.pendingcb++,e.lastBufferedRequest=null,n.next?(e.corkedRequestsFree=n.next,n.next=null):e.corkedRequestsFree=new WVe(e),e.bufferedRequestCount=0}else{for(;i;){var d=i.chunk,l=i.encoding,m=i.callback,c=e.objectMode?1:d.length;if(iie(a,e,!1,c,d,l,m),i=i.next,e.bufferedRequestCount--,e.writing)break}i===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=i,e.bufferProcessing=!1}gt.prototype._write=function(a,e,i){i(new Error("_write() is not implemented"))};gt.prototype._writev=null;gt.prototype.end=function(a,e,i){var r=this._writableState;typeof a=="function"?(i=a,a=null,e=null):typeof e=="function"&&(i=e,e=null),a!=null&&this.write(a,e),r.corked&&(r.corked=1,this.uncork()),r.ending||bZa(this,r,i)};function QVe(a){return a.ending&&a.length===0&&a.bufferedRequest===null&&!a.finished&&!a.writing}function qZa(a,e){a._final(function(i){e.pendingcb--,i&&a.emit("error",i),e.prefinished=!0,a.emit("prefinish"),yC(a,e)})}function jZa(a,e){!e.prefinished&&!e.finalCalled&&(typeof a._final=="function"?(e.pendingcb++,e.finalCalled=!0,$h.nextTick(qZa,a,e)):(e.prefinished=!0,a.emit("prefinish")))}function yC(a,e){var i=QVe(e);return i&&(jZa(a,e),e.pendingcb===0&&(e.finished=!0,a.emit("finish"))),i}function bZa(a,e,i){e.ending=!0,yC(a,e),i&&(e.finished?$h.nextTick(i):a.once("finish",i)),e.ended=!0,a.writable=!1}function IZa(a,e,i){var r=a.entry;for(a.entry=null;r;){var t=r.callback;e.pendingcb--,t(i),r=r.next}e.corkedRequestsFree.next=a}Object.defineProperty(gt.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(a){this._writableState&&(this._writableState.destroyed=a)}});gt.prototype.destroy=HVe.destroy;gt.prototype._undestroy=HVe.undestroy;gt.prototype._destroy=function(a,e){this.end(),e(a)}});var Hh=Ie((T$r,aWe)=>{"use strict";var YVe=wM(),SZa=Object.keys||function(a){var e=[];for(var i in a)e.push(i);return e};aWe.exports=vu;var ZVe=Object.create(_b());ZVe.inherits=hb();var eWe=sie(),nie=rie();ZVe.inherits(vu,eWe);for(tie=SZa(nie.prototype),Sz=0;Sz<tie.length;Sz++)Tz=tie[Sz],vu.prototype[Tz]||(vu.prototype[Tz]=nie.prototype[Tz]);var tie,Tz,Sz;function vu(a){if(!(this instanceof vu))return new vu(a);eWe.call(this,a),nie.call(this,a),a&&a.readable===!1&&(this.readable=!1),a&&a.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,a&&a.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",TZa)}Object.defineProperty(vu.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function TZa(){this.allowHalfOpen||this._writableState.ended||YVe.nextTick(EZa,this)}function EZa(a){a.end()}Object.defineProperty(vu.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(a){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=a,this._writableState.destroyed=a)}});vu.prototype._destroy=function(a,e){this.push(null),this.end(),YVe.nextTick(e,a)}});var lie=Ie(rWe=>{"use strict";var die=wC().Buffer,iWe=die.isEncoding||function(a){switch(a=""+a,a&&a.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 CZa(a){if(!a)return"utf8";for(var e;;)switch(a){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 a;default:if(e)return;a=(""+a).toLowerCase(),e=!0}}function AZa(a){var e=CZa(a);if(typeof e!="string"&&(die.isEncoding===iWe||!iWe(a)))throw new Error("Unknown encoding: "+a);return e||a}rWe.StringDecoder=qC;function qC(a){this.encoding=AZa(a);var e;switch(this.encoding){case"utf16le":this.text=LZa,this.end=OZa,e=4;break;case"utf8":this.fillLast=xZa,e=4;break;case"base64":this.text=BZa,this.end=UZa,e=3;break;default:this.write=FZa,this.end=zZa;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=die.allocUnsafe(e)}qC.prototype.write=function(a){if(a.length===0)return"";var e,i;if(this.lastNeed){if(e=this.fillLast(a),e===void 0)return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<a.length?e?e+this.text(a,i):this.text(a,i):e||""};qC.prototype.end=PZa;qC.prototype.text=MZa;qC.prototype.fillLast=function(a){if(this.lastNeed<=a.length)return a.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);a.copy(this.lastChar,this.lastTotal-this.lastNeed,0,a.length),this.lastNeed-=a.length};function oie(a){return a<=127?0:a>>5===6?2:a>>4===14?3:a>>3===30?4:a>>6===2?-1:-2}function RZa(a,e,i){var r=e.length-1;if(r<i)return 0;var t=oie(e[r]);return t>=0?(t>0&&(a.lastNeed=t-1),t):--r<i||t===-2?0:(t=oie(e[r]),t>=0?(t>0&&(a.lastNeed=t-2),t):--r<i||t===-2?0:(t=oie(e[r]),t>=0?(t>0&&(t===2?t=0:a.lastNeed=t-3),t):0))}function DZa(a,e,i){if((e[0]&192)!==128)return a.lastNeed=0,"\uFFFD";if(a.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return a.lastNeed=1,"\uFFFD";if(a.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return a.lastNeed=2,"\uFFFD"}}function xZa(a){var e=this.lastTotal-this.lastNeed,i=DZa(this,a,e);if(i!==void 0)return i;if(this.lastNeed<=a.length)return a.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);a.copy(this.lastChar,e,0,a.length),this.lastNeed-=a.length}function MZa(a,e){var i=RZa(this,a,e);if(!this.lastNeed)return a.toString("utf8",e);this.lastTotal=i;var r=a.length-(i-this.lastNeed);return a.copy(this.lastChar,0,r),a.toString("utf8",e,r)}function PZa(a){var e=a&&a.length?this.write(a):"";return this.lastNeed?e+"\uFFFD":e}function LZa(a,e){if((a.length-e)%2===0){var i=a.toString("utf16le",e);if(i){var r=i.charCodeAt(i.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=a[a.length-2],this.lastChar[1]=a[a.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=a[a.length-1],a.toString("utf16le",e,a.length-1)}function OZa(a){var e=a&&a.length?this.write(a):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,i)}return e}function BZa(a,e){var i=(a.length-e)%3;return i===0?a.toString("base64",e):(this.lastNeed=3-i,this.lastTotal=3,i===1?this.lastChar[0]=a[a.length-1]:(this.lastChar[0]=a[a.length-2],this.lastChar[1]=a[a.length-1]),a.toString("base64",e,a.length-i))}function UZa(a){var e=a&&a.length?this.write(a):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function FZa(a){return a.toString(this.encoding)}function zZa(a){return a&&a.length?this.write(a):""}});var sie=Ie((A$r,pWe)=>{"use strict";var jk=wM();pWe.exports=gr;var KZa=Dha(),jC;gr.ReadableState=mWe;var C$r=Wi("events").EventEmitter,oWe=function(a,e){return a.listeners(e).length},Nie=Yae(),bC=wC().Buffer,VZa=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function WZa(a){return bC.from(a)}function GZa(a){return bC.isBuffer(a)||a instanceof VZa}var dWe=Object.create(_b());dWe.inherits=hb();var mie=Wi("util"),Ei=void 0;mie&&mie.debuglog?Ei=mie.debuglog("stream"):Ei=function(){};var $Za=zVe(),lWe=aie(),qk;dWe.inherits(gr,Nie);var cie=["error","close","destroy","pause","resume"];function HZa(a,e,i){if(typeof a.prependListener=="function")return a.prependListener(e,i);!a._events||!a._events[e]?a.on(e,i):KZa(a._events[e])?a._events[e].unshift(i):a._events[e]=[i,a._events[e]]}function mWe(a,e){jC=jC||Hh(),a=a||{};var i=e instanceof jC;this.objectMode=!!a.objectMode,i&&(this.objectMode=this.objectMode||!!a.readableObjectMode);var r=a.highWaterMark,t=a.readableHighWaterMark,n=this.objectMode?16:16*1024;r||r===0?this.highWaterMark=r:i&&(t||t===0)?this.highWaterMark=t:this.highWaterMark=n,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new $Za,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=a.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,a.encoding&&(qk||(qk=lie().StringDecoder),this.decoder=new qk(a.encoding),this.encoding=a.encoding)}function gr(a){if(jC=jC||Hh(),!(this instanceof gr))return new gr(a);this._readableState=new mWe(a,this),this.readable=!0,a&&(typeof a.read=="function"&&(this._read=a.read),typeof a.destroy=="function"&&(this._destroy=a.destroy)),Nie.call(this)}Object.defineProperty(gr.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(a){this._readableState&&(this._readableState.destroyed=a)}});gr.prototype.destroy=lWe.destroy;gr.prototype._undestroy=lWe.undestroy;gr.prototype._destroy=function(a,e){this.push(null),e(a)};gr.prototype.push=function(a,e){var i=this._readableState,r;return i.objectMode?r=!0:typeof a=="string"&&(e=e||i.defaultEncoding,e!==i.encoding&&(a=bC.from(a,e),e=""),r=!0),cWe(this,a,e,!1,r)};gr.prototype.unshift=function(a){return cWe(this,a,null,!0,!1)};function cWe(a,e,i,r,t){var n=a._readableState;if(e===null)n.reading=!1,YZa(a,n);else{var s;t||(s=XZa(n,e)),s?a.emit("error",s):n.objectMode||e&&e.length>0?(typeof e!="string"&&!n.objectMode&&Object.getPrototypeOf(e)!==bC.prototype&&(e=WZa(e)),r?n.endEmitted?a.emit("error",new Error("stream.unshift() after end event")):uie(a,n,e,!0):n.ended?a.emit("error",new Error("stream.push() after EOF")):(n.reading=!1,n.decoder&&!i?(e=n.decoder.write(e),n.objectMode||e.length!==0?uie(a,n,e,!1):uWe(a,n)):uie(a,n,e,!1))):r||(n.reading=!1)}return QZa(n)}function uie(a,e,i,r){e.flowing&&e.length===0&&!e.sync?(a.emit("data",i),a.read(0)):(e.length+=e.objectMode?1:i.length,r?e.buffer.unshift(i):e.buffer.push(i),e.needReadable&&Ez(a)),uWe(a,e)}function XZa(a,e){var i;return!GZa(e)&&typeof e!="string"&&e!==void 0&&!a.objectMode&&(i=new TypeError("Invalid non-string/buffer chunk")),i}function QZa(a){return!a.ended&&(a.needReadable||a.length<a.highWaterMark||a.length===0)}gr.prototype.isPaused=function(){return this._readableState.flowing===!1};gr.prototype.setEncoding=function(a){return qk||(qk=lie().StringDecoder),this._readableState.decoder=new qk(a),this._readableState.encoding=a,this};var tWe=8388608;function JZa(a){return a>=tWe?a=tWe:(a--,a|=a>>>1,a|=a>>>2,a|=a>>>4,a|=a>>>8,a|=a>>>16,a++),a}function nWe(a,e){return a<=0||e.length===0&&e.ended?0:e.objectMode?1:a!==a?e.flowing&&e.length?e.buffer.head.data.length:e.length:(a>e.highWaterMark&&(e.highWaterMark=JZa(a)),a<=e.length?a:e.ended?e.length:(e.needReadable=!0,0))}gr.prototype.read=function(a){Ei("read",a),a=parseInt(a,10);var e=this._readableState,i=a;if(a!==0&&(e.emittedReadable=!1),a===0&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return Ei("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?fie(this):Ez(this),null;if(a=nWe(a,e),a===0&&e.ended)return e.length===0&&fie(this),null;var r=e.needReadable;Ei("need readable",r),(e.length===0||e.length-a<e.highWaterMark)&&(r=!0,Ei("length less than watermark",r)),e.ended||e.reading?(r=!1,Ei("reading or ended",r)):r&&(Ei("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(a=nWe(i,e)));var t;return a>0?t=fWe(a,e):t=null,t===null?(e.needReadable=!0,a=0):e.length-=a,e.length===0&&(e.ended||(e.needReadable=!0),i!==a&&e.ended&&fie(this)),t!==null&&this.emit("data",t),t};function YZa(a,e){if(!e.ended){if(e.decoder){var i=e.decoder.end();i&&i.length&&(e.buffer.push(i),e.length+=e.objectMode?1:i.length)}e.ended=!0,Ez(a)}}function Ez(a){var e=a._readableState;e.needReadable=!1,e.emittedReadable||(Ei("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?jk.nextTick(sWe,a):sWe(a))}function sWe(a){Ei("emit readable"),a.emit("readable"),pie(a)}function uWe(a,e){e.readingMore||(e.readingMore=!0,jk.nextTick(ZZa,a,e))}function ZZa(a,e){for(var i=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(Ei("maybeReadMore read 0"),a.read(0),i!==e.length);)i=e.length;e.readingMore=!1}gr.prototype._read=function(a){this.emit("error",new Error("_read() is not implemented"))};gr.prototype.pipe=function(a,e){var i=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=a;break;case 1:r.pipes=[r.pipes,a];break;default:r.pipes.push(a);break}r.pipesCount+=1,Ei("pipe count=%d opts=%j",r.pipesCount,e);var t=(!e||e.end!==!1)&&a!==process.stdout&&a!==process.stderr,n=t?o:v;r.endEmitted?jk.nextTick(n):i.once("end",n),a.on("unpipe",s);function s(h,w){Ei("onunpipe"),h===i&&w&&w.hasUnpiped===!1&&(w.hasUnpiped=!0,m())}function o(){Ei("onend"),a.end()}var d=eei(i);a.on("drain",d);var l=!1;function m(){Ei("cleanup"),a.removeListener("close",N),a.removeListener("finish",_),a.removeListener("drain",d),a.removeListener("error",f),a.removeListener("unpipe",s),i.removeListener("end",o),i.removeListener("end",v),i.removeListener("data",u),l=!0,r.awaitDrain&&(!a._writableState||a._writableState.needDrain)&&d()}var c=!1;i.on("data",u);function u(h){Ei("ondata"),c=!1;var w=a.write(h);w===!1&&!c&&((r.pipesCount===1&&r.pipes===a||r.pipesCount>1&&NWe(r.pipes,a)!==-1)&&!l&&(Ei("false write response, pause",r.awaitDrain),r.awaitDrain++,c=!0),i.pause())}function f(h){Ei("onerror",h),v(),a.removeListener("error",f),oWe(a,"error")===0&&a.emit("error",h)}HZa(a,"error",f);function N(){a.removeListener("finish",_),v()}a.once("close",N);function _(){Ei("onfinish"),a.removeListener("close",N),v()}a.once("finish",_);function v(){Ei("unpipe"),i.unpipe(a)}return a.emit("pipe",i),r.flowing||(Ei("pipe resume"),i.resume()),a};function eei(a){return function(){var e=a._readableState;Ei("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,e.awaitDrain===0&&oWe(a,"data")&&(e.flowing=!0,pie(a))}}gr.prototype.unpipe=function(a){var e=this._readableState,i={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return a&&a!==e.pipes?this:(a||(a=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,a&&a.emit("unpipe",this,i),this);if(!a){var r=e.pipes,t=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var n=0;n<t;n++)r[n].emit("unpipe",this,{hasUnpiped:!1});return this}var s=NWe(e.pipes,a);return s===-1?this:(e.pipes.splice(s,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),a.emit("unpipe",this,i),this)};gr.prototype.on=function(a,e){var i=Nie.prototype.on.call(this,a,e);if(a==="data")this._readableState.flowing!==!1&&this.resume();else if(a==="readable"){var r=this._readableState;!r.endEmitted&&!r.readableListening&&(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&Ez(this):jk.nextTick(aei,this))}return i};gr.prototype.addListener=gr.prototype.on;function aei(a){Ei("readable nexttick read 0"),a.read(0)}gr.prototype.resume=function(){var a=this._readableState;return a.flowing||(Ei("resume"),a.flowing=!0,iei(this,a)),this};function iei(a,e){e.resumeScheduled||(e.resumeScheduled=!0,jk.nextTick(rei,a,e))}function rei(a,e){e.reading||(Ei("resume read 0"),a.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,a.emit("resume"),pie(a),e.flowing&&!e.reading&&a.read(0)}gr.prototype.pause=function(){return Ei("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(Ei("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function pie(a){var e=a._readableState;for(Ei("flow",e.flowing);e.flowing&&a.read()!==null;);}gr.prototype.wrap=function(a){var e=this,i=this._readableState,r=!1;a.on("end",function(){if(Ei("wrapped end"),i.decoder&&!i.ended){var s=i.decoder.end();s&&s.length&&e.push(s)}e.push(null)}),a.on("data",function(s){if(Ei("wrapped data"),i.decoder&&(s=i.decoder.write(s)),!(i.objectMode&&s==null)&&!(!i.objectMode&&(!s||!s.length))){var o=e.push(s);o||(r=!0,a.pause())}});for(var t in a)this[t]===void 0&&typeof a[t]=="function"&&(this[t]=(function(s){return function(){return a[s].apply(a,arguments)}})(t));for(var n=0;n<cie.length;n++)a.on(cie[n],this.emit.bind(this,cie[n]));return this._read=function(s){Ei("wrapped _read",s),r&&(r=!1,a.resume())},this};Object.defineProperty(gr.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});gr._fromList=fWe;function fWe(a,e){if(e.length===0)return null;var i;return e.objectMode?i=e.buffer.shift():!a||a>=e.length?(e.decoder?i=e.buffer.join(""):e.buffer.length===1?i=e.buffer.head.data:i=e.buffer.concat(e.length),e.buffer.clear()):i=tei(a,e.buffer,e.decoder),i}function tei(a,e,i){var r;return a<e.head.data.length?(r=e.head.data.slice(0,a),e.head.data=e.head.data.slice(a)):a===e.head.data.length?r=e.shift():r=i?nei(a,e):sei(a,e),r}function nei(a,e){var i=e.head,r=1,t=i.data;for(a-=t.length;i=i.next;){var n=i.data,s=a>n.length?n.length:a;if(s===n.length?t+=n:t+=n.slice(0,a),a-=s,a===0){s===n.length?(++r,i.next?e.head=i.next:e.head=e.tail=null):(e.head=i,i.data=n.slice(s));break}++r}return e.length-=r,t}function sei(a,e){var i=bC.allocUnsafe(a),r=e.head,t=1;for(r.data.copy(i),a-=r.data.length;r=r.next;){var n=r.data,s=a>n.length?n.length:a;if(n.copy(i,i.length-a,0,s),a-=s,a===0){s===n.length?(++t,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=n.slice(s));break}++t}return e.length-=t,i}function fie(a){var e=a._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,jk.nextTick(oei,e,a))}function oei(a,e){!a.endEmitted&&a.length===0&&(a.endEmitted=!0,e.readable=!1,e.emit("end"))}function NWe(a,e){for(var i=0,r=a.length;i<r;i++)if(a[i]===e)return i;return-1}});var _ie=Ie((R$r,vWe)=>{"use strict";vWe.exports=wu;var Cz=Hh(),hWe=Object.create(_b());hWe.inherits=hb();hWe.inherits(wu,Cz);function dei(a,e){var i=this._transformState;i.transforming=!1;var r=i.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));i.writechunk=null,i.writecb=null,e!=null&&this.push(e),r(a);var t=this._readableState;t.reading=!1,(t.needReadable||t.length<t.highWaterMark)&&this._read(t.highWaterMark)}function wu(a){if(!(this instanceof wu))return new wu(a);Cz.call(this,a),this._transformState={afterTransform:dei.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,a&&(typeof a.transform=="function"&&(this._transform=a.transform),typeof a.flush=="function"&&(this._flush=a.flush)),this.on("prefinish",lei)}function lei(){var a=this;typeof this._flush=="function"?this._flush(function(e,i){_We(a,e,i)}):_We(this,null,null)}wu.prototype.push=function(a,e){return this._transformState.needTransform=!1,Cz.prototype.push.call(this,a,e)};wu.prototype._transform=function(a,e,i){throw new Error("_transform() is not implemented")};wu.prototype._write=function(a,e,i){var r=this._transformState;if(r.writecb=i,r.writechunk=a,r.writeencoding=e,!r.transforming){var t=this._readableState;(r.needTransform||t.needReadable||t.length<t.highWaterMark)&&this._read(t.highWaterMark)}};wu.prototype._read=function(a){var e=this._transformState;e.writechunk!==null&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};wu.prototype._destroy=function(a,e){var i=this;Cz.prototype._destroy.call(this,a,function(r){e(r),i.emit("close")})};function _We(a,e,i){if(e)return a.emit("error",e);if(i!=null&&a.push(i),a._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(a._transformState.transforming)throw new Error("Calling transform done when still transforming");return a.push(null)}});var kWe=Ie((D$r,yWe)=>{"use strict";yWe.exports=IC;var wWe=_ie(),gWe=Object.create(_b());gWe.inherits=hb();gWe.inherits(IC,wWe);function IC(a){if(!(this instanceof IC))return new IC(a);wWe.call(this,a)}IC.prototype._transform=function(a,e,i){i(null,a)}});var qWe=Ie((En,Az)=>{var Hm=Wi("stream");process.env.READABLE_STREAM==="disable"&&Hm?(Az.exports=Hm,En=Az.exports=Hm.Readable,En.Readable=Hm.Readable,En.Writable=Hm.Writable,En.Duplex=Hm.Duplex,En.Transform=Hm.Transform,En.PassThrough=Hm.PassThrough,En.Stream=Hm):(En=Az.exports=sie(),En.Stream=Hm||En,En.Readable=En,En.Writable=rie(),En.Duplex=Hh(),En.Transform=_ie(),En.PassThrough=kWe())});var bWe=Ie((x$r,jWe)=>{jWe.exports=qWe().PassThrough});var EWe=Ie((M$r,TWe)=>{var IWe=Wi("util"),xz=bWe();TWe.exports={Readable:Rz,Writable:Dz};IWe.inherits(Rz,xz);IWe.inherits(Dz,xz);function SWe(a,e,i){a[e]=function(){return delete a[e],i.apply(this,arguments),this[e].apply(this,arguments)}}function Rz(a,e){if(!(this instanceof Rz))return new Rz(a,e);xz.call(this,e),SWe(this,"_read",function(){var i=a.call(this,e),r=this.emit.bind(this,"error");i.on("error",r),i.pipe(this)}),this.emit("readable")}function Dz(a,e){if(!(this instanceof Dz))return new Dz(a,e);xz.call(this,e),SWe(this,"_write",function(){var i=a.call(this,e),r=this.emit.bind(this,"error");i.on("error",r),this.pipe(i)}),this.emit("writable")}});var La=Ie((ist,YXe)=>{YXe.exports={options:{usePureJavaScript:!1}}});var a8e=Ie((rst,e8e)=>{var Rne={};e8e.exports=Rne;var ZXe={};Rne.encode=function(a,e,i){if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(i!==void 0&&typeof i!="number")throw new TypeError('"maxline" must be a number.');var r="";if(!(a instanceof Uint8Array))r=bwi(a,e);else{var t=0,n=e.length,s=e.charAt(0),o=[0];for(t=0;t<a.length;++t){for(var d=0,l=a[t];d<o.length;++d)l+=o[d]<<8,o[d]=l%n,l=l/n|0;for(;l>0;)o.push(l%n),l=l/n|0}for(t=0;a[t]===0&&t<a.length-1;++t)r+=s;for(t=o.length-1;t>=0;--t)r+=e[o[t]]}if(i){var m=new RegExp(".{1,"+i+"}","g");r=r.match(m).join(`\r
3
3
  `)}return r};Rne.decode=function(a,e){if(typeof a!="string")throw new TypeError('"input" must be a string.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');var i=ZXe[e];if(!i){i=ZXe[e]=[];for(var r=0;r<e.length;++r)i[e.charCodeAt(r)]=r}a=a.replace(/\s/g,"");for(var t=e.length,n=e.charAt(0),s=[0],r=0;r<a.length;r++){var o=i[a.charCodeAt(r)];if(o===void 0)return;for(var d=0,l=o;d<s.length;++d)l+=s[d]*t,s[d]=l&255,l>>=8;for(;l>0;)s.push(l&255),l>>=8}for(var m=0;a[m]===n&&m<a.length-1;++m)s.push(0);return typeof Buffer<"u"?Buffer.from(s.reverse()):new Uint8Array(s.reverse())};function bwi(a,e){var i=0,r=e.length,t=e.charAt(0),n=[0];for(i=0;i<a.length();++i){for(var s=0,o=a.at(i);s<n.length;++s)o+=n[s]<<8,n[s]=o%r,o=o/r|0;for(;o>0;)n.push(o%r),o=o/r|0}var d="";for(i=0;a.at(i)===0&&i<a.length()-1;++i)d+=t;for(i=n.length-1;i>=0;--i)d+=e[n[i]];return d}});var vi=Ie((tst,n8e)=>{var i8e=La(),r8e=a8e(),G=n8e.exports=i8e.util=i8e.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){G.nextTick=process.nextTick,typeof setImmediate=="function"?G.setImmediate=setImmediate:G.setImmediate=G.nextTick;return}if(typeof setImmediate=="function"){G.setImmediate=function(){return setImmediate.apply(void 0,arguments)},G.nextTick=function(o){return setImmediate(o)};return}if(G.setImmediate=function(o){setTimeout(o,0)},typeof window<"u"&&typeof window.postMessage=="function"){let o=function(d){if(d.source===window&&d.data===a){d.stopPropagation();var l=e.slice();e.length=0,l.forEach(function(m){m()})}};var s=o,a="forge.setImmediate",e=[];G.setImmediate=function(d){e.push(d),e.length===1&&window.postMessage(a,"*")},window.addEventListener("message",o,!0)}if(typeof MutationObserver<"u"){var i=Date.now(),r=!0,t=document.createElement("div"),e=[];new MutationObserver(function(){var d=e.slice();e.length=0,d.forEach(function(l){l()})}).observe(t,{attributes:!0});var n=G.setImmediate;G.setImmediate=function(d){Date.now()-i>15?(i=Date.now(),n(d)):(e.push(d),e.length===1&&t.setAttribute("a",r=!r))}}G.nextTick=G.setImmediate})();G.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;G.globalScope=(function(){return G.isNodejs?global:typeof self>"u"?window:self})();G.isArray=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"};G.isArrayBuffer=function(a){return typeof ArrayBuffer<"u"&&a instanceof ArrayBuffer};G.isArrayBufferView=function(a){return a&&G.isArrayBuffer(a.buffer)&&a.byteLength!==void 0};function PA(a){if(!(a===8||a===16||a===24||a===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+a)}G.ByteBuffer=Dne;function Dne(a){if(this.data="",this.read=0,typeof a=="string")this.data=a;else if(G.isArrayBuffer(a)||G.isArrayBufferView(a))if(typeof Buffer<"u"&&a instanceof Buffer)this.data=a.toString("binary");else{var e=new Uint8Array(a);try{this.data=String.fromCharCode.apply(null,e)}catch{for(var i=0;i<e.length;++i)this.putByte(e[i])}}else(a instanceof Dne||typeof a=="object"&&typeof a.data=="string"&&typeof a.read=="number")&&(this.data=a.data,this.read=a.read);this._constructedStringLength=0}G.ByteStringBuffer=Dne;var Iwi=4096;G.ByteStringBuffer.prototype._optimizeConstructedString=function(a){this._constructedStringLength+=a,this._constructedStringLength>Iwi&&(this.data.substr(0,1),this._constructedStringLength=0)};G.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};G.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};G.ByteStringBuffer.prototype.putByte=function(a){return this.putBytes(String.fromCharCode(a))};G.ByteStringBuffer.prototype.fillWithByte=function(a,e){a=String.fromCharCode(a);for(var i=this.data;e>0;)e&1&&(i+=a),e>>>=1,e>0&&(a+=a);return this.data=i,this._optimizeConstructedString(e),this};G.ByteStringBuffer.prototype.putBytes=function(a){return this.data+=a,this._optimizeConstructedString(a.length),this};G.ByteStringBuffer.prototype.putString=function(a){return this.putBytes(G.encodeUtf8(a))};G.ByteStringBuffer.prototype.putInt16=function(a){return this.putBytes(String.fromCharCode(a>>8&255)+String.fromCharCode(a&255))};G.ByteStringBuffer.prototype.putInt24=function(a){return this.putBytes(String.fromCharCode(a>>16&255)+String.fromCharCode(a>>8&255)+String.fromCharCode(a&255))};G.ByteStringBuffer.prototype.putInt32=function(a){return this.putBytes(String.fromCharCode(a>>24&255)+String.fromCharCode(a>>16&255)+String.fromCharCode(a>>8&255)+String.fromCharCode(a&255))};G.ByteStringBuffer.prototype.putInt16Le=function(a){return this.putBytes(String.fromCharCode(a&255)+String.fromCharCode(a>>8&255))};G.ByteStringBuffer.prototype.putInt24Le=function(a){return this.putBytes(String.fromCharCode(a&255)+String.fromCharCode(a>>8&255)+String.fromCharCode(a>>16&255))};G.ByteStringBuffer.prototype.putInt32Le=function(a){return this.putBytes(String.fromCharCode(a&255)+String.fromCharCode(a>>8&255)+String.fromCharCode(a>>16&255)+String.fromCharCode(a>>24&255))};G.ByteStringBuffer.prototype.putInt=function(a,e){PA(e);var i="";do e-=8,i+=String.fromCharCode(a>>e&255);while(e>0);return this.putBytes(i)};G.ByteStringBuffer.prototype.putSignedInt=function(a,e){return a<0&&(a+=2<<e-1),this.putInt(a,e)};G.ByteStringBuffer.prototype.putBuffer=function(a){return this.putBytes(a.getBytes())};G.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)};G.ByteStringBuffer.prototype.getInt16=function(){var a=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,a};G.ByteStringBuffer.prototype.getInt24=function(){var a=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,a};G.ByteStringBuffer.prototype.getInt32=function(){var a=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,a};G.ByteStringBuffer.prototype.getInt16Le=function(){var a=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,a};G.ByteStringBuffer.prototype.getInt24Le=function(){var a=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,a};G.ByteStringBuffer.prototype.getInt32Le=function(){var a=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,a};G.ByteStringBuffer.prototype.getInt=function(a){PA(a);var e=0;do e=(e<<8)+this.data.charCodeAt(this.read++),a-=8;while(a>0);return e};G.ByteStringBuffer.prototype.getSignedInt=function(a){var e=this.getInt(a),i=2<<a-2;return e>=i&&(e-=i<<1),e};G.ByteStringBuffer.prototype.getBytes=function(a){var e;return a?(a=Math.min(this.length(),a),e=this.data.slice(this.read,this.read+a),this.read+=a):a===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};G.ByteStringBuffer.prototype.bytes=function(a){return typeof a>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+a)};G.ByteStringBuffer.prototype.at=function(a){return this.data.charCodeAt(this.read+a)};G.ByteStringBuffer.prototype.setAt=function(a,e){return this.data=this.data.substr(0,this.read+a)+String.fromCharCode(e)+this.data.substr(this.read+a+1),this};G.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};G.ByteStringBuffer.prototype.copy=function(){var a=G.createBuffer(this.data);return a.read=this.read,a};G.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};G.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};G.ByteStringBuffer.prototype.truncate=function(a){var e=Math.max(0,this.length()-a);return this.data=this.data.substr(this.read,e),this.read=0,this};G.ByteStringBuffer.prototype.toHex=function(){for(var a="",e=this.read;e<this.data.length;++e){var i=this.data.charCodeAt(e);i<16&&(a+="0"),a+=i.toString(16)}return a};G.ByteStringBuffer.prototype.toString=function(){return G.decodeUtf8(this.bytes())};function Swi(a,e){e=e||{},this.read=e.readOffset||0,this.growSize=e.growSize||1024;var i=G.isArrayBuffer(a),r=G.isArrayBufferView(a);if(i||r){i?this.data=new DataView(a):this.data=new DataView(a.buffer,a.byteOffset,a.byteLength),this.write="writeOffset"in e?e.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,a!=null&&this.putBytes(a),"writeOffset"in e&&(this.write=e.writeOffset)}G.DataBuffer=Swi;G.DataBuffer.prototype.length=function(){return this.write-this.read};G.DataBuffer.prototype.isEmpty=function(){return this.length()<=0};G.DataBuffer.prototype.accommodate=function(a,e){if(this.length()>=a)return this;e=Math.max(e||this.growSize,a);var i=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),r=new Uint8Array(this.length()+e);return r.set(i),this.data=new DataView(r.buffer),this};G.DataBuffer.prototype.putByte=function(a){return this.accommodate(1),this.data.setUint8(this.write++,a),this};G.DataBuffer.prototype.fillWithByte=function(a,e){this.accommodate(e);for(var i=0;i<e;++i)this.data.setUint8(a);return this};G.DataBuffer.prototype.putBytes=function(a,e){if(G.isArrayBufferView(a)){var i=new Uint8Array(a.buffer,a.byteOffset,a.byteLength),r=i.byteLength-i.byteOffset;this.accommodate(r);var t=new Uint8Array(this.data.buffer,this.write);return t.set(i),this.write+=r,this}if(G.isArrayBuffer(a)){var i=new Uint8Array(a);this.accommodate(i.byteLength);var t=new Uint8Array(this.data.buffer);return t.set(i,this.write),this.write+=i.byteLength,this}if(a instanceof G.DataBuffer||typeof a=="object"&&typeof a.read=="number"&&typeof a.write=="number"&&G.isArrayBufferView(a.data)){var i=new Uint8Array(a.data.byteLength,a.read,a.length());this.accommodate(i.byteLength);var t=new Uint8Array(a.data.byteLength,this.write);return t.set(i),this.write+=i.byteLength,this}if(a instanceof G.ByteStringBuffer&&(a=a.data,e="binary"),e=e||"binary",typeof a=="string"){var n;if(e==="hex")return this.accommodate(Math.ceil(a.length/2)),n=new Uint8Array(this.data.buffer,this.write),this.write+=G.binary.hex.decode(a,n,this.write),this;if(e==="base64")return this.accommodate(Math.ceil(a.length/4)*3),n=new Uint8Array(this.data.buffer,this.write),this.write+=G.binary.base64.decode(a,n,this.write),this;if(e==="utf8"&&(a=G.encodeUtf8(a),e="binary"),e==="binary"||e==="raw")return this.accommodate(a.length),n=new Uint8Array(this.data.buffer,this.write),this.write+=G.binary.raw.decode(n),this;if(e==="utf16")return this.accommodate(a.length*2),n=new Uint16Array(this.data.buffer,this.write),this.write+=G.text.utf16.encode(n),this;throw new Error("Invalid encoding: "+e)}throw Error("Invalid parameter: "+a)};G.DataBuffer.prototype.putBuffer=function(a){return this.putBytes(a),a.clear(),this};G.DataBuffer.prototype.putString=function(a){return this.putBytes(a,"utf16")};G.DataBuffer.prototype.putInt16=function(a){return this.accommodate(2),this.data.setInt16(this.write,a),this.write+=2,this};G.DataBuffer.prototype.putInt24=function(a){return this.accommodate(3),this.data.setInt16(this.write,a>>8&65535),this.data.setInt8(this.write,a>>16&255),this.write+=3,this};G.DataBuffer.prototype.putInt32=function(a){return this.accommodate(4),this.data.setInt32(this.write,a),this.write+=4,this};G.DataBuffer.prototype.putInt16Le=function(a){return this.accommodate(2),this.data.setInt16(this.write,a,!0),this.write+=2,this};G.DataBuffer.prototype.putInt24Le=function(a){return this.accommodate(3),this.data.setInt8(this.write,a>>16&255),this.data.setInt16(this.write,a>>8&65535,!0),this.write+=3,this};G.DataBuffer.prototype.putInt32Le=function(a){return this.accommodate(4),this.data.setInt32(this.write,a,!0),this.write+=4,this};G.DataBuffer.prototype.putInt=function(a,e){PA(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,a>>e&255);while(e>0);return this};G.DataBuffer.prototype.putSignedInt=function(a,e){return PA(e),this.accommodate(e/8),a<0&&(a+=2<<e-1),this.putInt(a,e)};G.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)};G.DataBuffer.prototype.getInt16=function(){var a=this.data.getInt16(this.read);return this.read+=2,a};G.DataBuffer.prototype.getInt24=function(){var a=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,a};G.DataBuffer.prototype.getInt32=function(){var a=this.data.getInt32(this.read);return this.read+=4,a};G.DataBuffer.prototype.getInt16Le=function(){var a=this.data.getInt16(this.read,!0);return this.read+=2,a};G.DataBuffer.prototype.getInt24Le=function(){var a=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,a};G.DataBuffer.prototype.getInt32Le=function(){var a=this.data.getInt32(this.read,!0);return this.read+=4,a};G.DataBuffer.prototype.getInt=function(a){PA(a);var e=0;do e=(e<<8)+this.data.getInt8(this.read++),a-=8;while(a>0);return e};G.DataBuffer.prototype.getSignedInt=function(a){var e=this.getInt(a),i=2<<a-2;return e>=i&&(e-=i<<1),e};G.DataBuffer.prototype.getBytes=function(a){var e;return a?(a=Math.min(this.length(),a),e=this.data.slice(this.read,this.read+a),this.read+=a):a===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};G.DataBuffer.prototype.bytes=function(a){return typeof a>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+a)};G.DataBuffer.prototype.at=function(a){return this.data.getUint8(this.read+a)};G.DataBuffer.prototype.setAt=function(a,e){return this.data.setUint8(a,e),this};G.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};G.DataBuffer.prototype.copy=function(){return new G.DataBuffer(this)};G.DataBuffer.prototype.compact=function(){if(this.read>0){var a=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(a.byteLength);e.set(a),this.data=new DataView(e),this.write-=this.read,this.read=0}return this};G.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};G.DataBuffer.prototype.truncate=function(a){return this.write=Math.max(0,this.length()-a),this.read=Math.min(this.read,this.write),this};G.DataBuffer.prototype.toHex=function(){for(var a="",e=this.read;e<this.data.byteLength;++e){var i=this.data.getUint8(e);i<16&&(a+="0"),a+=i.toString(16)}return a};G.DataBuffer.prototype.toString=function(a){var e=new Uint8Array(this.data,this.read,this.length());if(a=a||"utf8",a==="binary"||a==="raw")return G.binary.raw.encode(e);if(a==="hex")return G.binary.hex.encode(e);if(a==="base64")return G.binary.base64.encode(e);if(a==="utf8")return G.text.utf8.decode(e);if(a==="utf16")return G.text.utf16.decode(e);throw new Error("Invalid encoding: "+a)};G.createBuffer=function(a,e){return e=e||"raw",a!==void 0&&e==="utf8"&&(a=G.encodeUtf8(a)),new G.ByteBuffer(a)};G.fillString=function(a,e){for(var i="";e>0;)e&1&&(i+=a),e>>>=1,e>0&&(a+=a);return i};G.xorBytes=function(a,e,i){for(var r="",t="",n="",s=0,o=0;i>0;--i,++s)t=a.charCodeAt(s)^e.charCodeAt(s),o>=10&&(r+=n,n="",o=0),n+=String.fromCharCode(t),++o;return r+=n,r};G.hexToBytes=function(a){var e="",i=0;for(a.length&!0&&(i=1,e+=String.fromCharCode(parseInt(a[0],16)));i<a.length;i+=2)e+=String.fromCharCode(parseInt(a.substr(i,2),16));return e};G.bytesToHex=function(a){return G.createBuffer(a).toHex()};G.int32ToBytes=function(a){return String.fromCharCode(a>>24&255)+String.fromCharCode(a>>16&255)+String.fromCharCode(a>>8&255)+String.fromCharCode(a&255)};var FN="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",zN=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],t8e="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";G.encode64=function(a,e){for(var i="",r="",t,n,s,o=0;o<a.length;)t=a.charCodeAt(o++),n=a.charCodeAt(o++),s=a.charCodeAt(o++),i+=FN.charAt(t>>2),i+=FN.charAt((t&3)<<4|n>>4),isNaN(n)?i+="==":(i+=FN.charAt((n&15)<<2|s>>6),i+=isNaN(s)?"=":FN.charAt(s&63)),e&&i.length>e&&(r+=i.substr(0,e)+`\r
4
4
  `,i=i.substr(e));return r+=i,r};G.decode64=function(a){a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e="",i,r,t,n,s=0;s<a.length;)i=zN[a.charCodeAt(s++)-43],r=zN[a.charCodeAt(s++)-43],t=zN[a.charCodeAt(s++)-43],n=zN[a.charCodeAt(s++)-43],e+=String.fromCharCode(i<<2|r>>4),t!==64&&(e+=String.fromCharCode((r&15)<<4|t>>2),n!==64&&(e+=String.fromCharCode((t&3)<<6|n)));return e};G.encodeUtf8=function(a){return unescape(encodeURIComponent(a))};G.decodeUtf8=function(a){return decodeURIComponent(escape(a))};G.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:r8e.encode,decode:r8e.decode}};G.binary.raw.encode=function(a){return String.fromCharCode.apply(null,a)};G.binary.raw.decode=function(a,e,i){var r=e;r||(r=new Uint8Array(a.length)),i=i||0;for(var t=i,n=0;n<a.length;++n)r[t++]=a.charCodeAt(n);return e?t-i:r};G.binary.hex.encode=G.bytesToHex;G.binary.hex.decode=function(a,e,i){var r=e;r||(r=new Uint8Array(Math.ceil(a.length/2))),i=i||0;var t=0,n=i;for(a.length&1&&(t=1,r[n++]=parseInt(a[0],16));t<a.length;t+=2)r[n++]=parseInt(a.substr(t,2),16);return e?n-i:r};G.binary.base64.encode=function(a,e){for(var i="",r="",t,n,s,o=0;o<a.byteLength;)t=a[o++],n=a[o++],s=a[o++],i+=FN.charAt(t>>2),i+=FN.charAt((t&3)<<4|n>>4),isNaN(n)?i+="==":(i+=FN.charAt((n&15)<<2|s>>6),i+=isNaN(s)?"=":FN.charAt(s&63)),e&&i.length>e&&(r+=i.substr(0,e)+`\r
5
5
  `,i=i.substr(e));return r+=i,r};G.binary.base64.decode=function(a,e,i){var r=e;r||(r=new Uint8Array(Math.ceil(a.length/4)*3)),a=a.replace(/[^A-Za-z0-9\+\/\=]/g,""),i=i||0;for(var t,n,s,o,d=0,l=i;d<a.length;)t=zN[a.charCodeAt(d++)-43],n=zN[a.charCodeAt(d++)-43],s=zN[a.charCodeAt(d++)-43],o=zN[a.charCodeAt(d++)-43],r[l++]=t<<2|n>>4,s!==64&&(r[l++]=(n&15)<<4|s>>2,o!==64&&(r[l++]=(s&3)<<6|o));return e?l-i:r.subarray(0,l)};G.binary.base58.encode=function(a,e){return G.binary.baseN.encode(a,t8e,e)};G.binary.base58.decode=function(a,e){return G.binary.baseN.decode(a,t8e,e)};G.text={utf8:{},utf16:{}};G.text.utf8.encode=function(a,e,i){a=G.encodeUtf8(a);var r=e;r||(r=new Uint8Array(a.length)),i=i||0;for(var t=i,n=0;n<a.length;++n)r[t++]=a.charCodeAt(n);return e?t-i:r};G.text.utf8.decode=function(a){return G.decodeUtf8(String.fromCharCode.apply(null,a))};G.text.utf16.encode=function(a,e,i){var r=e;r||(r=new Uint8Array(a.length*2));var t=new Uint16Array(r.buffer);i=i||0;for(var n=i,s=i,o=0;o<a.length;++o)t[s++]=a.charCodeAt(o),n+=2;return e?n-i:r};G.text.utf16.decode=function(a){return String.fromCharCode.apply(null,new Uint16Array(a.buffer))};G.deflate=function(a,e,i){if(e=G.decode64(a.deflate(G.encode64(e)).rval),i){var r=2,t=e.charCodeAt(1);t&32&&(r=6),e=e.substring(r,e.length-4)}return e};G.inflate=function(a,e,i){var r=a.inflate(G.encode64(e)).rval;return r===null?null:G.decode64(r)};var xne=function(a,e,i){if(!a)throw new Error("WebStorage not available.");var r;if(i===null?r=a.removeItem(e):(i=G.encode64(JSON.stringify(i)),r=a.setItem(e,i)),typeof r<"u"&&r.rval!==!0){var t=new Error(r.error.message);throw t.id=r.error.id,t.name=r.error.name,t}},Mne=function(a,e){if(!a)throw new Error("WebStorage not available.");var i=a.getItem(e);if(a.init)if(i.rval===null){if(i.error){var r=new Error(i.error.message);throw r.id=i.error.id,r.name=i.error.name,r}i=null}else i=i.rval;return i!==null&&(i=JSON.parse(G.decode64(i))),i},Twi=function(a,e,i,r){var t=Mne(a,e);t===null&&(t={}),t[i]=r,xne(a,e,t)},Ewi=function(a,e,i){var r=Mne(a,e);return r!==null&&(r=i in r?r[i]:null),r},Cwi=function(a,e,i){var r=Mne(a,e);if(r!==null&&i in r){delete r[i];var t=!0;for(var n in r){t=!1;break}t&&(r=null),xne(a,e,r)}},Awi=function(a,e){xne(a,e,null)},MV=function(a,e,i){var r=null;typeof i>"u"&&(i=["web","flash"]);var t,n=!1,s=null;for(var o in i){t=i[o];try{if(t==="flash"||t==="both"){if(e[0]===null)throw new Error("Flash local storage not available.");r=a.apply(this,e),n=t==="flash"}(t==="web"||t==="both")&&(e[0]=localStorage,r=a.apply(this,e),n=!0)}catch(d){s=d}if(n)break}if(!n)throw s;return r};G.setItem=function(a,e,i,r,t){MV(Twi,arguments,t)};G.getItem=function(a,e,i,r){return MV(Ewi,arguments,r)};G.removeItem=function(a,e,i,r){MV(Cwi,arguments,r)};G.clearItems=function(a,e,i){MV(Awi,arguments,i)};G.isEmpty=function(a){for(var e in a)if(a.hasOwnProperty(e))return!1;return!0};G.format=function(a){for(var e=/%./g,i,r,t=0,n=[],s=0;i=e.exec(a);){r=a.substring(s,e.lastIndex-2),r.length>0&&n.push(r),s=e.lastIndex;var o=i[0][1];switch(o){case"s":case"o":t<arguments.length?n.push(arguments[t+++1]):n.push("<?>");break;case"%":n.push("%");break;default:n.push("<%"+o+"?>")}}return n.push(a.substring(s)),n.join("")};G.formatNumber=function(a,e,i,r){var t=a,n=isNaN(e=Math.abs(e))?2:e,s=i===void 0?",":i,o=r===void 0?".":r,d=t<0?"-":"",l=parseInt(t=Math.abs(+t||0).toFixed(n),10)+"",m=l.length>3?l.length%3:0;return d+(m?l.substr(0,m)+o:"")+l.substr(m).replace(/(\d{3})(?=\d)/g,"$1"+o)+(n?s+Math.abs(t-l).toFixed(n).slice(2):"")};G.formatSize=function(a){return a>=1073741824?a=G.formatNumber(a/1073741824,2,".","")+" GiB":a>=1048576?a=G.formatNumber(a/1048576,2,".","")+" MiB":a>=1024?a=G.formatNumber(a/1024,0)+" KiB":a=G.formatNumber(a,0)+" bytes",a};G.bytesFromIP=function(a){return a.indexOf(".")!==-1?G.bytesFromIPv4(a):a.indexOf(":")!==-1?G.bytesFromIPv6(a):null};G.bytesFromIPv4=function(a){if(a=a.split("."),a.length!==4)return null;for(var e=G.createBuffer(),i=0;i<a.length;++i){var r=parseInt(a[i],10);if(isNaN(r))return null;e.putByte(r)}return e.getBytes()};G.bytesFromIPv6=function(a){var e=0;a=a.split(":").filter(function(s){return s.length===0&&++e,!0});for(var i=(8-a.length+e)*2,r=G.createBuffer(),t=0;t<8;++t){if(!a[t]||a[t].length===0){r.fillWithByte(0,i),i=0;continue}var n=G.hexToBytes(a[t]);n.length<2&&r.putByte(0),r.putBytes(n)}return r.getBytes()};G.bytesToIP=function(a){return a.length===4?G.bytesToIPv4(a):a.length===16?G.bytesToIPv6(a):null};G.bytesToIPv4=function(a){if(a.length!==4)return null;for(var e=[],i=0;i<a.length;++i)e.push(a.charCodeAt(i));return e.join(".")};G.bytesToIPv6=function(a){if(a.length!==16)return null;for(var e=[],i=[],r=0,t=0;t<a.length;t+=2){for(var n=G.bytesToHex(a[t]+a[t+1]);n[0]==="0"&&n!=="0";)n=n.substr(1);if(n==="0"){var s=i[i.length-1],o=e.length;!s||o!==s.end+1?i.push({start:o,end:o}):(s.end=o,s.end-s.start>i[r].end-i[r].start&&(r=i.length-1))}e.push(n)}if(i.length>0){var d=i[r];d.end-d.start>0&&(e.splice(d.start,d.end-d.start+1,""),d.start===0&&e.unshift(""),d.end===7&&e.push(""))}return e.join(":")};G.estimateCores=function(a,e){if(typeof a=="function"&&(e=a,a={}),a=a||{},"cores"in G&&!a.update)return e(null,G.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return G.cores=navigator.hardwareConcurrency,e(null,G.cores);if(typeof Worker>"u")return G.cores=1,e(null,G.cores);if(typeof Blob>"u")return G.cores=2,e(null,G.cores);var i=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(s){for(var o=Date.now(),d=o+4;Date.now()<d;);self.postMessage({st:o,et:d})})}.toString(),")()"],{type:"application/javascript"}));r([],5,16);function r(s,o,d){if(o===0){var l=Math.floor(s.reduce(function(m,c){return m+c},0)/s.length);return G.cores=Math.max(1,l),URL.revokeObjectURL(i),e(null,G.cores)}t(d,function(m,c){s.push(n(d,c)),r(s,o-1,d)})}function t(s,o){for(var d=[],l=[],m=0;m<s;++m){var c=new Worker(i);c.addEventListener("message",function(u){if(l.push(u.data),l.length===s){for(var f=0;f<s;++f)d[f].terminate();o(null,l)}}),d.push(c)}for(var m=0;m<s;++m)d[m].postMessage(m)}function n(s,o){for(var d=[],l=0;l<s;++l)for(var m=o[l],c=d[l]=[],u=0;u<s;++u)if(l!==u){var f=o[u];(m.st>f.st&&m.st<f.et||f.st>m.st&&f.st<m.et)&&c.push(u)}return d.reduce(function(N,_){return Math.max(N,_.length)},0)}}});var PV=Ie((nst,s8e)=>{var pn=La();vi();s8e.exports=pn.cipher=pn.cipher||{};pn.cipher.algorithms=pn.cipher.algorithms||{};pn.cipher.createCipher=function(a,e){var i=a;if(typeof i=="string"&&(i=pn.cipher.getAlgorithm(i),i&&(i=i())),!i)throw new Error("Unsupported algorithm: "+a);return new pn.cipher.BlockCipher({algorithm:i,key:e,decrypt:!1})};pn.cipher.createDecipher=function(a,e){var i=a;if(typeof i=="string"&&(i=pn.cipher.getAlgorithm(i),i&&(i=i())),!i)throw new Error("Unsupported algorithm: "+a);return new pn.cipher.BlockCipher({algorithm:i,key:e,decrypt:!0})};pn.cipher.registerAlgorithm=function(a,e){a=a.toUpperCase(),pn.cipher.algorithms[a]=e};pn.cipher.getAlgorithm=function(a){return a=a.toUpperCase(),a in pn.cipher.algorithms?pn.cipher.algorithms[a]:null};var Pne=pn.cipher.BlockCipher=function(a){this.algorithm=a.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=a.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=a.decrypt,this.algorithm.initialize(a)};Pne.prototype.start=function(a){a=a||{};var e={};for(var i in a)e[i]=a[i];e.decrypt=this._decrypt,this._finish=!1,this._input=pn.util.createBuffer(),this.output=a.output||pn.util.createBuffer(),this.mode.start(e)};Pne.prototype.update=function(a){for(a&&this._input.putBuffer(a);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};Pne.prototype.finish=function(a){a&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(i){return a(this.blockSize,i,!1)},this.mode.unpad=function(i){return a(this.blockSize,i,!0)});var e={};return e.decrypt=this._decrypt,e.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,e)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,e))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,e))}});var One=Ie((sst,o8e)=>{var _n=La();vi();_n.cipher=_n.cipher||{};var Xa=o8e.exports=_n.cipher.modes=_n.cipher.modes||{};Xa.ecb=function(a){a=a||{},this.name="ECB",this.cipher=a.cipher,this.blockSize=a.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};Xa.ecb.prototype.start=function(a){};Xa.ecb.prototype.encrypt=function(a,e,i){if(a.length()<this.blockSize&&!(i&&a.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=a.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)e.putInt32(this._outBlock[r])};Xa.ecb.prototype.decrypt=function(a,e,i){if(a.length()<this.blockSize&&!(i&&a.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=a.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)e.putInt32(this._outBlock[r])};Xa.ecb.prototype.pad=function(a,e){var i=a.length()===this.blockSize?this.blockSize:this.blockSize-a.length();return a.fillWithByte(i,i),!0};Xa.ecb.prototype.unpad=function(a,e){if(e.overflow>0)return!1;var i=a.length(),r=a.at(i-1);return r>this.blockSize<<2?!1:(a.truncate(r),!0)};Xa.cbc=function(a){a=a||{},this.name="CBC",this.cipher=a.cipher,this.blockSize=a.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};Xa.cbc.prototype.start=function(a){if(a.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in a)this._iv=LV(a.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};Xa.cbc.prototype.encrypt=function(a,e,i){if(a.length()<this.blockSize&&!(i&&a.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=this._prev[r]^a.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)e.putInt32(this._outBlock[r]);this._prev=this._outBlock};Xa.cbc.prototype.decrypt=function(a,e,i){if(a.length()<this.blockSize&&!(i&&a.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=a.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)e.putInt32(this._prev[r]^this._outBlock[r]);this._prev=this._inBlock.slice(0)};Xa.cbc.prototype.pad=function(a,e){var i=a.length()===this.blockSize?this.blockSize:this.blockSize-a.length();return a.fillWithByte(i,i),!0};Xa.cbc.prototype.unpad=function(a,e){if(e.overflow>0)return!1;var i=a.length(),r=a.at(i-1);return r>this.blockSize<<2?!1:(a.truncate(r),!0)};Xa.cfb=function(a){a=a||{},this.name="CFB",this.cipher=a.cipher,this.blockSize=a.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=_n.util.createBuffer(),this._partialBytes=0};Xa.cfb.prototype.start=function(a){if(!("iv"in a))throw new Error("Invalid IV parameter.");this._iv=LV(a.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Xa.cfb.prototype.encrypt=function(a,e,i){var r=a.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var t=0;t<this._ints;++t)this._inBlock[t]=a.getInt32()^this._outBlock[t],e.putInt32(this._inBlock[t]);return}var n=(this.blockSize-r)%this.blockSize;n>0&&(n=this.blockSize-n),this._partialOutput.clear();for(var t=0;t<this._ints;++t)this._partialBlock[t]=a.getInt32()^this._outBlock[t],this._partialOutput.putInt32(this._partialBlock[t]);if(n>0)a.read-=this.blockSize;else for(var t=0;t<this._ints;++t)this._inBlock[t]=this._partialBlock[t];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),n>0&&!i)return e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;e.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0};Xa.cfb.prototype.decrypt=function(a,e,i){var r=a.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var t=0;t<this._ints;++t)this._inBlock[t]=a.getInt32(),e.putInt32(this._inBlock[t]^this._outBlock[t]);return}var n=(this.blockSize-r)%this.blockSize;n>0&&(n=this.blockSize-n),this._partialOutput.clear();for(var t=0;t<this._ints;++t)this._partialBlock[t]=a.getInt32(),this._partialOutput.putInt32(this._partialBlock[t]^this._outBlock[t]);if(n>0)a.read-=this.blockSize;else for(var t=0;t<this._ints;++t)this._inBlock[t]=this._partialBlock[t];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),n>0&&!i)return e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;e.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0};Xa.ofb=function(a){a=a||{},this.name="OFB",this.cipher=a.cipher,this.blockSize=a.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=_n.util.createBuffer(),this._partialBytes=0};Xa.ofb.prototype.start=function(a){if(!("iv"in a))throw new Error("Invalid IV parameter.");this._iv=LV(a.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Xa.ofb.prototype.encrypt=function(a,e,i){var r=a.length();if(a.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var t=0;t<this._ints;++t)e.putInt32(a.getInt32()^this._outBlock[t]),this._inBlock[t]=this._outBlock[t];return}var n=(this.blockSize-r)%this.blockSize;n>0&&(n=this.blockSize-n),this._partialOutput.clear();for(var t=0;t<this._ints;++t)this._partialOutput.putInt32(a.getInt32()^this._outBlock[t]);if(n>0)a.read-=this.blockSize;else for(var t=0;t<this._ints;++t)this._inBlock[t]=this._outBlock[t];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),n>0&&!i)return e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;e.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0};Xa.ofb.prototype.decrypt=Xa.ofb.prototype.encrypt;Xa.ctr=function(a){a=a||{},this.name="CTR",this.cipher=a.cipher,this.blockSize=a.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=_n.util.createBuffer(),this._partialBytes=0};Xa.ctr.prototype.start=function(a){if(!("iv"in a))throw new Error("Invalid IV parameter.");this._iv=LV(a.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Xa.ctr.prototype.encrypt=function(a,e,i){var r=a.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize)for(var t=0;t<this._ints;++t)e.putInt32(a.getInt32()^this._outBlock[t]);else{var n=(this.blockSize-r)%this.blockSize;n>0&&(n=this.blockSize-n),this._partialOutput.clear();for(var t=0;t<this._ints;++t)this._partialOutput.putInt32(a.getInt32()^this._outBlock[t]);if(n>0&&(a.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),n>0&&!i)return e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;e.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}OV(this._inBlock)};Xa.ctr.prototype.decrypt=Xa.ctr.prototype.encrypt;Xa.gcm=function(a){a=a||{},this.name="GCM",this.cipher=a.cipher,this.blockSize=a.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=_n.util.createBuffer(),this._partialBytes=0,this._R=3774873600};Xa.gcm.prototype.start=function(a){if(!("iv"in a))throw new Error("Invalid IV parameter.");var e=_n.util.createBuffer(a.iv);this._cipherLength=0;var i;if("additionalData"in a?i=_n.util.createBuffer(a.additionalData):i=_n.util.createBuffer(),"tagLength"in a?this._tagLength=a.tagLength:this._tagLength=128,this._tag=null,a.decrypt&&(this._tag=_n.util.createBuffer(a.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var r=e.length();if(r===12)this._j0=[e.getInt32(),e.getInt32(),e.getInt32(),1];else{for(this._j0=[0,0,0,0];e.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(Lne(r*8)))}this._inBlock=this._j0.slice(0),OV(this._inBlock),this._partialBytes=0,i=_n.util.createBuffer(i),this._aDataLength=Lne(i.length()*8);var t=i.length()%this.blockSize;for(t&&i.fillWithByte(0,this.blockSize-t),this._s=[0,0,0,0];i.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[i.getInt32(),i.getInt32(),i.getInt32(),i.getInt32()])};Xa.gcm.prototype.encrypt=function(a,e,i){var r=a.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var t=0;t<this._ints;++t)e.putInt32(this._outBlock[t]^=a.getInt32());this._cipherLength+=this.blockSize}else{var n=(this.blockSize-r)%this.blockSize;n>0&&(n=this.blockSize-n),this._partialOutput.clear();for(var t=0;t<this._ints;++t)this._partialOutput.putInt32(a.getInt32()^this._outBlock[t]);if(n<=0||i){if(i){var s=r%this.blockSize;this._cipherLength+=s,this._partialOutput.truncate(this.blockSize-s)}else this._cipherLength+=this.blockSize;for(var t=0;t<this._ints;++t)this._outBlock[t]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),n>0&&!i)return a.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;e.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),OV(this._inBlock)};Xa.gcm.prototype.decrypt=function(a,e,i){var r=a.length();if(r<this.blockSize&&!(i&&r>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),OV(this._inBlock),this._hashBlock[0]=a.getInt32(),this._hashBlock[1]=a.getInt32(),this._hashBlock[2]=a.getInt32(),this._hashBlock[3]=a.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var t=0;t<this._ints;++t)e.putInt32(this._outBlock[t]^this._hashBlock[t]);r<this.blockSize?this._cipherLength+=r%this.blockSize:this._cipherLength+=this.blockSize};Xa.gcm.prototype.afterFinish=function(a,e){var i=!0;e.decrypt&&e.overflow&&a.truncate(this.blockSize-e.overflow),this.tag=_n.util.createBuffer();var r=this._aDataLength.concat(Lne(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,r);var t=[];this.cipher.encrypt(this._j0,t);for(var n=0;n<this._ints;++n)this.tag.putInt32(this._s[n]^t[n]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),e.decrypt&&this.tag.bytes()!==this._tag&&(i=!1),i};Xa.gcm.prototype.multiply=function(a,e){for(var i=[0,0,0,0],r=e.slice(0),t=0;t<128;++t){var n=a[t/32|0]&1<<31-t%32;n&&(i[0]^=r[0],i[1]^=r[1],i[2]^=r[2],i[3]^=r[3]),this.pow(r,r)}return i};Xa.gcm.prototype.pow=function(a,e){for(var i=a[3]&1,r=3;r>0;--r)e[r]=a[r]>>>1|(a[r-1]&1)<<31;e[0]=a[0]>>>1,i&&(e[0]^=this._R)};Xa.gcm.prototype.tableMultiply=function(a){for(var e=[0,0,0,0],i=0;i<32;++i){var r=i/8|0,t=a[r]>>>(7-i%8)*4&15,n=this._m[i][t];e[0]^=n[0],e[1]^=n[1],e[2]^=n[2],e[3]^=n[3]}return e};Xa.gcm.prototype.ghash=function(a,e,i){return e[0]^=i[0],e[1]^=i[1],e[2]^=i[2],e[3]^=i[3],this.tableMultiply(e)};Xa.gcm.prototype.generateHashTable=function(a,e){for(var i=8/e,r=4*i,t=16*i,n=new Array(t),s=0;s<t;++s){var o=[0,0,0,0],d=s/r|0,l=(r-1-s%r)*e;o[d]=1<<e-1<<l,n[s]=this.generateSubHashTable(this.multiply(o,a),e)}return n};Xa.gcm.prototype.generateSubHashTable=function(a,e){var i=1<<e,r=i>>>1,t=new Array(i);t[r]=a.slice(0);for(var n=r>>>1;n>0;)this.pow(t[2*n],t[n]=[]),n>>=1;for(n=2;n<r;){for(var s=1;s<n;++s){var o=t[n],d=t[s];t[n+s]=[o[0]^d[0],o[1]^d[1],o[2]^d[2],o[3]^d[3]]}n*=2}for(t[0]=[0,0,0,0],n=r+1;n<i;++n){var l=t[n^r];t[n]=[a[0]^l[0],a[1]^l[1],a[2]^l[2],a[3]^l[3]]}return t};function LV(a,e){if(typeof a=="string"&&(a=_n.util.createBuffer(a)),_n.util.isArray(a)&&a.length>4){var i=a;a=_n.util.createBuffer();for(var r=0;r<i.length;++r)a.putByte(i[r])}if(a.length()<e)throw new Error("Invalid IV length; got "+a.length()+" bytes and expected "+e+" bytes.");if(!_n.util.isArray(a)){for(var t=[],n=e/4,r=0;r<n;++r)t.push(a.getInt32());a=t}return a}function OV(a){a[a.length-1]=a[a.length-1]+1&4294967295}function Lne(a){return[a/4294967296|0,a&4294967295]}});var KN=Ie((ost,c8e)=>{var ur=La();PV();One();vi();c8e.exports=ur.aes=ur.aes||{};ur.aes.startEncrypting=function(a,e,i,r){var t=BV({key:a,output:i,decrypt:!1,mode:r});return t.start(e),t};ur.aes.createEncryptionCipher=function(a,e){return BV({key:a,output:null,decrypt:!1,mode:e})};ur.aes.startDecrypting=function(a,e,i,r){var t=BV({key:a,output:i,decrypt:!0,mode:r});return t.start(e),t};ur.aes.createDecryptionCipher=function(a,e){return BV({key:a,output:null,decrypt:!0,mode:e})};ur.aes.Algorithm=function(a,e){Fne||l8e();var i=this;i.name=a,i.mode=new e({blockSize:16,cipher:{encrypt:function(r,t){return Une(i._w,r,t,!1)},decrypt:function(r,t){return Une(i._w,r,t,!0)}}}),i._init=!1};ur.aes.Algorithm.prototype.initialize=function(a){if(!this._init){var e=a.key,i;if(typeof e=="string"&&(e.length===16||e.length===24||e.length===32))e=ur.util.createBuffer(e);else if(ur.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){i=e,e=ur.util.createBuffer();for(var r=0;r<i.length;++r)e.putByte(i[r])}if(!ur.util.isArray(e)){i=e,e=[];var t=i.length();if(t===16||t===24||t===32){t=t>>>2;for(var r=0;r<t;++r)e.push(i.getInt32())}}if(!ur.util.isArray(e)||!(e.length===4||e.length===6||e.length===8))throw new Error("Invalid key parameter.");var n=this.mode.name,s=["CFB","OFB","CTR","GCM"].indexOf(n)!==-1;this._w=m8e(e,a.decrypt&&!s),this._init=!0}};ur.aes._expandKey=function(a,e){return Fne||l8e(),m8e(a,e)};ur.aes._updateBlock=Une;lq("AES-ECB",ur.cipher.modes.ecb);lq("AES-CBC",ur.cipher.modes.cbc);lq("AES-CFB",ur.cipher.modes.cfb);lq("AES-OFB",ur.cipher.modes.ofb);lq("AES-CTR",ur.cipher.modes.ctr);lq("AES-GCM",ur.cipher.modes.gcm);function lq(a,e){var i=function(){return new ur.aes.Algorithm(a,e)};ur.cipher.registerAlgorithm(a,i)}var Fne=!1,dq=4,Is,Bne,d8e,kv,Wl;function l8e(){Fne=!0,d8e=[0,1,2,4,8,16,32,64,128,27,54];for(var a=new Array(256),e=0;e<128;++e)a[e]=e<<1,a[e+128]=e+128<<1^283;Is=new Array(256),Bne=new Array(256),kv=new Array(4),Wl=new Array(4);for(var e=0;e<4;++e)kv[e]=new Array(256),Wl[e]=new Array(256);for(var i=0,r=0,t,n,s,o,d,l,m,e=0;e<256;++e){o=r^r<<1^r<<2^r<<3^r<<4,o=o>>8^o&255^99,Is[i]=o,Bne[o]=i,d=a[o],t=a[i],n=a[t],s=a[n],l=d<<24^o<<16^o<<8^(o^d),m=(t^n^s)<<24^(i^s)<<16^(i^n^s)<<8^(i^t^s);for(var c=0;c<4;++c)kv[c][i]=l,Wl[c][o]=m,l=l<<24|l>>>8,m=m<<24|m>>>8;i===0?i=r=1:(i=t^a[a[a[t^s]]],r^=a[a[r]])}}function m8e(a,e){for(var i=a.slice(0),r,t=1,n=i.length,s=n+6+1,o=dq*s,d=n;d<o;++d)r=i[d-1],d%n===0?(r=Is[r>>>16&255]<<24^Is[r>>>8&255]<<16^Is[r&255]<<8^Is[r>>>24]^d8e[t]<<24,t++):n>6&&d%n===4&&(r=Is[r>>>24]<<24^Is[r>>>16&255]<<16^Is[r>>>8&255]<<8^Is[r&255]),i[d]=i[d-n]^r;if(e){var l,m=Wl[0],c=Wl[1],u=Wl[2],f=Wl[3],N=i.slice(0);o=i.length;for(var d=0,_=o-dq;d<o;d+=dq,_-=dq)if(d===0||d===o-dq)N[d]=i[_],N[d+1]=i[_+3],N[d+2]=i[_+2],N[d+3]=i[_+1];else for(var v=0;v<dq;++v)l=i[_+v],N[d+(3&-v)]=m[Is[l>>>24]]^c[Is[l>>>16&255]]^u[Is[l>>>8&255]]^f[Is[l&255]];i=N}return i}function Une(a,e,i,r){var t=a.length/4-1,n,s,o,d,l;r?(n=Wl[0],s=Wl[1],o=Wl[2],d=Wl[3],l=Bne):(n=kv[0],s=kv[1],o=kv[2],d=kv[3],l=Is);var m,c,u,f,N,_,v;m=e[0]^a[0],c=e[r?3:1]^a[1],u=e[2]^a[2],f=e[r?1:3]^a[3];for(var h=3,w=1;w<t;++w)N=n[m>>>24]^s[c>>>16&255]^o[u>>>8&255]^d[f&255]^a[++h],_=n[c>>>24]^s[u>>>16&255]^o[f>>>8&255]^d[m&255]^a[++h],v=n[u>>>24]^s[f>>>16&255]^o[m>>>8&255]^d[c&255]^a[++h],f=n[f>>>24]^s[m>>>16&255]^o[c>>>8&255]^d[u&255]^a[++h],m=N,c=_,u=v;i[0]=l[m>>>24]<<24^l[c>>>16&255]<<16^l[u>>>8&255]<<8^l[f&255]^a[++h],i[r?3:1]=l[c>>>24]<<24^l[u>>>16&255]<<16^l[f>>>8&255]<<8^l[m&255]^a[++h],i[2]=l[u>>>24]<<24^l[f>>>16&255]<<16^l[m>>>8&255]<<8^l[c&255]^a[++h],i[r?1:3]=l[f>>>24]<<24^l[m>>>16&255]<<16^l[c>>>8&255]<<8^l[u&255]^a[++h]}function BV(a){a=a||{};var e=(a.mode||"CBC").toUpperCase(),i="AES-"+e,r;a.decrypt?r=ur.cipher.createDecipher(i,a.key):r=ur.cipher.createCipher(i,a.key);var t=r.start;return r.start=function(n,s){var o=null;s instanceof ur.util.ByteBuffer&&(o=s,s={}),s=s||{},s.output=o,s.iv=n,t.call(r,s)},r}});var VN=Ie((dst,u8e)=>{var LA=La();LA.pki=LA.pki||{};var zne=u8e.exports=LA.pki.oids=LA.oids=LA.oids||{};function ye(a,e){zne[a]=e,zne[e]=a}function Oi(a,e){zne[a]=e}ye("1.2.840.113549.1.1.1","rsaEncryption");ye("1.2.840.113549.1.1.4","md5WithRSAEncryption");ye("1.2.840.113549.1.1.5","sha1WithRSAEncryption");ye("1.2.840.113549.1.1.7","RSAES-OAEP");ye("1.2.840.113549.1.1.8","mgf1");ye("1.2.840.113549.1.1.9","pSpecified");ye("1.2.840.113549.1.1.10","RSASSA-PSS");ye("1.2.840.113549.1.1.11","sha256WithRSAEncryption");ye("1.2.840.113549.1.1.12","sha384WithRSAEncryption");ye("1.2.840.113549.1.1.13","sha512WithRSAEncryption");ye("1.3.101.112","EdDSA25519");ye("1.2.840.10040.4.3","dsa-with-sha1");ye("1.3.14.3.2.7","desCBC");ye("1.3.14.3.2.26","sha1");ye("1.3.14.3.2.29","sha1WithRSASignature");ye("2.16.840.1.101.3.4.2.1","sha256");ye("2.16.840.1.101.3.4.2.2","sha384");ye("2.16.840.1.101.3.4.2.3","sha512");ye("2.16.840.1.101.3.4.2.4","sha224");ye("2.16.840.1.101.3.4.2.5","sha512-224");ye("2.16.840.1.101.3.4.2.6","sha512-256");ye("1.2.840.113549.2.2","md2");ye("1.2.840.113549.2.5","md5");ye("1.2.840.113549.1.7.1","data");ye("1.2.840.113549.1.7.2","signedData");ye("1.2.840.113549.1.7.3","envelopedData");ye("1.2.840.113549.1.7.4","signedAndEnvelopedData");ye("1.2.840.113549.1.7.5","digestedData");ye("1.2.840.113549.1.7.6","encryptedData");ye("1.2.840.113549.1.9.1","emailAddress");ye("1.2.840.113549.1.9.2","unstructuredName");ye("1.2.840.113549.1.9.3","contentType");ye("1.2.840.113549.1.9.4","messageDigest");ye("1.2.840.113549.1.9.5","signingTime");ye("1.2.840.113549.1.9.6","counterSignature");ye("1.2.840.113549.1.9.7","challengePassword");ye("1.2.840.113549.1.9.8","unstructuredAddress");ye("1.2.840.113549.1.9.14","extensionRequest");ye("1.2.840.113549.1.9.20","friendlyName");ye("1.2.840.113549.1.9.21","localKeyId");ye("1.2.840.113549.1.9.22.1","x509Certificate");ye("1.2.840.113549.1.12.10.1.1","keyBag");ye("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");ye("1.2.840.113549.1.12.10.1.3","certBag");ye("1.2.840.113549.1.12.10.1.4","crlBag");ye("1.2.840.113549.1.12.10.1.5","secretBag");ye("1.2.840.113549.1.12.10.1.6","safeContentsBag");ye("1.2.840.113549.1.5.13","pkcs5PBES2");ye("1.2.840.113549.1.5.12","pkcs5PBKDF2");ye("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");ye("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");ye("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");ye("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");ye("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");ye("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");ye("1.2.840.113549.2.7","hmacWithSHA1");ye("1.2.840.113549.2.8","hmacWithSHA224");ye("1.2.840.113549.2.9","hmacWithSHA256");ye("1.2.840.113549.2.10","hmacWithSHA384");ye("1.2.840.113549.2.11","hmacWithSHA512");ye("1.2.840.113549.3.7","des-EDE3-CBC");ye("2.16.840.1.101.3.4.1.2","aes128-CBC");ye("2.16.840.1.101.3.4.1.22","aes192-CBC");ye("2.16.840.1.101.3.4.1.42","aes256-CBC");ye("2.5.4.3","commonName");ye("2.5.4.4","surname");ye("2.5.4.5","serialNumber");ye("2.5.4.6","countryName");ye("2.5.4.7","localityName");ye("2.5.4.8","stateOrProvinceName");ye("2.5.4.9","streetAddress");ye("2.5.4.10","organizationName");ye("2.5.4.11","organizationalUnitName");ye("2.5.4.12","title");ye("2.5.4.13","description");ye("2.5.4.15","businessCategory");ye("2.5.4.17","postalCode");ye("2.5.4.42","givenName");ye("2.5.4.65","pseudonym");ye("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");ye("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");ye("2.16.840.1.113730.1.1","nsCertType");ye("2.16.840.1.113730.1.13","nsComment");Oi("2.5.29.1","authorityKeyIdentifier");Oi("2.5.29.2","keyAttributes");Oi("2.5.29.3","certificatePolicies");Oi("2.5.29.4","keyUsageRestriction");Oi("2.5.29.5","policyMapping");Oi("2.5.29.6","subtreesConstraint");Oi("2.5.29.7","subjectAltName");Oi("2.5.29.8","issuerAltName");Oi("2.5.29.9","subjectDirectoryAttributes");Oi("2.5.29.10","basicConstraints");Oi("2.5.29.11","nameConstraints");Oi("2.5.29.12","policyConstraints");Oi("2.5.29.13","basicConstraints");ye("2.5.29.14","subjectKeyIdentifier");ye("2.5.29.15","keyUsage");Oi("2.5.29.16","privateKeyUsagePeriod");ye("2.5.29.17","subjectAltName");ye("2.5.29.18","issuerAltName");ye("2.5.29.19","basicConstraints");Oi("2.5.29.20","cRLNumber");Oi("2.5.29.21","cRLReason");Oi("2.5.29.22","expirationDate");Oi("2.5.29.23","instructionCode");Oi("2.5.29.24","invalidityDate");Oi("2.5.29.25","cRLDistributionPoints");Oi("2.5.29.26","issuingDistributionPoint");Oi("2.5.29.27","deltaCRLIndicator");Oi("2.5.29.28","issuingDistributionPoint");Oi("2.5.29.29","certificateIssuer");Oi("2.5.29.30","nameConstraints");ye("2.5.29.31","cRLDistributionPoints");ye("2.5.29.32","certificatePolicies");Oi("2.5.29.33","policyMappings");Oi("2.5.29.34","policyConstraints");ye("2.5.29.35","authorityKeyIdentifier");Oi("2.5.29.36","policyConstraints");ye("2.5.29.37","extKeyUsage");Oi("2.5.29.46","freshestCRL");Oi("2.5.29.54","inhibitAnyPolicy");ye("1.3.6.1.4.1.11129.2.4.2","timestampList");ye("1.3.6.1.5.5.7.1.1","authorityInfoAccess");ye("1.3.6.1.5.5.7.3.1","serverAuth");ye("1.3.6.1.5.5.7.3.2","clientAuth");ye("1.3.6.1.5.5.7.3.3","codeSigning");ye("1.3.6.1.5.5.7.3.4","emailProtection");ye("1.3.6.1.5.5.7.3.8","timeStamping")});var Gl=Ie((lst,N8e)=>{var qr=La();vi();VN();var xe=N8e.exports=qr.asn1=qr.asn1||{};xe.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};xe.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};xe.maxDepth=256;xe.create=function(a,e,i,r,t){if(qr.util.isArray(r)){for(var n=[],s=0;s<r.length;++s)r[s]!==void 0&&n.push(r[s]);r=n}var o={tagClass:a,type:e,constructed:i,composed:i||qr.util.isArray(r),value:r};return t&&"bitStringContents"in t&&(o.bitStringContents=t.bitStringContents,o.original=xe.copy(o)),o};xe.copy=function(a,e){var i;if(qr.util.isArray(a)){i=[];for(var r=0;r<a.length;++r)i.push(xe.copy(a[r],e));return i}return typeof a=="string"?a:(i={tagClass:a.tagClass,type:a.type,constructed:a.constructed,composed:a.composed,value:xe.copy(a.value,e)},e&&!e.excludeBitStringContents&&(i.bitStringContents=a.bitStringContents),i)};xe.equals=function(a,e,i){if(qr.util.isArray(a)){if(!qr.util.isArray(e)||a.length!==e.length)return!1;for(var r=0;r<a.length;++r)if(!xe.equals(a[r],e[r]))return!1;return!0}if(typeof a!=typeof e)return!1;if(typeof a=="string")return a===e;var t=a.tagClass===e.tagClass&&a.type===e.type&&a.constructed===e.constructed&&a.composed===e.composed&&xe.equals(a.value,e.value);return i&&i.includeBitStringContents&&(t=t&&a.bitStringContents===e.bitStringContents),t};xe.getBerValueLength=function(a){var e=a.getByte();if(e!==128){var i,r=e&128;return r?i=a.getInt((e&127)<<3):i=e,i}};function OA(a,e,i){if(i>e){var r=new Error("Too few bytes to parse DER.");throw r.available=a.length(),r.remaining=e,r.requested=i,r}}var Rwi=function(a,e){var i=a.getByte();if(e--,i!==128){var r,t=i&128;if(!t)r=i;else{var n=i&127;OA(a,e,n),r=a.getInt(n<<3)}if(r<0)throw new Error("Negative length: "+r);return r}};xe.fromDer=function(a,e){e===void 0&&(e={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof e=="boolean"&&(e={strict:e,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"parseAllBytes"in e||(e.parseAllBytes=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),"maxDepth"in e||(e.maxDepth=xe.maxDepth),typeof a=="string"&&(a=qr.util.createBuffer(a));var i=a.length(),r=UV(a,a.length(),0,e);if(e.parseAllBytes&&a.length()!==0){var t=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw t.byteCount=i,t.remaining=a.length(),t}return r};function UV(a,e,i,r){if(i>=r.maxDepth)throw new Error("ASN.1 parsing error: Max depth exceeded.");var t;OA(a,e,2);var n=a.getByte();e--;var s=n&192,o=n&31;t=a.length();var d=Rwi(a,e);if(e-=t-a.length(),d!==void 0&&d>e){if(r.strict){var l=new Error("Too few bytes to read ASN.1 value.");throw l.available=a.length(),l.remaining=e,l.requested=d,l}d=e}var m,c,u=(n&32)===32;if(u)if(m=[],d===void 0)for(;;){if(OA(a,e,2),a.bytes(2)==="\0\0"){a.getBytes(2),e-=2;break}t=a.length(),m.push(UV(a,e,i+1,r)),e-=t-a.length()}else for(;d>0;)t=a.length(),m.push(UV(a,d,i+1,r)),e-=t-a.length(),d-=t-a.length();if(m===void 0&&s===xe.Class.UNIVERSAL&&o===xe.Type.BITSTRING&&(c=a.bytes(d)),m===void 0&&r.decodeBitStrings&&s===xe.Class.UNIVERSAL&&o===xe.Type.BITSTRING&&d>1){var f=a.read,N=e,_=0;if(o===xe.Type.BITSTRING&&(OA(a,e,1),_=a.getByte(),e--),_===0)try{t=a.length();var v={strict:!0,decodeBitStrings:!0},h=UV(a,e,i+1,v),w=t-a.length();e-=w,o==xe.Type.BITSTRING&&w++;var g=h.tagClass;w===d&&(g===xe.Class.UNIVERSAL||g===xe.Class.CONTEXT_SPECIFIC)&&(m=[h])}catch{}m===void 0&&(a.read=f,e=N)}if(m===void 0){if(d===void 0){if(r.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");d=e}if(o===xe.Type.BMPSTRING)for(m="";d>0;d-=2)OA(a,e,2),m+=String.fromCharCode(a.getInt16()),e-=2;else m=a.getBytes(d),e-=d}var k=c===void 0?null:{bitStringContents:c};return xe.create(s,o,u,m,k)}xe.toDer=function(a){var e=qr.util.createBuffer(),i=a.tagClass|a.type,r=qr.util.createBuffer(),t=!1;if("bitStringContents"in a&&(t=!0,a.original&&(t=xe.equals(a,a.original))),t)r.putBytes(a.bitStringContents);else if(a.composed){a.constructed?i|=32:r.putByte(0);for(var n=0;n<a.value.length;++n)a.value[n]!==void 0&&r.putBuffer(xe.toDer(a.value[n]))}else if(a.type===xe.Type.BMPSTRING)for(var n=0;n<a.value.length;++n)r.putInt16(a.value.charCodeAt(n));else a.type===xe.Type.INTEGER&&a.value.length>1&&(a.value.charCodeAt(0)===0&&(a.value.charCodeAt(1)&128)===0||a.value.charCodeAt(0)===255&&(a.value.charCodeAt(1)&128)===128)?r.putBytes(a.value.substr(1)):r.putBytes(a.value);if(e.putByte(i),r.length()<=127)e.putByte(r.length()&127);else{var s=r.length(),o="";do o+=String.fromCharCode(s&255),s=s>>>8;while(s>0);e.putByte(o.length|128);for(var n=o.length-1;n>=0;--n)e.putByte(o.charCodeAt(n))}return e.putBuffer(r),e};xe.oidToDer=function(a){var e=a.split("."),i=qr.util.createBuffer();i.putByte(40*parseInt(e[0],10)+parseInt(e[1],10));for(var r,t,n,s,o=2;o<e.length;++o){if(r=!0,t=[],n=parseInt(e[o],10),n>4294967295)throw new Error("OID value too large; max is 32-bits.");do s=n&127,n=n>>>7,r||(s|=128),t.push(s),r=!1;while(n>0);for(var d=t.length-1;d>=0;--d)i.putByte(t[d])}return i};xe.derToOid=function(a){var e;typeof a=="string"&&(a=qr.util.createBuffer(a));var i=a.getByte();e=Math.floor(i/40)+"."+i%40;for(var r=0;a.length()>0;){if(r>70368744177663)throw new Error("OID value too large; max is 53-bits.");i=a.getByte(),r=r*128,i&128?r+=i&127:(e+="."+(r+i),r=0)}return e};xe.utcTimeToDate=function(a){var e=new Date,i=parseInt(a.substr(0,2),10);i=i>=50?1900+i:2e3+i;var r=parseInt(a.substr(2,2),10)-1,t=parseInt(a.substr(4,2),10),n=parseInt(a.substr(6,2),10),s=parseInt(a.substr(8,2),10),o=0;if(a.length>11){var d=a.charAt(10),l=10;d!=="+"&&d!=="-"&&(o=parseInt(a.substr(10,2),10),l+=2)}if(e.setUTCFullYear(i,r,t),e.setUTCHours(n,s,o,0),l&&(d=a.charAt(l),d==="+"||d==="-")){var m=parseInt(a.substr(l+1,2),10),c=parseInt(a.substr(l+4,2),10),u=m*60+c;u*=6e4,d==="+"?e.setTime(+e-u):e.setTime(+e+u)}return e};xe.generalizedTimeToDate=function(a){var e=new Date,i=parseInt(a.substr(0,4),10),r=parseInt(a.substr(4,2),10)-1,t=parseInt(a.substr(6,2),10),n=parseInt(a.substr(8,2),10),s=parseInt(a.substr(10,2),10),o=parseInt(a.substr(12,2),10),d=0,l=0,m=!1;a.charAt(a.length-1)==="Z"&&(m=!0);var c=a.length-5,u=a.charAt(c);if(u==="+"||u==="-"){var f=parseInt(a.substr(c+1,2),10),N=parseInt(a.substr(c+4,2),10);l=f*60+N,l*=6e4,u==="+"&&(l*=-1),m=!0}return a.charAt(14)==="."&&(d=parseFloat(a.substr(14),10)*1e3),m?(e.setUTCFullYear(i,r,t),e.setUTCHours(n,s,o,d),e.setTime(+e+l)):(e.setFullYear(i,r,t),e.setHours(n,s,o,d)),e};xe.dateToUtcTime=function(a){if(typeof a=="string")return a;var e="",i=[];i.push((""+a.getUTCFullYear()).substr(2)),i.push(""+(a.getUTCMonth()+1)),i.push(""+a.getUTCDate()),i.push(""+a.getUTCHours()),i.push(""+a.getUTCMinutes()),i.push(""+a.getUTCSeconds());for(var r=0;r<i.length;++r)i[r].length<2&&(e+="0"),e+=i[r];return e+="Z",e};xe.dateToGeneralizedTime=function(a){if(typeof a=="string")return a;var e="",i=[];i.push(""+a.getUTCFullYear()),i.push(""+(a.getUTCMonth()+1)),i.push(""+a.getUTCDate()),i.push(""+a.getUTCHours()),i.push(""+a.getUTCMinutes()),i.push(""+a.getUTCSeconds());for(var r=0;r<i.length;++r)i[r].length<2&&(e+="0"),e+=i[r];return e+="Z",e};xe.integerToDer=function(a){var e=qr.util.createBuffer();if(a>=-128&&a<128)return e.putSignedInt(a,8);if(a>=-32768&&a<32768)return e.putSignedInt(a,16);if(a>=-8388608&&a<8388608)return e.putSignedInt(a,24);if(a>=-2147483648&&a<2147483648)return e.putSignedInt(a,32);var i=new Error("Integer too large; max is 32-bits.");throw i.integer=a,i};xe.derToInteger=function(a){typeof a=="string"&&(a=qr.util.createBuffer(a));var e=a.length()*8;if(e>32)throw new Error("Integer too large; max is 32-bits.");return a.getSignedInt(e)};xe.validate=function(a,e,i,r){var t=!1;if((a.tagClass===e.tagClass||typeof e.tagClass>"u")&&(a.type===e.type||typeof e.type>"u"))if(a.constructed===e.constructed||typeof e.constructed>"u"){if(t=!0,e.value&&qr.util.isArray(e.value))for(var n=0,s=0;t&&s<e.value.length;++s){var o=e.value[s];t=!!o.optional;var d=a.value[n];if(!d){o.optional||(t=!1,r&&r.push("["+e.name+'] Missing required element. Expected tag class "'+o.tagClass+'", type "'+o.type+'"'));continue}var l=typeof o.tagClass<"u"&&typeof o.type<"u";if(l&&(d.tagClass!==o.tagClass||d.type!==o.type))if(o.optional){t=!0;continue}else{t=!1,r&&r.push("["+e.name+"] Tag mismatch. Expected ("+o.tagClass+","+o.type+"), got ("+d.tagClass+","+d.type+")");break}var m=xe.validate(d,o,i,r);if(m)++n,t=!0;else if(o.optional)t=!0;else{t=!1;break}}if(t&&i&&(e.capture&&(i[e.capture]=a.value),e.captureAsn1&&(i[e.captureAsn1]=a),e.captureBitStringContents&&"bitStringContents"in a&&(i[e.captureBitStringContents]=a.bitStringContents),e.captureBitStringValue&&"bitStringContents"in a)){var c;if(a.bitStringContents.length<2)i[e.captureBitStringValue]="";else{var u=a.bitStringContents.charCodeAt(0);if(u!==0)throw new Error("captureBitStringValue only supported for zero unused bits");i[e.captureBitStringValue]=a.bitStringContents.slice(1)}}}else r&&r.push("["+e.name+'] Expected constructed "'+e.constructed+'", got "'+a.constructed+'"');else r&&(a.tagClass!==e.tagClass&&r.push("["+e.name+'] Expected tag class "'+e.tagClass+'", got "'+a.tagClass+'"'),a.type!==e.type&&r.push("["+e.name+'] Expected type "'+e.type+'", got "'+a.type+'"'));return t};var f8e=/[^\\u0000-\\u00ff]/;xe.prettyPrint=function(a,e,i){var r="";e=e||0,i=i||2,e>0&&(r+=`