@minimax-ai/code 0.3.9 → 0.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/CHANGELOG.zh-CN.md +13 -0
- package/chunks/{chunk-BJMNDLWT.js → chunk-MCBYVEVA.js} +1 -1
- package/chunks/{chunk-CTHP2I62.js → chunk-P2ZQPHDU.js} +1 -1
- package/chunks/{chunk-U2NOFGEC.js → chunk-UXJBOM6Z.js} +489 -489
- package/chunks/{launcher-CRWDSPMP.js → launcher-6OPLN32C.js} +93 -93
- package/chunks/{lifecycle-53YARWA5.js → lifecycle-SE3HYR6H.js} +1 -1
- package/chunks/{main-I2GTN2NG.js → main-SEFSP27Y.js} +1 -1
- package/chunks/{plugin-command-AKGMERKZ.js → plugin-command-I45AT3FL.js} +1 -1
- package/chunks/{provider-command-DKDOT7OP.js → provider-command-FXCWI6GT.js} +1 -1
- package/chunks/{run-acp-command-IRGYH5GM.js → run-acp-command-ZUNHLPG5.js} +1 -1
- package/chunks/{run-exec-command-WKCMWDQS.js → run-exec-command-GWJ73TKO.js} +1 -1
- package/cli.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,19 @@ This changelog covers important changes that directly affect MCode TUI users. It
|
|
|
7
7
|
|
|
8
8
|
Internal refactors, test-only changes, and changes limited to other product surfaces are excluded.
|
|
9
9
|
|
|
10
|
+
## 0.3.11 · 2026-09-09
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Fixed long-running tasks stopping with a 401 error after repeated sign-in credential renewals.
|
|
15
|
+
|
|
16
|
+
## 0.3.10 · 2026-09-08
|
|
17
|
+
|
|
18
|
+
### Improved
|
|
19
|
+
|
|
20
|
+
- Selected options use consistent blue highlighting across TUI menus and pickers.
|
|
21
|
+
- Command descriptions consistently use English across the command menu.
|
|
22
|
+
|
|
10
23
|
## 0.3.9 · 2026-09-07
|
|
11
24
|
|
|
12
25
|
### Fixed
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -8,6 +8,19 @@ TUI 正式版中用户能直接感知的重要变化。收录范围以 TUI 用
|
|
|
8
8
|
|
|
9
9
|
仅内部重构、测试调整,或只影响其他产品界面且不改变 TUI 行为的变化不记录。
|
|
10
10
|
|
|
11
|
+
## 0.3.11 · 2026-09-09
|
|
12
|
+
|
|
13
|
+
### 问题修复
|
|
14
|
+
|
|
15
|
+
- 修复长任务中登录凭据多次续期后,模型请求仍使用旧凭据而以 401 中断的问题。
|
|
16
|
+
|
|
17
|
+
## 0.3.10 · 2026-09-08
|
|
18
|
+
|
|
19
|
+
### 体验改进
|
|
20
|
+
|
|
21
|
+
- TUI 菜单和选择器中的选中项统一使用蓝色高亮。
|
|
22
|
+
- 命令菜单中的命令说明统一使用英文。
|
|
23
|
+
|
|
11
24
|
## 0.3.9 · 2026-09-07
|
|
12
25
|
|
|
13
26
|
### 问题修复
|
|
@@ -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{c as d,i as f}from"./chunk-
|
|
2
|
+
import{c as d,i as f}from"./chunk-UXJBOM6Z.js";var h=/<(?:deliver[-_]assets|media|publish[_-]artifact|preview_card|genui-|mavis-widget|mavis-thinking|mavis-progress|think|final|permission-(?:ask|response)|questionnaire-(?:ask|response))\b|^\s*preview_cards?:\s*$/imu;function L(t){let n=k(t);return n.assets.length===0?n.text:[n.text,T(n.assets)].filter(Boolean).join(`
|
|
3
3
|
|
|
4
4
|
`)}function k(t){if(!t||!h.test(t))return{text:t,assets:[]};let n=d(t),e=[],s=[],r="\uE000mcode-protected";for(;t.includes(r);)r+="-";let i=!1,o=n.map(a=>{if(a.type==="protected"){let c=e.push(a.content)-1;return`${r}-${c}\uE001`}return h.test(a.content)?(i=!0,A(a.content,s)):a.content}).join("");if(!i)return{text:t,assets:[]};let u=_(o);e.forEach((a,c)=>{u=u.replace(`${r}-${c}\uE001`,a)});let l=[...new Map(s.map(a=>[a.path.trim(),a])).values()];return{text:u,assets:l.map(a=>({path:a.path.trim(),...a.name?.trim()?{name:a.name.trim()}:{}}))}}function A(t,n){let e=t;return e=p(e,"mavis-thinking"),e=p(e,"think"),e=w(e,"mavis-progress"),e=p(e,"permission-ask"),e=p(e,"permission-response"),e=p(e,"questionnaire-ask"),e=p(e,"questionnaire-response"),e=e.replace(/<\/?final\b[^>]*>/giu,""),e=y(e),e=$(e),e=D(e),e=E(e),e=I(e,n),e=e.replace(/<\/?(?:deliver-assets|deliver_assets)\b[^>]*>/giu,"file attachment").replace(/<media\b[^>]*\/?>/giu,"file attachment").replace(/<media\b[^>]*$/iu,""),e}function p(t,n){let e=new RegExp(`<${n}\\b[^>]*>((?:(?!<${n}\\b)[\\s\\S])*?)<\\/${n}\\s*>`,"giu"),s=t,r=t.replace(e,"");for(;r!==s;)s=r,r=r.replace(e,"");return r}function w(t,n){let e=new RegExp(`<${n}\\b[^>]*>((?:(?!<${n}\\b)[\\s\\S])*?)<\\/${n}\\s*>`,"giu"),s=t,r=t.replace(e,(i,o)=>o.trim());for(;r!==s;)s=r,r=r.replace(e,(i,o)=>o.trim());return r}function y(t){let n=/<mavis-widget\b([^>]*)>([\s\S]*?)<\/mavis-widget\s*>/giu,e=t.replace(n,(s,r,i)=>{let o=/<mavis-fallback\b[^>]*>([\s\S]*?)<\/mavis-fallback\s*>/iu.exec(i)?.[1];return o?.trim()?o.trim():v(g(r))});return e=e.replace(/<mavis-widget\b([^>]*)>[\s\S]*$/iu,(s,r)=>v(g(r))),e.replace(/<mavis-widget\b[^>]*$/iu,"Interactive content is loading\u2026")}function v(t){let n=t.kind?.trim(),e=t.title?.trim();return n&&e?`Interactive ${n}: ${e} (open in Desktop).`:e?`Interactive content: ${e} (open in Desktop).`:"Interactive content available in Desktop."}function $(t){let n=/<genui-([\w-]+)\b([^>]*)>[\s\S]*?<\/genui-\1\s*>/giu,e=/<genui-([\w-]+)\b([^>]*?)\/\s*>/giu,s=t.replace(n,(r,i,o)=>b(i,g(o)));return s=s.replace(e,(r,i,o)=>b(i,g(o))),s.replace(/<genui-[\w-]*\b[^>]*$/iu,"Interactive content is loading\u2026")}function b(t,n){if(t.toLocaleLowerCase()==="mcp-auth"){let e=n.label?.trim()||n["server-id"]?.trim();return e?`MCP authorization required: ${e} (open in Desktop).`:"MCP authorization required (open in Desktop)."}if(t.toLocaleLowerCase()==="agent-team-recommendation"){let e=n.status?.trim().toLocaleLowerCase();return e==="accepted"?"Team recommendation accepted.":e==="skipped"?"Team recommendation skipped.":"Team recommendation available in Desktop."}return"Interactive content available in Desktop."}function g(t){let n={},e=/([\w-]+)\s*=\s*(["'])(.*?)\2/gu,s;for(;(s=e.exec(t))!==null;){let r=s[1],i=s[3];r&&i!==void 0&&(n[r]=C(i))}return n}function D(t){let n=/<(deliver-assets|deliver_assets)\b[^>]*>\s*<\/\1\s*>/giu,e=t,s=t.replace(n,"");for(;s!==e;)e=s,s=s.replace(n,"");return s}function C(t){return t.replace(/"/gu,'"').replace(/'|'/gu,"'").replace(/</gu,"<").replace(/>/gu,">").replace(/&/gu,"&")}function E(t){let n=/<\/?(deliver-assets|deliver_assets)\b[^>]*>/giu,e=[],s;for(;(s=n.exec(t))!==null;)e.push({start:s.index,end:n.lastIndex,name:s[1]?.toLocaleLowerCase()??"",closing:s[0].startsWith("</")});if(e.length===0)return t;let r=[],i=new Set;if(e.forEach((l,a)=>{if(!l.closing){r.push(a);return}for(let c=r.length-1;c>=0;c-=1){let m=r[c];if(!(m===void 0||e[m]?.name!==l.name)){r.splice(c,1),i.add(m),i.add(a);return}}}),i.size===e.length)return t;let o=0,u="";return e.forEach((l,a)=>{u+=t.slice(o,l.start),u+=i.has(a)?t.slice(l.start,l.end):"file attachment",o=l.end}),u+t.slice(o)}function I(t,n){let e=t;for(let s=0;s<3;s+=1){let r=f(e),i=R(r);if(i.assets.length===0)break;n.push(...i.assets),e=i.text}return e}function R(t){let n=[],e=[];for(let s of t)s.type==="deliver-assets"||s.type==="image-gallery"?e.push(...s.items):s.content.trim()&&n.push(s.content.trim());return{text:n.join(`
|
|
5
5
|
|
|
@@ -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 xie,b as aT,c as rn,d as up,e as fp,f as iT,g as $o,h as Mie,i as ru}from"./chunk-4ESEMCSG.js";import{$ as Dr,$a as nee,$b as Wee,$c as $,$d as die,A as MS,Aa as xr,Ab as ls,Ac as uae,Ad as Bae,Ae as Rie,B as PS,Ba as Cw,Bb as bee,Bc as fae,Bd as Kae,Be as Aie,C as _Z,Ca as zS,Cb as Iee,Cc as Nae,Cd as mp,Ce as ez,D as hZ,Da as Rw,Db as See,Dc as W2,Dd as YS,E as vZ,Ea as L2,Eb as VS,Ec as pae,Ed as X2,F as Yl,Fa as VZ,Fb as U2,Fc as _ae,Fd as Vae,G as qZ,Ga as WZ,Gb as X,Gc as hae,Gd as Wae,H as jZ,Ha as GZ,Hb as Tee,Hc as vae,Hd as J2,I as PXe,Ia as $Z,Ib as Eee,Ic as wae,Id as Gae,J as bZ,Ja as HZ,Jb as Cee,Jc as iu,Jd as $ae,K as IZ,Ka as QZ,Kb as E,Kc as gae,Kd as Hae,L as SZ,La as rp,Lb as Ree,Lc as yae,Ld as Qae,M as TZ,Ma as Aw,Mb as Aee,Mc as kae,Md as Y2,N as EZ,Na as O2,Nb as Dee,Nc as qae,Nd as Xae,O as LS,Oa as XZ,Ob as D,Oc as jae,Od as ZS,P as CZ,Pa as JZ,Pb as xee,Pc as bae,Pd as Jae,Q as RZ,Qa as YZ,Qb as Mee,Qd as Yae,R as AZ,Ra as ZZ,Rb as Pee,Rc as Iae,Rd as eT,S as en,Sa as Dw,Sb as Lee,Sc as Sae,Sd as Zae,T as Hd,Ta as eee,Tb as Oee,Tc as Tae,Td as eie,U as Mi,Ua as eu,Ub as Fee,Uc as Eae,Ud as aie,V as Oa,Va as aee,Vb as Uee,Vc as Cae,Vd as iie,W as M2,Wa as iee,Wb as zee,Wc as op,Wd as rie,X as DZ,Xa as an,Xb as z2,Xc as dp,Xd as tie,Y as ga,Ya as BS,Yb as Bee,Yc as G2,Yd as nie,Z as Qd,Za as ree,Zb as Kee,Zc as Rae,Zd as sie,_ as Zr,_a as tee,_b as Vee,_c as $2,_d as oie,aa as OS,ab as see,ac as B2,ad as GS,ae as lie,ba as FS,bb as oee,bc as Gee,bd as Aae,be as mie,ca as US,cb as dee,cc as $ee,cd as $S,ce as cie,d as tZ,da as xZ,db as lee,dc as Hee,dd as H2,de as uie,e as nZ,ea as MZ,eb as mee,ec as Qee,ed as Dae,ee as em,f as sZ,fa as PZ,fb as cee,fc as Xee,fd as xae,fe as fie,g as AS,ga as LZ,gb as uee,gc as Jee,gd as Mae,ge as cp,h as oZ,ha as OZ,hb as fee,hc as Yee,hd as HS,he as Z2,ia as FZ,ib as Nee,ic as Zee,id as LXe,ie as Nie,j as Tw,ja as UZ,jb as KS,jc as eae,jd as Pw,je as pie,k as lZ,ka as zZ,kb as tp,kc as aae,kd as Lw,ke as _ie,l as Ks,la as ze,lb as pee,lc as iae,ld as OXe,le as hie,m as A2,ma as pe,mb as _ee,mc as rae,md as Zl,me as Fw,n as cZ,na as BZ,nb as hee,nc as tae,nd as Pae,ne as vie,o as ep,oa as Ni,ob as vee,oc as nae,od as QS,oe as wie,pa as ap,pb as F2,pc as WS,pd as lp,pe as gie,qa as P2,qb as wee,qc as sae,qd as XS,qe as yie,ra as ip,rb as gee,rc as oae,rd as JS,re as kie,s as uZ,sa as KZ,sb as yee,sc as dae,sd as Ow,se as qie,ta as ds,tb as kee,tc as lae,td as Q2,te as jie,ua as Ew,ub as np,uc as au,ud as Lae,ue as bie,v as fZ,va as Zc,vb as qee,vc as sp,vd as Oae,ve as Iie,w as NZ,wa as Vs,wb as Go,wc as K2,wd as Fae,we as Sie,x as pZ,xa as qi,xb as xw,xc as mae,xe as Tie,ya as Fa,yb as Mw,yc as cae,yd as Uae,ye as Eie,z as xS,za as Me,zb as jee,zc as V2,zd as zae,ze as Cie}from"./chunk-U2NOFGEC.js";import{d as CS}from"./chunk-A2CQYOXE.js";import{d as iZ,e as rZ,f as RS,g as DS,h as R2,i as dZ,l as D2,q as x2}from"./chunk-ZXUXZKGU.js";import{a as Die}from"./chunk-ACTS7L64.js";import{c as kZ}from"./chunk-GMXY243M.js";import{a as mZ,b as ZN}from"./chunk-C3JRMX7L.js";import{a as az,b as Uw,c as iz}from"./chunk-R6GVNV7J.js";import{a as gZ,b as yZ}from"./chunk-ECV3PLKX.js";import{a as Pie}from"./chunk-4Y64C4JT.js";import{a as MXe}from"./chunk-HQ2U4QVQ.js";import{a as q2,e as L7,f as O7,g as F7,k as eZ,p as aZ}from"./chunk-SEVVS6ZS.js";import{A as qw,B as ss,Ea as $d,Fa as Z7,Ga as Yc,H as jw,Ha as E2,Ia as C2,J as jn,K as K7,O as Ge,P as ma,Q as XN,R as Yr,S as V7,U as vS,V as wS,a as QN,aa as gS,b as Be,ba as yS,c as U7,ea as JN,fa as kS,g as j2,ia as Xl,ja as oi,ma as qS,n as yw,o as kw,oa as Jc,sa as W7,ta as jS,u as z7,ua as G7,va as os,w as B7}from"./chunk-XO2KLR35.js";import{A as ES,B as Sw,C as Y7,E as T2,a as b2,c as YN,d as bS,e as Jl,f as bw,g as $7,h as IS,i as Iw,p as H7,r as Q7,s as SS,u as X7,v as I2,w as S2,x as J7,z as TS}from"./chunk-MMRA4VD2.js";import{a as wZ}from"./chunk-KSPFS4MM.js";import{a as Ri,c as We,e as fi}from"./chunk-D76SO2ME.js";var a1=We((_Mi,jNe)=>{"use strict";var pma=Ri("util"),qNe=Ri("stream"),co=jNe.exports=function(){qNe.call(this),this._buffers=[],this._buffered=0,this._reads=[],this._paused=!1,this._encoding="utf8",this.writable=!0};pma.inherits(co,qNe);co.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))};co.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};co.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()))};co.prototype.destroySoon=co.prototype.end;co.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("Unexpected end of input")),this.destroy()};co.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))};co.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))};co.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)};co.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 r1=We(i1=>{"use strict";var Rm=[{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]}];i1.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<Rm.length;o++){let d=Rm[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};i1.getInterlaceIterator=function(a){return function(e,i,r){let t=e%Rm[r].x.length,n=(e-t)/Rm[r].x.length*8+Rm[r].x[t],s=i%Rm[r].y.length,o=(i-s)/Rm[r].y.length*8+Rm[r].y[s];return n*4+o*a*4}}});var t1=We((vMi,bNe)=>{"use strict";bNe.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 n1=We((wMi,SNe)=>{"use strict";var _ma=r1(),hma=t1();function INe(a,e,i){let r=a*e;return i!==8&&(r=Math.ceil(r/(8/i))),r}var E_=SNe.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=_ma.getImagePasses(i,r);for(let d=0;d<o.length;d++)this._images.push({byteWidth:INe(o[d].width,n,s),height:o[d].height,lineIndex:0})}else this._images.push({byteWidth:INe(i,n,s),height:r,lineIndex:0});s===8?this._xComparison=n:s===16?this._xComparison=n*2:this._xComparison=1};E_.prototype.start=function(){this.read(this._images[this._imageIndex].byteWidth+1,this._reverseFilterLine.bind(this))};E_.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}};E_.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}};E_.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}};E_.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=hma(l,d,m);e[s]=o+c}};E_.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 CNe=We((gMi,ENe)=>{"use strict";var vma=Ri("util"),TNe=a1(),wma=n1(),gma=ENe.exports=function(a){TNe.call(this);let e=[],i=this;this._filter=new wma(a,{read:this.read.bind(this),write:function(r){e.push(r)},complete:function(){i.emit("complete",Buffer.concat(e))}}),this._filter.start()};vma.inherits(gma,TNe)});var C_=We((yMi,RNe)=>{"use strict";RNe.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 d1=We((kMi,ANe)=>{"use strict";var s1=[];(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;s1[a]=e}})();var o1=ANe.exports=function(){this._crc=-1};o1.prototype.write=function(a){for(let e=0;e<a.length;e++)this._crc=s1[(this._crc^a[e])&255]^this._crc>>>8;return!0};o1.prototype.crc32=function(){return this._crc^-1};o1.crc32=function(a){let e=-1;for(let i=0;i<a.length;i++)e=s1[(e^a[i])&255]^e>>>8;return e^-1}});var l1=We((qMi,DNe)=>{"use strict";var gr=C_(),yma=d1(),Wr=DNe.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[gr.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[gr.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[gr.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[gr.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[gr.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[gr.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(){}};Wr.prototype.start=function(){this.read(gr.PNG_SIGNATURE.length,this._parseSignature.bind(this))};Wr.prototype._parseSignature=function(a){let e=gr.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))};Wr.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!==gr.TYPE_IHDR){this.error(new Error("Expected IHDR on beggining"));return}if(this._crc=new yma,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))};Wr.prototype._skipChunk=function(){this.read(8,this._parseChunkBegin.bind(this))};Wr.prototype._handleChunkEnd=function(){this.read(4,this._parseChunkEnd.bind(this))};Wr.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))};Wr.prototype._handleIHDR=function(a){this.read(a,this._parseIHDR.bind(this))};Wr.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 gr.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=gr.COLORTYPE_TO_BPP_MAP[this._colorType];this._hasIHDR=!0,this.metadata({width:e,height:i,depth:r,interlace:!!o,palette:!!(t&gr.COLORTYPE_PALETTE),color:!!(t&gr.COLORTYPE_COLOR),alpha:!!(t&gr.COLORTYPE_ALPHA),bpp:d,colorType:t}),this._handleChunkEnd()};Wr.prototype._handlePLTE=function(a){this.read(a,this._parsePLTE.bind(this))};Wr.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()};Wr.prototype._handleTRNS=function(a){this.simpleTransparency(),this.read(a,this._parseTRNS.bind(this))};Wr.prototype._parseTRNS=function(a){if(this._crc.write(a),this._colorType===gr.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===gr.COLORTYPE_GRAYSCALE&&this.transColor([a.readUInt16BE(0)]),this._colorType===gr.COLORTYPE_COLOR&&this.transColor([a.readUInt16BE(0),a.readUInt16BE(2),a.readUInt16BE(4)]),this._handleChunkEnd()};Wr.prototype._handleGAMA=function(a){this.read(a,this._parseGAMA.bind(this))};Wr.prototype._parseGAMA=function(a){this._crc.write(a),this.gamma(a.readUInt32BE(0)/gr.GAMMA_DIVISION),this._handleChunkEnd()};Wr.prototype._handleIDAT=function(a){this._emittedHeadersFinished||(this._emittedHeadersFinished=!0,this.headersFinished()),this.read(-a,this._parseIDAT.bind(this,a))};Wr.prototype._parseIDAT=function(a,e){if(this._crc.write(e),this._colorType===gr.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()};Wr.prototype._handleIEND=function(a){this.read(a,this._parseIEND.bind(this))};Wr.prototype._parseIEND=function(a){this._crc.write(a),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()}});var m1=We(MNe=>{"use strict";var xNe=r1(),kma=[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]}],qma=[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 jma(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 bma(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);kma[r](e,t,c,n),n+=r}return n}function Ima(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);qma[r](e,c,u,n)}t.resetAfterLine()}}MNe.dataToBitMap=function(a,e){let i=e.width,r=e.height,t=e.depth,n=e.bpp,s=e.interlace,o;t!==8&&(o=jma(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=xNe.getImagePasses(i,r),u=xNe.getInterlaceIterator(i,r);else{let f=0;u=function(){let p=f;return f+=4,p},c=[{width:i,height:r}]}for(let f=0;f<c.length;f++)t===8?m=bma(c[f],d,u,n,a,m):Ima(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 c1=We((bMi,PNe)=>{"use strict";function Sma(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 Tma(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 Ema(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}}PNe.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?Sma(a,l,t,n,d):(o&&Tma(a,l,t,n,o),r!==8&&!i&&(r===16&&(l=Buffer.alloc(t*n*4)),Ema(a,l,t,n,r))),l}});var FNe=We((IMi,ONe)=>{"use strict";var Cma=Ri("util"),u1=Ri("zlib"),LNe=a1(),Rma=CNe(),Ama=l1(),Dma=m1(),xma=c1(),sd=ONe.exports=function(a){LNe.call(this),this._parser=new Ama(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()};Cma.inherits(sd,LNe);sd.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};sd.prototype._inflateData=function(a){if(!this._inflate)if(this._bitmapInfo.interlace)this._inflate=u1.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,u1.Z_MIN_CHUNK);this._inflate=u1.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)};sd.prototype._handleMetaData=function(a){this._metaData=a,this._bitmapInfo=Object.create(a),this._filter=new Rma(this._bitmapInfo)};sd.prototype._handleTransColor=function(a){this._bitmapInfo.transColor=a};sd.prototype._handlePalette=function(a){this._bitmapInfo.palette=a};sd.prototype._simpleTransparency=function(){this._metaData.alpha=!0};sd.prototype._headersFinished=function(){this.emit("metadata",this._metaData)};sd.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"))};sd.prototype._complete=function(a){if(this.errord)return;let e;try{let i=Dma.dataToBitMap(a,this._bitmapInfo);e=xma(i,this._bitmapInfo,this._options.skipRescale),i=null}catch(i){this._handleError(i);return}this.emit("parsed",e)}});var zNe=We((SMi,UNe)=>{"use strict";var ks=C_();UNe.exports=function(a,e,i,r){let t=[ks.COLORTYPE_COLOR_ALPHA,ks.COLORTYPE_ALPHA].indexOf(r.colorType)!==-1;if(r.colorType===r.inputColorType){let p=(function(){let _=new ArrayBuffer(2);return new DataView(_).setInt16(0,256,!0),new Int16Array(_)[0]!==256})();if(r.bitDepth===8||r.bitDepth===16&&p)return a}let n=r.bitDepth!==16?a:new Uint16Array(a.buffer),s=255,o=ks.COLORTYPE_TO_BPP_MAP[r.inputColorType];o===4&&!r.inputHasAlpha&&(o=3);let d=ks.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 p,_,v,h=s;switch(r.inputColorType){case ks.COLORTYPE_COLOR_ALPHA:h=n[m+3],p=n[m],_=n[m+1],v=n[m+2];break;case ks.COLORTYPE_COLOR:p=n[m],_=n[m+1],v=n[m+2];break;case ks.COLORTYPE_ALPHA:h=n[m+1],p=n[m],_=p,v=p;break;case ks.COLORTYPE_GRAYSCALE:p=n[m],_=p,v=p;break;default:throw new Error("input color type:"+r.inputColorType+" is not supported at present")}return r.inputHasAlpha&&(t||(h/=s,p=Math.min(Math.max(Math.round((1-h)*u.red+h*p),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:p,green:_,blue:v,alpha:h}}for(let p=0;p<i;p++)for(let _=0;_<e;_++){let v=f(n,m);switch(r.colorType){case ks.COLORTYPE_COLOR_ALPHA:case ks.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 ks.COLORTYPE_ALPHA:case ks.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 VNe=We((TMi,KNe)=>{"use strict";var BNe=t1();function Mma(a,e,i,r,t){for(let n=0;n<i;n++)r[t+n]=a[e+n]}function Pma(a,e,i){let r=0,t=e+i;for(let n=e;n<t;n++)r+=Math.abs(a[n]);return r}function Lma(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 Oma(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 Fma(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 Uma(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 zma(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 Bma(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 Kma(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]-BNe(o,d,l);r[t+s]=m}}function Vma(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]-BNe(s,o,d);t+=Math.abs(l)}return t}var Wma={0:Mma,1:Lma,2:Fma,3:zma,4:Kma},Gma={0:Pma,1:Oma,2:Uma,3:Bma,4:Vma};KNe.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 p=Gma[n[f]](a,d,s,t);p<u&&(m=n[f],u=p)}}l[o]=m,o++,Wma[m](a,d,s,l,o,t),o+=s,d+=s}return l}});var f1=We((EMi,WNe)=>{"use strict";var _t=C_(),$ma=d1(),Hma=zNe(),Qma=VNe(),Xma=Ri("zlib"),Am=WNe.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||Xma.createDeflate,a.bitDepth=a.bitDepth||8,a.colorType=typeof a.colorType=="number"?a.colorType:_t.COLORTYPE_COLOR_ALPHA,a.inputColorType=typeof a.inputColorType=="number"?a.inputColorType:_t.COLORTYPE_COLOR_ALPHA,[_t.COLORTYPE_GRAYSCALE,_t.COLORTYPE_COLOR,_t.COLORTYPE_COLOR_ALPHA,_t.COLORTYPE_ALPHA].indexOf(a.colorType)===-1)throw new Error("option color type:"+a.colorType+" is not supported at present");if([_t.COLORTYPE_GRAYSCALE,_t.COLORTYPE_COLOR,_t.COLORTYPE_COLOR_ALPHA,_t.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")};Am.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}};Am.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())};Am.prototype.filterData=function(a,e,i){let r=Hma(a,e,i,this._options),t=_t.COLORTYPE_TO_BPP_MAP[this._options.colorType];return Qma(r,e,i,this._options,t)};Am.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($ma.crc32(r.slice(4,r.length-4)),r.length-4),r};Am.prototype.packGAMA=function(a){let e=Buffer.alloc(4);return e.writeUInt32BE(Math.floor(a*_t.GAMMA_DIVISION),0),this._packChunk(_t.TYPE_gAMA,e)};Am.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(_t.TYPE_IHDR,i)};Am.prototype.packIDAT=function(a){return this._packChunk(_t.TYPE_IDAT,a)};Am.prototype.packIEND=function(){return this._packChunk(_t.TYPE_IEND,null)}});var QNe=We((CMi,HNe)=>{"use strict";var Jma=Ri("util"),GNe=Ri("stream"),Yma=C_(),Zma=f1(),$Ne=HNe.exports=function(a){GNe.call(this);let e=a||{};this._packer=new Zma(e),this._deflate=this._packer.createDeflate(),this.readable=!0};Jma.inherits($Ne,GNe);$Ne.prototype.pack=function(a,e,i,r){this.emit("data",Buffer.from(Yma.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 ape=We((lk,epe)=>{"use strict";var XNe=Ri("assert").ok,R_=Ri("zlib"),eca=Ri("util"),JNe=Ri("buffer").kMaxLength;function pf(a){if(!(this instanceof pf))return new pf(a);a&&a.chunkSize<R_.Z_MIN_CHUNK&&(a.chunkSize=R_.Z_MIN_CHUNK),R_.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 aca(a){return new pf(a)}function YNe(a,e){e&&process.nextTick(e),a._handle&&(a._handle.close(),a._handle=null)}pf.prototype._processChunk=function(a,e,i){if(typeof i=="function")return R_.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(p){m=p});function c(p,_){if(r._hadError)return;let v=n-_;if(XNe(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-p,t=p,!0):!1}XNe(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>=JNe)throw YNe(this),new RangeError("Cannot create final Buffer. It would be larger than 0x"+JNe.toString(16)+" bytes");let f=Buffer.concat(d,l);return YNe(this),f};eca.inherits(pf,R_.Inflate);function ica(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=R_.Z_FINISH),a._processChunk(e,i)}function ZNe(a,e){return ica(new pf(e),a)}epe.exports=lk=ZNe;lk.Inflate=pf;lk.createInflate=aca;lk.inflateSync=ZNe});var N1=We((RMi,rpe)=>{"use strict";var ipe=rpe.exports=function(a){this._buffer=a,this._reads=[]};ipe.prototype.read=function(a,e){this._reads.push({length:Math.abs(a),allowLess:a<0,func:e})};ipe.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 npe=We(tpe=>{"use strict";var rca=N1(),tca=n1();tpe.process=function(a,e){let i=[],r=new rca(a);return new tca(e,{read:r.read.bind(r),write:function(n){i.push(n)},complete:function(){}}).start(),r.process(),Buffer.concat(i)}});var lpe=We((DMi,dpe)=>{"use strict";var spe=!0,ope=Ri("zlib"),nca=ape();ope.deflateSync||(spe=!1);var sca=N1(),oca=npe(),dca=l1(),lca=m1(),mca=c1();dpe.exports=function(a,e){if(!spe)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 sca(a);if(new dca(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=ope.inflateSync(_);else{let S=((t.width*t.bpp*t.depth+7>>3)+1)*t.height;v=nca(_,{chunkSize:S,maxLength:S})}if(_=null,!v||!v.length)throw new Error("bad png - invalid inflate data response");let h=oca.process(v,t);_=null;let w=lca.dataToBitMap(h,t);h=null;let y=mca(w,t,e.skipRescale);return t.data=y,t.gamma=l||0,t}});var fpe=We((xMi,upe)=>{"use strict";var mpe=!0,cpe=Ri("zlib");cpe.deflateSync||(mpe=!1);var cca=C_(),uca=f1();upe.exports=function(a,e){if(!mpe)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 uca(i),t=[];t.push(Buffer.from(cca.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=cpe.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 Npe=We(p1=>{"use strict";var fca=lpe(),Nca=fpe();p1.read=function(a,e){return fca(a,e||{})};p1.write=function(a,e){return Nca(a,e)}});var mk=We(_pe=>{"use strict";var pca=Ri("util"),ppe=Ri("stream"),_ca=FNe(),hca=QNe(),vca=Npe(),Lt=_pe.PNG=function(a){ppe.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 _ca(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 hca(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"))};pca.inherits(Lt,ppe);Lt.sync=vca;Lt.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)};Lt.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};Lt.prototype.write=function(a){return this._parser.write(a),!0};Lt.prototype.end=function(a){this._parser.end(a)};Lt.prototype._metadata=function(a){this.width=a.width,this.height=a.height,this.emit("metadata",a)};Lt.prototype._gamma=function(a){this.gamma=a};Lt.prototype._handleClose=function(){!this._parser.writable&&!this._packer.readable&&this.emit("close")};Lt.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)};Lt.prototype.bitblt=function(a,e,i,r,t,n,s){return Lt.bitblt(this,a,e,i,r,t,n,s),this};Lt.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}};Lt.prototype.adjustGamma=function(){Lt.adjustGamma(this)}});var wpe=We((LMi,bA)=>{var vpe=vpe||function(a){return Buffer.from(a).toString("base64")};function wca(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),p=new Array(64),_=new Array(64),v=[],h=0,w=7,y=new Array(64),k=new Array(64),S=new Array(64),M=new Array(256),C=new Array(2048),L,P=[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],K=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],O=[0,1,2,3,4,5,6,7,8,9,10,11],W=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],Q=[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],fe=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],re=[0,1,2,3,4,5,6,7,8,9,10,11],qe=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],$e=[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 Y(V){for(var Ie=[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],Ue=0;Ue<64;Ue++){var Re=r((Ie[Ue]*V+50)/100);Re<1?Re=1:Re>255&&(Re=255),t[P[Ue]]=Re}for(var Xe=[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],Ye=0;Ye<64;Ye++){var qa=r((Xe[Ye]*V+50)/100);qa<1?qa=1:qa>255&&(qa=255),n[P[Ye]]=qa}for(var ja=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],Ci=0,si=0;si<8;si++)for(var ee=0;ee<8;ee++)s[Ci]=1/(t[P[Ci]]*ja[si]*ja[ee]*8),o[Ci]=1/(n[P[Ci]]*ja[si]*ja[ee]*8),Ci++}function me(V,Ie){for(var Ue=0,Re=0,Xe=new Array,Ye=1;Ye<=16;Ye++){for(var qa=1;qa<=V[Ye];qa++)Xe[Ie[Re]]=[],Xe[Ie[Re]][0]=Ue,Xe[Ie[Re]][1]=Ye,Re++,Ue++;Ue*=2}return Xe}function be(){d=me(K,O),l=me(fe,re),m=me(W,Q),c=me(qe,$e)}function xe(){for(var V=1,Ie=2,Ue=1;Ue<=15;Ue++){for(var Re=V;Re<Ie;Re++)f[32767+Re]=Ue,u[32767+Re]=[],u[32767+Re][1]=Ue,u[32767+Re][0]=Re;for(var Xe=-(Ie-1);Xe<=-V;Xe++)f[32767+Xe]=Ue,u[32767+Xe]=[],u[32767+Xe][1]=Ue,u[32767+Xe][0]=Ie-1+Xe;V<<=1,Ie<<=1}}function he(){for(var V=0;V<256;V++)C[V]=19595*V,C[V+256>>0]=38470*V,C[V+512>>0]=7471*V+32768,C[V+768>>0]=-11059*V,C[V+1024>>0]=-21709*V,C[V+1280>>0]=32768*V+8421375,C[V+1536>>0]=-27439*V,C[V+1792>>0]=-5329*V}function ce(V){for(var Ie=V[0],Ue=V[1]-1;Ue>=0;)Ie&1<<Ue&&(h|=1<<w),Ue--,w--,w<0&&(h==255?(z(255),z(0)):z(h),w=7,h=0)}function z(V){v.push(V)}function U(V){z(V>>8&255),z(V&255)}function J(V,Ie){var Ue,Re,Xe,Ye,qa,ja,Ci,si,ee=0,Ne,He=8,ki=64;for(Ne=0;Ne<He;++Ne){Ue=V[ee],Re=V[ee+1],Xe=V[ee+2],Ye=V[ee+3],qa=V[ee+4],ja=V[ee+5],Ci=V[ee+6],si=V[ee+7];var Ze=Ue+si,Na=Ue-si,Qa=Re+Ci,Ve=Re-Ci,xa=Xe+ja,Jr=Xe-ja,ui=Ye+qa,ns=Ye-qa,Wo=Ze+ui,Xc=Ze-ui,$N=Qa+xa,HN=Qa-xa;V[ee]=Wo+$N,V[ee+4]=Wo-$N;var Nw=(HN+Xc)*.707106781;V[ee+2]=Xc+Nw,V[ee+6]=Xc-Nw,Wo=ns+Jr,$N=Jr+Ve,HN=Ve+Na;var pw=(Wo-HN)*.382683433,NS=.5411961*Wo+pw,_w=1.306562965*HN+pw,hw=$N*.707106781,vw=Na+hw,ww=Na-hw;V[ee+5]=ww+NS,V[ee+3]=ww-NS,V[ee+1]=vw+_w,V[ee+7]=vw-_w,ee+=8}for(ee=0,Ne=0;Ne<He;++Ne){Ue=V[ee],Re=V[ee+8],Xe=V[ee+16],Ye=V[ee+24],qa=V[ee+32],ja=V[ee+40],Ci=V[ee+48],si=V[ee+56];var j7=Ue+si,y2=Ue-si,b7=Re+Ci,I7=Re-Ci,S7=Xe+ja,T7=Xe-ja,E7=Ye+qa,xXe=Ye-qa,gw=j7+E7,k2=j7-E7,pS=b7+S7,_S=b7-S7;V[ee]=gw+pS,V[ee+32]=gw-pS;var C7=(_S+k2)*.707106781;V[ee+16]=k2+C7,V[ee+48]=k2-C7,gw=xXe+T7,pS=T7+I7,_S=I7+y2;var R7=(gw-_S)*.382683433,A7=.5411961*gw+R7,D7=1.306562965*_S+R7,x7=pS*.707106781,M7=y2+x7,P7=y2-x7;V[ee+40]=P7+A7,V[ee+24]=P7-A7,V[ee+8]=M7+D7,V[ee+56]=M7-D7,ee++}var hS;for(Ne=0;Ne<ki;++Ne)hS=V[Ne]*Ie[Ne],p[Ne]=hS>0?hS+.5|0:hS-.5|0;return p}function oe(){U(65504),U(16),z(74),z(70),z(73),z(70),z(0),z(1),z(1),z(0),U(1),U(1),z(0),z(0)}function te(V){if(V){U(65505),V[0]===69&&V[1]===120&&V[2]===105&&V[3]===102?U(V.length+2):(U(V.length+5+2),z(69),z(120),z(105),z(102),z(0));for(var Ie=0;Ie<V.length;Ie++)z(V[Ie])}}function ue(V,Ie){U(65472),U(17),z(8),U(Ie),U(V),z(3),z(1),z(17),z(0),z(2),z(17),z(1),z(3),z(17),z(1)}function we(){U(65499),U(132),z(0);for(var V=0;V<64;V++)z(t[V]);z(1);for(var Ie=0;Ie<64;Ie++)z(n[Ie])}function Z(){U(65476),U(418),z(0);for(var V=0;V<16;V++)z(K[V+1]);for(var Ie=0;Ie<=11;Ie++)z(O[Ie]);z(16);for(var Ue=0;Ue<16;Ue++)z(W[Ue+1]);for(var Re=0;Re<=161;Re++)z(Q[Re]);z(1);for(var Xe=0;Xe<16;Xe++)z(fe[Xe+1]);for(var Ye=0;Ye<=11;Ye++)z(re[Ye]);z(17);for(var qa=0;qa<16;qa++)z(qe[qa+1]);for(var ja=0;ja<=161;ja++)z($e[ja])}function ae(V){typeof V>"u"||V.constructor!==Array||V.forEach(Ie=>{if(typeof Ie=="string"){U(65534);var Ue=Ie.length;U(Ue+2);var Re;for(Re=0;Re<Ue;Re++)z(Ie.charCodeAt(Re))}})}function na(){U(65498),U(12),z(3),z(1),z(0),z(2),z(17),z(3),z(17),z(0),z(63),z(0)}function Ce(V,Ie,Ue,Re,Xe){for(var Ye=Xe[0],qa=Xe[240],ja,Ci=16,si=63,ee=64,Ne=J(V,Ie),He=0;He<ee;++He)_[P[He]]=Ne[He];var ki=_[0]-Ue;Ue=_[0],ki==0?ce(Re[0]):(ja=32767+ki,ce(Re[f[ja]]),ce(u[ja]));for(var Ze=63;Ze>0&&_[Ze]==0;Ze--);if(Ze==0)return ce(Ye),Ue;for(var Na=1,Qa;Na<=Ze;){for(var Ve=Na;_[Na]==0&&Na<=Ze;++Na);var xa=Na-Ve;if(xa>=Ci){Qa=xa>>4;for(var Jr=1;Jr<=Qa;++Jr)ce(qa);xa=xa&15}ja=32767+_[Na],ce(Xe[(xa<<4)+f[ja]]),ce(u[ja]),Na++}return Ze!=si&&ce(Ye),Ue}function sa(){for(var V=String.fromCharCode,Ie=0;Ie<256;Ie++)M[Ie]=V(Ie)}this.encode=function(V,Ie){var Ue=new Date().getTime();Ie&&ts(Ie),v=new Array,h=0,w=7,U(65496),oe(),ae(V.comments),te(V.exifBuffer),we(),ue(V.width,V.height),Z(),na();var Re=0,Xe=0,Ye=0;h=0,w=7,this.encode.displayName="_encode_";for(var qa=V.data,ja=V.width,Ci=V.height,si=ja*4,ee=ja*3,Ne,He=0,ki,Ze,Na,Qa,Ve,xa,Jr,ui;He<Ci;){for(Ne=0;Ne<si;){for(Qa=si*He+Ne,Ve=Qa,xa=-1,Jr=0,ui=0;ui<64;ui++)Jr=ui>>3,xa=(ui&7)*4,Ve=Qa+Jr*si+xa,He+Jr>=Ci&&(Ve-=si*(He+1+Jr-Ci)),Ne+xa>=si&&(Ve-=Ne+xa-si+4),ki=qa[Ve++],Ze=qa[Ve++],Na=qa[Ve++],y[ui]=(C[ki]+C[Ze+256>>0]+C[Na+512>>0]>>16)-128,k[ui]=(C[ki+768>>0]+C[Ze+1024>>0]+C[Na+1280>>0]>>16)-128,S[ui]=(C[ki+1280>>0]+C[Ze+1536>>0]+C[Na+1792>>0]>>16)-128;Re=Ce(y,s,Re,d,m),Xe=Ce(k,o,Xe,l,c),Ye=Ce(S,o,Ye,l,c),Ne+=32}He+=8}if(w>=0){var ns=[];ns[1]=w+1,ns[0]=(1<<w+1)-1,ce(ns)}if(U(65497),typeof bA>"u")return new Uint8Array(v);return Buffer.from(v);var Wo,Xc};function ts(V){if(V<=0&&(V=1),V>100&&(V=100),L!=V){var Ie=0;V<50?Ie=Math.floor(5e3/V):Ie=Math.floor(200-V*2),Y(Ie),L=V}}function Bs(){var V=new Date().getTime();a||(a=50),sa(),be(),xe(),he(),ts(a);var Ie=new Date().getTime()-V}Bs()}typeof bA<"u"?bA.exports=hpe:typeof window<"u"&&(window["jpeg-js"]=window["jpeg-js"]||{},window["jpeg-js"].encode=hpe);function hpe(a,e){typeof e>"u"&&(e=50);var i=new wca(e),r=i.encode(a,e);return{data:r,width:a.width,height:a.height}}});var ype=We((OMi,h1)=>{var _1=(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,y){for(var k=0,S=[],M,C,L=16;L>0&&!w[L-1];)L--;S.push({children:[],index:0});var P=S[0],K;for(M=0;M<L;M++){for(C=0;C<w[M];C++){for(P=S.pop(),P.children[P.index]=y[k];P.index>0;){if(S.length===0)throw new Error("Could not recreate Huffman Table");P=S.pop()}for(P.index++,S.push(P);S.length<=M;)S.push(K={children:[],index:0}),P.children[P.index]=K.children,P=K;k++}M+1<L&&(S.push(K={children:[],index:0}),P.children[P.index]=K.children,P=K)}return S[0].children}function u(w,y,k,S,M,C,L,P,K,O){var W=k.precision,Q=k.samplesPerLine,fe=k.scanLines,re=k.mcusPerLine,qe=k.progressive,$e=k.maxH,Y=k.maxV,me=y,be=0,xe=0;function he(){if(xe>0)return xe--,be>>xe&1;if(be=w[y++],be==255){var ee=w[y++];if(ee)throw new Error("unexpected marker: "+(be<<8|ee).toString(16))}return xe=7,be>>>7}function ce(ee){for(var Ne=ee,He;(He=he())!==null;){if(Ne=Ne[He],typeof Ne=="number")return Ne;if(typeof Ne!="object")throw new Error("invalid huffman sequence")}return null}function z(ee){for(var Ne=0;ee>0;){var He=he();if(He===null)return;Ne=Ne<<1|He,ee--}return Ne}function U(ee){var Ne=z(ee);return Ne>=1<<ee-1?Ne:Ne+(-1<<ee)+1}function J(ee,Ne){var He=ce(ee.huffmanTableDC),ki=He===0?0:U(He);Ne[0]=ee.pred+=ki;for(var Ze=1;Ze<64;){var Na=ce(ee.huffmanTableAC),Qa=Na&15,Ve=Na>>4;if(Qa===0){if(Ve<15)break;Ze+=16;continue}Ze+=Ve;var xa=e[Ze];Ne[xa]=U(Qa),Ze++}}function oe(ee,Ne){var He=ce(ee.huffmanTableDC),ki=He===0?0:U(He)<<K;Ne[0]=ee.pred+=ki}function te(ee,Ne){Ne[0]|=he()<<K}var ue=0;function we(ee,Ne){if(ue>0){ue--;return}for(var He=C,ki=L;He<=ki;){var Ze=ce(ee.huffmanTableAC),Na=Ze&15,Qa=Ze>>4;if(Na===0){if(Qa<15){ue=z(Qa)+(1<<Qa)-1;break}He+=16;continue}He+=Qa;var Ve=e[He];Ne[Ve]=U(Na)*(1<<K),He++}}var Z=0,ae;function na(ee,Ne){for(var He=C,ki=L,Ze=0;He<=ki;){var Na=e[He],Qa=Ne[Na]<0?-1:1;switch(Z){case 0:var Ve=ce(ee.huffmanTableAC),xa=Ve&15,Ze=Ve>>4;if(xa===0)Ze<15?(ue=z(Ze)+(1<<Ze),Z=4):(Ze=16,Z=1);else{if(xa!==1)throw new Error("invalid ACn encoding");ae=U(xa),Z=Ze?2:3}continue;case 1:case 2:Ne[Na]?Ne[Na]+=(he()<<K)*Qa:(Ze--,Ze===0&&(Z=Z==2?3:0));break;case 3:Ne[Na]?Ne[Na]+=(he()<<K)*Qa:(Ne[Na]=ae<<K,Z=0);break;case 4:Ne[Na]&&(Ne[Na]+=(he()<<K)*Qa);break}He++}Z===4&&(ue--,ue===0&&(Z=0))}function Ce(ee,Ne,He,ki,Ze){var Na=He/re|0,Qa=He%re,Ve=Na*ee.v+ki,xa=Qa*ee.h+Ze;ee.blocks[Ve]===void 0&&O.tolerantDecoding||Ne(ee,ee.blocks[Ve][xa])}function sa(ee,Ne,He){var ki=He/ee.blocksPerLine|0,Ze=He%ee.blocksPerLine;ee.blocks[ki]===void 0&&O.tolerantDecoding||Ne(ee,ee.blocks[ki][Ze])}var ts=S.length,Bs,V,Ie,Ue,Re,Xe;qe?C===0?Xe=P===0?oe:te:Xe=P===0?we:na:Xe=J;var Ye=0,qa,ja;ts==1?ja=S[0].blocksPerLine*S[0].blocksPerColumn:ja=re*k.mcusPerColumn,M||(M=ja);for(var Ci,si;Ye<ja;){for(V=0;V<ts;V++)S[V].pred=0;if(ue=0,ts==1)for(Bs=S[0],Re=0;Re<M;Re++)sa(Bs,Xe,Ye),Ye++;else for(Re=0;Re<M;Re++){for(V=0;V<ts;V++)for(Bs=S[V],Ci=Bs.h,si=Bs.v,Ie=0;Ie<si;Ie++)for(Ue=0;Ue<Ci;Ue++)Ce(Bs,Xe,Ye,Ie,Ue);if(Ye++,Ye===ja)break}if(Ye===ja)do{if(w[y]===255&&w[y+1]!==0)break;y+=1}while(y<w.length-2);if(xe=0,qa=w[y]<<8|w[y+1],qa<65280)throw new Error("marker was not found");if(qa>=65488&&qa<=65495)y+=2;else break}return y-me}function f(w,y){var k=[],S=y.blocksPerLine,M=y.blocksPerColumn,C=S<<3,L=new Int32Array(64),P=new Uint8Array(64);function K(me,be,xe){var he=y.quantizationTable,ce,z,U,J,oe,te,ue,we,Z,ae=xe,na;for(na=0;na<64;na++)ae[na]=me[na]*he[na];for(na=0;na<8;++na){var Ce=8*na;if(ae[1+Ce]==0&&ae[2+Ce]==0&&ae[3+Ce]==0&&ae[4+Ce]==0&&ae[5+Ce]==0&&ae[6+Ce]==0&&ae[7+Ce]==0){Z=d*ae[0+Ce]+512>>10,ae[0+Ce]=Z,ae[1+Ce]=Z,ae[2+Ce]=Z,ae[3+Ce]=Z,ae[4+Ce]=Z,ae[5+Ce]=Z,ae[6+Ce]=Z,ae[7+Ce]=Z;continue}ce=d*ae[0+Ce]+128>>8,z=d*ae[4+Ce]+128>>8,U=ae[2+Ce],J=ae[6+Ce],oe=l*(ae[1+Ce]-ae[7+Ce])+128>>8,we=l*(ae[1+Ce]+ae[7+Ce])+128>>8,te=ae[3+Ce]<<4,ue=ae[5+Ce]<<4,Z=ce-z+1>>1,ce=ce+z+1>>1,z=Z,Z=U*o+J*s+128>>8,U=U*s-J*o+128>>8,J=Z,Z=oe-ue+1>>1,oe=oe+ue+1>>1,ue=Z,Z=we+te+1>>1,te=we-te+1>>1,we=Z,Z=ce-J+1>>1,ce=ce+J+1>>1,J=Z,Z=z-U+1>>1,z=z+U+1>>1,U=Z,Z=oe*n+we*t+2048>>12,oe=oe*t-we*n+2048>>12,we=Z,Z=te*r+ue*i+2048>>12,te=te*i-ue*r+2048>>12,ue=Z,ae[0+Ce]=ce+we,ae[7+Ce]=ce-we,ae[1+Ce]=z+ue,ae[6+Ce]=z-ue,ae[2+Ce]=U+te,ae[5+Ce]=U-te,ae[3+Ce]=J+oe,ae[4+Ce]=J-oe}for(na=0;na<8;++na){var sa=na;if(ae[8+sa]==0&&ae[16+sa]==0&&ae[24+sa]==0&&ae[32+sa]==0&&ae[40+sa]==0&&ae[48+sa]==0&&ae[56+sa]==0){Z=d*xe[na+0]+8192>>14,ae[0+sa]=Z,ae[8+sa]=Z,ae[16+sa]=Z,ae[24+sa]=Z,ae[32+sa]=Z,ae[40+sa]=Z,ae[48+sa]=Z,ae[56+sa]=Z;continue}ce=d*ae[0+sa]+2048>>12,z=d*ae[32+sa]+2048>>12,U=ae[16+sa],J=ae[48+sa],oe=l*(ae[8+sa]-ae[56+sa])+2048>>12,we=l*(ae[8+sa]+ae[56+sa])+2048>>12,te=ae[24+sa],ue=ae[40+sa],Z=ce-z+1>>1,ce=ce+z+1>>1,z=Z,Z=U*o+J*s+2048>>12,U=U*s-J*o+2048>>12,J=Z,Z=oe-ue+1>>1,oe=oe+ue+1>>1,ue=Z,Z=we+te+1>>1,te=we-te+1>>1,we=Z,Z=ce-J+1>>1,ce=ce+J+1>>1,J=Z,Z=z-U+1>>1,z=z+U+1>>1,U=Z,Z=oe*n+we*t+2048>>12,oe=oe*t-we*n+2048>>12,we=Z,Z=te*r+ue*i+2048>>12,te=te*i-ue*r+2048>>12,ue=Z,ae[0+sa]=ce+we,ae[56+sa]=ce-we,ae[8+sa]=z+ue,ae[48+sa]=z-ue,ae[16+sa]=U+te,ae[40+sa]=U-te,ae[24+sa]=J+oe,ae[32+sa]=J-oe}for(na=0;na<64;++na){var ts=128+(ae[na]+8>>4);be[na]=ts<0?0:ts>255?255:ts}}h(C*M*8);for(var O,W,Q=0;Q<M;Q++){var fe=Q<<3;for(O=0;O<8;O++)k.push(new Uint8Array(C));for(var re=0;re<S;re++){K(y.blocks[Q][re],P,L);var qe=0,$e=re<<3;for(W=0;W<8;W++){var Y=k[fe+W];for(O=0;O<8;O++)Y[$e+O]=P[qe++]}}}return k}function p(w){return w<0?0:w>255?255:w}m.prototype={load:function(y){var k=new XMLHttpRequest;k.open("GET",y,!0),k.responseType="arraybuffer",k.onload=(function(){var S=new Uint8Array(k.response||k.mozResponseArrayBuffer);this.parse(S),this.onload&&this.onload()}).bind(this),k.send(null)},parse:function(y){var k=this.opts.maxResolutionInMP*1e3*1e3,S=0,M=y.length;function C(){var Ve=y[S]<<8|y[S+1];return S+=2,Ve}function L(){var Ve=C(),xa=y.subarray(S,S+Ve-2);return S+=xa.length,xa}function P(Ve){var xa=1,Jr=1,ui,ns;for(ns in Ve.components)Ve.components.hasOwnProperty(ns)&&(ui=Ve.components[ns],xa<ui.h&&(xa=ui.h),Jr<ui.v&&(Jr=ui.v));var Wo=Math.ceil(Ve.samplesPerLine/8/xa),Xc=Math.ceil(Ve.scanLines/8/Jr);for(ns in Ve.components)if(Ve.components.hasOwnProperty(ns)){ui=Ve.components[ns];var $N=Math.ceil(Math.ceil(Ve.samplesPerLine/8)*ui.h/xa),HN=Math.ceil(Math.ceil(Ve.scanLines/8)*ui.v/Jr),Nw=Wo*ui.h,pw=Xc*ui.v,NS=pw*Nw,_w=[];h(NS*256);for(var hw=0;hw<pw;hw++){for(var vw=[],ww=0;ww<Nw;ww++)vw.push(new Int32Array(64));_w.push(vw)}ui.blocksPerLine=$N,ui.blocksPerColumn=HN,ui.blocks=_w}Ve.maxH=xa,Ve.maxV=Jr,Ve.mcusPerLine=Wo,Ve.mcusPerColumn=Xc}var K=null,O=null,W=null,Q,fe,re=[],qe=[],$e=[],Y=[],me=C(),be=-1;if(this.comments=[],me!=65496)throw new Error("SOI not found");for(me=C();me!=65497;){var xe,he,ce;switch(me){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 z=L();if(me===65534){var U=String.fromCharCode.apply(null,z);this.comments.push(U)}me===65504&&z[0]===74&&z[1]===70&&z[2]===73&&z[3]===70&&z[4]===0&&(K={version:{major:z[5],minor:z[6]},densityUnits:z[7],xDensity:z[8]<<8|z[9],yDensity:z[10]<<8|z[11],thumbWidth:z[12],thumbHeight:z[13],thumbData:z.subarray(14,14+3*z[12]*z[13])}),me===65505&&z[0]===69&&z[1]===120&&z[2]===105&&z[3]===102&&z[4]===0&&(this.exifBuffer=z.subarray(5,z.length)),me===65518&&z[0]===65&&z[1]===100&&z[2]===111&&z[3]===98&&z[4]===101&&z[5]===0&&(O={version:z[6],flags0:z[7]<<8|z[8],flags1:z[9]<<8|z[10],transformCode:z[11]});break;case 65499:for(var J=C(),oe=J+S-2;S<oe;){var te=y[S++];h(256);var ue=new Int32Array(64);if(te>>4===0)for(he=0;he<64;he++){var we=e[he];ue[we]=y[S++]}else if(te>>4===1)for(he=0;he<64;he++){var we=e[he];ue[we]=C()}else throw new Error("DQT: invalid table spec");re[te&15]=ue}break;case 65472:case 65473:case 65474:C(),Q={},Q.extended=me===65473,Q.progressive=me===65474,Q.precision=y[S++],Q.scanLines=C(),Q.samplesPerLine=C(),Q.components={},Q.componentsOrder=[];var Z=Q.scanLines*Q.samplesPerLine;if(Z>k){var ae=Math.ceil((Z-k)/1e6);throw new Error(`maxResolutionInMP limit exceeded by ${ae}MP`)}var na=y[S++],Ce,sa=0,ts=0;for(xe=0;xe<na;xe++){Ce=y[S];var Bs=y[S+1]>>4,V=y[S+1]&15,Ie=y[S+2];if(Bs<=0||V<=0)throw new Error("Invalid sampling factor, expected values above 0");Q.componentsOrder.push(Ce),Q.components[Ce]={h:Bs,v:V,quantizationIdx:Ie},S+=3}P(Q),qe.push(Q);break;case 65476:var Ue=C();for(xe=2;xe<Ue;){var Re=y[S++],Xe=new Uint8Array(16),Ye=0;for(he=0;he<16;he++,S++)Ye+=Xe[he]=y[S];h(16+Ye);var qa=new Uint8Array(Ye);for(he=0;he<Ye;he++,S++)qa[he]=y[S];xe+=17+Ye,(Re>>4===0?Y:$e)[Re&15]=c(Xe,qa)}break;case 65501:C(),fe=C();break;case 65500:C(),C();break;case 65498:var ja=C(),Ci=y[S++],si=[],ee;for(xe=0;xe<Ci;xe++){ee=Q.components[y[S++]];var Ne=y[S++];ee.huffmanTableDC=Y[Ne>>4],ee.huffmanTableAC=$e[Ne&15],si.push(ee)}var He=y[S++],ki=y[S++],Ze=y[S++],Na=u(y,S,Q,si,fe,He,ki,Ze>>4,Ze&15,this.opts);S+=Na;break;case 65535:y[S]!==255&&S--;break;default:if(y[S-3]==255&&y[S-2]>=192&&y[S-2]<=254){S-=3;break}else if(me===224||me==225){if(be!==-1)throw new Error(`first unknown JPEG marker at offset ${be.toString(16)}, second unknown JPEG marker ${me.toString(16)} at offset ${(S-1).toString(16)}`);be=S-1;let Ve=C();if(y[S+Ve-2]===255){S+=Ve-2;break}}throw new Error("unknown JPEG marker "+me.toString(16))}me=C()}if(qe.length!=1)throw new Error("only single frame JPEGs supported");for(var xe=0;xe<qe.length;xe++){var Qa=qe[xe].components;for(var he in Qa)Qa[he].quantizationTable=re[Qa[he].quantizationIdx],delete Qa[he].quantizationIdx}this.width=Q.samplesPerLine,this.height=Q.scanLines,this.jfif=K,this.adobe=O,this.components=[];for(var xe=0;xe<Q.componentsOrder.length;xe++){var ee=Q.components[Q.componentsOrder[xe]];this.components.push({lines:f(Q,ee),scaleX:ee.h/Q.maxH,scaleY:ee.v/Q.maxV})}},getData:function(y,k){var S=this.width/y,M=this.height/k,C,L,P,K,O,W,Q,fe,re,qe,$e=0,Y,me,be,xe,he,ce,z,U,J,oe,te,ue=y*k*this.components.length;h(ue);var we=new Uint8Array(ue);switch(this.components.length){case 1:for(C=this.components[0],qe=0;qe<k;qe++)for(O=C.lines[0|qe*C.scaleY*M],re=0;re<y;re++)Y=O[0|re*C.scaleX*S],we[$e++]=Y;break;case 2:for(C=this.components[0],L=this.components[1],qe=0;qe<k;qe++)for(O=C.lines[0|qe*C.scaleY*M],W=L.lines[0|qe*L.scaleY*M],re=0;re<y;re++)Y=O[0|re*C.scaleX*S],we[$e++]=Y,Y=W[0|re*L.scaleX*S],we[$e++]=Y;break;case 3:for(te=!0,this.adobe&&this.adobe.transformCode?te=!0:typeof this.opts.colorTransform<"u"&&(te=!!this.opts.colorTransform),C=this.components[0],L=this.components[1],P=this.components[2],qe=0;qe<k;qe++)for(O=C.lines[0|qe*C.scaleY*M],W=L.lines[0|qe*L.scaleY*M],Q=P.lines[0|qe*P.scaleY*M],re=0;re<y;re++)te?(Y=O[0|re*C.scaleX*S],me=W[0|re*L.scaleX*S],be=Q[0|re*P.scaleX*S],U=p(Y+1.402*(be-128)),J=p(Y-.3441363*(me-128)-.71413636*(be-128)),oe=p(Y+1.772*(me-128))):(U=O[0|re*C.scaleX*S],J=W[0|re*L.scaleX*S],oe=Q[0|re*P.scaleX*S]),we[$e++]=U,we[$e++]=J,we[$e++]=oe;break;case 4:if(!this.adobe)throw new Error("Unsupported color mode (4 components)");for(te=!1,this.adobe&&this.adobe.transformCode?te=!0:typeof this.opts.colorTransform<"u"&&(te=!!this.opts.colorTransform),C=this.components[0],L=this.components[1],P=this.components[2],K=this.components[3],qe=0;qe<k;qe++)for(O=C.lines[0|qe*C.scaleY*M],W=L.lines[0|qe*L.scaleY*M],Q=P.lines[0|qe*P.scaleY*M],fe=K.lines[0|qe*K.scaleY*M],re=0;re<y;re++)te?(Y=O[0|re*C.scaleX*S],me=W[0|re*L.scaleX*S],be=Q[0|re*P.scaleX*S],xe=fe[0|re*K.scaleX*S],he=255-p(Y+1.402*(be-128)),ce=255-p(Y-.3441363*(me-128)-.71413636*(be-128)),z=255-p(Y+1.772*(me-128))):(he=O[0|re*C.scaleX*S],ce=W[0|re*L.scaleX*S],z=Q[0|re*P.scaleX*S],xe=fe[0|re*K.scaleX*S]),we[$e++]=255-he,we[$e++]=255-ce,we[$e++]=255-z,we[$e++]=255-xe;break;default:throw new Error("Unsupported color mode")}return we},copyToImageData:function(y,k){var S=y.width,M=y.height,C=y.data,L=this.getData(S,M),P=0,K=0,O,W,Q,fe,re,qe,$e,Y,me;switch(this.components.length){case 1:for(W=0;W<M;W++)for(O=0;O<S;O++)Q=L[P++],C[K++]=Q,C[K++]=Q,C[K++]=Q,k&&(C[K++]=255);break;case 3:for(W=0;W<M;W++)for(O=0;O<S;O++)$e=L[P++],Y=L[P++],me=L[P++],C[K++]=$e,C[K++]=Y,C[K++]=me,k&&(C[K++]=255);break;case 4:for(W=0;W<M;W++)for(O=0;O<S;O++)re=L[P++],qe=L[P++],Q=L[P++],fe=L[P++],$e=255-p(re*(1-fe/255)+fe),Y=255-p(qe*(1-fe/255)+fe),me=255-p(Q*(1-fe/255)+fe),C[K++]=$e,C[K++]=Y,C[K++]=me,k&&(C[K++]=255);break;default:throw new Error("Unsupported color mode")}}};var _=0,v=0;function h(w=0){var y=_+w;if(y>v){var k=Math.ceil((y-v)/1024/1024);throw new Error(`maxMemoryUsageInMB limit exceeded by at least ${k}MB`)}_=y}return m.resetMaxMemoryUsage=function(w){_=0,v=w},m.getBytesAllocated=function(){return _},m.requestMemoryAllocation=h,m})();typeof h1<"u"?h1.exports=gpe:typeof window<"u"&&(window["jpeg-js"]=window["jpeg-js"]||{},window["jpeg-js"].decode=gpe);function gpe(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 _1;n.opts=r,_1.resetMaxMemoryUsage(r.maxMemoryUsageInMB*1024*1024),n.parse(t);var s=r.formatAsRGBA?4:3,o=n.width*n.height*s;try{_1.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 v1=We((FMi,kpe)=>{var gca=wpe(),yca=ype();kpe.exports={encode:gca,decode:yca}});var qke=We((YVi,kke)=>{function yke(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}yke.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};kke.exports=function(a,e){typeof e>"u"&&(e=100);var i=new yke(a),r=i.encode();return{data:r,width:a.width,height:a.height}}});var bke=We((ZVi,jke)=>{function qo(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()}qo.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)};qo.prototype.parseRGBA=function(){var a="bit"+this.bitPP,e=this.width*this.height*4;this.data=new Buffer(e),this[a]()};qo.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)}};qo.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,p=this.palette[u];if(this.data[a]=0,this.data[a+1]=p.blue,this.data[a+2]=p.green,this.data[a+3]=p.red,n*2+1>=this.width)break;p=this.palette[f],this.data[a+4]=0,this.data[a+4+1]=p.blue,this.data[a+4+2]=p.green,this.data[a+4+3]=p.red}m!=0&&(this.pos+=4-m)}};qo.prototype.bit8=function(){if(this.compress==1){let u=function(f){var p=this.palette[f];this.data[a]=0,this.data[a+1]=p.blue,this.data[a+2]=p.green,this.data[a+3]=p.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)}};qo.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}};qo.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}};qo.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}};qo.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}};qo.prototype.getData=function(){return this.data};jke.exports=function(a){var e=new qo(a);return e}});var Ske=We((eWi,Ike)=>{var Aka=qke(),Dka=bke();Ike.exports={encode:Aka,decode:Dka}});var gCe=We(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.CHAR=`
|
|
2
|
+
import{a as xie,b as aT,c as rn,d as up,e as fp,f as iT,g as $o,h as Mie,i as ru}from"./chunk-4ESEMCSG.js";import{$ as Dr,$a as nee,$b as Wee,$c as $,$d as die,A as MS,Aa as xr,Ab as ls,Ac as uae,Ad as Bae,Ae as Rie,B as PS,Ba as Cw,Bb as bee,Bc as fae,Bd as Kae,Be as Aie,C as _Z,Ca as zS,Cb as Iee,Cc as Nae,Cd as mp,Ce as ez,D as hZ,Da as Rw,Db as See,Dc as W2,Dd as YS,E as vZ,Ea as L2,Eb as VS,Ec as pae,Ed as X2,F as Yl,Fa as VZ,Fb as U2,Fc as _ae,Fd as Vae,G as qZ,Ga as WZ,Gb as X,Gc as hae,Gd as Wae,H as jZ,Ha as GZ,Hb as Tee,Hc as vae,Hd as J2,I as PXe,Ia as $Z,Ib as Eee,Ic as wae,Id as Gae,J as bZ,Ja as HZ,Jb as Cee,Jc as iu,Jd as $ae,K as IZ,Ka as QZ,Kb as E,Kc as gae,Kd as Hae,L as SZ,La as rp,Lb as Ree,Lc as yae,Ld as Qae,M as TZ,Ma as Aw,Mb as Aee,Mc as kae,Md as Y2,N as EZ,Na as O2,Nb as Dee,Nc as qae,Nd as Xae,O as LS,Oa as XZ,Ob as D,Oc as jae,Od as ZS,P as CZ,Pa as JZ,Pb as xee,Pc as bae,Pd as Jae,Q as RZ,Qa as YZ,Qb as Mee,Qd as Yae,R as AZ,Ra as ZZ,Rb as Pee,Rc as Iae,Rd as eT,S as en,Sa as Dw,Sb as Lee,Sc as Sae,Sd as Zae,T as Hd,Ta as eee,Tb as Oee,Tc as Tae,Td as eie,U as Mi,Ua as eu,Ub as Fee,Uc as Eae,Ud as aie,V as Oa,Va as aee,Vb as Uee,Vc as Cae,Vd as iie,W as M2,Wa as iee,Wb as zee,Wc as op,Wd as rie,X as DZ,Xa as an,Xb as z2,Xc as dp,Xd as tie,Y as ga,Ya as BS,Yb as Bee,Yc as G2,Yd as nie,Z as Qd,Za as ree,Zb as Kee,Zc as Rae,Zd as sie,_ as Zr,_a as tee,_b as Vee,_c as $2,_d as oie,aa as OS,ab as see,ac as B2,ad as GS,ae as lie,ba as FS,bb as oee,bc as Gee,bd as Aae,be as mie,ca as US,cb as dee,cc as $ee,cd as $S,ce as cie,d as tZ,da as xZ,db as lee,dc as Hee,dd as H2,de as uie,e as nZ,ea as MZ,eb as mee,ec as Qee,ed as Dae,ee as em,f as sZ,fa as PZ,fb as cee,fc as Xee,fd as xae,fe as fie,g as AS,ga as LZ,gb as uee,gc as Jee,gd as Mae,ge as cp,h as oZ,ha as OZ,hb as fee,hc as Yee,hd as HS,he as Z2,ia as FZ,ib as Nee,ic as Zee,id as LXe,ie as Nie,j as Tw,ja as UZ,jb as KS,jc as eae,jd as Pw,je as pie,k as lZ,ka as zZ,kb as tp,kc as aae,kd as Lw,ke as _ie,l as Ks,la as ze,lb as pee,lc as iae,ld as OXe,le as hie,m as A2,ma as pe,mb as _ee,mc as rae,md as Zl,me as Fw,n as cZ,na as BZ,nb as hee,nc as tae,nd as Pae,ne as vie,o as ep,oa as Ni,ob as vee,oc as nae,od as QS,oe as wie,pa as ap,pb as F2,pc as WS,pd as lp,pe as gie,qa as P2,qb as wee,qc as sae,qd as XS,qe as yie,ra as ip,rb as gee,rc as oae,rd as JS,re as kie,s as uZ,sa as KZ,sb as yee,sc as dae,sd as Ow,se as qie,ta as ds,tb as kee,tc as lae,td as Q2,te as jie,ua as Ew,ub as np,uc as au,ud as Lae,ue as bie,v as fZ,va as Zc,vb as qee,vc as sp,vd as Oae,ve as Iie,w as NZ,wa as Vs,wb as Go,wc as K2,wd as Fae,we as Sie,x as pZ,xa as qi,xb as xw,xc as mae,xe as Tie,ya as Fa,yb as Mw,yc as cae,yd as Uae,ye as Eie,z as xS,za as Me,zb as jee,zc as V2,zd as zae,ze as Cie}from"./chunk-UXJBOM6Z.js";import{d as CS}from"./chunk-A2CQYOXE.js";import{d as iZ,e as rZ,f as RS,g as DS,h as R2,i as dZ,l as D2,q as x2}from"./chunk-ZXUXZKGU.js";import{a as Die}from"./chunk-ACTS7L64.js";import{c as kZ}from"./chunk-GMXY243M.js";import{a as mZ,b as ZN}from"./chunk-C3JRMX7L.js";import{a as az,b as Uw,c as iz}from"./chunk-R6GVNV7J.js";import{a as gZ,b as yZ}from"./chunk-ECV3PLKX.js";import{a as Pie}from"./chunk-4Y64C4JT.js";import{a as MXe}from"./chunk-HQ2U4QVQ.js";import{a as q2,e as L7,f as O7,g as F7,k as eZ,p as aZ}from"./chunk-SEVVS6ZS.js";import{A as qw,B as ss,Ea as $d,Fa as Z7,Ga as Yc,H as jw,Ha as E2,Ia as C2,J as jn,K as K7,O as Ge,P as ma,Q as XN,R as Yr,S as V7,U as vS,V as wS,a as QN,aa as gS,b as Be,ba as yS,c as U7,ea as JN,fa as kS,g as j2,ia as Xl,ja as oi,ma as qS,n as yw,o as kw,oa as Jc,sa as W7,ta as jS,u as z7,ua as G7,va as os,w as B7}from"./chunk-XO2KLR35.js";import{A as ES,B as Sw,C as Y7,E as T2,a as b2,c as YN,d as bS,e as Jl,f as bw,g as $7,h as IS,i as Iw,p as H7,r as Q7,s as SS,u as X7,v as I2,w as S2,x as J7,z as TS}from"./chunk-MMRA4VD2.js";import{a as wZ}from"./chunk-KSPFS4MM.js";import{a as Ri,c as We,e as fi}from"./chunk-D76SO2ME.js";var a1=We((_Mi,jNe)=>{"use strict";var pma=Ri("util"),qNe=Ri("stream"),co=jNe.exports=function(){qNe.call(this),this._buffers=[],this._buffered=0,this._reads=[],this._paused=!1,this._encoding="utf8",this.writable=!0};pma.inherits(co,qNe);co.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))};co.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};co.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()))};co.prototype.destroySoon=co.prototype.end;co.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("Unexpected end of input")),this.destroy()};co.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))};co.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))};co.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)};co.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 r1=We(i1=>{"use strict";var Rm=[{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]}];i1.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<Rm.length;o++){let d=Rm[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};i1.getInterlaceIterator=function(a){return function(e,i,r){let t=e%Rm[r].x.length,n=(e-t)/Rm[r].x.length*8+Rm[r].x[t],s=i%Rm[r].y.length,o=(i-s)/Rm[r].y.length*8+Rm[r].y[s];return n*4+o*a*4}}});var t1=We((vMi,bNe)=>{"use strict";bNe.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 n1=We((wMi,SNe)=>{"use strict";var _ma=r1(),hma=t1();function INe(a,e,i){let r=a*e;return i!==8&&(r=Math.ceil(r/(8/i))),r}var E_=SNe.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=_ma.getImagePasses(i,r);for(let d=0;d<o.length;d++)this._images.push({byteWidth:INe(o[d].width,n,s),height:o[d].height,lineIndex:0})}else this._images.push({byteWidth:INe(i,n,s),height:r,lineIndex:0});s===8?this._xComparison=n:s===16?this._xComparison=n*2:this._xComparison=1};E_.prototype.start=function(){this.read(this._images[this._imageIndex].byteWidth+1,this._reverseFilterLine.bind(this))};E_.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}};E_.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}};E_.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}};E_.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=hma(l,d,m);e[s]=o+c}};E_.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 CNe=We((gMi,ENe)=>{"use strict";var vma=Ri("util"),TNe=a1(),wma=n1(),gma=ENe.exports=function(a){TNe.call(this);let e=[],i=this;this._filter=new wma(a,{read:this.read.bind(this),write:function(r){e.push(r)},complete:function(){i.emit("complete",Buffer.concat(e))}}),this._filter.start()};vma.inherits(gma,TNe)});var C_=We((yMi,RNe)=>{"use strict";RNe.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 d1=We((kMi,ANe)=>{"use strict";var s1=[];(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;s1[a]=e}})();var o1=ANe.exports=function(){this._crc=-1};o1.prototype.write=function(a){for(let e=0;e<a.length;e++)this._crc=s1[(this._crc^a[e])&255]^this._crc>>>8;return!0};o1.prototype.crc32=function(){return this._crc^-1};o1.crc32=function(a){let e=-1;for(let i=0;i<a.length;i++)e=s1[(e^a[i])&255]^e>>>8;return e^-1}});var l1=We((qMi,DNe)=>{"use strict";var gr=C_(),yma=d1(),Wr=DNe.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[gr.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[gr.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[gr.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[gr.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[gr.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[gr.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(){}};Wr.prototype.start=function(){this.read(gr.PNG_SIGNATURE.length,this._parseSignature.bind(this))};Wr.prototype._parseSignature=function(a){let e=gr.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))};Wr.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!==gr.TYPE_IHDR){this.error(new Error("Expected IHDR on beggining"));return}if(this._crc=new yma,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))};Wr.prototype._skipChunk=function(){this.read(8,this._parseChunkBegin.bind(this))};Wr.prototype._handleChunkEnd=function(){this.read(4,this._parseChunkEnd.bind(this))};Wr.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))};Wr.prototype._handleIHDR=function(a){this.read(a,this._parseIHDR.bind(this))};Wr.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 gr.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=gr.COLORTYPE_TO_BPP_MAP[this._colorType];this._hasIHDR=!0,this.metadata({width:e,height:i,depth:r,interlace:!!o,palette:!!(t&gr.COLORTYPE_PALETTE),color:!!(t&gr.COLORTYPE_COLOR),alpha:!!(t&gr.COLORTYPE_ALPHA),bpp:d,colorType:t}),this._handleChunkEnd()};Wr.prototype._handlePLTE=function(a){this.read(a,this._parsePLTE.bind(this))};Wr.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()};Wr.prototype._handleTRNS=function(a){this.simpleTransparency(),this.read(a,this._parseTRNS.bind(this))};Wr.prototype._parseTRNS=function(a){if(this._crc.write(a),this._colorType===gr.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===gr.COLORTYPE_GRAYSCALE&&this.transColor([a.readUInt16BE(0)]),this._colorType===gr.COLORTYPE_COLOR&&this.transColor([a.readUInt16BE(0),a.readUInt16BE(2),a.readUInt16BE(4)]),this._handleChunkEnd()};Wr.prototype._handleGAMA=function(a){this.read(a,this._parseGAMA.bind(this))};Wr.prototype._parseGAMA=function(a){this._crc.write(a),this.gamma(a.readUInt32BE(0)/gr.GAMMA_DIVISION),this._handleChunkEnd()};Wr.prototype._handleIDAT=function(a){this._emittedHeadersFinished||(this._emittedHeadersFinished=!0,this.headersFinished()),this.read(-a,this._parseIDAT.bind(this,a))};Wr.prototype._parseIDAT=function(a,e){if(this._crc.write(e),this._colorType===gr.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()};Wr.prototype._handleIEND=function(a){this.read(a,this._parseIEND.bind(this))};Wr.prototype._parseIEND=function(a){this._crc.write(a),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()}});var m1=We(MNe=>{"use strict";var xNe=r1(),kma=[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]}],qma=[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 jma(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 bma(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);kma[r](e,t,c,n),n+=r}return n}function Ima(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);qma[r](e,c,u,n)}t.resetAfterLine()}}MNe.dataToBitMap=function(a,e){let i=e.width,r=e.height,t=e.depth,n=e.bpp,s=e.interlace,o;t!==8&&(o=jma(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=xNe.getImagePasses(i,r),u=xNe.getInterlaceIterator(i,r);else{let f=0;u=function(){let p=f;return f+=4,p},c=[{width:i,height:r}]}for(let f=0;f<c.length;f++)t===8?m=bma(c[f],d,u,n,a,m):Ima(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 c1=We((bMi,PNe)=>{"use strict";function Sma(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 Tma(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 Ema(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}}PNe.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?Sma(a,l,t,n,d):(o&&Tma(a,l,t,n,o),r!==8&&!i&&(r===16&&(l=Buffer.alloc(t*n*4)),Ema(a,l,t,n,r))),l}});var FNe=We((IMi,ONe)=>{"use strict";var Cma=Ri("util"),u1=Ri("zlib"),LNe=a1(),Rma=CNe(),Ama=l1(),Dma=m1(),xma=c1(),sd=ONe.exports=function(a){LNe.call(this),this._parser=new Ama(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()};Cma.inherits(sd,LNe);sd.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};sd.prototype._inflateData=function(a){if(!this._inflate)if(this._bitmapInfo.interlace)this._inflate=u1.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,u1.Z_MIN_CHUNK);this._inflate=u1.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)};sd.prototype._handleMetaData=function(a){this._metaData=a,this._bitmapInfo=Object.create(a),this._filter=new Rma(this._bitmapInfo)};sd.prototype._handleTransColor=function(a){this._bitmapInfo.transColor=a};sd.prototype._handlePalette=function(a){this._bitmapInfo.palette=a};sd.prototype._simpleTransparency=function(){this._metaData.alpha=!0};sd.prototype._headersFinished=function(){this.emit("metadata",this._metaData)};sd.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"))};sd.prototype._complete=function(a){if(this.errord)return;let e;try{let i=Dma.dataToBitMap(a,this._bitmapInfo);e=xma(i,this._bitmapInfo,this._options.skipRescale),i=null}catch(i){this._handleError(i);return}this.emit("parsed",e)}});var zNe=We((SMi,UNe)=>{"use strict";var ks=C_();UNe.exports=function(a,e,i,r){let t=[ks.COLORTYPE_COLOR_ALPHA,ks.COLORTYPE_ALPHA].indexOf(r.colorType)!==-1;if(r.colorType===r.inputColorType){let p=(function(){let _=new ArrayBuffer(2);return new DataView(_).setInt16(0,256,!0),new Int16Array(_)[0]!==256})();if(r.bitDepth===8||r.bitDepth===16&&p)return a}let n=r.bitDepth!==16?a:new Uint16Array(a.buffer),s=255,o=ks.COLORTYPE_TO_BPP_MAP[r.inputColorType];o===4&&!r.inputHasAlpha&&(o=3);let d=ks.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 p,_,v,h=s;switch(r.inputColorType){case ks.COLORTYPE_COLOR_ALPHA:h=n[m+3],p=n[m],_=n[m+1],v=n[m+2];break;case ks.COLORTYPE_COLOR:p=n[m],_=n[m+1],v=n[m+2];break;case ks.COLORTYPE_ALPHA:h=n[m+1],p=n[m],_=p,v=p;break;case ks.COLORTYPE_GRAYSCALE:p=n[m],_=p,v=p;break;default:throw new Error("input color type:"+r.inputColorType+" is not supported at present")}return r.inputHasAlpha&&(t||(h/=s,p=Math.min(Math.max(Math.round((1-h)*u.red+h*p),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:p,green:_,blue:v,alpha:h}}for(let p=0;p<i;p++)for(let _=0;_<e;_++){let v=f(n,m);switch(r.colorType){case ks.COLORTYPE_COLOR_ALPHA:case ks.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 ks.COLORTYPE_ALPHA:case ks.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 VNe=We((TMi,KNe)=>{"use strict";var BNe=t1();function Mma(a,e,i,r,t){for(let n=0;n<i;n++)r[t+n]=a[e+n]}function Pma(a,e,i){let r=0,t=e+i;for(let n=e;n<t;n++)r+=Math.abs(a[n]);return r}function Lma(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 Oma(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 Fma(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 Uma(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 zma(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 Bma(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 Kma(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]-BNe(o,d,l);r[t+s]=m}}function Vma(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]-BNe(s,o,d);t+=Math.abs(l)}return t}var Wma={0:Mma,1:Lma,2:Fma,3:zma,4:Kma},Gma={0:Pma,1:Oma,2:Uma,3:Bma,4:Vma};KNe.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 p=Gma[n[f]](a,d,s,t);p<u&&(m=n[f],u=p)}}l[o]=m,o++,Wma[m](a,d,s,l,o,t),o+=s,d+=s}return l}});var f1=We((EMi,WNe)=>{"use strict";var _t=C_(),$ma=d1(),Hma=zNe(),Qma=VNe(),Xma=Ri("zlib"),Am=WNe.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||Xma.createDeflate,a.bitDepth=a.bitDepth||8,a.colorType=typeof a.colorType=="number"?a.colorType:_t.COLORTYPE_COLOR_ALPHA,a.inputColorType=typeof a.inputColorType=="number"?a.inputColorType:_t.COLORTYPE_COLOR_ALPHA,[_t.COLORTYPE_GRAYSCALE,_t.COLORTYPE_COLOR,_t.COLORTYPE_COLOR_ALPHA,_t.COLORTYPE_ALPHA].indexOf(a.colorType)===-1)throw new Error("option color type:"+a.colorType+" is not supported at present");if([_t.COLORTYPE_GRAYSCALE,_t.COLORTYPE_COLOR,_t.COLORTYPE_COLOR_ALPHA,_t.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")};Am.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}};Am.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())};Am.prototype.filterData=function(a,e,i){let r=Hma(a,e,i,this._options),t=_t.COLORTYPE_TO_BPP_MAP[this._options.colorType];return Qma(r,e,i,this._options,t)};Am.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($ma.crc32(r.slice(4,r.length-4)),r.length-4),r};Am.prototype.packGAMA=function(a){let e=Buffer.alloc(4);return e.writeUInt32BE(Math.floor(a*_t.GAMMA_DIVISION),0),this._packChunk(_t.TYPE_gAMA,e)};Am.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(_t.TYPE_IHDR,i)};Am.prototype.packIDAT=function(a){return this._packChunk(_t.TYPE_IDAT,a)};Am.prototype.packIEND=function(){return this._packChunk(_t.TYPE_IEND,null)}});var QNe=We((CMi,HNe)=>{"use strict";var Jma=Ri("util"),GNe=Ri("stream"),Yma=C_(),Zma=f1(),$Ne=HNe.exports=function(a){GNe.call(this);let e=a||{};this._packer=new Zma(e),this._deflate=this._packer.createDeflate(),this.readable=!0};Jma.inherits($Ne,GNe);$Ne.prototype.pack=function(a,e,i,r){this.emit("data",Buffer.from(Yma.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 ape=We((lk,epe)=>{"use strict";var XNe=Ri("assert").ok,R_=Ri("zlib"),eca=Ri("util"),JNe=Ri("buffer").kMaxLength;function pf(a){if(!(this instanceof pf))return new pf(a);a&&a.chunkSize<R_.Z_MIN_CHUNK&&(a.chunkSize=R_.Z_MIN_CHUNK),R_.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 aca(a){return new pf(a)}function YNe(a,e){e&&process.nextTick(e),a._handle&&(a._handle.close(),a._handle=null)}pf.prototype._processChunk=function(a,e,i){if(typeof i=="function")return R_.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(p){m=p});function c(p,_){if(r._hadError)return;let v=n-_;if(XNe(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-p,t=p,!0):!1}XNe(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>=JNe)throw YNe(this),new RangeError("Cannot create final Buffer. It would be larger than 0x"+JNe.toString(16)+" bytes");let f=Buffer.concat(d,l);return YNe(this),f};eca.inherits(pf,R_.Inflate);function ica(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=R_.Z_FINISH),a._processChunk(e,i)}function ZNe(a,e){return ica(new pf(e),a)}epe.exports=lk=ZNe;lk.Inflate=pf;lk.createInflate=aca;lk.inflateSync=ZNe});var N1=We((RMi,rpe)=>{"use strict";var ipe=rpe.exports=function(a){this._buffer=a,this._reads=[]};ipe.prototype.read=function(a,e){this._reads.push({length:Math.abs(a),allowLess:a<0,func:e})};ipe.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 npe=We(tpe=>{"use strict";var rca=N1(),tca=n1();tpe.process=function(a,e){let i=[],r=new rca(a);return new tca(e,{read:r.read.bind(r),write:function(n){i.push(n)},complete:function(){}}).start(),r.process(),Buffer.concat(i)}});var lpe=We((DMi,dpe)=>{"use strict";var spe=!0,ope=Ri("zlib"),nca=ape();ope.deflateSync||(spe=!1);var sca=N1(),oca=npe(),dca=l1(),lca=m1(),mca=c1();dpe.exports=function(a,e){if(!spe)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 sca(a);if(new dca(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=ope.inflateSync(_);else{let S=((t.width*t.bpp*t.depth+7>>3)+1)*t.height;v=nca(_,{chunkSize:S,maxLength:S})}if(_=null,!v||!v.length)throw new Error("bad png - invalid inflate data response");let h=oca.process(v,t);_=null;let w=lca.dataToBitMap(h,t);h=null;let y=mca(w,t,e.skipRescale);return t.data=y,t.gamma=l||0,t}});var fpe=We((xMi,upe)=>{"use strict";var mpe=!0,cpe=Ri("zlib");cpe.deflateSync||(mpe=!1);var cca=C_(),uca=f1();upe.exports=function(a,e){if(!mpe)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 uca(i),t=[];t.push(Buffer.from(cca.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=cpe.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 Npe=We(p1=>{"use strict";var fca=lpe(),Nca=fpe();p1.read=function(a,e){return fca(a,e||{})};p1.write=function(a,e){return Nca(a,e)}});var mk=We(_pe=>{"use strict";var pca=Ri("util"),ppe=Ri("stream"),_ca=FNe(),hca=QNe(),vca=Npe(),Lt=_pe.PNG=function(a){ppe.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 _ca(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 hca(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"))};pca.inherits(Lt,ppe);Lt.sync=vca;Lt.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)};Lt.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};Lt.prototype.write=function(a){return this._parser.write(a),!0};Lt.prototype.end=function(a){this._parser.end(a)};Lt.prototype._metadata=function(a){this.width=a.width,this.height=a.height,this.emit("metadata",a)};Lt.prototype._gamma=function(a){this.gamma=a};Lt.prototype._handleClose=function(){!this._parser.writable&&!this._packer.readable&&this.emit("close")};Lt.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)};Lt.prototype.bitblt=function(a,e,i,r,t,n,s){return Lt.bitblt(this,a,e,i,r,t,n,s),this};Lt.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}};Lt.prototype.adjustGamma=function(){Lt.adjustGamma(this)}});var wpe=We((LMi,bA)=>{var vpe=vpe||function(a){return Buffer.from(a).toString("base64")};function wca(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),p=new Array(64),_=new Array(64),v=[],h=0,w=7,y=new Array(64),k=new Array(64),S=new Array(64),M=new Array(256),C=new Array(2048),L,P=[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],K=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],O=[0,1,2,3,4,5,6,7,8,9,10,11],W=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],Q=[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],fe=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],re=[0,1,2,3,4,5,6,7,8,9,10,11],qe=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],$e=[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 Y(V){for(var Ie=[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],Ue=0;Ue<64;Ue++){var Re=r((Ie[Ue]*V+50)/100);Re<1?Re=1:Re>255&&(Re=255),t[P[Ue]]=Re}for(var Xe=[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],Ye=0;Ye<64;Ye++){var qa=r((Xe[Ye]*V+50)/100);qa<1?qa=1:qa>255&&(qa=255),n[P[Ye]]=qa}for(var ja=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],Ci=0,si=0;si<8;si++)for(var ee=0;ee<8;ee++)s[Ci]=1/(t[P[Ci]]*ja[si]*ja[ee]*8),o[Ci]=1/(n[P[Ci]]*ja[si]*ja[ee]*8),Ci++}function me(V,Ie){for(var Ue=0,Re=0,Xe=new Array,Ye=1;Ye<=16;Ye++){for(var qa=1;qa<=V[Ye];qa++)Xe[Ie[Re]]=[],Xe[Ie[Re]][0]=Ue,Xe[Ie[Re]][1]=Ye,Re++,Ue++;Ue*=2}return Xe}function be(){d=me(K,O),l=me(fe,re),m=me(W,Q),c=me(qe,$e)}function xe(){for(var V=1,Ie=2,Ue=1;Ue<=15;Ue++){for(var Re=V;Re<Ie;Re++)f[32767+Re]=Ue,u[32767+Re]=[],u[32767+Re][1]=Ue,u[32767+Re][0]=Re;for(var Xe=-(Ie-1);Xe<=-V;Xe++)f[32767+Xe]=Ue,u[32767+Xe]=[],u[32767+Xe][1]=Ue,u[32767+Xe][0]=Ie-1+Xe;V<<=1,Ie<<=1}}function he(){for(var V=0;V<256;V++)C[V]=19595*V,C[V+256>>0]=38470*V,C[V+512>>0]=7471*V+32768,C[V+768>>0]=-11059*V,C[V+1024>>0]=-21709*V,C[V+1280>>0]=32768*V+8421375,C[V+1536>>0]=-27439*V,C[V+1792>>0]=-5329*V}function ce(V){for(var Ie=V[0],Ue=V[1]-1;Ue>=0;)Ie&1<<Ue&&(h|=1<<w),Ue--,w--,w<0&&(h==255?(z(255),z(0)):z(h),w=7,h=0)}function z(V){v.push(V)}function U(V){z(V>>8&255),z(V&255)}function J(V,Ie){var Ue,Re,Xe,Ye,qa,ja,Ci,si,ee=0,Ne,He=8,ki=64;for(Ne=0;Ne<He;++Ne){Ue=V[ee],Re=V[ee+1],Xe=V[ee+2],Ye=V[ee+3],qa=V[ee+4],ja=V[ee+5],Ci=V[ee+6],si=V[ee+7];var Ze=Ue+si,Na=Ue-si,Qa=Re+Ci,Ve=Re-Ci,xa=Xe+ja,Jr=Xe-ja,ui=Ye+qa,ns=Ye-qa,Wo=Ze+ui,Xc=Ze-ui,$N=Qa+xa,HN=Qa-xa;V[ee]=Wo+$N,V[ee+4]=Wo-$N;var Nw=(HN+Xc)*.707106781;V[ee+2]=Xc+Nw,V[ee+6]=Xc-Nw,Wo=ns+Jr,$N=Jr+Ve,HN=Ve+Na;var pw=(Wo-HN)*.382683433,NS=.5411961*Wo+pw,_w=1.306562965*HN+pw,hw=$N*.707106781,vw=Na+hw,ww=Na-hw;V[ee+5]=ww+NS,V[ee+3]=ww-NS,V[ee+1]=vw+_w,V[ee+7]=vw-_w,ee+=8}for(ee=0,Ne=0;Ne<He;++Ne){Ue=V[ee],Re=V[ee+8],Xe=V[ee+16],Ye=V[ee+24],qa=V[ee+32],ja=V[ee+40],Ci=V[ee+48],si=V[ee+56];var j7=Ue+si,y2=Ue-si,b7=Re+Ci,I7=Re-Ci,S7=Xe+ja,T7=Xe-ja,E7=Ye+qa,xXe=Ye-qa,gw=j7+E7,k2=j7-E7,pS=b7+S7,_S=b7-S7;V[ee]=gw+pS,V[ee+32]=gw-pS;var C7=(_S+k2)*.707106781;V[ee+16]=k2+C7,V[ee+48]=k2-C7,gw=xXe+T7,pS=T7+I7,_S=I7+y2;var R7=(gw-_S)*.382683433,A7=.5411961*gw+R7,D7=1.306562965*_S+R7,x7=pS*.707106781,M7=y2+x7,P7=y2-x7;V[ee+40]=P7+A7,V[ee+24]=P7-A7,V[ee+8]=M7+D7,V[ee+56]=M7-D7,ee++}var hS;for(Ne=0;Ne<ki;++Ne)hS=V[Ne]*Ie[Ne],p[Ne]=hS>0?hS+.5|0:hS-.5|0;return p}function oe(){U(65504),U(16),z(74),z(70),z(73),z(70),z(0),z(1),z(1),z(0),U(1),U(1),z(0),z(0)}function te(V){if(V){U(65505),V[0]===69&&V[1]===120&&V[2]===105&&V[3]===102?U(V.length+2):(U(V.length+5+2),z(69),z(120),z(105),z(102),z(0));for(var Ie=0;Ie<V.length;Ie++)z(V[Ie])}}function ue(V,Ie){U(65472),U(17),z(8),U(Ie),U(V),z(3),z(1),z(17),z(0),z(2),z(17),z(1),z(3),z(17),z(1)}function we(){U(65499),U(132),z(0);for(var V=0;V<64;V++)z(t[V]);z(1);for(var Ie=0;Ie<64;Ie++)z(n[Ie])}function Z(){U(65476),U(418),z(0);for(var V=0;V<16;V++)z(K[V+1]);for(var Ie=0;Ie<=11;Ie++)z(O[Ie]);z(16);for(var Ue=0;Ue<16;Ue++)z(W[Ue+1]);for(var Re=0;Re<=161;Re++)z(Q[Re]);z(1);for(var Xe=0;Xe<16;Xe++)z(fe[Xe+1]);for(var Ye=0;Ye<=11;Ye++)z(re[Ye]);z(17);for(var qa=0;qa<16;qa++)z(qe[qa+1]);for(var ja=0;ja<=161;ja++)z($e[ja])}function ae(V){typeof V>"u"||V.constructor!==Array||V.forEach(Ie=>{if(typeof Ie=="string"){U(65534);var Ue=Ie.length;U(Ue+2);var Re;for(Re=0;Re<Ue;Re++)z(Ie.charCodeAt(Re))}})}function na(){U(65498),U(12),z(3),z(1),z(0),z(2),z(17),z(3),z(17),z(0),z(63),z(0)}function Ce(V,Ie,Ue,Re,Xe){for(var Ye=Xe[0],qa=Xe[240],ja,Ci=16,si=63,ee=64,Ne=J(V,Ie),He=0;He<ee;++He)_[P[He]]=Ne[He];var ki=_[0]-Ue;Ue=_[0],ki==0?ce(Re[0]):(ja=32767+ki,ce(Re[f[ja]]),ce(u[ja]));for(var Ze=63;Ze>0&&_[Ze]==0;Ze--);if(Ze==0)return ce(Ye),Ue;for(var Na=1,Qa;Na<=Ze;){for(var Ve=Na;_[Na]==0&&Na<=Ze;++Na);var xa=Na-Ve;if(xa>=Ci){Qa=xa>>4;for(var Jr=1;Jr<=Qa;++Jr)ce(qa);xa=xa&15}ja=32767+_[Na],ce(Xe[(xa<<4)+f[ja]]),ce(u[ja]),Na++}return Ze!=si&&ce(Ye),Ue}function sa(){for(var V=String.fromCharCode,Ie=0;Ie<256;Ie++)M[Ie]=V(Ie)}this.encode=function(V,Ie){var Ue=new Date().getTime();Ie&&ts(Ie),v=new Array,h=0,w=7,U(65496),oe(),ae(V.comments),te(V.exifBuffer),we(),ue(V.width,V.height),Z(),na();var Re=0,Xe=0,Ye=0;h=0,w=7,this.encode.displayName="_encode_";for(var qa=V.data,ja=V.width,Ci=V.height,si=ja*4,ee=ja*3,Ne,He=0,ki,Ze,Na,Qa,Ve,xa,Jr,ui;He<Ci;){for(Ne=0;Ne<si;){for(Qa=si*He+Ne,Ve=Qa,xa=-1,Jr=0,ui=0;ui<64;ui++)Jr=ui>>3,xa=(ui&7)*4,Ve=Qa+Jr*si+xa,He+Jr>=Ci&&(Ve-=si*(He+1+Jr-Ci)),Ne+xa>=si&&(Ve-=Ne+xa-si+4),ki=qa[Ve++],Ze=qa[Ve++],Na=qa[Ve++],y[ui]=(C[ki]+C[Ze+256>>0]+C[Na+512>>0]>>16)-128,k[ui]=(C[ki+768>>0]+C[Ze+1024>>0]+C[Na+1280>>0]>>16)-128,S[ui]=(C[ki+1280>>0]+C[Ze+1536>>0]+C[Na+1792>>0]>>16)-128;Re=Ce(y,s,Re,d,m),Xe=Ce(k,o,Xe,l,c),Ye=Ce(S,o,Ye,l,c),Ne+=32}He+=8}if(w>=0){var ns=[];ns[1]=w+1,ns[0]=(1<<w+1)-1,ce(ns)}if(U(65497),typeof bA>"u")return new Uint8Array(v);return Buffer.from(v);var Wo,Xc};function ts(V){if(V<=0&&(V=1),V>100&&(V=100),L!=V){var Ie=0;V<50?Ie=Math.floor(5e3/V):Ie=Math.floor(200-V*2),Y(Ie),L=V}}function Bs(){var V=new Date().getTime();a||(a=50),sa(),be(),xe(),he(),ts(a);var Ie=new Date().getTime()-V}Bs()}typeof bA<"u"?bA.exports=hpe:typeof window<"u"&&(window["jpeg-js"]=window["jpeg-js"]||{},window["jpeg-js"].encode=hpe);function hpe(a,e){typeof e>"u"&&(e=50);var i=new wca(e),r=i.encode(a,e);return{data:r,width:a.width,height:a.height}}});var ype=We((OMi,h1)=>{var _1=(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,y){for(var k=0,S=[],M,C,L=16;L>0&&!w[L-1];)L--;S.push({children:[],index:0});var P=S[0],K;for(M=0;M<L;M++){for(C=0;C<w[M];C++){for(P=S.pop(),P.children[P.index]=y[k];P.index>0;){if(S.length===0)throw new Error("Could not recreate Huffman Table");P=S.pop()}for(P.index++,S.push(P);S.length<=M;)S.push(K={children:[],index:0}),P.children[P.index]=K.children,P=K;k++}M+1<L&&(S.push(K={children:[],index:0}),P.children[P.index]=K.children,P=K)}return S[0].children}function u(w,y,k,S,M,C,L,P,K,O){var W=k.precision,Q=k.samplesPerLine,fe=k.scanLines,re=k.mcusPerLine,qe=k.progressive,$e=k.maxH,Y=k.maxV,me=y,be=0,xe=0;function he(){if(xe>0)return xe--,be>>xe&1;if(be=w[y++],be==255){var ee=w[y++];if(ee)throw new Error("unexpected marker: "+(be<<8|ee).toString(16))}return xe=7,be>>>7}function ce(ee){for(var Ne=ee,He;(He=he())!==null;){if(Ne=Ne[He],typeof Ne=="number")return Ne;if(typeof Ne!="object")throw new Error("invalid huffman sequence")}return null}function z(ee){for(var Ne=0;ee>0;){var He=he();if(He===null)return;Ne=Ne<<1|He,ee--}return Ne}function U(ee){var Ne=z(ee);return Ne>=1<<ee-1?Ne:Ne+(-1<<ee)+1}function J(ee,Ne){var He=ce(ee.huffmanTableDC),ki=He===0?0:U(He);Ne[0]=ee.pred+=ki;for(var Ze=1;Ze<64;){var Na=ce(ee.huffmanTableAC),Qa=Na&15,Ve=Na>>4;if(Qa===0){if(Ve<15)break;Ze+=16;continue}Ze+=Ve;var xa=e[Ze];Ne[xa]=U(Qa),Ze++}}function oe(ee,Ne){var He=ce(ee.huffmanTableDC),ki=He===0?0:U(He)<<K;Ne[0]=ee.pred+=ki}function te(ee,Ne){Ne[0]|=he()<<K}var ue=0;function we(ee,Ne){if(ue>0){ue--;return}for(var He=C,ki=L;He<=ki;){var Ze=ce(ee.huffmanTableAC),Na=Ze&15,Qa=Ze>>4;if(Na===0){if(Qa<15){ue=z(Qa)+(1<<Qa)-1;break}He+=16;continue}He+=Qa;var Ve=e[He];Ne[Ve]=U(Na)*(1<<K),He++}}var Z=0,ae;function na(ee,Ne){for(var He=C,ki=L,Ze=0;He<=ki;){var Na=e[He],Qa=Ne[Na]<0?-1:1;switch(Z){case 0:var Ve=ce(ee.huffmanTableAC),xa=Ve&15,Ze=Ve>>4;if(xa===0)Ze<15?(ue=z(Ze)+(1<<Ze),Z=4):(Ze=16,Z=1);else{if(xa!==1)throw new Error("invalid ACn encoding");ae=U(xa),Z=Ze?2:3}continue;case 1:case 2:Ne[Na]?Ne[Na]+=(he()<<K)*Qa:(Ze--,Ze===0&&(Z=Z==2?3:0));break;case 3:Ne[Na]?Ne[Na]+=(he()<<K)*Qa:(Ne[Na]=ae<<K,Z=0);break;case 4:Ne[Na]&&(Ne[Na]+=(he()<<K)*Qa);break}He++}Z===4&&(ue--,ue===0&&(Z=0))}function Ce(ee,Ne,He,ki,Ze){var Na=He/re|0,Qa=He%re,Ve=Na*ee.v+ki,xa=Qa*ee.h+Ze;ee.blocks[Ve]===void 0&&O.tolerantDecoding||Ne(ee,ee.blocks[Ve][xa])}function sa(ee,Ne,He){var ki=He/ee.blocksPerLine|0,Ze=He%ee.blocksPerLine;ee.blocks[ki]===void 0&&O.tolerantDecoding||Ne(ee,ee.blocks[ki][Ze])}var ts=S.length,Bs,V,Ie,Ue,Re,Xe;qe?C===0?Xe=P===0?oe:te:Xe=P===0?we:na:Xe=J;var Ye=0,qa,ja;ts==1?ja=S[0].blocksPerLine*S[0].blocksPerColumn:ja=re*k.mcusPerColumn,M||(M=ja);for(var Ci,si;Ye<ja;){for(V=0;V<ts;V++)S[V].pred=0;if(ue=0,ts==1)for(Bs=S[0],Re=0;Re<M;Re++)sa(Bs,Xe,Ye),Ye++;else for(Re=0;Re<M;Re++){for(V=0;V<ts;V++)for(Bs=S[V],Ci=Bs.h,si=Bs.v,Ie=0;Ie<si;Ie++)for(Ue=0;Ue<Ci;Ue++)Ce(Bs,Xe,Ye,Ie,Ue);if(Ye++,Ye===ja)break}if(Ye===ja)do{if(w[y]===255&&w[y+1]!==0)break;y+=1}while(y<w.length-2);if(xe=0,qa=w[y]<<8|w[y+1],qa<65280)throw new Error("marker was not found");if(qa>=65488&&qa<=65495)y+=2;else break}return y-me}function f(w,y){var k=[],S=y.blocksPerLine,M=y.blocksPerColumn,C=S<<3,L=new Int32Array(64),P=new Uint8Array(64);function K(me,be,xe){var he=y.quantizationTable,ce,z,U,J,oe,te,ue,we,Z,ae=xe,na;for(na=0;na<64;na++)ae[na]=me[na]*he[na];for(na=0;na<8;++na){var Ce=8*na;if(ae[1+Ce]==0&&ae[2+Ce]==0&&ae[3+Ce]==0&&ae[4+Ce]==0&&ae[5+Ce]==0&&ae[6+Ce]==0&&ae[7+Ce]==0){Z=d*ae[0+Ce]+512>>10,ae[0+Ce]=Z,ae[1+Ce]=Z,ae[2+Ce]=Z,ae[3+Ce]=Z,ae[4+Ce]=Z,ae[5+Ce]=Z,ae[6+Ce]=Z,ae[7+Ce]=Z;continue}ce=d*ae[0+Ce]+128>>8,z=d*ae[4+Ce]+128>>8,U=ae[2+Ce],J=ae[6+Ce],oe=l*(ae[1+Ce]-ae[7+Ce])+128>>8,we=l*(ae[1+Ce]+ae[7+Ce])+128>>8,te=ae[3+Ce]<<4,ue=ae[5+Ce]<<4,Z=ce-z+1>>1,ce=ce+z+1>>1,z=Z,Z=U*o+J*s+128>>8,U=U*s-J*o+128>>8,J=Z,Z=oe-ue+1>>1,oe=oe+ue+1>>1,ue=Z,Z=we+te+1>>1,te=we-te+1>>1,we=Z,Z=ce-J+1>>1,ce=ce+J+1>>1,J=Z,Z=z-U+1>>1,z=z+U+1>>1,U=Z,Z=oe*n+we*t+2048>>12,oe=oe*t-we*n+2048>>12,we=Z,Z=te*r+ue*i+2048>>12,te=te*i-ue*r+2048>>12,ue=Z,ae[0+Ce]=ce+we,ae[7+Ce]=ce-we,ae[1+Ce]=z+ue,ae[6+Ce]=z-ue,ae[2+Ce]=U+te,ae[5+Ce]=U-te,ae[3+Ce]=J+oe,ae[4+Ce]=J-oe}for(na=0;na<8;++na){var sa=na;if(ae[8+sa]==0&&ae[16+sa]==0&&ae[24+sa]==0&&ae[32+sa]==0&&ae[40+sa]==0&&ae[48+sa]==0&&ae[56+sa]==0){Z=d*xe[na+0]+8192>>14,ae[0+sa]=Z,ae[8+sa]=Z,ae[16+sa]=Z,ae[24+sa]=Z,ae[32+sa]=Z,ae[40+sa]=Z,ae[48+sa]=Z,ae[56+sa]=Z;continue}ce=d*ae[0+sa]+2048>>12,z=d*ae[32+sa]+2048>>12,U=ae[16+sa],J=ae[48+sa],oe=l*(ae[8+sa]-ae[56+sa])+2048>>12,we=l*(ae[8+sa]+ae[56+sa])+2048>>12,te=ae[24+sa],ue=ae[40+sa],Z=ce-z+1>>1,ce=ce+z+1>>1,z=Z,Z=U*o+J*s+2048>>12,U=U*s-J*o+2048>>12,J=Z,Z=oe-ue+1>>1,oe=oe+ue+1>>1,ue=Z,Z=we+te+1>>1,te=we-te+1>>1,we=Z,Z=ce-J+1>>1,ce=ce+J+1>>1,J=Z,Z=z-U+1>>1,z=z+U+1>>1,U=Z,Z=oe*n+we*t+2048>>12,oe=oe*t-we*n+2048>>12,we=Z,Z=te*r+ue*i+2048>>12,te=te*i-ue*r+2048>>12,ue=Z,ae[0+sa]=ce+we,ae[56+sa]=ce-we,ae[8+sa]=z+ue,ae[48+sa]=z-ue,ae[16+sa]=U+te,ae[40+sa]=U-te,ae[24+sa]=J+oe,ae[32+sa]=J-oe}for(na=0;na<64;++na){var ts=128+(ae[na]+8>>4);be[na]=ts<0?0:ts>255?255:ts}}h(C*M*8);for(var O,W,Q=0;Q<M;Q++){var fe=Q<<3;for(O=0;O<8;O++)k.push(new Uint8Array(C));for(var re=0;re<S;re++){K(y.blocks[Q][re],P,L);var qe=0,$e=re<<3;for(W=0;W<8;W++){var Y=k[fe+W];for(O=0;O<8;O++)Y[$e+O]=P[qe++]}}}return k}function p(w){return w<0?0:w>255?255:w}m.prototype={load:function(y){var k=new XMLHttpRequest;k.open("GET",y,!0),k.responseType="arraybuffer",k.onload=(function(){var S=new Uint8Array(k.response||k.mozResponseArrayBuffer);this.parse(S),this.onload&&this.onload()}).bind(this),k.send(null)},parse:function(y){var k=this.opts.maxResolutionInMP*1e3*1e3,S=0,M=y.length;function C(){var Ve=y[S]<<8|y[S+1];return S+=2,Ve}function L(){var Ve=C(),xa=y.subarray(S,S+Ve-2);return S+=xa.length,xa}function P(Ve){var xa=1,Jr=1,ui,ns;for(ns in Ve.components)Ve.components.hasOwnProperty(ns)&&(ui=Ve.components[ns],xa<ui.h&&(xa=ui.h),Jr<ui.v&&(Jr=ui.v));var Wo=Math.ceil(Ve.samplesPerLine/8/xa),Xc=Math.ceil(Ve.scanLines/8/Jr);for(ns in Ve.components)if(Ve.components.hasOwnProperty(ns)){ui=Ve.components[ns];var $N=Math.ceil(Math.ceil(Ve.samplesPerLine/8)*ui.h/xa),HN=Math.ceil(Math.ceil(Ve.scanLines/8)*ui.v/Jr),Nw=Wo*ui.h,pw=Xc*ui.v,NS=pw*Nw,_w=[];h(NS*256);for(var hw=0;hw<pw;hw++){for(var vw=[],ww=0;ww<Nw;ww++)vw.push(new Int32Array(64));_w.push(vw)}ui.blocksPerLine=$N,ui.blocksPerColumn=HN,ui.blocks=_w}Ve.maxH=xa,Ve.maxV=Jr,Ve.mcusPerLine=Wo,Ve.mcusPerColumn=Xc}var K=null,O=null,W=null,Q,fe,re=[],qe=[],$e=[],Y=[],me=C(),be=-1;if(this.comments=[],me!=65496)throw new Error("SOI not found");for(me=C();me!=65497;){var xe,he,ce;switch(me){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 z=L();if(me===65534){var U=String.fromCharCode.apply(null,z);this.comments.push(U)}me===65504&&z[0]===74&&z[1]===70&&z[2]===73&&z[3]===70&&z[4]===0&&(K={version:{major:z[5],minor:z[6]},densityUnits:z[7],xDensity:z[8]<<8|z[9],yDensity:z[10]<<8|z[11],thumbWidth:z[12],thumbHeight:z[13],thumbData:z.subarray(14,14+3*z[12]*z[13])}),me===65505&&z[0]===69&&z[1]===120&&z[2]===105&&z[3]===102&&z[4]===0&&(this.exifBuffer=z.subarray(5,z.length)),me===65518&&z[0]===65&&z[1]===100&&z[2]===111&&z[3]===98&&z[4]===101&&z[5]===0&&(O={version:z[6],flags0:z[7]<<8|z[8],flags1:z[9]<<8|z[10],transformCode:z[11]});break;case 65499:for(var J=C(),oe=J+S-2;S<oe;){var te=y[S++];h(256);var ue=new Int32Array(64);if(te>>4===0)for(he=0;he<64;he++){var we=e[he];ue[we]=y[S++]}else if(te>>4===1)for(he=0;he<64;he++){var we=e[he];ue[we]=C()}else throw new Error("DQT: invalid table spec");re[te&15]=ue}break;case 65472:case 65473:case 65474:C(),Q={},Q.extended=me===65473,Q.progressive=me===65474,Q.precision=y[S++],Q.scanLines=C(),Q.samplesPerLine=C(),Q.components={},Q.componentsOrder=[];var Z=Q.scanLines*Q.samplesPerLine;if(Z>k){var ae=Math.ceil((Z-k)/1e6);throw new Error(`maxResolutionInMP limit exceeded by ${ae}MP`)}var na=y[S++],Ce,sa=0,ts=0;for(xe=0;xe<na;xe++){Ce=y[S];var Bs=y[S+1]>>4,V=y[S+1]&15,Ie=y[S+2];if(Bs<=0||V<=0)throw new Error("Invalid sampling factor, expected values above 0");Q.componentsOrder.push(Ce),Q.components[Ce]={h:Bs,v:V,quantizationIdx:Ie},S+=3}P(Q),qe.push(Q);break;case 65476:var Ue=C();for(xe=2;xe<Ue;){var Re=y[S++],Xe=new Uint8Array(16),Ye=0;for(he=0;he<16;he++,S++)Ye+=Xe[he]=y[S];h(16+Ye);var qa=new Uint8Array(Ye);for(he=0;he<Ye;he++,S++)qa[he]=y[S];xe+=17+Ye,(Re>>4===0?Y:$e)[Re&15]=c(Xe,qa)}break;case 65501:C(),fe=C();break;case 65500:C(),C();break;case 65498:var ja=C(),Ci=y[S++],si=[],ee;for(xe=0;xe<Ci;xe++){ee=Q.components[y[S++]];var Ne=y[S++];ee.huffmanTableDC=Y[Ne>>4],ee.huffmanTableAC=$e[Ne&15],si.push(ee)}var He=y[S++],ki=y[S++],Ze=y[S++],Na=u(y,S,Q,si,fe,He,ki,Ze>>4,Ze&15,this.opts);S+=Na;break;case 65535:y[S]!==255&&S--;break;default:if(y[S-3]==255&&y[S-2]>=192&&y[S-2]<=254){S-=3;break}else if(me===224||me==225){if(be!==-1)throw new Error(`first unknown JPEG marker at offset ${be.toString(16)}, second unknown JPEG marker ${me.toString(16)} at offset ${(S-1).toString(16)}`);be=S-1;let Ve=C();if(y[S+Ve-2]===255){S+=Ve-2;break}}throw new Error("unknown JPEG marker "+me.toString(16))}me=C()}if(qe.length!=1)throw new Error("only single frame JPEGs supported");for(var xe=0;xe<qe.length;xe++){var Qa=qe[xe].components;for(var he in Qa)Qa[he].quantizationTable=re[Qa[he].quantizationIdx],delete Qa[he].quantizationIdx}this.width=Q.samplesPerLine,this.height=Q.scanLines,this.jfif=K,this.adobe=O,this.components=[];for(var xe=0;xe<Q.componentsOrder.length;xe++){var ee=Q.components[Q.componentsOrder[xe]];this.components.push({lines:f(Q,ee),scaleX:ee.h/Q.maxH,scaleY:ee.v/Q.maxV})}},getData:function(y,k){var S=this.width/y,M=this.height/k,C,L,P,K,O,W,Q,fe,re,qe,$e=0,Y,me,be,xe,he,ce,z,U,J,oe,te,ue=y*k*this.components.length;h(ue);var we=new Uint8Array(ue);switch(this.components.length){case 1:for(C=this.components[0],qe=0;qe<k;qe++)for(O=C.lines[0|qe*C.scaleY*M],re=0;re<y;re++)Y=O[0|re*C.scaleX*S],we[$e++]=Y;break;case 2:for(C=this.components[0],L=this.components[1],qe=0;qe<k;qe++)for(O=C.lines[0|qe*C.scaleY*M],W=L.lines[0|qe*L.scaleY*M],re=0;re<y;re++)Y=O[0|re*C.scaleX*S],we[$e++]=Y,Y=W[0|re*L.scaleX*S],we[$e++]=Y;break;case 3:for(te=!0,this.adobe&&this.adobe.transformCode?te=!0:typeof this.opts.colorTransform<"u"&&(te=!!this.opts.colorTransform),C=this.components[0],L=this.components[1],P=this.components[2],qe=0;qe<k;qe++)for(O=C.lines[0|qe*C.scaleY*M],W=L.lines[0|qe*L.scaleY*M],Q=P.lines[0|qe*P.scaleY*M],re=0;re<y;re++)te?(Y=O[0|re*C.scaleX*S],me=W[0|re*L.scaleX*S],be=Q[0|re*P.scaleX*S],U=p(Y+1.402*(be-128)),J=p(Y-.3441363*(me-128)-.71413636*(be-128)),oe=p(Y+1.772*(me-128))):(U=O[0|re*C.scaleX*S],J=W[0|re*L.scaleX*S],oe=Q[0|re*P.scaleX*S]),we[$e++]=U,we[$e++]=J,we[$e++]=oe;break;case 4:if(!this.adobe)throw new Error("Unsupported color mode (4 components)");for(te=!1,this.adobe&&this.adobe.transformCode?te=!0:typeof this.opts.colorTransform<"u"&&(te=!!this.opts.colorTransform),C=this.components[0],L=this.components[1],P=this.components[2],K=this.components[3],qe=0;qe<k;qe++)for(O=C.lines[0|qe*C.scaleY*M],W=L.lines[0|qe*L.scaleY*M],Q=P.lines[0|qe*P.scaleY*M],fe=K.lines[0|qe*K.scaleY*M],re=0;re<y;re++)te?(Y=O[0|re*C.scaleX*S],me=W[0|re*L.scaleX*S],be=Q[0|re*P.scaleX*S],xe=fe[0|re*K.scaleX*S],he=255-p(Y+1.402*(be-128)),ce=255-p(Y-.3441363*(me-128)-.71413636*(be-128)),z=255-p(Y+1.772*(me-128))):(he=O[0|re*C.scaleX*S],ce=W[0|re*L.scaleX*S],z=Q[0|re*P.scaleX*S],xe=fe[0|re*K.scaleX*S]),we[$e++]=255-he,we[$e++]=255-ce,we[$e++]=255-z,we[$e++]=255-xe;break;default:throw new Error("Unsupported color mode")}return we},copyToImageData:function(y,k){var S=y.width,M=y.height,C=y.data,L=this.getData(S,M),P=0,K=0,O,W,Q,fe,re,qe,$e,Y,me;switch(this.components.length){case 1:for(W=0;W<M;W++)for(O=0;O<S;O++)Q=L[P++],C[K++]=Q,C[K++]=Q,C[K++]=Q,k&&(C[K++]=255);break;case 3:for(W=0;W<M;W++)for(O=0;O<S;O++)$e=L[P++],Y=L[P++],me=L[P++],C[K++]=$e,C[K++]=Y,C[K++]=me,k&&(C[K++]=255);break;case 4:for(W=0;W<M;W++)for(O=0;O<S;O++)re=L[P++],qe=L[P++],Q=L[P++],fe=L[P++],$e=255-p(re*(1-fe/255)+fe),Y=255-p(qe*(1-fe/255)+fe),me=255-p(Q*(1-fe/255)+fe),C[K++]=$e,C[K++]=Y,C[K++]=me,k&&(C[K++]=255);break;default:throw new Error("Unsupported color mode")}}};var _=0,v=0;function h(w=0){var y=_+w;if(y>v){var k=Math.ceil((y-v)/1024/1024);throw new Error(`maxMemoryUsageInMB limit exceeded by at least ${k}MB`)}_=y}return m.resetMaxMemoryUsage=function(w){_=0,v=w},m.getBytesAllocated=function(){return _},m.requestMemoryAllocation=h,m})();typeof h1<"u"?h1.exports=gpe:typeof window<"u"&&(window["jpeg-js"]=window["jpeg-js"]||{},window["jpeg-js"].decode=gpe);function gpe(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 _1;n.opts=r,_1.resetMaxMemoryUsage(r.maxMemoryUsageInMB*1024*1024),n.parse(t);var s=r.formatAsRGBA?4:3,o=n.width*n.height*s;try{_1.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 v1=We((FMi,kpe)=>{var gca=wpe(),yca=ype();kpe.exports={encode:gca,decode:yca}});var qke=We((YVi,kke)=>{function yke(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}yke.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};kke.exports=function(a,e){typeof e>"u"&&(e=100);var i=new yke(a),r=i.encode();return{data:r,width:a.width,height:a.height}}});var bke=We((ZVi,jke)=>{function qo(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()}qo.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)};qo.prototype.parseRGBA=function(){var a="bit"+this.bitPP,e=this.width*this.height*4;this.data=new Buffer(e),this[a]()};qo.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)}};qo.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,p=this.palette[u];if(this.data[a]=0,this.data[a+1]=p.blue,this.data[a+2]=p.green,this.data[a+3]=p.red,n*2+1>=this.width)break;p=this.palette[f],this.data[a+4]=0,this.data[a+4+1]=p.blue,this.data[a+4+2]=p.green,this.data[a+4+3]=p.red}m!=0&&(this.pos+=4-m)}};qo.prototype.bit8=function(){if(this.compress==1){let u=function(f){var p=this.palette[f];this.data[a]=0,this.data[a+1]=p.blue,this.data[a+2]=p.green,this.data[a+3]=p.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)}};qo.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}};qo.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}};qo.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}};qo.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}};qo.prototype.getData=function(){return this.data};jke.exports=function(a){var e=new qo(a);return e}});var Ske=We((eWi,Ike)=>{var Aka=qke(),Dka=bke();Ike.exports={encode:Aka,decode:Dka}});var gCe=We(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.CHAR=`
|
|
3
3
|
\r -\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}`;vi.S=` \r
|
|
4
4
|
`;vi.NAME_START_CHAR=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}";vi.NAME_CHAR="-"+vi.NAME_START_CHAR+".0-9\xB7\u0300-\u036F\u203F-\u2040";vi.CHAR_RE=new RegExp("^["+vi.CHAR+"]$","u");vi.S_RE=new RegExp("^["+vi.S+"]+$","u");vi.NAME_START_CHAR_RE=new RegExp("^["+vi.NAME_START_CHAR+"]$","u");vi.NAME_CHAR_RE=new RegExp("^["+vi.NAME_CHAR+"]$","u");vi.NAME_RE=new RegExp("^["+vi.NAME_START_CHAR+"]["+vi.NAME_CHAR+"]*$","u");vi.NMTOKEN_RE=new RegExp("^["+vi.NAME_CHAR+"]+$","u");var P5=9,L5=10,O5=13,F5=32;vi.S_LIST=[F5,L5,O5,P5];function kMa(a){return a>=F5&&a<=55295||a===L5||a===O5||a===P5||a>=57344&&a<=65533||a>=65536&&a<=1114111}vi.isChar=kMa;function qMa(a){return a===F5||a===L5||a===O5||a===P5}vi.isS=qMa;function wCe(a){return a>=65&&a<=90||a>=97&&a<=122||a===58||a===95||a===8204||a===8205||a>=192&&a<=214||a>=216&&a<=246||a>=248&&a<=767||a>=880&&a<=893||a>=895&&a<=8191||a>=8304&&a<=8591||a>=11264&&a<=12271||a>=12289&&a<=55295||a>=63744&&a<=64975||a>=65008&&a<=65533||a>=65536&&a<=983039}vi.isNameStartChar=wCe;function jMa(a){return wCe(a)||a>=48&&a<=57||a===45||a===46||a===183||a>=768&&a<=879||a>=8255&&a<=8256}vi.isNameChar=jMa});var ICe=We(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});Ka.CHAR="-\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}";Ka.RESTRICTED_CHAR="-\b\v\f-\x7F-\x84\x86-\x9F";Ka.S=` \r
|
|
5
5
|
`;Ka.NAME_START_CHAR=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}";Ka.NAME_CHAR="-"+Ka.NAME_START_CHAR+".0-9\xB7\u0300-\u036F\u203F-\u2040";Ka.CHAR_RE=new RegExp("^["+Ka.CHAR+"]$","u");Ka.RESTRICTED_CHAR_RE=new RegExp("^["+Ka.RESTRICTED_CHAR+"]$","u");Ka.S_RE=new RegExp("^["+Ka.S+"]+$","u");Ka.NAME_START_CHAR_RE=new RegExp("^["+Ka.NAME_START_CHAR+"]$","u");Ka.NAME_CHAR_RE=new RegExp("^["+Ka.NAME_CHAR+"]$","u");Ka.NAME_RE=new RegExp("^["+Ka.NAME_START_CHAR+"]["+Ka.NAME_CHAR+"]*$","u");Ka.NMTOKEN_RE=new RegExp("^["+Ka.NAME_CHAR+"]+$","u");var yCe=9,kCe=10,qCe=13,jCe=32;Ka.S_LIST=[jCe,kCe,qCe,yCe];function bMa(a){return a>=1&&a<=55295||a>=57344&&a<=65533||a>=65536&&a<=1114111}Ka.isChar=bMa;function IMa(a){return a>=1&&a<=8||a===11||a===12||a>=14&&a<=31||a>=127&&a<=132||a>=134&&a<=159}Ka.isRestrictedChar=IMa;function SMa(a){return a===9||a===10||a===13||a>31&&a<127||a===133||a>159&&a<=55295||a>=57344&&a<=65533||a>=65536&&a<=1114111}Ka.isCharAndNotRestricted=SMa;function TMa(a){return a===jCe||a===kCe||a===qCe||a===yCe}Ka.isS=TMa;function bCe(a){return a>=65&&a<=90||a>=97&&a<=122||a===58||a===95||a===8204||a===8205||a>=192&&a<=214||a>=216&&a<=246||a>=248&&a<=767||a>=880&&a<=893||a>=895&&a<=8191||a>=8304&&a<=8591||a>=11264&&a<=12271||a>=12289&&a<=55295||a>=63744&&a<=64975||a>=65008&&a<=65533||a>=65536&&a<=983039}Ka.isNameStartChar=bCe;function EMa(a){return bCe(a)||a>=48&&a<=57||a===45||a===46||a===183||a>=768&&a<=879||a>=8255&&a<=8256}Ka.isNameChar=EMa});var TCe=We(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.NC_NAME_START_CHAR="A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}";vn.NC_NAME_CHAR="-"+vn.NC_NAME_START_CHAR+".0-9\xB7\u0300-\u036F\u203F-\u2040";vn.NC_NAME_START_CHAR_RE=new RegExp("^["+vn.NC_NAME_START_CHAR+"]$","u");vn.NC_NAME_CHAR_RE=new RegExp("^["+vn.NC_NAME_CHAR+"]$","u");vn.NC_NAME_RE=new RegExp("^["+vn.NC_NAME_START_CHAR+"]["+vn.NC_NAME_CHAR+"]*$","u");function SCe(a){return a>=65&&a<=90||a===95||a>=97&&a<=122||a>=192&&a<=214||a>=216&&a<=246||a>=248&&a<=767||a>=880&&a<=893||a>=895&&a<=8191||a>=8204&&a<=8205||a>=8304&&a<=8591||a>=11264&&a<=12271||a>=12289&&a<=55295||a>=63744&&a<=64975||a>=65008&&a<=65533||a>=65536&&a<=983039}vn.isNCNameStartChar=SCe;function CMa(a){return SCe(a)||a===45||a===46||a>=48&&a<=57||a===183||a>=768&&a<=879||a>=8255&&a<=8256}vn.isNCNameChar=CMa});var HCe=We(Hh=>{"use strict";Object.defineProperty(Hh,"__esModule",{value:!0});Hh.SaxesParser=Hh.EVENTS=void 0;var Qh=gCe(),RMa=ICe(),Z5=TCe(),wn=Qh.isS,AMa=Qh.isChar,bj=Qh.isNameStartChar,ECe=Qh.isNameChar,KCe=Qh.S_LIST,DMa=Qh.NAME_RE,xMa=RMa.isChar,MMa=Z5.isNCNameStartChar,PMa=Z5.isNCNameChar,LMa=Z5.NC_NAME_RE,$P="http://www.w3.org/XML/1998/namespace",$h="http://www.w3.org/2000/xmlns/",OMa={__proto__:null,xml:$P,xmlns:$h},FMa={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},Ei=-1,qd=-2,CCe=0,UMa=1,U5=2,zMa=3,Vh=4,BMa=5,KMa=6,VMa=7,z5=8,WMa=9,GMa=10,$Ma=11,HMa=12,Kt=13,BP=14,B5=15,QMa=16,K5=17,XMa=18,JMa=19,V5=20,YMa=21,ZMa=22,ePa=23,RCe=24,W5=25,KP=26,ACe=27,aPa=28,iPa=29,DCe=30,rPa=31,tPa=32,Gf=33,nPa=34,G5=35,Ij=36,$5=37,sPa=38,xCe=39,MCe=40,oPa=41,PCe=42,dPa=43,lPa=44,H5=9,To=10,Q5=13,LCe=32,OCe=33,VCe=34,Sj=38,WCe=39,VP=45,WP=47,mPa=59,lc=60,Wh=61,Sr=62,st=63,GCe=91,Gh=93,FCe=133,UCe=8232,GP=a=>a===VCe||a===WCe,$Ce=[VCe,WCe],cPa=[...$Ce,GCe,Sr],uPa=[...$Ce,lc,Gh],fPa=[Wh,st,...KCe],NPa=[...KCe,Sr,Sj,lc];function J5(a,e,i){switch(e){case"xml":i!==$P&&a.fail(`xml prefix must be bound to ${$P}.`);break;case"xmlns":i!==$h&&a.fail(`xmlns prefix must be bound to ${$h}.`);break;default:}switch(i){case $h:a.fail(e===""?`the default namespace may not be set to ${i}.`:`may not assign a prefix (even "xmlns") to the URI ${$h}.`);break;case $P:switch(e){case"xml":break;case"":a.fail(`the default namespace may not be set to ${i}.`);break;default:a.fail("may not assign the xml namespace to another prefix.")}break;default:}}function pPa(a,e){for(let i of Object.keys(e))J5(a,i,e[i])}var _Pa=a=>LMa.test(a),hPa=a=>DMa.test(a),$f=0,zCe=1,X5=2;Hh.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];var BCe={xmldecl:"xmldeclHandler",text:"textHandler",processinginstruction:"piHandler",doctype:"doctypeHandler",comment:"commentHandler",opentagstart:"openTagStartHandler",attribute:"attributeHandler",opentag:"openTagHandler",closetag:"closeTagHandler",cdata:"cdataHandler",error:"errorHandler",end:"endHandler",ready:"readyHandler"},Y5=class{constructor(e){this.opt=e??{},this.fragmentOpt=!!this.opt.fragment;let i=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=this.opt.position!==!1,this.fileName=this.opt.fileName,i){this.nameStartCheck=MMa,this.nameCheck=PMa,this.isName=_Pa,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},OMa);let r=this.opt.additionalNamespaces;r!=null&&(pPa(this,r),Object.assign(this.ns,r))}else this.nameStartCheck=bj,this.nameCheck=ECe,this.isName=hPa,this.processAttribs=this.processAttribsPlain,this.pushAttrib=this.pushAttribPlain;this.stateTable=[this.sBegin,this.sBeginWhitespace,this.sDoctype,this.sDoctypeQuote,this.sDTD,this.sDTDQuoted,this.sDTDOpenWaka,this.sDTDOpenWakaBang,this.sDTDComment,this.sDTDCommentEnding,this.sDTDCommentEnded,this.sDTDPI,this.sDTDPIEnding,this.sText,this.sEntity,this.sOpenWaka,this.sOpenWakaBang,this.sComment,this.sCommentEnding,this.sCommentEnded,this.sCData,this.sCDataEnding,this.sCDataEnding2,this.sPIFirstChar,this.sPIRest,this.sPIBody,this.sPIEnding,this.sXMLDeclNameStart,this.sXMLDeclName,this.sXMLDeclEq,this.sXMLDeclValueStart,this.sXMLDeclValue,this.sXMLDeclSeparator,this.sXMLDeclEnding,this.sOpenTag,this.sOpenTagSlash,this.sAttrib,this.sAttribName,this.sAttribNameSawWhite,this.sAttribValue,this.sAttribValueQuoted,this.sAttribValueClosed,this.sAttribValueUnquoted,this.sCloseTag,this.sCloseTagSawWhite],this._init()}get closed(){return this._closed}_init(){var e;this.openWakaBang="",this.text="",this.name="",this.piTarget="",this.entity="",this.q=null,this.tags=[],this.tag=null,this.topNS=null,this.chunk="",this.chunkPosition=0,this.i=0,this.prevI=0,this.carriedFromPrevious=void 0,this.forbiddenState=$f,this.attribList=[];let{fragmentOpt:i}=this;this.state=i?Kt:CCe,this.reportedTextBeforeRoot=this.reportedTextAfterRoot=this.closedRoot=this.sawRoot=i,this.xmlDeclPossible=!i,this.xmlDeclExpects=["version"],this.entityReturnState=void 0;let{defaultXMLVersion:r}=this.opt;if(r===void 0){if(this.opt.forceXMLVersion===!0)throw new Error("forceXMLVersion set but defaultXMLVersion is not set");r="1.0"}this.setXMLVersion(r),this.positionAtNewLine=0,this.doctype=!1,this._closed=!1,this.xmlDecl={version:void 0,encoding:void 0,standalone:void 0},this.line=1,this.column=0,this.ENTITIES=Object.create(FMa),(e=this.readyHandler)===null||e===void 0||e.call(this)}get position(){return this.chunkPosition+this.i}get columnIndex(){return this.position-this.positionAtNewLine}on(e,i){this[BCe[e]]=i}off(e){this[BCe[e]]=void 0}makeError(e){var i;let r=(i=this.fileName)!==null&&i!==void 0?i:"";return this.trackPosition&&(r.length>0&&(r+=":"),r+=`${this.line}:${this.column}`),r.length>0&&(r+=": "),new Error(r+e)}fail(e){let i=this.makeError(e),r=this.errorHandler;if(r===void 0)throw i;return r(i),this}write(e){if(this.closed)return this.fail("cannot write after close; assign an onready handler.");let i=!1;e===null?(i=!0,e=""):typeof e=="object"&&(e=e.toString()),this.carriedFromPrevious!==void 0&&(e=`${this.carriedFromPrevious}${e}`,this.carriedFromPrevious=void 0);let r=e.length,t=e.charCodeAt(r-1);!i&&(t===Q5||t>=55296&&t<=56319)&&(this.carriedFromPrevious=e[r-1],r--,e=e.slice(0,r));let{stateTable:n}=this;for(this.chunk=e,this.i=0;this.i<r;)n[this.state].call(this);return this.chunkPosition+=r,i?this.end():this}close(){return this.write(null)}getCode10(){let{chunk:e,i}=this;if(this.prevI=i,this.i=i+1,i>=e.length)return Ei;let r=e.charCodeAt(i);if(this.column++,r<55296){if(r>=LCe||r===H5)return r;switch(r){case To:return this.line++,this.column=0,this.positionAtNewLine=this.position,To;case Q5:return e.charCodeAt(i+1)===To&&(this.i=i+2),this.line++,this.column=0,this.positionAtNewLine=this.position,qd;default:return this.fail("disallowed character."),r}}if(r>56319)return r>=57344&&r<=65533||this.fail("disallowed character."),r;let t=65536+(r-55296)*1024+(e.charCodeAt(i+1)-56320);return this.i=i+2,t>1114111&&this.fail("disallowed character."),t}getCode11(){let{chunk:e,i}=this;if(this.prevI=i,this.i=i+1,i>=e.length)return Ei;let r=e.charCodeAt(i);if(this.column++,r<55296){if(r>31&&r<127||r>159&&r!==UCe||r===H5)return r;switch(r){case To:return this.line++,this.column=0,this.positionAtNewLine=this.position,To;case Q5:{let n=e.charCodeAt(i+1);(n===To||n===FCe)&&(this.i=i+2)}case FCe:case UCe:return this.line++,this.column=0,this.positionAtNewLine=this.position,qd;default:return this.fail("disallowed character."),r}}if(r>56319)return r>=57344&&r<=65533||this.fail("disallowed character."),r;let t=65536+(r-55296)*1024+(e.charCodeAt(i+1)-56320);return this.i=i+2,t>1114111&&this.fail("disallowed character."),t}getCodeNorm(){let e=this.getCode();return e===qd?To:e}unget(){this.i=this.prevI,this.column--}captureTo(e){let{i}=this,{chunk:r}=this;for(;;){let t=this.getCode(),n=t===qd,s=n?To:t;if(s===Ei||e.includes(s))return this.text+=r.slice(i,this.prevI),s;n&&(this.text+=`${r.slice(i,this.prevI)}
|