popost 4.6.9 → 4.6.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/README.md +2 -0
- package/SKILL.md +6 -2
- package/assets/canvas/assets/{dist-CX2mxpwq.js → dist-DAI3U0Jz.js} +1 -1
- package/assets/canvas/assets/{es-BFnFFu6P.js → es-3zEBH4X5.js} +1 -1
- package/assets/canvas/assets/index-Ce4sDSi9.css +1 -0
- package/assets/canvas/assets/{index-CwqBT_rk.js → index-Dc4qgNYJ.js} +4 -4
- package/assets/canvas/assets/{jszip.min-DqfCBLrH.js → jszip.min-BwYI3Gs3.js} +1 -1
- package/assets/canvas/build-info.json +6 -6
- package/assets/canvas/index.html +2 -2
- package/dist/cli.js +30544 -27776
- package/dist/index.js +30295 -27591
- package/dist/types/cloud/account.d.ts +14 -0
- package/dist/types/cloud/deliver.d.ts +29 -0
- package/dist/types/cloud/entitlement.d.ts +55 -0
- package/dist/types/cloud/paid-gate.d.ts +159 -0
- package/dist/types/cloud/service.d.ts +68 -23
- package/dist/types/commands/link-platforms.d.ts +2 -0
- package/dist/types/commands/update.d.ts +2 -0
- package/dist/types/device-login.d.ts +35 -0
- package/dist/types/editor/canvas-state.d.ts +1 -1
- package/dist/types/editor/handoff.d.ts +12 -3
- package/dist/types/editor/http-types.d.ts +4 -1
- package/dist/types/editor/routes-cloud.d.ts +4 -3
- package/dist/types/install/agents.d.ts +36 -11
- package/dist/types/install/record.d.ts +15 -0
- package/dist/types/providers/api-errors.d.ts +2 -0
- package/dist/types/providers/api.d.ts +3 -1
- package/dist/types/providers/link.d.ts +2 -0
- package/dist/types/providers/pricing.d.ts +11 -0
- package/dist/types/runtime.d.ts +38 -0
- package/dist/types/update/auto.d.ts +14 -0
- package/dist/types/update/check.d.ts +47 -0
- package/dist/types/update/install-kind.d.ts +27 -0
- package/dist/types/update/npm.d.ts +8 -0
- package/dist/types/update/perform.d.ts +64 -0
- package/dist/types/update/report.d.ts +7 -0
- package/dist/types/update/semver.d.ts +17 -0
- package/dist/types/update/session.d.ts +19 -0
- package/dist/types/update/state.d.ts +91 -0
- package/dist/types/update/verify.d.ts +33 -0
- package/dist/types/version.d.ts +1 -1
- package/dist/types/video/cache/frames.d.ts +85 -0
- package/dist/types/video/cache/holds.d.ts +35 -0
- package/dist/types/video/cache/project.d.ts +57 -0
- package/dist/types/video/commands/clean.d.ts +9 -0
- package/dist/types/video/commands/product.d.ts +15 -0
- package/dist/types/video/compile/footage.d.ts +24 -7
- package/dist/types/video/compile/index.d.ts +3 -0
- package/dist/types/video/generate/index.d.ts +13 -1
- package/dist/types/video/preview/cloud.d.ts +20 -1
- package/dist/types/video/preview/edit/routes.d.ts +17 -11
- package/dist/types/video/preview/export-settings.d.ts +1 -2
- package/dist/types/video/preview/project.d.ts +3 -0
- package/dist/types/video/preview/shell/dom.d.ts +2 -0
- package/dist/types/video/preview/shell/footage.d.ts +2 -1
- package/dist/types/video/preview/shell/i18n.d.ts +1 -1
- package/dist/types/video/preview/shell/studio/cloud.d.ts +6 -1
- package/dist/types/video/preview/shell/studio/compare.d.ts +16 -0
- package/dist/types/video/preview/shell/studio/copy.d.ts +24 -3
- package/dist/types/video/preview/shell/studio/paid.d.ts +23 -0
- package/dist/types/video/preview/shell/studio/style.d.ts +2 -2
- package/dist/types/video/preview/shell/studio/workspace.d.ts +2 -0
- package/dist/types/video/preview/shell-bundle.d.ts +1 -1
- package/dist/types/video/product/requests.d.ts +74 -0
- package/dist/types/video/product/review.d.ts +74 -0
- package/dist/types/video/product/sheet.d.ts +99 -0
- package/dist/types/video/project/schema.d.ts +21 -21
- package/dist/types/video/render/index.d.ts +2 -0
- package/dist/types/video/render/session.d.ts +4 -0
- package/dist/types/video/replication/contract.d.ts +29 -29
- package/dist/types/video/replication/production.d.ts +5 -5
- package/dist/types/video/replication/schema.d.ts +2 -2
- package/dist/types/video/replication/speech-observed.d.ts +6 -6
- package/package.json +1 -1
- package/references/host-editor.md +33 -8
- package/references/image-workflow.md +6 -6
- package/references/onboarding.md +23 -3
- package/references/post-bundle.md +7 -7
- package/references/video-editing.md +19 -7
- package/references/video-performers.md +2 -2
- package/references/video-product.md +174 -0
- package/references/video-replication.md +1 -1
- package/references/video-step-1-read.md +15 -1
- package/references/video-step-3-content.md +14 -6
- package/references/video-step-7-deliver.md +36 -1
- package/references/video-tools.md +43 -7
- package/references/video.md +5 -0
- package/assets/canvas/assets/index-C5rz5H21.css +0 -1
- package/dist/types/cloud/auth-flow.d.ts +0 -30
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./index-CwqBT_rk.js";var t=e(((e,t)=>{function n(e){let t=e.length;for(;--t>=0;)e[t]=0}var r=29,i=30,a=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),o=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),s=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),c=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),l=512,u=Array(576);n(u);var d=Array(60);n(d);var f=Array(l);n(f);var p=Array(256);n(p);var m=Array(r);n(m);var h=Array(i);n(h);function g(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}var _,v,y;function b(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}var x=e=>e<256?f[e]:f[256+(e>>>7)],S=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},C=(e,t,n)=>{e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,S(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},w=(e,t,n)=>{C(e,n[t*2],n[t*2+1])},T=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},E=e=>{e.bi_valid===16?(S(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},D=(e,t)=>{let n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length,l,u,d,f,p,m,h=0;for(f=0;f<=15;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<573;l++)u=e.heap[l],f=n[n[u*2+1]*2+1]+1,f>c&&(f=c,h++),n[u*2+1]=f,!(u>r)&&(e.bl_count[f]++,p=0,u>=s&&(p=o[u-s]),m=n[u*2],e.opt_len+=m*(f+p),a&&(e.static_len+=m*(i[u*2+1]+p)));if(h!==0){do{for(f=c-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[c]--,h-=2}while(h>0);for(f=c;f!==0;f--)for(u=e.bl_count[f];u!==0;)d=e.heap[--l],!(d>r)&&(n[d*2+1]!==f&&(e.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),u--)}},O=(e,t,n)=>{let r=Array(16),i=0,a,o;for(a=1;a<=15;a++)i=i+n[a-1]<<1,r[a]=i;for(o=0;o<=t;o++){let t=e[o*2+1];t!==0&&(e[o*2]=T(r[t]++,t))}},k=()=>{let e,t,n,r,c,l=Array(16);for(n=0,r=0;r<28;r++)for(m[r]=n,e=0;e<1<<a[r];e++)p[n++]=r;for(p[n-1]=r,c=0,r=0;r<16;r++)for(h[r]=c,e=0;e<1<<o[r];e++)f[c++]=r;for(c>>=7;r<i;r++)for(h[r]=c<<7,e=0;e<1<<o[r]-7;e++)f[256+c++]=r;for(t=0;t<=15;t++)l[t]=0;for(e=0;e<=143;)u[e*2+1]=8,e++,l[8]++;for(;e<=255;)u[e*2+1]=9,e++,l[9]++;for(;e<=279;)u[e*2+1]=7,e++,l[7]++;for(;e<=287;)u[e*2+1]=8,e++,l[8]++;for(O(u,287,l),e=0;e<i;e++)d[e*2+1]=5,d[e*2]=T(e,5);_=new g(u,a,257,286,15),v=new g(d,o,0,i,15),y=new g([],s,0,19,7)},A=e=>{let t;for(t=0;t<286;t++)e.dyn_ltree[t*2]=0;for(t=0;t<i;t++)e.dyn_dtree[t*2]=0;for(t=0;t<19;t++)e.bl_tree[t*2]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},j=e=>{e.bi_valid>8?S(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},M=(e,t,n,r)=>{let i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]},N=(e,t,n)=>{let r=e.heap[n],i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&M(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!M(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},P=(e,t,n)=>{let r,i,s=0,c,l;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+s++]&255,r+=(e.pending_buf[e.sym_buf+s++]&255)<<8,i=e.pending_buf[e.sym_buf+s++],r===0?w(e,i,t):(c=p[i],w(e,c+256+1,t),l=a[c],l!==0&&(i-=m[c],C(e,i,l)),r--,c=x(r),w(e,c,n),l=o[c],l!==0&&(r-=h[c],C(e,r,l)));while(s<e.sym_next);w(e,256,t)},ee=(e,t)=>{let n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems,o,s,c=-1,l;for(e.heap_len=0,e.heap_max=573,o=0;o<a;o++)n[o*2]===0?n[o*2+1]=0:(e.heap[++e.heap_len]=c=o,e.depth[o]=0);for(;e.heap_len<2;)l=e.heap[++e.heap_len]=c<2?++c:0,n[l*2]=1,e.depth[l]=0,e.opt_len--,i&&(e.static_len-=r[l*2+1]);for(t.max_code=c,o=e.heap_len>>1;o>=1;o--)N(e,n,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],N(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,n[l*2]=n[o*2]+n[s*2],e.depth[l]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,n[o*2+1]=n[s*2+1]=l,e.heap[1]=l++,N(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],D(e,t),O(n,c,e.bl_count)},F=(e,t,n)=>{let r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)&&(s<l?e.bl_tree[a*2]+=s:a===0?s<=10?e.bl_tree[34]++:e.bl_tree[36]++:(a!==i&&e.bl_tree[a*2]++,e.bl_tree[32]++),s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4))},I=(e,t,n)=>{let r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),r=0;r<=n;r++)if(a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)){if(s<l)do w(e,a,e.bl_tree);while(--s!==0);else a===0?s<=10?(w(e,17,e.bl_tree),C(e,s-3,3)):(w(e,18,e.bl_tree),C(e,s-11,7)):(a!==i&&(w(e,a,e.bl_tree),s--),w(e,16,e.bl_tree),C(e,s-3,2));s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4)}},te=e=>{let t;for(F(e,e.dyn_ltree,e.l_desc.max_code),F(e,e.dyn_dtree,e.d_desc.max_code),ee(e,e.bl_desc),t=18;t>=3&&e.bl_tree[c[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},ne=(e,t,n,r)=>{let i;for(C(e,t-257,5),C(e,n-1,5),C(e,r-4,4),i=0;i<r;i++)C(e,e.bl_tree[c[i]*2+1],3);I(e,e.dyn_ltree,t-1),I(e,e.dyn_dtree,n-1)},re=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return 0;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return 1;for(n=32;n<256;n++)if(e.dyn_ltree[n*2]!==0)return 1;return 0},ie=!1,ae=e=>{ie||=(k(),!0),e.l_desc=new b(e.dyn_ltree,_),e.d_desc=new b(e.dyn_dtree,v),e.bl_desc=new b(e.bl_tree,y),e.bi_buf=0,e.bi_valid=0,A(e)},oe=(e,t,n,r)=>{C(e,0+ +!!r,3),j(e),S(e,n),S(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},se=e=>{C(e,2,3),w(e,256,u),E(e)},ce=(e,t,n,r)=>{let i,a,o=0;e.level>0?(e.strm.data_type===2&&(e.strm.data_type=re(e)),ee(e,e.l_desc),ee(e,e.d_desc),o=te(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=n+5,n+4<=i&&t!==-1?oe(e,t,n,r):e.strategy===4||a===i?(C(e,2+ +!!r,3),P(e,u,d)):(C(e,4+ +!!r,3),ne(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),P(e,e.dyn_ltree,e.dyn_dtree)),A(e),r&&j(e)},L=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(p[n]+256+1)*2]++,e.dyn_dtree[x(t)*2]++),e.sym_next===e.sym_end);t.exports._tr_init=ae,t.exports._tr_stored_block=oe,t.exports._tr_flush_block=ce,t.exports._tr_tally=L,t.exports._tr_align=se})),n=e(((e,t)=>{t.exports=(e,t,n,r)=>{let i=e&65535|0,a=e>>>16&65535|0,o=0;for(;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+t[r++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0}})),r=e(((e,t)=>{var n=new Uint32Array((()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t})());t.exports=(e,t,r,i)=>{let a=n,o=i+r;e^=-1;for(let n=i;n<o;n++)e=e>>>8^a[(e^t[n])&255];return e^-1}})),i=e(((e,t)=>{t.exports={2:`need dictionary`,1:`stream end`,0:``,"-1":`file error`,"-2":`stream error`,"-3":`data error`,"-4":`insufficient memory`,"-5":`buffer error`,"-6":`incompatible version`}})),a=e(((e,t)=>{t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}})),o=e(((e,o)=>{var{_tr_init:s,_tr_stored_block:c,_tr_flush_block:l,_tr_tally:u,_tr_align:d}=t(),f=n(),p=r(),m=i(),{Z_NO_FLUSH:h,Z_PARTIAL_FLUSH:g,Z_FULL_FLUSH:_,Z_FINISH:v,Z_BLOCK:y,Z_OK:b,Z_STREAM_END:x,Z_STREAM_ERROR:S,Z_DATA_ERROR:C,Z_BUF_ERROR:w,Z_DEFAULT_COMPRESSION:T,Z_FILTERED:E,Z_HUFFMAN_ONLY:D,Z_RLE:O,Z_FIXED:k,Z_DEFAULT_STRATEGY:A,Z_UNKNOWN:j,Z_DEFLATED:M}=a(),N=9,P=15,ee=8,F=573,I=3,te=258,ne=262,re=32,ie=42,ae=57,oe=69,se=73,ce=91,L=103,le=113,ue=666,de=1,fe=2,pe=3,R=4,me=3,z=(e,t)=>(e.msg=m[t],t),he=e=>e*2-(e>4?9:0),ge=e=>{let t=e.length;for(;--t>=0;)e[t]=0},B=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=i?n-i:0;while(--t);t=i,r=t;do n=e.prev[--r],e.prev[r]=n>=i?n-i:0;while(--t)},V=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,H=e=>{let t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},_e=(e,t)=>{l(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,H(e.strm)},U=(e,t)=>{e.pending_buf[e.pending++]=t},ve=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},ye=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),e.state.wrap===1?e.adler=f(e.adler,t,i,n):e.state.wrap===2&&(e.adler=p(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},W=(e,t)=>{let n=e.max_chain_length,r=e.strstart,i,a,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-ne?e.strstart-(e.w_size-ne):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+te,p=l[r+o-1],m=l[r+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,l[i+o]===m&&l[i+o-1]===p&&l[i]===l[r]&&l[++i]===l[r+1]){r+=2,i++;do;while(l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&r<f);if(a=te-(f-r),r=f-te,a>o){if(e.match_start=t,o=a,a>=s)break;p=l[r+o-1],m=l[r+o]}}while((t=d[t&u])>c&&--n!==0);return o<=e.lookahead?o:e.lookahead},G=e=>{let t=e.w_size,n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-ne)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),B(e),r+=t),e.strm.avail_in===0)break;if(n=ye(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=I)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=V(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=V(e,e.ins_h,e.window[i+I-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<I)););}while(e.lookahead<ne&&e.strm.avail_in!==0)},be=(e,t)=>{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,i,a,o=0,s=e.strm.avail_in;do{if(r=65535,a=e.bi_valid+42>>3,e.strm.avail_out<a||(a=e.strm.avail_out-a,i=e.strstart-e.block_start,r>i+e.strm.avail_in&&(r=i+e.strm.avail_in),r>a&&(r=a),r<n&&(r===0&&t!==v||t===h||r!==i+e.strm.avail_in)))break;o=+(t===v&&r===i+e.strm.avail_in),c(e,0,0,o),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,H(e.strm),i&&(i>r&&(i=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,r-=i),r&&(ye(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(o===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),o?R:t!==h&&t!==v&&e.strm.avail_in===0&&e.strstart===e.block_start?fe:(a=e.window_size-e.strstart,e.strm.avail_in>a&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,a+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),a>e.strm.avail_in&&(a=e.strm.avail_in),a&&(ye(e.strm,e.window,e.strstart,a),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.high_water<e.strstart&&(e.high_water=e.strstart),a=e.bi_valid+42>>3,a=e.pending_buf_size-a>65535?65535:e.pending_buf_size-a,n=a>e.w_size?e.w_size:a,i=e.strstart-e.block_start,(i>=n||(i||t===v)&&t!==h&&e.strm.avail_in===0&&i<=a)&&(r=i>a?a:i,o=+(t===v&&e.strm.avail_in===0&&r===i),c(e,e.block_start,r,o),e.block_start+=r,H(e.strm)),o?pe:de)},xe=(e,t)=>{let n,r;for(;;){if(e.lookahead<ne){if(G(e),e.lookahead<ne&&t===h)return de;if(e.lookahead===0)break}if(n=0,e.lookahead>=I&&(e.ins_h=V(e,e.ins_h,e.window[e.strstart+I-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-ne&&(e.match_length=W(e,n)),e.match_length>=I){if(r=u(e,e.strstart-e.match_start,e.match_length-I),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=I){e.match_length--;do e.strstart++,e.ins_h=V(e,e.ins_h,e.window[e.strstart+I-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=V(e,e.ins_h,e.window[e.strstart+1])}else r=u(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(_e(e,!1),e.strm.avail_out===0))return de}return e.insert=e.strstart<2?e.strstart:2,t===v?(_e(e,!0),e.strm.avail_out===0?pe:R):e.sym_next&&(_e(e,!1),e.strm.avail_out===0)?de:fe},K=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<ne){if(G(e),e.lookahead<ne&&t===h)return de;if(e.lookahead===0)break}if(n=0,e.lookahead>=I&&(e.ins_h=V(e,e.ins_h,e.window[e.strstart+I-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-ne&&(e.match_length=W(e,n),e.match_length<=5&&(e.strategy===E||e.match_length===I&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=I&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-I,r=u(e,e.strstart-1-e.prev_match,e.prev_length-I),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=V(e,e.ins_h,e.window[e.strstart+I-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(_e(e,!1),e.strm.avail_out===0))return de}else if(e.match_available){if(r=u(e,0,e.window[e.strstart-1]),r&&_e(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return de}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&=(r=u(e,0,e.window[e.strstart-1]),0),e.insert=e.strstart<2?e.strstart:2,t===v?(_e(e,!0),e.strm.avail_out===0?pe:R):e.sym_next&&(_e(e,!1),e.strm.avail_out===0)?de:fe},q=(e,t)=>{let n,r,i,a,o=e.window;for(;;){if(e.lookahead<=te){if(G(e),e.lookahead<=te&&t===h)return de;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=I&&e.strstart>0&&(i=e.strstart-1,r=o[i],r===o[++i]&&r===o[++i]&&r===o[++i])){a=e.strstart+te;do;while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&i<a);e.match_length=te-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=I?(n=u(e,1,e.match_length-I),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=u(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(_e(e,!1),e.strm.avail_out===0))return de}return e.insert=0,t===v?(_e(e,!0),e.strm.avail_out===0?pe:R):e.sym_next&&(_e(e,!1),e.strm.avail_out===0)?de:fe},Se=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(G(e),e.lookahead===0)){if(t===h)return de;break}if(e.match_length=0,n=u(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(_e(e,!1),e.strm.avail_out===0))return de}return e.insert=0,t===v?(_e(e,!0),e.strm.avail_out===0?pe:R):e.sym_next&&(_e(e,!1),e.strm.avail_out===0)?de:fe};function Ce(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}var J=[new Ce(0,0,0,0,be),new Ce(4,4,8,4,xe),new Ce(4,5,16,8,xe),new Ce(4,6,32,32,xe),new Ce(4,4,16,16,K),new Ce(8,16,32,32,K),new Ce(8,16,128,128,K),new Ce(8,32,128,256,K),new Ce(32,128,258,1024,K),new Ce(32,258,258,4096,K)],we=e=>{e.window_size=2*e.w_size,ge(e.head),e.max_lazy_match=J[e.level].max_lazy,e.good_match=J[e.level].good_length,e.nice_match=J[e.level].nice_length,e.max_chain_length=J[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0};function Y(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=M,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(F*2),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),ge(this.dyn_ltree),ge(this.dyn_dtree),ge(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),ge(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),ge(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var X=e=>{if(!e)return 1;let t=e.state;return+(!t||t.strm!==e||t.status!==ie&&t.status!==ae&&t.status!==oe&&t.status!==se&&t.status!==ce&&t.status!==L&&t.status!==le&&t.status!==ue)},Te=e=>{if(X(e))return z(e,S);e.total_in=e.total_out=0,e.data_type=j;let t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?ae:t.wrap?ie:le,e.adler=t.wrap===2?0:1,t.last_flush=-2,s(t),b},Z=e=>{let t=Te(e);return t===b&&we(e.state),t},Ee=(e,t)=>X(e)||e.state.wrap!==2?S:(e.state.gzhead=t,b),Q=(e,t,n,r,i,a)=>{if(!e)return S;let o=1;if(t===T&&(t=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),i<1||i>N||n!==M||r<8||r>15||t<0||t>9||a<0||a>k||r===8&&o!==1)return z(e,S);r===8&&(r=9);let s=new Y;return e.state=s,s.strm=e,s.status=ie,s.wrap=o,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+I-1)/I),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=t,s.strategy=a,s.method=n,Z(e)},$=(e,t)=>Q(e,t,M,P,ee,A),De=(e,t)=>{if(X(e)||t>y||t<0)return e?z(e,S):S;let n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===ue&&t!==v)return z(e,e.avail_out===0?w:S);let r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(H(e),e.avail_out===0)return n.last_flush=-1,b}else if(e.avail_in===0&&he(t)<=he(r)&&t!==v)return z(e,w);if(n.status===ue&&e.avail_in!==0)return z(e,w);if(n.status===ie&&n.wrap===0&&(n.status=le),n.status===ie){let t=M+(n.w_bits-8<<4)<<8,r=-1;if(r=n.strategy>=D||n.level<2?0:n.level<6?1:n.level===6?2:3,t|=r<<6,n.strstart!==0&&(t|=re),t+=31-t%31,ve(n,t),n.strstart!==0&&(ve(n,e.adler>>>16),ve(n,e.adler&65535)),e.adler=1,n.status=le,H(e),n.pending!==0)return n.last_flush=-1,b}if(n.status===ae){if(e.adler=0,U(n,31),U(n,139),U(n,8),n.gzhead)U(n,+!!n.gzhead.text+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),U(n,n.gzhead.time&255),U(n,n.gzhead.time>>8&255),U(n,n.gzhead.time>>16&255),U(n,n.gzhead.time>>24&255),U(n,n.level===9?2:n.strategy>=D||n.level<2?4:0),U(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(U(n,n.gzhead.extra.length&255),U(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=p(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=oe;else if(U(n,0),U(n,0),U(n,0),U(n,0),U(n,0),U(n,n.level===9?2:n.strategy>=D||n.level<2?4:0),U(n,me),n.status=le,H(e),n.pending!==0)return n.last_flush=-1,b}if(n.status===oe){if(n.gzhead.extra){let t=n.pending,r=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+r>n.pending_buf_size;){let i=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+i),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>t&&(e.adler=p(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex+=i,H(e),n.pending!==0)return n.last_flush=-1,b;t=0,r-=i}let i=new Uint8Array(n.gzhead.extra);n.pending_buf.set(i.subarray(n.gzindex,n.gzindex+r),n.pending),n.pending+=r,n.gzhead.hcrc&&n.pending>t&&(e.adler=p(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=se}if(n.status===se){if(n.gzhead.name){let t=n.pending,r;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>t&&(e.adler=p(e.adler,n.pending_buf,n.pending-t,t)),H(e),n.pending!==0)return n.last_flush=-1,b;t=0}r=n.gzindex<n.gzhead.name.length?n.gzhead.name.charCodeAt(n.gzindex++)&255:0,U(n,r)}while(r!==0);n.gzhead.hcrc&&n.pending>t&&(e.adler=p(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=ce}if(n.status===ce){if(n.gzhead.comment){let t=n.pending,r;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>t&&(e.adler=p(e.adler,n.pending_buf,n.pending-t,t)),H(e),n.pending!==0)return n.last_flush=-1,b;t=0}r=n.gzindex<n.gzhead.comment.length?n.gzhead.comment.charCodeAt(n.gzindex++)&255:0,U(n,r)}while(r!==0);n.gzhead.hcrc&&n.pending>t&&(e.adler=p(e.adler,n.pending_buf,n.pending-t,t))}n.status=L}if(n.status===L){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(H(e),n.pending!==0))return n.last_flush=-1,b;U(n,e.adler&255),U(n,e.adler>>8&255),e.adler=0}if(n.status=le,H(e),n.pending!==0)return n.last_flush=-1,b}if(e.avail_in!==0||n.lookahead!==0||t!==h&&n.status!==ue){let r=n.level===0?be(n,t):n.strategy===D?Se(n,t):n.strategy===O?q(n,t):J[n.level].func(n,t);if((r===pe||r===R)&&(n.status=ue),r===de||r===pe)return e.avail_out===0&&(n.last_flush=-1),b;if(r===fe&&(t===g?d(n):t!==y&&(c(n,0,0,!1),t===_&&(ge(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),H(e),e.avail_out===0))return n.last_flush=-1,b}return t===v?n.wrap<=0?x:(n.wrap===2?(U(n,e.adler&255),U(n,e.adler>>8&255),U(n,e.adler>>16&255),U(n,e.adler>>24&255),U(n,e.total_in&255),U(n,e.total_in>>8&255),U(n,e.total_in>>16&255),U(n,e.total_in>>24&255)):(ve(n,e.adler>>>16),ve(n,e.adler&65535)),H(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending===0?x:b):b},Oe=e=>{if(X(e))return S;let t=e.state.status;return e.state=null,t===le?z(e,C):b},ke=(e,t)=>{let n=t.length;if(X(e))return S;let r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==ie||r.lookahead)return S;if(i===1&&(e.adler=f(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){i===0&&(ge(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(n-r.w_size,n),0),t=e,n=r.w_size}let a=e.avail_in,o=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,G(r);r.lookahead>=I;){let e=r.strstart,t=r.lookahead-2;do r.ins_h=V(r,r.ins_h,r.window[e+I-1]),r.prev[e&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=e,e++;while(--t);r.strstart=e,r.lookahead=2,G(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=o,e.input=s,e.avail_in=a,r.wrap=i,b};o.exports.deflateInit=$,o.exports.deflateInit2=Q,o.exports.deflateReset=Z,o.exports.deflateResetKeep=Te,o.exports.deflateSetHeader=Ee,o.exports.deflate=De,o.exports.deflateEnd=Oe,o.exports.deflateSetDictionary=ke,o.exports.deflateInfo=`pako deflate (from Nodeca project)`})),s=e(((e,t)=>{var n=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);t.exports.assign=function(e){let t=Array.prototype.slice.call(arguments,1);for(;t.length;){let r=t.shift();if(r){if(typeof r!=`object`)throw TypeError(r+`must be non-object`);for(let t in r)n(r,t)&&(e[t]=r[t])}}return e},t.exports.flattenChunks=e=>{let t=0;for(let n=0,r=e.length;n<r;n++)t+=e[n].length;let n=new Uint8Array(t);for(let t=0,r=0,i=e.length;t<i;t++){let i=e[t];n.set(i,r),r+=i.length}return n}})),c=e(((e,t)=>{var n=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{n=!1}var r=new Uint8Array(256);for(let e=0;e<256;e++)r[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;r[254]=r[254]=1,t.exports.string2buf=e=>{if(typeof TextEncoder==`function`&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,n,r,i,a,o=e.length,s=0;for(i=0;i<o;i++)n=e.charCodeAt(i),(n&64512)==55296&&i+1<o&&(r=e.charCodeAt(i+1),(r&64512)==56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),a=0,i=0;a<s;i++)n=e.charCodeAt(i),(n&64512)==55296&&i+1<o&&(r=e.charCodeAt(i+1),(r&64512)==56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?t[a++]=n:n<2048?(t[a++]=192|n>>>6,t[a++]=128|n&63):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|n&63):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|n&63);return t};var i=(e,t)=>{if(t<65534&&e.subarray&&n)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let r=``;for(let n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r};t.exports.buf2string=(e,t)=>{let n=t||e.length;if(typeof TextDecoder==`function`&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let a,o,s=Array(n*2);for(o=0,a=0;a<n;){let t=e[a++];if(t<128){s[o++]=t;continue}let i=r[t];if(i>4){s[o++]=65533,a+=i-1;continue}for(t&=i===2?31:i===3?15:7;i>1&&a<n;)t=t<<6|e[a++]&63,i--;if(i>1){s[o++]=65533;continue}t<65536?s[o++]=t:(t-=65536,s[o++]=55296|t>>10&1023,s[o++]=56320|t&1023)}return i(s,o)},t.exports.utf8border=(e,t)=>{t||=e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)==128;)n--;return n<0||n===0?t:n+r[e[n]]>t?n:t}})),l=e(((e,t)=>{function n(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=``,this.state=null,this.data_type=2,this.adler=0}t.exports=n})),u=e(((e,t)=>{var n=o(),r=s(),u=c(),d=i(),f=l(),p=Object.prototype.toString,{Z_NO_FLUSH:m,Z_SYNC_FLUSH:h,Z_FULL_FLUSH:g,Z_FINISH:_,Z_OK:v,Z_STREAM_END:y,Z_DEFAULT_COMPRESSION:b,Z_DEFAULT_STRATEGY:x,Z_DEFLATED:S}=a();function C(e){this.options=r.assign({level:b,method:S,chunkSize:16384,windowBits:15,memLevel:8,strategy:x},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;let i=n.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(i!==v)throw Error(d[i]);if(t.header&&n.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e=typeof t.dictionary==`string`?u.string2buf(t.dictionary):p.call(t.dictionary)===`[object ArrayBuffer]`?new Uint8Array(t.dictionary):t.dictionary,i=n.deflateSetDictionary(this.strm,e),i!==v)throw Error(d[i]);this._dict_set=!0}}C.prototype.push=function(e,t){let r=this.strm,i=this.options.chunkSize,a,o;if(this.ended)return!1;for(o=t===~~t?t:t===!0?_:m,r.input=typeof e==`string`?u.string2buf(e):p.call(e)===`[object ArrayBuffer]`?new Uint8Array(e):e,r.next_in=0,r.avail_in=r.input.length;;){if(r.avail_out===0&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(o===h||o===g)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(a=n.deflate(r,o),a===y)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=n.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===v;if(r.avail_out===0){this.onData(r.output);continue}if(o>0&&r.next_out>0){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(r.avail_in===0)break}return!0},C.prototype.onData=function(e){this.chunks.push(e)},C.prototype.onEnd=function(e){e===v&&(this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function w(e,t){let n=new C(t);if(n.push(e,!0),n.err)throw n.msg||d[n.err];return n.result}function T(e,t){return t||={},t.raw=!0,w(e,t)}function E(e,t){return t||={},t.gzip=!0,w(e,t)}t.exports.Deflate=C,t.exports.deflate=w,t.exports.deflateRaw=T,t.exports.gzip=E,t.exports.constants=a()})),d=e(((e,t)=>{var n=16209;t.exports=function(e,t){let r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D=e.state;r=e.next_in,T=e.input,i=r+(e.avail_in-5),a=e.next_out,E=e.output,o=a-(t-e.avail_out),s=a+(e.avail_out-257),c=D.dmax,l=D.wsize,u=D.whave,d=D.wnext,f=D.window,p=D.hold,m=D.bits,h=D.lencode,g=D.distcode,_=(1<<D.lenbits)-1,v=(1<<D.distbits)-1;top:do{m<15&&(p+=T[r++]<<m,m+=8,p+=T[r++]<<m,m+=8),y=h[p&_];dolen:for(;;){if(b=y>>>24,p>>>=b,m-=b,b=y>>>16&255,b===0)E[a++]=y&65535;else if(b&16){x=y&65535,b&=15,b&&(m<b&&(p+=T[r++]<<m,m+=8),x+=p&(1<<b)-1,p>>>=b,m-=b),m<15&&(p+=T[r++]<<m,m+=8,p+=T[r++]<<m,m+=8),y=g[p&v];dodist:for(;;){if(b=y>>>24,p>>>=b,m-=b,b=y>>>16&255,b&16){if(S=y&65535,b&=15,m<b&&(p+=T[r++]<<m,m+=8,m<b&&(p+=T[r++]<<m,m+=8)),S+=p&(1<<b)-1,S>c){e.msg=`invalid distance too far back`,D.mode=n;break top}if(p>>>=b,m-=b,b=a-o,S>b){if(b=S-b,b>u&&D.sane){e.msg=`invalid distance too far back`,D.mode=n;break top}if(C=0,w=f,d===0){if(C+=l-b,b<x){x-=b;do E[a++]=f[C++];while(--b);C=a-S,w=E}}else if(d<b){if(C+=l+d-b,b-=d,b<x){x-=b;do E[a++]=f[C++];while(--b);if(C=0,d<x){b=d,x-=b;do E[a++]=f[C++];while(--b);C=a-S,w=E}}}else if(C+=d-b,b<x){x-=b;do E[a++]=f[C++];while(--b);C=a-S,w=E}for(;x>2;)E[a++]=w[C++],E[a++]=w[C++],E[a++]=w[C++],x-=3;x&&(E[a++]=w[C++],x>1&&(E[a++]=w[C++]))}else{C=a-S;do E[a++]=E[C++],E[a++]=E[C++],E[a++]=E[C++],x-=3;while(x>2);x&&(E[a++]=E[C++],x>1&&(E[a++]=E[C++]))}}else if(b&64){e.msg=`invalid distance code`,D.mode=n;break top}else{y=g[(y&65535)+(p&(1<<b)-1)];continue dodist}break}}else if(!(b&64)){y=h[(y&65535)+(p&(1<<b)-1)];continue dolen}else if(b&32){D.mode=16191;break top}else{e.msg=`invalid literal/length code`,D.mode=n;break top}break}}while(r<i&&a<s);x=m>>3,r-=x,m-=x<<3,p&=(1<<m)-1,e.next_in=r,e.next_out=a,e.avail_in=r<i?5+(i-r):5-(r-i),e.avail_out=a<s?257+(s-a):257-(a-s),D.hold=p,D.bits=m}})),f=e(((e,t)=>{var n=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),r=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),i=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),a=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);t.exports=(e,t,o,s,c,l,u,d)=>{let f=d.bits,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=0,S=0,C,w,T,E,D,O=null,k,A=new Uint16Array(16),j=new Uint16Array(16),M=null,N,P,ee;for(p=0;p<=15;p++)A[p]=0;for(m=0;m<s;m++)A[t[o+m]]++;for(_=f,g=15;g>=1&&A[g]===0;g--);if(_>g&&(_=g),g===0)return c[l++]=20971520,c[l++]=20971520,d.bits=1,0;for(h=1;h<g&&A[h]===0;h++);for(_<h&&(_=h),b=1,p=1;p<=15;p++)if(b<<=1,b-=A[p],b<0)return-1;if(b>0&&(e===0||g!==1))return-1;for(j[1]=0,p=1;p<15;p++)j[p+1]=j[p]+A[p];for(m=0;m<s;m++)t[o+m]!==0&&(u[j[t[o+m]]++]=m);if(e===0?(O=M=u,k=20):e===1?(O=n,M=r,k=257):(O=i,M=a,k=0),S=0,m=0,p=h,D=l,v=_,y=0,T=-1,x=1<<_,E=x-1,e===1&&x>852||e===2&&x>592)return 1;for(;;){N=p-y,u[m]+1<k?(P=0,ee=u[m]):u[m]>=k?(P=M[u[m]-k],ee=O[u[m]-k]):(P=96,ee=0),C=1<<p-y,w=1<<v,h=w;do w-=C,c[D+(S>>y)+w]=N<<24|P<<16|ee|0;while(w!==0);for(C=1<<p-1;S&C;)C>>=1;if(C===0?S=0:(S&=C-1,S+=C),m++,--A[p]===0){if(p===g)break;p=t[o+u[m]]}if(p>_&&(S&E)!==T){for(y===0&&(y=_),D+=h,v=p-y,b=1<<v;v+y<g&&(b-=A[v+y],!(b<=0));)v++,b<<=1;if(x+=1<<v,e===1&&x>852||e===2&&x>592)return 1;T=S&E,c[T]=_<<24|v<<16|D-l|0}}return S!==0&&(c[D+S]=p-y<<24|4194304),d.bits=_,0}})),p=e(((e,t)=>{var i=n(),o=r(),s=d(),c=f(),l=0,u=1,p=2,{Z_FINISH:m,Z_BLOCK:h,Z_TREES:g,Z_OK:_,Z_STREAM_END:v,Z_NEED_DICT:y,Z_STREAM_ERROR:b,Z_DATA_ERROR:x,Z_MEM_ERROR:S,Z_BUF_ERROR:C,Z_DEFLATED:w}=a(),T=16180,E=16181,D=16182,O=16183,k=16184,A=16185,j=16186,M=16187,N=16188,P=16189,ee=16190,F=16191,I=16192,te=16193,ne=16194,re=16195,ie=16196,ae=16197,oe=16198,se=16199,ce=16200,L=16201,le=16202,ue=16203,de=16204,fe=16205,pe=16206,R=16207,me=16208,z=16209,he=16210,ge=16211,B=852,V=592,H=15,_e=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function U(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var ve=e=>{if(!e)return 1;let t=e.state;return+(!t||t.strm!==e||t.mode<T||t.mode>ge)},ye=e=>{if(ve(e))return b;let t=e.state;return e.total_in=e.total_out=t.total=0,e.msg=``,t.wrap&&(e.adler=t.wrap&1),t.mode=T,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(B),t.distcode=t.distdyn=new Int32Array(V),t.sane=1,t.back=-1,_},W=e=>{if(ve(e))return b;let t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,ye(e)},G=(e,t)=>{let n;if(ve(e))return b;let r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?b:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,W(e))},be=(e,t)=>{if(!e)return b;let n=new U;e.state=n,n.strm=e,n.window=null,n.mode=T;let r=G(e,t);return r!==_&&(e.state=null),r},xe=e=>be(e,H),K=!0,q,Se,Ce=e=>{if(K){q=new Int32Array(512),Se=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(c(u,e.lens,0,288,q,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;c(p,e.lens,0,32,Se,0,e.work,{bits:5}),K=!1}e.lencode=q,e.lenbits=9,e.distcode=Se,e.distbits=5},J=(e,t,n,r)=>{let i,a=e.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),r>=a.wsize?(a.window.set(t.subarray(n-a.wsize,n),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>r&&(i=r),a.window.set(t.subarray(n-r,n-r+i),a.wnext),r-=i,r?(a.window.set(t.subarray(n-r,n),0),a.wnext=r,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},we=(e,t)=>{let n,r,a,d,f,B,V,H,U,ye,W,G,be,xe,K=0,q,Se,we,Y,X,Te,Z,Ee,Q=new Uint8Array(4),$,De,Oe=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(ve(e)||!e.output||!e.input&&e.avail_in!==0)return b;n=e.state,n.mode===F&&(n.mode=I),f=e.next_out,a=e.output,V=e.avail_out,d=e.next_in,r=e.input,B=e.avail_in,H=n.hold,U=n.bits,ye=B,W=V,Ee=_;inf_leave:for(;;)switch(n.mode){case T:if(n.wrap===0){n.mode=I;break}for(;U<16;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}if(n.wrap&2&&H===35615){n.wbits===0&&(n.wbits=15),n.check=0,Q[0]=H&255,Q[1]=H>>>8&255,n.check=o(n.check,Q,2,0),H=0,U=0,n.mode=E;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((H&255)<<8)+(H>>8))%31){e.msg=`incorrect header check`,n.mode=z;break}if((H&15)!==w){e.msg=`unknown compression method`,n.mode=z;break}if(H>>>=4,U-=4,Z=(H&15)+8,n.wbits===0&&(n.wbits=Z),Z>15||Z>n.wbits){e.msg=`invalid window size`,n.mode=z;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=H&512?P:F,H=0,U=0;break;case E:for(;U<16;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}if(n.flags=H,(n.flags&255)!==w){e.msg=`unknown compression method`,n.mode=z;break}if(n.flags&57344){e.msg=`unknown header flags set`,n.mode=z;break}n.head&&(n.head.text=H>>8&1),n.flags&512&&n.wrap&4&&(Q[0]=H&255,Q[1]=H>>>8&255,n.check=o(n.check,Q,2,0)),H=0,U=0,n.mode=D;case D:for(;U<32;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}n.head&&(n.head.time=H),n.flags&512&&n.wrap&4&&(Q[0]=H&255,Q[1]=H>>>8&255,Q[2]=H>>>16&255,Q[3]=H>>>24&255,n.check=o(n.check,Q,4,0)),H=0,U=0,n.mode=O;case O:for(;U<16;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}n.head&&(n.head.xflags=H&255,n.head.os=H>>8),n.flags&512&&n.wrap&4&&(Q[0]=H&255,Q[1]=H>>>8&255,n.check=o(n.check,Q,2,0)),H=0,U=0,n.mode=k;case k:if(n.flags&1024){for(;U<16;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}n.length=H,n.head&&(n.head.extra_len=H),n.flags&512&&n.wrap&4&&(Q[0]=H&255,Q[1]=H>>>8&255,n.check=o(n.check,Q,2,0)),H=0,U=0}else n.head&&(n.head.extra=null);n.mode=A;case A:if(n.flags&1024&&(G=n.length,G>B&&(G=B),G&&(n.head&&(Z=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(d,d+G),Z)),n.flags&512&&n.wrap&4&&(n.check=o(n.check,r,G,d)),B-=G,d+=G,n.length-=G),n.length))break inf_leave;n.length=0,n.mode=j;case j:if(n.flags&2048){if(B===0)break inf_leave;G=0;do Z=r[d+G++],n.head&&Z&&n.length<65536&&(n.head.name+=String.fromCharCode(Z));while(Z&&G<B);if(n.flags&512&&n.wrap&4&&(n.check=o(n.check,r,G,d)),B-=G,d+=G,Z)break inf_leave}else n.head&&(n.head.name=null);n.length=0,n.mode=M;case M:if(n.flags&4096){if(B===0)break inf_leave;G=0;do Z=r[d+G++],n.head&&Z&&n.length<65536&&(n.head.comment+=String.fromCharCode(Z));while(Z&&G<B);if(n.flags&512&&n.wrap&4&&(n.check=o(n.check,r,G,d)),B-=G,d+=G,Z)break inf_leave}else n.head&&(n.head.comment=null);n.mode=N;case N:if(n.flags&512){for(;U<16;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}if(n.wrap&4&&H!==(n.check&65535)){e.msg=`header crc mismatch`,n.mode=z;break}H=0,U=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=F;break;case P:for(;U<32;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}e.adler=n.check=_e(H),H=0,U=0,n.mode=ee;case ee:if(n.havedict===0)return e.next_out=f,e.avail_out=V,e.next_in=d,e.avail_in=B,n.hold=H,n.bits=U,y;e.adler=n.check=1,n.mode=F;case F:if(t===h||t===g)break inf_leave;case I:if(n.last){H>>>=U&7,U-=U&7,n.mode=pe;break}for(;U<3;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}switch(n.last=H&1,H>>>=1,--U,H&3){case 0:n.mode=te;break;case 1:if(Ce(n),n.mode=se,t===g){H>>>=2,U-=2;break inf_leave}break;case 2:n.mode=ie;break;case 3:e.msg=`invalid block type`,n.mode=z}H>>>=2,U-=2;break;case te:for(H>>>=U&7,U-=U&7;U<32;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}if((H&65535)!=(H>>>16^65535)){e.msg=`invalid stored block lengths`,n.mode=z;break}if(n.length=H&65535,H=0,U=0,n.mode=ne,t===g)break inf_leave;case ne:n.mode=re;case re:if(G=n.length,G){if(G>B&&(G=B),G>V&&(G=V),G===0)break inf_leave;a.set(r.subarray(d,d+G),f),B-=G,d+=G,V-=G,f+=G,n.length-=G;break}n.mode=F;break;case ie:for(;U<14;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}if(n.nlen=(H&31)+257,H>>>=5,U-=5,n.ndist=(H&31)+1,H>>>=5,U-=5,n.ncode=(H&15)+4,H>>>=4,U-=4,n.nlen>286||n.ndist>30){e.msg=`too many length or distance symbols`,n.mode=z;break}n.have=0,n.mode=ae;case ae:for(;n.have<n.ncode;){for(;U<3;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}n.lens[Oe[n.have++]]=H&7,H>>>=3,U-=3}for(;n.have<19;)n.lens[Oe[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,$={bits:n.lenbits},Ee=c(l,n.lens,0,19,n.lencode,0,n.work,$),n.lenbits=$.bits,Ee){e.msg=`invalid code lengths set`,n.mode=z;break}n.have=0,n.mode=oe;case oe:for(;n.have<n.nlen+n.ndist;){for(;K=n.lencode[H&(1<<n.lenbits)-1],q=K>>>24,Se=K>>>16&255,we=K&65535,!(q<=U);){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}if(we<16)H>>>=q,U-=q,n.lens[n.have++]=we;else{if(we===16){for(De=q+2;U<De;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}if(H>>>=q,U-=q,n.have===0){e.msg=`invalid bit length repeat`,n.mode=z;break}Z=n.lens[n.have-1],G=3+(H&3),H>>>=2,U-=2}else if(we===17){for(De=q+3;U<De;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}H>>>=q,U-=q,Z=0,G=3+(H&7),H>>>=3,U-=3}else{for(De=q+7;U<De;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}H>>>=q,U-=q,Z=0,G=11+(H&127),H>>>=7,U-=7}if(n.have+G>n.nlen+n.ndist){e.msg=`invalid bit length repeat`,n.mode=z;break}for(;G--;)n.lens[n.have++]=Z}}if(n.mode===z)break;if(n.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,n.mode=z;break}if(n.lenbits=9,$={bits:n.lenbits},Ee=c(u,n.lens,0,n.nlen,n.lencode,0,n.work,$),n.lenbits=$.bits,Ee){e.msg=`invalid literal/lengths set`,n.mode=z;break}if(n.distbits=6,n.distcode=n.distdyn,$={bits:n.distbits},Ee=c(p,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,$),n.distbits=$.bits,Ee){e.msg=`invalid distances set`,n.mode=z;break}if(n.mode=se,t===g)break inf_leave;case se:n.mode=ce;case ce:if(B>=6&&V>=258){e.next_out=f,e.avail_out=V,e.next_in=d,e.avail_in=B,n.hold=H,n.bits=U,s(e,W),f=e.next_out,a=e.output,V=e.avail_out,d=e.next_in,r=e.input,B=e.avail_in,H=n.hold,U=n.bits,n.mode===F&&(n.back=-1);break}for(n.back=0;K=n.lencode[H&(1<<n.lenbits)-1],q=K>>>24,Se=K>>>16&255,we=K&65535,!(q<=U);){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}if(Se&&!(Se&240)){for(Y=q,X=Se,Te=we;K=n.lencode[Te+((H&(1<<Y+X)-1)>>Y)],q=K>>>24,Se=K>>>16&255,we=K&65535,!(Y+q<=U);){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}H>>>=Y,U-=Y,n.back+=Y}if(H>>>=q,U-=q,n.back+=q,n.length=we,Se===0){n.mode=fe;break}if(Se&32){n.back=-1,n.mode=F;break}if(Se&64){e.msg=`invalid literal/length code`,n.mode=z;break}n.extra=Se&15,n.mode=L;case L:if(n.extra){for(De=n.extra;U<De;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}n.length+=H&(1<<n.extra)-1,H>>>=n.extra,U-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=le;case le:for(;K=n.distcode[H&(1<<n.distbits)-1],q=K>>>24,Se=K>>>16&255,we=K&65535,!(q<=U);){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}if(!(Se&240)){for(Y=q,X=Se,Te=we;K=n.distcode[Te+((H&(1<<Y+X)-1)>>Y)],q=K>>>24,Se=K>>>16&255,we=K&65535,!(Y+q<=U);){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}H>>>=Y,U-=Y,n.back+=Y}if(H>>>=q,U-=q,n.back+=q,Se&64){e.msg=`invalid distance code`,n.mode=z;break}n.offset=we,n.extra=Se&15,n.mode=ue;case ue:if(n.extra){for(De=n.extra;U<De;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}n.offset+=H&(1<<n.extra)-1,H>>>=n.extra,U-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg=`invalid distance too far back`,n.mode=z;break}n.mode=de;case de:if(V===0)break inf_leave;if(G=W-V,n.offset>G){if(G=n.offset-G,G>n.whave&&n.sane){e.msg=`invalid distance too far back`,n.mode=z;break}G>n.wnext?(G-=n.wnext,be=n.wsize-G):be=n.wnext-G,G>n.length&&(G=n.length),xe=n.window}else xe=a,be=f-n.offset,G=n.length;G>V&&(G=V),V-=G,n.length-=G;do a[f++]=xe[be++];while(--G);n.length===0&&(n.mode=ce);break;case fe:if(V===0)break inf_leave;a[f++]=n.length,V--,n.mode=ce;break;case pe:if(n.wrap){for(;U<32;){if(B===0)break inf_leave;B--,H|=r[d++]<<U,U+=8}if(W-=V,e.total_out+=W,n.total+=W,n.wrap&4&&W&&(e.adler=n.check=n.flags?o(n.check,a,W,f-W):i(n.check,a,W,f-W)),W=V,n.wrap&4&&(n.flags?H:_e(H))!==n.check){e.msg=`incorrect data check`,n.mode=z;break}H=0,U=0}n.mode=R;case R:if(n.wrap&&n.flags){for(;U<32;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}if(n.wrap&4&&H!==(n.total&4294967295)){e.msg=`incorrect length check`,n.mode=z;break}H=0,U=0}n.mode=me;case me:Ee=v;break inf_leave;case z:Ee=x;break inf_leave;case he:return S;case ge:default:return b}return e.next_out=f,e.avail_out=V,e.next_in=d,e.avail_in=B,n.hold=H,n.bits=U,(n.wsize||W!==e.avail_out&&n.mode<z&&(n.mode<pe||t!==m))&&J(e,e.output,e.next_out,W-e.avail_out)?(n.mode=he,S):(ye-=e.avail_in,W-=e.avail_out,e.total_in+=ye,e.total_out+=W,n.total+=W,n.wrap&4&&W&&(e.adler=n.check=n.flags?o(n.check,a,W,e.next_out-W):i(n.check,a,W,e.next_out-W)),e.data_type=n.bits+(n.last?64:0)+(n.mode===F?128:0)+(n.mode===se||n.mode===ne?256:0),(ye===0&&W===0||t===m)&&Ee===_&&(Ee=C),Ee)},Y=e=>{if(ve(e))return b;let t=e.state;return t.window&&=null,e.state=null,_},X=(e,t)=>{if(ve(e))return b;let n=e.state;return n.wrap&2?(n.head=t,t.done=!1,_):b},Te=(e,t)=>{let n=t.length,r,a,o;return ve(e)||(r=e.state,r.wrap!==0&&r.mode!==ee)?b:r.mode===ee&&(a=1,a=i(a,t,n,0),a!==r.check)?x:(o=J(e,t,n,n),o?(r.mode=he,S):(r.havedict=1,_))};t.exports.inflateReset=W,t.exports.inflateReset2=G,t.exports.inflateResetKeep=ye,t.exports.inflateInit=xe,t.exports.inflateInit2=be,t.exports.inflate=we,t.exports.inflateEnd=Y,t.exports.inflateGetHeader=X,t.exports.inflateSetDictionary=Te,t.exports.inflateInfo=`pako inflate (from Nodeca project)`})),m=e(((e,t)=>{function n(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name=``,this.comment=``,this.hcrc=0,this.done=!1}t.exports=n})),h=e(((e,t)=>{var n=p(),r=s(),o=c(),u=i(),d=l(),f=m(),h=Object.prototype.toString,{Z_NO_FLUSH:g,Z_FINISH:_,Z_OK:v,Z_STREAM_END:y,Z_NEED_DICT:b,Z_STREAM_ERROR:x,Z_DATA_ERROR:S,Z_MEM_ERROR:C}=a();function w(e){this.options=r.assign({chunkSize:65536,windowBits:15,to:``},e||{});let t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;let i=n.inflateInit2(this.strm,t.windowBits);if(i!==v||(this.header=new f,n.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary==`string`?t.dictionary=o.string2buf(t.dictionary):h.call(t.dictionary)===`[object ArrayBuffer]`&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(i=n.inflateSetDictionary(this.strm,t.dictionary),i!==v))))throw Error(u[i])}w.prototype.push=function(e,t){let r=this.strm,i=this.options.chunkSize,a=this.options.dictionary,s,c,l;if(this.ended)return!1;for(c=t===~~t?t:t===!0?_:g,r.input=h.call(e)===`[object ArrayBuffer]`?new Uint8Array(e):e,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),s=n.inflate(r,c),s===b&&a&&(s=n.inflateSetDictionary(r,a),s===v?s=n.inflate(r,c):s===S&&(s=b));r.avail_in>0&&s===y&&r.state.wrap>0&&e[r.next_in]!==0;)n.inflateReset(r),s=n.inflate(r,c);switch(s){case x:case S:case b:case C:return this.onEnd(s),this.ended=!0,!1}if(l=r.avail_out,r.next_out&&(r.avail_out===0||s===y)){if(this.options.to===`string`){let e=o.utf8border(r.output,r.next_out),t=r.next_out-e,n=o.buf2string(r.output,e);r.next_out=t,r.avail_out=i-t,t&&r.output.set(r.output.subarray(e,e+t),0),this.onData(n)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out))}if(s!==v||l!==0){if(s===y)return s=n.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(r.avail_in===0)break}}return!0},w.prototype.onData=function(e){this.chunks.push(e)},w.prototype.onEnd=function(e){e===v&&(this.result=this.options.to===`string`?this.chunks.join(``):r.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function T(e,t){let n=new w(t);if(n.push(e),n.err)throw n.msg||u[n.err];return n.result}function E(e,t){return t||={},t.raw=!0,T(e,t)}t.exports.Inflate=w,t.exports.inflate=T,t.exports.inflateRaw=E,t.exports.ungzip=T,t.exports.constants=a()})),g=e(((e,t)=>{var{Deflate:n,deflate:r,deflateRaw:i,gzip:o}=u(),{Inflate:s,inflate:c,inflateRaw:l,ungzip:d}=h(),f=a();t.exports.Deflate=n,t.exports.deflate=r,t.exports.deflateRaw=i,t.exports.gzip=o,t.exports.Inflate=s,t.exports.inflate=c,t.exports.inflateRaw=l,t.exports.ungzip=d,t.exports.constants=f})),_=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.decodeJpeg=x;var t=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]),n=4017,r=799,i=3406,a=2276,o=1567,s=3784,c=5793,l=2896,u=100,d=67108864,f=0,p=d;function m(e){if(!isFinite(e)||e<0)throw Error(`Invalid memory allocation size (${e})`);let t=f+e;if(t>p){let e=Math.ceil((t-p)/1024/1024);throw Error(`Max memory limit exceeded by at least ${e}MB`)}f=t}function h(e,t){let n=16;for(;n>0&&!e[n-1];)n--;let r=[{children:[],index:0}],i=0,a=r[0];for(let o=0;o<n;o++){for(let n=0;n<e[o];n++){for(a=r.pop(),a.children[a.index]=t[i];a.index>0;){if(r.length===0)throw Error(`Could not recreate Huffman Table`);a=r.pop()}for(a.index++,r.push(a);r.length<=o;){let e={children:[],index:0};r.push(e),a.children[a.index]=e.children,a=e}i++}if(o+1<n){let e={children:[],index:0};r.push(e),a.children[a.index]=e.children,a=e}}return r[0].children}function g(e,n,r,i,a,o,s,c,l){let u=r.mcusPerLine,d=r.progressive,f=n,p=0,m=0;function h(){if(m>0)return m--,p>>m&1;if(p=e[n++],p==255){let t=e[n++];if(t)throw Error(`unexpected marker: ${(p<<8|t).toString(16)}`)}return m=7,p>>>7}function g(e){if(!e)throw Error(`Missing Huffman table`);let t=e;for(;;){if(t=t[h()],typeof t==`number`)return t;if(t===void 0)throw Error(`invalid huffman sequence`)}}function _(e){let t=0;for(;e>0;)t=t<<1|h(),e--;return t}function v(e){let t=_(e);return t>=1<<e-1?t:t+(-1<<e)+1}function y(e,n){let r=g(e.huffmanTableDC),i=r===0?0:v(r);n[0]=e.pred+=i;let a=1;for(;a<64;){let r=g(e.huffmanTableAC),i=r&15,o=r>>4;if(i===0){if(o<15)break;a+=16;continue}a+=o;let s=t[a];n[s]=v(i),a++}}function b(e,t){let n=g(e.huffmanTableDC),r=n===0?0:v(n)<<l;t[0]=e.pred+=r}function x(e,t){t[0]|=h()<<l}let S=0;function C(e,n){if(S>0){S--;return}let r=o,i=s;for(;r<=i;){let i=g(e.huffmanTableAC),a=i&15,o=i>>4;if(a===0){if(o<15){S=_(o)+(1<<o)-1;break}r+=16;continue}r+=o;let s=t[r];n[s]=v(a)*(1<<l),r++}}let w=0,T=0;function E(e,n){let r=o,i=s,a=0;for(;r<=i;){let i=t[r],o=n[i]<0?-1:1;switch(w){case 0:let t=g(e.huffmanTableAC),r=t&15;if(a=t>>4,r===0)a<15?(S=_(a)+(1<<a),w=4):(a=16,w=1);else{if(r!==1)throw Error(`invalid ACn encoding`);T=v(r),w=a?2:3}continue;case 1:case 2:n[i]?n[i]+=(h()<<l)*o:(a--,a===0&&(w=w==2?3:0));break;case 3:n[i]?n[i]+=(h()<<l)*o:(n[i]=T<<l,w=0);break;case 4:n[i]&&(n[i]+=(h()<<l)*o)}r++}w===4&&(S--,S===0&&(w=0))}function D(e,t,n,r,i){let a=n/u|0,o=n%u,s=a*e.v+r,c=o*e.h+i;e.blocks[s]!==void 0&&t(e,e.blocks[s][c])}function O(e,t,n){let r=n/e.blocksPerLine|0,i=n%e.blocksPerLine;e.blocks[r]!==void 0&&t(e,e.blocks[r][i])}let k=i.length,A,j;j=d?o===0?c===0?b:x:c===0?C:E:y;let M=0,N;if(N=k==1?i[0].blocksPerLine*i[0].blocksPerColumn:u*r.mcusPerColumn,!isFinite(N)||N<0)throw Error(`Invalid number of MCUs`);a||=N;let P,ee,F;for(;M<N;){for(let e=0;e<k;e++)i[e].pred=0;if(S=0,k==1){A=i[0];for(let e=0;e<a&&(O(A,j,M),M++,M!==N);e++);}else for(let e=0;e<a;e++){for(let e=0;e<k;e++){A=i[e],P=A.h,ee=A.v;for(let e=0;e<ee;e++)for(let t=0;t<P;t++)D(A,j,M,e,t)}if(M++,M===N)break}if(M===N)do{if(e[n]===255&&e[n+1]!==0)break;n+=1}while(n<e.length-2);if(m=0,F=e[n]<<8|e[n+1],F<65280)throw Error(`marker was not found`);if(F>=65488&&F<=65495)n+=2;else break}return n-f}function _(e){let t=[],u=e.blocksPerLine,d=e.blocksPerColumn,f=u<<3,p=new Int32Array(64),h=new Uint8Array(64);function g(t,u,d){let f=e.quantizationTable;if(!f)throw Error(`Missing quantization table`);let p=d;for(let e=0;e<64;e++)p[e]=t[e]*f[e];for(let e=0;e<8;++e){let t=8*e;if(p[1+t]==0&&p[2+t]==0&&p[3+t]==0&&p[4+t]==0&&p[5+t]==0&&p[6+t]==0&&p[7+t]==0){let e=c*p[0+t]+512>>10;p[0+t]=e,p[1+t]=e,p[2+t]=e,p[3+t]=e,p[4+t]=e,p[5+t]=e,p[6+t]=e,p[7+t]=e;continue}let u=c*p[0+t]+128>>8,d=c*p[4+t]+128>>8,f=p[2+t],m=p[6+t],h=l*(p[1+t]-p[7+t])+128>>8,g=l*(p[1+t]+p[7+t])+128>>8,_=p[3+t]<<4,v=p[5+t]<<4,y=u-d+1>>1;u=u+d+1>>1,d=y,y=f*s+m*o+128>>8,f=f*o-m*s+128>>8,m=y,y=h-v+1>>1,h=h+v+1>>1,v=y,y=g+_+1>>1,_=g-_+1>>1,g=y,y=u-m+1>>1,u=u+m+1>>1,m=y,y=d-f+1>>1,d=d+f+1>>1,f=y,y=h*a+g*i+2048>>12,h=h*i-g*a+2048>>12,g=y,y=_*r+v*n+2048>>12,_=_*n-v*r+2048>>12,v=y,p[0+t]=u+g,p[7+t]=u-g,p[1+t]=d+v,p[6+t]=d-v,p[2+t]=f+_,p[5+t]=f-_,p[3+t]=m+h,p[4+t]=m-h}for(let e=0;e<8;++e){let t=e;if(p[8+t]==0&&p[16+t]==0&&p[24+t]==0&&p[32+t]==0&&p[40+t]==0&&p[48+t]==0&&p[56+t]==0){let n=c*d[e+0]+8192>>14;p[0+t]=n,p[8+t]=n,p[16+t]=n,p[24+t]=n,p[32+t]=n,p[40+t]=n,p[48+t]=n,p[56+t]=n;continue}let u=c*p[0+t]+2048>>12,f=c*p[32+t]+2048>>12,m=p[16+t],h=p[48+t],g=l*(p[8+t]-p[56+t])+2048>>12,_=l*(p[8+t]+p[56+t])+2048>>12,v=p[24+t],y=p[40+t],b=u-f+1>>1;u=u+f+1>>1,f=b,b=m*s+h*o+2048>>12,m=m*o-h*s+2048>>12,h=b,b=g-y+1>>1,g=g+y+1>>1,y=b,b=_+v+1>>1,v=_-v+1>>1,_=b,b=u-h+1>>1,u=u+h+1>>1,h=b,b=f-m+1>>1,f=f+m+1>>1,m=b,b=g*a+_*i+2048>>12,g=g*i-_*a+2048>>12,_=b,b=v*r+y*n+2048>>12,v=v*n-y*r+2048>>12,y=b,p[0+t]=u+_,p[56+t]=u-_,p[8+t]=f+y,p[48+t]=f-y,p[16+t]=m+v,p[40+t]=m-v,p[24+t]=h+g,p[32+t]=h-g}for(let e=0;e<64;++e){let t=128+(p[e]+8>>4);u[e]=t<0?0:t>255?255:t}}m(f*d*8);for(let n=0;n<d;n++){let r=n<<3;for(let e=0;e<8;e++)t.push(new Uint8Array(f));for(let i=0;i<u;i++){g(e.blocks[n][i],h,p);let a=0,o=i<<3;for(let e=0;e<8;e++){let n=t[r+e];for(let e=0;e<8;e++)n[o+e]=h[a++]}}}return t}function v(e){return e<0?0:e>255?255:e}function y(e){let n={width:0,height:0,adobe:void 0,components:[],exifBuffer:void 0,jfif:void 0},r=u*1e3*1e3,i=0;function a(){let t=e[i]<<8|e[i+1];return i+=2,t}function o(){let t=a(),n=e.subarray(i,i+t-2);return i+=n.length,n}function s(e){let t=0,n=0;for(let r in e.components)if(e.components.hasOwnProperty(r)){let i=e.components[r];t<i.h&&(t=i.h),n<i.v&&(n=i.v)}let r=Math.ceil(e.samplesPerLine/8/t),i=Math.ceil(e.scanLines/8/n);for(let a in e.components)if(e.components.hasOwnProperty(a)){let o=e.components[a],s=Math.ceil(Math.ceil(e.samplesPerLine/8)*o.h/t),c=Math.ceil(Math.ceil(e.scanLines/8)*o.v/n),l=r*o.h,u=i*o.v,d=u*l,f=[];m(d*256);for(let e=0;e<u;e++){let e=[];for(let t=0;t<l;t++)e.push(new Int32Array(64));f.push(e)}o.blocksPerLine=s,o.blocksPerColumn=c,o.blocks=f}e.maxH=t,e.maxV=n,e.mcusPerLine=r,e.mcusPerColumn=i}let c=null,l=null,d,f=0,p=[],v=[],y=[],b=[],x=a(),S=-1;if(x!=65496)throw Error(`SOI not found`);for(x=a();x!=65497;){switch(x){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:{let e=o();x===65504&&e[0]===74&&e[1]===70&&e[2]===73&&e[3]===70&&e[4]===0&&(c={version:{major:e[5],minor:e[6]},densityUnits:e[7],xDensity:e[8]<<8|e[9],yDensity:e[10]<<8|e[11],thumbWidth:e[12],thumbHeight:e[13],thumbData:e.subarray(14,14+3*e[12]*e[13])}),x===65505&&e[0]===69&&e[1]===120&&e[2]===105&&e[3]===102&&e[4]===0&&(n.exifBuffer=e.subarray(5,e.length)),x===65518&&e[0]===65&&e[1]===100&&e[2]===111&&e[3]===98&&e[4]===101&&e[5]===0&&(l={version:e[6],flags0:e[7]<<8|e[8],flags1:e[9]<<8|e[10],transformCode:e[11]});break}case 65499:{let n=a()+i-2;for(;i<n;){let n=e[i++];m(256);let r=new Int32Array(64);if(!(n>>4))for(let n=0;n<64;n++){let a=t[n];r[a]=e[i++]}else if(n>>4==1)for(let e=0;e<64;e++){let n=t[e];r[n]=a()}else throw Error(`DQT: invalid table spec`);p[n&15]=r}break}case 65472:case 65473:case 65474:{a(),d={extended:x===65473,progressive:x===65474,precision:e[i++],scanLines:a(),samplesPerLine:a(),components:{},componentsOrder:[],maxH:0,maxV:0,mcusPerLine:0,mcusPerColumn:0};let t=d.scanLines*d.samplesPerLine;if(t>r){let e=Math.ceil((t-r)/1e6);throw Error(`maxResolutionInMP limit exceeded by ${e}MP`)}let n=e[i++];if(!n)throw Error(`SOF: no components in frame`);for(let t=0;t<n;t++){let t=e[i],n=e[i+1]>>4,r=e[i+1]&15;if(n<1||n>4||r<1||r>4)throw Error(`SOF: invalid sampling factors (${n}x${r})`);let a=e[i+2];d.componentsOrder.push(t),d.components[t]={h:n,v:r,quantizationIdx:a,blocksPerColumn:0,blocksPerLine:0,blocks:[],pred:0},i+=3}s(d),v.push(d);break}case 65476:{let t=a();for(let n=2;n<t;){let t=e[i++],r=new Uint8Array(16),a=0;for(let t=0;t<16;t++,i++)a+=r[t]=e[i];m(16+a);let o=new Uint8Array(a);for(let t=0;t<a;t++,i++)o[t]=e[i];n+=17+a;let s=t&15,c=t>>4?y:b;c[s]=h(r,o)}break}case 65501:a(),f=a();break;case 65500:a(),a();break;case 65498:{if(!d)throw Error(`SOS: scan before frame header (SOF)`);a();let t=e[i++],n=[];for(let r=0;r<t;r++){let t=e[i++],r=d.components[t];if(!r)throw Error(`SOS: component ${t} not found in frame`);let a=e[i++];r.huffmanTableDC=b[a>>4],r.huffmanTableAC=y[a&15],n.push(r)}let r=e[i++],o=e[i++],s=e[i++],c=g(e,i,d,n,f,r,o,s>>4,s&15);i+=c;break}case 65535:e[i]!==255&&i--;break;default:if(e[i-3]==255&&e[i-2]>=192&&e[i-2]<=254){i-=3;break}if(x===224||x==225){if(S!==-1)throw Error(`first unknown JPEG marker at offset ${S.toString(16)}, second unknown JPEG marker ${x.toString(16)} at offset ${(i-1).toString(16)}`);S=i-1;let t=a();if(e[i+t-2]===255){i+=t-2;break}}throw Error(`unknown JPEG marker `+x.toString(16))}x=a()}if(v.length!=1)throw Error(`only single frame JPEGs supported`);for(let e=0;e<v.length;e++){let t=v[e].components;for(let e of Object.keys(t)){let n=t[+e],r=p[n.quantizationIdx];if(!r)throw Error(`Missing quantization table ${n.quantizationIdx}`);n.quantizationTable=r}}n.width=d.samplesPerLine,n.height=d.scanLines,n.jfif=c,n.adobe=l,n.components=[];for(let e=0;e<d.componentsOrder.length;e++){let t=d.components[d.componentsOrder[e]];n.components.push({lines:_(t),scaleX:t.h/d.maxH,scaleY:t.v/d.maxV})}return n}function b(e){let t=0,n=!1,r=e.width,i=e.height,a=r*i*e.components.length;m(a);let o=new Uint8Array(a);switch(e.components.length){case 1:{let n=e.components[0];for(let e=0;e<i;e++){let i=n.lines[0|e*n.scaleY];for(let e=0;e<r;e++){let r=i[0|e*n.scaleX];o[t++]=r}}break}case 2:{let n=e.components[0],a=e.components[1];for(let e=0;e<i;e++){let i=n.lines[0|e*n.scaleY],s=a.lines[0|e*a.scaleY];for(let e=0;e<r;e++){let r=i[0|e*n.scaleX];o[t++]=r;let c=s[0|e*a.scaleX];o[t++]=c}}break}case 3:{n=e.jfif?!0:!e.adobe||!!e.adobe.transformCode;let a=e.components[0],s=e.components[1],c=e.components[2];for(let e=0;e<i;e++){let i=a.lines[0|e*a.scaleY],l=s.lines[0|e*s.scaleY],u=c.lines[0|e*c.scaleY];for(let e=0;e<r;e++){let r,d,f,p,m,h;n?(r=i[0|e*a.scaleX],d=l[0|e*s.scaleX],f=u[0|e*c.scaleX],p=v(r+1.402*(f-128)),m=v(r-.3441363*(d-128)-.71413636*(f-128)),h=v(r+1.772*(d-128))):(p=i[0|e*a.scaleX],m=l[0|e*s.scaleX],h=u[0|e*c.scaleX]),o[t++]=p,o[t++]=m,o[t++]=h}}break}case 4:{if(!e.adobe)throw Error(`Unsupported color mode (4 components)`);n=!1,e.adobe&&e.adobe.transformCode&&(n=!0);let a=e.components[0],s=e.components[1],c=e.components[2],l=e.components[3];for(let e=0;e<i;e++){let i=a.lines[0|e*a.scaleY],u=s.lines[0|e*s.scaleY],d=c.lines[0|e*c.scaleY],f=l.lines[0|e*l.scaleY];for(let e=0;e<r;e++){let r,p,m,h,g,_,y;n?(r=i[0|e*a.scaleX],p=u[0|e*s.scaleX],m=d[0|e*c.scaleX],h=f[0|e*l.scaleX],g=255-v(r+1.402*(m-128)),_=255-v(r-.3441363*(p-128)-.71413636*(m-128)),y=255-v(r+1.772*(p-128))):(g=i[0|e*a.scaleX],_=u[0|e*s.scaleX],y=d[0|e*c.scaleX],h=f[0|e*l.scaleX]),o[t++]=255-g,o[t++]=255-_,o[t++]=255-y,o[t++]=255-h}}break}default:throw Error(`Unsupported color mode`)}return o}function x(e,t,n){if(f=0,p=n===void 0?d:Math.min(d,Math.max(0,n)),e.length===0)throw Error(`Empty jpeg buffer`);let r=y(e);m(r.width*r.height*4);let i=b(r),a=t(r.width,r.height),o=a.width,s=a.height,c=a.data,l=0,u=0;switch(r.components.length){case 1:for(let e=0;e<s;e++)for(let e=0;e<o;e++){let e=i[l++];c[u++]=e,c[u++]=e,c[u++]=e,c[u++]=255}break;case 2:for(let e=0;e<s;e++)for(let e=0;e<o;e++){let e=i[l++],t=i[l++];c[u++]=e,c[u++]=e,c[u++]=e,c[u++]=t}break;case 3:for(let e=0;e<s;e++)for(let e=0;e<o;e++){let e=i[l++],t=i[l++],n=i[l++];c[u++]=e,c[u++]=t,c[u++]=n,c[u++]=255}break;case 4:for(let e=0;e<s;e++)for(let e=0;e<o;e++){let e=i[l++],t=i[l++],n=i[l++],r=i[l++],a=255-v(e*(1-r/255)+r),o=255-v(t*(1-r/255)+r),s=255-v(n*(1-r/255)+r);c[u++]=a,c[u++]=o,c[u++]=s,c[u++]=255}break;default:throw Error(`Unsupported color mode`)}return a}})),v=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createImageData=e.createCanvas=e.MaskParams=e.LayerMaskFlags=e.ColorSpace=e.largeAdditionalInfoKeys=e.largeAdditionalInfoKeysObserved=e.layerColors=e.toBlendMode=e.fromBlendMode=e.MOCK_HANDLERS=void 0,e.revMap=r,e.createEnum=i,e.offsetForChannel=c,e.normalizeLabAB=l,e.denormalizeLabAB=u,e.clamp=d,e.hasAlpha=f,e.cmykToRgbValues=p,e.rgbToCmykValues=S,e.resetImageData=C,e.imageDataToCanvas=w,e.decodeBitmap=T,e.writeDataRaw=E,e.writeDataRLE=D,e.planarToBytes=O,e.writeDataRLEBytes=k,e.writeDataZipWithPrediction=A,e.writeDataZipWithoutPrediction=j,e.createCanvasFromData=M,e.initializeCanvas=P;var t=g(),n=_();e.MOCK_HANDLERS=!1,e.fromBlendMode={},e.toBlendMode={pass:`pass through`,norm:`normal`,diss:`dissolve`,dark:`darken`,"mul ":`multiply`,idiv:`color burn`,lbrn:`linear burn`,dkCl:`darker color`,lite:`lighten`,scrn:`screen`,"div ":`color dodge`,lddg:`linear dodge`,lgCl:`lighter color`,over:`overlay`,sLit:`soft light`,hLit:`hard light`,vLit:`vivid light`,lLit:`linear light`,pLit:`pin light`,hMix:`hard mix`,diff:`difference`,smud:`exclusion`,fsub:`subtract`,fdiv:`divide`,"hue ":`hue`,"sat ":`saturation`,colr:`color`,"lum ":`luminosity`},Object.keys(e.toBlendMode).forEach(t=>e.fromBlendMode[e.toBlendMode[t]]=t),e.layerColors=[`none`,`red`,`orange`,`yellow`,`green`,`blue`,`violet`,`gray`,`seafoam`,`indigo`,`magenta`,`fuchsia`],e.largeAdditionalInfoKeysObserved=[`lnk3`,`lnkE`,`pths`,`extd`,`extn`,`FELS`,`artd`],e.largeAdditionalInfoKeys=[`LMsk`,`Lr16`,`Lr32`,`Layr`,`Mt16`,`Mt32`,`Mtrn`,`Alph`,`FMsk`,`lnk2`,`FEid`,`FXid`,`PxSD`,`cinf`,...e.largeAdditionalInfoKeysObserved];function r(e){let t={};return Object.keys(e).forEach(n=>t[e[n]]=n),t}function i(e,t,n){let i=r(n);return{decode:e=>{let r=e.split(`.`)[1];if(r&&!i[r]){if(Object.prototype.hasOwnProperty.call(n,r))return r;let t=r.replace(/([A-Z])/g,` $1`).toLowerCase();if(Object.prototype.hasOwnProperty.call(n,t))return t;throw Error(`Unrecognized value for enum: '${e}'`)}return i[r]||t},encode:r=>{if(r&&!n[r])throw Error(`Invalid value for enum: '${r}'`);return`${e}.${r?n[r]:n[t]}`}}}var a;(function(e){e[e.RGB=0]=`RGB`,e[e.HSB=1]=`HSB`,e[e.CMYK=2]=`CMYK`,e[e.Lab=7]=`Lab`,e[e.Grayscale=8]=`Grayscale`})(a||(e.ColorSpace=a={}));var o;(function(e){e[e.PositionRelativeToLayer=1]=`PositionRelativeToLayer`,e[e.LayerMaskDisabled=2]=`LayerMaskDisabled`,e[e.InvertLayerMaskWhenBlending=4]=`InvertLayerMaskWhenBlending`,e[e.LayerMaskFromRenderingOtherData=8]=`LayerMaskFromRenderingOtherData`,e[e.MaskHasParametersAppliedToIt=16]=`MaskHasParametersAppliedToIt`})(o||(e.LayerMaskFlags=o={}));var s;(function(e){e[e.UserMaskDensity=1]=`UserMaskDensity`,e[e.UserMaskFeather=2]=`UserMaskFeather`,e[e.VectorMaskDensity=4]=`VectorMaskDensity`,e[e.VectorMaskFeather=8]=`VectorMaskFeather`})(s||(e.MaskParams=s={}));function c(e,t){switch(e){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return t?3:e+1;case-1:return t?4:3;default:return e+1}}function l(e,t=1){return e<0?e/(128*t):e/(127*t)}function u(e,t=1){return e<0?128*t*e:127*t*e}function d(e,t,n){return e<t?t:e>n?n:e}function f(e){let t=e.width*e.height*4,n=e.data instanceof Float32Array?1:e.data instanceof Uint16Array?65535:255;for(let r=3;r<t;r+=4)if(e.data[r]!==n)return!0;return!1}function p(e,t,n,r,i){i[0]=255+e*(-4.387332384609988*e+54.48615194189176*t+18.82290502165302*n+212.25662451639585*r-285.2331026137004)+t*(1.7149763477362134*t-5.6096736904047315*n-17.873870861415444*r-5.497006427196366)+n*(-2.5217340131683033*n-21.248923337353073*r+17.5119270841813)+r*(-21.86122147463605*r-189.48180835922747),i[1]=255+e*(8.841041422036149*e+60.118027045597366*t+6.871425592049007*n+31.159100130055922*r-79.2970844816548)+t*(-15.310361306967817*t+17.575251261109482*n+131.35250912493976*r-190.9453302588951)+n*(4.444339102852739*n+9.8632861493405*r-24.86741582555878)+r*(-20.737325471181034*r-187.80453709719578),i[2]=255+e*(.8842522430003296*e+8.078677503112928*t+30.89978309703729*n-.23883238689178934*r-14.183576799673286)+t*(10.49593273432072*t+63.02378494754052*n+50.606957656360734*r-112.23884253719248)+n*(.03296041114873217*n+115.60384449646641*r-193.58209356861505)+r*(-22.33816807309886*r-180.12613974708367)}var m=e=>e<0?0:e>1?1:e;function h(e,t,n,r,i){let a=[0,0,0],o=[0,0,0],s=[0,0,0],c=[[0,0,0],[0,0,0],[0,0,0]],l=1e-4;for(let u=0;u<20&&(p(i[0],i[1],i[2],r,a),s[0]=a[0]-e,s[1]=a[1]-t,s[2]=a[2]-n,!(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]<1e-6));u++){for(let e=0;e<3;e++){let t=i[e];i[e]=t+l,p(i[0],i[1],i[2],r,o),i[e]=t;for(let t=0;t<3;t++)c[t][e]=(o[t]-a[t])/l}let[[e,t,n],[u,d,f],[h,g,_]]=c,v=e*(d*_-f*g)-t*(u*_-f*h)+n*(u*g-d*h);if(Math.abs(v)<1e-12)break;let y=[[d*_-f*g,n*g-t*_,t*f-n*d],[f*h-u*_,e*_-n*h,n*u-e*f],[u*g-d*h,t*h-e*g,e*d-t*u]],b=0;for(let e=0;e<3;e++){let t=-(y[e][0]*s[0]+y[e][1]*s[1]+y[e][2]*s[2])/v,n=m(i[e]+t);b+=Math.abs(n-i[e]),i[e]=n}if(b<1e-9)break}return p(i[0],i[1],i[2],r,a),(a[0]-e)*(a[0]-e)+(a[1]-t)*(a[1]-t)+(a[2]-n)*(a[2]-n)}function v(e,t,n,r){let i=m((1-Math.max(e,t,n)/255-.2)/.8)**1.3,a=[0,0,0],o=1/0,s=1/0,c=c=>{a[0]=m(1-e/255-c),a[1]=m(1-t/255-c),a[2]=m(1-n/255-c);let l=h(e,t,n,c,a),u=Math.max(l,.1)+Math.abs(c-i)*.01;u<o&&(o=u,s=l,r[0]=a[0],r[1]=a[1],r[2]=a[2],r[3]=c)};if(c(i),s>.1)for(let e=0;e<=10;e++)c(e/10);if(s>.1){let e=r[3];for(let t=-5;t<=5;t++)c(m(e+t/100))}}var y=33,b;function x(){if(!b){let e=y,t=new Float32Array(1089*e*4),n=[0,0,0,0];for(let r=0,i=0;r<e;r++)for(let a=0;a<e;a++)for(let o=0;o<e;o++,i+=4)v(r*255/32,a*255/32,o*255/32,n),t[i]=n[0],t[i+1]=n[1],t[i+2]=n[2],t[i+3]=n[3];b=t}return b}function S(e,t,n,r){let i=x(),a=m(e)*32,o=m(t)*32,s=m(n)*32,c=Math.min(31,Math.floor(a)),l=Math.min(31,Math.floor(o)),u=Math.min(31,Math.floor(s)),d=a-c,f=o-l,p=s-u;r[0]=r[1]=r[2]=r[3]=0;for(let e=0;e<8;e++){let t=e>>2,n=e>>1&1,a=e&1,o=(t?d:1-d)*(n?f:1-f)*(a?p:1-p),s=(((c+t)*y+l+n)*y+u+a)*4;r[0]+=o*i[s],r[1]+=o*i[s+1],r[2]+=o*i[s+2],r[3]+=o*i[s+3]}}function C({data:e}){let t=e instanceof Float32Array?1:e instanceof Uint16Array?65535:255;for(let n=0,r=e.length|0;n<r;n=n+4|0)e[n+0]=0,e[n+1]=0,e[n+2]=0,e[n+3]=t}function w(t){let n=(0,e.createCanvas)(t.width,t.height),r;if(t.data instanceof Uint8ClampedArray)r=t;else{r=(0,e.createImageData)(t.width,t.height);let n=t.data,i=r.data;if(n instanceof Float32Array)for(let e=0,t=n.length;e<t;e+=4)i[e+0]=Math.round(n[e+0]**(1/2.2)*255),i[e+1]=Math.round(n[e+1]**(1/2.2)*255),i[e+2]=Math.round(n[e+2]**(1/2.2)*255),i[e+3]=Math.round(n[e+3]*255);else{let e=n instanceof Uint16Array?8:0;for(let t=0,r=n.length;t<r;t++)i[t]=n[t]>>>e}}return n.getContext(`2d`).putImageData(r,0,0),n}function T(e,t,n,r){if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray))throw Error(`Invalid bit depth`);for(let i=0,a=0,o=0;i<r;i++)for(let r=0;r<n;){let i=e[o++];for(let e=0;e<8&&r<n;e++,r++,a+=4){let e=i&128?0:255;i<<=1,t[a+0]=e,t[a+1]=e,t[a+2]=e,t[a+3]=255}}}function E(e,t,n,r){if(!n||!r)return;let i=new Uint8Array(n*r);for(let n=0;n<i.length;n++)i[n]=e.data[n*4+t];return i}function D(e,{data:t,width:n,height:r},i,a){if(!n||!r)return e.subarray(0,0);let o=4*n|0,s=0,c=i.length*(a?4:2)*r|0;for(let n of i)for(let i=0,l=n|0;i<r;i++){let r=i*o|0,u=r+o|0,d=u+n-4|0,f=d-4|0,p=c;for(l=r+n|0;l<u;l=l+4|0)if(l<f){let n=t[l];l=l+4|0;let r=t[l];l=l+4|0;let i=t[l];if(n===r&&n===i){let r=3;for(;r<128&&l<d&&t[l+4|0]===n;)r=r+1|0,l=l+4|0;e[c++]=1-r,e[c++]=n}else{let a=c,o=!0,s=1;for(e[c++]=0,e[c++]=n;l<d&&s<128;){if(l=l+4|0,n=r,r=i,i=t[l],n===r&&n===i){l=l-12|0,o=!1;break}s++,e[c++]=n}o&&(s<127?(e[c++]=r,e[c++]=i,s+=2):s<128?(e[c++]=r,s++,l=l-4|0):l=l-8|0),e[a]=s-1}}else l===d?(e[c++]=0,e[c++]=t[l]):(e[c++]=1,e[c++]=t[l],l=l+4|0,e[c++]=t[l]);if(c>e.length)throw Error(`RLE buffer too small (${e.length})`);let m=c-p;a&&(e[s++]=m>>24&255,e[s++]=m>>16&255),e[s++]=m>>8&255,e[s++]=m&255}return e.subarray(0,c)}function O(e){if(e instanceof Uint8Array)return e;let t=new Uint8Array(e.byteLength),n=new DataView(t.buffer);if(e instanceof Uint16Array)for(let t=0;t<e.length;t++)n.setUint16(t*2,e[t],!1);else for(let t=0;t<e.length;t++)n.setFloat32(t*4,e[t],!1);return t}function k(e,t,n,r){let i=r?4:2,a=new Uint8Array(n*(i+t+Math.ceil(t/128))),o=i*n;for(let r=0;r<n;r++){let n=o,s=r*t,c=s+t,l=s;for(;l<c;){let t=1;for(;l+t<c&&t<128&&e[l+t]===e[l];)t++;if(t>1)a[o++]=257-t,a[o++]=e[l],l+=t;else{let t=o++,n=0;for(;l<c&&n<128&&!(l+2<c&&e[l]===e[l+1]&&e[l]===e[l+2]);)a[o++]=e[l++],n++;a[t]=n-1}}let u=o-n;for(let e=0;e<i;e++)a[r*i+e]=u>>>(i-e-1)*8&255}return a.subarray(0,o)}function A(e,n,r){let i;if(e instanceof Uint8Array){i=new Uint8Array(n*r);for(let t=0,a=0;t<r;t++)for(let t=0,r=0;t<n;t++,a++)i[a]=e[a]-r,r=e[a]}else if(e instanceof Uint16Array){i=new Uint8Array(n*r*2);for(let t=0,a=0;t<r;t++)for(let t=0,r=0;t<n;t++,a++){let t=e[a]-r&65535;i[a*2]=t>>8,i[a*2+1]=t&255,r=e[a]}}else{let t=n*4,a=O(e);i=new Uint8Array(t*r);for(let e=0;e<r;e++){let r=e*t;for(let e=0;e<n;e++)for(let t=0;t<4;t++)i[r+t*n+e]=a[r+e*4+t];for(let e=t-1;e>0;e--)i[r+e]-=i[r+e-1]}}return(0,t.deflate)(i)}function j({data:e,width:n,height:r},i){let a=n*r,o=new Uint8Array(a),s=[],c=0;for(let n of i){for(let t=0,r=n;t<a;t++,r+=4)o[t]=e[r];let r=(0,t.deflate)(o);s.push(r),c+=r.byteLength}if(s.length>0){let e=new Uint8Array(c),t=0;for(let n of s)e.set(n,t),t+=n.byteLength;return e}return s[0]}function M(t,r){let i=(0,e.createCanvas)(100,100);try{let e=i.getContext(`2d`),a=(0,n.decodeJpeg)(t,(t,n)=>e.createImageData(t,n),r.totalMemoryLimit);i.width=a.width,i.height=a.height,e.putImageData(a,0,0),r.totalMemoryLimit!==void 0&&(r.totalMemoryLimit-=a.width*a.height*4)}catch(e){r.log(`JPEG decompression error`,e.message)}return i}e.createCanvas=()=>{throw Error(`Canvas not initialized, use initializeCanvas method to set up createCanvas method`)};var N=void 0;e.createImageData=(t,n)=>(N||=(0,e.createCanvas)(1,1),N.getContext(`2d`).createImageData(t,n)),typeof document<`u`&&(e.createCanvas=(e,t)=>{let n=document.createElement(`canvas`);return n.width=e,n.height=t,n});function P(t,n){e.createCanvas=t,e.createImageData=n||e.createImageData}})),y=e((e=>{e.byteLength=c,e.toByteArray=u,e.fromByteArray=p;for(var t=[],n=[],r=typeof Uint8Array<`u`?Uint8Array:Array,i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,a=0,o=i.length;a<o;++a)t[a]=i[a],n[i.charCodeAt(a)]=a;n[45]=62,n[95]=63;function s(e){var t=e.length;if(t%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function c(e){var t=s(e),n=t[0],r=t[1];return(n+r)*3/4-r}function l(e,t,n){return(t+n)*3/4-n}function u(e){var t,i=s(e),a=i[0],o=i[1],c=new r(l(e,a,o)),u=0,d=o>0?a-4:a,f;for(f=0;f<d;f+=4)t=n[e.charCodeAt(f)]<<18|n[e.charCodeAt(f+1)]<<12|n[e.charCodeAt(f+2)]<<6|n[e.charCodeAt(f+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=t&255;return o===2&&(t=n[e.charCodeAt(f)]<<2|n[e.charCodeAt(f+1)]>>4,c[u++]=t&255),o===1&&(t=n[e.charCodeAt(f)]<<10|n[e.charCodeAt(f+1)]<<4|n[e.charCodeAt(f+2)]>>2,c[u++]=t>>8&255,c[u++]=t&255),c}function d(e){return t[e>>18&63]+t[e>>12&63]+t[e>>6&63]+t[e&63]}function f(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(d(r));return i.join(``)}function p(e){for(var n,r=e.length,i=r%3,a=[],o=16383,s=0,c=r-i;s<c;s+=o)a.push(f(e,s,s+o>c?c:s+o));return i===1?(n=e[r-1],a.push(t[n>>2]+t[n<<4&63]+`==`)):i===2&&(n=(e[r-2]<<8)+e[r-1],a.push(t[n>>10]+t[n>>4&63]+t[n<<2&63]+`=`)),a.join(``)}})),b=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.stringLengthInBytes=r,e.encodeStringTo=a,e.encodeString=o,e.decodeString=s;function t(e){return e&4294967168?e&4294965248?e&4294901760?4:3:2:1}function n(e,t){let n=e.charCodeAt(t);if(n<55296||n>57343)return n;if(n<=56319&&t+1<e.length){let r=e.charCodeAt(t+1);if(r>=56320&&r<=57343)return((n&1023)<<10)+(r&1023)+65536}return 65533}function r(e){let t=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);i<128?t+=1:i<2048?t+=2:n(e,r)>65535?(t+=4,r++):t+=3}return t}function i(e,n,r){let i=t(r);switch(i){case 1:e[n]=r;break;case 2:e[n]=r>>6&31|192,e[n+1]=r&63|128;break;case 3:e[n]=r>>12&15|224,e[n+1]=r>>6&63|128,e[n+2]=r&63|128;break;default:e[n]=r>>18&7|240,e[n+1]=r>>12&63|128,e[n+2]=r>>6&63|128,e[n+3]=r&63|128}return i}function a(e,t,r){for(let a=0;a<r.length;a++){let o=r.charCodeAt(a);if(o<128)e[t++]=o;else{let o=n(r,a);o>65535&&a++,t+=i(e,t,o)}}return t}function o(e){if(e.length>1e3&&typeof TextEncoder<`u`)return new TextEncoder().encode(e);let t=new Uint8Array(r(e));return a(t,0,e),t}function s(e){let t=[];function n(e){e>65535&&(e-=65536,t.push(String.fromCharCode(e>>>10&1023|55296)),e=56320|e&1023),t.push(String.fromCharCode(e))}let r=0,i=0,a=0,o=128,s=191;for(let t=0;t<e.length;t++){let c=e[t];if(a===0){c<=127?n(c):c>=194&&c<=223?(a=1,r=c&31):c>=224&&c<=239?(c===224&&(o=160),c===237&&(s=159),a=2,r=c&15):c>=240&&c<=244?(c===240&&(o=144),c===244&&(s=143),a=3,r=c&7):n(65533);continue}if(c<o||c>s){r=0,a=0,i=0,o=128,s=191,n(65533),t--;continue}o=128,s=191,r=r<<6|c&63,i++,i===a&&(n(r),r=0,a=0,i=0)}return a!==0&&n(65533),t.join(``)}})),x=e((e=>{var t=e&&e.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};Object.defineProperty(e,"__esModule",{value:!0}),e.FlCl=e.ExtR=e.ExtT=e.DfsM=e.blurType=e.Lns=e.MztT=e.Chnl=e.Dstr=e.ZZTy=e.Wvtp=e.SphM=e.RplS=e.Cnvr=e.UndA=e.DspM=e.SmBQ=e.SmBM=e.BlrQ=e.BlrM=e.strokeStyleLineAlignment=e.strokeStyleLineJoinType=e.strokeStyleLineCapType=e.ESliceBGColorType=e.ESliceOrigin=e.ESliceVertAlign=e.ESliceHorzAlign=e.ESliceType=e.FrFl=e.FStl=e.ClrS=e.Clry=e.gradientInterpolationMethodType=e.stdTrackID=e.animInterpStyleEnum=e.GrdT=e.IGSr=e.BETE=e.BESs=e.bvlT=e.BESl=e.BlnM=e.warpStyle=e.Annt=e.Ornt=e.textGridding=e.outputSettingsRoot=e.layerStateRoot=e.cameraRawFilterKeyTypes=e.cameraRawFilterClassID=void 0,e.patternColorHandling=e.presetKindType=e.prjM=e.FlMd=e.IntC=e.IntE=e.Drct=e.WndM=e.CntE=void 0,e.readAsciiStringOrClassId=x,e.writeAsciiStringOrClassId=S,e.readDescriptorStructure=w,e.writeDescriptorStructure=T,e.pathSelectionStateToReference=P,e.writeClassStructure=I,e.readVersionAndDescriptor=te,e.writeVersionAndDescriptor=ne,e.horzVrtcToXY=re,e.xyToHorzVrtc=ie,e.descBoundsToBounds=ae,e.boundsToDescBounds=oe,e.serializeEffects=L,e.parseEffects=le,e.parseTrackList=fe,e.serializeTrackList=pe,e.parseVectorContent=_e,e.serializeVectorContent=ye,e.parseColor=xe,e.serializeColor=q,e.parseAngle=Ce,e.parsePercent=J,e.parsePercentOrAngle=we,e.parseUnits=Y,e.parseUnitsOrNumber=X,e.parseUnitsToNumber=Te,e.unitsAngle=Z,e.unitsPercent=Ee,e.unitsPercentF=Q,e.unitsValue=$,e.frac=De;var n=v(),r=C(),i=k();function a(e){let t={};return Object.keys(e).forEach(n=>t[e[n]]=n),t}var o={"#Ang":`Angle`,"#Rsl":`Density`,"#Rlt":`Distance`,"#Nne":`None`,"#Prc":`Percent`,"#Pxl":`Pixels`,"#Mlm":`Millimeters`,"#Pnt":`Points`,RrPi:`Picas`,RrIn:`Inches`,RrCm:`Centimeters`},s=a(o);function c(e,t){return{name:e,classID:t}}var l=c(``,`null`),u={strokeStyleContent:c(``,`solidColorLayer`),printProofSetup:c(`Proof Setup`,`proofSetup`),Grad:c(`Gradient`,`Grdn`),Trnf:c(`Transform`,`Trnf`),patternFill:c(``,`patternFill`),ebbl:c(``,`ebbl`),SoFi:c(``,`SoFi`),GrFl:c(``,`GrFl`),sdwC:c(``,`RGBC`),hglC:c(``,`RGBC`),"Clr ":c(``,`RGBC`),tintColor:c(``,`RGBC`),Ofst:c(``,`Pnt `),ChFX:c(``,`ChFX`),MpgS:c(``,`ShpC`),DrSh:c(``,`DrSh`),IrSh:c(``,`IrSh`),OrGl:c(``,`OrGl`),IrGl:c(``,`IrGl`),TrnS:c(``,`ShpC`),Ptrn:c(``,`Ptrn`),FrFX:c(``,`FrFX`),phase:c(``,`Pnt `),frameStep:l,duration:l,workInTime:l,workOutTime:l,audioClipGroupList:l,bounds:c(``,`Rctn`),customEnvelopeWarp:c(``,`customEnvelopeWarp`),warp:c(``,`warp`),"Sz ":c(``,`Pnt `),origin:c(``,`Pnt `),autoExpandOffset:c(``,`Pnt `),keyOriginShapeBBox:c(``,`unitRect`),Vrsn:l,psVersion:l,docDefaultNewArtboardBackgroundColor:c(``,`RGBC`),artboardRect:c(``,`classFloatRect`),framedGroupRect:c(``,`classFloatRect`),keyOriginRRectRadii:c(``,`radii`),keyOriginBoxCorners:l,rectangleCornerA:c(``,`Pnt `),rectangleCornerB:c(``,`Pnt `),rectangleCornerC:c(``,`Pnt `),rectangleCornerD:c(``,`Pnt `),keyOriginPolyPreviousTightBoxCorners:l,keyOriginPolyTrueRectCorners:l,keyOriginLineStart:c(``,`Pnt `),keyOriginLineEnd:c(``,`Pnt `),compInfo:l,quiltWarp:c(``,`quiltWarp`),generatorSettings:l,crema:l,FrIn:l,blendOptions:l,FXRf:l,Lefx:l,time:l,animKey:l,timeScope:l,inTime:l,outTime:l,sheetStyle:l,translation:l,Skew:l,boundingBox:c(``,`boundingBox`),"Lnk ":c(``,`ExternalFileLink`),frameReader:c(``,`FrameReader`),effectParams:c(``,`motionTrackEffectParams`),Impr:c(`None`,`none`),Anch:c(``,`Pnt `),"Fwd ":c(``,`Pnt `),"Bwd ":c(``,`Pnt `),FlrC:c(``,`Pnt `),meshBoundaryPath:c(``,`pathClass`),filterFX:c(``,`filterFXStyle`),Fltr:c(``,`rigidTransform`),FrgC:c(``,`RGBC`),BckC:c(``,`RGBC`),sdwM:c(`Parameters`,`adaptCorrectTones`),hglM:c(`Parameters`,`adaptCorrectTones`),customShape:c(``,`customShape`),origFXRefPoint:l,FXRefPoint:l,vectorMask:l,layerSpecific:l,LSpc:l,textLayerSettings:c(``,`warp`),placedLayerSettings:l,IMsk:l,VMsk:l,TxtC:l,ClMg:c(``,`ClMg`),interpretation:c(``,`footageInterpretation`),bgColor:c(``,`NativeQuad`)},d={"Crv ":c(``,`CrPt`),Clrs:c(``,`Clrt`),Trns:c(``,`TrnS`),keyDescriptorList:l,keyRootDescriptorList:l,solidFillMulti:c(``,`SoFi`),gradientFillMulti:c(``,`GrFl`),dropShadowMulti:c(``,`DrSh`),innerShadowMulti:c(``,`IrSh`),frameFXMulti:c(``,`FrFX`),FrIn:l,FSts:l,LaSt:l,sheetTimelineOptions:l,trackList:c(``,`animationTrack`),globalTrackList:c(``,`animationTrack`),keyList:l,audioClipGroupList:l,audioClipList:l,countObjectList:c(``,`countObject`),countGroupList:c(``,`countGroup`),slices:c(``,`slice`),"Pts ":c(``,`Pthp`),SbpL:c(``,`SbpL`),pathComponents:c(``,`PaCm`),filterFXList:c(``,`filterFX`),puppetShapeList:c(``,`puppetShape`),channelDenoise:c(``,`channelDenoiseParams`),ShrP:c(``,`Pnt `),layerSettings:l,list:l,Adjs:c(``,`CrvA`),vertices:c(``,`Pnt `),warpedVertices:c(``,`Pnt `),quads:c(``,`quadIndices`)},f={TEXT:`Txt .printerName.Nm .Idnt.blackAndWhitePresetFileName.LUT3DFileName.exportOption.scaleSettings.BackgroundImagePath.ImageSubfolderName.SavedIteratedName.presetFileName.curvesPresetFileName.mixerPresetFileName.placed.description.reason.artboardPresetName.json.clipID.relPath.fullPath.mediaDescriptor.Msge.altTag.url.cellText.preset.KnNm.FPth.comment.originalPath.Bk .pathUnicodeName`.split(`.`),tdta:[`EngineData`,`LUT3DFileData`,`indexArray`,`originalVertexArray`,`deformedVertexArray`,`LqMe`,`bookKey`],long:`TextIndex.RndS.Mdpn.Smth.Lctn.strokeStyleVersion.LaID.Vrsn.Cnt .bookID.cropRectBottom.cropRectLeft.cropRectRight.cropRectTop.Version.BackgroundColorBlue.BackgroundColorGreen.BackgroundColorRed.BackgroundColorState.AttributeCase.Encoding.DuplicateFileNameBehavior.ImageMapLocation.ImageMapType.Indent.LineEndings.SpacersEmptyCells.SpacersHorizontal.SpacersVertical.StylesFormat.TDWidthHeight.TagCase.ColorPolicy.MetadataPolicy.Brgh.Cntr.means.vibrance.Strt.bwPresetKind.comp.compID.originalCompID.curvesPresetKind.mixerPresetKind.uOrder.vOrder.PgNm.totalPages.Crop.numerator.denominator.frameCount.Annt.keyOriginType.unitValueQuadVersion.keyOriginIndex.major.minor.fix.docDefaultNewArtboardBackgroundType.artboardBackgroundType.numModifyingFX.deformNumRows.deformNumCols.FrID.FrDl.FsID.LCnt.AFrm.AFSt.numBefore.numAfter.Spcn.minOpacity.maxOpacity.BlnM.sheetID.gblA.globalAltitude.descVersion.frameReaderType.LyrI.zoomOrigin.fontSize.Rds .sliceID.topOutset.leftOutset.bottomOutset.rightOutset.filterID.meshQuality.meshExpansion.meshRigidity.VrsM.VrsN.NmbG.WLMn.WLMx.AmMn.AmMx.SclH.SclV.Lvl .TlNm.TlOf.FlRs.Thsh.ShrS.ShrE.FlRs.Vrnc.Strg.ExtS.ExtD.HrzS.VrtS.NmbR.EdgF.Ang1.Ang2.Ang3.Ang4.lastAppliedComp.capturedInfo.pixelSourceType.framedGroupType.keyOriginPolySides.keyOriginLineArrConc.noisePreSeed.associatedLayer.placedLayerCompID.VAlign`.split(`.`),enum:`textGridding.Ornt.warpStyle.warpRotate.Inte.Bltn.ClrS.BlrQ.bvlT.bvlS.bvlD.Md .glwS.GrdF.GlwT.RplS.BlrM.SmBM.strokeStyleLineCapType.strokeStyleLineJoinType.strokeStyleLineAlignment.strokeStyleBlendMode.PntT.Styl.lookupType.LUTFormat.dataOrder.tableOrder.enableCompCore.enableCompCoreGPU.compCoreSupport.compCoreGPUSupport.Engn.enableCompCoreThreads.gs99.FrDs.trackID.animInterpStyle.horzAlign.vertAlign.bgColorType.shapeOperation.UndA.Wvtp.Drct.WndM.Edg .FlCl.IntE.IntC.Cnvr.Fl .Dstr.MztT.Lns .ExtT.DspM.ExtR.ZZTy.SphM.SmBQ.placedLayerOCIOConversion.gradientsInterpolationMethod.pathSymmetryMode.interpretAlpha.knockout.TxPT.TxPR`.split(`.`),bool:`PstS.printSixteenBit.masterFXSwitch.enab.uglg.antialiasGloss.useShape.useTexture.uglg.antialiasGloss.useShape.Vsbl.useTexture.Algn.Rvrs.Dthr.Invr.VctC.ShTr.layerConceals.strokeEnabled.fillEnabled.strokeStyleScaleLock.strokeStyleStrokeAdjust.hardProof.MpBl.paperWhite.useLegacy.Auto.Lab .useTint.keyShapeInvalidated.autoExpandEnabled.autoNestEnabled.autoPositionEnabled.shrinkwrapOnSaveEnabled.present.showInDialog.overprint.sheetDisclosed.lightsDisclosed.meshesDisclosed.materialsDisclosed.hasMotion.muted.Effc.selected.autoScope.fillCanvas.cellTextIsHTML.Smoo.Clsp.validAtPosition.rigidType.hasoptions.filterMaskEnable.filterMaskLinked.filterMaskExtendWithWhite.removeJPEGArtifact.Mnch.ExtF.ExtM.moreAccurate.GpuY.LIWy.Cnty.Lnkd.showAlteredVideo.lightingOn.LockPPI.keyOriginLineArrowSt.keyOriginLineArrowEnd.Expn.substitutesUsed.blendClipped.blendInterior.TxMP`.split(`.`),doub:`warpValue.warpPerspective.warpPerspectiveOther.Intr.Wdth.Hght.Gmm .strokeStyleMiterLimit.strokeStyleResolution.layerTime.keyOriginResolution.xx.xy.yx.yy.tx.ty.FrGA.frameRate.audioLevel.rotation.X .Y .redFloat.greenFloat.blueFloat.imageResolution.PuX0.PuX1.PuX2.PuX3.PuY0.PuY1.PuY2.PuY3.stylization.cleanliness.brushScale.microBrush.specularity.PreferredResolution.FrGL.keyOriginLineWeight.keyOriginLineArrWdth.keyOriginLineArrLngth.keyOriginPolyPixelHSF.keyOriginPolyCornerRadius.gradientAspectRatio`.split(`.`),UntF:`sdwO.hglO.lagl.Lald.srgR.blur.Sftn.Opct.Dstn.Angl.Ckmt.Nose.Inpr.ShdN.strokeStyleLineWidth.strokeStyleLineDashOffset.strokeStyleOpacity.H .Top .Left.Btom.Rght.Rslt.topRight.topLeft.bottomLeft.bottomRight.ClNs.Shrp.fillOpacity.keyOriginPolyStarRatio`.split(`.`),VlLs:`Crv .Clrs.Mnm .Mxm .Trns.pathList.keyRootDescriptorList.strokeStyleLineDashSet.FrLs.slices.LaSt.Trnf.nonAffineTransform.keyDescriptorList.guideIndeces.gradientFillMulti.solidFillMulti.frameFXMulti.innerShadowMulti.dropShadowMulti.FrIn.FSts.FsFr.sheetTimelineOptions.audioClipList.trackList.globalTrackList.keyList.audioClipList.warpValues.selectedPin.Pts .SbpL.pathComponents.pinOffsets.posFinalPins.pinVertexIndices.PinP.PnRt.PnOv.PnDp.filterFXList.puppetShapeList.ShrP.channelDenoise.Mtrx.layerSettings.list.compList.Adjs.vertices.warpedVertices.quads.indices.Mpng.textLayerSettingsWarpRect`.split(`.`),ObAr:[`meshPoints`,`quiltSliceX`,`quiltSliceY`],"obj ":[`null`,`Chnl`],"Pth ":[`DspF`],alis:[`alis`]},p=[`Rd `,`Grn `,`Bl `,`Yllw`,`Ylw `,`Cyn `,`Mgnt`,`Blck`,`Gry `,`Lmnc`,`A `,`B `],m=[`Grsc`,`LbCl`,`GRYC`,`LABC`];e.cameraRawFilterClassID=`Adobe Camera Raw Filter`,e.cameraRawFilterKeyTypes={CrVe:`TEXT`,PrVN:`long`,PrVe:`long`,WBal:`enum`,Ex12:`doub`,ShpR:`doub`,"Crv ":`VlLs`,CrvR:`VlLs`,CrvG:`VlLs`,CrvB:`VlLs`};function h(e){if(typeof e==`boolean`)return`bool`;if(typeof e==`number`&&!Number.isInteger(e))return`doub`;if(Array.isArray(e))return`VlLs`;if(e&&typeof e==`object`){if(typeof e._classID==`string`)return`Objc`;if(typeof e.classID==`string`)return`type`;if(typeof e.low==`number`&&typeof e.high==`number`)return`comp`;if(typeof e.units==`string`&&typeof e.value==`number`)return`UntF`}}var g={"Mnm ":`long`,"Mxm ":`long`,HtmlFileNameComponents:`long`,SavingFileNameComponents:`long`,SliceFileNameComponents:`long`,Inpt:`long`,Otpt:`long`,FrLs:`long`,strokeStyleLineDashSet:`UntF`,Trnf:`doub`,nonAffineTransform:`doub`,keyDescriptorList:`Objc`,keyRootDescriptorList:`Objc`,pathList:`Objc`,gradientFillMulti:`Objc`,solidFillMulti:`Objc`,frameFXMulti:`Objc`,innerShadowMulti:`Objc`,dropShadowMulti:`Objc`,LaSt:`Objc`,FrIn:`Objc`,FSts:`Objc`,FsFr:`long`,blendOptions:`Objc`,sheetTimelineOptions:`Objc`,keyList:`Objc`,warpValues:`doub`,selectedPin:`long`,"Pts ":`Objc`,SbpL:`Objc`,pathComponents:`Objc`,pinOffsets:`doub`,posFinalPins:`doub`,pinVertexIndices:`long`,PinP:`doub`,PnRt:`long`,PnOv:`bool`,PnDp:`doub`,filterFXList:`Objc`,puppetShapeList:`Objc`,ShrP:`Objc`,channelDenoise:`Objc`,Mtrx:`long`,compList:`long`,textLayerSettingsWarpRect:`doub`,Chnl:`enum`,indices:`long`,Mpng:`long`},_={};for(let e of Object.keys(f))for(let t of f[e])_[t]=e;for(let e of Object.keys(u))_[e]||(_[e]=`Objc`);for(let e of Object.keys(d))g[e]=`Objc`;var y=`PixelSource.origin`;e.layerStateRoot=`layerState`;function b(e,t,n,r){return e===`presetKind`?typeof t==`string`?`enum`:`long`:e===`null`&&n===`slices`?`TEXT`:e===`groupID`?n===`slices`?`long`:`TEXT`:e===`Sz `?`Wdth`in t?`Objc`:`units`in t?`UntF`:`doub`:e===`Type`?typeof t==`string`?`enum`:`long`:e===`AntA`?typeof t==`string`?`enum`:`bool`:(e===`Hrzn`||e===`Vrtc`)&&(r.Type===`keyType.Pstn`||r._classID===`Ofst`||n===y)?`long`:e===`Hrzn`||e===`Vrtc`||e===`Top `||e===`Left`||e===`Btom`||e===`Rght`?n===`slices`?`long`:typeof t==`number`?`doub`:`UntF`:e===`Vrsn`?typeof t==`number`?`long`:`Objc`:e===`Rd `||e===`Grn `||e===`Bl `?n===`artd`?`long`:`doub`:e===`Trnf`?Array.isArray(t)?`VlLs`:`Objc`:e===`alpha`&&n===`slices`?`long`:(e===`Inpt`||e===`Otpt`)&&r._classID===`HsbP`?`enum`:(e===`Inpt`||e===`Otpt`)&&r._classID===`LvlA`?`VlLs`:e===`Intr`&&typeof t==`boolean`?`bool`:e===`PgPs`?`enum`:e===`LghD`&&r._classID===`oilPaint`?`long`:_[e]}function x(e){let t=(0,r.readInt32)(e);return(0,r.readAsciiString)(e,t||4)}function S(e,t){if(t.length===4&&t!==`warp`&&t!==`time`&&t!==`hold`&&t!==`list`&&t!==`json`)(0,i.writeInt32)(e,0),(0,i.writeSignature)(e,t);else{(0,i.writeInt32)(e,t.length);for(let n=0;n<t.length;n++)(0,i.writeUint8)(e,t.charCodeAt(n))}}function w(e,t){let n=F(e),i=t?{_name:n.name,_classID:n.classID}:{},a=(0,r.readUint32)(e);for(let n=0;n<a;n++){let n=x(e);i[n]=E(e,(0,r.readSignature)(e),t)}return i}e.outputSettingsRoot=`outputSettings`;function T(t,n,r,a,o){t.logMissingFeatures&&!r&&t.log(`Missing classId for: `,n,r,a),(0,i.writeUnicodeStringWithPadding)(t,n),o===e.outputSettingsRoot&&r===`null`?((0,i.writeInt32)(t,4),(0,i.writeSignature)(t,r)):S(t,r);let s=Object.keys(a).filter(e=>e!==`_name`&&e!==`_classID`&&a[e]!==void 0);(0,i.writeUint32)(t,s.length);for(let n of s){let d=b(n,a[n],o,a),f=o,g=u[n];r===e.cameraRawFilterClassID&&(d=e.cameraRawFilterKeyTypes[n]??`long`,f=e.cameraRawFilterClassID),n===`bounds`&&o===`text`?g=c(``,`bounds`):n===`origin`?(d=o===`slices`?`enum`:`Objc`,r===`PixelSource`&&(g=l,f=y)):n===`Ofst`&&o===e.layerStateRoot&&typeof a[n].Hrzn==`number`?(g=l,f=y):(n===`Cyn `||n===`Mgnt`||n===`Ylw `||n===`Blck`)&&a._classID===`CMYC`?d=`doub`:/^PN[a-z][a-z]$/.test(n)?d=`TEXT`:/^PT[a-z][a-z]$/.test(n)?d=`long`:/^PF[a-z][a-z]$/.test(n)||(n===`Rds `||n===`Thsh`)&&typeof a[n]==`number`&&a._classID===`SmrB`?d=`doub`:n===`ClSz`||n===`Rds `||n===`Amnt`?d=typeof a[n]==`number`?`long`:`UntF`:(n===`sdwM`||n===`hglM`)&&typeof a[n]==`string`||n===`blur`&&typeof a[n]==`string`?d=`enum`:n===`Hght`&&typeof a[n]==`number`&&a._classID===`Embs`||n===`Angl`&&typeof a[n]==`number`&&(a._classID===`Embs`||a._classID===`smartSharpen`||a._classID===`Twrl`||a._classID===`MtnB`)?d=`long`:n===`Angl`&&typeof a[n]==`number`?d=`doub`:n===`bounds`&&o===`slices`?(d=`Objc`,g=c(``,`Rct1`)):n===`Scl `?typeof a[n]==`object`&&`Hrzn`in a[n]?(d=`Objc`,g=l):d=typeof a[n]==`number`?`long`:`UntF`:n===`audioClipGroupList`&&s.length===1?d=`VlLs`:(n===`Strt`||n===`Brgh`)&&`H `in a?d=`doub`:n===`Wdth`&&typeof a[n]==`object`?d=`UntF`:n===`Ofst`&&typeof a[n]==`number`?d=`long`:n===`Strt`&&typeof a[n]==`object`?(d=`Objc`,g=l):p.indexOf(n)===-1?n===`profile`?d=r===`printOutput`||r===`proofSetup`?`TEXT`:`tdta`:n===`alis`&&typeof a[n]==`string`?d=/[^\x00-\xff]/.test(a[n])?`TEXT`:`alis`:n===`strokeStyleContent`?a[n][`Clr `]?g=c(``,`solidColorLayer`):a[n].Grad?g=c(``,`gradientLayer`):a[n].Ptrn?g=c(``,`patternLayer`):t.logMissingFeatures&&t.log(`Invalid strokeStyleContent value`,a[n]):n===`bounds`&&o===`quiltWarp`&&(g=c(``,`classFloatRect`)):d=r===`RGBC`&&o!==`artd`||m.indexOf(r)!==-1?`doub`:`long`,g&&g.classID===`RGBC`&&(`H `in a[n]?g={classID:`HSBC`,name:``}:`Cyn `in a[n]?g={classID:`CMYC`,name:``}:`Lmnc`in a[n]?g={classID:`LbCl`,name:``}:`Gry `in a[n]&&(g={classID:`Grsc`,name:``})),d||=h(a[n]),S(t,n),(0,i.writeSignature)(t,d||`long`),O(t,d||`long`,a[n],n,g,f),t.logMissingFeatures&&!d&&t.log(`Missing descriptor field type for: '${n}' in`,a)}}function E(e,t,n){switch(t){case`obj `:return M(e);case`Objc`:case`GlbO`:return w(e,n);case`VlLs`:{let t=(0,r.readInt32)(e),i=[];for(let a=0;a<t;a++){let t=(0,r.readSignature)(e);i.push(E(e,t,n))}return i}case`doub`:return(0,r.readFloat64)(e);case`UntF`:{let t=(0,r.readSignature)(e),n=(0,r.readFloat64)(e);if(!o[t])throw Error(`Invalid units: ${t}`);return{units:o[t],value:n}}case`UnFl`:{let t=(0,r.readSignature)(e),n=(0,r.readFloat32)(e);if(!o[t])throw Error(`Invalid units: ${t}`);return{units:o[t],value:n}}case`TEXT`:return(0,r.readUnicodeString)(e);case`enum`:return`${x(e)}.${x(e)}`;case`long`:return(0,r.readInt32)(e);case`comp`:{let t=(0,r.readUint32)(e);return{low:(0,r.readUint32)(e),high:t}}case`bool`:return!!(0,r.readUint8)(e);case`type`:case`GlbC`:return F(e);case`alis`:{let t=(0,r.readInt32)(e);return(0,r.readAsciiString)(e,t)}case`tdta`:{let t=(0,r.readInt32)(e);if(t>e.view.byteLength-e.offset)throw Error(`Invalid tdta length: ${t}`);return(0,r.readBytes)(e,t)}case`ObAr`:{(0,r.readInt32)(e),(0,r.readUnicodeString)(e),x(e);let t=(0,r.readInt32)(e),n=[];for(let i=0;i<t;i++){let t=x(e);(0,r.readSignature)(e),(0,r.readSignature)(e);let i=(0,r.readInt32)(e),a=[];for(let t=0;t<i;t++)a.push((0,r.readFloat64)(e));n.push({type:t,values:a})}return n}case`Pth `:{(0,r.readInt32)(e);let t=(0,r.readSignature)(e);(0,r.readInt32LE)(e);let n=(0,r.readInt32LE)(e);return{sig:t,path:(0,r.readUnicodeStringWithLengthLE)(e,n)}}default:throw Error(`Invalid TySh descriptor OSType: ${t} at ${e.offset.toString(16)}`)}}var D={meshPoints:`rationalPoint`,quiltSliceX:`UntF`,quiltSliceY:`UntF`};function O(t,n,r,a,o,c){switch(n){case`obj `:ee(t,a,r);break;case`Objc`:case`GlbO`:if(typeof r!=`object`)throw Error(`Invalid struct value: ${JSON.stringify(r)}, key: ${a}`);if(!o&&!r._classID)throw Error(`Missing ext type for: '${a}' (${JSON.stringify(r)})`);T(t,r._name||o?.name||``,r._classID||o.classID,r,c);break;case`VlLs`:if(!Array.isArray(r))throw Error(`Invalid list value: ${JSON.stringify(r)}, key: ${a}`);(0,i.writeInt32)(t,r.length);for(let n=0;n<r.length;n++){let o=c===e.cameraRawFilterClassID?`long`:g[a]??h(r[n]);(0,i.writeSignature)(t,o||`long`),O(t,o||`long`,r[n],`${a}[]`,d[a],c),t.logMissingFeatures&&!o&&t.log(`Missing descriptor array type for: '${a}' in`,r)}break;case`doub`:if(typeof r!=`number`)throw Error(`Invalid number value: ${JSON.stringify(r)}, key: ${a}`);(0,i.writeFloat64)(t,r);break;case`UntF`:if(!s[r.units])throw Error(`Invalid units: ${r.units} in ${a}`);(0,i.writeSignature)(t,s[r.units]),(0,i.writeFloat64)(t,r.value);break;case`UnFl`:if(!s[r.units])throw Error(`Invalid units: ${r.units} in ${a}`);(0,i.writeSignature)(t,s[r.units]),(0,i.writeFloat32)(t,r.value);break;case`TEXT`:(0,i.writeUnicodeStringWithPadding)(t,r);break;case`enum`:{if(typeof r!=`string`)throw Error(`Invalid enum value: ${JSON.stringify(r)}, key: ${a}`);let[e,n]=r.split(`.`);S(t,e),S(t,n);break}case`long`:if(typeof r!=`number`)throw Error(`Invalid integer value: ${JSON.stringify(r)}, key: ${a}`);(0,i.writeInt32)(t,Math.round(r));break;case`comp`:if(!r||typeof r!=`object`)throw Error(`Invalid large integer value: ${JSON.stringify(r)}, key: ${a}`);(0,i.writeUint32)(t,r.high>>>0),(0,i.writeUint32)(t,r.low>>>0);break;case`bool`:if(typeof r!=`boolean`)throw Error(`Invalid boolean value: ${JSON.stringify(r)}, key: ${a}`);(0,i.writeUint8)(t,+!!r);break;case`type`:case`GlbC`:if(!r||typeof r!=`object`)throw Error(`Invalid class value: ${JSON.stringify(r)}, key: ${a}`);(0,i.writeUnicodeStringWithPadding)(t,r.name||``),S(t,r.classID);break;case`alis`:if(typeof r!=`string`)throw Error(`Invalid alias value: ${JSON.stringify(r)}, key: ${a}`);(0,i.writeInt32)(t,r.length);for(let e=0;e<r.length;e++)(0,i.writeUint8)(t,r.charCodeAt(e)&255);break;case`tdta`:(0,i.writeInt32)(t,r.byteLength),(0,i.writeBytes)(t,r);break;case`ObAr`:{(0,i.writeInt32)(t,16),(0,i.writeUnicodeStringWithPadding)(t,``);let e=D[a];if(!e)throw Error(`Not implemented ObArType for: ${a}`);S(t,e),(0,i.writeInt32)(t,r.length);for(let e=0;e<r.length;e++){S(t,r[e].type),(0,i.writeSignature)(t,`UnFl`),(0,i.writeSignature)(t,`#Pxl`),(0,i.writeInt32)(t,r[e].values.length);for(let n=0;n<r[e].values.length;n++)(0,i.writeFloat64)(t,r[e].values[n])}break}case`Pth `:{let e=r.path+`\0`,n=12+e.length*2;(0,i.writeInt32)(t,n),(0,i.writeSignature)(t,r.sig),(0,i.writeInt32LE)(t,n),(0,i.writeInt32LE)(t,e.length),(0,i.writeUnicodeStringWithoutLengthLE)(t,e);break}default:throw Error(`Not implemented descriptor OSType: ${n}`)}}var A=[`prop`,`Clss`,`Enmr`,`rele`,`Idnt`,`indx`,`name`];function j(e){return!!e&&typeof e==`object`&&A.indexOf(e.type)!==-1}function M(e){let t=(0,r.readInt32)(e),n=[];for(let i=0;i<t;i++){let t=(0,r.readSignature)(e);switch(t){case`prop`:F(e),n.push(x(e));break;case`Clss`:n.push(F(e));break;case`Enmr`:{F(e);let t=x(e),r=x(e);n.push(`${t}.${r}`);break}case`rele`:F(e),n.push((0,r.readUint32)(e));break;case`Idnt`:case`indx`:n.push((0,r.readInt32)(e));break;case`name`:F(e),n.push((0,r.readUnicodeString)(e));break;default:throw Error(`Invalid descriptor reference type: ${t}`)}}return n}function N(e){if(typeof e==`string`){let t=/^([a-z ]{4}|[a-z]{5,})\.([a-z ]+)$/i.exec(e);return t?{type:`Enmr`,_name:``,_classID:t[1],typeID:t[1],enumValue:t[2]}:{type:`name`,_name:``,_classID:`Lyr `,value:e}}if(typeof e==`number`)return{type:`Idnt`,value:e};if(e&&typeof e==`object`&&typeof e.classID==`string`)return{type:`Clss`,_name:e.name||``,_classID:e.classID};throw Error(`Invalid descriptor reference value: ${JSON.stringify(e)}`)}function P(e){return e.map(e=>{let t=N(e);return t.type===`Enmr`&&(t._classID=`Path`),t})}function ee(e,t,n){if(!Array.isArray(n))throw Error(`Invalid reference value: ${JSON.stringify(n)}, key: ${t}`);(0,i.writeInt32)(e,n.length);for(let t of n){let n=j(t)?t:N(t);switch((0,i.writeSignature)(e,n.type),n.type){case`prop`:I(e,n._name||``,n._classID),S(e,n.keyID);break;case`Clss`:I(e,n._name||``,n._classID);break;case`Enmr`:I(e,n._name||``,n._classID),S(e,n.typeID),S(e,n.enumValue);break;case`rele`:I(e,n._name||``,n._classID),(0,i.writeUint32)(e,n.value);break;case`Idnt`:case`indx`:(0,i.writeInt32)(e,n.value);break;case`name`:I(e,n._name||``,n._classID),(0,i.writeUnicodeStringWithPadding)(e,`${n.value}`);break;default:throw Error(`Invalid descriptor reference type: ${n.type}`)}}return n}function F(e){return{name:(0,r.readUnicodeString)(e),classID:x(e)}}function I(e,t,n){(0,i.writeUnicodeStringWithPadding)(e,t),S(e,n)}function te(e,t=!1){let n=(0,r.readUint32)(e);if(n!==16)throw Error(`Invalid descriptor version: ${n}`);return w(e,t)}function ne(e,t,n,r,a=``){(0,i.writeUint32)(e,16),T(e,t,n,r,a)}function re(e){return{x:e.Hrzn,y:e.Vrtc}}function ie(e){return{Hrzn:e.x,Vrtc:e.y}}function ae(e){return{top:Y(e[`Top `]),left:Y(e.Left),right:Y(e.Rght),bottom:Y(e.Btom)}}function oe(e){return{Left:$(e.left,`bounds.left`),"Top ":$(e.top,`bounds.top`),Rght:$(e.right,`bounds.right`),Btom:$(e.bottom,`bounds.bottom`)}}function se(t){let n={enabled:!!t.enab,position:e.FStl.decode(t.Styl),fillType:e.FrFl.decode(t.PntT),blendMode:e.BlnM.decode(t[`Md `]),opacity:J(t.Opct),size:X(t[`Sz `])};return t.present!==void 0&&(n.present=t.present),t.showInDialog!==void 0&&(n.showInDialog=t.showInDialog),t.overprint!==void 0&&(n.overprint=t.overprint),t[`Clr `]&&(n.color=xe(t[`Clr `])),t.Grad&&(n.gradient=B(t)),t.Ptrn&&(n.pattern=H(t)),n}function ce(t){let n={};return n.enab=!!t.enabled,t.present!==void 0&&(n.present=!!t.present),t.showInDialog!==void 0&&(n.showInDialog=!!t.showInDialog),n.Styl=e.FStl.encode(t.position),n.PntT=e.FrFl.encode(t.fillType),n[`Md `]=e.BlnM.encode(t.blendMode),n.Opct=Ee(t.opacity),n[`Sz `]=$(t.size,`size`),t.color&&(n[`Clr `]=q(t.color)),t.gradient&&(n=Object.assign(Object.assign({},n),U(t.gradient))),t.pattern&&(n=Object.assign(Object.assign({},n),ve(t.pattern))),t.overprint!==void 0&&(n.overprint=!!t.overprint),n}function L(e,t,n){let r=n?{"Scl ":Q(e.scale??1),masterFXSwitch:!e.disabled}:{masterFXSwitch:!e.disabled,"Scl ":Q(e.scale??1)};for(let t of[`dropShadow`,`innerShadow`,`solidFill`,`gradientOverlay`,`stroke`])if(e[t]&&!Array.isArray(e[t]))throw Error(`${t} should be an array`);let i=e=>!!e&&e.length>1&&n,a=e=>!!e&&e.length>=1&&(!n||e.length===1);if(a(e.dropShadow)&&(r.DrSh=me(e.dropShadow[0],`dropShadow`,t)),i(e.dropShadow)&&(r.dropShadowMulti=e.dropShadow.map(e=>me(e,`dropShadow`,t))),a(e.innerShadow)&&(r.IrSh=me(e.innerShadow[0],`innerShadow`,t)),i(e.innerShadow)&&(r.innerShadowMulti=e.innerShadow.map(e=>me(e,`innerShadow`,t))),e.outerGlow&&(r.OrGl=me(e.outerGlow,`outerGlow`,t)),i(e.solidFill)&&(r.solidFillMulti=e.solidFill.map(e=>me(e,`solidFill`,t))),i(e.gradientOverlay)&&(r.gradientFillMulti=e.gradientOverlay.map(e=>me(e,`gradientOverlay`,t))),i(e.stroke)&&(r.frameFXMulti=e.stroke.map(e=>ce(e))),e.innerGlow&&(r.IrGl=me(e.innerGlow,`innerGlow`,t)),e.bevel&&(r.ebbl=me(e.bevel,`bevel`,t)),a(e.solidFill)&&(r.SoFi=me(e.solidFill[0],`solidFill`,t)),e.patternOverlay&&(r.patternFill=me(e.patternOverlay,`patternOverlay`,t)),a(e.gradientOverlay)&&(r.GrFl=me(e.gradientOverlay[0],`gradientOverlay`,t)),e.satin&&(r.ChFX=me(e.satin,`satin`,t)),a(e.stroke)&&(r.FrFX=ce(e.stroke?.[0])),n){r.numModifyingFX=0;for(let t of Object.keys(e)){let n=e[t];if(!(typeof n!=`object`||!n)){if(Array.isArray(n))for(let e of n)e?.enabled&&r.numModifyingFX++;else n.enabled&&r.numModifyingFX++}}}return r}function le(e,n){let r={},i=e,{_name:a,_classID:o,"Scl ":s,masterFXSwitch:c,DrSh:l,dropShadowMulti:u,IrSh:d,innerShadowMulti:f,OrGl:p,IrGl:m,ebbl:h,SoFi:g,solidFillMulti:_,patternFill:v,GrFl:y,gradientFillMulti:b,ChFX:x,FrFX:S,frameFXMulti:C,numModifyingFX:w}=i,T=t(i,[`_name`,`_classID`,`Scl `,`masterFXSwitch`,`DrSh`,`dropShadowMulti`,`IrSh`,`innerShadowMulti`,`OrGl`,`IrGl`,`ebbl`,`SoFi`,`solidFillMulti`,`patternFill`,`GrFl`,`gradientFillMulti`,`ChFX`,`FrFX`,`frameFXMulti`,`numModifyingFX`]);return c||(r.disabled=!0),s&&(r.scale=J(s)),l&&(r.dropShadow=[R(l,n)]),u&&(r.dropShadow=u.map(e=>R(e,n))),d&&(r.innerShadow=[R(d,n)]),f&&(r.innerShadow=f.map(e=>R(e,n))),p&&(r.outerGlow=R(p,n)),m&&(r.innerGlow=R(m,n)),h&&(r.bevel=R(h,n,`bevel`)),g&&(r.solidFill=[R(g,n)]),_&&(r.solidFill=_.map(e=>R(e,n))),v&&(r.patternOverlay=R(v,n)),y&&(r.gradientOverlay=[R(y,n)]),b&&(r.gradientOverlay=b.map(e=>R(e,n))),x&&(r.satin=R(x,n)),S&&(r.stroke=[se(S)]),C&&(r.stroke=C.map(e=>se(e))),n.logMissingFeatures&&Object.keys(T).length&&n.log(`Unhandled effect keys:`,T),r}function ue(t,n){let r=[];for(let i=0;i<t.length;i++){let a=t[i],{time:{denominator:o,numerator:s},selected:c,animKey:l}=a,u={numerator:s,denominator:o},d=e.animInterpStyleEnum.decode(a.animInterpStyle);switch(l.Type){case`keyType.Opct`:r.push({interpolation:d,time:u,selected:c,type:`opacity`,value:J(l.Opct)});break;case`keyType.Pstn`:r.push({interpolation:d,time:u,selected:c,type:`position`,x:l.Hrzn,y:l.Vrtc});break;case`keyType.Trnf`:r.push({interpolation:d,time:u,selected:c,type:`transform`,scale:re(l[`Scl `]),skew:re(l.Skew),rotation:l.rotation,translation:re(l.translation)});break;case`keyType.sheetStyle`:{let e={interpolation:d,time:u,selected:c,type:`style`};l.sheetStyle.Lefx&&(e.style=le(l.sheetStyle.Lefx,n)),r.push(e);break}case`keyType.globalLighting`:r.push({interpolation:d,time:u,selected:c,type:`globalLighting`,globalAngle:l.gblA,globalAltitude:l.globalAltitude});break;default:throw Error(`Unsupported keyType value`)}}return r}function de(t,n){let r=[];for(let i=0;i<t.length;i++){let a=t[i],{time:o,selected:s=!1,interpolation:c}=a,l=e.animInterpStyleEnum.encode(c),u;switch(a.type){case`opacity`:u={Type:`keyType.Opct`,Opct:Ee(a.value)};break;case`position`:u={Type:`keyType.Pstn`,Hrzn:a.x,Vrtc:a.y};break;case`transform`:u={Type:`keyType.Trnf`,"Scl ":ie(a.scale),Skew:ie(a.skew),rotation:a.rotation,translation:ie(a.translation)};break;case`style`:u={Type:`keyType.sheetStyle`,sheetStyle:{Vrsn:1,blendOptions:{}}},a.style&&(u.sheetStyle={Vrsn:1,Lefx:L(a.style,n,!1),blendOptions:{}});break;case`globalLighting`:u={Type:`keyType.globalLighting`,gblA:a.globalAngle,globalAltitude:a.globalAltitude};break;default:throw Error(`Unsupported keyType value`)}r.push({Vrsn:1,animInterpStyle:l,time:o,animKey:u,selected:s})}return r}function fe(t,n){let r=[];for(let i=0;i<t.length;i++){let a=t[i],o={type:e.stdTrackID.decode(a.trackID),enabled:a.enab,keys:ue(a.keyList,n)};a.effectParams&&(o.effectParams={fillCanvas:a.effectParams.fillCanvas,zoomOrigin:a.effectParams.zoomOrigin,keys:ue(a.effectParams.keyList,n)}),r.push(o)}return r}function pe(t,n){let r=[];for(let i=0;i<t.length;i++){let a=t[i];r.push(Object.assign(Object.assign({trackID:e.stdTrackID.encode(a.type),Vrsn:1,enab:!!a.enabled,Effc:!!a.effectParams},a.effectParams?{effectParams:{keyList:de(a.effectParams.keys,n),fillCanvas:a.effectParams.fillCanvas,zoomOrigin:a.effectParams.zoomOrigin}}:{}),{keyList:de(a.keys,n)}))}return r}function R(t,n,r){let i={};for(let a of Object.keys(t)){let o=t[a];switch(a){case`enab`:i.enabled=!!o;break;case`uglg`:i.useGlobalLight=!!o;break;case`AntA`:i.antialiased=!!o;break;case`Algn`:i.align=!!o;break;case`Dthr`:i.dither=!!o;break;case`Invr`:i.invert=!!o;break;case`Rvrs`:i.reverse=!!o;break;case`Clr `:i.color=xe(o);break;case`hglC`:i.highlightColor=xe(o);break;case`sdwC`:i.shadowColor=xe(o);break;case`Styl`:i.position=e.FStl.decode(o);break;case`Md `:i.blendMode=e.BlnM.decode(o);break;case`hglM`:i.highlightBlendMode=e.BlnM.decode(o);break;case`sdwM`:i.shadowBlendMode=e.BlnM.decode(o);break;case`bvlS`:i.style=e.BESl.decode(o);break;case`bvlD`:i.direction=e.BESs.decode(o);break;case`bvlT`:i.technique=e.bvlT.decode(o);break;case`GlwT`:i.technique=e.BETE.decode(o);break;case`glwS`:i.source=e.IGSr.decode(o);break;case`Type`:i.type=e.GrdT.decode(o);break;case`gs99`:case`gradientsInterpolationMethod`:i.interpolationMethod=e.gradientInterpolationMethodType.decode(o);break;case`Opct`:i.opacity=J(o);break;case`hglO`:i.highlightOpacity=J(o);break;case`sdwO`:i.shadowOpacity=J(o);break;case`lagl`:i.angle=Ce(o);break;case`Angl`:i.angle=Ce(o);break;case`Lald`:i.altitude=Ce(o);break;case`Sftn`:i.soften=Y(o);break;case`srgR`:i.strength=J(o);break;case`blur`:i.size=Y(o);break;case`Nose`:i.noise=J(o);break;case`Inpr`:i.range=J(o);break;case`Ckmt`:i.choke=Y(o);break;case`ShdN`:i.jitter=J(o);break;case`Dstn`:i.distance=Y(o);break;case`Scl `:i.scale=J(o);break;case`Ptrn`:i.pattern={name:o[`Nm `],id:o.Idnt};break;case`phase`:i.phase=V(o);break;case`Ofst`:i.offset={x:J(o.Hrzn),y:J(o.Vrtc)};break;case`MpgS`:case`TrnS`:{let e={name:o[`Nm `],curve:o[`Crv `].map(e=>e.Cnty===void 0?{x:e.Hrzn,y:e.Vrtc}:{x:e.Hrzn,y:e.Vrtc,curved:e.Cnty})};r===`bevel`&&a===`MpgS`?i.shapeContour=e:i.contour=e;break}case`Grad`:i.gradient=he(o);break;case`useTexture`:case`useShape`:case`layerConceals`:case`present`:case`showInDialog`:case`antialiasGloss`:i[a]=o;break;case`_name`:case`_classID`:break;default:n.logMissingFeatures&&n.log(`Invalid effect key: '${a}', value:`,o)}}return i}function me(t,n,r){let i={enab:!1};n===`dropShadow`&&(i.TrnS={"Nm ":``,"Crv ":[]});for(let a of Object.keys(t)){let o=a,s=t[o];switch(o){case`enabled`:i.enab=!!s;break;case`useGlobalLight`:i.uglg=!!s;break;case`antialiased`:i.AntA=!!s;break;case`align`:i.Algn=!!s;break;case`dither`:i.Dthr=!!s;break;case`invert`:i.Invr=!!s;break;case`reverse`:i.Rvrs=!!s;break;case`color`:i[`Clr `]=q(s);break;case`highlightColor`:i.hglC=q(s);break;case`shadowColor`:i.sdwC=q(s);break;case`position`:i.Styl=e.FStl.encode(s);break;case`blendMode`:i[`Md `]=e.BlnM.encode(s);break;case`highlightBlendMode`:i.hglM=e.BlnM.encode(s);break;case`shadowBlendMode`:i.sdwM=e.BlnM.encode(s);break;case`style`:i.bvlS=e.BESl.encode(s);break;case`direction`:i.bvlD=e.BESs.encode(s);break;case`technique`:n===`bevel`?i.bvlT=e.bvlT.encode(s):i.GlwT=e.BETE.encode(s);break;case`source`:i.glwS=e.IGSr.encode(s);break;case`type`:i.Type=e.GrdT.encode(s);break;case`interpolationMethod`:i[n===`outerGlow`||n===`innerGlow`?`gradientsInterpolationMethod`:`gs99`]=e.gradientInterpolationMethodType.encode(s);break;case`opacity`:i.Opct=Ee(s);break;case`highlightOpacity`:i.hglO=Ee(s);break;case`shadowOpacity`:i.sdwO=Ee(s);break;case`angle`:n===`gradientOverlay`||n===`patternOverlay`?i.Angl=Z(s):i.lagl=Z(s);break;case`altitude`:i.Lald=Z(s);break;case`soften`:i.Sftn=$(s,o);break;case`strength`:i.srgR=Ee(s);break;case`size`:i.blur=$(s,o);break;case`noise`:i.Nose=Ee(s);break;case`range`:i.Inpr=Ee(s);break;case`choke`:i.Ckmt=$(s,o);break;case`jitter`:i.ShdN=Ee(s);break;case`distance`:i.Dstn=$(s,o);break;case`scale`:i[`Scl `]=Ee(s);break;case`pattern`:i.Ptrn={"Nm ":s.name,Idnt:s.id};break;case`phase`:i.phase={Hrzn:s.x,Vrtc:s.y};break;case`offset`:i.Ofst={Hrzn:Q(s.x),Vrtc:Q(s.y)};break;case`contour`:i[n===`satin`?`MpgS`:`TrnS`]=z(s);break;case`shapeContour`:i.MpgS=z(s);break;case`gradient`:i.Grad=ge(s);break;case`useTexture`:case`useShape`:case`layerConceals`:case`present`:case`showInDialog`:case`antialiasGloss`:i[o]=s;break;default:r.logMissingFeatures&&r.log(`Invalid effect key: '${o}', value:`,s)}}return i}function z(e){return{"Nm ":e.name,"Crv ":e.curve.map(e=>e.curved===void 0?{Hrzn:e.x,Vrtc:e.y}:{Hrzn:e.x,Vrtc:e.y,Cnty:!!e.curved})}}function he(t){if(t.GrdF===`GrdF.CstS`){let n=4096;return{type:`solid`,name:t[`Nm `],smoothness:t.Intr/4096,colorStops:t.Clrs.map(t=>{let r={color:t[`Clr `]?xe(t[`Clr `]):{r:0,g:0,b:0},location:t.Lctn/n,midpoint:t.Mdpn/100};if(t.Type)try{let n=e.Clry.decode(t.Type);n!==`user`&&(r.type=n)}catch{}return r}),opacityStops:t.Trns.map(e=>({opacity:J(e.Opct),location:e.Lctn/n,midpoint:e.Mdpn/100}))}}return{type:`noise`,name:t[`Nm `],roughness:t.Smth/4096,colorModel:e.ClrS.decode(t.ClrS),randomSeed:t.RndS,restrictColors:!!t.VctC,addTransparency:!!t.ShTr,min:t[`Mnm `].map(e=>e/100),max:t[`Mxm `].map(e=>e/100)}}function ge(t){if(t.type===`solid`){let n=4096;return{"Nm ":t.name||``,GrdF:`GrdF.CstS`,Intr:Math.round((t.smoothness??1)*4096),Clrs:t.colorStops.map(t=>({"Clr ":q(t.color),Type:e.Clry.encode(t.type??`user`),Lctn:Math.round(t.location*n),Mdpn:Math.round((t.midpoint??.5)*100)})),Trns:t.opacityStops.map(e=>({Opct:Q(e.opacity),Lctn:Math.round(e.location*n),Mdpn:Math.round((e.midpoint??.5)*100)}))}}return{GrdF:`GrdF.ClNs`,"Nm ":t.name||``,ShTr:!!t.addTransparency,VctC:!!t.restrictColors,ClrS:e.ClrS.encode(t.colorModel),RndS:t.randomSeed||0,Smth:Math.round((t.roughness??1)*4096),"Mnm ":(t.min||[0,0,0,0]).map(e=>Math.round(e*100)),"Mxm ":(t.max||[1,1,1,1]).map(e=>Math.round(e*100))}}function B(t){let n=he(t.Grad);return n.style=e.GrdT.decode(t.Type),t.Dthr!==void 0&&(n.dither=t.Dthr),t.gradientsInterpolationMethod!==void 0&&(n.interpolationMethod=e.gradientInterpolationMethodType.decode(t.gradientsInterpolationMethod)),t.Rvrs!==void 0&&(n.reverse=t.Rvrs),t.Angl!==void 0&&(n.angle=Ce(t.Angl)),t[`Scl `]!==void 0&&(n.scale=J(t[`Scl `])),t.Algn!==void 0&&(n.align=t.Algn),t.Ofst!==void 0&&(n.offset={x:J(t.Ofst.Hrzn),y:J(t.Ofst.Vrtc)}),t.gradientAspectRatio!==void 0&&(n.aspectRatio=t.gradientAspectRatio),t.noisePreSeed!==void 0&&(n.noisePreSeed=t.noisePreSeed),n}function V({Hrzn:e,Vrtc:t}){return{x:typeof e==`number`?e:e.value,y:typeof t==`number`?t:t.value}}function H(e){let t={name:e.Ptrn[`Nm `],id:e.Ptrn.Idnt};return e.Algn!==void 0&&(t.align=e.Algn),e.Lnkd!==void 0&&(t.linked=e.Lnkd),e.phase!==void 0&&(t.phase=V(e.phase)),e[`Scl `]!==void 0&&(t.scale=J(e[`Scl `])),e.Angl!==void 0&&(t.angle=Ce(e.Angl)),t}function _e(e){if(`Grad`in e)return B(e);if(`Ptrn`in e)return Object.assign({type:`pattern`},H(e));if(`Clr `in e)return{type:`color`,color:xe(e[`Clr `])};throw Error(`Invalid vector content`)}function U(t){let n={};return t.dither!==void 0&&(n.Dthr=t.dither),t.interpolationMethod!==void 0&&(n.gradientsInterpolationMethod=e.gradientInterpolationMethodType.encode(t.interpolationMethod)),t.reverse!==void 0&&(n.Rvrs=t.reverse),t.aspectRatio!==void 0&&(n.gradientAspectRatio=t.aspectRatio),t.angle!==void 0&&(n.Angl=Z(t.angle)),n.Type=e.GrdT.encode(t.style),t.align!==void 0&&(n.Algn=t.align),t.scale!==void 0&&(n[`Scl `]=Q(t.scale)),t.offset&&(n.Ofst={Hrzn:Q(t.offset.x),Vrtc:Q(t.offset.y)}),t.noisePreSeed!==void 0&&(n.noisePreSeed=t.noisePreSeed),n.Grad=ge(t),n}function ve(e){let t={Ptrn:{"Nm ":e.name||``,Idnt:e.id||``}};return e.align!==void 0&&(t.Algn=!!e.align),e.linked!==void 0&&(t.Lnkd=!!e.linked),e.phase!==void 0&&(t.phase={Hrzn:e.phase.x,Vrtc:e.phase.y}),e.scale!==void 0&&(t[`Scl `]=Q(e.scale)),e.angle!==void 0&&(t.Angl=Z(e.angle)),t}function ye(e){return e.type===`color`?{key:`SoCo`,descriptor:{"Clr ":q(e.color)}}:e.type===`pattern`?{key:`PtFl`,descriptor:ve(e)}:{key:`GdFl`,descriptor:U(e)}}var W={"H ":[e=>e/360,e=>e*360],Strt:[e=>e/100,e=>e*100],Brgh:[e=>e/100,e=>e*100],"Cyn ":[e=>e*255/100,e=>e*100/255],Mgnt:[e=>e*255/100,e=>e*100/255],"Ylw ":[e=>e*255/100,e=>e*100/255],Blck:[e=>e*255/100,e=>e*100/255],"Gry ":[e=>e*255/100,e=>e*100/255],Lmnc:[e=>e/100,e=>e*100],"A ":[n.normalizeLabAB,n.denormalizeLabAB],"B ":[n.normalizeLabAB,n.denormalizeLabAB]};function G(e,t){let n=W[e];if(!n)return t;let[r,i]=n,a=i(t);if(!isFinite(a))return a;for(let e=1;e<17;e++){let n=+a.toPrecision(e);if(r(n)===t)return n}return a}function be(e){return e._classID===`BkCl`||`Bk `in e||`bookID`in e}function xe(e){let t=K(e);if(be(e)){let n=e,r=n.bookKey;t.book={book:n[`Bk `]??``,name:n[`Nm `]??``,bookID:n.bookID??0,bookKey:typeof r==`string`?r:r?String.fromCharCode(...Array.from(r)):``}}return t}function K(e){if(`H `in e)return{h:we(e[`H `]),s:e.Strt/100,b:e.Brgh/100};if(`Rd `in e)return{r:e[`Rd `],g:e[`Grn `],b:e[`Bl `]};if(`Cyn `in e)return{c:e[`Cyn `]*255/100,m:e.Mgnt*255/100,y:e[`Ylw `]*255/100,k:e.Blck*255/100};if(`Gry `in e)return{k:e[`Gry `]*255/100};if(`Lmnc`in e)return{l:e.Lmnc/100,a:(0,n.normalizeLabAB)(e[`A `]),b:(0,n.normalizeLabAB)(e[`B `])};if(`redFloat`in e)return{fr:e.redFloat,fg:e.greenFloat,fb:e.blueFloat};if(be(e))return{r:0,g:0,b:0};throw Error(`Unsupported color descriptor`)}function q(e){let t=Se(e);if(e?.book){let{book:n,name:r,bookID:i,bookKey:a}=e.book,o=new Uint8Array(a.length);for(let e=0;e<o.length;e++)o[e]=a.charCodeAt(e)&255;Object.assign(t,{"Bk ":n,"Nm ":r,bookID:i,bookKey:o})}return t}function Se(e){if(!e)return{_name:``,_classID:`RGBC`,"Rd ":0,"Grn ":0,"Bl ":0};if(`r`in e)return{_name:``,_classID:`RGBC`,"Rd ":e.r||0,"Grn ":e.g||0,"Bl ":e.b||0};if(`fr`in e)return{_name:``,_classID:`RGBC`,redFloat:e.fr,greenFloat:e.fg,blueFloat:e.fb};if(`h`in e)return{_name:``,_classID:`HSBC`,"H ":Z(G(`H `,e.h||0)),Strt:G(`Strt`,e.s||0),Brgh:G(`Brgh`,e.b||0)};if(`c`in e)return{_name:``,_classID:`CMYC`,"Cyn ":G(`Cyn `,e.c||0),Mgnt:G(`Mgnt`,e.m||0),"Ylw ":G(`Ylw `,e.y||0),Blck:G(`Blck`,e.k||0)};if(`l`in e)return{_name:``,_classID:`LbCl`,Lmnc:G(`Lmnc`,e.l||0),"A ":G(`A `,e.a||0),"B ":G(`B `,e.b||0)};if(`k`in e)return{_name:``,_classID:`Grsc`,"Gry ":G(`Gry `,e.k||0)};throw Error(`Invalid color value`)}function Ce(e){if(e===void 0)return 0;if(e.units!==`Angle`)throw Error(`Invalid units: ${e.units}`);return e.value}function J(e){if(e===void 0)return 1;if(e.units!==`Percent`)throw Error(`Invalid units: ${e.units}`);return e.value/100}function we(e){if(e===void 0)return 1;if(e.units===`Percent`)return e.value/100;if(e.units===`Angle`)return e.value/360;throw Error(`Invalid units: ${e.units}`)}function Y({units:e,value:t}){if(e!==`Pixels`&&e!==`Millimeters`&&e!==`Points`&&e!==`None`&&e!==`Picas`&&e!==`Inches`&&e!==`Centimeters`&&e!==`Density`&&e!==`Distance`)throw Error(`Invalid units: ${JSON.stringify({units:e,value:t})}`);return{value:t,units:e}}function X(e,t=`Pixels`){return typeof e==`number`?{value:e,units:t}:Y(e)}function Te({units:e,value:t},n){if(e!==n)throw Error(`Invalid units: ${JSON.stringify({units:e,value:t})}`);return t}function Z(e){return{units:`Angle`,value:e||0}}function Ee(e){return{units:`Percent`,value:Math.round((e||0)*100)}}function Q(e){return{units:`Percent`,value:(e||0)*100}}function $(e,t){if(e==null)return{units:`Pixels`,value:0};if(typeof e!=`object`)throw Error(`Invalid value: ${JSON.stringify(e)} (key: ${t}) (should have value and units)`);let{units:n,value:r}=e;if(typeof r!=`number`)throw Error(`Invalid value in ${JSON.stringify(e)} (key: ${t})`);if(n!==`Pixels`&&n!==`Millimeters`&&n!==`Points`&&n!==`None`&&n!==`Picas`&&n!==`Inches`&&n!==`Centimeters`&&n!==`Density`&&n!==`Distance`)throw Error(`Invalid units in ${JSON.stringify(e)} (key: ${t})`);return{units:n,value:r}}function De({numerator:e,denominator:t}){return{numerator:e,denominator:t}}e.textGridding=(0,n.createEnum)(`textGridding`,`none`,{none:`None`,round:`Rnd `}),e.Ornt=(0,n.createEnum)(`Ornt`,`horizontal`,{horizontal:`Hrzn`,vertical:`Vrtc`}),e.Annt=(0,n.createEnum)(`Annt`,`sharp`,{none:`Anno`,sharp:`antiAliasSharp`,crisp:`AnCr`,strong:`AnSt`,smooth:`AnSm`,platform:`antiAliasPlatformGray`,platformLCD:`antiAliasPlatformLCD`}),e.warpStyle=(0,n.createEnum)(`warpStyle`,`none`,{none:`warpNone`,arc:`warpArc`,arcLower:`warpArcLower`,arcUpper:`warpArcUpper`,arch:`warpArch`,bulge:`warpBulge`,shellLower:`warpShellLower`,shellUpper:`warpShellUpper`,flag:`warpFlag`,wave:`warpWave`,fish:`warpFish`,rise:`warpRise`,fisheye:`warpFisheye`,inflate:`warpInflate`,squeeze:`warpSqueeze`,twist:`warpTwist`,cylinder:`warpCylinder`,custom:`warpCustom`}),e.BlnM=(0,n.createEnum)(`BlnM`,`normal`,{normal:`Nrml`,dissolve:`Dslv`,darken:`Drkn`,multiply:`Mltp`,"color burn":`CBrn`,"linear burn":`linearBurn`,"darker color":`darkerColor`,lighten:`Lghn`,screen:`Scrn`,"color dodge":`CDdg`,"linear dodge":`linearDodge`,"lighter color":`lighterColor`,overlay:`Ovrl`,"soft light":`SftL`,"hard light":`HrdL`,"vivid light":`vividLight`,"linear light":`linearLight`,"pin light":`pinLight`,"hard mix":`hardMix`,difference:`Dfrn`,exclusion:`Xclu`,subtract:`blendSubtraction`,divide:`blendDivide`,hue:`H `,saturation:`Strt`,color:`Clr `,luminosity:`Lmns`,"linear height":`linearHeight`,height:`Hght`,subtraction:`Sbtr`,"pass through":`passThrough`}),e.BESl=(0,n.createEnum)(`BESl`,`inner bevel`,{"inner bevel":`InrB`,"outer bevel":`OtrB`,emboss:`Embs`,"pillow emboss":`PlEb`,"stroke emboss":`strokeEmboss`}),e.bvlT=(0,n.createEnum)(`bvlT`,`smooth`,{smooth:`SfBL`,"chisel hard":`PrBL`,"chisel soft":`Slmt`}),e.BESs=(0,n.createEnum)(`BESs`,`up`,{up:`In `,down:`Out `}),e.BETE=(0,n.createEnum)(`BETE`,`softer`,{softer:`SfBL`,precise:`PrBL`}),e.IGSr=(0,n.createEnum)(`IGSr`,`edge`,{edge:`SrcE`,center:`SrcC`}),e.GrdT=(0,n.createEnum)(`GrdT`,`linear`,{linear:`Lnr `,radial:`Rdl `,angle:`Angl`,reflected:`Rflc`,diamond:`Dmnd`}),e.animInterpStyleEnum=(0,n.createEnum)(`animInterpStyle`,`linear`,{linear:`Lnr `,hold:`hold`}),e.stdTrackID=(0,n.createEnum)(`stdTrackID`,`opacity`,{opacity:`opacityTrack`,style:`styleTrack`,sheetTransform:`sheetTransformTrack`,sheetPosition:`sheetPositionTrack`,globalLighting:`globalLightingTrack`}),e.gradientInterpolationMethodType=(0,n.createEnum)(`gradientInterpolationMethodType`,`perceptual`,{perceptual:`Perc`,linear:`Lnr `,classic:`Gcls`,smooth:`Smoo`}),e.Clry=(0,n.createEnum)(`Clry`,`user`,{user:`UsrS`,foreground:`FrgC`,background:`BckC`}),e.ClrS=(0,n.createEnum)(`ClrS`,`rgb`,{rgb:`RGBC`,hsb:`HSBl`,lab:`LbCl`,hsl:`HSLC`}),e.FStl=(0,n.createEnum)(`FStl`,`outside`,{outside:`OutF`,center:`CtrF`,inside:`InsF`}),e.FrFl=(0,n.createEnum)(`FrFl`,`color`,{color:`SClr`,gradient:`GrFl`,pattern:`Ptrn`}),e.ESliceType=(0,n.createEnum)(`ESliceType`,`image`,{image:`Img `,noImage:`noImage`}),e.ESliceHorzAlign=(0,n.createEnum)(`ESliceHorzAlign`,`default`,{default:`default`}),e.ESliceVertAlign=(0,n.createEnum)(`ESliceVertAlign`,`default`,{default:`default`}),e.ESliceOrigin=(0,n.createEnum)(`ESliceOrigin`,`userGenerated`,{userGenerated:`userGenerated`,autoGenerated:`autoGenerated`,layer:`layer`}),e.ESliceBGColorType=(0,n.createEnum)(`ESliceBGColorType`,`none`,{none:`None`,matte:`matte`,color:`Clr `}),e.strokeStyleLineCapType=(0,n.createEnum)(`strokeStyleLineCapType`,`butt`,{butt:`strokeStyleButtCap`,round:`strokeStyleRoundCap`,square:`strokeStyleSquareCap`}),e.strokeStyleLineJoinType=(0,n.createEnum)(`strokeStyleLineJoinType`,`miter`,{miter:`strokeStyleMiterJoin`,round:`strokeStyleRoundJoin`,bevel:`strokeStyleBevelJoin`}),e.strokeStyleLineAlignment=(0,n.createEnum)(`strokeStyleLineAlignment`,`inside`,{inside:`strokeStyleAlignInside`,center:`strokeStyleAlignCenter`,outside:`strokeStyleAlignOutside`}),e.BlrM=(0,n.createEnum)(`BlrM`,`spin`,{spin:`Spn `,zoom:`Zm `}),e.BlrQ=(0,n.createEnum)(`BlrQ`,`good`,{draft:`Drft`,good:`Gd `,best:`Bst `}),e.SmBM=(0,n.createEnum)(`SmBM`,`normal`,{normal:`SBMN`,"edge only":`SBME`,"overlay edge":`SBMO`}),e.SmBQ=(0,n.createEnum)(`SmBQ`,`medium`,{low:`SBQL`,medium:`SBQM`,high:`SBQH`}),e.DspM=(0,n.createEnum)(`DspM`,`stretch to fit`,{"stretch to fit":`StrF`,tile:`Tile`}),e.UndA=(0,n.createEnum)(`UndA`,`repeat edge pixels`,{"wrap around":`WrpA`,"repeat edge pixels":`RptE`}),e.Cnvr=(0,n.createEnum)(`Cnvr`,`rectangular to polar`,{"rectangular to polar":`RctP`,"polar to rectangular":`PlrR`}),e.RplS=(0,n.createEnum)(`RplS`,`medium`,{small:`Sml `,medium:`Mdm `,large:`Lrg `}),e.SphM=(0,n.createEnum)(`SphM`,`normal`,{normal:`Nrml`,"horizontal only":`HrzO`,"vertical only":`VrtO`}),e.Wvtp=(0,n.createEnum)(`Wvtp`,`sine`,{sine:`WvSn`,triangle:`WvTr`,square:`WvSq`}),e.ZZTy=(0,n.createEnum)(`ZZTy`,`pond ripples`,{"around center":`ArnC`,"out from center":`OtFr`,"pond ripples":`PndR`}),e.Dstr=(0,n.createEnum)(`Dstr`,`uniform`,{uniform:`Unfr`,gaussian:`Gsn `}),e.Chnl=(0,n.createEnum)(`Chnl`,`composite`,{red:`Rd `,green:`Grn `,blue:`Bl `,composite:`Cmps`}),e.MztT=(0,n.createEnum)(`MztT`,`fine dots`,{"fine dots":`FnDt`,"medium dots":`MdmD`,"grainy dots":`GrnD`,"coarse dots":`CrsD`,"short lines":`ShrL`,"medium lines":`MdmL`,"long lines":`LngL`,"short strokes":`ShSt`,"medium strokes":`MdmS`,"long strokes":`LngS`}),e.Lns=(0,n.createEnum)(`Lns `,`50-300mm zoom`,{"50-300mm zoom":`Zm `,"32mm prime":`Nkn `,"105mm prime":`Nkn1`,"movie prime":`PnVs`}),e.blurType=(0,n.createEnum)(`blurType`,`gaussian blur`,{"gaussian blur":`GsnB`,"lens blur":`lensBlur`,"motion blur":`MtnB`}),e.DfsM=(0,n.createEnum)(`DfsM`,`normal`,{normal:`Nrml`,"darken only":`DrkO`,"lighten only":`LghO`,anisotropic:`anisotropic`}),e.ExtT=(0,n.createEnum)(`ExtT`,`blocks`,{blocks:`Blks`,pyramids:`Pyrm`}),e.ExtR=(0,n.createEnum)(`ExtR`,`random`,{random:`Rndm`,"level-based":`LvlB`}),e.FlCl=(0,n.createEnum)(`FlCl`,`background color`,{"background color":`FlBc`,"foreground color":`FlFr`,"inverse image":`FlIn`,"unaltered image":`FlSm`}),e.CntE=(0,n.createEnum)(`CntE`,`upper`,{lower:`Lwr `,upper:`Upr `}),e.WndM=(0,n.createEnum)(`WndM`,`wind`,{wind:`Wnd `,blast:`Blst`,stagger:`Stgr`}),e.Drct=(0,n.createEnum)(`Drct`,`right`,{left:`Left`,right:`Rght`}),e.IntE=(0,n.createEnum)(`IntE`,`odd lines`,{"odd lines":`ElmO`,"even lines":`ElmE`}),e.IntC=(0,n.createEnum)(`IntC`,`interpolation`,{duplication:`CrtD`,interpolation:`CrtI`}),e.FlMd=(0,n.createEnum)(`FlMd`,`wrap around`,{"set to transparent":`Bckg`,"repeat edge pixels":`Rpt `,"wrap around":`Wrp `}),e.prjM=(0,n.createEnum)(`prjM`,`fisheye`,{fisheye:`fisP`,perspective:`perP`,auto:`auto`,"full spherical":`fusP`}),e.presetKindType=(0,n.createEnum)(`presetKindType`,`custom`,{custom:`presetKindCustom`,default:`presetKindDefault`}),e.patternColorHandling=(0,n.createEnum)(``,`convert`,{convert:`conv`,"avoid conversion":`avod`,"luminance only":`lumi`})})),S=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resourceHandlersMap=e.resourceHandlers=void 0,e.shouldReadResource=d;var t=y(),n=O(),r=C(),i=k(),a=v(),o=b(),s=x();e.resourceHandlers=[],e.resourceHandlersMap={};function c(e){let t=[],n=new Proxy({},{get(e,n){typeof n==`string`&&!t.includes(n)&&t.push(n)}});try{e(n)}catch{}return t}var l=new Set([`layersGroup`,`layerGroupsEnabledId`,`alphaChannelNames`,`transparencyIndex`]);function u(t,n,r,i,a={}){let o=a.fields??c(n),s=o.some(e=>l.has(e)),u={key:t,keyCount:a.keyCount??1,has:n,read:r,write:i,name:a.name,fields:o,required:s};e.resourceHandlers.push(u);for(let t=0;t<u.keyCount;t++)e.resourceHandlersMap[u.key+t]=u}function d(e,t){return!t||e.required||t.size>0&&e.fields.some(e=>t.has(e))}var f=[void 0,`PPI`,`PPCM`],p=[void 0,`Inches`,`Centimeters`,`Points`,`Picas`,`Columns`],m=`0123456789abcdef`;function h(e){return e<=57?e-48:e>=97?e-87:e-55}function g(e,t){return h(e.charCodeAt(t))<<4|h(e.charCodeAt(t+1))}function _(e,t){let n=(0,r.readBytes)(e,t);return(0,r.decodeUtf8)(e,n)}function S(e,t){let n=(0,o.encodeString)(t);(0,i.writeBytes)(e,n)}function w(e){let t=(0,r.readUint8)(e);return T(e,(0,r.readBytes)(e,t))}function T(e,t){let n=!1;for(let e=0;e<t.byteLength;e++)if(t[e]&128){n=!0;break}if(n){for(let n of[(0,r.getGbkStrictDecoder)(e),(0,r.getUtf8StrictDecoder)(e)])if(n)try{return n.decode(t)}catch{}}return(0,r.decodeUtf8)(e,t)}function E(e){let t=``;for(let n=0;n<e.length;){let r=e.codePointAt(n);t+=r>127?`?`:String.fromCharCode(r),n+=r>65535?2:1}return t.length>255?t.substring(0,255):t}function D(e,t){let n=(0,o.encodeString)(E(t));(0,i.writeUint8)(e,n.byteLength),(0,i.writeBytes)(e,n)}u(1028,e=>e.iptcData!==void 0,(e,t,n)=>{t.iptcData=(0,r.readBytes)(e,n())},(e,t)=>{(0,i.writeBytes)(e,t.iptcData)}),u(1061,e=>e.captionDigest!==void 0,(e,t)=>{let n=``;for(let t=0;t<16;t++){let t=(0,r.readUint8)(e);n+=m[t>>4],n+=m[t&15]}t.captionDigest=n},(e,t)=>{for(let n=0;n<16;n++)(0,i.writeUint8)(e,g(t.captionDigest,n*2))}),u(1060,e=>e.xmpMetadata!==void 0,(e,t,n)=>{t.xmpMetadata=_(e,n())},(e,t)=>{S(e,t.xmpMetadata)});var A=(0,a.createEnum)(`Inte`,`perceptual`,{perceptual:`Img `,saturation:`Grp `,"relative colorimetric":`Clrm`,"absolute colorimetric":`AClr`});u(1085,e=>e.windowsDevMode!==void 0,(e,t,n)=>{t.windowsDevMode=(0,r.readBytes)(e,n())},(e,t)=>{(0,i.writeBytes)(e,t.windowsDevMode)}),u(1082,e=>e.printInformation!==void 0,(e,t)=>{let n=(0,s.readVersionAndDescriptor)(e);t.printInformation={printerName:n.printerName||``,renderingIntent:A.decode(n.Inte??`Inte.Img `)};let r=t.printInformation;n.PstS!==void 0&&(r.printerManagesColors=n.PstS),n.ClrS===`ClrS.Grys`&&(r.printerProfileColorSpace=`grayscale`),n[`Nm `]!==void 0&&(r.printerProfile=n[`Nm `]),n.MpBl!==void 0&&(r.blackPointCompensation=n.MpBl),n.printSixteenBit!==void 0&&(r.printSixteenBit=n.printSixteenBit),n.hardProof!==void 0&&(r.hardProof=n.hardProof),n.printProofSetup&&(r.proofSetup=`Bltn`in n.printProofSetup?{builtin:n.printProofSetup.Bltn.split(`.`)[1]}:{profile:n.printProofSetup.profile,renderingIntent:A.decode(n.printProofSetup.Inte??`Inte.Img `),blackPointCompensation:!!n.printProofSetup.MpBl,paperWhite:!!n.printProofSetup.paperWhite})},(e,t)=>{let n=t.printInformation,r={};n.printerManagesColors?r.PstS=!0:(n.hardProof!==void 0&&(r.hardProof=!!n.hardProof),r.ClrS=n.printerProfileColorSpace===`grayscale`?`ClrS.Grys`:`ClrS.RGBC`,n.printerProfile!==void 0&&(r[`Nm `]=n.printerProfile)),r.Inte=A.encode(n.renderingIntent),!n.printerManagesColors&&n.blackPointCompensation!==void 0&&(r.MpBl=!!n.blackPointCompensation),r.printSixteenBit=!!n.printSixteenBit,r.printerName=n.printerName||``,n.proofSetup&&`profile`in n.proofSetup?r.printProofSetup={profile:n.proofSetup.profile||``,Inte:A.encode(n.proofSetup.renderingIntent),MpBl:!!n.proofSetup.blackPointCompensation,paperWhite:!!n.proofSetup.paperWhite}:n.proofSetup&&(r.printProofSetup={Bltn:`builtinProof.${n.proofSetup.builtin||`proofCMYK`}`}),(0,s.writeVersionAndDescriptor)(e,``,`printOutput`,r)}),u(1083,e=>e.printStyle!==void 0,(e,t)=>{let n=(0,s.readVersionAndDescriptor)(e);t.printStyle={caption:n.Cptn,calibrationBars:n.Clbr,registrationMarks:n.RgsM,cornerCropMarks:n.CrnC,centerCropMarks:n.CntC,labels:n.Lbls,negative:n.Ngtv,emulsionDown:n.EmlD,interpolate:n.Intr,backgroundColor:(0,s.parseColor)(n.Bckg),border:(0,s.parseUnits)(n.BrdT),bleed:(0,s.parseUnits)(n[`Bld `]),resolution:(0,s.parseUnits)(n.Rslt),vectorData:n.vectorData,pagePosition:n.PgPs===`PgPs.PgPC`?`centered`:n.PgPs,left:(0,s.parseUnits)(n.Left),top:(0,s.parseUnits)(n[`Top `]),scale:(0,s.parsePercent)(n[`Scl `])},n.cropWhenPrinting!==void 0&&(t.printStyle.cropWhenPrinting=n.cropWhenPrinting,t.printStyle.cropRect={top:n.cropRectTop||0,left:n.cropRectLeft||0,bottom:n.cropRectBottom||0,right:n.cropRectRight||0})},(e,t)=>{let n=t.printStyle,r={Cptn:!!n.caption,Clbr:!!n.calibrationBars,RgsM:!!n.registrationMarks,CrnC:!!n.cornerCropMarks,CntC:!!n.centerCropMarks,Lbls:!!n.labels,Ngtv:!!n.negative,EmlD:!!n.emulsionDown,Intr:!!n.interpolate,Bckg:(0,s.serializeColor)(n.backgroundColor||{r:255,g:255,b:255}),BrdT:(0,s.unitsValue)(n.border||{units:`Distance`,value:0},`border`),"Bld ":(0,s.unitsValue)(n.bleed||{units:`Distance`,value:0},`bleed`),Rslt:(0,s.unitsValue)(n.resolution||{units:`Pixels`,value:72},`resolution`),vectorData:n.vectorData??!0,PgPs:!n.pagePosition||n.pagePosition===`centered`?`PgPs.PgPC`:n.pagePosition,Left:(0,s.unitsValue)(n.left||{units:`Distance`,value:0},`left`),"Top ":(0,s.unitsValue)(n.top||{units:`Distance`,value:0},`top`),"Scl ":(0,s.unitsPercentF)(n.scale??1)};(n.cropWhenPrinting!==void 0||n.cropRect)&&(r.cropWhenPrinting=!!n.cropWhenPrinting,r.cropRectBottom=n.cropRect?.bottom??0,r.cropRectLeft=n.cropRect?.left??0,r.cropRectRight=n.cropRect?.right??0,r.cropRectTop=n.cropRect?.top??0),(0,s.writeVersionAndDescriptor)(e,``,`printOutputOptions`,r)}),u(1005,e=>e.resolutionInfo!==void 0,(e,t)=>{let n=(0,r.readFixedPoint32)(e),i=(0,r.readUint16)(e),a=(0,r.readUint16)(e),o=(0,r.readFixedPoint32)(e),s=(0,r.readUint16)(e),c=(0,r.readUint16)(e);t.resolutionInfo={horizontalResolution:n,horizontalResolutionUnit:f[i]||`PPI`,widthUnit:p[a]||`Inches`,verticalResolution:o,verticalResolutionUnit:f[s]||`PPI`,heightUnit:p[c]||`Inches`}},(e,t)=>{let n=t.resolutionInfo;(0,i.writeFixedPoint32)(e,n.horizontalResolution||0),(0,i.writeUint16)(e,Math.max(1,f.indexOf(n.horizontalResolutionUnit))),(0,i.writeUint16)(e,Math.max(1,p.indexOf(n.widthUnit))),(0,i.writeFixedPoint32)(e,n.verticalResolution||0),(0,i.writeUint16)(e,Math.max(1,f.indexOf(n.verticalResolutionUnit))),(0,i.writeUint16)(e,Math.max(1,p.indexOf(n.heightUnit)))});var j=[`centered`,`size to fit`,`user defined`];u(1062,e=>e.printScale!==void 0,(e,t)=>{t.printScale={style:j[(0,r.readInt16)(e)],x:(0,r.readFloat32)(e),y:(0,r.readFloat32)(e),scale:(0,r.readFloat32)(e)}},(e,t)=>{let{style:n,x:r,y:a,scale:o}=t.printScale;(0,i.writeInt16)(e,Math.max(0,j.indexOf(n))),(0,i.writeFloat32)(e,r||0),(0,i.writeFloat32)(e,a||0),(0,i.writeFloat32)(e,o||0)}),u(1006,e=>e.alphaChannelNames!==void 0,(e,t,n)=>{if(t.alphaChannelNames)(0,r.skipBytes)(e,n());else for(t.alphaChannelNames=[];n()>0;){let n=w(e);t.alphaChannelNames.push(n)}},(e,t)=>{for(let n of t.alphaChannelNames)D(e,n)}),u(1045,e=>e.alphaChannelNames!==void 0,(e,t,n)=>{for(t.alphaChannelNames=[];n()>0;)t.alphaChannelNames.push((0,r.readUnicodeString)(e))},(e,t)=>{for(let n of t.alphaChannelNames)(0,i.writeUnicodeStringWithPadding)(e,n)});var M=[`selected`,`protected`,`spot`],N=[0,1,2,7,8];function P(e){let t={opacity:0,kind:`selected`},n=e.view.getUint16(e.offset);N.indexOf(n)===-1?((0,r.skipBytes)(e,2),t.rawColor={colorSpace:n,values:[(0,r.readUint16)(e),(0,r.readUint16)(e),(0,r.readUint16)(e),(0,r.readUint16)(e)]}):t.color=(0,r.readColor)(e),t.opacity=(0,r.readUint16)(e)/100;let i=M[(0,r.readUint8)(e)];if(!i)throw Error(`Invalid display info kind`);return t.kind=i,t}u(1007,()=>!1,(e,t,n)=>{let i=[];for(;n()>=14;)i.push(P(e)),(0,r.skipBytes)(e,1);t.alphaChannelDisplayInfo||=i},()=>{},{fields:[`alphaChannelDisplayInfo`]}),u(1077,e=>e.alphaChannelDisplayInfo!==void 0,(e,t,n)=>{let i=(0,r.readUint32)(e);if(i!==1)throw Error(`Invalid display info version: ${i}`);for(t.alphaChannelDisplayInfo=[];n()>=13;)t.alphaChannelDisplayInfo.push(P(e))},(e,t)=>{(0,i.writeUint32)(e,1);for(let n of t.alphaChannelDisplayInfo){if(!n.color&&n.rawColor){(0,i.writeUint16)(e,n.rawColor.colorSpace);for(let t=0;t<4;t++)(0,i.writeUint16)(e,n.rawColor.values[t]|0)}else(0,i.writeColor)(e,n.color||{r:255,g:0,b:0});(0,i.writeUint16)(e,Math.round((0,a.clamp)(n.opacity,0,1)*100)),(0,i.writeUint8)(e,Math.max(0,M.indexOf(n.kind)))}}),u(1053,e=>e.alphaIdentifiers!==void 0,(e,t,n)=>{for(t.alphaIdentifiers=[];n()>=4;)t.alphaIdentifiers.push((0,r.readUint32)(e))},(e,t)=>{for(let n of t.alphaIdentifiers)(0,i.writeUint32)(e,n)}),u(1010,e=>e.backgroundColor!==void 0,(e,t)=>t.backgroundColor=(0,r.readColor)(e),(e,t)=>(0,i.writeColor)(e,t.backgroundColor)),u(1037,e=>e.globalAngle!==void 0,(e,t)=>t.globalAngle=(0,r.readInt32)(e),(e,t)=>(0,i.writeInt32)(e,t.globalAngle)),u(1049,e=>e.globalAltitude!==void 0,(e,t)=>t.globalAltitude=(0,r.readUint32)(e),(e,t)=>(0,i.writeUint32)(e,t.globalAltitude)),u(1011,e=>e.printFlags!==void 0,(e,t,n)=>{t.printFlags={labels:!!(0,r.readUint8)(e),cropMarks:!!(0,r.readUint8)(e),colorBars:!!(0,r.readUint8)(e),registrationMarks:!!(0,r.readUint8)(e),negative:!!(0,r.readUint8)(e),flip:!!(0,r.readUint8)(e),interpolate:!!(0,r.readUint8)(e),caption:!!(0,r.readUint8)(e),printFlags:n()?!!(0,r.readUint8)(e):!1}},(e,t)=>{let n=t.printFlags;(0,i.writeUint8)(e,+!!n.labels),(0,i.writeUint8)(e,+!!n.cropMarks),(0,i.writeUint8)(e,+!!n.colorBars),(0,i.writeUint8)(e,+!!n.registrationMarks),(0,i.writeUint8)(e,+!!n.negative),(0,i.writeUint8)(e,+!!n.flip),(0,i.writeUint8)(e,+!!n.interpolate),(0,i.writeUint8)(e,+!!n.caption),(0,i.writeUint8)(e,+!!n.printFlags)}),u(1034,e=>e.copyrighted!==void 0,(e,t)=>{t.copyrighted=!!(0,r.readUint8)(e)},(e,t)=>{(0,i.writeUint8)(e,+!!t.copyrighted)}),u(1035,e=>e.url!==void 0,(e,t,n)=>{t.url=(0,r.readAsciiString)(e,n())},(e,t)=>{(0,i.writeAsciiString)(e,t.url)}),u(1e4,e=>e.printFlagsInfo!==void 0,(e,t)=>{let n=(0,r.readUint16)(e);if(n!==1)throw Error(`Invalid print flags information version: ${n}`);let i=!!(0,r.readUint8)(e);(0,r.skipBytes)(e,1),t.printFlagsInfo={centerCropMarks:i,bleedWidth:(0,r.readUint32)(e),bleedWidthScale:(0,r.readUint16)(e)}},(e,t)=>{let n=t.printFlagsInfo;(0,i.writeUint16)(e,1),(0,i.writeUint8)(e,+!!n.centerCropMarks),(0,i.writeUint8)(e,0),(0,i.writeUint32)(e,n.bleedWidth|0),(0,i.writeUint16)(e,n.bleedWidthScale|0)}),u(1046,e=>e.indexedColorCount!==void 0,(e,t)=>{t.indexedColorCount=(0,r.readUint16)(e)},(e,t)=>{(0,i.writeUint16)(e,t.indexedColorCount)}),u(1047,e=>e.transparencyIndex!==void 0,(e,t)=>{t.transparencyIndex=(0,r.readUint16)(e)},(e,t)=>{(0,i.writeUint16)(e,t.transparencyIndex)});var ee=[`lines/inch`,`lines/cm`],F=[`round`,`ellipse`,`line`,`square`,`cross`,void 0,`diamond`];function I(e,t){let n=[];for(;t()>=18;){let t=(0,r.readFixedPoint32)(e),i=ee[(0,r.readUint16)(e)-1];if(!i)throw Error(`Invalid halftone screen frequency units`);let a=(0,r.readFixedPoint32)(e),o=F[(0,r.readInt16)(e)];if(!o)throw Error(`Invalid halftone screen shape`);(0,r.skipBytes)(e,4);let s=!!(0,r.readUint8)(e),c=!!(0,r.readUint8)(e);n.push({frequency:t,frequencyUnits:i,angle:a,shape:o,accurateScreens:s,printerDefaultScreens:c})}return n}function te(e,t){for(let n of t)(0,i.writeFixedPoint32)(e,n.frequency),(0,i.writeUint16)(e,Math.max(0,ee.indexOf(n.frequencyUnits))+1),(0,i.writeFixedPoint32)(e,n.angle),(0,i.writeInt16)(e,Math.max(0,F.indexOf(n.shape))),(0,i.writeZeros)(e,4),(0,i.writeUint8)(e,+!!n.accurateScreens),(0,i.writeUint8)(e,+!!n.printerDefaultScreens)}u(1012,e=>e.grayscaleHalftoneScreens!==void 0,(e,t,n)=>t.grayscaleHalftoneScreens=I(e,n),(e,t)=>te(e,t.grayscaleHalftoneScreens)),u(1013,e=>e.colorHalftoneScreens!==void 0,(e,t,n)=>t.colorHalftoneScreens=I(e,n),(e,t)=>te(e,t.colorHalftoneScreens));function ne(e,t){let n=[];for(;t()>=28;){let t=[];for(let n=0;n<13;n++)t.push((0,r.readInt16)(e));let i=!!(0,r.readUint16)(e);n.push({curve:t,override:i})}return n}function re(e,t){for(let n of t){for(let t=0;t<13;t++)(0,i.writeInt16)(e,n.curve[t]??-1);(0,i.writeUint16)(e,+!!n.override)}}u(1014,e=>e.duotoneHalftoneScreens!==void 0,(e,t,n)=>t.duotoneHalftoneScreens=I(e,n),(e,t)=>te(e,t.duotoneHalftoneScreens)),u(1017,e=>e.duotoneTransferFunctions!==void 0,(e,t,n)=>t.duotoneTransferFunctions=ne(e,n),(e,t)=>re(e,t.duotoneTransferFunctions)),u(1018,e=>e.duotoneImageInformation!==void 0,(e,t,n)=>t.duotoneImageInformation=(0,r.readBytes)(e,n()),(e,t)=>(0,i.writeBytes)(e,t.duotoneImageInformation)),u(1066,e=>e.alternateDuotoneColors!==void 0,(e,t,n)=>{if((0,r.readUint16)(e)!==1)throw Error(`Invalid alternate duotone colors version`);let i=[],a=(0,r.readUint16)(e);for(let t=0;t<a&&n()>=10;t++)i.push((0,r.readColor)(e));let o=(0,r.readUint16)(e);if(o*3>n())throw Error(`Invalid alternate duotone colors Lab table size`);t.alternateDuotoneColors={colors:i,labColors:(0,r.readBytes)(e,o*3)}},(e,t)=>{let{colors:n,labColors:r}=t.alternateDuotoneColors;(0,i.writeUint16)(e,1),(0,i.writeUint16)(e,n.length);for(let t of n)(0,i.writeColor)(e,t);(0,i.writeUint16)(e,Math.floor(r.byteLength/3)),(0,i.writeBytes)(e,r.subarray(0,Math.floor(r.byteLength/3)*3))}),u(1015,e=>e.grayscaleTransferFunctions!==void 0,(e,t,n)=>t.grayscaleTransferFunctions=ne(e,n),(e,t)=>re(e,t.grayscaleTransferFunctions)),u(1016,e=>e.colorTransferFunctions!==void 0,(e,t,n)=>t.colorTransferFunctions=ne(e,n),(e,t)=>re(e,t.colorTransferFunctions)),u(1080,e=>e.countInformation!==void 0,(e,t)=>{t.countInformation=(0,s.readVersionAndDescriptor)(e).countGroupList.map(e=>({color:{r:e[`Rd `],g:e[`Grn `],b:e[`Bl `]},name:e[`Nm `],size:e[`Rds `],fontSize:e.fontSize,visible:e.Vsbl,points:e.countObjectList.map(e=>({x:e[`X `],y:e[`Y `]}))}))},(e,t)=>{let n={Vrsn:1,countGroupList:t.countInformation.map(e=>({"Rd ":e.color.r,"Grn ":e.color.g,"Bl ":e.color.b,"Nm ":e.name,"Rds ":e.size,fontSize:e.fontSize,Vsbl:e.visible,countObjectList:e.points.map(e=>({"X ":e.x,"Y ":e.y}))}))};(0,s.writeVersionAndDescriptor)(e,``,`Cnt `,n)}),u(1024,e=>e.layerState!==void 0,(e,t)=>t.layerState=(0,r.readUint16)(e),(e,t)=>(0,i.writeUint16)(e,t.layerState)),u(1026,e=>e.layersGroup!==void 0,(e,t,n)=>{for(t.layersGroup=[];n()>0;)t.layersGroup.push((0,r.readUint16)(e))},(e,t)=>{for(let n of t.layersGroup)(0,i.writeUint16)(e,n)}),u(1072,e=>e.layerGroupsEnabledId!==void 0,(e,t,n)=>{for(t.layerGroupsEnabledId=[];n()>0;)t.layerGroupsEnabledId.push((0,r.readUint8)(e))},(e,t)=>{for(let n of t.layerGroupsEnabledId)(0,i.writeUint8)(e,n)}),u(1069,e=>e.layerSelectionIds!==void 0,(e,t)=>{let n=(0,r.readUint16)(e);for(t.layerSelectionIds=[];n--;)t.layerSelectionIds.push((0,r.readUint32)(e))},(e,t)=>{(0,i.writeUint16)(e,t.layerSelectionIds.length);for(let n of t.layerSelectionIds)(0,i.writeUint32)(e,n)}),u(1032,e=>e.gridAndGuidesInformation!==void 0,(e,t)=>{let n=(0,r.readUint32)(e),i=(0,r.readUint32)(e),a=(0,r.readUint32)(e),o=(0,r.readUint32)(e);if(n!==1)throw Error(`Invalid 1032 resource version: ${n}`);let s=t.gridAndGuidesInformation?.guides,c=[];for(let t=0;t<o;t++){let n={location:(0,r.readInt32)(e)/32,direction:(0,r.readUint8)(e)?`horizontal`:`vertical`};s?.length===o&&s[t].color&&(n.color=s[t].color),s?.length===o&&s[t].id&&(n.id=s[t].id),c.push(n)}t.gridAndGuidesInformation={grid:{horizontal:i,vertical:a},guides:c}},(e,t)=>{let n=t.gridAndGuidesInformation,r=n.grid||{horizontal:576,vertical:576},a=n.guides||[];(0,i.writeUint32)(e,1),(0,i.writeUint32)(e,Math.round(r.horizontal)),(0,i.writeUint32)(e,Math.round(r.vertical)),(0,i.writeUint32)(e,a.length);for(let t of a)(0,i.writeInt32)(e,Math.round(t.location*32)),(0,i.writeUint8)(e,+(t.direction===`horizontal`))});var ie={r:74,g:255,b:255};u(1092,e=>e.gridAndGuidesInformation!==void 0,(e,t)=>{let n=(0,r.readUint32)(e);if(n!==2)throw Error(`Invalid 1092 resource version: ${n}`);let i=(0,r.readUint32)(e),a=(0,r.readUint32)(e),o=(0,r.readUint32)(e),s=[];for(let t=0;t<o;t++){let t=(0,r.readInt32)(e)/32,n=(0,r.readUint8)(e)?`horizontal`:`vertical`;(0,r.skipBytes)(e,1);let i={r:(0,r.readUint8)(e),g:(0,r.readUint8)(e),b:(0,r.readUint8)(e)};s.push({location:t,direction:n,color:i})}let c=t.gridAndGuidesInformation?.guides;c&&c.length===o?c.forEach((e,t)=>e.color=s[t].color):t.gridAndGuidesInformation={grid:{horizontal:i,vertical:a},guides:s}},(e,t)=>{let n=t.gridAndGuidesInformation,r=n.grid||{horizontal:576,vertical:576},a=n.guides||[];(0,i.writeUint32)(e,2),(0,i.writeUint32)(e,Math.round(r.horizontal)),(0,i.writeUint32)(e,Math.round(r.vertical)),(0,i.writeUint32)(e,a.length);for(let t of a){let n=t.color||ie;(0,i.writeInt32)(e,Math.round(t.location*32)),(0,i.writeUint8)(e,+(t.direction===`horizontal`)),(0,i.writeUint8)(e,0),(0,i.writeUint8)(e,Math.round(n.r)),(0,i.writeUint8)(e,Math.round(n.g)),(0,i.writeUint8)(e,Math.round(n.b))}});var ae=`00000000-0000-0000-0000-000000000000`;u(1097,e=>!!e.gridAndGuidesInformation&&(e.gridAndGuidesInformation.guides||[]).every(e=>e.id),(e,t)=>{let n=(0,r.readUint32)(e),i=[];for(let t=0;t<n;t++)i.push((0,r.readAsciiString)(e,(0,r.readUint32)(e))),(0,r.readUint32)(e),(0,r.readAsciiString)(e,(0,r.readUint32)(e));let a=t.gridAndGuidesInformation?.guides;a&&a.length===n&&a.forEach((e,t)=>e.id=i[t])},(e,t)=>{let n=t.gridAndGuidesInformation.guides||[];(0,i.writeUint32)(e,n.length);for(let t of n)(0,i.writeUint32)(e,t.id.length),(0,i.writeAsciiString)(e,t.id),(0,i.writeUint32)(e,0),(0,i.writeUint32)(e,36),(0,i.writeAsciiString)(e,ae)}),u(1065,e=>e.layerComps!==void 0,(e,t)=>{let n=(0,s.readVersionAndDescriptor)(e,!0);t.layerComps={list:[]};for(let e of n.list)t.layerComps.list.push({id:e.compID,name:e[`Nm `],capturedInfo:e.capturedInfo}),e.comment!==void 0&&(t.layerComps.list[t.layerComps.list.length-1].comment=e.comment),e.Expn!==void 0&&(t.layerComps.list[t.layerComps.list.length-1].expanded=e.Expn);n.lastAppliedComp!==void 0&&(t.layerComps.lastApplied=n.lastAppliedComp)},(e,t)=>{let n=t.layerComps,r={list:[]};for(let e of n.list){let t={};t._classID=`Comp`,t[`Nm `]=e.name,e.comment!==void 0&&(t.comment=e.comment),t.compID=e.id,t.capturedInfo=e.capturedInfo,e.expanded!==void 0&&(t.Expn=!!e.expanded),r.list.push(t)}n.lastApplied!==void 0&&(r.lastAppliedComp=n.lastApplied),(0,s.writeVersionAndDescriptor)(e,``,`CompList`,r)}),a.MOCK_HANDLERS&&u(1092,e=>e._ir1092!==void 0,(e,t,n)=>{t._ir1092=(0,r.readBytes)(e,n())},(e,t)=>{(0,i.writeBytes)(e,t._ir1092)});var oe=[`normal`,void 0,void 0,void 0,void 0,void 0,void 0,`multiply`,`screen`,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,`difference`];u(1078,e=>e.onionSkins!==void 0,(e,t)=>{let n=(0,s.readVersionAndDescriptor)(e);t.onionSkins={enabled:n.enab,framesBefore:n.numBefore,framesAfter:n.numAfter,frameSpacing:n.Spcn,minOpacity:n.minOpacity/100,maxOpacity:n.maxOpacity/100,blendMode:oe[n.BlnM]||`normal`}},(e,t)=>{let n=t.onionSkins,r={Vrsn:1,enab:n.enabled,numBefore:n.framesBefore,numAfter:n.framesAfter,Spcn:n.frameSpacing,minOpacity:Math.round(n.minOpacity*100),maxOpacity:Math.round(n.maxOpacity*100),BlnM:Math.max(0,oe.indexOf(n.blendMode))};(0,s.writeVersionAndDescriptor)(e,``,`null`,r)}),u(1075,e=>e.timelineInformation!==void 0,(e,t)=>{let n=(0,s.readVersionAndDescriptor)(e);t.timelineInformation={enabled:n.enab,frameStep:(0,s.frac)(n.frameStep),frameRate:n.frameRate,time:(0,s.frac)(n.time),duration:(0,s.frac)(n.duration),workInTime:(0,s.frac)(n.workInTime),workOutTime:(0,s.frac)(n.workOutTime),repeats:n.LCnt,hasMotion:n.hasMotion,globalTracks:(0,s.parseTrackList)(n.globalTrackList,e)},n.audioClipGroupList?.audioClipGroupList?.length&&(t.timelineInformation.audioClipGroups=n.audioClipGroupList.audioClipGroupList.map(e=>({id:e.groupID,muted:e.muted,audioClips:e.audioClipList.map(({clipID:e,timeScope:t,muted:n,audioLevel:r,frameReader:i})=>({id:e,start:(0,s.frac)(t.Strt),duration:(0,s.frac)(t.duration),inTime:(0,s.frac)(t.inTime),outTime:(0,s.frac)(t.outTime),muted:n,audioLevel:r,frameReader:{type:i.frameReaderType,mediaDescriptor:i.mediaDescriptor,link:{name:i[`Lnk `][`Nm `],fullPath:i[`Lnk `].fullPath,relativePath:i[`Lnk `].relPath}}}))})))},(e,t)=>{let n=t.timelineInformation,r={Vrsn:1,enab:n.enabled,frameStep:n.frameStep,frameRate:n.frameRate,time:n.time,duration:n.duration,workInTime:n.workInTime,workOutTime:n.workOutTime,LCnt:n.repeats,globalTrackList:(0,s.serializeTrackList)(n.globalTracks,e),audioClipGroupList:{audioClipGroupList:(n.audioClipGroups??[]).map(e=>({groupID:e.id,muted:e.muted,audioClipList:e.audioClips.map(e=>({clipID:e.id,timeScope:{Vrsn:1,Strt:e.start,duration:e.duration,inTime:e.inTime,outTime:e.outTime},frameReader:{frameReaderType:e.frameReader.type,descVersion:1,"Lnk ":{descVersion:1,"Nm ":e.frameReader.link.name,fullPath:e.frameReader.link.fullPath,relPath:e.frameReader.link.relativePath},mediaDescriptor:e.frameReader.mediaDescriptor},muted:e.muted,audioLevel:e.audioLevel}))}))},hasMotion:n.hasMotion};(0,s.writeVersionAndDescriptor)(e,``,`null`,r,`anim`)}),u(1076,e=>e.sheetDisclosure!==void 0,(e,t)=>{let n=(0,s.readVersionAndDescriptor)(e);t.sheetDisclosure={},n.sheetTimelineOptions&&(t.sheetDisclosure.sheetTimelineOptions=n.sheetTimelineOptions.map(e=>({sheetID:e.sheetID,sheetDisclosed:e.sheetDisclosed,lightsDisclosed:e.lightsDisclosed,meshesDisclosed:e.meshesDisclosed,materialsDisclosed:e.materialsDisclosed})))},(e,t)=>{let n=t.sheetDisclosure,r={Vrsn:1};n.sheetTimelineOptions&&(r.sheetTimelineOptions=n.sheetTimelineOptions.map(e=>({Vrsn:2,sheetID:e.sheetID,sheetDisclosed:e.sheetDisclosed,lightsDisclosed:e.lightsDisclosed,meshesDisclosed:e.meshesDisclosed,materialsDisclosed:e.materialsDisclosed}))),(0,s.writeVersionAndDescriptor)(e,``,`null`,r)}),u(1054,e=>e.urlsList!==void 0,(e,t)=>{let n=(0,r.readUint32)(e);t.urlsList=[];for(let i=0;i<n;i++){if((0,r.readSignature)(e)!==`slic`&&e.throwForMissingFeatures)throw Error(`Unknown long`);let n=(0,r.readUint32)(e),i=(0,r.readUnicodeString)(e);t.urlsList.push({id:n,url:i,ref:`slice`})}},(e,t)=>{let n=t.urlsList;(0,i.writeUint32)(e,n.length);for(let t=0;t<n.length;t++)(0,i.writeSignature)(e,`slic`),(0,i.writeUint32)(e,n[t].id),(0,i.writeUnicodeString)(e,n[t].url)});function se(e){return{"Top ":e.top,Left:e.left,Btom:e.bottom,Rght:e.right}}function ce(e){return{top:e[`Top `],left:e.Left,bottom:e.Btom,right:e.Rght}}function L(e,t){return e[Math.max(0,Math.min(e.length-1,t))]}var le=[`autoGenerated`,`layer`,`userGenerated`],ue=[`noImage`,`image`],de=[`default`];u(1050,e=>e.slices?e.slices.length:0,(e,t,n)=>{let i=(0,r.readUint32)(e);if(i===6){t.slices||=[];let i=(0,r.readInt32)(e),a=(0,r.readInt32)(e),o=(0,r.readInt32)(e),c=(0,r.readInt32)(e),l=(0,r.readUnicodeString)(e),u=(0,r.readUint32)(e);t.slices.push({bounds:{top:i,left:a,bottom:o,right:c},groupName:l,slices:[]});let d=t.slices[t.slices.length-1].slices;for(let t=0;t<u;t++){let t=(0,r.readUint32)(e),n=(0,r.readUint32)(e),i=L(le,(0,r.readUint32)(e)),a=i==`layer`?(0,r.readUint32)(e):0,o=(0,r.readUnicodeString)(e),s=L(ue,(0,r.readUint32)(e)),c=(0,r.readInt32)(e),l=(0,r.readInt32)(e),u=(0,r.readInt32)(e),f=(0,r.readInt32)(e),p=(0,r.readUnicodeString)(e),m=(0,r.readUnicodeString)(e),h=(0,r.readUnicodeString)(e),g=(0,r.readUnicodeString)(e),_=!!(0,r.readUint8)(e),v=(0,r.readUnicodeString)(e),y=L(de,(0,r.readUint32)(e)),b=L(de,(0,r.readUint32)(e)),x=(0,r.readUint8)(e),S=(0,r.readUint8)(e),C=(0,r.readUint8)(e),w=(0,r.readUint8)(e),T=x+S+C+w===0?`none`:x===0?`matte`:`color`;d.push({id:t,groupId:n,origin:i,associatedLayerId:a,name:o,target:m,message:h,altTag:g,cellTextIsHTML:_,cellText:v,horizontalAlignment:y,verticalAlignment:b,type:s,url:p,bounds:{top:l,left:c,bottom:f,right:u},backgroundColorType:T,backgroundColor:{r:S,g:C,b:w,a:x}})}if(n()){let t=(0,s.readVersionAndDescriptor)(e),n=new Map;for(let e of d)n.has(e.id)||n.set(e.id,e);t.slices.forEach(e=>{let t=n.get(e.sliceID);t&&(t.topOutset=e.topOutset,t.leftOutset=e.leftOutset,t.bottomOutset=e.bottomOutset,t.rightOutset=e.rightOutset)})}}else if(i===7||i===8){let n=(0,s.readVersionAndDescriptor)(e);t.slices||=[],t.slices.push({groupName:n.baseName??``,bounds:ce(n.bounds),slices:n.slices.map(e=>Object.assign(Object.assign({},e[`Nm `]?{name:e[`Nm `]}:{}),{id:e.sliceID,groupId:e.groupID,associatedLayerId:e.associatedLayer??0,origin:s.ESliceOrigin.decode(e.origin),type:s.ESliceType.decode(e.Type),bounds:ce(e.bounds),url:e.url,target:e.null,message:e.Msge,altTag:e.altTag,cellTextIsHTML:e.cellTextIsHTML,cellText:e.cellText,horizontalAlignment:s.ESliceHorzAlign.decode(e.horzAlign),verticalAlignment:s.ESliceVertAlign.decode(e.vertAlign),backgroundColorType:s.ESliceBGColorType.decode(e.bgColorType),backgroundColor:e.bgColor?{r:e.bgColor[`Rd `],g:e.bgColor[`Grn `],b:e.bgColor[`Bl `],a:e.bgColor.alpha}:{r:0,g:0,b:0,a:0},topOutset:e.topOutset||0,leftOutset:e.leftOutset||0,bottomOutset:e.bottomOutset||0,rightOutset:e.rightOutset||0}))})}else throw Error(`Invalid slices version (${i})`)},(e,t,n)=>{let{bounds:r,groupName:a,slices:o}=t.slices[n];(0,i.writeUint32)(e,6),(0,i.writeInt32)(e,r.top),(0,i.writeInt32)(e,r.left),(0,i.writeInt32)(e,r.bottom),(0,i.writeInt32)(e,r.right),(0,i.writeUnicodeString)(e,a),(0,i.writeUint32)(e,o.length);for(let t=0;t<o.length;t++){let n=o[t],{a:r,r:a,g:s,b:c}=n.backgroundColor;n.backgroundColorType===`none`?r=a=s=c=0:n.backgroundColorType===`matte`&&(r=0,a=s=c=255),(0,i.writeUint32)(e,n.id),(0,i.writeUint32)(e,n.groupId),(0,i.writeUint32)(e,le.indexOf(n.origin)),n.origin===`layer`&&(0,i.writeUint32)(e,n.associatedLayerId),(0,i.writeUnicodeString)(e,n.name||``),(0,i.writeUint32)(e,ue.indexOf(n.type)),(0,i.writeInt32)(e,n.bounds.left),(0,i.writeInt32)(e,n.bounds.top),(0,i.writeInt32)(e,n.bounds.right),(0,i.writeInt32)(e,n.bounds.bottom),(0,i.writeUnicodeString)(e,n.url),(0,i.writeUnicodeString)(e,n.target),(0,i.writeUnicodeString)(e,n.message),(0,i.writeUnicodeString)(e,n.altTag),(0,i.writeUint8)(e,+!!n.cellTextIsHTML),(0,i.writeUnicodeString)(e,n.cellText),(0,i.writeUint32)(e,de.indexOf(n.horizontalAlignment)),(0,i.writeUint32)(e,de.indexOf(n.verticalAlignment)),(0,i.writeUint8)(e,r),(0,i.writeUint8)(e,a),(0,i.writeUint8)(e,s),(0,i.writeUint8)(e,c)}let c={bounds:se(r),slices:[]};o.forEach(e=>{let t=Object.assign(Object.assign({sliceID:e.id,groupID:e.groupId,origin:s.ESliceOrigin.encode(e.origin),Type:s.ESliceType.encode(e.type),bounds:se(e.bounds)},e.name?{"Nm ":e.name}:{}),{url:e.url,null:e.target,Msge:e.message,altTag:e.altTag,cellTextIsHTML:e.cellTextIsHTML,cellText:e.cellText,horzAlign:s.ESliceHorzAlign.encode(e.horizontalAlignment),vertAlign:s.ESliceVertAlign.encode(e.verticalAlignment),bgColorType:s.ESliceBGColorType.encode(e.backgroundColorType)});if(e.backgroundColorType===`color`){let{r:n,g:r,b:i,a}=e.backgroundColor;t.bgColor={"Rd ":n,"Grn ":r,"Bl ":i,alpha:a}}t.topOutset=e.topOutset||0,t.leftOutset=e.leftOutset||0,t.bottomOutset=e.bottomOutset||0,t.rightOutset=e.rightOutset||0,c.slices.push(t)}),(0,s.writeVersionAndDescriptor)(e,``,`null`,c,`slices`)}),u(1064,e=>e.pixelAspectRatio!==void 0,(e,t)=>{if((0,r.readUint32)(e)>2)throw Error(`Invalid pixelAspectRatio version`);t.pixelAspectRatio={aspect:(0,r.readFloat64)(e)}},(e,t)=>{(0,i.writeUint32)(e,2),(0,i.writeFloat64)(e,t.pixelAspectRatio.aspect)}),u(1041,e=>e.iccUntaggedProfile!==void 0,(e,t)=>{t.iccUntaggedProfile=!!(0,r.readUint8)(e)},(e,t)=>{(0,i.writeUint8)(e,+!!t.iccUntaggedProfile)}),u(1039,e=>e.iccProfile!==void 0,(e,t,n)=>{t.iccProfile=(0,r.readBytes)(e,n())},(e,t)=>{(0,i.writeBytes)(e,t.iccProfile)}),u(1044,e=>e.idsSeedNumber!==void 0,(e,t)=>t.idsSeedNumber=(0,r.readUint32)(e),(e,t)=>(0,i.writeUint32)(e,t.idsSeedNumber)),u(1038,e=>e.colorSamplers!==void 0&&!e.colorSamplers.some(e=>e.depth!==void 0),(e,t,n)=>{let i=(0,r.readUint32)(e);if(i!==1)throw Error(`Invalid color samplers version: ${i}`);if(t.colorSamplers?.some(e=>e.depth!==void 0))return(0,r.skipBytes)(e,n());let a=(0,r.readUint32)(e);t.colorSamplers=[];for(let i=0;i<a&&n()>=10;i++){let n=(0,r.readInt32)(e)/16,i=(0,r.readInt32)(e)/16,a=(0,r.readInt16)(e);t.colorSamplers.push({x:i,y:n,colorSpace:a})}},(e,t)=>{(0,i.writeUint32)(e,1),(0,i.writeUint32)(e,t.colorSamplers.length);for(let n of t.colorSamplers)(0,i.writeInt32)(e,Math.round(n.y*16)),(0,i.writeInt32)(e,Math.round(n.x*16)),(0,i.writeInt16)(e,n.colorSpace)}),u(1073,e=>e.colorSamplers!==void 0&&e.colorSamplers.some(e=>e.depth!==void 0),(e,t,n)=>{let i=(0,r.readUint32)(e);if(i<1||i>3)throw Error(`Invalid color samplers version: ${i}`);let a=(0,r.readUint32)(e);t.colorSamplers=[];for(let o=0;o<a&&n()>=10;o++){let n=i===3?(0,r.readUint32)(e):i,a=n===1?(0,r.readInt32)(e)/16:(0,r.readFloat32)(e),o=n===1?(0,r.readInt32)(e)/16:(0,r.readFloat32)(e),s=(0,r.readInt16)(e),c=i>=2?(0,r.readInt16)(e):1;t.colorSamplers.push({x:o,y:a,colorSpace:s,depth:c})}},(e,t)=>{(0,i.writeUint32)(e,3),(0,i.writeUint32)(e,t.colorSamplers.length);for(let n of t.colorSamplers)(0,i.writeUint32)(e,1),(0,i.writeInt32)(e,Math.round(n.y*16)),(0,i.writeInt32)(e,Math.round(n.x*16)),(0,i.writeInt16)(e,n.colorSpace),(0,i.writeInt16)(e,n.depth??1)}),u(1022,e=>e.quickMaskInfo!==void 0,(e,t)=>{t.quickMaskInfo={channelId:(0,r.readUint16)(e),initiallyEmpty:!!(0,r.readUint8)(e)}},(e,t)=>{(0,i.writeUint16)(e,t.quickMaskInfo.channelId),(0,i.writeUint8)(e,+!!t.quickMaskInfo.initiallyEmpty)}),u(1074,e=>e.measurementScale!==void 0,(e,t,n)=>{t.measurementScale=(0,r.readBytes)(e,n())},(e,t)=>{(0,i.writeBytes)(e,t.measurementScale)}),u(1042,e=>e.effectsVisible!==void 0,(e,t)=>{t.effectsVisible=!!(0,r.readUint8)(e)},(e,t)=>{(0,i.writeUint8)(e,+!!t.effectsVisible)}),u(1036,e=>e.thumbnail!==void 0||e.thumbnailRaw!==void 0,(e,t,n)=>{let i=(0,r.readUint32)(e),o=(0,r.readUint32)(e),s=(0,r.readUint32)(e),c=(0,r.readUint32)(e);(0,r.readUint32)(e),(0,r.readUint32)(e);let l=(0,r.readUint16)(e);if((0,r.readUint16)(e),i===0&&l===24&&c>=o*3&&c*s<=n()){if(e.useRawThumbnail){e.logMissingFeatures&&e.log(`Raw thumbnail data is not supported with useRawThumbnail option`),(0,r.skipBytes)(e,n());return}let i=(0,r.readBytes)(e,c*s),l=(0,a.createImageData)(o,s);for(let e=0,t=0;e<s;e++)for(let n=0,r=e*c;n<o;n++,r+=3,t+=4)l.data[t+0]=i[r+0],l.data[t+1]=i[r+1],l.data[t+2]=i[r+2],l.data[t+3]=255;t.thumbnail=(0,a.imageDataToCanvas)(l),(0,r.skipBytes)(e,n());return}if(i!==1||l!==24){e.logMissingFeatures&&e.log(`Invalid thumbnail data (format: ${i}, bitsPerPixel: ${l})`),(0,r.skipBytes)(e,n());return}let u=n(),d=(0,r.readBytes)(e,u);e.useRawThumbnail?t.thumbnailRaw={width:o,height:s,data:d}:d.byteLength&&(t.thumbnail=(0,a.createCanvasFromData)(d,e))},(e,n)=>{let r=0,a=0,o=new Uint8Array;if(n.thumbnailRaw)r=n.thumbnailRaw.width,a=n.thumbnailRaw.height,o=n.thumbnailRaw.data;else try{let e=n.thumbnail.toDataURL(`image/jpeg`,1)?.substring(23);e&&(o=(0,t.toByteArray)(e),r=n.thumbnail.width,a=n.thumbnail.height)}catch{}let s=Math.floor((r*24+31)/32)*4,c=s*a*1,l=o.length;(0,i.writeUint32)(e,1),(0,i.writeUint32)(e,r),(0,i.writeUint32)(e,a),(0,i.writeUint32)(e,s),(0,i.writeUint32)(e,c),(0,i.writeUint32)(e,l),(0,i.writeUint16)(e,24),(0,i.writeUint16)(e,1),(0,i.writeBytes)(e,o)}),u(1057,e=>e.versionInfo!==void 0,(e,t,n)=>{if((0,r.readUint32)(e)!==1)throw Error(`Invalid versionInfo version`);t.versionInfo={hasRealMergedData:!!(0,r.readUint8)(e),writerName:(0,r.readUnicodeString)(e),readerName:(0,r.readUnicodeString)(e),fileVersion:(0,r.readUint32)(e)},(0,r.skipBytes)(e,n())},(e,t)=>{let n=t.versionInfo;(0,i.writeUint32)(e,1),(0,i.writeUint8)(e,+!!n.hasRealMergedData),(0,i.writeUnicodeString)(e,n.writerName),(0,i.writeUnicodeString)(e,n.readerName),(0,i.writeUint32)(e,n.fileVersion)}),u(1058,e=>e.exifData!==void 0,(e,t,n)=>{t.exifData=(0,r.readBytes)(e,n())},(e,t)=>{(0,i.writeBytes)(e,t.exifData)}),u(7e3,e=>e.imageReadyVariables!==void 0,(e,t,n)=>{t.imageReadyVariables=_(e,n())},(e,t)=>{S(e,t.imageReadyVariables)}),u(7001,e=>e.imageReadyDataSets!==void 0,(e,t,n)=>{t.imageReadyDataSets=_(e,n())},(e,t)=>{S(e,t.imageReadyDataSets)}),u(1088,e=>e.pathSelectionState!==void 0,(e,t,n)=>{t.pathSelectionState=(0,s.readVersionAndDescriptor)(e).null},(e,t)=>{let n={null:(0,s.pathSelectionStateToReference)(t.pathSelectionState)};(0,s.writeVersionAndDescriptor)(e,``,`null`,n)}),u(1025,e=>e.workPath!==void 0,(e,t,i,{width:a,height:o})=>{t.workPath={paths:[]},(0,n.readVectorMask)(e,t.workPath,a,o,i()),(0,r.skipBytes)(e,i())},(e,t,r,{width:i,height:a})=>{(0,n.writeVectorMask)(e,t.workPath,i,a)});var fe=999;u(2e3,e=>e.savedPaths?Math.min(e.savedPaths.length,fe):0,(e,t,i,{signature:a,id:o,name:s,width:c,height:l})=>{if(a!==`8BIM`){e.logMissingFeatures&&e.log(`Unhandled image resource: ${a} ${o}`),(0,r.skipBytes)(e,i());return}let u=t.savedPaths??=[],d={name:T(e,s),paths:[]};(0,n.readVectorMask)(e,d,c,l,i()),(0,r.skipBytes)(e,i());let f=t.savedPathsOrigination?.[u.length];f&&(d.vectorOrigination={keyDescriptorList:f}),u.push(d)},(e,t,r,{width:i,height:a})=>{(0,n.writeVectorMask)(e,t.savedPaths[r],i,a)},{keyCount:fe,name:(e,t)=>E(e.savedPaths[t].name)}),u(3e3,e=>!!e.savedPaths?.some(e=>e.vectorOrigination),(e,t,i)=>{(0,s.readVersionAndDescriptor)(e).keyRootDescriptorList.forEach((e,r)=>{let i=(0,n.parseKeyDescriptorList)(e);if(!i.length)return;let a=t.savedPaths?.[r];a?a.vectorOrigination={keyDescriptorList:i}:(t.savedPathsOrigination??=[])[r]=i}),(0,r.skipBytes)(e,i())},(e,t)=>{let r={keyRootDescriptorList:t.savedPaths.slice(0,fe).map(e=>(0,n.serializeKeyDescriptorList)(e.vectorOrigination?.keyDescriptorList??[]))};(0,s.writeVersionAndDescriptor)(e,``,`null`,r)},{name:()=>`OriginDataIRB`}),u(2999,e=>e.clippingPath!==void 0,(e,t,n)=>{let i=w(e),a=(0,r.readFixedPoint32)(e);(0,r.skipBytes)(e,n()),t.clippingPath={name:i,flatness:a}},(e,t)=>{D(e,t.clippingPath.name),(0,i.writeFixedPoint32)(e,t.clippingPath.flatness),(0,i.writeUint16)(e,1)});var pe=(0,a.createEnum)(`FrmD`,`auto`,{auto:`Auto`,none:`None`,dispose:`Disp`});function R(e){let t=[];return e.outputSettings!==void 0&&t.push(`mset`),e.animations!==void 0&&t.push(`mani`,`mfri`),t}u(4e3,e=>R(e).length,(e,t,n)=>{let i=(0,r.readSignature)(e);if(i===`mset`)t.outputSettings=(0,s.readVersionAndDescriptor)(e,!0),(0,r.skipBytes)(e,n());else if(i===`mfri`)(0,r.skipBytes)(e,n());else if(i===`mani`)(0,r.checkSignature)(e,`IRFR`),(0,r.readSection)(e,1,n=>{for(;n()>0;){(0,r.checkSignature)(e,`8BIM`);let n=(0,r.readSignature)(e);(0,r.readSection)(e,1,i=>{if(n===`AnDs`){let n=(0,s.readVersionAndDescriptor)(e);t.animations={frames:n.FrIn.map(e=>{let t={id:e.FrID,delay:(e.FrDl||0)/100,dispose:e.FrDs?pe.decode(e.FrDs):`auto`};return e.FrGA!==void 0&&(t.globalAngle=e.FrGA),e.FrGL!==void 0&&(t.globalAltitude=e.FrGL),t}),animations:n.FSts.map(e=>({id:e.FsID,frames:e.FsFr,repeats:e.LCnt,activeFrame:e.AFrm||0}))},n.AFSt!==void 0&&(t.animations.activeAnimation=n.AFSt),(0,r.skipBytes)(e,i())}else if(n===`Roll`){let t=(0,r.readBytes)(e,i());e.logDevFeatures&&e.log(`#4000 Roll`,t)}else e.logMissingFeatures&&e.log(`Unhandled subsection in #4000`,n),(0,r.skipBytes)(e,i())})}}),(0,r.skipBytes)(e,n());else if(i===`mopt`){let t=(0,r.readBytes)(e,n());e.logDevFeatures&&e.log(`#4000 mopt`,t)}else e.logMissingFeatures&&e.log(`Unhandled plug-in resource key: ${i}`),(0,r.skipBytes)(e,n())},(e,t,n)=>{let r=R(t)[n];if(r===`mset`)(0,i.writeSignature)(e,`mset`),(0,s.writeVersionAndDescriptor)(e,``,`null`,t.outputSettings,s.outputSettingsRoot);else if(r===`mfri`){let n=t.animations;(0,i.writeSignature)(e,`mfri`),(0,i.writeUint32)(e,2),(0,i.writeUint32)(e,16),(0,i.writeUint32)(e,n.frames.length),(0,i.writeUint32)(e,n.animations[0]?.activeFrame??0),(0,i.writeUint32)(e,n.animations.length),(0,i.writeUint32)(e,0)}else r===`mani`&&((0,i.writeSignature)(e,`mani`),(0,i.writeSignature)(e,`IRFR`),(0,i.writeSection)(e,1,()=>{(0,i.writeSignature)(e,`8BIM`),(0,i.writeSignature)(e,`AnDs`),(0,i.writeSection)(e,1,()=>{let n=Object.assign(Object.assign({},t.animations.activeAnimation===void 0?{}:{AFSt:t.animations.activeAnimation}),{FrIn:[],FSts:[]});for(let e=0;e<t.animations.frames.length;e++){let r=t.animations.frames[e],i={FrID:r.id};r.delay&&(i.FrDl=Math.round(r.delay*100)),i.FrDs=pe.encode(r.dispose),r.globalAngle!==void 0&&(i.FrGA=r.globalAngle),r.globalAltitude!==void 0&&(i.FrGL=r.globalAltitude),n.FrIn.push(i)}for(let e=0;e<t.animations.animations.length;e++){let r=t.animations.animations[e],i={FsID:r.id,AFrm:r.activeFrame|0,FsFr:r.frames,LCnt:r.repeats|0};n.FSts.push(i)}(0,s.writeVersionAndDescriptor)(e,``,`null`,n)}),(0,i.writeSignature)(e,`8BIM`),(0,i.writeSignature)(e,`Roll`),(0,i.writeSection)(e,1,()=>{(0,i.writeZeros)(e,8)})}))},{keyCount:1e3})})),C=e((e=>{var t=e&&e.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};Object.defineProperty(e,"__esModule",{value:!0}),e.supportedColorModes=void 0,e.getUtf8Decoder=u,e.getUtf8StrictDecoder=d,e.getGbkStrictDecoder=f,e.decodeUtf8=p,e.createReader=m,e.warnOrThrow=h,e.readUint8=_,e.peekUint8=y,e.readInt16=x,e.readUint16=C,e.readUint16LE=w,e.readInt32=T,e.readInt32LE=E,e.readUint32=D,e.readFloat32=k,e.readFloat64=A,e.readFixedPoint32=j,e.readFixedPointPath32=M,e.readBytes=N,e.readSignature=P,e.validSignatureAt=ee,e.readPascalString=F,e.readUnicodeString=I,e.readUnicodeStringWithLength=oe,e.readUnicodeStringWithLengthLE=se,e.readAsciiString=ce,e.skipBytes=L,e.checkSignature=le,e.readPsd=fe,e.readLayerInfo=pe,e.getCompositeImageData=ye,e.getCompositeCanvas=W,e.getLayerImageData=G,e.getLayerMaskImageData=be,e.getLayerRealMaskImageData=xe,e.getLayerCanvas=K,e.getLayerMaskCanvas=q,e.getLayerRealMaskCanvas=Se,e.getFilterEffectsMaskImageData=Ce,e.getFilterEffectsMaskExtraImageData=J,e.getFilterEffectsMaskCanvas=we,e.getFilterEffectsMaskExtraCanvas=Y,e.decodeLayerPixels=Ee,e.readGlobalLayerMaskInfo=ke,e.readAdditionalLayerInfo=Ne,e.readDataZip=Je,e.readDataRLE=$e,e.readSection=et,e.readColor=tt,e.readPatternSafe=rt,e.readPattern=it,e.consumeMemory=st;var n=g(),r=v(),i=O(),a=b(),o=S();e.supportedColorModes=[0,1,3,2,4];var s=[`bitmap`,`grayscale`,`indexed`,`RGB`,`CMYK`,``,``,`multichannel`,`duotone`,`lab`];function c(e){let t=e.width*e.height*4;for(let n=0;n<t;n+=4){let t=e.data[n];e.data[n+1]=t,e.data[n+2]=t}}function l(e,t){try{return typeof TextDecoder<`u`?new TextDecoder(e,t):null}catch{return null}}function u(e){return e.utf8Decoder===void 0&&(e.utf8Decoder=l(`utf-8`,{ignoreBOM:!0})),e.utf8Decoder}function d(e){return e.utf8StrictDecoder===void 0&&(e.utf8StrictDecoder=l(`utf-8`,{ignoreBOM:!0,fatal:!0})),e.utf8StrictDecoder}function f(e){return e.gbkDecoder===void 0&&(e.gbkDecoder=l(`gbk`,{fatal:!0})),e.gbkDecoder}function p(e,t){let n=t.byteLength>1e3?u(e):null;return n?n.decode(t):(0,a.decodeString)(t)}function m(e,t,n){return{view:new DataView(e,t,n),offset:0,strict:!1,debug:!1,large:!1,globalAlpha:!1,log:console.log}}function h(e,t){if(e.strict)throw Error(t);e.debug&&e.log(t)}function _(e){return e.offset+=1,e.view.getUint8(e.offset-1)}function y(e){return e.view.getUint8(e.offset)}function x(e){return e.offset+=2,e.view.getInt16(e.offset-2,!1)}function C(e){return e.offset+=2,e.view.getUint16(e.offset-2,!1)}function w(e){return e.offset+=2,e.view.getUint16(e.offset-2,!0)}function T(e){return e.offset+=4,e.view.getInt32(e.offset-4,!1)}function E(e){return e.offset+=4,e.view.getInt32(e.offset-4,!0)}function D(e){return e.offset+=4,e.view.getUint32(e.offset-4,!1)}function k(e){return e.offset+=4,e.view.getFloat32(e.offset-4,!1)}function A(e){return e.offset+=8,e.view.getFloat64(e.offset-8,!1)}function j(e){return T(e)/65536}function M(e){return T(e)/(1<<24)}function N(e,t){if(!(t>=0))throw Error(`Invalid length: ${t}`);let n=e.offset,r=e.view.byteLength;if(e.offset+=t,n+t>r){if(h(e,`Reading bytes exceeding buffer length`),t>104857600)throw Error(`Reading past end of file`);st(e,t);let i=new Uint8Array(t),a=Math.min(t,r-n);return a>0&&i.set(new Uint8Array(e.view.buffer,e.view.byteOffset+n,a)),i}return new Uint8Array(e.view.buffer,e.view.byteOffset+n,t)}function P(e){return ue(e,4)}function ee(e,t){let n=String.fromCharCode(e.view.getUint8(t))+String.fromCharCode(e.view.getUint8(t+1))+String.fromCharCode(e.view.getUint8(t+2))+String.fromCharCode(e.view.getUint8(t+3));return n==`8BIM`||n==`8B64`}function F(e,t){let n=_(e),r=n?ue(e,n):``;for(;++n%t;)e.offset++;return r}function I(e){return oe(e,D(e))}var te=8192,ne=64;function re(e,t){if(e.offset<0||e.offset+t>e.view.byteLength)throw RangeError(`Offset is outside the bounds of the DataView`)}function ie(e,t,n){if(!(t>0))return``;re(e,t*2);let r=e.view,i=e.offset,a=``;if(t<=ne){for(let e=0;e<t;e++,i+=2)a+=String.fromCharCode(r.getUint16(i,n));return e.offset=i,a.charCodeAt(a.length-1)===0&&(a=a.substring(0,a.length-1)),a}let o=new Uint16Array(Math.min(t,te));for(let e=0;e<t;e+=te){let s=Math.min(te,t-e);for(let e=0;e<s;e++,i+=2)o[e]=r.getUint16(i,n);a+=String.fromCharCode.apply(null,s===o.length?o:o.subarray(0,s))}return e.offset=i,a.charCodeAt(a.length-1)===0&&(a=a.substring(0,a.length-1)),a}function ae(e){let t=``;for(let n=0;n<e.length;n+=te)t+=String.fromCharCode.apply(null,e.subarray(n,n+te));return t}function oe(e,t){return ie(e,t,!1)}function se(e,t){return ie(e,t,!0)}function ce(e,t){if(!(t>0))return``;if(re(e,t),t<=ne){let n=e.view,r=``;for(let i=0,a=e.offset;i<t;i++,a++)r+=String.fromCharCode(n.getUint8(a));return e.offset+=t,r}let n=ae(new Uint8Array(e.view.buffer,e.view.byteOffset+e.offset,t));return e.offset+=t,n}function L(e,t){e.offset+=t}function le(e,t,n){let r=e.offset,i=P(e);if(i!==t&&i!==n)throw Error(`Invalid signature: '${i}' at 0x${r.toString(16)}`)}function ue(e,t){let n=N(e,t);if(t>ne)return ae(n);let r=``;for(let e=0;e<n.length;e++)r+=String.fromCharCode(n[e]);return r}function de(e){return e===`8BIM`||e===`MeSa`||e===`AgHg`||e===`PHUT`||e===`DCSR`}function fe(n,i={}){le(n,`8BPS`);let a=C(n);if(a!==1&&a!==2)throw Error(`Invalid PSD file version: ${a}`);L(n,6);let c=C(n),l=D(n),u=D(n),d=C(n),f=C(n),p=a===1?3e4:3e5;if(u>p||l>p)throw Error(`Invalid size: ${u}x${l}`);if(c<1||c>57)throw Error(`Invalid channel count: ${c}`);if(![1,8,16,32].includes(d))throw Error(`Invalid bitsPerChannel: ${d}`);if(e.supportedColorModes.indexOf(f)===-1)throw Error(`Color mode not supported: ${s[f]??f}`);let m={width:u,height:l,channels:c,bitsPerChannel:d,colorMode:f};Object.assign(n,i),n.large=a===2,n.globalAlpha=!1,n.layersInGlobalInfo=!1;let h=n.imageResourcesWhitelist;n.imageResourcesWhitelistSet=h?h instanceof Set?h:new Set(h):void 0,`totalMemoryLimit`in n||(n.totalMemoryLimit=2147483648),et(n,1,e=>{if(e()){if(f===2){if(e()!=768)throw Error(`Invalid color palette size`);m.palette=[];for(let e=0;e<256;e++)m.palette.push({r:_(n),g:0,b:0});for(let e=0;e<256;e++)m.palette[e].g=_(n);for(let e=0;e<256;e++)m.palette[e].b=_(n)}L(n,e())}});let g={},v=0;et(n,1,e=>{for(;e()>=12;){let e=je(n,de),t=C(n),r=_(n),i=N(n,r);L(n,(r+1)%2),et(n,2,r=>{let a=o.resourceHandlersMap[t];if(a){if(t===1036&&n.skipThumbnail||!(0,o.shouldReadResource)(a,n.imageResourcesWhitelistSet))L(n,r());else try{a.read(n,g,r,{signature:e,id:t,name:i,width:u,height:l})}catch(e){if(n.throwForMissingFeatures)throw e;L(n,r())}}else n.logMissingFeatures&&n.log(`Unhandled image resource: ${t} (${r()})`),L(n,r())})}v=e(),L(n,e())}),v&&!me(n,n.offset)&&me(n,n.offset-v)&&(n.offset-=v);let{layersGroup:b,layerGroupsEnabledId:x,savedPathsOrigination:S}=g,w=t(g,[`layersGroup`,`layerGroupsEnabledId`,`savedPathsOrigination`]);Object.keys(w).length&&(m.imageResources=w),et(n,1,e=>{if(et(n,2,e=>{pe(n,m,g),L(n,e())},void 0,n.large),e()>0){let e=ke(n);e&&(m.globalLayerMaskInfo=e)}else L(n,e());for(;e()>0;){for(;e()&&y(n)===0;)L(n,1);e()>=12?Ne(n,m,m,g):L(n,e())}},void 0,n.large);let T=m.children&&m.children.length;if(!(n.skipCompositeImageData&&(n.skipLayerImageData||T))){if(n.useRawData){let e=Math.min(n.offset,n.view.byteLength);m.rawCompositeData=new Uint8Array(n.view.buffer,n.view.byteOffset+e,n.view.byteLength-e),m.rawCompositeDataInfo={large:n.large,globalAlpha:n.globalAlpha},n.layersInGlobalInfo&&(m.rawCompositeDataInfo.layersInGlobalInfo=!0)}else{let e=Fe(n,m);n.useImageData?m.imageData=e:m.canvas=(0,r.imageDataToCanvas)(e)}}return m}function pe(e,t,n){let{layersGroup:i=[],layerGroupsEnabledId:a=[]}=n,o=x(e);o<0&&(e.globalAlpha=!0,o=-o);let s=[],c=[];for(let r=0;r<o;r++){let{layer:o,channels:l}=R(e,t,n);i[r]!==void 0&&(o.linkGroup=i[r]),a[r]!==void 0&&(o.linkGroupEnabled=!!a[r]),s.push(o),c.push(l)}for(let n=0;n<o;n++)U(e,t,s[n],c[n]);t.children||=[];let l=[t];for(let e=s.length-1;e>=0;e--){let t=s[e],n=t.sectionDivider?t.sectionDivider.type:0;n===1||n===2?(t.opened=n===1,t.children=[],delete t.canvas,delete t.imageData,t.sectionDivider?.key&&(t.blendMode=r.toBlendMode[t.sectionDivider.key]??t.blendMode),l[l.length-1].children.unshift(t),l.push(t)):n===3?l.length>1&&l.pop():l[l.length-1].children.unshift(t)}}function R(e,t,n){let i={};if(i.top=T(e),i.left=T(e),i.bottom=T(e),i.right=T(e),!z(i,e))throw Error(`Invalid layer size`);let a=C(e),o=[];for(let t=0;t<a;t++){let t=x(e),n=D(e);if(e.large){if(n!==0)throw Error(`Sizes larger than 4GB are not supported`);n=D(e)}o.push({id:t,length:n})}le(e,`8BIM`);let s=P(e);if(!r.toBlendMode[s]){if(e.throwForMissingFeatures)throw Error(`Invalid blend mode: '${s}'`);e.logMissingFeatures&&e.log(`Unknown blend mode: '${s}', using normal blend mode`)}i.blendMode=r.toBlendMode[s]||`normal`,i.opacity=_(e)/255,i.clipping=_(e)===1;let c=_(e);return i.transparencyProtected=!!(c&1),i.hidden=!!(c&2),c&32&&(i.effectsOpen=!0),L(e,1),et(e,1,r=>{he(e,i);let a=_e(e);for(a&&(i.blendingRanges=a),i.name=F(e,1);r()>4&&!ee(e,e.offset);)e.offset++;for(;r()>=12;)Ne(e,i,t,n);L(e,r())}),{layer:i,channels:o}}function me(e,t){let n=e.large?8:4;if(t<0||t+n>e.view.byteLength)return!1;let r=e.large?e.view.getUint32(t)*4294967296+e.view.getUint32(t+4):e.view.getUint32(t);return t+n+r<=e.view.byteLength}function z(e,t){let n=(e.right||0)-(e.left||0),r=(e.bottom||0)-(e.top||0),i=t.large?3e5:3e4;return n<=i&&r<=i}function he(e,t){return et(e,1,n=>{if(!n())return;let r={};if(t.mask=r,r.top=T(e),r.left=T(e),r.bottom=T(e),r.right=T(e),!z(r,e))throw Error(`Invalid mask size`);r.defaultColor=_(e);let i=_(e);if(r.positionRelativeToLayer=!!(i&1),r.disabled=!!(i&2),r.fromVectorData=!!(i&8),V(e,i,n())){let n={};t.realMask=n;let r=_(e);if(n.positionRelativeToLayer=!!(r&1),n.disabled=!!(r&2),n.fromVectorData=!!(r&8),n.defaultColor=_(e),n.top=T(e),n.left=T(e),n.bottom=T(e),n.right=T(e),!z(n,e))throw Error(`Invalid realMask size`)}if(i&16){let t=_(e);t&1&&(r.userMaskDensity=_(e)/255),t&2&&(r.userMaskFeather=A(e)),t&4&&(r.vectorMaskDensity=_(e)/255),t&8&&(r.vectorMaskFeather=A(e))}L(e,n())})}function ge(e){return 1+(e&1?1:0)+(e&2?8:0)+(e&4?1:0)+(e&8?8:0)}function B(e,t,n){if(n<1)return!1;let r=e.getUint8(t);if(r===0||r&-16)return!1;let i=ge(r);if(n<i||n-i>3)return!1;for(let r=i;r<n;r++)if(e.getUint8(t+r)!==0)return!1;return!0}function V(e,t,n){if(n<18)return!1;if(!(t&16))return!0;let{view:r,offset:i}=e;return B(r,i,n)?!1:B(r,i+18,n-18)?!0:n===18||n-18>=ge(r.getUint8(i+18))}function H(e){return[_(e),_(e),_(e),_(e)]}function _e(e){return et(e,1,t=>{let n=H(e),r=H(e),i=[];for(;t()>0;){let t=H(e),n=H(e);i.push({sourceRange:t,destRange:n})}return{compositeGrayBlendSource:n,compositeGraphBlendDestinationRange:r,ranges:i}})}function U(e,t,n,r){if(e.skipLayerImageData)return;let{colorMode:i=3,bitsPerChannel:a=8}=t;n.rawData={colorMode:i,bitsPerChannel:a,channels:[],large:e.large};for(let t of r){let r=e.offset,i=0,a;if(t.length>=2){if(i=C(e),i>3&&(--e.offset,i=C(e)),i>3&&(e.offset-=4,i=C(e)),i>3)throw Error(`Invalid compression: ${i}`);t.length>2&&(a=N(e,t.length-2))}e.offset=r+t.length,n.rawData.channels.push({id:t.id,compression:i,data:a})}if(!e.useRawData)try{Q(n,e)}catch(t){if(e.throwForMissingFeatures||t.message===`Exceeded memory limit`)throw t;e.logMissingFeatures&&e.log(`Failed to decode layer image data: ${t.message}`),delete n.rawData}}function ve({data:e},t){let n=e instanceof Float32Array?1:e instanceof Uint16Array?65535:255,r=(t?4:3)|0,i=e.length|0,a=(t?5:4)|0;for(let t=r;t<i;t=t+a|0)e[t]=n}function ye(e){let t=e.rawCompositeData;if(!t)return;let n=m(t.buffer,t.byteOffset,t.byteLength),r=e.rawCompositeDataInfo;return r&&(n.large=r.large,n.globalAlpha=r.globalAlpha,n.layersInGlobalInfo=!!r.layersInGlobalInfo),Fe(n,e)}function W(e){return Te(ye(e))}function G(e){return De(e,$.Layer,!1,void 0)}function be(e){return De(e,$.Mask,!1,void 0)}function xe(e){return De(e,$.RealMask,!1,void 0)}function K(e){return Te(G(e))}function q(e){return Te(be(e))}function Se(e){return Te(xe(e))}function Ce(e){let{depth:t,channels:n,colorMode:r=3}=e,i=Math.max(0,e.right-e.left),a=Math.max(0,e.bottom-e.top);if(!i||!a)return;let o=r===4;if(o&&t!==8&&t!==16)throw Error(`bitsPerChannel not supported`);let s=o?5:4,l=n.length-1,u=Math.min(o?4:r===1?1:3,n.length-2),d=Pe(i,a,t,s,void 0);for(let e=0;e<n.length;e++){let r=n[e];r&&(e<u?X(r,d,i,a,t,e,s):e===l&&X(r,d,i,a,t,s-1,s))}if(r===1&&c(d),n[l]||ve(d,o),o){let e=d;d=Pe(e.width,e.height,t,4,void 0),Be(e,d,!1)}return d}function J(e){let{extra:t,depth:n}=e;if(!t)return;let r=Math.max(0,t.right-t.left),i=Math.max(0,t.bottom-t.top);if(!r||!i)return;let a=Pe(r,i,n,4,void 0);return X(t,a,r,i,n,0,4),c(a),ve(a,!1),a}function we(e){return Te(Ce(e))}function Y(e){return Te(J(e))}function X({compressionMode:e,data:t},n,r,i,a,o,s){Oe(m(t.buffer,t.byteOffset,t.byteLength),t.byteLength,n,e,r,i,a,o,!0,s)}function Te(e){return e&&(0,r.imageDataToCanvas)(e)}function Z(e,t,n){t&&(n?e.imageData=t:e.canvas=(0,r.imageDataToCanvas)(t))}function Ee(e,t){Q(e,{useImageData:t})}function Q(e,t){let{throwForMissingFeatures:n,useImageData:r}=t,i=De(e,$.Layer,n,t.totalMemoryLimit,t);if(Z(e,i,r),t.totalMemoryLimit!==void 0&&(t.totalMemoryLimit-=i?.data.byteLength??0),e.mask){let i=De(e,$.Mask,n,t.totalMemoryLimit,t);Z(e.mask,i,r),t.totalMemoryLimit!==void 0&&(t.totalMemoryLimit-=i?.data.byteLength??0)}if(e.realMask){let i=De(e,$.RealMask,n,t.totalMemoryLimit,t);Z(e.realMask,i,r),t.totalMemoryLimit!==void 0&&(t.totalMemoryLimit-=i?.data.byteLength??0)}delete e.rawData}var $;(function(e){e[e.Layer=0]=`Layer`,e[e.Mask=1]=`Mask`,e[e.RealMask=2]=`RealMask`})($||={});function De(e,t,n,i,a){if(!e.rawData)return;let{colorMode:o,bitsPerChannel:s,channels:l,large:u}=e.rawData,d=Math.max(0,(e.right||0)-(e.left||0)),f=Math.max(0,(e.bottom||0)-(e.top||0)),p=o===4,h,g,_=!1;if(d&&f&&t===$.Layer){if(p){if(s!==8&&s!==16)throw Error(`bitsPerChannel not supported`);h=Pe(d,f,s,5,i)}else h=Pe(d,f,s,4,i)}for(let{id:o,compression:v,data:y}of l){if(!y)continue;let l=m(y.buffer,y.byteOffset,y.byteLength);if(l.debug=!!a?.debug,a?.log&&(l.log=a.log),i!==void 0&&(l.totalMemoryLimit=Math.max(0,i-(h?.data.byteLength??0))),o===-2||o===-3){if(o===-2&&t!==$.Mask||o===-3&&t!==$.RealMask)continue;let n=o===-2?e.mask:e.realMask;if(!n)throw Error(`Missing layer ${o===-2?`mask`:`real mask`} data`);let r=Math.max(0,(n.right||0)-(n.left||0)),a=Math.max(0,(n.bottom||0)-(n.top||0));r&&a&&(g=Pe(r,a,s,4,i),i!==void 0&&(l.totalMemoryLimit=Math.max(0,l.totalMemoryLimit-g.data.byteLength)),Oe(l,y.byteLength,g,v,r,a,s,0,u,4),c(g),ve(g,!1))}else{if(t!==$.Layer)continue;let e=(0,r.offsetForChannel)(o,p),i=h;if(e<0&&(i=void 0,n))throw Error(`Channel not supported: ${o}`);Oe(l,y.byteLength,i,v,d,f,s,e,u,p?5:4)}o===-1&&(_=!0)}if(h&&(o===1&&c(h),_||ve(h,p),p)){let e=h,t=i===void 0?void 0:Math.max(0,i-e.data.byteLength);h=Pe(e.width,e.height,s,4,t),Be(e,h,!1)}return t===$.Layer?h:g}function Oe(e,t,n,r,i,a,o,s,c,l){if(t){if(r===0)t!==i*a*Math.floor(o/8)&&h(e,`Invalid length (${t}, ${i*a*Math.floor(o/8)})`),We(N(e,t),n,o,l,s);else if(r===1)$e(e,n,i,a,o,l,[s],c);else if(r===2)Je(N(e,t),n,i,a,o,l,s,!1,e);else if(r===3)Je(N(e,t),n,i,a,o,l,s,!0,e);else throw Error(`Invalid Compression type: ${r}`)}}function ke(e){return et(e,1,t=>{if(!t())return;let n=C(e),r=C(e),i=C(e),a=C(e),o=C(e),s=Math.min(C(e),100)/100,c=_(e);return L(e,t()),{overlayColorSpace:n,colorSpace1:r,colorSpace2:i,colorSpace3:a,colorSpace4:o,opacity:s,kind:c}})}var Ae=[0,1,-1,2,-2,3,-3,4,-4];function je(e,t){let n=e.offset,r=``;for(let i of Ae){try{e.offset=n+i,r=P(e)}catch{}if(t(r))break}if(!t(r))throw Error(`Invalid signature: '${r}' at 0x${n.toString(16)}`);return r}function Me(e){return e===`8BIM`||e===`8B64`}function Ne(e,t,n,a){let o=je(e,Me),s=P(e),c=o===`8B64`||e.large&&r.largeAdditionalInfoKeys.indexOf(s)!==-1;if(e.large&&o===`8BIM`&&r.largeAdditionalInfoKeysObserved.indexOf(s)!==-1){let t=e.offset+8<=e.view.byteLength?e.view.getUint32(e.offset+4):0,n=t===943868237||t===943863348;c=e.view.getUint32(e.offset)===0&&!n}et(e,2,r=>{let o=i.infoHandlersMap[s];o?o.read(e,t,r,n,a):(e.logMissingFeatures&&s!==`GenI`&&s!==`OCIO`&&s!==`CAI `&&e.log(`Unhandled additional info: ${s}`),L(e,r())),r()&&(e.logMissingFeatures&&e.log(`Unread ${r()} bytes left for additional info: ${s}`),L(e,r()))},!1,c)}function Pe(e,t,n,i,a){let o=e*t*i*Math.max(1,n/8);if(a!==void 0&&o>a)throw Error(`Exceeded memory limit`);if(n===1||n===8)return i===4?(0,r.createImageData)(e,t):{width:e,height:t,data:new Uint8ClampedArray(e*t*i)};if(n===16)return{width:e,height:t,data:new Uint16Array(e*t*i)};if(n===32)return{width:e,height:t,data:new Float32Array(e*t*i)};throw Error(`Invalid bitDepth (${n})`)}function Fe(t,n){let i=C(t),a=n.bitsPerChannel??8,{width:o,height:s}=n;if(e.supportedColorModes.indexOf(n.colorMode)===-1)throw Error(`Color mode not supported: ${n.colorMode}`);if(i!==0&&i!==1)throw Error(`Compression type not supported: ${i}`);let l=Pe(o,s,a,4,t.totalMemoryLimit);switch(t.totalMemoryLimit!==void 0&&(t.totalMemoryLimit-=l.data.byteLength),(0,r.resetImageData)(l),n.colorMode){case 0:{if(a!==1)throw Error(`Invalid bitsPerChannel for bitmap color mode`);let e=Math.ceil(o/8),n;i===0?n=N(t,e*s):(n=new Uint8Array(e*s),$e(t,{data:n,width:e,height:s},e,s,8,1,[0],t.large)),(0,r.decodeBitmap)(n,l.data,o,s);break}case 3:case 1:Le(t,i,l,a,4,Ie(t,n,n.colorMode===1?1:3,3)),n.colorMode===1&&c(l);break;case 2:{if(a!==8)throw Error(`bitsPerChannel not supported`);if(!n.palette)throw Error(`Missing color palette`);let e=Ie(t,n,1,-1),r={width:o,height:s,data:new Uint8Array(o*s)};Le(t,i,r,8,1,e),Ve(r,l,n.palette,n.imageResources?.transparencyIndex??-1);break}case 4:{if(a!==8&&a!==16)throw Error(`bitsPerChannel not supported`);let e=Ie(t,n,4,4),r=Pe(o,s,a,5,t.totalMemoryLimit);ve(r,!0),Le(t,i,r,a,5,e),Be(r,l,!!t.globalAlpha);break}default:throw Error(`Color mode not supported: ${n.colorMode}`)}return t.globalAlpha&&n.colorMode!==4&&Re(l),l}function Ie(e,t,n,r){let i=t.channels??n+ +!!e.globalAlpha;if(i<n)throw Error(`Invalid channel count: ${i}`);let a=t.imageResources?.alphaChannelNames??[],o=a.length,s=!!e.layersInGlobalInfo&&a[0]===`Transparency`&&o===i-n,c=e.globalAlpha||s||i-n>o,l=[];for(let e=0;e<i;e++)e<n?l.push(e):e===n&&c&&r>=0?l.push(r):l.push(-1);return l}function Le(e,t,n,r,i,a){if(t===0){let t=n.width*n.height*He(r);for(let o of a)o<0?L(e,t):We(N(e,t),n,r,i,o)}else if(t===1)$e(e,n,n.width,n.height,r,i,a,e.large);else throw Error(`Compression not supported: ${t}`)}function Re({data:e,width:t,height:n}){let r=t*n*4;if(e instanceof Float32Array)for(let t=0;t<r;t+=4){let n=e[t+3];if(n>0&&n<1){let r=1/n,i=1-r;for(let n=0;n<3;n++){let a=e[t+n]*r+i;e[t+n]=a<0?0:a}}}else if(e instanceof Uint16Array)for(let t=0;t<r;t+=4){let n=e[t+3];if(n!==0&&n!==65535){let r=65535/n,i=65535*(1-r);for(let n=0;n<3;n++){let a=Math.round(e[t+n]*r+i);e[t+n]=a<0?0:a>65535?65535:a}}}else for(let t=0;t<r;t+=4){let n=e[t+3];if(n!=0&&n!=255){let r=1/(n/255),i=255*(1-r);e[t+0]=e[t+0]*r+i,e[t+1]=e[t+1]*r+i,e[t+2]=e[t+2]*r+i}}}function ze(e,t){return e=Math.round(t/255*e),e<=0?0:e>=t?t:e}function Be(e,t,n){let i=t.width*t.height*4,a=e.data,o=t.data,s=a instanceof Uint16Array?65535:255,c=o instanceof Uint16Array?65535:255,l=[0,0,0];for(let e=0,t=0;t<i;e+=5,t+=4){let i=a[e+4],u=1-a[e]/s,d=1-a[e+1]/s,f=1-a[e+2]/s,p=1-a[e+3]/s;if(n&&i>0&&i<s){let e=s/i;u=Math.min(1,u*e),d=Math.min(1,d*e),f=Math.min(1,f*e),p=Math.min(1,p*e)}(0,r.cmykToRgbValues)(u,d,f,p,l),o[t]=ze(l[0],c),o[t+1]=ze(l[1],c),o[t+2]=ze(l[2],c),o[t+3]=s===c?i:Math.round(i*c/s)}}function Ve(e,t,n,r){let i=e.width*e.height,a=e.data,o=t.data;for(let e=0,t=0;e<i;e++,t+=4){let i=a[e],s=n[i];o[t+0]=s.r,o[t+1]=s.g,o[t+2]=s.b,o[t+3]=i===r?0:255}}function He(e){switch(e){case 1:case 8:return 1;case 16:return 2;case 32:return 4;default:throw Error(`Invalid bitDepth (${e})`)}}function Ue(e,t){if(e.BYTES_PER_ELEMENT!==t)throw Error(`Invalid array types`)}function We(e,t,n,r,i){let a=He(n);if(!t||i<0||i>=r)return;let o=t.data;Ue(o,a);let s=Math.min(t.width*t.height,Math.floor(e.byteLength/a))|0;if(a===1)for(let t=0,n=i|0;t<s;t++,n=n+r|0)o[n]=e[t];else if(a===2)for(let t=0,n=0,a=i|0;t<s;t++,n+=2,a=a+r|0)o[a]=e[n]<<8|e[n+1];else{let t=new DataView(e.buffer,e.byteOffset,e.byteLength);for(let e=0,n=0,a=i|0;e<s;e++,n+=4,a=a+r|0)o[a]=t.getFloat32(n,!1)}}function Ge(e,t,n){for(let r=0;r<n;r++){let n=r*t;for(let r=1,i=n+1;r<t;r++,i++)e[i]=e[i-1]+e[i]}}var Ke=Error(`Decompressed data exceeds expected size`);function qe(e,t,r,i=!1){let a=new Uint8Array(t),o=0,s=!1,c=new n.Inflate({chunkSize:Math.max(1024,Math.min(t,65536)),raw:i});c.onData=e=>{let n=e,r=Math.min(n.length,t-o);if(r>0&&a.set(r===n.length?n:n.subarray(0,r),o),o+=r,r<n.length)throw s=!0,Ke},c.onEnd=e=>{c.err=e,c.msg=c.strm?.msg||``};try{c.push(e,!0)}catch(e){if(e!==Ke)throw e}if(s)r&&h(r,Ke.message);else if(c.err&&c.msg===`incorrect data check`&&!i)return r&&h(r,`Invalid zip data: ${c.msg}`),qe(e.subarray(2),t,r,!0);else if(c.err)throw Error(`Invalid zip data: ${c.msg}`);return a}function Je(e,t,n,r,i,a,o,s,c){let l=He(i);if(!t||o<0||o>=a)return;let u=t.data;Ue(u,l);let d=n*r*l;c&&st(c,d);try{let t=qe(e,d,c);if(l===1)for(let e=0,i=0;e<r;e++){let r=0;for(let c=0,l=o+e*n*a;c<n;c++,i++,l+=a){let e=t[i];s&&(e=r=r+e&255),u[l]=e}}else if(l===2)for(let e=0,i=0;e<r;e++){let r=0;for(let c=0,l=o+e*n*a;c<n;c++,i+=2,l+=a){let e=t[i]<<8|t[i+1];s&&(e=r=r+e&65535),u[l]=e}}else{let e=new Uint32Array(u.buffer,u.byteOffset,u.length);if(s){Ge(t,n*4,r);for(let i=0,s=o;i<r;i++){let r=n*4*i;for(let i=0;i<n;i++,r++,s+=a){let i=r+n,a=i+n,o=a+n;e[s]=(t[r]<<24|t[i]<<16|t[a]<<8|t[o])>>>0}}}else{let i=new DataView(t.buffer,t.byteOffset,t.byteLength);for(let t=0,s=0,c=o,l=n*r;t<l;t++,s+=4,c+=a)e[c]=i.getUint32(s,!1)}}}finally{c&&ct(c,d)}}function Ye(e,t,n,r,i){let a=0;for(;t<n&&a<i;){let o=e[t++];if(o>128){if(t>=n)break;let s=e[t++],c=257-o;c>i-a&&(c=i-a),r.fill(s,a,a+c),a+=c}else if(o<128){let s=o+1;for(s>i-a&&(s=i-a),s>n-t&&(s=n-t);s>0;s--)r[a++]=e[t++]}}return a}function Xe(e,t,n,r,i,a,o,s,c){let l=e.length|0;for(let u=0;u<a;u++,n++){let a=(r<l?r:l)|0;r+=t[n];let d=(r<l?r:l)|0,f=s+u*i*c|0,p=0;for(;a<d&&p<i;){let t=e[a++]|0;if(t>128){if(a>=d)break;let n=e[a++]|0,r=257-t|0;r>i-p&&(r=i-p|0),p=p+r|0;for(let e=f+r*c|0;f<e;f=f+c|0)o[f]=n}else if(t<128){let n=t+1|0;n>i-p&&(n=i-p|0),n>d-a&&(n=d-a|0),p=p+n|0;for(let t=a+n|0;a<t;a=a+1|0,f=f+c|0)o[f]=e[a]}}}}function Ze(e,t,n,r,i,a){if(n===2)for(let n=0,o=0;n<t;n++,o+=2,i+=a)r[i]=e[o]<<8|e[o+1];else{let n=new DataView(e.buffer,e.byteOffset,e.byteLength);for(let e=0,o=0;e<t;e++,o+=4,i+=a)r[i]=n.getFloat32(o,!1)}}function Qe(e,t,n,r,i,a,o,s,c,l,u){let d=e.length,f=i*l;for(let p=0;p<a;p++,n++){let a=r<d?r:d;r+=t[n];let m=r<d?r:d;if(a>=m)continue;let h=Ye(e,a,m,u,f);Ze(u,Math.floor(h/l),l,o,s+p*i*c,c)}}function $e(e,t,n,r,i,a,o,s){let c=t&&t.data,l=o.length*r,u=l*(s?4:2),d=e.view.byteLength,f=He(i),p;st(e,u);try{if(e.offset+u>d)throw Error(`RLE row lengths exceed buffer length`);p=s?new Uint32Array(l):new Uint16Array(l);let t=0;if(s)for(let n=0;n<l;n++)t+=p[n]=D(e);else for(let n=0;n<l;n++)t+=p[n]=C(e);t>d-e.offset&&h(e,`RLE data exceeds buffer length`),c&&Ue(c,f)}catch(t){throw ct(e,u),t}let m=new Uint8Array(e.view.buffer,e.view.byteOffset,d),g=c&&f>1?new Uint8Array(n*f):void 0,_=e.offset;for(let e=0,t=0;e<o.length;e++,t+=r){let i=o[e]|0,s=_;for(let e=0;e<r;e++)_+=p[t+e];c&&i>=0&&i<a&&(f===1?Xe(m,p,t,s,n,r,c,i,a):Qe(m,p,t,s,n,r,c,i,a,f,g))}e.offset=_,ct(e,u)}function et(e,t,n,r=!0,i=!1){let a=D(e);if(i){if(a!==0)throw Error(`Sizes larger than 4GB are not supported`);a=D(e)}if(a<=0&&r)return;let o=e.offset+a;if(o>e.view.byteLength)throw Error(`Section exceeds file size`);let s=n(()=>o-e.offset);for(e.offset!==o&&(e.offset>o?h(e,`Exceeded section limits`):h(e,`Unread section data`));a%t;)a++,o++;return e.offset=o,s}function tt(e){switch(C(e)){case 0:{let t=C(e)/257,n=C(e)/257,r=C(e)/257;return L(e,2),{r:t,g:n,b:r}}case 1:{let t=C(e)/65535,n=C(e)/65535,r=C(e)/65535;return L(e,2),{h:t,s:n,b:r}}case 2:return{c:(65535-C(e))/257,m:(65535-C(e))/257,y:(65535-C(e))/257,k:(65535-C(e))/257};case 7:{let t=x(e)/1e4,n=x(e),i=x(e),a=(0,r.normalizeLabAB)(n,100),o=(0,r.normalizeLabAB)(i,100);return L(e,2),{l:t,a,b:o}}case 8:{let t=C(e)*255/1e4;return L(e,6),{k:t}}default:throw Error(`Invalid color space`)}}var nt=3e4;function rt(e){let t=e.view.getUint32(e.offset);for(;t%4;)t++;let n=e.offset+4+t;try{return it(e)}catch(t){if(e.throwForMissingFeatures)throw t;e.logMissingFeatures&&e.log(`Skipped pattern: ${t.message}`),e.offset=n;return}}function it(e){let t=D(e);for(;t%4;)t++;let n=e.offset+t,r=D(e);if(r!==1)throw Error(`Invalid pattern version: ${r}`);let i=D(e),a=x(e),o=x(e);if(i!==3&&i!==1&&i!==2&&i!==4)throw Error(`Unsupported pattern color mode: ${i}`);let s=I(e),c=F(e,1),l=[];if(i===2){for(let t=0;t<256;t++)l.push({r:_(e),g:_(e),b:_(e)});e.view.getUint32(e.offset)!==3&&L(e,4)}let u=D(e);if(u!==3)throw Error(`Invalid pattern VMAL version: ${u}`);D(e);let d=D(e),f=D(e),p=D(e),h=D(e),g=D(e),v=h-f,y=p-d;if(v<0||y<0)throw Error(`Invalid pattern bounds`);if(v>nt||y>nt)throw Error(`Pattern too large (${v}x${y})`);if(g>64)throw Error(`Invalid pattern channel count: ${g}`);if(v*y>(Math.min(n,e.view.byteLength)-e.offset)*64)throw Error(`Pattern data out of bounds`);let b=i===3?3:i===4?4:1,S=i===4,w=S?4:3,T=[],E=0;for(let t=0,r=0;t<g+2&&e.offset+4<=n;t++){if(!D(e))continue;let t=D(e);if(!t)continue;if(t<23)throw Error(`Invalid pattern channel length`);let n=D(e),i=D(e),a=D(e),o=D(e),s=D(e),c=C(e),l=_(e),u=N(e,t-23),m=c===8||c===16||c===32?c:n;if(m!==8&&m!==16&&m!==32)throw Error(`Unsupported pattern pixel depth: ${m}`);if(i<d||a<f||o>p||s>h||o<i||s<a)throw Error(`Pattern channel bounds outside of pattern bounds`);let g=r<b?r:r===b?w:-1;if(r++,g===-1)continue;let v=s-a,y=o-i,x=m/8*v,S=x*y;if(l===0){if(u.byteLength<S)throw Error(`Pattern channel data out of bounds`)}else if(l===1){if(S>u.byteLength*64)throw Error(`Pattern channel data out of bounds`);E=Math.max(E,S)}else throw Error(`Invalid pattern compression mode`);T.push({target:g,depth:m,compressionMode:l,cdata:u,ctop:i,cleft:a,w:v,h:y,rowBytes:x,channelSize:S})}let O=v*y*4,k=S?v*y*5:0;st(e,O+k+E),ct(e,O+k+E);let A=new Uint8Array(O);for(let e=3;e<A.byteLength;e+=4)A[e]=255;let j=S?new Uint8Array(k).fill(255):void 0;for(let{target:e,depth:t,compressionMode:n,cdata:r,ctop:a,cleft:o,w:s,h:c,rowBytes:u,channelSize:p}of T){let h=r;n===1&&(h=new Uint8Array(p),$e(m(r.buffer,r.byteOffset,r.byteLength),{data:h,width:u,height:c},u,c,8,1,[0],!1)),t!==8&&(h=at(h,s*c,t));let g=o-f,_=a-d;if(j)ot(h,j,s,c,(g+_*v)*5+e,v*5,5);else if(e===3||i===3)ot(h,A,s,c,(g+_*v)*4+e,v*4,4);else if(i===2){let e=new Uint8Array(768);for(let t=0;t<256;t++)e[t*3+0]=l[t].r,e[t*3+1]=l[t].g,e[t*3+2]=l[t].b;for(let t=0;t<c;t++)for(let n=0,r=t*s,i=(g+(t+_)*v)*4;n<s;n++,r++,i+=4){let t=h[r]*3;A[i+0]=e[t+0],A[i+1]=e[t+1],A[i+2]=e[t+2]}}else for(let e=0;e<c;e++)for(let t=0,n=e*s,r=(g+(e+_)*v)*4;t<s;t++,n++,r+=4){let e=h[n];A[r+0]=e,A[r+1]=e,A[r+2]=e}}return j&&Be({width:v,height:y,data:j},{width:v,height:y,data:A},!1),st(e,O),e.offset=n,{id:c,name:s,x:a,y:o,bounds:{x:f,y:d,w:v,h:y},data:A}}function at(e,t,n){let r=new Uint8Array(t);if(n===16)for(let n=0;n<t;n++)r[n]=Math.round((e[n*2]<<8|e[n*2+1])/257);else{let n=new DataView(e.buffer,e.byteOffset,e.byteLength);for(let e=0;e<t;e++){let t=n.getFloat32(e*4,!1);r[e]=t>0?t<1?Math.round(t*255):255:0}}return r}function ot(e,t,n,r,i,a,o){for(let s=0,c=0;s<r;s++)for(let r=0,l=i+s*a;r<n;r++,c++,l+=o)t[l]=e[c]}function st(e,t){if(!(t>=0))throw Error(`Invalid size`);if(e.totalMemoryLimit!==void 0){if(e.totalMemoryLimit<t)throw Error(`Exceeded memory limit`);e.totalMemoryLimit-=t}}function ct(e,t){e.totalMemoryLimit!==void 0&&(e.totalMemoryLimit+=t)}})),w=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.readEffects=l,e.writeEffects=d;var t=v(),n=C(),r=k(),i=[void 0,`outer bevel`,`inner bevel`,`emboss`,`pillow emboss`,`stroke emboss`];function a(e){return(0,n.checkSignature)(e,`8BIM`),t.toBlendMode[(0,n.readSignature)(e)]||`normal`}function o(e,n){(0,r.writeSignature)(e,`8BIM`),(0,r.writeSignature)(e,t.fromBlendMode[n]||`norm`)}function s(e){return(0,n.readUint8)(e)/255}function c(e,t){(0,r.writeUint8)(e,Math.round(t*255)|0)}function l(e){let t=(0,n.readUint16)(e);if(t!==0)throw Error(`Invalid effects layer version: ${t}`);let r=(0,n.readUint16)(e),o={};for(let t=0;t<r;t++){(0,n.checkSignature)(e,`8BIM`);let t=(0,n.readSignature)(e);switch(t){case`cmnS`:{let t=(0,n.readUint32)(e),r=(0,n.readUint32)(e);if((0,n.readUint8)(e),(0,n.skipBytes)(e,2),t!==7||r!==0)throw Error(`Invalid effects common state`);break}case`dsdw`:case`isdw`:{let r=(0,n.readUint32)(e),i=(0,n.readUint32)(e);if(r!==41&&r!==51)throw Error(`Invalid shadow size: ${r}`);if(i!==0&&i!==2)throw Error(`Invalid shadow version: ${i}`);let c=(0,n.readFixedPoint32)(e);(0,n.readFixedPoint32)(e);let l=(0,n.readFixedPoint32)(e),u=(0,n.readFixedPoint32)(e),d=(0,n.readColor)(e),f=a(e),p=!!(0,n.readUint8)(e),m=!!(0,n.readUint8)(e),h=s(e);r>=51&&(0,n.readColor)(e);let g={size:{units:`Pixels`,value:c},distance:{units:`Pixels`,value:u},angle:l,color:d,blendMode:f,enabled:p,useGlobalLight:m,opacity:h};t===`dsdw`?o.dropShadow=[g]:o.innerShadow=[g];break}case`oglw`:{let t=(0,n.readUint32)(e),r=(0,n.readUint32)(e);if(t!==32&&t!==42)throw Error(`Invalid outer glow size: ${t}`);if(r!==0&&r!==2)throw Error(`Invalid outer glow version: ${r}`);let i=(0,n.readFixedPoint32)(e);(0,n.readFixedPoint32)(e);let c=(0,n.readColor)(e),l=a(e),u=!!(0,n.readUint8)(e),d=s(e);t>=42&&(0,n.readColor)(e),o.outerGlow={size:{units:`Pixels`,value:i},color:c,blendMode:l,enabled:u,opacity:d};break}case`iglw`:{let t=(0,n.readUint32)(e),r=(0,n.readUint32)(e);if(t!==32&&t!==43)throw Error(`Invalid inner glow size: ${t}`);if(r!==0&&r!==2)throw Error(`Invalid inner glow version: ${r}`);let i=(0,n.readFixedPoint32)(e);(0,n.readFixedPoint32)(e);let c=(0,n.readColor)(e),l=a(e),u=!!(0,n.readUint8)(e),d=s(e);t>=43&&((0,n.readUint8)(e),(0,n.readColor)(e)),o.innerGlow={size:{units:`Pixels`,value:i},color:c,blendMode:l,enabled:u,opacity:d};break}case`bevl`:{let t=(0,n.readUint32)(e),r=(0,n.readUint32)(e);if(t!==58&&t!==78)throw Error(`Invalid bevel size: ${t}`);if(r!==0&&r!==2)throw Error(`Invalid bevel version: ${r}`);let c=(0,n.readFixedPoint32)(e),l=(0,n.readFixedPoint32)(e),u=(0,n.readFixedPoint32)(e),d=a(e),f=a(e),p=(0,n.readColor)(e),m=(0,n.readColor)(e),h=i[(0,n.readUint8)(e)]||`inner bevel`,g=s(e),_=s(e),v=!!(0,n.readUint8)(e),y=!!(0,n.readUint8)(e),b=(0,n.readUint8)(e)?`down`:`up`;t>=78&&((0,n.readColor)(e),(0,n.readColor)(e)),o.bevel={size:{units:`Pixels`,value:u},angle:c,strength:l,highlightBlendMode:d,shadowBlendMode:f,highlightColor:p,shadowColor:m,style:h,highlightOpacity:g,shadowOpacity:_,enabled:v,useGlobalLight:y,direction:b};break}case`sofi`:{let t=(0,n.readUint32)(e),r=(0,n.readUint32)(e);if(t!==34)throw Error(`Invalid effects solid fill info size: ${t}`);if(r!==2)throw Error(`Invalid effects solid fill info version: ${r}`);let i=a(e),c=(0,n.readColor)(e),l=s(e),u=!!(0,n.readUint8)(e);(0,n.readColor)(e),o.solidFill=[{blendMode:i,color:c,opacity:l,enabled:u}];break}default:throw Error(`Invalid effect type: '${t}'`)}}return o}function u(e,t){(0,r.writeUint32)(e,51),(0,r.writeUint32)(e,2),(0,r.writeFixedPoint32)(e,t.size&&t.size.value||0),(0,r.writeFixedPoint32)(e,0),(0,r.writeFixedPoint32)(e,t.angle||0),(0,r.writeFixedPoint32)(e,t.distance&&t.distance.value||0),(0,r.writeColor)(e,t.color),o(e,t.blendMode),(0,r.writeUint8)(e,+!!t.enabled),(0,r.writeUint8)(e,+!!t.useGlobalLight),c(e,t.opacity??1),(0,r.writeColor)(e,t.color)}function d(e,t){let n=t.dropShadow?.[0],a=t.innerShadow?.[0],s=t.outerGlow,l=t.innerGlow,d=t.bevel,f=t.solidFill?.[0],p=1;if(n&&p++,a&&p++,s&&p++,l&&p++,d&&p++,f&&p++,(0,r.writeUint16)(e,0),(0,r.writeUint16)(e,p),(0,r.writeSignature)(e,`8BIM`),(0,r.writeSignature)(e,`cmnS`),(0,r.writeUint32)(e,7),(0,r.writeUint32)(e,0),(0,r.writeUint8)(e,1),(0,r.writeZeros)(e,2),n&&((0,r.writeSignature)(e,`8BIM`),(0,r.writeSignature)(e,`dsdw`),u(e,n)),a&&((0,r.writeSignature)(e,`8BIM`),(0,r.writeSignature)(e,`isdw`),u(e,a)),s&&((0,r.writeSignature)(e,`8BIM`),(0,r.writeSignature)(e,`oglw`),(0,r.writeUint32)(e,42),(0,r.writeUint32)(e,2),(0,r.writeFixedPoint32)(e,s.size?.value||0),(0,r.writeFixedPoint32)(e,0),(0,r.writeColor)(e,s.color),o(e,s.blendMode),(0,r.writeUint8)(e,+!!s.enabled),c(e,s.opacity??1),(0,r.writeColor)(e,s.color)),l&&((0,r.writeSignature)(e,`8BIM`),(0,r.writeSignature)(e,`iglw`),(0,r.writeUint32)(e,43),(0,r.writeUint32)(e,2),(0,r.writeFixedPoint32)(e,l.size?.value||0),(0,r.writeFixedPoint32)(e,0),(0,r.writeColor)(e,l.color),o(e,l.blendMode),(0,r.writeUint8)(e,+!!l.enabled),c(e,l.opacity??1),(0,r.writeUint8)(e,0),(0,r.writeColor)(e,l.color)),d){(0,r.writeSignature)(e,`8BIM`),(0,r.writeSignature)(e,`bevl`),(0,r.writeUint32)(e,78),(0,r.writeUint32)(e,2),(0,r.writeFixedPoint32)(e,d.angle||0),(0,r.writeFixedPoint32)(e,d.strength||0),(0,r.writeFixedPoint32)(e,d.size?.value||0),o(e,d.highlightBlendMode),o(e,d.shadowBlendMode),(0,r.writeColor)(e,d.highlightColor),(0,r.writeColor)(e,d.shadowColor);let t=i.indexOf(d.style);(0,r.writeUint8)(e,t<=0?i.indexOf(`inner bevel`):t),c(e,d.highlightOpacity??1),c(e,d.shadowOpacity??1),(0,r.writeUint8)(e,+!!d.enabled),(0,r.writeUint8)(e,+!!d.useGlobalLight),(0,r.writeUint8)(e,+(d.direction===`down`)),(0,r.writeColor)(e,d.highlightColor),(0,r.writeColor)(e,d.shadowColor)}f&&((0,r.writeSignature)(e,`8BIM`),(0,r.writeSignature)(e,`sofi`),(0,r.writeUint32)(e,34),(0,r.writeUint32)(e,2),o(e,f.blendMode),(0,r.writeColor)(e,f.color),c(e,f.opacity??1),(0,r.writeUint8)(e,+!!f.enabled),(0,r.writeColor)(e,f.color))}})),T=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.setProperty=i,e.parseEngineData=o,e.serializeEngineData=l;var t=C();function n(e){return e===32||e===10||e===13||e===9}function r(e){return e>=48&&e<=57||e===46||e===45}function i(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}var a=64;function o(e,o){let s=0;function c(){for(;s<e.length&&n(e[s]);)s++}function l(){let t=e[s];return s++,t===92&&(t=e[s],s++),t}function u(){let n=``;if(e[s]===41)return s++,n;if(e[s]!==254||e[s+1]!==255){for(;s<e.length&&e[s]!==41;)n+=String.fromCharCode(l());return(0,t.consumeMemory)(o,n.length*2),s++,n}for(s+=2;s<e.length&&e[s]!==41;){let e=l(),t=l(),r=e<<8|t;n+=String.fromCharCode(r)}return(0,t.consumeMemory)(o,n.length*2),s++,n}let d=null,f=[];function p(e){f.length?(m(e),f.push(e)):(f.push(e),d=e)}function m(e){if(!f.length)throw Error(`Invalid data`);(0,t.consumeMemory)(o,a);let n=f[f.length-1];if(typeof n==`string`){let t=f[f.length-2];i(t,n,e),g()}else if(Array.isArray(n))n.push(e);else throw Error(`Invalid data`)}function h(e){f.length||p({});let n=f[f.length-1];if(typeof n==`string`||Array.isArray(n))m(e===`nil`?null:`/${e}`);else if(n&&typeof n==`object`)(0,t.consumeMemory)(o,a+e.length*2),f.push(e);else throw Error(`Invalid data`)}function g(){if(!f.length)throw Error(`Invalid data`);f.pop()}c();let _=e.length,v=0,y=``;for(;_>0&&e[_-1]===0;)_--;for(;s<_;){let t=s,i=e[t];if(i===60&&e[t+1]===60)s+=2,p({});else if(i===62&&e[t+1]===62)s+=2,g();else if(i===47){s+=1;let t=s;for(;s<e.length&&!n(e[s]);)s++;let r=``;for(let n=t;n<s;n++)r+=String.fromCharCode(e[n]);h(r)}else if(i===40)s+=1,m(u());else if(i===91)s+=1,p([]);else if(i===93)s+=1,g();else if(i===110&&e[t+1]===117&&e[t+2]===108&&e[t+3]===108)s+=4,m(null);else if(i===116&&e[t+1]===114&&e[t+2]===117&&e[t+3]===101)s+=4,m(!0);else if(i===102&&e[t+1]===97&&e[t+2]===108&&e[t+3]===115&&e[t+4]===101)s+=5,m(!1);else if(r(i)){let t=``;for(;s<e.length&&r(e[s]);)t+=String.fromCharCode(e[s]),s++;m(parseFloat(t))}else s+=1,v||(y=`'${String.fromCharCode(i)}' (${i}) at ${s}`),v++;c()}return v&&o.log(`Invalid tokens in engine data (${v} in total, first: ${y})`),d}var s=`Axis.XY.Zone.WordSpacing.FirstLineIndent.GlyphSpacing.StartIndent.EndIndent.SpaceBefore.SpaceAfter.LetterSpacing.Values.GridSize.GridLeading.PointBase.BoxBounds.TransformPoint0.TransformPoint1.TransformPoint2.FontSize.Leading.HorizontalScale.VerticalScale.BaselineShift.Tsume.OutlineWidth.AutoLeading`.split(`.`),c=[`RunLengthArray`];function l(e,t=!1){let n=new Uint8Array(1024),r=0,i=0;function a(e){if(r>=n.length){let e=new Uint8Array(n.length*2);e.set(n),n=e}n[r]=e,r++}function o(e){for(let t=0;t<e.length;t++)a(e.charCodeAt(t))}function l(){if(t)o(` `);else for(let e=0;e<i;e++)o(` `)}function u(e,n){l(),o(`/${e}`),_(n,e,!0),t||o(`
|
|
1
|
+
import{t as e}from"./index-Dc4qgNYJ.js";var t=e(((e,t)=>{function n(e){let t=e.length;for(;--t>=0;)e[t]=0}var r=29,i=30,a=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),o=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),s=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),c=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),l=512,u=Array(576);n(u);var d=Array(60);n(d);var f=Array(l);n(f);var p=Array(256);n(p);var m=Array(r);n(m);var h=Array(i);n(h);function g(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}var _,v,y;function b(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}var x=e=>e<256?f[e]:f[256+(e>>>7)],S=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},C=(e,t,n)=>{e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,S(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},w=(e,t,n)=>{C(e,n[t*2],n[t*2+1])},T=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},E=e=>{e.bi_valid===16?(S(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},D=(e,t)=>{let n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length,l,u,d,f,p,m,h=0;for(f=0;f<=15;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<573;l++)u=e.heap[l],f=n[n[u*2+1]*2+1]+1,f>c&&(f=c,h++),n[u*2+1]=f,!(u>r)&&(e.bl_count[f]++,p=0,u>=s&&(p=o[u-s]),m=n[u*2],e.opt_len+=m*(f+p),a&&(e.static_len+=m*(i[u*2+1]+p)));if(h!==0){do{for(f=c-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[c]--,h-=2}while(h>0);for(f=c;f!==0;f--)for(u=e.bl_count[f];u!==0;)d=e.heap[--l],!(d>r)&&(n[d*2+1]!==f&&(e.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),u--)}},O=(e,t,n)=>{let r=Array(16),i=0,a,o;for(a=1;a<=15;a++)i=i+n[a-1]<<1,r[a]=i;for(o=0;o<=t;o++){let t=e[o*2+1];t!==0&&(e[o*2]=T(r[t]++,t))}},k=()=>{let e,t,n,r,c,l=Array(16);for(n=0,r=0;r<28;r++)for(m[r]=n,e=0;e<1<<a[r];e++)p[n++]=r;for(p[n-1]=r,c=0,r=0;r<16;r++)for(h[r]=c,e=0;e<1<<o[r];e++)f[c++]=r;for(c>>=7;r<i;r++)for(h[r]=c<<7,e=0;e<1<<o[r]-7;e++)f[256+c++]=r;for(t=0;t<=15;t++)l[t]=0;for(e=0;e<=143;)u[e*2+1]=8,e++,l[8]++;for(;e<=255;)u[e*2+1]=9,e++,l[9]++;for(;e<=279;)u[e*2+1]=7,e++,l[7]++;for(;e<=287;)u[e*2+1]=8,e++,l[8]++;for(O(u,287,l),e=0;e<i;e++)d[e*2+1]=5,d[e*2]=T(e,5);_=new g(u,a,257,286,15),v=new g(d,o,0,i,15),y=new g([],s,0,19,7)},A=e=>{let t;for(t=0;t<286;t++)e.dyn_ltree[t*2]=0;for(t=0;t<i;t++)e.dyn_dtree[t*2]=0;for(t=0;t<19;t++)e.bl_tree[t*2]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},j=e=>{e.bi_valid>8?S(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},M=(e,t,n,r)=>{let i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]},N=(e,t,n)=>{let r=e.heap[n],i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&M(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!M(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},P=(e,t,n)=>{let r,i,s=0,c,l;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+s++]&255,r+=(e.pending_buf[e.sym_buf+s++]&255)<<8,i=e.pending_buf[e.sym_buf+s++],r===0?w(e,i,t):(c=p[i],w(e,c+256+1,t),l=a[c],l!==0&&(i-=m[c],C(e,i,l)),r--,c=x(r),w(e,c,n),l=o[c],l!==0&&(r-=h[c],C(e,r,l)));while(s<e.sym_next);w(e,256,t)},ee=(e,t)=>{let n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems,o,s,c=-1,l;for(e.heap_len=0,e.heap_max=573,o=0;o<a;o++)n[o*2]===0?n[o*2+1]=0:(e.heap[++e.heap_len]=c=o,e.depth[o]=0);for(;e.heap_len<2;)l=e.heap[++e.heap_len]=c<2?++c:0,n[l*2]=1,e.depth[l]=0,e.opt_len--,i&&(e.static_len-=r[l*2+1]);for(t.max_code=c,o=e.heap_len>>1;o>=1;o--)N(e,n,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],N(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,n[l*2]=n[o*2]+n[s*2],e.depth[l]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,n[o*2+1]=n[s*2+1]=l,e.heap[1]=l++,N(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],D(e,t),O(n,c,e.bl_count)},F=(e,t,n)=>{let r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)&&(s<l?e.bl_tree[a*2]+=s:a===0?s<=10?e.bl_tree[34]++:e.bl_tree[36]++:(a!==i&&e.bl_tree[a*2]++,e.bl_tree[32]++),s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4))},I=(e,t,n)=>{let r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),r=0;r<=n;r++)if(a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)){if(s<l)do w(e,a,e.bl_tree);while(--s!==0);else a===0?s<=10?(w(e,17,e.bl_tree),C(e,s-3,3)):(w(e,18,e.bl_tree),C(e,s-11,7)):(a!==i&&(w(e,a,e.bl_tree),s--),w(e,16,e.bl_tree),C(e,s-3,2));s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4)}},te=e=>{let t;for(F(e,e.dyn_ltree,e.l_desc.max_code),F(e,e.dyn_dtree,e.d_desc.max_code),ee(e,e.bl_desc),t=18;t>=3&&e.bl_tree[c[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},ne=(e,t,n,r)=>{let i;for(C(e,t-257,5),C(e,n-1,5),C(e,r-4,4),i=0;i<r;i++)C(e,e.bl_tree[c[i]*2+1],3);I(e,e.dyn_ltree,t-1),I(e,e.dyn_dtree,n-1)},re=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return 0;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return 1;for(n=32;n<256;n++)if(e.dyn_ltree[n*2]!==0)return 1;return 0},ie=!1,ae=e=>{ie||=(k(),!0),e.l_desc=new b(e.dyn_ltree,_),e.d_desc=new b(e.dyn_dtree,v),e.bl_desc=new b(e.bl_tree,y),e.bi_buf=0,e.bi_valid=0,A(e)},oe=(e,t,n,r)=>{C(e,0+ +!!r,3),j(e),S(e,n),S(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},se=e=>{C(e,2,3),w(e,256,u),E(e)},ce=(e,t,n,r)=>{let i,a,o=0;e.level>0?(e.strm.data_type===2&&(e.strm.data_type=re(e)),ee(e,e.l_desc),ee(e,e.d_desc),o=te(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=n+5,n+4<=i&&t!==-1?oe(e,t,n,r):e.strategy===4||a===i?(C(e,2+ +!!r,3),P(e,u,d)):(C(e,4+ +!!r,3),ne(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),P(e,e.dyn_ltree,e.dyn_dtree)),A(e),r&&j(e)},L=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(p[n]+256+1)*2]++,e.dyn_dtree[x(t)*2]++),e.sym_next===e.sym_end);t.exports._tr_init=ae,t.exports._tr_stored_block=oe,t.exports._tr_flush_block=ce,t.exports._tr_tally=L,t.exports._tr_align=se})),n=e(((e,t)=>{t.exports=(e,t,n,r)=>{let i=e&65535|0,a=e>>>16&65535|0,o=0;for(;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+t[r++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0}})),r=e(((e,t)=>{var n=new Uint32Array((()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t})());t.exports=(e,t,r,i)=>{let a=n,o=i+r;e^=-1;for(let n=i;n<o;n++)e=e>>>8^a[(e^t[n])&255];return e^-1}})),i=e(((e,t)=>{t.exports={2:`need dictionary`,1:`stream end`,0:``,"-1":`file error`,"-2":`stream error`,"-3":`data error`,"-4":`insufficient memory`,"-5":`buffer error`,"-6":`incompatible version`}})),a=e(((e,t)=>{t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}})),o=e(((e,o)=>{var{_tr_init:s,_tr_stored_block:c,_tr_flush_block:l,_tr_tally:u,_tr_align:d}=t(),f=n(),p=r(),m=i(),{Z_NO_FLUSH:h,Z_PARTIAL_FLUSH:g,Z_FULL_FLUSH:_,Z_FINISH:v,Z_BLOCK:y,Z_OK:b,Z_STREAM_END:x,Z_STREAM_ERROR:S,Z_DATA_ERROR:C,Z_BUF_ERROR:w,Z_DEFAULT_COMPRESSION:T,Z_FILTERED:E,Z_HUFFMAN_ONLY:D,Z_RLE:O,Z_FIXED:k,Z_DEFAULT_STRATEGY:A,Z_UNKNOWN:j,Z_DEFLATED:M}=a(),N=9,P=15,ee=8,F=573,I=3,te=258,ne=262,re=32,ie=42,ae=57,oe=69,se=73,ce=91,L=103,le=113,ue=666,de=1,fe=2,pe=3,R=4,me=3,z=(e,t)=>(e.msg=m[t],t),he=e=>e*2-(e>4?9:0),ge=e=>{let t=e.length;for(;--t>=0;)e[t]=0},B=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=i?n-i:0;while(--t);t=i,r=t;do n=e.prev[--r],e.prev[r]=n>=i?n-i:0;while(--t)},V=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,H=e=>{let t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},_e=(e,t)=>{l(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,H(e.strm)},U=(e,t)=>{e.pending_buf[e.pending++]=t},ve=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},ye=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),e.state.wrap===1?e.adler=f(e.adler,t,i,n):e.state.wrap===2&&(e.adler=p(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},W=(e,t)=>{let n=e.max_chain_length,r=e.strstart,i,a,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-ne?e.strstart-(e.w_size-ne):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+te,p=l[r+o-1],m=l[r+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,l[i+o]===m&&l[i+o-1]===p&&l[i]===l[r]&&l[++i]===l[r+1]){r+=2,i++;do;while(l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&r<f);if(a=te-(f-r),r=f-te,a>o){if(e.match_start=t,o=a,a>=s)break;p=l[r+o-1],m=l[r+o]}}while((t=d[t&u])>c&&--n!==0);return o<=e.lookahead?o:e.lookahead},G=e=>{let t=e.w_size,n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-ne)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),B(e),r+=t),e.strm.avail_in===0)break;if(n=ye(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=I)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=V(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=V(e,e.ins_h,e.window[i+I-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<I)););}while(e.lookahead<ne&&e.strm.avail_in!==0)},be=(e,t)=>{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,i,a,o=0,s=e.strm.avail_in;do{if(r=65535,a=e.bi_valid+42>>3,e.strm.avail_out<a||(a=e.strm.avail_out-a,i=e.strstart-e.block_start,r>i+e.strm.avail_in&&(r=i+e.strm.avail_in),r>a&&(r=a),r<n&&(r===0&&t!==v||t===h||r!==i+e.strm.avail_in)))break;o=+(t===v&&r===i+e.strm.avail_in),c(e,0,0,o),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,H(e.strm),i&&(i>r&&(i=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,r-=i),r&&(ye(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(o===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),o?R:t!==h&&t!==v&&e.strm.avail_in===0&&e.strstart===e.block_start?fe:(a=e.window_size-e.strstart,e.strm.avail_in>a&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,a+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),a>e.strm.avail_in&&(a=e.strm.avail_in),a&&(ye(e.strm,e.window,e.strstart,a),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.high_water<e.strstart&&(e.high_water=e.strstart),a=e.bi_valid+42>>3,a=e.pending_buf_size-a>65535?65535:e.pending_buf_size-a,n=a>e.w_size?e.w_size:a,i=e.strstart-e.block_start,(i>=n||(i||t===v)&&t!==h&&e.strm.avail_in===0&&i<=a)&&(r=i>a?a:i,o=+(t===v&&e.strm.avail_in===0&&r===i),c(e,e.block_start,r,o),e.block_start+=r,H(e.strm)),o?pe:de)},xe=(e,t)=>{let n,r;for(;;){if(e.lookahead<ne){if(G(e),e.lookahead<ne&&t===h)return de;if(e.lookahead===0)break}if(n=0,e.lookahead>=I&&(e.ins_h=V(e,e.ins_h,e.window[e.strstart+I-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-ne&&(e.match_length=W(e,n)),e.match_length>=I){if(r=u(e,e.strstart-e.match_start,e.match_length-I),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=I){e.match_length--;do e.strstart++,e.ins_h=V(e,e.ins_h,e.window[e.strstart+I-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=V(e,e.ins_h,e.window[e.strstart+1])}else r=u(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(_e(e,!1),e.strm.avail_out===0))return de}return e.insert=e.strstart<2?e.strstart:2,t===v?(_e(e,!0),e.strm.avail_out===0?pe:R):e.sym_next&&(_e(e,!1),e.strm.avail_out===0)?de:fe},K=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<ne){if(G(e),e.lookahead<ne&&t===h)return de;if(e.lookahead===0)break}if(n=0,e.lookahead>=I&&(e.ins_h=V(e,e.ins_h,e.window[e.strstart+I-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-ne&&(e.match_length=W(e,n),e.match_length<=5&&(e.strategy===E||e.match_length===I&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=I&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-I,r=u(e,e.strstart-1-e.prev_match,e.prev_length-I),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=V(e,e.ins_h,e.window[e.strstart+I-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(_e(e,!1),e.strm.avail_out===0))return de}else if(e.match_available){if(r=u(e,0,e.window[e.strstart-1]),r&&_e(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return de}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&=(r=u(e,0,e.window[e.strstart-1]),0),e.insert=e.strstart<2?e.strstart:2,t===v?(_e(e,!0),e.strm.avail_out===0?pe:R):e.sym_next&&(_e(e,!1),e.strm.avail_out===0)?de:fe},q=(e,t)=>{let n,r,i,a,o=e.window;for(;;){if(e.lookahead<=te){if(G(e),e.lookahead<=te&&t===h)return de;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=I&&e.strstart>0&&(i=e.strstart-1,r=o[i],r===o[++i]&&r===o[++i]&&r===o[++i])){a=e.strstart+te;do;while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&i<a);e.match_length=te-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=I?(n=u(e,1,e.match_length-I),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=u(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(_e(e,!1),e.strm.avail_out===0))return de}return e.insert=0,t===v?(_e(e,!0),e.strm.avail_out===0?pe:R):e.sym_next&&(_e(e,!1),e.strm.avail_out===0)?de:fe},Se=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(G(e),e.lookahead===0)){if(t===h)return de;break}if(e.match_length=0,n=u(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(_e(e,!1),e.strm.avail_out===0))return de}return e.insert=0,t===v?(_e(e,!0),e.strm.avail_out===0?pe:R):e.sym_next&&(_e(e,!1),e.strm.avail_out===0)?de:fe};function Ce(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}var J=[new Ce(0,0,0,0,be),new Ce(4,4,8,4,xe),new Ce(4,5,16,8,xe),new Ce(4,6,32,32,xe),new Ce(4,4,16,16,K),new Ce(8,16,32,32,K),new Ce(8,16,128,128,K),new Ce(8,32,128,256,K),new Ce(32,128,258,1024,K),new Ce(32,258,258,4096,K)],we=e=>{e.window_size=2*e.w_size,ge(e.head),e.max_lazy_match=J[e.level].max_lazy,e.good_match=J[e.level].good_length,e.nice_match=J[e.level].nice_length,e.max_chain_length=J[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0};function Y(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=M,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(F*2),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),ge(this.dyn_ltree),ge(this.dyn_dtree),ge(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),ge(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),ge(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var X=e=>{if(!e)return 1;let t=e.state;return+(!t||t.strm!==e||t.status!==ie&&t.status!==ae&&t.status!==oe&&t.status!==se&&t.status!==ce&&t.status!==L&&t.status!==le&&t.status!==ue)},Te=e=>{if(X(e))return z(e,S);e.total_in=e.total_out=0,e.data_type=j;let t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?ae:t.wrap?ie:le,e.adler=t.wrap===2?0:1,t.last_flush=-2,s(t),b},Z=e=>{let t=Te(e);return t===b&&we(e.state),t},Ee=(e,t)=>X(e)||e.state.wrap!==2?S:(e.state.gzhead=t,b),Q=(e,t,n,r,i,a)=>{if(!e)return S;let o=1;if(t===T&&(t=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),i<1||i>N||n!==M||r<8||r>15||t<0||t>9||a<0||a>k||r===8&&o!==1)return z(e,S);r===8&&(r=9);let s=new Y;return e.state=s,s.strm=e,s.status=ie,s.wrap=o,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+I-1)/I),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=t,s.strategy=a,s.method=n,Z(e)},$=(e,t)=>Q(e,t,M,P,ee,A),De=(e,t)=>{if(X(e)||t>y||t<0)return e?z(e,S):S;let n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===ue&&t!==v)return z(e,e.avail_out===0?w:S);let r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(H(e),e.avail_out===0)return n.last_flush=-1,b}else if(e.avail_in===0&&he(t)<=he(r)&&t!==v)return z(e,w);if(n.status===ue&&e.avail_in!==0)return z(e,w);if(n.status===ie&&n.wrap===0&&(n.status=le),n.status===ie){let t=M+(n.w_bits-8<<4)<<8,r=-1;if(r=n.strategy>=D||n.level<2?0:n.level<6?1:n.level===6?2:3,t|=r<<6,n.strstart!==0&&(t|=re),t+=31-t%31,ve(n,t),n.strstart!==0&&(ve(n,e.adler>>>16),ve(n,e.adler&65535)),e.adler=1,n.status=le,H(e),n.pending!==0)return n.last_flush=-1,b}if(n.status===ae){if(e.adler=0,U(n,31),U(n,139),U(n,8),n.gzhead)U(n,+!!n.gzhead.text+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),U(n,n.gzhead.time&255),U(n,n.gzhead.time>>8&255),U(n,n.gzhead.time>>16&255),U(n,n.gzhead.time>>24&255),U(n,n.level===9?2:n.strategy>=D||n.level<2?4:0),U(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(U(n,n.gzhead.extra.length&255),U(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=p(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=oe;else if(U(n,0),U(n,0),U(n,0),U(n,0),U(n,0),U(n,n.level===9?2:n.strategy>=D||n.level<2?4:0),U(n,me),n.status=le,H(e),n.pending!==0)return n.last_flush=-1,b}if(n.status===oe){if(n.gzhead.extra){let t=n.pending,r=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+r>n.pending_buf_size;){let i=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+i),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>t&&(e.adler=p(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex+=i,H(e),n.pending!==0)return n.last_flush=-1,b;t=0,r-=i}let i=new Uint8Array(n.gzhead.extra);n.pending_buf.set(i.subarray(n.gzindex,n.gzindex+r),n.pending),n.pending+=r,n.gzhead.hcrc&&n.pending>t&&(e.adler=p(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=se}if(n.status===se){if(n.gzhead.name){let t=n.pending,r;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>t&&(e.adler=p(e.adler,n.pending_buf,n.pending-t,t)),H(e),n.pending!==0)return n.last_flush=-1,b;t=0}r=n.gzindex<n.gzhead.name.length?n.gzhead.name.charCodeAt(n.gzindex++)&255:0,U(n,r)}while(r!==0);n.gzhead.hcrc&&n.pending>t&&(e.adler=p(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=ce}if(n.status===ce){if(n.gzhead.comment){let t=n.pending,r;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>t&&(e.adler=p(e.adler,n.pending_buf,n.pending-t,t)),H(e),n.pending!==0)return n.last_flush=-1,b;t=0}r=n.gzindex<n.gzhead.comment.length?n.gzhead.comment.charCodeAt(n.gzindex++)&255:0,U(n,r)}while(r!==0);n.gzhead.hcrc&&n.pending>t&&(e.adler=p(e.adler,n.pending_buf,n.pending-t,t))}n.status=L}if(n.status===L){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(H(e),n.pending!==0))return n.last_flush=-1,b;U(n,e.adler&255),U(n,e.adler>>8&255),e.adler=0}if(n.status=le,H(e),n.pending!==0)return n.last_flush=-1,b}if(e.avail_in!==0||n.lookahead!==0||t!==h&&n.status!==ue){let r=n.level===0?be(n,t):n.strategy===D?Se(n,t):n.strategy===O?q(n,t):J[n.level].func(n,t);if((r===pe||r===R)&&(n.status=ue),r===de||r===pe)return e.avail_out===0&&(n.last_flush=-1),b;if(r===fe&&(t===g?d(n):t!==y&&(c(n,0,0,!1),t===_&&(ge(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),H(e),e.avail_out===0))return n.last_flush=-1,b}return t===v?n.wrap<=0?x:(n.wrap===2?(U(n,e.adler&255),U(n,e.adler>>8&255),U(n,e.adler>>16&255),U(n,e.adler>>24&255),U(n,e.total_in&255),U(n,e.total_in>>8&255),U(n,e.total_in>>16&255),U(n,e.total_in>>24&255)):(ve(n,e.adler>>>16),ve(n,e.adler&65535)),H(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending===0?x:b):b},Oe=e=>{if(X(e))return S;let t=e.state.status;return e.state=null,t===le?z(e,C):b},ke=(e,t)=>{let n=t.length;if(X(e))return S;let r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==ie||r.lookahead)return S;if(i===1&&(e.adler=f(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){i===0&&(ge(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(n-r.w_size,n),0),t=e,n=r.w_size}let a=e.avail_in,o=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,G(r);r.lookahead>=I;){let e=r.strstart,t=r.lookahead-2;do r.ins_h=V(r,r.ins_h,r.window[e+I-1]),r.prev[e&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=e,e++;while(--t);r.strstart=e,r.lookahead=2,G(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=o,e.input=s,e.avail_in=a,r.wrap=i,b};o.exports.deflateInit=$,o.exports.deflateInit2=Q,o.exports.deflateReset=Z,o.exports.deflateResetKeep=Te,o.exports.deflateSetHeader=Ee,o.exports.deflate=De,o.exports.deflateEnd=Oe,o.exports.deflateSetDictionary=ke,o.exports.deflateInfo=`pako deflate (from Nodeca project)`})),s=e(((e,t)=>{var n=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);t.exports.assign=function(e){let t=Array.prototype.slice.call(arguments,1);for(;t.length;){let r=t.shift();if(r){if(typeof r!=`object`)throw TypeError(r+`must be non-object`);for(let t in r)n(r,t)&&(e[t]=r[t])}}return e},t.exports.flattenChunks=e=>{let t=0;for(let n=0,r=e.length;n<r;n++)t+=e[n].length;let n=new Uint8Array(t);for(let t=0,r=0,i=e.length;t<i;t++){let i=e[t];n.set(i,r),r+=i.length}return n}})),c=e(((e,t)=>{var n=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{n=!1}var r=new Uint8Array(256);for(let e=0;e<256;e++)r[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;r[254]=r[254]=1,t.exports.string2buf=e=>{if(typeof TextEncoder==`function`&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,n,r,i,a,o=e.length,s=0;for(i=0;i<o;i++)n=e.charCodeAt(i),(n&64512)==55296&&i+1<o&&(r=e.charCodeAt(i+1),(r&64512)==56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),a=0,i=0;a<s;i++)n=e.charCodeAt(i),(n&64512)==55296&&i+1<o&&(r=e.charCodeAt(i+1),(r&64512)==56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?t[a++]=n:n<2048?(t[a++]=192|n>>>6,t[a++]=128|n&63):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|n&63):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|n&63);return t};var i=(e,t)=>{if(t<65534&&e.subarray&&n)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let r=``;for(let n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r};t.exports.buf2string=(e,t)=>{let n=t||e.length;if(typeof TextDecoder==`function`&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let a,o,s=Array(n*2);for(o=0,a=0;a<n;){let t=e[a++];if(t<128){s[o++]=t;continue}let i=r[t];if(i>4){s[o++]=65533,a+=i-1;continue}for(t&=i===2?31:i===3?15:7;i>1&&a<n;)t=t<<6|e[a++]&63,i--;if(i>1){s[o++]=65533;continue}t<65536?s[o++]=t:(t-=65536,s[o++]=55296|t>>10&1023,s[o++]=56320|t&1023)}return i(s,o)},t.exports.utf8border=(e,t)=>{t||=e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)==128;)n--;return n<0||n===0?t:n+r[e[n]]>t?n:t}})),l=e(((e,t)=>{function n(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=``,this.state=null,this.data_type=2,this.adler=0}t.exports=n})),u=e(((e,t)=>{var n=o(),r=s(),u=c(),d=i(),f=l(),p=Object.prototype.toString,{Z_NO_FLUSH:m,Z_SYNC_FLUSH:h,Z_FULL_FLUSH:g,Z_FINISH:_,Z_OK:v,Z_STREAM_END:y,Z_DEFAULT_COMPRESSION:b,Z_DEFAULT_STRATEGY:x,Z_DEFLATED:S}=a();function C(e){this.options=r.assign({level:b,method:S,chunkSize:16384,windowBits:15,memLevel:8,strategy:x},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;let i=n.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(i!==v)throw Error(d[i]);if(t.header&&n.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e=typeof t.dictionary==`string`?u.string2buf(t.dictionary):p.call(t.dictionary)===`[object ArrayBuffer]`?new Uint8Array(t.dictionary):t.dictionary,i=n.deflateSetDictionary(this.strm,e),i!==v)throw Error(d[i]);this._dict_set=!0}}C.prototype.push=function(e,t){let r=this.strm,i=this.options.chunkSize,a,o;if(this.ended)return!1;for(o=t===~~t?t:t===!0?_:m,r.input=typeof e==`string`?u.string2buf(e):p.call(e)===`[object ArrayBuffer]`?new Uint8Array(e):e,r.next_in=0,r.avail_in=r.input.length;;){if(r.avail_out===0&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(o===h||o===g)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(a=n.deflate(r,o),a===y)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=n.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===v;if(r.avail_out===0){this.onData(r.output);continue}if(o>0&&r.next_out>0){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(r.avail_in===0)break}return!0},C.prototype.onData=function(e){this.chunks.push(e)},C.prototype.onEnd=function(e){e===v&&(this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function w(e,t){let n=new C(t);if(n.push(e,!0),n.err)throw n.msg||d[n.err];return n.result}function T(e,t){return t||={},t.raw=!0,w(e,t)}function E(e,t){return t||={},t.gzip=!0,w(e,t)}t.exports.Deflate=C,t.exports.deflate=w,t.exports.deflateRaw=T,t.exports.gzip=E,t.exports.constants=a()})),d=e(((e,t)=>{var n=16209;t.exports=function(e,t){let r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D=e.state;r=e.next_in,T=e.input,i=r+(e.avail_in-5),a=e.next_out,E=e.output,o=a-(t-e.avail_out),s=a+(e.avail_out-257),c=D.dmax,l=D.wsize,u=D.whave,d=D.wnext,f=D.window,p=D.hold,m=D.bits,h=D.lencode,g=D.distcode,_=(1<<D.lenbits)-1,v=(1<<D.distbits)-1;top:do{m<15&&(p+=T[r++]<<m,m+=8,p+=T[r++]<<m,m+=8),y=h[p&_];dolen:for(;;){if(b=y>>>24,p>>>=b,m-=b,b=y>>>16&255,b===0)E[a++]=y&65535;else if(b&16){x=y&65535,b&=15,b&&(m<b&&(p+=T[r++]<<m,m+=8),x+=p&(1<<b)-1,p>>>=b,m-=b),m<15&&(p+=T[r++]<<m,m+=8,p+=T[r++]<<m,m+=8),y=g[p&v];dodist:for(;;){if(b=y>>>24,p>>>=b,m-=b,b=y>>>16&255,b&16){if(S=y&65535,b&=15,m<b&&(p+=T[r++]<<m,m+=8,m<b&&(p+=T[r++]<<m,m+=8)),S+=p&(1<<b)-1,S>c){e.msg=`invalid distance too far back`,D.mode=n;break top}if(p>>>=b,m-=b,b=a-o,S>b){if(b=S-b,b>u&&D.sane){e.msg=`invalid distance too far back`,D.mode=n;break top}if(C=0,w=f,d===0){if(C+=l-b,b<x){x-=b;do E[a++]=f[C++];while(--b);C=a-S,w=E}}else if(d<b){if(C+=l+d-b,b-=d,b<x){x-=b;do E[a++]=f[C++];while(--b);if(C=0,d<x){b=d,x-=b;do E[a++]=f[C++];while(--b);C=a-S,w=E}}}else if(C+=d-b,b<x){x-=b;do E[a++]=f[C++];while(--b);C=a-S,w=E}for(;x>2;)E[a++]=w[C++],E[a++]=w[C++],E[a++]=w[C++],x-=3;x&&(E[a++]=w[C++],x>1&&(E[a++]=w[C++]))}else{C=a-S;do E[a++]=E[C++],E[a++]=E[C++],E[a++]=E[C++],x-=3;while(x>2);x&&(E[a++]=E[C++],x>1&&(E[a++]=E[C++]))}}else if(b&64){e.msg=`invalid distance code`,D.mode=n;break top}else{y=g[(y&65535)+(p&(1<<b)-1)];continue dodist}break}}else if(!(b&64)){y=h[(y&65535)+(p&(1<<b)-1)];continue dolen}else if(b&32){D.mode=16191;break top}else{e.msg=`invalid literal/length code`,D.mode=n;break top}break}}while(r<i&&a<s);x=m>>3,r-=x,m-=x<<3,p&=(1<<m)-1,e.next_in=r,e.next_out=a,e.avail_in=r<i?5+(i-r):5-(r-i),e.avail_out=a<s?257+(s-a):257-(a-s),D.hold=p,D.bits=m}})),f=e(((e,t)=>{var n=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),r=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),i=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),a=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);t.exports=(e,t,o,s,c,l,u,d)=>{let f=d.bits,p=0,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=0,S=0,C,w,T,E,D,O=null,k,A=new Uint16Array(16),j=new Uint16Array(16),M=null,N,P,ee;for(p=0;p<=15;p++)A[p]=0;for(m=0;m<s;m++)A[t[o+m]]++;for(_=f,g=15;g>=1&&A[g]===0;g--);if(_>g&&(_=g),g===0)return c[l++]=20971520,c[l++]=20971520,d.bits=1,0;for(h=1;h<g&&A[h]===0;h++);for(_<h&&(_=h),b=1,p=1;p<=15;p++)if(b<<=1,b-=A[p],b<0)return-1;if(b>0&&(e===0||g!==1))return-1;for(j[1]=0,p=1;p<15;p++)j[p+1]=j[p]+A[p];for(m=0;m<s;m++)t[o+m]!==0&&(u[j[t[o+m]]++]=m);if(e===0?(O=M=u,k=20):e===1?(O=n,M=r,k=257):(O=i,M=a,k=0),S=0,m=0,p=h,D=l,v=_,y=0,T=-1,x=1<<_,E=x-1,e===1&&x>852||e===2&&x>592)return 1;for(;;){N=p-y,u[m]+1<k?(P=0,ee=u[m]):u[m]>=k?(P=M[u[m]-k],ee=O[u[m]-k]):(P=96,ee=0),C=1<<p-y,w=1<<v,h=w;do w-=C,c[D+(S>>y)+w]=N<<24|P<<16|ee|0;while(w!==0);for(C=1<<p-1;S&C;)C>>=1;if(C===0?S=0:(S&=C-1,S+=C),m++,--A[p]===0){if(p===g)break;p=t[o+u[m]]}if(p>_&&(S&E)!==T){for(y===0&&(y=_),D+=h,v=p-y,b=1<<v;v+y<g&&(b-=A[v+y],!(b<=0));)v++,b<<=1;if(x+=1<<v,e===1&&x>852||e===2&&x>592)return 1;T=S&E,c[T]=_<<24|v<<16|D-l|0}}return S!==0&&(c[D+S]=p-y<<24|4194304),d.bits=_,0}})),p=e(((e,t)=>{var i=n(),o=r(),s=d(),c=f(),l=0,u=1,p=2,{Z_FINISH:m,Z_BLOCK:h,Z_TREES:g,Z_OK:_,Z_STREAM_END:v,Z_NEED_DICT:y,Z_STREAM_ERROR:b,Z_DATA_ERROR:x,Z_MEM_ERROR:S,Z_BUF_ERROR:C,Z_DEFLATED:w}=a(),T=16180,E=16181,D=16182,O=16183,k=16184,A=16185,j=16186,M=16187,N=16188,P=16189,ee=16190,F=16191,I=16192,te=16193,ne=16194,re=16195,ie=16196,ae=16197,oe=16198,se=16199,ce=16200,L=16201,le=16202,ue=16203,de=16204,fe=16205,pe=16206,R=16207,me=16208,z=16209,he=16210,ge=16211,B=852,V=592,H=15,_e=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function U(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var ve=e=>{if(!e)return 1;let t=e.state;return+(!t||t.strm!==e||t.mode<T||t.mode>ge)},ye=e=>{if(ve(e))return b;let t=e.state;return e.total_in=e.total_out=t.total=0,e.msg=``,t.wrap&&(e.adler=t.wrap&1),t.mode=T,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(B),t.distcode=t.distdyn=new Int32Array(V),t.sane=1,t.back=-1,_},W=e=>{if(ve(e))return b;let t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,ye(e)},G=(e,t)=>{let n;if(ve(e))return b;let r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?b:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,W(e))},be=(e,t)=>{if(!e)return b;let n=new U;e.state=n,n.strm=e,n.window=null,n.mode=T;let r=G(e,t);return r!==_&&(e.state=null),r},xe=e=>be(e,H),K=!0,q,Se,Ce=e=>{if(K){q=new Int32Array(512),Se=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(c(u,e.lens,0,288,q,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;c(p,e.lens,0,32,Se,0,e.work,{bits:5}),K=!1}e.lencode=q,e.lenbits=9,e.distcode=Se,e.distbits=5},J=(e,t,n,r)=>{let i,a=e.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),r>=a.wsize?(a.window.set(t.subarray(n-a.wsize,n),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>r&&(i=r),a.window.set(t.subarray(n-r,n-r+i),a.wnext),r-=i,r?(a.window.set(t.subarray(n-r,n),0),a.wnext=r,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},we=(e,t)=>{let n,r,a,d,f,B,V,H,U,ye,W,G,be,xe,K=0,q,Se,we,Y,X,Te,Z,Ee,Q=new Uint8Array(4),$,De,Oe=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(ve(e)||!e.output||!e.input&&e.avail_in!==0)return b;n=e.state,n.mode===F&&(n.mode=I),f=e.next_out,a=e.output,V=e.avail_out,d=e.next_in,r=e.input,B=e.avail_in,H=n.hold,U=n.bits,ye=B,W=V,Ee=_;inf_leave:for(;;)switch(n.mode){case T:if(n.wrap===0){n.mode=I;break}for(;U<16;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}if(n.wrap&2&&H===35615){n.wbits===0&&(n.wbits=15),n.check=0,Q[0]=H&255,Q[1]=H>>>8&255,n.check=o(n.check,Q,2,0),H=0,U=0,n.mode=E;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((H&255)<<8)+(H>>8))%31){e.msg=`incorrect header check`,n.mode=z;break}if((H&15)!==w){e.msg=`unknown compression method`,n.mode=z;break}if(H>>>=4,U-=4,Z=(H&15)+8,n.wbits===0&&(n.wbits=Z),Z>15||Z>n.wbits){e.msg=`invalid window size`,n.mode=z;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=H&512?P:F,H=0,U=0;break;case E:for(;U<16;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}if(n.flags=H,(n.flags&255)!==w){e.msg=`unknown compression method`,n.mode=z;break}if(n.flags&57344){e.msg=`unknown header flags set`,n.mode=z;break}n.head&&(n.head.text=H>>8&1),n.flags&512&&n.wrap&4&&(Q[0]=H&255,Q[1]=H>>>8&255,n.check=o(n.check,Q,2,0)),H=0,U=0,n.mode=D;case D:for(;U<32;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}n.head&&(n.head.time=H),n.flags&512&&n.wrap&4&&(Q[0]=H&255,Q[1]=H>>>8&255,Q[2]=H>>>16&255,Q[3]=H>>>24&255,n.check=o(n.check,Q,4,0)),H=0,U=0,n.mode=O;case O:for(;U<16;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}n.head&&(n.head.xflags=H&255,n.head.os=H>>8),n.flags&512&&n.wrap&4&&(Q[0]=H&255,Q[1]=H>>>8&255,n.check=o(n.check,Q,2,0)),H=0,U=0,n.mode=k;case k:if(n.flags&1024){for(;U<16;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}n.length=H,n.head&&(n.head.extra_len=H),n.flags&512&&n.wrap&4&&(Q[0]=H&255,Q[1]=H>>>8&255,n.check=o(n.check,Q,2,0)),H=0,U=0}else n.head&&(n.head.extra=null);n.mode=A;case A:if(n.flags&1024&&(G=n.length,G>B&&(G=B),G&&(n.head&&(Z=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(d,d+G),Z)),n.flags&512&&n.wrap&4&&(n.check=o(n.check,r,G,d)),B-=G,d+=G,n.length-=G),n.length))break inf_leave;n.length=0,n.mode=j;case j:if(n.flags&2048){if(B===0)break inf_leave;G=0;do Z=r[d+G++],n.head&&Z&&n.length<65536&&(n.head.name+=String.fromCharCode(Z));while(Z&&G<B);if(n.flags&512&&n.wrap&4&&(n.check=o(n.check,r,G,d)),B-=G,d+=G,Z)break inf_leave}else n.head&&(n.head.name=null);n.length=0,n.mode=M;case M:if(n.flags&4096){if(B===0)break inf_leave;G=0;do Z=r[d+G++],n.head&&Z&&n.length<65536&&(n.head.comment+=String.fromCharCode(Z));while(Z&&G<B);if(n.flags&512&&n.wrap&4&&(n.check=o(n.check,r,G,d)),B-=G,d+=G,Z)break inf_leave}else n.head&&(n.head.comment=null);n.mode=N;case N:if(n.flags&512){for(;U<16;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}if(n.wrap&4&&H!==(n.check&65535)){e.msg=`header crc mismatch`,n.mode=z;break}H=0,U=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=F;break;case P:for(;U<32;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}e.adler=n.check=_e(H),H=0,U=0,n.mode=ee;case ee:if(n.havedict===0)return e.next_out=f,e.avail_out=V,e.next_in=d,e.avail_in=B,n.hold=H,n.bits=U,y;e.adler=n.check=1,n.mode=F;case F:if(t===h||t===g)break inf_leave;case I:if(n.last){H>>>=U&7,U-=U&7,n.mode=pe;break}for(;U<3;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}switch(n.last=H&1,H>>>=1,--U,H&3){case 0:n.mode=te;break;case 1:if(Ce(n),n.mode=se,t===g){H>>>=2,U-=2;break inf_leave}break;case 2:n.mode=ie;break;case 3:e.msg=`invalid block type`,n.mode=z}H>>>=2,U-=2;break;case te:for(H>>>=U&7,U-=U&7;U<32;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}if((H&65535)!=(H>>>16^65535)){e.msg=`invalid stored block lengths`,n.mode=z;break}if(n.length=H&65535,H=0,U=0,n.mode=ne,t===g)break inf_leave;case ne:n.mode=re;case re:if(G=n.length,G){if(G>B&&(G=B),G>V&&(G=V),G===0)break inf_leave;a.set(r.subarray(d,d+G),f),B-=G,d+=G,V-=G,f+=G,n.length-=G;break}n.mode=F;break;case ie:for(;U<14;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}if(n.nlen=(H&31)+257,H>>>=5,U-=5,n.ndist=(H&31)+1,H>>>=5,U-=5,n.ncode=(H&15)+4,H>>>=4,U-=4,n.nlen>286||n.ndist>30){e.msg=`too many length or distance symbols`,n.mode=z;break}n.have=0,n.mode=ae;case ae:for(;n.have<n.ncode;){for(;U<3;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}n.lens[Oe[n.have++]]=H&7,H>>>=3,U-=3}for(;n.have<19;)n.lens[Oe[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,$={bits:n.lenbits},Ee=c(l,n.lens,0,19,n.lencode,0,n.work,$),n.lenbits=$.bits,Ee){e.msg=`invalid code lengths set`,n.mode=z;break}n.have=0,n.mode=oe;case oe:for(;n.have<n.nlen+n.ndist;){for(;K=n.lencode[H&(1<<n.lenbits)-1],q=K>>>24,Se=K>>>16&255,we=K&65535,!(q<=U);){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}if(we<16)H>>>=q,U-=q,n.lens[n.have++]=we;else{if(we===16){for(De=q+2;U<De;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}if(H>>>=q,U-=q,n.have===0){e.msg=`invalid bit length repeat`,n.mode=z;break}Z=n.lens[n.have-1],G=3+(H&3),H>>>=2,U-=2}else if(we===17){for(De=q+3;U<De;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}H>>>=q,U-=q,Z=0,G=3+(H&7),H>>>=3,U-=3}else{for(De=q+7;U<De;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}H>>>=q,U-=q,Z=0,G=11+(H&127),H>>>=7,U-=7}if(n.have+G>n.nlen+n.ndist){e.msg=`invalid bit length repeat`,n.mode=z;break}for(;G--;)n.lens[n.have++]=Z}}if(n.mode===z)break;if(n.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,n.mode=z;break}if(n.lenbits=9,$={bits:n.lenbits},Ee=c(u,n.lens,0,n.nlen,n.lencode,0,n.work,$),n.lenbits=$.bits,Ee){e.msg=`invalid literal/lengths set`,n.mode=z;break}if(n.distbits=6,n.distcode=n.distdyn,$={bits:n.distbits},Ee=c(p,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,$),n.distbits=$.bits,Ee){e.msg=`invalid distances set`,n.mode=z;break}if(n.mode=se,t===g)break inf_leave;case se:n.mode=ce;case ce:if(B>=6&&V>=258){e.next_out=f,e.avail_out=V,e.next_in=d,e.avail_in=B,n.hold=H,n.bits=U,s(e,W),f=e.next_out,a=e.output,V=e.avail_out,d=e.next_in,r=e.input,B=e.avail_in,H=n.hold,U=n.bits,n.mode===F&&(n.back=-1);break}for(n.back=0;K=n.lencode[H&(1<<n.lenbits)-1],q=K>>>24,Se=K>>>16&255,we=K&65535,!(q<=U);){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}if(Se&&!(Se&240)){for(Y=q,X=Se,Te=we;K=n.lencode[Te+((H&(1<<Y+X)-1)>>Y)],q=K>>>24,Se=K>>>16&255,we=K&65535,!(Y+q<=U);){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}H>>>=Y,U-=Y,n.back+=Y}if(H>>>=q,U-=q,n.back+=q,n.length=we,Se===0){n.mode=fe;break}if(Se&32){n.back=-1,n.mode=F;break}if(Se&64){e.msg=`invalid literal/length code`,n.mode=z;break}n.extra=Se&15,n.mode=L;case L:if(n.extra){for(De=n.extra;U<De;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}n.length+=H&(1<<n.extra)-1,H>>>=n.extra,U-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=le;case le:for(;K=n.distcode[H&(1<<n.distbits)-1],q=K>>>24,Se=K>>>16&255,we=K&65535,!(q<=U);){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}if(!(Se&240)){for(Y=q,X=Se,Te=we;K=n.distcode[Te+((H&(1<<Y+X)-1)>>Y)],q=K>>>24,Se=K>>>16&255,we=K&65535,!(Y+q<=U);){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}H>>>=Y,U-=Y,n.back+=Y}if(H>>>=q,U-=q,n.back+=q,Se&64){e.msg=`invalid distance code`,n.mode=z;break}n.offset=we,n.extra=Se&15,n.mode=ue;case ue:if(n.extra){for(De=n.extra;U<De;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}n.offset+=H&(1<<n.extra)-1,H>>>=n.extra,U-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg=`invalid distance too far back`,n.mode=z;break}n.mode=de;case de:if(V===0)break inf_leave;if(G=W-V,n.offset>G){if(G=n.offset-G,G>n.whave&&n.sane){e.msg=`invalid distance too far back`,n.mode=z;break}G>n.wnext?(G-=n.wnext,be=n.wsize-G):be=n.wnext-G,G>n.length&&(G=n.length),xe=n.window}else xe=a,be=f-n.offset,G=n.length;G>V&&(G=V),V-=G,n.length-=G;do a[f++]=xe[be++];while(--G);n.length===0&&(n.mode=ce);break;case fe:if(V===0)break inf_leave;a[f++]=n.length,V--,n.mode=ce;break;case pe:if(n.wrap){for(;U<32;){if(B===0)break inf_leave;B--,H|=r[d++]<<U,U+=8}if(W-=V,e.total_out+=W,n.total+=W,n.wrap&4&&W&&(e.adler=n.check=n.flags?o(n.check,a,W,f-W):i(n.check,a,W,f-W)),W=V,n.wrap&4&&(n.flags?H:_e(H))!==n.check){e.msg=`incorrect data check`,n.mode=z;break}H=0,U=0}n.mode=R;case R:if(n.wrap&&n.flags){for(;U<32;){if(B===0)break inf_leave;B--,H+=r[d++]<<U,U+=8}if(n.wrap&4&&H!==(n.total&4294967295)){e.msg=`incorrect length check`,n.mode=z;break}H=0,U=0}n.mode=me;case me:Ee=v;break inf_leave;case z:Ee=x;break inf_leave;case he:return S;case ge:default:return b}return e.next_out=f,e.avail_out=V,e.next_in=d,e.avail_in=B,n.hold=H,n.bits=U,(n.wsize||W!==e.avail_out&&n.mode<z&&(n.mode<pe||t!==m))&&J(e,e.output,e.next_out,W-e.avail_out)?(n.mode=he,S):(ye-=e.avail_in,W-=e.avail_out,e.total_in+=ye,e.total_out+=W,n.total+=W,n.wrap&4&&W&&(e.adler=n.check=n.flags?o(n.check,a,W,e.next_out-W):i(n.check,a,W,e.next_out-W)),e.data_type=n.bits+(n.last?64:0)+(n.mode===F?128:0)+(n.mode===se||n.mode===ne?256:0),(ye===0&&W===0||t===m)&&Ee===_&&(Ee=C),Ee)},Y=e=>{if(ve(e))return b;let t=e.state;return t.window&&=null,e.state=null,_},X=(e,t)=>{if(ve(e))return b;let n=e.state;return n.wrap&2?(n.head=t,t.done=!1,_):b},Te=(e,t)=>{let n=t.length,r,a,o;return ve(e)||(r=e.state,r.wrap!==0&&r.mode!==ee)?b:r.mode===ee&&(a=1,a=i(a,t,n,0),a!==r.check)?x:(o=J(e,t,n,n),o?(r.mode=he,S):(r.havedict=1,_))};t.exports.inflateReset=W,t.exports.inflateReset2=G,t.exports.inflateResetKeep=ye,t.exports.inflateInit=xe,t.exports.inflateInit2=be,t.exports.inflate=we,t.exports.inflateEnd=Y,t.exports.inflateGetHeader=X,t.exports.inflateSetDictionary=Te,t.exports.inflateInfo=`pako inflate (from Nodeca project)`})),m=e(((e,t)=>{function n(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name=``,this.comment=``,this.hcrc=0,this.done=!1}t.exports=n})),h=e(((e,t)=>{var n=p(),r=s(),o=c(),u=i(),d=l(),f=m(),h=Object.prototype.toString,{Z_NO_FLUSH:g,Z_FINISH:_,Z_OK:v,Z_STREAM_END:y,Z_NEED_DICT:b,Z_STREAM_ERROR:x,Z_DATA_ERROR:S,Z_MEM_ERROR:C}=a();function w(e){this.options=r.assign({chunkSize:65536,windowBits:15,to:``},e||{});let t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;let i=n.inflateInit2(this.strm,t.windowBits);if(i!==v||(this.header=new f,n.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary==`string`?t.dictionary=o.string2buf(t.dictionary):h.call(t.dictionary)===`[object ArrayBuffer]`&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(i=n.inflateSetDictionary(this.strm,t.dictionary),i!==v))))throw Error(u[i])}w.prototype.push=function(e,t){let r=this.strm,i=this.options.chunkSize,a=this.options.dictionary,s,c,l;if(this.ended)return!1;for(c=t===~~t?t:t===!0?_:g,r.input=h.call(e)===`[object ArrayBuffer]`?new Uint8Array(e):e,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),s=n.inflate(r,c),s===b&&a&&(s=n.inflateSetDictionary(r,a),s===v?s=n.inflate(r,c):s===S&&(s=b));r.avail_in>0&&s===y&&r.state.wrap>0&&e[r.next_in]!==0;)n.inflateReset(r),s=n.inflate(r,c);switch(s){case x:case S:case b:case C:return this.onEnd(s),this.ended=!0,!1}if(l=r.avail_out,r.next_out&&(r.avail_out===0||s===y)){if(this.options.to===`string`){let e=o.utf8border(r.output,r.next_out),t=r.next_out-e,n=o.buf2string(r.output,e);r.next_out=t,r.avail_out=i-t,t&&r.output.set(r.output.subarray(e,e+t),0),this.onData(n)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out))}if(s!==v||l!==0){if(s===y)return s=n.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(r.avail_in===0)break}}return!0},w.prototype.onData=function(e){this.chunks.push(e)},w.prototype.onEnd=function(e){e===v&&(this.result=this.options.to===`string`?this.chunks.join(``):r.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function T(e,t){let n=new w(t);if(n.push(e),n.err)throw n.msg||u[n.err];return n.result}function E(e,t){return t||={},t.raw=!0,T(e,t)}t.exports.Inflate=w,t.exports.inflate=T,t.exports.inflateRaw=E,t.exports.ungzip=T,t.exports.constants=a()})),g=e(((e,t)=>{var{Deflate:n,deflate:r,deflateRaw:i,gzip:o}=u(),{Inflate:s,inflate:c,inflateRaw:l,ungzip:d}=h(),f=a();t.exports.Deflate=n,t.exports.deflate=r,t.exports.deflateRaw=i,t.exports.gzip=o,t.exports.Inflate=s,t.exports.inflate=c,t.exports.inflateRaw=l,t.exports.ungzip=d,t.exports.constants=f})),_=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.decodeJpeg=x;var t=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]),n=4017,r=799,i=3406,a=2276,o=1567,s=3784,c=5793,l=2896,u=100,d=67108864,f=0,p=d;function m(e){if(!isFinite(e)||e<0)throw Error(`Invalid memory allocation size (${e})`);let t=f+e;if(t>p){let e=Math.ceil((t-p)/1024/1024);throw Error(`Max memory limit exceeded by at least ${e}MB`)}f=t}function h(e,t){let n=16;for(;n>0&&!e[n-1];)n--;let r=[{children:[],index:0}],i=0,a=r[0];for(let o=0;o<n;o++){for(let n=0;n<e[o];n++){for(a=r.pop(),a.children[a.index]=t[i];a.index>0;){if(r.length===0)throw Error(`Could not recreate Huffman Table`);a=r.pop()}for(a.index++,r.push(a);r.length<=o;){let e={children:[],index:0};r.push(e),a.children[a.index]=e.children,a=e}i++}if(o+1<n){let e={children:[],index:0};r.push(e),a.children[a.index]=e.children,a=e}}return r[0].children}function g(e,n,r,i,a,o,s,c,l){let u=r.mcusPerLine,d=r.progressive,f=n,p=0,m=0;function h(){if(m>0)return m--,p>>m&1;if(p=e[n++],p==255){let t=e[n++];if(t)throw Error(`unexpected marker: ${(p<<8|t).toString(16)}`)}return m=7,p>>>7}function g(e){if(!e)throw Error(`Missing Huffman table`);let t=e;for(;;){if(t=t[h()],typeof t==`number`)return t;if(t===void 0)throw Error(`invalid huffman sequence`)}}function _(e){let t=0;for(;e>0;)t=t<<1|h(),e--;return t}function v(e){let t=_(e);return t>=1<<e-1?t:t+(-1<<e)+1}function y(e,n){let r=g(e.huffmanTableDC),i=r===0?0:v(r);n[0]=e.pred+=i;let a=1;for(;a<64;){let r=g(e.huffmanTableAC),i=r&15,o=r>>4;if(i===0){if(o<15)break;a+=16;continue}a+=o;let s=t[a];n[s]=v(i),a++}}function b(e,t){let n=g(e.huffmanTableDC),r=n===0?0:v(n)<<l;t[0]=e.pred+=r}function x(e,t){t[0]|=h()<<l}let S=0;function C(e,n){if(S>0){S--;return}let r=o,i=s;for(;r<=i;){let i=g(e.huffmanTableAC),a=i&15,o=i>>4;if(a===0){if(o<15){S=_(o)+(1<<o)-1;break}r+=16;continue}r+=o;let s=t[r];n[s]=v(a)*(1<<l),r++}}let w=0,T=0;function E(e,n){let r=o,i=s,a=0;for(;r<=i;){let i=t[r],o=n[i]<0?-1:1;switch(w){case 0:let t=g(e.huffmanTableAC),r=t&15;if(a=t>>4,r===0)a<15?(S=_(a)+(1<<a),w=4):(a=16,w=1);else{if(r!==1)throw Error(`invalid ACn encoding`);T=v(r),w=a?2:3}continue;case 1:case 2:n[i]?n[i]+=(h()<<l)*o:(a--,a===0&&(w=w==2?3:0));break;case 3:n[i]?n[i]+=(h()<<l)*o:(n[i]=T<<l,w=0);break;case 4:n[i]&&(n[i]+=(h()<<l)*o)}r++}w===4&&(S--,S===0&&(w=0))}function D(e,t,n,r,i){let a=n/u|0,o=n%u,s=a*e.v+r,c=o*e.h+i;e.blocks[s]!==void 0&&t(e,e.blocks[s][c])}function O(e,t,n){let r=n/e.blocksPerLine|0,i=n%e.blocksPerLine;e.blocks[r]!==void 0&&t(e,e.blocks[r][i])}let k=i.length,A,j;j=d?o===0?c===0?b:x:c===0?C:E:y;let M=0,N;if(N=k==1?i[0].blocksPerLine*i[0].blocksPerColumn:u*r.mcusPerColumn,!isFinite(N)||N<0)throw Error(`Invalid number of MCUs`);a||=N;let P,ee,F;for(;M<N;){for(let e=0;e<k;e++)i[e].pred=0;if(S=0,k==1){A=i[0];for(let e=0;e<a&&(O(A,j,M),M++,M!==N);e++);}else for(let e=0;e<a;e++){for(let e=0;e<k;e++){A=i[e],P=A.h,ee=A.v;for(let e=0;e<ee;e++)for(let t=0;t<P;t++)D(A,j,M,e,t)}if(M++,M===N)break}if(M===N)do{if(e[n]===255&&e[n+1]!==0)break;n+=1}while(n<e.length-2);if(m=0,F=e[n]<<8|e[n+1],F<65280)throw Error(`marker was not found`);if(F>=65488&&F<=65495)n+=2;else break}return n-f}function _(e){let t=[],u=e.blocksPerLine,d=e.blocksPerColumn,f=u<<3,p=new Int32Array(64),h=new Uint8Array(64);function g(t,u,d){let f=e.quantizationTable;if(!f)throw Error(`Missing quantization table`);let p=d;for(let e=0;e<64;e++)p[e]=t[e]*f[e];for(let e=0;e<8;++e){let t=8*e;if(p[1+t]==0&&p[2+t]==0&&p[3+t]==0&&p[4+t]==0&&p[5+t]==0&&p[6+t]==0&&p[7+t]==0){let e=c*p[0+t]+512>>10;p[0+t]=e,p[1+t]=e,p[2+t]=e,p[3+t]=e,p[4+t]=e,p[5+t]=e,p[6+t]=e,p[7+t]=e;continue}let u=c*p[0+t]+128>>8,d=c*p[4+t]+128>>8,f=p[2+t],m=p[6+t],h=l*(p[1+t]-p[7+t])+128>>8,g=l*(p[1+t]+p[7+t])+128>>8,_=p[3+t]<<4,v=p[5+t]<<4,y=u-d+1>>1;u=u+d+1>>1,d=y,y=f*s+m*o+128>>8,f=f*o-m*s+128>>8,m=y,y=h-v+1>>1,h=h+v+1>>1,v=y,y=g+_+1>>1,_=g-_+1>>1,g=y,y=u-m+1>>1,u=u+m+1>>1,m=y,y=d-f+1>>1,d=d+f+1>>1,f=y,y=h*a+g*i+2048>>12,h=h*i-g*a+2048>>12,g=y,y=_*r+v*n+2048>>12,_=_*n-v*r+2048>>12,v=y,p[0+t]=u+g,p[7+t]=u-g,p[1+t]=d+v,p[6+t]=d-v,p[2+t]=f+_,p[5+t]=f-_,p[3+t]=m+h,p[4+t]=m-h}for(let e=0;e<8;++e){let t=e;if(p[8+t]==0&&p[16+t]==0&&p[24+t]==0&&p[32+t]==0&&p[40+t]==0&&p[48+t]==0&&p[56+t]==0){let n=c*d[e+0]+8192>>14;p[0+t]=n,p[8+t]=n,p[16+t]=n,p[24+t]=n,p[32+t]=n,p[40+t]=n,p[48+t]=n,p[56+t]=n;continue}let u=c*p[0+t]+2048>>12,f=c*p[32+t]+2048>>12,m=p[16+t],h=p[48+t],g=l*(p[8+t]-p[56+t])+2048>>12,_=l*(p[8+t]+p[56+t])+2048>>12,v=p[24+t],y=p[40+t],b=u-f+1>>1;u=u+f+1>>1,f=b,b=m*s+h*o+2048>>12,m=m*o-h*s+2048>>12,h=b,b=g-y+1>>1,g=g+y+1>>1,y=b,b=_+v+1>>1,v=_-v+1>>1,_=b,b=u-h+1>>1,u=u+h+1>>1,h=b,b=f-m+1>>1,f=f+m+1>>1,m=b,b=g*a+_*i+2048>>12,g=g*i-_*a+2048>>12,_=b,b=v*r+y*n+2048>>12,v=v*n-y*r+2048>>12,y=b,p[0+t]=u+_,p[56+t]=u-_,p[8+t]=f+y,p[48+t]=f-y,p[16+t]=m+v,p[40+t]=m-v,p[24+t]=h+g,p[32+t]=h-g}for(let e=0;e<64;++e){let t=128+(p[e]+8>>4);u[e]=t<0?0:t>255?255:t}}m(f*d*8);for(let n=0;n<d;n++){let r=n<<3;for(let e=0;e<8;e++)t.push(new Uint8Array(f));for(let i=0;i<u;i++){g(e.blocks[n][i],h,p);let a=0,o=i<<3;for(let e=0;e<8;e++){let n=t[r+e];for(let e=0;e<8;e++)n[o+e]=h[a++]}}}return t}function v(e){return e<0?0:e>255?255:e}function y(e){let n={width:0,height:0,adobe:void 0,components:[],exifBuffer:void 0,jfif:void 0},r=u*1e3*1e3,i=0;function a(){let t=e[i]<<8|e[i+1];return i+=2,t}function o(){let t=a(),n=e.subarray(i,i+t-2);return i+=n.length,n}function s(e){let t=0,n=0;for(let r in e.components)if(e.components.hasOwnProperty(r)){let i=e.components[r];t<i.h&&(t=i.h),n<i.v&&(n=i.v)}let r=Math.ceil(e.samplesPerLine/8/t),i=Math.ceil(e.scanLines/8/n);for(let a in e.components)if(e.components.hasOwnProperty(a)){let o=e.components[a],s=Math.ceil(Math.ceil(e.samplesPerLine/8)*o.h/t),c=Math.ceil(Math.ceil(e.scanLines/8)*o.v/n),l=r*o.h,u=i*o.v,d=u*l,f=[];m(d*256);for(let e=0;e<u;e++){let e=[];for(let t=0;t<l;t++)e.push(new Int32Array(64));f.push(e)}o.blocksPerLine=s,o.blocksPerColumn=c,o.blocks=f}e.maxH=t,e.maxV=n,e.mcusPerLine=r,e.mcusPerColumn=i}let c=null,l=null,d,f=0,p=[],v=[],y=[],b=[],x=a(),S=-1;if(x!=65496)throw Error(`SOI not found`);for(x=a();x!=65497;){switch(x){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:{let e=o();x===65504&&e[0]===74&&e[1]===70&&e[2]===73&&e[3]===70&&e[4]===0&&(c={version:{major:e[5],minor:e[6]},densityUnits:e[7],xDensity:e[8]<<8|e[9],yDensity:e[10]<<8|e[11],thumbWidth:e[12],thumbHeight:e[13],thumbData:e.subarray(14,14+3*e[12]*e[13])}),x===65505&&e[0]===69&&e[1]===120&&e[2]===105&&e[3]===102&&e[4]===0&&(n.exifBuffer=e.subarray(5,e.length)),x===65518&&e[0]===65&&e[1]===100&&e[2]===111&&e[3]===98&&e[4]===101&&e[5]===0&&(l={version:e[6],flags0:e[7]<<8|e[8],flags1:e[9]<<8|e[10],transformCode:e[11]});break}case 65499:{let n=a()+i-2;for(;i<n;){let n=e[i++];m(256);let r=new Int32Array(64);if(!(n>>4))for(let n=0;n<64;n++){let a=t[n];r[a]=e[i++]}else if(n>>4==1)for(let e=0;e<64;e++){let n=t[e];r[n]=a()}else throw Error(`DQT: invalid table spec`);p[n&15]=r}break}case 65472:case 65473:case 65474:{a(),d={extended:x===65473,progressive:x===65474,precision:e[i++],scanLines:a(),samplesPerLine:a(),components:{},componentsOrder:[],maxH:0,maxV:0,mcusPerLine:0,mcusPerColumn:0};let t=d.scanLines*d.samplesPerLine;if(t>r){let e=Math.ceil((t-r)/1e6);throw Error(`maxResolutionInMP limit exceeded by ${e}MP`)}let n=e[i++];if(!n)throw Error(`SOF: no components in frame`);for(let t=0;t<n;t++){let t=e[i],n=e[i+1]>>4,r=e[i+1]&15;if(n<1||n>4||r<1||r>4)throw Error(`SOF: invalid sampling factors (${n}x${r})`);let a=e[i+2];d.componentsOrder.push(t),d.components[t]={h:n,v:r,quantizationIdx:a,blocksPerColumn:0,blocksPerLine:0,blocks:[],pred:0},i+=3}s(d),v.push(d);break}case 65476:{let t=a();for(let n=2;n<t;){let t=e[i++],r=new Uint8Array(16),a=0;for(let t=0;t<16;t++,i++)a+=r[t]=e[i];m(16+a);let o=new Uint8Array(a);for(let t=0;t<a;t++,i++)o[t]=e[i];n+=17+a;let s=t&15,c=t>>4?y:b;c[s]=h(r,o)}break}case 65501:a(),f=a();break;case 65500:a(),a();break;case 65498:{if(!d)throw Error(`SOS: scan before frame header (SOF)`);a();let t=e[i++],n=[];for(let r=0;r<t;r++){let t=e[i++],r=d.components[t];if(!r)throw Error(`SOS: component ${t} not found in frame`);let a=e[i++];r.huffmanTableDC=b[a>>4],r.huffmanTableAC=y[a&15],n.push(r)}let r=e[i++],o=e[i++],s=e[i++],c=g(e,i,d,n,f,r,o,s>>4,s&15);i+=c;break}case 65535:e[i]!==255&&i--;break;default:if(e[i-3]==255&&e[i-2]>=192&&e[i-2]<=254){i-=3;break}if(x===224||x==225){if(S!==-1)throw Error(`first unknown JPEG marker at offset ${S.toString(16)}, second unknown JPEG marker ${x.toString(16)} at offset ${(i-1).toString(16)}`);S=i-1;let t=a();if(e[i+t-2]===255){i+=t-2;break}}throw Error(`unknown JPEG marker `+x.toString(16))}x=a()}if(v.length!=1)throw Error(`only single frame JPEGs supported`);for(let e=0;e<v.length;e++){let t=v[e].components;for(let e of Object.keys(t)){let n=t[+e],r=p[n.quantizationIdx];if(!r)throw Error(`Missing quantization table ${n.quantizationIdx}`);n.quantizationTable=r}}n.width=d.samplesPerLine,n.height=d.scanLines,n.jfif=c,n.adobe=l,n.components=[];for(let e=0;e<d.componentsOrder.length;e++){let t=d.components[d.componentsOrder[e]];n.components.push({lines:_(t),scaleX:t.h/d.maxH,scaleY:t.v/d.maxV})}return n}function b(e){let t=0,n=!1,r=e.width,i=e.height,a=r*i*e.components.length;m(a);let o=new Uint8Array(a);switch(e.components.length){case 1:{let n=e.components[0];for(let e=0;e<i;e++){let i=n.lines[0|e*n.scaleY];for(let e=0;e<r;e++){let r=i[0|e*n.scaleX];o[t++]=r}}break}case 2:{let n=e.components[0],a=e.components[1];for(let e=0;e<i;e++){let i=n.lines[0|e*n.scaleY],s=a.lines[0|e*a.scaleY];for(let e=0;e<r;e++){let r=i[0|e*n.scaleX];o[t++]=r;let c=s[0|e*a.scaleX];o[t++]=c}}break}case 3:{n=e.jfif?!0:!e.adobe||!!e.adobe.transformCode;let a=e.components[0],s=e.components[1],c=e.components[2];for(let e=0;e<i;e++){let i=a.lines[0|e*a.scaleY],l=s.lines[0|e*s.scaleY],u=c.lines[0|e*c.scaleY];for(let e=0;e<r;e++){let r,d,f,p,m,h;n?(r=i[0|e*a.scaleX],d=l[0|e*s.scaleX],f=u[0|e*c.scaleX],p=v(r+1.402*(f-128)),m=v(r-.3441363*(d-128)-.71413636*(f-128)),h=v(r+1.772*(d-128))):(p=i[0|e*a.scaleX],m=l[0|e*s.scaleX],h=u[0|e*c.scaleX]),o[t++]=p,o[t++]=m,o[t++]=h}}break}case 4:{if(!e.adobe)throw Error(`Unsupported color mode (4 components)`);n=!1,e.adobe&&e.adobe.transformCode&&(n=!0);let a=e.components[0],s=e.components[1],c=e.components[2],l=e.components[3];for(let e=0;e<i;e++){let i=a.lines[0|e*a.scaleY],u=s.lines[0|e*s.scaleY],d=c.lines[0|e*c.scaleY],f=l.lines[0|e*l.scaleY];for(let e=0;e<r;e++){let r,p,m,h,g,_,y;n?(r=i[0|e*a.scaleX],p=u[0|e*s.scaleX],m=d[0|e*c.scaleX],h=f[0|e*l.scaleX],g=255-v(r+1.402*(m-128)),_=255-v(r-.3441363*(p-128)-.71413636*(m-128)),y=255-v(r+1.772*(p-128))):(g=i[0|e*a.scaleX],_=u[0|e*s.scaleX],y=d[0|e*c.scaleX],h=f[0|e*l.scaleX]),o[t++]=255-g,o[t++]=255-_,o[t++]=255-y,o[t++]=255-h}}break}default:throw Error(`Unsupported color mode`)}return o}function x(e,t,n){if(f=0,p=n===void 0?d:Math.min(d,Math.max(0,n)),e.length===0)throw Error(`Empty jpeg buffer`);let r=y(e);m(r.width*r.height*4);let i=b(r),a=t(r.width,r.height),o=a.width,s=a.height,c=a.data,l=0,u=0;switch(r.components.length){case 1:for(let e=0;e<s;e++)for(let e=0;e<o;e++){let e=i[l++];c[u++]=e,c[u++]=e,c[u++]=e,c[u++]=255}break;case 2:for(let e=0;e<s;e++)for(let e=0;e<o;e++){let e=i[l++],t=i[l++];c[u++]=e,c[u++]=e,c[u++]=e,c[u++]=t}break;case 3:for(let e=0;e<s;e++)for(let e=0;e<o;e++){let e=i[l++],t=i[l++],n=i[l++];c[u++]=e,c[u++]=t,c[u++]=n,c[u++]=255}break;case 4:for(let e=0;e<s;e++)for(let e=0;e<o;e++){let e=i[l++],t=i[l++],n=i[l++],r=i[l++],a=255-v(e*(1-r/255)+r),o=255-v(t*(1-r/255)+r),s=255-v(n*(1-r/255)+r);c[u++]=a,c[u++]=o,c[u++]=s,c[u++]=255}break;default:throw Error(`Unsupported color mode`)}return a}})),v=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createImageData=e.createCanvas=e.MaskParams=e.LayerMaskFlags=e.ColorSpace=e.largeAdditionalInfoKeys=e.largeAdditionalInfoKeysObserved=e.layerColors=e.toBlendMode=e.fromBlendMode=e.MOCK_HANDLERS=void 0,e.revMap=r,e.createEnum=i,e.offsetForChannel=c,e.normalizeLabAB=l,e.denormalizeLabAB=u,e.clamp=d,e.hasAlpha=f,e.cmykToRgbValues=p,e.rgbToCmykValues=S,e.resetImageData=C,e.imageDataToCanvas=w,e.decodeBitmap=T,e.writeDataRaw=E,e.writeDataRLE=D,e.planarToBytes=O,e.writeDataRLEBytes=k,e.writeDataZipWithPrediction=A,e.writeDataZipWithoutPrediction=j,e.createCanvasFromData=M,e.initializeCanvas=P;var t=g(),n=_();e.MOCK_HANDLERS=!1,e.fromBlendMode={},e.toBlendMode={pass:`pass through`,norm:`normal`,diss:`dissolve`,dark:`darken`,"mul ":`multiply`,idiv:`color burn`,lbrn:`linear burn`,dkCl:`darker color`,lite:`lighten`,scrn:`screen`,"div ":`color dodge`,lddg:`linear dodge`,lgCl:`lighter color`,over:`overlay`,sLit:`soft light`,hLit:`hard light`,vLit:`vivid light`,lLit:`linear light`,pLit:`pin light`,hMix:`hard mix`,diff:`difference`,smud:`exclusion`,fsub:`subtract`,fdiv:`divide`,"hue ":`hue`,"sat ":`saturation`,colr:`color`,"lum ":`luminosity`},Object.keys(e.toBlendMode).forEach(t=>e.fromBlendMode[e.toBlendMode[t]]=t),e.layerColors=[`none`,`red`,`orange`,`yellow`,`green`,`blue`,`violet`,`gray`,`seafoam`,`indigo`,`magenta`,`fuchsia`],e.largeAdditionalInfoKeysObserved=[`lnk3`,`lnkE`,`pths`,`extd`,`extn`,`FELS`,`artd`],e.largeAdditionalInfoKeys=[`LMsk`,`Lr16`,`Lr32`,`Layr`,`Mt16`,`Mt32`,`Mtrn`,`Alph`,`FMsk`,`lnk2`,`FEid`,`FXid`,`PxSD`,`cinf`,...e.largeAdditionalInfoKeysObserved];function r(e){let t={};return Object.keys(e).forEach(n=>t[e[n]]=n),t}function i(e,t,n){let i=r(n);return{decode:e=>{let r=e.split(`.`)[1];if(r&&!i[r]){if(Object.prototype.hasOwnProperty.call(n,r))return r;let t=r.replace(/([A-Z])/g,` $1`).toLowerCase();if(Object.prototype.hasOwnProperty.call(n,t))return t;throw Error(`Unrecognized value for enum: '${e}'`)}return i[r]||t},encode:r=>{if(r&&!n[r])throw Error(`Invalid value for enum: '${r}'`);return`${e}.${r?n[r]:n[t]}`}}}var a;(function(e){e[e.RGB=0]=`RGB`,e[e.HSB=1]=`HSB`,e[e.CMYK=2]=`CMYK`,e[e.Lab=7]=`Lab`,e[e.Grayscale=8]=`Grayscale`})(a||(e.ColorSpace=a={}));var o;(function(e){e[e.PositionRelativeToLayer=1]=`PositionRelativeToLayer`,e[e.LayerMaskDisabled=2]=`LayerMaskDisabled`,e[e.InvertLayerMaskWhenBlending=4]=`InvertLayerMaskWhenBlending`,e[e.LayerMaskFromRenderingOtherData=8]=`LayerMaskFromRenderingOtherData`,e[e.MaskHasParametersAppliedToIt=16]=`MaskHasParametersAppliedToIt`})(o||(e.LayerMaskFlags=o={}));var s;(function(e){e[e.UserMaskDensity=1]=`UserMaskDensity`,e[e.UserMaskFeather=2]=`UserMaskFeather`,e[e.VectorMaskDensity=4]=`VectorMaskDensity`,e[e.VectorMaskFeather=8]=`VectorMaskFeather`})(s||(e.MaskParams=s={}));function c(e,t){switch(e){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return t?3:e+1;case-1:return t?4:3;default:return e+1}}function l(e,t=1){return e<0?e/(128*t):e/(127*t)}function u(e,t=1){return e<0?128*t*e:127*t*e}function d(e,t,n){return e<t?t:e>n?n:e}function f(e){let t=e.width*e.height*4,n=e.data instanceof Float32Array?1:e.data instanceof Uint16Array?65535:255;for(let r=3;r<t;r+=4)if(e.data[r]!==n)return!0;return!1}function p(e,t,n,r,i){i[0]=255+e*(-4.387332384609988*e+54.48615194189176*t+18.82290502165302*n+212.25662451639585*r-285.2331026137004)+t*(1.7149763477362134*t-5.6096736904047315*n-17.873870861415444*r-5.497006427196366)+n*(-2.5217340131683033*n-21.248923337353073*r+17.5119270841813)+r*(-21.86122147463605*r-189.48180835922747),i[1]=255+e*(8.841041422036149*e+60.118027045597366*t+6.871425592049007*n+31.159100130055922*r-79.2970844816548)+t*(-15.310361306967817*t+17.575251261109482*n+131.35250912493976*r-190.9453302588951)+n*(4.444339102852739*n+9.8632861493405*r-24.86741582555878)+r*(-20.737325471181034*r-187.80453709719578),i[2]=255+e*(.8842522430003296*e+8.078677503112928*t+30.89978309703729*n-.23883238689178934*r-14.183576799673286)+t*(10.49593273432072*t+63.02378494754052*n+50.606957656360734*r-112.23884253719248)+n*(.03296041114873217*n+115.60384449646641*r-193.58209356861505)+r*(-22.33816807309886*r-180.12613974708367)}var m=e=>e<0?0:e>1?1:e;function h(e,t,n,r,i){let a=[0,0,0],o=[0,0,0],s=[0,0,0],c=[[0,0,0],[0,0,0],[0,0,0]],l=1e-4;for(let u=0;u<20&&(p(i[0],i[1],i[2],r,a),s[0]=a[0]-e,s[1]=a[1]-t,s[2]=a[2]-n,!(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]<1e-6));u++){for(let e=0;e<3;e++){let t=i[e];i[e]=t+l,p(i[0],i[1],i[2],r,o),i[e]=t;for(let t=0;t<3;t++)c[t][e]=(o[t]-a[t])/l}let[[e,t,n],[u,d,f],[h,g,_]]=c,v=e*(d*_-f*g)-t*(u*_-f*h)+n*(u*g-d*h);if(Math.abs(v)<1e-12)break;let y=[[d*_-f*g,n*g-t*_,t*f-n*d],[f*h-u*_,e*_-n*h,n*u-e*f],[u*g-d*h,t*h-e*g,e*d-t*u]],b=0;for(let e=0;e<3;e++){let t=-(y[e][0]*s[0]+y[e][1]*s[1]+y[e][2]*s[2])/v,n=m(i[e]+t);b+=Math.abs(n-i[e]),i[e]=n}if(b<1e-9)break}return p(i[0],i[1],i[2],r,a),(a[0]-e)*(a[0]-e)+(a[1]-t)*(a[1]-t)+(a[2]-n)*(a[2]-n)}function v(e,t,n,r){let i=m((1-Math.max(e,t,n)/255-.2)/.8)**1.3,a=[0,0,0],o=1/0,s=1/0,c=c=>{a[0]=m(1-e/255-c),a[1]=m(1-t/255-c),a[2]=m(1-n/255-c);let l=h(e,t,n,c,a),u=Math.max(l,.1)+Math.abs(c-i)*.01;u<o&&(o=u,s=l,r[0]=a[0],r[1]=a[1],r[2]=a[2],r[3]=c)};if(c(i),s>.1)for(let e=0;e<=10;e++)c(e/10);if(s>.1){let e=r[3];for(let t=-5;t<=5;t++)c(m(e+t/100))}}var y=33,b;function x(){if(!b){let e=y,t=new Float32Array(1089*e*4),n=[0,0,0,0];for(let r=0,i=0;r<e;r++)for(let a=0;a<e;a++)for(let o=0;o<e;o++,i+=4)v(r*255/32,a*255/32,o*255/32,n),t[i]=n[0],t[i+1]=n[1],t[i+2]=n[2],t[i+3]=n[3];b=t}return b}function S(e,t,n,r){let i=x(),a=m(e)*32,o=m(t)*32,s=m(n)*32,c=Math.min(31,Math.floor(a)),l=Math.min(31,Math.floor(o)),u=Math.min(31,Math.floor(s)),d=a-c,f=o-l,p=s-u;r[0]=r[1]=r[2]=r[3]=0;for(let e=0;e<8;e++){let t=e>>2,n=e>>1&1,a=e&1,o=(t?d:1-d)*(n?f:1-f)*(a?p:1-p),s=(((c+t)*y+l+n)*y+u+a)*4;r[0]+=o*i[s],r[1]+=o*i[s+1],r[2]+=o*i[s+2],r[3]+=o*i[s+3]}}function C({data:e}){let t=e instanceof Float32Array?1:e instanceof Uint16Array?65535:255;for(let n=0,r=e.length|0;n<r;n=n+4|0)e[n+0]=0,e[n+1]=0,e[n+2]=0,e[n+3]=t}function w(t){let n=(0,e.createCanvas)(t.width,t.height),r;if(t.data instanceof Uint8ClampedArray)r=t;else{r=(0,e.createImageData)(t.width,t.height);let n=t.data,i=r.data;if(n instanceof Float32Array)for(let e=0,t=n.length;e<t;e+=4)i[e+0]=Math.round(n[e+0]**(1/2.2)*255),i[e+1]=Math.round(n[e+1]**(1/2.2)*255),i[e+2]=Math.round(n[e+2]**(1/2.2)*255),i[e+3]=Math.round(n[e+3]*255);else{let e=n instanceof Uint16Array?8:0;for(let t=0,r=n.length;t<r;t++)i[t]=n[t]>>>e}}return n.getContext(`2d`).putImageData(r,0,0),n}function T(e,t,n,r){if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray))throw Error(`Invalid bit depth`);for(let i=0,a=0,o=0;i<r;i++)for(let r=0;r<n;){let i=e[o++];for(let e=0;e<8&&r<n;e++,r++,a+=4){let e=i&128?0:255;i<<=1,t[a+0]=e,t[a+1]=e,t[a+2]=e,t[a+3]=255}}}function E(e,t,n,r){if(!n||!r)return;let i=new Uint8Array(n*r);for(let n=0;n<i.length;n++)i[n]=e.data[n*4+t];return i}function D(e,{data:t,width:n,height:r},i,a){if(!n||!r)return e.subarray(0,0);let o=4*n|0,s=0,c=i.length*(a?4:2)*r|0;for(let n of i)for(let i=0,l=n|0;i<r;i++){let r=i*o|0,u=r+o|0,d=u+n-4|0,f=d-4|0,p=c;for(l=r+n|0;l<u;l=l+4|0)if(l<f){let n=t[l];l=l+4|0;let r=t[l];l=l+4|0;let i=t[l];if(n===r&&n===i){let r=3;for(;r<128&&l<d&&t[l+4|0]===n;)r=r+1|0,l=l+4|0;e[c++]=1-r,e[c++]=n}else{let a=c,o=!0,s=1;for(e[c++]=0,e[c++]=n;l<d&&s<128;){if(l=l+4|0,n=r,r=i,i=t[l],n===r&&n===i){l=l-12|0,o=!1;break}s++,e[c++]=n}o&&(s<127?(e[c++]=r,e[c++]=i,s+=2):s<128?(e[c++]=r,s++,l=l-4|0):l=l-8|0),e[a]=s-1}}else l===d?(e[c++]=0,e[c++]=t[l]):(e[c++]=1,e[c++]=t[l],l=l+4|0,e[c++]=t[l]);if(c>e.length)throw Error(`RLE buffer too small (${e.length})`);let m=c-p;a&&(e[s++]=m>>24&255,e[s++]=m>>16&255),e[s++]=m>>8&255,e[s++]=m&255}return e.subarray(0,c)}function O(e){if(e instanceof Uint8Array)return e;let t=new Uint8Array(e.byteLength),n=new DataView(t.buffer);if(e instanceof Uint16Array)for(let t=0;t<e.length;t++)n.setUint16(t*2,e[t],!1);else for(let t=0;t<e.length;t++)n.setFloat32(t*4,e[t],!1);return t}function k(e,t,n,r){let i=r?4:2,a=new Uint8Array(n*(i+t+Math.ceil(t/128))),o=i*n;for(let r=0;r<n;r++){let n=o,s=r*t,c=s+t,l=s;for(;l<c;){let t=1;for(;l+t<c&&t<128&&e[l+t]===e[l];)t++;if(t>1)a[o++]=257-t,a[o++]=e[l],l+=t;else{let t=o++,n=0;for(;l<c&&n<128&&!(l+2<c&&e[l]===e[l+1]&&e[l]===e[l+2]);)a[o++]=e[l++],n++;a[t]=n-1}}let u=o-n;for(let e=0;e<i;e++)a[r*i+e]=u>>>(i-e-1)*8&255}return a.subarray(0,o)}function A(e,n,r){let i;if(e instanceof Uint8Array){i=new Uint8Array(n*r);for(let t=0,a=0;t<r;t++)for(let t=0,r=0;t<n;t++,a++)i[a]=e[a]-r,r=e[a]}else if(e instanceof Uint16Array){i=new Uint8Array(n*r*2);for(let t=0,a=0;t<r;t++)for(let t=0,r=0;t<n;t++,a++){let t=e[a]-r&65535;i[a*2]=t>>8,i[a*2+1]=t&255,r=e[a]}}else{let t=n*4,a=O(e);i=new Uint8Array(t*r);for(let e=0;e<r;e++){let r=e*t;for(let e=0;e<n;e++)for(let t=0;t<4;t++)i[r+t*n+e]=a[r+e*4+t];for(let e=t-1;e>0;e--)i[r+e]-=i[r+e-1]}}return(0,t.deflate)(i)}function j({data:e,width:n,height:r},i){let a=n*r,o=new Uint8Array(a),s=[],c=0;for(let n of i){for(let t=0,r=n;t<a;t++,r+=4)o[t]=e[r];let r=(0,t.deflate)(o);s.push(r),c+=r.byteLength}if(s.length>0){let e=new Uint8Array(c),t=0;for(let n of s)e.set(n,t),t+=n.byteLength;return e}return s[0]}function M(t,r){let i=(0,e.createCanvas)(100,100);try{let e=i.getContext(`2d`),a=(0,n.decodeJpeg)(t,(t,n)=>e.createImageData(t,n),r.totalMemoryLimit);i.width=a.width,i.height=a.height,e.putImageData(a,0,0),r.totalMemoryLimit!==void 0&&(r.totalMemoryLimit-=a.width*a.height*4)}catch(e){r.log(`JPEG decompression error`,e.message)}return i}e.createCanvas=()=>{throw Error(`Canvas not initialized, use initializeCanvas method to set up createCanvas method`)};var N=void 0;e.createImageData=(t,n)=>(N||=(0,e.createCanvas)(1,1),N.getContext(`2d`).createImageData(t,n)),typeof document<`u`&&(e.createCanvas=(e,t)=>{let n=document.createElement(`canvas`);return n.width=e,n.height=t,n});function P(t,n){e.createCanvas=t,e.createImageData=n||e.createImageData}})),y=e((e=>{e.byteLength=c,e.toByteArray=u,e.fromByteArray=p;for(var t=[],n=[],r=typeof Uint8Array<`u`?Uint8Array:Array,i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,a=0,o=i.length;a<o;++a)t[a]=i[a],n[i.charCodeAt(a)]=a;n[45]=62,n[95]=63;function s(e){var t=e.length;if(t%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function c(e){var t=s(e),n=t[0],r=t[1];return(n+r)*3/4-r}function l(e,t,n){return(t+n)*3/4-n}function u(e){var t,i=s(e),a=i[0],o=i[1],c=new r(l(e,a,o)),u=0,d=o>0?a-4:a,f;for(f=0;f<d;f+=4)t=n[e.charCodeAt(f)]<<18|n[e.charCodeAt(f+1)]<<12|n[e.charCodeAt(f+2)]<<6|n[e.charCodeAt(f+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=t&255;return o===2&&(t=n[e.charCodeAt(f)]<<2|n[e.charCodeAt(f+1)]>>4,c[u++]=t&255),o===1&&(t=n[e.charCodeAt(f)]<<10|n[e.charCodeAt(f+1)]<<4|n[e.charCodeAt(f+2)]>>2,c[u++]=t>>8&255,c[u++]=t&255),c}function d(e){return t[e>>18&63]+t[e>>12&63]+t[e>>6&63]+t[e&63]}function f(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(d(r));return i.join(``)}function p(e){for(var n,r=e.length,i=r%3,a=[],o=16383,s=0,c=r-i;s<c;s+=o)a.push(f(e,s,s+o>c?c:s+o));return i===1?(n=e[r-1],a.push(t[n>>2]+t[n<<4&63]+`==`)):i===2&&(n=(e[r-2]<<8)+e[r-1],a.push(t[n>>10]+t[n>>4&63]+t[n<<2&63]+`=`)),a.join(``)}})),b=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.stringLengthInBytes=r,e.encodeStringTo=a,e.encodeString=o,e.decodeString=s;function t(e){return e&4294967168?e&4294965248?e&4294901760?4:3:2:1}function n(e,t){let n=e.charCodeAt(t);if(n<55296||n>57343)return n;if(n<=56319&&t+1<e.length){let r=e.charCodeAt(t+1);if(r>=56320&&r<=57343)return((n&1023)<<10)+(r&1023)+65536}return 65533}function r(e){let t=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);i<128?t+=1:i<2048?t+=2:n(e,r)>65535?(t+=4,r++):t+=3}return t}function i(e,n,r){let i=t(r);switch(i){case 1:e[n]=r;break;case 2:e[n]=r>>6&31|192,e[n+1]=r&63|128;break;case 3:e[n]=r>>12&15|224,e[n+1]=r>>6&63|128,e[n+2]=r&63|128;break;default:e[n]=r>>18&7|240,e[n+1]=r>>12&63|128,e[n+2]=r>>6&63|128,e[n+3]=r&63|128}return i}function a(e,t,r){for(let a=0;a<r.length;a++){let o=r.charCodeAt(a);if(o<128)e[t++]=o;else{let o=n(r,a);o>65535&&a++,t+=i(e,t,o)}}return t}function o(e){if(e.length>1e3&&typeof TextEncoder<`u`)return new TextEncoder().encode(e);let t=new Uint8Array(r(e));return a(t,0,e),t}function s(e){let t=[];function n(e){e>65535&&(e-=65536,t.push(String.fromCharCode(e>>>10&1023|55296)),e=56320|e&1023),t.push(String.fromCharCode(e))}let r=0,i=0,a=0,o=128,s=191;for(let t=0;t<e.length;t++){let c=e[t];if(a===0){c<=127?n(c):c>=194&&c<=223?(a=1,r=c&31):c>=224&&c<=239?(c===224&&(o=160),c===237&&(s=159),a=2,r=c&15):c>=240&&c<=244?(c===240&&(o=144),c===244&&(s=143),a=3,r=c&7):n(65533);continue}if(c<o||c>s){r=0,a=0,i=0,o=128,s=191,n(65533),t--;continue}o=128,s=191,r=r<<6|c&63,i++,i===a&&(n(r),r=0,a=0,i=0)}return a!==0&&n(65533),t.join(``)}})),x=e((e=>{var t=e&&e.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};Object.defineProperty(e,"__esModule",{value:!0}),e.FlCl=e.ExtR=e.ExtT=e.DfsM=e.blurType=e.Lns=e.MztT=e.Chnl=e.Dstr=e.ZZTy=e.Wvtp=e.SphM=e.RplS=e.Cnvr=e.UndA=e.DspM=e.SmBQ=e.SmBM=e.BlrQ=e.BlrM=e.strokeStyleLineAlignment=e.strokeStyleLineJoinType=e.strokeStyleLineCapType=e.ESliceBGColorType=e.ESliceOrigin=e.ESliceVertAlign=e.ESliceHorzAlign=e.ESliceType=e.FrFl=e.FStl=e.ClrS=e.Clry=e.gradientInterpolationMethodType=e.stdTrackID=e.animInterpStyleEnum=e.GrdT=e.IGSr=e.BETE=e.BESs=e.bvlT=e.BESl=e.BlnM=e.warpStyle=e.Annt=e.Ornt=e.textGridding=e.outputSettingsRoot=e.layerStateRoot=e.cameraRawFilterKeyTypes=e.cameraRawFilterClassID=void 0,e.patternColorHandling=e.presetKindType=e.prjM=e.FlMd=e.IntC=e.IntE=e.Drct=e.WndM=e.CntE=void 0,e.readAsciiStringOrClassId=x,e.writeAsciiStringOrClassId=S,e.readDescriptorStructure=w,e.writeDescriptorStructure=T,e.pathSelectionStateToReference=P,e.writeClassStructure=I,e.readVersionAndDescriptor=te,e.writeVersionAndDescriptor=ne,e.horzVrtcToXY=re,e.xyToHorzVrtc=ie,e.descBoundsToBounds=ae,e.boundsToDescBounds=oe,e.serializeEffects=L,e.parseEffects=le,e.parseTrackList=fe,e.serializeTrackList=pe,e.parseVectorContent=_e,e.serializeVectorContent=ye,e.parseColor=xe,e.serializeColor=q,e.parseAngle=Ce,e.parsePercent=J,e.parsePercentOrAngle=we,e.parseUnits=Y,e.parseUnitsOrNumber=X,e.parseUnitsToNumber=Te,e.unitsAngle=Z,e.unitsPercent=Ee,e.unitsPercentF=Q,e.unitsValue=$,e.frac=De;var n=v(),r=C(),i=k();function a(e){let t={};return Object.keys(e).forEach(n=>t[e[n]]=n),t}var o={"#Ang":`Angle`,"#Rsl":`Density`,"#Rlt":`Distance`,"#Nne":`None`,"#Prc":`Percent`,"#Pxl":`Pixels`,"#Mlm":`Millimeters`,"#Pnt":`Points`,RrPi:`Picas`,RrIn:`Inches`,RrCm:`Centimeters`},s=a(o);function c(e,t){return{name:e,classID:t}}var l=c(``,`null`),u={strokeStyleContent:c(``,`solidColorLayer`),printProofSetup:c(`Proof Setup`,`proofSetup`),Grad:c(`Gradient`,`Grdn`),Trnf:c(`Transform`,`Trnf`),patternFill:c(``,`patternFill`),ebbl:c(``,`ebbl`),SoFi:c(``,`SoFi`),GrFl:c(``,`GrFl`),sdwC:c(``,`RGBC`),hglC:c(``,`RGBC`),"Clr ":c(``,`RGBC`),tintColor:c(``,`RGBC`),Ofst:c(``,`Pnt `),ChFX:c(``,`ChFX`),MpgS:c(``,`ShpC`),DrSh:c(``,`DrSh`),IrSh:c(``,`IrSh`),OrGl:c(``,`OrGl`),IrGl:c(``,`IrGl`),TrnS:c(``,`ShpC`),Ptrn:c(``,`Ptrn`),FrFX:c(``,`FrFX`),phase:c(``,`Pnt `),frameStep:l,duration:l,workInTime:l,workOutTime:l,audioClipGroupList:l,bounds:c(``,`Rctn`),customEnvelopeWarp:c(``,`customEnvelopeWarp`),warp:c(``,`warp`),"Sz ":c(``,`Pnt `),origin:c(``,`Pnt `),autoExpandOffset:c(``,`Pnt `),keyOriginShapeBBox:c(``,`unitRect`),Vrsn:l,psVersion:l,docDefaultNewArtboardBackgroundColor:c(``,`RGBC`),artboardRect:c(``,`classFloatRect`),framedGroupRect:c(``,`classFloatRect`),keyOriginRRectRadii:c(``,`radii`),keyOriginBoxCorners:l,rectangleCornerA:c(``,`Pnt `),rectangleCornerB:c(``,`Pnt `),rectangleCornerC:c(``,`Pnt `),rectangleCornerD:c(``,`Pnt `),keyOriginPolyPreviousTightBoxCorners:l,keyOriginPolyTrueRectCorners:l,keyOriginLineStart:c(``,`Pnt `),keyOriginLineEnd:c(``,`Pnt `),compInfo:l,quiltWarp:c(``,`quiltWarp`),generatorSettings:l,crema:l,FrIn:l,blendOptions:l,FXRf:l,Lefx:l,time:l,animKey:l,timeScope:l,inTime:l,outTime:l,sheetStyle:l,translation:l,Skew:l,boundingBox:c(``,`boundingBox`),"Lnk ":c(``,`ExternalFileLink`),frameReader:c(``,`FrameReader`),effectParams:c(``,`motionTrackEffectParams`),Impr:c(`None`,`none`),Anch:c(``,`Pnt `),"Fwd ":c(``,`Pnt `),"Bwd ":c(``,`Pnt `),FlrC:c(``,`Pnt `),meshBoundaryPath:c(``,`pathClass`),filterFX:c(``,`filterFXStyle`),Fltr:c(``,`rigidTransform`),FrgC:c(``,`RGBC`),BckC:c(``,`RGBC`),sdwM:c(`Parameters`,`adaptCorrectTones`),hglM:c(`Parameters`,`adaptCorrectTones`),customShape:c(``,`customShape`),origFXRefPoint:l,FXRefPoint:l,vectorMask:l,layerSpecific:l,LSpc:l,textLayerSettings:c(``,`warp`),placedLayerSettings:l,IMsk:l,VMsk:l,TxtC:l,ClMg:c(``,`ClMg`),interpretation:c(``,`footageInterpretation`),bgColor:c(``,`NativeQuad`)},d={"Crv ":c(``,`CrPt`),Clrs:c(``,`Clrt`),Trns:c(``,`TrnS`),keyDescriptorList:l,keyRootDescriptorList:l,solidFillMulti:c(``,`SoFi`),gradientFillMulti:c(``,`GrFl`),dropShadowMulti:c(``,`DrSh`),innerShadowMulti:c(``,`IrSh`),frameFXMulti:c(``,`FrFX`),FrIn:l,FSts:l,LaSt:l,sheetTimelineOptions:l,trackList:c(``,`animationTrack`),globalTrackList:c(``,`animationTrack`),keyList:l,audioClipGroupList:l,audioClipList:l,countObjectList:c(``,`countObject`),countGroupList:c(``,`countGroup`),slices:c(``,`slice`),"Pts ":c(``,`Pthp`),SbpL:c(``,`SbpL`),pathComponents:c(``,`PaCm`),filterFXList:c(``,`filterFX`),puppetShapeList:c(``,`puppetShape`),channelDenoise:c(``,`channelDenoiseParams`),ShrP:c(``,`Pnt `),layerSettings:l,list:l,Adjs:c(``,`CrvA`),vertices:c(``,`Pnt `),warpedVertices:c(``,`Pnt `),quads:c(``,`quadIndices`)},f={TEXT:`Txt .printerName.Nm .Idnt.blackAndWhitePresetFileName.LUT3DFileName.exportOption.scaleSettings.BackgroundImagePath.ImageSubfolderName.SavedIteratedName.presetFileName.curvesPresetFileName.mixerPresetFileName.placed.description.reason.artboardPresetName.json.clipID.relPath.fullPath.mediaDescriptor.Msge.altTag.url.cellText.preset.KnNm.FPth.comment.originalPath.Bk .pathUnicodeName`.split(`.`),tdta:[`EngineData`,`LUT3DFileData`,`indexArray`,`originalVertexArray`,`deformedVertexArray`,`LqMe`,`bookKey`],long:`TextIndex.RndS.Mdpn.Smth.Lctn.strokeStyleVersion.LaID.Vrsn.Cnt .bookID.cropRectBottom.cropRectLeft.cropRectRight.cropRectTop.Version.BackgroundColorBlue.BackgroundColorGreen.BackgroundColorRed.BackgroundColorState.AttributeCase.Encoding.DuplicateFileNameBehavior.ImageMapLocation.ImageMapType.Indent.LineEndings.SpacersEmptyCells.SpacersHorizontal.SpacersVertical.StylesFormat.TDWidthHeight.TagCase.ColorPolicy.MetadataPolicy.Brgh.Cntr.means.vibrance.Strt.bwPresetKind.comp.compID.originalCompID.curvesPresetKind.mixerPresetKind.uOrder.vOrder.PgNm.totalPages.Crop.numerator.denominator.frameCount.Annt.keyOriginType.unitValueQuadVersion.keyOriginIndex.major.minor.fix.docDefaultNewArtboardBackgroundType.artboardBackgroundType.numModifyingFX.deformNumRows.deformNumCols.FrID.FrDl.FsID.LCnt.AFrm.AFSt.numBefore.numAfter.Spcn.minOpacity.maxOpacity.BlnM.sheetID.gblA.globalAltitude.descVersion.frameReaderType.LyrI.zoomOrigin.fontSize.Rds .sliceID.topOutset.leftOutset.bottomOutset.rightOutset.filterID.meshQuality.meshExpansion.meshRigidity.VrsM.VrsN.NmbG.WLMn.WLMx.AmMn.AmMx.SclH.SclV.Lvl .TlNm.TlOf.FlRs.Thsh.ShrS.ShrE.FlRs.Vrnc.Strg.ExtS.ExtD.HrzS.VrtS.NmbR.EdgF.Ang1.Ang2.Ang3.Ang4.lastAppliedComp.capturedInfo.pixelSourceType.framedGroupType.keyOriginPolySides.keyOriginLineArrConc.noisePreSeed.associatedLayer.placedLayerCompID.VAlign`.split(`.`),enum:`textGridding.Ornt.warpStyle.warpRotate.Inte.Bltn.ClrS.BlrQ.bvlT.bvlS.bvlD.Md .glwS.GrdF.GlwT.RplS.BlrM.SmBM.strokeStyleLineCapType.strokeStyleLineJoinType.strokeStyleLineAlignment.strokeStyleBlendMode.PntT.Styl.lookupType.LUTFormat.dataOrder.tableOrder.enableCompCore.enableCompCoreGPU.compCoreSupport.compCoreGPUSupport.Engn.enableCompCoreThreads.gs99.FrDs.trackID.animInterpStyle.horzAlign.vertAlign.bgColorType.shapeOperation.UndA.Wvtp.Drct.WndM.Edg .FlCl.IntE.IntC.Cnvr.Fl .Dstr.MztT.Lns .ExtT.DspM.ExtR.ZZTy.SphM.SmBQ.placedLayerOCIOConversion.gradientsInterpolationMethod.pathSymmetryMode.interpretAlpha.knockout.TxPT.TxPR`.split(`.`),bool:`PstS.printSixteenBit.masterFXSwitch.enab.uglg.antialiasGloss.useShape.useTexture.uglg.antialiasGloss.useShape.Vsbl.useTexture.Algn.Rvrs.Dthr.Invr.VctC.ShTr.layerConceals.strokeEnabled.fillEnabled.strokeStyleScaleLock.strokeStyleStrokeAdjust.hardProof.MpBl.paperWhite.useLegacy.Auto.Lab .useTint.keyShapeInvalidated.autoExpandEnabled.autoNestEnabled.autoPositionEnabled.shrinkwrapOnSaveEnabled.present.showInDialog.overprint.sheetDisclosed.lightsDisclosed.meshesDisclosed.materialsDisclosed.hasMotion.muted.Effc.selected.autoScope.fillCanvas.cellTextIsHTML.Smoo.Clsp.validAtPosition.rigidType.hasoptions.filterMaskEnable.filterMaskLinked.filterMaskExtendWithWhite.removeJPEGArtifact.Mnch.ExtF.ExtM.moreAccurate.GpuY.LIWy.Cnty.Lnkd.showAlteredVideo.lightingOn.LockPPI.keyOriginLineArrowSt.keyOriginLineArrowEnd.Expn.substitutesUsed.blendClipped.blendInterior.TxMP`.split(`.`),doub:`warpValue.warpPerspective.warpPerspectiveOther.Intr.Wdth.Hght.Gmm .strokeStyleMiterLimit.strokeStyleResolution.layerTime.keyOriginResolution.xx.xy.yx.yy.tx.ty.FrGA.frameRate.audioLevel.rotation.X .Y .redFloat.greenFloat.blueFloat.imageResolution.PuX0.PuX1.PuX2.PuX3.PuY0.PuY1.PuY2.PuY3.stylization.cleanliness.brushScale.microBrush.specularity.PreferredResolution.FrGL.keyOriginLineWeight.keyOriginLineArrWdth.keyOriginLineArrLngth.keyOriginPolyPixelHSF.keyOriginPolyCornerRadius.gradientAspectRatio`.split(`.`),UntF:`sdwO.hglO.lagl.Lald.srgR.blur.Sftn.Opct.Dstn.Angl.Ckmt.Nose.Inpr.ShdN.strokeStyleLineWidth.strokeStyleLineDashOffset.strokeStyleOpacity.H .Top .Left.Btom.Rght.Rslt.topRight.topLeft.bottomLeft.bottomRight.ClNs.Shrp.fillOpacity.keyOriginPolyStarRatio`.split(`.`),VlLs:`Crv .Clrs.Mnm .Mxm .Trns.pathList.keyRootDescriptorList.strokeStyleLineDashSet.FrLs.slices.LaSt.Trnf.nonAffineTransform.keyDescriptorList.guideIndeces.gradientFillMulti.solidFillMulti.frameFXMulti.innerShadowMulti.dropShadowMulti.FrIn.FSts.FsFr.sheetTimelineOptions.audioClipList.trackList.globalTrackList.keyList.audioClipList.warpValues.selectedPin.Pts .SbpL.pathComponents.pinOffsets.posFinalPins.pinVertexIndices.PinP.PnRt.PnOv.PnDp.filterFXList.puppetShapeList.ShrP.channelDenoise.Mtrx.layerSettings.list.compList.Adjs.vertices.warpedVertices.quads.indices.Mpng.textLayerSettingsWarpRect`.split(`.`),ObAr:[`meshPoints`,`quiltSliceX`,`quiltSliceY`],"obj ":[`null`,`Chnl`],"Pth ":[`DspF`],alis:[`alis`]},p=[`Rd `,`Grn `,`Bl `,`Yllw`,`Ylw `,`Cyn `,`Mgnt`,`Blck`,`Gry `,`Lmnc`,`A `,`B `],m=[`Grsc`,`LbCl`,`GRYC`,`LABC`];e.cameraRawFilterClassID=`Adobe Camera Raw Filter`,e.cameraRawFilterKeyTypes={CrVe:`TEXT`,PrVN:`long`,PrVe:`long`,WBal:`enum`,Ex12:`doub`,ShpR:`doub`,"Crv ":`VlLs`,CrvR:`VlLs`,CrvG:`VlLs`,CrvB:`VlLs`};function h(e){if(typeof e==`boolean`)return`bool`;if(typeof e==`number`&&!Number.isInteger(e))return`doub`;if(Array.isArray(e))return`VlLs`;if(e&&typeof e==`object`){if(typeof e._classID==`string`)return`Objc`;if(typeof e.classID==`string`)return`type`;if(typeof e.low==`number`&&typeof e.high==`number`)return`comp`;if(typeof e.units==`string`&&typeof e.value==`number`)return`UntF`}}var g={"Mnm ":`long`,"Mxm ":`long`,HtmlFileNameComponents:`long`,SavingFileNameComponents:`long`,SliceFileNameComponents:`long`,Inpt:`long`,Otpt:`long`,FrLs:`long`,strokeStyleLineDashSet:`UntF`,Trnf:`doub`,nonAffineTransform:`doub`,keyDescriptorList:`Objc`,keyRootDescriptorList:`Objc`,pathList:`Objc`,gradientFillMulti:`Objc`,solidFillMulti:`Objc`,frameFXMulti:`Objc`,innerShadowMulti:`Objc`,dropShadowMulti:`Objc`,LaSt:`Objc`,FrIn:`Objc`,FSts:`Objc`,FsFr:`long`,blendOptions:`Objc`,sheetTimelineOptions:`Objc`,keyList:`Objc`,warpValues:`doub`,selectedPin:`long`,"Pts ":`Objc`,SbpL:`Objc`,pathComponents:`Objc`,pinOffsets:`doub`,posFinalPins:`doub`,pinVertexIndices:`long`,PinP:`doub`,PnRt:`long`,PnOv:`bool`,PnDp:`doub`,filterFXList:`Objc`,puppetShapeList:`Objc`,ShrP:`Objc`,channelDenoise:`Objc`,Mtrx:`long`,compList:`long`,textLayerSettingsWarpRect:`doub`,Chnl:`enum`,indices:`long`,Mpng:`long`},_={};for(let e of Object.keys(f))for(let t of f[e])_[t]=e;for(let e of Object.keys(u))_[e]||(_[e]=`Objc`);for(let e of Object.keys(d))g[e]=`Objc`;var y=`PixelSource.origin`;e.layerStateRoot=`layerState`;function b(e,t,n,r){return e===`presetKind`?typeof t==`string`?`enum`:`long`:e===`null`&&n===`slices`?`TEXT`:e===`groupID`?n===`slices`?`long`:`TEXT`:e===`Sz `?`Wdth`in t?`Objc`:`units`in t?`UntF`:`doub`:e===`Type`?typeof t==`string`?`enum`:`long`:e===`AntA`?typeof t==`string`?`enum`:`bool`:(e===`Hrzn`||e===`Vrtc`)&&(r.Type===`keyType.Pstn`||r._classID===`Ofst`||n===y)?`long`:e===`Hrzn`||e===`Vrtc`||e===`Top `||e===`Left`||e===`Btom`||e===`Rght`?n===`slices`?`long`:typeof t==`number`?`doub`:`UntF`:e===`Vrsn`?typeof t==`number`?`long`:`Objc`:e===`Rd `||e===`Grn `||e===`Bl `?n===`artd`?`long`:`doub`:e===`Trnf`?Array.isArray(t)?`VlLs`:`Objc`:e===`alpha`&&n===`slices`?`long`:(e===`Inpt`||e===`Otpt`)&&r._classID===`HsbP`?`enum`:(e===`Inpt`||e===`Otpt`)&&r._classID===`LvlA`?`VlLs`:e===`Intr`&&typeof t==`boolean`?`bool`:e===`PgPs`?`enum`:e===`LghD`&&r._classID===`oilPaint`?`long`:_[e]}function x(e){let t=(0,r.readInt32)(e);return(0,r.readAsciiString)(e,t||4)}function S(e,t){if(t.length===4&&t!==`warp`&&t!==`time`&&t!==`hold`&&t!==`list`&&t!==`json`)(0,i.writeInt32)(e,0),(0,i.writeSignature)(e,t);else{(0,i.writeInt32)(e,t.length);for(let n=0;n<t.length;n++)(0,i.writeUint8)(e,t.charCodeAt(n))}}function w(e,t){let n=F(e),i=t?{_name:n.name,_classID:n.classID}:{},a=(0,r.readUint32)(e);for(let n=0;n<a;n++){let n=x(e);i[n]=E(e,(0,r.readSignature)(e),t)}return i}e.outputSettingsRoot=`outputSettings`;function T(t,n,r,a,o){t.logMissingFeatures&&!r&&t.log(`Missing classId for: `,n,r,a),(0,i.writeUnicodeStringWithPadding)(t,n),o===e.outputSettingsRoot&&r===`null`?((0,i.writeInt32)(t,4),(0,i.writeSignature)(t,r)):S(t,r);let s=Object.keys(a).filter(e=>e!==`_name`&&e!==`_classID`&&a[e]!==void 0);(0,i.writeUint32)(t,s.length);for(let n of s){let d=b(n,a[n],o,a),f=o,g=u[n];r===e.cameraRawFilterClassID&&(d=e.cameraRawFilterKeyTypes[n]??`long`,f=e.cameraRawFilterClassID),n===`bounds`&&o===`text`?g=c(``,`bounds`):n===`origin`?(d=o===`slices`?`enum`:`Objc`,r===`PixelSource`&&(g=l,f=y)):n===`Ofst`&&o===e.layerStateRoot&&typeof a[n].Hrzn==`number`?(g=l,f=y):(n===`Cyn `||n===`Mgnt`||n===`Ylw `||n===`Blck`)&&a._classID===`CMYC`?d=`doub`:/^PN[a-z][a-z]$/.test(n)?d=`TEXT`:/^PT[a-z][a-z]$/.test(n)?d=`long`:/^PF[a-z][a-z]$/.test(n)||(n===`Rds `||n===`Thsh`)&&typeof a[n]==`number`&&a._classID===`SmrB`?d=`doub`:n===`ClSz`||n===`Rds `||n===`Amnt`?d=typeof a[n]==`number`?`long`:`UntF`:(n===`sdwM`||n===`hglM`)&&typeof a[n]==`string`||n===`blur`&&typeof a[n]==`string`?d=`enum`:n===`Hght`&&typeof a[n]==`number`&&a._classID===`Embs`||n===`Angl`&&typeof a[n]==`number`&&(a._classID===`Embs`||a._classID===`smartSharpen`||a._classID===`Twrl`||a._classID===`MtnB`)?d=`long`:n===`Angl`&&typeof a[n]==`number`?d=`doub`:n===`bounds`&&o===`slices`?(d=`Objc`,g=c(``,`Rct1`)):n===`Scl `?typeof a[n]==`object`&&`Hrzn`in a[n]?(d=`Objc`,g=l):d=typeof a[n]==`number`?`long`:`UntF`:n===`audioClipGroupList`&&s.length===1?d=`VlLs`:(n===`Strt`||n===`Brgh`)&&`H `in a?d=`doub`:n===`Wdth`&&typeof a[n]==`object`?d=`UntF`:n===`Ofst`&&typeof a[n]==`number`?d=`long`:n===`Strt`&&typeof a[n]==`object`?(d=`Objc`,g=l):p.indexOf(n)===-1?n===`profile`?d=r===`printOutput`||r===`proofSetup`?`TEXT`:`tdta`:n===`alis`&&typeof a[n]==`string`?d=/[^\x00-\xff]/.test(a[n])?`TEXT`:`alis`:n===`strokeStyleContent`?a[n][`Clr `]?g=c(``,`solidColorLayer`):a[n].Grad?g=c(``,`gradientLayer`):a[n].Ptrn?g=c(``,`patternLayer`):t.logMissingFeatures&&t.log(`Invalid strokeStyleContent value`,a[n]):n===`bounds`&&o===`quiltWarp`&&(g=c(``,`classFloatRect`)):d=r===`RGBC`&&o!==`artd`||m.indexOf(r)!==-1?`doub`:`long`,g&&g.classID===`RGBC`&&(`H `in a[n]?g={classID:`HSBC`,name:``}:`Cyn `in a[n]?g={classID:`CMYC`,name:``}:`Lmnc`in a[n]?g={classID:`LbCl`,name:``}:`Gry `in a[n]&&(g={classID:`Grsc`,name:``})),d||=h(a[n]),S(t,n),(0,i.writeSignature)(t,d||`long`),O(t,d||`long`,a[n],n,g,f),t.logMissingFeatures&&!d&&t.log(`Missing descriptor field type for: '${n}' in`,a)}}function E(e,t,n){switch(t){case`obj `:return M(e);case`Objc`:case`GlbO`:return w(e,n);case`VlLs`:{let t=(0,r.readInt32)(e),i=[];for(let a=0;a<t;a++){let t=(0,r.readSignature)(e);i.push(E(e,t,n))}return i}case`doub`:return(0,r.readFloat64)(e);case`UntF`:{let t=(0,r.readSignature)(e),n=(0,r.readFloat64)(e);if(!o[t])throw Error(`Invalid units: ${t}`);return{units:o[t],value:n}}case`UnFl`:{let t=(0,r.readSignature)(e),n=(0,r.readFloat32)(e);if(!o[t])throw Error(`Invalid units: ${t}`);return{units:o[t],value:n}}case`TEXT`:return(0,r.readUnicodeString)(e);case`enum`:return`${x(e)}.${x(e)}`;case`long`:return(0,r.readInt32)(e);case`comp`:{let t=(0,r.readUint32)(e);return{low:(0,r.readUint32)(e),high:t}}case`bool`:return!!(0,r.readUint8)(e);case`type`:case`GlbC`:return F(e);case`alis`:{let t=(0,r.readInt32)(e);return(0,r.readAsciiString)(e,t)}case`tdta`:{let t=(0,r.readInt32)(e);if(t>e.view.byteLength-e.offset)throw Error(`Invalid tdta length: ${t}`);return(0,r.readBytes)(e,t)}case`ObAr`:{(0,r.readInt32)(e),(0,r.readUnicodeString)(e),x(e);let t=(0,r.readInt32)(e),n=[];for(let i=0;i<t;i++){let t=x(e);(0,r.readSignature)(e),(0,r.readSignature)(e);let i=(0,r.readInt32)(e),a=[];for(let t=0;t<i;t++)a.push((0,r.readFloat64)(e));n.push({type:t,values:a})}return n}case`Pth `:{(0,r.readInt32)(e);let t=(0,r.readSignature)(e);(0,r.readInt32LE)(e);let n=(0,r.readInt32LE)(e);return{sig:t,path:(0,r.readUnicodeStringWithLengthLE)(e,n)}}default:throw Error(`Invalid TySh descriptor OSType: ${t} at ${e.offset.toString(16)}`)}}var D={meshPoints:`rationalPoint`,quiltSliceX:`UntF`,quiltSliceY:`UntF`};function O(t,n,r,a,o,c){switch(n){case`obj `:ee(t,a,r);break;case`Objc`:case`GlbO`:if(typeof r!=`object`)throw Error(`Invalid struct value: ${JSON.stringify(r)}, key: ${a}`);if(!o&&!r._classID)throw Error(`Missing ext type for: '${a}' (${JSON.stringify(r)})`);T(t,r._name||o?.name||``,r._classID||o.classID,r,c);break;case`VlLs`:if(!Array.isArray(r))throw Error(`Invalid list value: ${JSON.stringify(r)}, key: ${a}`);(0,i.writeInt32)(t,r.length);for(let n=0;n<r.length;n++){let o=c===e.cameraRawFilterClassID?`long`:g[a]??h(r[n]);(0,i.writeSignature)(t,o||`long`),O(t,o||`long`,r[n],`${a}[]`,d[a],c),t.logMissingFeatures&&!o&&t.log(`Missing descriptor array type for: '${a}' in`,r)}break;case`doub`:if(typeof r!=`number`)throw Error(`Invalid number value: ${JSON.stringify(r)}, key: ${a}`);(0,i.writeFloat64)(t,r);break;case`UntF`:if(!s[r.units])throw Error(`Invalid units: ${r.units} in ${a}`);(0,i.writeSignature)(t,s[r.units]),(0,i.writeFloat64)(t,r.value);break;case`UnFl`:if(!s[r.units])throw Error(`Invalid units: ${r.units} in ${a}`);(0,i.writeSignature)(t,s[r.units]),(0,i.writeFloat32)(t,r.value);break;case`TEXT`:(0,i.writeUnicodeStringWithPadding)(t,r);break;case`enum`:{if(typeof r!=`string`)throw Error(`Invalid enum value: ${JSON.stringify(r)}, key: ${a}`);let[e,n]=r.split(`.`);S(t,e),S(t,n);break}case`long`:if(typeof r!=`number`)throw Error(`Invalid integer value: ${JSON.stringify(r)}, key: ${a}`);(0,i.writeInt32)(t,Math.round(r));break;case`comp`:if(!r||typeof r!=`object`)throw Error(`Invalid large integer value: ${JSON.stringify(r)}, key: ${a}`);(0,i.writeUint32)(t,r.high>>>0),(0,i.writeUint32)(t,r.low>>>0);break;case`bool`:if(typeof r!=`boolean`)throw Error(`Invalid boolean value: ${JSON.stringify(r)}, key: ${a}`);(0,i.writeUint8)(t,+!!r);break;case`type`:case`GlbC`:if(!r||typeof r!=`object`)throw Error(`Invalid class value: ${JSON.stringify(r)}, key: ${a}`);(0,i.writeUnicodeStringWithPadding)(t,r.name||``),S(t,r.classID);break;case`alis`:if(typeof r!=`string`)throw Error(`Invalid alias value: ${JSON.stringify(r)}, key: ${a}`);(0,i.writeInt32)(t,r.length);for(let e=0;e<r.length;e++)(0,i.writeUint8)(t,r.charCodeAt(e)&255);break;case`tdta`:(0,i.writeInt32)(t,r.byteLength),(0,i.writeBytes)(t,r);break;case`ObAr`:{(0,i.writeInt32)(t,16),(0,i.writeUnicodeStringWithPadding)(t,``);let e=D[a];if(!e)throw Error(`Not implemented ObArType for: ${a}`);S(t,e),(0,i.writeInt32)(t,r.length);for(let e=0;e<r.length;e++){S(t,r[e].type),(0,i.writeSignature)(t,`UnFl`),(0,i.writeSignature)(t,`#Pxl`),(0,i.writeInt32)(t,r[e].values.length);for(let n=0;n<r[e].values.length;n++)(0,i.writeFloat64)(t,r[e].values[n])}break}case`Pth `:{let e=r.path+`\0`,n=12+e.length*2;(0,i.writeInt32)(t,n),(0,i.writeSignature)(t,r.sig),(0,i.writeInt32LE)(t,n),(0,i.writeInt32LE)(t,e.length),(0,i.writeUnicodeStringWithoutLengthLE)(t,e);break}default:throw Error(`Not implemented descriptor OSType: ${n}`)}}var A=[`prop`,`Clss`,`Enmr`,`rele`,`Idnt`,`indx`,`name`];function j(e){return!!e&&typeof e==`object`&&A.indexOf(e.type)!==-1}function M(e){let t=(0,r.readInt32)(e),n=[];for(let i=0;i<t;i++){let t=(0,r.readSignature)(e);switch(t){case`prop`:F(e),n.push(x(e));break;case`Clss`:n.push(F(e));break;case`Enmr`:{F(e);let t=x(e),r=x(e);n.push(`${t}.${r}`);break}case`rele`:F(e),n.push((0,r.readUint32)(e));break;case`Idnt`:case`indx`:n.push((0,r.readInt32)(e));break;case`name`:F(e),n.push((0,r.readUnicodeString)(e));break;default:throw Error(`Invalid descriptor reference type: ${t}`)}}return n}function N(e){if(typeof e==`string`){let t=/^([a-z ]{4}|[a-z]{5,})\.([a-z ]+)$/i.exec(e);return t?{type:`Enmr`,_name:``,_classID:t[1],typeID:t[1],enumValue:t[2]}:{type:`name`,_name:``,_classID:`Lyr `,value:e}}if(typeof e==`number`)return{type:`Idnt`,value:e};if(e&&typeof e==`object`&&typeof e.classID==`string`)return{type:`Clss`,_name:e.name||``,_classID:e.classID};throw Error(`Invalid descriptor reference value: ${JSON.stringify(e)}`)}function P(e){return e.map(e=>{let t=N(e);return t.type===`Enmr`&&(t._classID=`Path`),t})}function ee(e,t,n){if(!Array.isArray(n))throw Error(`Invalid reference value: ${JSON.stringify(n)}, key: ${t}`);(0,i.writeInt32)(e,n.length);for(let t of n){let n=j(t)?t:N(t);switch((0,i.writeSignature)(e,n.type),n.type){case`prop`:I(e,n._name||``,n._classID),S(e,n.keyID);break;case`Clss`:I(e,n._name||``,n._classID);break;case`Enmr`:I(e,n._name||``,n._classID),S(e,n.typeID),S(e,n.enumValue);break;case`rele`:I(e,n._name||``,n._classID),(0,i.writeUint32)(e,n.value);break;case`Idnt`:case`indx`:(0,i.writeInt32)(e,n.value);break;case`name`:I(e,n._name||``,n._classID),(0,i.writeUnicodeStringWithPadding)(e,`${n.value}`);break;default:throw Error(`Invalid descriptor reference type: ${n.type}`)}}return n}function F(e){return{name:(0,r.readUnicodeString)(e),classID:x(e)}}function I(e,t,n){(0,i.writeUnicodeStringWithPadding)(e,t),S(e,n)}function te(e,t=!1){let n=(0,r.readUint32)(e);if(n!==16)throw Error(`Invalid descriptor version: ${n}`);return w(e,t)}function ne(e,t,n,r,a=``){(0,i.writeUint32)(e,16),T(e,t,n,r,a)}function re(e){return{x:e.Hrzn,y:e.Vrtc}}function ie(e){return{Hrzn:e.x,Vrtc:e.y}}function ae(e){return{top:Y(e[`Top `]),left:Y(e.Left),right:Y(e.Rght),bottom:Y(e.Btom)}}function oe(e){return{Left:$(e.left,`bounds.left`),"Top ":$(e.top,`bounds.top`),Rght:$(e.right,`bounds.right`),Btom:$(e.bottom,`bounds.bottom`)}}function se(t){let n={enabled:!!t.enab,position:e.FStl.decode(t.Styl),fillType:e.FrFl.decode(t.PntT),blendMode:e.BlnM.decode(t[`Md `]),opacity:J(t.Opct),size:X(t[`Sz `])};return t.present!==void 0&&(n.present=t.present),t.showInDialog!==void 0&&(n.showInDialog=t.showInDialog),t.overprint!==void 0&&(n.overprint=t.overprint),t[`Clr `]&&(n.color=xe(t[`Clr `])),t.Grad&&(n.gradient=B(t)),t.Ptrn&&(n.pattern=H(t)),n}function ce(t){let n={};return n.enab=!!t.enabled,t.present!==void 0&&(n.present=!!t.present),t.showInDialog!==void 0&&(n.showInDialog=!!t.showInDialog),n.Styl=e.FStl.encode(t.position),n.PntT=e.FrFl.encode(t.fillType),n[`Md `]=e.BlnM.encode(t.blendMode),n.Opct=Ee(t.opacity),n[`Sz `]=$(t.size,`size`),t.color&&(n[`Clr `]=q(t.color)),t.gradient&&(n=Object.assign(Object.assign({},n),U(t.gradient))),t.pattern&&(n=Object.assign(Object.assign({},n),ve(t.pattern))),t.overprint!==void 0&&(n.overprint=!!t.overprint),n}function L(e,t,n){let r=n?{"Scl ":Q(e.scale??1),masterFXSwitch:!e.disabled}:{masterFXSwitch:!e.disabled,"Scl ":Q(e.scale??1)};for(let t of[`dropShadow`,`innerShadow`,`solidFill`,`gradientOverlay`,`stroke`])if(e[t]&&!Array.isArray(e[t]))throw Error(`${t} should be an array`);let i=e=>!!e&&e.length>1&&n,a=e=>!!e&&e.length>=1&&(!n||e.length===1);if(a(e.dropShadow)&&(r.DrSh=me(e.dropShadow[0],`dropShadow`,t)),i(e.dropShadow)&&(r.dropShadowMulti=e.dropShadow.map(e=>me(e,`dropShadow`,t))),a(e.innerShadow)&&(r.IrSh=me(e.innerShadow[0],`innerShadow`,t)),i(e.innerShadow)&&(r.innerShadowMulti=e.innerShadow.map(e=>me(e,`innerShadow`,t))),e.outerGlow&&(r.OrGl=me(e.outerGlow,`outerGlow`,t)),i(e.solidFill)&&(r.solidFillMulti=e.solidFill.map(e=>me(e,`solidFill`,t))),i(e.gradientOverlay)&&(r.gradientFillMulti=e.gradientOverlay.map(e=>me(e,`gradientOverlay`,t))),i(e.stroke)&&(r.frameFXMulti=e.stroke.map(e=>ce(e))),e.innerGlow&&(r.IrGl=me(e.innerGlow,`innerGlow`,t)),e.bevel&&(r.ebbl=me(e.bevel,`bevel`,t)),a(e.solidFill)&&(r.SoFi=me(e.solidFill[0],`solidFill`,t)),e.patternOverlay&&(r.patternFill=me(e.patternOverlay,`patternOverlay`,t)),a(e.gradientOverlay)&&(r.GrFl=me(e.gradientOverlay[0],`gradientOverlay`,t)),e.satin&&(r.ChFX=me(e.satin,`satin`,t)),a(e.stroke)&&(r.FrFX=ce(e.stroke?.[0])),n){r.numModifyingFX=0;for(let t of Object.keys(e)){let n=e[t];if(!(typeof n!=`object`||!n)){if(Array.isArray(n))for(let e of n)e?.enabled&&r.numModifyingFX++;else n.enabled&&r.numModifyingFX++}}}return r}function le(e,n){let r={},i=e,{_name:a,_classID:o,"Scl ":s,masterFXSwitch:c,DrSh:l,dropShadowMulti:u,IrSh:d,innerShadowMulti:f,OrGl:p,IrGl:m,ebbl:h,SoFi:g,solidFillMulti:_,patternFill:v,GrFl:y,gradientFillMulti:b,ChFX:x,FrFX:S,frameFXMulti:C,numModifyingFX:w}=i,T=t(i,[`_name`,`_classID`,`Scl `,`masterFXSwitch`,`DrSh`,`dropShadowMulti`,`IrSh`,`innerShadowMulti`,`OrGl`,`IrGl`,`ebbl`,`SoFi`,`solidFillMulti`,`patternFill`,`GrFl`,`gradientFillMulti`,`ChFX`,`FrFX`,`frameFXMulti`,`numModifyingFX`]);return c||(r.disabled=!0),s&&(r.scale=J(s)),l&&(r.dropShadow=[R(l,n)]),u&&(r.dropShadow=u.map(e=>R(e,n))),d&&(r.innerShadow=[R(d,n)]),f&&(r.innerShadow=f.map(e=>R(e,n))),p&&(r.outerGlow=R(p,n)),m&&(r.innerGlow=R(m,n)),h&&(r.bevel=R(h,n,`bevel`)),g&&(r.solidFill=[R(g,n)]),_&&(r.solidFill=_.map(e=>R(e,n))),v&&(r.patternOverlay=R(v,n)),y&&(r.gradientOverlay=[R(y,n)]),b&&(r.gradientOverlay=b.map(e=>R(e,n))),x&&(r.satin=R(x,n)),S&&(r.stroke=[se(S)]),C&&(r.stroke=C.map(e=>se(e))),n.logMissingFeatures&&Object.keys(T).length&&n.log(`Unhandled effect keys:`,T),r}function ue(t,n){let r=[];for(let i=0;i<t.length;i++){let a=t[i],{time:{denominator:o,numerator:s},selected:c,animKey:l}=a,u={numerator:s,denominator:o},d=e.animInterpStyleEnum.decode(a.animInterpStyle);switch(l.Type){case`keyType.Opct`:r.push({interpolation:d,time:u,selected:c,type:`opacity`,value:J(l.Opct)});break;case`keyType.Pstn`:r.push({interpolation:d,time:u,selected:c,type:`position`,x:l.Hrzn,y:l.Vrtc});break;case`keyType.Trnf`:r.push({interpolation:d,time:u,selected:c,type:`transform`,scale:re(l[`Scl `]),skew:re(l.Skew),rotation:l.rotation,translation:re(l.translation)});break;case`keyType.sheetStyle`:{let e={interpolation:d,time:u,selected:c,type:`style`};l.sheetStyle.Lefx&&(e.style=le(l.sheetStyle.Lefx,n)),r.push(e);break}case`keyType.globalLighting`:r.push({interpolation:d,time:u,selected:c,type:`globalLighting`,globalAngle:l.gblA,globalAltitude:l.globalAltitude});break;default:throw Error(`Unsupported keyType value`)}}return r}function de(t,n){let r=[];for(let i=0;i<t.length;i++){let a=t[i],{time:o,selected:s=!1,interpolation:c}=a,l=e.animInterpStyleEnum.encode(c),u;switch(a.type){case`opacity`:u={Type:`keyType.Opct`,Opct:Ee(a.value)};break;case`position`:u={Type:`keyType.Pstn`,Hrzn:a.x,Vrtc:a.y};break;case`transform`:u={Type:`keyType.Trnf`,"Scl ":ie(a.scale),Skew:ie(a.skew),rotation:a.rotation,translation:ie(a.translation)};break;case`style`:u={Type:`keyType.sheetStyle`,sheetStyle:{Vrsn:1,blendOptions:{}}},a.style&&(u.sheetStyle={Vrsn:1,Lefx:L(a.style,n,!1),blendOptions:{}});break;case`globalLighting`:u={Type:`keyType.globalLighting`,gblA:a.globalAngle,globalAltitude:a.globalAltitude};break;default:throw Error(`Unsupported keyType value`)}r.push({Vrsn:1,animInterpStyle:l,time:o,animKey:u,selected:s})}return r}function fe(t,n){let r=[];for(let i=0;i<t.length;i++){let a=t[i],o={type:e.stdTrackID.decode(a.trackID),enabled:a.enab,keys:ue(a.keyList,n)};a.effectParams&&(o.effectParams={fillCanvas:a.effectParams.fillCanvas,zoomOrigin:a.effectParams.zoomOrigin,keys:ue(a.effectParams.keyList,n)}),r.push(o)}return r}function pe(t,n){let r=[];for(let i=0;i<t.length;i++){let a=t[i];r.push(Object.assign(Object.assign({trackID:e.stdTrackID.encode(a.type),Vrsn:1,enab:!!a.enabled,Effc:!!a.effectParams},a.effectParams?{effectParams:{keyList:de(a.effectParams.keys,n),fillCanvas:a.effectParams.fillCanvas,zoomOrigin:a.effectParams.zoomOrigin}}:{}),{keyList:de(a.keys,n)}))}return r}function R(t,n,r){let i={};for(let a of Object.keys(t)){let o=t[a];switch(a){case`enab`:i.enabled=!!o;break;case`uglg`:i.useGlobalLight=!!o;break;case`AntA`:i.antialiased=!!o;break;case`Algn`:i.align=!!o;break;case`Dthr`:i.dither=!!o;break;case`Invr`:i.invert=!!o;break;case`Rvrs`:i.reverse=!!o;break;case`Clr `:i.color=xe(o);break;case`hglC`:i.highlightColor=xe(o);break;case`sdwC`:i.shadowColor=xe(o);break;case`Styl`:i.position=e.FStl.decode(o);break;case`Md `:i.blendMode=e.BlnM.decode(o);break;case`hglM`:i.highlightBlendMode=e.BlnM.decode(o);break;case`sdwM`:i.shadowBlendMode=e.BlnM.decode(o);break;case`bvlS`:i.style=e.BESl.decode(o);break;case`bvlD`:i.direction=e.BESs.decode(o);break;case`bvlT`:i.technique=e.bvlT.decode(o);break;case`GlwT`:i.technique=e.BETE.decode(o);break;case`glwS`:i.source=e.IGSr.decode(o);break;case`Type`:i.type=e.GrdT.decode(o);break;case`gs99`:case`gradientsInterpolationMethod`:i.interpolationMethod=e.gradientInterpolationMethodType.decode(o);break;case`Opct`:i.opacity=J(o);break;case`hglO`:i.highlightOpacity=J(o);break;case`sdwO`:i.shadowOpacity=J(o);break;case`lagl`:i.angle=Ce(o);break;case`Angl`:i.angle=Ce(o);break;case`Lald`:i.altitude=Ce(o);break;case`Sftn`:i.soften=Y(o);break;case`srgR`:i.strength=J(o);break;case`blur`:i.size=Y(o);break;case`Nose`:i.noise=J(o);break;case`Inpr`:i.range=J(o);break;case`Ckmt`:i.choke=Y(o);break;case`ShdN`:i.jitter=J(o);break;case`Dstn`:i.distance=Y(o);break;case`Scl `:i.scale=J(o);break;case`Ptrn`:i.pattern={name:o[`Nm `],id:o.Idnt};break;case`phase`:i.phase=V(o);break;case`Ofst`:i.offset={x:J(o.Hrzn),y:J(o.Vrtc)};break;case`MpgS`:case`TrnS`:{let e={name:o[`Nm `],curve:o[`Crv `].map(e=>e.Cnty===void 0?{x:e.Hrzn,y:e.Vrtc}:{x:e.Hrzn,y:e.Vrtc,curved:e.Cnty})};r===`bevel`&&a===`MpgS`?i.shapeContour=e:i.contour=e;break}case`Grad`:i.gradient=he(o);break;case`useTexture`:case`useShape`:case`layerConceals`:case`present`:case`showInDialog`:case`antialiasGloss`:i[a]=o;break;case`_name`:case`_classID`:break;default:n.logMissingFeatures&&n.log(`Invalid effect key: '${a}', value:`,o)}}return i}function me(t,n,r){let i={enab:!1};n===`dropShadow`&&(i.TrnS={"Nm ":``,"Crv ":[]});for(let a of Object.keys(t)){let o=a,s=t[o];switch(o){case`enabled`:i.enab=!!s;break;case`useGlobalLight`:i.uglg=!!s;break;case`antialiased`:i.AntA=!!s;break;case`align`:i.Algn=!!s;break;case`dither`:i.Dthr=!!s;break;case`invert`:i.Invr=!!s;break;case`reverse`:i.Rvrs=!!s;break;case`color`:i[`Clr `]=q(s);break;case`highlightColor`:i.hglC=q(s);break;case`shadowColor`:i.sdwC=q(s);break;case`position`:i.Styl=e.FStl.encode(s);break;case`blendMode`:i[`Md `]=e.BlnM.encode(s);break;case`highlightBlendMode`:i.hglM=e.BlnM.encode(s);break;case`shadowBlendMode`:i.sdwM=e.BlnM.encode(s);break;case`style`:i.bvlS=e.BESl.encode(s);break;case`direction`:i.bvlD=e.BESs.encode(s);break;case`technique`:n===`bevel`?i.bvlT=e.bvlT.encode(s):i.GlwT=e.BETE.encode(s);break;case`source`:i.glwS=e.IGSr.encode(s);break;case`type`:i.Type=e.GrdT.encode(s);break;case`interpolationMethod`:i[n===`outerGlow`||n===`innerGlow`?`gradientsInterpolationMethod`:`gs99`]=e.gradientInterpolationMethodType.encode(s);break;case`opacity`:i.Opct=Ee(s);break;case`highlightOpacity`:i.hglO=Ee(s);break;case`shadowOpacity`:i.sdwO=Ee(s);break;case`angle`:n===`gradientOverlay`||n===`patternOverlay`?i.Angl=Z(s):i.lagl=Z(s);break;case`altitude`:i.Lald=Z(s);break;case`soften`:i.Sftn=$(s,o);break;case`strength`:i.srgR=Ee(s);break;case`size`:i.blur=$(s,o);break;case`noise`:i.Nose=Ee(s);break;case`range`:i.Inpr=Ee(s);break;case`choke`:i.Ckmt=$(s,o);break;case`jitter`:i.ShdN=Ee(s);break;case`distance`:i.Dstn=$(s,o);break;case`scale`:i[`Scl `]=Ee(s);break;case`pattern`:i.Ptrn={"Nm ":s.name,Idnt:s.id};break;case`phase`:i.phase={Hrzn:s.x,Vrtc:s.y};break;case`offset`:i.Ofst={Hrzn:Q(s.x),Vrtc:Q(s.y)};break;case`contour`:i[n===`satin`?`MpgS`:`TrnS`]=z(s);break;case`shapeContour`:i.MpgS=z(s);break;case`gradient`:i.Grad=ge(s);break;case`useTexture`:case`useShape`:case`layerConceals`:case`present`:case`showInDialog`:case`antialiasGloss`:i[o]=s;break;default:r.logMissingFeatures&&r.log(`Invalid effect key: '${o}', value:`,s)}}return i}function z(e){return{"Nm ":e.name,"Crv ":e.curve.map(e=>e.curved===void 0?{Hrzn:e.x,Vrtc:e.y}:{Hrzn:e.x,Vrtc:e.y,Cnty:!!e.curved})}}function he(t){if(t.GrdF===`GrdF.CstS`){let n=4096;return{type:`solid`,name:t[`Nm `],smoothness:t.Intr/4096,colorStops:t.Clrs.map(t=>{let r={color:t[`Clr `]?xe(t[`Clr `]):{r:0,g:0,b:0},location:t.Lctn/n,midpoint:t.Mdpn/100};if(t.Type)try{let n=e.Clry.decode(t.Type);n!==`user`&&(r.type=n)}catch{}return r}),opacityStops:t.Trns.map(e=>({opacity:J(e.Opct),location:e.Lctn/n,midpoint:e.Mdpn/100}))}}return{type:`noise`,name:t[`Nm `],roughness:t.Smth/4096,colorModel:e.ClrS.decode(t.ClrS),randomSeed:t.RndS,restrictColors:!!t.VctC,addTransparency:!!t.ShTr,min:t[`Mnm `].map(e=>e/100),max:t[`Mxm `].map(e=>e/100)}}function ge(t){if(t.type===`solid`){let n=4096;return{"Nm ":t.name||``,GrdF:`GrdF.CstS`,Intr:Math.round((t.smoothness??1)*4096),Clrs:t.colorStops.map(t=>({"Clr ":q(t.color),Type:e.Clry.encode(t.type??`user`),Lctn:Math.round(t.location*n),Mdpn:Math.round((t.midpoint??.5)*100)})),Trns:t.opacityStops.map(e=>({Opct:Q(e.opacity),Lctn:Math.round(e.location*n),Mdpn:Math.round((e.midpoint??.5)*100)}))}}return{GrdF:`GrdF.ClNs`,"Nm ":t.name||``,ShTr:!!t.addTransparency,VctC:!!t.restrictColors,ClrS:e.ClrS.encode(t.colorModel),RndS:t.randomSeed||0,Smth:Math.round((t.roughness??1)*4096),"Mnm ":(t.min||[0,0,0,0]).map(e=>Math.round(e*100)),"Mxm ":(t.max||[1,1,1,1]).map(e=>Math.round(e*100))}}function B(t){let n=he(t.Grad);return n.style=e.GrdT.decode(t.Type),t.Dthr!==void 0&&(n.dither=t.Dthr),t.gradientsInterpolationMethod!==void 0&&(n.interpolationMethod=e.gradientInterpolationMethodType.decode(t.gradientsInterpolationMethod)),t.Rvrs!==void 0&&(n.reverse=t.Rvrs),t.Angl!==void 0&&(n.angle=Ce(t.Angl)),t[`Scl `]!==void 0&&(n.scale=J(t[`Scl `])),t.Algn!==void 0&&(n.align=t.Algn),t.Ofst!==void 0&&(n.offset={x:J(t.Ofst.Hrzn),y:J(t.Ofst.Vrtc)}),t.gradientAspectRatio!==void 0&&(n.aspectRatio=t.gradientAspectRatio),t.noisePreSeed!==void 0&&(n.noisePreSeed=t.noisePreSeed),n}function V({Hrzn:e,Vrtc:t}){return{x:typeof e==`number`?e:e.value,y:typeof t==`number`?t:t.value}}function H(e){let t={name:e.Ptrn[`Nm `],id:e.Ptrn.Idnt};return e.Algn!==void 0&&(t.align=e.Algn),e.Lnkd!==void 0&&(t.linked=e.Lnkd),e.phase!==void 0&&(t.phase=V(e.phase)),e[`Scl `]!==void 0&&(t.scale=J(e[`Scl `])),e.Angl!==void 0&&(t.angle=Ce(e.Angl)),t}function _e(e){if(`Grad`in e)return B(e);if(`Ptrn`in e)return Object.assign({type:`pattern`},H(e));if(`Clr `in e)return{type:`color`,color:xe(e[`Clr `])};throw Error(`Invalid vector content`)}function U(t){let n={};return t.dither!==void 0&&(n.Dthr=t.dither),t.interpolationMethod!==void 0&&(n.gradientsInterpolationMethod=e.gradientInterpolationMethodType.encode(t.interpolationMethod)),t.reverse!==void 0&&(n.Rvrs=t.reverse),t.aspectRatio!==void 0&&(n.gradientAspectRatio=t.aspectRatio),t.angle!==void 0&&(n.Angl=Z(t.angle)),n.Type=e.GrdT.encode(t.style),t.align!==void 0&&(n.Algn=t.align),t.scale!==void 0&&(n[`Scl `]=Q(t.scale)),t.offset&&(n.Ofst={Hrzn:Q(t.offset.x),Vrtc:Q(t.offset.y)}),t.noisePreSeed!==void 0&&(n.noisePreSeed=t.noisePreSeed),n.Grad=ge(t),n}function ve(e){let t={Ptrn:{"Nm ":e.name||``,Idnt:e.id||``}};return e.align!==void 0&&(t.Algn=!!e.align),e.linked!==void 0&&(t.Lnkd=!!e.linked),e.phase!==void 0&&(t.phase={Hrzn:e.phase.x,Vrtc:e.phase.y}),e.scale!==void 0&&(t[`Scl `]=Q(e.scale)),e.angle!==void 0&&(t.Angl=Z(e.angle)),t}function ye(e){return e.type===`color`?{key:`SoCo`,descriptor:{"Clr ":q(e.color)}}:e.type===`pattern`?{key:`PtFl`,descriptor:ve(e)}:{key:`GdFl`,descriptor:U(e)}}var W={"H ":[e=>e/360,e=>e*360],Strt:[e=>e/100,e=>e*100],Brgh:[e=>e/100,e=>e*100],"Cyn ":[e=>e*255/100,e=>e*100/255],Mgnt:[e=>e*255/100,e=>e*100/255],"Ylw ":[e=>e*255/100,e=>e*100/255],Blck:[e=>e*255/100,e=>e*100/255],"Gry ":[e=>e*255/100,e=>e*100/255],Lmnc:[e=>e/100,e=>e*100],"A ":[n.normalizeLabAB,n.denormalizeLabAB],"B ":[n.normalizeLabAB,n.denormalizeLabAB]};function G(e,t){let n=W[e];if(!n)return t;let[r,i]=n,a=i(t);if(!isFinite(a))return a;for(let e=1;e<17;e++){let n=+a.toPrecision(e);if(r(n)===t)return n}return a}function be(e){return e._classID===`BkCl`||`Bk `in e||`bookID`in e}function xe(e){let t=K(e);if(be(e)){let n=e,r=n.bookKey;t.book={book:n[`Bk `]??``,name:n[`Nm `]??``,bookID:n.bookID??0,bookKey:typeof r==`string`?r:r?String.fromCharCode(...Array.from(r)):``}}return t}function K(e){if(`H `in e)return{h:we(e[`H `]),s:e.Strt/100,b:e.Brgh/100};if(`Rd `in e)return{r:e[`Rd `],g:e[`Grn `],b:e[`Bl `]};if(`Cyn `in e)return{c:e[`Cyn `]*255/100,m:e.Mgnt*255/100,y:e[`Ylw `]*255/100,k:e.Blck*255/100};if(`Gry `in e)return{k:e[`Gry `]*255/100};if(`Lmnc`in e)return{l:e.Lmnc/100,a:(0,n.normalizeLabAB)(e[`A `]),b:(0,n.normalizeLabAB)(e[`B `])};if(`redFloat`in e)return{fr:e.redFloat,fg:e.greenFloat,fb:e.blueFloat};if(be(e))return{r:0,g:0,b:0};throw Error(`Unsupported color descriptor`)}function q(e){let t=Se(e);if(e?.book){let{book:n,name:r,bookID:i,bookKey:a}=e.book,o=new Uint8Array(a.length);for(let e=0;e<o.length;e++)o[e]=a.charCodeAt(e)&255;Object.assign(t,{"Bk ":n,"Nm ":r,bookID:i,bookKey:o})}return t}function Se(e){if(!e)return{_name:``,_classID:`RGBC`,"Rd ":0,"Grn ":0,"Bl ":0};if(`r`in e)return{_name:``,_classID:`RGBC`,"Rd ":e.r||0,"Grn ":e.g||0,"Bl ":e.b||0};if(`fr`in e)return{_name:``,_classID:`RGBC`,redFloat:e.fr,greenFloat:e.fg,blueFloat:e.fb};if(`h`in e)return{_name:``,_classID:`HSBC`,"H ":Z(G(`H `,e.h||0)),Strt:G(`Strt`,e.s||0),Brgh:G(`Brgh`,e.b||0)};if(`c`in e)return{_name:``,_classID:`CMYC`,"Cyn ":G(`Cyn `,e.c||0),Mgnt:G(`Mgnt`,e.m||0),"Ylw ":G(`Ylw `,e.y||0),Blck:G(`Blck`,e.k||0)};if(`l`in e)return{_name:``,_classID:`LbCl`,Lmnc:G(`Lmnc`,e.l||0),"A ":G(`A `,e.a||0),"B ":G(`B `,e.b||0)};if(`k`in e)return{_name:``,_classID:`Grsc`,"Gry ":G(`Gry `,e.k||0)};throw Error(`Invalid color value`)}function Ce(e){if(e===void 0)return 0;if(e.units!==`Angle`)throw Error(`Invalid units: ${e.units}`);return e.value}function J(e){if(e===void 0)return 1;if(e.units!==`Percent`)throw Error(`Invalid units: ${e.units}`);return e.value/100}function we(e){if(e===void 0)return 1;if(e.units===`Percent`)return e.value/100;if(e.units===`Angle`)return e.value/360;throw Error(`Invalid units: ${e.units}`)}function Y({units:e,value:t}){if(e!==`Pixels`&&e!==`Millimeters`&&e!==`Points`&&e!==`None`&&e!==`Picas`&&e!==`Inches`&&e!==`Centimeters`&&e!==`Density`&&e!==`Distance`)throw Error(`Invalid units: ${JSON.stringify({units:e,value:t})}`);return{value:t,units:e}}function X(e,t=`Pixels`){return typeof e==`number`?{value:e,units:t}:Y(e)}function Te({units:e,value:t},n){if(e!==n)throw Error(`Invalid units: ${JSON.stringify({units:e,value:t})}`);return t}function Z(e){return{units:`Angle`,value:e||0}}function Ee(e){return{units:`Percent`,value:Math.round((e||0)*100)}}function Q(e){return{units:`Percent`,value:(e||0)*100}}function $(e,t){if(e==null)return{units:`Pixels`,value:0};if(typeof e!=`object`)throw Error(`Invalid value: ${JSON.stringify(e)} (key: ${t}) (should have value and units)`);let{units:n,value:r}=e;if(typeof r!=`number`)throw Error(`Invalid value in ${JSON.stringify(e)} (key: ${t})`);if(n!==`Pixels`&&n!==`Millimeters`&&n!==`Points`&&n!==`None`&&n!==`Picas`&&n!==`Inches`&&n!==`Centimeters`&&n!==`Density`&&n!==`Distance`)throw Error(`Invalid units in ${JSON.stringify(e)} (key: ${t})`);return{units:n,value:r}}function De({numerator:e,denominator:t}){return{numerator:e,denominator:t}}e.textGridding=(0,n.createEnum)(`textGridding`,`none`,{none:`None`,round:`Rnd `}),e.Ornt=(0,n.createEnum)(`Ornt`,`horizontal`,{horizontal:`Hrzn`,vertical:`Vrtc`}),e.Annt=(0,n.createEnum)(`Annt`,`sharp`,{none:`Anno`,sharp:`antiAliasSharp`,crisp:`AnCr`,strong:`AnSt`,smooth:`AnSm`,platform:`antiAliasPlatformGray`,platformLCD:`antiAliasPlatformLCD`}),e.warpStyle=(0,n.createEnum)(`warpStyle`,`none`,{none:`warpNone`,arc:`warpArc`,arcLower:`warpArcLower`,arcUpper:`warpArcUpper`,arch:`warpArch`,bulge:`warpBulge`,shellLower:`warpShellLower`,shellUpper:`warpShellUpper`,flag:`warpFlag`,wave:`warpWave`,fish:`warpFish`,rise:`warpRise`,fisheye:`warpFisheye`,inflate:`warpInflate`,squeeze:`warpSqueeze`,twist:`warpTwist`,cylinder:`warpCylinder`,custom:`warpCustom`}),e.BlnM=(0,n.createEnum)(`BlnM`,`normal`,{normal:`Nrml`,dissolve:`Dslv`,darken:`Drkn`,multiply:`Mltp`,"color burn":`CBrn`,"linear burn":`linearBurn`,"darker color":`darkerColor`,lighten:`Lghn`,screen:`Scrn`,"color dodge":`CDdg`,"linear dodge":`linearDodge`,"lighter color":`lighterColor`,overlay:`Ovrl`,"soft light":`SftL`,"hard light":`HrdL`,"vivid light":`vividLight`,"linear light":`linearLight`,"pin light":`pinLight`,"hard mix":`hardMix`,difference:`Dfrn`,exclusion:`Xclu`,subtract:`blendSubtraction`,divide:`blendDivide`,hue:`H `,saturation:`Strt`,color:`Clr `,luminosity:`Lmns`,"linear height":`linearHeight`,height:`Hght`,subtraction:`Sbtr`,"pass through":`passThrough`}),e.BESl=(0,n.createEnum)(`BESl`,`inner bevel`,{"inner bevel":`InrB`,"outer bevel":`OtrB`,emboss:`Embs`,"pillow emboss":`PlEb`,"stroke emboss":`strokeEmboss`}),e.bvlT=(0,n.createEnum)(`bvlT`,`smooth`,{smooth:`SfBL`,"chisel hard":`PrBL`,"chisel soft":`Slmt`}),e.BESs=(0,n.createEnum)(`BESs`,`up`,{up:`In `,down:`Out `}),e.BETE=(0,n.createEnum)(`BETE`,`softer`,{softer:`SfBL`,precise:`PrBL`}),e.IGSr=(0,n.createEnum)(`IGSr`,`edge`,{edge:`SrcE`,center:`SrcC`}),e.GrdT=(0,n.createEnum)(`GrdT`,`linear`,{linear:`Lnr `,radial:`Rdl `,angle:`Angl`,reflected:`Rflc`,diamond:`Dmnd`}),e.animInterpStyleEnum=(0,n.createEnum)(`animInterpStyle`,`linear`,{linear:`Lnr `,hold:`hold`}),e.stdTrackID=(0,n.createEnum)(`stdTrackID`,`opacity`,{opacity:`opacityTrack`,style:`styleTrack`,sheetTransform:`sheetTransformTrack`,sheetPosition:`sheetPositionTrack`,globalLighting:`globalLightingTrack`}),e.gradientInterpolationMethodType=(0,n.createEnum)(`gradientInterpolationMethodType`,`perceptual`,{perceptual:`Perc`,linear:`Lnr `,classic:`Gcls`,smooth:`Smoo`}),e.Clry=(0,n.createEnum)(`Clry`,`user`,{user:`UsrS`,foreground:`FrgC`,background:`BckC`}),e.ClrS=(0,n.createEnum)(`ClrS`,`rgb`,{rgb:`RGBC`,hsb:`HSBl`,lab:`LbCl`,hsl:`HSLC`}),e.FStl=(0,n.createEnum)(`FStl`,`outside`,{outside:`OutF`,center:`CtrF`,inside:`InsF`}),e.FrFl=(0,n.createEnum)(`FrFl`,`color`,{color:`SClr`,gradient:`GrFl`,pattern:`Ptrn`}),e.ESliceType=(0,n.createEnum)(`ESliceType`,`image`,{image:`Img `,noImage:`noImage`}),e.ESliceHorzAlign=(0,n.createEnum)(`ESliceHorzAlign`,`default`,{default:`default`}),e.ESliceVertAlign=(0,n.createEnum)(`ESliceVertAlign`,`default`,{default:`default`}),e.ESliceOrigin=(0,n.createEnum)(`ESliceOrigin`,`userGenerated`,{userGenerated:`userGenerated`,autoGenerated:`autoGenerated`,layer:`layer`}),e.ESliceBGColorType=(0,n.createEnum)(`ESliceBGColorType`,`none`,{none:`None`,matte:`matte`,color:`Clr `}),e.strokeStyleLineCapType=(0,n.createEnum)(`strokeStyleLineCapType`,`butt`,{butt:`strokeStyleButtCap`,round:`strokeStyleRoundCap`,square:`strokeStyleSquareCap`}),e.strokeStyleLineJoinType=(0,n.createEnum)(`strokeStyleLineJoinType`,`miter`,{miter:`strokeStyleMiterJoin`,round:`strokeStyleRoundJoin`,bevel:`strokeStyleBevelJoin`}),e.strokeStyleLineAlignment=(0,n.createEnum)(`strokeStyleLineAlignment`,`inside`,{inside:`strokeStyleAlignInside`,center:`strokeStyleAlignCenter`,outside:`strokeStyleAlignOutside`}),e.BlrM=(0,n.createEnum)(`BlrM`,`spin`,{spin:`Spn `,zoom:`Zm `}),e.BlrQ=(0,n.createEnum)(`BlrQ`,`good`,{draft:`Drft`,good:`Gd `,best:`Bst `}),e.SmBM=(0,n.createEnum)(`SmBM`,`normal`,{normal:`SBMN`,"edge only":`SBME`,"overlay edge":`SBMO`}),e.SmBQ=(0,n.createEnum)(`SmBQ`,`medium`,{low:`SBQL`,medium:`SBQM`,high:`SBQH`}),e.DspM=(0,n.createEnum)(`DspM`,`stretch to fit`,{"stretch to fit":`StrF`,tile:`Tile`}),e.UndA=(0,n.createEnum)(`UndA`,`repeat edge pixels`,{"wrap around":`WrpA`,"repeat edge pixels":`RptE`}),e.Cnvr=(0,n.createEnum)(`Cnvr`,`rectangular to polar`,{"rectangular to polar":`RctP`,"polar to rectangular":`PlrR`}),e.RplS=(0,n.createEnum)(`RplS`,`medium`,{small:`Sml `,medium:`Mdm `,large:`Lrg `}),e.SphM=(0,n.createEnum)(`SphM`,`normal`,{normal:`Nrml`,"horizontal only":`HrzO`,"vertical only":`VrtO`}),e.Wvtp=(0,n.createEnum)(`Wvtp`,`sine`,{sine:`WvSn`,triangle:`WvTr`,square:`WvSq`}),e.ZZTy=(0,n.createEnum)(`ZZTy`,`pond ripples`,{"around center":`ArnC`,"out from center":`OtFr`,"pond ripples":`PndR`}),e.Dstr=(0,n.createEnum)(`Dstr`,`uniform`,{uniform:`Unfr`,gaussian:`Gsn `}),e.Chnl=(0,n.createEnum)(`Chnl`,`composite`,{red:`Rd `,green:`Grn `,blue:`Bl `,composite:`Cmps`}),e.MztT=(0,n.createEnum)(`MztT`,`fine dots`,{"fine dots":`FnDt`,"medium dots":`MdmD`,"grainy dots":`GrnD`,"coarse dots":`CrsD`,"short lines":`ShrL`,"medium lines":`MdmL`,"long lines":`LngL`,"short strokes":`ShSt`,"medium strokes":`MdmS`,"long strokes":`LngS`}),e.Lns=(0,n.createEnum)(`Lns `,`50-300mm zoom`,{"50-300mm zoom":`Zm `,"32mm prime":`Nkn `,"105mm prime":`Nkn1`,"movie prime":`PnVs`}),e.blurType=(0,n.createEnum)(`blurType`,`gaussian blur`,{"gaussian blur":`GsnB`,"lens blur":`lensBlur`,"motion blur":`MtnB`}),e.DfsM=(0,n.createEnum)(`DfsM`,`normal`,{normal:`Nrml`,"darken only":`DrkO`,"lighten only":`LghO`,anisotropic:`anisotropic`}),e.ExtT=(0,n.createEnum)(`ExtT`,`blocks`,{blocks:`Blks`,pyramids:`Pyrm`}),e.ExtR=(0,n.createEnum)(`ExtR`,`random`,{random:`Rndm`,"level-based":`LvlB`}),e.FlCl=(0,n.createEnum)(`FlCl`,`background color`,{"background color":`FlBc`,"foreground color":`FlFr`,"inverse image":`FlIn`,"unaltered image":`FlSm`}),e.CntE=(0,n.createEnum)(`CntE`,`upper`,{lower:`Lwr `,upper:`Upr `}),e.WndM=(0,n.createEnum)(`WndM`,`wind`,{wind:`Wnd `,blast:`Blst`,stagger:`Stgr`}),e.Drct=(0,n.createEnum)(`Drct`,`right`,{left:`Left`,right:`Rght`}),e.IntE=(0,n.createEnum)(`IntE`,`odd lines`,{"odd lines":`ElmO`,"even lines":`ElmE`}),e.IntC=(0,n.createEnum)(`IntC`,`interpolation`,{duplication:`CrtD`,interpolation:`CrtI`}),e.FlMd=(0,n.createEnum)(`FlMd`,`wrap around`,{"set to transparent":`Bckg`,"repeat edge pixels":`Rpt `,"wrap around":`Wrp `}),e.prjM=(0,n.createEnum)(`prjM`,`fisheye`,{fisheye:`fisP`,perspective:`perP`,auto:`auto`,"full spherical":`fusP`}),e.presetKindType=(0,n.createEnum)(`presetKindType`,`custom`,{custom:`presetKindCustom`,default:`presetKindDefault`}),e.patternColorHandling=(0,n.createEnum)(``,`convert`,{convert:`conv`,"avoid conversion":`avod`,"luminance only":`lumi`})})),S=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resourceHandlersMap=e.resourceHandlers=void 0,e.shouldReadResource=d;var t=y(),n=O(),r=C(),i=k(),a=v(),o=b(),s=x();e.resourceHandlers=[],e.resourceHandlersMap={};function c(e){let t=[],n=new Proxy({},{get(e,n){typeof n==`string`&&!t.includes(n)&&t.push(n)}});try{e(n)}catch{}return t}var l=new Set([`layersGroup`,`layerGroupsEnabledId`,`alphaChannelNames`,`transparencyIndex`]);function u(t,n,r,i,a={}){let o=a.fields??c(n),s=o.some(e=>l.has(e)),u={key:t,keyCount:a.keyCount??1,has:n,read:r,write:i,name:a.name,fields:o,required:s};e.resourceHandlers.push(u);for(let t=0;t<u.keyCount;t++)e.resourceHandlersMap[u.key+t]=u}function d(e,t){return!t||e.required||t.size>0&&e.fields.some(e=>t.has(e))}var f=[void 0,`PPI`,`PPCM`],p=[void 0,`Inches`,`Centimeters`,`Points`,`Picas`,`Columns`],m=`0123456789abcdef`;function h(e){return e<=57?e-48:e>=97?e-87:e-55}function g(e,t){return h(e.charCodeAt(t))<<4|h(e.charCodeAt(t+1))}function _(e,t){let n=(0,r.readBytes)(e,t);return(0,r.decodeUtf8)(e,n)}function S(e,t){let n=(0,o.encodeString)(t);(0,i.writeBytes)(e,n)}function w(e){let t=(0,r.readUint8)(e);return T(e,(0,r.readBytes)(e,t))}function T(e,t){let n=!1;for(let e=0;e<t.byteLength;e++)if(t[e]&128){n=!0;break}if(n){for(let n of[(0,r.getGbkStrictDecoder)(e),(0,r.getUtf8StrictDecoder)(e)])if(n)try{return n.decode(t)}catch{}}return(0,r.decodeUtf8)(e,t)}function E(e){let t=``;for(let n=0;n<e.length;){let r=e.codePointAt(n);t+=r>127?`?`:String.fromCharCode(r),n+=r>65535?2:1}return t.length>255?t.substring(0,255):t}function D(e,t){let n=(0,o.encodeString)(E(t));(0,i.writeUint8)(e,n.byteLength),(0,i.writeBytes)(e,n)}u(1028,e=>e.iptcData!==void 0,(e,t,n)=>{t.iptcData=(0,r.readBytes)(e,n())},(e,t)=>{(0,i.writeBytes)(e,t.iptcData)}),u(1061,e=>e.captionDigest!==void 0,(e,t)=>{let n=``;for(let t=0;t<16;t++){let t=(0,r.readUint8)(e);n+=m[t>>4],n+=m[t&15]}t.captionDigest=n},(e,t)=>{for(let n=0;n<16;n++)(0,i.writeUint8)(e,g(t.captionDigest,n*2))}),u(1060,e=>e.xmpMetadata!==void 0,(e,t,n)=>{t.xmpMetadata=_(e,n())},(e,t)=>{S(e,t.xmpMetadata)});var A=(0,a.createEnum)(`Inte`,`perceptual`,{perceptual:`Img `,saturation:`Grp `,"relative colorimetric":`Clrm`,"absolute colorimetric":`AClr`});u(1085,e=>e.windowsDevMode!==void 0,(e,t,n)=>{t.windowsDevMode=(0,r.readBytes)(e,n())},(e,t)=>{(0,i.writeBytes)(e,t.windowsDevMode)}),u(1082,e=>e.printInformation!==void 0,(e,t)=>{let n=(0,s.readVersionAndDescriptor)(e);t.printInformation={printerName:n.printerName||``,renderingIntent:A.decode(n.Inte??`Inte.Img `)};let r=t.printInformation;n.PstS!==void 0&&(r.printerManagesColors=n.PstS),n.ClrS===`ClrS.Grys`&&(r.printerProfileColorSpace=`grayscale`),n[`Nm `]!==void 0&&(r.printerProfile=n[`Nm `]),n.MpBl!==void 0&&(r.blackPointCompensation=n.MpBl),n.printSixteenBit!==void 0&&(r.printSixteenBit=n.printSixteenBit),n.hardProof!==void 0&&(r.hardProof=n.hardProof),n.printProofSetup&&(r.proofSetup=`Bltn`in n.printProofSetup?{builtin:n.printProofSetup.Bltn.split(`.`)[1]}:{profile:n.printProofSetup.profile,renderingIntent:A.decode(n.printProofSetup.Inte??`Inte.Img `),blackPointCompensation:!!n.printProofSetup.MpBl,paperWhite:!!n.printProofSetup.paperWhite})},(e,t)=>{let n=t.printInformation,r={};n.printerManagesColors?r.PstS=!0:(n.hardProof!==void 0&&(r.hardProof=!!n.hardProof),r.ClrS=n.printerProfileColorSpace===`grayscale`?`ClrS.Grys`:`ClrS.RGBC`,n.printerProfile!==void 0&&(r[`Nm `]=n.printerProfile)),r.Inte=A.encode(n.renderingIntent),!n.printerManagesColors&&n.blackPointCompensation!==void 0&&(r.MpBl=!!n.blackPointCompensation),r.printSixteenBit=!!n.printSixteenBit,r.printerName=n.printerName||``,n.proofSetup&&`profile`in n.proofSetup?r.printProofSetup={profile:n.proofSetup.profile||``,Inte:A.encode(n.proofSetup.renderingIntent),MpBl:!!n.proofSetup.blackPointCompensation,paperWhite:!!n.proofSetup.paperWhite}:n.proofSetup&&(r.printProofSetup={Bltn:`builtinProof.${n.proofSetup.builtin||`proofCMYK`}`}),(0,s.writeVersionAndDescriptor)(e,``,`printOutput`,r)}),u(1083,e=>e.printStyle!==void 0,(e,t)=>{let n=(0,s.readVersionAndDescriptor)(e);t.printStyle={caption:n.Cptn,calibrationBars:n.Clbr,registrationMarks:n.RgsM,cornerCropMarks:n.CrnC,centerCropMarks:n.CntC,labels:n.Lbls,negative:n.Ngtv,emulsionDown:n.EmlD,interpolate:n.Intr,backgroundColor:(0,s.parseColor)(n.Bckg),border:(0,s.parseUnits)(n.BrdT),bleed:(0,s.parseUnits)(n[`Bld `]),resolution:(0,s.parseUnits)(n.Rslt),vectorData:n.vectorData,pagePosition:n.PgPs===`PgPs.PgPC`?`centered`:n.PgPs,left:(0,s.parseUnits)(n.Left),top:(0,s.parseUnits)(n[`Top `]),scale:(0,s.parsePercent)(n[`Scl `])},n.cropWhenPrinting!==void 0&&(t.printStyle.cropWhenPrinting=n.cropWhenPrinting,t.printStyle.cropRect={top:n.cropRectTop||0,left:n.cropRectLeft||0,bottom:n.cropRectBottom||0,right:n.cropRectRight||0})},(e,t)=>{let n=t.printStyle,r={Cptn:!!n.caption,Clbr:!!n.calibrationBars,RgsM:!!n.registrationMarks,CrnC:!!n.cornerCropMarks,CntC:!!n.centerCropMarks,Lbls:!!n.labels,Ngtv:!!n.negative,EmlD:!!n.emulsionDown,Intr:!!n.interpolate,Bckg:(0,s.serializeColor)(n.backgroundColor||{r:255,g:255,b:255}),BrdT:(0,s.unitsValue)(n.border||{units:`Distance`,value:0},`border`),"Bld ":(0,s.unitsValue)(n.bleed||{units:`Distance`,value:0},`bleed`),Rslt:(0,s.unitsValue)(n.resolution||{units:`Pixels`,value:72},`resolution`),vectorData:n.vectorData??!0,PgPs:!n.pagePosition||n.pagePosition===`centered`?`PgPs.PgPC`:n.pagePosition,Left:(0,s.unitsValue)(n.left||{units:`Distance`,value:0},`left`),"Top ":(0,s.unitsValue)(n.top||{units:`Distance`,value:0},`top`),"Scl ":(0,s.unitsPercentF)(n.scale??1)};(n.cropWhenPrinting!==void 0||n.cropRect)&&(r.cropWhenPrinting=!!n.cropWhenPrinting,r.cropRectBottom=n.cropRect?.bottom??0,r.cropRectLeft=n.cropRect?.left??0,r.cropRectRight=n.cropRect?.right??0,r.cropRectTop=n.cropRect?.top??0),(0,s.writeVersionAndDescriptor)(e,``,`printOutputOptions`,r)}),u(1005,e=>e.resolutionInfo!==void 0,(e,t)=>{let n=(0,r.readFixedPoint32)(e),i=(0,r.readUint16)(e),a=(0,r.readUint16)(e),o=(0,r.readFixedPoint32)(e),s=(0,r.readUint16)(e),c=(0,r.readUint16)(e);t.resolutionInfo={horizontalResolution:n,horizontalResolutionUnit:f[i]||`PPI`,widthUnit:p[a]||`Inches`,verticalResolution:o,verticalResolutionUnit:f[s]||`PPI`,heightUnit:p[c]||`Inches`}},(e,t)=>{let n=t.resolutionInfo;(0,i.writeFixedPoint32)(e,n.horizontalResolution||0),(0,i.writeUint16)(e,Math.max(1,f.indexOf(n.horizontalResolutionUnit))),(0,i.writeUint16)(e,Math.max(1,p.indexOf(n.widthUnit))),(0,i.writeFixedPoint32)(e,n.verticalResolution||0),(0,i.writeUint16)(e,Math.max(1,f.indexOf(n.verticalResolutionUnit))),(0,i.writeUint16)(e,Math.max(1,p.indexOf(n.heightUnit)))});var j=[`centered`,`size to fit`,`user defined`];u(1062,e=>e.printScale!==void 0,(e,t)=>{t.printScale={style:j[(0,r.readInt16)(e)],x:(0,r.readFloat32)(e),y:(0,r.readFloat32)(e),scale:(0,r.readFloat32)(e)}},(e,t)=>{let{style:n,x:r,y:a,scale:o}=t.printScale;(0,i.writeInt16)(e,Math.max(0,j.indexOf(n))),(0,i.writeFloat32)(e,r||0),(0,i.writeFloat32)(e,a||0),(0,i.writeFloat32)(e,o||0)}),u(1006,e=>e.alphaChannelNames!==void 0,(e,t,n)=>{if(t.alphaChannelNames)(0,r.skipBytes)(e,n());else for(t.alphaChannelNames=[];n()>0;){let n=w(e);t.alphaChannelNames.push(n)}},(e,t)=>{for(let n of t.alphaChannelNames)D(e,n)}),u(1045,e=>e.alphaChannelNames!==void 0,(e,t,n)=>{for(t.alphaChannelNames=[];n()>0;)t.alphaChannelNames.push((0,r.readUnicodeString)(e))},(e,t)=>{for(let n of t.alphaChannelNames)(0,i.writeUnicodeStringWithPadding)(e,n)});var M=[`selected`,`protected`,`spot`],N=[0,1,2,7,8];function P(e){let t={opacity:0,kind:`selected`},n=e.view.getUint16(e.offset);N.indexOf(n)===-1?((0,r.skipBytes)(e,2),t.rawColor={colorSpace:n,values:[(0,r.readUint16)(e),(0,r.readUint16)(e),(0,r.readUint16)(e),(0,r.readUint16)(e)]}):t.color=(0,r.readColor)(e),t.opacity=(0,r.readUint16)(e)/100;let i=M[(0,r.readUint8)(e)];if(!i)throw Error(`Invalid display info kind`);return t.kind=i,t}u(1007,()=>!1,(e,t,n)=>{let i=[];for(;n()>=14;)i.push(P(e)),(0,r.skipBytes)(e,1);t.alphaChannelDisplayInfo||=i},()=>{},{fields:[`alphaChannelDisplayInfo`]}),u(1077,e=>e.alphaChannelDisplayInfo!==void 0,(e,t,n)=>{let i=(0,r.readUint32)(e);if(i!==1)throw Error(`Invalid display info version: ${i}`);for(t.alphaChannelDisplayInfo=[];n()>=13;)t.alphaChannelDisplayInfo.push(P(e))},(e,t)=>{(0,i.writeUint32)(e,1);for(let n of t.alphaChannelDisplayInfo){if(!n.color&&n.rawColor){(0,i.writeUint16)(e,n.rawColor.colorSpace);for(let t=0;t<4;t++)(0,i.writeUint16)(e,n.rawColor.values[t]|0)}else(0,i.writeColor)(e,n.color||{r:255,g:0,b:0});(0,i.writeUint16)(e,Math.round((0,a.clamp)(n.opacity,0,1)*100)),(0,i.writeUint8)(e,Math.max(0,M.indexOf(n.kind)))}}),u(1053,e=>e.alphaIdentifiers!==void 0,(e,t,n)=>{for(t.alphaIdentifiers=[];n()>=4;)t.alphaIdentifiers.push((0,r.readUint32)(e))},(e,t)=>{for(let n of t.alphaIdentifiers)(0,i.writeUint32)(e,n)}),u(1010,e=>e.backgroundColor!==void 0,(e,t)=>t.backgroundColor=(0,r.readColor)(e),(e,t)=>(0,i.writeColor)(e,t.backgroundColor)),u(1037,e=>e.globalAngle!==void 0,(e,t)=>t.globalAngle=(0,r.readInt32)(e),(e,t)=>(0,i.writeInt32)(e,t.globalAngle)),u(1049,e=>e.globalAltitude!==void 0,(e,t)=>t.globalAltitude=(0,r.readUint32)(e),(e,t)=>(0,i.writeUint32)(e,t.globalAltitude)),u(1011,e=>e.printFlags!==void 0,(e,t,n)=>{t.printFlags={labels:!!(0,r.readUint8)(e),cropMarks:!!(0,r.readUint8)(e),colorBars:!!(0,r.readUint8)(e),registrationMarks:!!(0,r.readUint8)(e),negative:!!(0,r.readUint8)(e),flip:!!(0,r.readUint8)(e),interpolate:!!(0,r.readUint8)(e),caption:!!(0,r.readUint8)(e),printFlags:n()?!!(0,r.readUint8)(e):!1}},(e,t)=>{let n=t.printFlags;(0,i.writeUint8)(e,+!!n.labels),(0,i.writeUint8)(e,+!!n.cropMarks),(0,i.writeUint8)(e,+!!n.colorBars),(0,i.writeUint8)(e,+!!n.registrationMarks),(0,i.writeUint8)(e,+!!n.negative),(0,i.writeUint8)(e,+!!n.flip),(0,i.writeUint8)(e,+!!n.interpolate),(0,i.writeUint8)(e,+!!n.caption),(0,i.writeUint8)(e,+!!n.printFlags)}),u(1034,e=>e.copyrighted!==void 0,(e,t)=>{t.copyrighted=!!(0,r.readUint8)(e)},(e,t)=>{(0,i.writeUint8)(e,+!!t.copyrighted)}),u(1035,e=>e.url!==void 0,(e,t,n)=>{t.url=(0,r.readAsciiString)(e,n())},(e,t)=>{(0,i.writeAsciiString)(e,t.url)}),u(1e4,e=>e.printFlagsInfo!==void 0,(e,t)=>{let n=(0,r.readUint16)(e);if(n!==1)throw Error(`Invalid print flags information version: ${n}`);let i=!!(0,r.readUint8)(e);(0,r.skipBytes)(e,1),t.printFlagsInfo={centerCropMarks:i,bleedWidth:(0,r.readUint32)(e),bleedWidthScale:(0,r.readUint16)(e)}},(e,t)=>{let n=t.printFlagsInfo;(0,i.writeUint16)(e,1),(0,i.writeUint8)(e,+!!n.centerCropMarks),(0,i.writeUint8)(e,0),(0,i.writeUint32)(e,n.bleedWidth|0),(0,i.writeUint16)(e,n.bleedWidthScale|0)}),u(1046,e=>e.indexedColorCount!==void 0,(e,t)=>{t.indexedColorCount=(0,r.readUint16)(e)},(e,t)=>{(0,i.writeUint16)(e,t.indexedColorCount)}),u(1047,e=>e.transparencyIndex!==void 0,(e,t)=>{t.transparencyIndex=(0,r.readUint16)(e)},(e,t)=>{(0,i.writeUint16)(e,t.transparencyIndex)});var ee=[`lines/inch`,`lines/cm`],F=[`round`,`ellipse`,`line`,`square`,`cross`,void 0,`diamond`];function I(e,t){let n=[];for(;t()>=18;){let t=(0,r.readFixedPoint32)(e),i=ee[(0,r.readUint16)(e)-1];if(!i)throw Error(`Invalid halftone screen frequency units`);let a=(0,r.readFixedPoint32)(e),o=F[(0,r.readInt16)(e)];if(!o)throw Error(`Invalid halftone screen shape`);(0,r.skipBytes)(e,4);let s=!!(0,r.readUint8)(e),c=!!(0,r.readUint8)(e);n.push({frequency:t,frequencyUnits:i,angle:a,shape:o,accurateScreens:s,printerDefaultScreens:c})}return n}function te(e,t){for(let n of t)(0,i.writeFixedPoint32)(e,n.frequency),(0,i.writeUint16)(e,Math.max(0,ee.indexOf(n.frequencyUnits))+1),(0,i.writeFixedPoint32)(e,n.angle),(0,i.writeInt16)(e,Math.max(0,F.indexOf(n.shape))),(0,i.writeZeros)(e,4),(0,i.writeUint8)(e,+!!n.accurateScreens),(0,i.writeUint8)(e,+!!n.printerDefaultScreens)}u(1012,e=>e.grayscaleHalftoneScreens!==void 0,(e,t,n)=>t.grayscaleHalftoneScreens=I(e,n),(e,t)=>te(e,t.grayscaleHalftoneScreens)),u(1013,e=>e.colorHalftoneScreens!==void 0,(e,t,n)=>t.colorHalftoneScreens=I(e,n),(e,t)=>te(e,t.colorHalftoneScreens));function ne(e,t){let n=[];for(;t()>=28;){let t=[];for(let n=0;n<13;n++)t.push((0,r.readInt16)(e));let i=!!(0,r.readUint16)(e);n.push({curve:t,override:i})}return n}function re(e,t){for(let n of t){for(let t=0;t<13;t++)(0,i.writeInt16)(e,n.curve[t]??-1);(0,i.writeUint16)(e,+!!n.override)}}u(1014,e=>e.duotoneHalftoneScreens!==void 0,(e,t,n)=>t.duotoneHalftoneScreens=I(e,n),(e,t)=>te(e,t.duotoneHalftoneScreens)),u(1017,e=>e.duotoneTransferFunctions!==void 0,(e,t,n)=>t.duotoneTransferFunctions=ne(e,n),(e,t)=>re(e,t.duotoneTransferFunctions)),u(1018,e=>e.duotoneImageInformation!==void 0,(e,t,n)=>t.duotoneImageInformation=(0,r.readBytes)(e,n()),(e,t)=>(0,i.writeBytes)(e,t.duotoneImageInformation)),u(1066,e=>e.alternateDuotoneColors!==void 0,(e,t,n)=>{if((0,r.readUint16)(e)!==1)throw Error(`Invalid alternate duotone colors version`);let i=[],a=(0,r.readUint16)(e);for(let t=0;t<a&&n()>=10;t++)i.push((0,r.readColor)(e));let o=(0,r.readUint16)(e);if(o*3>n())throw Error(`Invalid alternate duotone colors Lab table size`);t.alternateDuotoneColors={colors:i,labColors:(0,r.readBytes)(e,o*3)}},(e,t)=>{let{colors:n,labColors:r}=t.alternateDuotoneColors;(0,i.writeUint16)(e,1),(0,i.writeUint16)(e,n.length);for(let t of n)(0,i.writeColor)(e,t);(0,i.writeUint16)(e,Math.floor(r.byteLength/3)),(0,i.writeBytes)(e,r.subarray(0,Math.floor(r.byteLength/3)*3))}),u(1015,e=>e.grayscaleTransferFunctions!==void 0,(e,t,n)=>t.grayscaleTransferFunctions=ne(e,n),(e,t)=>re(e,t.grayscaleTransferFunctions)),u(1016,e=>e.colorTransferFunctions!==void 0,(e,t,n)=>t.colorTransferFunctions=ne(e,n),(e,t)=>re(e,t.colorTransferFunctions)),u(1080,e=>e.countInformation!==void 0,(e,t)=>{t.countInformation=(0,s.readVersionAndDescriptor)(e).countGroupList.map(e=>({color:{r:e[`Rd `],g:e[`Grn `],b:e[`Bl `]},name:e[`Nm `],size:e[`Rds `],fontSize:e.fontSize,visible:e.Vsbl,points:e.countObjectList.map(e=>({x:e[`X `],y:e[`Y `]}))}))},(e,t)=>{let n={Vrsn:1,countGroupList:t.countInformation.map(e=>({"Rd ":e.color.r,"Grn ":e.color.g,"Bl ":e.color.b,"Nm ":e.name,"Rds ":e.size,fontSize:e.fontSize,Vsbl:e.visible,countObjectList:e.points.map(e=>({"X ":e.x,"Y ":e.y}))}))};(0,s.writeVersionAndDescriptor)(e,``,`Cnt `,n)}),u(1024,e=>e.layerState!==void 0,(e,t)=>t.layerState=(0,r.readUint16)(e),(e,t)=>(0,i.writeUint16)(e,t.layerState)),u(1026,e=>e.layersGroup!==void 0,(e,t,n)=>{for(t.layersGroup=[];n()>0;)t.layersGroup.push((0,r.readUint16)(e))},(e,t)=>{for(let n of t.layersGroup)(0,i.writeUint16)(e,n)}),u(1072,e=>e.layerGroupsEnabledId!==void 0,(e,t,n)=>{for(t.layerGroupsEnabledId=[];n()>0;)t.layerGroupsEnabledId.push((0,r.readUint8)(e))},(e,t)=>{for(let n of t.layerGroupsEnabledId)(0,i.writeUint8)(e,n)}),u(1069,e=>e.layerSelectionIds!==void 0,(e,t)=>{let n=(0,r.readUint16)(e);for(t.layerSelectionIds=[];n--;)t.layerSelectionIds.push((0,r.readUint32)(e))},(e,t)=>{(0,i.writeUint16)(e,t.layerSelectionIds.length);for(let n of t.layerSelectionIds)(0,i.writeUint32)(e,n)}),u(1032,e=>e.gridAndGuidesInformation!==void 0,(e,t)=>{let n=(0,r.readUint32)(e),i=(0,r.readUint32)(e),a=(0,r.readUint32)(e),o=(0,r.readUint32)(e);if(n!==1)throw Error(`Invalid 1032 resource version: ${n}`);let s=t.gridAndGuidesInformation?.guides,c=[];for(let t=0;t<o;t++){let n={location:(0,r.readInt32)(e)/32,direction:(0,r.readUint8)(e)?`horizontal`:`vertical`};s?.length===o&&s[t].color&&(n.color=s[t].color),s?.length===o&&s[t].id&&(n.id=s[t].id),c.push(n)}t.gridAndGuidesInformation={grid:{horizontal:i,vertical:a},guides:c}},(e,t)=>{let n=t.gridAndGuidesInformation,r=n.grid||{horizontal:576,vertical:576},a=n.guides||[];(0,i.writeUint32)(e,1),(0,i.writeUint32)(e,Math.round(r.horizontal)),(0,i.writeUint32)(e,Math.round(r.vertical)),(0,i.writeUint32)(e,a.length);for(let t of a)(0,i.writeInt32)(e,Math.round(t.location*32)),(0,i.writeUint8)(e,+(t.direction===`horizontal`))});var ie={r:74,g:255,b:255};u(1092,e=>e.gridAndGuidesInformation!==void 0,(e,t)=>{let n=(0,r.readUint32)(e);if(n!==2)throw Error(`Invalid 1092 resource version: ${n}`);let i=(0,r.readUint32)(e),a=(0,r.readUint32)(e),o=(0,r.readUint32)(e),s=[];for(let t=0;t<o;t++){let t=(0,r.readInt32)(e)/32,n=(0,r.readUint8)(e)?`horizontal`:`vertical`;(0,r.skipBytes)(e,1);let i={r:(0,r.readUint8)(e),g:(0,r.readUint8)(e),b:(0,r.readUint8)(e)};s.push({location:t,direction:n,color:i})}let c=t.gridAndGuidesInformation?.guides;c&&c.length===o?c.forEach((e,t)=>e.color=s[t].color):t.gridAndGuidesInformation={grid:{horizontal:i,vertical:a},guides:s}},(e,t)=>{let n=t.gridAndGuidesInformation,r=n.grid||{horizontal:576,vertical:576},a=n.guides||[];(0,i.writeUint32)(e,2),(0,i.writeUint32)(e,Math.round(r.horizontal)),(0,i.writeUint32)(e,Math.round(r.vertical)),(0,i.writeUint32)(e,a.length);for(let t of a){let n=t.color||ie;(0,i.writeInt32)(e,Math.round(t.location*32)),(0,i.writeUint8)(e,+(t.direction===`horizontal`)),(0,i.writeUint8)(e,0),(0,i.writeUint8)(e,Math.round(n.r)),(0,i.writeUint8)(e,Math.round(n.g)),(0,i.writeUint8)(e,Math.round(n.b))}});var ae=`00000000-0000-0000-0000-000000000000`;u(1097,e=>!!e.gridAndGuidesInformation&&(e.gridAndGuidesInformation.guides||[]).every(e=>e.id),(e,t)=>{let n=(0,r.readUint32)(e),i=[];for(let t=0;t<n;t++)i.push((0,r.readAsciiString)(e,(0,r.readUint32)(e))),(0,r.readUint32)(e),(0,r.readAsciiString)(e,(0,r.readUint32)(e));let a=t.gridAndGuidesInformation?.guides;a&&a.length===n&&a.forEach((e,t)=>e.id=i[t])},(e,t)=>{let n=t.gridAndGuidesInformation.guides||[];(0,i.writeUint32)(e,n.length);for(let t of n)(0,i.writeUint32)(e,t.id.length),(0,i.writeAsciiString)(e,t.id),(0,i.writeUint32)(e,0),(0,i.writeUint32)(e,36),(0,i.writeAsciiString)(e,ae)}),u(1065,e=>e.layerComps!==void 0,(e,t)=>{let n=(0,s.readVersionAndDescriptor)(e,!0);t.layerComps={list:[]};for(let e of n.list)t.layerComps.list.push({id:e.compID,name:e[`Nm `],capturedInfo:e.capturedInfo}),e.comment!==void 0&&(t.layerComps.list[t.layerComps.list.length-1].comment=e.comment),e.Expn!==void 0&&(t.layerComps.list[t.layerComps.list.length-1].expanded=e.Expn);n.lastAppliedComp!==void 0&&(t.layerComps.lastApplied=n.lastAppliedComp)},(e,t)=>{let n=t.layerComps,r={list:[]};for(let e of n.list){let t={};t._classID=`Comp`,t[`Nm `]=e.name,e.comment!==void 0&&(t.comment=e.comment),t.compID=e.id,t.capturedInfo=e.capturedInfo,e.expanded!==void 0&&(t.Expn=!!e.expanded),r.list.push(t)}n.lastApplied!==void 0&&(r.lastAppliedComp=n.lastApplied),(0,s.writeVersionAndDescriptor)(e,``,`CompList`,r)}),a.MOCK_HANDLERS&&u(1092,e=>e._ir1092!==void 0,(e,t,n)=>{t._ir1092=(0,r.readBytes)(e,n())},(e,t)=>{(0,i.writeBytes)(e,t._ir1092)});var oe=[`normal`,void 0,void 0,void 0,void 0,void 0,void 0,`multiply`,`screen`,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,`difference`];u(1078,e=>e.onionSkins!==void 0,(e,t)=>{let n=(0,s.readVersionAndDescriptor)(e);t.onionSkins={enabled:n.enab,framesBefore:n.numBefore,framesAfter:n.numAfter,frameSpacing:n.Spcn,minOpacity:n.minOpacity/100,maxOpacity:n.maxOpacity/100,blendMode:oe[n.BlnM]||`normal`}},(e,t)=>{let n=t.onionSkins,r={Vrsn:1,enab:n.enabled,numBefore:n.framesBefore,numAfter:n.framesAfter,Spcn:n.frameSpacing,minOpacity:Math.round(n.minOpacity*100),maxOpacity:Math.round(n.maxOpacity*100),BlnM:Math.max(0,oe.indexOf(n.blendMode))};(0,s.writeVersionAndDescriptor)(e,``,`null`,r)}),u(1075,e=>e.timelineInformation!==void 0,(e,t)=>{let n=(0,s.readVersionAndDescriptor)(e);t.timelineInformation={enabled:n.enab,frameStep:(0,s.frac)(n.frameStep),frameRate:n.frameRate,time:(0,s.frac)(n.time),duration:(0,s.frac)(n.duration),workInTime:(0,s.frac)(n.workInTime),workOutTime:(0,s.frac)(n.workOutTime),repeats:n.LCnt,hasMotion:n.hasMotion,globalTracks:(0,s.parseTrackList)(n.globalTrackList,e)},n.audioClipGroupList?.audioClipGroupList?.length&&(t.timelineInformation.audioClipGroups=n.audioClipGroupList.audioClipGroupList.map(e=>({id:e.groupID,muted:e.muted,audioClips:e.audioClipList.map(({clipID:e,timeScope:t,muted:n,audioLevel:r,frameReader:i})=>({id:e,start:(0,s.frac)(t.Strt),duration:(0,s.frac)(t.duration),inTime:(0,s.frac)(t.inTime),outTime:(0,s.frac)(t.outTime),muted:n,audioLevel:r,frameReader:{type:i.frameReaderType,mediaDescriptor:i.mediaDescriptor,link:{name:i[`Lnk `][`Nm `],fullPath:i[`Lnk `].fullPath,relativePath:i[`Lnk `].relPath}}}))})))},(e,t)=>{let n=t.timelineInformation,r={Vrsn:1,enab:n.enabled,frameStep:n.frameStep,frameRate:n.frameRate,time:n.time,duration:n.duration,workInTime:n.workInTime,workOutTime:n.workOutTime,LCnt:n.repeats,globalTrackList:(0,s.serializeTrackList)(n.globalTracks,e),audioClipGroupList:{audioClipGroupList:(n.audioClipGroups??[]).map(e=>({groupID:e.id,muted:e.muted,audioClipList:e.audioClips.map(e=>({clipID:e.id,timeScope:{Vrsn:1,Strt:e.start,duration:e.duration,inTime:e.inTime,outTime:e.outTime},frameReader:{frameReaderType:e.frameReader.type,descVersion:1,"Lnk ":{descVersion:1,"Nm ":e.frameReader.link.name,fullPath:e.frameReader.link.fullPath,relPath:e.frameReader.link.relativePath},mediaDescriptor:e.frameReader.mediaDescriptor},muted:e.muted,audioLevel:e.audioLevel}))}))},hasMotion:n.hasMotion};(0,s.writeVersionAndDescriptor)(e,``,`null`,r,`anim`)}),u(1076,e=>e.sheetDisclosure!==void 0,(e,t)=>{let n=(0,s.readVersionAndDescriptor)(e);t.sheetDisclosure={},n.sheetTimelineOptions&&(t.sheetDisclosure.sheetTimelineOptions=n.sheetTimelineOptions.map(e=>({sheetID:e.sheetID,sheetDisclosed:e.sheetDisclosed,lightsDisclosed:e.lightsDisclosed,meshesDisclosed:e.meshesDisclosed,materialsDisclosed:e.materialsDisclosed})))},(e,t)=>{let n=t.sheetDisclosure,r={Vrsn:1};n.sheetTimelineOptions&&(r.sheetTimelineOptions=n.sheetTimelineOptions.map(e=>({Vrsn:2,sheetID:e.sheetID,sheetDisclosed:e.sheetDisclosed,lightsDisclosed:e.lightsDisclosed,meshesDisclosed:e.meshesDisclosed,materialsDisclosed:e.materialsDisclosed}))),(0,s.writeVersionAndDescriptor)(e,``,`null`,r)}),u(1054,e=>e.urlsList!==void 0,(e,t)=>{let n=(0,r.readUint32)(e);t.urlsList=[];for(let i=0;i<n;i++){if((0,r.readSignature)(e)!==`slic`&&e.throwForMissingFeatures)throw Error(`Unknown long`);let n=(0,r.readUint32)(e),i=(0,r.readUnicodeString)(e);t.urlsList.push({id:n,url:i,ref:`slice`})}},(e,t)=>{let n=t.urlsList;(0,i.writeUint32)(e,n.length);for(let t=0;t<n.length;t++)(0,i.writeSignature)(e,`slic`),(0,i.writeUint32)(e,n[t].id),(0,i.writeUnicodeString)(e,n[t].url)});function se(e){return{"Top ":e.top,Left:e.left,Btom:e.bottom,Rght:e.right}}function ce(e){return{top:e[`Top `],left:e.Left,bottom:e.Btom,right:e.Rght}}function L(e,t){return e[Math.max(0,Math.min(e.length-1,t))]}var le=[`autoGenerated`,`layer`,`userGenerated`],ue=[`noImage`,`image`],de=[`default`];u(1050,e=>e.slices?e.slices.length:0,(e,t,n)=>{let i=(0,r.readUint32)(e);if(i===6){t.slices||=[];let i=(0,r.readInt32)(e),a=(0,r.readInt32)(e),o=(0,r.readInt32)(e),c=(0,r.readInt32)(e),l=(0,r.readUnicodeString)(e),u=(0,r.readUint32)(e);t.slices.push({bounds:{top:i,left:a,bottom:o,right:c},groupName:l,slices:[]});let d=t.slices[t.slices.length-1].slices;for(let t=0;t<u;t++){let t=(0,r.readUint32)(e),n=(0,r.readUint32)(e),i=L(le,(0,r.readUint32)(e)),a=i==`layer`?(0,r.readUint32)(e):0,o=(0,r.readUnicodeString)(e),s=L(ue,(0,r.readUint32)(e)),c=(0,r.readInt32)(e),l=(0,r.readInt32)(e),u=(0,r.readInt32)(e),f=(0,r.readInt32)(e),p=(0,r.readUnicodeString)(e),m=(0,r.readUnicodeString)(e),h=(0,r.readUnicodeString)(e),g=(0,r.readUnicodeString)(e),_=!!(0,r.readUint8)(e),v=(0,r.readUnicodeString)(e),y=L(de,(0,r.readUint32)(e)),b=L(de,(0,r.readUint32)(e)),x=(0,r.readUint8)(e),S=(0,r.readUint8)(e),C=(0,r.readUint8)(e),w=(0,r.readUint8)(e),T=x+S+C+w===0?`none`:x===0?`matte`:`color`;d.push({id:t,groupId:n,origin:i,associatedLayerId:a,name:o,target:m,message:h,altTag:g,cellTextIsHTML:_,cellText:v,horizontalAlignment:y,verticalAlignment:b,type:s,url:p,bounds:{top:l,left:c,bottom:f,right:u},backgroundColorType:T,backgroundColor:{r:S,g:C,b:w,a:x}})}if(n()){let t=(0,s.readVersionAndDescriptor)(e),n=new Map;for(let e of d)n.has(e.id)||n.set(e.id,e);t.slices.forEach(e=>{let t=n.get(e.sliceID);t&&(t.topOutset=e.topOutset,t.leftOutset=e.leftOutset,t.bottomOutset=e.bottomOutset,t.rightOutset=e.rightOutset)})}}else if(i===7||i===8){let n=(0,s.readVersionAndDescriptor)(e);t.slices||=[],t.slices.push({groupName:n.baseName??``,bounds:ce(n.bounds),slices:n.slices.map(e=>Object.assign(Object.assign({},e[`Nm `]?{name:e[`Nm `]}:{}),{id:e.sliceID,groupId:e.groupID,associatedLayerId:e.associatedLayer??0,origin:s.ESliceOrigin.decode(e.origin),type:s.ESliceType.decode(e.Type),bounds:ce(e.bounds),url:e.url,target:e.null,message:e.Msge,altTag:e.altTag,cellTextIsHTML:e.cellTextIsHTML,cellText:e.cellText,horizontalAlignment:s.ESliceHorzAlign.decode(e.horzAlign),verticalAlignment:s.ESliceVertAlign.decode(e.vertAlign),backgroundColorType:s.ESliceBGColorType.decode(e.bgColorType),backgroundColor:e.bgColor?{r:e.bgColor[`Rd `],g:e.bgColor[`Grn `],b:e.bgColor[`Bl `],a:e.bgColor.alpha}:{r:0,g:0,b:0,a:0},topOutset:e.topOutset||0,leftOutset:e.leftOutset||0,bottomOutset:e.bottomOutset||0,rightOutset:e.rightOutset||0}))})}else throw Error(`Invalid slices version (${i})`)},(e,t,n)=>{let{bounds:r,groupName:a,slices:o}=t.slices[n];(0,i.writeUint32)(e,6),(0,i.writeInt32)(e,r.top),(0,i.writeInt32)(e,r.left),(0,i.writeInt32)(e,r.bottom),(0,i.writeInt32)(e,r.right),(0,i.writeUnicodeString)(e,a),(0,i.writeUint32)(e,o.length);for(let t=0;t<o.length;t++){let n=o[t],{a:r,r:a,g:s,b:c}=n.backgroundColor;n.backgroundColorType===`none`?r=a=s=c=0:n.backgroundColorType===`matte`&&(r=0,a=s=c=255),(0,i.writeUint32)(e,n.id),(0,i.writeUint32)(e,n.groupId),(0,i.writeUint32)(e,le.indexOf(n.origin)),n.origin===`layer`&&(0,i.writeUint32)(e,n.associatedLayerId),(0,i.writeUnicodeString)(e,n.name||``),(0,i.writeUint32)(e,ue.indexOf(n.type)),(0,i.writeInt32)(e,n.bounds.left),(0,i.writeInt32)(e,n.bounds.top),(0,i.writeInt32)(e,n.bounds.right),(0,i.writeInt32)(e,n.bounds.bottom),(0,i.writeUnicodeString)(e,n.url),(0,i.writeUnicodeString)(e,n.target),(0,i.writeUnicodeString)(e,n.message),(0,i.writeUnicodeString)(e,n.altTag),(0,i.writeUint8)(e,+!!n.cellTextIsHTML),(0,i.writeUnicodeString)(e,n.cellText),(0,i.writeUint32)(e,de.indexOf(n.horizontalAlignment)),(0,i.writeUint32)(e,de.indexOf(n.verticalAlignment)),(0,i.writeUint8)(e,r),(0,i.writeUint8)(e,a),(0,i.writeUint8)(e,s),(0,i.writeUint8)(e,c)}let c={bounds:se(r),slices:[]};o.forEach(e=>{let t=Object.assign(Object.assign({sliceID:e.id,groupID:e.groupId,origin:s.ESliceOrigin.encode(e.origin),Type:s.ESliceType.encode(e.type),bounds:se(e.bounds)},e.name?{"Nm ":e.name}:{}),{url:e.url,null:e.target,Msge:e.message,altTag:e.altTag,cellTextIsHTML:e.cellTextIsHTML,cellText:e.cellText,horzAlign:s.ESliceHorzAlign.encode(e.horizontalAlignment),vertAlign:s.ESliceVertAlign.encode(e.verticalAlignment),bgColorType:s.ESliceBGColorType.encode(e.backgroundColorType)});if(e.backgroundColorType===`color`){let{r:n,g:r,b:i,a}=e.backgroundColor;t.bgColor={"Rd ":n,"Grn ":r,"Bl ":i,alpha:a}}t.topOutset=e.topOutset||0,t.leftOutset=e.leftOutset||0,t.bottomOutset=e.bottomOutset||0,t.rightOutset=e.rightOutset||0,c.slices.push(t)}),(0,s.writeVersionAndDescriptor)(e,``,`null`,c,`slices`)}),u(1064,e=>e.pixelAspectRatio!==void 0,(e,t)=>{if((0,r.readUint32)(e)>2)throw Error(`Invalid pixelAspectRatio version`);t.pixelAspectRatio={aspect:(0,r.readFloat64)(e)}},(e,t)=>{(0,i.writeUint32)(e,2),(0,i.writeFloat64)(e,t.pixelAspectRatio.aspect)}),u(1041,e=>e.iccUntaggedProfile!==void 0,(e,t)=>{t.iccUntaggedProfile=!!(0,r.readUint8)(e)},(e,t)=>{(0,i.writeUint8)(e,+!!t.iccUntaggedProfile)}),u(1039,e=>e.iccProfile!==void 0,(e,t,n)=>{t.iccProfile=(0,r.readBytes)(e,n())},(e,t)=>{(0,i.writeBytes)(e,t.iccProfile)}),u(1044,e=>e.idsSeedNumber!==void 0,(e,t)=>t.idsSeedNumber=(0,r.readUint32)(e),(e,t)=>(0,i.writeUint32)(e,t.idsSeedNumber)),u(1038,e=>e.colorSamplers!==void 0&&!e.colorSamplers.some(e=>e.depth!==void 0),(e,t,n)=>{let i=(0,r.readUint32)(e);if(i!==1)throw Error(`Invalid color samplers version: ${i}`);if(t.colorSamplers?.some(e=>e.depth!==void 0))return(0,r.skipBytes)(e,n());let a=(0,r.readUint32)(e);t.colorSamplers=[];for(let i=0;i<a&&n()>=10;i++){let n=(0,r.readInt32)(e)/16,i=(0,r.readInt32)(e)/16,a=(0,r.readInt16)(e);t.colorSamplers.push({x:i,y:n,colorSpace:a})}},(e,t)=>{(0,i.writeUint32)(e,1),(0,i.writeUint32)(e,t.colorSamplers.length);for(let n of t.colorSamplers)(0,i.writeInt32)(e,Math.round(n.y*16)),(0,i.writeInt32)(e,Math.round(n.x*16)),(0,i.writeInt16)(e,n.colorSpace)}),u(1073,e=>e.colorSamplers!==void 0&&e.colorSamplers.some(e=>e.depth!==void 0),(e,t,n)=>{let i=(0,r.readUint32)(e);if(i<1||i>3)throw Error(`Invalid color samplers version: ${i}`);let a=(0,r.readUint32)(e);t.colorSamplers=[];for(let o=0;o<a&&n()>=10;o++){let n=i===3?(0,r.readUint32)(e):i,a=n===1?(0,r.readInt32)(e)/16:(0,r.readFloat32)(e),o=n===1?(0,r.readInt32)(e)/16:(0,r.readFloat32)(e),s=(0,r.readInt16)(e),c=i>=2?(0,r.readInt16)(e):1;t.colorSamplers.push({x:o,y:a,colorSpace:s,depth:c})}},(e,t)=>{(0,i.writeUint32)(e,3),(0,i.writeUint32)(e,t.colorSamplers.length);for(let n of t.colorSamplers)(0,i.writeUint32)(e,1),(0,i.writeInt32)(e,Math.round(n.y*16)),(0,i.writeInt32)(e,Math.round(n.x*16)),(0,i.writeInt16)(e,n.colorSpace),(0,i.writeInt16)(e,n.depth??1)}),u(1022,e=>e.quickMaskInfo!==void 0,(e,t)=>{t.quickMaskInfo={channelId:(0,r.readUint16)(e),initiallyEmpty:!!(0,r.readUint8)(e)}},(e,t)=>{(0,i.writeUint16)(e,t.quickMaskInfo.channelId),(0,i.writeUint8)(e,+!!t.quickMaskInfo.initiallyEmpty)}),u(1074,e=>e.measurementScale!==void 0,(e,t,n)=>{t.measurementScale=(0,r.readBytes)(e,n())},(e,t)=>{(0,i.writeBytes)(e,t.measurementScale)}),u(1042,e=>e.effectsVisible!==void 0,(e,t)=>{t.effectsVisible=!!(0,r.readUint8)(e)},(e,t)=>{(0,i.writeUint8)(e,+!!t.effectsVisible)}),u(1036,e=>e.thumbnail!==void 0||e.thumbnailRaw!==void 0,(e,t,n)=>{let i=(0,r.readUint32)(e),o=(0,r.readUint32)(e),s=(0,r.readUint32)(e),c=(0,r.readUint32)(e);(0,r.readUint32)(e),(0,r.readUint32)(e);let l=(0,r.readUint16)(e);if((0,r.readUint16)(e),i===0&&l===24&&c>=o*3&&c*s<=n()){if(e.useRawThumbnail){e.logMissingFeatures&&e.log(`Raw thumbnail data is not supported with useRawThumbnail option`),(0,r.skipBytes)(e,n());return}let i=(0,r.readBytes)(e,c*s),l=(0,a.createImageData)(o,s);for(let e=0,t=0;e<s;e++)for(let n=0,r=e*c;n<o;n++,r+=3,t+=4)l.data[t+0]=i[r+0],l.data[t+1]=i[r+1],l.data[t+2]=i[r+2],l.data[t+3]=255;t.thumbnail=(0,a.imageDataToCanvas)(l),(0,r.skipBytes)(e,n());return}if(i!==1||l!==24){e.logMissingFeatures&&e.log(`Invalid thumbnail data (format: ${i}, bitsPerPixel: ${l})`),(0,r.skipBytes)(e,n());return}let u=n(),d=(0,r.readBytes)(e,u);e.useRawThumbnail?t.thumbnailRaw={width:o,height:s,data:d}:d.byteLength&&(t.thumbnail=(0,a.createCanvasFromData)(d,e))},(e,n)=>{let r=0,a=0,o=new Uint8Array;if(n.thumbnailRaw)r=n.thumbnailRaw.width,a=n.thumbnailRaw.height,o=n.thumbnailRaw.data;else try{let e=n.thumbnail.toDataURL(`image/jpeg`,1)?.substring(23);e&&(o=(0,t.toByteArray)(e),r=n.thumbnail.width,a=n.thumbnail.height)}catch{}let s=Math.floor((r*24+31)/32)*4,c=s*a*1,l=o.length;(0,i.writeUint32)(e,1),(0,i.writeUint32)(e,r),(0,i.writeUint32)(e,a),(0,i.writeUint32)(e,s),(0,i.writeUint32)(e,c),(0,i.writeUint32)(e,l),(0,i.writeUint16)(e,24),(0,i.writeUint16)(e,1),(0,i.writeBytes)(e,o)}),u(1057,e=>e.versionInfo!==void 0,(e,t,n)=>{if((0,r.readUint32)(e)!==1)throw Error(`Invalid versionInfo version`);t.versionInfo={hasRealMergedData:!!(0,r.readUint8)(e),writerName:(0,r.readUnicodeString)(e),readerName:(0,r.readUnicodeString)(e),fileVersion:(0,r.readUint32)(e)},(0,r.skipBytes)(e,n())},(e,t)=>{let n=t.versionInfo;(0,i.writeUint32)(e,1),(0,i.writeUint8)(e,+!!n.hasRealMergedData),(0,i.writeUnicodeString)(e,n.writerName),(0,i.writeUnicodeString)(e,n.readerName),(0,i.writeUint32)(e,n.fileVersion)}),u(1058,e=>e.exifData!==void 0,(e,t,n)=>{t.exifData=(0,r.readBytes)(e,n())},(e,t)=>{(0,i.writeBytes)(e,t.exifData)}),u(7e3,e=>e.imageReadyVariables!==void 0,(e,t,n)=>{t.imageReadyVariables=_(e,n())},(e,t)=>{S(e,t.imageReadyVariables)}),u(7001,e=>e.imageReadyDataSets!==void 0,(e,t,n)=>{t.imageReadyDataSets=_(e,n())},(e,t)=>{S(e,t.imageReadyDataSets)}),u(1088,e=>e.pathSelectionState!==void 0,(e,t,n)=>{t.pathSelectionState=(0,s.readVersionAndDescriptor)(e).null},(e,t)=>{let n={null:(0,s.pathSelectionStateToReference)(t.pathSelectionState)};(0,s.writeVersionAndDescriptor)(e,``,`null`,n)}),u(1025,e=>e.workPath!==void 0,(e,t,i,{width:a,height:o})=>{t.workPath={paths:[]},(0,n.readVectorMask)(e,t.workPath,a,o,i()),(0,r.skipBytes)(e,i())},(e,t,r,{width:i,height:a})=>{(0,n.writeVectorMask)(e,t.workPath,i,a)});var fe=999;u(2e3,e=>e.savedPaths?Math.min(e.savedPaths.length,fe):0,(e,t,i,{signature:a,id:o,name:s,width:c,height:l})=>{if(a!==`8BIM`){e.logMissingFeatures&&e.log(`Unhandled image resource: ${a} ${o}`),(0,r.skipBytes)(e,i());return}let u=t.savedPaths??=[],d={name:T(e,s),paths:[]};(0,n.readVectorMask)(e,d,c,l,i()),(0,r.skipBytes)(e,i());let f=t.savedPathsOrigination?.[u.length];f&&(d.vectorOrigination={keyDescriptorList:f}),u.push(d)},(e,t,r,{width:i,height:a})=>{(0,n.writeVectorMask)(e,t.savedPaths[r],i,a)},{keyCount:fe,name:(e,t)=>E(e.savedPaths[t].name)}),u(3e3,e=>!!e.savedPaths?.some(e=>e.vectorOrigination),(e,t,i)=>{(0,s.readVersionAndDescriptor)(e).keyRootDescriptorList.forEach((e,r)=>{let i=(0,n.parseKeyDescriptorList)(e);if(!i.length)return;let a=t.savedPaths?.[r];a?a.vectorOrigination={keyDescriptorList:i}:(t.savedPathsOrigination??=[])[r]=i}),(0,r.skipBytes)(e,i())},(e,t)=>{let r={keyRootDescriptorList:t.savedPaths.slice(0,fe).map(e=>(0,n.serializeKeyDescriptorList)(e.vectorOrigination?.keyDescriptorList??[]))};(0,s.writeVersionAndDescriptor)(e,``,`null`,r)},{name:()=>`OriginDataIRB`}),u(2999,e=>e.clippingPath!==void 0,(e,t,n)=>{let i=w(e),a=(0,r.readFixedPoint32)(e);(0,r.skipBytes)(e,n()),t.clippingPath={name:i,flatness:a}},(e,t)=>{D(e,t.clippingPath.name),(0,i.writeFixedPoint32)(e,t.clippingPath.flatness),(0,i.writeUint16)(e,1)});var pe=(0,a.createEnum)(`FrmD`,`auto`,{auto:`Auto`,none:`None`,dispose:`Disp`});function R(e){let t=[];return e.outputSettings!==void 0&&t.push(`mset`),e.animations!==void 0&&t.push(`mani`,`mfri`),t}u(4e3,e=>R(e).length,(e,t,n)=>{let i=(0,r.readSignature)(e);if(i===`mset`)t.outputSettings=(0,s.readVersionAndDescriptor)(e,!0),(0,r.skipBytes)(e,n());else if(i===`mfri`)(0,r.skipBytes)(e,n());else if(i===`mani`)(0,r.checkSignature)(e,`IRFR`),(0,r.readSection)(e,1,n=>{for(;n()>0;){(0,r.checkSignature)(e,`8BIM`);let n=(0,r.readSignature)(e);(0,r.readSection)(e,1,i=>{if(n===`AnDs`){let n=(0,s.readVersionAndDescriptor)(e);t.animations={frames:n.FrIn.map(e=>{let t={id:e.FrID,delay:(e.FrDl||0)/100,dispose:e.FrDs?pe.decode(e.FrDs):`auto`};return e.FrGA!==void 0&&(t.globalAngle=e.FrGA),e.FrGL!==void 0&&(t.globalAltitude=e.FrGL),t}),animations:n.FSts.map(e=>({id:e.FsID,frames:e.FsFr,repeats:e.LCnt,activeFrame:e.AFrm||0}))},n.AFSt!==void 0&&(t.animations.activeAnimation=n.AFSt),(0,r.skipBytes)(e,i())}else if(n===`Roll`){let t=(0,r.readBytes)(e,i());e.logDevFeatures&&e.log(`#4000 Roll`,t)}else e.logMissingFeatures&&e.log(`Unhandled subsection in #4000`,n),(0,r.skipBytes)(e,i())})}}),(0,r.skipBytes)(e,n());else if(i===`mopt`){let t=(0,r.readBytes)(e,n());e.logDevFeatures&&e.log(`#4000 mopt`,t)}else e.logMissingFeatures&&e.log(`Unhandled plug-in resource key: ${i}`),(0,r.skipBytes)(e,n())},(e,t,n)=>{let r=R(t)[n];if(r===`mset`)(0,i.writeSignature)(e,`mset`),(0,s.writeVersionAndDescriptor)(e,``,`null`,t.outputSettings,s.outputSettingsRoot);else if(r===`mfri`){let n=t.animations;(0,i.writeSignature)(e,`mfri`),(0,i.writeUint32)(e,2),(0,i.writeUint32)(e,16),(0,i.writeUint32)(e,n.frames.length),(0,i.writeUint32)(e,n.animations[0]?.activeFrame??0),(0,i.writeUint32)(e,n.animations.length),(0,i.writeUint32)(e,0)}else r===`mani`&&((0,i.writeSignature)(e,`mani`),(0,i.writeSignature)(e,`IRFR`),(0,i.writeSection)(e,1,()=>{(0,i.writeSignature)(e,`8BIM`),(0,i.writeSignature)(e,`AnDs`),(0,i.writeSection)(e,1,()=>{let n=Object.assign(Object.assign({},t.animations.activeAnimation===void 0?{}:{AFSt:t.animations.activeAnimation}),{FrIn:[],FSts:[]});for(let e=0;e<t.animations.frames.length;e++){let r=t.animations.frames[e],i={FrID:r.id};r.delay&&(i.FrDl=Math.round(r.delay*100)),i.FrDs=pe.encode(r.dispose),r.globalAngle!==void 0&&(i.FrGA=r.globalAngle),r.globalAltitude!==void 0&&(i.FrGL=r.globalAltitude),n.FrIn.push(i)}for(let e=0;e<t.animations.animations.length;e++){let r=t.animations.animations[e],i={FsID:r.id,AFrm:r.activeFrame|0,FsFr:r.frames,LCnt:r.repeats|0};n.FSts.push(i)}(0,s.writeVersionAndDescriptor)(e,``,`null`,n)}),(0,i.writeSignature)(e,`8BIM`),(0,i.writeSignature)(e,`Roll`),(0,i.writeSection)(e,1,()=>{(0,i.writeZeros)(e,8)})}))},{keyCount:1e3})})),C=e((e=>{var t=e&&e.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};Object.defineProperty(e,"__esModule",{value:!0}),e.supportedColorModes=void 0,e.getUtf8Decoder=u,e.getUtf8StrictDecoder=d,e.getGbkStrictDecoder=f,e.decodeUtf8=p,e.createReader=m,e.warnOrThrow=h,e.readUint8=_,e.peekUint8=y,e.readInt16=x,e.readUint16=C,e.readUint16LE=w,e.readInt32=T,e.readInt32LE=E,e.readUint32=D,e.readFloat32=k,e.readFloat64=A,e.readFixedPoint32=j,e.readFixedPointPath32=M,e.readBytes=N,e.readSignature=P,e.validSignatureAt=ee,e.readPascalString=F,e.readUnicodeString=I,e.readUnicodeStringWithLength=oe,e.readUnicodeStringWithLengthLE=se,e.readAsciiString=ce,e.skipBytes=L,e.checkSignature=le,e.readPsd=fe,e.readLayerInfo=pe,e.getCompositeImageData=ye,e.getCompositeCanvas=W,e.getLayerImageData=G,e.getLayerMaskImageData=be,e.getLayerRealMaskImageData=xe,e.getLayerCanvas=K,e.getLayerMaskCanvas=q,e.getLayerRealMaskCanvas=Se,e.getFilterEffectsMaskImageData=Ce,e.getFilterEffectsMaskExtraImageData=J,e.getFilterEffectsMaskCanvas=we,e.getFilterEffectsMaskExtraCanvas=Y,e.decodeLayerPixels=Ee,e.readGlobalLayerMaskInfo=ke,e.readAdditionalLayerInfo=Ne,e.readDataZip=Je,e.readDataRLE=$e,e.readSection=et,e.readColor=tt,e.readPatternSafe=rt,e.readPattern=it,e.consumeMemory=st;var n=g(),r=v(),i=O(),a=b(),o=S();e.supportedColorModes=[0,1,3,2,4];var s=[`bitmap`,`grayscale`,`indexed`,`RGB`,`CMYK`,``,``,`multichannel`,`duotone`,`lab`];function c(e){let t=e.width*e.height*4;for(let n=0;n<t;n+=4){let t=e.data[n];e.data[n+1]=t,e.data[n+2]=t}}function l(e,t){try{return typeof TextDecoder<`u`?new TextDecoder(e,t):null}catch{return null}}function u(e){return e.utf8Decoder===void 0&&(e.utf8Decoder=l(`utf-8`,{ignoreBOM:!0})),e.utf8Decoder}function d(e){return e.utf8StrictDecoder===void 0&&(e.utf8StrictDecoder=l(`utf-8`,{ignoreBOM:!0,fatal:!0})),e.utf8StrictDecoder}function f(e){return e.gbkDecoder===void 0&&(e.gbkDecoder=l(`gbk`,{fatal:!0})),e.gbkDecoder}function p(e,t){let n=t.byteLength>1e3?u(e):null;return n?n.decode(t):(0,a.decodeString)(t)}function m(e,t,n){return{view:new DataView(e,t,n),offset:0,strict:!1,debug:!1,large:!1,globalAlpha:!1,log:console.log}}function h(e,t){if(e.strict)throw Error(t);e.debug&&e.log(t)}function _(e){return e.offset+=1,e.view.getUint8(e.offset-1)}function y(e){return e.view.getUint8(e.offset)}function x(e){return e.offset+=2,e.view.getInt16(e.offset-2,!1)}function C(e){return e.offset+=2,e.view.getUint16(e.offset-2,!1)}function w(e){return e.offset+=2,e.view.getUint16(e.offset-2,!0)}function T(e){return e.offset+=4,e.view.getInt32(e.offset-4,!1)}function E(e){return e.offset+=4,e.view.getInt32(e.offset-4,!0)}function D(e){return e.offset+=4,e.view.getUint32(e.offset-4,!1)}function k(e){return e.offset+=4,e.view.getFloat32(e.offset-4,!1)}function A(e){return e.offset+=8,e.view.getFloat64(e.offset-8,!1)}function j(e){return T(e)/65536}function M(e){return T(e)/(1<<24)}function N(e,t){if(!(t>=0))throw Error(`Invalid length: ${t}`);let n=e.offset,r=e.view.byteLength;if(e.offset+=t,n+t>r){if(h(e,`Reading bytes exceeding buffer length`),t>104857600)throw Error(`Reading past end of file`);st(e,t);let i=new Uint8Array(t),a=Math.min(t,r-n);return a>0&&i.set(new Uint8Array(e.view.buffer,e.view.byteOffset+n,a)),i}return new Uint8Array(e.view.buffer,e.view.byteOffset+n,t)}function P(e){return ue(e,4)}function ee(e,t){let n=String.fromCharCode(e.view.getUint8(t))+String.fromCharCode(e.view.getUint8(t+1))+String.fromCharCode(e.view.getUint8(t+2))+String.fromCharCode(e.view.getUint8(t+3));return n==`8BIM`||n==`8B64`}function F(e,t){let n=_(e),r=n?ue(e,n):``;for(;++n%t;)e.offset++;return r}function I(e){return oe(e,D(e))}var te=8192,ne=64;function re(e,t){if(e.offset<0||e.offset+t>e.view.byteLength)throw RangeError(`Offset is outside the bounds of the DataView`)}function ie(e,t,n){if(!(t>0))return``;re(e,t*2);let r=e.view,i=e.offset,a=``;if(t<=ne){for(let e=0;e<t;e++,i+=2)a+=String.fromCharCode(r.getUint16(i,n));return e.offset=i,a.charCodeAt(a.length-1)===0&&(a=a.substring(0,a.length-1)),a}let o=new Uint16Array(Math.min(t,te));for(let e=0;e<t;e+=te){let s=Math.min(te,t-e);for(let e=0;e<s;e++,i+=2)o[e]=r.getUint16(i,n);a+=String.fromCharCode.apply(null,s===o.length?o:o.subarray(0,s))}return e.offset=i,a.charCodeAt(a.length-1)===0&&(a=a.substring(0,a.length-1)),a}function ae(e){let t=``;for(let n=0;n<e.length;n+=te)t+=String.fromCharCode.apply(null,e.subarray(n,n+te));return t}function oe(e,t){return ie(e,t,!1)}function se(e,t){return ie(e,t,!0)}function ce(e,t){if(!(t>0))return``;if(re(e,t),t<=ne){let n=e.view,r=``;for(let i=0,a=e.offset;i<t;i++,a++)r+=String.fromCharCode(n.getUint8(a));return e.offset+=t,r}let n=ae(new Uint8Array(e.view.buffer,e.view.byteOffset+e.offset,t));return e.offset+=t,n}function L(e,t){e.offset+=t}function le(e,t,n){let r=e.offset,i=P(e);if(i!==t&&i!==n)throw Error(`Invalid signature: '${i}' at 0x${r.toString(16)}`)}function ue(e,t){let n=N(e,t);if(t>ne)return ae(n);let r=``;for(let e=0;e<n.length;e++)r+=String.fromCharCode(n[e]);return r}function de(e){return e===`8BIM`||e===`MeSa`||e===`AgHg`||e===`PHUT`||e===`DCSR`}function fe(n,i={}){le(n,`8BPS`);let a=C(n);if(a!==1&&a!==2)throw Error(`Invalid PSD file version: ${a}`);L(n,6);let c=C(n),l=D(n),u=D(n),d=C(n),f=C(n),p=a===1?3e4:3e5;if(u>p||l>p)throw Error(`Invalid size: ${u}x${l}`);if(c<1||c>57)throw Error(`Invalid channel count: ${c}`);if(![1,8,16,32].includes(d))throw Error(`Invalid bitsPerChannel: ${d}`);if(e.supportedColorModes.indexOf(f)===-1)throw Error(`Color mode not supported: ${s[f]??f}`);let m={width:u,height:l,channels:c,bitsPerChannel:d,colorMode:f};Object.assign(n,i),n.large=a===2,n.globalAlpha=!1,n.layersInGlobalInfo=!1;let h=n.imageResourcesWhitelist;n.imageResourcesWhitelistSet=h?h instanceof Set?h:new Set(h):void 0,`totalMemoryLimit`in n||(n.totalMemoryLimit=2147483648),et(n,1,e=>{if(e()){if(f===2){if(e()!=768)throw Error(`Invalid color palette size`);m.palette=[];for(let e=0;e<256;e++)m.palette.push({r:_(n),g:0,b:0});for(let e=0;e<256;e++)m.palette[e].g=_(n);for(let e=0;e<256;e++)m.palette[e].b=_(n)}L(n,e())}});let g={},v=0;et(n,1,e=>{for(;e()>=12;){let e=je(n,de),t=C(n),r=_(n),i=N(n,r);L(n,(r+1)%2),et(n,2,r=>{let a=o.resourceHandlersMap[t];if(a){if(t===1036&&n.skipThumbnail||!(0,o.shouldReadResource)(a,n.imageResourcesWhitelistSet))L(n,r());else try{a.read(n,g,r,{signature:e,id:t,name:i,width:u,height:l})}catch(e){if(n.throwForMissingFeatures)throw e;L(n,r())}}else n.logMissingFeatures&&n.log(`Unhandled image resource: ${t} (${r()})`),L(n,r())})}v=e(),L(n,e())}),v&&!me(n,n.offset)&&me(n,n.offset-v)&&(n.offset-=v);let{layersGroup:b,layerGroupsEnabledId:x,savedPathsOrigination:S}=g,w=t(g,[`layersGroup`,`layerGroupsEnabledId`,`savedPathsOrigination`]);Object.keys(w).length&&(m.imageResources=w),et(n,1,e=>{if(et(n,2,e=>{pe(n,m,g),L(n,e())},void 0,n.large),e()>0){let e=ke(n);e&&(m.globalLayerMaskInfo=e)}else L(n,e());for(;e()>0;){for(;e()&&y(n)===0;)L(n,1);e()>=12?Ne(n,m,m,g):L(n,e())}},void 0,n.large);let T=m.children&&m.children.length;if(!(n.skipCompositeImageData&&(n.skipLayerImageData||T))){if(n.useRawData){let e=Math.min(n.offset,n.view.byteLength);m.rawCompositeData=new Uint8Array(n.view.buffer,n.view.byteOffset+e,n.view.byteLength-e),m.rawCompositeDataInfo={large:n.large,globalAlpha:n.globalAlpha},n.layersInGlobalInfo&&(m.rawCompositeDataInfo.layersInGlobalInfo=!0)}else{let e=Fe(n,m);n.useImageData?m.imageData=e:m.canvas=(0,r.imageDataToCanvas)(e)}}return m}function pe(e,t,n){let{layersGroup:i=[],layerGroupsEnabledId:a=[]}=n,o=x(e);o<0&&(e.globalAlpha=!0,o=-o);let s=[],c=[];for(let r=0;r<o;r++){let{layer:o,channels:l}=R(e,t,n);i[r]!==void 0&&(o.linkGroup=i[r]),a[r]!==void 0&&(o.linkGroupEnabled=!!a[r]),s.push(o),c.push(l)}for(let n=0;n<o;n++)U(e,t,s[n],c[n]);t.children||=[];let l=[t];for(let e=s.length-1;e>=0;e--){let t=s[e],n=t.sectionDivider?t.sectionDivider.type:0;n===1||n===2?(t.opened=n===1,t.children=[],delete t.canvas,delete t.imageData,t.sectionDivider?.key&&(t.blendMode=r.toBlendMode[t.sectionDivider.key]??t.blendMode),l[l.length-1].children.unshift(t),l.push(t)):n===3?l.length>1&&l.pop():l[l.length-1].children.unshift(t)}}function R(e,t,n){let i={};if(i.top=T(e),i.left=T(e),i.bottom=T(e),i.right=T(e),!z(i,e))throw Error(`Invalid layer size`);let a=C(e),o=[];for(let t=0;t<a;t++){let t=x(e),n=D(e);if(e.large){if(n!==0)throw Error(`Sizes larger than 4GB are not supported`);n=D(e)}o.push({id:t,length:n})}le(e,`8BIM`);let s=P(e);if(!r.toBlendMode[s]){if(e.throwForMissingFeatures)throw Error(`Invalid blend mode: '${s}'`);e.logMissingFeatures&&e.log(`Unknown blend mode: '${s}', using normal blend mode`)}i.blendMode=r.toBlendMode[s]||`normal`,i.opacity=_(e)/255,i.clipping=_(e)===1;let c=_(e);return i.transparencyProtected=!!(c&1),i.hidden=!!(c&2),c&32&&(i.effectsOpen=!0),L(e,1),et(e,1,r=>{he(e,i);let a=_e(e);for(a&&(i.blendingRanges=a),i.name=F(e,1);r()>4&&!ee(e,e.offset);)e.offset++;for(;r()>=12;)Ne(e,i,t,n);L(e,r())}),{layer:i,channels:o}}function me(e,t){let n=e.large?8:4;if(t<0||t+n>e.view.byteLength)return!1;let r=e.large?e.view.getUint32(t)*4294967296+e.view.getUint32(t+4):e.view.getUint32(t);return t+n+r<=e.view.byteLength}function z(e,t){let n=(e.right||0)-(e.left||0),r=(e.bottom||0)-(e.top||0),i=t.large?3e5:3e4;return n<=i&&r<=i}function he(e,t){return et(e,1,n=>{if(!n())return;let r={};if(t.mask=r,r.top=T(e),r.left=T(e),r.bottom=T(e),r.right=T(e),!z(r,e))throw Error(`Invalid mask size`);r.defaultColor=_(e);let i=_(e);if(r.positionRelativeToLayer=!!(i&1),r.disabled=!!(i&2),r.fromVectorData=!!(i&8),V(e,i,n())){let n={};t.realMask=n;let r=_(e);if(n.positionRelativeToLayer=!!(r&1),n.disabled=!!(r&2),n.fromVectorData=!!(r&8),n.defaultColor=_(e),n.top=T(e),n.left=T(e),n.bottom=T(e),n.right=T(e),!z(n,e))throw Error(`Invalid realMask size`)}if(i&16){let t=_(e);t&1&&(r.userMaskDensity=_(e)/255),t&2&&(r.userMaskFeather=A(e)),t&4&&(r.vectorMaskDensity=_(e)/255),t&8&&(r.vectorMaskFeather=A(e))}L(e,n())})}function ge(e){return 1+(e&1?1:0)+(e&2?8:0)+(e&4?1:0)+(e&8?8:0)}function B(e,t,n){if(n<1)return!1;let r=e.getUint8(t);if(r===0||r&-16)return!1;let i=ge(r);if(n<i||n-i>3)return!1;for(let r=i;r<n;r++)if(e.getUint8(t+r)!==0)return!1;return!0}function V(e,t,n){if(n<18)return!1;if(!(t&16))return!0;let{view:r,offset:i}=e;return B(r,i,n)?!1:B(r,i+18,n-18)?!0:n===18||n-18>=ge(r.getUint8(i+18))}function H(e){return[_(e),_(e),_(e),_(e)]}function _e(e){return et(e,1,t=>{let n=H(e),r=H(e),i=[];for(;t()>0;){let t=H(e),n=H(e);i.push({sourceRange:t,destRange:n})}return{compositeGrayBlendSource:n,compositeGraphBlendDestinationRange:r,ranges:i}})}function U(e,t,n,r){if(e.skipLayerImageData)return;let{colorMode:i=3,bitsPerChannel:a=8}=t;n.rawData={colorMode:i,bitsPerChannel:a,channels:[],large:e.large};for(let t of r){let r=e.offset,i=0,a;if(t.length>=2){if(i=C(e),i>3&&(--e.offset,i=C(e)),i>3&&(e.offset-=4,i=C(e)),i>3)throw Error(`Invalid compression: ${i}`);t.length>2&&(a=N(e,t.length-2))}e.offset=r+t.length,n.rawData.channels.push({id:t.id,compression:i,data:a})}if(!e.useRawData)try{Q(n,e)}catch(t){if(e.throwForMissingFeatures||t.message===`Exceeded memory limit`)throw t;e.logMissingFeatures&&e.log(`Failed to decode layer image data: ${t.message}`),delete n.rawData}}function ve({data:e},t){let n=e instanceof Float32Array?1:e instanceof Uint16Array?65535:255,r=(t?4:3)|0,i=e.length|0,a=(t?5:4)|0;for(let t=r;t<i;t=t+a|0)e[t]=n}function ye(e){let t=e.rawCompositeData;if(!t)return;let n=m(t.buffer,t.byteOffset,t.byteLength),r=e.rawCompositeDataInfo;return r&&(n.large=r.large,n.globalAlpha=r.globalAlpha,n.layersInGlobalInfo=!!r.layersInGlobalInfo),Fe(n,e)}function W(e){return Te(ye(e))}function G(e){return De(e,$.Layer,!1,void 0)}function be(e){return De(e,$.Mask,!1,void 0)}function xe(e){return De(e,$.RealMask,!1,void 0)}function K(e){return Te(G(e))}function q(e){return Te(be(e))}function Se(e){return Te(xe(e))}function Ce(e){let{depth:t,channels:n,colorMode:r=3}=e,i=Math.max(0,e.right-e.left),a=Math.max(0,e.bottom-e.top);if(!i||!a)return;let o=r===4;if(o&&t!==8&&t!==16)throw Error(`bitsPerChannel not supported`);let s=o?5:4,l=n.length-1,u=Math.min(o?4:r===1?1:3,n.length-2),d=Pe(i,a,t,s,void 0);for(let e=0;e<n.length;e++){let r=n[e];r&&(e<u?X(r,d,i,a,t,e,s):e===l&&X(r,d,i,a,t,s-1,s))}if(r===1&&c(d),n[l]||ve(d,o),o){let e=d;d=Pe(e.width,e.height,t,4,void 0),Be(e,d,!1)}return d}function J(e){let{extra:t,depth:n}=e;if(!t)return;let r=Math.max(0,t.right-t.left),i=Math.max(0,t.bottom-t.top);if(!r||!i)return;let a=Pe(r,i,n,4,void 0);return X(t,a,r,i,n,0,4),c(a),ve(a,!1),a}function we(e){return Te(Ce(e))}function Y(e){return Te(J(e))}function X({compressionMode:e,data:t},n,r,i,a,o,s){Oe(m(t.buffer,t.byteOffset,t.byteLength),t.byteLength,n,e,r,i,a,o,!0,s)}function Te(e){return e&&(0,r.imageDataToCanvas)(e)}function Z(e,t,n){t&&(n?e.imageData=t:e.canvas=(0,r.imageDataToCanvas)(t))}function Ee(e,t){Q(e,{useImageData:t})}function Q(e,t){let{throwForMissingFeatures:n,useImageData:r}=t,i=De(e,$.Layer,n,t.totalMemoryLimit,t);if(Z(e,i,r),t.totalMemoryLimit!==void 0&&(t.totalMemoryLimit-=i?.data.byteLength??0),e.mask){let i=De(e,$.Mask,n,t.totalMemoryLimit,t);Z(e.mask,i,r),t.totalMemoryLimit!==void 0&&(t.totalMemoryLimit-=i?.data.byteLength??0)}if(e.realMask){let i=De(e,$.RealMask,n,t.totalMemoryLimit,t);Z(e.realMask,i,r),t.totalMemoryLimit!==void 0&&(t.totalMemoryLimit-=i?.data.byteLength??0)}delete e.rawData}var $;(function(e){e[e.Layer=0]=`Layer`,e[e.Mask=1]=`Mask`,e[e.RealMask=2]=`RealMask`})($||={});function De(e,t,n,i,a){if(!e.rawData)return;let{colorMode:o,bitsPerChannel:s,channels:l,large:u}=e.rawData,d=Math.max(0,(e.right||0)-(e.left||0)),f=Math.max(0,(e.bottom||0)-(e.top||0)),p=o===4,h,g,_=!1;if(d&&f&&t===$.Layer){if(p){if(s!==8&&s!==16)throw Error(`bitsPerChannel not supported`);h=Pe(d,f,s,5,i)}else h=Pe(d,f,s,4,i)}for(let{id:o,compression:v,data:y}of l){if(!y)continue;let l=m(y.buffer,y.byteOffset,y.byteLength);if(l.debug=!!a?.debug,a?.log&&(l.log=a.log),i!==void 0&&(l.totalMemoryLimit=Math.max(0,i-(h?.data.byteLength??0))),o===-2||o===-3){if(o===-2&&t!==$.Mask||o===-3&&t!==$.RealMask)continue;let n=o===-2?e.mask:e.realMask;if(!n)throw Error(`Missing layer ${o===-2?`mask`:`real mask`} data`);let r=Math.max(0,(n.right||0)-(n.left||0)),a=Math.max(0,(n.bottom||0)-(n.top||0));r&&a&&(g=Pe(r,a,s,4,i),i!==void 0&&(l.totalMemoryLimit=Math.max(0,l.totalMemoryLimit-g.data.byteLength)),Oe(l,y.byteLength,g,v,r,a,s,0,u,4),c(g),ve(g,!1))}else{if(t!==$.Layer)continue;let e=(0,r.offsetForChannel)(o,p),i=h;if(e<0&&(i=void 0,n))throw Error(`Channel not supported: ${o}`);Oe(l,y.byteLength,i,v,d,f,s,e,u,p?5:4)}o===-1&&(_=!0)}if(h&&(o===1&&c(h),_||ve(h,p),p)){let e=h,t=i===void 0?void 0:Math.max(0,i-e.data.byteLength);h=Pe(e.width,e.height,s,4,t),Be(e,h,!1)}return t===$.Layer?h:g}function Oe(e,t,n,r,i,a,o,s,c,l){if(t){if(r===0)t!==i*a*Math.floor(o/8)&&h(e,`Invalid length (${t}, ${i*a*Math.floor(o/8)})`),We(N(e,t),n,o,l,s);else if(r===1)$e(e,n,i,a,o,l,[s],c);else if(r===2)Je(N(e,t),n,i,a,o,l,s,!1,e);else if(r===3)Je(N(e,t),n,i,a,o,l,s,!0,e);else throw Error(`Invalid Compression type: ${r}`)}}function ke(e){return et(e,1,t=>{if(!t())return;let n=C(e),r=C(e),i=C(e),a=C(e),o=C(e),s=Math.min(C(e),100)/100,c=_(e);return L(e,t()),{overlayColorSpace:n,colorSpace1:r,colorSpace2:i,colorSpace3:a,colorSpace4:o,opacity:s,kind:c}})}var Ae=[0,1,-1,2,-2,3,-3,4,-4];function je(e,t){let n=e.offset,r=``;for(let i of Ae){try{e.offset=n+i,r=P(e)}catch{}if(t(r))break}if(!t(r))throw Error(`Invalid signature: '${r}' at 0x${n.toString(16)}`);return r}function Me(e){return e===`8BIM`||e===`8B64`}function Ne(e,t,n,a){let o=je(e,Me),s=P(e),c=o===`8B64`||e.large&&r.largeAdditionalInfoKeys.indexOf(s)!==-1;if(e.large&&o===`8BIM`&&r.largeAdditionalInfoKeysObserved.indexOf(s)!==-1){let t=e.offset+8<=e.view.byteLength?e.view.getUint32(e.offset+4):0,n=t===943868237||t===943863348;c=e.view.getUint32(e.offset)===0&&!n}et(e,2,r=>{let o=i.infoHandlersMap[s];o?o.read(e,t,r,n,a):(e.logMissingFeatures&&s!==`GenI`&&s!==`OCIO`&&s!==`CAI `&&e.log(`Unhandled additional info: ${s}`),L(e,r())),r()&&(e.logMissingFeatures&&e.log(`Unread ${r()} bytes left for additional info: ${s}`),L(e,r()))},!1,c)}function Pe(e,t,n,i,a){let o=e*t*i*Math.max(1,n/8);if(a!==void 0&&o>a)throw Error(`Exceeded memory limit`);if(n===1||n===8)return i===4?(0,r.createImageData)(e,t):{width:e,height:t,data:new Uint8ClampedArray(e*t*i)};if(n===16)return{width:e,height:t,data:new Uint16Array(e*t*i)};if(n===32)return{width:e,height:t,data:new Float32Array(e*t*i)};throw Error(`Invalid bitDepth (${n})`)}function Fe(t,n){let i=C(t),a=n.bitsPerChannel??8,{width:o,height:s}=n;if(e.supportedColorModes.indexOf(n.colorMode)===-1)throw Error(`Color mode not supported: ${n.colorMode}`);if(i!==0&&i!==1)throw Error(`Compression type not supported: ${i}`);let l=Pe(o,s,a,4,t.totalMemoryLimit);switch(t.totalMemoryLimit!==void 0&&(t.totalMemoryLimit-=l.data.byteLength),(0,r.resetImageData)(l),n.colorMode){case 0:{if(a!==1)throw Error(`Invalid bitsPerChannel for bitmap color mode`);let e=Math.ceil(o/8),n;i===0?n=N(t,e*s):(n=new Uint8Array(e*s),$e(t,{data:n,width:e,height:s},e,s,8,1,[0],t.large)),(0,r.decodeBitmap)(n,l.data,o,s);break}case 3:case 1:Le(t,i,l,a,4,Ie(t,n,n.colorMode===1?1:3,3)),n.colorMode===1&&c(l);break;case 2:{if(a!==8)throw Error(`bitsPerChannel not supported`);if(!n.palette)throw Error(`Missing color palette`);let e=Ie(t,n,1,-1),r={width:o,height:s,data:new Uint8Array(o*s)};Le(t,i,r,8,1,e),Ve(r,l,n.palette,n.imageResources?.transparencyIndex??-1);break}case 4:{if(a!==8&&a!==16)throw Error(`bitsPerChannel not supported`);let e=Ie(t,n,4,4),r=Pe(o,s,a,5,t.totalMemoryLimit);ve(r,!0),Le(t,i,r,a,5,e),Be(r,l,!!t.globalAlpha);break}default:throw Error(`Color mode not supported: ${n.colorMode}`)}return t.globalAlpha&&n.colorMode!==4&&Re(l),l}function Ie(e,t,n,r){let i=t.channels??n+ +!!e.globalAlpha;if(i<n)throw Error(`Invalid channel count: ${i}`);let a=t.imageResources?.alphaChannelNames??[],o=a.length,s=!!e.layersInGlobalInfo&&a[0]===`Transparency`&&o===i-n,c=e.globalAlpha||s||i-n>o,l=[];for(let e=0;e<i;e++)e<n?l.push(e):e===n&&c&&r>=0?l.push(r):l.push(-1);return l}function Le(e,t,n,r,i,a){if(t===0){let t=n.width*n.height*He(r);for(let o of a)o<0?L(e,t):We(N(e,t),n,r,i,o)}else if(t===1)$e(e,n,n.width,n.height,r,i,a,e.large);else throw Error(`Compression not supported: ${t}`)}function Re({data:e,width:t,height:n}){let r=t*n*4;if(e instanceof Float32Array)for(let t=0;t<r;t+=4){let n=e[t+3];if(n>0&&n<1){let r=1/n,i=1-r;for(let n=0;n<3;n++){let a=e[t+n]*r+i;e[t+n]=a<0?0:a}}}else if(e instanceof Uint16Array)for(let t=0;t<r;t+=4){let n=e[t+3];if(n!==0&&n!==65535){let r=65535/n,i=65535*(1-r);for(let n=0;n<3;n++){let a=Math.round(e[t+n]*r+i);e[t+n]=a<0?0:a>65535?65535:a}}}else for(let t=0;t<r;t+=4){let n=e[t+3];if(n!=0&&n!=255){let r=1/(n/255),i=255*(1-r);e[t+0]=e[t+0]*r+i,e[t+1]=e[t+1]*r+i,e[t+2]=e[t+2]*r+i}}}function ze(e,t){return e=Math.round(t/255*e),e<=0?0:e>=t?t:e}function Be(e,t,n){let i=t.width*t.height*4,a=e.data,o=t.data,s=a instanceof Uint16Array?65535:255,c=o instanceof Uint16Array?65535:255,l=[0,0,0];for(let e=0,t=0;t<i;e+=5,t+=4){let i=a[e+4],u=1-a[e]/s,d=1-a[e+1]/s,f=1-a[e+2]/s,p=1-a[e+3]/s;if(n&&i>0&&i<s){let e=s/i;u=Math.min(1,u*e),d=Math.min(1,d*e),f=Math.min(1,f*e),p=Math.min(1,p*e)}(0,r.cmykToRgbValues)(u,d,f,p,l),o[t]=ze(l[0],c),o[t+1]=ze(l[1],c),o[t+2]=ze(l[2],c),o[t+3]=s===c?i:Math.round(i*c/s)}}function Ve(e,t,n,r){let i=e.width*e.height,a=e.data,o=t.data;for(let e=0,t=0;e<i;e++,t+=4){let i=a[e],s=n[i];o[t+0]=s.r,o[t+1]=s.g,o[t+2]=s.b,o[t+3]=i===r?0:255}}function He(e){switch(e){case 1:case 8:return 1;case 16:return 2;case 32:return 4;default:throw Error(`Invalid bitDepth (${e})`)}}function Ue(e,t){if(e.BYTES_PER_ELEMENT!==t)throw Error(`Invalid array types`)}function We(e,t,n,r,i){let a=He(n);if(!t||i<0||i>=r)return;let o=t.data;Ue(o,a);let s=Math.min(t.width*t.height,Math.floor(e.byteLength/a))|0;if(a===1)for(let t=0,n=i|0;t<s;t++,n=n+r|0)o[n]=e[t];else if(a===2)for(let t=0,n=0,a=i|0;t<s;t++,n+=2,a=a+r|0)o[a]=e[n]<<8|e[n+1];else{let t=new DataView(e.buffer,e.byteOffset,e.byteLength);for(let e=0,n=0,a=i|0;e<s;e++,n+=4,a=a+r|0)o[a]=t.getFloat32(n,!1)}}function Ge(e,t,n){for(let r=0;r<n;r++){let n=r*t;for(let r=1,i=n+1;r<t;r++,i++)e[i]=e[i-1]+e[i]}}var Ke=Error(`Decompressed data exceeds expected size`);function qe(e,t,r,i=!1){let a=new Uint8Array(t),o=0,s=!1,c=new n.Inflate({chunkSize:Math.max(1024,Math.min(t,65536)),raw:i});c.onData=e=>{let n=e,r=Math.min(n.length,t-o);if(r>0&&a.set(r===n.length?n:n.subarray(0,r),o),o+=r,r<n.length)throw s=!0,Ke},c.onEnd=e=>{c.err=e,c.msg=c.strm?.msg||``};try{c.push(e,!0)}catch(e){if(e!==Ke)throw e}if(s)r&&h(r,Ke.message);else if(c.err&&c.msg===`incorrect data check`&&!i)return r&&h(r,`Invalid zip data: ${c.msg}`),qe(e.subarray(2),t,r,!0);else if(c.err)throw Error(`Invalid zip data: ${c.msg}`);return a}function Je(e,t,n,r,i,a,o,s,c){let l=He(i);if(!t||o<0||o>=a)return;let u=t.data;Ue(u,l);let d=n*r*l;c&&st(c,d);try{let t=qe(e,d,c);if(l===1)for(let e=0,i=0;e<r;e++){let r=0;for(let c=0,l=o+e*n*a;c<n;c++,i++,l+=a){let e=t[i];s&&(e=r=r+e&255),u[l]=e}}else if(l===2)for(let e=0,i=0;e<r;e++){let r=0;for(let c=0,l=o+e*n*a;c<n;c++,i+=2,l+=a){let e=t[i]<<8|t[i+1];s&&(e=r=r+e&65535),u[l]=e}}else{let e=new Uint32Array(u.buffer,u.byteOffset,u.length);if(s){Ge(t,n*4,r);for(let i=0,s=o;i<r;i++){let r=n*4*i;for(let i=0;i<n;i++,r++,s+=a){let i=r+n,a=i+n,o=a+n;e[s]=(t[r]<<24|t[i]<<16|t[a]<<8|t[o])>>>0}}}else{let i=new DataView(t.buffer,t.byteOffset,t.byteLength);for(let t=0,s=0,c=o,l=n*r;t<l;t++,s+=4,c+=a)e[c]=i.getUint32(s,!1)}}}finally{c&&ct(c,d)}}function Ye(e,t,n,r,i){let a=0;for(;t<n&&a<i;){let o=e[t++];if(o>128){if(t>=n)break;let s=e[t++],c=257-o;c>i-a&&(c=i-a),r.fill(s,a,a+c),a+=c}else if(o<128){let s=o+1;for(s>i-a&&(s=i-a),s>n-t&&(s=n-t);s>0;s--)r[a++]=e[t++]}}return a}function Xe(e,t,n,r,i,a,o,s,c){let l=e.length|0;for(let u=0;u<a;u++,n++){let a=(r<l?r:l)|0;r+=t[n];let d=(r<l?r:l)|0,f=s+u*i*c|0,p=0;for(;a<d&&p<i;){let t=e[a++]|0;if(t>128){if(a>=d)break;let n=e[a++]|0,r=257-t|0;r>i-p&&(r=i-p|0),p=p+r|0;for(let e=f+r*c|0;f<e;f=f+c|0)o[f]=n}else if(t<128){let n=t+1|0;n>i-p&&(n=i-p|0),n>d-a&&(n=d-a|0),p=p+n|0;for(let t=a+n|0;a<t;a=a+1|0,f=f+c|0)o[f]=e[a]}}}}function Ze(e,t,n,r,i,a){if(n===2)for(let n=0,o=0;n<t;n++,o+=2,i+=a)r[i]=e[o]<<8|e[o+1];else{let n=new DataView(e.buffer,e.byteOffset,e.byteLength);for(let e=0,o=0;e<t;e++,o+=4,i+=a)r[i]=n.getFloat32(o,!1)}}function Qe(e,t,n,r,i,a,o,s,c,l,u){let d=e.length,f=i*l;for(let p=0;p<a;p++,n++){let a=r<d?r:d;r+=t[n];let m=r<d?r:d;if(a>=m)continue;let h=Ye(e,a,m,u,f);Ze(u,Math.floor(h/l),l,o,s+p*i*c,c)}}function $e(e,t,n,r,i,a,o,s){let c=t&&t.data,l=o.length*r,u=l*(s?4:2),d=e.view.byteLength,f=He(i),p;st(e,u);try{if(e.offset+u>d)throw Error(`RLE row lengths exceed buffer length`);p=s?new Uint32Array(l):new Uint16Array(l);let t=0;if(s)for(let n=0;n<l;n++)t+=p[n]=D(e);else for(let n=0;n<l;n++)t+=p[n]=C(e);t>d-e.offset&&h(e,`RLE data exceeds buffer length`),c&&Ue(c,f)}catch(t){throw ct(e,u),t}let m=new Uint8Array(e.view.buffer,e.view.byteOffset,d),g=c&&f>1?new Uint8Array(n*f):void 0,_=e.offset;for(let e=0,t=0;e<o.length;e++,t+=r){let i=o[e]|0,s=_;for(let e=0;e<r;e++)_+=p[t+e];c&&i>=0&&i<a&&(f===1?Xe(m,p,t,s,n,r,c,i,a):Qe(m,p,t,s,n,r,c,i,a,f,g))}e.offset=_,ct(e,u)}function et(e,t,n,r=!0,i=!1){let a=D(e);if(i){if(a!==0)throw Error(`Sizes larger than 4GB are not supported`);a=D(e)}if(a<=0&&r)return;let o=e.offset+a;if(o>e.view.byteLength)throw Error(`Section exceeds file size`);let s=n(()=>o-e.offset);for(e.offset!==o&&(e.offset>o?h(e,`Exceeded section limits`):h(e,`Unread section data`));a%t;)a++,o++;return e.offset=o,s}function tt(e){switch(C(e)){case 0:{let t=C(e)/257,n=C(e)/257,r=C(e)/257;return L(e,2),{r:t,g:n,b:r}}case 1:{let t=C(e)/65535,n=C(e)/65535,r=C(e)/65535;return L(e,2),{h:t,s:n,b:r}}case 2:return{c:(65535-C(e))/257,m:(65535-C(e))/257,y:(65535-C(e))/257,k:(65535-C(e))/257};case 7:{let t=x(e)/1e4,n=x(e),i=x(e),a=(0,r.normalizeLabAB)(n,100),o=(0,r.normalizeLabAB)(i,100);return L(e,2),{l:t,a,b:o}}case 8:{let t=C(e)*255/1e4;return L(e,6),{k:t}}default:throw Error(`Invalid color space`)}}var nt=3e4;function rt(e){let t=e.view.getUint32(e.offset);for(;t%4;)t++;let n=e.offset+4+t;try{return it(e)}catch(t){if(e.throwForMissingFeatures)throw t;e.logMissingFeatures&&e.log(`Skipped pattern: ${t.message}`),e.offset=n;return}}function it(e){let t=D(e);for(;t%4;)t++;let n=e.offset+t,r=D(e);if(r!==1)throw Error(`Invalid pattern version: ${r}`);let i=D(e),a=x(e),o=x(e);if(i!==3&&i!==1&&i!==2&&i!==4)throw Error(`Unsupported pattern color mode: ${i}`);let s=I(e),c=F(e,1),l=[];if(i===2){for(let t=0;t<256;t++)l.push({r:_(e),g:_(e),b:_(e)});e.view.getUint32(e.offset)!==3&&L(e,4)}let u=D(e);if(u!==3)throw Error(`Invalid pattern VMAL version: ${u}`);D(e);let d=D(e),f=D(e),p=D(e),h=D(e),g=D(e),v=h-f,y=p-d;if(v<0||y<0)throw Error(`Invalid pattern bounds`);if(v>nt||y>nt)throw Error(`Pattern too large (${v}x${y})`);if(g>64)throw Error(`Invalid pattern channel count: ${g}`);if(v*y>(Math.min(n,e.view.byteLength)-e.offset)*64)throw Error(`Pattern data out of bounds`);let b=i===3?3:i===4?4:1,S=i===4,w=S?4:3,T=[],E=0;for(let t=0,r=0;t<g+2&&e.offset+4<=n;t++){if(!D(e))continue;let t=D(e);if(!t)continue;if(t<23)throw Error(`Invalid pattern channel length`);let n=D(e),i=D(e),a=D(e),o=D(e),s=D(e),c=C(e),l=_(e),u=N(e,t-23),m=c===8||c===16||c===32?c:n;if(m!==8&&m!==16&&m!==32)throw Error(`Unsupported pattern pixel depth: ${m}`);if(i<d||a<f||o>p||s>h||o<i||s<a)throw Error(`Pattern channel bounds outside of pattern bounds`);let g=r<b?r:r===b?w:-1;if(r++,g===-1)continue;let v=s-a,y=o-i,x=m/8*v,S=x*y;if(l===0){if(u.byteLength<S)throw Error(`Pattern channel data out of bounds`)}else if(l===1){if(S>u.byteLength*64)throw Error(`Pattern channel data out of bounds`);E=Math.max(E,S)}else throw Error(`Invalid pattern compression mode`);T.push({target:g,depth:m,compressionMode:l,cdata:u,ctop:i,cleft:a,w:v,h:y,rowBytes:x,channelSize:S})}let O=v*y*4,k=S?v*y*5:0;st(e,O+k+E),ct(e,O+k+E);let A=new Uint8Array(O);for(let e=3;e<A.byteLength;e+=4)A[e]=255;let j=S?new Uint8Array(k).fill(255):void 0;for(let{target:e,depth:t,compressionMode:n,cdata:r,ctop:a,cleft:o,w:s,h:c,rowBytes:u,channelSize:p}of T){let h=r;n===1&&(h=new Uint8Array(p),$e(m(r.buffer,r.byteOffset,r.byteLength),{data:h,width:u,height:c},u,c,8,1,[0],!1)),t!==8&&(h=at(h,s*c,t));let g=o-f,_=a-d;if(j)ot(h,j,s,c,(g+_*v)*5+e,v*5,5);else if(e===3||i===3)ot(h,A,s,c,(g+_*v)*4+e,v*4,4);else if(i===2){let e=new Uint8Array(768);for(let t=0;t<256;t++)e[t*3+0]=l[t].r,e[t*3+1]=l[t].g,e[t*3+2]=l[t].b;for(let t=0;t<c;t++)for(let n=0,r=t*s,i=(g+(t+_)*v)*4;n<s;n++,r++,i+=4){let t=h[r]*3;A[i+0]=e[t+0],A[i+1]=e[t+1],A[i+2]=e[t+2]}}else for(let e=0;e<c;e++)for(let t=0,n=e*s,r=(g+(e+_)*v)*4;t<s;t++,n++,r+=4){let e=h[n];A[r+0]=e,A[r+1]=e,A[r+2]=e}}return j&&Be({width:v,height:y,data:j},{width:v,height:y,data:A},!1),st(e,O),e.offset=n,{id:c,name:s,x:a,y:o,bounds:{x:f,y:d,w:v,h:y},data:A}}function at(e,t,n){let r=new Uint8Array(t);if(n===16)for(let n=0;n<t;n++)r[n]=Math.round((e[n*2]<<8|e[n*2+1])/257);else{let n=new DataView(e.buffer,e.byteOffset,e.byteLength);for(let e=0;e<t;e++){let t=n.getFloat32(e*4,!1);r[e]=t>0?t<1?Math.round(t*255):255:0}}return r}function ot(e,t,n,r,i,a,o){for(let s=0,c=0;s<r;s++)for(let r=0,l=i+s*a;r<n;r++,c++,l+=o)t[l]=e[c]}function st(e,t){if(!(t>=0))throw Error(`Invalid size`);if(e.totalMemoryLimit!==void 0){if(e.totalMemoryLimit<t)throw Error(`Exceeded memory limit`);e.totalMemoryLimit-=t}}function ct(e,t){e.totalMemoryLimit!==void 0&&(e.totalMemoryLimit+=t)}})),w=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.readEffects=l,e.writeEffects=d;var t=v(),n=C(),r=k(),i=[void 0,`outer bevel`,`inner bevel`,`emboss`,`pillow emboss`,`stroke emboss`];function a(e){return(0,n.checkSignature)(e,`8BIM`),t.toBlendMode[(0,n.readSignature)(e)]||`normal`}function o(e,n){(0,r.writeSignature)(e,`8BIM`),(0,r.writeSignature)(e,t.fromBlendMode[n]||`norm`)}function s(e){return(0,n.readUint8)(e)/255}function c(e,t){(0,r.writeUint8)(e,Math.round(t*255)|0)}function l(e){let t=(0,n.readUint16)(e);if(t!==0)throw Error(`Invalid effects layer version: ${t}`);let r=(0,n.readUint16)(e),o={};for(let t=0;t<r;t++){(0,n.checkSignature)(e,`8BIM`);let t=(0,n.readSignature)(e);switch(t){case`cmnS`:{let t=(0,n.readUint32)(e),r=(0,n.readUint32)(e);if((0,n.readUint8)(e),(0,n.skipBytes)(e,2),t!==7||r!==0)throw Error(`Invalid effects common state`);break}case`dsdw`:case`isdw`:{let r=(0,n.readUint32)(e),i=(0,n.readUint32)(e);if(r!==41&&r!==51)throw Error(`Invalid shadow size: ${r}`);if(i!==0&&i!==2)throw Error(`Invalid shadow version: ${i}`);let c=(0,n.readFixedPoint32)(e);(0,n.readFixedPoint32)(e);let l=(0,n.readFixedPoint32)(e),u=(0,n.readFixedPoint32)(e),d=(0,n.readColor)(e),f=a(e),p=!!(0,n.readUint8)(e),m=!!(0,n.readUint8)(e),h=s(e);r>=51&&(0,n.readColor)(e);let g={size:{units:`Pixels`,value:c},distance:{units:`Pixels`,value:u},angle:l,color:d,blendMode:f,enabled:p,useGlobalLight:m,opacity:h};t===`dsdw`?o.dropShadow=[g]:o.innerShadow=[g];break}case`oglw`:{let t=(0,n.readUint32)(e),r=(0,n.readUint32)(e);if(t!==32&&t!==42)throw Error(`Invalid outer glow size: ${t}`);if(r!==0&&r!==2)throw Error(`Invalid outer glow version: ${r}`);let i=(0,n.readFixedPoint32)(e);(0,n.readFixedPoint32)(e);let c=(0,n.readColor)(e),l=a(e),u=!!(0,n.readUint8)(e),d=s(e);t>=42&&(0,n.readColor)(e),o.outerGlow={size:{units:`Pixels`,value:i},color:c,blendMode:l,enabled:u,opacity:d};break}case`iglw`:{let t=(0,n.readUint32)(e),r=(0,n.readUint32)(e);if(t!==32&&t!==43)throw Error(`Invalid inner glow size: ${t}`);if(r!==0&&r!==2)throw Error(`Invalid inner glow version: ${r}`);let i=(0,n.readFixedPoint32)(e);(0,n.readFixedPoint32)(e);let c=(0,n.readColor)(e),l=a(e),u=!!(0,n.readUint8)(e),d=s(e);t>=43&&((0,n.readUint8)(e),(0,n.readColor)(e)),o.innerGlow={size:{units:`Pixels`,value:i},color:c,blendMode:l,enabled:u,opacity:d};break}case`bevl`:{let t=(0,n.readUint32)(e),r=(0,n.readUint32)(e);if(t!==58&&t!==78)throw Error(`Invalid bevel size: ${t}`);if(r!==0&&r!==2)throw Error(`Invalid bevel version: ${r}`);let c=(0,n.readFixedPoint32)(e),l=(0,n.readFixedPoint32)(e),u=(0,n.readFixedPoint32)(e),d=a(e),f=a(e),p=(0,n.readColor)(e),m=(0,n.readColor)(e),h=i[(0,n.readUint8)(e)]||`inner bevel`,g=s(e),_=s(e),v=!!(0,n.readUint8)(e),y=!!(0,n.readUint8)(e),b=(0,n.readUint8)(e)?`down`:`up`;t>=78&&((0,n.readColor)(e),(0,n.readColor)(e)),o.bevel={size:{units:`Pixels`,value:u},angle:c,strength:l,highlightBlendMode:d,shadowBlendMode:f,highlightColor:p,shadowColor:m,style:h,highlightOpacity:g,shadowOpacity:_,enabled:v,useGlobalLight:y,direction:b};break}case`sofi`:{let t=(0,n.readUint32)(e),r=(0,n.readUint32)(e);if(t!==34)throw Error(`Invalid effects solid fill info size: ${t}`);if(r!==2)throw Error(`Invalid effects solid fill info version: ${r}`);let i=a(e),c=(0,n.readColor)(e),l=s(e),u=!!(0,n.readUint8)(e);(0,n.readColor)(e),o.solidFill=[{blendMode:i,color:c,opacity:l,enabled:u}];break}default:throw Error(`Invalid effect type: '${t}'`)}}return o}function u(e,t){(0,r.writeUint32)(e,51),(0,r.writeUint32)(e,2),(0,r.writeFixedPoint32)(e,t.size&&t.size.value||0),(0,r.writeFixedPoint32)(e,0),(0,r.writeFixedPoint32)(e,t.angle||0),(0,r.writeFixedPoint32)(e,t.distance&&t.distance.value||0),(0,r.writeColor)(e,t.color),o(e,t.blendMode),(0,r.writeUint8)(e,+!!t.enabled),(0,r.writeUint8)(e,+!!t.useGlobalLight),c(e,t.opacity??1),(0,r.writeColor)(e,t.color)}function d(e,t){let n=t.dropShadow?.[0],a=t.innerShadow?.[0],s=t.outerGlow,l=t.innerGlow,d=t.bevel,f=t.solidFill?.[0],p=1;if(n&&p++,a&&p++,s&&p++,l&&p++,d&&p++,f&&p++,(0,r.writeUint16)(e,0),(0,r.writeUint16)(e,p),(0,r.writeSignature)(e,`8BIM`),(0,r.writeSignature)(e,`cmnS`),(0,r.writeUint32)(e,7),(0,r.writeUint32)(e,0),(0,r.writeUint8)(e,1),(0,r.writeZeros)(e,2),n&&((0,r.writeSignature)(e,`8BIM`),(0,r.writeSignature)(e,`dsdw`),u(e,n)),a&&((0,r.writeSignature)(e,`8BIM`),(0,r.writeSignature)(e,`isdw`),u(e,a)),s&&((0,r.writeSignature)(e,`8BIM`),(0,r.writeSignature)(e,`oglw`),(0,r.writeUint32)(e,42),(0,r.writeUint32)(e,2),(0,r.writeFixedPoint32)(e,s.size?.value||0),(0,r.writeFixedPoint32)(e,0),(0,r.writeColor)(e,s.color),o(e,s.blendMode),(0,r.writeUint8)(e,+!!s.enabled),c(e,s.opacity??1),(0,r.writeColor)(e,s.color)),l&&((0,r.writeSignature)(e,`8BIM`),(0,r.writeSignature)(e,`iglw`),(0,r.writeUint32)(e,43),(0,r.writeUint32)(e,2),(0,r.writeFixedPoint32)(e,l.size?.value||0),(0,r.writeFixedPoint32)(e,0),(0,r.writeColor)(e,l.color),o(e,l.blendMode),(0,r.writeUint8)(e,+!!l.enabled),c(e,l.opacity??1),(0,r.writeUint8)(e,0),(0,r.writeColor)(e,l.color)),d){(0,r.writeSignature)(e,`8BIM`),(0,r.writeSignature)(e,`bevl`),(0,r.writeUint32)(e,78),(0,r.writeUint32)(e,2),(0,r.writeFixedPoint32)(e,d.angle||0),(0,r.writeFixedPoint32)(e,d.strength||0),(0,r.writeFixedPoint32)(e,d.size?.value||0),o(e,d.highlightBlendMode),o(e,d.shadowBlendMode),(0,r.writeColor)(e,d.highlightColor),(0,r.writeColor)(e,d.shadowColor);let t=i.indexOf(d.style);(0,r.writeUint8)(e,t<=0?i.indexOf(`inner bevel`):t),c(e,d.highlightOpacity??1),c(e,d.shadowOpacity??1),(0,r.writeUint8)(e,+!!d.enabled),(0,r.writeUint8)(e,+!!d.useGlobalLight),(0,r.writeUint8)(e,+(d.direction===`down`)),(0,r.writeColor)(e,d.highlightColor),(0,r.writeColor)(e,d.shadowColor)}f&&((0,r.writeSignature)(e,`8BIM`),(0,r.writeSignature)(e,`sofi`),(0,r.writeUint32)(e,34),(0,r.writeUint32)(e,2),o(e,f.blendMode),(0,r.writeColor)(e,f.color),c(e,f.opacity??1),(0,r.writeUint8)(e,+!!f.enabled),(0,r.writeColor)(e,f.color))}})),T=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.setProperty=i,e.parseEngineData=o,e.serializeEngineData=l;var t=C();function n(e){return e===32||e===10||e===13||e===9}function r(e){return e>=48&&e<=57||e===46||e===45}function i(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}var a=64;function o(e,o){let s=0;function c(){for(;s<e.length&&n(e[s]);)s++}function l(){let t=e[s];return s++,t===92&&(t=e[s],s++),t}function u(){let n=``;if(e[s]===41)return s++,n;if(e[s]!==254||e[s+1]!==255){for(;s<e.length&&e[s]!==41;)n+=String.fromCharCode(l());return(0,t.consumeMemory)(o,n.length*2),s++,n}for(s+=2;s<e.length&&e[s]!==41;){let e=l(),t=l(),r=e<<8|t;n+=String.fromCharCode(r)}return(0,t.consumeMemory)(o,n.length*2),s++,n}let d=null,f=[];function p(e){f.length?(m(e),f.push(e)):(f.push(e),d=e)}function m(e){if(!f.length)throw Error(`Invalid data`);(0,t.consumeMemory)(o,a);let n=f[f.length-1];if(typeof n==`string`){let t=f[f.length-2];i(t,n,e),g()}else if(Array.isArray(n))n.push(e);else throw Error(`Invalid data`)}function h(e){f.length||p({});let n=f[f.length-1];if(typeof n==`string`||Array.isArray(n))m(e===`nil`?null:`/${e}`);else if(n&&typeof n==`object`)(0,t.consumeMemory)(o,a+e.length*2),f.push(e);else throw Error(`Invalid data`)}function g(){if(!f.length)throw Error(`Invalid data`);f.pop()}c();let _=e.length,v=0,y=``;for(;_>0&&e[_-1]===0;)_--;for(;s<_;){let t=s,i=e[t];if(i===60&&e[t+1]===60)s+=2,p({});else if(i===62&&e[t+1]===62)s+=2,g();else if(i===47){s+=1;let t=s;for(;s<e.length&&!n(e[s]);)s++;let r=``;for(let n=t;n<s;n++)r+=String.fromCharCode(e[n]);h(r)}else if(i===40)s+=1,m(u());else if(i===91)s+=1,p([]);else if(i===93)s+=1,g();else if(i===110&&e[t+1]===117&&e[t+2]===108&&e[t+3]===108)s+=4,m(null);else if(i===116&&e[t+1]===114&&e[t+2]===117&&e[t+3]===101)s+=4,m(!0);else if(i===102&&e[t+1]===97&&e[t+2]===108&&e[t+3]===115&&e[t+4]===101)s+=5,m(!1);else if(r(i)){let t=``;for(;s<e.length&&r(e[s]);)t+=String.fromCharCode(e[s]),s++;m(parseFloat(t))}else s+=1,v||(y=`'${String.fromCharCode(i)}' (${i}) at ${s}`),v++;c()}return v&&o.log(`Invalid tokens in engine data (${v} in total, first: ${y})`),d}var s=`Axis.XY.Zone.WordSpacing.FirstLineIndent.GlyphSpacing.StartIndent.EndIndent.SpaceBefore.SpaceAfter.LetterSpacing.Values.GridSize.GridLeading.PointBase.BoxBounds.TransformPoint0.TransformPoint1.TransformPoint2.FontSize.Leading.HorizontalScale.VerticalScale.BaselineShift.Tsume.OutlineWidth.AutoLeading`.split(`.`),c=[`RunLengthArray`];function l(e,t=!1){let n=new Uint8Array(1024),r=0,i=0;function a(e){if(r>=n.length){let e=new Uint8Array(n.length*2);e.set(n),n=e}n[r]=e,r++}function o(e){for(let t=0;t<e.length;t++)a(e.charCodeAt(t))}function l(){if(t)o(` `);else for(let e=0;e<i;e++)o(` `)}function u(e,n){l(),o(`/${e}`),_(n,e,!0),t||o(`
|
|
2
2
|
`)}function d(e){return Number.isFinite(e)?e:0}function f(e){return d(e).toString()}function p(e){return d(e).toFixed(5).replace(/(\d)0+$/g,`$1`).replace(/^0+\.([1-9])/g,`.$1`).replace(/^-0+\.0(\d)/g,`-.0$1`)}function m(e,t){return e=d(e),t&&s.indexOf(t)!==-1||(e|0)!==e?p(e):f(e)}function h(e){let t=Object.keys(e);return t.indexOf(`98`)!==-1&&t.unshift(...t.splice(t.indexOf(`98`),1)),t.indexOf(`99`)!==-1&&t.unshift(...t.splice(t.indexOf(`99`),1)),t}function g(e){(e===40||e===41||e===92)&&a(92),a(e)}function _(e,n,r=!1){function s(){r?o(` `):l()}if(e==null)s(),o(t?`/nil`:`null`);else if(typeof e==`number`)s(),o(m(e,n));else if(typeof e==`boolean`)s(),o(e?`true`:`false`);else if(typeof e==`string`){if(s(),(n===`99`||n===`98`)&&e.charAt(0)===`/`)o(e);else{o(`(`),a(254),a(255);for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);g(n>>8&255),g(n&255)}o(`)`)}}else if(Array.isArray(e)){if(s(),e.every(e=>typeof e==`number`)){o(`[`);let t=c.indexOf(n)!==-1;for(let n of e)o(` `),o(t?m(n):p(n));o(` ]`)}else{o(`[`),t||o(`
|
|
3
3
|
`);for(let r of e)_(r,n),t||o(`
|
|
4
4
|
`);l(),o(`]`)}}else if(typeof e==`object`){r&&!t&&o(`
|