forked from espressif/esptool-js
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbundle.js
2 lines (2 loc) · 117 KB
/
bundle.js
1
2
class A extends Error{}
/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */function t(A){let t=A.length;for(;--t>=0;)A[t]=0}const e=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]),i=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]),a=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),n=new Array(576);t(n);const r=new Array(60);t(r);const h=new Array(512);t(h);const o=new Array(256);t(o);const g=new Array(29);t(g);const E=new Array(30);function _(A,t,e,i,s){this.static_tree=A,this.extra_bits=t,this.extra_base=e,this.elems=i,this.max_length=s,this.has_stree=A&&A.length}let w,I,l;function c(A,t){this.dyn_tree=A,this.max_code=0,this.stat_desc=t}t(E);const B=A=>A<256?h[A]:h[256+(A>>>7)],C=(A,t)=>{A.pending_buf[A.pending++]=255&t,A.pending_buf[A.pending++]=t>>>8&255},d=(A,t,e)=>{A.bi_valid>16-e?(A.bi_buf|=t<<A.bi_valid&65535,C(A,A.bi_buf),A.bi_buf=t>>16-A.bi_valid,A.bi_valid+=e-16):(A.bi_buf|=t<<A.bi_valid&65535,A.bi_valid+=e)},D=(A,t,e)=>{d(A,e[2*t],e[2*t+1])},f=(A,t)=>{let e=0;do{e|=1&A,A>>>=1,e<<=1}while(--t>0);return e>>>1},Q=(A,t,e)=>{const i=new Array(16);let s,a,n=0;for(s=1;s<=15;s++)n=n+e[s-1]<<1,i[s]=n;for(a=0;a<=t;a++){let t=A[2*a+1];0!==t&&(A[2*a]=f(i[t]++,t))}},M=A=>{let t;for(t=0;t<286;t++)A.dyn_ltree[2*t]=0;for(t=0;t<30;t++)A.dyn_dtree[2*t]=0;for(t=0;t<19;t++)A.bl_tree[2*t]=0;A.dyn_ltree[512]=1,A.opt_len=A.static_len=0,A.sym_next=A.matches=0},S=A=>{A.bi_valid>8?C(A,A.bi_buf):A.bi_valid>0&&(A.pending_buf[A.pending++]=A.bi_buf),A.bi_buf=0,A.bi_valid=0},u=(A,t,e,i)=>{const s=2*t,a=2*e;return A[s]<A[a]||A[s]===A[a]&&i[t]<=i[e]},p=(A,t,e)=>{const i=A.heap[e];let s=e<<1;for(;s<=A.heap_len&&(s<A.heap_len&&u(t,A.heap[s+1],A.heap[s],A.depth)&&s++,!u(t,i,A.heap[s],A.depth));)A.heap[e]=A.heap[s],e=s,s<<=1;A.heap[e]=i},m=(A,t,s)=>{let a,n,r,h,_=0;if(0!==A.sym_next)do{a=255&A.pending_buf[A.sym_buf+_++],a+=(255&A.pending_buf[A.sym_buf+_++])<<8,n=A.pending_buf[A.sym_buf+_++],0===a?D(A,n,t):(r=o[n],D(A,r+256+1,t),h=e[r],0!==h&&(n-=g[r],d(A,n,h)),a--,r=B(a),D(A,r,s),h=i[r],0!==h&&(a-=E[r],d(A,a,h)))}while(_<A.sym_next);D(A,256,t)},R=(A,t)=>{const e=t.dyn_tree,i=t.stat_desc.static_tree,s=t.stat_desc.has_stree,a=t.stat_desc.elems;let n,r,h,o=-1;for(A.heap_len=0,A.heap_max=573,n=0;n<a;n++)0!==e[2*n]?(A.heap[++A.heap_len]=o=n,A.depth[n]=0):e[2*n+1]=0;for(;A.heap_len<2;)h=A.heap[++A.heap_len]=o<2?++o:0,e[2*h]=1,A.depth[h]=0,A.opt_len--,s&&(A.static_len-=i[2*h+1]);for(t.max_code=o,n=A.heap_len>>1;n>=1;n--)p(A,e,n);h=a;do{n=A.heap[1],A.heap[1]=A.heap[A.heap_len--],p(A,e,1),r=A.heap[1],A.heap[--A.heap_max]=n,A.heap[--A.heap_max]=r,e[2*h]=e[2*n]+e[2*r],A.depth[h]=(A.depth[n]>=A.depth[r]?A.depth[n]:A.depth[r])+1,e[2*n+1]=e[2*r+1]=h,A.heap[1]=h++,p(A,e,1)}while(A.heap_len>=2);A.heap[--A.heap_max]=A.heap[1],((A,t)=>{const e=t.dyn_tree,i=t.max_code,s=t.stat_desc.static_tree,a=t.stat_desc.has_stree,n=t.stat_desc.extra_bits,r=t.stat_desc.extra_base,h=t.stat_desc.max_length;let o,g,E,_,w,I,l=0;for(_=0;_<=15;_++)A.bl_count[_]=0;for(e[2*A.heap[A.heap_max]+1]=0,o=A.heap_max+1;o<573;o++)g=A.heap[o],_=e[2*e[2*g+1]+1]+1,_>h&&(_=h,l++),e[2*g+1]=_,g>i||(A.bl_count[_]++,w=0,g>=r&&(w=n[g-r]),I=e[2*g],A.opt_len+=I*(_+w),a&&(A.static_len+=I*(s[2*g+1]+w)));if(0!==l){do{for(_=h-1;0===A.bl_count[_];)_--;A.bl_count[_]--,A.bl_count[_+1]+=2,A.bl_count[h]--,l-=2}while(l>0);for(_=h;0!==_;_--)for(g=A.bl_count[_];0!==g;)E=A.heap[--o],E>i||(e[2*E+1]!==_&&(A.opt_len+=(_-e[2*E+1])*e[2*E],e[2*E+1]=_),g--)}})(A,t),Q(e,o,A.bl_count)},y=(A,t,e)=>{let i,s,a=-1,n=t[1],r=0,h=7,o=4;for(0===n&&(h=138,o=3),t[2*(e+1)+1]=65535,i=0;i<=e;i++)s=n,n=t[2*(i+1)+1],++r<h&&s===n||(r<o?A.bl_tree[2*s]+=r:0!==s?(s!==a&&A.bl_tree[2*s]++,A.bl_tree[32]++):r<=10?A.bl_tree[34]++:A.bl_tree[36]++,r=0,a=s,0===n?(h=138,o=3):s===n?(h=6,o=3):(h=7,o=4))},k=(A,t,e)=>{let i,s,a=-1,n=t[1],r=0,h=7,o=4;for(0===n&&(h=138,o=3),i=0;i<=e;i++)if(s=n,n=t[2*(i+1)+1],!(++r<h&&s===n)){if(r<o)do{D(A,s,A.bl_tree)}while(0!=--r);else 0!==s?(s!==a&&(D(A,s,A.bl_tree),r--),D(A,16,A.bl_tree),d(A,r-3,2)):r<=10?(D(A,17,A.bl_tree),d(A,r-3,3)):(D(A,18,A.bl_tree),d(A,r-11,7));r=0,a=s,0===n?(h=138,o=3):s===n?(h=6,o=3):(h=7,o=4)}};let b=!1;const F=(A,t,e,i)=>{d(A,0+(i?1:0),3),S(A),C(A,e),C(A,~e),e&&A.pending_buf.set(A.window.subarray(t,t+e),A.pending),A.pending+=e};var H=(A,t,e,i)=>{let s,h,o=0;A.level>0?(2===A.strm.data_type&&(A.strm.data_type=(A=>{let t,e=4093624447;for(t=0;t<=31;t++,e>>>=1)if(1&e&&0!==A.dyn_ltree[2*t])return 0;if(0!==A.dyn_ltree[18]||0!==A.dyn_ltree[20]||0!==A.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==A.dyn_ltree[2*t])return 1;return 0})(A)),R(A,A.l_desc),R(A,A.d_desc),o=(A=>{let t;for(y(A,A.dyn_ltree,A.l_desc.max_code),y(A,A.dyn_dtree,A.d_desc.max_code),R(A,A.bl_desc),t=18;t>=3&&0===A.bl_tree[2*a[t]+1];t--);return A.opt_len+=3*(t+1)+5+5+4,t})(A),s=A.opt_len+3+7>>>3,h=A.static_len+3+7>>>3,h<=s&&(s=h)):s=h=e+5,e+4<=s&&-1!==t?F(A,t,e,i):4===A.strategy||h===s?(d(A,2+(i?1:0),3),m(A,n,r)):(d(A,4+(i?1:0),3),((A,t,e,i)=>{let s;for(d(A,t-257,5),d(A,e-1,5),d(A,i-4,4),s=0;s<i;s++)d(A,A.bl_tree[2*a[s]+1],3);k(A,A.dyn_ltree,t-1),k(A,A.dyn_dtree,e-1)})(A,A.l_desc.max_code+1,A.d_desc.max_code+1,o+1),m(A,A.dyn_ltree,A.dyn_dtree)),M(A),i&&S(A)},G={_tr_init:A=>{b||((()=>{let A,t,a,c,B;const C=new Array(16);for(a=0,c=0;c<28;c++)for(g[c]=a,A=0;A<1<<e[c];A++)o[a++]=c;for(o[a-1]=c,B=0,c=0;c<16;c++)for(E[c]=B,A=0;A<1<<i[c];A++)h[B++]=c;for(B>>=7;c<30;c++)for(E[c]=B<<7,A=0;A<1<<i[c]-7;A++)h[256+B++]=c;for(t=0;t<=15;t++)C[t]=0;for(A=0;A<=143;)n[2*A+1]=8,A++,C[8]++;for(;A<=255;)n[2*A+1]=9,A++,C[9]++;for(;A<=279;)n[2*A+1]=7,A++,C[7]++;for(;A<=287;)n[2*A+1]=8,A++,C[8]++;for(Q(n,287,C),A=0;A<30;A++)r[2*A+1]=5,r[2*A]=f(A,5);w=new _(n,e,257,286,15),I=new _(r,i,0,30,15),l=new _(new Array(0),s,0,19,7)})(),b=!0),A.l_desc=new c(A.dyn_ltree,w),A.d_desc=new c(A.dyn_dtree,I),A.bl_desc=new c(A.bl_tree,l),A.bi_buf=0,A.bi_valid=0,M(A)},_tr_stored_block:F,_tr_flush_block:H,_tr_tally:(A,t,e)=>(A.pending_buf[A.sym_buf+A.sym_next++]=t,A.pending_buf[A.sym_buf+A.sym_next++]=t>>8,A.pending_buf[A.sym_buf+A.sym_next++]=e,0===t?A.dyn_ltree[2*e]++:(A.matches++,t--,A.dyn_ltree[2*(o[e]+256+1)]++,A.dyn_dtree[2*B(t)]++),A.sym_next===A.sym_end),_tr_align:A=>{d(A,2,3),D(A,256,n),(A=>{16===A.bi_valid?(C(A,A.bi_buf),A.bi_buf=0,A.bi_valid=0):A.bi_valid>=8&&(A.pending_buf[A.pending++]=255&A.bi_buf,A.bi_buf>>=8,A.bi_valid-=8)})(A)}};var P=(A,t,e,i)=>{let s=65535&A|0,a=A>>>16&65535|0,n=0;for(;0!==e;){n=e>2e3?2e3:e,e-=n;do{s=s+t[i++]|0,a=a+s|0}while(--n);s%=65521,a%=65521}return s|a<<16|0};const T=new Uint32Array((()=>{let A,t=[];for(var e=0;e<256;e++){A=e;for(var i=0;i<8;i++)A=1&A?3988292384^A>>>1:A>>>1;t[e]=A}return t})());var Y=(A,t,e,i)=>{const s=T,a=i+e;A^=-1;for(let e=i;e<a;e++)A=A>>>8^s[255&(A^t[e])];return-1^A},K={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"},x={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};const{_tr_init:O,_tr_stored_block:v,_tr_flush_block:U,_tr_tally:J,_tr_align:L}=G,{Z_NO_FLUSH:z,Z_PARTIAL_FLUSH:Z,Z_FULL_FLUSH:N,Z_FINISH:q,Z_BLOCK:j,Z_OK:W,Z_STREAM_END:X,Z_STREAM_ERROR:V,Z_DATA_ERROR:$,Z_BUF_ERROR:AA,Z_DEFAULT_COMPRESSION:tA,Z_FILTERED:eA,Z_HUFFMAN_ONLY:iA,Z_RLE:sA,Z_FIXED:aA,Z_DEFAULT_STRATEGY:nA,Z_UNKNOWN:rA,Z_DEFLATED:hA}=x,oA=(A,t)=>(A.msg=K[t],t),gA=A=>2*A-(A>4?9:0),EA=A=>{let t=A.length;for(;--t>=0;)A[t]=0},_A=A=>{let t,e,i,s=A.w_size;t=A.hash_size,i=t;do{e=A.head[--i],A.head[i]=e>=s?e-s:0}while(--t);t=s,i=t;do{e=A.prev[--i],A.prev[i]=e>=s?e-s:0}while(--t)};let wA=(A,t,e)=>(t<<A.hash_shift^e)&A.hash_mask;const IA=A=>{const t=A.state;let e=t.pending;e>A.avail_out&&(e=A.avail_out),0!==e&&(A.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+e),A.next_out),A.next_out+=e,t.pending_out+=e,A.total_out+=e,A.avail_out-=e,t.pending-=e,0===t.pending&&(t.pending_out=0))},lA=(A,t)=>{U(A,A.block_start>=0?A.block_start:-1,A.strstart-A.block_start,t),A.block_start=A.strstart,IA(A.strm)},cA=(A,t)=>{A.pending_buf[A.pending++]=t},BA=(A,t)=>{A.pending_buf[A.pending++]=t>>>8&255,A.pending_buf[A.pending++]=255&t},CA=(A,t,e,i)=>{let s=A.avail_in;return s>i&&(s=i),0===s?0:(A.avail_in-=s,t.set(A.input.subarray(A.next_in,A.next_in+s),e),1===A.state.wrap?A.adler=P(A.adler,t,s,e):2===A.state.wrap&&(A.adler=Y(A.adler,t,s,e)),A.next_in+=s,A.total_in+=s,s)},dA=(A,t)=>{let e,i,s=A.max_chain_length,a=A.strstart,n=A.prev_length,r=A.nice_match;const h=A.strstart>A.w_size-262?A.strstart-(A.w_size-262):0,o=A.window,g=A.w_mask,E=A.prev,_=A.strstart+258;let w=o[a+n-1],I=o[a+n];A.prev_length>=A.good_match&&(s>>=2),r>A.lookahead&&(r=A.lookahead);do{if(e=t,o[e+n]===I&&o[e+n-1]===w&&o[e]===o[a]&&o[++e]===o[a+1]){a+=2,e++;do{}while(o[++a]===o[++e]&&o[++a]===o[++e]&&o[++a]===o[++e]&&o[++a]===o[++e]&&o[++a]===o[++e]&&o[++a]===o[++e]&&o[++a]===o[++e]&&o[++a]===o[++e]&&a<_);if(i=258-(_-a),a=_-258,i>n){if(A.match_start=t,n=i,i>=r)break;w=o[a+n-1],I=o[a+n]}}}while((t=E[t&g])>h&&0!=--s);return n<=A.lookahead?n:A.lookahead},DA=A=>{const t=A.w_size;let e,i,s;do{if(i=A.window_size-A.lookahead-A.strstart,A.strstart>=t+(t-262)&&(A.window.set(A.window.subarray(t,t+t-i),0),A.match_start-=t,A.strstart-=t,A.block_start-=t,A.insert>A.strstart&&(A.insert=A.strstart),_A(A),i+=t),0===A.strm.avail_in)break;if(e=CA(A.strm,A.window,A.strstart+A.lookahead,i),A.lookahead+=e,A.lookahead+A.insert>=3)for(s=A.strstart-A.insert,A.ins_h=A.window[s],A.ins_h=wA(A,A.ins_h,A.window[s+1]);A.insert&&(A.ins_h=wA(A,A.ins_h,A.window[s+3-1]),A.prev[s&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=s,s++,A.insert--,!(A.lookahead+A.insert<3)););}while(A.lookahead<262&&0!==A.strm.avail_in)},fA=(A,t)=>{let e,i,s,a=A.pending_buf_size-5>A.w_size?A.w_size:A.pending_buf_size-5,n=0,r=A.strm.avail_in;do{if(e=65535,s=A.bi_valid+42>>3,A.strm.avail_out<s)break;if(s=A.strm.avail_out-s,i=A.strstart-A.block_start,e>i+A.strm.avail_in&&(e=i+A.strm.avail_in),e>s&&(e=s),e<a&&(0===e&&t!==q||t===z||e!==i+A.strm.avail_in))break;n=t===q&&e===i+A.strm.avail_in?1:0,v(A,0,0,n),A.pending_buf[A.pending-4]=e,A.pending_buf[A.pending-3]=e>>8,A.pending_buf[A.pending-2]=~e,A.pending_buf[A.pending-1]=~e>>8,IA(A.strm),i&&(i>e&&(i=e),A.strm.output.set(A.window.subarray(A.block_start,A.block_start+i),A.strm.next_out),A.strm.next_out+=i,A.strm.avail_out-=i,A.strm.total_out+=i,A.block_start+=i,e-=i),e&&(CA(A.strm,A.strm.output,A.strm.next_out,e),A.strm.next_out+=e,A.strm.avail_out-=e,A.strm.total_out+=e)}while(0===n);return r-=A.strm.avail_in,r&&(r>=A.w_size?(A.matches=2,A.window.set(A.strm.input.subarray(A.strm.next_in-A.w_size,A.strm.next_in),0),A.strstart=A.w_size,A.insert=A.strstart):(A.window_size-A.strstart<=r&&(A.strstart-=A.w_size,A.window.set(A.window.subarray(A.w_size,A.w_size+A.strstart),0),A.matches<2&&A.matches++,A.insert>A.strstart&&(A.insert=A.strstart)),A.window.set(A.strm.input.subarray(A.strm.next_in-r,A.strm.next_in),A.strstart),A.strstart+=r,A.insert+=r>A.w_size-A.insert?A.w_size-A.insert:r),A.block_start=A.strstart),A.high_water<A.strstart&&(A.high_water=A.strstart),n?4:t!==z&&t!==q&&0===A.strm.avail_in&&A.strstart===A.block_start?2:(s=A.window_size-A.strstart,A.strm.avail_in>s&&A.block_start>=A.w_size&&(A.block_start-=A.w_size,A.strstart-=A.w_size,A.window.set(A.window.subarray(A.w_size,A.w_size+A.strstart),0),A.matches<2&&A.matches++,s+=A.w_size,A.insert>A.strstart&&(A.insert=A.strstart)),s>A.strm.avail_in&&(s=A.strm.avail_in),s&&(CA(A.strm,A.window,A.strstart,s),A.strstart+=s,A.insert+=s>A.w_size-A.insert?A.w_size-A.insert:s),A.high_water<A.strstart&&(A.high_water=A.strstart),s=A.bi_valid+42>>3,s=A.pending_buf_size-s>65535?65535:A.pending_buf_size-s,a=s>A.w_size?A.w_size:s,i=A.strstart-A.block_start,(i>=a||(i||t===q)&&t!==z&&0===A.strm.avail_in&&i<=s)&&(e=i>s?s:i,n=t===q&&0===A.strm.avail_in&&e===i?1:0,v(A,A.block_start,e,n),A.block_start+=e,IA(A.strm)),n?3:1)},QA=(A,t)=>{let e,i;for(;;){if(A.lookahead<262){if(DA(A),A.lookahead<262&&t===z)return 1;if(0===A.lookahead)break}if(e=0,A.lookahead>=3&&(A.ins_h=wA(A,A.ins_h,A.window[A.strstart+3-1]),e=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart),0!==e&&A.strstart-e<=A.w_size-262&&(A.match_length=dA(A,e)),A.match_length>=3)if(i=J(A,A.strstart-A.match_start,A.match_length-3),A.lookahead-=A.match_length,A.match_length<=A.max_lazy_match&&A.lookahead>=3){A.match_length--;do{A.strstart++,A.ins_h=wA(A,A.ins_h,A.window[A.strstart+3-1]),e=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart}while(0!=--A.match_length);A.strstart++}else A.strstart+=A.match_length,A.match_length=0,A.ins_h=A.window[A.strstart],A.ins_h=wA(A,A.ins_h,A.window[A.strstart+1]);else i=J(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++;if(i&&(lA(A,!1),0===A.strm.avail_out))return 1}return A.insert=A.strstart<2?A.strstart:2,t===q?(lA(A,!0),0===A.strm.avail_out?3:4):A.sym_next&&(lA(A,!1),0===A.strm.avail_out)?1:2},MA=(A,t)=>{let e,i,s;for(;;){if(A.lookahead<262){if(DA(A),A.lookahead<262&&t===z)return 1;if(0===A.lookahead)break}if(e=0,A.lookahead>=3&&(A.ins_h=wA(A,A.ins_h,A.window[A.strstart+3-1]),e=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart),A.prev_length=A.match_length,A.prev_match=A.match_start,A.match_length=2,0!==e&&A.prev_length<A.max_lazy_match&&A.strstart-e<=A.w_size-262&&(A.match_length=dA(A,e),A.match_length<=5&&(A.strategy===eA||3===A.match_length&&A.strstart-A.match_start>4096)&&(A.match_length=2)),A.prev_length>=3&&A.match_length<=A.prev_length){s=A.strstart+A.lookahead-3,i=J(A,A.strstart-1-A.prev_match,A.prev_length-3),A.lookahead-=A.prev_length-1,A.prev_length-=2;do{++A.strstart<=s&&(A.ins_h=wA(A,A.ins_h,A.window[A.strstart+3-1]),e=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart)}while(0!=--A.prev_length);if(A.match_available=0,A.match_length=2,A.strstart++,i&&(lA(A,!1),0===A.strm.avail_out))return 1}else if(A.match_available){if(i=J(A,0,A.window[A.strstart-1]),i&&lA(A,!1),A.strstart++,A.lookahead--,0===A.strm.avail_out)return 1}else A.match_available=1,A.strstart++,A.lookahead--}return A.match_available&&(i=J(A,0,A.window[A.strstart-1]),A.match_available=0),A.insert=A.strstart<2?A.strstart:2,t===q?(lA(A,!0),0===A.strm.avail_out?3:4):A.sym_next&&(lA(A,!1),0===A.strm.avail_out)?1:2};function SA(A,t,e,i,s){this.good_length=A,this.max_lazy=t,this.nice_length=e,this.max_chain=i,this.func=s}const uA=[new SA(0,0,0,0,fA),new SA(4,4,8,4,QA),new SA(4,5,16,8,QA),new SA(4,6,32,32,QA),new SA(4,4,16,16,MA),new SA(8,16,32,32,MA),new SA(8,16,128,128,MA),new SA(8,32,128,256,MA),new SA(32,128,258,1024,MA),new SA(32,258,258,4096,MA)];function pA(){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=hA,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(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),EA(this.dyn_ltree),EA(this.dyn_dtree),EA(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),EA(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),EA(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}const mA=A=>{if(!A)return 1;const t=A.state;return!t||t.strm!==A||42!==t.status&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&113!==t.status&&666!==t.status?1:0},RA=A=>{if(mA(A))return oA(A,V);A.total_in=A.total_out=0,A.data_type=rA;const t=A.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?42:113,A.adler=2===t.wrap?0:1,t.last_flush=-2,O(t),W},yA=A=>{const t=RA(A);var e;return t===W&&((e=A.state).window_size=2*e.w_size,EA(e.head),e.max_lazy_match=uA[e.level].max_lazy,e.good_match=uA[e.level].good_length,e.nice_match=uA[e.level].nice_length,e.max_chain_length=uA[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),t},kA=(A,t,e,i,s,a)=>{if(!A)return V;let n=1;if(t===tA&&(t=6),i<0?(n=0,i=-i):i>15&&(n=2,i-=16),s<1||s>9||e!==hA||i<8||i>15||t<0||t>9||a<0||a>aA||8===i&&1!==n)return oA(A,V);8===i&&(i=9);const r=new pA;return A.state=r,r.strm=A,r.status=42,r.wrap=n,r.gzhead=null,r.w_bits=i,r.w_size=1<<r.w_bits,r.w_mask=r.w_size-1,r.hash_bits=s+7,r.hash_size=1<<r.hash_bits,r.hash_mask=r.hash_size-1,r.hash_shift=~~((r.hash_bits+3-1)/3),r.window=new Uint8Array(2*r.w_size),r.head=new Uint16Array(r.hash_size),r.prev=new Uint16Array(r.w_size),r.lit_bufsize=1<<s+6,r.pending_buf_size=4*r.lit_bufsize,r.pending_buf=new Uint8Array(r.pending_buf_size),r.sym_buf=r.lit_bufsize,r.sym_end=3*(r.lit_bufsize-1),r.level=t,r.strategy=a,r.method=e,yA(A)};var bA={deflateInit:(A,t)=>kA(A,t,hA,15,8,nA),deflateInit2:kA,deflateReset:yA,deflateResetKeep:RA,deflateSetHeader:(A,t)=>mA(A)||2!==A.state.wrap?V:(A.state.gzhead=t,W),deflate:(A,t)=>{if(mA(A)||t>j||t<0)return A?oA(A,V):V;const e=A.state;if(!A.output||0!==A.avail_in&&!A.input||666===e.status&&t!==q)return oA(A,0===A.avail_out?AA:V);const i=e.last_flush;if(e.last_flush=t,0!==e.pending){if(IA(A),0===A.avail_out)return e.last_flush=-1,W}else if(0===A.avail_in&&gA(t)<=gA(i)&&t!==q)return oA(A,AA);if(666===e.status&&0!==A.avail_in)return oA(A,AA);if(42===e.status&&0===e.wrap&&(e.status=113),42===e.status){let t=hA+(e.w_bits-8<<4)<<8,i=-1;if(i=e.strategy>=iA||e.level<2?0:e.level<6?1:6===e.level?2:3,t|=i<<6,0!==e.strstart&&(t|=32),t+=31-t%31,BA(e,t),0!==e.strstart&&(BA(e,A.adler>>>16),BA(e,65535&A.adler)),A.adler=1,e.status=113,IA(A),0!==e.pending)return e.last_flush=-1,W}if(57===e.status)if(A.adler=0,cA(e,31),cA(e,139),cA(e,8),e.gzhead)cA(e,(e.gzhead.text?1:0)+(e.gzhead.hcrc?2:0)+(e.gzhead.extra?4:0)+(e.gzhead.name?8:0)+(e.gzhead.comment?16:0)),cA(e,255&e.gzhead.time),cA(e,e.gzhead.time>>8&255),cA(e,e.gzhead.time>>16&255),cA(e,e.gzhead.time>>24&255),cA(e,9===e.level?2:e.strategy>=iA||e.level<2?4:0),cA(e,255&e.gzhead.os),e.gzhead.extra&&e.gzhead.extra.length&&(cA(e,255&e.gzhead.extra.length),cA(e,e.gzhead.extra.length>>8&255)),e.gzhead.hcrc&&(A.adler=Y(A.adler,e.pending_buf,e.pending,0)),e.gzindex=0,e.status=69;else if(cA(e,0),cA(e,0),cA(e,0),cA(e,0),cA(e,0),cA(e,9===e.level?2:e.strategy>=iA||e.level<2?4:0),cA(e,3),e.status=113,IA(A),0!==e.pending)return e.last_flush=-1,W;if(69===e.status){if(e.gzhead.extra){let t=e.pending,i=(65535&e.gzhead.extra.length)-e.gzindex;for(;e.pending+i>e.pending_buf_size;){let s=e.pending_buf_size-e.pending;if(e.pending_buf.set(e.gzhead.extra.subarray(e.gzindex,e.gzindex+s),e.pending),e.pending=e.pending_buf_size,e.gzhead.hcrc&&e.pending>t&&(A.adler=Y(A.adler,e.pending_buf,e.pending-t,t)),e.gzindex+=s,IA(A),0!==e.pending)return e.last_flush=-1,W;t=0,i-=s}let s=new Uint8Array(e.gzhead.extra);e.pending_buf.set(s.subarray(e.gzindex,e.gzindex+i),e.pending),e.pending+=i,e.gzhead.hcrc&&e.pending>t&&(A.adler=Y(A.adler,e.pending_buf,e.pending-t,t)),e.gzindex=0}e.status=73}if(73===e.status){if(e.gzhead.name){let t,i=e.pending;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>i&&(A.adler=Y(A.adler,e.pending_buf,e.pending-i,i)),IA(A),0!==e.pending)return e.last_flush=-1,W;i=0}t=e.gzindex<e.gzhead.name.length?255&e.gzhead.name.charCodeAt(e.gzindex++):0,cA(e,t)}while(0!==t);e.gzhead.hcrc&&e.pending>i&&(A.adler=Y(A.adler,e.pending_buf,e.pending-i,i)),e.gzindex=0}e.status=91}if(91===e.status){if(e.gzhead.comment){let t,i=e.pending;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>i&&(A.adler=Y(A.adler,e.pending_buf,e.pending-i,i)),IA(A),0!==e.pending)return e.last_flush=-1,W;i=0}t=e.gzindex<e.gzhead.comment.length?255&e.gzhead.comment.charCodeAt(e.gzindex++):0,cA(e,t)}while(0!==t);e.gzhead.hcrc&&e.pending>i&&(A.adler=Y(A.adler,e.pending_buf,e.pending-i,i))}e.status=103}if(103===e.status){if(e.gzhead.hcrc){if(e.pending+2>e.pending_buf_size&&(IA(A),0!==e.pending))return e.last_flush=-1,W;cA(e,255&A.adler),cA(e,A.adler>>8&255),A.adler=0}if(e.status=113,IA(A),0!==e.pending)return e.last_flush=-1,W}if(0!==A.avail_in||0!==e.lookahead||t!==z&&666!==e.status){let i=0===e.level?fA(e,t):e.strategy===iA?((A,t)=>{let e;for(;;){if(0===A.lookahead&&(DA(A),0===A.lookahead)){if(t===z)return 1;break}if(A.match_length=0,e=J(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++,e&&(lA(A,!1),0===A.strm.avail_out))return 1}return A.insert=0,t===q?(lA(A,!0),0===A.strm.avail_out?3:4):A.sym_next&&(lA(A,!1),0===A.strm.avail_out)?1:2})(e,t):e.strategy===sA?((A,t)=>{let e,i,s,a;const n=A.window;for(;;){if(A.lookahead<=258){if(DA(A),A.lookahead<=258&&t===z)return 1;if(0===A.lookahead)break}if(A.match_length=0,A.lookahead>=3&&A.strstart>0&&(s=A.strstart-1,i=n[s],i===n[++s]&&i===n[++s]&&i===n[++s])){a=A.strstart+258;do{}while(i===n[++s]&&i===n[++s]&&i===n[++s]&&i===n[++s]&&i===n[++s]&&i===n[++s]&&i===n[++s]&&i===n[++s]&&s<a);A.match_length=258-(a-s),A.match_length>A.lookahead&&(A.match_length=A.lookahead)}if(A.match_length>=3?(e=J(A,1,A.match_length-3),A.lookahead-=A.match_length,A.strstart+=A.match_length,A.match_length=0):(e=J(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++),e&&(lA(A,!1),0===A.strm.avail_out))return 1}return A.insert=0,t===q?(lA(A,!0),0===A.strm.avail_out?3:4):A.sym_next&&(lA(A,!1),0===A.strm.avail_out)?1:2})(e,t):uA[e.level].func(e,t);if(3!==i&&4!==i||(e.status=666),1===i||3===i)return 0===A.avail_out&&(e.last_flush=-1),W;if(2===i&&(t===Z?L(e):t!==j&&(v(e,0,0,!1),t===N&&(EA(e.head),0===e.lookahead&&(e.strstart=0,e.block_start=0,e.insert=0))),IA(A),0===A.avail_out))return e.last_flush=-1,W}return t!==q?W:e.wrap<=0?X:(2===e.wrap?(cA(e,255&A.adler),cA(e,A.adler>>8&255),cA(e,A.adler>>16&255),cA(e,A.adler>>24&255),cA(e,255&A.total_in),cA(e,A.total_in>>8&255),cA(e,A.total_in>>16&255),cA(e,A.total_in>>24&255)):(BA(e,A.adler>>>16),BA(e,65535&A.adler)),IA(A),e.wrap>0&&(e.wrap=-e.wrap),0!==e.pending?W:X)},deflateEnd:A=>{if(mA(A))return V;const t=A.state.status;return A.state=null,113===t?oA(A,$):W},deflateSetDictionary:(A,t)=>{let e=t.length;if(mA(A))return V;const i=A.state,s=i.wrap;if(2===s||1===s&&42!==i.status||i.lookahead)return V;if(1===s&&(A.adler=P(A.adler,t,e,0)),i.wrap=0,e>=i.w_size){0===s&&(EA(i.head),i.strstart=0,i.block_start=0,i.insert=0);let A=new Uint8Array(i.w_size);A.set(t.subarray(e-i.w_size,e),0),t=A,e=i.w_size}const a=A.avail_in,n=A.next_in,r=A.input;for(A.avail_in=e,A.next_in=0,A.input=t,DA(i);i.lookahead>=3;){let A=i.strstart,t=i.lookahead-2;do{i.ins_h=wA(i,i.ins_h,i.window[A+3-1]),i.prev[A&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=A,A++}while(--t);i.strstart=A,i.lookahead=2,DA(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,A.next_in=n,A.input=r,A.avail_in=a,i.wrap=s,W},deflateInfo:"pako deflate (from Nodeca project)"};const FA=(A,t)=>Object.prototype.hasOwnProperty.call(A,t);var HA=function(A){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const e=t.shift();if(e){if("object"!=typeof e)throw new TypeError(e+"must be non-object");for(const t in e)FA(e,t)&&(A[t]=e[t])}}return A},GA=A=>{let t=0;for(let e=0,i=A.length;e<i;e++)t+=A[e].length;const e=new Uint8Array(t);for(let t=0,i=0,s=A.length;t<s;t++){let s=A[t];e.set(s,i),i+=s.length}return e};let PA=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(A){PA=!1}const TA=new Uint8Array(256);for(let A=0;A<256;A++)TA[A]=A>=252?6:A>=248?5:A>=240?4:A>=224?3:A>=192?2:1;TA[254]=TA[254]=1;var YA=A=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(A);let t,e,i,s,a,n=A.length,r=0;for(s=0;s<n;s++)e=A.charCodeAt(s),55296==(64512&e)&&s+1<n&&(i=A.charCodeAt(s+1),56320==(64512&i)&&(e=65536+(e-55296<<10)+(i-56320),s++)),r+=e<128?1:e<2048?2:e<65536?3:4;for(t=new Uint8Array(r),a=0,s=0;a<r;s++)e=A.charCodeAt(s),55296==(64512&e)&&s+1<n&&(i=A.charCodeAt(s+1),56320==(64512&i)&&(e=65536+(e-55296<<10)+(i-56320),s++)),e<128?t[a++]=e:e<2048?(t[a++]=192|e>>>6,t[a++]=128|63&e):e<65536?(t[a++]=224|e>>>12,t[a++]=128|e>>>6&63,t[a++]=128|63&e):(t[a++]=240|e>>>18,t[a++]=128|e>>>12&63,t[a++]=128|e>>>6&63,t[a++]=128|63&e);return t},KA=(A,t)=>{const e=t||A.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(A.subarray(0,t));let i,s;const a=new Array(2*e);for(s=0,i=0;i<e;){let t=A[i++];if(t<128){a[s++]=t;continue}let n=TA[t];if(n>4)a[s++]=65533,i+=n-1;else{for(t&=2===n?31:3===n?15:7;n>1&&i<e;)t=t<<6|63&A[i++],n--;n>1?a[s++]=65533:t<65536?a[s++]=t:(t-=65536,a[s++]=55296|t>>10&1023,a[s++]=56320|1023&t)}}return((A,t)=>{if(t<65534&&A.subarray&&PA)return String.fromCharCode.apply(null,A.length===t?A:A.subarray(0,t));let e="";for(let i=0;i<t;i++)e+=String.fromCharCode(A[i]);return e})(a,s)},xA=(A,t)=>{(t=t||A.length)>A.length&&(t=A.length);let e=t-1;for(;e>=0&&128==(192&A[e]);)e--;return e<0||0===e?t:e+TA[A[e]]>t?e:t};var OA=function(){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};const vA=Object.prototype.toString,{Z_NO_FLUSH:UA,Z_SYNC_FLUSH:JA,Z_FULL_FLUSH:LA,Z_FINISH:zA,Z_OK:ZA,Z_STREAM_END:NA,Z_DEFAULT_COMPRESSION:qA,Z_DEFAULT_STRATEGY:jA,Z_DEFLATED:WA}=x;function XA(A){this.options=HA({level:qA,method:WA,chunkSize:16384,windowBits:15,memLevel:8,strategy:jA},A||{});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 OA,this.strm.avail_out=0;let e=bA.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(e!==ZA)throw new Error(K[e]);if(t.header&&bA.deflateSetHeader(this.strm,t.header),t.dictionary){let A;if(A="string"==typeof t.dictionary?YA(t.dictionary):"[object ArrayBuffer]"===vA.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,e=bA.deflateSetDictionary(this.strm,A),e!==ZA)throw new Error(K[e]);this._dict_set=!0}}function VA(A,t){const e=new XA(t);if(e.push(A,!0),e.err)throw e.msg||K[e.err];return e.result}XA.prototype.push=function(A,t){const e=this.strm,i=this.options.chunkSize;let s,a;if(this.ended)return!1;for(a=t===~~t?t:!0===t?zA:UA,"string"==typeof A?e.input=YA(A):"[object ArrayBuffer]"===vA.call(A)?e.input=new Uint8Array(A):e.input=A,e.next_in=0,e.avail_in=e.input.length;;)if(0===e.avail_out&&(e.output=new Uint8Array(i),e.next_out=0,e.avail_out=i),(a===JA||a===LA)&&e.avail_out<=6)this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;else{if(s=bA.deflate(e,a),s===NA)return e.next_out>0&&this.onData(e.output.subarray(0,e.next_out)),s=bA.deflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===ZA;if(0!==e.avail_out){if(a>0&&e.next_out>0)this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;else if(0===e.avail_in)break}else this.onData(e.output)}return!0},XA.prototype.onData=function(A){this.chunks.push(A)},XA.prototype.onEnd=function(A){A===ZA&&(this.result=GA(this.chunks)),this.chunks=[],this.err=A,this.msg=this.strm.msg};var $A={Deflate:XA,deflate:VA,deflateRaw:function(A,t){return(t=t||{}).raw=!0,VA(A,t)},gzip:function(A,t){return(t=t||{}).gzip=!0,VA(A,t)},constants:x};var At=function(A,t){let e,i,s,a,n,r,h,o,g,E,_,w,I,l,c,B,C,d,D,f,Q,M,S,u;const p=A.state;e=A.next_in,S=A.input,i=e+(A.avail_in-5),s=A.next_out,u=A.output,a=s-(t-A.avail_out),n=s+(A.avail_out-257),r=p.dmax,h=p.wsize,o=p.whave,g=p.wnext,E=p.window,_=p.hold,w=p.bits,I=p.lencode,l=p.distcode,c=(1<<p.lenbits)-1,B=(1<<p.distbits)-1;A:do{w<15&&(_+=S[e++]<<w,w+=8,_+=S[e++]<<w,w+=8),C=I[_&c];t:for(;;){if(d=C>>>24,_>>>=d,w-=d,d=C>>>16&255,0===d)u[s++]=65535&C;else{if(!(16&d)){if(0==(64&d)){C=I[(65535&C)+(_&(1<<d)-1)];continue t}if(32&d){p.mode=16191;break A}A.msg="invalid literal/length code",p.mode=16209;break A}D=65535&C,d&=15,d&&(w<d&&(_+=S[e++]<<w,w+=8),D+=_&(1<<d)-1,_>>>=d,w-=d),w<15&&(_+=S[e++]<<w,w+=8,_+=S[e++]<<w,w+=8),C=l[_&B];e:for(;;){if(d=C>>>24,_>>>=d,w-=d,d=C>>>16&255,!(16&d)){if(0==(64&d)){C=l[(65535&C)+(_&(1<<d)-1)];continue e}A.msg="invalid distance code",p.mode=16209;break A}if(f=65535&C,d&=15,w<d&&(_+=S[e++]<<w,w+=8,w<d&&(_+=S[e++]<<w,w+=8)),f+=_&(1<<d)-1,f>r){A.msg="invalid distance too far back",p.mode=16209;break A}if(_>>>=d,w-=d,d=s-a,f>d){if(d=f-d,d>o&&p.sane){A.msg="invalid distance too far back",p.mode=16209;break A}if(Q=0,M=E,0===g){if(Q+=h-d,d<D){D-=d;do{u[s++]=E[Q++]}while(--d);Q=s-f,M=u}}else if(g<d){if(Q+=h+g-d,d-=g,d<D){D-=d;do{u[s++]=E[Q++]}while(--d);if(Q=0,g<D){d=g,D-=d;do{u[s++]=E[Q++]}while(--d);Q=s-f,M=u}}}else if(Q+=g-d,d<D){D-=d;do{u[s++]=E[Q++]}while(--d);Q=s-f,M=u}for(;D>2;)u[s++]=M[Q++],u[s++]=M[Q++],u[s++]=M[Q++],D-=3;D&&(u[s++]=M[Q++],D>1&&(u[s++]=M[Q++]))}else{Q=s-f;do{u[s++]=u[Q++],u[s++]=u[Q++],u[s++]=u[Q++],D-=3}while(D>2);D&&(u[s++]=u[Q++],D>1&&(u[s++]=u[Q++]))}break}}break}}while(e<i&&s<n);D=w>>3,e-=D,w-=D<<3,_&=(1<<w)-1,A.next_in=e,A.next_out=s,A.avail_in=e<i?i-e+5:5-(e-i),A.avail_out=s<n?n-s+257:257-(s-n),p.hold=_,p.bits=w};const tt=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]),et=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]),it=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]),st=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]);var at=(A,t,e,i,s,a,n,r)=>{const h=r.bits;let o,g,E,_,w,I,l=0,c=0,B=0,C=0,d=0,D=0,f=0,Q=0,M=0,S=0,u=null;const p=new Uint16Array(16),m=new Uint16Array(16);let R,y,k,b=null;for(l=0;l<=15;l++)p[l]=0;for(c=0;c<i;c++)p[t[e+c]]++;for(d=h,C=15;C>=1&&0===p[C];C--);if(d>C&&(d=C),0===C)return s[a++]=20971520,s[a++]=20971520,r.bits=1,0;for(B=1;B<C&&0===p[B];B++);for(d<B&&(d=B),Q=1,l=1;l<=15;l++)if(Q<<=1,Q-=p[l],Q<0)return-1;if(Q>0&&(0===A||1!==C))return-1;for(m[1]=0,l=1;l<15;l++)m[l+1]=m[l]+p[l];for(c=0;c<i;c++)0!==t[e+c]&&(n[m[t[e+c]]++]=c);if(0===A?(u=b=n,I=20):1===A?(u=tt,b=et,I=257):(u=it,b=st,I=0),S=0,c=0,l=B,w=a,D=d,f=0,E=-1,M=1<<d,_=M-1,1===A&&M>852||2===A&&M>592)return 1;for(;;){R=l-f,n[c]+1<I?(y=0,k=n[c]):n[c]>=I?(y=b[n[c]-I],k=u[n[c]-I]):(y=96,k=0),o=1<<l-f,g=1<<D,B=g;do{g-=o,s[w+(S>>f)+g]=R<<24|y<<16|k|0}while(0!==g);for(o=1<<l-1;S&o;)o>>=1;if(0!==o?(S&=o-1,S+=o):S=0,c++,0==--p[l]){if(l===C)break;l=t[e+n[c]]}if(l>d&&(S&_)!==E){for(0===f&&(f=d),w+=B,D=l-f,Q=1<<D;D+f<C&&(Q-=p[D+f],!(Q<=0));)D++,Q<<=1;if(M+=1<<D,1===A&&M>852||2===A&&M>592)return 1;E=S&_,s[E]=d<<24|D<<16|w-a|0}}return 0!==S&&(s[w+S]=l-f<<24|64<<16|0),r.bits=d,0};const{Z_FINISH:nt,Z_BLOCK:rt,Z_TREES:ht,Z_OK:ot,Z_STREAM_END:gt,Z_NEED_DICT:Et,Z_STREAM_ERROR:_t,Z_DATA_ERROR:wt,Z_MEM_ERROR:It,Z_BUF_ERROR:lt,Z_DEFLATED:ct}=x,Bt=16209,Ct=A=>(A>>>24&255)+(A>>>8&65280)+((65280&A)<<8)+((255&A)<<24);function dt(){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}const Dt=A=>{if(!A)return 1;const t=A.state;return!t||t.strm!==A||t.mode<16180||t.mode>16211?1:0},ft=A=>{if(Dt(A))return _t;const t=A.state;return A.total_in=A.total_out=t.total=0,A.msg="",t.wrap&&(A.adler=1&t.wrap),t.mode=16180,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(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,ot},Qt=A=>{if(Dt(A))return _t;const t=A.state;return t.wsize=0,t.whave=0,t.wnext=0,ft(A)},Mt=(A,t)=>{let e;if(Dt(A))return _t;const i=A.state;return t<0?(e=0,t=-t):(e=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?_t:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=e,i.wbits=t,Qt(A))},St=(A,t)=>{if(!A)return _t;const e=new dt;A.state=e,e.strm=A,e.window=null,e.mode=16180;const i=Mt(A,t);return i!==ot&&(A.state=null),i};let ut,pt,mt=!0;const Rt=A=>{if(mt){ut=new Int32Array(512),pt=new Int32Array(32);let t=0;for(;t<144;)A.lens[t++]=8;for(;t<256;)A.lens[t++]=9;for(;t<280;)A.lens[t++]=7;for(;t<288;)A.lens[t++]=8;for(at(1,A.lens,0,288,ut,0,A.work,{bits:9}),t=0;t<32;)A.lens[t++]=5;at(2,A.lens,0,32,pt,0,A.work,{bits:5}),mt=!1}A.lencode=ut,A.lenbits=9,A.distcode=pt,A.distbits=5},yt=(A,t,e,i)=>{let s;const a=A.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),i>=a.wsize?(a.window.set(t.subarray(e-a.wsize,e),0),a.wnext=0,a.whave=a.wsize):(s=a.wsize-a.wnext,s>i&&(s=i),a.window.set(t.subarray(e-i,e-i+s),a.wnext),(i-=s)?(a.window.set(t.subarray(e-i,e),0),a.wnext=i,a.whave=a.wsize):(a.wnext+=s,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=s))),0};var kt={inflateReset:Qt,inflateReset2:Mt,inflateResetKeep:ft,inflateInit:A=>St(A,15),inflateInit2:St,inflate:(A,t)=>{let e,i,s,a,n,r,h,o,g,E,_,w,I,l,c,B,C,d,D,f,Q,M,S=0;const u=new Uint8Array(4);let p,m;const R=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Dt(A)||!A.output||!A.input&&0!==A.avail_in)return _t;e=A.state,16191===e.mode&&(e.mode=16192),n=A.next_out,s=A.output,h=A.avail_out,a=A.next_in,i=A.input,r=A.avail_in,o=e.hold,g=e.bits,E=r,_=h,M=ot;A:for(;;)switch(e.mode){case 16180:if(0===e.wrap){e.mode=16192;break}for(;g<16;){if(0===r)break A;r--,o+=i[a++]<<g,g+=8}if(2&e.wrap&&35615===o){0===e.wbits&&(e.wbits=15),e.check=0,u[0]=255&o,u[1]=o>>>8&255,e.check=Y(e.check,u,2,0),o=0,g=0,e.mode=16181;break}if(e.head&&(e.head.done=!1),!(1&e.wrap)||(((255&o)<<8)+(o>>8))%31){A.msg="incorrect header check",e.mode=Bt;break}if((15&o)!==ct){A.msg="unknown compression method",e.mode=Bt;break}if(o>>>=4,g-=4,Q=8+(15&o),0===e.wbits&&(e.wbits=Q),Q>15||Q>e.wbits){A.msg="invalid window size",e.mode=Bt;break}e.dmax=1<<e.wbits,e.flags=0,A.adler=e.check=1,e.mode=512&o?16189:16191,o=0,g=0;break;case 16181:for(;g<16;){if(0===r)break A;r--,o+=i[a++]<<g,g+=8}if(e.flags=o,(255&e.flags)!==ct){A.msg="unknown compression method",e.mode=Bt;break}if(57344&e.flags){A.msg="unknown header flags set",e.mode=Bt;break}e.head&&(e.head.text=o>>8&1),512&e.flags&&4&e.wrap&&(u[0]=255&o,u[1]=o>>>8&255,e.check=Y(e.check,u,2,0)),o=0,g=0,e.mode=16182;case 16182:for(;g<32;){if(0===r)break A;r--,o+=i[a++]<<g,g+=8}e.head&&(e.head.time=o),512&e.flags&&4&e.wrap&&(u[0]=255&o,u[1]=o>>>8&255,u[2]=o>>>16&255,u[3]=o>>>24&255,e.check=Y(e.check,u,4,0)),o=0,g=0,e.mode=16183;case 16183:for(;g<16;){if(0===r)break A;r--,o+=i[a++]<<g,g+=8}e.head&&(e.head.xflags=255&o,e.head.os=o>>8),512&e.flags&&4&e.wrap&&(u[0]=255&o,u[1]=o>>>8&255,e.check=Y(e.check,u,2,0)),o=0,g=0,e.mode=16184;case 16184:if(1024&e.flags){for(;g<16;){if(0===r)break A;r--,o+=i[a++]<<g,g+=8}e.length=o,e.head&&(e.head.extra_len=o),512&e.flags&&4&e.wrap&&(u[0]=255&o,u[1]=o>>>8&255,e.check=Y(e.check,u,2,0)),o=0,g=0}else e.head&&(e.head.extra=null);e.mode=16185;case 16185:if(1024&e.flags&&(w=e.length,w>r&&(w=r),w&&(e.head&&(Q=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Uint8Array(e.head.extra_len)),e.head.extra.set(i.subarray(a,a+w),Q)),512&e.flags&&4&e.wrap&&(e.check=Y(e.check,i,w,a)),r-=w,a+=w,e.length-=w),e.length))break A;e.length=0,e.mode=16186;case 16186:if(2048&e.flags){if(0===r)break A;w=0;do{Q=i[a+w++],e.head&&Q&&e.length<65536&&(e.head.name+=String.fromCharCode(Q))}while(Q&&w<r);if(512&e.flags&&4&e.wrap&&(e.check=Y(e.check,i,w,a)),r-=w,a+=w,Q)break A}else e.head&&(e.head.name=null);e.length=0,e.mode=16187;case 16187:if(4096&e.flags){if(0===r)break A;w=0;do{Q=i[a+w++],e.head&&Q&&e.length<65536&&(e.head.comment+=String.fromCharCode(Q))}while(Q&&w<r);if(512&e.flags&&4&e.wrap&&(e.check=Y(e.check,i,w,a)),r-=w,a+=w,Q)break A}else e.head&&(e.head.comment=null);e.mode=16188;case 16188:if(512&e.flags){for(;g<16;){if(0===r)break A;r--,o+=i[a++]<<g,g+=8}if(4&e.wrap&&o!==(65535&e.check)){A.msg="header crc mismatch",e.mode=Bt;break}o=0,g=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0),A.adler=e.check=0,e.mode=16191;break;case 16189:for(;g<32;){if(0===r)break A;r--,o+=i[a++]<<g,g+=8}A.adler=e.check=Ct(o),o=0,g=0,e.mode=16190;case 16190:if(0===e.havedict)return A.next_out=n,A.avail_out=h,A.next_in=a,A.avail_in=r,e.hold=o,e.bits=g,Et;A.adler=e.check=1,e.mode=16191;case 16191:if(t===rt||t===ht)break A;case 16192:if(e.last){o>>>=7&g,g-=7&g,e.mode=16206;break}for(;g<3;){if(0===r)break A;r--,o+=i[a++]<<g,g+=8}switch(e.last=1&o,o>>>=1,g-=1,3&o){case 0:e.mode=16193;break;case 1:if(Rt(e),e.mode=16199,t===ht){o>>>=2,g-=2;break A}break;case 2:e.mode=16196;break;case 3:A.msg="invalid block type",e.mode=Bt}o>>>=2,g-=2;break;case 16193:for(o>>>=7&g,g-=7&g;g<32;){if(0===r)break A;r--,o+=i[a++]<<g,g+=8}if((65535&o)!=(o>>>16^65535)){A.msg="invalid stored block lengths",e.mode=Bt;break}if(e.length=65535&o,o=0,g=0,e.mode=16194,t===ht)break A;case 16194:e.mode=16195;case 16195:if(w=e.length,w){if(w>r&&(w=r),w>h&&(w=h),0===w)break A;s.set(i.subarray(a,a+w),n),r-=w,a+=w,h-=w,n+=w,e.length-=w;break}e.mode=16191;break;case 16196:for(;g<14;){if(0===r)break A;r--,o+=i[a++]<<g,g+=8}if(e.nlen=257+(31&o),o>>>=5,g-=5,e.ndist=1+(31&o),o>>>=5,g-=5,e.ncode=4+(15&o),o>>>=4,g-=4,e.nlen>286||e.ndist>30){A.msg="too many length or distance symbols",e.mode=Bt;break}e.have=0,e.mode=16197;case 16197:for(;e.have<e.ncode;){for(;g<3;){if(0===r)break A;r--,o+=i[a++]<<g,g+=8}e.lens[R[e.have++]]=7&o,o>>>=3,g-=3}for(;e.have<19;)e.lens[R[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,p={bits:e.lenbits},M=at(0,e.lens,0,19,e.lencode,0,e.work,p),e.lenbits=p.bits,M){A.msg="invalid code lengths set",e.mode=Bt;break}e.have=0,e.mode=16198;case 16198:for(;e.have<e.nlen+e.ndist;){for(;S=e.lencode[o&(1<<e.lenbits)-1],c=S>>>24,B=S>>>16&255,C=65535&S,!(c<=g);){if(0===r)break A;r--,o+=i[a++]<<g,g+=8}if(C<16)o>>>=c,g-=c,e.lens[e.have++]=C;else{if(16===C){for(m=c+2;g<m;){if(0===r)break A;r--,o+=i[a++]<<g,g+=8}if(o>>>=c,g-=c,0===e.have){A.msg="invalid bit length repeat",e.mode=Bt;break}Q=e.lens[e.have-1],w=3+(3&o),o>>>=2,g-=2}else if(17===C){for(m=c+3;g<m;){if(0===r)break A;r--,o+=i[a++]<<g,g+=8}o>>>=c,g-=c,Q=0,w=3+(7&o),o>>>=3,g-=3}else{for(m=c+7;g<m;){if(0===r)break A;r--,o+=i[a++]<<g,g+=8}o>>>=c,g-=c,Q=0,w=11+(127&o),o>>>=7,g-=7}if(e.have+w>e.nlen+e.ndist){A.msg="invalid bit length repeat",e.mode=Bt;break}for(;w--;)e.lens[e.have++]=Q}}if(e.mode===Bt)break;if(0===e.lens[256]){A.msg="invalid code -- missing end-of-block",e.mode=Bt;break}if(e.lenbits=9,p={bits:e.lenbits},M=at(1,e.lens,0,e.nlen,e.lencode,0,e.work,p),e.lenbits=p.bits,M){A.msg="invalid literal/lengths set",e.mode=Bt;break}if(e.distbits=6,e.distcode=e.distdyn,p={bits:e.distbits},M=at(2,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,p),e.distbits=p.bits,M){A.msg="invalid distances set",e.mode=Bt;break}if(e.mode=16199,t===ht)break A;case 16199:e.mode=16200;case 16200:if(r>=6&&h>=258){A.next_out=n,A.avail_out=h,A.next_in=a,A.avail_in=r,e.hold=o,e.bits=g,At(A,_),n=A.next_out,s=A.output,h=A.avail_out,a=A.next_in,i=A.input,r=A.avail_in,o=e.hold,g=e.bits,16191===e.mode&&(e.back=-1);break}for(e.back=0;S=e.lencode[o&(1<<e.lenbits)-1],c=S>>>24,B=S>>>16&255,C=65535&S,!(c<=g);){if(0===r)break A;r--,o+=i[a++]<<g,g+=8}if(B&&0==(240&B)){for(d=c,D=B,f=C;S=e.lencode[f+((o&(1<<d+D)-1)>>d)],c=S>>>24,B=S>>>16&255,C=65535&S,!(d+c<=g);){if(0===r)break A;r--,o+=i[a++]<<g,g+=8}o>>>=d,g-=d,e.back+=d}if(o>>>=c,g-=c,e.back+=c,e.length=C,0===B){e.mode=16205;break}if(32&B){e.back=-1,e.mode=16191;break}if(64&B){A.msg="invalid literal/length code",e.mode=Bt;break}e.extra=15&B,e.mode=16201;case 16201:if(e.extra){for(m=e.extra;g<m;){if(0===r)break A;r--,o+=i[a++]<<g,g+=8}e.length+=o&(1<<e.extra)-1,o>>>=e.extra,g-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=16202;case 16202:for(;S=e.distcode[o&(1<<e.distbits)-1],c=S>>>24,B=S>>>16&255,C=65535&S,!(c<=g);){if(0===r)break A;r--,o+=i[a++]<<g,g+=8}if(0==(240&B)){for(d=c,D=B,f=C;S=e.distcode[f+((o&(1<<d+D)-1)>>d)],c=S>>>24,B=S>>>16&255,C=65535&S,!(d+c<=g);){if(0===r)break A;r--,o+=i[a++]<<g,g+=8}o>>>=d,g-=d,e.back+=d}if(o>>>=c,g-=c,e.back+=c,64&B){A.msg="invalid distance code",e.mode=Bt;break}e.offset=C,e.extra=15&B,e.mode=16203;case 16203:if(e.extra){for(m=e.extra;g<m;){if(0===r)break A;r--,o+=i[a++]<<g,g+=8}e.offset+=o&(1<<e.extra)-1,o>>>=e.extra,g-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){A.msg="invalid distance too far back",e.mode=Bt;break}e.mode=16204;case 16204:if(0===h)break A;if(w=_-h,e.offset>w){if(w=e.offset-w,w>e.whave&&e.sane){A.msg="invalid distance too far back",e.mode=Bt;break}w>e.wnext?(w-=e.wnext,I=e.wsize-w):I=e.wnext-w,w>e.length&&(w=e.length),l=e.window}else l=s,I=n-e.offset,w=e.length;w>h&&(w=h),h-=w,e.length-=w;do{s[n++]=l[I++]}while(--w);0===e.length&&(e.mode=16200);break;case 16205:if(0===h)break A;s[n++]=e.length,h--,e.mode=16200;break;case 16206:if(e.wrap){for(;g<32;){if(0===r)break A;r--,o|=i[a++]<<g,g+=8}if(_-=h,A.total_out+=_,e.total+=_,4&e.wrap&&_&&(A.adler=e.check=e.flags?Y(e.check,s,_,n-_):P(e.check,s,_,n-_)),_=h,4&e.wrap&&(e.flags?o:Ct(o))!==e.check){A.msg="incorrect data check",e.mode=Bt;break}o=0,g=0}e.mode=16207;case 16207:if(e.wrap&&e.flags){for(;g<32;){if(0===r)break A;r--,o+=i[a++]<<g,g+=8}if(4&e.wrap&&o!==(4294967295&e.total)){A.msg="incorrect length check",e.mode=Bt;break}o=0,g=0}e.mode=16208;case 16208:M=gt;break A;case Bt:M=wt;break A;case 16210:return It;default:return _t}return A.next_out=n,A.avail_out=h,A.next_in=a,A.avail_in=r,e.hold=o,e.bits=g,(e.wsize||_!==A.avail_out&&e.mode<Bt&&(e.mode<16206||t!==nt))&&yt(A,A.output,A.next_out,_-A.avail_out),E-=A.avail_in,_-=A.avail_out,A.total_in+=E,A.total_out+=_,e.total+=_,4&e.wrap&&_&&(A.adler=e.check=e.flags?Y(e.check,s,_,A.next_out-_):P(e.check,s,_,A.next_out-_)),A.data_type=e.bits+(e.last?64:0)+(16191===e.mode?128:0)+(16199===e.mode||16194===e.mode?256:0),(0===E&&0===_||t===nt)&&M===ot&&(M=lt),M},inflateEnd:A=>{if(Dt(A))return _t;let t=A.state;return t.window&&(t.window=null),A.state=null,ot},inflateGetHeader:(A,t)=>{if(Dt(A))return _t;const e=A.state;return 0==(2&e.wrap)?_t:(e.head=t,t.done=!1,ot)},inflateSetDictionary:(A,t)=>{const e=t.length;let i,s,a;return Dt(A)?_t:(i=A.state,0!==i.wrap&&16190!==i.mode?_t:16190===i.mode&&(s=1,s=P(s,t,e,0),s!==i.check)?wt:(a=yt(A,t,e,e),a?(i.mode=16210,It):(i.havedict=1,ot)))},inflateInfo:"pako inflate (from Nodeca project)"};var bt=function(){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};const Ft=Object.prototype.toString,{Z_NO_FLUSH:Ht,Z_FINISH:Gt,Z_OK:Pt,Z_STREAM_END:Tt,Z_NEED_DICT:Yt,Z_STREAM_ERROR:Kt,Z_DATA_ERROR:xt,Z_MEM_ERROR:Ot}=x;function vt(A){this.options=HA({chunkSize:65536,windowBits:15,to:""},A||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||A&&A.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new OA,this.strm.avail_out=0;let e=kt.inflateInit2(this.strm,t.windowBits);if(e!==Pt)throw new Error(K[e]);if(this.header=new bt,kt.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=YA(t.dictionary):"[object ArrayBuffer]"===Ft.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(e=kt.inflateSetDictionary(this.strm,t.dictionary),e!==Pt)))throw new Error(K[e])}function Ut(A,t){const e=new vt(t);if(e.push(A),e.err)throw e.msg||K[e.err];return e.result}vt.prototype.push=function(A,t){const e=this.strm,i=this.options.chunkSize,s=this.options.dictionary;let a,n,r;if(this.ended)return!1;for(n=t===~~t?t:!0===t?Gt:Ht,"[object ArrayBuffer]"===Ft.call(A)?e.input=new Uint8Array(A):e.input=A,e.next_in=0,e.avail_in=e.input.length;;){for(0===e.avail_out&&(e.output=new Uint8Array(i),e.next_out=0,e.avail_out=i),a=kt.inflate(e,n),a===Yt&&s&&(a=kt.inflateSetDictionary(e,s),a===Pt?a=kt.inflate(e,n):a===xt&&(a=Yt));e.avail_in>0&&a===Tt&&e.state.wrap>0&&0!==A[e.next_in];)kt.inflateReset(e),a=kt.inflate(e,n);switch(a){case Kt:case xt:case Yt:case Ot:return this.onEnd(a),this.ended=!0,!1}if(r=e.avail_out,e.next_out&&(0===e.avail_out||a===Tt))if("string"===this.options.to){let A=xA(e.output,e.next_out),t=e.next_out-A,s=KA(e.output,A);e.next_out=t,e.avail_out=i-t,t&&e.output.set(e.output.subarray(A,A+t),0),this.onData(s)}else this.onData(e.output.length===e.next_out?e.output:e.output.subarray(0,e.next_out));if(a!==Pt||0!==r){if(a===Tt)return a=kt.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(0===e.avail_in)break}}return!0},vt.prototype.onData=function(A){this.chunks.push(A)},vt.prototype.onEnd=function(A){A===Pt&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=GA(this.chunks)),this.chunks=[],this.err=A,this.msg=this.strm.msg};var Jt={Inflate:vt,inflate:Ut,inflateRaw:function(A,t){return(t=t||{}).raw=!0,Ut(A,t)},ungzip:Ut,constants:x};const{Deflate:Lt,deflate:zt,deflateRaw:Zt,gzip:Nt}=$A,{Inflate:qt,inflate:jt,inflateRaw:Wt,ungzip:Xt}=Jt;var Vt=zt,$t=qt;class Ae{constructor(A,t,e,i=115200,s=!1){this.transport=A,this.baudrate=t,this.terminal=e,this.rom_baudrate=i,this.debugLogging=s,this.ESP_RAM_BLOCK=6144,this.ESP_FLASH_BEGIN=2,this.ESP_FLASH_DATA=3,this.ESP_FLASH_END=4,this.ESP_MEM_BEGIN=5,this.ESP_MEM_END=6,this.ESP_MEM_DATA=7,this.ESP_WRITE_REG=9,this.ESP_READ_REG=10,this.ESP_SPI_ATTACH=13,this.ESP_CHANGE_BAUDRATE=15,this.ESP_FLASH_DEFL_BEGIN=16,this.ESP_FLASH_DEFL_DATA=17,this.ESP_FLASH_DEFL_END=18,this.ESP_SPI_FLASH_MD5=19,this.ESP_ERASE_FLASH=208,this.ESP_ERASE_REGION=209,this.ESP_RUN_USER_CODE=211,this.ESP_IMAGE_MAGIC=233,this.ESP_CHECKSUM_MAGIC=239,this.ROM_INVALID_RECV_MSG=5,this.ERASE_REGION_TIMEOUT_PER_MB=3e4,this.ERASE_WRITE_TIMEOUT_PER_MB=4e4,this.MD5_TIMEOUT_PER_MB=8e3,this.CHIP_ERASE_TIMEOUT=12e4,this.MAX_TIMEOUT=2*this.CHIP_ERASE_TIMEOUT,this.CHIP_DETECT_MAGIC_REG_ADDR=1073745920,this.DETECTED_FLASH_SIZES={18:"256KB",19:"512KB",20:"1MB",21:"2MB",22:"4MB",23:"8MB",24:"16MB"},this.USB_JTAG_SERIAL_PID=4097,this.checksum=function(A){let t,e=239;for(t=0;t<A.length;t++)e^=A[t];return e},this.timeout_per_mb=function(A,t){const e=A*(t/1e6);return e<3e3?3e3:e},this.flash_size_bytes=function(A){let t=-1;return-1!==A.indexOf("KB")?t=1024*parseInt(A.slice(0,A.indexOf("KB"))):-1!==A.indexOf("MB")&&(t=1024*parseInt(A.slice(0,A.indexOf("MB")))*1024),t},this.IS_STUB=!1,this.FLASH_WRITE_SIZE=16384,this.terminal&&this.terminal.clean(),this.info("esptool.js"),this.info("Serial port "+this.transport.get_info())}_sleep(A){return new Promise((t=>setTimeout(t,A)))}write(A,t=!0){this.terminal?t?this.terminal.writeLine(A):this.terminal.write(A):console.log(A)}error(A,t=!0){this.write(`Error: ${A}`,t)}info(A,t=!0){this.write(A,t)}debug(A,t=!0){this.debugLogging&&this.write(`Debug: ${A}`,t)}_short_to_bytearray(A){return new Uint8Array([255&A,A>>8&255])}_int_to_bytearray(A){return new Uint8Array([255&A,A>>8&255,A>>16&255,A>>24&255])}_bytearray_to_short(A,t){return A|t>>8}_bytearray_to_int(A,t,e,i){return A|t<<8|e<<16|i<<24}_appendBuffer(A,t){const e=new Uint8Array(A.byteLength+t.byteLength);return e.set(new Uint8Array(A),0),e.set(new Uint8Array(t),A.byteLength),e.buffer}_appendArray(A,t){const e=new Uint8Array(A.length+t.length);return e.set(A,0),e.set(t,A.length),e}ui8ToBstr(A){let t="";for(let e=0;e<A.length;e++)t+=String.fromCharCode(A[e]);return t}bstrToUi8(A){const t=new Uint8Array(A.length);for(let e=0;e<A.length;e++)t[e]=A.charCodeAt(e);return t}async flush_input(){try{await this.transport.rawRead(200)}catch(A){this.error(A.message)}}async command(t=null,e=new Uint8Array(0),i=0,s=!0,a=3e3){if(null!=t){const A=new Uint8Array(8+e.length);let s;for(A[0]=0,A[1]=t,A[2]=this._short_to_bytearray(e.length)[0],A[3]=this._short_to_bytearray(e.length)[1],A[4]=this._int_to_bytearray(i)[0],A[5]=this._int_to_bytearray(i)[1],A[6]=this._int_to_bytearray(i)[2],A[7]=this._int_to_bytearray(i)[3],s=0;s<e.length;s++)A[8+s]=e[s];await this.transport.write(A)}if(!s)return[0,new Uint8Array(0)];for(let e=0;e<100;e++){const e=await this.transport.read(a),i=e[0],s=e[1],n=this._bytearray_to_int(e[4],e[5],e[6],e[7]),r=e.slice(8);if(1==i){if(null==t||s==t)return[n,r];if(0!=r[0]&&r[1]==this.ROM_INVALID_RECV_MSG)throw await this.flush_input(),new A("unsupported command error")}}throw new A("invalid response")}async read_reg(A,t=3e3){const e=this._int_to_bytearray(A);return(await this.command(this.ESP_READ_REG,e,void 0,void 0,t))[0]}async write_reg(A,t,e=4294967295,i=0,s=0){let a=this._appendArray(this._int_to_bytearray(A),this._int_to_bytearray(t));a=this._appendArray(a,this._int_to_bytearray(e)),a=this._appendArray(a,this._int_to_bytearray(i)),s>0&&(a=this._appendArray(a,this._int_to_bytearray(this.chip.UART_DATE_REG_ADDR)),a=this._appendArray(a,this._int_to_bytearray(0)),a=this._appendArray(a,this._int_to_bytearray(0)),a=this._appendArray(a,this._int_to_bytearray(s))),await this.check_command("write target memory",this.ESP_WRITE_REG,a)}async sync(){this.debug("Sync");const A=new Uint8Array(36);let t;for(A[0]=7,A[1]=7,A[2]=18,A[3]=32,t=0;t<32;t++)A[4+t]=85;try{return await this.command(8,A,void 0,void 0,100)}catch(A){throw this.debug("Sync err "+A),A}}async _connect_attempt(A="default_reset",t=!1){this.debug("_connect_attempt "+A+" "+t),"no_reset"!==A&&(this.transport.get_pid()===this.USB_JTAG_SERIAL_PID?(await this.transport.setRTS(!1),await this.transport.setDTR(!1),await this._sleep(100),await this.transport.setDTR(!0),await this.transport.setRTS(!1),await this._sleep(100),await this.transport.setRTS(!0),await this.transport.setDTR(!1),await this.transport.setRTS(!0),await this._sleep(100),await this.transport.setRTS(!1),await this.transport.setDTR(!1)):(await this.transport.setDTR(!1),await this.transport.setRTS(!0),await this._sleep(100),t&&await this._sleep(2e3),await this.transport.setDTR(!0),await this.transport.setRTS(!1),await this._sleep(50),await this.transport.setDTR(!1)));let e=0,i=!0;for(;i;){try{e+=(await this.transport.read(1e3)).length}catch(A){if(this.debug(A.message),A instanceof Error){i=!1;break}}await this._sleep(50)}for(this.transport.slip_reader_enabled=!0,e=7;e--;){try{const A=await this.sync();return this.debug(A[0].toString()),"success"}catch(A){A instanceof Error&&(t?this.info("_",!1):this.info(".",!1))}await this._sleep(50)}return"error"}async connect(t="default_reset",e=7,i=!1){let s,a;for(this.info("Connecting...",!1),await this.transport.connect(this.rom_baudrate),s=0;s<e&&(a=await this._connect_attempt(t,!1),"success"!==a)&&(a=await this._connect_attempt(t,!0),"success"!==a);s++);if("success"!==a)throw new A("Failed to connect with the device");if(this.info("\n\r",!1),!i){const t=await this.read_reg(1073745920)>>>0;this.debug("Chip Magic "+t.toString(16));const e=await async function(A){switch(A){case 15736195:{const{ESP32ROM:A}=await Promise.resolve().then((function(){return he}));return new A}case 1763790959:case 456216687:{const{ESP32C3ROM:A}=await Promise.resolve().then((function(){return Ie}));return new A}case 752910447:{const{ESP32C6ROM:A}=await Promise.resolve().then((function(){return De}));return new A}case 9:{const{ESP32S3ROM:A}=await Promise.resolve().then((function(){return pe}));return new A}case 1990:{const{ESP32S2ROM:A}=await Promise.resolve().then((function(){return Fe}));return new A}case 4293968129:{const{ESP8266ROM:A}=await Promise.resolve().then((function(){return Ke}));return new A}default:return null}}(t);if(null===this.chip)throw new A(`Unexpected CHIP magic value ${t}. Failed to autodetect chip type.`);this.chip=e}}async detect_chip(A="default_reset"){await this.connect(A),this.info("Detecting chip type... ",!1),null!=this.chip?this.info(this.chip.CHIP_NAME):this.info("unknown!")}async check_command(A="",t=null,e=new Uint8Array(0),i=0,s=3e3){this.debug("check_command "+A);const a=await this.command(t,e,i,void 0,s);return a[1].length>4?a[1]:a[0]}async mem_begin(A,t,e,i){this.debug("mem_begin "+A+" "+t+" "+e+" "+i.toString(16));let s=this._appendArray(this._int_to_bytearray(A),this._int_to_bytearray(t));s=this._appendArray(s,this._int_to_bytearray(e)),s=this._appendArray(s,this._int_to_bytearray(i)),await this.check_command("enter RAM download mode",this.ESP_MEM_BEGIN,s)}async mem_block(A,t){let e=this._appendArray(this._int_to_bytearray(A.length),this._int_to_bytearray(t));e=this._appendArray(e,this._int_to_bytearray(0)),e=this._appendArray(e,this._int_to_bytearray(0)),e=this._appendArray(e,A);const i=this.checksum(A);await this.check_command("write to target RAM",this.ESP_MEM_DATA,e,i)}async mem_finish(A){const t=0===A?1:0,e=this._appendArray(this._int_to_bytearray(t),this._int_to_bytearray(A));await this.check_command("leave RAM download mode",this.ESP_MEM_END,e,void 0,50)}async flash_spi_attach(A){const t=this._int_to_bytearray(A);await this.check_command("configure SPI flash pins",this.ESP_SPI_ATTACH,t)}async flash_begin(A,t){const e=Math.floor((A+this.FLASH_WRITE_SIZE-1)/this.FLASH_WRITE_SIZE),i=this.chip.get_erase_size(t,A),s=new Date,a=s.getTime();let n=3e3;0==this.IS_STUB&&(n=this.timeout_per_mb(this.ERASE_REGION_TIMEOUT_PER_MB,A)),this.debug("flash begin "+i+" "+e+" "+this.FLASH_WRITE_SIZE+" "+t+" "+A);let r=this._appendArray(this._int_to_bytearray(i),this._int_to_bytearray(e));r=this._appendArray(r,this._int_to_bytearray(this.FLASH_WRITE_SIZE)),r=this._appendArray(r,this._int_to_bytearray(t)),0==this.IS_STUB&&(r=this._appendArray(r,this._int_to_bytearray(0))),await this.check_command("enter Flash download mode",this.ESP_FLASH_BEGIN,r,void 0,n);const h=s.getTime();return 0!=A&&0==this.IS_STUB&&this.info("Took "+(h-a)/1e3+"."+(h-a)%1e3+"s to erase flash block"),e}async flash_defl_begin(A,t,e){const i=Math.floor((t+this.FLASH_WRITE_SIZE-1)/this.FLASH_WRITE_SIZE),s=Math.floor((A+this.FLASH_WRITE_SIZE-1)/this.FLASH_WRITE_SIZE),a=new Date,n=a.getTime();let r,h;this.IS_STUB?(r=A,h=3e3):(r=s*this.FLASH_WRITE_SIZE,h=this.timeout_per_mb(this.ERASE_REGION_TIMEOUT_PER_MB,r)),this.info("Compressed "+A+" bytes to "+t+"...");let o=this._appendArray(this._int_to_bytearray(r),this._int_to_bytearray(i));o=this._appendArray(o,this._int_to_bytearray(this.FLASH_WRITE_SIZE)),o=this._appendArray(o,this._int_to_bytearray(e)),"ESP32-S2"!==this.chip.CHIP_NAME&&"ESP32-S3"!==this.chip.CHIP_NAME&&"ESP32-C3"!==this.chip.CHIP_NAME||!1!==this.IS_STUB||(o=this._appendArray(o,this._int_to_bytearray(0))),await this.check_command("enter compressed flash mode",this.ESP_FLASH_DEFL_BEGIN,o,void 0,h);const g=a.getTime();return 0!=A&&!1===this.IS_STUB&&this.info("Took "+(g-n)/1e3+"."+(g-n)%1e3+"s to erase flash block"),i}async flash_block(A,t,e){let i=this._appendArray(this._int_to_bytearray(A.length),this._int_to_bytearray(t));i=this._appendArray(i,this._int_to_bytearray(0)),i=this._appendArray(i,this._int_to_bytearray(0)),i=this._appendArray(i,A);const s=this.checksum(A);await this.check_command("write to target Flash after seq "+t,this.ESP_FLASH_DATA,i,s,e)}async flash_defl_block(A,t,e){let i=this._appendArray(this._int_to_bytearray(A.length),this._int_to_bytearray(t));i=this._appendArray(i,this._int_to_bytearray(0)),i=this._appendArray(i,this._int_to_bytearray(0)),i=this._appendArray(i,A);const s=this.checksum(A);this.debug("flash_defl_block "+A[0].toString(16)+" "+A[1].toString(16)),await this.check_command("write compressed data to flash after seq "+t,this.ESP_FLASH_DEFL_DATA,i,s,e)}async flash_finish(A=!1){const t=A?0:1,e=this._int_to_bytearray(t);await this.check_command("leave Flash mode",this.ESP_FLASH_END,e)}async flash_defl_finish(A=!1){const t=A?0:1,e=this._int_to_bytearray(t);await this.check_command("leave compressed flash mode",this.ESP_FLASH_DEFL_END,e)}async run_spiflash_command(t,e,i){const s=this.chip.SPI_REG_BASE,a=s+0,n=s+this.chip.SPI_USR_OFFS,r=s+this.chip.SPI_USR1_OFFS,h=s+this.chip.SPI_USR2_OFFS,o=s+this.chip.SPI_W0_OFFS;let g;g=null!=this.chip.SPI_MOSI_DLEN_OFFS?async(A,t)=>{const e=s+this.chip.SPI_MOSI_DLEN_OFFS,i=s+this.chip.SPI_MISO_DLEN_OFFS;A>0&&await this.write_reg(e,A-1),t>0&&await this.write_reg(i,t-1)}:async(A,t)=>{const e=r,i=(0===t?0:t-1)<<8|(0===A?0:A-1)<<17;await this.write_reg(e,i)};const E=1<<18;if(i>32)throw new A("Reading more than 32 bits back from a SPI flash operation is unsupported");if(e.length>64)throw new A("Writing more than 64 bytes of data with one SPI command is unsupported");const _=8*e.length,w=await this.read_reg(n),I=await this.read_reg(h);let l,c=1<<31;i>0&&(c|=268435456),_>0&&(c|=134217728),await g(_,i),await this.write_reg(n,c);let B=7<<28|t;if(await this.write_reg(h,B),0==_)await this.write_reg(o,0);else{if(e.length%4!=0){const A=new Uint8Array(e.length%4);e=this._appendArray(e,A)}let A=o;for(l=0;l<e.length-4;l+=4)B=this._bytearray_to_int(e[l],e[l+1],e[l+2],e[l+3]),await this.write_reg(A,B),A+=4}for(await this.write_reg(a,E),l=0;l<10&&(B=await this.read_reg(a)&E,0!=B);l++);if(10===l)throw new A("SPI command did not complete in time");const C=await this.read_reg(o);return await this.write_reg(n,w),await this.write_reg(h,I),C}async read_flash_id(){const A=new Uint8Array(0);return await this.run_spiflash_command(159,A,24)}async erase_flash(){this.info("Erasing flash (this may take a while)...");let A=new Date;const t=A.getTime(),e=await this.check_command("erase flash",this.ESP_ERASE_FLASH,void 0,void 0,this.CHIP_ERASE_TIMEOUT);A=new Date;const i=A.getTime();return this.info("Chip erase completed successfully in "+(i-t)/1e3+"s"),e}toHex(A){return Array.prototype.map.call(A,(A=>("00"+A.toString(16)).slice(-2))).join("")}async flash_md5sum(A,t){const e=this.timeout_per_mb(this.MD5_TIMEOUT_PER_MB,t);let i=this._appendArray(this._int_to_bytearray(A),this._int_to_bytearray(t));i=this._appendArray(i,this._int_to_bytearray(0)),i=this._appendArray(i,this._int_to_bytearray(0));let s=await this.check_command("calculate md5sum",this.ESP_SPI_FLASH_MD5,i,void 0,e);s instanceof Uint8Array&&s.length>16&&(s=s.slice(0,16));return this.toHex(s)}async run_stub(){this.info("Uploading stub...");let t=atob(this.chip.ROM_TEXT),e=t.split("").map((function(A){return A.charCodeAt(0)}));const i=new Uint8Array(e);t=atob(this.chip.ROM_DATA),e=t.split("").map((function(A){return A.charCodeAt(0)}));const s=new Uint8Array(e);let a,n=Math.floor((i.length+this.ESP_RAM_BLOCK-1)/this.ESP_RAM_BLOCK);for(await this.mem_begin(i.length,n,this.ESP_RAM_BLOCK,this.chip.TEXT_START),a=0;a<n;a++){const A=a*this.ESP_RAM_BLOCK,t=A+this.ESP_RAM_BLOCK;await this.mem_block(i.slice(A,t),a)}for(n=Math.floor((s.length+this.ESP_RAM_BLOCK-1)/this.ESP_RAM_BLOCK),await this.mem_begin(s.length,n,this.ESP_RAM_BLOCK,this.chip.DATA_START),a=0;a<n;a++){const A=a*this.ESP_RAM_BLOCK,t=A+this.ESP_RAM_BLOCK;await this.mem_block(s.slice(A,t),a)}this.info("Running stub..."),await this.mem_finish(this.chip.ENTRY);for(let A=0;A<100;A++){const A=await this.transport.read(1e3,6);if(79===A[0]&&72===A[1]&&65===A[2]&&73===A[3])return this.info("Stub running..."),this.IS_STUB=!0,this.FLASH_WRITE_SIZE=16384,this.chip}throw new A("Failed to start stub. Unexpected response")}async change_baud(){this.info("Changing baudrate to "+this.baudrate);const A=this.IS_STUB?this.transport.baudrate:0,t=this._appendArray(this._int_to_bytearray(this.baudrate),this._int_to_bytearray(A)),e=await this.command(this.ESP_CHANGE_BAUDRATE,t);this.debug(e[0].toString()),this.info("Changed"),await this.transport.disconnect(),await this._sleep(50),await this.transport.connect(this.baudrate);try{await this.transport.rawRead(500)}catch(A){this.debug(A.message)}}async main_fn(A="default_reset"){await this.detect_chip(A);const t=await this.chip.get_chip_description(this);return this.info("Chip is "+t),this.info("Features: "+await this.chip.get_chip_features(this)),this.info("Crystal is "+await this.chip.get_crystal_freq(this)+"MHz"),this.info("MAC: "+await this.chip.read_mac(this)),await this.chip.read_mac(this),void 0!==this.chip._post_connect&&await this.chip._post_connect(this),await this.run_stub(),this.rom_baudrate!==this.baudrate&&await this.change_baud(),t}parse_flash_size_arg(t){if(void 0===this.chip.FLASH_SIZES[t])throw new A("Flash size "+t+" is not supported by this chip type. Supported sizes: "+this.chip.FLASH_SIZES);return this.chip.FLASH_SIZES[t]}_update_image_flash_params(A,t,e,i,s){if(this.debug("_update_image_flash_params "+e+" "+i+" "+s),A.length<8)return A;if(t!=this.chip.BOOTLOADER_FLASH_OFFSET)return A;if("keep"===e&&"keep"===i&&"keep"===s)return this.info("Not changing the image"),A;const a=parseInt(A[0]);let n=parseInt(A[2]);const r=parseInt(A[3]);if(a!==this.ESP_IMAGE_MAGIC)return this.info("Warning: Image file at 0x"+t.toString(16)+" doesn't look like an image file, so not changing any flash settings."),A;if("keep"!==i){n={qio:0,qout:1,dio:2,dout:3}[i]}let h=15&r;if("keep"!==s){h={"40m":0,"26m":1,"20m":2,"80m":15}[s]}let o=240&r;"keep"!==e&&(o=this.parse_flash_size_arg(e));const g=n<<8|h+o;return this.info("Flash params set to "+g.toString(16)),parseInt(A[2])!==n<<8&&(A=A.substring(0,2)+(n<<8).toString()+A.substring(3)),parseInt(A[3])!==h+o&&(A=A.substring(0,3)+(h+o).toString()+A.substring(4)),A}async write_flash(t,e="keep",i="keep",s="keep",a=!1,n=!0,r,h){if(this.debug("EspLoader program"),"keep"!==e){const i=this.flash_size_bytes(e);for(let e=0;e<t.length;e++)if(t[e].data.length+t[e].address>i)throw new A(`File ${e+1} doesn't fit in the available flash`)}let o,g;!0===this.IS_STUB&&!0===a&&await this.erase_flash();for(let a=0;a<t.length;a++){this.debug("Data Length "+t[a].data.length),o=t[a].data;const E=t[a].data.length%4;if(E>0&&(o+="ÿÿÿÿ".substring(4-E)),g=t[a].address,this.debug("Image Length "+o.length),0===o.length){this.debug("Warning: File is empty");continue}o=this._update_image_flash_params(o,g,e,i,s);let _=null;h&&(_=h(o),this.debug("Image MD5 "+_));const w=o.length;let I;if(n){const A=this.bstrToUi8(o);o=this.ui8ToBstr(Vt(A,{level:9})),I=await this.flash_defl_begin(w,o.length,g)}else I=await this.flash_begin(w,g);let l=0,c=0;const B=o.length;r&&r(a,0,B);let C=new Date;const d=C.getTime();let D=5e3;const f=new $t({chunkSize:1});let Q=0;for(f.onData=function(A){Q+=A.byteLength};o.length>0;){this.debug("Write loop "+g+" "+l+" "+I),this.info("Writing at 0x"+(g+Q).toString(16)+"... ("+Math.floor(100*(l+1)/I)+"%)");const t=this.bstrToUi8(o.slice(0,this.FLASH_WRITE_SIZE));if(!n)throw new A("Yet to handle Non Compressed writes");{const A=Q;f.push(t,!1);const e=Q-A;let i=3e3;this.timeout_per_mb(this.ERASE_WRITE_TIMEOUT_PER_MB,e)>3e3&&(i=this.timeout_per_mb(this.ERASE_WRITE_TIMEOUT_PER_MB,e)),!1===this.IS_STUB&&(D=i),await this.flash_defl_block(t,l,D),this.IS_STUB&&(D=i)}c+=t.length,o=o.slice(this.FLASH_WRITE_SIZE,o.length),l++,r&&r(a,c,B)}this.IS_STUB&&await this.read_reg(this.CHIP_DETECT_MAGIC_REG_ADDR,D),C=new Date;const M=C.getTime()-d;if(n&&this.info("Wrote "+w+" bytes ("+c+" compressed) at 0x"+g.toString(16)+" in "+M/1e3+" seconds."),_){const t=await this.flash_md5sum(g,w);if(new String(t).valueOf()!=new String(_).valueOf())throw this.info("File md5: "+_),this.info("Flash md5: "+t),new A("MD5 of file does not match data in flash!");this.info("Hash of data verified.")}}this.info("Leaving..."),this.IS_STUB&&(await this.flash_begin(0,0),n?await this.flash_defl_finish():await this.flash_finish())}async flash_id(){this.debug("flash_id");const A=await this.read_flash_id();this.info("Manufacturer: "+(255&A).toString(16));const t=A>>16&255;this.info("Device: "+(A>>8&255).toString(16)+t.toString(16)),this.info("Detected flash size: "+this.DETECTED_FLASH_SIZES[t])}async hard_reset(){await this.transport.setRTS(!0),await this._sleep(100),await this.transport.setRTS(!1)}async soft_reset(){if(this.IS_STUB){if("ESP8266"!=this.chip.CHIP_NAME)throw new A("Soft resetting is currently only supported on ESP8266");await this.command(this.ESP_RUN_USER_CODE,void 0,void 0,!1)}else await this.flash_begin(0,0),await this.flash_finish(!1)}}class te{constructor(A){this.device=A,this.slip_reader_enabled=!1,this.left_over=new Uint8Array(0),this.baudrate=0,this._DTR_state=!1}get_info(){const A=this.device.getInfo();return A.usbVendorId&&A.usbProductId?`WebSerial VendorID 0x${A.usbVendorId.toString(16)} ProductID 0x${A.usbProductId.toString(16)}`:""}get_pid(){return this.device.getInfo().usbProductId}slip_writer(A){let t=0,e=0,i=0;for(e=0;e<A.length;e++)192!==A[e]&&219!==A[e]||t++;const s=new Uint8Array(2+t+A.length);for(s[0]=192,i=1,e=0;e<A.length;e++,i++)192!==A[e]?219!==A[e]?s[i]=A[e]:(s[i++]=219,s[i]=221):(s[i++]=219,s[i]=220);return s[i]=192,s}async write(A){const t=this.slip_writer(A);if(this.device.writable){const A=this.device.writable.getWriter();await A.write(t),A.releaseLock()}}_appendBuffer(A,t){const e=new Uint8Array(A.byteLength+t.byteLength);return e.set(new Uint8Array(A),0),e.set(new Uint8Array(t),A.byteLength),e.buffer}slip_reader(A){let t=0,e=0,i=0,s="init";for(;t<A.length;)if("init"!==s||192!=A[t]){if("valid_data"===s&&192==A[t]){i=t-1,s="packet_complete";break}t++}else e=t+1,s="valid_data",t++;if("packet_complete"!==s)return this.left_over=A,new Uint8Array(0);this.left_over=A.slice(i+2);const a=new Uint8Array(i-e+1);let n=0;for(t=e;t<=i;t++,n++)219!==A[t]||220!==A[t+1]?219!==A[t]||221!==A[t+1]?a[n]=A[t]:(a[n]=219,t++):(a[n]=192,t++);return a.slice(0,n)}async read(A=0,t=12){let e,i=this.left_over;if(this.left_over=new Uint8Array(0),this.slip_reader_enabled){const A=this.slip_reader(i);if(A.length>0)return A;i=this.left_over,this.left_over=new Uint8Array(0)}if(null==this.device.readable)return this.left_over;const s=this.device.readable.getReader();try{A>0&&(e=setTimeout((function(){s.cancel()}),A));do{const{value:A,done:t}=await s.read();if(t)throw this.left_over=i,new Error("Timeout");i=new Uint8Array(this._appendBuffer(i.buffer,A.buffer))}while(i.length<t)}finally{A>0&&clearTimeout(e),s.releaseLock()}return this.slip_reader_enabled?this.slip_reader(i):i}async rawRead(A=0){if(0!=this.left_over.length){const A=this.left_over;return this.left_over=new Uint8Array(0),A}if(!this.device.readable)return this.left_over;const t=this.device.readable.getReader();let e;try{A>0&&(e=setTimeout((function(){t.cancel()}),A));const{value:i,done:s}=await t.read();if(s)throw new Error("Timeout");return i}finally{A>0&&clearTimeout(e),t.releaseLock()}}async setRTS(A){await this.device.setSignals({requestToSend:A}),await this.setDTR(this._DTR_state)}async setDTR(A){this._DTR_state=A,await this.device.setSignals({dataTerminalReady:A})}async connect(A=115200){await this.device.open({baudRate:A}),this.baudrate=A,this.left_over=new Uint8Array(0)}async sleep(A){return new Promise((t=>setTimeout(t,A)))}async waitForUnlock(A){for(;this.device.readable&&this.device.readable.locked||this.device.writable&&this.device.writable.locked;)await this.sleep(A)}async disconnect(){await this.waitForUnlock(400),await this.device.close()}}class ee{get_erase_size(A,t){return t}}var ie=1074521556,se="CAD0PxwA9D8AAPQ/AMD8PxAA9D82QQAh+v/AIAA4AkH5/8AgACgEICB0nOIGBQAAAEH1/4H2/8AgAKgEiAigoHTgCAALImYC54b0/yHx/8AgADkCHfAAAKDr/T8Ya/0/hIAAAEBAAABYq/0/pOv9PzZBALH5/yCgdBARIGXHAJYaBoH2/5KhAZCZEZqYwCAAuAmR8/+goHSaiMAgAJIYAJCQ9BvJwMD0wCAAwlgAmpvAIACiSQDAIACSGACB6v+QkPSAgPSHmUeB5f+SoQGQmRGamMAgAMgJoeX/seP/h5wXxgEAfOiHGt7GCADAIACJCsAgALkJRgIAwCAAuQrAIACJCZHX/5qIDAnAIACSWAAd8AAA+CD0P/gw9D82QQCR/f/AIACICYCAJFZI/5H6/8AgAIgJgIAkVkj/HfAAAAAQIPQ/ACD0PwAAAAg2QQAQESCl/P8h+v8MCMAgAIJiAJH6/4H4/8AgAJJoAMAgAJgIVnn/wCAAiAJ88oAiMCAgBB3wAAAAAEA2QQAQESDl+/8Wav+B7P+R+//AIACSaADAIACYCFZ5/x3wAAAMwPw/////AAQg9D82QQAh/P84QhZTBhARIGX4/xbKBQz4DAQ3qAyYIoCZEAwYkEiDQEB0EBEgZfr/EBEgJfP/iCKh8P9AmBGXOiEMG5CrAcwUgKsBsez/wCAAmQuRzv/AIACpCcAgAKgJVnr/HAkMGkCag5AzwJqIOUKJIh3wACySAEA2QQCioMCB/f/gCAAd8AAANkEAgqDArQKHkhGioNuB9//gCACioNxGBAAAAACCoNuHkgiB8v/gCACioN2B8P/gCAAd8DZBADoyxgIAAKICABsiEBEgpfv/N5LxHfAAAAB82gVA2C4GQJzaBUAc2wVANiEhot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iZwYFr/uAIALgnzQqocYjxoLvAuSegM8C4CKoiqGGYwaq73QQMGrkIwNqDkLvA0OB0zH3S24DQrpMWagGtCYnxmcHJ4RARICWJ/4jxmMHI4ZJoAGFP/Yg2jKPAnzHAmcDWKQBW+PXWrAAxSv0ioMcpU0YAAIw8nAjGgv4WiKBhRf0ioMgpVkZ//gAxQv0ioMkpU0Z8/igjVsKerQSBRf7gCACionHAqhGBPv7gCACBQv7gCADGc/4AACgzFoKcrQSBPP7gCACio+iBNv7gCADgAgBGbP4d8AAAADZBAJ0CgqDAKAOHmQ/MMgwShgcADAIpA3zihg8AJhIHJiIYhgMAAACCoNuAKSOHmSoMIikDfPJGCAAAACKg3CeZCgwSKQMtCAYEAAAAgqDdfPKHmQYMEikDIqDbHfAAAA==",ae=1074520064,ne="GOv8P9TnC0Bt6AtA7+wLQOnoC0CL6AtA6egLQEXpC0AC6gtAdOoLQB3qC0B95wtAn+kLQPTpC0Bj6QtAluoLQIrpC0CW6gtAWegLQK/oC0Dp6AtARekLQHPoC0BI6wtAr+wLQKHmC0DT7AtAoeYLQKHmC0Ch5gtAoeYLQKHmC0Ch5gtAoeYLQKHmC0Dv6gtAoeYLQMnrC0Cv7AtA",re=1073605544;var he=Object.freeze({__proto__:null,ESP32ROM:class extends ee{constructor(){super(...arguments),this.CHIP_NAME="ESP32",this.IMAGE_CHIP_ID=0,this.EFUSE_RD_REG_BASE=1073061888,this.DR_REG_SYSCON_BASE=1073111040,this.UART_CLKDIV_REG=1072955412,this.UART_CLKDIV_MASK=1048575,this.UART_DATE_REG_ADDR=1610612856,this.XTAL_CLK_DIVIDER=1,this.FLASH_SIZES={"1MB":0,"2MB":16,"4MB":32,"8MB":48,"16MB":64},this.FLASH_WRITE_SIZE=1024,this.BOOTLOADER_FLASH_OFFSET=4096,this.SPI_REG_BASE=1072963584,this.SPI_USR_OFFS=28,this.SPI_USR1_OFFS=32,this.SPI_USR2_OFFS=36,this.SPI_W0_OFFS=128,this.SPI_MOSI_DLEN_OFFS=40,this.SPI_MISO_DLEN_OFFS=44,this.TEXT_START=ae,this.ENTRY=ie,this.DATA_START=re,this.ROM_DATA=ne,this.ROM_TEXT=se}async read_efuse(A,t){const e=this.EFUSE_RD_REG_BASE+4*t;return A.debug("Read efuse "+e),await A.read_reg(e)}async get_pkg_version(A){const t=await this.read_efuse(A,3);let e=t>>9&7;return e+=(t>>2&1)<<3,e}async get_chip_revision(A){const t=await this.read_efuse(A,3),e=await this.read_efuse(A,5),i=await A.read_reg(this.DR_REG_SYSCON_BASE+124);return 0!=(t>>15&1)?0!=(e>>20&1)?0!=(i>>31&1)?3:2:1:0}async get_chip_description(A){const t=["ESP32-D0WDQ6","ESP32-D0WD","ESP32-D2WD","","ESP32-U4WDH","ESP32-PICO-D4","ESP32-PICO-V3-02"];let e="";const i=await this.get_pkg_version(A),s=await this.get_chip_revision(A),a=3==s;return 0!=(1&await this.read_efuse(A,3))&&(t[0]="ESP32-S0WDQ6",t[1]="ESP32-S0WD"),a&&(t[5]="ESP32-PICO-V3"),e=i>=0&&i<=6?t[i]:"Unknown ESP32",!a||0!==i&&1!==i||(e+="-V3"),e+" (revision "+s+")"}async get_chip_features(A){const t=["Wi-Fi"],e=await this.read_efuse(A,3);0===(2&e)&&t.push(" BT");0!==(1&e)?t.push(" Single Core"):t.push(" Dual Core");if(0!==(8192&e)){0!==(4096&e)?t.push(" 160MHz"):t.push(" 240MHz")}const i=await this.get_pkg_version(A);-1!==[2,4,5,6].indexOf(i)&&t.push(" Embedded Flash"),6===i&&t.push(" Embedded PSRAM");0!==(await this.read_efuse(A,4)>>8&31)&&t.push(" VRef calibration in efuse");0!==(e>>14&1)&&t.push(" BLK3 partially reserved");const s=3&await this.read_efuse(A,6);return t.push(" Coding Scheme "+["None","3/4","Repeat (UNSUPPORTED)","Invalid"][s]),t}async get_crystal_freq(A){const t=await A.read_reg(this.UART_CLKDIV_REG)&this.UART_CLKDIV_MASK,e=A.transport.baudrate*t/1e6/this.XTAL_CLK_DIVIDER;let i;return i=e>33?40:26,Math.abs(i-e)>1&&A.info("WARNING: Unsupported crystal in use"),i}_d2h(A){const t=(+A).toString(16);return 1===t.length?"0"+t:t}async read_mac(A){let t=await this.read_efuse(A,1);t>>>=0;let e=await this.read_efuse(A,2);e>>>=0;const i=new Uint8Array(6);return i[0]=e>>8&255,i[1]=255&e,i[2]=t>>24&255,i[3]=t>>16&255,i[4]=t>>8&255,i[5]=255&t,this._d2h(i[0])+":"+this._d2h(i[1])+":"+this._d2h(i[2])+":"+this._d2h(i[3])+":"+this._d2h(i[4])+":"+this._d2h(i[5])}}}),oe=1077413538,ge="QREixCbCBsa3NwRgEUc3RMg/2Mu3NARgEwQEANxAkYuR57JAIkSSREEBgoCIQBxAE3X1D4KX3bcBEbcHAGBOxoOphwBKyDdJyD8mylLEBs4izLcEAGB9WhMJCQDATBN09D8N4PJAYkQjqDQBQknSRLJJIkoFYYKAiECDJwkAE3X1D4KXfRTjGUT/yb8TBwAMlEGqh2MY5QCFR4XGI6AFAHlVgoAFR2OH5gAJRmONxgB9VYKAQgUTB7ANQYVjlecCiUecwfW3kwbADWMW1QCYwRMFAAyCgJMG0A19VWOV1wCYwRMFsA2CgLd1yT9BEZOFhboGxmE/Y0UFBrd3yT+ThweyA6cHCAPWRwgTdfUPkwYWAMIGwYIjktcIMpcjAKcAA9dHCJFnk4cHBGMe9wI398g/EwcHsqFnupcDpgcItzbJP7d3yT+Thweyk4YGtmMf5gAjpscII6DXCCOSBwghoPlX4wb1/LJAQQGCgCOm1wgjoOcI3bc3JwBgfEudi/X/NzcAYHxLnYv1/4KAQREGxt03tycAYCOmBwI3BwAImMOYQ33/yFeyQBNF9f8FiUEBgoBBEQbG2T993TcHAEC3JwBgmMM3JwBgHEP9/7JAQQGCgEERIsQ3RMg/kwdEAUrAA6kHAQbGJsJjDQkERTcxyb1HEwREAYFEY9YnAQREvYiTtBQAfTeFPxxENwcAAROWxwBjf+YAtwaAAJngtwYAATcnAGBQwxTDtyYAYJhCff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OEA2CjhAfAo4QKwKOEAECzhASAo4QIwJOEC8CThARAo4QGYOOECsCjhALA04QB4OOEAYCDhARg44QBgIOEAYCDhAGAg4QBgIOEAYCDhAGAg4QBgIOEAYCDhAyAw4QBgIOEBKDThAHg44QA==",we=1070164912;var Ie=Object.freeze({__proto__:null,ESP32C3ROM:class extends ee{constructor(){super(...arguments),this.CHIP_NAME="ESP32-C3",this.IMAGE_CHIP_ID=5,this.EFUSE_BASE=1610647552,this.MAC_EFUSE_REG=this.EFUSE_BASE+68,this.UART_CLKDIV_REG=1072955412,this.UART_CLKDIV_MASK=1048575,this.UART_DATE_REG_ADDR=1610612860,this.FLASH_WRITE_SIZE=1024,this.BOOTLOADER_FLASH_OFFSET=0,this.FLASH_SIZES={"1MB":0,"2MB":16,"4MB":32,"8MB":48,"16MB":64},this.SPI_REG_BASE=1610620928,this.SPI_USR_OFFS=24,this.SPI_USR1_OFFS=28,this.SPI_USR2_OFFS=32,this.SPI_MOSI_DLEN_OFFS=36,this.SPI_MISO_DLEN_OFFS=40,this.SPI_W0_OFFS=88,this.TEXT_START=Ee,this.ENTRY=oe,this.DATA_START=we,this.ROM_DATA=_e,this.ROM_TEXT=ge}async get_pkg_version(A){const t=this.EFUSE_BASE+68+12;return await A.read_reg(t)>>21&7}async get_chip_revision(A){const t=this.EFUSE_BASE+68+12;return(await A.read_reg(t)&7<<18)>>18}async get_chip_description(A){let t;t=0===await this.get_pkg_version(A)?"ESP32-C3":"unknown ESP32-C3";return t+=" (revision "+await this.get_chip_revision(A)+")",t}async get_chip_features(A){return["Wi-Fi"]}async get_crystal_freq(A){return 40}_d2h(A){const t=(+A).toString(16);return 1===t.length?"0"+t:t}async read_mac(A){let t=await A.read_reg(this.MAC_EFUSE_REG);t>>>=0;let e=await A.read_reg(this.MAC_EFUSE_REG+4);e=e>>>0&65535;const i=new Uint8Array(6);return i[0]=e>>8&255,i[1]=255&e,i[2]=t>>24&255,i[3]=t>>16&255,i[4]=t>>8&255,i[5]=255&t,this._d2h(i[0])+":"+this._d2h(i[1])+":"+this._d2h(i[2])+":"+this._d2h(i[3])+":"+this._d2h(i[4])+":"+this._d2h(i[5])}get_erase_size(A,t){return t}}}),le=1082132112,ce="QREixCbCBsa39wBgEUc3BIRA2Mu39ABgEwQEANxAkYuR57JAIkSSREEBgoCIQBxAE3X1D4KX3bcBEbcHAGBOxoOphwBKyDcJhEAmylLEBs4izLcEAGB9WhMJCQDATBN09A8N4PJAYkQjqDQBQknSRLJJIkoFYYKAiECDJwkAE3X1D4KXfRTjGUT/yb8TBwAMlEGqh2MY5QCFR4XGI6AFAHlVgoAFR2OH5gAJRmONxgB9VYKAQgUTB7ANQYVjlecCiUecwfW3kwbADWMW1QCYwRMFAAyCgJMG0A19VWOV1wCYwRMFsA2CgLc1hUBBEZOFRboGxmE/Y0UFBrc3hUCTh8exA6cHCAPWRwgTdfUPkwYWAMIGwYIjktcIMpcjAKcAA9dHCJFnk4cHBGMe9wI3t4RAEwfHsaFnupcDpgcIt/aEQLc3hUCTh8exk4bGtWMf5gAjpscII6DXCCOSBwghoPlX4wb1/LJAQQGCgCOm1wgjoOcI3bc3NwBgfEudi/X/NycAYHxLnYv1/4KAQREGxt03tzcAYCOmBwI3BwAImMOYQ33/yFeyQBNF9f8FiUEBgoBBEQbG2T993TcHAEC3NwBgmMM3NwBgHEP9/7JAQQGCgEERIsQ3BIRAkwcEAUrAA6kHAQbGJsJjCgkERTc5xb1HEwQEAYFEY9YnAQREvYiTtBQAfTeFPxxENwaAABOXxwCZ4DcGAAG39v8AdY+3NgBg2MKQwphCff9BR5HgBUczCelAupcjKCQBHMSyQCJEkkQCSUEBgoABEQbOIswlNzcEzj9sABMFRP+XAID/54Cg8qqHBUWV57JHk/cHID7GiTc3NwBgHEe3BkAAEwVE/9WPHMeyRZcAgP/ngCDwMzWgAPJAYkQFYYKAQRG3B4RABsaThwcBBUcjgOcAE9fFAJjHBWd9F8zDyMf5jTqVqpWxgYzLI6oHAEE3GcETBVAMskBBAY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AnEhjVfAAnERjW/QK7/DP0nXdyEBihpOFiwGX8H//54BgSgHFkwdADNzI3EDil9zA3ESzh4dB3MSX8H//54BASYm+CWUTBQVxA6zLAAOkiwCX8H//54DAObcHAGDYS7cGAAHBFpNXRwESB3WPvYvZj7OHhwMBRbPVhwKX8H//54DgOhMFgD6X8H//54BgNhG2g6ZLAQOmCwGDpcsAA6WLAO/wz//9tIPFOwCDxysAE4WLAaIF3Y3BFe/wr9zZvO/wD8w9v4PHOwADxysAE4yLAaIH2Y8TjQf/BUS3O4VA3ERjBQ0AmcNjTIAAY1AEChMHcAzYyOOfB6iTB5AMYaiTh8u6mEO3t4RAk4fHsZmPPtaDJ4qwtzyEQGrQk4wMAZONy7oFSGNz/QANSELGOsTv8A/FIkcySDcFhEDihXwQk4bKsRAQEwWFApfwf//ngMA1glcDp4ywg6UNADMN/UAdjz6cslcjpOywKoS+lSOgvQCTh8qxnY0BxaFn45L19lqF7/Av0COgbQGZvy3044MHoJMHgAzcyPW6g6eLAOObB57v8K/aCWUTBQVxl/B//+eAICTv8C/Wl/B//+eAYCjRugOkywDjBwSc7/Av2BMFgD6X8H//54DAIe/wz9MClFW67/BP0/ZQZlTWVEZZtlkmWpZaBlv2S2ZM1kxGTbZNCWGCgAAA",Be=1082130432,Ce="HCuEQCoKgEB6CoBA0gqAQHYLgEDiC4BAkAuAQPYIgEAyC4BAcguAQOYKgECmCIBAGguAQKYIgEAECoBASgqAQHoKgEDSCoBAFgqAQFoJgECKCYBAEgqAQDQOgEB6CoBA+gyAQOwNgEDmB4BAFA6AQOYHgEDmB4BA5geAQOYHgEDmB4BA5geAQOYHgEDmB4BAlgyAQOYHgEAYDYBA7A2AQA==",de=1082469292;var De=Object.freeze({__proto__:null,ESP32C6ROM:class extends ee{constructor(){super(...arguments),this.CHIP_NAME="ESP32-C6",this.IMAGE_CHIP_ID=13,this.EFUSE_BASE=1611335680,this.MAC_EFUSE_REG=this.EFUSE_BASE+68,this.UART_CLKDIV_REG=1072955412,this.UART_CLKDIV_MASK=1048575,this.UART_DATE_REG_ADDR=1610612860,this.FLASH_WRITE_SIZE=1024,this.BOOTLOADER_FLASH_OFFSET=0,this.FLASH_SIZES={"1MB":0,"2MB":16,"4MB":32,"8MB":48,"16MB":64},this.SPI_REG_BASE=1610620928,this.SPI_USR_OFFS=24,this.SPI_USR1_OFFS=28,this.SPI_USR2_OFFS=32,this.SPI_MOSI_DLEN_OFFS=36,this.SPI_MISO_DLEN_OFFS=40,this.SPI_W0_OFFS=88,this.TEXT_START=Be,this.ENTRY=le,this.DATA_START=de,this.ROM_DATA=Ce,this.ROM_TEXT=ce}async get_pkg_version(A){const t=this.EFUSE_BASE+68+12;return await A.read_reg(t)>>21&7}async get_chip_revision(A){const t=this.EFUSE_BASE+68+12;return(await A.read_reg(t)&7<<18)>>18}async get_chip_description(A){let t;t=0===await this.get_pkg_version(A)?"ESP32-C6":"unknown ESP32-C6";return t+=" (revision "+await this.get_chip_revision(A)+")",t}async get_chip_features(A){return["Wi-Fi"]}async get_crystal_freq(A){return 40}_d2h(A){const t=(+A).toString(16);return 1===t.length?"0"+t:t}async read_mac(A){let t=await A.read_reg(this.MAC_EFUSE_REG);t>>>=0;let e=await A.read_reg(this.MAC_EFUSE_REG+4);e=e>>>0&65535;const i=new Uint8Array(6);return i[0]=e>>8&255,i[1]=255&e,i[2]=t>>24&255,i[3]=t>>16&255,i[4]=t>>8&255,i[5]=255&t,this._d2h(i[0])+":"+this._d2h(i[1])+":"+this._d2h(i[2])+":"+this._d2h(i[3])+":"+this._d2h(i[4])+":"+this._d2h(i[5])}get_erase_size(A,t){return t}}}),fe=1077381716,Qe="FIADYACAA2BIAMo/BIADYDZBAIH7/wxJwCAAmQjGBAAAgfj/wCAAqAiB9/+goHSICOAIACH2/8AgAIgCJ+jhHfAAAAAIAABgHAAAYBAAAGA2QQAh/P/AIAA4AkH7/8AgACgEICCUnOJB6P9GBAAMODCIAcAgAKgIiASgoHTgCAALImYC6Ib0/yHx/8AgADkC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gAgAGPP4AEBEgpQD/HfAAADZBAJ0CgqDAKAOHmQ/MMgwShgcADAIpA3zihg8AJhIHJiIYhgMAAACCoNuAKSOHmSoMIikDfPJGCAAAACKg3CeZCgwSKQMtCAYEAAAAgqDdfPKHmQYMEikDIqDbHfAAAA==",Me=1077379072,Se="ZCvKP/KNN0DcjjdAqpM3QGePN0D+jjdAZ483QMaPN0CSkDdABZE3QK2QN0B9jTdAKJA3QISQN0DpjzdAKJE3QBKQN0AokTdAyo43QCmPN0BnjzdAxo83QOKON0C+jTdA6JE3QGOTN0CajDdAiZM3QJqMN0CajDdAmow3QJqMN0CajDdAmow3QJqMN0CajDdAgpE3QJqMN0B9kjdAY5M3QA==",ue=1070279676;var pe=Object.freeze({__proto__:null,ESP32S3ROM:class extends ee{constructor(){super(...arguments),this.CHIP_NAME="ESP32-S3",this.IMAGE_CHIP_ID=9,this.EFUSE_BASE=1610641408,this.MAC_EFUSE_REG=this.EFUSE_BASE+68,this.UART_CLKDIV_REG=1610612756,this.UART_CLKDIV_MASK=1048575,this.UART_DATE_REG_ADDR=1610612864,this.FLASH_WRITE_SIZE=1024,this.BOOTLOADER_FLASH_OFFSET=0,this.FLASH_SIZES={"1MB":0,"2MB":16,"4MB":32,"8MB":48,"16MB":64},this.SPI_REG_BASE=1610620928,this.SPI_USR_OFFS=24,this.SPI_USR1_OFFS=28,this.SPI_USR2_OFFS=32,this.SPI_MOSI_DLEN_OFFS=36,this.SPI_MISO_DLEN_OFFS=40,this.SPI_W0_OFFS=88,this.USB_RAM_BLOCK=2048,this.UARTDEV_BUF_NO_USB=3,this.UARTDEV_BUF_NO=1070526796,this.TEXT_START=Me,this.ENTRY=fe,this.DATA_START=ue,this.ROM_DATA=Se,this.ROM_TEXT=Qe}async get_chip_description(A){return"ESP32-S3"}async get_chip_features(A){return["Wi-Fi","BLE"]}async get_crystal_freq(A){return 40}_d2h(A){const t=(+A).toString(16);return 1===t.length?"0"+t:t}async _post_connect(A){const t=255&await A.read_reg(this.UARTDEV_BUF_NO);A.debug("In _post_connect "+t),t==this.UARTDEV_BUF_NO_USB&&(A.ESP_RAM_BLOCK=this.USB_RAM_BLOCK)}async read_mac(A){let t=await A.read_reg(this.MAC_EFUSE_REG);t>>>=0;let e=await A.read_reg(this.MAC_EFUSE_REG+4);e=e>>>0&65535;const i=new Uint8Array(6);return i[0]=e>>8&255,i[1]=255&e,i[2]=t>>24&255,i[3]=t>>16&255,i[4]=t>>8&255,i[5]=255&t,this._d2h(i[0])+":"+this._d2h(i[1])+":"+this._d2h(i[2])+":"+this._d2h(i[3])+":"+this._d2h(i[4])+":"+this._d2h(i[5])}get_erase_size(A,t){return t}}}),me=1073907692,Re="CAAAYBwAAGBIAP0/EAAAYDZBACH7/8AgADgCQfr/wCAAKAQgIJSc4kH4/0YEAAw4MIgBwCAAqAiIBKCgdOAIAAsiZgLohvT/IfH/wCAAOQId8AAA7Cv+P2Sr/T+EgAAAQEAAAKTr/T/wK/4/NkEAsfn/IKB0EBEgJQEBlhoGgfb/kqEBkJkRmpjAIAC4CZHz/6CgdJqIwCAAkhgAkJD0G8nAwPTAIADCWACam8AgAKJJAMAgAJIYAIHq/5CQ9ICA9IeZR4Hl/5KhAZCZEZqYwCAAyAmh5f+x4/+HnBfGAQB86Ica3sYIAMAgAIkKwCAAuQlGAgDAIAC5CsAgAIkJkdf/mogMCcAgAJJYAB3wAABUIEA/VDBAPzZBAJH9/8AgAIgJgIAkVkj/kfr/wCAAiAmAgCRWSP8d8AAAACwgQD8AIEA/AAAACDZBABARIKX8/yH6/wwIwCAAgmIAkfr/gfj/wCAAkmgAwCAAmAhWef/AIACIAnzygCIwICAEHfAAAAAAQDZBABARIOX7/xZq/4Hs/5H7/8AgAJJoAMAgAJgIVnn/HfAAAFgA/T////8ABCBAPzZBACH8/zhCFlMGEBEgZfj/FsoFDPgMBDeoDJgigJkQDBiQSINAQHQQESBl+v8QESAl8/+IIqHw/0CYEZc6IQwbkKsBzBSAqwGx7P/AIACZC5HO/8Ag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AIAMbI/gAA2FPIQ7gzqCMQESBlc/8GxP6yAwMiAwKAuxEguyCyy/CiwxgQESDlPv9Gvf4AACIDA3IDAoAiEXAiIIE7/uAIAHGt/CLC8Ig3gCJjFjKtiBeKgoCMQYYCAInhEBEgZSr/giEOkicEphkEmCeXqOkQESBlIv8Wav+oF80CssMYgSv+4AgAjDoyoMQ5VzgXKjM5Fzg3ICPAKTeBJf7gCAAGoP4AAHIDAiLDGDIDAwwZgDMRcDMgMsPwBiIAcQb+gTr86Ac5keCIwIlBiCYMGYezAQw5kmEN4mEMEBEgZSL/gf79mNHowaH9/d0IvQKZAcLBJPLBEInhgQ/+4AgAuCadCqiRiOGgu8C5JqAzwLgHqiKoQQwMqrsMGrkHkMqDgLvAwNB0VnwAwtuAwK2TnDqtCIJhDpJhDRARIOUt/4jhmNGCZwBRbPx4NYyjkI8xkIjA1igAVjf21qkAMWf8IqDHKVNGAACMOZwHhm3+FjebUWL8IqDIKVUGav4AMV/8IqDJKVMGZ/4AACgjVlKZEBEg5VL/oqJxwKoRgdL94AgAEBEgJTr/geT94AgABl3+AAAoMxbSlhARIGVQ/6Kj6IHJ/eAIABARIKU3/+ACAIZU/gAQESDlNv8d8AAANkEAnQKCoMAoA4eZD8wyDBKGBwAMAikDfOKGDwAmEgcmIhiGAwAAAIKg24ApI4eZKgwiKQN88kYIAAAAIqDcJ5kKDBIpAy0IBgQAAACCoN188oeZBgwSKQMioNsd8AAA",ye=1073905664,ke="ZCv9PzKLAkC9iwJAgpACQEaMAkDfiwJARowCQKWMAkBujQJA4Y0CQImNAkC8igJAB40CQGCNAkDIjAJABI4CQPKMAkAEjgJAq4sCQAqMAkBGjAJApYwCQMOLAkD+igJAw44CQDmQAkDUiQJAYZACQNSJAkDUiQJA1IkCQNSJAkDUiQJA1IkCQNSJAkDUiQJAYI4CQNSJAkBVjwJAOZACQA==",be=1073622012;var Fe=Object.freeze({__proto__:null,ESP32S2ROM:class extends ee{constructor(){super(...arguments),this.CHIP_NAME="ESP32-S2",this.IMAGE_CHIP_ID=2,this.MAC_EFUSE_REG=1061265476,this.EFUSE_BASE=1061265408,this.UART_CLKDIV_REG=1061158932,this.UART_CLKDIV_MASK=1048575,this.UART_DATE_REG_ADDR=1610612856,this.FLASH_WRITE_SIZE=1024,this.BOOTLOADER_FLASH_OFFSET=4096,this.FLASH_SIZES={"1MB":0,"2MB":16,"4MB":32,"8MB":48,"16MB":64},this.SPI_REG_BASE=1061167104,this.SPI_USR_OFFS=24,this.SPI_USR1_OFFS=28,this.SPI_USR2_OFFS=32,this.SPI_W0_OFFS=88,this.SPI_MOSI_DLEN_OFFS=36,this.SPI_MISO_DLEN_OFFS=40,this.TEXT_START=ye,this.ENTRY=me,this.DATA_START=be,this.ROM_DATA=ke,this.ROM_TEXT=Re}async get_pkg_version(A){const t=this.EFUSE_BASE+68+12;return await A.read_reg(t)>>21&15}async get_chip_description(A){const t=["ESP32-S2","ESP32-S2FH16","ESP32-S2FH32"],e=await this.get_pkg_version(A);return e>=0&&e<=2?t[e]:"unknown ESP32-S2"}async get_chip_features(A){const t=["Wi-Fi"],e=await this.get_pkg_version(A);1==e?t.push("Embedded 2MB Flash"):2==e&&t.push("Embedded 4MB Flash");const i=this.EFUSE_BASE+92+16;return 1==(await A.read_reg(i)>>4&7)&&t.push("ADC and temperature sensor calibration in BLK2 of efuse"),t}async get_crystal_freq(A){return 40}_d2h(A){const t=(+A).toString(16);return 1===t.length?"0"+t:t}async read_mac(A){let t=await A.read_reg(this.MAC_EFUSE_REG);t>>>=0;let e=await A.read_reg(this.MAC_EFUSE_REG+4);e=e>>>0&65535;const i=new Uint8Array(6);return i[0]=e>>8&255,i[1]=255&e,i[2]=t>>24&255,i[3]=t>>16&255,i[4]=t>>8&255,i[5]=255&t,this._d2h(i[0])+":"+this._d2h(i[1])+":"+this._d2h(i[2])+":"+this._d2h(i[3])+":"+this._d2h(i[4])+":"+this._d2h(i[5])}get_erase_size(A,t){return t}}}),He=1074843652,Ge="qBAAQAH//0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AAMAAAAEAAAABAAAAAQAAAAEAAAABQAAAAUAAAAFAAAABQAAAAAAAAAAAAAAAAAAABAREgAIBwkGCgULBAwDDQIOAQ8AAQEAAAEAAAAEAAAA",Ye=1073720488;var Ke=Object.freeze({__proto__:null,ESP8266ROM:class extends ee{constructor(){super(...arguments),this.CHIP_NAME="ESP8266",this.CHIP_DETECT_MAGIC_VALUE=[4293968129],this.EFUSE_RD_REG_BASE=1072693328,this.UART_CLKDIV_REG=1610612756,this.UART_CLKDIV_MASK=1048575,this.XTAL_CLK_DIVIDER=2,this.FLASH_WRITE_SIZE=16384,this.BOOTLOADER_FLASH_OFFSET=0,this.UART_DATE_REG_ADDR=0,this.FLASH_SIZES={"512KB":0,"256KB":16,"1MB":32,"2MB":48,"4MB":64,"2MB-c1":80,"4MB-c1":96,"8MB":128,"16MB":144},this.SPI_REG_BASE=1610613248,this.SPI_USR_OFFS=28,this.SPI_USR1_OFFS=32,this.SPI_USR2_OFFS=36,this.SPI_MOSI_DLEN_OFFS=0,this.SPI_MISO_DLEN_OFFS=0,this.SPI_W0_OFFS=64,this.TEXT_START=Pe,this.ENTRY=He,this.DATA_START=Ye,this.ROM_DATA=Te,this.ROM_TEXT=Ge,this.get_chip_features=async A=>{const t=["WiFi"];return"ESP8285"==await this.get_chip_description(A)&&t.push("Embedded Flash"),t}}async read_efuse(A,t){const e=this.EFUSE_RD_REG_BASE+4*t;return A.debug("Read efuse "+e),await A.read_reg(e)}async get_chip_description(A){const t=await this.read_efuse(A,2);return 0!=(16&await this.read_efuse(A,0)|65536&t)?"ESP8285":"ESP8266EX"}async get_crystal_freq(A){const t=await A.read_reg(this.UART_CLKDIV_REG)&this.UART_CLKDIV_MASK,e=A.transport.baudrate*t/1e6/this.XTAL_CLK_DIVIDER;let i;return i=e>33?40:26,Math.abs(i-e)>1&&A.info("WARNING: Detected crystal freq "+e+"MHz is quite different to normalized freq "+i+"MHz. Unsupported crystal in use?"),i}_d2h(A){const t=(+A).toString(16);return 1===t.length?"0"+t:t}async read_mac(A){let t=await this.read_efuse(A,0);t>>>=0;let e=await this.read_efuse(A,1);e>>>=0;let i=await this.read_efuse(A,3);i>>>=0;const s=new Uint8Array(6);return 0!=i?(s[0]=i>>16&255,s[1]=i>>8&255,s[2]=255&i):0==(e>>16&255)?(s[0]=24,s[1]=254,s[2]=52):1==(e>>16&255)?(s[0]=172,s[1]=208,s[2]=116):A.error("Unknown OUI"),s[3]=e>>8&255,s[4]=255&e,s[5]=t>>24&255,this._d2h(s[0])+":"+this._d2h(s[1])+":"+this._d2h(s[2])+":"+this._d2h(s[3])+":"+this._d2h(s[4])+":"+this._d2h(s[5])}get_erase_size(A,t){return t}}});export{Ae as ESPLoader,te as Transport};