@cj-tech-master/excelts 1.5.0 → 1.6.1

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.
Files changed (45) hide show
  1. package/dist/browser/excelts.iife.js +1057 -201
  2. package/dist/browser/excelts.iife.js.map +1 -1
  3. package/dist/browser/excelts.iife.min.js +63 -33
  4. package/dist/cjs/doc/column.js +7 -3
  5. package/dist/cjs/doc/pivot-table.js +149 -61
  6. package/dist/cjs/doc/workbook.js +3 -1
  7. package/dist/cjs/doc/worksheet.js +0 -2
  8. package/dist/cjs/stream/xlsx/worksheet-writer.js +1 -1
  9. package/dist/cjs/utils/unzip/zip-parser.js +2 -5
  10. package/dist/cjs/xlsx/xform/book/workbook-xform.js +3 -0
  11. package/dist/cjs/xlsx/xform/core/content-types-xform.js +19 -14
  12. package/dist/cjs/xlsx/xform/pivot-table/cache-field-xform.js +135 -0
  13. package/dist/cjs/xlsx/xform/pivot-table/cache-field.js +7 -4
  14. package/dist/cjs/xlsx/xform/pivot-table/pivot-cache-definition-xform.js +135 -13
  15. package/dist/cjs/xlsx/xform/pivot-table/pivot-cache-records-xform.js +193 -45
  16. package/dist/cjs/xlsx/xform/pivot-table/pivot-table-xform.js +390 -39
  17. package/dist/cjs/xlsx/xform/sheet/cell-xform.js +6 -0
  18. package/dist/cjs/xlsx/xform/sheet/worksheet-xform.js +14 -3
  19. package/dist/cjs/xlsx/xlsx.js +261 -38
  20. package/dist/esm/doc/column.js +7 -3
  21. package/dist/esm/doc/pivot-table.js +150 -62
  22. package/dist/esm/doc/workbook.js +3 -1
  23. package/dist/esm/doc/worksheet.js +0 -2
  24. package/dist/esm/stream/xlsx/worksheet-writer.js +1 -1
  25. package/dist/esm/utils/unzip/zip-parser.js +2 -5
  26. package/dist/esm/xlsx/xform/book/workbook-xform.js +3 -0
  27. package/dist/esm/xlsx/xform/core/content-types-xform.js +19 -14
  28. package/dist/esm/xlsx/xform/pivot-table/cache-field-xform.js +132 -0
  29. package/dist/esm/xlsx/xform/pivot-table/cache-field.js +7 -4
  30. package/dist/esm/xlsx/xform/pivot-table/pivot-cache-definition-xform.js +135 -13
  31. package/dist/esm/xlsx/xform/pivot-table/pivot-cache-records-xform.js +193 -45
  32. package/dist/esm/xlsx/xform/pivot-table/pivot-table-xform.js +390 -39
  33. package/dist/esm/xlsx/xform/sheet/cell-xform.js +6 -0
  34. package/dist/esm/xlsx/xform/sheet/worksheet-xform.js +14 -3
  35. package/dist/esm/xlsx/xlsx.js +261 -38
  36. package/dist/types/doc/column.d.ts +13 -6
  37. package/dist/types/doc/pivot-table.d.ts +135 -9
  38. package/dist/types/doc/workbook.d.ts +2 -0
  39. package/dist/types/index.d.ts +1 -0
  40. package/dist/types/xlsx/xform/pivot-table/cache-field-xform.d.ts +42 -0
  41. package/dist/types/xlsx/xform/pivot-table/pivot-cache-definition-xform.d.ts +45 -6
  42. package/dist/types/xlsx/xform/pivot-table/pivot-cache-records-xform.d.ts +52 -5
  43. package/dist/types/xlsx/xform/pivot-table/pivot-table-xform.d.ts +98 -5
  44. package/dist/types/xlsx/xlsx.d.ts +27 -0
  45. package/package.json +17 -17
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @cj-tech-master/excelts v1.5.0
2
+ * @cj-tech-master/excelts v1.6.1
3
3
  * TypeScript Excel Workbook Manager - Read and Write xlsx and csv Files.
4
4
  * (c) 2025 cjnoname
5
5
  * Released under the MIT License
@@ -22,8 +22,7 @@ Use Chrome, Firefox or Internet Explorer 11`)}var a=Ve().Buffer,o=global.crypto|
22
22
  `)}})),Ti=c((e=>{var t=e;t.der=Ci(),t.pem=wi()})),Ei=c((e=>{var t=e;t.bignum=Dr(),t.define=pi().define,t.base=_i(),t.constants=yi(),t.decoders=Si(),t.encoders=Ti()})),Di=c(((e,t)=>{var n=Ei(),r=n.define(`Time`,function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),i=n.define(`AttributeTypeValue`,function(){this.seq().obj(this.key(`type`).objid(),this.key(`value`).any())}),a=n.define(`AlgorithmIdentifier`,function(){this.seq().obj(this.key(`algorithm`).objid(),this.key(`parameters`).optional(),this.key(`curve`).objid().optional())}),o=n.define(`SubjectPublicKeyInfo`,function(){this.seq().obj(this.key(`algorithm`).use(a),this.key(`subjectPublicKey`).bitstr())}),s=n.define(`RelativeDistinguishedName`,function(){this.setof(i)}),c=n.define(`RDNSequence`,function(){this.seqof(s)}),l=n.define(`Name`,function(){this.choice({rdnSequence:this.use(c)})}),u=n.define(`Validity`,function(){this.seq().obj(this.key(`notBefore`).use(r),this.key(`notAfter`).use(r))}),d=n.define(`Extension`,function(){this.seq().obj(this.key(`extnID`).objid(),this.key(`critical`).bool().def(!1),this.key(`extnValue`).octstr())}),f=n.define(`TBSCertificate`,function(){this.seq().obj(this.key(`version`).explicit(0).int().optional(),this.key(`serialNumber`).int(),this.key(`signature`).use(a),this.key(`issuer`).use(l),this.key(`validity`).use(u),this.key(`subject`).use(l),this.key(`subjectPublicKeyInfo`).use(o),this.key(`issuerUniqueID`).implicit(1).bitstr().optional(),this.key(`subjectUniqueID`).implicit(2).bitstr().optional(),this.key(`extensions`).explicit(3).seqof(d).optional())});t.exports=n.define(`X509Certificate`,function(){this.seq().obj(this.key(`tbsCertificate`).use(f),this.key(`signatureAlgorithm`).use(a),this.key(`signatureValue`).bitstr())})})),Oi=c((e=>{var t=Ei();e.certificate=Di(),e.RSAPrivateKey=t.define(`RSAPrivateKey`,function(){this.seq().obj(this.key(`version`).int(),this.key(`modulus`).int(),this.key(`publicExponent`).int(),this.key(`privateExponent`).int(),this.key(`prime1`).int(),this.key(`prime2`).int(),this.key(`exponent1`).int(),this.key(`exponent2`).int(),this.key(`coefficient`).int())}),e.RSAPublicKey=t.define(`RSAPublicKey`,function(){this.seq().obj(this.key(`modulus`).int(),this.key(`publicExponent`).int())});var n=t.define(`AlgorithmIdentifier`,function(){this.seq().obj(this.key(`algorithm`).objid(),this.key(`none`).null_().optional(),this.key(`curve`).objid().optional(),this.key(`params`).seq().obj(this.key(`p`).int(),this.key(`q`).int(),this.key(`g`).int()).optional())});e.PublicKey=t.define(`SubjectPublicKeyInfo`,function(){this.seq().obj(this.key(`algorithm`).use(n),this.key(`subjectPublicKey`).bitstr())}),e.PrivateKey=t.define(`PrivateKeyInfo`,function(){this.seq().obj(this.key(`version`).int(),this.key(`algorithm`).use(n),this.key(`subjectPrivateKey`).octstr())}),e.EncryptedPrivateKey=t.define(`EncryptedPrivateKeyInfo`,function(){this.seq().obj(this.key(`algorithm`).seq().obj(this.key(`id`).objid(),this.key(`decrypt`).seq().obj(this.key(`kde`).seq().obj(this.key(`id`).objid(),this.key(`kdeparams`).seq().obj(this.key(`salt`).octstr(),this.key(`iters`).int())),this.key(`cipher`).seq().obj(this.key(`algo`).objid(),this.key(`iv`).octstr()))),this.key(`subjectPrivateKey`).octstr())}),e.DSAPrivateKey=t.define(`DSAPrivateKey`,function(){this.seq().obj(this.key(`version`).int(),this.key(`p`).int(),this.key(`q`).int(),this.key(`g`).int(),this.key(`pub_key`).int(),this.key(`priv_key`).int())}),e.DSAparam=t.define(`DSAparam`,function(){this.int()});var r=t.define(`ECParameters`,function(){this.choice({namedCurve:this.objid()})});e.ECPrivateKey=t.define(`ECPrivateKey`,function(){this.seq().obj(this.key(`version`).int(),this.key(`privateKey`).octstr(),this.key(`parameters`).optional().explicit(0).use(r),this.key(`publicKey`).optional().explicit(1).bitstr())}),e.signature=t.define(`signature`,function(){this.seq().obj(this.key(`r`).int(),this.key(`s`).int())})})),ki=c(((e,t)=>{t.exports={"2.16.840.1.101.3.4.1.1":`aes-128-ecb`,"2.16.840.1.101.3.4.1.2":`aes-128-cbc`,"2.16.840.1.101.3.4.1.3":`aes-128-ofb`,"2.16.840.1.101.3.4.1.4":`aes-128-cfb`,"2.16.840.1.101.3.4.1.21":`aes-192-ecb`,"2.16.840.1.101.3.4.1.22":`aes-192-cbc`,"2.16.840.1.101.3.4.1.23":`aes-192-ofb`,"2.16.840.1.101.3.4.1.24":`aes-192-cfb`,"2.16.840.1.101.3.4.1.41":`aes-256-ecb`,"2.16.840.1.101.3.4.1.42":`aes-256-cbc`,"2.16.840.1.101.3.4.1.43":`aes-256-ofb`,"2.16.840.1.101.3.4.1.44":`aes-256-cfb`}})),Ai=c(((e,t)=>{var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,r=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,a=xr(),o=wr(),s=Ve().Buffer;t.exports=function(e,t){var c=e.toString(),l=c.match(n),u;if(l){var d=`aes`+l[1],f=s.from(l[2],`hex`),p=s.from(l[3].replace(/[\r\n]/g,``),`base64`),m=a(t,f.slice(0,8),parseInt(l[1],10)).key,h=[],g=o.createDecipheriv(d,m,f);h.push(g.update(p)),h.push(g.final()),u=s.concat(h)}else{var _=c.match(i);u=s.from(_[2].replace(/[\r\n]/g,``),`base64`)}return{tag:c.match(r)[1],data:u}}})),ji=c(((e,t)=>{var n=Oi(),r=ki(),i=Ai(),a=wr(),o=Zn().pbkdf2Sync,s=Ve().Buffer;function c(e,t){var n=e.algorithm.decrypt.kde.kdeparams.salt,i=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),c=r[e.algorithm.decrypt.cipher.algo.join(`.`)],l=e.algorithm.decrypt.cipher.iv,u=e.subjectPrivateKey,d=o(t,n,i,parseInt(c.split(`-`)[1],10)/8,`sha1`),f=a.createDecipheriv(c,d,l),p=[];return p.push(f.update(u)),p.push(f.final()),s.concat(p)}function l(e){var t;typeof e==`object`&&!s.isBuffer(e)&&(t=e.passphrase,e=e.key),typeof e==`string`&&(e=s.from(e));var r=i(e,t),a=r.tag,o=r.data,l,u;switch(a){case`CERTIFICATE`:u=n.certificate.decode(o,`der`).tbsCertificate.subjectPublicKeyInfo;case`PUBLIC KEY`:switch(u||=n.PublicKey.decode(o,`der`),l=u.algorithm.algorithm.join(`.`),l){case`1.2.840.113549.1.1.1`:return n.RSAPublicKey.decode(u.subjectPublicKey.data,`der`);case`1.2.840.10045.2.1`:return u.subjectPrivateKey=u.subjectPublicKey,{type:`ec`,data:u};case`1.2.840.10040.4.1`:return u.algorithm.params.pub_key=n.DSAparam.decode(u.subjectPublicKey.data,`der`),{type:`dsa`,data:u.algorithm.params};default:throw Error(`unknown key id `+l)}case`ENCRYPTED PRIVATE KEY`:o=n.EncryptedPrivateKey.decode(o,`der`),o=c(o,t);case`PRIVATE KEY`:switch(u=n.PrivateKey.decode(o,`der`),l=u.algorithm.algorithm.join(`.`),l){case`1.2.840.113549.1.1.1`:return n.RSAPrivateKey.decode(u.subjectPrivateKey,`der`);case`1.2.840.10045.2.1`:return{curve:u.algorithm.curve,privateKey:n.ECPrivateKey.decode(u.subjectPrivateKey,`der`).privateKey};case`1.2.840.10040.4.1`:return u.algorithm.params.priv_key=n.DSAparam.decode(u.subjectPrivateKey,`der`),{type:`dsa`,params:u.algorithm.params};default:throw Error(`unknown key id `+l)}case`RSA PUBLIC KEY`:return n.RSAPublicKey.decode(o,`der`);case`RSA PRIVATE KEY`:return n.RSAPrivateKey.decode(o,`der`);case`DSA PRIVATE KEY`:return{type:`dsa`,params:n.DSAPrivateKey.decode(o,`der`)};case`EC PRIVATE KEY`:return o=n.ECPrivateKey.decode(o,`der`),{curve:o.parameters.value,privateKey:o.privateKey};default:throw Error(`unknown key type `+a)}}l.signature=n.signature,t.exports=l})),Mi=c(((e,t)=>{t.exports={"1.3.132.0.10":`secp256k1`,"1.3.132.0.33":`p224`,"1.2.840.10045.3.1.1":`p192`,"1.2.840.10045.3.1.7":`p256`,"1.3.132.0.34":`p384`,"1.3.132.0.35":`p521`}})),Ni=c(((e,t)=>{var n=Ve().Buffer,r=Un(),i=Fr(),a=di().ec,o=Pr(),s=ji(),c=Mi(),l=1;function u(e,t,r,a,o){var c=s(t);if(c.curve){if(a!==`ecdsa`&&a!==`ecdsa/rsa`)throw Error(`wrong private key type`);return d(e,c)}else if(c.type===`dsa`){if(a!==`dsa`)throw Error(`wrong private key type`);return f(e,c,r)}if(a!==`rsa`&&a!==`ecdsa/rsa`)throw Error(`wrong private key type`);if(t.padding!==void 0&&t.padding!==l)throw Error(`illegal or unsupported padding mode`);e=n.concat([o,e]);for(var u=c.modulus.byteLength(),p=[0,1];e.length+p.length+1<u;)p.push(255);p.push(0);for(var m=-1;++m<e.length;)p.push(e[m]);return i(p,c)}function d(e,t){var r=c[t.curve.join(`.`)];if(!r)throw Error(`unknown curve `+t.curve.join(`.`));var i=new a(r).keyFromPrivate(t.privateKey).sign(e);return n.from(i.toDER())}function f(e,t,n){for(var r=t.params.priv_key,i=t.params.p,a=t.params.q,s=t.params.g,c=new o(0),l,u=h(e,a).mod(a),d=!1,f=m(r,a,e,n);d===!1;)l=_(a,f,n),c=v(s,l,i,a),d=l.invm(a).imul(u.add(r.mul(c))).mod(a),d.cmpn(0)===0&&(d=!1,c=new o(0));return p(c,d)}function p(e,t){e=e.toArray(),t=t.toArray(),e[0]&128&&(e=[0].concat(e)),t[0]&128&&(t=[0].concat(t));var r=[48,e.length+t.length+4,2,e.length];return r=r.concat(e,[2,t.length],t),n.from(r)}function m(e,t,i,a){if(e=n.from(e.toArray()),e.length<t.byteLength()){var o=n.alloc(t.byteLength()-e.length);e=n.concat([o,e])}var s=i.length,c=g(i,t),l=n.alloc(s);l.fill(1);var u=n.alloc(s);return u=r(a,u).update(l).update(n.from([0])).update(e).update(c).digest(),l=r(a,u).update(l).digest(),u=r(a,u).update(l).update(n.from([1])).update(e).update(c).digest(),l=r(a,u).update(l).digest(),{k:u,v:l}}function h(e,t){var n=new o(e),r=(e.length<<3)-t.bitLength();return r>0&&n.ishrn(r),n}function g(e,t){e=h(e,t),e=e.mod(t);var r=n.from(e.toArray());if(r.length<t.byteLength()){var i=n.alloc(t.byteLength()-r.length);r=n.concat([i,r])}return r}function _(e,t,i){var a,o;do{for(a=n.alloc(0);a.length*8<e.bitLength();)t.v=r(i,t.k).update(t.v).digest(),a=n.concat([a,t.v]);o=h(a,e),t.k=r(i,t.k).update(t.v).update(n.from([0])).digest(),t.v=r(i,t.k).update(t.v).digest()}while(o.cmp(e)!==-1);return o}function v(e,t,n,r){return e.toRed(o.mont(n)).redPow(t).fromRed().mod(r)}t.exports=u,t.exports.getKey=m,t.exports.makeKey=_})),Pi=c(((e,t)=>{var n=Ve().Buffer,r=Pr(),i=di().ec,a=ji(),o=Mi();function s(e,t,i,o,s){var u=a(i);if(u.type===`ec`){if(o!==`ecdsa`&&o!==`ecdsa/rsa`)throw Error(`wrong public key type`);return c(e,t,u)}else if(u.type===`dsa`){if(o!==`dsa`)throw Error(`wrong public key type`);return l(e,t,u)}if(o!==`rsa`&&o!==`ecdsa/rsa`)throw Error(`wrong public key type`);t=n.concat([s,t]);for(var d=u.modulus.byteLength(),f=[1],p=0;t.length+f.length+2<d;)f.push(255),p+=1;f.push(0);for(var m=-1;++m<t.length;)f.push(t[m]);f=n.from(f);var h=r.mont(u.modulus);e=new r(e).toRed(h),e=e.redPow(new r(u.publicExponent)),e=n.from(e.fromRed().toArray());var g=p<8?1:0;for(d=Math.min(e.length,f.length),e.length!==f.length&&(g=1),m=-1;++m<d;)g|=e[m]^f[m];return g===0}function c(e,t,n){var r=o[n.data.algorithm.curve.join(`.`)];if(!r)throw Error(`unknown curve `+n.data.algorithm.curve.join(`.`));var a=new i(r),s=n.data.subjectPrivateKey.data;return a.verify(t,e,s)}function l(e,t,n){var i=n.data.p,o=n.data.q,s=n.data.g,c=n.data.pub_key,l=a.signature.decode(e,`der`),d=l.s,f=l.r;u(d,o),u(f,o);var p=r.mont(i),m=d.invm(o);return s.toRed(p).redPow(new r(t).mul(m).mod(o)).fromRed().mul(c.toRed(p).redPow(f.mul(m).mod(o)).fromRed()).mod(i).mod(o).cmp(f)===0}function u(e,t){if(e.cmpn(0)<=0||e.cmp(t)>=0)throw Error(`invalid sig`)}t.exports=s})),Fi=c(((e,t)=>{var n=Ve().Buffer,r=Bn(),i=On(),a=Ue(),o=Ni(),s=Pi(),c=Wn();Object.keys(c).forEach(function(e){c[e].id=n.from(c[e].id,`hex`),c[e.toLowerCase()]=c[e]});function l(e){i.Writable.call(this);var t=c[e];if(!t)throw Error(`Unknown message digest`);this._hashType=t.hash,this._hash=r(t.hash),this._tag=t.id,this._signType=t.sign}a(l,i.Writable),l.prototype._write=function(e,t,n){this._hash.update(e),n()},l.prototype.update=function(e,t){return this._hash.update(typeof e==`string`?n.from(e,t):e),this},l.prototype.sign=function(e,t){this.end();var n=o(this._hash.digest(),e,this._hashType,this._signType,this._tag);return t?n.toString(t):n};function u(e){i.Writable.call(this);var t=c[e];if(!t)throw Error(`Unknown message digest`);this._hash=r(t.hash),this._tag=t.id,this._signType=t.sign}a(u,i.Writable),u.prototype._write=function(e,t,n){this._hash.update(e),n()},u.prototype.update=function(e,t){return this._hash.update(typeof e==`string`?n.from(e,t):e),this},u.prototype.verify=function(e,t,r){var i=typeof t==`string`?n.from(t,r):t;return this.end(),s(i,this._hash.digest(),e,this._signType,this._tag)};function d(e){return new l(e)}function f(e){return new u(e)}t.exports={Sign:d,Verify:f,createSign:d,createVerify:f}})),Ii=c(((e,t)=>{var n=K(),r=di(),i=Dr();t.exports=function(e){return new o(e)};var a={secp256k1:{name:`secp256k1`,byteLength:32},secp224r1:{name:`p224`,byteLength:28},prime256v1:{name:`p256`,byteLength:32},prime192v1:{name:`p192`,byteLength:24},ed25519:{name:`ed25519`,byteLength:32},secp384r1:{name:`p384`,byteLength:48},secp521r1:{name:`p521`,byteLength:66}};a.p224=a.secp224r1,a.p256=a.secp256r1=a.prime256v1,a.p192=a.secp192r1=a.prime192v1,a.p384=a.secp384r1,a.p521=a.secp521r1;function o(e){this.curveType=a[e],this.curveType||={name:e},this.curve=new r.ec(this.curveType.name),this.keys=void 0}o.prototype.generateKeys=function(e,t){return this.keys=this.curve.genKeyPair(),this.getPublicKey(e,t)},o.prototype.computeSecret=function(e,t,r){return t||=`utf8`,n.Buffer.isBuffer(e)||(e=new n.Buffer(e,t)),s(this.curve.keyFromPublic(e).getPublic().mul(this.keys.getPrivate()).getX(),r,this.curveType.byteLength)},o.prototype.getPublicKey=function(e,t){var n=this.keys.getPublic(t===`compressed`,!0);return t===`hybrid`&&(n[n.length-1]%2?n[0]=7:n[0]=6),s(n,e)},o.prototype.getPrivateKey=function(e){return s(this.keys.getPrivate(),e)},o.prototype.setPublicKey=function(e,t){return t||=`utf8`,n.Buffer.isBuffer(e)||(e=new n.Buffer(e,t)),this.keys._importPublic(e),this},o.prototype.setPrivateKey=function(e,t){t||=`utf8`,n.Buffer.isBuffer(e)||(e=new n.Buffer(e,t));var r=new i(e);return r=r.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(r),this};function s(e,t,r){Array.isArray(e)||(e=e.toArray());var i=new n.Buffer(e);if(r&&i.length<r){var a=new n.Buffer(r-i.length);a.fill(0),i=n.Buffer.concat([a,i])}return t?i.toString(t):i}})),Li=c(((e,t)=>{var n=Bn(),r=Ve().Buffer;t.exports=function(e,t){for(var a=r.alloc(0),o=0,s;a.length<t;)s=i(o++),a=r.concat([a,n(`sha1`).update(e).update(s).digest()]);return a.slice(0,t)};function i(e){var t=r.allocUnsafe(4);return t.writeUInt32BE(e,0),t}})),Ri=c(((e,t)=>{t.exports=function(e,t){for(var n=e.length,r=-1;++r<n;)e[r]^=t[r];return e}})),zi=c(((e,t)=>{var n=Dr(),r=Ve().Buffer;function i(e,t){return r.from(e.toRed(n.mont(t.modulus)).redPow(new n(t.publicExponent)).fromRed().toArray())}t.exports=i})),Bi=c(((e,t)=>{var n=ji(),r=He(),i=Bn(),a=Li(),o=Ri(),s=Dr(),c=zi(),l=Fr(),u=Ve().Buffer;t.exports=function(e,t,r){var i=e.padding?e.padding:r?1:4,a=n(e),o;if(i===4)o=d(a,t);else if(i===1)o=f(a,t,r);else if(i===3){if(o=new s(t),o.cmp(a.modulus)>=0)throw Error(`data too long for modulus`)}else throw Error(`unknown padding`);return r?l(o,a):c(o,a)};function d(e,t){var n=e.modulus.byteLength(),c=t.length,l=i(`sha1`).update(u.alloc(0)).digest(),d=l.length,f=2*d;if(c>n-f-2)throw Error(`message too long`);var p=u.alloc(n-c-f-2),m=n-d-1,h=r(d),g=o(u.concat([l,p,u.alloc(1,1),t],m),a(h,m)),_=o(h,a(g,d));return new s(u.concat([u.alloc(1),_,g],n))}function f(e,t,n){var r=t.length,i=e.modulus.byteLength();if(r>i-11)throw Error(`message too long`);var a=n?u.alloc(i-r-3,255):p(i-r-3);return new s(u.concat([u.from([0,n?1:2]),a,u.alloc(1),t],i))}function p(e){for(var t=u.allocUnsafe(e),n=0,i=r(e*2),a=0,o;n<e;)a===i.length&&(i=r(e*2),a=0),o=i[a++],o&&(t[n++]=o);return t}})),Vi=c(((e,t)=>{var n=ji(),r=Li(),i=Ri(),a=Dr(),o=Fr(),s=Bn(),c=zi(),l=Ve().Buffer;t.exports=function(e,t,r){var i=e.padding?e.padding:r?1:4,s=n(e),f=s.modulus.byteLength();if(t.length>f||new a(t).cmp(s.modulus)>=0)throw Error(`decryption error`);var p=r?c(new a(t),s):o(t,s),m=l.alloc(f-p.length);if(p=l.concat([m,p],f),i===4)return u(s,p);if(i===1)return d(s,p,r);if(i===3)return p;throw Error(`unknown padding`)};function u(e,t){var n=e.modulus.byteLength(),a=s(`sha1`).update(l.alloc(0)).digest(),o=a.length;if(t[0]!==0)throw Error(`decryption error`);var c=t.slice(1,o+1),u=t.slice(o+1),d=i(u,r(i(c,r(u,o)),n-o-1));if(f(a,d.slice(0,o)))throw Error(`decryption error`);for(var p=o;d[p]===0;)p++;if(d[p++]!==1)throw Error(`decryption error`);return d.slice(p)}function d(e,t,n){for(var r=t.slice(0,2),i=2,a=0;t[i++]!==0;)if(i>=t.length){a++;break}var o=t.slice(2,i-1);if((r.toString(`hex`)!==`0002`&&!n||r.toString(`hex`)!==`0001`&&n)&&a++,o.length<8&&a++,a)throw Error(`decryption error`);return t.slice(i)}function f(e,t){e=l.from(e),t=l.from(t);var n=0,r=e.length;e.length!==t.length&&(n++,r=Math.min(e.length,t.length));for(var i=-1;++i<r;)n+=e[i]^t[i];return n}})),Hi=c((e=>{e.publicEncrypt=Bi(),e.privateDecrypt=Vi(),e.privateEncrypt=function(t,n){return e.publicEncrypt(t,n,!0)},e.publicDecrypt=function(t,n){return e.privateDecrypt(t,n,!0)}})),Ui=c((e=>{Be();function t(){throw Error(`secure random number generation not supported by this browser
23
23
  use chrome, FireFox or Internet Explorer 11`)}var n=Ve(),r=He(),i=n.Buffer,a=n.kMaxLength,o=global.crypto||global.msCrypto,s=2**32-1;function c(e,t){if(typeof e!=`number`||e!==e)throw TypeError(`offset must be a number`);if(e>s||e<0)throw TypeError(`offset must be a uint32`);if(e>a||e>t)throw RangeError(`offset out of range`)}function l(e,t,n){if(typeof e!=`number`||e!==e)throw TypeError(`size must be a number`);if(e>s||e<0)throw TypeError(`size must be a uint32`);if(e+t>n||e>a)throw RangeError(`buffer too small`)}o&&o.getRandomValues||!Q.browser?(e.randomFill=u,e.randomFillSync=f):(e.randomFill=t,e.randomFillSync=t);function u(e,t,n,r){if(!i.isBuffer(e)&&!(e instanceof global.Uint8Array))throw TypeError(`"buf" argument must be a Buffer or Uint8Array`);if(typeof t==`function`)r=t,t=0,n=e.length;else if(typeof n==`function`)r=n,n=e.length-t;else if(typeof r!=`function`)throw TypeError(`"cb" argument must be a function`);return c(t,e.length),l(n,t,e.length),d(e,t,n,r)}function d(e,t,n,i){if(Q.browser){var a=e.buffer,s=new Uint8Array(a,t,n);if(o.getRandomValues(s),i){Q.nextTick(function(){i(null,e)});return}return e}if(i){r(n,function(n,r){if(n)return i(n);r.copy(e,t),i(null,e)});return}return r(n).copy(e,t),e}function f(e,t,n){if(t===void 0&&(t=0),!i.isBuffer(e)&&!(e instanceof global.Uint8Array))throw TypeError(`"buf" argument must be a Buffer or Uint8Array`);return c(t,e.length),n===void 0&&(n=e.length-t),l(n,t,e.length),d(e,t,n)}})),Wi=c((e=>{e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=He(),e.createHash=e.Hash=Bn(),e.createHmac=e.Hmac=Un();var t=Gn(),n=Object.keys(t),r=[`sha1`,`sha224`,`sha256`,`sha384`,`sha512`,`md5`,`rmd160`].concat(n);e.getHashes=function(){return r};var i=Zn();e.pbkdf2=i.pbkdf2,e.pbkdf2Sync=i.pbkdf2Sync;var a=Er();e.Cipher=a.Cipher,e.createCipher=a.createCipher,e.Cipheriv=a.Cipheriv,e.createCipheriv=a.createCipheriv,e.Decipher=a.Decipher,e.createDecipher=a.createDecipher,e.Decipheriv=a.Decipheriv,e.createDecipheriv=a.createDecipheriv,e.getCiphers=a.getCiphers,e.listCiphers=a.listCiphers;var o=Nr();e.DiffieHellmanGroup=o.DiffieHellmanGroup,e.createDiffieHellmanGroup=o.createDiffieHellmanGroup,e.getDiffieHellman=o.getDiffieHellman,e.createDiffieHellman=o.createDiffieHellman,e.DiffieHellman=o.DiffieHellman;var s=Fi();e.createSign=s.createSign,e.Sign=s.Sign,e.createVerify=s.createVerify,e.Verify=s.Verify,e.createECDH=Ii();var c=Hi();e.publicEncrypt=c.publicEncrypt,e.privateEncrypt=c.privateEncrypt,e.publicDecrypt=c.publicDecrypt,e.privateDecrypt=c.privateDecrypt;var l=Ui();e.randomFill=l.randomFill,e.randomFillSync=l.randomFillSync,e.createCredentials=function(){throw Error(`sorry, createCredentials is not implemented yet
24
24
  we accept pull requests
25
- https://github.com/browserify/crypto-browserify`)},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}})),Gi=K(),Ki=d(Wi(),1);let qi={hash(e,...t){let n=Ki.createHash(e);return n.update(Gi.Buffer.concat(t)),n.digest()},convertPasswordToHash(e,t,n,r){if(t=t.toLowerCase(),Ki.getHashes().indexOf(t)<0)throw Error(`Hash algorithm '${t}' not supported!`);let i=Gi.Buffer.from(e,`utf16le`),a=this.hash(t,Gi.Buffer.from(n,`base64`),i);for(let e=0;e<r;e++){let n=Gi.Buffer.alloc(4);n.writeUInt32LE(e,0),a=this.hash(t,a,n)}return a.toString(`base64`)},randomBytes(e){return Ki.randomBytes(e)}};var Ji=l({default:()=>Yi}),Yi,Xi=s((()=>{Yi=null}));Xi();function Zi(){}let Qi=function(e,t,n,r){e.super_=t,r||(r=n,n=null),n&&Object.keys(n).forEach(t=>{Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))});let i={constructor:{value:e,enumerable:!1,writable:!1,configurable:!0}};r&&Object.keys(r).forEach(e=>{i[e]=Object.getOwnPropertyDescriptor(r,e)}),e.prototype=Object.create(t.prototype,i)};function $i(e,t){return 25569+e.getTime()/(24*3600*1e3)-(t?1462:0)}function ea(e,t){let n=Math.round((e-25569+(t?1462:0))*24*3600*1e3);return new Date(n)}let ta=/[<>&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/;function na(e){let t=ta.exec(e);if(!t)return e;let n=``,r=``,i=0,a=t.index;for(;a<e.length;a++){let t=e.charCodeAt(a);switch(t){case 34:r=`&quot;`;break;case 38:r=`&amp;`;break;case 39:r=`&apos;`;break;case 60:r=`&lt;`;break;case 62:r=`&gt;`;break;case 127:r=``;break;default:if(t<=31&&(t<=8||t>=11&&t!==13)){r=``;break}continue}i!==a&&(n+=e.substring(i,a)),i=a+1,r&&(n+=r)}return i===a?n:n+e.substring(i,a)}function ra(e){return e.replace(/&([a-z]*);/g,e=>{switch(e){case`&lt;`:return`<`;case`&gt;`:return`>`;case`&amp;`:return`&`;case`&apos;`:return`'`;case`&quot;`:return`"`;default:return e}})}function ia(e){let t=parseInt(e,10);return Number.isNaN(t)?0:t}function aa(e){return e?(e=e.replace(/\[[^\]]*]/g,``),e=e.replace(/"[^"]*"/g,``),e.match(/[ymdhMsb]+/)!==null):!1}function oa(e){return new Promise(t=>{Yi.access(e,Yi.constants.F_OK,e=>{t(!e)})})}function sa(e){return e===!0||e===`true`||e===1||e===`1`}function*ca(e,t,n=1){let r=n>0?(e,t)=>e<t:(e,t)=>e>t;for(let i=e;r(i,t);i+=n)yield i}function la(e){let t=Array.from(e);return t.every(e=>Number.isFinite(e))?t.sort((e,t)=>e-t):t.sort()}function ua(e,t=null){return e.reduce((e,n)=>(e[n]=t,e),{})}let da=new TextDecoder(`utf-8`);function fa(e){return typeof e==`string`?e:da.decode(e)}function pa(e,t){ma(e,t);let{sourceSheet:n}=t,{rows:r,columns:i,values:a}=t,o=ha(n,[...r,...i]),s=o.reduce((e,t,n)=>(e[t.name]=n,e),{});return{sourceSheet:n,rows:r.map(e=>s[e]),columns:i.map(e=>s[e]),values:a.map(e=>s[e]),metric:`sum`,cacheFields:o,cacheId:`10`}}function ma(e,t){if(e.workbook.pivotTables.length===1)throw Error(`A pivot table was already added. At this time, ExcelTS supports at most one pivot table per file.`);if(t.metric&&t.metric!==`sum`)throw Error(`Only the "sum" metric is supported at this time.`);let n=ua(t.sourceSheet.getRow(1).values.slice(1),!0);for(let e of[...t.rows,...t.columns,...t.values])if(!n[e])throw Error(`The header name "${e}" was not found in ${t.sourceSheet.name}.`);if(!t.rows.length)throw Error(`No pivot table rows specified.`);if(!t.columns.length)throw Error(`No pivot table columns specified.`);if(t.values.length!==1)throw Error(`Exactly 1 value needs to be specified at this time.`)}function ha(e,t){let n=e.getRow(1).values,r=ua(t,!0),i=t=>{let n=e.getColumn(t).values.splice(2);return la(new Set(n))},a=[];for(let e of ca(1,n.length)){let t=n[e],o=r[t]?i(e):null;a.push({name:t,sharedItems:o})}return a}let ga=(e,t)=>({...e,...t.reduce((t,n)=>(e[n]&&(t[n]={...e[n]}),t),{})}),_a=(e,t,n,r=[])=>{e[n]&&(t[n]=ga(e[n],r))},va=e=>Object.keys(e).length===0,ya=e=>{if(!e)return e;if(va(e))return{};let t={...e};return _a(e,t,`font`,[`color`]),_a(e,t,`alignment`),_a(e,t,`protection`),e.border&&(_a(e,t,`border`),_a(e.border,t.border,`top`,[`color`]),_a(e.border,t.border,`left`,[`color`]),_a(e.border,t.border,`bottom`,[`color`]),_a(e.border,t.border,`right`,[`color`]),_a(e.border,t.border,`diagonal`,[`color`])),e.fill&&(_a(e,t,`fill`,[`fgColor`,`bgColor`,`center`]),e.fill.stops&&(t.fill.stops=e.fill.stops.map(e=>ga(e,[`color`])))),t};var ba=class{constructor(e){e||={},this._workbook=e.workbook,this.id=e.id||0,this.orderNo=e.orderNo||0,this.name=e.name||`sheet${this.id}`,this.state=e.state||`visible`,this._rows=[],this._columns=null,this._keys={},this._merges={},this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},e.properties),this.pageSetup=Object.assign({},{margins:{left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3},orientation:`portrait`,horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!!(e.pageSetup&&(e.pageSetup.fitToWidth||e.pageSetup.fitToHeight)&&!e.pageSetup.scale),pageOrder:`downThenOver`,blackAndWhite:!1,draft:!1,cellComments:`None`,errors:`displayed`,scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,firstPageNumber:void 0,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},e.pageSetup),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},e.headerFooter),this.dataValidations=new de,this.views=e.views||[],this.autoFilter=e.autoFilter||null,this._media=[],this.sheetProtection=null,this.tables={},this.pivotTables=[],this.conditionalFormattings=[]}get name(){return this._name}set name(e){if(e===void 0&&(e=`sheet${this.id}`),this._name!==e){if(typeof e!=`string`)throw Error(`The name has to be a string.`);if(e===``)throw Error(`The name can't be empty.`);if(e===`History`)throw Error(`The name "History" is protected. Please use a different name.`);if(/[*?:/\\[\]]/.test(e))throw Error(`Worksheet name ${e} cannot include any of the following characters: * ? : \\ / [ ]`);if(/(^')|('$)/.test(e))throw Error(`The first or last character of worksheet name cannot be a single quotation mark: ${e}`);if(e&&e.length>31&&(e=e.substring(0,31)),this._workbook.worksheets.find(t=>t&&t.name.toLowerCase()===e.toLowerCase()))throw Error(`Worksheet name already exists: ${e}`);this._name=e}}get workbook(){return this._workbook}destroy(){this._workbook.removeWorksheetEx(this)}get dimensions(){let e=new h;return this._rows.forEach(t=>{if(t){let n=t.dimensions;n&&e.expand(t.number,n.min,t.number,n.max)}}),e}get columns(){return this._columns}set columns(e){this._headerRowCount=e.reduce((e,t)=>{let n=Array.isArray(t.header)?t.header.length:t.header?1:0;return Math.max(e,n)},0);let t=1,n=this._columns=[];e.forEach(e=>{let r=new se(this,t++,!1);n.push(r),r.defn=e})}getColumnKey(e){return this._keys[e]}setColumnKey(e,t){this._keys[e]=t}deleteColumnKey(e){delete this._keys[e]}eachColumnKey(e){Object.keys(this._keys).forEach(t=>e(this._keys[t],t))}getColumn(e){let t;if(typeof e==`string`){let n=this._keys[e];if(n)return n;t=m.l2n(e)}else t=e;if(this._columns||=[],t>this._columns.length){let e=this._columns.length+1;for(;e<=t;)this._columns.push(new se(this,e++))}return this._columns[t-1]}spliceColumns(e,t,...n){let r=this._rows.length;if(n.length>0)for(let i=0;i<r;i++){let r=n.map(e=>e[i]||null);this.getRow(i+1).splice(e,t,...r)}else this._rows.forEach(n=>{n&&n.splice(e,t)});let i=n.length-t,a=e+t,o=this._columns?this._columns.length:0;if(i<0)for(let t=e+n.length;t<=o;t++)this.getColumn(t).defn=this.getColumn(t-i).defn;else if(i>0)for(let e=o;e>=a;e--)this.getColumn(e+i).defn=this.getColumn(e).defn;for(let t=e;t<e+n.length;t++)this.getColumn(t).defn=void 0;this.workbook.definedNames.spliceColumns(this.name,e,t,n.length)}get lastColumn(){return this.getColumn(this.columnCount)}get columnCount(){let e=0;return this.eachRow(t=>{e=Math.max(e,t.cellCount)}),e}get actualColumnCount(){let e=[],t=0;return this.eachRow(n=>{n.eachCell(({col:n})=>{e[n]||(e[n]=!0,t++)})}),t}_commitRow(e){}get _lastRowNumber(){let e=this._rows,t=e.length;for(;t>0&&e[t-1]===void 0;)t--;return t}get _nextRow(){return this._lastRowNumber+1}get lastRow(){if(this._rows.length)return this._rows[this._rows.length-1]}findRow(e){return this._rows[e-1]}findRows(e,t){return this._rows.slice(e-1,e-1+t)}get rowCount(){return this._lastRowNumber}get actualRowCount(){let e=0;return this.eachRow(()=>{e++}),e}getRow(e){let t=this._rows[e-1];return t||=this._rows[e-1]=new oe(this,e),t}getRows(e,t){if(t<1)return;let n=[];for(let r=e;r<e+t;r++)n.push(this.getRow(r));return n}addRow(e,t=`n`){let n=this._nextRow,r=this.getRow(n);return r.values=e,this._setStyleOption(n,t[0]===`i`?t:`n`),r}addRows(e,t=`n`){let n=[];return e.forEach(e=>{n.push(this.addRow(e,t))}),n}insertRow(e,t,n=`n`){return this.spliceRows(e,0,t),this._setStyleOption(e,n),this.getRow(e)}insertRows(e,t,n=`n`){if(this.spliceRows(e,0,...t),n!==`n`)for(let r=0;r<t.length;r++)n[0]===`o`&&this.findRow(t.length+e+r)!==void 0?this._copyStyle(t.length+e+r,e+r,n[1]===`+`):n[0]===`i`&&this.findRow(e-1)!==void 0&&this._copyStyle(e-1,e+r,n[1]===`+`);return this.getRows(e,t.length)}_setStyleOption(e,t=`n`){t[0]===`o`&&this.findRow(e+1)!==void 0?this._copyStyle(e+1,e,t[1]===`+`):t[0]===`i`&&this.findRow(e-1)!==void 0&&this._copyStyle(e-1,e,t[1]===`+`)}_copyStyle(e,t,n=!1){let r=this.getRow(e),i=this.getRow(t);i.style=ya(r.style),r.eachCell({includeEmpty:n},(e,t)=>{i.getCell(t).style=ya(e.style)}),i.height=r.height}duplicateRow(e,t,n=!1){let r=this._rows[e-1],i=Array.from({length:t}).fill(r.values);this.spliceRows(e+1,n?0:t,...i);for(let n=0;n<t;n++){let t=this._rows[e+n];t.style=r.style,t.height=r.height,r.eachCell({includeEmpty:!0},(e,n)=>{t.getCell(n).style=e.style})}}spliceRows(e,t,...n){let r=e+t,i=n.length,a=i-t,o=this._rows.length,s,c;if(a<0)for(e===o&&(this._rows[o-1]=void 0),s=r;s<=o;s++)if(c=this._rows[s-1],c){let e=this.getRow(s+a);e.values=c.values,e.style=c.style,e.height=c.height,c.eachCell({includeEmpty:!0},(t,n)=>{e.getCell(n).style=t.style}),this._rows[s-1]=void 0}else this._rows[s+a-1]=void 0;else if(a>0)for(s=o;s>=r;s--)if(c=this._rows[s-1],c){let e=this.getRow(s+a);e.values=c.values,e.style=c.style,e.height=c.height,c.eachCell({includeEmpty:!0},(t,n)=>{if(e.getCell(n).style=t.style,t.type===S.ValueType.Merge){let e=this.getRow(t.row+i).getCell(n),r=t.master,a=this.getRow(r.row+i).getCell(r.col);e.merge(a)}})}else this._rows[s+a-1]=void 0;for(s=0;s<i;s++){let t=this.getRow(e+s);t.style={},t.values=n[s]}this.workbook.definedNames.spliceRows(this.name,e,t,i)}eachRow(e,t){let n,r;if(typeof e==`function`?r=e:(n=e,r=t),n&&n.includeEmpty){let e=this._rows.length;for(let t=1;t<=e;t++)r(this.getRow(t),t)}else this._rows.forEach(e=>{e&&e.hasValues&&r(e,e.number)})}getSheetValues(){let e=[];return this._rows.forEach(t=>{t&&(e[t.number]=t.values)}),e}findCell(e,t){let n=m.getAddress(e,t),r=this._rows[n.row-1];return r?r.findCell(n.col):void 0}getCell(e,t){let n=m.getAddress(e,t);return this.getRow(n.row).getCellEx(n)}mergeCells(...e){let t=new h(e);this._mergeCellsInternal(t)}mergeCellsWithoutStyle(...e){let t=new h(e);this._mergeCellsInternal(t,!0)}_mergeCellsInternal(e,t){Object.values(this._merges).forEach(t=>{if(t.intersects(e))throw Error(`Cannot merge already merged cells`)});let n=this.getCell(e.top,e.left);for(let r=e.top;r<=e.bottom;r++)for(let i=e.left;i<=e.right;i++)(r>e.top||i>e.left)&&this.getCell(r,i).merge(n,t);this._merges[n.address]=e}_unMergeMaster(e){let t=this._merges[e.address];if(t){for(let e=t.top;e<=t.bottom;e++)for(let n=t.left;n<=t.right;n++)this.getCell(e,n).unmerge();delete this._merges[e.address]}}get hasMerges(){return Object.values(this._merges).some(Boolean)}unMergeCells(...e){let t=new h(e);for(let e=t.top;e<=t.bottom;e++)for(let n=t.left;n<=t.right;n++){let t=this.findCell(e,n);t&&(t.type===S.ValueType.Merge?this._unMergeMaster(t.master):this._merges[t.address]&&this._unMergeMaster(t))}}fillFormula(e,t,n,r=`shared`){let{top:i,left:a,bottom:o,right:s}=m.decode(e),c=s-a+1,l=m.encodeAddress(i,a),u=r===`shared`,d;d=typeof n==`function`?n:Array.isArray(n)?Array.isArray(n[0])?(e,t)=>n[e-i][t-a]:(e,t)=>n[(e-i)*c+(t-a)]:()=>void 0;let f=!0;for(let n=i;n<=o;n++)for(let i=a;i<=s;i++)if(f){let a=this.getCell(n,i);a.value={shareType:r,formula:t,ref:e,result:d(n,i)},f=!1}else this.getCell(n,i).value=u?{sharedFormula:l,result:d(n,i)}:d(n,i)}addImage(e,t){let n={type:`image`,imageId:String(e),range:t};this._media.push(new U(this,n))}getImages(){return this._media.filter(e=>e.type===`image`)}addBackgroundImage(e){let t={type:`background`,imageId:String(e)};this._media.push(new U(this,t))}getBackgroundImageId(){let e=this._media.find(e=>e.type===`background`);return e&&e.imageId}protect(e,t){return new Promise(n=>{this.sheetProtection={sheet:!0},t&&`spinCount`in t&&(t.spinCount=Number.isFinite(t.spinCount)?Math.round(Math.max(0,t.spinCount)):1e5),e&&(this.sheetProtection.algorithmName=`SHA-512`,this.sheetProtection.saltValue=qi.randomBytes(16).toString(`base64`),this.sheetProtection.spinCount=t&&`spinCount`in t?t.spinCount:1e5,this.sheetProtection.hashValue=qi.convertPasswordToHash(e,`SHA512`,this.sheetProtection.saltValue,this.sheetProtection.spinCount)),t&&(this.sheetProtection=Object.assign(this.sheetProtection,t),!e&&`spinCount`in t&&delete this.sheetProtection.spinCount),n()})}unprotect(){this.sheetProtection=null}addTable(e){let t=new ue(this,e);return this.tables[e.name]=t,t}getTable(e){return this.tables[e]}removeTable(e){delete this.tables[e]}getTables(){return Object.values(this.tables)}addPivotTable(e){console.warn(`Warning: Pivot Table support is experimental.
26
- Please leave feedback at https://github.com/excelts/excelts/discussions/2575`);let t=pa(this,e);return this.pivotTables.push(t),this.workbook.pivotTables.push(t),t}addConditionalFormatting(e){this.conditionalFormattings.push(e)}removeConditionalFormatting(e){typeof e==`number`?this.conditionalFormattings.splice(e,1):e instanceof Function?this.conditionalFormattings=this.conditionalFormattings.filter(e):this.conditionalFormattings=[]}get model(){let e={id:this.id,name:this.name,dataValidations:this.dataValidations.model,properties:this.properties,state:this.state,pageSetup:this.pageSetup,headerFooter:this.headerFooter,rowBreaks:this.rowBreaks,views:this.views,autoFilter:this.autoFilter,media:this._media.map(e=>e.model),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map(e=>e.model),pivotTables:this.pivotTables,conditionalFormattings:this.conditionalFormattings};e.cols=se.toModel(this.columns||[]);let t=e.rows=[],n=e.dimensions=new h;return this._rows.forEach(e=>{let r=e&&e.model;r&&(n.expand(r.number,r.min,r.number,r.max),t.push(r))}),e.merges=[],Object.values(this._merges).forEach(t=>{e.merges.push(t.range)}),e}_parseRows(e){this._rows=[],e.rows&&e.rows.forEach(e=>{let t=new oe(this,e.number);this._rows[t.number-1]=t,t.model=e})}_parseMergeCells(e){e.mergeCells&&e.mergeCells.forEach(e=>{this.mergeCellsWithoutStyle(e)})}set model(e){this.name=e.name,this._columns=se.fromModel(this,e.cols),this._parseRows(e),this._parseMergeCells(e),this.dataValidations=new de(e.dataValidations),this.properties=e.properties,this.pageSetup=e.pageSetup,this.headerFooter=e.headerFooter,this.views=e.views,this.autoFilter=e.autoFilter,this._media=e.media.map(e=>new U(this,e)),this.sheetProtection=e.sheetProtection,this.tables=e.tables.reduce((e,t)=>{let n=new ue(this,t);return n.model=t,e[t.name]=n,e},{}),this.pivotTables=e.pivotTables,this.conditionalFormattings=e.conditionalFormattings}};function xa(e){return typeof e==`number`?!0:e!==`__proto__`&&e!==`constructor`&&e!==`prototype`}function Sa(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return e.map(e=>Sa(e));let t={};for(let n of Object.keys(e))xa(n)&&(t[n]=Sa(e[n]));return t}var Ca=class{constructor(e){this.template=e,this.sheets={}}addCell(e){this.addCellEx(m.decodeEx(e))}getCell(e){return this.findCellEx(m.decodeEx(e),!0)}findCell(e){return this.findCellEx(m.decodeEx(e),!1)}findCellAt(e,t,n){let r=this.sheets[e],i=r&&r[t];return i&&i[n]}addCellEx(e){if(e.top!==void 0)for(let t=e.top;t<=e.bottom;t++)for(let n=e.left;n<=e.right;n++)this.getCellAt(e.sheetName,t,n);else this.findCellEx(e,!0)}getCellEx(e){return this.findCellEx(e,!0)}findCellEx(e,t){let n=this.findSheet(e,t),r=this.findSheetRow(n,e,t);return this.findRowCell(r,e,t)}getCellAt(e,t,n){if(!xa(e))throw Error(`Invalid sheet name: ${e}`);let r=this.sheets[e]||(this.sheets[e]=[]),i=r[t]||(r[t]=[]);return i[n]||(i[n]={sheetName:e,address:m.n2l(n)+t,row:t,col:n})}removeCellEx(e){let t=this.findSheet(e,!1);if(!t)return;let n=this.findSheetRow(t,e,!1);n&&delete n[e.col]}forEachInSheet(e,t){let n=this.sheets[e];n&&n.forEach((e,n)=>{e&&e.forEach((e,r)=>{e&&t(e,n,r)})})}forEach(e){Object.keys(this.sheets).forEach(t=>{this.forEachInSheet(t,e)})}map(e){let t=[];return this.forEach(n=>{t.push(e(n))}),t}findSheet(e,t){let n=e.sheetName;if(!xa(n))throw Error(`Invalid sheet name: ${n}`);if(Object.prototype.hasOwnProperty.call(this.sheets,n))return this.sheets[n];if(t)return this.sheets[n]=[]}findSheetRow(e,t,n){let{row:r}=t;if(!xa(r))throw Error(`Invalid row: ${r}`);if(e&&e[r])return e[r];if(n)return e[r]=[]}findRowCell(e,t,n){let{col:r}=t;if(!xa(r))throw Error(`Invalid column: ${r}`);if(e&&e[r])return e[r];if(n)return e[r]=this.template?{...t,...Sa(this.template)}:t}spliceRows(e,t,n,r){let i=this.sheets[e];if(i){let e=[];for(let t=0;t<r;t++)e.push([]);i.splice(t,n,...e)}}spliceColumns(e,t,n,r){let i=this.sheets[e];if(i){let e=[];for(let t=0;t<r;t++)e.push(null);Object.values(i).forEach(r=>{r.splice(t,n,...e)})}}};let wa=/[$](\w+)[$](\d+)(:[$](\w+)[$](\d+))?/;var Ta=class{constructor(){this.matrixMap={}}getMatrix(e){return this.matrixMap[e]||(this.matrixMap[e]=new Ca)}add(e,t){let n=m.decodeEx(e);`error`in n||this.addEx(n,t)}addEx(e,t){let n=this.getMatrix(t);if(`top`in e)for(let t=e.left;t<=e.right;t++)for(let r=e.top;r<=e.bottom;r++){let i={sheetName:e.sheetName,address:m.n2l(t)+r,row:r,col:t};n.addCellEx(i)}else n.addCellEx(e)}remove(e,t){let n=m.decodeEx(e);`error`in n||this.removeEx(n,t)}removeEx(e,t){let n=this.getMatrix(t);if(`top`in e)for(let t=e.left;t<=e.right;t++)for(let r=e.top;r<=e.bottom;r++)n.removeCellEx({sheetName:e.sheetName,address:m.n2l(t)+r,row:r,col:t});else n.removeCellEx(e)}removeAllNames(e){Object.values(this.matrixMap).forEach(t=>{if(`top`in e)for(let n=e.left;n<=e.right;n++)for(let r=e.top;r<=e.bottom;r++)t.removeCellEx({sheetName:e.sheetName,address:m.n2l(n)+r,row:r,col:n});else t.removeCellEx(e)})}forEach(e){Object.entries(this.matrixMap).forEach(([t,n])=>{n.forEach(n=>{e(t,n)})})}getNames(e){let t=m.decodeEx(e);return`error`in t||`top`in t?[]:this.getNamesEx(t)}getNamesEx(e){return Object.entries(this.matrixMap).map(([t,n])=>n.findCellEx(e,!1)&&t).filter(e=>!!e)}_explore(e,t){t.mark=!1;let{sheetName:n}=t,r=new h(t.row,t.col,t.row,t.col,n),i,a,o=(t,r)=>e.findCellAt(n,t,r);function s(e,n){let i=o(e,t.col);return!i||!i.mark?!1:(r[n]=e,i.mark=!1,!0)}for(a=t.row-1;s(a,`top`);a--);for(a=t.row+1;s(a,`bottom`);a++);function c(e,t){let n=[];for(a=r.top;a<=r.bottom;a++){let t=o(a,e);if(t&&t.mark)n.push(t);else return!1}r[t]=e;for(let e=0;e<n.length;e++)n[e].mark=!1;return!0}for(i=t.col-1;c(i,`left`);i--);for(i=t.col+1;c(i,`right`);i++);return r}getRanges(e,t){return t||=this.matrixMap[e],t?(t.forEach(e=>{e.mark=!0}),{name:e,ranges:t.map(e=>e.mark&&this._explore(t,e)).filter(Boolean).map(e=>e.$shortRange)}):{name:e,ranges:[]}}normaliseMatrix(e,t){e.forEachInSheet(t,(e,t,n)=>{e&&(e.row!==t||e.col!==n)&&(e.row=t,e.col=n,e.address=m.n2l(n)+t)})}spliceRows(e,t,n,r){Object.values(this.matrixMap).forEach(i=>{i.spliceRows(e,t,n,r),this.normaliseMatrix(i,e)})}spliceColumns(e,t,n,r){Object.values(this.matrixMap).forEach(i=>{i.spliceColumns(e,t,n,r),this.normaliseMatrix(i,e)})}get model(){return Object.entries(this.matrixMap).map(([e,t])=>this.getRanges(e,t)).filter(e=>e.ranges.length)}set model(e){let t=this.matrixMap={};e.forEach(e=>{let n=t[e.name]=new Ca;e.ranges.forEach(e=>{wa.test(e.split(`!`).pop()||``)&&n.addCell(e)})})}},Ea=Uint8Array,Da=Uint16Array,Oa=Int32Array,ka=new Ea([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,0,0,0]),Aa=new Ea([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,0,0]),ja=new Ea([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ma=function(e,t){for(var n=new Da(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new Oa(n[30]),r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return{b:n,r:i}},Na=Ma(ka,2),Pa=Na.b,Fa=Na.r;Pa[28]=258,Fa[258]=28;var Ia=Ma(Aa,0),La=Ia.b;Ia.r;for(var Ra=new Da(32768),za=0;za<32768;++za){var Ba=(za&43690)>>1|(za&21845)<<1;Ba=(Ba&52428)>>2|(Ba&13107)<<2,Ba=(Ba&61680)>>4|(Ba&3855)<<4,Ra[za]=((Ba&65280)>>8|(Ba&255)<<8)>>1}for(var Va=(function(e,t,n){for(var r=e.length,i=0,a=new Da(t);i<r;++i)e[i]&&++a[e[i]-1];var o=new Da(t);for(i=1;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(n){s=new Da(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=o[e[i]-1]++<<u,f=d|(1<<u)-1;d<=f;++d)s[Ra[d]>>c]=l}else for(s=new Da(r),i=0;i<r;++i)e[i]&&(s[i]=Ra[o[e[i]-1]++]>>15-e[i]);return s}),Ha=new Ea(288),za=0;za<144;++za)Ha[za]=8;for(var za=144;za<256;++za)Ha[za]=9;for(var za=256;za<280;++za)Ha[za]=7;for(var za=280;za<288;++za)Ha[za]=8;for(var Ua=new Ea(32),za=0;za<32;++za)Ua[za]=5;var Wa=Va(Ha,9,1),Ga=Va(Ua,5,1),Ka=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},qa=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},Ja=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},Ya=function(e){return(e+7)/8|0},Xa=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new Ea(e.subarray(t,n))},Za=[`unexpected EOF`,`invalid block type`,`invalid length/literal`,`invalid distance`,`stream finished`,`no stream handler`,,`no callback`,`invalid UTF-8 data`,`extra field too long`,`date not in range 1980-2099`,`filename too long`,`stream finishing`,`invalid zip data`],Qa=function(e,t,n){var r=Error(t||Za[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,Qa),!n)throw r;return r},$a=function(e,t,n,r){var i=e.length,a=r?r.length:0;if(!i||t.f&&!t.l)return n||new Ea(0);var o=!n,s=o||t.i!=2,c=t.i;o&&(n=new Ea(i*3));var l=function(e){var t=n.length;if(e>t){var r=new Ea(Math.max(t*2,e));r.set(n),n=r}},u=t.f||0,d=t.p||0,f=t.b||0,p=t.l,m=t.d,h=t.m,g=t.n,_=i*8;do{if(!p){u=qa(e,d,1);var v=qa(e,d+1,3);if(d+=3,v)if(v==1)p=Wa,m=Ga,h=9,g=5;else if(v==2){var y=qa(e,d,31)+257,b=qa(e,d+10,15)+4,x=y+qa(e,d+5,31)+1;d+=14;for(var S=new Ea(x),C=new Ea(19),w=0;w<b;++w)C[ja[w]]=qa(e,d+w*3,7);d+=b*3;for(var T=Ka(C),E=(1<<T)-1,D=Va(C,T,1),w=0;w<x;){var O=D[qa(e,d,E)];d+=O&15;var k=O>>4;if(k<16)S[w++]=k;else{var A=0,ee=0;for(k==16?(ee=3+qa(e,d,3),d+=2,A=S[w-1]):k==17?(ee=3+qa(e,d,7),d+=3):k==18&&(ee=11+qa(e,d,127),d+=7);ee--;)S[w++]=A}}var j=S.subarray(0,y),M=S.subarray(y);h=Ka(j),g=Ka(M),p=Va(j,h,1),m=Va(M,g,1)}else Qa(1);else{var k=Ya(d)+4,N=e[k-4]|e[k-3]<<8,P=k+N;if(P>i){c&&Qa(0);break}s&&l(f+N),n.set(e.subarray(k,P),f),t.b=f+=N,t.p=d=P*8,t.f=u;continue}if(d>_){c&&Qa(0);break}}s&&l(f+131072);for(var F=(1<<h)-1,te=(1<<g)-1,I=d;;I=d){var A=p[Ja(e,d)&F],L=A>>4;if(d+=A&15,d>_){c&&Qa(0);break}if(A||Qa(2),L<256)n[f++]=L;else if(L==256){I=d,p=null;break}else{var ne=L-254;if(L>264){var w=L-257,R=ka[w];ne=qa(e,d,(1<<R)-1)+Pa[w],d+=R}var z=m[Ja(e,d)&te],re=z>>4;z||Qa(3),d+=z&15;var M=La[re];if(re>3){var R=Aa[re];M+=Ja(e,d)&(1<<R)-1,d+=R}if(d>_){c&&Qa(0);break}s&&l(f+131072);var B=f+ne;if(f<M){var V=a-M,ie=Math.min(M,B);for(V+f<0&&Qa(3);f<ie;++f)n[f]=r[V+f]}for(;f<B;++f)n[f]=n[f-M]}}t.l=p,t.p=I,t.b=f,t.f=u,p&&(u=1,t.m=h,t.d=m,t.n=g)}while(!u);return f!=n.length&&o?Xa(n,0,f):n.subarray(0,f)},eo=new Ea(0),to=function(e,t){return e[t]|e[t+1]<<8},no=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},ro=function(e,t){return no(e,t)+no(e,t+4)*4294967296},io=function(){function e(e,t){typeof e==`function`&&(t=e,e={}),this.ondata=t;var n=e&&e.dictionary&&e.dictionary.subarray(-32768);this.s={i:0,b:n?n.length:0},this.o=new Ea(32768),this.p=new Ea(0),n&&this.o.set(n)}return e.prototype.e=function(e){if(this.ondata||Qa(5),this.d&&Qa(4),!this.p.length)this.p=e;else if(e.length){var t=new Ea(this.p.length+e.length);t.set(this.p),t.set(e,this.p.length),this.p=t}},e.prototype.c=function(e){this.s.i=+(this.d=e||!1);var t=this.s.b,n=$a(this.p,this.s,this.o);this.ondata(Xa(n,t,this.s.b),this.d),this.o=Xa(n,this.s.b-32768),this.s.b=this.o.length,this.p=Xa(this.p,this.s.p/8|0),this.s.p&=7},e.prototype.push=function(e,t){this.e(e),this.c(t)},e}(),ao=typeof TextDecoder<`u`&&new TextDecoder;try{ao.decode(eo,{stream:!0})}catch{}var oo=function(e){for(var t=``,n=0;;){var r=e[n++],i=(r>127)+(r>223)+(r>239);if(n+i>e.length)return{s:t,r:Xa(e,n-1)};i?i==3?(r=((r&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?t+=String.fromCharCode((r&31)<<6|e[n++]&63):t+=String.fromCharCode((r&15)<<12|(e[n++]&63)<<6|e[n++]&63):t+=String.fromCharCode(r)}};function so(e,t){if(t){for(var n=``,r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}else if(ao)return ao.decode(e);else{var i=oo(e),a=i.s,n=i.r;return n.length&&Qa(8),a}}var co=function(e,t){for(;to(e,t)!=1;t+=4+to(e,t+2));return[ro(e,t+12),ro(e,t+4),ro(e,t+20)]},lo=function(){function e(){}return e.prototype.push=function(e,t){this.ondata(null,e,t)},e.compression=0,e}(),uo=function(){function e(){var e=this;this.i=new io(function(t,n){e.ondata(null,t,n)})}return e.prototype.push=function(e,t){try{this.i.push(e,t)}catch(e){this.ondata(e,null,t)}},e.compression=8,e}(),fo=function(){function e(e){this.onfile=e,this.k=[],this.o={0:lo},this.p=eo}return e.prototype.push=function(e,t){var n=this;if(this.onfile||Qa(5),this.p||Qa(4),this.c>0){var r=Math.min(this.c,e.length),i=e.subarray(0,r);if(this.c-=r,this.d?this.d.push(i,!this.c):this.k[0].push(i),e=e.subarray(r),e.length)return this.push(e,t)}else{var a=0,o=0,s=void 0,c=void 0;this.p.length?e.length?(c=new Ea(this.p.length+e.length),c.set(this.p),c.set(e,this.p.length)):c=this.p:c=e;for(var l=c.length,u=this.c,d=u&&this.d,f=function(){var e,t=no(c,o);if(t==67324752){a=1,s=o,p.d=null,p.c=0;var r=to(c,o+6),i=to(c,o+8),d=r&2048,f=r&8,m=to(c,o+26),h=to(c,o+28);if(l>o+30+m+h){var g=[];p.k.unshift(g),a=2;var _=no(c,o+18),v=no(c,o+22),y=so(c.subarray(o+30,o+=30+m),!d);_==4294967295?(e=f?[-2]:co(c,o),_=e[0],v=e[1]):f&&(_=-1),o+=h,p.c=_;var b,x={name:y,compression:i,start:function(){if(x.ondata||Qa(5),!_)x.ondata(null,eo,!0);else{var e=n.o[i];e||x.ondata(Qa(14,`unknown compression type `+i,1),null,!1),b=_<0?new e(y):new e(y,_,v),b.ondata=function(e,t,n){x.ondata(e,t,n)};for(var t=0,r=g;t<r.length;t++){var a=r[t];b.push(a,!1)}n.k[0]==g&&n.c?n.d=b:b.push(eo,!0)}},terminate:function(){b&&b.terminate&&b.terminate()}};_>=0&&(x.size=_,x.originalSize=v),p.onfile(x)}return`break`}else if(u){if(t==134695760)return s=o+=12+(u==-2&&8),a=3,p.c=0,`break`;if(t==33639248)return s=o-=4,a=3,p.c=0,`break`}},p=this;o<l-4&&f()!==`break`;++o);if(this.p=eo,u<0){var m=a?c.subarray(0,s-12-(u==-2&&8)-(no(c,s-16)==134695760&&4)):c.subarray(0,o);d?d.push(m,!!a):this.k[+(a==2)].push(m)}if(a&2)return this.push(c.subarray(o),t);this.p=c.subarray(o)}t&&(this.c&&Qa(13),this.p=null)},e.prototype.register=function(e){this.o[e.compression]=e},e}(),po=c(((e,t)=>{function n(e){"@babel/helpers - typeof";return n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function a(e){var t=o(e,`string`);return n(t)===`symbol`?t:String(t)}function o(e,t){if(n(e)!==`object`||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||`default`);if(n(i)!==`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function s(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function c(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,`prototype`,{writable:!1}),t&&l(e,t)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}function u(e){var t=p();return function(){var n=m(e),r;if(t){var i=m(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}function d(e,t){if(t&&(n(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return f(e)}function f(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function p(){if(typeof Reflect>`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}var h={},g,_;function v(e,t,n){n||=Error;function r(e,n,r){return typeof t==`string`?t:t(e,n,r)}h[e]=function(t){c(a,t);var n=u(a);function a(t,i,o){var c;return s(this,a),c=n.call(this,r(t,i,o)),c.code=e,c}return i(a)}(n)}function y(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map(function(e){return String(e)}),n>2?`one of ${t} ${e.slice(0,n-1).join(`, `)}, or `+e[n-1]:n===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}else return`of ${t} ${String(e)}`}function b(e,t,n){return e.substr(!n||n<0?0:+n,t.length)===t}function x(e,t,n){return(n===void 0||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}function S(e,t,n){return typeof n!=`number`&&(n=0),n+t.length>e.length?!1:e.indexOf(t,n)!==-1}v(`ERR_AMBIGUOUS_ARGUMENT`,`The "%s" argument is ambiguous. %s`,TypeError),v(`ERR_INVALID_ARG_TYPE`,function(e,t,r){g===void 0&&(g=jo()),g(typeof e==`string`,`'name' must be a string`);var i;typeof t==`string`&&b(t,`not `)?(i=`must not be`,t=t.replace(/^not /,``)):i=`must be`;var a=x(e,` argument`)?`The ${e} ${i} ${y(t,`type`)}`:`The "${e}" ${S(e,`.`)?`property`:`argument`} ${i} ${y(t,`type`)}`;return a+=`. Received type ${n(r)}`,a},TypeError),v(`ERR_INVALID_ARG_VALUE`,function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`is invalid`;_===void 0&&(_=Kt());var r=_.inspect(t);return r.length>128&&(r=`${r.slice(0,128)}...`),`The argument '${e}' ${n}. Received ${r}`},TypeError,RangeError),v(`ERR_INVALID_RETURN_VALUE`,function(e,t,r){return`Expected ${e} to be returned from the "${t}" function but got ${r&&r.constructor&&r.constructor.name?`instance of ${r.constructor.name}`:`type ${n(r)}`}.`},TypeError),v(`ERR_MISSING_ARGS`,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];g===void 0&&(g=jo()),g(t.length>0,`At least one arg needs to be specified`);var r=`The `,i=t.length;switch(t=t.map(function(e){return`"${e}"`}),i){case 1:r+=`${t[0]} argument`;break;case 2:r+=`${t[0]} and ${t[1]} arguments`;break;default:r+=t.slice(0,i-1).join(`, `),r+=`, and ${t[i-1]} arguments`;break}return`${r} must be specified`},TypeError),t.exports.codes=h})),mo=c(((e,t)=>{Be();function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function r(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]==null?{}:arguments[t];t%2?n(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function i(e,t,n){return t=c(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function s(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function c(e){var t=l(e,`string`);return b(t)===`symbol`?t:String(t)}function l(e,t){if(b(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(b(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function u(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,`prototype`,{writable:!1}),t&&v(e,t)}function d(e){var t=g();return function(){var n=y(e),r;if(t){var i=y(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return f(this,r)}}function f(e,t){if(t&&(b(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return p(e)}function p(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function m(e){var t=typeof Map==`function`?new Map:void 0;return m=function(e){if(e===null||!_(e))return e;if(typeof e!=`function`)throw TypeError(`Super expression must either be null or a function`);if(t!==void 0){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return h(e,arguments,y(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),v(n,e)},m(e)}function h(e,t,n){return h=g()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&v(i,n.prototype),i},h.apply(null,arguments)}function g(){if(typeof Reflect>`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _(e){return Function.toString.call(e).indexOf(`[native code]`)!==-1}function v(e,t){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},v(e,t)}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function b(e){"@babel/helpers - typeof";return b=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},b(e)}var x=Kt().inspect,S=po().codes.ERR_INVALID_ARG_TYPE;function C(e,t,n){return(n===void 0||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}function w(e,t){if(t=Math.floor(t),e.length==0||t==0)return``;var n=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+=e.substring(0,n-e.length),e}var T=``,E=``,D=``,O=``,k={deepStrictEqual:`Expected values to be strictly deep-equal:`,strictEqual:`Expected values to be strictly equal:`,strictEqualObject:`Expected "actual" to be reference-equal to "expected":`,deepEqual:`Expected values to be loosely deep-equal:`,equal:`Expected values to be loosely equal:`,notDeepStrictEqual:`Expected "actual" not to be strictly deep-equal to:`,notStrictEqual:`Expected "actual" to be strictly unequal to:`,notStrictEqualObject:`Expected "actual" not to be reference-equal to "expected":`,notDeepEqual:`Expected "actual" not to be loosely deep-equal to:`,notEqual:`Expected "actual" to be loosely unequal to:`,notIdentical:`Values identical but not reference-equal:`},A=10;function ee(e){var t=Object.keys(e),n=Object.create(Object.getPrototypeOf(e));return t.forEach(function(t){n[t]=e[t]}),Object.defineProperty(n,`message`,{value:e.message}),n}function j(e){return x(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(e,t,n){var r=``,i=``,a=0,o=``,s=!1,c=j(e),l=c.split(`
25
+ https://github.com/browserify/crypto-browserify`)},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}})),Gi=K(),Ki=d(Wi(),1);let qi={hash(e,...t){let n=Ki.createHash(e);return n.update(Gi.Buffer.concat(t)),n.digest()},convertPasswordToHash(e,t,n,r){if(t=t.toLowerCase(),Ki.getHashes().indexOf(t)<0)throw Error(`Hash algorithm '${t}' not supported!`);let i=Gi.Buffer.from(e,`utf16le`),a=this.hash(t,Gi.Buffer.from(n,`base64`),i);for(let e=0;e<r;e++){let n=Gi.Buffer.alloc(4);n.writeUInt32LE(e,0),a=this.hash(t,a,n)}return a.toString(`base64`)},randomBytes(e){return Ki.randomBytes(e)}};var Ji=l({default:()=>Yi}),Yi,Xi=s((()=>{Yi=null}));Xi();function Zi(){}let Qi=function(e,t,n,r){e.super_=t,r||(r=n,n=null),n&&Object.keys(n).forEach(t=>{Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))});let i={constructor:{value:e,enumerable:!1,writable:!1,configurable:!0}};r&&Object.keys(r).forEach(e=>{i[e]=Object.getOwnPropertyDescriptor(r,e)}),e.prototype=Object.create(t.prototype,i)};function $i(e,t){return 25569+e.getTime()/(24*3600*1e3)-(t?1462:0)}function ea(e,t){let n=Math.round((e-25569+(t?1462:0))*24*3600*1e3);return new Date(n)}let ta=/[<>&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/;function na(e){let t=ta.exec(e);if(!t)return e;let n=``,r=``,i=0,a=t.index;for(;a<e.length;a++){let t=e.charCodeAt(a);switch(t){case 34:r=`&quot;`;break;case 38:r=`&amp;`;break;case 39:r=`&apos;`;break;case 60:r=`&lt;`;break;case 62:r=`&gt;`;break;case 127:r=``;break;default:if(t<=31&&(t<=8||t>=11&&t!==13)){r=``;break}continue}i!==a&&(n+=e.substring(i,a)),i=a+1,r&&(n+=r)}return i===a?n:n+e.substring(i,a)}function ra(e){return e.replace(/&([a-z]*);/g,e=>{switch(e){case`&lt;`:return`<`;case`&gt;`:return`>`;case`&amp;`:return`&`;case`&apos;`:return`'`;case`&quot;`:return`"`;default:return e}})}function ia(e){let t=parseInt(e,10);return Number.isNaN(t)?0:t}function aa(e){return e?(e=e.replace(/\[[^\]]*]/g,``),e=e.replace(/"[^"]*"/g,``),e.match(/[ymdhMsb]+/)!==null):!1}function oa(e){return new Promise(t=>{Yi.access(e,Yi.constants.F_OK,e=>{t(!e)})})}function sa(e){return e===!0||e===`true`||e===1||e===`1`}function*ca(e,t,n=1){let r=n>0?(e,t)=>e<t:(e,t)=>e>t;for(let i=e;r(i,t);i+=n)yield i}function la(e){let t=Array.from(e);return t.every(e=>Number.isFinite(e))?t.sort((e,t)=>e-t):t.sort()}let ua=new TextDecoder(`utf-8`);function da(e){return typeof e==`string`?e:ua.decode(e)}function fa(e){let t=e.model;if(t.headerRow===!1)throw Error(`Cannot create pivot table from a table without headers. Set headerRow: true on the table.`);if(!t.rows||t.rows.length===0)throw Error(`Cannot create pivot table from an empty table. Add data rows to the table.`);let n=t.columns.map(e=>e.name),r=new Set;for(let e of n){if(r.has(e))throw Error(`Duplicate column name "${e}" found in table. Pivot tables require unique column names.`);r.add(e)}let i=[void 0,...n],a=t.rows.map(e=>[void 0,...e]),o=t.tl,s=o.row,c=o.col,l=s+t.rows.length,u=c+n.length-1,d=m.encode(s,c,l,u);return{name:t.name,getRow(e){if(e===1)return{values:i};let t=e-2;return t>=0&&t<a.length?{values:a[t]}:{values:[]}},getColumn(e){if(e<1||e>n.length)return{values:[]};let r=[];r[1]=n[e-1];for(let n=0;n<t.rows.length;n++)r[n+2]=t.rows[n][e-1];return{values:r}},getSheetValues(){let e=[];e[1]=i;for(let t=0;t<a.length;t++)e[t+2]=a[t];return e},dimensions:{shortRange:d}}}function pa(e){return e.sourceTable?fa(e.sourceTable):e.sourceSheet}function ma(e,t){if(!t.sourceSheet&&!t.sourceTable)throw Error(`Either sourceSheet or sourceTable must be provided.`);if(t.sourceSheet&&t.sourceTable)throw Error(`Cannot specify both sourceSheet and sourceTable. Choose one.`);let n=pa(t);ha(e,t,n);let{rows:r,values:i}=t,a=t.columns??[],o=ga(n,[...r,...a]),s=o.reduce((e,t,n)=>(e[t.name]=n,e),{}),c=r.map(e=>s[e]),l=a.map(e=>s[e]),u=i.map(e=>s[e]),d=e.workbook.pivotTables.length+1;return{source:n,rows:c,columns:l,values:u,metric:t.metric??`sum`,cacheFields:o,cacheId:String(10+d-1),applyWidthHeightFormats:t.applyWidthHeightFormats??`1`,tableNumber:d}}function ha(e,t,n){if(t.metric&&t.metric!==`sum`&&t.metric!==`count`)throw Error(`Only the "sum" and "count" metrics are supported at this time.`);let r=t.columns??[],i=n.getRow(1).values.slice(1),a=new Set(i);for(let e of[...t.rows,...r,...t.values])if(!a.has(e))throw Error(`The header name "${e}" was not found in ${n.name}.`);if(!t.rows.length)throw Error(`No pivot table rows specified.`);if(t.values.length<1)throw Error(`Must have at least one value.`);if(t.values.length>1&&r.length>0)throw Error(`It is currently not possible to have multiple values when columns are specified. Please either supply an empty array for columns or a single value.`)}function ga(e,t){let n=e.getRow(1).values,r=new Set(t),i=t=>{let n=e.getColumn(t).values,r=new Set;for(let e=2;e<n.length;e++){let t=n[e];t!=null&&r.add(t)}return la(r)},a=[];for(let e of ca(1,n.length)){let t=n[e],o=r.has(t)?i(e):null;a.push({name:t,sharedItems:o})}return a}let _a=(e,t)=>({...e,...t.reduce((t,n)=>(e[n]&&(t[n]={...e[n]}),t),{})}),va=(e,t,n,r=[])=>{e[n]&&(t[n]=_a(e[n],r))},ya=e=>Object.keys(e).length===0,ba=e=>{if(!e)return e;if(ya(e))return{};let t={...e};return va(e,t,`font`,[`color`]),va(e,t,`alignment`),va(e,t,`protection`),e.border&&(va(e,t,`border`),va(e.border,t.border,`top`,[`color`]),va(e.border,t.border,`left`,[`color`]),va(e.border,t.border,`bottom`,[`color`]),va(e.border,t.border,`right`,[`color`]),va(e.border,t.border,`diagonal`,[`color`])),e.fill&&(va(e,t,`fill`,[`fgColor`,`bgColor`,`center`]),e.fill.stops&&(t.fill.stops=e.fill.stops.map(e=>_a(e,[`color`])))),t};var xa=class{constructor(e){e||={},this._workbook=e.workbook,this.id=e.id||0,this.orderNo=e.orderNo||0,this.name=e.name||`sheet${this.id}`,this.state=e.state||`visible`,this._rows=[],this._columns=null,this._keys={},this._merges={},this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},e.properties),this.pageSetup=Object.assign({},{margins:{left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3},orientation:`portrait`,horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!!(e.pageSetup&&(e.pageSetup.fitToWidth||e.pageSetup.fitToHeight)&&!e.pageSetup.scale),pageOrder:`downThenOver`,blackAndWhite:!1,draft:!1,cellComments:`None`,errors:`displayed`,scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,firstPageNumber:void 0,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},e.pageSetup),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},e.headerFooter),this.dataValidations=new de,this.views=e.views||[],this.autoFilter=e.autoFilter||null,this._media=[],this.sheetProtection=null,this.tables={},this.pivotTables=[],this.conditionalFormattings=[]}get name(){return this._name}set name(e){if(e===void 0&&(e=`sheet${this.id}`),this._name!==e){if(typeof e!=`string`)throw Error(`The name has to be a string.`);if(e===``)throw Error(`The name can't be empty.`);if(e===`History`)throw Error(`The name "History" is protected. Please use a different name.`);if(/[*?:/\\[\]]/.test(e))throw Error(`Worksheet name ${e} cannot include any of the following characters: * ? : \\ / [ ]`);if(/(^')|('$)/.test(e))throw Error(`The first or last character of worksheet name cannot be a single quotation mark: ${e}`);if(e&&e.length>31&&(e=e.substring(0,31)),this._workbook.worksheets.find(t=>t&&t.name.toLowerCase()===e.toLowerCase()))throw Error(`Worksheet name already exists: ${e}`);this._name=e}}get workbook(){return this._workbook}destroy(){this._workbook.removeWorksheetEx(this)}get dimensions(){let e=new h;return this._rows.forEach(t=>{if(t){let n=t.dimensions;n&&e.expand(t.number,n.min,t.number,n.max)}}),e}get columns(){return this._columns}set columns(e){this._headerRowCount=e.reduce((e,t)=>{let n=Array.isArray(t.header)?t.header.length:t.header?1:0;return Math.max(e,n)},0);let t=1,n=this._columns=[];e.forEach(e=>{let r=new se(this,t++,!1);n.push(r),r.defn=e})}getColumnKey(e){return this._keys[e]}setColumnKey(e,t){this._keys[e]=t}deleteColumnKey(e){delete this._keys[e]}eachColumnKey(e){Object.keys(this._keys).forEach(t=>e(this._keys[t],t))}getColumn(e){let t;if(typeof e==`string`){let n=this._keys[e];if(n)return n;t=m.l2n(e)}else t=e;if(this._columns||=[],t>this._columns.length){let e=this._columns.length+1;for(;e<=t;)this._columns.push(new se(this,e++))}return this._columns[t-1]}spliceColumns(e,t,...n){let r=this._rows.length;if(n.length>0)for(let i=0;i<r;i++){let r=n.map(e=>e[i]||null);this.getRow(i+1).splice(e,t,...r)}else this._rows.forEach(n=>{n&&n.splice(e,t)});let i=n.length-t,a=e+t,o=this._columns?this._columns.length:0;if(i<0)for(let t=e+n.length;t<=o;t++)this.getColumn(t).defn=this.getColumn(t-i).defn;else if(i>0)for(let e=o;e>=a;e--)this.getColumn(e+i).defn=this.getColumn(e).defn;for(let t=e;t<e+n.length;t++)this.getColumn(t).defn=void 0;this.workbook.definedNames.spliceColumns(this.name,e,t,n.length)}get lastColumn(){return this.getColumn(this.columnCount)}get columnCount(){let e=0;return this.eachRow(t=>{e=Math.max(e,t.cellCount)}),e}get actualColumnCount(){let e=[],t=0;return this.eachRow(n=>{n.eachCell(({col:n})=>{e[n]||(e[n]=!0,t++)})}),t}_commitRow(e){}get _lastRowNumber(){let e=this._rows,t=e.length;for(;t>0&&e[t-1]===void 0;)t--;return t}get _nextRow(){return this._lastRowNumber+1}get lastRow(){if(this._rows.length)return this._rows[this._rows.length-1]}findRow(e){return this._rows[e-1]}findRows(e,t){return this._rows.slice(e-1,e-1+t)}get rowCount(){return this._lastRowNumber}get actualRowCount(){let e=0;return this.eachRow(()=>{e++}),e}getRow(e){let t=this._rows[e-1];return t||=this._rows[e-1]=new oe(this,e),t}getRows(e,t){if(t<1)return;let n=[];for(let r=e;r<e+t;r++)n.push(this.getRow(r));return n}addRow(e,t=`n`){let n=this._nextRow,r=this.getRow(n);return r.values=e,this._setStyleOption(n,t[0]===`i`?t:`n`),r}addRows(e,t=`n`){let n=[];return e.forEach(e=>{n.push(this.addRow(e,t))}),n}insertRow(e,t,n=`n`){return this.spliceRows(e,0,t),this._setStyleOption(e,n),this.getRow(e)}insertRows(e,t,n=`n`){if(this.spliceRows(e,0,...t),n!==`n`)for(let r=0;r<t.length;r++)n[0]===`o`&&this.findRow(t.length+e+r)!==void 0?this._copyStyle(t.length+e+r,e+r,n[1]===`+`):n[0]===`i`&&this.findRow(e-1)!==void 0&&this._copyStyle(e-1,e+r,n[1]===`+`);return this.getRows(e,t.length)}_setStyleOption(e,t=`n`){t[0]===`o`&&this.findRow(e+1)!==void 0?this._copyStyle(e+1,e,t[1]===`+`):t[0]===`i`&&this.findRow(e-1)!==void 0&&this._copyStyle(e-1,e,t[1]===`+`)}_copyStyle(e,t,n=!1){let r=this.getRow(e),i=this.getRow(t);i.style=ba(r.style),r.eachCell({includeEmpty:n},(e,t)=>{i.getCell(t).style=ba(e.style)}),i.height=r.height}duplicateRow(e,t,n=!1){let r=this._rows[e-1],i=Array.from({length:t}).fill(r.values);this.spliceRows(e+1,n?0:t,...i);for(let n=0;n<t;n++){let t=this._rows[e+n];t.style=r.style,t.height=r.height,r.eachCell({includeEmpty:!0},(e,n)=>{t.getCell(n).style=e.style})}}spliceRows(e,t,...n){let r=e+t,i=n.length,a=i-t,o=this._rows.length,s,c;if(a<0)for(e===o&&(this._rows[o-1]=void 0),s=r;s<=o;s++)if(c=this._rows[s-1],c){let e=this.getRow(s+a);e.values=c.values,e.style=c.style,e.height=c.height,c.eachCell({includeEmpty:!0},(t,n)=>{e.getCell(n).style=t.style}),this._rows[s-1]=void 0}else this._rows[s+a-1]=void 0;else if(a>0)for(s=o;s>=r;s--)if(c=this._rows[s-1],c){let e=this.getRow(s+a);e.values=c.values,e.style=c.style,e.height=c.height,c.eachCell({includeEmpty:!0},(t,n)=>{if(e.getCell(n).style=t.style,t.type===S.ValueType.Merge){let e=this.getRow(t.row+i).getCell(n),r=t.master,a=this.getRow(r.row+i).getCell(r.col);e.merge(a)}})}else this._rows[s+a-1]=void 0;for(s=0;s<i;s++){let t=this.getRow(e+s);t.style={},t.values=n[s]}this.workbook.definedNames.spliceRows(this.name,e,t,i)}eachRow(e,t){let n,r;if(typeof e==`function`?r=e:(n=e,r=t),n&&n.includeEmpty){let e=this._rows.length;for(let t=1;t<=e;t++)r(this.getRow(t),t)}else this._rows.forEach(e=>{e&&e.hasValues&&r(e,e.number)})}getSheetValues(){let e=[];return this._rows.forEach(t=>{t&&(e[t.number]=t.values)}),e}findCell(e,t){let n=m.getAddress(e,t),r=this._rows[n.row-1];return r?r.findCell(n.col):void 0}getCell(e,t){let n=m.getAddress(e,t);return this.getRow(n.row).getCellEx(n)}mergeCells(...e){let t=new h(e);this._mergeCellsInternal(t)}mergeCellsWithoutStyle(...e){let t=new h(e);this._mergeCellsInternal(t,!0)}_mergeCellsInternal(e,t){Object.values(this._merges).forEach(t=>{if(t.intersects(e))throw Error(`Cannot merge already merged cells`)});let n=this.getCell(e.top,e.left);for(let r=e.top;r<=e.bottom;r++)for(let i=e.left;i<=e.right;i++)(r>e.top||i>e.left)&&this.getCell(r,i).merge(n,t);this._merges[n.address]=e}_unMergeMaster(e){let t=this._merges[e.address];if(t){for(let e=t.top;e<=t.bottom;e++)for(let n=t.left;n<=t.right;n++)this.getCell(e,n).unmerge();delete this._merges[e.address]}}get hasMerges(){return Object.values(this._merges).some(Boolean)}unMergeCells(...e){let t=new h(e);for(let e=t.top;e<=t.bottom;e++)for(let n=t.left;n<=t.right;n++){let t=this.findCell(e,n);t&&(t.type===S.ValueType.Merge?this._unMergeMaster(t.master):this._merges[t.address]&&this._unMergeMaster(t))}}fillFormula(e,t,n,r=`shared`){let{top:i,left:a,bottom:o,right:s}=m.decode(e),c=s-a+1,l=m.encodeAddress(i,a),u=r===`shared`,d;d=typeof n==`function`?n:Array.isArray(n)?Array.isArray(n[0])?(e,t)=>n[e-i][t-a]:(e,t)=>n[(e-i)*c+(t-a)]:()=>void 0;let f=!0;for(let n=i;n<=o;n++)for(let i=a;i<=s;i++)if(f){let a=this.getCell(n,i);a.value={shareType:r,formula:t,ref:e,result:d(n,i)},f=!1}else this.getCell(n,i).value=u?{sharedFormula:l,result:d(n,i)}:d(n,i)}addImage(e,t){let n={type:`image`,imageId:String(e),range:t};this._media.push(new U(this,n))}getImages(){return this._media.filter(e=>e.type===`image`)}addBackgroundImage(e){let t={type:`background`,imageId:String(e)};this._media.push(new U(this,t))}getBackgroundImageId(){let e=this._media.find(e=>e.type===`background`);return e&&e.imageId}protect(e,t){return new Promise(n=>{this.sheetProtection={sheet:!0},t&&`spinCount`in t&&(t.spinCount=Number.isFinite(t.spinCount)?Math.round(Math.max(0,t.spinCount)):1e5),e&&(this.sheetProtection.algorithmName=`SHA-512`,this.sheetProtection.saltValue=qi.randomBytes(16).toString(`base64`),this.sheetProtection.spinCount=t&&`spinCount`in t?t.spinCount:1e5,this.sheetProtection.hashValue=qi.convertPasswordToHash(e,`SHA512`,this.sheetProtection.saltValue,this.sheetProtection.spinCount)),t&&(this.sheetProtection=Object.assign(this.sheetProtection,t),!e&&`spinCount`in t&&delete this.sheetProtection.spinCount),n()})}unprotect(){this.sheetProtection=null}addTable(e){let t=new ue(this,e);return this.tables[e.name]=t,t}getTable(e){return this.tables[e]}removeTable(e){delete this.tables[e]}getTables(){return Object.values(this.tables)}addPivotTable(e){let t=ma(this,e);return this.pivotTables.push(t),this.workbook.pivotTables.push(t),t}addConditionalFormatting(e){this.conditionalFormattings.push(e)}removeConditionalFormatting(e){typeof e==`number`?this.conditionalFormattings.splice(e,1):e instanceof Function?this.conditionalFormattings=this.conditionalFormattings.filter(e):this.conditionalFormattings=[]}get model(){let e={id:this.id,name:this.name,dataValidations:this.dataValidations.model,properties:this.properties,state:this.state,pageSetup:this.pageSetup,headerFooter:this.headerFooter,rowBreaks:this.rowBreaks,views:this.views,autoFilter:this.autoFilter,media:this._media.map(e=>e.model),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map(e=>e.model),pivotTables:this.pivotTables,conditionalFormattings:this.conditionalFormattings};e.cols=se.toModel(this.columns||[]);let t=e.rows=[],n=e.dimensions=new h;return this._rows.forEach(e=>{let r=e&&e.model;r&&(n.expand(r.number,r.min,r.number,r.max),t.push(r))}),e.merges=[],Object.values(this._merges).forEach(t=>{e.merges.push(t.range)}),e}_parseRows(e){this._rows=[],e.rows&&e.rows.forEach(e=>{let t=new oe(this,e.number);this._rows[t.number-1]=t,t.model=e})}_parseMergeCells(e){e.mergeCells&&e.mergeCells.forEach(e=>{this.mergeCellsWithoutStyle(e)})}set model(e){this.name=e.name,this._columns=se.fromModel(this,e.cols),this._parseRows(e),this._parseMergeCells(e),this.dataValidations=new de(e.dataValidations),this.properties=e.properties,this.pageSetup=e.pageSetup,this.headerFooter=e.headerFooter,this.views=e.views,this.autoFilter=e.autoFilter,this._media=e.media.map(e=>new U(this,e)),this.sheetProtection=e.sheetProtection,this.tables=e.tables.reduce((e,t)=>{let n=new ue(this,t);return n.model=t,e[t.name]=n,e},{}),this.pivotTables=e.pivotTables,this.conditionalFormattings=e.conditionalFormattings}};function Sa(e){return typeof e==`number`?!0:e!==`__proto__`&&e!==`constructor`&&e!==`prototype`}function Ca(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return e.map(e=>Ca(e));let t={};for(let n of Object.keys(e))Sa(n)&&(t[n]=Ca(e[n]));return t}var wa=class{constructor(e){this.template=e,this.sheets={}}addCell(e){this.addCellEx(m.decodeEx(e))}getCell(e){return this.findCellEx(m.decodeEx(e),!0)}findCell(e){return this.findCellEx(m.decodeEx(e),!1)}findCellAt(e,t,n){let r=this.sheets[e],i=r&&r[t];return i&&i[n]}addCellEx(e){if(e.top!==void 0)for(let t=e.top;t<=e.bottom;t++)for(let n=e.left;n<=e.right;n++)this.getCellAt(e.sheetName,t,n);else this.findCellEx(e,!0)}getCellEx(e){return this.findCellEx(e,!0)}findCellEx(e,t){let n=this.findSheet(e,t),r=this.findSheetRow(n,e,t);return this.findRowCell(r,e,t)}getCellAt(e,t,n){if(!Sa(e))throw Error(`Invalid sheet name: ${e}`);let r=this.sheets[e]||(this.sheets[e]=[]),i=r[t]||(r[t]=[]);return i[n]||(i[n]={sheetName:e,address:m.n2l(n)+t,row:t,col:n})}removeCellEx(e){let t=this.findSheet(e,!1);if(!t)return;let n=this.findSheetRow(t,e,!1);n&&delete n[e.col]}forEachInSheet(e,t){let n=this.sheets[e];n&&n.forEach((e,n)=>{e&&e.forEach((e,r)=>{e&&t(e,n,r)})})}forEach(e){Object.keys(this.sheets).forEach(t=>{this.forEachInSheet(t,e)})}map(e){let t=[];return this.forEach(n=>{t.push(e(n))}),t}findSheet(e,t){let n=e.sheetName;if(!Sa(n))throw Error(`Invalid sheet name: ${n}`);if(Object.prototype.hasOwnProperty.call(this.sheets,n))return this.sheets[n];if(t)return this.sheets[n]=[]}findSheetRow(e,t,n){let{row:r}=t;if(!Sa(r))throw Error(`Invalid row: ${r}`);if(e&&e[r])return e[r];if(n)return e[r]=[]}findRowCell(e,t,n){let{col:r}=t;if(!Sa(r))throw Error(`Invalid column: ${r}`);if(e&&e[r])return e[r];if(n)return e[r]=this.template?{...t,...Ca(this.template)}:t}spliceRows(e,t,n,r){let i=this.sheets[e];if(i){let e=[];for(let t=0;t<r;t++)e.push([]);i.splice(t,n,...e)}}spliceColumns(e,t,n,r){let i=this.sheets[e];if(i){let e=[];for(let t=0;t<r;t++)e.push(null);Object.values(i).forEach(r=>{r.splice(t,n,...e)})}}};let Ta=/[$](\w+)[$](\d+)(:[$](\w+)[$](\d+))?/;var Ea=class{constructor(){this.matrixMap={}}getMatrix(e){return this.matrixMap[e]||(this.matrixMap[e]=new wa)}add(e,t){let n=m.decodeEx(e);`error`in n||this.addEx(n,t)}addEx(e,t){let n=this.getMatrix(t);if(`top`in e)for(let t=e.left;t<=e.right;t++)for(let r=e.top;r<=e.bottom;r++){let i={sheetName:e.sheetName,address:m.n2l(t)+r,row:r,col:t};n.addCellEx(i)}else n.addCellEx(e)}remove(e,t){let n=m.decodeEx(e);`error`in n||this.removeEx(n,t)}removeEx(e,t){let n=this.getMatrix(t);if(`top`in e)for(let t=e.left;t<=e.right;t++)for(let r=e.top;r<=e.bottom;r++)n.removeCellEx({sheetName:e.sheetName,address:m.n2l(t)+r,row:r,col:t});else n.removeCellEx(e)}removeAllNames(e){Object.values(this.matrixMap).forEach(t=>{if(`top`in e)for(let n=e.left;n<=e.right;n++)for(let r=e.top;r<=e.bottom;r++)t.removeCellEx({sheetName:e.sheetName,address:m.n2l(n)+r,row:r,col:n});else t.removeCellEx(e)})}forEach(e){Object.entries(this.matrixMap).forEach(([t,n])=>{n.forEach(n=>{e(t,n)})})}getNames(e){let t=m.decodeEx(e);return`error`in t||`top`in t?[]:this.getNamesEx(t)}getNamesEx(e){return Object.entries(this.matrixMap).map(([t,n])=>n.findCellEx(e,!1)&&t).filter(e=>!!e)}_explore(e,t){t.mark=!1;let{sheetName:n}=t,r=new h(t.row,t.col,t.row,t.col,n),i,a,o=(t,r)=>e.findCellAt(n,t,r);function s(e,n){let i=o(e,t.col);return!i||!i.mark?!1:(r[n]=e,i.mark=!1,!0)}for(a=t.row-1;s(a,`top`);a--);for(a=t.row+1;s(a,`bottom`);a++);function c(e,t){let n=[];for(a=r.top;a<=r.bottom;a++){let t=o(a,e);if(t&&t.mark)n.push(t);else return!1}r[t]=e;for(let e=0;e<n.length;e++)n[e].mark=!1;return!0}for(i=t.col-1;c(i,`left`);i--);for(i=t.col+1;c(i,`right`);i++);return r}getRanges(e,t){return t||=this.matrixMap[e],t?(t.forEach(e=>{e.mark=!0}),{name:e,ranges:t.map(e=>e.mark&&this._explore(t,e)).filter(Boolean).map(e=>e.$shortRange)}):{name:e,ranges:[]}}normaliseMatrix(e,t){e.forEachInSheet(t,(e,t,n)=>{e&&(e.row!==t||e.col!==n)&&(e.row=t,e.col=n,e.address=m.n2l(n)+t)})}spliceRows(e,t,n,r){Object.values(this.matrixMap).forEach(i=>{i.spliceRows(e,t,n,r),this.normaliseMatrix(i,e)})}spliceColumns(e,t,n,r){Object.values(this.matrixMap).forEach(i=>{i.spliceColumns(e,t,n,r),this.normaliseMatrix(i,e)})}get model(){return Object.entries(this.matrixMap).map(([e,t])=>this.getRanges(e,t)).filter(e=>e.ranges.length)}set model(e){let t=this.matrixMap={};e.forEach(e=>{let n=t[e.name]=new wa;e.ranges.forEach(e=>{Ta.test(e.split(`!`).pop()||``)&&n.addCell(e)})})}},Da=Uint8Array,Oa=Uint16Array,ka=Int32Array,Aa=new Da([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,0,0,0]),ja=new Da([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,0,0]),Ma=new Da([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Na=function(e,t){for(var n=new Oa(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new ka(n[30]),r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return{b:n,r:i}},Pa=Na(Aa,2),Fa=Pa.b,Ia=Pa.r;Fa[28]=258,Ia[258]=28;var La=Na(ja,0),Ra=La.b;La.r;for(var za=new Oa(32768),Ba=0;Ba<32768;++Ba){var Va=(Ba&43690)>>1|(Ba&21845)<<1;Va=(Va&52428)>>2|(Va&13107)<<2,Va=(Va&61680)>>4|(Va&3855)<<4,za[Ba]=((Va&65280)>>8|(Va&255)<<8)>>1}for(var Ha=(function(e,t,n){for(var r=e.length,i=0,a=new Oa(t);i<r;++i)e[i]&&++a[e[i]-1];var o=new Oa(t);for(i=1;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(n){s=new Oa(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=o[e[i]-1]++<<u,f=d|(1<<u)-1;d<=f;++d)s[za[d]>>c]=l}else for(s=new Oa(r),i=0;i<r;++i)e[i]&&(s[i]=za[o[e[i]-1]++]>>15-e[i]);return s}),Ua=new Da(288),Ba=0;Ba<144;++Ba)Ua[Ba]=8;for(var Ba=144;Ba<256;++Ba)Ua[Ba]=9;for(var Ba=256;Ba<280;++Ba)Ua[Ba]=7;for(var Ba=280;Ba<288;++Ba)Ua[Ba]=8;for(var Wa=new Da(32),Ba=0;Ba<32;++Ba)Wa[Ba]=5;var Ga=Ha(Ua,9,1),Ka=Ha(Wa,5,1),qa=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},Ja=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},Ya=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},Xa=function(e){return(e+7)/8|0},Za=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new Da(e.subarray(t,n))},Qa=[`unexpected EOF`,`invalid block type`,`invalid length/literal`,`invalid distance`,`stream finished`,`no stream handler`,,`no callback`,`invalid UTF-8 data`,`extra field too long`,`date not in range 1980-2099`,`filename too long`,`stream finishing`,`invalid zip data`],$a=function(e,t,n){var r=Error(t||Qa[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,$a),!n)throw r;return r},eo=function(e,t,n,r){var i=e.length,a=r?r.length:0;if(!i||t.f&&!t.l)return n||new Da(0);var o=!n,s=o||t.i!=2,c=t.i;o&&(n=new Da(i*3));var l=function(e){var t=n.length;if(e>t){var r=new Da(Math.max(t*2,e));r.set(n),n=r}},u=t.f||0,d=t.p||0,f=t.b||0,p=t.l,m=t.d,h=t.m,g=t.n,_=i*8;do{if(!p){u=Ja(e,d,1);var v=Ja(e,d+1,3);if(d+=3,v)if(v==1)p=Ga,m=Ka,h=9,g=5;else if(v==2){var y=Ja(e,d,31)+257,b=Ja(e,d+10,15)+4,x=y+Ja(e,d+5,31)+1;d+=14;for(var S=new Da(x),C=new Da(19),w=0;w<b;++w)C[Ma[w]]=Ja(e,d+w*3,7);d+=b*3;for(var T=qa(C),E=(1<<T)-1,D=Ha(C,T,1),w=0;w<x;){var O=D[Ja(e,d,E)];d+=O&15;var k=O>>4;if(k<16)S[w++]=k;else{var A=0,ee=0;for(k==16?(ee=3+Ja(e,d,3),d+=2,A=S[w-1]):k==17?(ee=3+Ja(e,d,7),d+=3):k==18&&(ee=11+Ja(e,d,127),d+=7);ee--;)S[w++]=A}}var j=S.subarray(0,y),M=S.subarray(y);h=qa(j),g=qa(M),p=Ha(j,h,1),m=Ha(M,g,1)}else $a(1);else{var k=Xa(d)+4,N=e[k-4]|e[k-3]<<8,P=k+N;if(P>i){c&&$a(0);break}s&&l(f+N),n.set(e.subarray(k,P),f),t.b=f+=N,t.p=d=P*8,t.f=u;continue}if(d>_){c&&$a(0);break}}s&&l(f+131072);for(var F=(1<<h)-1,te=(1<<g)-1,I=d;;I=d){var A=p[Ya(e,d)&F],L=A>>4;if(d+=A&15,d>_){c&&$a(0);break}if(A||$a(2),L<256)n[f++]=L;else if(L==256){I=d,p=null;break}else{var ne=L-254;if(L>264){var w=L-257,R=Aa[w];ne=Ja(e,d,(1<<R)-1)+Fa[w],d+=R}var z=m[Ya(e,d)&te],re=z>>4;z||$a(3),d+=z&15;var M=Ra[re];if(re>3){var R=ja[re];M+=Ya(e,d)&(1<<R)-1,d+=R}if(d>_){c&&$a(0);break}s&&l(f+131072);var B=f+ne;if(f<M){var V=a-M,ie=Math.min(M,B);for(V+f<0&&$a(3);f<ie;++f)n[f]=r[V+f]}for(;f<B;++f)n[f]=n[f-M]}}t.l=p,t.p=I,t.b=f,t.f=u,p&&(u=1,t.m=h,t.d=m,t.n=g)}while(!u);return f!=n.length&&o?Za(n,0,f):n.subarray(0,f)},to=new Da(0),no=function(e,t){return e[t]|e[t+1]<<8},ro=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},io=function(e,t){return ro(e,t)+ro(e,t+4)*4294967296},ao=function(){function e(e,t){typeof e==`function`&&(t=e,e={}),this.ondata=t;var n=e&&e.dictionary&&e.dictionary.subarray(-32768);this.s={i:0,b:n?n.length:0},this.o=new Da(32768),this.p=new Da(0),n&&this.o.set(n)}return e.prototype.e=function(e){if(this.ondata||$a(5),this.d&&$a(4),!this.p.length)this.p=e;else if(e.length){var t=new Da(this.p.length+e.length);t.set(this.p),t.set(e,this.p.length),this.p=t}},e.prototype.c=function(e){this.s.i=+(this.d=e||!1);var t=this.s.b,n=eo(this.p,this.s,this.o);this.ondata(Za(n,t,this.s.b),this.d),this.o=Za(n,this.s.b-32768),this.s.b=this.o.length,this.p=Za(this.p,this.s.p/8|0),this.s.p&=7},e.prototype.push=function(e,t){this.e(e),this.c(t)},e}(),oo=typeof TextDecoder<`u`&&new TextDecoder;try{oo.decode(to,{stream:!0})}catch{}var so=function(e){for(var t=``,n=0;;){var r=e[n++],i=(r>127)+(r>223)+(r>239);if(n+i>e.length)return{s:t,r:Za(e,n-1)};i?i==3?(r=((r&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?t+=String.fromCharCode((r&31)<<6|e[n++]&63):t+=String.fromCharCode((r&15)<<12|(e[n++]&63)<<6|e[n++]&63):t+=String.fromCharCode(r)}};function co(e,t){if(t){for(var n=``,r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}else if(oo)return oo.decode(e);else{var i=so(e),a=i.s,n=i.r;return n.length&&$a(8),a}}var lo=function(e,t){for(;no(e,t)!=1;t+=4+no(e,t+2));return[io(e,t+12),io(e,t+4),io(e,t+20)]},uo=function(){function e(){}return e.prototype.push=function(e,t){this.ondata(null,e,t)},e.compression=0,e}(),fo=function(){function e(){var e=this;this.i=new ao(function(t,n){e.ondata(null,t,n)})}return e.prototype.push=function(e,t){try{this.i.push(e,t)}catch(e){this.ondata(e,null,t)}},e.compression=8,e}(),po=function(){function e(e){this.onfile=e,this.k=[],this.o={0:uo},this.p=to}return e.prototype.push=function(e,t){var n=this;if(this.onfile||$a(5),this.p||$a(4),this.c>0){var r=Math.min(this.c,e.length),i=e.subarray(0,r);if(this.c-=r,this.d?this.d.push(i,!this.c):this.k[0].push(i),e=e.subarray(r),e.length)return this.push(e,t)}else{var a=0,o=0,s=void 0,c=void 0;this.p.length?e.length?(c=new Da(this.p.length+e.length),c.set(this.p),c.set(e,this.p.length)):c=this.p:c=e;for(var l=c.length,u=this.c,d=u&&this.d,f=function(){var e,t=ro(c,o);if(t==67324752){a=1,s=o,p.d=null,p.c=0;var r=no(c,o+6),i=no(c,o+8),d=r&2048,f=r&8,m=no(c,o+26),h=no(c,o+28);if(l>o+30+m+h){var g=[];p.k.unshift(g),a=2;var _=ro(c,o+18),v=ro(c,o+22),y=co(c.subarray(o+30,o+=30+m),!d);_==4294967295?(e=f?[-2]:lo(c,o),_=e[0],v=e[1]):f&&(_=-1),o+=h,p.c=_;var b,x={name:y,compression:i,start:function(){if(x.ondata||$a(5),!_)x.ondata(null,to,!0);else{var e=n.o[i];e||x.ondata($a(14,`unknown compression type `+i,1),null,!1),b=_<0?new e(y):new e(y,_,v),b.ondata=function(e,t,n){x.ondata(e,t,n)};for(var t=0,r=g;t<r.length;t++){var a=r[t];b.push(a,!1)}n.k[0]==g&&n.c?n.d=b:b.push(to,!0)}},terminate:function(){b&&b.terminate&&b.terminate()}};_>=0&&(x.size=_,x.originalSize=v),p.onfile(x)}return`break`}else if(u){if(t==134695760)return s=o+=12+(u==-2&&8),a=3,p.c=0,`break`;if(t==33639248)return s=o-=4,a=3,p.c=0,`break`}},p=this;o<l-4&&f()!==`break`;++o);if(this.p=to,u<0){var m=a?c.subarray(0,s-12-(u==-2&&8)-(ro(c,s-16)==134695760&&4)):c.subarray(0,o);d?d.push(m,!!a):this.k[+(a==2)].push(m)}if(a&2)return this.push(c.subarray(o),t);this.p=c.subarray(o)}t&&(this.c&&$a(13),this.p=null)},e.prototype.register=function(e){this.o[e.compression]=e},e}(),mo=c(((e,t)=>{function n(e){"@babel/helpers - typeof";return n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function a(e){var t=o(e,`string`);return n(t)===`symbol`?t:String(t)}function o(e,t){if(n(e)!==`object`||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||`default`);if(n(i)!==`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function s(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function c(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,`prototype`,{writable:!1}),t&&l(e,t)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}function u(e){var t=p();return function(){var n=m(e),r;if(t){var i=m(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}function d(e,t){if(t&&(n(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return f(e)}function f(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function p(){if(typeof Reflect>`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}var h={},g,_;function v(e,t,n){n||=Error;function r(e,n,r){return typeof t==`string`?t:t(e,n,r)}h[e]=function(t){c(a,t);var n=u(a);function a(t,i,o){var c;return s(this,a),c=n.call(this,r(t,i,o)),c.code=e,c}return i(a)}(n)}function y(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map(function(e){return String(e)}),n>2?`one of ${t} ${e.slice(0,n-1).join(`, `)}, or `+e[n-1]:n===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}else return`of ${t} ${String(e)}`}function b(e,t,n){return e.substr(!n||n<0?0:+n,t.length)===t}function x(e,t,n){return(n===void 0||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}function S(e,t,n){return typeof n!=`number`&&(n=0),n+t.length>e.length?!1:e.indexOf(t,n)!==-1}v(`ERR_AMBIGUOUS_ARGUMENT`,`The "%s" argument is ambiguous. %s`,TypeError),v(`ERR_INVALID_ARG_TYPE`,function(e,t,r){g===void 0&&(g=Mo()),g(typeof e==`string`,`'name' must be a string`);var i;typeof t==`string`&&b(t,`not `)?(i=`must not be`,t=t.replace(/^not /,``)):i=`must be`;var a=x(e,` argument`)?`The ${e} ${i} ${y(t,`type`)}`:`The "${e}" ${S(e,`.`)?`property`:`argument`} ${i} ${y(t,`type`)}`;return a+=`. Received type ${n(r)}`,a},TypeError),v(`ERR_INVALID_ARG_VALUE`,function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`is invalid`;_===void 0&&(_=Kt());var r=_.inspect(t);return r.length>128&&(r=`${r.slice(0,128)}...`),`The argument '${e}' ${n}. Received ${r}`},TypeError,RangeError),v(`ERR_INVALID_RETURN_VALUE`,function(e,t,r){return`Expected ${e} to be returned from the "${t}" function but got ${r&&r.constructor&&r.constructor.name?`instance of ${r.constructor.name}`:`type ${n(r)}`}.`},TypeError),v(`ERR_MISSING_ARGS`,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];g===void 0&&(g=Mo()),g(t.length>0,`At least one arg needs to be specified`);var r=`The `,i=t.length;switch(t=t.map(function(e){return`"${e}"`}),i){case 1:r+=`${t[0]} argument`;break;case 2:r+=`${t[0]} and ${t[1]} arguments`;break;default:r+=t.slice(0,i-1).join(`, `),r+=`, and ${t[i-1]} arguments`;break}return`${r} must be specified`},TypeError),t.exports.codes=h})),ho=c(((e,t)=>{Be();function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function r(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]==null?{}:arguments[t];t%2?n(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function i(e,t,n){return t=c(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function s(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function c(e){var t=l(e,`string`);return b(t)===`symbol`?t:String(t)}function l(e,t){if(b(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(b(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function u(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,`prototype`,{writable:!1}),t&&v(e,t)}function d(e){var t=g();return function(){var n=y(e),r;if(t){var i=y(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return f(this,r)}}function f(e,t){if(t&&(b(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return p(e)}function p(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function m(e){var t=typeof Map==`function`?new Map:void 0;return m=function(e){if(e===null||!_(e))return e;if(typeof e!=`function`)throw TypeError(`Super expression must either be null or a function`);if(t!==void 0){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return h(e,arguments,y(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),v(n,e)},m(e)}function h(e,t,n){return h=g()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&v(i,n.prototype),i},h.apply(null,arguments)}function g(){if(typeof Reflect>`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _(e){return Function.toString.call(e).indexOf(`[native code]`)!==-1}function v(e,t){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},v(e,t)}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function b(e){"@babel/helpers - typeof";return b=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},b(e)}var x=Kt().inspect,S=mo().codes.ERR_INVALID_ARG_TYPE;function C(e,t,n){return(n===void 0||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}function w(e,t){if(t=Math.floor(t),e.length==0||t==0)return``;var n=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+=e.substring(0,n-e.length),e}var T=``,E=``,D=``,O=``,k={deepStrictEqual:`Expected values to be strictly deep-equal:`,strictEqual:`Expected values to be strictly equal:`,strictEqualObject:`Expected "actual" to be reference-equal to "expected":`,deepEqual:`Expected values to be loosely deep-equal:`,equal:`Expected values to be loosely equal:`,notDeepStrictEqual:`Expected "actual" not to be strictly deep-equal to:`,notStrictEqual:`Expected "actual" to be strictly unequal to:`,notStrictEqualObject:`Expected "actual" not to be reference-equal to "expected":`,notDeepEqual:`Expected "actual" not to be loosely deep-equal to:`,notEqual:`Expected "actual" to be loosely unequal to:`,notIdentical:`Values identical but not reference-equal:`},A=10;function ee(e){var t=Object.keys(e),n=Object.create(Object.getPrototypeOf(e));return t.forEach(function(t){n[t]=e[t]}),Object.defineProperty(n,`message`,{value:e.message}),n}function j(e){return x(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(e,t,n){var r=``,i=``,a=0,o=``,s=!1,c=j(e),l=c.split(`
27
26
  `),u=j(t).split(`
28
27
  `),d=0,f=``;if(n===`strictEqual`&&b(e)===`object`&&b(t)===`object`&&e!==null&&t!==null&&(n=`strictEqualObject`),l.length===1&&u.length===1&&l[0]!==u[0]){var p=l[0].length+u[0].length;if(p<=A){if((b(e)!==`object`||e===null)&&(b(t)!==`object`||t===null)&&(e!==0||t!==0))return`${k[n]}
29
28
 
@@ -69,15 +68,15 @@ ${h}
69
68
 
70
69
  should equal
71
70
 
72
- `:g=` ${o} ${g}`),t=n.call(this,`${h}${g}`)}return Error.stackTraceLimit=u,t.generatedMessage=!r,Object.defineProperty(p(t),`name`,{value:`AssertionError [ERR_ASSERTION]`,enumerable:!1,writable:!0,configurable:!0}),t.code=`ERR_ASSERTION`,t.actual=c,t.expected=l,t.operator=o,Error.captureStackTrace&&Error.captureStackTrace(p(t),s),t.stack,t.name=`AssertionError`,f(t)}return s(i,[{key:`toString`,value:function(){return`${this.name} [${this.code}]: ${this.message}`}},{key:t,value:function(e,t){return x(this,r(r({},t),{},{customInspect:!1,depth:0}))}}]),i}(m(Error),x.custom)})),ho=c(((e,t)=>{var n=Object.prototype.toString;t.exports=function(e){var t=n.call(e),r=t===`[object Arguments]`;return r||=t!==`[object Array]`&&typeof e==`object`&&!!e&&typeof e.length==`number`&&e.length>=0&&n.call(e.callee)===`[object Function]`,r}})),go=c(((e,t)=>{var n;if(!Object.keys){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=ho(),o=Object.prototype.propertyIsEnumerable,s=!o.call({toString:null},`toString`),c=o.call(function(){},`prototype`),l=[`toString`,`toLocaleString`,`valueOf`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`constructor`],u=function(e){var t=e.constructor;return t&&t.prototype===e},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if(typeof window>`u`)return!1;for(var e in window)try{if(!d[`$`+e]&&r.call(window,e)&&window[e]!==null&&typeof window[e]==`object`)try{u(window[e])}catch{return!0}}catch{return!0}return!1}(),p=function(e){if(typeof window>`u`||!f)return u(e);try{return u(e)}catch{return!1}};n=function(e){var t=typeof e==`object`&&!!e,n=i.call(e)===`[object Function]`,o=a(e),u=t&&i.call(e)===`[object String]`,d=[];if(!t&&!n&&!o)throw TypeError(`Object.keys called on a non-object`);var f=c&&n;if(u&&e.length>0&&!r.call(e,0))for(var m=0;m<e.length;++m)d.push(String(m));if(o&&e.length>0)for(var h=0;h<e.length;++h)d.push(String(h));else for(var g in e)!(f&&g===`prototype`)&&r.call(e,g)&&d.push(String(g));if(s)for(var _=p(e),v=0;v<l.length;++v)!(_&&l[v]===`constructor`)&&r.call(e,l[v])&&d.push(l[v]);return d}}t.exports=n})),_o=c(((e,t)=>{var n=Array.prototype.slice,r=ho(),i=Object.keys,a=i?function(e){return i(e)}:go(),o=Object.keys;a.shim=function(){return Object.keys?function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2)||(Object.keys=function(e){return r(e)?o(n.call(e)):o(e)}):Object.keys=a,Object.keys||a},t.exports=a})),vo=c(((e,t)=>{var n=_o(),r=Ke()(),i=Dt(),a=Je(),o=i(`Array.prototype.push`),s=i(`Object.prototype.propertyIsEnumerable`),c=r?a.getOwnPropertySymbols:null;t.exports=function(e,t){if(e==null)throw TypeError(`target must be an object`);var i=a(e);if(arguments.length===1)return i;for(var l=1;l<arguments.length;++l){var u=a(arguments[l]),d=n(u),f=r&&(a.getOwnPropertySymbols||c);if(f)for(var p=f(u),m=0;m<p.length;++m){var h=p[m];s(u,h)&&o(d,h)}for(var g=0;g<d.length;++g){var _=d[g];s(u,_)&&(i[_]=u[_])}}return i}})),yo=c(((e,t)=>{var n=vo(),r=function(){if(!Object.assign)return!1;for(var e=`abcdefghijklmnopqrst`,t=e.split(``),n={},r=0;r<t.length;++r)n[t[r]]=t[r];var i=Object.assign({},n),a=``;for(var o in i)a+=o;return e!==a},i=function(){if(!Object.assign||!Object.preventExtensions)return!1;var e=Object.preventExtensions({1:2});try{Object.assign(e,`xy`)}catch{return e[1]===`y`}return!1};t.exports=function(){return!Object.assign||r()||i()?n:Object.assign}})),bo=c(((e,t)=>{var n=function(e){return e!==e};t.exports=function(e,t){return e===0&&t===0?1/e==1/t:!!(e===t||n(e)&&n(t))}})),xo=c(((e,t)=>{var n=bo();t.exports=function(){return typeof Object.is==`function`?Object.is:n}})),So=c(((e,t)=>{var n=Et(),r=Vt(),i=r(n(`String.prototype.indexOf`));t.exports=function(e,t){var a=n(e,!!t);return typeof a==`function`&&i(e,`.prototype.`)>-1?r(a):a}})),Co=c(((e,t)=>{var n=_o(),r=typeof Symbol==`function`&&typeof Symbol(`foo`)==`symbol`,i=Object.prototype.toString,a=Array.prototype.concat,o=Lt(),s=function(e){return typeof e==`function`&&i.call(e)===`[object Function]`},c=Rt()(),l=function(e,t,n,r){if(t in e){if(r===!0){if(e[t]===n)return}else if(!s(r)||!r())return}c?o(e,t,n,!0):o(e,t,n)},u=function(e,t){var i=arguments.length>2?arguments[2]:{},o=n(t);r&&(o=a.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;s<o.length;s+=1)l(e,o[s],t[o[s]],i[o[s]])};u.supportsDescriptors=!!c,t.exports=u})),wo=c(((e,t)=>{var n=xo(),r=Co();t.exports=function(){var e=n();return r(Object,{is:e},{is:function(){return Object.is!==e}}),e}})),To=c(((e,t)=>{var n=Co(),r=Vt(),i=bo(),a=xo(),o=wo(),s=r(a(),Object);n(s,{getPolyfill:a,implementation:i,shim:o}),t.exports=s})),Eo=c(((e,t)=>{t.exports=function(e){return e!==e}})),Do=c(((e,t)=>{var n=Eo();t.exports=function(){return Number.isNaN&&!Number.isNaN(`a`)?Number.isNaN:n}})),Oo=c(((e,t)=>{var n=Co(),r=Do();t.exports=function(){var e=r();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}})),ko=c(((e,t)=>{var n=Vt(),r=Co(),i=Eo(),a=Do(),o=Oo(),s=n(a(),Number);r(s,{getPolyfill:a,implementation:i,shim:o}),t.exports=s})),Ao=c(((e,t)=>{function n(e,t){return s(e)||o(e,t)||i(e,t)||r()}function r(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
73
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i(e,t){if(e){if(typeof e==`string`)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}}function a(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function s(e){if(Array.isArray(e))return e}function c(e){"@babel/helpers - typeof";return c=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},c(e)}var l=/a/g.flags!==void 0,u=function(e){var t=[];return e.forEach(function(e){return t.push(e)}),t},d=function(e){var t=[];return e.forEach(function(e,n){return t.push([n,e])}),t},f=Object.is?Object.is:To(),p=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},m=Number.isNaN?Number.isNaN:ko();function h(e){return e.call.bind(e)}var g=h(Object.prototype.hasOwnProperty),_=h(Object.prototype.propertyIsEnumerable),v=h(Object.prototype.toString),y=Kt().types,b=y.isAnyArrayBuffer,x=y.isArrayBufferView,S=y.isDate,C=y.isMap,w=y.isRegExp,T=y.isSet,E=y.isNativeError,D=y.isBoxedPrimitive,O=y.isNumberObject,k=y.isStringObject,A=y.isBooleanObject,ee=y.isBigIntObject,j=y.isSymbolObject,M=y.isFloat32Array,N=y.isFloat64Array;function P(e){if(e.length===0||e.length>10)return!0;for(var t=0;t<e.length;t++){var n=e.charCodeAt(t);if(n<48||n>57)return!0}return e.length===10&&e>=2**32}function F(e){return Object.keys(e).filter(P).concat(p(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}
71
+ `:g=` ${o} ${g}`),t=n.call(this,`${h}${g}`)}return Error.stackTraceLimit=u,t.generatedMessage=!r,Object.defineProperty(p(t),`name`,{value:`AssertionError [ERR_ASSERTION]`,enumerable:!1,writable:!0,configurable:!0}),t.code=`ERR_ASSERTION`,t.actual=c,t.expected=l,t.operator=o,Error.captureStackTrace&&Error.captureStackTrace(p(t),s),t.stack,t.name=`AssertionError`,f(t)}return s(i,[{key:`toString`,value:function(){return`${this.name} [${this.code}]: ${this.message}`}},{key:t,value:function(e,t){return x(this,r(r({},t),{},{customInspect:!1,depth:0}))}}]),i}(m(Error),x.custom)})),go=c(((e,t)=>{var n=Object.prototype.toString;t.exports=function(e){var t=n.call(e),r=t===`[object Arguments]`;return r||=t!==`[object Array]`&&typeof e==`object`&&!!e&&typeof e.length==`number`&&e.length>=0&&n.call(e.callee)===`[object Function]`,r}})),_o=c(((e,t)=>{var n;if(!Object.keys){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=go(),o=Object.prototype.propertyIsEnumerable,s=!o.call({toString:null},`toString`),c=o.call(function(){},`prototype`),l=[`toString`,`toLocaleString`,`valueOf`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`constructor`],u=function(e){var t=e.constructor;return t&&t.prototype===e},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if(typeof window>`u`)return!1;for(var e in window)try{if(!d[`$`+e]&&r.call(window,e)&&window[e]!==null&&typeof window[e]==`object`)try{u(window[e])}catch{return!0}}catch{return!0}return!1}(),p=function(e){if(typeof window>`u`||!f)return u(e);try{return u(e)}catch{return!1}};n=function(e){var t=typeof e==`object`&&!!e,n=i.call(e)===`[object Function]`,o=a(e),u=t&&i.call(e)===`[object String]`,d=[];if(!t&&!n&&!o)throw TypeError(`Object.keys called on a non-object`);var f=c&&n;if(u&&e.length>0&&!r.call(e,0))for(var m=0;m<e.length;++m)d.push(String(m));if(o&&e.length>0)for(var h=0;h<e.length;++h)d.push(String(h));else for(var g in e)!(f&&g===`prototype`)&&r.call(e,g)&&d.push(String(g));if(s)for(var _=p(e),v=0;v<l.length;++v)!(_&&l[v]===`constructor`)&&r.call(e,l[v])&&d.push(l[v]);return d}}t.exports=n})),vo=c(((e,t)=>{var n=Array.prototype.slice,r=go(),i=Object.keys,a=i?function(e){return i(e)}:_o(),o=Object.keys;a.shim=function(){return Object.keys?function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2)||(Object.keys=function(e){return r(e)?o(n.call(e)):o(e)}):Object.keys=a,Object.keys||a},t.exports=a})),yo=c(((e,t)=>{var n=vo(),r=Ke()(),i=Dt(),a=Je(),o=i(`Array.prototype.push`),s=i(`Object.prototype.propertyIsEnumerable`),c=r?a.getOwnPropertySymbols:null;t.exports=function(e,t){if(e==null)throw TypeError(`target must be an object`);var i=a(e);if(arguments.length===1)return i;for(var l=1;l<arguments.length;++l){var u=a(arguments[l]),d=n(u),f=r&&(a.getOwnPropertySymbols||c);if(f)for(var p=f(u),m=0;m<p.length;++m){var h=p[m];s(u,h)&&o(d,h)}for(var g=0;g<d.length;++g){var _=d[g];s(u,_)&&(i[_]=u[_])}}return i}})),bo=c(((e,t)=>{var n=yo(),r=function(){if(!Object.assign)return!1;for(var e=`abcdefghijklmnopqrst`,t=e.split(``),n={},r=0;r<t.length;++r)n[t[r]]=t[r];var i=Object.assign({},n),a=``;for(var o in i)a+=o;return e!==a},i=function(){if(!Object.assign||!Object.preventExtensions)return!1;var e=Object.preventExtensions({1:2});try{Object.assign(e,`xy`)}catch{return e[1]===`y`}return!1};t.exports=function(){return!Object.assign||r()||i()?n:Object.assign}})),xo=c(((e,t)=>{var n=function(e){return e!==e};t.exports=function(e,t){return e===0&&t===0?1/e==1/t:!!(e===t||n(e)&&n(t))}})),So=c(((e,t)=>{var n=xo();t.exports=function(){return typeof Object.is==`function`?Object.is:n}})),Co=c(((e,t)=>{var n=Et(),r=Vt(),i=r(n(`String.prototype.indexOf`));t.exports=function(e,t){var a=n(e,!!t);return typeof a==`function`&&i(e,`.prototype.`)>-1?r(a):a}})),wo=c(((e,t)=>{var n=vo(),r=typeof Symbol==`function`&&typeof Symbol(`foo`)==`symbol`,i=Object.prototype.toString,a=Array.prototype.concat,o=Lt(),s=function(e){return typeof e==`function`&&i.call(e)===`[object Function]`},c=Rt()(),l=function(e,t,n,r){if(t in e){if(r===!0){if(e[t]===n)return}else if(!s(r)||!r())return}c?o(e,t,n,!0):o(e,t,n)},u=function(e,t){var i=arguments.length>2?arguments[2]:{},o=n(t);r&&(o=a.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;s<o.length;s+=1)l(e,o[s],t[o[s]],i[o[s]])};u.supportsDescriptors=!!c,t.exports=u})),To=c(((e,t)=>{var n=So(),r=wo();t.exports=function(){var e=n();return r(Object,{is:e},{is:function(){return Object.is!==e}}),e}})),Eo=c(((e,t)=>{var n=wo(),r=Vt(),i=xo(),a=So(),o=To(),s=r(a(),Object);n(s,{getPolyfill:a,implementation:i,shim:o}),t.exports=s})),Do=c(((e,t)=>{t.exports=function(e){return e!==e}})),Oo=c(((e,t)=>{var n=Do();t.exports=function(){return Number.isNaN&&!Number.isNaN(`a`)?Number.isNaN:n}})),ko=c(((e,t)=>{var n=wo(),r=Oo();t.exports=function(){var e=r();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}})),Ao=c(((e,t)=>{var n=Vt(),r=wo(),i=Do(),a=Oo(),o=ko(),s=n(a(),Number);r(s,{getPolyfill:a,implementation:i,shim:o}),t.exports=s})),jo=c(((e,t)=>{function n(e,t){return s(e)||o(e,t)||i(e,t)||r()}function r(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
72
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i(e,t){if(e){if(typeof e==`string`)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}}function a(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function s(e){if(Array.isArray(e))return e}function c(e){"@babel/helpers - typeof";return c=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},c(e)}var l=/a/g.flags!==void 0,u=function(e){var t=[];return e.forEach(function(e){return t.push(e)}),t},d=function(e){var t=[];return e.forEach(function(e,n){return t.push([n,e])}),t},f=Object.is?Object.is:Eo(),p=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},m=Number.isNaN?Number.isNaN:Ao();function h(e){return e.call.bind(e)}var g=h(Object.prototype.hasOwnProperty),_=h(Object.prototype.propertyIsEnumerable),v=h(Object.prototype.toString),y=Kt().types,b=y.isAnyArrayBuffer,x=y.isArrayBufferView,S=y.isDate,C=y.isMap,w=y.isRegExp,T=y.isSet,E=y.isNativeError,D=y.isBoxedPrimitive,O=y.isNumberObject,k=y.isStringObject,A=y.isBooleanObject,ee=y.isBigIntObject,j=y.isSymbolObject,M=y.isFloat32Array,N=y.isFloat64Array;function P(e){if(e.length===0||e.length>10)return!0;for(var t=0;t<e.length;t++){var n=e.charCodeAt(t);if(n<48||n>57)return!0}return e.length===10&&e>=2**32}function F(e){return Object.keys(e).filter(P).concat(p(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}
74
73
  /*!
75
74
  * The buffer module from node.js, for the browser.
76
75
  *
77
76
  * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
78
77
  * @license MIT
79
78
  */
80
- function te(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0}var I=void 0,L=!0,ne=!1,R=0,z=1,re=2,B=3;function V(e,t){return l?e.source===t.source&&e.flags===t.flags:RegExp.prototype.toString.call(e)===RegExp.prototype.toString.call(t)}function ie(e,t){if(e.byteLength!==t.byteLength)return!1;for(var n=0;n<e.byteLength;n++)if(e[n]!==t[n])return!1;return!0}function ae(e,t){return e.byteLength===t.byteLength?te(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))===0:!1}function oe(e,t){return e.byteLength===t.byteLength&&te(new Uint8Array(e),new Uint8Array(t))===0}function se(e,t){return O(e)?O(t)&&f(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):k(e)?k(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):A(e)?A(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):ee(e)?ee(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):j(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}function H(e,t,n,r){if(e===t)return e===0&&n?f(e,t):!0;if(n){if(c(e)!==`object`)return typeof e==`number`&&m(e)&&m(t);if(c(t)!==`object`||e===null||t===null||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(e===null||c(e)!==`object`)return t===null||c(t)!==`object`?e==t:!1;if(t===null||c(t)!==`object`)return!1}var i=v(e);if(i!==v(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var a=F(e,I),o=F(t,I);return a.length===o.length?le(e,t,n,r,z,a):!1}if(i===`[object Object]`&&(!C(e)&&C(t)||!T(e)&&T(t)))return!1;if(S(e)){if(!S(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(w(e)){if(!w(t)||!V(e,t))return!1}else if(E(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else if(x(e)){if(!n&&(M(e)||N(e))){if(!ie(e,t))return!1}else if(!ae(e,t))return!1;var s=F(e,I),l=F(t,I);return s.length===l.length?le(e,t,n,r,R,s):!1}else if(T(e))return!T(t)||e.size!==t.size?!1:le(e,t,n,r,re);else if(C(e))return!C(t)||e.size!==t.size?!1:le(e,t,n,r,B);else if(b(e)){if(!oe(e,t))return!1}else if(D(e)&&!se(e,t))return!1;return le(e,t,n,r,R)}function ce(e,t){return t.filter(function(t){return _(e,t)})}function le(e,t,n,r,i,a){if(arguments.length===5){a=Object.keys(e);var o=Object.keys(t);if(a.length!==o.length)return!1}for(var s=0;s<a.length;s++)if(!g(t,a[s]))return!1;if(n&&arguments.length===5){var c=p(e);if(c.length!==0){var l=0;for(s=0;s<c.length;s++){var u=c[s];if(_(e,u)){if(!_(t,u))return!1;a.push(u),l++}else if(_(t,u))return!1}var d=p(t);if(c.length!==d.length&&ce(t,d).length!==l)return!1}else{var f=p(t);if(f.length!==0&&ce(t,f).length!==0)return!1}}if(a.length===0&&(i===R||i===z&&e.length===0||e.size===0))return!0;if(r===void 0)r={val1:new Map,val2:new Map,position:0};else{var m=r.val1.get(e);if(m!==void 0){var h=r.val2.get(t);if(h!==void 0)return m===h}r.position++}r.val1.set(e,r.position),r.val2.set(t,r.position);var v=q(e,t,n,a,r,i);return r.val1.delete(e),r.val2.delete(t),v}function U(e,t,n,r){for(var i=u(e),a=0;a<i.length;a++){var o=i[a];if(H(t,o,n,r))return e.delete(o),!0}return!1}function W(e){switch(c(e)){case`undefined`:return null;case`object`:return;case`symbol`:return!1;case`string`:e=+e;case`number`:if(m(e))return!1}return!0}function ue(e,t,n){var r=W(n);return r??(t.has(r)&&!e.has(r))}function de(e,t,n,r,i){var a=W(n);if(a!=null)return a;var o=t.get(a);return o===void 0&&!t.has(a)||!H(r,o,!1,i)?!1:!e.has(a)&&H(r,o,!1,i)}function G(e,t,n,r){for(var i=null,a=u(e),o=0;o<a.length;o++){var s=a[o];if(c(s)===`object`&&s!==null)i===null&&(i=new Set),i.add(s);else if(!t.has(s)){if(n||!ue(e,t,s))return!1;i===null&&(i=new Set),i.add(s)}}if(i!==null){for(var l=u(t),d=0;d<l.length;d++){var f=l[d];if(c(f)===`object`&&f!==null){if(!U(i,f,n,r))return!1}else if(!n&&!e.has(f)&&!U(i,f,n,r))return!1}return i.size===0}return!0}function fe(e,t,n,r,i,a){for(var o=u(e),s=0;s<o.length;s++){var c=o[s];if(H(n,c,i,a)&&H(r,t.get(c),i,a))return e.delete(c),!0}return!1}function K(e,t,r,i){for(var a=null,o=d(e),s=0;s<o.length;s++){var l=n(o[s],2),u=l[0],f=l[1];if(c(u)===`object`&&u!==null)a===null&&(a=new Set),a.add(u);else{var p=t.get(u);if(p===void 0&&!t.has(u)||!H(f,p,r,i)){if(r||!de(e,t,u,f,i))return!1;a===null&&(a=new Set),a.add(u)}}}if(a!==null){for(var m=d(t),h=0;h<m.length;h++){var g=n(m[h],2),_=g[0],v=g[1];if(c(_)===`object`&&_!==null){if(!fe(a,e,_,v,r,i))return!1}else if(!r&&(!e.has(_)||!H(e.get(_),v,!1,i))&&!fe(a,e,_,v,!1,i))return!1}return a.size===0}return!0}function q(e,t,n,r,i,a){var o=0;if(a===re){if(!G(e,t,n,i))return!1}else if(a===B){if(!K(e,t,n,i))return!1}else if(a===z)for(;o<e.length;o++)if(g(e,o)){if(!g(t,o)||!H(e[o],t[o],n,i))return!1}else if(g(t,o))return!1;else{for(var s=Object.keys(e);o<s.length;o++){var c=s[o];if(!g(t,c)||!H(e[c],t[c],n,i))return!1}return s.length===Object.keys(t).length}for(o=0;o<r.length;o++){var l=r[o];if(!H(e[l],t[l],n,i))return!1}return!0}function J(e,t){return H(e,t,ne)}function Y(e,t){return H(e,t,L)}t.exports={isDeepEqual:J,isDeepStrictEqual:Y}})),jo=c(((e,t)=>{Be();function n(e){"@babel/helpers - typeof";return n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function a(e){var t=o(e,`string`);return n(t)===`symbol`?t:String(t)}function o(e,t){if(n(e)!==`object`||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||`default`);if(n(i)!==`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function s(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var c=po().codes,l=c.ERR_AMBIGUOUS_ARGUMENT,u=c.ERR_INVALID_ARG_TYPE,d=c.ERR_INVALID_ARG_VALUE,f=c.ERR_INVALID_RETURN_VALUE,p=c.ERR_MISSING_ARGS,m=mo(),h=Kt().inspect,g=Kt().types,_=g.isPromise,v=g.isRegExp,y=yo()(),b=xo()(),x=So()(`RegExp.prototype.test`),S,C;function w(){var e=Ao();S=e.isDeepEqual,C=e.isDeepStrictEqual}var T=!1,E=t.exports=ee,D={};function O(e){throw e.message instanceof Error?e.message:new m(e)}function k(e,t,n,r,i){var a=arguments.length,o;if(a===0?o=`Failed`:a===1?(n=e,e=void 0):(T===!1&&(T=!0,(Q.emitWarning?Q.emitWarning:console.warn.bind(console))(`assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.`,`DeprecationWarning`,`DEP0094`)),a===2&&(r=`!=`)),n instanceof Error)throw n;var s={actual:e,expected:t,operator:r===void 0?`fail`:r,stackStartFn:i||k};n!==void 0&&(s.message=n);var c=new m(s);throw o&&(c.message=o,c.generatedMessage=!0),c}E.fail=k,E.AssertionError=m;function A(e,t,n,r){if(!n){var i=!1;if(t===0)i=!0,r="No value argument passed to `assert.ok()`";else if(r instanceof Error)throw r;var a=new m({actual:n,expected:!0,message:r,operator:`==`,stackStartFn:e});throw a.generatedMessage=i,a}}function ee(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];A.apply(void 0,[ee,t.length].concat(t))}E.ok=ee,E.equal=function e(t,n,r){if(arguments.length<2)throw new p(`actual`,`expected`);t!=n&&O({actual:t,expected:n,message:r,operator:`==`,stackStartFn:e})},E.notEqual=function e(t,n,r){if(arguments.length<2)throw new p(`actual`,`expected`);t==n&&O({actual:t,expected:n,message:r,operator:`!=`,stackStartFn:e})},E.deepEqual=function e(t,n,r){if(arguments.length<2)throw new p(`actual`,`expected`);S===void 0&&w(),S(t,n)||O({actual:t,expected:n,message:r,operator:`deepEqual`,stackStartFn:e})},E.notDeepEqual=function e(t,n,r){if(arguments.length<2)throw new p(`actual`,`expected`);S===void 0&&w(),S(t,n)&&O({actual:t,expected:n,message:r,operator:`notDeepEqual`,stackStartFn:e})},E.deepStrictEqual=function e(t,n,r){if(arguments.length<2)throw new p(`actual`,`expected`);S===void 0&&w(),C(t,n)||O({actual:t,expected:n,message:r,operator:`deepStrictEqual`,stackStartFn:e})},E.notDeepStrictEqual=j;function j(e,t,n){if(arguments.length<2)throw new p(`actual`,`expected`);S===void 0&&w(),C(e,t)&&O({actual:e,expected:t,message:n,operator:`notDeepStrictEqual`,stackStartFn:j})}E.strictEqual=function e(t,n,r){if(arguments.length<2)throw new p(`actual`,`expected`);b(t,n)||O({actual:t,expected:n,message:r,operator:`strictEqual`,stackStartFn:e})},E.notStrictEqual=function e(t,n,r){if(arguments.length<2)throw new p(`actual`,`expected`);b(t,n)&&O({actual:t,expected:n,message:r,operator:`notStrictEqual`,stackStartFn:e})};var M=i(function e(t,n,r){var i=this;s(this,e),n.forEach(function(e){e in t&&(r!==void 0&&typeof r[e]==`string`&&v(t[e])&&x(t[e],r[e])?i[e]=r[e]:i[e]=t[e])})});function N(e,t,n,r,i,a){if(!(n in e)||!C(e[n],t[n])){if(!r){var o=new m({actual:new M(e,i),expected:new M(t,i,e),operator:`deepStrictEqual`,stackStartFn:a});throw o.actual=e,o.expected=t,o.operator=a.name,o}O({actual:e,expected:t,message:r,operator:a.name,stackStartFn:a})}}function P(e,t,r,i){if(typeof t!=`function`){if(v(t))return x(t,e);if(arguments.length===2)throw new u(`expected`,[`Function`,`RegExp`],t);if(n(e)!==`object`||e===null){var a=new m({actual:e,expected:t,message:r,operator:`deepStrictEqual`,stackStartFn:i});throw a.operator=i.name,a}var o=Object.keys(t);if(t instanceof Error)o.push(`name`,`message`);else if(o.length===0)throw new d(`error`,t,`may not be an empty object`);return S===void 0&&w(),o.forEach(function(n){typeof e[n]==`string`&&v(t[n])&&x(t[n],e[n])||N(e,t,n,r,o,i)}),!0}return t.prototype!==void 0&&e instanceof t?!0:Error.isPrototypeOf(t)?!1:t.call({},e)===!0}function F(e){if(typeof e!=`function`)throw new u(`fn`,`Function`,e);try{e()}catch(e){return e}return D}function te(e){return _(e)||e!==null&&n(e)===`object`&&typeof e.then==`function`&&typeof e.catch==`function`}function I(e){return Promise.resolve().then(function(){var t;if(typeof e==`function`){if(t=e(),!te(t))throw new f(`instance of Promise`,`promiseFn`,t)}else if(te(e))t=e;else throw new u(`promiseFn`,[`Function`,`Promise`],e);return Promise.resolve().then(function(){return t}).then(function(){return D}).catch(function(e){return e})})}function L(e,t,r,i){if(typeof r==`string`){if(arguments.length===4)throw new u(`error`,[`Object`,`Error`,`Function`,`RegExp`],r);if(n(t)===`object`&&t!==null){if(t.message===r)throw new l(`error/message`,`The error message "${t.message}" is identical to the message.`)}else if(t===r)throw new l(`error/message`,`The error "${t}" is identical to the message.`);i=r,r=void 0}else if(r!=null&&n(r)!==`object`&&typeof r!=`function`)throw new u(`error`,[`Object`,`Error`,`Function`,`RegExp`],r);if(t===D){var a=``;r&&r.name&&(a+=` (${r.name})`),a+=i?`: ${i}`:`.`;var o=e.name===`rejects`?`rejection`:`exception`;O({actual:void 0,expected:r,operator:e.name,message:`Missing expected ${o}${a}`,stackStartFn:e})}if(r&&!P(t,r,i,e))throw t}function ne(e,t,n,r){if(t!==D){if(typeof n==`string`&&(r=n,n=void 0),!n||P(t,n)){var i=r?`: ${r}`:`.`,a=e.name===`doesNotReject`?`rejection`:`exception`;O({actual:t,expected:n,operator:e.name,message:`Got unwanted ${a}${i}
79
+ function te(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0}var I=void 0,L=!0,ne=!1,R=0,z=1,re=2,B=3;function V(e,t){return l?e.source===t.source&&e.flags===t.flags:RegExp.prototype.toString.call(e)===RegExp.prototype.toString.call(t)}function ie(e,t){if(e.byteLength!==t.byteLength)return!1;for(var n=0;n<e.byteLength;n++)if(e[n]!==t[n])return!1;return!0}function ae(e,t){return e.byteLength===t.byteLength?te(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))===0:!1}function oe(e,t){return e.byteLength===t.byteLength&&te(new Uint8Array(e),new Uint8Array(t))===0}function se(e,t){return O(e)?O(t)&&f(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):k(e)?k(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):A(e)?A(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):ee(e)?ee(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):j(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}function H(e,t,n,r){if(e===t)return e===0&&n?f(e,t):!0;if(n){if(c(e)!==`object`)return typeof e==`number`&&m(e)&&m(t);if(c(t)!==`object`||e===null||t===null||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(e===null||c(e)!==`object`)return t===null||c(t)!==`object`?e==t:!1;if(t===null||c(t)!==`object`)return!1}var i=v(e);if(i!==v(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var a=F(e,I),o=F(t,I);return a.length===o.length?le(e,t,n,r,z,a):!1}if(i===`[object Object]`&&(!C(e)&&C(t)||!T(e)&&T(t)))return!1;if(S(e)){if(!S(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(w(e)){if(!w(t)||!V(e,t))return!1}else if(E(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else if(x(e)){if(!n&&(M(e)||N(e))){if(!ie(e,t))return!1}else if(!ae(e,t))return!1;var s=F(e,I),l=F(t,I);return s.length===l.length?le(e,t,n,r,R,s):!1}else if(T(e))return!T(t)||e.size!==t.size?!1:le(e,t,n,r,re);else if(C(e))return!C(t)||e.size!==t.size?!1:le(e,t,n,r,B);else if(b(e)){if(!oe(e,t))return!1}else if(D(e)&&!se(e,t))return!1;return le(e,t,n,r,R)}function ce(e,t){return t.filter(function(t){return _(e,t)})}function le(e,t,n,r,i,a){if(arguments.length===5){a=Object.keys(e);var o=Object.keys(t);if(a.length!==o.length)return!1}for(var s=0;s<a.length;s++)if(!g(t,a[s]))return!1;if(n&&arguments.length===5){var c=p(e);if(c.length!==0){var l=0;for(s=0;s<c.length;s++){var u=c[s];if(_(e,u)){if(!_(t,u))return!1;a.push(u),l++}else if(_(t,u))return!1}var d=p(t);if(c.length!==d.length&&ce(t,d).length!==l)return!1}else{var f=p(t);if(f.length!==0&&ce(t,f).length!==0)return!1}}if(a.length===0&&(i===R||i===z&&e.length===0||e.size===0))return!0;if(r===void 0)r={val1:new Map,val2:new Map,position:0};else{var m=r.val1.get(e);if(m!==void 0){var h=r.val2.get(t);if(h!==void 0)return m===h}r.position++}r.val1.set(e,r.position),r.val2.set(t,r.position);var v=q(e,t,n,a,r,i);return r.val1.delete(e),r.val2.delete(t),v}function U(e,t,n,r){for(var i=u(e),a=0;a<i.length;a++){var o=i[a];if(H(t,o,n,r))return e.delete(o),!0}return!1}function W(e){switch(c(e)){case`undefined`:return null;case`object`:return;case`symbol`:return!1;case`string`:e=+e;case`number`:if(m(e))return!1}return!0}function ue(e,t,n){var r=W(n);return r??(t.has(r)&&!e.has(r))}function de(e,t,n,r,i){var a=W(n);if(a!=null)return a;var o=t.get(a);return o===void 0&&!t.has(a)||!H(r,o,!1,i)?!1:!e.has(a)&&H(r,o,!1,i)}function G(e,t,n,r){for(var i=null,a=u(e),o=0;o<a.length;o++){var s=a[o];if(c(s)===`object`&&s!==null)i===null&&(i=new Set),i.add(s);else if(!t.has(s)){if(n||!ue(e,t,s))return!1;i===null&&(i=new Set),i.add(s)}}if(i!==null){for(var l=u(t),d=0;d<l.length;d++){var f=l[d];if(c(f)===`object`&&f!==null){if(!U(i,f,n,r))return!1}else if(!n&&!e.has(f)&&!U(i,f,n,r))return!1}return i.size===0}return!0}function fe(e,t,n,r,i,a){for(var o=u(e),s=0;s<o.length;s++){var c=o[s];if(H(n,c,i,a)&&H(r,t.get(c),i,a))return e.delete(c),!0}return!1}function K(e,t,r,i){for(var a=null,o=d(e),s=0;s<o.length;s++){var l=n(o[s],2),u=l[0],f=l[1];if(c(u)===`object`&&u!==null)a===null&&(a=new Set),a.add(u);else{var p=t.get(u);if(p===void 0&&!t.has(u)||!H(f,p,r,i)){if(r||!de(e,t,u,f,i))return!1;a===null&&(a=new Set),a.add(u)}}}if(a!==null){for(var m=d(t),h=0;h<m.length;h++){var g=n(m[h],2),_=g[0],v=g[1];if(c(_)===`object`&&_!==null){if(!fe(a,e,_,v,r,i))return!1}else if(!r&&(!e.has(_)||!H(e.get(_),v,!1,i))&&!fe(a,e,_,v,!1,i))return!1}return a.size===0}return!0}function q(e,t,n,r,i,a){var o=0;if(a===re){if(!G(e,t,n,i))return!1}else if(a===B){if(!K(e,t,n,i))return!1}else if(a===z)for(;o<e.length;o++)if(g(e,o)){if(!g(t,o)||!H(e[o],t[o],n,i))return!1}else if(g(t,o))return!1;else{for(var s=Object.keys(e);o<s.length;o++){var c=s[o];if(!g(t,c)||!H(e[c],t[c],n,i))return!1}return s.length===Object.keys(t).length}for(o=0;o<r.length;o++){var l=r[o];if(!H(e[l],t[l],n,i))return!1}return!0}function J(e,t){return H(e,t,ne)}function Y(e,t){return H(e,t,L)}t.exports={isDeepEqual:J,isDeepStrictEqual:Y}})),Mo=c(((e,t)=>{Be();function n(e){"@babel/helpers - typeof";return n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function a(e){var t=o(e,`string`);return n(t)===`symbol`?t:String(t)}function o(e,t){if(n(e)!==`object`||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||`default`);if(n(i)!==`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function s(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var c=mo().codes,l=c.ERR_AMBIGUOUS_ARGUMENT,u=c.ERR_INVALID_ARG_TYPE,d=c.ERR_INVALID_ARG_VALUE,f=c.ERR_INVALID_RETURN_VALUE,p=c.ERR_MISSING_ARGS,m=ho(),h=Kt().inspect,g=Kt().types,_=g.isPromise,v=g.isRegExp,y=bo()(),b=So()(),x=Co()(`RegExp.prototype.test`),S,C;function w(){var e=jo();S=e.isDeepEqual,C=e.isDeepStrictEqual}var T=!1,E=t.exports=ee,D={};function O(e){throw e.message instanceof Error?e.message:new m(e)}function k(e,t,n,r,i){var a=arguments.length,o;if(a===0?o=`Failed`:a===1?(n=e,e=void 0):(T===!1&&(T=!0,(Q.emitWarning?Q.emitWarning:console.warn.bind(console))(`assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.`,`DeprecationWarning`,`DEP0094`)),a===2&&(r=`!=`)),n instanceof Error)throw n;var s={actual:e,expected:t,operator:r===void 0?`fail`:r,stackStartFn:i||k};n!==void 0&&(s.message=n);var c=new m(s);throw o&&(c.message=o,c.generatedMessage=!0),c}E.fail=k,E.AssertionError=m;function A(e,t,n,r){if(!n){var i=!1;if(t===0)i=!0,r="No value argument passed to `assert.ok()`";else if(r instanceof Error)throw r;var a=new m({actual:n,expected:!0,message:r,operator:`==`,stackStartFn:e});throw a.generatedMessage=i,a}}function ee(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];A.apply(void 0,[ee,t.length].concat(t))}E.ok=ee,E.equal=function e(t,n,r){if(arguments.length<2)throw new p(`actual`,`expected`);t!=n&&O({actual:t,expected:n,message:r,operator:`==`,stackStartFn:e})},E.notEqual=function e(t,n,r){if(arguments.length<2)throw new p(`actual`,`expected`);t==n&&O({actual:t,expected:n,message:r,operator:`!=`,stackStartFn:e})},E.deepEqual=function e(t,n,r){if(arguments.length<2)throw new p(`actual`,`expected`);S===void 0&&w(),S(t,n)||O({actual:t,expected:n,message:r,operator:`deepEqual`,stackStartFn:e})},E.notDeepEqual=function e(t,n,r){if(arguments.length<2)throw new p(`actual`,`expected`);S===void 0&&w(),S(t,n)&&O({actual:t,expected:n,message:r,operator:`notDeepEqual`,stackStartFn:e})},E.deepStrictEqual=function e(t,n,r){if(arguments.length<2)throw new p(`actual`,`expected`);S===void 0&&w(),C(t,n)||O({actual:t,expected:n,message:r,operator:`deepStrictEqual`,stackStartFn:e})},E.notDeepStrictEqual=j;function j(e,t,n){if(arguments.length<2)throw new p(`actual`,`expected`);S===void 0&&w(),C(e,t)&&O({actual:e,expected:t,message:n,operator:`notDeepStrictEqual`,stackStartFn:j})}E.strictEqual=function e(t,n,r){if(arguments.length<2)throw new p(`actual`,`expected`);b(t,n)||O({actual:t,expected:n,message:r,operator:`strictEqual`,stackStartFn:e})},E.notStrictEqual=function e(t,n,r){if(arguments.length<2)throw new p(`actual`,`expected`);b(t,n)&&O({actual:t,expected:n,message:r,operator:`notStrictEqual`,stackStartFn:e})};var M=i(function e(t,n,r){var i=this;s(this,e),n.forEach(function(e){e in t&&(r!==void 0&&typeof r[e]==`string`&&v(t[e])&&x(t[e],r[e])?i[e]=r[e]:i[e]=t[e])})});function N(e,t,n,r,i,a){if(!(n in e)||!C(e[n],t[n])){if(!r){var o=new m({actual:new M(e,i),expected:new M(t,i,e),operator:`deepStrictEqual`,stackStartFn:a});throw o.actual=e,o.expected=t,o.operator=a.name,o}O({actual:e,expected:t,message:r,operator:a.name,stackStartFn:a})}}function P(e,t,r,i){if(typeof t!=`function`){if(v(t))return x(t,e);if(arguments.length===2)throw new u(`expected`,[`Function`,`RegExp`],t);if(n(e)!==`object`||e===null){var a=new m({actual:e,expected:t,message:r,operator:`deepStrictEqual`,stackStartFn:i});throw a.operator=i.name,a}var o=Object.keys(t);if(t instanceof Error)o.push(`name`,`message`);else if(o.length===0)throw new d(`error`,t,`may not be an empty object`);return S===void 0&&w(),o.forEach(function(n){typeof e[n]==`string`&&v(t[n])&&x(t[n],e[n])||N(e,t,n,r,o,i)}),!0}return t.prototype!==void 0&&e instanceof t?!0:Error.isPrototypeOf(t)?!1:t.call({},e)===!0}function F(e){if(typeof e!=`function`)throw new u(`fn`,`Function`,e);try{e()}catch(e){return e}return D}function te(e){return _(e)||e!==null&&n(e)===`object`&&typeof e.then==`function`&&typeof e.catch==`function`}function I(e){return Promise.resolve().then(function(){var t;if(typeof e==`function`){if(t=e(),!te(t))throw new f(`instance of Promise`,`promiseFn`,t)}else if(te(e))t=e;else throw new u(`promiseFn`,[`Function`,`Promise`],e);return Promise.resolve().then(function(){return t}).then(function(){return D}).catch(function(e){return e})})}function L(e,t,r,i){if(typeof r==`string`){if(arguments.length===4)throw new u(`error`,[`Object`,`Error`,`Function`,`RegExp`],r);if(n(t)===`object`&&t!==null){if(t.message===r)throw new l(`error/message`,`The error message "${t.message}" is identical to the message.`)}else if(t===r)throw new l(`error/message`,`The error "${t}" is identical to the message.`);i=r,r=void 0}else if(r!=null&&n(r)!==`object`&&typeof r!=`function`)throw new u(`error`,[`Object`,`Error`,`Function`,`RegExp`],r);if(t===D){var a=``;r&&r.name&&(a+=` (${r.name})`),a+=i?`: ${i}`:`.`;var o=e.name===`rejects`?`rejection`:`exception`;O({actual:void 0,expected:r,operator:e.name,message:`Missing expected ${o}${a}`,stackStartFn:e})}if(r&&!P(t,r,i,e))throw t}function ne(e,t,n,r){if(t!==D){if(typeof n==`string`&&(r=n,n=void 0),!n||P(t,n)){var i=r?`: ${r}`:`.`,a=e.name===`doesNotReject`?`rejection`:`exception`;O({actual:t,expected:n,operator:e.name,message:`Got unwanted ${a}${i}
81
80
  Actual message: "${t&&t.message}"`,stackStartFn:e})}throw t}}E.throws=function e(t){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];L.apply(void 0,[e,F(t)].concat(r))},E.rejects=function e(t){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return I(t).then(function(t){return L.apply(void 0,[e,t].concat(r))})},E.doesNotThrow=function e(t){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];ne.apply(void 0,[e,F(t)].concat(r))},E.doesNotReject=function e(t){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return I(t).then(function(t){return ne.apply(void 0,[e,t].concat(r))})},E.ifError=function e(t){if(t!=null){var r=`ifError got unwanted exception: `;n(t)===`object`&&typeof t.message==`string`?t.message.length===0&&t.constructor?r+=t.constructor.name:r+=t.message:r+=h(t);var i=new m({actual:t,expected:null,operator:`ifError`,message:r,stackStartFn:e}),a=t.stack;if(typeof a==`string`){var o=a.split(`
82
81
  `);o.shift();for(var s=i.stack.split(`
83
82
  `),c=0;c<o.length;c++){var l=s.indexOf(o[c]);if(l!==-1){s=s.slice(0,l);break}}i.stack=`${s.join(`
@@ -86,25 +85,29 @@ ${o.join(`
86
85
  `)}`}throw i}};function R(e,t,r,i,a){if(!v(t))throw new u(`regexp`,`RegExp`,t);var o=a===`match`;if(typeof e!=`string`||x(t,e)!==o){if(r instanceof Error)throw r;var s=!r;r||=typeof e==`string`?(o?`The input did not match the regular expression `:`The input was expected to not match the regular expression `)+`${h(t)}. Input:
87
86
 
88
87
  ${h(e)}
89
- `:`The "string" argument must be of type string. Received type ${n(e)} (${h(e)})`;var c=new m({actual:e,expected:t,message:r,operator:a,stackStartFn:i});throw c.generatedMessage=s,c}}E.match=function e(t,n,r){R(t,n,r,e,`match`)},E.doesNotMatch=function e(t,n,r){R(t,n,r,e,`doesNotMatch`)};function z(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];A.apply(void 0,[z,t.length].concat(t))}E.strict=y(z,E,{equal:E.strictEqual,deepEqual:E.deepStrictEqual,notEqual:E.notStrictEqual,notDeepEqual:E.notDeepStrictEqual}),E.strict.strict=E.strict})),Mo=c(((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})),No=c((e=>{var t=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Int32Array<`u`;function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if(typeof r!=`object`)throw TypeError(r+`must be non-object`);for(var i in r)n(r,i)&&(e[i]=r[i])}}return e},e.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var r={arraySet:function(e,t,n,r,i){if(t.subarray&&e.subarray){e.set(t.subarray(n,n+r),i);return}for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){var t,n,r=0,i,a,o;for(t=0,n=e.length;t<n;t++)r+=e[t].length;for(o=new Uint8Array(r),i=0,t=0,n=e.length;t<n;t++)a=e[t],o.set(a,i),i+=a.length;return o}},i={arraySet:function(e,t,n,r,i){for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){return[].concat.apply([],e)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,r)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,i))},e.setTyped(t)})),Po=c((e=>{var t=No(),n=4,r=0,i=1,a=2;function o(e){for(var t=e.length;--t>=0;)e[t]=0}var s=0,c=1,l=2,u=3,d=258,f=29,p=256,m=p+1+f,h=30,g=19,_=2*m+1,v=15,y=16,b=7,x=256,S=16,C=17,w=18,T=[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],E=[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],D=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],k=512,A=Array((m+2)*2);o(A);var ee=Array(h*2);o(ee);var j=Array(k);o(j);var M=Array(d-u+1);o(M);var N=Array(f);o(N);var P=Array(h);o(P);function F(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 te,I,L;function ne(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function R(e){return e<256?j[e]:j[256+(e>>>7)]}function z(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function re(e,t,n){e.bi_valid>y-n?(e.bi_buf|=t<<e.bi_valid&65535,z(e,e.bi_buf),e.bi_buf=t>>y-e.bi_valid,e.bi_valid+=n-y):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function B(e,t,n){re(e,n[t*2],n[t*2+1])}function V(e,t){var n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1}function ie(e){e.bi_valid===16?(z(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)}function ae(e,t){var 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<=v;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<_;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--)}}function oe(e,t,n){var r=Array(v+1),i=0,a,o;for(a=1;a<=v;a++)r[a]=i=i+n[a-1]<<1;for(o=0;o<=t;o++){var s=e[o*2+1];s!==0&&(e[o*2]=V(r[s]++,s))}}function se(){var e,t,n,r,i,a=Array(v+1);for(n=0,r=0;r<f-1;r++)for(N[r]=n,e=0;e<1<<T[r];e++)M[n++]=r;for(M[n-1]=r,i=0,r=0;r<16;r++)for(P[r]=i,e=0;e<1<<E[r];e++)j[i++]=r;for(i>>=7;r<h;r++)for(P[r]=i<<7,e=0;e<1<<E[r]-7;e++)j[256+ i++]=r;for(t=0;t<=v;t++)a[t]=0;for(e=0;e<=143;)A[e*2+1]=8,e++,a[8]++;for(;e<=255;)A[e*2+1]=9,e++,a[9]++;for(;e<=279;)A[e*2+1]=7,e++,a[7]++;for(;e<=287;)A[e*2+1]=8,e++,a[8]++;for(oe(A,m+1,a),e=0;e<h;e++)ee[e*2+1]=5,ee[e*2]=V(e,5);te=new F(A,T,p+1,m,v),I=new F(ee,E,0,h,v),L=new F([],D,0,g,b)}function H(e){var t;for(t=0;t<m;t++)e.dyn_ltree[t*2]=0;for(t=0;t<h;t++)e.dyn_dtree[t*2]=0;for(t=0;t<g;t++)e.bl_tree[t*2]=0;e.dyn_ltree[x*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function ce(e){e.bi_valid>8?z(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function le(e,n,r,i){ce(e),i&&(z(e,r),z(e,~r)),t.arraySet(e.pending_buf,e.window,n,r,e.pending),e.pending+=r}function U(e,t,n,r){var i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]}function W(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&U(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!U(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function ue(e,t,n){var r,i,a=0,o,s;if(e.last_lit!==0)do r=e.pending_buf[e.d_buf+a*2]<<8|e.pending_buf[e.d_buf+a*2+1],i=e.pending_buf[e.l_buf+a],a++,r===0?B(e,i,t):(o=M[i],B(e,o+p+1,t),s=T[o],s!==0&&(i-=N[o],re(e,i,s)),r--,o=R(r),B(e,o,n),s=E[o],s!==0&&(r-=P[o],re(e,r,s)));while(a<e.last_lit);B(e,x,t)}function de(e,t){var 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=_,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--)W(e,n,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],W(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++,W(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],ae(e,t),oe(n,c,e.bl_count)}function G(e,t,n){var 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[C*2]++:e.bl_tree[w*2]++:(a!==i&&e.bl_tree[a*2]++,e.bl_tree[S*2]++),s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4))}function fe(e,t,n){var 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 B(e,a,e.bl_tree);while(--s!==0);else a===0?s<=10?(B(e,C,e.bl_tree),re(e,s-3,3)):(B(e,w,e.bl_tree),re(e,s-11,7)):(a!==i&&(B(e,a,e.bl_tree),s--),B(e,S,e.bl_tree),re(e,s-3,2));s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4)}}function K(e){var t;for(G(e,e.dyn_ltree,e.l_desc.max_code),G(e,e.dyn_dtree,e.d_desc.max_code),de(e,e.bl_desc),t=g-1;t>=3&&e.bl_tree[O[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function q(e,t,n,r){var i;for(re(e,t-257,5),re(e,n-1,5),re(e,r-4,4),i=0;i<r;i++)re(e,e.bl_tree[O[i]*2+1],3);fe(e,e.dyn_ltree,t-1),fe(e,e.dyn_dtree,n-1)}function J(e){var t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return r;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return i;for(n=32;n<p;n++)if(e.dyn_ltree[n*2]!==0)return i;return r}var Y=!1;function pe(e){Y||=(se(),!0),e.l_desc=new ne(e.dyn_ltree,te),e.d_desc=new ne(e.dyn_dtree,I),e.bl_desc=new ne(e.bl_tree,L),e.bi_buf=0,e.bi_valid=0,H(e)}function me(e,t,n,r){re(e,(s<<1)+(r?1:0),3),le(e,t,n,!0)}function he(e){re(e,c<<1,3),B(e,x,A),ie(e)}function ge(e,t,r,i){var o,s,u=0;e.level>0?(e.strm.data_type===a&&(e.strm.data_type=J(e)),de(e,e.l_desc),de(e,e.d_desc),u=K(e),o=e.opt_len+3+7>>>3,s=e.static_len+3+7>>>3,s<=o&&(o=s)):o=s=r+5,r+4<=o&&t!==-1?me(e,t,r,i):e.strategy===n||s===o?(re(e,(c<<1)+(i?1:0),3),ue(e,A,ee)):(re(e,(l<<1)+(i?1:0),3),q(e,e.l_desc.max_code+1,e.d_desc.max_code+1,u+1),ue(e,e.dyn_ltree,e.dyn_dtree)),H(e),i&&ce(e)}function X(e,t,n){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=n&255,e.last_lit++,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(M[n]+p+1)*2]++,e.dyn_dtree[R(t)*2]++),e.last_lit===e.lit_bufsize-1}e._tr_init=pe,e._tr_stored_block=me,e._tr_flush_block=ge,e._tr_tally=X,e._tr_align=he})),Fo=c(((e,t)=>{function n(e,t,n,r){for(var i=e&65535|0,a=e>>>16&65535|0,o=0;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}t.exports=n})),Io=c(((e,t)=>{function n(){for(var e,t=[],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}var r=n();function i(e,t,n,i){var a=r,o=i+n;e^=-1;for(var s=i;s<o;s++)e=e>>>8^a[(e^t[s])&255];return e^-1}t.exports=i})),Lo=c(((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`}})),Ro=c((e=>{var t=No(),n=Po(),r=Fo(),i=Io(),a=Lo(),o=0,s=1,c=3,l=4,u=5,d=0,f=1,p=-2,m=-3,h=-5,g=-1,_=1,v=2,y=3,b=4,x=0,S=2,C=8,w=9,T=15,E=8,D=286,O=30,k=19,A=2*D+1,ee=15,j=3,M=258,N=M+j+1,P=32,F=42,te=69,I=73,L=91,ne=103,R=113,z=666,re=1,B=2,V=3,ie=4,ae=3;function oe(e,t){return e.msg=a[t],t}function se(e){return(e<<1)-(e>4?9:0)}function H(e){for(var t=e.length;--t>=0;)e[t]=0}function ce(e){var n=e.state,r=n.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(t.arraySet(e.output,n.pending_buf,n.pending_out,r,e.next_out),e.next_out+=r,n.pending_out+=r,e.total_out+=r,e.avail_out-=r,n.pending-=r,n.pending===0&&(n.pending_out=0))}function le(e,t){n._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ce(e.strm)}function U(e,t){e.pending_buf[e.pending++]=t}function W(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function ue(e,n,a,o){var s=e.avail_in;return s>o&&(s=o),s===0?0:(e.avail_in-=s,t.arraySet(n,e.input,e.next_in,s,a),e.state.wrap===1?e.adler=r(e.adler,n,s,a):e.state.wrap===2&&(e.adler=i(e.adler,n,s,a)),e.next_in+=s,e.total_in+=s,s)}function de(e,t){var n=e.max_chain_length,r=e.strstart,i,a,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-N?e.strstart-(e.w_size-N):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+M,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])continue;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=M-(f-r),r=f-M,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}function G(e){var n=e.w_size,r,i,a,o,s;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=n+(n-N)){t.arraySet(e.window,e.window,n,n,0),e.match_start-=n,e.strstart-=n,e.block_start-=n,i=e.hash_size,r=i;do a=e.head[--r],e.head[r]=a>=n?a-n:0;while(--i);i=n,r=i;do a=e.prev[--r],e.prev[r]=a>=n?a-n:0;while(--i);o+=n}if(e.strm.avail_in===0)break;if(i=ue(e.strm,e.window,e.strstart+e.lookahead,o),e.lookahead+=i,e.lookahead+e.insert>=j)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+j-1])&e.hash_mask,e.prev[s&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=s,s++,e.insert--,!(e.lookahead+e.insert<j)););}while(e.lookahead<N&&e.strm.avail_in!==0)}function fe(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(G(e),e.lookahead===0&&t===o)return re;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,le(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-N&&(le(e,!1),e.strm.avail_out===0))return re}return e.insert=0,t===l?(le(e,!0),e.strm.avail_out===0?V:ie):(e.strstart>e.block_start&&(le(e,!1),e.strm.avail_out),re)}function K(e,t){for(var r,i;;){if(e.lookahead<N){if(G(e),e.lookahead<N&&t===o)return re;if(e.lookahead===0)break}if(r=0,e.lookahead>=j&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+j-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-N&&(e.match_length=de(e,r)),e.match_length>=j)if(i=n._tr_tally(e,e.strstart-e.match_start,e.match_length-j),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=j){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+j-1])&e.hash_mask,r=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=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else i=n._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(le(e,!1),e.strm.avail_out===0))return re}return e.insert=e.strstart<j-1?e.strstart:j-1,t===l?(le(e,!0),e.strm.avail_out===0?V:ie):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?re:B}function q(e,t){for(var r,i,a;;){if(e.lookahead<N){if(G(e),e.lookahead<N&&t===o)return re;if(e.lookahead===0)break}if(r=0,e.lookahead>=j&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+j-1])&e.hash_mask,r=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=j-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-N&&(e.match_length=de(e,r),e.match_length<=5&&(e.strategy===_||e.match_length===j&&e.strstart-e.match_start>4096)&&(e.match_length=j-1)),e.prev_length>=j&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-j,i=n._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-j),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=a&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+j-1])&e.hash_mask,r=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=j-1,e.strstart++,i&&(le(e,!1),e.strm.avail_out===0))return re}else if(e.match_available){if(i=n._tr_tally(e,0,e.window[e.strstart-1]),i&&le(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return re}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&=(i=n._tr_tally(e,0,e.window[e.strstart-1]),0),e.insert=e.strstart<j-1?e.strstart:j-1,t===l?(le(e,!0),e.strm.avail_out===0?V:ie):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?re:B}function J(e,t){for(var r,i,a,s,c=e.window;;){if(e.lookahead<=M){if(G(e),e.lookahead<=M&&t===o)return re;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=j&&e.strstart>0&&(a=e.strstart-1,i=c[a],i===c[++a]&&i===c[++a]&&i===c[++a])){s=e.strstart+M;do;while(i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&a<s);e.match_length=M-(s-a),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=j?(r=n._tr_tally(e,1,e.match_length-j),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=n._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(le(e,!1),e.strm.avail_out===0))return re}return e.insert=0,t===l?(le(e,!0),e.strm.avail_out===0?V:ie):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?re:B}function Y(e,t){for(var r;;){if(e.lookahead===0&&(G(e),e.lookahead===0)){if(t===o)return re;break}if(e.match_length=0,r=n._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(le(e,!1),e.strm.avail_out===0))return re}return e.insert=0,t===l?(le(e,!0),e.strm.avail_out===0?V:ie):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?re:B}function pe(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 me=[new pe(0,0,0,0,fe),new pe(4,4,8,4,K),new pe(4,5,16,8,K),new pe(4,6,32,32,K),new pe(4,4,16,16,q),new pe(8,16,32,32,q),new pe(8,16,128,128,q),new pe(8,32,128,256,q),new pe(32,128,258,1024,q),new pe(32,258,258,4096,q)];function he(e){e.window_size=2*e.w_size,H(e.head),e.max_lazy_match=me[e.level].max_lazy,e.good_match=me[e.level].good_length,e.nice_match=me[e.level].nice_length,e.max_chain_length=me[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=j-1,e.match_available=0,e.ins_h=0}function ge(){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=C,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 t.Buf16(A*2),this.dyn_dtree=new t.Buf16((2*O+1)*2),this.bl_tree=new t.Buf16((2*k+1)*2),H(this.dyn_ltree),H(this.dyn_dtree),H(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new t.Buf16(ee+1),this.heap=new t.Buf16(2*D+1),H(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new t.Buf16(2*D+1),H(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function X(e){var t;return!e||!e.state?oe(e,p):(e.total_in=e.total_out=0,e.data_type=S,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?F:R,e.adler=t.wrap===2?0:1,t.last_flush=o,n._tr_init(t),d)}function _e(e){var t=X(e);return t===d&&he(e.state),t}function Z(e,t){return!e||!e.state||e.state.wrap!==2?p:(e.state.gzhead=t,d)}function ve(e,n,r,i,a,o){if(!e)return p;var s=1;if(n===g&&(n=6),i<0?(s=0,i=-i):i>15&&(s=2,i-=16),a<1||a>w||r!==C||i<8||i>15||n<0||n>9||o<0||o>b)return oe(e,p);i===8&&(i=9);var c=new ge;return e.state=c,c.strm=e,c.wrap=s,c.gzhead=null,c.w_bits=i,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=a+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+j-1)/j),c.window=new t.Buf8(c.w_size*2),c.head=new t.Buf16(c.hash_size),c.prev=new t.Buf16(c.w_size),c.lit_bufsize=1<<a+6,c.pending_buf_size=c.lit_bufsize*4,c.pending_buf=new t.Buf8(c.pending_buf_size),c.d_buf=1*c.lit_bufsize,c.l_buf=3*c.lit_bufsize,c.level=n,c.strategy=o,c.method=r,_e(e)}function ye(e,t){return ve(e,t,C,T,E,x)}function be(e,t){var r,a,m,g;if(!e||!e.state||t>u||t<0)return e?oe(e,p):p;if(a=e.state,!e.output||!e.input&&e.avail_in!==0||a.status===z&&t!==l)return oe(e,e.avail_out===0?h:p);if(a.strm=e,r=a.last_flush,a.last_flush=t,a.status===F)if(a.wrap===2)e.adler=0,U(a,31),U(a,139),U(a,8),a.gzhead?(U(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),U(a,a.gzhead.time&255),U(a,a.gzhead.time>>8&255),U(a,a.gzhead.time>>16&255),U(a,a.gzhead.time>>24&255),U(a,a.level===9?2:a.strategy>=v||a.level<2?4:0),U(a,a.gzhead.os&255),a.gzhead.extra&&a.gzhead.extra.length&&(U(a,a.gzhead.extra.length&255),U(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(e.adler=i(e.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=te):(U(a,0),U(a,0),U(a,0),U(a,0),U(a,0),U(a,a.level===9?2:a.strategy>=v||a.level<2?4:0),U(a,ae),a.status=R);else{var _=C+(a.w_bits-8<<4)<<8,b=-1;b=a.strategy>=v||a.level<2?0:a.level<6?1:a.level===6?2:3,_|=b<<6,a.strstart!==0&&(_|=P),_+=31-_%31,a.status=R,W(a,_),a.strstart!==0&&(W(a,e.adler>>>16),W(a,e.adler&65535)),e.adler=1}if(a.status===te)if(a.gzhead.extra){for(m=a.pending;a.gzindex<(a.gzhead.extra.length&65535)&&!(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),ce(e),m=a.pending,a.pending===a.pending_buf_size));)U(a,a.gzhead.extra[a.gzindex]&255),a.gzindex++;a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),a.gzindex===a.gzhead.extra.length&&(a.gzindex=0,a.status=I)}else a.status=I;if(a.status===I)if(a.gzhead.name){m=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),ce(e),m=a.pending,a.pending===a.pending_buf_size)){g=1;break}g=a.gzindex<a.gzhead.name.length?a.gzhead.name.charCodeAt(a.gzindex++)&255:0,U(a,g)}while(g!==0);a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),g===0&&(a.gzindex=0,a.status=L)}else a.status=L;if(a.status===L)if(a.gzhead.comment){m=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),ce(e),m=a.pending,a.pending===a.pending_buf_size)){g=1;break}g=a.gzindex<a.gzhead.comment.length?a.gzhead.comment.charCodeAt(a.gzindex++)&255:0,U(a,g)}while(g!==0);a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),g===0&&(a.status=ne)}else a.status=ne;if(a.status===ne&&(a.gzhead.hcrc?(a.pending+2>a.pending_buf_size&&ce(e),a.pending+2<=a.pending_buf_size&&(U(a,e.adler&255),U(a,e.adler>>8&255),e.adler=0,a.status=R)):a.status=R),a.pending!==0){if(ce(e),e.avail_out===0)return a.last_flush=-1,d}else if(e.avail_in===0&&se(t)<=se(r)&&t!==l)return oe(e,h);if(a.status===z&&e.avail_in!==0)return oe(e,h);if(e.avail_in!==0||a.lookahead!==0||t!==o&&a.status!==z){var x=a.strategy===v?Y(a,t):a.strategy===y?J(a,t):me[a.level].func(a,t);if((x===V||x===ie)&&(a.status=z),x===re||x===V)return e.avail_out===0&&(a.last_flush=-1),d;if(x===B&&(t===s?n._tr_align(a):t!==u&&(n._tr_stored_block(a,0,0,!1),t===c&&(H(a.head),a.lookahead===0&&(a.strstart=0,a.block_start=0,a.insert=0))),ce(e),e.avail_out===0))return a.last_flush=-1,d}return t===l?a.wrap<=0?f:(a.wrap===2?(U(a,e.adler&255),U(a,e.adler>>8&255),U(a,e.adler>>16&255),U(a,e.adler>>24&255),U(a,e.total_in&255),U(a,e.total_in>>8&255),U(a,e.total_in>>16&255),U(a,e.total_in>>24&255)):(W(a,e.adler>>>16),W(a,e.adler&65535)),ce(e),a.wrap>0&&(a.wrap=-a.wrap),a.pending===0?f:d):d}function xe(e){var t;return!e||!e.state?p:(t=e.state.status,t!==F&&t!==te&&t!==I&&t!==L&&t!==ne&&t!==R&&t!==z?oe(e,p):(e.state=null,t===R?oe(e,m):d))}function Se(e,n){var i=n.length,a,o,s,c,l,u,f,m;if(!e||!e.state||(a=e.state,c=a.wrap,c===2||c===1&&a.status!==F||a.lookahead))return p;for(c===1&&(e.adler=r(e.adler,n,i,0)),a.wrap=0,i>=a.w_size&&(c===0&&(H(a.head),a.strstart=0,a.block_start=0,a.insert=0),m=new t.Buf8(a.w_size),t.arraySet(m,n,i-a.w_size,a.w_size,0),n=m,i=a.w_size),l=e.avail_in,u=e.next_in,f=e.input,e.avail_in=i,e.next_in=0,e.input=n,G(a);a.lookahead>=j;){o=a.strstart,s=a.lookahead-(j-1);do a.ins_h=(a.ins_h<<a.hash_shift^a.window[o+j-1])&a.hash_mask,a.prev[o&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=o,o++;while(--s);a.strstart=o,a.lookahead=j-1,G(a)}return a.strstart+=a.lookahead,a.block_start=a.strstart,a.insert=a.lookahead,a.lookahead=0,a.match_length=a.prev_length=j-1,a.match_available=0,e.next_in=u,e.input=f,e.avail_in=l,a.wrap=c,d}e.deflateInit=ye,e.deflateInit2=ve,e.deflateReset=_e,e.deflateResetKeep=X,e.deflateSetHeader=Z,e.deflate=be,e.deflateEnd=xe,e.deflateSetDictionary=Se,e.deflateInfo=`pako deflate (from Nodeca project)`})),zo=c(((e,t)=>{var n=30,r=12;t.exports=function(e,t){var i=e.state,a=e.next_in,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D=e.input,O;o=a+(e.avail_in-5),s=e.next_out,O=e.output,c=s-(t-e.avail_out),l=s+(e.avail_out-257),u=i.dmax,d=i.wsize,f=i.whave,p=i.wnext,m=i.window,h=i.hold,g=i.bits,_=i.lencode,v=i.distcode,y=(1<<i.lenbits)-1,b=(1<<i.distbits)-1;top:do{g<15&&(h+=D[a++]<<g,g+=8,h+=D[a++]<<g,g+=8),x=_[h&y];dolen:for(;;){if(S=x>>>24,h>>>=S,g-=S,S=x>>>16&255,S===0)O[s++]=x&65535;else if(S&16){C=x&65535,S&=15,S&&(g<S&&(h+=D[a++]<<g,g+=8),C+=h&(1<<S)-1,h>>>=S,g-=S),g<15&&(h+=D[a++]<<g,g+=8,h+=D[a++]<<g,g+=8),x=v[h&b];dodist:for(;;){if(S=x>>>24,h>>>=S,g-=S,S=x>>>16&255,S&16){if(w=x&65535,S&=15,g<S&&(h+=D[a++]<<g,g+=8,g<S&&(h+=D[a++]<<g,g+=8)),w+=h&(1<<S)-1,w>u){e.msg=`invalid distance too far back`,i.mode=n;break top}if(h>>>=S,g-=S,S=s-c,w>S){if(S=w-S,S>f&&i.sane){e.msg=`invalid distance too far back`,i.mode=n;break top}if(T=0,E=m,p===0){if(T+=d-S,S<C){C-=S;do O[s++]=m[T++];while(--S);T=s-w,E=O}}else if(p<S){if(T+=d+p-S,S-=p,S<C){C-=S;do O[s++]=m[T++];while(--S);if(T=0,p<C){S=p,C-=S;do O[s++]=m[T++];while(--S);T=s-w,E=O}}}else if(T+=p-S,S<C){C-=S;do O[s++]=m[T++];while(--S);T=s-w,E=O}for(;C>2;)O[s++]=E[T++],O[s++]=E[T++],O[s++]=E[T++],C-=3;C&&(O[s++]=E[T++],C>1&&(O[s++]=E[T++]))}else{T=s-w;do O[s++]=O[T++],O[s++]=O[T++],O[s++]=O[T++],C-=3;while(C>2);C&&(O[s++]=O[T++],C>1&&(O[s++]=O[T++]))}}else if(S&64){e.msg=`invalid distance code`,i.mode=n;break top}else{x=v[(x&65535)+(h&(1<<S)-1)];continue dodist}break}}else if(S&64)if(S&32){i.mode=r;break top}else{e.msg=`invalid literal/length code`,i.mode=n;break top}else{x=_[(x&65535)+(h&(1<<S)-1)];continue dolen}break}}while(a<o&&s<l);C=g>>3,a-=C,g-=C<<3,h&=(1<<g)-1,e.next_in=a,e.next_out=s,e.avail_in=a<o?5+(o-a):5-(a-o),e.avail_out=s<l?257+(l-s):257-(s-l),i.hold=h,i.bits=g}})),Bo=c(((e,t)=>{var n=No(),r=15,i=852,a=592,o=0,s=1,c=2,l=[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],u=[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],d=[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],f=[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=function(e,t,p,m,h,g,_,v){var y=v.bits,b=0,x=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A,ee,j,M,N,P=null,F=0,te,I=new n.Buf16(r+1),L=new n.Buf16(r+1),ne=null,R=0,z,re,B;for(b=0;b<=r;b++)I[b]=0;for(x=0;x<m;x++)I[t[p+x]]++;for(w=y,C=r;C>=1&&I[C]===0;C--);if(w>C&&(w=C),C===0)return h[g++]=20971520,h[g++]=20971520,v.bits=1,0;for(S=1;S<C&&I[S]===0;S++);for(w<S&&(w=S),D=1,b=1;b<=r;b++)if(D<<=1,D-=I[b],D<0)return-1;if(D>0&&(e===o||C!==1))return-1;for(L[1]=0,b=1;b<r;b++)L[b+1]=L[b]+I[b];for(x=0;x<m;x++)t[p+x]!==0&&(_[L[t[p+x]]++]=x);if(e===o?(P=ne=_,te=19):e===s?(P=l,F-=257,ne=u,R-=257,te=256):(P=d,ne=f,te=-1),k=0,x=0,b=S,N=g,T=w,E=0,j=-1,O=1<<w,M=O-1,e===s&&O>i||e===c&&O>a)return 1;for(;;){z=b-E,_[x]<te?(re=0,B=_[x]):_[x]>te?(re=ne[R+_[x]],B=P[F+_[x]]):(re=96,B=0),A=1<<b-E,ee=1<<T,S=ee;do ee-=A,h[N+(k>>E)+ee]=z<<24|re<<16|B|0;while(ee!==0);for(A=1<<b-1;k&A;)A>>=1;if(A===0?k=0:(k&=A-1,k+=A),x++,--I[b]===0){if(b===C)break;b=t[p+_[x]]}if(b>w&&(k&M)!==j){for(E===0&&(E=w),N+=S,T=b-E,D=1<<T;T+E<C&&(D-=I[T+E],!(D<=0));)T++,D<<=1;if(O+=1<<T,e===s&&O>i||e===c&&O>a)return 1;j=k&M,h[j]=w<<24|T<<16|N-g|0}}return k!==0&&(h[N+k]=b-E<<24|4194304),v.bits=w,0}})),Vo=c((e=>{var t=No(),n=Fo(),r=Io(),i=zo(),a=Bo(),o=0,s=1,c=2,l=4,u=5,d=6,f=0,p=1,m=2,h=-2,g=-3,_=-4,v=-5,y=8,b=1,x=2,S=3,C=4,w=5,T=6,E=7,D=8,O=9,k=10,A=11,ee=12,j=13,M=14,N=15,P=16,F=17,te=18,I=19,L=20,ne=21,R=22,z=23,re=24,B=25,V=26,ie=27,ae=28,oe=29,se=30,H=31,ce=32,le=852,U=592,W=15;function ue(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function de(){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 t.Buf16(320),this.work=new t.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function G(e){var n;return!e||!e.state?h:(n=e.state,e.total_in=e.total_out=n.total=0,e.msg=``,n.wrap&&(e.adler=n.wrap&1),n.mode=b,n.last=0,n.havedict=0,n.dmax=32768,n.head=null,n.hold=0,n.bits=0,n.lencode=n.lendyn=new t.Buf32(le),n.distcode=n.distdyn=new t.Buf32(U),n.sane=1,n.back=-1,f)}function fe(e){var t;return!e||!e.state?h:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,G(e))}function K(e,t){var n,r;return!e||!e.state||(r=e.state,t<0?(n=0,t=-t):(n=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?h:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,fe(e))}function q(e,t){var n,r;return e?(r=new de,e.state=r,r.window=null,n=K(e,t),n!==f&&(e.state=null),n):h}function J(e){return q(e,W)}var Y=!0,pe,me;function he(e){if(Y){var n;for(pe=new t.Buf32(512),me=new t.Buf32(32),n=0;n<144;)e.lens[n++]=8;for(;n<256;)e.lens[n++]=9;for(;n<280;)e.lens[n++]=7;for(;n<288;)e.lens[n++]=8;for(a(s,e.lens,0,288,pe,0,e.work,{bits:9}),n=0;n<32;)e.lens[n++]=5;a(c,e.lens,0,32,me,0,e.work,{bits:5}),Y=!1}e.lencode=pe,e.lenbits=9,e.distcode=me,e.distbits=5}function ge(e,n,r,i){var a,o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new t.Buf8(o.wsize)),i>=o.wsize?(t.arraySet(o.window,n,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(a=o.wsize-o.wnext,a>i&&(a=i),t.arraySet(o.window,n,r-i,a,o.wnext),i-=a,i?(t.arraySet(o.window,n,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=a))),0}function X(e,le){var U,W,de,G,fe,K,q,J,Y,pe,me,X,_e,Z,ve=0,ye,be,xe,Se,Ce,we,Te,Ee,De=new t.Buf8(4),Oe,ke,Ae=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return h;U=e.state,U.mode===ee&&(U.mode=j),fe=e.next_out,de=e.output,q=e.avail_out,G=e.next_in,W=e.input,K=e.avail_in,J=U.hold,Y=U.bits,pe=K,me=q,Ee=f;inf_leave:for(;;)switch(U.mode){case b:if(U.wrap===0){U.mode=j;break}for(;Y<16;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}if(U.wrap&2&&J===35615){U.check=0,De[0]=J&255,De[1]=J>>>8&255,U.check=r(U.check,De,2,0),J=0,Y=0,U.mode=x;break}if(U.flags=0,U.head&&(U.head.done=!1),!(U.wrap&1)||(((J&255)<<8)+(J>>8))%31){e.msg=`incorrect header check`,U.mode=se;break}if((J&15)!==y){e.msg=`unknown compression method`,U.mode=se;break}if(J>>>=4,Y-=4,Te=(J&15)+8,U.wbits===0)U.wbits=Te;else if(Te>U.wbits){e.msg=`invalid window size`,U.mode=se;break}U.dmax=1<<Te,e.adler=U.check=1,U.mode=J&512?k:ee,J=0,Y=0;break;case x:for(;Y<16;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}if(U.flags=J,(U.flags&255)!==y){e.msg=`unknown compression method`,U.mode=se;break}if(U.flags&57344){e.msg=`unknown header flags set`,U.mode=se;break}U.head&&(U.head.text=J>>8&1),U.flags&512&&(De[0]=J&255,De[1]=J>>>8&255,U.check=r(U.check,De,2,0)),J=0,Y=0,U.mode=S;case S:for(;Y<32;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}U.head&&(U.head.time=J),U.flags&512&&(De[0]=J&255,De[1]=J>>>8&255,De[2]=J>>>16&255,De[3]=J>>>24&255,U.check=r(U.check,De,4,0)),J=0,Y=0,U.mode=C;case C:for(;Y<16;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}U.head&&(U.head.xflags=J&255,U.head.os=J>>8),U.flags&512&&(De[0]=J&255,De[1]=J>>>8&255,U.check=r(U.check,De,2,0)),J=0,Y=0,U.mode=w;case w:if(U.flags&1024){for(;Y<16;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}U.length=J,U.head&&(U.head.extra_len=J),U.flags&512&&(De[0]=J&255,De[1]=J>>>8&255,U.check=r(U.check,De,2,0)),J=0,Y=0}else U.head&&(U.head.extra=null);U.mode=T;case T:if(U.flags&1024&&(X=U.length,X>K&&(X=K),X&&(U.head&&(Te=U.head.extra_len-U.length,U.head.extra||(U.head.extra=Array(U.head.extra_len)),t.arraySet(U.head.extra,W,G,X,Te)),U.flags&512&&(U.check=r(U.check,W,X,G)),K-=X,G+=X,U.length-=X),U.length))break inf_leave;U.length=0,U.mode=E;case E:if(U.flags&2048){if(K===0)break inf_leave;X=0;do Te=W[G+ X++],U.head&&Te&&U.length<65536&&(U.head.name+=String.fromCharCode(Te));while(Te&&X<K);if(U.flags&512&&(U.check=r(U.check,W,X,G)),K-=X,G+=X,Te)break inf_leave}else U.head&&(U.head.name=null);U.length=0,U.mode=D;case D:if(U.flags&4096){if(K===0)break inf_leave;X=0;do Te=W[G+ X++],U.head&&Te&&U.length<65536&&(U.head.comment+=String.fromCharCode(Te));while(Te&&X<K);if(U.flags&512&&(U.check=r(U.check,W,X,G)),K-=X,G+=X,Te)break inf_leave}else U.head&&(U.head.comment=null);U.mode=O;case O:if(U.flags&512){for(;Y<16;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}if(J!==(U.check&65535)){e.msg=`header crc mismatch`,U.mode=se;break}J=0,Y=0}U.head&&(U.head.hcrc=U.flags>>9&1,U.head.done=!0),e.adler=U.check=0,U.mode=ee;break;case k:for(;Y<32;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}e.adler=U.check=ue(J),J=0,Y=0,U.mode=A;case A:if(U.havedict===0)return e.next_out=fe,e.avail_out=q,e.next_in=G,e.avail_in=K,U.hold=J,U.bits=Y,m;e.adler=U.check=1,U.mode=ee;case ee:if(le===u||le===d)break inf_leave;case j:if(U.last){J>>>=Y&7,Y-=Y&7,U.mode=ie;break}for(;Y<3;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}switch(U.last=J&1,J>>>=1,--Y,J&3){case 0:U.mode=M;break;case 1:if(he(U),U.mode=L,le===d){J>>>=2,Y-=2;break inf_leave}break;case 2:U.mode=F;break;case 3:e.msg=`invalid block type`,U.mode=se}J>>>=2,Y-=2;break;case M:for(J>>>=Y&7,Y-=Y&7;Y<32;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}if((J&65535)!=(J>>>16^65535)){e.msg=`invalid stored block lengths`,U.mode=se;break}if(U.length=J&65535,J=0,Y=0,U.mode=N,le===d)break inf_leave;case N:U.mode=P;case P:if(X=U.length,X){if(X>K&&(X=K),X>q&&(X=q),X===0)break inf_leave;t.arraySet(de,W,G,X,fe),K-=X,G+=X,q-=X,fe+=X,U.length-=X;break}U.mode=ee;break;case F:for(;Y<14;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}if(U.nlen=(J&31)+257,J>>>=5,Y-=5,U.ndist=(J&31)+1,J>>>=5,Y-=5,U.ncode=(J&15)+4,J>>>=4,Y-=4,U.nlen>286||U.ndist>30){e.msg=`too many length or distance symbols`,U.mode=se;break}U.have=0,U.mode=te;case te:for(;U.have<U.ncode;){for(;Y<3;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}U.lens[Ae[U.have++]]=J&7,J>>>=3,Y-=3}for(;U.have<19;)U.lens[Ae[U.have++]]=0;if(U.lencode=U.lendyn,U.lenbits=7,Oe={bits:U.lenbits},Ee=a(o,U.lens,0,19,U.lencode,0,U.work,Oe),U.lenbits=Oe.bits,Ee){e.msg=`invalid code lengths set`,U.mode=se;break}U.have=0,U.mode=I;case I:for(;U.have<U.nlen+U.ndist;){for(;ve=U.lencode[J&(1<<U.lenbits)-1],ye=ve>>>24,be=ve>>>16&255,xe=ve&65535,!(ye<=Y);){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}if(xe<16)J>>>=ye,Y-=ye,U.lens[U.have++]=xe;else{if(xe===16){for(ke=ye+2;Y<ke;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}if(J>>>=ye,Y-=ye,U.have===0){e.msg=`invalid bit length repeat`,U.mode=se;break}Te=U.lens[U.have-1],X=3+(J&3),J>>>=2,Y-=2}else if(xe===17){for(ke=ye+3;Y<ke;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}J>>>=ye,Y-=ye,Te=0,X=3+(J&7),J>>>=3,Y-=3}else{for(ke=ye+7;Y<ke;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}J>>>=ye,Y-=ye,Te=0,X=11+(J&127),J>>>=7,Y-=7}if(U.have+X>U.nlen+U.ndist){e.msg=`invalid bit length repeat`,U.mode=se;break}for(;X--;)U.lens[U.have++]=Te}}if(U.mode===se)break;if(U.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,U.mode=se;break}if(U.lenbits=9,Oe={bits:U.lenbits},Ee=a(s,U.lens,0,U.nlen,U.lencode,0,U.work,Oe),U.lenbits=Oe.bits,Ee){e.msg=`invalid literal/lengths set`,U.mode=se;break}if(U.distbits=6,U.distcode=U.distdyn,Oe={bits:U.distbits},Ee=a(c,U.lens,U.nlen,U.ndist,U.distcode,0,U.work,Oe),U.distbits=Oe.bits,Ee){e.msg=`invalid distances set`,U.mode=se;break}if(U.mode=L,le===d)break inf_leave;case L:U.mode=ne;case ne:if(K>=6&&q>=258){e.next_out=fe,e.avail_out=q,e.next_in=G,e.avail_in=K,U.hold=J,U.bits=Y,i(e,me),fe=e.next_out,de=e.output,q=e.avail_out,G=e.next_in,W=e.input,K=e.avail_in,J=U.hold,Y=U.bits,U.mode===ee&&(U.back=-1);break}for(U.back=0;ve=U.lencode[J&(1<<U.lenbits)-1],ye=ve>>>24,be=ve>>>16&255,xe=ve&65535,!(ye<=Y);){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}if(be&&!(be&240)){for(Se=ye,Ce=be,we=xe;ve=U.lencode[we+((J&(1<<Se+Ce)-1)>>Se)],ye=ve>>>24,be=ve>>>16&255,xe=ve&65535,!(Se+ye<=Y);){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}J>>>=Se,Y-=Se,U.back+=Se}if(J>>>=ye,Y-=ye,U.back+=ye,U.length=xe,be===0){U.mode=V;break}if(be&32){U.back=-1,U.mode=ee;break}if(be&64){e.msg=`invalid literal/length code`,U.mode=se;break}U.extra=be&15,U.mode=R;case R:if(U.extra){for(ke=U.extra;Y<ke;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}U.length+=J&(1<<U.extra)-1,J>>>=U.extra,Y-=U.extra,U.back+=U.extra}U.was=U.length,U.mode=z;case z:for(;ve=U.distcode[J&(1<<U.distbits)-1],ye=ve>>>24,be=ve>>>16&255,xe=ve&65535,!(ye<=Y);){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}if(!(be&240)){for(Se=ye,Ce=be,we=xe;ve=U.distcode[we+((J&(1<<Se+Ce)-1)>>Se)],ye=ve>>>24,be=ve>>>16&255,xe=ve&65535,!(Se+ye<=Y);){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}J>>>=Se,Y-=Se,U.back+=Se}if(J>>>=ye,Y-=ye,U.back+=ye,be&64){e.msg=`invalid distance code`,U.mode=se;break}U.offset=xe,U.extra=be&15,U.mode=re;case re:if(U.extra){for(ke=U.extra;Y<ke;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}U.offset+=J&(1<<U.extra)-1,J>>>=U.extra,Y-=U.extra,U.back+=U.extra}if(U.offset>U.dmax){e.msg=`invalid distance too far back`,U.mode=se;break}U.mode=B;case B:if(q===0)break inf_leave;if(X=me-q,U.offset>X){if(X=U.offset-X,X>U.whave&&U.sane){e.msg=`invalid distance too far back`,U.mode=se;break}X>U.wnext?(X-=U.wnext,_e=U.wsize-X):_e=U.wnext-X,X>U.length&&(X=U.length),Z=U.window}else Z=de,_e=fe-U.offset,X=U.length;X>q&&(X=q),q-=X,U.length-=X;do de[fe++]=Z[_e++];while(--X);U.length===0&&(U.mode=ne);break;case V:if(q===0)break inf_leave;de[fe++]=U.length,q--,U.mode=ne;break;case ie:if(U.wrap){for(;Y<32;){if(K===0)break inf_leave;K--,J|=W[G++]<<Y,Y+=8}if(me-=q,e.total_out+=me,U.total+=me,me&&(e.adler=U.check=U.flags?r(U.check,de,me,fe-me):n(U.check,de,me,fe-me)),me=q,(U.flags?J:ue(J))!==U.check){e.msg=`incorrect data check`,U.mode=se;break}J=0,Y=0}U.mode=ae;case ae:if(U.wrap&&U.flags){for(;Y<32;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}if(J!==(U.total&4294967295)){e.msg=`incorrect length check`,U.mode=se;break}J=0,Y=0}U.mode=oe;case oe:Ee=p;break inf_leave;case se:Ee=g;break inf_leave;case H:return _;case ce:default:return h}return e.next_out=fe,e.avail_out=q,e.next_in=G,e.avail_in=K,U.hold=J,U.bits=Y,(U.wsize||me!==e.avail_out&&U.mode<se&&(U.mode<ie||le!==l))&&ge(e,e.output,e.next_out,me-e.avail_out)?(U.mode=H,_):(pe-=e.avail_in,me-=e.avail_out,e.total_in+=pe,e.total_out+=me,U.total+=me,U.wrap&&me&&(e.adler=U.check=U.flags?r(U.check,de,me,e.next_out-me):n(U.check,de,me,e.next_out-me)),e.data_type=U.bits+(U.last?64:0)+(U.mode===ee?128:0)+(U.mode===L||U.mode===N?256:0),(pe===0&&me===0||le===l)&&Ee===f&&(Ee=v),Ee)}function _e(e){if(!e||!e.state)return h;var t=e.state;return t.window&&=null,e.state=null,f}function Z(e,t){var n;return!e||!e.state||(n=e.state,!(n.wrap&2))?h:(n.head=t,t.done=!1,f)}function ve(e,t){var r=t.length,i,a,o;return!e||!e.state||(i=e.state,i.wrap!==0&&i.mode!==A)?h:i.mode===A&&(a=1,a=n(a,t,r,0),a!==i.check)?g:(o=ge(e,t,r,r),o?(i.mode=H,_):(i.havedict=1,f))}e.inflateReset=fe,e.inflateReset2=K,e.inflateResetKeep=G,e.inflateInit=J,e.inflateInit2=q,e.inflate=X,e.inflateEnd=_e,e.inflateGetHeader=Z,e.inflateSetDictionary=ve,e.inflateInfo=`pako inflate (from Nodeca project)`})),Ho=c(((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_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}})),Uo=c((e=>{var t=K();Be();var n=jo(),r=Mo(),i=Ro(),a=Vo(),o=Ho();for(var s in o)e[s]=o[s];e.NONE=0,e.DEFLATE=1,e.INFLATE=2,e.GZIP=3,e.GUNZIP=4,e.DEFLATERAW=5,e.INFLATERAW=6,e.UNZIP=7;var c=31,l=139;function u(t){if(typeof t!=`number`||t<e.DEFLATE||t>e.UNZIP)throw TypeError(`Bad argument`);this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=t,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}u.prototype.close=function(){if(this.write_in_progress){this.pending_close=!0;return}this.pending_close=!1,n(this.init_done,`close before init`),n(this.mode<=e.UNZIP),this.mode===e.DEFLATE||this.mode===e.GZIP||this.mode===e.DEFLATERAW?i.deflateEnd(this.strm):(this.mode===e.INFLATE||this.mode===e.GUNZIP||this.mode===e.INFLATERAW||this.mode===e.UNZIP)&&a.inflateEnd(this.strm),this.mode=e.NONE,this.dictionary=null},u.prototype.write=function(e,t,n,r,i,a,o){return this._write(!0,e,t,n,r,i,a,o)},u.prototype.writeSync=function(e,t,n,r,i,a,o){return this._write(!1,e,t,n,r,i,a,o)},u.prototype._write=function(r,i,a,o,s,c,l,u){if(n.equal(arguments.length,8),n(this.init_done,`write before init`),n(this.mode!==e.NONE,`already finalized`),n.equal(!1,this.write_in_progress,`write already in progress`),n.equal(!1,this.pending_close,`close is pending`),this.write_in_progress=!0,n.equal(!1,i===void 0,`must provide flush value`),this.write_in_progress=!0,i!==e.Z_NO_FLUSH&&i!==e.Z_PARTIAL_FLUSH&&i!==e.Z_SYNC_FLUSH&&i!==e.Z_FULL_FLUSH&&i!==e.Z_FINISH&&i!==e.Z_BLOCK)throw Error(`Invalid flush value`);if(a??(a=t.Buffer.alloc(0),s=0,o=0),this.strm.avail_in=s,this.strm.input=a,this.strm.next_in=o,this.strm.avail_out=u,this.strm.output=c,this.strm.next_out=l,this.flush=i,!r)return this._process(),this._checkError()?this._afterSync():void 0;var d=this;return Q.nextTick(function(){d._process(),d._after()}),this},u.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]},u.prototype._process=function(){var t=null;switch(this.mode){case e.DEFLATE:case e.GZIP:case e.DEFLATERAW:this.err=i.deflate(this.strm,this.flush);break;case e.UNZIP:switch(this.strm.avail_in>0&&(t=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(t===null)break;if(this.strm.input[t]===c){if(this.gzip_id_bytes_read=1,t++,this.strm.avail_in===1)break}else{this.mode=e.INFLATE;break}case 1:if(t===null)break;this.strm.input[t]===l?(this.gzip_id_bytes_read=2,this.mode=e.GUNZIP):this.mode=e.INFLATE;break;default:throw Error(`invalid number of gzip magic number bytes read`)}case e.INFLATE:case e.GUNZIP:case e.INFLATERAW:for(this.err=a.inflate(this.strm,this.flush),this.err===e.Z_NEED_DICT&&this.dictionary&&(this.err=a.inflateSetDictionary(this.strm,this.dictionary),this.err===e.Z_OK?this.err=a.inflate(this.strm,this.flush):this.err===e.Z_DATA_ERROR&&(this.err=e.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===e.GUNZIP&&this.err===e.Z_STREAM_END&&this.strm.next_in[0]!==0;)this.reset(),this.err=a.inflate(this.strm,this.flush);break;default:throw Error(`Unknown mode `+this.mode)}},u.prototype._checkError=function(){switch(this.err){case e.Z_OK:case e.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===e.Z_FINISH)return this._error(`unexpected end of file`),!1;break;case e.Z_STREAM_END:break;case e.Z_NEED_DICT:return this.dictionary==null?this._error(`Missing dictionary`):this._error(`Bad dictionary`),!1;default:return this._error(`Zlib error`),!1}return!0},u.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,t=this.strm.avail_in;this.write_in_progress=!1,this.callback(t,e),this.pending_close&&this.close()}},u.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},u.prototype.init=function(t,r,i,a,o){n(arguments.length===4||arguments.length===5,`init(windowBits, level, memLevel, strategy, [dictionary])`),n(t>=8&&t<=15,`invalid windowBits`),n(r>=-1&&r<=9,`invalid compression level`),n(i>=1&&i<=9,`invalid memlevel`),n(a===e.Z_FILTERED||a===e.Z_HUFFMAN_ONLY||a===e.Z_RLE||a===e.Z_FIXED||a===e.Z_DEFAULT_STRATEGY,`invalid strategy`),this._init(r,t,i,a,o),this._setDictionary()},u.prototype.params=function(){throw Error(`deflateParams Not supported`)},u.prototype.reset=function(){this._reset(),this._setDictionary()},u.prototype._init=function(t,n,o,s,c){switch(this.level=t,this.windowBits=n,this.memLevel=o,this.strategy=s,this.flush=e.Z_NO_FLUSH,this.err=e.Z_OK,(this.mode===e.GZIP||this.mode===e.GUNZIP)&&(this.windowBits+=16),this.mode===e.UNZIP&&(this.windowBits+=32),(this.mode===e.DEFLATERAW||this.mode===e.INFLATERAW)&&(this.windowBits=-1*this.windowBits),this.strm=new r,this.mode){case e.DEFLATE:case e.GZIP:case e.DEFLATERAW:this.err=i.deflateInit2(this.strm,this.level,e.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case e.INFLATE:case e.GUNZIP:case e.INFLATERAW:case e.UNZIP:this.err=a.inflateInit2(this.strm,this.windowBits);break;default:throw Error(`Unknown mode `+this.mode)}this.err!==e.Z_OK&&this._error(`Init error`),this.dictionary=c,this.write_in_progress=!1,this.init_done=!0},u.prototype._setDictionary=function(){if(this.dictionary!=null){switch(this.err=e.Z_OK,this.mode){case e.DEFLATE:case e.DEFLATERAW:this.err=i.deflateSetDictionary(this.strm,this.dictionary);break;default:break}this.err!==e.Z_OK&&this._error(`Failed to set dictionary`)}},u.prototype._reset=function(){switch(this.err=e.Z_OK,this.mode){case e.DEFLATE:case e.DEFLATERAW:case e.GZIP:this.err=i.deflateReset(this.strm);break;case e.INFLATE:case e.INFLATERAW:case e.GUNZIP:this.err=a.inflateReset(this.strm);break;default:break}this.err!==e.Z_OK&&this._error(`Failed to reset stream`)},e.Zlib=u})),Wo=c((e=>{Be();var t=K().Buffer,n=ln().Transform,r=Uo(),i=Kt(),a=jo().ok,o=K().kMaxLength,s=`Cannot create final Buffer. It would be larger than 0x`+o.toString(16)+` bytes`;r.Z_MIN_WINDOWBITS=8,r.Z_MAX_WINDOWBITS=15,r.Z_DEFAULT_WINDOWBITS=15,r.Z_MIN_CHUNK=64,r.Z_MAX_CHUNK=1/0,r.Z_DEFAULT_CHUNK=16*1024,r.Z_MIN_MEMLEVEL=1,r.Z_MAX_MEMLEVEL=9,r.Z_DEFAULT_MEMLEVEL=8,r.Z_MIN_LEVEL=-1,r.Z_MAX_LEVEL=9,r.Z_DEFAULT_LEVEL=r.Z_DEFAULT_COMPRESSION;for(var c=Object.keys(r),l=0;l<c.length;l++){var u=c[l];u.match(/^Z/)&&Object.defineProperty(e,u,{enumerable:!0,value:r[u],writable:!1})}for(var d={Z_OK:r.Z_OK,Z_STREAM_END:r.Z_STREAM_END,Z_NEED_DICT:r.Z_NEED_DICT,Z_ERRNO:r.Z_ERRNO,Z_STREAM_ERROR:r.Z_STREAM_ERROR,Z_DATA_ERROR:r.Z_DATA_ERROR,Z_MEM_ERROR:r.Z_MEM_ERROR,Z_BUF_ERROR:r.Z_BUF_ERROR,Z_VERSION_ERROR:r.Z_VERSION_ERROR},f=Object.keys(d),p=0;p<f.length;p++){var m=f[p];d[d[m]]=m}Object.defineProperty(e,`codes`,{enumerable:!0,value:Object.freeze(d),writable:!1}),e.Deflate=_,e.Inflate=v,e.Gzip=y,e.Gunzip=b,e.DeflateRaw=x,e.InflateRaw=S,e.Unzip=C,e.createDeflate=function(e){return new _(e)},e.createInflate=function(e){return new v(e)},e.createDeflateRaw=function(e){return new x(e)},e.createInflateRaw=function(e){return new S(e)},e.createGzip=function(e){return new y(e)},e.createGunzip=function(e){return new b(e)},e.createUnzip=function(e){return new C(e)},e.deflate=function(e,t,n){return typeof t==`function`&&(n=t,t={}),h(new _(t),e,n)},e.deflateSync=function(e,t){return g(new _(t),e)},e.gzip=function(e,t,n){return typeof t==`function`&&(n=t,t={}),h(new y(t),e,n)},e.gzipSync=function(e,t){return g(new y(t),e)},e.deflateRaw=function(e,t,n){return typeof t==`function`&&(n=t,t={}),h(new x(t),e,n)},e.deflateRawSync=function(e,t){return g(new x(t),e)},e.unzip=function(e,t,n){return typeof t==`function`&&(n=t,t={}),h(new C(t),e,n)},e.unzipSync=function(e,t){return g(new C(t),e)},e.inflate=function(e,t,n){return typeof t==`function`&&(n=t,t={}),h(new v(t),e,n)},e.inflateSync=function(e,t){return g(new v(t),e)},e.gunzip=function(e,t,n){return typeof t==`function`&&(n=t,t={}),h(new b(t),e,n)},e.gunzipSync=function(e,t){return g(new b(t),e)},e.inflateRaw=function(e,t,n){return typeof t==`function`&&(n=t,t={}),h(new S(t),e,n)},e.inflateRawSync=function(e,t){return g(new S(t),e)};function h(e,n,r){var i=[],a=0;e.on(`error`,l),e.on(`end`,u),e.end(n),c();function c(){for(var t;(t=e.read())!==null;)i.push(t),a+=t.length;e.once(`readable`,c)}function l(t){e.removeListener(`end`,u),e.removeListener(`readable`,c),r(t)}function u(){var n,c=null;a>=o?c=RangeError(s):n=t.concat(i,a),i=[],e.close(),r(c,n)}}function g(e,n){if(typeof n==`string`&&(n=t.from(n)),!t.isBuffer(n))throw TypeError(`Not a string or buffer`);var r=e._finishFlushFlag;return e._processChunk(n,r)}function _(e){if(!(this instanceof _))return new _(e);T.call(this,e,r.DEFLATE)}function v(e){if(!(this instanceof v))return new v(e);T.call(this,e,r.INFLATE)}function y(e){if(!(this instanceof y))return new y(e);T.call(this,e,r.GZIP)}function b(e){if(!(this instanceof b))return new b(e);T.call(this,e,r.GUNZIP)}function x(e){if(!(this instanceof x))return new x(e);T.call(this,e,r.DEFLATERAW)}function S(e){if(!(this instanceof S))return new S(e);T.call(this,e,r.INFLATERAW)}function C(e){if(!(this instanceof C))return new C(e);T.call(this,e,r.UNZIP)}function w(e){return e===r.Z_NO_FLUSH||e===r.Z_PARTIAL_FLUSH||e===r.Z_SYNC_FLUSH||e===r.Z_FULL_FLUSH||e===r.Z_FINISH||e===r.Z_BLOCK}function T(i,a){var o=this;if(this._opts=i||={},this._chunkSize=i.chunkSize||e.Z_DEFAULT_CHUNK,n.call(this,i),i.flush&&!w(i.flush))throw Error(`Invalid flush flag: `+i.flush);if(i.finishFlush&&!w(i.finishFlush))throw Error(`Invalid flush flag: `+i.finishFlush);if(this._flushFlag=i.flush||r.Z_NO_FLUSH,this._finishFlushFlag=i.finishFlush===void 0?r.Z_FINISH:i.finishFlush,i.chunkSize&&(i.chunkSize<e.Z_MIN_CHUNK||i.chunkSize>e.Z_MAX_CHUNK))throw Error(`Invalid chunk size: `+i.chunkSize);if(i.windowBits&&(i.windowBits<e.Z_MIN_WINDOWBITS||i.windowBits>e.Z_MAX_WINDOWBITS))throw Error(`Invalid windowBits: `+i.windowBits);if(i.level&&(i.level<e.Z_MIN_LEVEL||i.level>e.Z_MAX_LEVEL))throw Error(`Invalid compression level: `+i.level);if(i.memLevel&&(i.memLevel<e.Z_MIN_MEMLEVEL||i.memLevel>e.Z_MAX_MEMLEVEL))throw Error(`Invalid memLevel: `+i.memLevel);if(i.strategy&&i.strategy!=e.Z_FILTERED&&i.strategy!=e.Z_HUFFMAN_ONLY&&i.strategy!=e.Z_RLE&&i.strategy!=e.Z_FIXED&&i.strategy!=e.Z_DEFAULT_STRATEGY)throw Error(`Invalid strategy: `+i.strategy);if(i.dictionary&&!t.isBuffer(i.dictionary))throw Error(`Invalid dictionary: it should be a Buffer instance`);this._handle=new r.Zlib(a);var s=this;this._hadError=!1,this._handle.onerror=function(t,n){E(s),s._hadError=!0;var r=Error(t);r.errno=n,r.code=e.codes[n],s.emit(`error`,r)};var c=e.Z_DEFAULT_COMPRESSION;typeof i.level==`number`&&(c=i.level);var l=e.Z_DEFAULT_STRATEGY;typeof i.strategy==`number`&&(l=i.strategy),this._handle.init(i.windowBits||e.Z_DEFAULT_WINDOWBITS,c,i.memLevel||e.Z_DEFAULT_MEMLEVEL,l,i.dictionary),this._buffer=t.allocUnsafe(this._chunkSize),this._offset=0,this._level=c,this._strategy=l,this.once(`end`,this.close),Object.defineProperty(this,`_closed`,{get:function(){return!o._handle},configurable:!0,enumerable:!0})}i.inherits(T,n),T.prototype.params=function(t,n,i){if(t<e.Z_MIN_LEVEL||t>e.Z_MAX_LEVEL)throw RangeError(`Invalid compression level: `+t);if(n!=e.Z_FILTERED&&n!=e.Z_HUFFMAN_ONLY&&n!=e.Z_RLE&&n!=e.Z_FIXED&&n!=e.Z_DEFAULT_STRATEGY)throw TypeError(`Invalid strategy: `+n);if(this._level!==t||this._strategy!==n){var o=this;this.flush(r.Z_SYNC_FLUSH,function(){a(o._handle,`zlib binding closed`),o._handle.params(t,n),o._hadError||(o._level=t,o._strategy=n,i&&i())})}else Q.nextTick(i)},T.prototype.reset=function(){return a(this._handle,`zlib binding closed`),this._handle.reset()},T.prototype._flush=function(e){this._transform(t.alloc(0),``,e)},T.prototype.flush=function(e,n){var i=this,a=this._writableState;(typeof e==`function`||e===void 0&&!n)&&(n=e,e=r.Z_FULL_FLUSH),a.ended?n&&Q.nextTick(n):a.ending?n&&this.once(`end`,n):a.needDrain?n&&this.once(`drain`,function(){return i.flush(e,n)}):(this._flushFlag=e,this.write(t.alloc(0),``,n))},T.prototype.close=function(e){E(this,e),Q.nextTick(D,this)};function E(e,t){t&&Q.nextTick(t),e._handle&&=(e._handle.close(),null)}function D(e){e.emit(`close`)}T.prototype._transform=function(e,n,i){var a,o=this._writableState,s=(o.ending||o.ended)&&(!e||o.length===e.length);if(e!==null&&!t.isBuffer(e))return i(Error(`invalid input`));if(!this._handle)return i(Error(`zlib binding closed`));s?a=this._finishFlushFlag:(a=this._flushFlag,e.length>=o.length&&(this._flushFlag=this._opts.flush||r.Z_NO_FLUSH)),this._processChunk(e,a,i)},T.prototype._processChunk=function(e,n,r){var i=e&&e.length,c=this._chunkSize-this._offset,l=0,u=this,d=typeof r==`function`;if(!d){var f=[],p=0,m;this.on(`error`,function(e){m=e}),a(this._handle,`zlib binding closed`);do var h=this._handle.writeSync(n,e,l,i,this._buffer,this._offset,c);while(!this._hadError&&v(h[0],h[1]));if(this._hadError)throw m;if(p>=o)throw E(this),RangeError(s);var g=t.concat(f,p);return E(this),g}a(this._handle,`zlib binding closed`);var _=this._handle.write(n,e,l,i,this._buffer,this._offset,c);_.buffer=e,_.callback=v;function v(o,s){if(this&&(this.buffer=null,this.callback=null),!u._hadError){var m=c-s;if(a(m>=0,`have should not go down`),m>0){var h=u._buffer.slice(u._offset,u._offset+m);u._offset+=m,d?u.push(h):(f.push(h),p+=h.length)}if((s===0||u._offset>=u._chunkSize)&&(c=u._chunkSize,u._offset=0,u._buffer=t.allocUnsafe(u._chunkSize)),s===0){if(l+=i-o,i=o,!d)return!0;var g=u._handle.write(n,e,l,i,u._buffer,u._offset,u._chunkSize);g.callback=v,g.buffer=e;return}if(!d)return!1;r()}}},i.inherits(_,T),i.inherits(v,T),i.inherits(y,T),i.inherits(b,T),i.inherits(x,T),i.inherits(S,T),i.inherits(C,T)})),Go=ln(),Ko=d(We(),1);Be();let qo=Q!==void 0&&Q.versions?.node,Jo=null;qo&&Promise.resolve().then(()=>d(Wo(),1)).then(e=>(Jo=e.default??e,Jo)).catch(()=>(Jo=null,null));let Yo=(()=>{let e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e})();function Xo(e){let t=4294967295;for(let n=0;n<e.length;n++)t=Yo[(t^e[n])&255]^t>>>8;return(t^4294967295)>>>0}function Zo(e){return Jo&&typeof Jo.crc32==`function`?Jo.crc32(e)>>>0:Xo(e)}var Qo=K();Be();let $o=Q!==void 0&&Q.versions?.node,es=null,ts=null;$o&&(ts=Promise.resolve().then(()=>d(Wo(),1)).then(e=>(es=e.default??e,es)).catch(()=>(es=null,null)));function ns(){return es}async function rs(){return ts||es}async function is(e,t={}){let n=t.level??6;if(n===0)return e;let r=await rs();if(r&&typeof r.deflateRawSync==`function`){let t=r.deflateRawSync(Qo.Buffer.from(e),{level:n});return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}return typeof CompressionStream<`u`?os(e):(console.warn(`No native compression available, returning uncompressed data`),e)}function as(e,t={}){let n=t.level??6;if(n===0)return e;let r=ns();if(!r||typeof r.deflateRawSync!=`function`)throw Error(`Synchronous compression is only available in Node.js environment`);let i=r.deflateRawSync(Qo.Buffer.from(e),{level:n});return new Uint8Array(i.buffer,i.byteOffset,i.byteLength)}async function os(e){let t=new CompressionStream(`deflate-raw`),n=t.writable.getWriter(),r=t.readable.getReader();n.write(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),n.close();let i=[],a=0;for(;;){let{done:e,value:t}=await r.read();if(e)break;i.push(t),a+=t.length}let o=new Uint8Array(a),s=0;for(let e of i)o.set(e,s),s+=e.length;return o}function ss(e){return[(e.getHours()&31)<<11|(e.getMinutes()&63)<<5|e.getSeconds()>>1&31,(e.getFullYear()-1980&127)<<9|(e.getMonth()+1&15)<<5|e.getDate()&31]}let cs=new TextEncoder;function ls(e){return cs.encode(e)}function us(e){let t=new Uint8Array(30+e.name.length),n=new DataView(t.buffer);return n.setUint32(0,67324752,!0),n.setUint16(4,20,!0),n.setUint16(6,2048,!0),n.setUint16(8,e.compressionMethod,!0),n.setUint16(10,e.modTime,!0),n.setUint16(12,e.modDate,!0),n.setUint32(14,e.crc,!0),n.setUint32(18,e.compressedData.length,!0),n.setUint32(22,e.data.length,!0),n.setUint16(26,e.name.length,!0),n.setUint16(28,0,!0),t.set(e.name,30),t}function ds(e){let t=new Uint8Array(46+e.name.length+e.comment.length),n=new DataView(t.buffer);return n.setUint32(0,33639248,!0),n.setUint16(4,20,!0),n.setUint16(6,20,!0),n.setUint16(8,2048,!0),n.setUint16(10,e.compressionMethod,!0),n.setUint16(12,e.modTime,!0),n.setUint16(14,e.modDate,!0),n.setUint32(16,e.crc,!0),n.setUint32(20,e.compressedData.length,!0),n.setUint32(24,e.data.length,!0),n.setUint16(28,e.name.length,!0),n.setUint16(30,0,!0),n.setUint16(32,e.comment.length,!0),n.setUint16(34,0,!0),n.setUint16(36,0,!0),n.setUint32(38,0,!0),n.setUint32(42,e.offset,!0),t.set(e.name,46),e.comment.length>0&&t.set(e.comment,46+e.name.length),t}function fs(e,t,n,r){let i=new Uint8Array(22+r.length),a=new DataView(i.buffer);return a.setUint32(0,101010256,!0),a.setUint16(4,0,!0),a.setUint16(6,0,!0),a.setUint16(8,e,!0),a.setUint16(10,e,!0),a.setUint32(12,t,!0),a.setUint32(16,n,!0),a.setUint16(20,r.length,!0),r.length>0&&i.set(r,22),i}var ps=class{constructor(e={}){this.entries=[],this.currentOffset=0,this.finalized=!1,this.level=e.level??6,this.zipComment=ls(e.comment??``)}async addFile(e){if(this.finalized)throw Error(`Cannot add files after finalizing`);let t=ls(e.name),n=ls(e.comment??``),[r,i]=ss(e.modTime??new Date),a=this.level>0&&e.data.length>0,o=a?await is(e.data,{level:this.level}):e.data,s={name:t,data:e.data,compressedData:o,crc:Zo(e.data),compressionMethod:a?8:0,modTime:r,modDate:i,comment:n,offset:this.currentOffset};return this.entries.push(s),this.currentOffset+=30+t.length+o.length,[us(s),o]}addFileSync(e){if(this.finalized)throw Error(`Cannot add files after finalizing`);let t=ls(e.name),n=ls(e.comment??``),[r,i]=ss(e.modTime??new Date),a=this.level>0&&e.data.length>0,o=a?as(e.data,{level:this.level}):e.data,s={name:t,data:e.data,compressedData:o,crc:Zo(e.data),compressionMethod:a?8:0,modTime:r,modDate:i,comment:n,offset:this.currentOffset};return this.entries.push(s),this.currentOffset+=30+t.length+o.length,[us(s),o]}finalize(){if(this.finalized)throw Error(`ZIP already finalized`);this.finalized=!0;let e=[];for(let t of this.entries)e.push(ds(t));let t=e.reduce((e,t)=>e+t.length,0);return e.push(fs(this.entries.length,t,this.currentOffset,this.zipComment)),e}get entryCount(){return this.entries.length}get dataSize(){return this.currentOffset}},ms=K(),hs=class{constructor(e){this._buf=ms.Buffer.alloc(e&&e.size||16384),this._encoding=e&&e.encoding||`utf8`,this._inPos=0,this._buffer=void 0}get length(){return this._inPos}get capacity(){return this._buf.length}get buffer(){return this._buf}toBuffer(){return this._buffer||(this._buffer=ms.Buffer.alloc(this.length),this._buf.copy(this._buffer,0,0,this.length)),this._buffer}reset(e){e||=0,this._buffer=void 0,this._inPos=e}_grow(e){let t=this._buf.length*2;for(;t<e;)t*=2;let n=ms.Buffer.alloc(t);this._buf.copy(n,0),this._buf=n}addText(e){this._buffer=void 0;let t=this._inPos+this._buf.write(e,this._inPos,this._encoding);for(;t>=this._buf.length-4;)this._grow(this._inPos+e.length),t=this._inPos+this._buf.write(e,this._inPos,this._encoding);this._inPos=t}addStringBuf(e){e.length&&(this._buffer=void 0,this.length+e.length>this.capacity&&this._grow(this.length+e.length),e._buf.copy(this._buf,this._inPos,0,e.length),this._inPos+=e.length)}},gs=K(),_s=class{constructor(e,t){this._data=e,this._encoding=t}get length(){return this.toBuffer().length}copy(e,t,n,r){return this.toBuffer().copy(e,t,n,r)}toBuffer(){return this._buffer||=gs.Buffer.from(this._data,this._encoding),this._buffer}},vs=class{constructor(e){this._data=e}get length(){return this._data.length}copy(e,t,n,r){return this._data._buf.copy(e,t,n,r)}toBuffer(){return this._data.toBuffer()}},ys=class{constructor(e){this._data=e}get length(){return this._data.length}copy(e,t,n,r){this._data.copy(e,t,n,r)}toBuffer(){return this._data}},bs=class{constructor(e){this.size=e,this.buffer=gs.Buffer.alloc(e),this.iRead=0,this.iWrite=0}toBuffer(){if(this.iRead===0&&this.iWrite===this.size)return this.buffer;let e=gs.Buffer.alloc(this.iWrite-this.iRead);return this.buffer.copy(e,0,this.iRead,this.iWrite),e}get length(){return this.iWrite-this.iRead}get eod(){return this.iRead===this.iWrite}get full(){return this.iWrite===this.size}read(e){let t;return e===0?null:e===void 0||e>=this.length?(t=this.toBuffer(),this.iRead=this.iWrite,t):(t=gs.Buffer.alloc(e),this.buffer.copy(t,0,this.iRead,e),this.iRead+=e,t)}write(e,t,n){let r=Math.min(n,this.size-this.iWrite);return e.copy(this.buffer,this.iWrite,t,t+r),this.iWrite+=r,r}};let xs=function(e){if(!(this instanceof xs))return new xs(e);Go.Duplex.call(this,e),e||={},this.bufSize=e.bufSize||1024*1024,this.buffers=[],this.batch=e.batch||!1,this.corked=!1,this.inPos=0,this.outPos=0,this.pipes=[],this.paused=!1,this.encoding=null};Qi(xs,Go.Duplex,{toBuffer(){switch(this.buffers.length){case 0:return null;case 1:return this.buffers[0].toBuffer();default:return gs.Buffer.concat(this.buffers.map(e=>e.toBuffer()))}},_getWritableBuffer(){if(this.buffers.length){let e=this.buffers[this.buffers.length-1];if(!e.full)return e}let e=new bs(this.bufSize);return this.buffers.push(e),e},async _pipe(e){await Promise.all(this.pipes.map(function(t){return new Promise(n=>{t.write(e.toBuffer(),()=>{n()})})}))},_writeToBuffers(e){let t=0,n=e.length;for(;t<n;){let r=this._getWritableBuffer();t+=r.write(e,t,n-t)}},async write(e,t,n){t instanceof Function&&(n=t,t=`utf8`),n||=Zi;let r;if(e instanceof hs||e&&e.constructor?.name===`StringBuf`)r=new vs(e);else if(gs.Buffer.isBuffer(e))r=new ys(e);else if(ArrayBuffer.isView(e))r=new ys(gs.Buffer.from(e.buffer,e.byteOffset,e.byteLength));else if(e instanceof ArrayBuffer)r=new ys(gs.Buffer.from(e));else if(typeof e==`string`||e instanceof String)r=new _s(String(e),t);else throw Error(`Chunk must be one of type String, Buffer, Uint8Array, ArrayBuffer or StringBuf.`);if(this.pipes.length)if(this.batch)for(this._writeToBuffers(r);!this.corked&&this.buffers.length>1;)this._pipe(this.buffers.shift());else this.corked?(this._writeToBuffers(r),queueMicrotask(()=>n())):(await this._pipe(r),n());else this.paused||this.emit(`data`,r.toBuffer()),this._writeToBuffers(r),this.emit(`readable`);return!0},cork(){this.corked=!0},_flush(){if(this.pipes.length)for(;this.buffers.length;)this._pipe(this.buffers.shift())},uncork(){this.corked=!1,this._flush()},end(e,t,n){let r=e=>{e?n(e):(this._flush(),this.pipes.forEach(e=>{e.end()}),this.emit(`finish`))};e?this.write(e,t,r):r()},read(e){let t;if(e){for(t=[];e&&this.buffers.length&&!this.buffers[0].eod;){let n=this.buffers[0],r=n.read(e);e-=r.length,t.push(r),n.eod&&n.full&&this.buffers.shift()}return gs.Buffer.concat(t)}return t=this.buffers.map(e=>e.toBuffer()).filter(Boolean),this.buffers=[],gs.Buffer.concat(t)},setEncoding(e){this.encoding=e},pause(){this.paused=!0},resume(){this.paused=!1},isPaused(){return!!this.paused},pipe(e){return this.pipes.push(e),!this.paused&&this.buffers.length&&this.end(),e},unpipe(e){this.pipes=this.pipes.filter(t=>t!==e)},unshift(){throw Error(`Not Implemented`)},wrap(){throw Error(`Not Implemented`)}});var Ss=K(),Cs=class extends Ko.default.EventEmitter{constructor(e){super(),this.finalized=!1,this.pendingWrites=[];let t=e?.compression===`STORE`?0:Math.max(0,Math.min(9,e?.compressionOptions?.level??1));this.stream=new xs,this.zipBuilder=new ps({level:t})}append(e,t){let n;if(Object.prototype.hasOwnProperty.call(t,`base64`)&&t.base64){let t=typeof e==`string`?e:e.toString();n=Ss.Buffer.from(t,`base64`)}else n=typeof e==`string`?Ss.Buffer.from(e,`utf8`):Ss.Buffer.isBuffer(e)?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer?new Uint8Array(e):e;let r=this.zipBuilder.addFile({name:t.name,data:n}).then(e=>{for(let t of e)this.stream.write(Ss.Buffer.from(t))});this.pendingWrites.push(r)}push(e){return this.stream.push(e)}async finalize(){if(this.finalized)return;this.finalized=!0,await Promise.all(this.pendingWrites);let e=this.zipBuilder.finalize();for(let t of e)this.stream.write(Ss.Buffer.from(t));this.stream.end(),this.emit(`finish`)}read(e){return this.stream.read(e)}setEncoding(e){return this.stream.setEncoding(e)}pause(){return this.stream.pause()}resume(){return this.stream.resume()}isPaused(){return this.stream.isPaused()}pipe(e,t){return this.stream.pipe(e,t)}unpipe(e){return this.stream.unpipe(e)}unshift(e){return this.stream.unshift(e)}wrap(e){return this.stream.wrap(e)}};let ws=1e4;function Ts(e,t,n){e.push(` ${t}="${na(n.toString())}"`)}function Es(e,t){if(t){let n=[];Object.entries(t).forEach(([e,t])=>{t!==void 0&&Ts(n,e,t)}),e.push(n.join(``))}}var Ds=class{constructor(){this._xml=[],this._chunks=[],this._stack=[],this._rollbacks=[]}_consolidate(){this._xml.length>=ws&&(this._chunks.push(this._xml.join(``)),this._xml=[])}get tos(){return this._stack.length?this._stack[this._stack.length-1]:void 0}get cursor(){return this._chunks.length*ws+this._xml.length}openXml(e){let t=this._xml;t.push(`<?xml`),Es(t,e),t.push(`?>
90
- `)}openNode(e,t){let n=this.tos,r=this._xml;n&&this.open&&r.push(`>`),this._stack.push(e),r.push(`<`),r.push(e),Es(r,t),this.leaf=!0,this.open=!0}addAttribute(e,t){if(!this.open)throw Error(`Cannot write attributes to node if it is not open`);t!==void 0&&Ts(this._xml,e,t)}addAttributes(e){if(!this.open)throw Error(`Cannot write attributes to node if it is not open`);Es(this._xml,e)}writeText(e){let t=this._xml;this.open&&=(t.push(`>`),!1),this.leaf=!1,t.push(na(e.toString()))}writeXml(e){this.open&&=(this._xml.push(`>`),!1),this.leaf=!1,this._xml.push(e)}closeNode(){let e=this._stack.pop(),t=this._xml;this.leaf?t.push(`/>`):(t.push(`</`),t.push(e),t.push(`>`)),this.open=!1,this.leaf=!1,this._consolidate()}leafNode(e,t,n){this.openNode(e,t),n!==void 0&&this.writeText(n),this.closeNode()}closeAll(){for(;this._stack.length;)this.closeNode()}addRollback(){return this._rollbacks.push({xml:this._xml.length,stack:this._stack.length,leaf:this.leaf,open:this.open,chunksLength:this._chunks.length}),this.cursor}commit(){this._rollbacks.pop()}rollback(){let e=this._rollbacks.pop();this._xml.length>e.xml&&this._xml.splice(e.xml,this._xml.length-e.xml),this._stack.length>e.stack&&this._stack.splice(e.stack,this._stack.length-e.stack),this._chunks.length>e.chunksLength&&this._chunks.splice(e.chunksLength,this._chunks.length-e.chunksLength),this.leaf=e.leaf,this.open=e.open}get xml(){return this.closeAll(),this._chunks.length===0?this._xml.join(``):(this._xml.length>0&&this._chunks.push(this._xml.join(``)),this._chunks.join(``))}static{this.StdDocAttributes={version:`1.0`,encoding:`UTF-8`,standalone:`yes`}}},Os=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CHAR=`
88
+ `:`The "string" argument must be of type string. Received type ${n(e)} (${h(e)})`;var c=new m({actual:e,expected:t,message:r,operator:a,stackStartFn:i});throw c.generatedMessage=s,c}}E.match=function e(t,n,r){R(t,n,r,e,`match`)},E.doesNotMatch=function e(t,n,r){R(t,n,r,e,`doesNotMatch`)};function z(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];A.apply(void 0,[z,t.length].concat(t))}E.strict=y(z,E,{equal:E.strictEqual,deepEqual:E.deepStrictEqual,notEqual:E.notStrictEqual,notDeepEqual:E.notDeepStrictEqual}),E.strict.strict=E.strict})),No=c(((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})),Po=c((e=>{var t=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Int32Array<`u`;function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if(typeof r!=`object`)throw TypeError(r+`must be non-object`);for(var i in r)n(r,i)&&(e[i]=r[i])}}return e},e.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var r={arraySet:function(e,t,n,r,i){if(t.subarray&&e.subarray){e.set(t.subarray(n,n+r),i);return}for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){var t,n,r=0,i,a,o;for(t=0,n=e.length;t<n;t++)r+=e[t].length;for(o=new Uint8Array(r),i=0,t=0,n=e.length;t<n;t++)a=e[t],o.set(a,i),i+=a.length;return o}},i={arraySet:function(e,t,n,r,i){for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){return[].concat.apply([],e)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,r)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,i))},e.setTyped(t)})),Fo=c((e=>{var t=Po(),n=4,r=0,i=1,a=2;function o(e){for(var t=e.length;--t>=0;)e[t]=0}var s=0,c=1,l=2,u=3,d=258,f=29,p=256,m=p+1+f,h=30,g=19,_=2*m+1,v=15,y=16,b=7,x=256,S=16,C=17,w=18,T=[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],E=[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],D=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],k=512,A=Array((m+2)*2);o(A);var ee=Array(h*2);o(ee);var j=Array(k);o(j);var M=Array(d-u+1);o(M);var N=Array(f);o(N);var P=Array(h);o(P);function F(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 te,I,L;function ne(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function R(e){return e<256?j[e]:j[256+(e>>>7)]}function z(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function re(e,t,n){e.bi_valid>y-n?(e.bi_buf|=t<<e.bi_valid&65535,z(e,e.bi_buf),e.bi_buf=t>>y-e.bi_valid,e.bi_valid+=n-y):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function B(e,t,n){re(e,n[t*2],n[t*2+1])}function V(e,t){var n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1}function ie(e){e.bi_valid===16?(z(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)}function ae(e,t){var 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<=v;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<_;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--)}}function oe(e,t,n){var r=Array(v+1),i=0,a,o;for(a=1;a<=v;a++)r[a]=i=i+n[a-1]<<1;for(o=0;o<=t;o++){var s=e[o*2+1];s!==0&&(e[o*2]=V(r[s]++,s))}}function se(){var e,t,n,r,i,a=Array(v+1);for(n=0,r=0;r<f-1;r++)for(N[r]=n,e=0;e<1<<T[r];e++)M[n++]=r;for(M[n-1]=r,i=0,r=0;r<16;r++)for(P[r]=i,e=0;e<1<<E[r];e++)j[i++]=r;for(i>>=7;r<h;r++)for(P[r]=i<<7,e=0;e<1<<E[r]-7;e++)j[256+ i++]=r;for(t=0;t<=v;t++)a[t]=0;for(e=0;e<=143;)A[e*2+1]=8,e++,a[8]++;for(;e<=255;)A[e*2+1]=9,e++,a[9]++;for(;e<=279;)A[e*2+1]=7,e++,a[7]++;for(;e<=287;)A[e*2+1]=8,e++,a[8]++;for(oe(A,m+1,a),e=0;e<h;e++)ee[e*2+1]=5,ee[e*2]=V(e,5);te=new F(A,T,p+1,m,v),I=new F(ee,E,0,h,v),L=new F([],D,0,g,b)}function H(e){var t;for(t=0;t<m;t++)e.dyn_ltree[t*2]=0;for(t=0;t<h;t++)e.dyn_dtree[t*2]=0;for(t=0;t<g;t++)e.bl_tree[t*2]=0;e.dyn_ltree[x*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function ce(e){e.bi_valid>8?z(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function le(e,n,r,i){ce(e),i&&(z(e,r),z(e,~r)),t.arraySet(e.pending_buf,e.window,n,r,e.pending),e.pending+=r}function U(e,t,n,r){var i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]}function W(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&U(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!U(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function ue(e,t,n){var r,i,a=0,o,s;if(e.last_lit!==0)do r=e.pending_buf[e.d_buf+a*2]<<8|e.pending_buf[e.d_buf+a*2+1],i=e.pending_buf[e.l_buf+a],a++,r===0?B(e,i,t):(o=M[i],B(e,o+p+1,t),s=T[o],s!==0&&(i-=N[o],re(e,i,s)),r--,o=R(r),B(e,o,n),s=E[o],s!==0&&(r-=P[o],re(e,r,s)));while(a<e.last_lit);B(e,x,t)}function de(e,t){var 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=_,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--)W(e,n,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],W(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++,W(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],ae(e,t),oe(n,c,e.bl_count)}function G(e,t,n){var 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[C*2]++:e.bl_tree[w*2]++:(a!==i&&e.bl_tree[a*2]++,e.bl_tree[S*2]++),s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4))}function fe(e,t,n){var 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 B(e,a,e.bl_tree);while(--s!==0);else a===0?s<=10?(B(e,C,e.bl_tree),re(e,s-3,3)):(B(e,w,e.bl_tree),re(e,s-11,7)):(a!==i&&(B(e,a,e.bl_tree),s--),B(e,S,e.bl_tree),re(e,s-3,2));s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4)}}function K(e){var t;for(G(e,e.dyn_ltree,e.l_desc.max_code),G(e,e.dyn_dtree,e.d_desc.max_code),de(e,e.bl_desc),t=g-1;t>=3&&e.bl_tree[O[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function q(e,t,n,r){var i;for(re(e,t-257,5),re(e,n-1,5),re(e,r-4,4),i=0;i<r;i++)re(e,e.bl_tree[O[i]*2+1],3);fe(e,e.dyn_ltree,t-1),fe(e,e.dyn_dtree,n-1)}function J(e){var t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return r;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return i;for(n=32;n<p;n++)if(e.dyn_ltree[n*2]!==0)return i;return r}var Y=!1;function pe(e){Y||=(se(),!0),e.l_desc=new ne(e.dyn_ltree,te),e.d_desc=new ne(e.dyn_dtree,I),e.bl_desc=new ne(e.bl_tree,L),e.bi_buf=0,e.bi_valid=0,H(e)}function me(e,t,n,r){re(e,(s<<1)+(r?1:0),3),le(e,t,n,!0)}function he(e){re(e,c<<1,3),B(e,x,A),ie(e)}function ge(e,t,r,i){var o,s,u=0;e.level>0?(e.strm.data_type===a&&(e.strm.data_type=J(e)),de(e,e.l_desc),de(e,e.d_desc),u=K(e),o=e.opt_len+3+7>>>3,s=e.static_len+3+7>>>3,s<=o&&(o=s)):o=s=r+5,r+4<=o&&t!==-1?me(e,t,r,i):e.strategy===n||s===o?(re(e,(c<<1)+(i?1:0),3),ue(e,A,ee)):(re(e,(l<<1)+(i?1:0),3),q(e,e.l_desc.max_code+1,e.d_desc.max_code+1,u+1),ue(e,e.dyn_ltree,e.dyn_dtree)),H(e),i&&ce(e)}function X(e,t,n){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=n&255,e.last_lit++,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(M[n]+p+1)*2]++,e.dyn_dtree[R(t)*2]++),e.last_lit===e.lit_bufsize-1}e._tr_init=pe,e._tr_stored_block=me,e._tr_flush_block=ge,e._tr_tally=X,e._tr_align=he})),Io=c(((e,t)=>{function n(e,t,n,r){for(var i=e&65535|0,a=e>>>16&65535|0,o=0;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}t.exports=n})),Lo=c(((e,t)=>{function n(){for(var e,t=[],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}var r=n();function i(e,t,n,i){var a=r,o=i+n;e^=-1;for(var s=i;s<o;s++)e=e>>>8^a[(e^t[s])&255];return e^-1}t.exports=i})),Ro=c(((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`}})),zo=c((e=>{var t=Po(),n=Fo(),r=Io(),i=Lo(),a=Ro(),o=0,s=1,c=3,l=4,u=5,d=0,f=1,p=-2,m=-3,h=-5,g=-1,_=1,v=2,y=3,b=4,x=0,S=2,C=8,w=9,T=15,E=8,D=286,O=30,k=19,A=2*D+1,ee=15,j=3,M=258,N=M+j+1,P=32,F=42,te=69,I=73,L=91,ne=103,R=113,z=666,re=1,B=2,V=3,ie=4,ae=3;function oe(e,t){return e.msg=a[t],t}function se(e){return(e<<1)-(e>4?9:0)}function H(e){for(var t=e.length;--t>=0;)e[t]=0}function ce(e){var n=e.state,r=n.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(t.arraySet(e.output,n.pending_buf,n.pending_out,r,e.next_out),e.next_out+=r,n.pending_out+=r,e.total_out+=r,e.avail_out-=r,n.pending-=r,n.pending===0&&(n.pending_out=0))}function le(e,t){n._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ce(e.strm)}function U(e,t){e.pending_buf[e.pending++]=t}function W(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function ue(e,n,a,o){var s=e.avail_in;return s>o&&(s=o),s===0?0:(e.avail_in-=s,t.arraySet(n,e.input,e.next_in,s,a),e.state.wrap===1?e.adler=r(e.adler,n,s,a):e.state.wrap===2&&(e.adler=i(e.adler,n,s,a)),e.next_in+=s,e.total_in+=s,s)}function de(e,t){var n=e.max_chain_length,r=e.strstart,i,a,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-N?e.strstart-(e.w_size-N):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+M,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])continue;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=M-(f-r),r=f-M,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}function G(e){var n=e.w_size,r,i,a,o,s;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=n+(n-N)){t.arraySet(e.window,e.window,n,n,0),e.match_start-=n,e.strstart-=n,e.block_start-=n,i=e.hash_size,r=i;do a=e.head[--r],e.head[r]=a>=n?a-n:0;while(--i);i=n,r=i;do a=e.prev[--r],e.prev[r]=a>=n?a-n:0;while(--i);o+=n}if(e.strm.avail_in===0)break;if(i=ue(e.strm,e.window,e.strstart+e.lookahead,o),e.lookahead+=i,e.lookahead+e.insert>=j)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+j-1])&e.hash_mask,e.prev[s&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=s,s++,e.insert--,!(e.lookahead+e.insert<j)););}while(e.lookahead<N&&e.strm.avail_in!==0)}function fe(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(G(e),e.lookahead===0&&t===o)return re;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,le(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-N&&(le(e,!1),e.strm.avail_out===0))return re}return e.insert=0,t===l?(le(e,!0),e.strm.avail_out===0?V:ie):(e.strstart>e.block_start&&(le(e,!1),e.strm.avail_out),re)}function K(e,t){for(var r,i;;){if(e.lookahead<N){if(G(e),e.lookahead<N&&t===o)return re;if(e.lookahead===0)break}if(r=0,e.lookahead>=j&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+j-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-N&&(e.match_length=de(e,r)),e.match_length>=j)if(i=n._tr_tally(e,e.strstart-e.match_start,e.match_length-j),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=j){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+j-1])&e.hash_mask,r=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=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else i=n._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(le(e,!1),e.strm.avail_out===0))return re}return e.insert=e.strstart<j-1?e.strstart:j-1,t===l?(le(e,!0),e.strm.avail_out===0?V:ie):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?re:B}function q(e,t){for(var r,i,a;;){if(e.lookahead<N){if(G(e),e.lookahead<N&&t===o)return re;if(e.lookahead===0)break}if(r=0,e.lookahead>=j&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+j-1])&e.hash_mask,r=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=j-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-N&&(e.match_length=de(e,r),e.match_length<=5&&(e.strategy===_||e.match_length===j&&e.strstart-e.match_start>4096)&&(e.match_length=j-1)),e.prev_length>=j&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-j,i=n._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-j),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=a&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+j-1])&e.hash_mask,r=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=j-1,e.strstart++,i&&(le(e,!1),e.strm.avail_out===0))return re}else if(e.match_available){if(i=n._tr_tally(e,0,e.window[e.strstart-1]),i&&le(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return re}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&=(i=n._tr_tally(e,0,e.window[e.strstart-1]),0),e.insert=e.strstart<j-1?e.strstart:j-1,t===l?(le(e,!0),e.strm.avail_out===0?V:ie):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?re:B}function J(e,t){for(var r,i,a,s,c=e.window;;){if(e.lookahead<=M){if(G(e),e.lookahead<=M&&t===o)return re;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=j&&e.strstart>0&&(a=e.strstart-1,i=c[a],i===c[++a]&&i===c[++a]&&i===c[++a])){s=e.strstart+M;do;while(i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&a<s);e.match_length=M-(s-a),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=j?(r=n._tr_tally(e,1,e.match_length-j),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=n._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(le(e,!1),e.strm.avail_out===0))return re}return e.insert=0,t===l?(le(e,!0),e.strm.avail_out===0?V:ie):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?re:B}function Y(e,t){for(var r;;){if(e.lookahead===0&&(G(e),e.lookahead===0)){if(t===o)return re;break}if(e.match_length=0,r=n._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(le(e,!1),e.strm.avail_out===0))return re}return e.insert=0,t===l?(le(e,!0),e.strm.avail_out===0?V:ie):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?re:B}function pe(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 me=[new pe(0,0,0,0,fe),new pe(4,4,8,4,K),new pe(4,5,16,8,K),new pe(4,6,32,32,K),new pe(4,4,16,16,q),new pe(8,16,32,32,q),new pe(8,16,128,128,q),new pe(8,32,128,256,q),new pe(32,128,258,1024,q),new pe(32,258,258,4096,q)];function he(e){e.window_size=2*e.w_size,H(e.head),e.max_lazy_match=me[e.level].max_lazy,e.good_match=me[e.level].good_length,e.nice_match=me[e.level].nice_length,e.max_chain_length=me[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=j-1,e.match_available=0,e.ins_h=0}function ge(){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=C,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 t.Buf16(A*2),this.dyn_dtree=new t.Buf16((2*O+1)*2),this.bl_tree=new t.Buf16((2*k+1)*2),H(this.dyn_ltree),H(this.dyn_dtree),H(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new t.Buf16(ee+1),this.heap=new t.Buf16(2*D+1),H(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new t.Buf16(2*D+1),H(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function X(e){var t;return!e||!e.state?oe(e,p):(e.total_in=e.total_out=0,e.data_type=S,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?F:R,e.adler=t.wrap===2?0:1,t.last_flush=o,n._tr_init(t),d)}function _e(e){var t=X(e);return t===d&&he(e.state),t}function Z(e,t){return!e||!e.state||e.state.wrap!==2?p:(e.state.gzhead=t,d)}function ve(e,n,r,i,a,o){if(!e)return p;var s=1;if(n===g&&(n=6),i<0?(s=0,i=-i):i>15&&(s=2,i-=16),a<1||a>w||r!==C||i<8||i>15||n<0||n>9||o<0||o>b)return oe(e,p);i===8&&(i=9);var c=new ge;return e.state=c,c.strm=e,c.wrap=s,c.gzhead=null,c.w_bits=i,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=a+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+j-1)/j),c.window=new t.Buf8(c.w_size*2),c.head=new t.Buf16(c.hash_size),c.prev=new t.Buf16(c.w_size),c.lit_bufsize=1<<a+6,c.pending_buf_size=c.lit_bufsize*4,c.pending_buf=new t.Buf8(c.pending_buf_size),c.d_buf=1*c.lit_bufsize,c.l_buf=3*c.lit_bufsize,c.level=n,c.strategy=o,c.method=r,_e(e)}function ye(e,t){return ve(e,t,C,T,E,x)}function be(e,t){var r,a,m,g;if(!e||!e.state||t>u||t<0)return e?oe(e,p):p;if(a=e.state,!e.output||!e.input&&e.avail_in!==0||a.status===z&&t!==l)return oe(e,e.avail_out===0?h:p);if(a.strm=e,r=a.last_flush,a.last_flush=t,a.status===F)if(a.wrap===2)e.adler=0,U(a,31),U(a,139),U(a,8),a.gzhead?(U(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),U(a,a.gzhead.time&255),U(a,a.gzhead.time>>8&255),U(a,a.gzhead.time>>16&255),U(a,a.gzhead.time>>24&255),U(a,a.level===9?2:a.strategy>=v||a.level<2?4:0),U(a,a.gzhead.os&255),a.gzhead.extra&&a.gzhead.extra.length&&(U(a,a.gzhead.extra.length&255),U(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(e.adler=i(e.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=te):(U(a,0),U(a,0),U(a,0),U(a,0),U(a,0),U(a,a.level===9?2:a.strategy>=v||a.level<2?4:0),U(a,ae),a.status=R);else{var _=C+(a.w_bits-8<<4)<<8,b=-1;b=a.strategy>=v||a.level<2?0:a.level<6?1:a.level===6?2:3,_|=b<<6,a.strstart!==0&&(_|=P),_+=31-_%31,a.status=R,W(a,_),a.strstart!==0&&(W(a,e.adler>>>16),W(a,e.adler&65535)),e.adler=1}if(a.status===te)if(a.gzhead.extra){for(m=a.pending;a.gzindex<(a.gzhead.extra.length&65535)&&!(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),ce(e),m=a.pending,a.pending===a.pending_buf_size));)U(a,a.gzhead.extra[a.gzindex]&255),a.gzindex++;a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),a.gzindex===a.gzhead.extra.length&&(a.gzindex=0,a.status=I)}else a.status=I;if(a.status===I)if(a.gzhead.name){m=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),ce(e),m=a.pending,a.pending===a.pending_buf_size)){g=1;break}g=a.gzindex<a.gzhead.name.length?a.gzhead.name.charCodeAt(a.gzindex++)&255:0,U(a,g)}while(g!==0);a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),g===0&&(a.gzindex=0,a.status=L)}else a.status=L;if(a.status===L)if(a.gzhead.comment){m=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),ce(e),m=a.pending,a.pending===a.pending_buf_size)){g=1;break}g=a.gzindex<a.gzhead.comment.length?a.gzhead.comment.charCodeAt(a.gzindex++)&255:0,U(a,g)}while(g!==0);a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),g===0&&(a.status=ne)}else a.status=ne;if(a.status===ne&&(a.gzhead.hcrc?(a.pending+2>a.pending_buf_size&&ce(e),a.pending+2<=a.pending_buf_size&&(U(a,e.adler&255),U(a,e.adler>>8&255),e.adler=0,a.status=R)):a.status=R),a.pending!==0){if(ce(e),e.avail_out===0)return a.last_flush=-1,d}else if(e.avail_in===0&&se(t)<=se(r)&&t!==l)return oe(e,h);if(a.status===z&&e.avail_in!==0)return oe(e,h);if(e.avail_in!==0||a.lookahead!==0||t!==o&&a.status!==z){var x=a.strategy===v?Y(a,t):a.strategy===y?J(a,t):me[a.level].func(a,t);if((x===V||x===ie)&&(a.status=z),x===re||x===V)return e.avail_out===0&&(a.last_flush=-1),d;if(x===B&&(t===s?n._tr_align(a):t!==u&&(n._tr_stored_block(a,0,0,!1),t===c&&(H(a.head),a.lookahead===0&&(a.strstart=0,a.block_start=0,a.insert=0))),ce(e),e.avail_out===0))return a.last_flush=-1,d}return t===l?a.wrap<=0?f:(a.wrap===2?(U(a,e.adler&255),U(a,e.adler>>8&255),U(a,e.adler>>16&255),U(a,e.adler>>24&255),U(a,e.total_in&255),U(a,e.total_in>>8&255),U(a,e.total_in>>16&255),U(a,e.total_in>>24&255)):(W(a,e.adler>>>16),W(a,e.adler&65535)),ce(e),a.wrap>0&&(a.wrap=-a.wrap),a.pending===0?f:d):d}function xe(e){var t;return!e||!e.state?p:(t=e.state.status,t!==F&&t!==te&&t!==I&&t!==L&&t!==ne&&t!==R&&t!==z?oe(e,p):(e.state=null,t===R?oe(e,m):d))}function Se(e,n){var i=n.length,a,o,s,c,l,u,f,m;if(!e||!e.state||(a=e.state,c=a.wrap,c===2||c===1&&a.status!==F||a.lookahead))return p;for(c===1&&(e.adler=r(e.adler,n,i,0)),a.wrap=0,i>=a.w_size&&(c===0&&(H(a.head),a.strstart=0,a.block_start=0,a.insert=0),m=new t.Buf8(a.w_size),t.arraySet(m,n,i-a.w_size,a.w_size,0),n=m,i=a.w_size),l=e.avail_in,u=e.next_in,f=e.input,e.avail_in=i,e.next_in=0,e.input=n,G(a);a.lookahead>=j;){o=a.strstart,s=a.lookahead-(j-1);do a.ins_h=(a.ins_h<<a.hash_shift^a.window[o+j-1])&a.hash_mask,a.prev[o&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=o,o++;while(--s);a.strstart=o,a.lookahead=j-1,G(a)}return a.strstart+=a.lookahead,a.block_start=a.strstart,a.insert=a.lookahead,a.lookahead=0,a.match_length=a.prev_length=j-1,a.match_available=0,e.next_in=u,e.input=f,e.avail_in=l,a.wrap=c,d}e.deflateInit=ye,e.deflateInit2=ve,e.deflateReset=_e,e.deflateResetKeep=X,e.deflateSetHeader=Z,e.deflate=be,e.deflateEnd=xe,e.deflateSetDictionary=Se,e.deflateInfo=`pako deflate (from Nodeca project)`})),Bo=c(((e,t)=>{var n=30,r=12;t.exports=function(e,t){var i=e.state,a=e.next_in,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D=e.input,O;o=a+(e.avail_in-5),s=e.next_out,O=e.output,c=s-(t-e.avail_out),l=s+(e.avail_out-257),u=i.dmax,d=i.wsize,f=i.whave,p=i.wnext,m=i.window,h=i.hold,g=i.bits,_=i.lencode,v=i.distcode,y=(1<<i.lenbits)-1,b=(1<<i.distbits)-1;top:do{g<15&&(h+=D[a++]<<g,g+=8,h+=D[a++]<<g,g+=8),x=_[h&y];dolen:for(;;){if(S=x>>>24,h>>>=S,g-=S,S=x>>>16&255,S===0)O[s++]=x&65535;else if(S&16){C=x&65535,S&=15,S&&(g<S&&(h+=D[a++]<<g,g+=8),C+=h&(1<<S)-1,h>>>=S,g-=S),g<15&&(h+=D[a++]<<g,g+=8,h+=D[a++]<<g,g+=8),x=v[h&b];dodist:for(;;){if(S=x>>>24,h>>>=S,g-=S,S=x>>>16&255,S&16){if(w=x&65535,S&=15,g<S&&(h+=D[a++]<<g,g+=8,g<S&&(h+=D[a++]<<g,g+=8)),w+=h&(1<<S)-1,w>u){e.msg=`invalid distance too far back`,i.mode=n;break top}if(h>>>=S,g-=S,S=s-c,w>S){if(S=w-S,S>f&&i.sane){e.msg=`invalid distance too far back`,i.mode=n;break top}if(T=0,E=m,p===0){if(T+=d-S,S<C){C-=S;do O[s++]=m[T++];while(--S);T=s-w,E=O}}else if(p<S){if(T+=d+p-S,S-=p,S<C){C-=S;do O[s++]=m[T++];while(--S);if(T=0,p<C){S=p,C-=S;do O[s++]=m[T++];while(--S);T=s-w,E=O}}}else if(T+=p-S,S<C){C-=S;do O[s++]=m[T++];while(--S);T=s-w,E=O}for(;C>2;)O[s++]=E[T++],O[s++]=E[T++],O[s++]=E[T++],C-=3;C&&(O[s++]=E[T++],C>1&&(O[s++]=E[T++]))}else{T=s-w;do O[s++]=O[T++],O[s++]=O[T++],O[s++]=O[T++],C-=3;while(C>2);C&&(O[s++]=O[T++],C>1&&(O[s++]=O[T++]))}}else if(S&64){e.msg=`invalid distance code`,i.mode=n;break top}else{x=v[(x&65535)+(h&(1<<S)-1)];continue dodist}break}}else if(S&64)if(S&32){i.mode=r;break top}else{e.msg=`invalid literal/length code`,i.mode=n;break top}else{x=_[(x&65535)+(h&(1<<S)-1)];continue dolen}break}}while(a<o&&s<l);C=g>>3,a-=C,g-=C<<3,h&=(1<<g)-1,e.next_in=a,e.next_out=s,e.avail_in=a<o?5+(o-a):5-(a-o),e.avail_out=s<l?257+(l-s):257-(s-l),i.hold=h,i.bits=g}})),Vo=c(((e,t)=>{var n=Po(),r=15,i=852,a=592,o=0,s=1,c=2,l=[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],u=[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],d=[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],f=[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=function(e,t,p,m,h,g,_,v){var y=v.bits,b=0,x=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A,ee,j,M,N,P=null,F=0,te,I=new n.Buf16(r+1),L=new n.Buf16(r+1),ne=null,R=0,z,re,B;for(b=0;b<=r;b++)I[b]=0;for(x=0;x<m;x++)I[t[p+x]]++;for(w=y,C=r;C>=1&&I[C]===0;C--);if(w>C&&(w=C),C===0)return h[g++]=20971520,h[g++]=20971520,v.bits=1,0;for(S=1;S<C&&I[S]===0;S++);for(w<S&&(w=S),D=1,b=1;b<=r;b++)if(D<<=1,D-=I[b],D<0)return-1;if(D>0&&(e===o||C!==1))return-1;for(L[1]=0,b=1;b<r;b++)L[b+1]=L[b]+I[b];for(x=0;x<m;x++)t[p+x]!==0&&(_[L[t[p+x]]++]=x);if(e===o?(P=ne=_,te=19):e===s?(P=l,F-=257,ne=u,R-=257,te=256):(P=d,ne=f,te=-1),k=0,x=0,b=S,N=g,T=w,E=0,j=-1,O=1<<w,M=O-1,e===s&&O>i||e===c&&O>a)return 1;for(;;){z=b-E,_[x]<te?(re=0,B=_[x]):_[x]>te?(re=ne[R+_[x]],B=P[F+_[x]]):(re=96,B=0),A=1<<b-E,ee=1<<T,S=ee;do ee-=A,h[N+(k>>E)+ee]=z<<24|re<<16|B|0;while(ee!==0);for(A=1<<b-1;k&A;)A>>=1;if(A===0?k=0:(k&=A-1,k+=A),x++,--I[b]===0){if(b===C)break;b=t[p+_[x]]}if(b>w&&(k&M)!==j){for(E===0&&(E=w),N+=S,T=b-E,D=1<<T;T+E<C&&(D-=I[T+E],!(D<=0));)T++,D<<=1;if(O+=1<<T,e===s&&O>i||e===c&&O>a)return 1;j=k&M,h[j]=w<<24|T<<16|N-g|0}}return k!==0&&(h[N+k]=b-E<<24|4194304),v.bits=w,0}})),Ho=c((e=>{var t=Po(),n=Io(),r=Lo(),i=Bo(),a=Vo(),o=0,s=1,c=2,l=4,u=5,d=6,f=0,p=1,m=2,h=-2,g=-3,_=-4,v=-5,y=8,b=1,x=2,S=3,C=4,w=5,T=6,E=7,D=8,O=9,k=10,A=11,ee=12,j=13,M=14,N=15,P=16,F=17,te=18,I=19,L=20,ne=21,R=22,z=23,re=24,B=25,V=26,ie=27,ae=28,oe=29,se=30,H=31,ce=32,le=852,U=592,W=15;function ue(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function de(){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 t.Buf16(320),this.work=new t.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function G(e){var n;return!e||!e.state?h:(n=e.state,e.total_in=e.total_out=n.total=0,e.msg=``,n.wrap&&(e.adler=n.wrap&1),n.mode=b,n.last=0,n.havedict=0,n.dmax=32768,n.head=null,n.hold=0,n.bits=0,n.lencode=n.lendyn=new t.Buf32(le),n.distcode=n.distdyn=new t.Buf32(U),n.sane=1,n.back=-1,f)}function fe(e){var t;return!e||!e.state?h:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,G(e))}function K(e,t){var n,r;return!e||!e.state||(r=e.state,t<0?(n=0,t=-t):(n=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?h:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,fe(e))}function q(e,t){var n,r;return e?(r=new de,e.state=r,r.window=null,n=K(e,t),n!==f&&(e.state=null),n):h}function J(e){return q(e,W)}var Y=!0,pe,me;function he(e){if(Y){var n;for(pe=new t.Buf32(512),me=new t.Buf32(32),n=0;n<144;)e.lens[n++]=8;for(;n<256;)e.lens[n++]=9;for(;n<280;)e.lens[n++]=7;for(;n<288;)e.lens[n++]=8;for(a(s,e.lens,0,288,pe,0,e.work,{bits:9}),n=0;n<32;)e.lens[n++]=5;a(c,e.lens,0,32,me,0,e.work,{bits:5}),Y=!1}e.lencode=pe,e.lenbits=9,e.distcode=me,e.distbits=5}function ge(e,n,r,i){var a,o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new t.Buf8(o.wsize)),i>=o.wsize?(t.arraySet(o.window,n,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(a=o.wsize-o.wnext,a>i&&(a=i),t.arraySet(o.window,n,r-i,a,o.wnext),i-=a,i?(t.arraySet(o.window,n,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=a))),0}function X(e,le){var U,W,de,G,fe,K,q,J,Y,pe,me,X,_e,Z,ve=0,ye,be,xe,Se,Ce,we,Te,Ee,De=new t.Buf8(4),Oe,ke,Ae=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return h;U=e.state,U.mode===ee&&(U.mode=j),fe=e.next_out,de=e.output,q=e.avail_out,G=e.next_in,W=e.input,K=e.avail_in,J=U.hold,Y=U.bits,pe=K,me=q,Ee=f;inf_leave:for(;;)switch(U.mode){case b:if(U.wrap===0){U.mode=j;break}for(;Y<16;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}if(U.wrap&2&&J===35615){U.check=0,De[0]=J&255,De[1]=J>>>8&255,U.check=r(U.check,De,2,0),J=0,Y=0,U.mode=x;break}if(U.flags=0,U.head&&(U.head.done=!1),!(U.wrap&1)||(((J&255)<<8)+(J>>8))%31){e.msg=`incorrect header check`,U.mode=se;break}if((J&15)!==y){e.msg=`unknown compression method`,U.mode=se;break}if(J>>>=4,Y-=4,Te=(J&15)+8,U.wbits===0)U.wbits=Te;else if(Te>U.wbits){e.msg=`invalid window size`,U.mode=se;break}U.dmax=1<<Te,e.adler=U.check=1,U.mode=J&512?k:ee,J=0,Y=0;break;case x:for(;Y<16;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}if(U.flags=J,(U.flags&255)!==y){e.msg=`unknown compression method`,U.mode=se;break}if(U.flags&57344){e.msg=`unknown header flags set`,U.mode=se;break}U.head&&(U.head.text=J>>8&1),U.flags&512&&(De[0]=J&255,De[1]=J>>>8&255,U.check=r(U.check,De,2,0)),J=0,Y=0,U.mode=S;case S:for(;Y<32;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}U.head&&(U.head.time=J),U.flags&512&&(De[0]=J&255,De[1]=J>>>8&255,De[2]=J>>>16&255,De[3]=J>>>24&255,U.check=r(U.check,De,4,0)),J=0,Y=0,U.mode=C;case C:for(;Y<16;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}U.head&&(U.head.xflags=J&255,U.head.os=J>>8),U.flags&512&&(De[0]=J&255,De[1]=J>>>8&255,U.check=r(U.check,De,2,0)),J=0,Y=0,U.mode=w;case w:if(U.flags&1024){for(;Y<16;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}U.length=J,U.head&&(U.head.extra_len=J),U.flags&512&&(De[0]=J&255,De[1]=J>>>8&255,U.check=r(U.check,De,2,0)),J=0,Y=0}else U.head&&(U.head.extra=null);U.mode=T;case T:if(U.flags&1024&&(X=U.length,X>K&&(X=K),X&&(U.head&&(Te=U.head.extra_len-U.length,U.head.extra||(U.head.extra=Array(U.head.extra_len)),t.arraySet(U.head.extra,W,G,X,Te)),U.flags&512&&(U.check=r(U.check,W,X,G)),K-=X,G+=X,U.length-=X),U.length))break inf_leave;U.length=0,U.mode=E;case E:if(U.flags&2048){if(K===0)break inf_leave;X=0;do Te=W[G+ X++],U.head&&Te&&U.length<65536&&(U.head.name+=String.fromCharCode(Te));while(Te&&X<K);if(U.flags&512&&(U.check=r(U.check,W,X,G)),K-=X,G+=X,Te)break inf_leave}else U.head&&(U.head.name=null);U.length=0,U.mode=D;case D:if(U.flags&4096){if(K===0)break inf_leave;X=0;do Te=W[G+ X++],U.head&&Te&&U.length<65536&&(U.head.comment+=String.fromCharCode(Te));while(Te&&X<K);if(U.flags&512&&(U.check=r(U.check,W,X,G)),K-=X,G+=X,Te)break inf_leave}else U.head&&(U.head.comment=null);U.mode=O;case O:if(U.flags&512){for(;Y<16;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}if(J!==(U.check&65535)){e.msg=`header crc mismatch`,U.mode=se;break}J=0,Y=0}U.head&&(U.head.hcrc=U.flags>>9&1,U.head.done=!0),e.adler=U.check=0,U.mode=ee;break;case k:for(;Y<32;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}e.adler=U.check=ue(J),J=0,Y=0,U.mode=A;case A:if(U.havedict===0)return e.next_out=fe,e.avail_out=q,e.next_in=G,e.avail_in=K,U.hold=J,U.bits=Y,m;e.adler=U.check=1,U.mode=ee;case ee:if(le===u||le===d)break inf_leave;case j:if(U.last){J>>>=Y&7,Y-=Y&7,U.mode=ie;break}for(;Y<3;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}switch(U.last=J&1,J>>>=1,--Y,J&3){case 0:U.mode=M;break;case 1:if(he(U),U.mode=L,le===d){J>>>=2,Y-=2;break inf_leave}break;case 2:U.mode=F;break;case 3:e.msg=`invalid block type`,U.mode=se}J>>>=2,Y-=2;break;case M:for(J>>>=Y&7,Y-=Y&7;Y<32;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}if((J&65535)!=(J>>>16^65535)){e.msg=`invalid stored block lengths`,U.mode=se;break}if(U.length=J&65535,J=0,Y=0,U.mode=N,le===d)break inf_leave;case N:U.mode=P;case P:if(X=U.length,X){if(X>K&&(X=K),X>q&&(X=q),X===0)break inf_leave;t.arraySet(de,W,G,X,fe),K-=X,G+=X,q-=X,fe+=X,U.length-=X;break}U.mode=ee;break;case F:for(;Y<14;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}if(U.nlen=(J&31)+257,J>>>=5,Y-=5,U.ndist=(J&31)+1,J>>>=5,Y-=5,U.ncode=(J&15)+4,J>>>=4,Y-=4,U.nlen>286||U.ndist>30){e.msg=`too many length or distance symbols`,U.mode=se;break}U.have=0,U.mode=te;case te:for(;U.have<U.ncode;){for(;Y<3;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}U.lens[Ae[U.have++]]=J&7,J>>>=3,Y-=3}for(;U.have<19;)U.lens[Ae[U.have++]]=0;if(U.lencode=U.lendyn,U.lenbits=7,Oe={bits:U.lenbits},Ee=a(o,U.lens,0,19,U.lencode,0,U.work,Oe),U.lenbits=Oe.bits,Ee){e.msg=`invalid code lengths set`,U.mode=se;break}U.have=0,U.mode=I;case I:for(;U.have<U.nlen+U.ndist;){for(;ve=U.lencode[J&(1<<U.lenbits)-1],ye=ve>>>24,be=ve>>>16&255,xe=ve&65535,!(ye<=Y);){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}if(xe<16)J>>>=ye,Y-=ye,U.lens[U.have++]=xe;else{if(xe===16){for(ke=ye+2;Y<ke;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}if(J>>>=ye,Y-=ye,U.have===0){e.msg=`invalid bit length repeat`,U.mode=se;break}Te=U.lens[U.have-1],X=3+(J&3),J>>>=2,Y-=2}else if(xe===17){for(ke=ye+3;Y<ke;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}J>>>=ye,Y-=ye,Te=0,X=3+(J&7),J>>>=3,Y-=3}else{for(ke=ye+7;Y<ke;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}J>>>=ye,Y-=ye,Te=0,X=11+(J&127),J>>>=7,Y-=7}if(U.have+X>U.nlen+U.ndist){e.msg=`invalid bit length repeat`,U.mode=se;break}for(;X--;)U.lens[U.have++]=Te}}if(U.mode===se)break;if(U.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,U.mode=se;break}if(U.lenbits=9,Oe={bits:U.lenbits},Ee=a(s,U.lens,0,U.nlen,U.lencode,0,U.work,Oe),U.lenbits=Oe.bits,Ee){e.msg=`invalid literal/lengths set`,U.mode=se;break}if(U.distbits=6,U.distcode=U.distdyn,Oe={bits:U.distbits},Ee=a(c,U.lens,U.nlen,U.ndist,U.distcode,0,U.work,Oe),U.distbits=Oe.bits,Ee){e.msg=`invalid distances set`,U.mode=se;break}if(U.mode=L,le===d)break inf_leave;case L:U.mode=ne;case ne:if(K>=6&&q>=258){e.next_out=fe,e.avail_out=q,e.next_in=G,e.avail_in=K,U.hold=J,U.bits=Y,i(e,me),fe=e.next_out,de=e.output,q=e.avail_out,G=e.next_in,W=e.input,K=e.avail_in,J=U.hold,Y=U.bits,U.mode===ee&&(U.back=-1);break}for(U.back=0;ve=U.lencode[J&(1<<U.lenbits)-1],ye=ve>>>24,be=ve>>>16&255,xe=ve&65535,!(ye<=Y);){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}if(be&&!(be&240)){for(Se=ye,Ce=be,we=xe;ve=U.lencode[we+((J&(1<<Se+Ce)-1)>>Se)],ye=ve>>>24,be=ve>>>16&255,xe=ve&65535,!(Se+ye<=Y);){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}J>>>=Se,Y-=Se,U.back+=Se}if(J>>>=ye,Y-=ye,U.back+=ye,U.length=xe,be===0){U.mode=V;break}if(be&32){U.back=-1,U.mode=ee;break}if(be&64){e.msg=`invalid literal/length code`,U.mode=se;break}U.extra=be&15,U.mode=R;case R:if(U.extra){for(ke=U.extra;Y<ke;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}U.length+=J&(1<<U.extra)-1,J>>>=U.extra,Y-=U.extra,U.back+=U.extra}U.was=U.length,U.mode=z;case z:for(;ve=U.distcode[J&(1<<U.distbits)-1],ye=ve>>>24,be=ve>>>16&255,xe=ve&65535,!(ye<=Y);){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}if(!(be&240)){for(Se=ye,Ce=be,we=xe;ve=U.distcode[we+((J&(1<<Se+Ce)-1)>>Se)],ye=ve>>>24,be=ve>>>16&255,xe=ve&65535,!(Se+ye<=Y);){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}J>>>=Se,Y-=Se,U.back+=Se}if(J>>>=ye,Y-=ye,U.back+=ye,be&64){e.msg=`invalid distance code`,U.mode=se;break}U.offset=xe,U.extra=be&15,U.mode=re;case re:if(U.extra){for(ke=U.extra;Y<ke;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}U.offset+=J&(1<<U.extra)-1,J>>>=U.extra,Y-=U.extra,U.back+=U.extra}if(U.offset>U.dmax){e.msg=`invalid distance too far back`,U.mode=se;break}U.mode=B;case B:if(q===0)break inf_leave;if(X=me-q,U.offset>X){if(X=U.offset-X,X>U.whave&&U.sane){e.msg=`invalid distance too far back`,U.mode=se;break}X>U.wnext?(X-=U.wnext,_e=U.wsize-X):_e=U.wnext-X,X>U.length&&(X=U.length),Z=U.window}else Z=de,_e=fe-U.offset,X=U.length;X>q&&(X=q),q-=X,U.length-=X;do de[fe++]=Z[_e++];while(--X);U.length===0&&(U.mode=ne);break;case V:if(q===0)break inf_leave;de[fe++]=U.length,q--,U.mode=ne;break;case ie:if(U.wrap){for(;Y<32;){if(K===0)break inf_leave;K--,J|=W[G++]<<Y,Y+=8}if(me-=q,e.total_out+=me,U.total+=me,me&&(e.adler=U.check=U.flags?r(U.check,de,me,fe-me):n(U.check,de,me,fe-me)),me=q,(U.flags?J:ue(J))!==U.check){e.msg=`incorrect data check`,U.mode=se;break}J=0,Y=0}U.mode=ae;case ae:if(U.wrap&&U.flags){for(;Y<32;){if(K===0)break inf_leave;K--,J+=W[G++]<<Y,Y+=8}if(J!==(U.total&4294967295)){e.msg=`incorrect length check`,U.mode=se;break}J=0,Y=0}U.mode=oe;case oe:Ee=p;break inf_leave;case se:Ee=g;break inf_leave;case H:return _;case ce:default:return h}return e.next_out=fe,e.avail_out=q,e.next_in=G,e.avail_in=K,U.hold=J,U.bits=Y,(U.wsize||me!==e.avail_out&&U.mode<se&&(U.mode<ie||le!==l))&&ge(e,e.output,e.next_out,me-e.avail_out)?(U.mode=H,_):(pe-=e.avail_in,me-=e.avail_out,e.total_in+=pe,e.total_out+=me,U.total+=me,U.wrap&&me&&(e.adler=U.check=U.flags?r(U.check,de,me,e.next_out-me):n(U.check,de,me,e.next_out-me)),e.data_type=U.bits+(U.last?64:0)+(U.mode===ee?128:0)+(U.mode===L||U.mode===N?256:0),(pe===0&&me===0||le===l)&&Ee===f&&(Ee=v),Ee)}function _e(e){if(!e||!e.state)return h;var t=e.state;return t.window&&=null,e.state=null,f}function Z(e,t){var n;return!e||!e.state||(n=e.state,!(n.wrap&2))?h:(n.head=t,t.done=!1,f)}function ve(e,t){var r=t.length,i,a,o;return!e||!e.state||(i=e.state,i.wrap!==0&&i.mode!==A)?h:i.mode===A&&(a=1,a=n(a,t,r,0),a!==i.check)?g:(o=ge(e,t,r,r),o?(i.mode=H,_):(i.havedict=1,f))}e.inflateReset=fe,e.inflateReset2=K,e.inflateResetKeep=G,e.inflateInit=J,e.inflateInit2=q,e.inflate=X,e.inflateEnd=_e,e.inflateGetHeader=Z,e.inflateSetDictionary=ve,e.inflateInfo=`pako inflate (from Nodeca project)`})),Uo=c(((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_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}})),Wo=c((e=>{var t=K();Be();var n=Mo(),r=No(),i=zo(),a=Ho(),o=Uo();for(var s in o)e[s]=o[s];e.NONE=0,e.DEFLATE=1,e.INFLATE=2,e.GZIP=3,e.GUNZIP=4,e.DEFLATERAW=5,e.INFLATERAW=6,e.UNZIP=7;var c=31,l=139;function u(t){if(typeof t!=`number`||t<e.DEFLATE||t>e.UNZIP)throw TypeError(`Bad argument`);this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=t,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}u.prototype.close=function(){if(this.write_in_progress){this.pending_close=!0;return}this.pending_close=!1,n(this.init_done,`close before init`),n(this.mode<=e.UNZIP),this.mode===e.DEFLATE||this.mode===e.GZIP||this.mode===e.DEFLATERAW?i.deflateEnd(this.strm):(this.mode===e.INFLATE||this.mode===e.GUNZIP||this.mode===e.INFLATERAW||this.mode===e.UNZIP)&&a.inflateEnd(this.strm),this.mode=e.NONE,this.dictionary=null},u.prototype.write=function(e,t,n,r,i,a,o){return this._write(!0,e,t,n,r,i,a,o)},u.prototype.writeSync=function(e,t,n,r,i,a,o){return this._write(!1,e,t,n,r,i,a,o)},u.prototype._write=function(r,i,a,o,s,c,l,u){if(n.equal(arguments.length,8),n(this.init_done,`write before init`),n(this.mode!==e.NONE,`already finalized`),n.equal(!1,this.write_in_progress,`write already in progress`),n.equal(!1,this.pending_close,`close is pending`),this.write_in_progress=!0,n.equal(!1,i===void 0,`must provide flush value`),this.write_in_progress=!0,i!==e.Z_NO_FLUSH&&i!==e.Z_PARTIAL_FLUSH&&i!==e.Z_SYNC_FLUSH&&i!==e.Z_FULL_FLUSH&&i!==e.Z_FINISH&&i!==e.Z_BLOCK)throw Error(`Invalid flush value`);if(a??(a=t.Buffer.alloc(0),s=0,o=0),this.strm.avail_in=s,this.strm.input=a,this.strm.next_in=o,this.strm.avail_out=u,this.strm.output=c,this.strm.next_out=l,this.flush=i,!r)return this._process(),this._checkError()?this._afterSync():void 0;var d=this;return Q.nextTick(function(){d._process(),d._after()}),this},u.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]},u.prototype._process=function(){var t=null;switch(this.mode){case e.DEFLATE:case e.GZIP:case e.DEFLATERAW:this.err=i.deflate(this.strm,this.flush);break;case e.UNZIP:switch(this.strm.avail_in>0&&(t=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(t===null)break;if(this.strm.input[t]===c){if(this.gzip_id_bytes_read=1,t++,this.strm.avail_in===1)break}else{this.mode=e.INFLATE;break}case 1:if(t===null)break;this.strm.input[t]===l?(this.gzip_id_bytes_read=2,this.mode=e.GUNZIP):this.mode=e.INFLATE;break;default:throw Error(`invalid number of gzip magic number bytes read`)}case e.INFLATE:case e.GUNZIP:case e.INFLATERAW:for(this.err=a.inflate(this.strm,this.flush),this.err===e.Z_NEED_DICT&&this.dictionary&&(this.err=a.inflateSetDictionary(this.strm,this.dictionary),this.err===e.Z_OK?this.err=a.inflate(this.strm,this.flush):this.err===e.Z_DATA_ERROR&&(this.err=e.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===e.GUNZIP&&this.err===e.Z_STREAM_END&&this.strm.next_in[0]!==0;)this.reset(),this.err=a.inflate(this.strm,this.flush);break;default:throw Error(`Unknown mode `+this.mode)}},u.prototype._checkError=function(){switch(this.err){case e.Z_OK:case e.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===e.Z_FINISH)return this._error(`unexpected end of file`),!1;break;case e.Z_STREAM_END:break;case e.Z_NEED_DICT:return this.dictionary==null?this._error(`Missing dictionary`):this._error(`Bad dictionary`),!1;default:return this._error(`Zlib error`),!1}return!0},u.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,t=this.strm.avail_in;this.write_in_progress=!1,this.callback(t,e),this.pending_close&&this.close()}},u.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},u.prototype.init=function(t,r,i,a,o){n(arguments.length===4||arguments.length===5,`init(windowBits, level, memLevel, strategy, [dictionary])`),n(t>=8&&t<=15,`invalid windowBits`),n(r>=-1&&r<=9,`invalid compression level`),n(i>=1&&i<=9,`invalid memlevel`),n(a===e.Z_FILTERED||a===e.Z_HUFFMAN_ONLY||a===e.Z_RLE||a===e.Z_FIXED||a===e.Z_DEFAULT_STRATEGY,`invalid strategy`),this._init(r,t,i,a,o),this._setDictionary()},u.prototype.params=function(){throw Error(`deflateParams Not supported`)},u.prototype.reset=function(){this._reset(),this._setDictionary()},u.prototype._init=function(t,n,o,s,c){switch(this.level=t,this.windowBits=n,this.memLevel=o,this.strategy=s,this.flush=e.Z_NO_FLUSH,this.err=e.Z_OK,(this.mode===e.GZIP||this.mode===e.GUNZIP)&&(this.windowBits+=16),this.mode===e.UNZIP&&(this.windowBits+=32),(this.mode===e.DEFLATERAW||this.mode===e.INFLATERAW)&&(this.windowBits=-1*this.windowBits),this.strm=new r,this.mode){case e.DEFLATE:case e.GZIP:case e.DEFLATERAW:this.err=i.deflateInit2(this.strm,this.level,e.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case e.INFLATE:case e.GUNZIP:case e.INFLATERAW:case e.UNZIP:this.err=a.inflateInit2(this.strm,this.windowBits);break;default:throw Error(`Unknown mode `+this.mode)}this.err!==e.Z_OK&&this._error(`Init error`),this.dictionary=c,this.write_in_progress=!1,this.init_done=!0},u.prototype._setDictionary=function(){if(this.dictionary!=null){switch(this.err=e.Z_OK,this.mode){case e.DEFLATE:case e.DEFLATERAW:this.err=i.deflateSetDictionary(this.strm,this.dictionary);break;default:break}this.err!==e.Z_OK&&this._error(`Failed to set dictionary`)}},u.prototype._reset=function(){switch(this.err=e.Z_OK,this.mode){case e.DEFLATE:case e.DEFLATERAW:case e.GZIP:this.err=i.deflateReset(this.strm);break;case e.INFLATE:case e.INFLATERAW:case e.GUNZIP:this.err=a.inflateReset(this.strm);break;default:break}this.err!==e.Z_OK&&this._error(`Failed to reset stream`)},e.Zlib=u})),Go=c((e=>{Be();var t=K().Buffer,n=ln().Transform,r=Wo(),i=Kt(),a=Mo().ok,o=K().kMaxLength,s=`Cannot create final Buffer. It would be larger than 0x`+o.toString(16)+` bytes`;r.Z_MIN_WINDOWBITS=8,r.Z_MAX_WINDOWBITS=15,r.Z_DEFAULT_WINDOWBITS=15,r.Z_MIN_CHUNK=64,r.Z_MAX_CHUNK=1/0,r.Z_DEFAULT_CHUNK=16*1024,r.Z_MIN_MEMLEVEL=1,r.Z_MAX_MEMLEVEL=9,r.Z_DEFAULT_MEMLEVEL=8,r.Z_MIN_LEVEL=-1,r.Z_MAX_LEVEL=9,r.Z_DEFAULT_LEVEL=r.Z_DEFAULT_COMPRESSION;for(var c=Object.keys(r),l=0;l<c.length;l++){var u=c[l];u.match(/^Z/)&&Object.defineProperty(e,u,{enumerable:!0,value:r[u],writable:!1})}for(var d={Z_OK:r.Z_OK,Z_STREAM_END:r.Z_STREAM_END,Z_NEED_DICT:r.Z_NEED_DICT,Z_ERRNO:r.Z_ERRNO,Z_STREAM_ERROR:r.Z_STREAM_ERROR,Z_DATA_ERROR:r.Z_DATA_ERROR,Z_MEM_ERROR:r.Z_MEM_ERROR,Z_BUF_ERROR:r.Z_BUF_ERROR,Z_VERSION_ERROR:r.Z_VERSION_ERROR},f=Object.keys(d),p=0;p<f.length;p++){var m=f[p];d[d[m]]=m}Object.defineProperty(e,`codes`,{enumerable:!0,value:Object.freeze(d),writable:!1}),e.Deflate=_,e.Inflate=v,e.Gzip=y,e.Gunzip=b,e.DeflateRaw=x,e.InflateRaw=S,e.Unzip=C,e.createDeflate=function(e){return new _(e)},e.createInflate=function(e){return new v(e)},e.createDeflateRaw=function(e){return new x(e)},e.createInflateRaw=function(e){return new S(e)},e.createGzip=function(e){return new y(e)},e.createGunzip=function(e){return new b(e)},e.createUnzip=function(e){return new C(e)},e.deflate=function(e,t,n){return typeof t==`function`&&(n=t,t={}),h(new _(t),e,n)},e.deflateSync=function(e,t){return g(new _(t),e)},e.gzip=function(e,t,n){return typeof t==`function`&&(n=t,t={}),h(new y(t),e,n)},e.gzipSync=function(e,t){return g(new y(t),e)},e.deflateRaw=function(e,t,n){return typeof t==`function`&&(n=t,t={}),h(new x(t),e,n)},e.deflateRawSync=function(e,t){return g(new x(t),e)},e.unzip=function(e,t,n){return typeof t==`function`&&(n=t,t={}),h(new C(t),e,n)},e.unzipSync=function(e,t){return g(new C(t),e)},e.inflate=function(e,t,n){return typeof t==`function`&&(n=t,t={}),h(new v(t),e,n)},e.inflateSync=function(e,t){return g(new v(t),e)},e.gunzip=function(e,t,n){return typeof t==`function`&&(n=t,t={}),h(new b(t),e,n)},e.gunzipSync=function(e,t){return g(new b(t),e)},e.inflateRaw=function(e,t,n){return typeof t==`function`&&(n=t,t={}),h(new S(t),e,n)},e.inflateRawSync=function(e,t){return g(new S(t),e)};function h(e,n,r){var i=[],a=0;e.on(`error`,l),e.on(`end`,u),e.end(n),c();function c(){for(var t;(t=e.read())!==null;)i.push(t),a+=t.length;e.once(`readable`,c)}function l(t){e.removeListener(`end`,u),e.removeListener(`readable`,c),r(t)}function u(){var n,c=null;a>=o?c=RangeError(s):n=t.concat(i,a),i=[],e.close(),r(c,n)}}function g(e,n){if(typeof n==`string`&&(n=t.from(n)),!t.isBuffer(n))throw TypeError(`Not a string or buffer`);var r=e._finishFlushFlag;return e._processChunk(n,r)}function _(e){if(!(this instanceof _))return new _(e);T.call(this,e,r.DEFLATE)}function v(e){if(!(this instanceof v))return new v(e);T.call(this,e,r.INFLATE)}function y(e){if(!(this instanceof y))return new y(e);T.call(this,e,r.GZIP)}function b(e){if(!(this instanceof b))return new b(e);T.call(this,e,r.GUNZIP)}function x(e){if(!(this instanceof x))return new x(e);T.call(this,e,r.DEFLATERAW)}function S(e){if(!(this instanceof S))return new S(e);T.call(this,e,r.INFLATERAW)}function C(e){if(!(this instanceof C))return new C(e);T.call(this,e,r.UNZIP)}function w(e){return e===r.Z_NO_FLUSH||e===r.Z_PARTIAL_FLUSH||e===r.Z_SYNC_FLUSH||e===r.Z_FULL_FLUSH||e===r.Z_FINISH||e===r.Z_BLOCK}function T(i,a){var o=this;if(this._opts=i||={},this._chunkSize=i.chunkSize||e.Z_DEFAULT_CHUNK,n.call(this,i),i.flush&&!w(i.flush))throw Error(`Invalid flush flag: `+i.flush);if(i.finishFlush&&!w(i.finishFlush))throw Error(`Invalid flush flag: `+i.finishFlush);if(this._flushFlag=i.flush||r.Z_NO_FLUSH,this._finishFlushFlag=i.finishFlush===void 0?r.Z_FINISH:i.finishFlush,i.chunkSize&&(i.chunkSize<e.Z_MIN_CHUNK||i.chunkSize>e.Z_MAX_CHUNK))throw Error(`Invalid chunk size: `+i.chunkSize);if(i.windowBits&&(i.windowBits<e.Z_MIN_WINDOWBITS||i.windowBits>e.Z_MAX_WINDOWBITS))throw Error(`Invalid windowBits: `+i.windowBits);if(i.level&&(i.level<e.Z_MIN_LEVEL||i.level>e.Z_MAX_LEVEL))throw Error(`Invalid compression level: `+i.level);if(i.memLevel&&(i.memLevel<e.Z_MIN_MEMLEVEL||i.memLevel>e.Z_MAX_MEMLEVEL))throw Error(`Invalid memLevel: `+i.memLevel);if(i.strategy&&i.strategy!=e.Z_FILTERED&&i.strategy!=e.Z_HUFFMAN_ONLY&&i.strategy!=e.Z_RLE&&i.strategy!=e.Z_FIXED&&i.strategy!=e.Z_DEFAULT_STRATEGY)throw Error(`Invalid strategy: `+i.strategy);if(i.dictionary&&!t.isBuffer(i.dictionary))throw Error(`Invalid dictionary: it should be a Buffer instance`);this._handle=new r.Zlib(a);var s=this;this._hadError=!1,this._handle.onerror=function(t,n){E(s),s._hadError=!0;var r=Error(t);r.errno=n,r.code=e.codes[n],s.emit(`error`,r)};var c=e.Z_DEFAULT_COMPRESSION;typeof i.level==`number`&&(c=i.level);var l=e.Z_DEFAULT_STRATEGY;typeof i.strategy==`number`&&(l=i.strategy),this._handle.init(i.windowBits||e.Z_DEFAULT_WINDOWBITS,c,i.memLevel||e.Z_DEFAULT_MEMLEVEL,l,i.dictionary),this._buffer=t.allocUnsafe(this._chunkSize),this._offset=0,this._level=c,this._strategy=l,this.once(`end`,this.close),Object.defineProperty(this,`_closed`,{get:function(){return!o._handle},configurable:!0,enumerable:!0})}i.inherits(T,n),T.prototype.params=function(t,n,i){if(t<e.Z_MIN_LEVEL||t>e.Z_MAX_LEVEL)throw RangeError(`Invalid compression level: `+t);if(n!=e.Z_FILTERED&&n!=e.Z_HUFFMAN_ONLY&&n!=e.Z_RLE&&n!=e.Z_FIXED&&n!=e.Z_DEFAULT_STRATEGY)throw TypeError(`Invalid strategy: `+n);if(this._level!==t||this._strategy!==n){var o=this;this.flush(r.Z_SYNC_FLUSH,function(){a(o._handle,`zlib binding closed`),o._handle.params(t,n),o._hadError||(o._level=t,o._strategy=n,i&&i())})}else Q.nextTick(i)},T.prototype.reset=function(){return a(this._handle,`zlib binding closed`),this._handle.reset()},T.prototype._flush=function(e){this._transform(t.alloc(0),``,e)},T.prototype.flush=function(e,n){var i=this,a=this._writableState;(typeof e==`function`||e===void 0&&!n)&&(n=e,e=r.Z_FULL_FLUSH),a.ended?n&&Q.nextTick(n):a.ending?n&&this.once(`end`,n):a.needDrain?n&&this.once(`drain`,function(){return i.flush(e,n)}):(this._flushFlag=e,this.write(t.alloc(0),``,n))},T.prototype.close=function(e){E(this,e),Q.nextTick(D,this)};function E(e,t){t&&Q.nextTick(t),e._handle&&=(e._handle.close(),null)}function D(e){e.emit(`close`)}T.prototype._transform=function(e,n,i){var a,o=this._writableState,s=(o.ending||o.ended)&&(!e||o.length===e.length);if(e!==null&&!t.isBuffer(e))return i(Error(`invalid input`));if(!this._handle)return i(Error(`zlib binding closed`));s?a=this._finishFlushFlag:(a=this._flushFlag,e.length>=o.length&&(this._flushFlag=this._opts.flush||r.Z_NO_FLUSH)),this._processChunk(e,a,i)},T.prototype._processChunk=function(e,n,r){var i=e&&e.length,c=this._chunkSize-this._offset,l=0,u=this,d=typeof r==`function`;if(!d){var f=[],p=0,m;this.on(`error`,function(e){m=e}),a(this._handle,`zlib binding closed`);do var h=this._handle.writeSync(n,e,l,i,this._buffer,this._offset,c);while(!this._hadError&&v(h[0],h[1]));if(this._hadError)throw m;if(p>=o)throw E(this),RangeError(s);var g=t.concat(f,p);return E(this),g}a(this._handle,`zlib binding closed`);var _=this._handle.write(n,e,l,i,this._buffer,this._offset,c);_.buffer=e,_.callback=v;function v(o,s){if(this&&(this.buffer=null,this.callback=null),!u._hadError){var m=c-s;if(a(m>=0,`have should not go down`),m>0){var h=u._buffer.slice(u._offset,u._offset+m);u._offset+=m,d?u.push(h):(f.push(h),p+=h.length)}if((s===0||u._offset>=u._chunkSize)&&(c=u._chunkSize,u._offset=0,u._buffer=t.allocUnsafe(u._chunkSize)),s===0){if(l+=i-o,i=o,!d)return!0;var g=u._handle.write(n,e,l,i,u._buffer,u._offset,u._chunkSize);g.callback=v,g.buffer=e;return}if(!d)return!1;r()}}},i.inherits(_,T),i.inherits(v,T),i.inherits(y,T),i.inherits(b,T),i.inherits(x,T),i.inherits(S,T),i.inherits(C,T)})),Ko=ln(),qo=d(We(),1);Be();let Jo=Q!==void 0&&Q.versions?.node,Yo=null;Jo&&Promise.resolve().then(()=>d(Go(),1)).then(e=>(Yo=e.default??e,Yo)).catch(()=>(Yo=null,null));let Xo=(()=>{let e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e})();function Zo(e){let t=4294967295;for(let n=0;n<e.length;n++)t=Xo[(t^e[n])&255]^t>>>8;return(t^4294967295)>>>0}function Qo(e){return Yo&&typeof Yo.crc32==`function`?Yo.crc32(e)>>>0:Zo(e)}Be();let $o=Q!==void 0&&Q.versions?.node,es=null,ts=null;$o&&(ts=Promise.resolve().then(()=>d(Go(),1)).then(e=>(es=e.default??e,es)).catch(()=>(es=null,null)));function ns(){return es}async function rs(){return ts||es}async function is(e,t={}){let n=t.level??6;if(n===0)return e;let r=await rs();if(r&&typeof r.deflateRawSync==`function`){let t=r.deflateRawSync(Gi.Buffer.from(e),{level:n});return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}return typeof CompressionStream<`u`?os(e):(console.warn(`No native compression available, returning uncompressed data`),e)}function as(e,t={}){let n=t.level??6;if(n===0)return e;let r=ns();if(!r||typeof r.deflateRawSync!=`function`)throw Error(`Synchronous compression is only available in Node.js environment`);let i=r.deflateRawSync(Gi.Buffer.from(e),{level:n});return new Uint8Array(i.buffer,i.byteOffset,i.byteLength)}async function os(e){let t=new CompressionStream(`deflate-raw`),n=t.writable.getWriter(),r=t.readable.getReader();n.write(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),n.close();let i=[],a=0;for(;;){let{done:e,value:t}=await r.read();if(e)break;i.push(t),a+=t.length}let o=new Uint8Array(a),s=0;for(let e of i)o.set(e,s),s+=e.length;return o}function ss(e){return[(e.getHours()&31)<<11|(e.getMinutes()&63)<<5|e.getSeconds()>>1&31,(e.getFullYear()-1980&127)<<9|(e.getMonth()+1&15)<<5|e.getDate()&31]}let cs=new TextEncoder;function ls(e){return cs.encode(e)}function us(e){let t=new Uint8Array(30+e.name.length),n=new DataView(t.buffer);return n.setUint32(0,67324752,!0),n.setUint16(4,20,!0),n.setUint16(6,2048,!0),n.setUint16(8,e.compressionMethod,!0),n.setUint16(10,e.modTime,!0),n.setUint16(12,e.modDate,!0),n.setUint32(14,e.crc,!0),n.setUint32(18,e.compressedData.length,!0),n.setUint32(22,e.data.length,!0),n.setUint16(26,e.name.length,!0),n.setUint16(28,0,!0),t.set(e.name,30),t}function ds(e){let t=new Uint8Array(46+e.name.length+e.comment.length),n=new DataView(t.buffer);return n.setUint32(0,33639248,!0),n.setUint16(4,20,!0),n.setUint16(6,20,!0),n.setUint16(8,2048,!0),n.setUint16(10,e.compressionMethod,!0),n.setUint16(12,e.modTime,!0),n.setUint16(14,e.modDate,!0),n.setUint32(16,e.crc,!0),n.setUint32(20,e.compressedData.length,!0),n.setUint32(24,e.data.length,!0),n.setUint16(28,e.name.length,!0),n.setUint16(30,0,!0),n.setUint16(32,e.comment.length,!0),n.setUint16(34,0,!0),n.setUint16(36,0,!0),n.setUint32(38,0,!0),n.setUint32(42,e.offset,!0),t.set(e.name,46),e.comment.length>0&&t.set(e.comment,46+e.name.length),t}function fs(e,t,n,r){let i=new Uint8Array(22+r.length),a=new DataView(i.buffer);return a.setUint32(0,101010256,!0),a.setUint16(4,0,!0),a.setUint16(6,0,!0),a.setUint16(8,e,!0),a.setUint16(10,e,!0),a.setUint32(12,t,!0),a.setUint32(16,n,!0),a.setUint16(20,r.length,!0),r.length>0&&i.set(r,22),i}var ps=class{constructor(e={}){this.entries=[],this.currentOffset=0,this.finalized=!1,this.level=e.level??6,this.zipComment=ls(e.comment??``)}async addFile(e){if(this.finalized)throw Error(`Cannot add files after finalizing`);let t=ls(e.name),n=ls(e.comment??``),[r,i]=ss(e.modTime??new Date),a=this.level>0&&e.data.length>0,o=a?await is(e.data,{level:this.level}):e.data,s={name:t,data:e.data,compressedData:o,crc:Qo(e.data),compressionMethod:a?8:0,modTime:r,modDate:i,comment:n,offset:this.currentOffset};return this.entries.push(s),this.currentOffset+=30+t.length+o.length,[us(s),o]}addFileSync(e){if(this.finalized)throw Error(`Cannot add files after finalizing`);let t=ls(e.name),n=ls(e.comment??``),[r,i]=ss(e.modTime??new Date),a=this.level>0&&e.data.length>0,o=a?as(e.data,{level:this.level}):e.data,s={name:t,data:e.data,compressedData:o,crc:Qo(e.data),compressionMethod:a?8:0,modTime:r,modDate:i,comment:n,offset:this.currentOffset};return this.entries.push(s),this.currentOffset+=30+t.length+o.length,[us(s),o]}finalize(){if(this.finalized)throw Error(`ZIP already finalized`);this.finalized=!0;let e=[];for(let t of this.entries)e.push(ds(t));let t=e.reduce((e,t)=>e+t.length,0);return e.push(fs(this.entries.length,t,this.currentOffset,this.zipComment)),e}get entryCount(){return this.entries.length}get dataSize(){return this.currentOffset}},ms=class{constructor(e){this._buf=Gi.Buffer.alloc(e&&e.size||16384),this._encoding=e&&e.encoding||`utf8`,this._inPos=0,this._buffer=void 0}get length(){return this._inPos}get capacity(){return this._buf.length}get buffer(){return this._buf}toBuffer(){return this._buffer||(this._buffer=Gi.Buffer.alloc(this.length),this._buf.copy(this._buffer,0,0,this.length)),this._buffer}reset(e){e||=0,this._buffer=void 0,this._inPos=e}_grow(e){let t=this._buf.length*2;for(;t<e;)t*=2;let n=Gi.Buffer.alloc(t);this._buf.copy(n,0),this._buf=n}addText(e){this._buffer=void 0;let t=this._inPos+this._buf.write(e,this._inPos,this._encoding);for(;t>=this._buf.length-4;)this._grow(this._inPos+e.length),t=this._inPos+this._buf.write(e,this._inPos,this._encoding);this._inPos=t}addStringBuf(e){e.length&&(this._buffer=void 0,this.length+e.length>this.capacity&&this._grow(this.length+e.length),e._buf.copy(this._buf,this._inPos,0,e.length),this._inPos+=e.length)}},hs=class{constructor(e,t){this._data=e,this._encoding=t}get length(){return this.toBuffer().length}copy(e,t,n,r){return this.toBuffer().copy(e,t,n,r)}toBuffer(){return this._buffer||=Gi.Buffer.from(this._data,this._encoding),this._buffer}},gs=class{constructor(e){this._data=e}get length(){return this._data.length}copy(e,t,n,r){return this._data._buf.copy(e,t,n,r)}toBuffer(){return this._data.toBuffer()}},_s=class{constructor(e){this._data=e}get length(){return this._data.length}copy(e,t,n,r){this._data.copy(e,t,n,r)}toBuffer(){return this._data}},vs=class{constructor(e){this.size=e,this.buffer=Gi.Buffer.alloc(e),this.iRead=0,this.iWrite=0}toBuffer(){if(this.iRead===0&&this.iWrite===this.size)return this.buffer;let e=Gi.Buffer.alloc(this.iWrite-this.iRead);return this.buffer.copy(e,0,this.iRead,this.iWrite),e}get length(){return this.iWrite-this.iRead}get eod(){return this.iRead===this.iWrite}get full(){return this.iWrite===this.size}read(e){let t;return e===0?null:e===void 0||e>=this.length?(t=this.toBuffer(),this.iRead=this.iWrite,t):(t=Gi.Buffer.alloc(e),this.buffer.copy(t,0,this.iRead,e),this.iRead+=e,t)}write(e,t,n){let r=Math.min(n,this.size-this.iWrite);return e.copy(this.buffer,this.iWrite,t,t+r),this.iWrite+=r,r}};let ys=function(e){if(!(this instanceof ys))return new ys(e);Ko.Duplex.call(this,e),e||={},this.bufSize=e.bufSize||1024*1024,this.buffers=[],this.batch=e.batch||!1,this.corked=!1,this.inPos=0,this.outPos=0,this.pipes=[],this.paused=!1,this.encoding=null};Qi(ys,Ko.Duplex,{toBuffer(){switch(this.buffers.length){case 0:return null;case 1:return this.buffers[0].toBuffer();default:return Gi.Buffer.concat(this.buffers.map(e=>e.toBuffer()))}},_getWritableBuffer(){if(this.buffers.length){let e=this.buffers[this.buffers.length-1];if(!e.full)return e}let e=new vs(this.bufSize);return this.buffers.push(e),e},async _pipe(e){await Promise.all(this.pipes.map(function(t){return new Promise(n=>{t.write(e.toBuffer(),()=>{n()})})}))},_writeToBuffers(e){let t=0,n=e.length;for(;t<n;){let r=this._getWritableBuffer();t+=r.write(e,t,n-t)}},async write(e,t,n){t instanceof Function&&(n=t,t=`utf8`),n||=Zi;let r;if(e instanceof ms||e&&e.constructor?.name===`StringBuf`)r=new gs(e);else if(Gi.Buffer.isBuffer(e))r=new _s(e);else if(ArrayBuffer.isView(e))r=new _s(Gi.Buffer.from(e.buffer,e.byteOffset,e.byteLength));else if(e instanceof ArrayBuffer)r=new _s(Gi.Buffer.from(e));else if(typeof e==`string`||e instanceof String)r=new hs(String(e),t);else throw Error(`Chunk must be one of type String, Buffer, Uint8Array, ArrayBuffer or StringBuf.`);if(this.pipes.length)if(this.batch)for(this._writeToBuffers(r);!this.corked&&this.buffers.length>1;)this._pipe(this.buffers.shift());else this.corked?(this._writeToBuffers(r),queueMicrotask(()=>n())):(await this._pipe(r),n());else this.paused||this.emit(`data`,r.toBuffer()),this._writeToBuffers(r),this.emit(`readable`);return!0},cork(){this.corked=!0},_flush(){if(this.pipes.length)for(;this.buffers.length;)this._pipe(this.buffers.shift())},uncork(){this.corked=!1,this._flush()},end(e,t,n){let r=e=>{e?n(e):(this._flush(),this.pipes.forEach(e=>{e.end()}),this.emit(`finish`))};e?this.write(e,t,r):r()},read(e){let t;if(e){for(t=[];e&&this.buffers.length&&!this.buffers[0].eod;){let n=this.buffers[0],r=n.read(e);e-=r.length,t.push(r),n.eod&&n.full&&this.buffers.shift()}return Gi.Buffer.concat(t)}return t=this.buffers.map(e=>e.toBuffer()).filter(Boolean),this.buffers=[],Gi.Buffer.concat(t)},setEncoding(e){this.encoding=e},pause(){this.paused=!0},resume(){this.paused=!1},isPaused(){return!!this.paused},pipe(e){return this.pipes.push(e),!this.paused&&this.buffers.length&&this.end(),e},unpipe(e){this.pipes=this.pipes.filter(t=>t!==e)},unshift(){throw Error(`Not Implemented`)},wrap(){throw Error(`Not Implemented`)}});var bs=class extends qo.default.EventEmitter{constructor(e){super(),this.finalized=!1,this.pendingWrites=[];let t=e?.compression===`STORE`?0:Math.max(0,Math.min(9,e?.compressionOptions?.level??1));this.stream=new ys,this.zipBuilder=new ps({level:t})}append(e,t){let n;if(Object.prototype.hasOwnProperty.call(t,`base64`)&&t.base64){let t=typeof e==`string`?e:e.toString();n=Gi.Buffer.from(t,`base64`)}else n=typeof e==`string`?Gi.Buffer.from(e,`utf8`):Gi.Buffer.isBuffer(e)?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer?new Uint8Array(e):e;let r=this.zipBuilder.addFile({name:t.name,data:n}).then(e=>{for(let t of e)this.stream.write(Gi.Buffer.from(t))});this.pendingWrites.push(r)}push(e){return this.stream.push(e)}async finalize(){if(this.finalized)return;this.finalized=!0,await Promise.all(this.pendingWrites);let e=this.zipBuilder.finalize();for(let t of e)this.stream.write(Gi.Buffer.from(t));this.stream.end(),this.emit(`finish`)}read(e){return this.stream.read(e)}setEncoding(e){return this.stream.setEncoding(e)}pause(){return this.stream.pause()}resume(){return this.stream.resume()}isPaused(){return this.stream.isPaused()}pipe(e,t){return this.stream.pipe(e,t)}unpipe(e){return this.stream.unpipe(e)}unshift(e){return this.stream.unshift(e)}wrap(e){return this.stream.wrap(e)}};let xs=1e4;function Ss(e,t,n){e.push(` ${t}="${na(n.toString())}"`)}function Cs(e,t){if(t){let n=[];Object.entries(t).forEach(([e,t])=>{t!==void 0&&Ss(n,e,t)}),e.push(n.join(``))}}var ws=class{constructor(){this._xml=[],this._chunks=[],this._stack=[],this._rollbacks=[]}_consolidate(){this._xml.length>=xs&&(this._chunks.push(this._xml.join(``)),this._xml=[])}get tos(){return this._stack.length?this._stack[this._stack.length-1]:void 0}get cursor(){return this._chunks.length*xs+this._xml.length}openXml(e){let t=this._xml;t.push(`<?xml`),Cs(t,e),t.push(`?>
89
+ `)}openNode(e,t){let n=this.tos,r=this._xml;n&&this.open&&r.push(`>`),this._stack.push(e),r.push(`<`),r.push(e),Cs(r,t),this.leaf=!0,this.open=!0}addAttribute(e,t){if(!this.open)throw Error(`Cannot write attributes to node if it is not open`);t!==void 0&&Ss(this._xml,e,t)}addAttributes(e){if(!this.open)throw Error(`Cannot write attributes to node if it is not open`);Cs(this._xml,e)}writeText(e){let t=this._xml;this.open&&=(t.push(`>`),!1),this.leaf=!1,t.push(na(e.toString()))}writeXml(e){this.open&&=(this._xml.push(`>`),!1),this.leaf=!1,this._xml.push(e)}closeNode(){let e=this._stack.pop(),t=this._xml;this.leaf?t.push(`/>`):(t.push(`</`),t.push(e),t.push(`>`)),this.open=!1,this.leaf=!1,this._consolidate()}leafNode(e,t,n){this.openNode(e,t),n!==void 0&&this.writeText(n),this.closeNode()}closeAll(){for(;this._stack.length;)this.closeNode()}addRollback(){return this._rollbacks.push({xml:this._xml.length,stack:this._stack.length,leaf:this.leaf,open:this.open,chunksLength:this._chunks.length}),this.cursor}commit(){this._rollbacks.pop()}rollback(){let e=this._rollbacks.pop();this._xml.length>e.xml&&this._xml.splice(e.xml,this._xml.length-e.xml),this._stack.length>e.stack&&this._stack.splice(e.stack,this._stack.length-e.stack),this._chunks.length>e.chunksLength&&this._chunks.splice(e.chunksLength,this._chunks.length-e.chunksLength),this.leaf=e.leaf,this.open=e.open}get xml(){return this.closeAll(),this._chunks.length===0?this._xml.join(``):(this._xml.length>0&&this._chunks.push(this._xml.join(``)),this._chunks.join(``))}static{this.StdDocAttributes={version:`1.0`,encoding:`UTF-8`,standalone:`yes`}}},Ts=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CHAR=`
91
90
  \r -퟿-�𐀀-􏿿`,e.S=` \r
92
- `,e.NAME_START_CHAR=`:A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿`,e.NAME_CHAR=`-`+e.NAME_START_CHAR+`.0-9·̀-ͯ‿-⁀`,e.CHAR_RE=RegExp(`^[`+e.CHAR+`]$`,`u`),e.S_RE=RegExp(`^[`+e.S+`]+$`,`u`),e.NAME_START_CHAR_RE=RegExp(`^[`+e.NAME_START_CHAR+`]$`,`u`),e.NAME_CHAR_RE=RegExp(`^[`+e.NAME_CHAR+`]$`,`u`),e.NAME_RE=RegExp(`^[`+e.NAME_START_CHAR+`][`+e.NAME_CHAR+`]*$`,`u`),e.NMTOKEN_RE=RegExp(`^[`+e.NAME_CHAR+`]+$`,`u`);var t=9,n=10,r=13,i=32;e.S_LIST=[i,n,r,t];function a(e){return e>=i&&e<=55295||e===n||e===r||e===t||e>=57344&&e<=65533||e>=65536&&e<=1114111}e.isChar=a;function o(e){return e===i||e===n||e===r||e===t}e.isS=o;function s(e){return e>=65&&e<=90||e>=97&&e<=122||e===58||e===95||e===8204||e===8205||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}e.isNameStartChar=s;function c(e){return s(e)||e>=48&&e<=57||e===45||e===46||e===183||e>=768&&e<=879||e>=8255&&e<=8256}e.isNameChar=c})),ks=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CHAR=`-퟿-�𐀀-􏿿`,e.RESTRICTED_CHAR=`-\b\v\f--„†-Ÿ`,e.S=` \r
93
- `,e.NAME_START_CHAR=`:A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿`,e.NAME_CHAR=`-`+e.NAME_START_CHAR+`.0-9·̀-ͯ‿-⁀`,e.CHAR_RE=RegExp(`^[`+e.CHAR+`]$`,`u`),e.RESTRICTED_CHAR_RE=RegExp(`^[`+e.RESTRICTED_CHAR+`]$`,`u`),e.S_RE=RegExp(`^[`+e.S+`]+$`,`u`),e.NAME_START_CHAR_RE=RegExp(`^[`+e.NAME_START_CHAR+`]$`,`u`),e.NAME_CHAR_RE=RegExp(`^[`+e.NAME_CHAR+`]$`,`u`),e.NAME_RE=RegExp(`^[`+e.NAME_START_CHAR+`][`+e.NAME_CHAR+`]*$`,`u`),e.NMTOKEN_RE=RegExp(`^[`+e.NAME_CHAR+`]+$`,`u`);var t=9,n=10,r=13,i=32;e.S_LIST=[i,n,r,t];function a(e){return e>=1&&e<=55295||e>=57344&&e<=65533||e>=65536&&e<=1114111}e.isChar=a;function o(e){return e>=1&&e<=8||e===11||e===12||e>=14&&e<=31||e>=127&&e<=132||e>=134&&e<=159}e.isRestrictedChar=o;function s(e){return e===9||e===10||e===13||e>31&&e<127||e===133||e>159&&e<=55295||e>=57344&&e<=65533||e>=65536&&e<=1114111}e.isCharAndNotRestricted=s;function c(e){return e===i||e===n||e===r||e===t}e.isS=c;function l(e){return e>=65&&e<=90||e>=97&&e<=122||e===58||e===95||e===8204||e===8205||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}e.isNameStartChar=l;function u(e){return l(e)||e>=48&&e<=57||e===45||e===46||e===183||e>=768&&e<=879||e>=8255&&e<=8256}e.isNameChar=u})),As=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.NC_NAME_START_CHAR=`A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿`,e.NC_NAME_CHAR=`-`+e.NC_NAME_START_CHAR+`.0-9·̀-ͯ‿-⁀`,e.NC_NAME_START_CHAR_RE=RegExp(`^[`+e.NC_NAME_START_CHAR+`]$`,`u`),e.NC_NAME_CHAR_RE=RegExp(`^[`+e.NC_NAME_CHAR+`]$`,`u`),e.NC_NAME_RE=RegExp(`^[`+e.NC_NAME_START_CHAR+`][`+e.NC_NAME_CHAR+`]*$`,`u`);function t(e){return e>=65&&e<=90||e===95||e>=97&&e<=122||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}e.isNCNameStartChar=t;function n(e){return t(e)||e===45||e===46||e>=48&&e<=57||e===183||e>=768&&e<=879||e>=8255&&e<=8256}e.isNCNameChar=n})),js=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SaxesParser=e.EVENTS=void 0;let t=Os(),n=ks(),r=As();var i=t.isS,a=t.isChar,o=t.isNameStartChar,s=t.isNameChar,c=t.S_LIST,l=t.NAME_RE,u=n.isChar,d=r.isNCNameStartChar,f=r.isNCNameChar,p=r.NC_NAME_RE;let m=`http://www.w3.org/XML/1998/namespace`,h=`http://www.w3.org/2000/xmlns/`,g={__proto__:null,xml:m,xmlns:h},_={__proto__:null,amp:`&`,gt:`>`,lt:`<`,quot:`"`,apos:`'`},v=8232,y=e=>e===34||e===39,b=[34,39],x=[...b,91,62],S=[...b,60,93],C=[61,63,...c],w=[...c,62,38,60];function T(e,t,n){switch(t){case`xml`:n!==m&&e.fail(`xml prefix must be bound to ${m}.`);break;case`xmlns`:n!==h&&e.fail(`xmlns prefix must be bound to ${h}.`);break;default:}switch(n){case h:e.fail(t===``?`the default namespace may not be set to ${n}.`:`may not assign a prefix (even "xmlns") to the URI \
94
- ${h}.`);break;case m:switch(t){case`xml`:break;case``:e.fail(`the default namespace may not be set to ${n}.`);break;default:e.fail(`may not assign the xml namespace to another prefix.`)}break;default:}}function E(e,t){for(let n of Object.keys(t))T(e,n,t[n])}let D=e=>p.test(e),O=e=>l.test(e);e.EVENTS=[`xmldecl`,`text`,`processinginstruction`,`doctype`,`comment`,`opentagstart`,`attribute`,`opentag`,`closetag`,`cdata`,`error`,`end`,`ready`];let k={xmldecl:`xmldeclHandler`,text:`textHandler`,processinginstruction:`piHandler`,doctype:`doctypeHandler`,comment:`commentHandler`,opentagstart:`openTagStartHandler`,attribute:`attributeHandler`,opentag:`openTagHandler`,closetag:`closeTagHandler`,cdata:`cdataHandler`,error:`errorHandler`,end:`endHandler`,ready:`readyHandler`};e.SaxesParser=class{constructor(e){this.opt=e??{},this.fragmentOpt=!!this.opt.fragment;let t=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=this.opt.position!==!1,this.fileName=this.opt.fileName,t){this.nameStartCheck=d,this.nameCheck=f,this.isName=D,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},g);let e=this.opt.additionalNamespaces;e!=null&&(E(this,e),Object.assign(this.ns,e))}else this.nameStartCheck=o,this.nameCheck=s,this.isName=O,this.processAttribs=this.processAttribsPlain,this.pushAttrib=this.pushAttribPlain;this.stateTable=[this.sBegin,this.sBeginWhitespace,this.sDoctype,this.sDoctypeQuote,this.sDTD,this.sDTDQuoted,this.sDTDOpenWaka,this.sDTDOpenWakaBang,this.sDTDComment,this.sDTDCommentEnding,this.sDTDCommentEnded,this.sDTDPI,this.sDTDPIEnding,this.sText,this.sEntity,this.sOpenWaka,this.sOpenWakaBang,this.sComment,this.sCommentEnding,this.sCommentEnded,this.sCData,this.sCDataEnding,this.sCDataEnding2,this.sPIFirstChar,this.sPIRest,this.sPIBody,this.sPIEnding,this.sXMLDeclNameStart,this.sXMLDeclName,this.sXMLDeclEq,this.sXMLDeclValueStart,this.sXMLDeclValue,this.sXMLDeclSeparator,this.sXMLDeclEnding,this.sOpenTag,this.sOpenTagSlash,this.sAttrib,this.sAttribName,this.sAttribNameSawWhite,this.sAttribValue,this.sAttribValueQuoted,this.sAttribValueClosed,this.sAttribValueUnquoted,this.sCloseTag,this.sCloseTagSawWhite],this._init()}get closed(){return this._closed}_init(){var e;this.openWakaBang=``,this.text=``,this.name=``,this.piTarget=``,this.entity=``,this.q=null,this.tags=[],this.tag=null,this.topNS=null,this.chunk=``,this.chunkPosition=0,this.i=0,this.prevI=0,this.carriedFromPrevious=void 0,this.forbiddenState=0,this.attribList=[];let{fragmentOpt:t}=this;this.state=t?13:0,this.reportedTextBeforeRoot=this.reportedTextAfterRoot=this.closedRoot=this.sawRoot=t,this.xmlDeclPossible=!t,this.xmlDeclExpects=[`version`],this.entityReturnState=void 0;let{defaultXMLVersion:n}=this.opt;if(n===void 0){if(this.opt.forceXMLVersion===!0)throw Error(`forceXMLVersion set but defaultXMLVersion is not set`);n=`1.0`}this.setXMLVersion(n),this.positionAtNewLine=0,this.doctype=!1,this._closed=!1,this.xmlDecl={version:void 0,encoding:void 0,standalone:void 0},this.line=1,this.column=0,this.ENTITIES=Object.create(_),(e=this.readyHandler)==null||e.call(this)}get position(){return this.chunkPosition+this.i}get columnIndex(){return this.position-this.positionAtNewLine}on(e,t){this[k[e]]=t}off(e){this[k[e]]=void 0}makeError(e){let t=this.fileName??``;return this.trackPosition&&(t.length>0&&(t+=`:`),t+=`${this.line}:${this.column}`),t.length>0&&(t+=`: `),Error(t+e)}fail(e){let t=this.makeError(e),n=this.errorHandler;if(n===void 0)throw t;return n(t),this}write(e){if(this.closed)return this.fail(`cannot write after close; assign an onready handler.`);let t=!1;e===null?(t=!0,e=``):typeof e==`object`&&(e=e.toString()),this.carriedFromPrevious!==void 0&&(e=`${this.carriedFromPrevious}${e}`,this.carriedFromPrevious=void 0);let n=e.length,r=e.charCodeAt(n-1);!t&&(r===13||r>=55296&&r<=56319)&&(this.carriedFromPrevious=e[n-1],n--,e=e.slice(0,n));let{stateTable:i}=this;for(this.chunk=e,this.i=0;this.i<n;)i[this.state].call(this);return this.chunkPosition+=n,t?this.end():this}close(){return this.write(null)}getCode10(){let{chunk:e,i:t}=this;if(this.prevI=t,this.i=t+1,t>=e.length)return-1;let n=e.charCodeAt(t);if(this.column++,n<55296){if(n>=32||n===9)return n;switch(n){case 10:return this.line++,this.column=0,this.positionAtNewLine=this.position,10;case 13:return e.charCodeAt(t+1)===10&&(this.i=t+2),this.line++,this.column=0,this.positionAtNewLine=this.position,-2;default:return this.fail(`disallowed character.`),n}}if(n>56319)return n>=57344&&n<=65533||this.fail(`disallowed character.`),n;let r=65536+(n-55296)*1024+(e.charCodeAt(t+1)-56320);return this.i=t+2,r>1114111&&this.fail(`disallowed character.`),r}getCode11(){let{chunk:e,i:t}=this;if(this.prevI=t,this.i=t+1,t>=e.length)return-1;let n=e.charCodeAt(t);if(this.column++,n<55296){if(n>31&&n<127||n>159&&n!==v||n===9)return n;switch(n){case 10:return this.line++,this.column=0,this.positionAtNewLine=this.position,10;case 13:{let n=e.charCodeAt(t+1);(n===10||n===133)&&(this.i=t+2)}case 133:case v:return this.line++,this.column=0,this.positionAtNewLine=this.position,-2;default:return this.fail(`disallowed character.`),n}}if(n>56319)return n>=57344&&n<=65533||this.fail(`disallowed character.`),n;let r=65536+(n-55296)*1024+(e.charCodeAt(t+1)-56320);return this.i=t+2,r>1114111&&this.fail(`disallowed character.`),r}getCodeNorm(){let e=this.getCode();return e===-2?10:e}unget(){this.i=this.prevI,this.column--}captureTo(e){let{i:t}=this,{chunk:n}=this;for(;;){let r=this.getCode(),i=r===-2,a=i?10:r;if(a===-1||e.includes(a))return this.text+=n.slice(t,this.prevI),a;i&&(this.text+=`${n.slice(t,this.prevI)}\n`,t=this.i)}}captureToChar(e){let{i:t}=this,{chunk:n}=this;for(;;){let r=this.getCode();switch(r){case-2:this.text+=`${n.slice(t,this.prevI)}\n`,t=this.i,r=10;break;case-1:return this.text+=n.slice(t),!1;default:}if(r===e)return this.text+=n.slice(t,this.prevI),!0}}captureNameChars(){let{chunk:e,i:t}=this;for(;;){let n=this.getCode();if(n===-1)return this.name+=e.slice(t),-1;if(!s(n))return this.name+=e.slice(t,this.prevI),n===-2?10:n}}skipSpaces(){for(;;){let e=this.getCodeNorm();if(e===-1||!i(e))return e}}setXMLVersion(e){this.currentXMLVersion=e,e===`1.0`?(this.isChar=a,this.getCode=this.getCode10):(this.isChar=u,this.getCode=this.getCode11)}sBegin(){this.chunk.charCodeAt(0)===65279&&(this.i++,this.column++),this.state=1}sBeginWhitespace(){let e=this.i,t=this.skipSpaces();switch(this.prevI!==e&&(this.xmlDeclPossible=!1),t){case 60:if(this.state=15,this.text.length!==0)throw Error(`no-empty text at start`);break;case-1:break;default:this.unget(),this.state=13,this.xmlDeclPossible=!1}}sDoctype(){var e;let t=this.captureTo(x);switch(t){case 62:(e=this.doctypeHandler)==null||e.call(this,this.text),this.text=``,this.state=13,this.doctype=!0;break;case-1:break;default:this.text+=String.fromCodePoint(t),t===91?this.state=4:y(t)&&(this.state=3,this.q=t)}}sDoctypeQuote(){let e=this.q;this.captureToChar(e)&&(this.text+=String.fromCodePoint(e),this.q=null,this.state=2)}sDTD(){let e=this.captureTo(S);e!==-1&&(this.text+=String.fromCodePoint(e),e===93?this.state=2:e===60?this.state=6:y(e)&&(this.state=5,this.q=e))}sDTDQuoted(){let e=this.q;this.captureToChar(e)&&(this.text+=String.fromCodePoint(e),this.state=4,this.q=null)}sDTDOpenWaka(){let e=this.getCodeNorm();switch(this.text+=String.fromCodePoint(e),e){case 33:this.state=7,this.openWakaBang=``;break;case 63:this.state=11;break;default:this.state=4}}sDTDOpenWakaBang(){let e=String.fromCodePoint(this.getCodeNorm()),t=this.openWakaBang+=e;this.text+=e,t!==`-`&&(this.state=t===`--`?8:4,this.openWakaBang=``)}sDTDComment(){this.captureToChar(45)&&(this.text+=`-`,this.state=9)}sDTDCommentEnding(){let e=this.getCodeNorm();this.text+=String.fromCodePoint(e),this.state=e===45?10:8}sDTDCommentEnded(){let e=this.getCodeNorm();this.text+=String.fromCodePoint(e),e===62?this.state=4:(this.fail(`malformed comment.`),this.state=8)}sDTDPI(){this.captureToChar(63)&&(this.text+=`?`,this.state=12)}sDTDPIEnding(){let e=this.getCodeNorm();this.text+=String.fromCodePoint(e),e===62&&(this.state=4)}sText(){this.tags.length===0?this.handleTextOutsideRoot():this.handleTextInRoot()}sEntity(){let{i:e}=this,{chunk:t}=this;loop:for(;;)switch(this.getCode()){case-2:this.entity+=`${t.slice(e,this.prevI)}\n`,e=this.i;break;case 59:{let{entityReturnState:n}=this,r=this.entity+t.slice(e,this.prevI);this.state=n;let i;r===``?(this.fail(`empty entity name.`),i=`&;`):(i=this.parseEntity(r),this.entity=``),(n!==13||this.textHandler!==void 0)&&(this.text+=i);break loop}case-1:this.entity+=t.slice(e);break loop;default:}}sOpenWaka(){let e=this.getCode();if(o(e))this.state=34,this.unget(),this.xmlDeclPossible=!1;else switch(e){case 47:this.state=43,this.xmlDeclPossible=!1;break;case 33:this.state=16,this.openWakaBang=``,this.xmlDeclPossible=!1;break;case 63:this.state=23;break;default:this.fail(`disallowed character in tag name`),this.state=13,this.xmlDeclPossible=!1}}sOpenWakaBang(){switch(this.openWakaBang+=String.fromCodePoint(this.getCodeNorm()),this.openWakaBang){case`[CDATA[`:!this.sawRoot&&!this.reportedTextBeforeRoot&&(this.fail(`text data outside of root node.`),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail(`text data outside of root node.`),this.reportedTextAfterRoot=!0),this.state=20,this.openWakaBang=``;break;case`--`:this.state=17,this.openWakaBang=``;break;case`DOCTYPE`:this.state=2,(this.doctype||this.sawRoot)&&this.fail(`inappropriately located doctype declaration.`),this.openWakaBang=``;break;default:this.openWakaBang.length>=7&&this.fail(`incorrect syntax.`)}}sComment(){this.captureToChar(45)&&(this.state=18)}sCommentEnding(){var e;let t=this.getCodeNorm();t===45?(this.state=19,(e=this.commentHandler)==null||e.call(this,this.text),this.text=``):(this.text+=`-${String.fromCodePoint(t)}`,this.state=17)}sCommentEnded(){let e=this.getCodeNorm();e===62?this.state=13:(this.fail(`malformed comment.`),this.text+=`--${String.fromCodePoint(e)}`,this.state=17)}sCData(){this.captureToChar(93)&&(this.state=21)}sCDataEnding(){let e=this.getCodeNorm();e===93?this.state=22:(this.text+=`]${String.fromCodePoint(e)}`,this.state=20)}sCDataEnding2(){var e;let t=this.getCodeNorm();switch(t){case 62:(e=this.cdataHandler)==null||e.call(this,this.text),this.text=``,this.state=13;break;case 93:this.text+=`]`;break;default:this.text+=`]]${String.fromCodePoint(t)}`,this.state=20}}sPIFirstChar(){let e=this.getCodeNorm();this.nameStartCheck(e)?(this.piTarget+=String.fromCodePoint(e),this.state=24):e===63||i(e)?(this.fail(`processing instruction without a target.`),this.state=e===63?26:25):(this.fail(`disallowed character in processing instruction name.`),this.piTarget+=String.fromCodePoint(e),this.state=24)}sPIRest(){let{chunk:e,i:t}=this;for(;;){let n=this.getCodeNorm();if(n===-1){this.piTarget+=e.slice(t);return}if(!this.nameCheck(n)){this.piTarget+=e.slice(t,this.prevI);let r=n===63;r||i(n)?this.piTarget===`xml`?(this.xmlDeclPossible||this.fail(`an XML declaration must be at the start of the document.`),this.state=r?33:27):this.state=r?26:25:(this.fail(`disallowed character in processing instruction name.`),this.piTarget+=String.fromCodePoint(n));break}}}sPIBody(){if(this.text.length===0){let e=this.getCodeNorm();e===63?this.state=26:i(e)||(this.text=String.fromCodePoint(e))}else this.captureToChar(63)&&(this.state=26)}sPIEnding(){var e;let t=this.getCodeNorm();if(t===62){let{piTarget:t}=this;t.toLowerCase()===`xml`&&this.fail(`the XML declaration must appear at the start of the document.`),(e=this.piHandler)==null||e.call(this,{target:t,body:this.text}),this.piTarget=this.text=``,this.state=13}else t===63?this.text+=`?`:(this.text+=`?${String.fromCodePoint(t)}`,this.state=25);this.xmlDeclPossible=!1}sXMLDeclNameStart(){let e=this.skipSpaces();if(e===63){this.state=33;return}e!==-1&&(this.state=28,this.name=String.fromCodePoint(e))}sXMLDeclName(){let e=this.captureTo(C);if(e===63){this.state=33,this.name+=this.text,this.text=``,this.fail(`XML declaration is incomplete.`);return}if(i(e)||e===61){if(this.name+=this.text,this.text=``,!this.xmlDeclExpects.includes(this.name))switch(this.name.length){case 0:this.fail(`did not expect any more name/value pairs.`);break;case 1:this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);break;default:this.fail(`expected one of ${this.xmlDeclExpects.join(`, `)}`)}this.state=e===61?30:29}}sXMLDeclEq(){let e=this.getCodeNorm();if(e===63){this.state=33,this.fail(`XML declaration is incomplete.`);return}i(e)||(e!==61&&this.fail(`value required.`),this.state=30)}sXMLDeclValueStart(){let e=this.getCodeNorm();if(e===63){this.state=33,this.fail(`XML declaration is incomplete.`);return}i(e)||(y(e)?this.q=e:(this.fail(`value must be quoted.`),this.q=32),this.state=31)}sXMLDeclValue(){let e=this.captureTo([this.q,63]);if(e===63){this.state=33,this.text=``,this.fail(`XML declaration is incomplete.`);return}if(e===-1)return;let t=this.text;switch(this.text=``,this.name){case`version`:{this.xmlDeclExpects=[`encoding`,`standalone`];let e=t;this.xmlDecl.version=e,/^1\.[0-9]+$/.test(e)?this.opt.forceXMLVersion||this.setXMLVersion(e):this.fail(`version number must match /^1\\.[0-9]+$/.`);break}case`encoding`:/^[A-Za-z][A-Za-z0-9._-]*$/.test(t)||this.fail(`encoding value must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/.`),this.xmlDeclExpects=[`standalone`],this.xmlDecl.encoding=t;break;case`standalone`:t!==`yes`&&t!==`no`&&this.fail(`standalone value must match "yes" or "no".`),this.xmlDeclExpects=[],this.xmlDecl.standalone=t;break;default:}this.name=``,this.state=32}sXMLDeclSeparator(){let e=this.getCodeNorm();if(e===63){this.state=33;return}i(e)||(this.fail(`whitespace required.`),this.unget()),this.state=27}sXMLDeclEnding(){var e;this.getCodeNorm()===62?(this.piTarget===`xml`?this.name!==`version`&&this.xmlDeclExpects.includes(`version`)&&this.fail(`XML declaration must contain a version.`):this.fail(`processing instructions are not allowed before root.`),(e=this.xmldeclHandler)==null||e.call(this,this.xmlDecl),this.name=``,this.piTarget=this.text=``,this.state=13):this.fail(`The character ? is disallowed anywhere in XML declarations.`),this.xmlDeclPossible=!1}sOpenTag(){var e;let t=this.captureNameChars();if(t===-1)return;let n=this.tag={name:this.name,attributes:Object.create(null)};switch(this.name=``,this.xmlnsOpt&&(this.topNS=n.ns=Object.create(null)),(e=this.openTagStartHandler)==null||e.call(this,n),this.sawRoot=!0,!this.fragmentOpt&&this.closedRoot&&this.fail(`documents may contain only one root.`),t){case 62:this.openTag();break;case 47:this.state=35;break;default:i(t)||this.fail(`disallowed character in tag name.`),this.state=36}}sOpenTagSlash(){this.getCode()===62?this.openSelfClosingTag():(this.fail(`forward-slash in opening tag not followed by >.`),this.state=36)}sAttrib(){let e=this.skipSpaces();e!==-1&&(o(e)?(this.unget(),this.state=37):e===62?this.openTag():e===47?this.state=35:this.fail(`disallowed character in attribute name.`))}sAttribName(){let e=this.captureNameChars();e===61?this.state=39:i(e)?this.state=38:e===62?(this.fail(`attribute without value.`),this.pushAttrib(this.name,this.name),this.name=this.text=``,this.openTag()):e!==-1&&this.fail(`disallowed character in attribute name.`)}sAttribNameSawWhite(){let e=this.skipSpaces();switch(e){case-1:return;case 61:this.state=39;break;default:this.fail(`attribute without value.`),this.text=``,this.name=``,e===62?this.openTag():o(e)?(this.unget(),this.state=37):(this.fail(`disallowed character in attribute name.`),this.state=36)}}sAttribValue(){let e=this.getCodeNorm();y(e)?(this.q=e,this.state=40):i(e)||(this.fail(`unquoted attribute value.`),this.state=42,this.unget())}sAttribValueQuoted(){let{q:e,chunk:t}=this,{i:n}=this;for(;;)switch(this.getCode()){case e:this.pushAttrib(this.name,this.text+t.slice(n,this.prevI)),this.name=this.text=``,this.q=null,this.state=41;return;case 38:this.text+=t.slice(n,this.prevI),this.state=14,this.entityReturnState=40;return;case 10:case-2:case 9:this.text+=`${t.slice(n,this.prevI)} `,n=this.i;break;case 60:this.text+=t.slice(n,this.prevI),this.fail(`disallowed character.`);return;case-1:this.text+=t.slice(n);return;default:}}sAttribValueClosed(){let e=this.getCodeNorm();i(e)?this.state=36:e===62?this.openTag():e===47?this.state=35:o(e)?(this.fail(`no whitespace between attributes.`),this.unget(),this.state=37):this.fail(`disallowed character in attribute name.`)}sAttribValueUnquoted(){let e=this.captureTo(w);switch(e){case 38:this.state=14,this.entityReturnState=42;break;case 60:this.fail(`disallowed character.`);break;case-1:break;default:this.text.includes(`]]>`)&&this.fail(`the string "]]>" is disallowed in char data.`),this.pushAttrib(this.name,this.text),this.name=this.text=``,e===62?this.openTag():this.state=36}}sCloseTag(){let e=this.captureNameChars();e===62?this.closeTag():i(e)?this.state=44:e!==-1&&this.fail(`disallowed character in closing tag.`)}sCloseTagSawWhite(){switch(this.skipSpaces()){case 62:this.closeTag();break;case-1:break;default:this.fail(`disallowed character in closing tag.`)}}handleTextInRoot(){let{i:e,forbiddenState:t}=this,{chunk:n,textHandler:r}=this;scanLoop:for(;;)switch(this.getCode()){case 60:if(this.state=15,r!==void 0){let{text:t}=this,i=n.slice(e,this.prevI);t.length===0?i.length!==0&&r(i):(r(t+i),this.text=``)}t=0;break scanLoop;case 38:this.state=14,this.entityReturnState=13,r!==void 0&&(this.text+=n.slice(e,this.prevI)),t=0;break scanLoop;case 93:switch(t){case 0:t=1;break;case 1:t=2;break;case 2:break;default:throw Error(`impossible state`)}break;case 62:t===2&&this.fail(`the string "]]>" is disallowed in char data.`),t=0;break;case-2:r!==void 0&&(this.text+=`${n.slice(e,this.prevI)}\n`),e=this.i,t=0;break;case-1:r!==void 0&&(this.text+=n.slice(e));break scanLoop;default:t=0}this.forbiddenState=t}handleTextOutsideRoot(){let{i:e}=this,{chunk:t,textHandler:n}=this,r=!1;outRootLoop:for(;;){let a=this.getCode();switch(a){case 60:if(this.state=15,n!==void 0){let{text:r}=this,i=t.slice(e,this.prevI);r.length===0?i.length!==0&&n(i):(n(r+i),this.text=``)}break outRootLoop;case 38:this.state=14,this.entityReturnState=13,n!==void 0&&(this.text+=t.slice(e,this.prevI)),r=!0;break outRootLoop;case-2:n!==void 0&&(this.text+=`${t.slice(e,this.prevI)}\n`),e=this.i;break;case-1:n!==void 0&&(this.text+=t.slice(e));break outRootLoop;default:i(a)||(r=!0)}}r&&(!this.sawRoot&&!this.reportedTextBeforeRoot&&(this.fail(`text data outside of root node.`),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail(`text data outside of root node.`),this.reportedTextAfterRoot=!0))}pushAttribNS(e,t){var n;let{prefix:r,local:i}=this.qname(e),a={name:e,prefix:r,local:i,value:t};if(this.attribList.push(a),(n=this.attributeHandler)==null||n.call(this,a),r===`xmlns`){let e=t.trim();this.currentXMLVersion===`1.0`&&e===``&&this.fail(`invalid attempt to undefine prefix in XML 1.0`),this.topNS[i]=e,T(this,i,e)}else if(e===`xmlns`){let e=t.trim();this.topNS[``]=e,T(this,``,e)}}pushAttribPlain(e,t){var n;let r={name:e,value:t};this.attribList.push(r),(n=this.attributeHandler)==null||n.call(this,r)}end(){var e,t;this.sawRoot||this.fail(`document must contain a root element.`);let{tags:n}=this;for(;n.length>0;){let e=n.pop();this.fail(`unclosed tag: ${e.name}`)}this.state!==0&&this.state!==13&&this.fail(`unexpected end.`);let{text:r}=this;return r.length!==0&&((e=this.textHandler)==null||e.call(this,r),this.text=``),this._closed=!0,(t=this.endHandler)==null||t.call(this),this._init(),this}resolve(e){var t;let n=this.topNS[e];if(n!==void 0)return n;let{tags:r}=this;for(let t=r.length-1;t>=0;t--)if(n=r[t].ns[e],n!==void 0)return n;return n=this.ns[e],n===void 0?(t=this.opt).resolvePrefix?.call(t,e):n}qname(e){let t=e.indexOf(`:`);if(t===-1)return{prefix:``,local:e};let n=e.slice(t+1),r=e.slice(0,t);return(r===``||n===``||n.includes(`:`))&&this.fail(`malformed name: ${e}.`),{prefix:r,local:n}}processAttribsNS(){let{attribList:e}=this,t=this.tag;{let{prefix:e,local:n}=this.qname(t.name);t.prefix=e,t.local=n;let r=t.uri=this.resolve(e)??``;e!==``&&(e===`xmlns`&&this.fail(`tags may not have "xmlns" as prefix.`),r===``&&(this.fail(`unbound namespace prefix: ${JSON.stringify(e)}.`),t.uri=e))}if(e.length===0)return;let{attributes:n}=t,r=new Set;for(let t of e){let{name:e,prefix:i,local:a}=t,o,s;i===``?(o=e===`xmlns`?h:``,s=e):(o=this.resolve(i),o===void 0&&(this.fail(`unbound namespace prefix: ${JSON.stringify(i)}.`),o=i),s=`{${o}}${a}`),r.has(s)&&this.fail(`duplicate attribute: ${s}.`),r.add(s),t.uri=o,n[e]=t}this.attribList=[]}processAttribsPlain(){let{attribList:e}=this,t=this.tag.attributes;for(let{name:n,value:r}of e)t[n]!==void 0&&this.fail(`duplicate attribute: ${n}.`),t[n]=r;this.attribList=[]}openTag(){var e;this.processAttribs();let{tags:t}=this,n=this.tag;n.isSelfClosing=!1,(e=this.openTagHandler)==null||e.call(this,n),t.push(n),this.state=13,this.name=``}openSelfClosingTag(){var e,t;this.processAttribs();let{tags:n}=this,r=this.tag;r.isSelfClosing=!0,(e=this.openTagHandler)==null||e.call(this,r),(t=this.closeTagHandler)==null||t.call(this,r),(this.tag=n[n.length-1]??null)===null&&(this.closedRoot=!0),this.state=13,this.name=``}closeTag(){let{tags:e,name:t}=this;if(this.state=13,this.name=``,t===``){this.fail(`weird empty close tag.`),this.text+=`</>`;return}let n=this.closeTagHandler,r=e.length;for(;r-- >0;){let r=this.tag=e.pop();if(this.topNS=r.ns,n?.(r),r.name===t)break;this.fail(`unexpected close tag.`)}r===0?this.closedRoot=!0:r<0&&(this.fail(`unmatched closing tag: ${t}.`),this.text+=`</${t}>`)}parseEntity(e){if(e[0]!==`#`){let t=this.ENTITIES[e];return t===void 0?(this.fail(this.isName(e)?`undefined entity.`:`disallowed character in entity name.`),`&${e};`):t}let t=NaN;return e[1]===`x`&&/^#x[0-9a-f]+$/i.test(e)?t=parseInt(e.slice(2),16):/^#[0-9]+$/.test(e)&&(t=parseInt(e.slice(1),10)),this.isChar(t)?String.fromCodePoint(t):(this.fail(`malformed character entity.`),`&${e};`)}}}))();async function*Ms(e){let t=new js.SaxesParser({xmlns:!1,defaultXMLVersion:`1.0`}),n;t.on(`error`,e=>{n=e});let r=[];t.on(`opentag`,e=>r.push({eventType:`opentag`,value:e})),t.on(`text`,e=>r.push({eventType:`text`,value:e})),t.on(`closetag`,e=>r.push({eventType:`closetag`,value:e}));for await(let i of e){if(t.write(fa(i)),n)throw n;yield r,r=[]}}var $=class e{prepare(e,t){}render(e,t){}parseOpen(e){}parseText(e){}parseClose(e){return!1}reconcile(e,t){}reset(){this.model=null,this.map&&Object.values(this.map).forEach(t=>{t instanceof e?t.reset():t.xform&&t.xform.reset()})}mergeModel(e){this.model=Object.assign(this.model||{},e)}async parse(e){for await(let t of e)for(let{eventType:e,value:n}of t)if(e===`opentag`)this.parseOpen(n);else if(e===`text`)this.parseText(n);else if(e===`closetag`&&!this.parseClose(n.name))return this.model;return this.model}async parseStream(e){return this.parse(Ms(e))}get xml(){return this.toXml(this.model)}toXml(e){let t=new Ds;return this.render(t,e),t.xml}static toAttribute(e,t,n=!1){if(e===void 0){if(n)return t}else if(n||e!==t)return e.toString()}static toStringAttribute(t,n,r=!1){return e.toAttribute(t,n,r)}static toStringValue(e,t){return e===void 0?t:e}static toBoolAttribute(e,t,n=!1){if(e===void 0){if(n)return t}else if(n||e!==t)return e?`1`:`0`}static toBoolValue(e,t){return e===void 0?t:e===`1`}static toIntAttribute(t,n,r=!1){return e.toAttribute(t,n,r)}static toIntValue(e,t){return e===void 0?t:parseInt(e,10)}static toFloatAttribute(t,n,r=!1){return e.toAttribute(t,n,r)}static toFloatValue(e,t){return e===void 0?t:parseFloat(e)}};function Ns(e,t){e.openNode(t.tag,t.$),t.c&&t.c.forEach(t=>{Ns(e,t)}),t.t&&e.writeText(t.t),e.closeNode()}var Ps=class extends ${constructor(e){super(),this._model=e}render(e){if(!this._xml){let e=new Ds;Ns(e,this._model),this._xml=e.xml}e.writeXml(this._xml)}parseOpen(){return!0}parseText(){}parseClose(e){switch(e){case this._model.tag:return!1;default:return!0}}},Fs=class extends ${constructor(e){super(),this.tag=e.tag,this.always=!!e.always,this.count=e.count,this.empty=e.empty,this.$count=e.$count||`count`,this.$=e.$,this.childXform=e.childXform,this.maxItems=e.maxItems}prepare(e,t){let{childXform:n}=this;e&&e.forEach((e,r)=>{t.index=r,n.prepare(e,t)})}render(e,t){if(this.always||t&&t.length){e.openNode(this.tag,this.$),this.count&&e.addAttribute(this.$count,t&&t.length||0);let{childXform:n}=this;(t||[]).forEach((t,r)=>{n.render(e,t,r)}),e.closeNode()}else this.empty&&e.leafNode(this.tag)}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:return this.model=[],!0;default:return this.childXform.parseOpen(e)?(this.parser=this.childXform,!0):!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)&&(this.model.push(this.parser.model),this.parser=void 0,this.maxItems&&this.model.length>this.maxItems))throw Error(`Max ${this.childXform.tag} count (${this.maxItems}) exceeded`);return!0}return!1}reconcile(e,t){if(e){let{childXform:n}=this;e.forEach(e=>{n.reconcile(e,t)})}}reset(){super.reset(),this.childXform&&this.childXform.reset()}},Is=class extends ${constructor(e){super(),this.name=e||`color`}get tag(){return this.name}render(e,t){return t?(e.openNode(this.name),t.argb?e.addAttribute(`rgb`,t.argb):t.theme===void 0?t.indexed===void 0?e.addAttribute(`auto`,`1`):e.addAttribute(`indexed`,t.indexed):(e.addAttribute(`theme`,t.theme),t.tint!==void 0&&e.addAttribute(`tint`,t.tint)),e.closeNode(),!0):!1}parseOpen(e){return e.name===this.name?(e.attributes.rgb?this.model={argb:e.attributes.rgb}:e.attributes.theme?(this.model={theme:parseInt(e.attributes.theme,10)},e.attributes.tint&&(this.model.tint=parseFloat(e.attributes.tint))):e.attributes.indexed?this.model={indexed:parseInt(e.attributes.indexed,10)}:this.model=void 0,!0):!1}parseText(){}parseClose(){return!1}},Ls=class extends ${constructor(e){super(),this.tag=e.tag,this.attr=e.attr}render(e,t){t&&(e.openNode(this.tag),e.closeNode())}parseOpen(e){e.name===this.tag&&(this.model=!0)}parseText(){}parseClose(){return!1}},Rs=class extends ${constructor(e){super(),this.tag=e.tag,this.attr=e.attr,this.attrs=e.attrs,this.zero=e.zero,this.text=[]}render(e,t){(t||this.zero)&&(e.openNode(this.tag),this.attrs&&e.addAttributes(this.attrs),this.attr?e.addAttribute(this.attr,t):e.writeText(t),e.closeNode())}parseOpen(e){return e.name===this.tag?(this.attr?this.model=parseInt(e.attributes[this.attr],10):this.text=[],!0):!1}parseText(e){this.attr||this.text.push(e)}parseClose(){return this.attr||(this.model=parseInt(this.text.join(``)||`0`,10)),!1}},zs=class extends ${constructor(e){super(),this.tag=e.tag,this.attr=e.attr,this.attrs=e.attrs,this.text=[]}render(e,t){t!==void 0&&(e.openNode(this.tag),this.attrs&&e.addAttributes(this.attrs),this.attr?e.addAttribute(this.attr,t):e.writeText(t),e.closeNode())}parseOpen(e){e.name===this.tag&&(this.attr?this.model=e.attributes[this.attr]:this.text=[])}parseText(e){this.attr||this.text.push(e)}parseClose(){return this.attr||(this.model=this.text.join(``)),!1}},Bs=class e extends ${static{this.Attributes={single:{},double:{val:`double`},singleAccounting:{val:`singleAccounting`},doubleAccounting:{val:`doubleAccounting`}}}constructor(e){super(),this.model=e}get tag(){return`u`}render(t,n){if(n||=this.model,n===!0)t.leafNode(`u`);else{let r=e.Attributes[n];r&&t.leafNode(`u`,r)}}parseOpen(e){e.name===`u`&&(this.model=e.attributes.val||!0)}parseText(){}parseClose(){return!1}},Vs=class e extends ${constructor(t){super(),this.options=t||e.OPTIONS,this.map={b:{prop:`bold`,xform:new Ls({tag:`b`,attr:`val`})},i:{prop:`italic`,xform:new Ls({tag:`i`,attr:`val`})},u:{prop:`underline`,xform:new Bs},charset:{prop:`charset`,xform:new Rs({tag:`charset`,attr:`val`})},color:{prop:`color`,xform:new Is},condense:{prop:`condense`,xform:new Ls({tag:`condense`,attr:`val`})},extend:{prop:`extend`,xform:new Ls({tag:`extend`,attr:`val`})},family:{prop:`family`,xform:new Rs({tag:`family`,attr:`val`})},outline:{prop:`outline`,xform:new Ls({tag:`outline`,attr:`val`})},vertAlign:{prop:`vertAlign`,xform:new zs({tag:`vertAlign`,attr:`val`})},scheme:{prop:`scheme`,xform:new zs({tag:`scheme`,attr:`val`})},shadow:{prop:`shadow`,xform:new Ls({tag:`shadow`,attr:`val`})},strike:{prop:`strike`,xform:new Ls({tag:`strike`,attr:`val`})},sz:{prop:`size`,xform:new Rs({tag:`sz`,attr:`val`})}},this.map[this.options.fontNameTag]={prop:`name`,xform:new zs({tag:this.options.fontNameTag,attr:`val`})}}get tag(){return this.options.tagName}render(e,t){let{map:n}=this;e.openNode(this.options.tagName),Object.entries(this.map).forEach(([r,i])=>{n[r].xform.render(e,t[i.prop])}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if(this.map[e.name])return this.parser=this.map[e.name].xform,this.parser.parseOpen(e);switch(e.name){case this.options.tagName:return this.model={},!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser&&!this.parser.parseClose(e)){let t=this.map[e];return this.parser.model&&(this.model[t.prop]=this.parser.model),this.parser=void 0,!0}switch(e){case this.options.tagName:return!1;default:return!0}}static{this.OPTIONS={tagName:`font`,fontNameTag:`name`}}},Hs=class extends ${constructor(){super(),this.map={color:new Is}}get tag(){return`stop`}render(e,t){e.openNode(`stop`),e.addAttribute(`position`,t.position),this.map.color.render(e,t.color),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`stop`:return this.model={position:parseFloat(e.attributes.position)},!0;case`color`:return this.parser=this.map.color,this.parser.parseOpen(e),!0;default:return!1}}parseText(){}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.model.color=this.parser.model,this.parser=void 0),!0):!1}},Us=class extends ${constructor(){super(),this.map={fgColor:new Is(`fgColor`),bgColor:new Is(`bgColor`)}}get name(){return`pattern`}get tag(){return`patternFill`}render(e,t){e.openNode(`patternFill`),e.addAttribute(`patternType`,t.pattern),t.fgColor&&this.map.fgColor.render(e,t.fgColor),t.bgColor&&this.map.bgColor.render(e,t.bgColor),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`patternFill`:return this.model={type:`pattern`,pattern:e.attributes.patternType},!0;default:return this.parser=this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser.model&&(this.model[e]=this.parser.model),this.parser=void 0),!0):!1}},Ws=class extends ${constructor(){super(),this.map={stop:new Hs}}get name(){return`gradient`}get tag(){return`gradientFill`}render(e,t){switch(e.openNode(`gradientFill`),t.gradient){case`angle`:e.addAttribute(`degree`,t.degree);break;case`path`:e.addAttribute(`type`,`path`),t.center.left&&(e.addAttribute(`left`,t.center.left),t.center.right===void 0&&e.addAttribute(`right`,t.center.left)),t.center.right&&e.addAttribute(`right`,t.center.right),t.center.top&&(e.addAttribute(`top`,t.center.top),t.center.bottom===void 0&&e.addAttribute(`bottom`,t.center.top)),t.center.bottom&&e.addAttribute(`bottom`,t.center.bottom);break;default:break}let n=this.map.stop;t.stops.forEach(t=>{n.render(e,t)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`gradientFill`:{let t=this.model={stops:[]};return e.attributes.degree?(t.gradient=`angle`,t.degree=parseInt(e.attributes.degree,10)):e.attributes.type===`path`&&(t.gradient=`path`,t.center={left:e.attributes.left?parseFloat(e.attributes.left):0,top:e.attributes.top?parseFloat(e.attributes.top):0},e.attributes.right!==e.attributes.left&&(t.center.right=e.attributes.right?parseFloat(e.attributes.right):0),e.attributes.bottom!==e.attributes.top&&(t.center.bottom=e.attributes.bottom?parseFloat(e.attributes.bottom):0)),!0}case`stop`:return this.parser=this.map.stop,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.model.stops.push(this.parser.model),this.parser=void 0),!0):!1}},Gs=class e extends ${constructor(){super(),this.map={patternFill:new Us,gradientFill:new Ws}}get tag(){return`fill`}render(e,t){switch(e.addRollback(),e.openNode(`fill`),t.type){case`pattern`:this.map.patternFill.render(e,t);break;case`gradient`:this.map.gradientFill.render(e,t);break;default:e.rollback();return}e.closeNode(),e.commit()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`fill`:return this.model={},!0;default:return this.parser=this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.model=this.parser.model,this.model.type=this.parser.name,this.parser=void 0),!0):!1}validStyle(t){return e.validPatternValues[t]}static{this.validPatternValues=[`none`,`solid`,`darkVertical`,`darkGray`,`mediumGray`,`lightGray`,`gray125`,`gray0625`,`darkHorizontal`,`darkVertical`,`darkDown`,`darkUp`,`darkGrid`,`darkTrellis`,`lightHorizontal`,`lightVertical`,`lightDown`,`lightUp`,`lightGrid`,`lightTrellis`,`lightGrid`].reduce((e,t)=>(e[t]=!0,e),{})}static{this.StopXform=Hs}static{this.PatternFillXform=Us}static{this.GradientFillXform=Ws}},Ks=class e extends ${constructor(e){super(),this.name=e,this.map={color:new Is}}get tag(){return this.name}render(e,t,n){let r=t&&t.color||n||this.defaultColor;e.openNode(this.name),t&&t.style&&(e.addAttribute(`style`,t.style),r&&this.map.color.render(e,r)),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.name:{let{style:t}=e.attributes;return t?this.model={style:t}:this.model=void 0,!0}case`color`:return this.parser=this.map.color,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):(e===this.name&&this.map.color.model&&(this.model||={},this.model.color=this.map.color.model),!1)}validStyle(t){return e.validStyleValues[t]}static{this.validStyleValues=[`thin`,`dashed`,`dotted`,`dashDot`,`hair`,`dashDotDot`,`slantDashDot`,`mediumDashed`,`mediumDashDotDot`,`mediumDashDot`,`medium`,`double`,`thick`].reduce((e,t)=>(e[t]=!0,e),{})}},qs=class extends ${constructor(){super(),this.map={top:new Ks(`top`),left:new Ks(`left`),bottom:new Ks(`bottom`),right:new Ks(`right`),diagonal:new Ks(`diagonal`)}}render(e,t){let{color:n}=t;e.openNode(`border`),t.diagonal&&t.diagonal.style&&(t.diagonal.up&&e.addAttribute(`diagonalUp`,`1`),t.diagonal.down&&e.addAttribute(`diagonalDown`,`1`));let r=(r,i)=>{let a=r;a&&!a.color&&t.color&&(a={...a,color:t.color}),i.render(e,a,n)};r(t.left,this.map.left),r(t.right,this.map.right),r(t.top,this.map.top),r(t.bottom,this.map.bottom),r(t.diagonal,this.map.diagonal),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`border`:return this.reset(),this.diagonalUp=sa(e.attributes.diagonalUp),this.diagonalDown=sa(e.attributes.diagonalDown),!0;default:return this.parser=this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;if(e===`border`){let e=this.model={},t=(t,n,r)=>{n&&(r&&Object.assign(n,r),e[t]=n)};t(`left`,this.map.left.model),t(`right`,this.map.right.model),t(`top`,this.map.top.model),t(`bottom`,this.map.bottom.model),t(`diagonal`,this.map.diagonal.model,{up:this.diagonalUp,down:this.diagonalDown})}return!1}};let Js={0:{f:`General`},1:{f:`0`},2:{f:`0.00`},3:{f:`#,##0`},4:{f:`#,##0.00`},9:{f:`0%`},10:{f:`0.00%`},11:{f:`0.00E+00`},12:{f:`# ?/?`},13:{f:`# ??/??`},14:{f:`mm-dd-yy`},15:{f:`d-mmm-yy`},16:{f:`d-mmm`},17:{f:`mmm-yy`},18:{f:`h:mm AM/PM`},19:{f:`h:mm:ss AM/PM`},20:{f:`h:mm`},21:{f:`h:mm:ss`},22:{f:`m/d/yy "h":mm`},27:{"zh-tw":`[$-404]e/m/d`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`[$-411]ge.m.d`,"ko-kr":`yyyy"年" mm"月" dd"日"`},28:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},29:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},30:{"zh-tw":`m/d/yy `,"zh-cn":`m-d-yy`,"ja-jp":`m/d/yy`,"ko-kr":`mm-dd-yy`},31:{"zh-tw":`yyyy"年"m"月"d"日"`,"zh-cn":`yyyy"年"m"月"d"日"`,"ja-jp":`yyyy"年"m"月"d"日"`,"ko-kr":`yyyy"년" mm"월" dd"일"`},32:{"zh-tw":`hh"時"mm"分"`,"zh-cn":`h"时"mm"分"`,"ja-jp":`h"時"mm"分"`,"ko-kr":`h"시" mm"분"`},33:{"zh-tw":`hh"時"mm"分"ss"秒"`,"zh-cn":`h"时"mm"分"ss"秒"`,"ja-jp":`h"時"mm"分"ss"秒"`,"ko-kr":`h"시" mm"분" ss"초"`},34:{"zh-tw":`上午/下午 hh"時"mm"分"`,"zh-cn":`上午/下午 h"时"mm"分"`,"ja-jp":`yyyy"年"m"月"`,"ko-kr":`yyyy-mm-dd`},35:{"zh-tw":`上午/下午 hh"時"mm"分"ss"秒"`,"zh-cn":`上午/下午 h"时"mm"分"ss"秒"`,"ja-jp":`m"月"d"日"`,"ko-kr":`yyyy-mm-dd`},36:{"zh-tw":`[$-404]e/m/d`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`[$-411]ge.m.d`,"ko-kr":`yyyy"年" mm"月" dd"日"`},37:{f:`#,##0 ;(#,##0)`},38:{f:`#,##0 ;[Red](#,##0)`},39:{f:`#,##0.00 ;(#,##0.00)`},40:{f:`#,##0.00 ;[Red](#,##0.00)`},45:{f:`mm:ss`},46:{f:`[h]:mm:ss`},47:{f:`mmss.0`},48:{f:`##0.0E+0`},49:{f:`@`},50:{"zh-tw":`[$-404]e/m/d`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`[$-411]ge.m.d`,"ko-kr":`yyyy"年" mm"月" dd"日"`},51:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},52:{"zh-tw":`上午/下午 hh"時"mm"分"`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`yyyy"年"m"月"`,"ko-kr":`yyyy-mm-dd`},53:{"zh-tw":`上午/下午 hh"時"mm"分"ss"秒"`,"zh-cn":`m"月"d"日"`,"ja-jp":`m"月"d"日"`,"ko-kr":`yyyy-mm-dd`},54:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},55:{"zh-tw":`上午/下午 hh"時"mm"分"`,"zh-cn":`上午/下午 h"时"mm"分"`,"ja-jp":`yyyy"年"m"月"`,"ko-kr":`yyyy-mm-dd`},56:{"zh-tw":`上午/下午 hh"時"mm"分"ss"秒"`,"zh-cn":`上午/下午 h"时"mm"分"ss"秒"`,"ja-jp":`m"月"d"日"`,"ko-kr":`yyyy-mm-dd`},57:{"zh-tw":`[$-404]e/m/d`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`[$-411]ge.m.d`,"ko-kr":`yyyy"年" mm"月" dd"日"`},58:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},59:{"th-th":`t0`},60:{"th-th":`t0.00`},61:{"th-th":`t#,##0`},62:{"th-th":`t#,##0.00`},67:{"th-th":`t0%`},68:{"th-th":`t0.00%`},69:{"th-th":`t# ?/?`},70:{"th-th":`t# ??/??`},81:{"th-th":`d/m/bb`}};function Ys(){let e={};return Object.entries(Js).forEach(([t,n])=>{n.f&&(e[n.f]=parseInt(t,10))}),e}let Xs=Ys();var Zs=class extends ${constructor(e,t){super(),this.id=e,this.formatCode=t}get tag(){return`numFmt`}render(e,t){e.leafNode(`numFmt`,{numFmtId:t.id,formatCode:t.formatCode})}parseOpen(e){switch(e.name){case`numFmt`:return this.model={id:parseInt(e.attributes.numFmtId,10),formatCode:e.attributes.formatCode.replace(/[\\](.)/g,`$1`)},!0;default:return!1}}parseText(){}parseClose(){return!1}static getDefaultFmtId(e){return Xs[e]}static getDefaultFmtCode(e){return Js[e]&&Js[e].f}};let Qs={ReadingOrder:{LeftToRight:1,RightToLeft:2}},$s={horizontalValues:[`left`,`center`,`right`,`fill`,`centerContinuous`,`distributed`,`justify`].reduce((e,t)=>(e[t]=!0,e),{}),horizontal(e){return this.horizontalValues[e]?e:void 0},verticalValues:[`top`,`middle`,`bottom`,`distributed`,`justify`].reduce((e,t)=>(e[t]=!0,e),{}),vertical(e){return e===`middle`?`center`:this.verticalValues[e]?e:void 0},wrapText(e){return e?!0:void 0},shrinkToFit(e){return e?!0:void 0},textRotation(e){switch(e){case`vertical`:return e;default:{let t=ia(e);return t!==void 0&&t>=-90&&t<=90?t:void 0}}},indent(e){let t=ia(e);return Math.max(0,t)},readingOrder(e){switch(e){case`ltr`:return Qs.ReadingOrder.LeftToRight;case`rtl`:return Qs.ReadingOrder.RightToLeft;default:return}}},ec={toXml(e){let t=$s.textRotation(e);if(t){if(t===`vertical`)return 255;let e=Math.round(t);if(e>=0&&e<=90)return e;if(e<0&&e>=-90)return 90-e}},toModel(e){let t=ia(e);if(t!==void 0){if(t===255)return`vertical`;if(t>=0&&t<=90)return t;if(t>90&&t<=180)return 90-t}}};var tc=class extends ${get tag(){return`alignment`}render(e,t){e.addRollback(),e.openNode(`alignment`);let n=!1;function r(t,r){r&&(e.addAttribute(t,r),n=!0)}r(`horizontal`,$s.horizontal(t.horizontal)),r(`vertical`,$s.vertical(t.vertical)),r(`wrapText`,$s.wrapText(t.wrapText)?`1`:!1),r(`shrinkToFit`,$s.shrinkToFit(t.shrinkToFit)?`1`:!1),r(`indent`,$s.indent(t.indent)),r(`textRotation`,ec.toXml(t.textRotation)),r(`readingOrder`,$s.readingOrder(t.readingOrder)),e.closeNode(),n?e.commit():e.rollback()}parseOpen(e){let t={},n=!1;function r(e,r,i){e&&(t[r]=i,n=!0)}r(e.attributes.horizontal,`horizontal`,e.attributes.horizontal),r(e.attributes.vertical,`vertical`,e.attributes.vertical===`center`?`middle`:e.attributes.vertical),r(e.attributes.wrapText,`wrapText`,sa(e.attributes.wrapText)),r(e.attributes.shrinkToFit,`shrinkToFit`,sa(e.attributes.shrinkToFit)),r(e.attributes.indent,`indent`,parseInt(e.attributes.indent,10)),r(e.attributes.textRotation,`textRotation`,ec.toModel(e.attributes.textRotation)),r(e.attributes.readingOrder,`readingOrder`,e.attributes.readingOrder===`2`?`rtl`:`ltr`),this.model=n?t:null}parseText(){}parseClose(){return!1}};let nc={boolean(e,t){return e===void 0?t:e}};var rc=class extends ${get tag(){return`protection`}render(e,t){e.addRollback(),e.openNode(`protection`);let n=!1;function r(t,r){r!==void 0&&(e.addAttribute(t,r),n=!0)}r(`locked`,nc.boolean(t.locked,!0)?void 0:`0`),r(`hidden`,nc.boolean(t.hidden,!1)?`1`:void 0),e.closeNode(),n?e.commit():e.rollback()}parseOpen(e){let t={locked:e.attributes.locked!==`0`,hidden:e.attributes.hidden===`1`};this.model=!t.locked||t.hidden?t:null}parseText(){}parseClose(){return!1}},ic=class extends ${constructor(e){super(),this.xfId=!!(e&&e.xfId),this.map={alignment:new tc,protection:new rc}}get tag(){return`xf`}render(e,t){e.openNode(`xf`,{numFmtId:t.numFmtId||0,fontId:t.fontId||0,fillId:t.fillId||0,borderId:t.borderId||0}),this.xfId&&e.addAttribute(`xfId`,t.xfId||0),t.numFmtId&&e.addAttribute(`applyNumberFormat`,`1`),t.fontId&&e.addAttribute(`applyFont`,`1`),t.fillId&&e.addAttribute(`applyFill`,`1`),t.borderId&&e.addAttribute(`applyBorder`,`1`),t.alignment&&e.addAttribute(`applyAlignment`,`1`),t.protection&&e.addAttribute(`applyProtection`,`1`),t.alignment&&this.map.alignment.render(e,t.alignment),t.protection&&this.map.protection.render(e,t.protection),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`xf`:return this.model={numFmtId:parseInt(e.attributes.numFmtId,10),fontId:parseInt(e.attributes.fontId,10),fillId:parseInt(e.attributes.fillId,10),borderId:parseInt(e.attributes.borderId,10)},this.xfId&&(this.model.xfId=parseInt(e.attributes.xfId,10)),!0;case`alignment`:return this.parser=this.map.alignment,this.parser.parseOpen(e),!0;case`protection`:return this.parser=this.map.protection,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.map.protection===this.parser?this.model.protection=this.parser.model:this.model.alignment=this.parser.model,this.parser=void 0),!0):e!==`xf`}},ac=class extends ${constructor(){super(),this.map={alignment:new tc,border:new qs,fill:new Gs,font:new Vs,numFmt:new Zs,protection:new rc}}get tag(){return`dxf`}render(e,t){if(e.openNode(this.tag),t.font&&this.map.font.render(e,t.font),t.numFmt&&t.numFmtId){let n={id:t.numFmtId,formatCode:t.numFmt};this.map.numFmt.render(e,n)}t.fill&&this.map.fill.render(e,t.fill),t.alignment&&this.map.alignment.render(e,t.alignment),t.border&&this.map.border.render(e,t.border),t.protection&&this.map.protection.render(e,t.protection),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:return this.reset(),!0;default:return this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e),!0}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e===this.tag?(this.model={alignment:this.map.alignment.model,border:this.map.border.model,fill:this.map.fill.model,font:this.map.font.model,numFmt:this.map.numFmt.model,protection:this.map.protection.model},!1):!0}},oc=class e extends ${constructor(t){super(),this.map={numFmts:new Fs({tag:`numFmts`,count:!0,childXform:new Zs}),fonts:new Fs({tag:`fonts`,count:!0,childXform:new Vs,$:{"x14ac:knownFonts":1}}),fills:new Fs({tag:`fills`,count:!0,childXform:new Gs}),borders:new Fs({tag:`borders`,count:!0,childXform:new qs}),cellStyleXfs:new Fs({tag:`cellStyleXfs`,count:!0,childXform:new ic}),cellXfs:new Fs({tag:`cellXfs`,count:!0,childXform:new ic({xfId:!0})}),dxfs:new Fs({tag:`dxfs`,always:!0,count:!0,childXform:new ac}),numFmt:new Zs,font:new Vs,fill:new Gs,border:new qs,style:new ic({xfId:!0}),cellStyles:e.STATIC_XFORMS.cellStyles,tableStyles:e.STATIC_XFORMS.tableStyles,extLst:e.STATIC_XFORMS.extLst},t&&this.init()}initIndex(){this.index={style:{},numFmt:{},numFmtNextId:164,font:{},border:{},fill:{}}}init(){this.model={styles:[],numFmts:[],fonts:[],borders:[],fills:[],dxfs:[]},this.initIndex(),this._addBorder({}),this._addStyle({numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}),this._addFill({type:`pattern`,pattern:`none`}),this._addFill({type:`pattern`,pattern:`gray125`}),this.weakMap=new WeakMap}render(t,n){let r=n||this.model;t.openXml(Ds.StdDocAttributes),t.openNode(`styleSheet`,e.STYLESHEET_ATTRIBUTES),this.index?(r.numFmts&&r.numFmts.length&&(t.openNode(`numFmts`,{count:r.numFmts.length}),r.numFmts.forEach(e=>{t.writeXml(e)}),t.closeNode()),r.fonts.length||this._addFont({size:11,color:{theme:1},name:`Calibri`,family:2,scheme:`minor`}),t.openNode(`fonts`,{count:r.fonts.length,"x14ac:knownFonts":1}),r.fonts.forEach(e=>{t.writeXml(e)}),t.closeNode(),t.openNode(`fills`,{count:r.fills.length}),r.fills.forEach(e=>{t.writeXml(e)}),t.closeNode(),t.openNode(`borders`,{count:r.borders.length}),r.borders.forEach(e=>{t.writeXml(e)}),t.closeNode(),this.map.cellStyleXfs.render(t,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),t.openNode(`cellXfs`,{count:r.styles.length}),r.styles.forEach(e=>{t.writeXml(e)}),t.closeNode()):(this.map.numFmts.render(t,r.numFmts),this.map.fonts.render(t,r.fonts),this.map.fills.render(t,r.fills),this.map.borders.render(t,r.borders),this.map.cellStyleXfs.render(t,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),this.map.cellXfs.render(t,r.styles)),e.STATIC_XFORMS.cellStyles.render(t),this.map.dxfs.render(t,r.dxfs),e.STATIC_XFORMS.tableStyles.render(t),e.STATIC_XFORMS.extLst.render(t),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`styleSheet`:return this.initIndex(),!0;default:return this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e),!0}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`styleSheet`:{this.model={};let e=(e,t)=>{t.model&&t.model.length&&(this.model[e]=t.model)};if(e(`numFmts`,this.map.numFmts),e(`fonts`,this.map.fonts),e(`fills`,this.map.fills),e(`borders`,this.map.borders),e(`styles`,this.map.cellXfs),e(`dxfs`,this.map.dxfs),this.index={model:[],numFmt:{}},this.model.numFmts){let e=this.index.numFmt;this.model.numFmts.forEach(t=>{e[t.id]=t.formatCode})}return!1}default:return!0}}addStyleModel(e,t){if(!e)return 0;if(this.model.fonts.length||this._addFont({size:11,color:{theme:1},name:`Calibri`,family:2,scheme:`minor`}),this.weakMap&&this.weakMap.has(e))return this.weakMap.get(e);let n={},r=t||S.ValueType.Number;if(e.numFmt)n.numFmtId=this._addNumFmtStr(e.numFmt);else switch(r){case S.ValueType.Number:n.numFmtId=this._addNumFmtStr(`General`);break;case S.ValueType.Date:n.numFmtId=this._addNumFmtStr(`mm-dd-yy`);break;default:break}e.font&&(n.fontId=this._addFont(e.font)),e.border&&(n.borderId=this._addBorder(e.border)),e.fill&&(n.fillId=this._addFill(e.fill)),e.alignment&&(n.alignment=e.alignment),e.protection&&(n.protection=e.protection);let i=this._addStyle(n);return this.weakMap&&this.weakMap.set(e,i),i}getStyleModel(e){let t=this.model.styles[e];if(!t)return null;let n=this.index.model[e];if(n)return n;if(n=this.index.model[e]={},t.numFmtId){let e=this.index.numFmt[t.numFmtId]||Zs.getDefaultFmtCode(t.numFmtId);e&&(n.numFmt=e)}function r(e,t,r){if(r||r===0){let i=t[r];i&&(n[e]=i)}}return r(`font`,this.model.fonts,t.fontId),r(`border`,this.model.borders,t.borderId),r(`fill`,this.model.fills,t.fillId),t.alignment&&(n.alignment=t.alignment),t.protection&&(n.protection=t.protection),n}addDxfStyle(e){return e.numFmt&&(e.numFmtId=this._addNumFmtStr(e.numFmt)),this.model.dxfs.push(e),this.model.dxfs.length-1}getDxfStyle(e){return this.model.dxfs[e]}_addStyle(e){let t=this.map.style.toXml(e),n=this.index.style[t];return n===void 0&&(n=this.index.style[t]=this.model.styles.length,this.model.styles.push(t)),n}_addNumFmtStr(e){let t=Zs.getDefaultFmtId(e);if(t!==void 0||(t=this.index.numFmt[e],t!==void 0))return t;t=this.index.numFmt[e]=164+this.model.numFmts.length;let n=this.map.numFmt.toXml({id:t,formatCode:e});return this.model.numFmts.push(n),t}_addFont(e){let t=this.map.font.toXml(e),n=this.index.font[t];return n===void 0&&(n=this.index.font[t]=this.model.fonts.length,this.model.fonts.push(t)),n}_addBorder(e){let t=this.map.border.toXml(e),n=this.index.border[t];return n===void 0&&(n=this.index.border[t]=this.model.borders.length,this.model.borders.push(t)),n}_addFill(e){let t=this.map.fill.toXml(e),n=this.index.fill[t];return n===void 0&&(n=this.index.fill[t]=this.model.fills.length,this.model.fills.push(t)),n}static{this.STYLESHEET_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`x14ac x16r2`,"xmlns:x14ac":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac`,"xmlns:x16r2":`http://schemas.microsoft.com/office/spreadsheetml/2015/02/main`}}static{this.STATIC_XFORMS={cellStyles:new Ps({tag:`cellStyles`,$:{count:1},c:[{tag:`cellStyle`,$:{name:`Normal`,xfId:0,builtinId:0}}]}),dxfs:new Ps({tag:`dxfs`,$:{count:0}}),tableStyles:new Ps({tag:`tableStyles`,$:{count:0,defaultTableStyle:`TableStyleMedium2`,defaultPivotStyle:`PivotStyleLight16`}}),extLst:new Ps({tag:`extLst`,c:[{tag:`ext`,$:{uri:`{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}`,"xmlns:x14":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/main`},c:[{tag:`x14:slicerStyles`,$:{defaultSlicerStyle:`SlicerStyleLight1`}}]},{tag:`ext`,$:{uri:`{9260A510-F301-46a8-8635-F512D64BE5F5}`,"xmlns:x15":`http://schemas.microsoft.com/office/spreadsheetml/2010/11/main`},c:[{tag:`x15:timelineStyles`,$:{defaultTimelineStyle:`TimeSlicerStyleLight1`}}]}]})}}};oc.Mock=class extends oc{constructor(){super(),this.model={styles:[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}],numFmts:[],fonts:[{size:11,color:{theme:1},name:`Calibri`,family:2,scheme:`minor`}],borders:[{}],fills:[{type:`pattern`,pattern:`none`},{type:`pattern`,pattern:`gray125`}]}}parseStream(e){return e.autodrain(),Promise.resolve()}addStyleModel(e,t){switch(t){case S.ValueType.Date:return this.dateStyleId;default:return 0}}get dateStyleId(){if(!this._dateStyleId){let e={numFmtId:Zs.getDefaultFmtId(`mm-dd-yy`)};this._dateStyleId=this.model.styles.length,this.model.styles.push(e)}return this._dateStyleId}getStyleModel(){return{}}};var sc=class extends ${constructor(e){super(),this.tag=e.tag,this.attr=e.attr,this.attrs=e.attrs,this.text=[],this._format=e.format||function(e){try{return Number.isNaN(e.getTime())?``:e.toISOString()}catch{return``}},this._parse=e.parse||function(e){return new Date(e)}}render(e,t){t&&(e.openNode(this.tag),this.attrs&&e.addAttributes(this.attrs),this.attr?e.addAttribute(this.attr,this._format(t)):e.writeText(this._format(t)),e.closeNode())}parseOpen(e){e.name===this.tag&&(this.attr?this.model=this._parse(e.attributes[this.attr]):this.text=[])}parseText(e){this.attr||this.text.push(e)}parseClose(){return this.attr||(this.model=this._parse(this.text.join(``))),!1}},cc=class e extends ${constructor(){super(),this.map={"dc:creator":new zs({tag:`dc:creator`}),"dc:title":new zs({tag:`dc:title`}),"dc:subject":new zs({tag:`dc:subject`}),"dc:description":new zs({tag:`dc:description`}),"dc:identifier":new zs({tag:`dc:identifier`}),"dc:language":new zs({tag:`dc:language`}),"cp:keywords":new zs({tag:`cp:keywords`}),"cp:category":new zs({tag:`cp:category`}),"cp:lastModifiedBy":new zs({tag:`cp:lastModifiedBy`}),"cp:lastPrinted":new sc({tag:`cp:lastPrinted`,format:e.DateFormat}),"cp:revision":new Rs({tag:`cp:revision`}),"cp:version":new zs({tag:`cp:version`}),"cp:contentStatus":new zs({tag:`cp:contentStatus`}),"cp:contentType":new zs({tag:`cp:contentType`}),"dcterms:created":new sc({tag:`dcterms:created`,attrs:e.DateAttrs,format:e.DateFormat}),"dcterms:modified":new sc({tag:`dcterms:modified`,attrs:e.DateAttrs,format:e.DateFormat})}}render(t,n){t.openXml(Ds.StdDocAttributes),t.openNode(`cp:coreProperties`,e.CORE_PROPERTY_ATTRIBUTES),this.map[`dc:creator`].render(t,n.creator),this.map[`dc:title`].render(t,n.title),this.map[`dc:subject`].render(t,n.subject),this.map[`dc:description`].render(t,n.description),this.map[`dc:identifier`].render(t,n.identifier),this.map[`dc:language`].render(t,n.language),this.map[`cp:keywords`].render(t,n.keywords),this.map[`cp:category`].render(t,n.category),this.map[`cp:lastModifiedBy`].render(t,n.lastModifiedBy),this.map[`cp:lastPrinted`].render(t,n.lastPrinted),this.map[`cp:revision`].render(t,n.revision),this.map[`cp:version`].render(t,n.version),this.map[`cp:contentStatus`].render(t,n.contentStatus),this.map[`cp:contentType`].render(t,n.contentType),this.map[`dcterms:created`].render(t,n.created),this.map[`dcterms:modified`].render(t,n.modified),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`cp:coreProperties`:case`coreProperties`:return!0;default:if(this.parser=this.map[e.name],this.parser)return this.parser.parseOpen(e),!0;throw Error(`Unexpected xml node in parseOpen: ${JSON.stringify(e)}`)}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`cp:coreProperties`:case`coreProperties`:return this.model={creator:this.map[`dc:creator`].model,title:this.map[`dc:title`].model,subject:this.map[`dc:subject`].model,description:this.map[`dc:description`].model,identifier:this.map[`dc:identifier`].model,language:this.map[`dc:language`].model,keywords:this.map[`cp:keywords`].model,category:this.map[`cp:category`].model,lastModifiedBy:this.map[`cp:lastModifiedBy`].model,lastPrinted:this.map[`cp:lastPrinted`].model,revision:this.map[`cp:revision`].model,contentStatus:this.map[`cp:contentStatus`].model,contentType:this.map[`cp:contentType`].model,created:this.map[`dcterms:created`].model,modified:this.map[`dcterms:modified`].model},!1;default:throw Error(`Unexpected xml node in parseClose: ${e}`)}}static{this.DateFormat=function(e){return e.toISOString().replace(/[.]\d{3}/,``)}}static{this.DateAttrs={"xsi:type":`dcterms:W3CDTF`}}static{this.CORE_PROPERTY_ATTRIBUTES={"xmlns:cp":`http://schemas.openxmlformats.org/package/2006/metadata/core-properties`,"xmlns:dc":`http://purl.org/dc/elements/1.1/`,"xmlns:dcterms":`http://purl.org/dc/terms/`,"xmlns:dcmitype":`http://purl.org/dc/dcmitype/`,"xmlns:xsi":`http://www.w3.org/2001/XMLSchema-instance`}}},lc=class extends ${get tag(){return`t`}render(e,t){e.openNode(`t`),/^\s|\n|\s$/.test(t)&&e.addAttribute(`xml:space`,`preserve`),e.writeText(t),e.closeNode()}parseOpen(e){switch(e.name){case`t`:return this._text=[],this.model=``,!0;default:return!1}}parseText(e){this._text.push(e),this.model=this._text.join(``).replace(/_x([0-9A-F]{4})_/g,(e,t)=>String.fromCharCode(parseInt(t,16)))}parseClose(){return!1}},uc=class e extends ${constructor(e){super(),this.model=e}get tag(){return`r`}get textXform(){return this._textXform||=new lc}get fontXform(){return this._fontXform||=new Vs(e.FONT_OPTIONS)}render(e,t){let n=t||this.model;e.openNode(`r`),n.font&&this.fontXform.render(e,n.font),this.textXform.render(e,n.text),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`r`:return this.model={},!0;case`t`:return this.parser=this.textXform,this.parser.parseOpen(e),!0;case`rPr`:return this.parser=this.fontXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){switch(e){case`r`:return!1;case`t`:return this.model.text=this.parser.model,this.parser=void 0,!0;case`rPr`:return this.model.font=this.parser.model,this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}static{this.FONT_OPTIONS={tagName:`rPr`,fontNameTag:`rFont`}}},dc=class extends ${constructor(){super(),this.map={r:new uc,t:new lc}}get tag(){return`rPh`}render(e,t){if(e.openNode(this.tag,{sb:t.sb||0,eb:t.eb||0}),t&&Object.prototype.hasOwnProperty.call(t,`richText`)&&t.richText){let{r:n}=this.map;t.richText.forEach(t=>{n.render(e,t)})}else t&&this.map.t.render(e,t.text);e.closeNode()}parseOpen(e){let{name:t}=e;return this.parser?(this.parser.parseOpen(e),!0):t===this.tag?(this.model={sb:parseInt(e.attributes.sb,10),eb:parseInt(e.attributes.eb,10)},!0):(this.parser=this.map[t],this.parser?(this.parser.parseOpen(e),!0):!1)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)){switch(e){case`r`:{let e=this.model.richText;e||=this.model.richText=[],e.push(this.parser.model);break}case`t`:this.model.text=this.parser.model;break;default:break}this.parser=void 0}return!0}switch(e){case this.tag:return!1;default:return!0}}},fc=class extends ${constructor(e){super(),this.model=e,this.map={r:new uc,t:new lc,rPh:new dc}}get tag(){return`si`}render(e,t){e.openNode(this.tag),t&&typeof t==`object`&&Object.prototype.hasOwnProperty.call(t,`richText`)&&t.richText?t.richText.length?t.richText.forEach(t=>{this.map.r.render(e,t)}):this.map.t.render(e,``):t!=null&&this.map.t.render(e,t),e.closeNode()}parseOpen(e){let{name:t}=e;return this.parser?(this.parser.parseOpen(e),!0):t===this.tag?(this.model={},!0):(this.parser=this.map[t],this.parser?(this.parser.parseOpen(e),!0):!1)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)){switch(e){case`r`:{let e=this.model.richText;e||=this.model.richText=[],e.push(this.parser.model);break}case`t`:this.model=this.parser.model;break;default:break}this.parser=void 0}return!0}switch(e){case this.tag:return!1;default:return!0}}},pc=class extends ${constructor(e){super(),this.model=e||{values:[],count:0},this.hash=Object.create(null),this.rich=Object.create(null)}get sharedStringXform(){return this._sharedStringXform||=new fc}get values(){return this.model.values}get uniqueCount(){return this.model.values.length}get count(){return this.model.count}getString(e){return this.model.values[e]}add(e){return e.richText?this.addRichText(e):this.addText(e)}addText(e){let t=this.hash[e];return t===void 0&&(t=this.hash[e]=this.model.values.length,this.model.values.push(e)),this.model.count++,t}addRichText(e){let t=this.sharedStringXform.toXml(e),n=this.rich[t];return n===void 0&&(n=this.rich[t]=this.model.values.length,this.model.values.push(e)),this.model.count++,n}render(e,t){let n=t||this._values;e.openXml(Ds.StdDocAttributes),e.openNode(`sst`,{xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,count:n.count,uniqueCount:n.values.length});let r=this.sharedStringXform;n.values.forEach(t=>{r.render(e,t)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`sst`:return!0;case`si`:return this.parser=this.sharedStringXform,this.parser.parseOpen(e),!0;default:throw Error(`Unexpected xml node in parseOpen: ${JSON.stringify(e)}`)}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.values.push(this.parser.model),this.model.count++,this.parser=void 0),!0;switch(e){case`sst`:return!1;default:throw Error(`Unexpected xml node in parseClose: ${e}`)}}},mc=class extends ${render(e,t){e.leafNode(`Relationship`,t)}parseOpen(e){switch(e.name){case`Relationship`:return this.model=e.attributes,!0;default:return!1}}parseText(){}parseClose(){return!1}},hc=class e extends ${constructor(){super(),this.map={Relationship:new mc}}render(t,n){let r=n||this._values;t.openXml(Ds.StdDocAttributes),t.openNode(`Relationships`,e.RELATIONSHIPS_ATTRIBUTES),r.forEach(e=>{this.map.Relationship.render(t,e)}),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`Relationships`:return this.model=[],!0;default:if(this.parser=this.map[e.name],this.parser)return this.parser.parseOpen(e),!0;throw Error(`Unexpected xml node in parseOpen: ${JSON.stringify(e)}`)}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.push(this.parser.model),this.parser=void 0),!0;switch(e){case`Relationships`:return!1;default:throw Error(`Unexpected xml node in parseClose: ${e}`)}}static{this.RELATIONSHIPS_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/package/2006/relationships`}}},gc=class e extends ${render(t,n){t.openXml(Ds.StdDocAttributes),t.openNode(`Types`,e.PROPERTY_ATTRIBUTES);let r={};(n.media||[]).forEach(e=>{if(e.type===`image`){let n=e.extension;r[n]||(r[n]=!0,t.leafNode(`Default`,{Extension:n,ContentType:`image/${n}`}))}}),t.leafNode(`Default`,{Extension:`rels`,ContentType:`application/vnd.openxmlformats-package.relationships+xml`}),t.leafNode(`Default`,{Extension:`xml`,ContentType:`application/xml`}),t.leafNode(`Override`,{PartName:`/xl/workbook.xml`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml`}),n.worksheets.forEach(e=>{let n=`/xl/worksheets/sheet${e.id}.xml`;t.leafNode(`Override`,{PartName:n,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml`})}),(n.pivotTables||[]).length&&(t.leafNode(`Override`,{PartName:`/xl/pivotCache/pivotCacheDefinition1.xml`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml`}),t.leafNode(`Override`,{PartName:`/xl/pivotCache/pivotCacheRecords1.xml`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml`}),t.leafNode(`Override`,{PartName:`/xl/pivotTables/pivotTable1.xml`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml`})),t.leafNode(`Override`,{PartName:`/xl/theme/theme1.xml`,ContentType:`application/vnd.openxmlformats-officedocument.theme+xml`}),t.leafNode(`Override`,{PartName:`/xl/styles.xml`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml`}),n.sharedStrings&&n.sharedStrings.count&&t.leafNode(`Override`,{PartName:`/xl/sharedStrings.xml`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml`}),n.tables&&n.tables.forEach(e=>{t.leafNode(`Override`,{PartName:`/xl/tables/${e.target}`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml`})}),n.drawings&&n.drawings.forEach(e=>{t.leafNode(`Override`,{PartName:`/xl/drawings/${e.name}.xml`,ContentType:`application/vnd.openxmlformats-officedocument.drawing+xml`})}),n.commentRefs&&(t.leafNode(`Default`,{Extension:`vml`,ContentType:`application/vnd.openxmlformats-officedocument.vmlDrawing`}),n.commentRefs.forEach(({commentName:e})=>{t.leafNode(`Override`,{PartName:`/xl/${e}.xml`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml`})})),t.leafNode(`Override`,{PartName:`/docProps/core.xml`,ContentType:`application/vnd.openxmlformats-package.core-properties+xml`}),t.leafNode(`Override`,{PartName:`/docProps/app.xml`,ContentType:`application/vnd.openxmlformats-officedocument.extended-properties+xml`}),t.closeNode()}parseOpen(){return!1}parseText(){}parseClose(){return!1}static{this.PROPERTY_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/package/2006/content-types`}}},_c=class extends ${render(e,t){e.openNode(`HeadingPairs`),e.openNode(`vt:vector`,{size:2,baseType:`variant`}),e.openNode(`vt:variant`),e.leafNode(`vt:lpstr`,void 0,`Worksheets`),e.closeNode(),e.openNode(`vt:variant`),e.leafNode(`vt:i4`,void 0,t.length),e.closeNode(),e.closeNode(),e.closeNode()}parseOpen(e){return e.name===`HeadingPairs`}parseText(){}parseClose(e){return e!==`HeadingPairs`}},vc=class extends ${render(e,t){e.openNode(`TitlesOfParts`),e.openNode(`vt:vector`,{size:t.length,baseType:`lpstr`}),t.forEach(t=>{e.leafNode(`vt:lpstr`,void 0,t.name)}),e.closeNode(),e.closeNode()}parseOpen(e){return e.name===`TitlesOfParts`}parseText(){}parseClose(e){return e!==`TitlesOfParts`}},yc=class e extends ${constructor(){super(),this.map={Company:new zs({tag:`Company`}),Manager:new zs({tag:`Manager`}),HeadingPairs:new _c,TitleOfParts:new vc}}render(t,n){t.openXml(Ds.StdDocAttributes),t.openNode(`Properties`,e.PROPERTY_ATTRIBUTES),t.leafNode(`Application`,void 0,`Microsoft Excel`),t.leafNode(`DocSecurity`,void 0,`0`),t.leafNode(`ScaleCrop`,void 0,`false`),this.map.HeadingPairs.render(t,n.worksheets),this.map.TitleOfParts.render(t,n.worksheets),this.map.Company.render(t,n.company||``),this.map.Manager.render(t,n.manager),t.leafNode(`LinksUpToDate`,void 0,`false`),t.leafNode(`SharedDoc`,void 0,`false`),t.leafNode(`HyperlinksChanged`,void 0,`false`),t.leafNode(`AppVersion`,void 0,`16.0300`),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`Properties`:return!0;default:return this.parser=this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`Properties`:return this.model={worksheets:this.map.TitleOfParts.model,company:this.map.Company.model,manager:this.map.Manager.model},!1;default:return!0}}static{this.DateFormat=function(e){return e.toISOString().replace(/[.]\d{3,6}/,``)}}static{this.DateAttrs={"xsi:type":`dcterms:W3CDTF`}}static{this.PROPERTY_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/officeDocument/2006/extended-properties`,"xmlns:vt":`http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes`}}},bc=class extends ${constructor(){super(),this._parsedText=[]}render(e,t){e.openNode(`definedName`,{name:t.name,localSheetId:t.localSheetId}),e.writeText(t.ranges.join(`,`)),e.closeNode()}parseOpen(e){switch(e.name){case`definedName`:return this._parsedName=e.attributes.name,this._parsedLocalSheetId=e.attributes.localSheetId,this._parsedText=[],!0;default:return!1}}parseText(e){this._parsedText.push(e)}parseClose(){return this.model={name:this._parsedName,ranges:Tc(this._parsedText.join(``))},this._parsedLocalSheetId!==void 0&&(this.model.localSheetId=parseInt(this._parsedLocalSheetId,10)),!1}};let xc=/^[$]?[A-Za-z]{1,3}[$]?\d+(:[$]?[A-Za-z]{1,3}[$]?\d+)?$/,Sc=/^[$]?\d+:[$]?\d+$/,Cc=/^[$]?[A-Za-z]{1,3}:[$]?[A-Za-z]{1,3}$/;function wc(e){if(e.startsWith(`{`)||e.endsWith(`}`))return!1;let t=e.split(`!`).pop()||``;if(!xc.test(t)&&!Sc.test(t)&&!Cc.test(t))return!1;try{let t=m.decodeEx(e);return`row`in t&&typeof t.row==`number`||`top`in t&&typeof t.top==`number`||`left`in t&&typeof t.left==`number`}catch{return!1}}function Tc(e){let t=e.trim();if(t.startsWith(`{`)&&t.endsWith(`}`))return[];let n=[],r=!1,i=``;return e.split(`,`).forEach(e=>{if(!e)return;let t=(e.match(/'/g)||[]).length;if(!t){r?i+=`${e},`:wc(e)&&n.push(e);return}let a=t%2==0;!r&&a&&wc(e)?n.push(e):r&&!a?(r=!1,wc(i+e)&&n.push(i+e),i=``):(r=!0,i+=`${e},`)}),n}var Ec=class extends ${render(e,t){e.leafNode(`sheet`,{sheetId:t.id,name:t.name,state:t.state,"r:id":t.rId})}parseOpen(e){return e.name===`sheet`?(this.model={name:ra(e.attributes.name),id:parseInt(e.attributes.sheetId,10),state:e.attributes.state,rId:e.attributes[`r:id`]},!0):!1}parseText(){}parseClose(){return!1}},Dc=class extends ${render(e,t){let n={xWindow:t.x||0,yWindow:t.y||0,windowWidth:t.width||12e3,windowHeight:t.height||24e3,firstSheet:t.firstSheet,activeTab:t.activeTab};t.visibility&&t.visibility!==`visible`&&(n.visibility=t.visibility),e.leafNode(`workbookView`,n)}parseOpen(e){if(e.name===`workbookView`){let t=this.model={},n=function(e,n,r){t[e]=n===void 0?r:n},r=function(e,n,r){let i=n===void 0?r:parseInt(n,10);i!==void 0&&(t[e]=i)};return r(`x`,e.attributes.xWindow,0),r(`y`,e.attributes.yWindow,0),r(`width`,e.attributes.windowWidth,25e3),r(`height`,e.attributes.windowHeight,1e4),n(`visibility`,e.attributes.visibility,`visible`),r(`activeTab`,e.attributes.activeTab,void 0),r(`firstSheet`,e.attributes.firstSheet,void 0),!0}return!1}parseText(){}parseClose(){return!1}},Oc=class extends ${render(e,t){e.leafNode(`workbookPr`,{date1904:t.date1904?1:void 0,defaultThemeVersion:164011,filterPrivacy:1})}parseOpen(e){return e.name===`workbookPr`?(this.model={date1904:e.attributes.date1904===`1`},!0):!1}parseText(){}parseClose(){return!1}},kc=class extends ${render(e,t){e.leafNode(`calcPr`,{calcId:171027,fullCalcOnLoad:t.fullCalcOnLoad?1:void 0})}parseOpen(e){return e.name===`calcPr`?(this.model={},!0):!1}parseText(){}parseClose(){return!1}},Ac=class extends ${render(e,t){e.leafNode(`pivotCache`,{cacheId:t.cacheId,"r:id":t.rId})}parseOpen(e){return e.name===`pivotCache`?(this.model={cacheId:e.attributes.cacheId,rId:e.attributes[`r:id`]},!0):!1}parseText(){}parseClose(){return!1}},jc=class e extends ${constructor(){super(),this.map={fileVersion:e.STATIC_XFORMS.fileVersion,workbookPr:new Oc,bookViews:new Fs({tag:`bookViews`,count:!1,childXform:new Dc}),sheets:new Fs({tag:`sheets`,count:!1,childXform:new Ec}),definedNames:new Fs({tag:`definedNames`,count:!1,childXform:new bc}),calcPr:new kc,pivotCaches:new Fs({tag:`pivotCaches`,count:!1,childXform:new Ac})}}prepare(e){e.sheets=e.worksheets;let t=[],n=0;e.sheets.forEach(e=>{if(e.pageSetup&&e.pageSetup.printArea&&e.pageSetup.printArea.split(`&&`).forEach(r=>{let i=r.split(`:`),a={name:`_xlnm.Print_Area`,ranges:[`'${e.name}'!$${i[0]}:$${i[1]}`],localSheetId:n};t.push(a)}),e.pageSetup&&(e.pageSetup.printTitlesRow||e.pageSetup.printTitlesColumn)){let r=[];if(e.pageSetup.printTitlesColumn){let t=e.pageSetup.printTitlesColumn.split(`:`);r.push(`'${e.name}'!$${t[0]}:$${t[1]}`)}if(e.pageSetup.printTitlesRow){let t=e.pageSetup.printTitlesRow.split(`:`);r.push(`'${e.name}'!$${t[0]}:$${t[1]}`)}let i={name:`_xlnm.Print_Titles`,ranges:r,localSheetId:n};t.push(i)}n++}),t.length&&(e.definedNames=e.definedNames.concat(t)),(e.media||[]).forEach((e,t)=>{e.name=e.type+(t+1)})}render(t,n){t.openXml(Ds.StdDocAttributes),t.openNode(`workbook`,e.WORKBOOK_ATTRIBUTES),this.map.fileVersion.render(t),this.map.workbookPr.render(t,n.properties),this.map.bookViews.render(t,n.views),this.map.sheets.render(t,n.sheets),this.map.definedNames.render(t,n.definedNames),this.map.calcPr.render(t,n.calcProperties),this.map.pivotCaches.render(t,n.pivotTables),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`workbook`:return!0;default:return this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e),!0}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`workbook`:return this.model={sheets:this.map.sheets.model,properties:this.map.workbookPr.model||{},views:this.map.bookViews.model,calcProperties:{}},this.map.definedNames.model&&(this.model.definedNames=this.map.definedNames.model),!1;default:return!0}}reconcile(e){let t=(e.workbookRels||[]).reduce((e,t)=>(e[t.Id]=t,e),{}),n=[],r,i=0;(e.sheets||[]).forEach(a=>{let o=t[a.rId];o&&(r=e.worksheetHash[`xl/${o.Target.replace(/^(\s|\/xl\/)+/,``)}`],r&&(r.name=a.name,r.id=a.id,r.state=a.state,n[i++]=r))});let a=[];e.definedNames&&e.definedNames.forEach(e=>{if(e.name===`_xlnm.Print_Area`){if(r=n[e.localSheetId],r){r.pageSetup||={};let t=m.decodeEx(e.ranges[0]);r.pageSetup.printArea=r.pageSetup.printArea?`${r.pageSetup.printArea}&&${t.dimensions}`:t.dimensions}}else if(e.name===`_xlnm.Print_Titles`){if(r=n[e.localSheetId],r){r.pageSetup||={};let t=e.ranges.join(`,`),n=/\$/g,i=t.match(/\$\d+:\$\d+/);if(i&&i.length){let e=i[0];r.pageSetup.printTitlesRow=e.replace(n,``)}let a=t.match(/\$[A-Z]+:\$[A-Z]+/);if(a&&a.length){let e=a[0];r.pageSetup.printTitlesColumn=e.replace(n,``)}}}else a.push(e)}),e.definedNames=a,e.media.forEach((e,t)=>{e.index=t})}static{this.WORKBOOK_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`x15`,"xmlns:x15":`http://schemas.microsoft.com/office/spreadsheetml/2010/11/main`}}static{this.STATIC_XFORMS={fileVersion:new Ps({tag:`fileVersion`,$:{appName:`xl`,lastEdited:5,lowestEdited:5,rupBuild:9303}})}}};let Mc={OfficeDocument:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument`,Worksheet:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet`,CalcChain:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/calcChain`,SharedStrings:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings`,Styles:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles`,Theme:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme`,Hyperlink:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink`,Image:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/image`,CoreProperties:`http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties`,ExtenderProperties:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties`,Comments:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments`,VmlDrawing:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing`,Table:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/table`,PivotCacheDefinition:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition`,PivotCacheRecords:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheRecords`,PivotTable:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable`};var Nc=class{constructor(){this.merges={}}add(e){if(this.merges[e.master])this.merges[e.master].expandToAddress(e.address);else{let t=`${e.master}:${e.address}`;this.merges[e.master]=new h(t)}}get mergeCells(){return Object.values(this.merges).map(e=>e.range)}reconcile(e,t){e.forEach(e=>{let n=m.decode(e);for(let e=n.top;e<=n.bottom;e++){let r=t[e-1];for(let t=n.left;t<=n.right;t++){let i=r.cells[t-1];i?i.type===S.ValueType.Merge&&(i.master=n.tl):r.cells[t]={type:S.ValueType.Null,address:m.encodeAddress(e,t)}}}})}getMasterAddress(e){let t=this.hash[e];return t&&t.tl}};function Pc(e){if(e==null)return S.ValueType.Null;if(e instanceof String||typeof e==`string`)return S.ValueType.String;if(typeof e==`number`)return S.ValueType.Number;if(typeof e==`boolean`)return S.ValueType.Boolean;if(e instanceof Date)return S.ValueType.Date;if(e.text&&e.hyperlink)return S.ValueType.Hyperlink;if(e.formula)return S.ValueType.Formula;if(e.error)return S.ValueType.Error;throw Error(`I could not understand type of value`)}function Fc(e){switch(e.type){case S.ValueType.Formula:return Pc(e.result);default:return e.type}}var Ic=class extends ${constructor(){super(),this.richTextXform=new uc}get tag(){return`c`}prepare(e,t){let n=t.styles.addStyleModel(e.style||{},Fc(e));switch(n&&(e.styleId=n),e.comment&&t.comments.push({...e.comment,ref:e.address}),e.type){case S.ValueType.String:case S.ValueType.RichText:t.sharedStrings&&(e.ssId=t.sharedStrings.add(e.value));break;case S.ValueType.Date:t.date1904&&(e.date1904=!0);break;case S.ValueType.Hyperlink:t.sharedStrings&&e.text!==void 0&&e.text!==null&&(e.ssId=t.sharedStrings.add(e.text)),t.hyperlinks.push({address:e.address,target:e.hyperlink,tooltip:e.tooltip});break;case S.ValueType.Merge:t.merges.add(e);break;case S.ValueType.Formula:if(t.date1904&&(e.date1904=!0),e.shareType===`shared`&&(e.si=t.siFormulae++),e.formula)t.formulae[e.address]=e;else if(e.sharedFormula){let n=t.formulae[e.sharedFormula];if(!n)throw Error(`Shared Formula master must exist above and or left of clone for cell ${e.address}`);n.si===void 0?(n.shareType=`shared`,n.si=t.siFormulae++,n.range=new h(n.address,e.address)):n.range&&n.range.expandToAddress(e.address),e.si=n.si}break;default:break}}renderFormula(e,t){let n=null;switch(t.shareType){case`shared`:n={t:`shared`,ref:t.ref||t.range.range,si:t.si};break;case`array`:n={t:`array`,ref:t.ref};break;default:t.si!==void 0&&(n={t:`shared`,si:t.si});break}switch(Pc(t.result)){case S.ValueType.Null:e.leafNode(`f`,n,t.formula);break;case S.ValueType.String:e.addAttribute(`t`,`str`),e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,t.result);break;case S.ValueType.Number:e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,t.result);break;case S.ValueType.Boolean:e.addAttribute(`t`,`b`),e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,t.result?1:0);break;case S.ValueType.Error:e.addAttribute(`t`,`e`),e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,t.result.error);break;case S.ValueType.Date:e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,$i(t.result,t.date1904));break;default:throw Error(`I could not understand type of value`)}}render(e,t){if(!(t.type===S.ValueType.Null&&!t.styleId)){switch(e.openNode(`c`),e.addAttribute(`r`,t.address),t.styleId&&e.addAttribute(`s`,t.styleId),t.type){case S.ValueType.Null:break;case S.ValueType.Number:e.leafNode(`v`,null,t.value);break;case S.ValueType.Boolean:e.addAttribute(`t`,`b`),e.leafNode(`v`,null,t.value?`1`:`0`);break;case S.ValueType.Error:e.addAttribute(`t`,`e`),e.leafNode(`v`,null,t.value.error);break;case S.ValueType.String:case S.ValueType.RichText:t.ssId===void 0?t.value&&t.value.richText?(e.addAttribute(`t`,`inlineStr`),e.openNode(`is`),t.value.richText.forEach(t=>{this.richTextXform.render(e,t)}),e.closeNode(`is`)):(e.addAttribute(`t`,`str`),e.leafNode(`v`,null,t.value)):(e.addAttribute(`t`,`s`),e.leafNode(`v`,null,t.ssId));break;case S.ValueType.Date:e.leafNode(`v`,null,$i(t.value,t.date1904));break;case S.ValueType.Hyperlink:t.ssId===void 0?(e.addAttribute(`t`,`str`),e.leafNode(`v`,null,t.text)):(e.addAttribute(`t`,`s`),e.leafNode(`v`,null,t.ssId));break;case S.ValueType.Formula:this.renderFormula(e,t);break;case S.ValueType.Merge:break;default:break}e.closeNode()}}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`c`:return this.model={address:e.attributes.r},this.t=e.attributes.t,e.attributes.s&&(this.model.styleId=parseInt(e.attributes.s,10)),!0;case`f`:return this.currentNode=`f`,this.model.si=e.attributes.si,this.model.shareType=e.attributes.t,this.model.ref=e.attributes.ref,!0;case`v`:return this.currentNode=`v`,!0;case`t`:return this.currentNode=`t`,!0;case`r`:return this.parser=this.richTextXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){if(this.parser){this.parser.parseText(e);return}switch(this.currentNode){case`f`:this.model.formula=this.model.formula?this.model.formula+e:e;break;case`v`:case`t`:this.model.value&&this.model.value.richText?this.model.value.richText.text=this.model.value.richText.text?this.model.value.richText.text+e:e:this.model.value=this.model.value?this.model.value+e:e;break;default:break}}parseClose(e){switch(e){case`c`:{let{model:e}=this;if(e.formula||e.shareType)e.type=S.ValueType.Formula,e.value&&=(this.t===`str`?e.result=ra(e.value):this.t===`b`?e.result=parseInt(e.value,10)!==0:this.t===`e`?e.result={error:e.value}:e.result=parseFloat(e.value),void 0);else if(e.value!==void 0)switch(this.t){case`s`:e.type=S.ValueType.String,e.value=parseInt(e.value,10);break;case`str`:e.type=S.ValueType.String,e.value=ra(e.value);break;case`inlineStr`:e.type=S.ValueType.String;break;case`b`:e.type=S.ValueType.Boolean,e.value=parseInt(e.value,10)!==0;break;case`e`:e.type=S.ValueType.Error,e.value={error:e.value};break;default:e.type=S.ValueType.Number,e.value=parseFloat(e.value);break}else e.styleId?e.type=S.ValueType.Null:e.type=S.ValueType.Merge;return!1}case`f`:case`v`:case`is`:return this.currentNode=void 0,!0;case`t`:return this.parser?(this.parser.parseClose(e),!0):(this.currentNode=void 0,!0);case`r`:return this.model.value=this.model.value||{},this.model.value.richText=this.model.value.richText||[],this.model.value.richText.push(this.parser.model),this.parser=void 0,this.currentNode=void 0,!0;default:return this.parser?(this.parser.parseClose(e),!0):!1}}reconcile(e,t){let n=e.styleId&&t.styles&&t.styles.getStyleModel(e.styleId);switch(n&&(e.style=n),e.styleId!==void 0&&(e.styleId=void 0),e.type){case S.ValueType.String:typeof e.value==`number`&&t.sharedStrings&&(e.value=t.sharedStrings.getString(e.value)),e.value.richText&&(e.type=S.ValueType.RichText);break;case S.ValueType.Number:n&&aa(n.numFmt)&&(e.type=S.ValueType.Date,e.value=ea(e.value,t.date1904));break;case S.ValueType.Formula:e.result!==void 0&&typeof e.result==`number`&&n&&aa(n.numFmt)&&(e.result=ea(e.result,t.date1904)),e.shareType===`shared`&&(e.ref?t.formulae[e.si]=e.address:(e.sharedFormula=t.formulae[e.si],delete e.shareType),delete e.si);break;default:break}let r=t.hyperlinkMap[e.address];r&&(e.type===S.ValueType.Formula?(e.text=e.result,e.result=void 0):(e.text=e.value,e.value=void 0),e.type=S.ValueType.Hyperlink,e.hyperlink=r);let i=t.commentsMap&&t.commentsMap[e.address];i&&(e.comment=i)}},Lc=class extends ${constructor(e){super(),this.maxItems=e&&e.maxItems,this.map={c:new Ic}}get tag(){return`row`}reset(){super.reset(),this.numRowsSeen=0,this.lastCellCol=0}prepare(e,t){let n=t.styles.addStyleModel(e.style);n&&(e.styleId=n);let r=this.map.c;e.cells.forEach(e=>{r.prepare(e,t)})}render(e,t,n){if(!t)return;e.openNode(`row`),e.addAttribute(`r`,t.number),t.height&&(e.addAttribute(`ht`,t.height),e.addAttribute(`customHeight`,`1`)),t.hidden&&e.addAttribute(`hidden`,`1`),t.min>0&&t.max>0&&t.min<=t.max&&e.addAttribute(`spans`,`${t.min}:${t.max}`),t.styleId&&(e.addAttribute(`s`,t.styleId),e.addAttribute(`customFormat`,`1`)),e.addAttribute(`x14ac:dyDescent`,`0.25`),t.outlineLevel&&e.addAttribute(`outlineLevel`,t.outlineLevel),t.collapsed&&e.addAttribute(`collapsed`,`1`);let r=this.map.c;t.cells.forEach(t=>{r.render(e,t,n)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if(e.name===`row`){this.numRowsSeen+=1,this.lastCellCol=0;let t=e.attributes.spans?e.attributes.spans.split(`:`).map(e=>parseInt(e,10)):[void 0,void 0],n=this.model={number:e.attributes.r?parseInt(e.attributes.r,10):this.numRowsSeen,min:t[0],max:t[1],cells:[]};return e.attributes.s&&(n.styleId=parseInt(e.attributes.s,10)),sa(e.attributes.hidden)&&(n.hidden=!0),sa(e.attributes.bestFit)&&(n.bestFit=!0),e.attributes.ht&&(n.height=parseFloat(e.attributes.ht)),e.attributes.outlineLevel&&(n.outlineLevel=parseInt(e.attributes.outlineLevel,10)),sa(e.attributes.collapsed)&&(n.collapsed=!0),!0}return this.parser=this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):!1}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)){let e=this.parser.model;if(e.address?this.lastCellCol=m.decodeAddress(e.address).col:(this.lastCellCol+=1,e.address=m.encodeAddress(this.model.number,this.lastCellCol)),this.model.cells.push(e),this.maxItems&&this.model.cells.length>this.maxItems)throw Error(`Max column count (${this.maxItems}) exceeded`);this.parser=void 0}return!0}return!1}reconcile(e,t){e.style=e.styleId?t.styles.getStyleModel(e.styleId):{},e.styleId!==void 0&&(e.styleId=void 0);let n=this.map.c;e.cells.forEach(e=>{n.reconcile(e,t)})}},Rc=class extends ${get tag(){return`col`}prepare(e,t){let n=t.styles.addStyleModel(e.style||{});n&&(e.styleId=n)}render(e,t){e.openNode(`col`),e.addAttribute(`min`,t.min),e.addAttribute(`max`,t.max),t.width&&e.addAttribute(`width`,t.width),t.styleId&&e.addAttribute(`style`,t.styleId),t.hidden&&e.addAttribute(`hidden`,`1`),t.bestFit&&e.addAttribute(`bestFit`,`1`),t.outlineLevel&&e.addAttribute(`outlineLevel`,t.outlineLevel),t.collapsed&&e.addAttribute(`collapsed`,`1`),e.addAttribute(`customWidth`,`1`),e.closeNode()}parseOpen(e){if(e.name===`col`){let t=this.model={min:parseInt(e.attributes.min||`0`,10),max:parseInt(e.attributes.max||`0`,10),width:e.attributes.width===void 0?void 0:parseFloat(e.attributes.width||`0`)};return e.attributes.style&&(t.styleId=parseInt(e.attributes.style,10)),sa(e.attributes.hidden)&&(t.hidden=!0),sa(e.attributes.bestFit)&&(t.bestFit=!0),e.attributes.outlineLevel&&(t.outlineLevel=parseInt(e.attributes.outlineLevel,10)),sa(e.attributes.collapsed)&&(t.collapsed=!0),!0}return!1}parseText(){}parseClose(){return!1}reconcile(e,t){e.styleId&&(e.style=t.styles.getStyleModel(e.styleId))}},zc=class extends ${get tag(){return`dimension`}render(e,t){t&&e.leafNode(`dimension`,{ref:t})}parseOpen(e){return e.name===`dimension`?(this.model=e.attributes.ref,!0):!1}parseText(){}parseClose(){return!1}},Bc=class extends ${get tag(){return`hyperlink`}render(e,t){this.isInternalLink(t)?e.leafNode(`hyperlink`,{ref:t.address,"r:id":t.rId,tooltip:t.tooltip,location:t.target}):e.leafNode(`hyperlink`,{ref:t.address,"r:id":t.rId,tooltip:t.tooltip})}parseOpen(e){return e.name===`hyperlink`?(this.model={address:e.attributes.ref,rId:e.attributes[`r:id`],tooltip:e.attributes.tooltip},e.attributes.location&&(this.model.target=e.attributes.location),!0):!1}parseText(){}parseClose(){return!1}isInternalLink(e){return!!(e.target&&/^[^!]+![a-zA-Z]+[\d]+$/.test(e.target))}},Vc=class extends ${get tag(){return`mergeCell`}render(e,t){e.leafNode(`mergeCell`,{ref:t})}parseOpen(e){return e.name===`mergeCell`?(this.model=e.attributes.ref,!0):!1}parseText(){}parseClose(){return!1}};function Hc(e,t,n,r){let i=t[n];i===void 0?r!==void 0&&(e[n]=r):e[n]=i}function Uc(e,t,n,r){let i=t[n];i===void 0?r!==void 0&&(e[n]=r):e[n]=sa(i)}function Wc(e){if(!e)return[];let t=[],n={};for(let[r,i]of Object.entries(e))if(i!=null)if(r.startsWith(`range:`)){let e=r.slice(6),{sqref:n,...a}=i;t.push({...a,sqref:e})}else n[r]=i;if(Object.keys(n).length===0)return t;let r=Object.entries(n).map(([e,t])=>({address:e,dataValidation:t,marked:!1})).sort((e,t)=>e.address.localeCompare(t.address)),i=Object.fromEntries(r.map(e=>[e.address,e])),a=(e,t,r)=>{for(let i=0;i<t;i++){let t=m.encodeAddress(e.row+i,r);if(!n[t]||!T(n[e.address],n[t]))return!1}return!0},o=r.map(e=>{if(!e.marked){let t=m.decodeEx(e.address);if(t.dimensions)return i[t.dimensions].marked=!0,{...e.dataValidation,sqref:e.address};let r=1,o=m.encodeAddress(t.row+r,t.col);for(;n[o]&&T(e.dataValidation,n[o]);)r++,o=m.encodeAddress(t.row+r,t.col);let s=1;for(;a(t,r,t.col+s);)s++;for(let e=0;e<r;e++)for(let n=0;n<s;n++)o=m.encodeAddress(t.row+e,t.col+n),i[o].marked=!0;if(r>1||s>1){let n=t.row+(r-1),i=t.col+(s-1);return{...e.dataValidation,sqref:`${e.address}:${m.encodeAddress(n,i)}`}}return{...e.dataValidation,sqref:e.address}}return null}).filter(Boolean);return[...t,...o]}var Gc=class extends ${get tag(){return`dataValidations`}render(e,t){let n=Wc(t);n.length&&(e.openNode(`dataValidations`,{count:n.length}),n.forEach(t=>{e.openNode(`dataValidation`),t.type!==`any`&&(e.addAttribute(`type`,t.type),t.operator&&t.type!==`list`&&t.operator!==`between`&&e.addAttribute(`operator`,t.operator),t.allowBlank&&e.addAttribute(`allowBlank`,`1`)),t.showInputMessage&&e.addAttribute(`showInputMessage`,`1`),t.promptTitle&&e.addAttribute(`promptTitle`,t.promptTitle),t.prompt&&e.addAttribute(`prompt`,t.prompt),t.showErrorMessage&&e.addAttribute(`showErrorMessage`,`1`),t.errorStyle&&e.addAttribute(`errorStyle`,t.errorStyle),t.errorTitle&&e.addAttribute(`errorTitle`,t.errorTitle),t.error&&e.addAttribute(`error`,t.error),e.addAttribute(`sqref`,t.sqref),(t.formulae||[]).forEach((n,r)=>{e.openNode(`formula${r+1}`),t.type===`date`?e.writeText($i(new Date(n))):e.writeText(n),e.closeNode()}),e.closeNode()}),e.closeNode())}parseOpen(e){switch(e.name){case`dataValidations`:return this.model={},!0;case`dataValidation`:{this._address=e.attributes.sqref;let t={type:e.attributes.type||`any`,formulae:[]};switch(e.attributes.type&&Uc(t,e.attributes,`allowBlank`),Uc(t,e.attributes,`showInputMessage`),Uc(t,e.attributes,`showErrorMessage`),t.type){case`any`:case`list`:case`custom`:break;default:Hc(t,e.attributes,`operator`,`between`);break}return Hc(t,e.attributes,`promptTitle`),Hc(t,e.attributes,`prompt`),Hc(t,e.attributes,`errorStyle`),Hc(t,e.attributes,`errorTitle`),Hc(t,e.attributes,`error`),this._dataValidation=t,!0}case`formula1`:case`formula2`:return this._formula=[],!0;default:return!1}}parseText(e){this._formula&&this._formula.push(e)}parseClose(e){switch(e){case`dataValidations`:return!1;case`dataValidation`:return(!this._dataValidation.formulae||!this._dataValidation.formulae.length)&&(delete this._dataValidation.formulae,delete this._dataValidation.operator),(this._address.split(/\s+/g)||[]).forEach(e=>{if(e.includes(`:`)){let t=new h(e);(t.bottom-t.top+1)*(t.right-t.left+1)<=1e3?t.forEachAddress(e=>{this.model[e]=this._dataValidation}):this.model[`range:${e}`]=this._dataValidation}else this.model[e]=this._dataValidation}),!0;case`formula1`:case`formula2`:{let e=this._formula.join(``);switch(this._dataValidation.type){case`whole`:case`textLength`:e=parseInt(e,10);break;case`decimal`:e=parseFloat(e);break;case`date`:e=ea(parseFloat(e));break;default:break}return this._dataValidation.formulae.push(e),this._formula=void 0,!0}default:return!0}}},Kc=class extends ${get tag(){return`pageSetUpPr`}render(e,t){return t&&t.fitToPage?(e.leafNode(this.tag,{fitToPage:t.fitToPage?`1`:void 0}),!0):!1}parseOpen(e){return e.name===this.tag?(this.model={fitToPage:e.attributes.fitToPage===`1`},!0):!1}parseText(){}parseClose(){return!1}};let qc=e=>e!==void 0;var Jc=class extends ${get tag(){return`outlinePr`}render(e,t){return t&&(qc(t.summaryBelow)||qc(t.summaryRight))?(e.leafNode(this.tag,{summaryBelow:qc(t.summaryBelow)?Number(t.summaryBelow):void 0,summaryRight:qc(t.summaryRight)?Number(t.summaryRight):void 0}),!0):!1}parseOpen(e){return e.name===this.tag?(this.model={summaryBelow:qc(e.attributes.summaryBelow)?!!Number(e.attributes.summaryBelow):void 0,summaryRight:qc(e.attributes.summaryRight)?!!Number(e.attributes.summaryRight):void 0},!0):!1}parseText(){}parseClose(){return!1}},Yc=class extends ${constructor(){super(),this.map={tabColor:new Is(`tabColor`),pageSetUpPr:new Kc,outlinePr:new Jc}}get tag(){return`sheetPr`}render(e,t){if(t){e.addRollback(),e.openNode(`sheetPr`);let n=!1;n=this.map.tabColor.render(e,t.tabColor)||n,n=this.map.pageSetUpPr.render(e,t.pageSetup)||n,n=this.map.outlinePr.render(e,t.outlineProperties)||n,n?(e.closeNode(),e.commit()):e.rollback()}}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):e.name===this.tag?(this.reset(),!0):this.map[e.name]?(this.parser=this.map[e.name],this.parser.parseOpen(e),!0):!1}parseText(e){return this.parser?(this.parser.parseText(e),!0):!1}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):(this.map.tabColor.model||this.map.pageSetUpPr.model||this.map.outlinePr.model?(this.model={},this.map.tabColor.model&&(this.model.tabColor=this.map.tabColor.model),this.map.pageSetUpPr.model&&(this.model.pageSetup=this.map.pageSetUpPr.model),this.map.outlinePr.model&&(this.model.outlineProperties=this.map.outlinePr.model)):this.model=null,!1)}},Xc=class extends ${get tag(){return`sheetFormatPr`}render(e,t){if(t){let n={defaultRowHeight:t.defaultRowHeight,outlineLevelRow:t.outlineLevelRow,outlineLevelCol:t.outlineLevelCol,"x14ac:dyDescent":t.dyDescent};t.defaultColWidth&&(n.defaultColWidth=t.defaultColWidth),(!t.defaultRowHeight||t.defaultRowHeight!==15)&&(n.customHeight=`1`),Object.values(n).some(e=>e!==void 0)&&e.leafNode(`sheetFormatPr`,n)}}parseOpen(e){return e.name===`sheetFormatPr`?(this.model={defaultRowHeight:parseFloat(e.attributes.defaultRowHeight||`0`),dyDescent:parseFloat(e.attributes[`x14ac:dyDescent`]||`0`),outlineLevelRow:parseInt(e.attributes.outlineLevelRow||`0`,10),outlineLevelCol:parseInt(e.attributes.outlineLevelCol||`0`,10)},e.attributes.defaultColWidth&&(this.model.defaultColWidth=parseFloat(e.attributes.defaultColWidth)),!0):!1}parseText(){}parseClose(){return!1}};let Zc={frozen:`frozen`,frozenSplit:`frozen`,split:`split`};var Qc=class extends ${get tag(){return`sheetView`}prepare(e){switch(e.state){case`frozen`:case`split`:break;default:e.state=`normal`;break}}render(e,t){e.openNode(`sheetView`,{workbookViewId:t.workbookViewId||0});let n=function(t,n,r){r&&e.addAttribute(t,n)};n(`rightToLeft`,`1`,t.rightToLeft===!0),n(`tabSelected`,`1`,t.tabSelected),n(`showRuler`,`0`,t.showRuler===!1),n(`showRowColHeaders`,`0`,t.showRowColHeaders===!1),n(`showGridLines`,`0`,t.showGridLines===!1),n(`zoomScale`,t.zoomScale,t.zoomScale),n(`zoomScaleNormal`,t.zoomScaleNormal,t.zoomScaleNormal),n(`view`,t.style,t.style);let r,i,a,o;switch(t.state){case`frozen`:i=t.xSplit||0,a=t.ySplit||0,r=t.topLeftCell||m.getAddress(a+1,i+1).address,o=t.xSplit&&t.ySplit&&`bottomRight`||t.xSplit&&`topRight`||`bottomLeft`,e.leafNode(`pane`,{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:r,activePane:o,state:`frozen`}),e.leafNode(`selection`,{pane:o,activeCell:t.activeCell,sqref:t.activeCell});break;case`split`:t.activePane===`topLeft`&&(t.activePane=void 0),e.leafNode(`pane`,{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:t.topLeftCell,activePane:t.activePane}),e.leafNode(`selection`,{pane:t.activePane,activeCell:t.activeCell,sqref:t.activeCell});break;case`normal`:t.activeCell&&e.leafNode(`selection`,{activeCell:t.activeCell,sqref:t.activeCell});break;default:break}e.closeNode()}parseOpen(e){switch(e.name){case`sheetView`:return this.sheetView={workbookViewId:parseInt(e.attributes.workbookViewId,10),rightToLeft:e.attributes.rightToLeft===`1`,tabSelected:e.attributes.tabSelected===`1`,showRuler:e.attributes.showRuler!==`0`,showRowColHeaders:e.attributes.showRowColHeaders!==`0`,showGridLines:e.attributes.showGridLines!==`0`,zoomScale:parseInt(e.attributes.zoomScale||`100`,10),zoomScaleNormal:parseInt(e.attributes.zoomScaleNormal||`100`,10),style:e.attributes.view},this.pane=void 0,this.selections={},!0;case`pane`:return this.pane={xSplit:parseInt(e.attributes.xSplit||`0`,10),ySplit:parseInt(e.attributes.ySplit||`0`,10),topLeftCell:e.attributes.topLeftCell,activePane:e.attributes.activePane||`topLeft`,state:e.attributes.state},!0;case`selection`:{let t=e.attributes.pane||`topLeft`;return this.selections[t]={pane:t,activeCell:e.attributes.activeCell},!0}default:return!1}}parseText(){}parseClose(e){let t,n;switch(e){case`sheetView`:return this.sheetView&&this.pane?(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:Zc[this.pane.state]||`split`,xSplit:this.pane.xSplit,ySplit:this.pane.ySplit,topLeftCell:this.pane.topLeftCell,showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},this.model.state===`split`&&(t.activePane=this.pane.activePane),n=this.selections[this.pane.activePane],n&&n.activeCell&&(t.activeCell=n.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)):(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:`normal`,showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},n=this.selections.topLeft,n&&n.activeCell&&(t.activeCell=n.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)),!1;default:return!0}}reconcile(){}};function $c(e,t){return e?t:void 0}function el(e,t){return e===t?!0:void 0}var tl=class extends ${get tag(){return`sheetProtection`}render(e,t){if(t){let n={sheet:$c(t.sheet,`1`),selectLockedCells:t.selectLockedCells===!1?`1`:void 0,selectUnlockedCells:t.selectUnlockedCells===!1?`1`:void 0,formatCells:$c(t.formatCells,`0`),formatColumns:$c(t.formatColumns,`0`),formatRows:$c(t.formatRows,`0`),insertColumns:$c(t.insertColumns,`0`),insertRows:$c(t.insertRows,`0`),insertHyperlinks:$c(t.insertHyperlinks,`0`),deleteColumns:$c(t.deleteColumns,`0`),deleteRows:$c(t.deleteRows,`0`),sort:$c(t.sort,`0`),autoFilter:$c(t.autoFilter,`0`),pivotTables:$c(t.pivotTables,`0`)};t.sheet&&(n.algorithmName=t.algorithmName,n.hashValue=t.hashValue,n.saltValue=t.saltValue,n.spinCount=t.spinCount,n.objects=$c(t.objects===!1,`1`),n.scenarios=$c(t.scenarios===!1,`1`)),Object.values(n).some(e=>e!==void 0)&&e.leafNode(this.tag,n)}}parseOpen(e){switch(e.name){case this.tag:return this.model={sheet:el(e.attributes.sheet,`1`),objects:e.attributes.objects===`1`?!1:void 0,scenarios:e.attributes.scenarios===`1`?!1:void 0,selectLockedCells:e.attributes.selectLockedCells===`1`?!1:void 0,selectUnlockedCells:e.attributes.selectUnlockedCells===`1`?!1:void 0,formatCells:el(e.attributes.formatCells,`0`),formatColumns:el(e.attributes.formatColumns,`0`),formatRows:el(e.attributes.formatRows,`0`),insertColumns:el(e.attributes.insertColumns,`0`),insertRows:el(e.attributes.insertRows,`0`),insertHyperlinks:el(e.attributes.insertHyperlinks,`0`),deleteColumns:el(e.attributes.deleteColumns,`0`),deleteRows:el(e.attributes.deleteRows,`0`),sort:el(e.attributes.sort,`0`),autoFilter:el(e.attributes.autoFilter,`0`),pivotTables:el(e.attributes.pivotTables,`0`)},e.attributes.algorithmName&&(this.model.algorithmName=e.attributes.algorithmName,this.model.hashValue=e.attributes.hashValue,this.model.saltValue=e.attributes.saltValue,this.model.spinCount=parseInt(e.attributes.spinCount,10)),!0;default:return!1}}parseText(){}parseClose(){return!1}},nl=class extends ${get tag(){return`pageMargins`}render(e,t){if(t){let n={left:t.left,right:t.right,top:t.top,bottom:t.bottom,header:t.header,footer:t.footer};Object.values(n).some(e=>e!==void 0)&&e.leafNode(this.tag,n)}}parseOpen(e){switch(e.name){case this.tag:return this.model={left:parseFloat(e.attributes.left||.7),right:parseFloat(e.attributes.right||.7),top:parseFloat(e.attributes.top||.75),bottom:parseFloat(e.attributes.bottom||.75),header:parseFloat(e.attributes.header||.3),footer:parseFloat(e.attributes.footer||.3)},!0;default:return!1}}parseText(){}parseClose(){return!1}};function rl(e){return e?`1`:void 0}function il(e){switch(e){case`overThenDown`:return e;default:return}}function al(e){switch(e){case`atEnd`:case`asDisplyed`:return e;default:return}}function ol(e){switch(e){case`dash`:case`blank`:case`NA`:return e;default:return}}function sl(e){return e===void 0?void 0:parseInt(e,10)}var cl=class extends ${get tag(){return`pageSetup`}render(e,t){if(t){let n={paperSize:t.paperSize,orientation:t.orientation,horizontalDpi:t.horizontalDpi,verticalDpi:t.verticalDpi,pageOrder:il(t.pageOrder),blackAndWhite:rl(t.blackAndWhite),draft:rl(t.draft),cellComments:al(t.cellComments),errors:ol(t.errors),scale:t.scale,fitToWidth:t.fitToWidth,fitToHeight:t.fitToHeight,firstPageNumber:t.firstPageNumber,useFirstPageNumber:rl(!!t.firstPageNumber),usePrinterDefaults:rl(t.usePrinterDefaults),copies:t.copies};Object.values(n).some(e=>e!==void 0)&&e.leafNode(this.tag,n)}}parseOpen(e){switch(e.name){case this.tag:return this.model={paperSize:sl(e.attributes.paperSize),orientation:e.attributes.orientation||`portrait`,horizontalDpi:parseInt(e.attributes.horizontalDpi||`4294967295`,10),verticalDpi:parseInt(e.attributes.verticalDpi||`4294967295`,10),pageOrder:e.attributes.pageOrder||`downThenOver`,blackAndWhite:e.attributes.blackAndWhite===`1`,draft:e.attributes.draft===`1`,cellComments:e.attributes.cellComments||`None`,errors:e.attributes.errors||`displayed`,scale:parseInt(e.attributes.scale||`100`,10),fitToWidth:parseInt(e.attributes.fitToWidth||`1`,10),fitToHeight:parseInt(e.attributes.fitToHeight||`1`,10),firstPageNumber:parseInt(e.attributes.firstPageNumber||`1`,10),useFirstPageNumber:e.attributes.useFirstPageNumber===`1`,usePrinterDefaults:e.attributes.usePrinterDefaults===`1`,copies:parseInt(e.attributes.copies||`1`,10)},!0;default:return!1}}parseText(){}parseClose(){return!1}};function ll(e){return e?`1`:void 0}var ul=class extends ${get tag(){return`printOptions`}render(e,t){if(t){let n={headings:ll(t.showRowColHeaders),gridLines:ll(t.showGridLines),horizontalCentered:ll(t.horizontalCentered),verticalCentered:ll(t.verticalCentered)};Object.values(n).some(e=>e!==void 0)&&e.leafNode(this.tag,n)}}parseOpen(e){switch(e.name){case this.tag:return this.model={showRowColHeaders:e.attributes.headings===`1`,showGridLines:e.attributes.gridLines===`1`,horizontalCentered:e.attributes.horizontalCentered===`1`,verticalCentered:e.attributes.verticalCentered===`1`},!0;default:return!1}}parseText(){}parseClose(){return!1}},dl=class extends ${get tag(){return`autoFilter`}render(e,t){if(t)if(typeof t==`string`)e.leafNode(`autoFilter`,{ref:t});else{let n=function(e){return typeof e==`string`?e:m.getAddress(e.row,e.column).address},r=n(t.from),i=n(t.to);r&&i&&e.leafNode(`autoFilter`,{ref:`${r}:${i}`})}}parseOpen(e){e.name===`autoFilter`&&(this.model=e.attributes.ref)}},fl=class extends ${get tag(){return`picture`}render(e,t){t&&e.leafNode(this.tag,{"r:id":t.rId})}parseOpen(e){switch(e.name){case this.tag:return this.model={rId:e.attributes[`r:id`]},!0;default:return!1}}parseText(){}parseClose(){return!1}},pl=class extends ${get tag(){return`drawing`}render(e,t){t&&e.leafNode(this.tag,{"r:id":t.rId})}parseOpen(e){switch(e.name){case this.tag:return this.model={rId:e.attributes[`r:id`]},!0;default:return!1}}parseText(){}parseClose(){return!1}},ml=class extends ${get tag(){return`tablePart`}render(e,t){t&&e.leafNode(this.tag,{"r:id":t.rId})}parseOpen(e){switch(e.name){case this.tag:return this.model={rId:e.attributes[`r:id`]},!0;default:return!1}}parseText(){}parseClose(){return!1}},hl=class extends ${get tag(){return`brk`}render(e,t){e.leafNode(`brk`,t)}parseOpen(e){return e.name===`brk`?(this.model=e.attributes.ref,!0):!1}parseText(){}parseClose(){return!1}},gl=class extends Fs{constructor(){let e={tag:`rowBreaks`,count:!0,childXform:new hl};super(e)}render(e,t){if(t&&t.length){e.openNode(this.tag,this.$),this.count&&(e.addAttribute(this.$count,t.length),e.addAttribute(`manualBreakCount`,t.length));let{childXform:n}=this;t.forEach(t=>{n.render(e,t)}),e.closeNode()}else this.empty&&e.leafNode(this.tag)}},_l=class extends ${get tag(){return`headerFooter`}render(e,t){if(t){e.addRollback();let n=!1;e.openNode(`headerFooter`),t.differentFirst&&(e.addAttribute(`differentFirst`,`1`),n=!0),t.differentOddEven&&(e.addAttribute(`differentOddEven`,`1`),n=!0),t.oddHeader&&typeof t.oddHeader==`string`&&(e.leafNode(`oddHeader`,null,t.oddHeader),n=!0),t.oddFooter&&typeof t.oddFooter==`string`&&(e.leafNode(`oddFooter`,null,t.oddFooter),n=!0),t.evenHeader&&typeof t.evenHeader==`string`&&(e.leafNode(`evenHeader`,null,t.evenHeader),n=!0),t.evenFooter&&typeof t.evenFooter==`string`&&(e.leafNode(`evenFooter`,null,t.evenFooter),n=!0),t.firstHeader&&typeof t.firstHeader==`string`&&(e.leafNode(`firstHeader`,null,t.firstHeader),n=!0),t.firstFooter&&typeof t.firstFooter==`string`&&(e.leafNode(`firstFooter`,null,t.firstFooter),n=!0),n?(e.closeNode(),e.commit()):e.rollback()}}parseOpen(e){switch(e.name){case`headerFooter`:return this.model={},e.attributes.differentFirst&&(this.model.differentFirst=parseInt(e.attributes.differentFirst,0)===1),e.attributes.differentOddEven&&(this.model.differentOddEven=parseInt(e.attributes.differentOddEven,0)===1),!0;case`oddHeader`:return this.currentNode=`oddHeader`,!0;case`oddFooter`:return this.currentNode=`oddFooter`,!0;case`evenHeader`:return this.currentNode=`evenHeader`,!0;case`evenFooter`:return this.currentNode=`evenFooter`,!0;case`firstHeader`:return this.currentNode=`firstHeader`,!0;case`firstFooter`:return this.currentNode=`firstFooter`,!0;default:return!1}}parseText(e){switch(this.currentNode){case`oddHeader`:this.model.oddHeader=(this.model.oddHeader||``)+e;break;case`oddFooter`:this.model.oddFooter=(this.model.oddFooter||``)+e;break;case`evenHeader`:this.model.evenHeader=(this.model.evenHeader||``)+e;break;case`evenFooter`:this.model.evenFooter=(this.model.evenFooter||``)+e;break;case`firstHeader`:this.model.firstHeader=(this.model.firstHeader||``)+e;break;case`firstFooter`:this.model.firstFooter=(this.model.firstFooter||``)+e;break;default:break}}parseClose(){switch(this.currentNode){case`oddHeader`:case`oddFooter`:case`evenHeader`:case`evenFooter`:case`firstHeader`:case`firstFooter`:return this.currentNode=void 0,!0;default:return!1}}},vl=class extends ${createNewModel(e){return{}}parseOpen(e){return this.parser=this.parser||this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):e.name===this.tag?(this.model=this.createNewModel(e),!0):!1}parseText(e){this.parser&&this.parser.parseText(e)}onParserClose(e,t){this.model[e]=t.model}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.onParserClose(e,this.parser),this.parser=void 0),!0):e!==this.tag}get tag(){return``}},yl=class extends ${get tag(){return`cfvo`}render(e,t){e.leafNode(this.tag,{type:t.type,val:t.value})}parseOpen(e){this.model={type:e.attributes.type,value:$.toFloatValue(e.attributes.val)}}parseClose(e){return e!==this.tag}},bl=class extends vl{constructor(){super(),this.map={cfvo:this.cfvoXform=new yl,color:this.colorXform=new Is}}get tag(){return`dataBar`}render(e,t){e.openNode(this.tag),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),this.colorXform.render(e,t.color),e.closeNode()}createNewModel(){return{cfvo:[]}}onParserClose(e,t){switch(e){case`cfvo`:this.model.cfvo.push(t.model);break;case`color`:this.model.color=t.model;break}}},xl=class extends ${get tag(){return`x14:id`}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=``}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}},Sl=class extends vl{constructor(){super(),this.map={"x14:id":this.idXform=new xl}}get tag(){return`ext`}render(e,t){e.openNode(this.tag,{uri:`{B025F937-C7B1-47D3-B67F-A62EFF666E3E}`,"xmlns:x14":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/main`}),this.idXform.render(e,t.x14Id),e.closeNode()}createNewModel(){return{}}onParserClose(e,t){this.model.x14Id=t.model}},Cl=class extends vl{constructor(){super(),this.map={ext:new Sl}}get tag(){return`extLst`}render(e,t){e.openNode(this.tag),this.map.ext.render(e,t),e.closeNode()}createNewModel(){return{}}onParserClose(e,t){Object.assign(this.model,t.model)}},wl=class extends ${get tag(){return`formula`}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=``}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}},Tl=class extends vl{constructor(){super(),this.map={cfvo:this.cfvoXform=new yl,color:this.colorXform=new Is}}get tag(){return`colorScale`}render(e,t){e.openNode(this.tag),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),t.color.forEach(t=>{this.colorXform.render(e,t)}),e.closeNode()}createNewModel(e){return{cfvo:[],color:[]}}onParserClose(e,t){this.model[e].push(t.model)}},El=class extends vl{constructor(){super(),this.map={cfvo:this.cfvoXform=new yl}}get tag(){return`iconSet`}render(e,t){e.openNode(this.tag,{iconSet:$.toStringAttribute(t.iconSet,`3TrafficLights`),reverse:$.toBoolAttribute(t.reverse,!1),showValue:$.toBoolAttribute(t.showValue,!0)}),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),e.closeNode()}createNewModel({attributes:e}){return{iconSet:$.toStringValue(e.iconSet,`3TrafficLights`),reverse:$.toBoolValue(e.reverse),showValue:$.toBoolValue(e.showValue),cfvo:[]}}onParserClose(e,t){this.model[e].push(t.model)}};let Dl={"3Triangles":!0,"3Stars":!0,"5Boxes":!0},Ol=e=>{if(e.formulae&&e.formulae[0])return e.formulae[0];let{tl:t}=new h(e.ref);switch(e.operator){case`containsText`:return`NOT(ISERROR(SEARCH("${e.text}",${t})))`;case`containsBlanks`:return`LEN(TRIM(${t}))=0`;case`notContainsBlanks`:return`LEN(TRIM(${t}))>0`;case`containsErrors`:return`ISERROR(${t})`;case`notContainsErrors`:return`NOT(ISERROR(${t}))`;default:return}},kl=e=>{if(e.formulae&&e.formulae[0])return e.formulae[0];let{tl:t}=new h(e.ref);switch(e.timePeriod){case`thisWeek`:return`AND(TODAY()-ROUNDDOWN(${t},0)<=WEEKDAY(TODAY())-1,ROUNDDOWN(${t},0)-TODAY()<=7-WEEKDAY(TODAY()))`;case`lastWeek`:return`AND(TODAY()-ROUNDDOWN(${t},0)>=(WEEKDAY(TODAY())),TODAY()-ROUNDDOWN(${t},0)<(WEEKDAY(TODAY())+7))`;case`nextWeek`:return`AND(ROUNDDOWN(${t},0)-TODAY()>(7-WEEKDAY(TODAY())),ROUNDDOWN(${t},0)-TODAY()<(15-WEEKDAY(TODAY())))`;case`yesterday`:return`FLOOR(${t},1)=TODAY()-1`;case`today`:return`FLOOR(${t},1)=TODAY()`;case`tomorrow`:return`FLOOR(${t},1)=TODAY()+1`;case`last7Days`:return`AND(TODAY()-FLOOR(${t},1)<=6,FLOOR(${t},1)<=TODAY())`;case`lastMonth`:return`AND(MONTH(${t})=MONTH(EDATE(TODAY(),0-1)),YEAR(${t})=YEAR(EDATE(TODAY(),0-1)))`;case`thisMonth`:return`AND(MONTH(${t})=MONTH(TODAY()),YEAR(${t})=YEAR(TODAY()))`;case`nextMonth`:return`AND(MONTH(${t})=MONTH(EDATE(TODAY(),0+1)),YEAR(${t})=YEAR(EDATE(TODAY(),0+1)))`;default:return}},Al=e=>{let{type:t,operator:n}=e;switch(t){case`containsText`:case`containsBlanks`:case`notContainsBlanks`:case`containsErrors`:case`notContainsErrors`:return{type:`containsText`,operator:t};default:return{type:t,operator:n}}};var jl=class e extends vl{constructor(){super(),this.map={dataBar:this.databarXform=new bl,extLst:this.extLstRefXform=new Cl,formula:this.formulaXform=new wl,colorScale:this.colorScaleXform=new Tl,iconSet:this.iconSetXform=new El}}get tag(){return`cfRule`}static isPrimitive(e){return!(e.type===`iconSet`&&(e.custom||Dl[e.iconSet]))}render(e,t){switch(t.type){case`expression`:this.renderExpression(e,t);break;case`cellIs`:this.renderCellIs(e,t);break;case`top10`:this.renderTop10(e,t);break;case`aboveAverage`:this.renderAboveAverage(e,t);break;case`dataBar`:this.renderDataBar(e,t);break;case`colorScale`:this.renderColorScale(e,t);break;case`iconSet`:this.renderIconSet(e,t);break;case`containsText`:this.renderText(e,t);break;case`timePeriod`:this.renderTimePeriod(e,t);break}}renderExpression(e,t){e.openNode(this.tag,{type:`expression`,dxfId:t.dxfId,priority:t.priority}),this.formulaXform.render(e,t.formulae[0]),e.closeNode()}renderCellIs(e,t){e.openNode(this.tag,{type:`cellIs`,dxfId:t.dxfId,priority:t.priority,operator:t.operator}),t.formulae.forEach(t=>{this.formulaXform.render(e,t)}),e.closeNode()}renderTop10(e,t){e.leafNode(this.tag,{type:`top10`,dxfId:t.dxfId,priority:t.priority,percent:$.toBoolAttribute(t.percent,!1),bottom:$.toBoolAttribute(t.bottom,!1),rank:$.toIntValue(t.rank,10)})}renderAboveAverage(e,t){e.leafNode(this.tag,{type:`aboveAverage`,dxfId:t.dxfId,priority:t.priority,aboveAverage:$.toBoolAttribute(t.aboveAverage,!0)})}renderDataBar(e,t){e.openNode(this.tag,{type:`dataBar`,priority:t.priority}),this.databarXform.render(e,t),this.extLstRefXform.render(e,t),e.closeNode()}renderColorScale(e,t){e.openNode(this.tag,{type:`colorScale`,priority:t.priority}),this.colorScaleXform.render(e,t),e.closeNode()}renderIconSet(t,n){e.isPrimitive(n)&&(t.openNode(this.tag,{type:`iconSet`,priority:n.priority}),this.iconSetXform.render(t,n),t.closeNode())}renderText(e,t){e.openNode(this.tag,{type:t.operator,dxfId:t.dxfId,priority:t.priority,operator:$.toStringAttribute(t.operator,`containsText`)});let n=Ol(t);n&&this.formulaXform.render(e,n),e.closeNode()}renderTimePeriod(e,t){e.openNode(this.tag,{type:`timePeriod`,dxfId:t.dxfId,priority:t.priority,timePeriod:t.timePeriod});let n=kl(t);n&&this.formulaXform.render(e,n),e.closeNode()}createNewModel({attributes:e}){return{...Al(e),dxfId:$.toIntValue(e.dxfId),priority:$.toIntValue(e.priority),timePeriod:e.timePeriod,percent:$.toBoolValue(e.percent),bottom:$.toBoolValue(e.bottom),rank:$.toIntValue(e.rank),aboveAverage:$.toBoolValue(e.aboveAverage)}}onParserClose(e,t){switch(e){case`dataBar`:case`extLst`:case`colorScale`:case`iconSet`:Object.assign(this.model,t.model);break;case`formula`:this.model.formulae=this.model.formulae||[],this.model.formulae.push(t.model);break}}},Ml=class extends vl{constructor(){super(),this.map={cfRule:new jl}}get tag(){return`conditionalFormatting`}render(e,t){t.rules.some(jl.isPrimitive)&&(e.openNode(this.tag,{sqref:t.ref}),t.rules.forEach(n=>{jl.isPrimitive(n)&&(n.ref=t.ref,this.map.cfRule.render(e,n))}),e.closeNode())}createNewModel({attributes:e}){return{ref:e.sqref,rules:[]}}onParserClose(e,t){this.model.rules.push(t.model)}},Nl=class extends ${constructor(){super(),this.cfXform=new Ml}get tag(){return`conditionalFormatting`}reset(){this.model=[]}prepare(e,t){let n=e.reduce((e,t)=>Math.max(e,...t.rules.map(e=>e.priority||0)),1);e.forEach(e=>{e.rules.forEach(e=>{e.priority||=n++,e.style&&(e.dxfId=t.styles.addDxfStyle(e.style))})})}render(e,t){t.forEach(t=>{this.cfXform.render(e,t)})}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`conditionalFormatting`:return this.parser=this.cfXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?this.parser.parseClose(e)?!0:(this.model.push(this.parser.model),this.parser=void 0,!1):!1}reconcile(e,t){e.forEach(e=>{e.rules.forEach(e=>{e.dxfId!==void 0&&(e.style=t.styles.getDxfStyle(e.dxfId),delete e.dxfId)})})}};let Pl=[];for(let e=0;e<256;++e)Pl.push((e+256).toString(16).slice(1));function Fl(e,t=0){return(Pl[e[t+0]]+Pl[e[t+1]]+Pl[e[t+2]]+Pl[e[t+3]]+`-`+Pl[e[t+4]]+Pl[e[t+5]]+`-`+Pl[e[t+6]]+Pl[e[t+7]]+`-`+Pl[e[t+8]]+Pl[e[t+9]]+`-`+Pl[e[t+10]]+Pl[e[t+11]]+Pl[e[t+12]]+Pl[e[t+13]]+Pl[e[t+14]]+Pl[e[t+15]]).toLowerCase()}let Il,Ll=new Uint8Array(16);function Rl(){if(!Il){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);Il=crypto.getRandomValues.bind(crypto)}return Il(Ll)}var zl={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Bl(e,t,n){e||={};let r=e.random??e.rng?.()??Rl();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return Fl(r)}function Vl(e,t,n){return zl.randomUUID&&!t&&!e?zl.randomUUID():Bl(e,t,n)}var Hl=Vl,Ul=class extends ${get tag(){return`xm:f`}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=``}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}},Wl=class extends vl{constructor(){super(),this.map={"xm:f":this.fExtXform=new Ul}}get tag(){return`x14:cfvo`}render(e,t){e.openNode(this.tag,{type:t.type}),t.value!==void 0&&this.fExtXform.render(e,t.value),e.closeNode()}createNewModel(e){return{type:e.attributes.type}}onParserClose(e,t){switch(e){case`xm:f`:this.model.value=t.model?parseFloat(t.model):0;break}}},Gl=class extends vl{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new Wl,"x14:borderColor":this.borderColorXform=new Is(`x14:borderColor`),"x14:negativeBorderColor":this.negativeBorderColorXform=new Is(`x14:negativeBorderColor`),"x14:negativeFillColor":this.negativeFillColorXform=new Is(`x14:negativeFillColor`),"x14:axisColor":this.axisColorXform=new Is(`x14:axisColor`)}}static isExt(e){return!e.gradient}get tag(){return`x14:dataBar`}render(e,t){e.openNode(this.tag,{minLength:$.toIntAttribute(t.minLength,0,!0),maxLength:$.toIntAttribute(t.maxLength,100,!0),border:$.toBoolAttribute(t.border,!1),gradient:$.toBoolAttribute(t.gradient,!0),negativeBarColorSameAsPositive:$.toBoolAttribute(t.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:$.toBoolAttribute(t.negativeBarBorderColorSameAsPositive,!0),axisPosition:$.toAttribute(t.axisPosition,`auto`),direction:$.toAttribute(t.direction,`leftToRight`)}),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),this.borderColorXform.render(e,t.borderColor),this.negativeBorderColorXform.render(e,t.negativeBorderColor),this.negativeFillColorXform.render(e,t.negativeFillColor),this.axisColorXform.render(e,t.axisColor),e.closeNode()}createNewModel({attributes:e}){return{cfvo:[],minLength:$.toIntValue(e.minLength,0),maxLength:$.toIntValue(e.maxLength,100),border:$.toBoolValue(e.border,!1),gradient:$.toBoolValue(e.gradient,!0),negativeBarColorSameAsPositive:$.toBoolValue(e.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:$.toBoolValue(e.negativeBarBorderColorSameAsPositive,!0),axisPosition:$.toStringValue(e.axisPosition,`auto`),direction:$.toStringValue(e.direction,`leftToRight`)}}onParserClose(e,t){let[,n]=e.split(`:`);switch(n){case`cfvo`:this.model.cfvo.push(t.model);break;default:this.model[n]=t.model;break}}},Kl=class extends ${get tag(){return`x14:cfIcon`}render(e,t){e.leafNode(this.tag,{iconSet:t.iconSet,iconId:t.iconId})}parseOpen({attributes:e}){this.model={iconSet:e.iconSet,iconId:$.toIntValue(e.iconId)}}parseClose(e){return e!==this.tag}},ql=class extends vl{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new Wl,"x14:cfIcon":this.cfIconXform=new Kl}}get tag(){return`x14:iconSet`}render(e,t){e.openNode(this.tag,{iconSet:$.toStringAttribute(t.iconSet),reverse:$.toBoolAttribute(t.reverse,!1),showValue:$.toBoolAttribute(t.showValue,!0),custom:$.toBoolAttribute(t.icons,!1)}),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),t.icons&&t.icons.forEach((t,n)=>{t.iconId=n,this.cfIconXform.render(e,t)}),e.closeNode()}createNewModel({attributes:e}){return{cfvo:[],iconSet:$.toStringValue(e.iconSet,`3TrafficLights`),reverse:$.toBoolValue(e.reverse,!1),showValue:$.toBoolValue(e.showValue,!0)}}onParserClose(e,t){let[,n]=e.split(`:`);switch(n){case`cfvo`:this.model.cfvo.push(t.model);break;case`cfIcon`:this.model.icons||(this.model.icons=[]),this.model.icons.push(t.model);break;default:this.model[n]=t.model;break}}};let Jl={"3Triangles":!0,"3Stars":!0,"5Boxes":!0};var Yl=class e extends vl{constructor(){super(),this.map={"x14:dataBar":this.databarXform=new Gl,"x14:iconSet":this.iconSetXform=new ql}}get tag(){return`x14:cfRule`}static isExt(e){return e.type===`dataBar`?Gl.isExt(e):!!(e.type===`iconSet`&&(e.custom||Jl[e.iconSet]))}prepare(t){e.isExt(t)&&(t.x14Id=`{${Hl()}}`.toUpperCase())}render(t,n){if(e.isExt(n))switch(n.type){case`dataBar`:this.renderDataBar(t,n);break;case`iconSet`:this.renderIconSet(t,n);break}}renderDataBar(e,t){e.openNode(this.tag,{type:`dataBar`,id:t.x14Id}),this.databarXform.render(e,t),e.closeNode()}renderIconSet(e,t){e.openNode(this.tag,{type:`iconSet`,priority:t.priority,id:t.x14Id||`{${Hl()}}`}),this.iconSetXform.render(e,t),e.closeNode()}createNewModel({attributes:e}){return{type:e.type,x14Id:e.id,priority:$.toIntValue(e.priority)}}onParserClose(e,t){Object.assign(this.model,t.model)}},Xl=class extends ${get tag(){return`xm:sqref`}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=``}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}},Zl=class extends vl{constructor(){super(),this.map={"xm:sqref":this.sqRef=new Xl,"x14:cfRule":this.cfRule=new Yl}}get tag(){return`x14:conditionalFormatting`}prepare(e){e.rules.forEach(e=>{this.cfRule.prepare(e)})}render(e,t){t.rules.some(Yl.isExt)&&(e.openNode(this.tag,{"xmlns:xm":`http://schemas.microsoft.com/office/excel/2006/main`}),t.rules.filter(Yl.isExt).forEach(t=>this.cfRule.render(e,t)),this.sqRef.render(e,t.ref),e.closeNode())}createNewModel(){return{rules:[]}}onParserClose(e,t){switch(e){case`xm:sqref`:this.model.ref=t.model;break;case`x14:cfRule`:this.model.rules.push(t.model);break}}},Ql=class extends vl{constructor(){super(),this.map={"x14:conditionalFormatting":this.cfXform=new Zl}}get tag(){return`x14:conditionalFormattings`}hasContent(e){return e.hasExtContent===void 0&&(e.hasExtContent=e.some(e=>e.rules.some(Yl.isExt))),e.hasExtContent}prepare(e){e.forEach(e=>{this.cfXform.prepare(e)})}render(e,t){this.hasContent(t)&&(e.openNode(this.tag),t.forEach(t=>this.cfXform.render(e,t)),e.closeNode())}createNewModel(){return[]}onParserClose(e,t){this.model.push(t.model)}},$l=class extends vl{constructor(){super(),this.map={"x14:conditionalFormattings":this.conditionalFormattings=new Ql}}get tag(){return`ext`}hasContent(e){return this.conditionalFormattings.hasContent(e.conditionalFormattings)}prepare(e){this.conditionalFormattings.prepare(e.conditionalFormattings)}render(e,t){e.openNode(`ext`,{uri:`{78C0D931-6437-407d-A8EE-F0AAD7539E65}`,"xmlns:x14":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/main`}),this.conditionalFormattings.render(e,t.conditionalFormattings),e.closeNode()}createNewModel(){return{}}onParserClose(e,t){this.model[e]=t.model}},eu=class extends vl{constructor(){super(),this.map={ext:this.ext=new $l}}get tag(){return`extLst`}prepare(e,t){this.ext.prepare(e)}hasContent(e){return this.ext.hasContent(e)}render(e,t){this.hasContent(t)&&(e.openNode(`extLst`),this.ext.render(e,t),e.closeNode())}createNewModel(){return{}}onParserClose(e,t){this.model[e]=t.model}};let tu=(e,t)=>{Object.keys(t).forEach(n=>{let r=e[n],i=t[n];r===void 0&&i!==void 0&&(e[n]=i)})},nu=(e,t)=>{if(!t||!t.length)return e;if(!e||!e.length)return t;let n={},r={};return e.forEach(e=>{n[e.ref]=e,e.rules.forEach(e=>{let{x14Id:t}=e;t&&(r[t]=e)})}),t.forEach(t=>{t.rules.forEach(i=>{let a=r[i.x14Id];a?tu(a,i):n[t.ref]?n[t.ref].rules.push(i):e.push({ref:t.ref,rules:[i]})})}),e};var ru=class e extends ${static{this.WORKSHEET_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`x14ac`,"xmlns:x14ac":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac`}}constructor(e){super();let{maxRows:t,maxCols:n,ignoreNodes:r}=e||{};this.ignoreNodes=r||[],this.map={sheetPr:new Yc,dimension:new zc,sheetViews:new Fs({tag:`sheetViews`,count:!1,childXform:new Qc}),sheetFormatPr:new Xc,cols:new Fs({tag:`cols`,count:!1,childXform:new Rc}),sheetData:new Fs({tag:`sheetData`,count:!1,empty:!0,childXform:new Lc({maxItems:n}),maxItems:t}),autoFilter:new dl,mergeCells:new Fs({tag:`mergeCells`,count:!0,childXform:new Vc}),rowBreaks:new gl,hyperlinks:new Fs({tag:`hyperlinks`,count:!1,childXform:new Bc}),pageMargins:new nl,dataValidations:new Gc,pageSetup:new cl,headerFooter:new _l,printOptions:new ul,picture:new fl,drawing:new pl,sheetProtection:new tl,tableParts:new Fs({tag:`tableParts`,count:!0,childXform:new ml}),conditionalFormatting:new Nl,extLst:new eu}}prepare(e,t){t.merges=new Nc,e.hyperlinks=t.hyperlinks=[],e.comments=t.comments=[],t.formulae={},t.siFormulae=0,this.map.cols.prepare(e.cols,t),this.map.sheetData.prepare(e.rows,t),this.map.conditionalFormatting.prepare(e.conditionalFormattings,t),e.mergeCells=t.merges.mergeCells;let n=e.rels=[];function r(e){return`rId${e.length+1}`}if(e.hyperlinks.forEach(e=>{let t=r(n);e.rId=t,n.push({Id:t,Type:Mc.Hyperlink,Target:e.target,TargetMode:`External`})}),e.comments.length>0){let i={Id:r(n),Type:Mc.Comments,Target:`../comments${e.id}.xml`};n.push(i);let a={Id:r(n),Type:Mc.VmlDrawing,Target:`../drawings/vmlDrawing${e.id}.vml`};n.push(a),e.comments.forEach(e=>{e.refAddress=m.decodeAddress(e.ref)}),t.commentRefs.push({commentName:`comments${e.id}`,vmlDrawing:`vmlDrawing${e.id}`})}let i=[],a;e.media.forEach(o=>{if(o.type===`background`){let i=r(n);a=t.media[o.imageId],n.push({Id:i,Type:Mc.Image,Target:`../media/${a.name}.${a.extension}`}),e.background={rId:i},e.image=t.media[o.imageId]}else if(o.type===`image`){let{drawing:s}=e;a=t.media[o.imageId],s||(s=e.drawing={rId:r(n),name:`drawing${++t.drawingsCount}`,anchors:[],rels:[]},t.drawings.push(s),n.push({Id:s.rId,Type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing`,Target:`../drawings/${s.name}.xml`}));let c=this.preImageId===o.imageId?i[o.imageId]:i[s.rels.length];c||(c=r(s.rels),i[s.rels.length]=c,s.rels.push({Id:c,Type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/image`,Target:`../media/${a.name}.${a.extension}`}));let l={picture:{rId:c},range:o.range};if(o.hyperlinks&&o.hyperlinks.hyperlink){let e=r(s.rels);i[s.rels.length]=e,l.picture.hyperlinks={tooltip:o.hyperlinks.tooltip,rId:e},s.rels.push({Id:e,Type:Mc.Hyperlink,Target:o.hyperlinks.hyperlink,TargetMode:`External`})}this.preImageId=o.imageId,s.anchors.push(l)}}),e.tables.forEach(e=>{let i=r(n);e.rId=i,n.push({Id:i,Type:Mc.Table,Target:`../tables/${e.target}`}),e.columns.forEach(e=>{let{style:n}=e;n&&(e.dxfId=t.styles.addDxfStyle(n))})}),(e.pivotTables||[]).length&&n.push({Id:r(n),Type:Mc.PivotTable,Target:`../pivotTables/pivotTable1.xml`}),this.map.extLst.prepare(e,t)}render(t,n){t.openXml(Ds.StdDocAttributes),t.openNode(`worksheet`,e.WORKSHEET_ATTRIBUTES);let r=n.properties?{defaultRowHeight:n.properties.defaultRowHeight,dyDescent:n.properties.dyDescent,outlineLevelCol:n.properties.outlineLevelCol,outlineLevelRow:n.properties.outlineLevelRow}:void 0;n.properties&&n.properties.defaultColWidth&&(r.defaultColWidth=n.properties.defaultColWidth);let i={outlineProperties:n.properties&&n.properties.outlineProperties,tabColor:n.properties&&n.properties.tabColor,pageSetup:n.pageSetup&&n.pageSetup.fitToPage?{fitToPage:n.pageSetup.fitToPage}:void 0},a=n.pageSetup&&n.pageSetup.margins,o={showRowColHeaders:n.pageSetup&&n.pageSetup.showRowColHeaders,showGridLines:n.pageSetup&&n.pageSetup.showGridLines,horizontalCentered:n.pageSetup&&n.pageSetup.horizontalCentered,verticalCentered:n.pageSetup&&n.pageSetup.verticalCentered},s=n.sheetProtection;this.map.sheetPr.render(t,i),this.map.dimension.render(t,n.dimensions),this.map.sheetViews.render(t,n.views),this.map.sheetFormatPr.render(t,r),this.map.cols.render(t,n.cols),this.map.sheetData.render(t,n.rows),this.map.sheetProtection.render(t,s),this.map.autoFilter.render(t,n.autoFilter),this.map.mergeCells.render(t,n.mergeCells),this.map.conditionalFormatting.render(t,n.conditionalFormattings),this.map.dataValidations.render(t,n.dataValidations),this.map.hyperlinks.render(t,n.hyperlinks),this.map.printOptions.render(t,o),this.map.pageMargins.render(t,a),this.map.pageSetup.render(t,n.pageSetup),this.map.headerFooter.render(t,n.headerFooter),this.map.rowBreaks.render(t,n.rowBreaks),this.map.drawing.render(t,n.drawing),this.map.picture.render(t,n.background),this.map.tableParts.render(t,n.tables),this.map.extLst.render(t,n),n.rels&&n.rels.forEach(e=>{e.Type===Mc.VmlDrawing&&t.leafNode(`legacyDrawing`,{"r:id":e.Id})}),t.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):e.name===`worksheet`?(Object.values(this.map).forEach(e=>{e.reset()}),!0):(this.map[e.name]&&!this.ignoreNodes.includes(e.name)&&(this.parser=this.map[e.name],this.parser.parseOpen(e)),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`worksheet`:{let e=this.map.sheetFormatPr.model||{};this.map.sheetPr.model&&this.map.sheetPr.model.tabColor&&(e.tabColor=this.map.sheetPr.model.tabColor),this.map.sheetPr.model&&this.map.sheetPr.model.outlineProperties&&(e.outlineProperties=this.map.sheetPr.model.outlineProperties);let t={fitToPage:this.map.sheetPr.model&&this.map.sheetPr.model.pageSetup&&this.map.sheetPr.model.pageSetup.fitToPage||!1,margins:this.map.pageMargins.model},n=Object.assign(t,this.map.pageSetup.model,this.map.printOptions.model),r=nu(this.map.conditionalFormatting.model,this.map.extLst.model&&this.map.extLst.model[`x14:conditionalFormattings`]);return this.model={dimensions:this.map.dimension.model,cols:this.map.cols.model,rows:this.map.sheetData.model,mergeCells:this.map.mergeCells.model,hyperlinks:this.map.hyperlinks.model,dataValidations:this.map.dataValidations.model,properties:e,views:this.map.sheetViews.model,pageSetup:n,headerFooter:this.map.headerFooter.model,background:this.map.picture.model,drawing:this.map.drawing.model,tables:this.map.tableParts.model,conditionalFormattings:r},this.map.autoFilter.model&&(this.model.autoFilter=this.map.autoFilter.model),this.map.sheetProtection.model&&(this.model.sheetProtection=this.map.sheetProtection.model),!1}default:return!0}}reconcile(e,t){let n=(e.relationships||[]).reduce((n,r)=>{if(n[r.Id]=r,r.Type===Mc.Comments&&(e.comments=t.comments[r.Target].comments),r.Type===Mc.VmlDrawing&&e.comments&&e.comments.length){let n=t.vmlDrawings[r.Target].comments;e.comments.forEach((e,t)=>{e.note=Object.assign({},e.note,n[t])})}return n},{});if(t.commentsMap=(e.comments||[]).reduce((e,t)=>(t.ref&&(e[t.ref]=t),e),{}),t.hyperlinkMap=(e.hyperlinks||[]).reduce((e,t)=>(t.rId&&(e[t.address]=n[t.rId].Target),e),{}),t.formulae={},e.rows=e.rows&&e.rows.filter(Boolean)||[],e.rows.forEach(e=>{e.cells=e.cells&&e.cells.filter(Boolean)||[]}),this.map.cols.reconcile(e.cols,t),this.map.sheetData.reconcile(e.rows,t),this.map.conditionalFormatting.reconcile(e.conditionalFormattings,t),e.media=[],e.drawing){let r=n[e.drawing.rId].Target.match(/\/drawings\/([a-zA-Z0-9]+)[.][a-zA-Z]{3,4}$/);if(r){let n=r[1];t.drawings[n].anchors.forEach(t=>{if(t.medium){let n={type:`image`,imageId:t.medium.index,range:t.range,hyperlinks:t.picture.hyperlinks};e.media.push(n)}})}}let r=e.background&&n[e.background.rId];if(r){let n=r.Target.split(`/media/`)[1],i=t.mediaIndex&&t.mediaIndex[n];i!==void 0&&e.media.push({type:`background`,imageId:i})}e.tables=(e.tables||[]).map(e=>{let r=n[e.rId];return t.tables[r.Target]}),delete e.relationships,delete e.hyperlinks,delete e.comments}},iu=class extends ${parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={range:{editAs:e.attributes.editAs||`oneCell`}};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}reconcilePicture(e,t){if(e&&e.rId){let n=t.rels[e.rId].Target.match(/.*\/media\/(.+[.][a-zA-Z]{3,4})/);if(n){let e=n[1],r=t.mediaIndex[e];return t.media[r]}}}},au=class extends ${constructor(e){super(),this.tag=e.tag,this.map={"xdr:col":new Rs({tag:`xdr:col`,zero:!0}),"xdr:colOff":new Rs({tag:`xdr:colOff`,zero:!0}),"xdr:row":new Rs({tag:`xdr:row`,zero:!0}),"xdr:rowOff":new Rs({tag:`xdr:rowOff`,zero:!0})},this.model={nativeCol:0,nativeColOff:0,nativeRow:0,nativeRowOff:0}}render(e,t){e.openNode(this.tag),this.map[`xdr:col`].render(e,t.nativeCol),this.map[`xdr:colOff`].render(e,t.nativeColOff),this.map[`xdr:row`].render(e,t.nativeRow),this.map[`xdr:rowOff`].render(e,t.nativeRowOff),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model={nativeCol:this.map[`xdr:col`].model,nativeColOff:this.map[`xdr:colOff`].model,nativeRow:this.map[`xdr:row`].model,nativeRowOff:this.map[`xdr:rowOff`].model},!1;default:return!0}}},ou=class extends ${constructor(){super(),this.model={rId:``}}get tag(){return`a:blip`}render(e,t){e.leafNode(this.tag,{"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"r:embed":t.rId,cstate:`print`})}parseOpen(e){switch(e.name){case this.tag:return this.model={rId:e.attributes[`r:embed`]},!0;default:return!0}}parseText(){}parseClose(e){switch(e){case this.tag:return!1;default:return!0}}},su=class extends ${constructor(){super(),this.map={"a:blip":new ou}}get tag(){return`xdr:blipFill`}render(e,t){e.openNode(this.tag),this.map[`a:blip`].render(e,t),e.openNode(`a:stretch`),e.leafNode(`a:fillRect`),e.closeNode(),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model=this.map[`a:blip`].model,!1;default:return!0}}},cu=class extends ${constructor(){super(),this.model={}}get tag(){return`a:hlinkClick`}render(e,t){t.hyperlinks&&t.hyperlinks.rId&&e.leafNode(this.tag,{"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"r:id":t.hyperlinks.rId,tooltip:t.hyperlinks.tooltip})}parseOpen(e){switch(e.name){case this.tag:return this.model={hyperlinks:{rId:e.attributes[`r:id`],tooltip:e.attributes.tooltip}},!0;default:return!0}}parseText(){}parseClose(){return!1}},lu=class extends ${get tag(){return`a:extLst`}render(e){e.openNode(this.tag),e.openNode(`a:ext`,{uri:`{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}`}),e.leafNode(`a16:creationId`,{"xmlns:a16":`http://schemas.microsoft.com/office/drawing/2014/main`,id:`{00000000-0008-0000-0000-000002000000}`}),e.closeNode(),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:return!0;default:return!0}}parseText(){}parseClose(e){switch(e){case this.tag:return!1;default:return!0}}},uu=class extends ${constructor(){super(),this.map={"a:hlinkClick":new cu,"a:extLst":new lu}}get tag(){return`xdr:cNvPr`}render(e,t){e.openNode(this.tag,{id:t.index,name:`Picture ${t.index}`}),this.map[`a:hlinkClick`].render(e,t),this.map[`a:extLst`].render(e,t),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model=this.map[`a:hlinkClick`].model,!1;default:return!0}}},du=class extends ${get tag(){return`xdr:cNvPicPr`}render(e){e.openNode(this.tag),e.leafNode(`a:picLocks`,{noChangeAspect:`1`}),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:return!0;default:return!0}}parseText(){}parseClose(e){switch(e){case this.tag:return!1;default:return!0}}},fu=class extends ${constructor(){super(),this.map={"xdr:cNvPr":new uu,"xdr:cNvPicPr":new du}}get tag(){return`xdr:nvPicPr`}render(e,t){e.openNode(this.tag),this.map[`xdr:cNvPr`].render(e,t),this.map[`xdr:cNvPicPr`].render(e,t),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model=this.map[`xdr:cNvPr`].model,!1;default:return!0}}};let pu={tag:`xdr:spPr`,c:[{tag:`a:xfrm`,c:[{tag:`a:off`,$:{x:`0`,y:`0`}},{tag:`a:ext`,$:{cx:`0`,cy:`0`}}]},{tag:`a:prstGeom`,$:{prst:`rect`},c:[{tag:`a:avLst`}]}]};var mu=class extends ${constructor(){super(),this.map={"xdr:nvPicPr":new fu,"xdr:blipFill":new su,"xdr:spPr":new Ps(pu)}}get tag(){return`xdr:pic`}prepare(e,t){e.index=t.index+1}render(e,t){e.openNode(this.tag),this.map[`xdr:nvPicPr`].render(e,t),this.map[`xdr:blipFill`].render(e,t),this.map[`xdr:spPr`].render(e,t),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.mergeModel(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:return!0}}},hu=class extends iu{constructor(){super(),this.map={"xdr:from":new au({tag:`xdr:from`}),"xdr:to":new au({tag:`xdr:to`}),"xdr:pic":new mu,"xdr:clientData":new Ps({tag:`xdr:clientData`})}}get tag(){return`xdr:twoCellAnchor`}prepare(e,t){this.map[`xdr:pic`].prepare(e.picture,t)}render(e,t){e.openNode(this.tag,{editAs:t.range.editAs||`oneCell`}),this.map[`xdr:from`].render(e,t.range.tl),this.map[`xdr:to`].render(e,t.range.br),this.map[`xdr:pic`].render(e,t.picture),this.map[`xdr:clientData`].render(e,{}),e.closeNode()}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.range.tl=this.map[`xdr:from`].model,this.model.range.br=this.map[`xdr:to`].model,this.model.picture=this.map[`xdr:pic`].model,!1;default:return!0}}reconcile(e,t){e.medium=this.reconcilePicture(e.picture,t)}};let gu=9525;var _u=class extends ${constructor(e){super(),this.tag=e.tag,this.map={},this.model={width:0,height:0}}render(e,t){e.openNode(this.tag);let n=Math.floor(t.width*gu),r=Math.floor(t.height*gu);e.addAttribute(`cx`,n),e.addAttribute(`cy`,r),e.closeNode()}parseOpen(e){return e.name===this.tag?(this.model={width:parseInt(e.attributes.cx||`0`,10)/gu,height:parseInt(e.attributes.cy||`0`,10)/gu},!0):!1}parseText(e){}parseClose(e){return!1}},vu=class extends iu{constructor(){super(),this.map={"xdr:from":new au({tag:`xdr:from`}),"xdr:ext":new _u({tag:`xdr:ext`}),"xdr:pic":new mu,"xdr:clientData":new Ps({tag:`xdr:clientData`})}}get tag(){return`xdr:oneCellAnchor`}prepare(e,t){this.map[`xdr:pic`].prepare(e.picture,t)}render(e,t){e.openNode(this.tag,{editAs:t.range.editAs||`oneCell`}),this.map[`xdr:from`].render(e,t.range.tl),this.map[`xdr:ext`].render(e,t.range.ext),this.map[`xdr:pic`].render(e,t.picture),this.map[`xdr:clientData`].render(e,{}),e.closeNode()}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.range.tl=this.map[`xdr:from`].model,this.model.range.ext=this.map[`xdr:ext`].model,this.model.picture=this.map[`xdr:pic`].model,!1;default:return!0}}reconcile(e,t){e.medium=this.reconcilePicture(e.picture,t)}};function yu(e){return(typeof e.range==`string`?m.decode(e.range):e.range).br?`xdr:twoCellAnchor`:`xdr:oneCellAnchor`}var bu=class e extends ${constructor(){super(),this.map={"xdr:twoCellAnchor":new hu,"xdr:oneCellAnchor":new vu},this.model={anchors:[]}}prepare(e){e.anchors.forEach((e,t)=>{e.anchorType=yu(e),this.map[e.anchorType].prepare(e,{index:t})})}get tag(){return`xdr:wsDr`}render(t,n){let r=n||this.model;t.openXml(Ds.StdDocAttributes),t.openNode(this.tag,e.DRAWING_ATTRIBUTES),r.anchors.forEach(e=>{this.map[e.anchorType].render(t,e)}),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={anchors:[]};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.anchors.push(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:return!0}}reconcile(e,t){e.anchors.forEach(e=>{e.br?this.map[`xdr:twoCellAnchor`].reconcile(e,t):this.map[`xdr:oneCellAnchor`].reconcile(e,t)})}static{this.DRAWING_ATTRIBUTES={"xmlns:xdr":`http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing`,"xmlns:a":`http://schemas.openxmlformats.org/drawingml/2006/main`}}},xu=class extends ${constructor(){super(),this.model={val:``}}get tag(){return`customFilter`}render(e,t){e.leafNode(this.tag,{val:t.val,operator:t.operator})}parseOpen(e){return e.name===this.tag?(this.model={val:e.attributes.val,operator:e.attributes.operator},!0):!1}parseText(){}parseClose(){return!1}},Su=class extends ${constructor(){super(),this.model={val:``}}get tag(){return`filter`}render(e,t){e.leafNode(this.tag,{val:t.val})}parseOpen(e){return e.name===this.tag?(this.model={val:e.attributes.val},!0):!1}parseText(){}parseClose(){return!1}},Cu=class extends ${constructor(){super(),this.map={customFilters:new Fs({tag:`customFilters`,count:!1,empty:!0,childXform:new xu}),filters:new Fs({tag:`filters`,count:!1,empty:!0,childXform:new Su})},this.model={filterButton:!1}}get tag(){return`filterColumn`}prepare(e,t){e.colId=t.index.toString()}render(e,t){if(t.customFilters){e.openNode(this.tag,{colId:t.colId,hiddenButton:t.filterButton?`0`:`1`}),this.map.customFilters.render(e,t.customFilters),e.closeNode();return}e.leafNode(this.tag,{colId:t.colId,hiddenButton:t.filterButton?`0`:`1`})}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;let{attributes:t}=e;switch(e.name){case this.tag:return this.model={filterButton:t.hiddenButton===`0`},!0;case`dynamicFilter`:return!0;default:if(this.parser=this.map[e.name],this.parser)return this.parseOpen(e),!0;throw Error(`Unexpected xml node in parseOpen: ${JSON.stringify(e)}`)}}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.customFilters=this.map.customFilters.model,!1;default:return!0}}},wu=class extends ${constructor(){super(),this.map={filterColumn:new Cu},this.model={autoFilterRef:``,columns:[]}}get tag(){return`autoFilter`}prepare(e){e.columns.forEach((e,t)=>{this.map.filterColumn.prepare(e,{index:t})})}render(e,t){e.openNode(this.tag,{ref:t.autoFilterRef}),t.columns.forEach(t=>{this.map.filterColumn.render(e,t)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:return this.model={autoFilterRef:e.attributes.ref,columns:[]},!0;default:if(this.parser=this.map[e.name],this.parser)return this.parseOpen(e),!0;throw Error(`Unexpected xml node in parseOpen: ${JSON.stringify(e)}`)}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.columns.push(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:throw Error(`Unexpected xml node in parseClose: ${e}`)}}},Tu=class extends ${constructor(){super(),this.model={name:``}}get tag(){return`tableColumn`}prepare(e,t){e.id=t.index+1}render(e,t){e.leafNode(this.tag,{id:t.id.toString(),name:t.name,totalsRowLabel:t.totalsRowLabel,totalsRowFunction:t.totalsRowFunction,dxfId:t.dxfId})}parseOpen(e){if(e.name===this.tag){let{attributes:t}=e;return this.model={name:t.name,totalsRowLabel:t.totalsRowLabel,totalsRowFunction:t.totalsRowFunction,dxfId:t.dxfId},!0}return!1}parseText(){}parseClose(){return!1}},Eu=class extends ${constructor(){super(),this.model={theme:null,showFirstColumn:!1,showLastColumn:!1,showRowStripes:!1,showColumnStripes:!1}}get tag(){return`tableStyleInfo`}render(e,t){e.leafNode(this.tag,{name:t.theme?t.theme:void 0,showFirstColumn:t.showFirstColumn?`1`:`0`,showLastColumn:t.showLastColumn?`1`:`0`,showRowStripes:t.showRowStripes?`1`:`0`,showColumnStripes:t.showColumnStripes?`1`:`0`})}parseOpen(e){if(e.name===this.tag){let{attributes:t}=e;return this.model={theme:t.name?t.name:null,showFirstColumn:t.showFirstColumn===`1`,showLastColumn:t.showLastColumn===`1`,showRowStripes:t.showRowStripes===`1`,showColumnStripes:t.showColumnStripes===`1`},!0}return!1}parseText(){}parseClose(){return!1}},Du=class e extends ${constructor(){super(),this.map={autoFilter:new wu,tableColumns:new Fs({tag:`tableColumns`,count:!0,empty:!0,childXform:new Tu}),tableStyleInfo:new Eu},this.model={id:0,name:``,tableRef:``,columns:[]}}prepare(e,t){this.map.autoFilter.prepare(e),this.map.tableColumns.prepare(e.columns,t)}get tag(){return`table`}render(t,n){t.openXml(Ds.StdDocAttributes),t.openNode(this.tag,{...e.TABLE_ATTRIBUTES,id:n.id,name:n.name,displayName:n.displayName||n.name,ref:n.tableRef,totalsRowCount:n.totalsRow?`1`:void 0,totalsRowShown:n.totalsRow?void 0:`1`,headerRowCount:n.headerRow?`1`:`0`}),this.map.autoFilter.render(t,n),this.map.tableColumns.render(t,n.columns),this.map.tableStyleInfo.render(t,n.style),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;let{name:t,attributes:n}=e;switch(t){case this.tag:this.reset(),this.model={name:n.name,displayName:n.displayName||n.name,tableRef:n.ref,totalsRow:n.totalsRowCount===`1`,headerRow:n.headerRowCount===`1`};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.columns=this.map.tableColumns.model,this.map.autoFilter.model&&(this.model.autoFilterRef=this.map.autoFilter.model.autoFilterRef,this.map.autoFilter.model.columns.forEach((e,t)=>{this.model.columns[t].filterButton=e.filterButton})),this.model.style=this.map.tableStyleInfo.model,!1;default:return!0}}reconcile(e,t){e.tableRef&&!e.ref&&(e.ref=e.tableRef),e.rows||=[],e.columns.forEach(e=>{e.dxfId!==void 0&&(e.style=t.styles.getDxfStyle(e.dxfId))})}static{this.TABLE_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`xr xr3`,"xmlns:xr":`http://schemas.microsoft.com/office/spreadsheetml/2014/revision`,"xmlns:xr3":`http://schemas.microsoft.com/office/spreadsheetml/2016/revision3`}}},Ou=class e extends ${constructor(){super(),this.map={}}prepare(e){}get tag(){return`pivotCacheRecords`}render(t,n){let{sourceSheet:r,cacheFields:i}=n,a=r.getSheetValues().slice(2);t.openXml(Ds.StdDocAttributes),t.openNode(this.tag,{...e.PIVOT_CACHE_RECORDS_ATTRIBUTES,count:a.length}),t.writeXml(o()),t.closeNode();function o(){return a.map(e=>[...s(e.slice(1))].join(``)).join(``)}function*s(e){yield`
95
- <r>`;for(let[t,n]of e.entries())yield`
96
- `,yield c(n,i[t].sharedItems);yield`
97
- </r>`}function c(e,t){if(t===null)return Number.isFinite(e)?`<n v="${e}" />`:`<s v="${e}" />`;let n=t.indexOf(e);if(n<0)throw Error(`${JSON.stringify(e)} not in sharedItems ${JSON.stringify(t)}`);return`<x v="${n}" />`}}parseOpen(e){return!1}parseText(e){}parseClose(e){return!1}reconcile(e,t){}static{this.PIVOT_CACHE_RECORDS_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`xr`,"xmlns:xr":`http://schemas.microsoft.com/office/spreadsheetml/2014/revision`}}},ku=class{constructor({name:e,sharedItems:t}){this.name=e,this.sharedItems=t}render(){return this.sharedItems===null?`<cacheField name="${this.name}" numFmtId="0">
91
+ `,e.NAME_START_CHAR=`:A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿`,e.NAME_CHAR=`-`+e.NAME_START_CHAR+`.0-9·̀-ͯ‿-⁀`,e.CHAR_RE=RegExp(`^[`+e.CHAR+`]$`,`u`),e.S_RE=RegExp(`^[`+e.S+`]+$`,`u`),e.NAME_START_CHAR_RE=RegExp(`^[`+e.NAME_START_CHAR+`]$`,`u`),e.NAME_CHAR_RE=RegExp(`^[`+e.NAME_CHAR+`]$`,`u`),e.NAME_RE=RegExp(`^[`+e.NAME_START_CHAR+`][`+e.NAME_CHAR+`]*$`,`u`),e.NMTOKEN_RE=RegExp(`^[`+e.NAME_CHAR+`]+$`,`u`);var t=9,n=10,r=13,i=32;e.S_LIST=[i,n,r,t];function a(e){return e>=i&&e<=55295||e===n||e===r||e===t||e>=57344&&e<=65533||e>=65536&&e<=1114111}e.isChar=a;function o(e){return e===i||e===n||e===r||e===t}e.isS=o;function s(e){return e>=65&&e<=90||e>=97&&e<=122||e===58||e===95||e===8204||e===8205||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}e.isNameStartChar=s;function c(e){return s(e)||e>=48&&e<=57||e===45||e===46||e===183||e>=768&&e<=879||e>=8255&&e<=8256}e.isNameChar=c})),Es=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CHAR=`-퟿-�𐀀-􏿿`,e.RESTRICTED_CHAR=`-\b\v\f--„†-Ÿ`,e.S=` \r
92
+ `,e.NAME_START_CHAR=`:A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿`,e.NAME_CHAR=`-`+e.NAME_START_CHAR+`.0-9·̀-ͯ‿-⁀`,e.CHAR_RE=RegExp(`^[`+e.CHAR+`]$`,`u`),e.RESTRICTED_CHAR_RE=RegExp(`^[`+e.RESTRICTED_CHAR+`]$`,`u`),e.S_RE=RegExp(`^[`+e.S+`]+$`,`u`),e.NAME_START_CHAR_RE=RegExp(`^[`+e.NAME_START_CHAR+`]$`,`u`),e.NAME_CHAR_RE=RegExp(`^[`+e.NAME_CHAR+`]$`,`u`),e.NAME_RE=RegExp(`^[`+e.NAME_START_CHAR+`][`+e.NAME_CHAR+`]*$`,`u`),e.NMTOKEN_RE=RegExp(`^[`+e.NAME_CHAR+`]+$`,`u`);var t=9,n=10,r=13,i=32;e.S_LIST=[i,n,r,t];function a(e){return e>=1&&e<=55295||e>=57344&&e<=65533||e>=65536&&e<=1114111}e.isChar=a;function o(e){return e>=1&&e<=8||e===11||e===12||e>=14&&e<=31||e>=127&&e<=132||e>=134&&e<=159}e.isRestrictedChar=o;function s(e){return e===9||e===10||e===13||e>31&&e<127||e===133||e>159&&e<=55295||e>=57344&&e<=65533||e>=65536&&e<=1114111}e.isCharAndNotRestricted=s;function c(e){return e===i||e===n||e===r||e===t}e.isS=c;function l(e){return e>=65&&e<=90||e>=97&&e<=122||e===58||e===95||e===8204||e===8205||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}e.isNameStartChar=l;function u(e){return l(e)||e>=48&&e<=57||e===45||e===46||e===183||e>=768&&e<=879||e>=8255&&e<=8256}e.isNameChar=u})),Ds=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.NC_NAME_START_CHAR=`A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿`,e.NC_NAME_CHAR=`-`+e.NC_NAME_START_CHAR+`.0-9·̀-ͯ‿-⁀`,e.NC_NAME_START_CHAR_RE=RegExp(`^[`+e.NC_NAME_START_CHAR+`]$`,`u`),e.NC_NAME_CHAR_RE=RegExp(`^[`+e.NC_NAME_CHAR+`]$`,`u`),e.NC_NAME_RE=RegExp(`^[`+e.NC_NAME_START_CHAR+`][`+e.NC_NAME_CHAR+`]*$`,`u`);function t(e){return e>=65&&e<=90||e===95||e>=97&&e<=122||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}e.isNCNameStartChar=t;function n(e){return t(e)||e===45||e===46||e>=48&&e<=57||e===183||e>=768&&e<=879||e>=8255&&e<=8256}e.isNCNameChar=n})),Os=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SaxesParser=e.EVENTS=void 0;let t=Ts(),n=Es(),r=Ds();var i=t.isS,a=t.isChar,o=t.isNameStartChar,s=t.isNameChar,c=t.S_LIST,l=t.NAME_RE,u=n.isChar,d=r.isNCNameStartChar,f=r.isNCNameChar,p=r.NC_NAME_RE;let m=`http://www.w3.org/XML/1998/namespace`,h=`http://www.w3.org/2000/xmlns/`,g={__proto__:null,xml:m,xmlns:h},_={__proto__:null,amp:`&`,gt:`>`,lt:`<`,quot:`"`,apos:`'`},v=8232,y=e=>e===34||e===39,b=[34,39],x=[...b,91,62],S=[...b,60,93],C=[61,63,...c],w=[...c,62,38,60];function T(e,t,n){switch(t){case`xml`:n!==m&&e.fail(`xml prefix must be bound to ${m}.`);break;case`xmlns`:n!==h&&e.fail(`xmlns prefix must be bound to ${h}.`);break;default:}switch(n){case h:e.fail(t===``?`the default namespace may not be set to ${n}.`:`may not assign a prefix (even "xmlns") to the URI \
93
+ ${h}.`);break;case m:switch(t){case`xml`:break;case``:e.fail(`the default namespace may not be set to ${n}.`);break;default:e.fail(`may not assign the xml namespace to another prefix.`)}break;default:}}function E(e,t){for(let n of Object.keys(t))T(e,n,t[n])}let D=e=>p.test(e),O=e=>l.test(e);e.EVENTS=[`xmldecl`,`text`,`processinginstruction`,`doctype`,`comment`,`opentagstart`,`attribute`,`opentag`,`closetag`,`cdata`,`error`,`end`,`ready`];let k={xmldecl:`xmldeclHandler`,text:`textHandler`,processinginstruction:`piHandler`,doctype:`doctypeHandler`,comment:`commentHandler`,opentagstart:`openTagStartHandler`,attribute:`attributeHandler`,opentag:`openTagHandler`,closetag:`closeTagHandler`,cdata:`cdataHandler`,error:`errorHandler`,end:`endHandler`,ready:`readyHandler`};e.SaxesParser=class{constructor(e){this.opt=e??{},this.fragmentOpt=!!this.opt.fragment;let t=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=this.opt.position!==!1,this.fileName=this.opt.fileName,t){this.nameStartCheck=d,this.nameCheck=f,this.isName=D,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},g);let e=this.opt.additionalNamespaces;e!=null&&(E(this,e),Object.assign(this.ns,e))}else this.nameStartCheck=o,this.nameCheck=s,this.isName=O,this.processAttribs=this.processAttribsPlain,this.pushAttrib=this.pushAttribPlain;this.stateTable=[this.sBegin,this.sBeginWhitespace,this.sDoctype,this.sDoctypeQuote,this.sDTD,this.sDTDQuoted,this.sDTDOpenWaka,this.sDTDOpenWakaBang,this.sDTDComment,this.sDTDCommentEnding,this.sDTDCommentEnded,this.sDTDPI,this.sDTDPIEnding,this.sText,this.sEntity,this.sOpenWaka,this.sOpenWakaBang,this.sComment,this.sCommentEnding,this.sCommentEnded,this.sCData,this.sCDataEnding,this.sCDataEnding2,this.sPIFirstChar,this.sPIRest,this.sPIBody,this.sPIEnding,this.sXMLDeclNameStart,this.sXMLDeclName,this.sXMLDeclEq,this.sXMLDeclValueStart,this.sXMLDeclValue,this.sXMLDeclSeparator,this.sXMLDeclEnding,this.sOpenTag,this.sOpenTagSlash,this.sAttrib,this.sAttribName,this.sAttribNameSawWhite,this.sAttribValue,this.sAttribValueQuoted,this.sAttribValueClosed,this.sAttribValueUnquoted,this.sCloseTag,this.sCloseTagSawWhite],this._init()}get closed(){return this._closed}_init(){var e;this.openWakaBang=``,this.text=``,this.name=``,this.piTarget=``,this.entity=``,this.q=null,this.tags=[],this.tag=null,this.topNS=null,this.chunk=``,this.chunkPosition=0,this.i=0,this.prevI=0,this.carriedFromPrevious=void 0,this.forbiddenState=0,this.attribList=[];let{fragmentOpt:t}=this;this.state=t?13:0,this.reportedTextBeforeRoot=this.reportedTextAfterRoot=this.closedRoot=this.sawRoot=t,this.xmlDeclPossible=!t,this.xmlDeclExpects=[`version`],this.entityReturnState=void 0;let{defaultXMLVersion:n}=this.opt;if(n===void 0){if(this.opt.forceXMLVersion===!0)throw Error(`forceXMLVersion set but defaultXMLVersion is not set`);n=`1.0`}this.setXMLVersion(n),this.positionAtNewLine=0,this.doctype=!1,this._closed=!1,this.xmlDecl={version:void 0,encoding:void 0,standalone:void 0},this.line=1,this.column=0,this.ENTITIES=Object.create(_),(e=this.readyHandler)==null||e.call(this)}get position(){return this.chunkPosition+this.i}get columnIndex(){return this.position-this.positionAtNewLine}on(e,t){this[k[e]]=t}off(e){this[k[e]]=void 0}makeError(e){let t=this.fileName??``;return this.trackPosition&&(t.length>0&&(t+=`:`),t+=`${this.line}:${this.column}`),t.length>0&&(t+=`: `),Error(t+e)}fail(e){let t=this.makeError(e),n=this.errorHandler;if(n===void 0)throw t;return n(t),this}write(e){if(this.closed)return this.fail(`cannot write after close; assign an onready handler.`);let t=!1;e===null?(t=!0,e=``):typeof e==`object`&&(e=e.toString()),this.carriedFromPrevious!==void 0&&(e=`${this.carriedFromPrevious}${e}`,this.carriedFromPrevious=void 0);let n=e.length,r=e.charCodeAt(n-1);!t&&(r===13||r>=55296&&r<=56319)&&(this.carriedFromPrevious=e[n-1],n--,e=e.slice(0,n));let{stateTable:i}=this;for(this.chunk=e,this.i=0;this.i<n;)i[this.state].call(this);return this.chunkPosition+=n,t?this.end():this}close(){return this.write(null)}getCode10(){let{chunk:e,i:t}=this;if(this.prevI=t,this.i=t+1,t>=e.length)return-1;let n=e.charCodeAt(t);if(this.column++,n<55296){if(n>=32||n===9)return n;switch(n){case 10:return this.line++,this.column=0,this.positionAtNewLine=this.position,10;case 13:return e.charCodeAt(t+1)===10&&(this.i=t+2),this.line++,this.column=0,this.positionAtNewLine=this.position,-2;default:return this.fail(`disallowed character.`),n}}if(n>56319)return n>=57344&&n<=65533||this.fail(`disallowed character.`),n;let r=65536+(n-55296)*1024+(e.charCodeAt(t+1)-56320);return this.i=t+2,r>1114111&&this.fail(`disallowed character.`),r}getCode11(){let{chunk:e,i:t}=this;if(this.prevI=t,this.i=t+1,t>=e.length)return-1;let n=e.charCodeAt(t);if(this.column++,n<55296){if(n>31&&n<127||n>159&&n!==v||n===9)return n;switch(n){case 10:return this.line++,this.column=0,this.positionAtNewLine=this.position,10;case 13:{let n=e.charCodeAt(t+1);(n===10||n===133)&&(this.i=t+2)}case 133:case v:return this.line++,this.column=0,this.positionAtNewLine=this.position,-2;default:return this.fail(`disallowed character.`),n}}if(n>56319)return n>=57344&&n<=65533||this.fail(`disallowed character.`),n;let r=65536+(n-55296)*1024+(e.charCodeAt(t+1)-56320);return this.i=t+2,r>1114111&&this.fail(`disallowed character.`),r}getCodeNorm(){let e=this.getCode();return e===-2?10:e}unget(){this.i=this.prevI,this.column--}captureTo(e){let{i:t}=this,{chunk:n}=this;for(;;){let r=this.getCode(),i=r===-2,a=i?10:r;if(a===-1||e.includes(a))return this.text+=n.slice(t,this.prevI),a;i&&(this.text+=`${n.slice(t,this.prevI)}\n`,t=this.i)}}captureToChar(e){let{i:t}=this,{chunk:n}=this;for(;;){let r=this.getCode();switch(r){case-2:this.text+=`${n.slice(t,this.prevI)}\n`,t=this.i,r=10;break;case-1:return this.text+=n.slice(t),!1;default:}if(r===e)return this.text+=n.slice(t,this.prevI),!0}}captureNameChars(){let{chunk:e,i:t}=this;for(;;){let n=this.getCode();if(n===-1)return this.name+=e.slice(t),-1;if(!s(n))return this.name+=e.slice(t,this.prevI),n===-2?10:n}}skipSpaces(){for(;;){let e=this.getCodeNorm();if(e===-1||!i(e))return e}}setXMLVersion(e){this.currentXMLVersion=e,e===`1.0`?(this.isChar=a,this.getCode=this.getCode10):(this.isChar=u,this.getCode=this.getCode11)}sBegin(){this.chunk.charCodeAt(0)===65279&&(this.i++,this.column++),this.state=1}sBeginWhitespace(){let e=this.i,t=this.skipSpaces();switch(this.prevI!==e&&(this.xmlDeclPossible=!1),t){case 60:if(this.state=15,this.text.length!==0)throw Error(`no-empty text at start`);break;case-1:break;default:this.unget(),this.state=13,this.xmlDeclPossible=!1}}sDoctype(){var e;let t=this.captureTo(x);switch(t){case 62:(e=this.doctypeHandler)==null||e.call(this,this.text),this.text=``,this.state=13,this.doctype=!0;break;case-1:break;default:this.text+=String.fromCodePoint(t),t===91?this.state=4:y(t)&&(this.state=3,this.q=t)}}sDoctypeQuote(){let e=this.q;this.captureToChar(e)&&(this.text+=String.fromCodePoint(e),this.q=null,this.state=2)}sDTD(){let e=this.captureTo(S);e!==-1&&(this.text+=String.fromCodePoint(e),e===93?this.state=2:e===60?this.state=6:y(e)&&(this.state=5,this.q=e))}sDTDQuoted(){let e=this.q;this.captureToChar(e)&&(this.text+=String.fromCodePoint(e),this.state=4,this.q=null)}sDTDOpenWaka(){let e=this.getCodeNorm();switch(this.text+=String.fromCodePoint(e),e){case 33:this.state=7,this.openWakaBang=``;break;case 63:this.state=11;break;default:this.state=4}}sDTDOpenWakaBang(){let e=String.fromCodePoint(this.getCodeNorm()),t=this.openWakaBang+=e;this.text+=e,t!==`-`&&(this.state=t===`--`?8:4,this.openWakaBang=``)}sDTDComment(){this.captureToChar(45)&&(this.text+=`-`,this.state=9)}sDTDCommentEnding(){let e=this.getCodeNorm();this.text+=String.fromCodePoint(e),this.state=e===45?10:8}sDTDCommentEnded(){let e=this.getCodeNorm();this.text+=String.fromCodePoint(e),e===62?this.state=4:(this.fail(`malformed comment.`),this.state=8)}sDTDPI(){this.captureToChar(63)&&(this.text+=`?`,this.state=12)}sDTDPIEnding(){let e=this.getCodeNorm();this.text+=String.fromCodePoint(e),e===62&&(this.state=4)}sText(){this.tags.length===0?this.handleTextOutsideRoot():this.handleTextInRoot()}sEntity(){let{i:e}=this,{chunk:t}=this;loop:for(;;)switch(this.getCode()){case-2:this.entity+=`${t.slice(e,this.prevI)}\n`,e=this.i;break;case 59:{let{entityReturnState:n}=this,r=this.entity+t.slice(e,this.prevI);this.state=n;let i;r===``?(this.fail(`empty entity name.`),i=`&;`):(i=this.parseEntity(r),this.entity=``),(n!==13||this.textHandler!==void 0)&&(this.text+=i);break loop}case-1:this.entity+=t.slice(e);break loop;default:}}sOpenWaka(){let e=this.getCode();if(o(e))this.state=34,this.unget(),this.xmlDeclPossible=!1;else switch(e){case 47:this.state=43,this.xmlDeclPossible=!1;break;case 33:this.state=16,this.openWakaBang=``,this.xmlDeclPossible=!1;break;case 63:this.state=23;break;default:this.fail(`disallowed character in tag name`),this.state=13,this.xmlDeclPossible=!1}}sOpenWakaBang(){switch(this.openWakaBang+=String.fromCodePoint(this.getCodeNorm()),this.openWakaBang){case`[CDATA[`:!this.sawRoot&&!this.reportedTextBeforeRoot&&(this.fail(`text data outside of root node.`),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail(`text data outside of root node.`),this.reportedTextAfterRoot=!0),this.state=20,this.openWakaBang=``;break;case`--`:this.state=17,this.openWakaBang=``;break;case`DOCTYPE`:this.state=2,(this.doctype||this.sawRoot)&&this.fail(`inappropriately located doctype declaration.`),this.openWakaBang=``;break;default:this.openWakaBang.length>=7&&this.fail(`incorrect syntax.`)}}sComment(){this.captureToChar(45)&&(this.state=18)}sCommentEnding(){var e;let t=this.getCodeNorm();t===45?(this.state=19,(e=this.commentHandler)==null||e.call(this,this.text),this.text=``):(this.text+=`-${String.fromCodePoint(t)}`,this.state=17)}sCommentEnded(){let e=this.getCodeNorm();e===62?this.state=13:(this.fail(`malformed comment.`),this.text+=`--${String.fromCodePoint(e)}`,this.state=17)}sCData(){this.captureToChar(93)&&(this.state=21)}sCDataEnding(){let e=this.getCodeNorm();e===93?this.state=22:(this.text+=`]${String.fromCodePoint(e)}`,this.state=20)}sCDataEnding2(){var e;let t=this.getCodeNorm();switch(t){case 62:(e=this.cdataHandler)==null||e.call(this,this.text),this.text=``,this.state=13;break;case 93:this.text+=`]`;break;default:this.text+=`]]${String.fromCodePoint(t)}`,this.state=20}}sPIFirstChar(){let e=this.getCodeNorm();this.nameStartCheck(e)?(this.piTarget+=String.fromCodePoint(e),this.state=24):e===63||i(e)?(this.fail(`processing instruction without a target.`),this.state=e===63?26:25):(this.fail(`disallowed character in processing instruction name.`),this.piTarget+=String.fromCodePoint(e),this.state=24)}sPIRest(){let{chunk:e,i:t}=this;for(;;){let n=this.getCodeNorm();if(n===-1){this.piTarget+=e.slice(t);return}if(!this.nameCheck(n)){this.piTarget+=e.slice(t,this.prevI);let r=n===63;r||i(n)?this.piTarget===`xml`?(this.xmlDeclPossible||this.fail(`an XML declaration must be at the start of the document.`),this.state=r?33:27):this.state=r?26:25:(this.fail(`disallowed character in processing instruction name.`),this.piTarget+=String.fromCodePoint(n));break}}}sPIBody(){if(this.text.length===0){let e=this.getCodeNorm();e===63?this.state=26:i(e)||(this.text=String.fromCodePoint(e))}else this.captureToChar(63)&&(this.state=26)}sPIEnding(){var e;let t=this.getCodeNorm();if(t===62){let{piTarget:t}=this;t.toLowerCase()===`xml`&&this.fail(`the XML declaration must appear at the start of the document.`),(e=this.piHandler)==null||e.call(this,{target:t,body:this.text}),this.piTarget=this.text=``,this.state=13}else t===63?this.text+=`?`:(this.text+=`?${String.fromCodePoint(t)}`,this.state=25);this.xmlDeclPossible=!1}sXMLDeclNameStart(){let e=this.skipSpaces();if(e===63){this.state=33;return}e!==-1&&(this.state=28,this.name=String.fromCodePoint(e))}sXMLDeclName(){let e=this.captureTo(C);if(e===63){this.state=33,this.name+=this.text,this.text=``,this.fail(`XML declaration is incomplete.`);return}if(i(e)||e===61){if(this.name+=this.text,this.text=``,!this.xmlDeclExpects.includes(this.name))switch(this.name.length){case 0:this.fail(`did not expect any more name/value pairs.`);break;case 1:this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);break;default:this.fail(`expected one of ${this.xmlDeclExpects.join(`, `)}`)}this.state=e===61?30:29}}sXMLDeclEq(){let e=this.getCodeNorm();if(e===63){this.state=33,this.fail(`XML declaration is incomplete.`);return}i(e)||(e!==61&&this.fail(`value required.`),this.state=30)}sXMLDeclValueStart(){let e=this.getCodeNorm();if(e===63){this.state=33,this.fail(`XML declaration is incomplete.`);return}i(e)||(y(e)?this.q=e:(this.fail(`value must be quoted.`),this.q=32),this.state=31)}sXMLDeclValue(){let e=this.captureTo([this.q,63]);if(e===63){this.state=33,this.text=``,this.fail(`XML declaration is incomplete.`);return}if(e===-1)return;let t=this.text;switch(this.text=``,this.name){case`version`:{this.xmlDeclExpects=[`encoding`,`standalone`];let e=t;this.xmlDecl.version=e,/^1\.[0-9]+$/.test(e)?this.opt.forceXMLVersion||this.setXMLVersion(e):this.fail(`version number must match /^1\\.[0-9]+$/.`);break}case`encoding`:/^[A-Za-z][A-Za-z0-9._-]*$/.test(t)||this.fail(`encoding value must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/.`),this.xmlDeclExpects=[`standalone`],this.xmlDecl.encoding=t;break;case`standalone`:t!==`yes`&&t!==`no`&&this.fail(`standalone value must match "yes" or "no".`),this.xmlDeclExpects=[],this.xmlDecl.standalone=t;break;default:}this.name=``,this.state=32}sXMLDeclSeparator(){let e=this.getCodeNorm();if(e===63){this.state=33;return}i(e)||(this.fail(`whitespace required.`),this.unget()),this.state=27}sXMLDeclEnding(){var e;this.getCodeNorm()===62?(this.piTarget===`xml`?this.name!==`version`&&this.xmlDeclExpects.includes(`version`)&&this.fail(`XML declaration must contain a version.`):this.fail(`processing instructions are not allowed before root.`),(e=this.xmldeclHandler)==null||e.call(this,this.xmlDecl),this.name=``,this.piTarget=this.text=``,this.state=13):this.fail(`The character ? is disallowed anywhere in XML declarations.`),this.xmlDeclPossible=!1}sOpenTag(){var e;let t=this.captureNameChars();if(t===-1)return;let n=this.tag={name:this.name,attributes:Object.create(null)};switch(this.name=``,this.xmlnsOpt&&(this.topNS=n.ns=Object.create(null)),(e=this.openTagStartHandler)==null||e.call(this,n),this.sawRoot=!0,!this.fragmentOpt&&this.closedRoot&&this.fail(`documents may contain only one root.`),t){case 62:this.openTag();break;case 47:this.state=35;break;default:i(t)||this.fail(`disallowed character in tag name.`),this.state=36}}sOpenTagSlash(){this.getCode()===62?this.openSelfClosingTag():(this.fail(`forward-slash in opening tag not followed by >.`),this.state=36)}sAttrib(){let e=this.skipSpaces();e!==-1&&(o(e)?(this.unget(),this.state=37):e===62?this.openTag():e===47?this.state=35:this.fail(`disallowed character in attribute name.`))}sAttribName(){let e=this.captureNameChars();e===61?this.state=39:i(e)?this.state=38:e===62?(this.fail(`attribute without value.`),this.pushAttrib(this.name,this.name),this.name=this.text=``,this.openTag()):e!==-1&&this.fail(`disallowed character in attribute name.`)}sAttribNameSawWhite(){let e=this.skipSpaces();switch(e){case-1:return;case 61:this.state=39;break;default:this.fail(`attribute without value.`),this.text=``,this.name=``,e===62?this.openTag():o(e)?(this.unget(),this.state=37):(this.fail(`disallowed character in attribute name.`),this.state=36)}}sAttribValue(){let e=this.getCodeNorm();y(e)?(this.q=e,this.state=40):i(e)||(this.fail(`unquoted attribute value.`),this.state=42,this.unget())}sAttribValueQuoted(){let{q:e,chunk:t}=this,{i:n}=this;for(;;)switch(this.getCode()){case e:this.pushAttrib(this.name,this.text+t.slice(n,this.prevI)),this.name=this.text=``,this.q=null,this.state=41;return;case 38:this.text+=t.slice(n,this.prevI),this.state=14,this.entityReturnState=40;return;case 10:case-2:case 9:this.text+=`${t.slice(n,this.prevI)} `,n=this.i;break;case 60:this.text+=t.slice(n,this.prevI),this.fail(`disallowed character.`);return;case-1:this.text+=t.slice(n);return;default:}}sAttribValueClosed(){let e=this.getCodeNorm();i(e)?this.state=36:e===62?this.openTag():e===47?this.state=35:o(e)?(this.fail(`no whitespace between attributes.`),this.unget(),this.state=37):this.fail(`disallowed character in attribute name.`)}sAttribValueUnquoted(){let e=this.captureTo(w);switch(e){case 38:this.state=14,this.entityReturnState=42;break;case 60:this.fail(`disallowed character.`);break;case-1:break;default:this.text.includes(`]]>`)&&this.fail(`the string "]]>" is disallowed in char data.`),this.pushAttrib(this.name,this.text),this.name=this.text=``,e===62?this.openTag():this.state=36}}sCloseTag(){let e=this.captureNameChars();e===62?this.closeTag():i(e)?this.state=44:e!==-1&&this.fail(`disallowed character in closing tag.`)}sCloseTagSawWhite(){switch(this.skipSpaces()){case 62:this.closeTag();break;case-1:break;default:this.fail(`disallowed character in closing tag.`)}}handleTextInRoot(){let{i:e,forbiddenState:t}=this,{chunk:n,textHandler:r}=this;scanLoop:for(;;)switch(this.getCode()){case 60:if(this.state=15,r!==void 0){let{text:t}=this,i=n.slice(e,this.prevI);t.length===0?i.length!==0&&r(i):(r(t+i),this.text=``)}t=0;break scanLoop;case 38:this.state=14,this.entityReturnState=13,r!==void 0&&(this.text+=n.slice(e,this.prevI)),t=0;break scanLoop;case 93:switch(t){case 0:t=1;break;case 1:t=2;break;case 2:break;default:throw Error(`impossible state`)}break;case 62:t===2&&this.fail(`the string "]]>" is disallowed in char data.`),t=0;break;case-2:r!==void 0&&(this.text+=`${n.slice(e,this.prevI)}\n`),e=this.i,t=0;break;case-1:r!==void 0&&(this.text+=n.slice(e));break scanLoop;default:t=0}this.forbiddenState=t}handleTextOutsideRoot(){let{i:e}=this,{chunk:t,textHandler:n}=this,r=!1;outRootLoop:for(;;){let a=this.getCode();switch(a){case 60:if(this.state=15,n!==void 0){let{text:r}=this,i=t.slice(e,this.prevI);r.length===0?i.length!==0&&n(i):(n(r+i),this.text=``)}break outRootLoop;case 38:this.state=14,this.entityReturnState=13,n!==void 0&&(this.text+=t.slice(e,this.prevI)),r=!0;break outRootLoop;case-2:n!==void 0&&(this.text+=`${t.slice(e,this.prevI)}\n`),e=this.i;break;case-1:n!==void 0&&(this.text+=t.slice(e));break outRootLoop;default:i(a)||(r=!0)}}r&&(!this.sawRoot&&!this.reportedTextBeforeRoot&&(this.fail(`text data outside of root node.`),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail(`text data outside of root node.`),this.reportedTextAfterRoot=!0))}pushAttribNS(e,t){var n;let{prefix:r,local:i}=this.qname(e),a={name:e,prefix:r,local:i,value:t};if(this.attribList.push(a),(n=this.attributeHandler)==null||n.call(this,a),r===`xmlns`){let e=t.trim();this.currentXMLVersion===`1.0`&&e===``&&this.fail(`invalid attempt to undefine prefix in XML 1.0`),this.topNS[i]=e,T(this,i,e)}else if(e===`xmlns`){let e=t.trim();this.topNS[``]=e,T(this,``,e)}}pushAttribPlain(e,t){var n;let r={name:e,value:t};this.attribList.push(r),(n=this.attributeHandler)==null||n.call(this,r)}end(){var e,t;this.sawRoot||this.fail(`document must contain a root element.`);let{tags:n}=this;for(;n.length>0;){let e=n.pop();this.fail(`unclosed tag: ${e.name}`)}this.state!==0&&this.state!==13&&this.fail(`unexpected end.`);let{text:r}=this;return r.length!==0&&((e=this.textHandler)==null||e.call(this,r),this.text=``),this._closed=!0,(t=this.endHandler)==null||t.call(this),this._init(),this}resolve(e){var t;let n=this.topNS[e];if(n!==void 0)return n;let{tags:r}=this;for(let t=r.length-1;t>=0;t--)if(n=r[t].ns[e],n!==void 0)return n;return n=this.ns[e],n===void 0?(t=this.opt).resolvePrefix?.call(t,e):n}qname(e){let t=e.indexOf(`:`);if(t===-1)return{prefix:``,local:e};let n=e.slice(t+1),r=e.slice(0,t);return(r===``||n===``||n.includes(`:`))&&this.fail(`malformed name: ${e}.`),{prefix:r,local:n}}processAttribsNS(){let{attribList:e}=this,t=this.tag;{let{prefix:e,local:n}=this.qname(t.name);t.prefix=e,t.local=n;let r=t.uri=this.resolve(e)??``;e!==``&&(e===`xmlns`&&this.fail(`tags may not have "xmlns" as prefix.`),r===``&&(this.fail(`unbound namespace prefix: ${JSON.stringify(e)}.`),t.uri=e))}if(e.length===0)return;let{attributes:n}=t,r=new Set;for(let t of e){let{name:e,prefix:i,local:a}=t,o,s;i===``?(o=e===`xmlns`?h:``,s=e):(o=this.resolve(i),o===void 0&&(this.fail(`unbound namespace prefix: ${JSON.stringify(i)}.`),o=i),s=`{${o}}${a}`),r.has(s)&&this.fail(`duplicate attribute: ${s}.`),r.add(s),t.uri=o,n[e]=t}this.attribList=[]}processAttribsPlain(){let{attribList:e}=this,t=this.tag.attributes;for(let{name:n,value:r}of e)t[n]!==void 0&&this.fail(`duplicate attribute: ${n}.`),t[n]=r;this.attribList=[]}openTag(){var e;this.processAttribs();let{tags:t}=this,n=this.tag;n.isSelfClosing=!1,(e=this.openTagHandler)==null||e.call(this,n),t.push(n),this.state=13,this.name=``}openSelfClosingTag(){var e,t;this.processAttribs();let{tags:n}=this,r=this.tag;r.isSelfClosing=!0,(e=this.openTagHandler)==null||e.call(this,r),(t=this.closeTagHandler)==null||t.call(this,r),(this.tag=n[n.length-1]??null)===null&&(this.closedRoot=!0),this.state=13,this.name=``}closeTag(){let{tags:e,name:t}=this;if(this.state=13,this.name=``,t===``){this.fail(`weird empty close tag.`),this.text+=`</>`;return}let n=this.closeTagHandler,r=e.length;for(;r-- >0;){let r=this.tag=e.pop();if(this.topNS=r.ns,n?.(r),r.name===t)break;this.fail(`unexpected close tag.`)}r===0?this.closedRoot=!0:r<0&&(this.fail(`unmatched closing tag: ${t}.`),this.text+=`</${t}>`)}parseEntity(e){if(e[0]!==`#`){let t=this.ENTITIES[e];return t===void 0?(this.fail(this.isName(e)?`undefined entity.`:`disallowed character in entity name.`),`&${e};`):t}let t=NaN;return e[1]===`x`&&/^#x[0-9a-f]+$/i.test(e)?t=parseInt(e.slice(2),16):/^#[0-9]+$/.test(e)&&(t=parseInt(e.slice(1),10)),this.isChar(t)?String.fromCodePoint(t):(this.fail(`malformed character entity.`),`&${e};`)}}}))();async function*ks(e){let t=new Os.SaxesParser({xmlns:!1,defaultXMLVersion:`1.0`}),n;t.on(`error`,e=>{n=e});let r=[];t.on(`opentag`,e=>r.push({eventType:`opentag`,value:e})),t.on(`text`,e=>r.push({eventType:`text`,value:e})),t.on(`closetag`,e=>r.push({eventType:`closetag`,value:e}));for await(let i of e){if(t.write(da(i)),n)throw n;yield r,r=[]}}var $=class e{prepare(e,t){}render(e,t){}parseOpen(e){}parseText(e){}parseClose(e){return!1}reconcile(e,t){}reset(){this.model=null,this.map&&Object.values(this.map).forEach(t=>{t instanceof e?t.reset():t.xform&&t.xform.reset()})}mergeModel(e){this.model=Object.assign(this.model||{},e)}async parse(e){for await(let t of e)for(let{eventType:e,value:n}of t)if(e===`opentag`)this.parseOpen(n);else if(e===`text`)this.parseText(n);else if(e===`closetag`&&!this.parseClose(n.name))return this.model;return this.model}async parseStream(e){return this.parse(ks(e))}get xml(){return this.toXml(this.model)}toXml(e){let t=new ws;return this.render(t,e),t.xml}static toAttribute(e,t,n=!1){if(e===void 0){if(n)return t}else if(n||e!==t)return e.toString()}static toStringAttribute(t,n,r=!1){return e.toAttribute(t,n,r)}static toStringValue(e,t){return e===void 0?t:e}static toBoolAttribute(e,t,n=!1){if(e===void 0){if(n)return t}else if(n||e!==t)return e?`1`:`0`}static toBoolValue(e,t){return e===void 0?t:e===`1`}static toIntAttribute(t,n,r=!1){return e.toAttribute(t,n,r)}static toIntValue(e,t){return e===void 0?t:parseInt(e,10)}static toFloatAttribute(t,n,r=!1){return e.toAttribute(t,n,r)}static toFloatValue(e,t){return e===void 0?t:parseFloat(e)}};function As(e,t){e.openNode(t.tag,t.$),t.c&&t.c.forEach(t=>{As(e,t)}),t.t&&e.writeText(t.t),e.closeNode()}var js=class extends ${constructor(e){super(),this._model=e}render(e){if(!this._xml){let e=new ws;As(e,this._model),this._xml=e.xml}e.writeXml(this._xml)}parseOpen(){return!0}parseText(){}parseClose(e){switch(e){case this._model.tag:return!1;default:return!0}}},Ms=class extends ${constructor(e){super(),this.tag=e.tag,this.always=!!e.always,this.count=e.count,this.empty=e.empty,this.$count=e.$count||`count`,this.$=e.$,this.childXform=e.childXform,this.maxItems=e.maxItems}prepare(e,t){let{childXform:n}=this;e&&e.forEach((e,r)=>{t.index=r,n.prepare(e,t)})}render(e,t){if(this.always||t&&t.length){e.openNode(this.tag,this.$),this.count&&e.addAttribute(this.$count,t&&t.length||0);let{childXform:n}=this;(t||[]).forEach((t,r)=>{n.render(e,t,r)}),e.closeNode()}else this.empty&&e.leafNode(this.tag)}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:return this.model=[],!0;default:return this.childXform.parseOpen(e)?(this.parser=this.childXform,!0):!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)&&(this.model.push(this.parser.model),this.parser=void 0,this.maxItems&&this.model.length>this.maxItems))throw Error(`Max ${this.childXform.tag} count (${this.maxItems}) exceeded`);return!0}return!1}reconcile(e,t){if(e){let{childXform:n}=this;e.forEach(e=>{n.reconcile(e,t)})}}reset(){super.reset(),this.childXform&&this.childXform.reset()}},Ns=class extends ${constructor(e){super(),this.name=e||`color`}get tag(){return this.name}render(e,t){return t?(e.openNode(this.name),t.argb?e.addAttribute(`rgb`,t.argb):t.theme===void 0?t.indexed===void 0?e.addAttribute(`auto`,`1`):e.addAttribute(`indexed`,t.indexed):(e.addAttribute(`theme`,t.theme),t.tint!==void 0&&e.addAttribute(`tint`,t.tint)),e.closeNode(),!0):!1}parseOpen(e){return e.name===this.name?(e.attributes.rgb?this.model={argb:e.attributes.rgb}:e.attributes.theme?(this.model={theme:parseInt(e.attributes.theme,10)},e.attributes.tint&&(this.model.tint=parseFloat(e.attributes.tint))):e.attributes.indexed?this.model={indexed:parseInt(e.attributes.indexed,10)}:this.model=void 0,!0):!1}parseText(){}parseClose(){return!1}},Ps=class extends ${constructor(e){super(),this.tag=e.tag,this.attr=e.attr}render(e,t){t&&(e.openNode(this.tag),e.closeNode())}parseOpen(e){e.name===this.tag&&(this.model=!0)}parseText(){}parseClose(){return!1}},Fs=class extends ${constructor(e){super(),this.tag=e.tag,this.attr=e.attr,this.attrs=e.attrs,this.zero=e.zero,this.text=[]}render(e,t){(t||this.zero)&&(e.openNode(this.tag),this.attrs&&e.addAttributes(this.attrs),this.attr?e.addAttribute(this.attr,t):e.writeText(t),e.closeNode())}parseOpen(e){return e.name===this.tag?(this.attr?this.model=parseInt(e.attributes[this.attr],10):this.text=[],!0):!1}parseText(e){this.attr||this.text.push(e)}parseClose(){return this.attr||(this.model=parseInt(this.text.join(``)||`0`,10)),!1}},Is=class extends ${constructor(e){super(),this.tag=e.tag,this.attr=e.attr,this.attrs=e.attrs,this.text=[]}render(e,t){t!==void 0&&(e.openNode(this.tag),this.attrs&&e.addAttributes(this.attrs),this.attr?e.addAttribute(this.attr,t):e.writeText(t),e.closeNode())}parseOpen(e){e.name===this.tag&&(this.attr?this.model=e.attributes[this.attr]:this.text=[])}parseText(e){this.attr||this.text.push(e)}parseClose(){return this.attr||(this.model=this.text.join(``)),!1}},Ls=class e extends ${static{this.Attributes={single:{},double:{val:`double`},singleAccounting:{val:`singleAccounting`},doubleAccounting:{val:`doubleAccounting`}}}constructor(e){super(),this.model=e}get tag(){return`u`}render(t,n){if(n||=this.model,n===!0)t.leafNode(`u`);else{let r=e.Attributes[n];r&&t.leafNode(`u`,r)}}parseOpen(e){e.name===`u`&&(this.model=e.attributes.val||!0)}parseText(){}parseClose(){return!1}},Rs=class e extends ${constructor(t){super(),this.options=t||e.OPTIONS,this.map={b:{prop:`bold`,xform:new Ps({tag:`b`,attr:`val`})},i:{prop:`italic`,xform:new Ps({tag:`i`,attr:`val`})},u:{prop:`underline`,xform:new Ls},charset:{prop:`charset`,xform:new Fs({tag:`charset`,attr:`val`})},color:{prop:`color`,xform:new Ns},condense:{prop:`condense`,xform:new Ps({tag:`condense`,attr:`val`})},extend:{prop:`extend`,xform:new Ps({tag:`extend`,attr:`val`})},family:{prop:`family`,xform:new Fs({tag:`family`,attr:`val`})},outline:{prop:`outline`,xform:new Ps({tag:`outline`,attr:`val`})},vertAlign:{prop:`vertAlign`,xform:new Is({tag:`vertAlign`,attr:`val`})},scheme:{prop:`scheme`,xform:new Is({tag:`scheme`,attr:`val`})},shadow:{prop:`shadow`,xform:new Ps({tag:`shadow`,attr:`val`})},strike:{prop:`strike`,xform:new Ps({tag:`strike`,attr:`val`})},sz:{prop:`size`,xform:new Fs({tag:`sz`,attr:`val`})}},this.map[this.options.fontNameTag]={prop:`name`,xform:new Is({tag:this.options.fontNameTag,attr:`val`})}}get tag(){return this.options.tagName}render(e,t){let{map:n}=this;e.openNode(this.options.tagName),Object.entries(this.map).forEach(([r,i])=>{n[r].xform.render(e,t[i.prop])}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if(this.map[e.name])return this.parser=this.map[e.name].xform,this.parser.parseOpen(e);switch(e.name){case this.options.tagName:return this.model={},!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser&&!this.parser.parseClose(e)){let t=this.map[e];return this.parser.model&&(this.model[t.prop]=this.parser.model),this.parser=void 0,!0}switch(e){case this.options.tagName:return!1;default:return!0}}static{this.OPTIONS={tagName:`font`,fontNameTag:`name`}}},zs=class extends ${constructor(){super(),this.map={color:new Ns}}get tag(){return`stop`}render(e,t){e.openNode(`stop`),e.addAttribute(`position`,t.position),this.map.color.render(e,t.color),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`stop`:return this.model={position:parseFloat(e.attributes.position)},!0;case`color`:return this.parser=this.map.color,this.parser.parseOpen(e),!0;default:return!1}}parseText(){}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.model.color=this.parser.model,this.parser=void 0),!0):!1}},Bs=class extends ${constructor(){super(),this.map={fgColor:new Ns(`fgColor`),bgColor:new Ns(`bgColor`)}}get name(){return`pattern`}get tag(){return`patternFill`}render(e,t){e.openNode(`patternFill`),e.addAttribute(`patternType`,t.pattern),t.fgColor&&this.map.fgColor.render(e,t.fgColor),t.bgColor&&this.map.bgColor.render(e,t.bgColor),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`patternFill`:return this.model={type:`pattern`,pattern:e.attributes.patternType},!0;default:return this.parser=this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser.model&&(this.model[e]=this.parser.model),this.parser=void 0),!0):!1}},Vs=class extends ${constructor(){super(),this.map={stop:new zs}}get name(){return`gradient`}get tag(){return`gradientFill`}render(e,t){switch(e.openNode(`gradientFill`),t.gradient){case`angle`:e.addAttribute(`degree`,t.degree);break;case`path`:e.addAttribute(`type`,`path`),t.center.left&&(e.addAttribute(`left`,t.center.left),t.center.right===void 0&&e.addAttribute(`right`,t.center.left)),t.center.right&&e.addAttribute(`right`,t.center.right),t.center.top&&(e.addAttribute(`top`,t.center.top),t.center.bottom===void 0&&e.addAttribute(`bottom`,t.center.top)),t.center.bottom&&e.addAttribute(`bottom`,t.center.bottom);break;default:break}let n=this.map.stop;t.stops.forEach(t=>{n.render(e,t)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`gradientFill`:{let t=this.model={stops:[]};return e.attributes.degree?(t.gradient=`angle`,t.degree=parseInt(e.attributes.degree,10)):e.attributes.type===`path`&&(t.gradient=`path`,t.center={left:e.attributes.left?parseFloat(e.attributes.left):0,top:e.attributes.top?parseFloat(e.attributes.top):0},e.attributes.right!==e.attributes.left&&(t.center.right=e.attributes.right?parseFloat(e.attributes.right):0),e.attributes.bottom!==e.attributes.top&&(t.center.bottom=e.attributes.bottom?parseFloat(e.attributes.bottom):0)),!0}case`stop`:return this.parser=this.map.stop,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.model.stops.push(this.parser.model),this.parser=void 0),!0):!1}},Hs=class e extends ${constructor(){super(),this.map={patternFill:new Bs,gradientFill:new Vs}}get tag(){return`fill`}render(e,t){switch(e.addRollback(),e.openNode(`fill`),t.type){case`pattern`:this.map.patternFill.render(e,t);break;case`gradient`:this.map.gradientFill.render(e,t);break;default:e.rollback();return}e.closeNode(),e.commit()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`fill`:return this.model={},!0;default:return this.parser=this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.model=this.parser.model,this.model.type=this.parser.name,this.parser=void 0),!0):!1}validStyle(t){return e.validPatternValues[t]}static{this.validPatternValues=[`none`,`solid`,`darkVertical`,`darkGray`,`mediumGray`,`lightGray`,`gray125`,`gray0625`,`darkHorizontal`,`darkVertical`,`darkDown`,`darkUp`,`darkGrid`,`darkTrellis`,`lightHorizontal`,`lightVertical`,`lightDown`,`lightUp`,`lightGrid`,`lightTrellis`,`lightGrid`].reduce((e,t)=>(e[t]=!0,e),{})}static{this.StopXform=zs}static{this.PatternFillXform=Bs}static{this.GradientFillXform=Vs}},Us=class e extends ${constructor(e){super(),this.name=e,this.map={color:new Ns}}get tag(){return this.name}render(e,t,n){let r=t&&t.color||n||this.defaultColor;e.openNode(this.name),t&&t.style&&(e.addAttribute(`style`,t.style),r&&this.map.color.render(e,r)),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.name:{let{style:t}=e.attributes;return t?this.model={style:t}:this.model=void 0,!0}case`color`:return this.parser=this.map.color,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):(e===this.name&&this.map.color.model&&(this.model||={},this.model.color=this.map.color.model),!1)}validStyle(t){return e.validStyleValues[t]}static{this.validStyleValues=[`thin`,`dashed`,`dotted`,`dashDot`,`hair`,`dashDotDot`,`slantDashDot`,`mediumDashed`,`mediumDashDotDot`,`mediumDashDot`,`medium`,`double`,`thick`].reduce((e,t)=>(e[t]=!0,e),{})}},Ws=class extends ${constructor(){super(),this.map={top:new Us(`top`),left:new Us(`left`),bottom:new Us(`bottom`),right:new Us(`right`),diagonal:new Us(`diagonal`)}}render(e,t){let{color:n}=t;e.openNode(`border`),t.diagonal&&t.diagonal.style&&(t.diagonal.up&&e.addAttribute(`diagonalUp`,`1`),t.diagonal.down&&e.addAttribute(`diagonalDown`,`1`));let r=(r,i)=>{let a=r;a&&!a.color&&t.color&&(a={...a,color:t.color}),i.render(e,a,n)};r(t.left,this.map.left),r(t.right,this.map.right),r(t.top,this.map.top),r(t.bottom,this.map.bottom),r(t.diagonal,this.map.diagonal),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`border`:return this.reset(),this.diagonalUp=sa(e.attributes.diagonalUp),this.diagonalDown=sa(e.attributes.diagonalDown),!0;default:return this.parser=this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;if(e===`border`){let e=this.model={},t=(t,n,r)=>{n&&(r&&Object.assign(n,r),e[t]=n)};t(`left`,this.map.left.model),t(`right`,this.map.right.model),t(`top`,this.map.top.model),t(`bottom`,this.map.bottom.model),t(`diagonal`,this.map.diagonal.model,{up:this.diagonalUp,down:this.diagonalDown})}return!1}};let Gs={0:{f:`General`},1:{f:`0`},2:{f:`0.00`},3:{f:`#,##0`},4:{f:`#,##0.00`},9:{f:`0%`},10:{f:`0.00%`},11:{f:`0.00E+00`},12:{f:`# ?/?`},13:{f:`# ??/??`},14:{f:`mm-dd-yy`},15:{f:`d-mmm-yy`},16:{f:`d-mmm`},17:{f:`mmm-yy`},18:{f:`h:mm AM/PM`},19:{f:`h:mm:ss AM/PM`},20:{f:`h:mm`},21:{f:`h:mm:ss`},22:{f:`m/d/yy "h":mm`},27:{"zh-tw":`[$-404]e/m/d`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`[$-411]ge.m.d`,"ko-kr":`yyyy"年" mm"月" dd"日"`},28:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},29:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},30:{"zh-tw":`m/d/yy `,"zh-cn":`m-d-yy`,"ja-jp":`m/d/yy`,"ko-kr":`mm-dd-yy`},31:{"zh-tw":`yyyy"年"m"月"d"日"`,"zh-cn":`yyyy"年"m"月"d"日"`,"ja-jp":`yyyy"年"m"月"d"日"`,"ko-kr":`yyyy"년" mm"월" dd"일"`},32:{"zh-tw":`hh"時"mm"分"`,"zh-cn":`h"时"mm"分"`,"ja-jp":`h"時"mm"分"`,"ko-kr":`h"시" mm"분"`},33:{"zh-tw":`hh"時"mm"分"ss"秒"`,"zh-cn":`h"时"mm"分"ss"秒"`,"ja-jp":`h"時"mm"分"ss"秒"`,"ko-kr":`h"시" mm"분" ss"초"`},34:{"zh-tw":`上午/下午 hh"時"mm"分"`,"zh-cn":`上午/下午 h"时"mm"分"`,"ja-jp":`yyyy"年"m"月"`,"ko-kr":`yyyy-mm-dd`},35:{"zh-tw":`上午/下午 hh"時"mm"分"ss"秒"`,"zh-cn":`上午/下午 h"时"mm"分"ss"秒"`,"ja-jp":`m"月"d"日"`,"ko-kr":`yyyy-mm-dd`},36:{"zh-tw":`[$-404]e/m/d`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`[$-411]ge.m.d`,"ko-kr":`yyyy"年" mm"月" dd"日"`},37:{f:`#,##0 ;(#,##0)`},38:{f:`#,##0 ;[Red](#,##0)`},39:{f:`#,##0.00 ;(#,##0.00)`},40:{f:`#,##0.00 ;[Red](#,##0.00)`},45:{f:`mm:ss`},46:{f:`[h]:mm:ss`},47:{f:`mmss.0`},48:{f:`##0.0E+0`},49:{f:`@`},50:{"zh-tw":`[$-404]e/m/d`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`[$-411]ge.m.d`,"ko-kr":`yyyy"年" mm"月" dd"日"`},51:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},52:{"zh-tw":`上午/下午 hh"時"mm"分"`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`yyyy"年"m"月"`,"ko-kr":`yyyy-mm-dd`},53:{"zh-tw":`上午/下午 hh"時"mm"分"ss"秒"`,"zh-cn":`m"月"d"日"`,"ja-jp":`m"月"d"日"`,"ko-kr":`yyyy-mm-dd`},54:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},55:{"zh-tw":`上午/下午 hh"時"mm"分"`,"zh-cn":`上午/下午 h"时"mm"分"`,"ja-jp":`yyyy"年"m"月"`,"ko-kr":`yyyy-mm-dd`},56:{"zh-tw":`上午/下午 hh"時"mm"分"ss"秒"`,"zh-cn":`上午/下午 h"时"mm"分"ss"秒"`,"ja-jp":`m"月"d"日"`,"ko-kr":`yyyy-mm-dd`},57:{"zh-tw":`[$-404]e/m/d`,"zh-cn":`yyyy"年"m"月"`,"ja-jp":`[$-411]ge.m.d`,"ko-kr":`yyyy"年" mm"月" dd"日"`},58:{"zh-tw":`[$-404]e"年"m"月"d"日"`,"zh-cn":`m"月"d"日"`,"ja-jp":`[$-411]ggge"年"m"月"d"日"`,"ko-kr":`mm-dd`},59:{"th-th":`t0`},60:{"th-th":`t0.00`},61:{"th-th":`t#,##0`},62:{"th-th":`t#,##0.00`},67:{"th-th":`t0%`},68:{"th-th":`t0.00%`},69:{"th-th":`t# ?/?`},70:{"th-th":`t# ??/??`},81:{"th-th":`d/m/bb`}};function Ks(){let e={};return Object.entries(Gs).forEach(([t,n])=>{n.f&&(e[n.f]=parseInt(t,10))}),e}let qs=Ks();var Js=class extends ${constructor(e,t){super(),this.id=e,this.formatCode=t}get tag(){return`numFmt`}render(e,t){e.leafNode(`numFmt`,{numFmtId:t.id,formatCode:t.formatCode})}parseOpen(e){switch(e.name){case`numFmt`:return this.model={id:parseInt(e.attributes.numFmtId,10),formatCode:e.attributes.formatCode.replace(/[\\](.)/g,`$1`)},!0;default:return!1}}parseText(){}parseClose(){return!1}static getDefaultFmtId(e){return qs[e]}static getDefaultFmtCode(e){return Gs[e]&&Gs[e].f}};let Ys={ReadingOrder:{LeftToRight:1,RightToLeft:2}},Xs={horizontalValues:[`left`,`center`,`right`,`fill`,`centerContinuous`,`distributed`,`justify`].reduce((e,t)=>(e[t]=!0,e),{}),horizontal(e){return this.horizontalValues[e]?e:void 0},verticalValues:[`top`,`middle`,`bottom`,`distributed`,`justify`].reduce((e,t)=>(e[t]=!0,e),{}),vertical(e){return e===`middle`?`center`:this.verticalValues[e]?e:void 0},wrapText(e){return e?!0:void 0},shrinkToFit(e){return e?!0:void 0},textRotation(e){switch(e){case`vertical`:return e;default:{let t=ia(e);return t!==void 0&&t>=-90&&t<=90?t:void 0}}},indent(e){let t=ia(e);return Math.max(0,t)},readingOrder(e){switch(e){case`ltr`:return Ys.ReadingOrder.LeftToRight;case`rtl`:return Ys.ReadingOrder.RightToLeft;default:return}}},Zs={toXml(e){let t=Xs.textRotation(e);if(t){if(t===`vertical`)return 255;let e=Math.round(t);if(e>=0&&e<=90)return e;if(e<0&&e>=-90)return 90-e}},toModel(e){let t=ia(e);if(t!==void 0){if(t===255)return`vertical`;if(t>=0&&t<=90)return t;if(t>90&&t<=180)return 90-t}}};var Qs=class extends ${get tag(){return`alignment`}render(e,t){e.addRollback(),e.openNode(`alignment`);let n=!1;function r(t,r){r&&(e.addAttribute(t,r),n=!0)}r(`horizontal`,Xs.horizontal(t.horizontal)),r(`vertical`,Xs.vertical(t.vertical)),r(`wrapText`,Xs.wrapText(t.wrapText)?`1`:!1),r(`shrinkToFit`,Xs.shrinkToFit(t.shrinkToFit)?`1`:!1),r(`indent`,Xs.indent(t.indent)),r(`textRotation`,Zs.toXml(t.textRotation)),r(`readingOrder`,Xs.readingOrder(t.readingOrder)),e.closeNode(),n?e.commit():e.rollback()}parseOpen(e){let t={},n=!1;function r(e,r,i){e&&(t[r]=i,n=!0)}r(e.attributes.horizontal,`horizontal`,e.attributes.horizontal),r(e.attributes.vertical,`vertical`,e.attributes.vertical===`center`?`middle`:e.attributes.vertical),r(e.attributes.wrapText,`wrapText`,sa(e.attributes.wrapText)),r(e.attributes.shrinkToFit,`shrinkToFit`,sa(e.attributes.shrinkToFit)),r(e.attributes.indent,`indent`,parseInt(e.attributes.indent,10)),r(e.attributes.textRotation,`textRotation`,Zs.toModel(e.attributes.textRotation)),r(e.attributes.readingOrder,`readingOrder`,e.attributes.readingOrder===`2`?`rtl`:`ltr`),this.model=n?t:null}parseText(){}parseClose(){return!1}};let $s={boolean(e,t){return e===void 0?t:e}};var ec=class extends ${get tag(){return`protection`}render(e,t){e.addRollback(),e.openNode(`protection`);let n=!1;function r(t,r){r!==void 0&&(e.addAttribute(t,r),n=!0)}r(`locked`,$s.boolean(t.locked,!0)?void 0:`0`),r(`hidden`,$s.boolean(t.hidden,!1)?`1`:void 0),e.closeNode(),n?e.commit():e.rollback()}parseOpen(e){let t={locked:e.attributes.locked!==`0`,hidden:e.attributes.hidden===`1`};this.model=!t.locked||t.hidden?t:null}parseText(){}parseClose(){return!1}},tc=class extends ${constructor(e){super(),this.xfId=!!(e&&e.xfId),this.map={alignment:new Qs,protection:new ec}}get tag(){return`xf`}render(e,t){e.openNode(`xf`,{numFmtId:t.numFmtId||0,fontId:t.fontId||0,fillId:t.fillId||0,borderId:t.borderId||0}),this.xfId&&e.addAttribute(`xfId`,t.xfId||0),t.numFmtId&&e.addAttribute(`applyNumberFormat`,`1`),t.fontId&&e.addAttribute(`applyFont`,`1`),t.fillId&&e.addAttribute(`applyFill`,`1`),t.borderId&&e.addAttribute(`applyBorder`,`1`),t.alignment&&e.addAttribute(`applyAlignment`,`1`),t.protection&&e.addAttribute(`applyProtection`,`1`),t.alignment&&this.map.alignment.render(e,t.alignment),t.protection&&this.map.protection.render(e,t.protection),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`xf`:return this.model={numFmtId:parseInt(e.attributes.numFmtId,10),fontId:parseInt(e.attributes.fontId,10),fillId:parseInt(e.attributes.fillId,10),borderId:parseInt(e.attributes.borderId,10)},this.xfId&&(this.model.xfId=parseInt(e.attributes.xfId,10)),!0;case`alignment`:return this.parser=this.map.alignment,this.parser.parseOpen(e),!0;case`protection`:return this.parser=this.map.protection,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.map.protection===this.parser?this.model.protection=this.parser.model:this.model.alignment=this.parser.model,this.parser=void 0),!0):e!==`xf`}},nc=class extends ${constructor(){super(),this.map={alignment:new Qs,border:new Ws,fill:new Hs,font:new Rs,numFmt:new Js,protection:new ec}}get tag(){return`dxf`}render(e,t){if(e.openNode(this.tag),t.font&&this.map.font.render(e,t.font),t.numFmt&&t.numFmtId){let n={id:t.numFmtId,formatCode:t.numFmt};this.map.numFmt.render(e,n)}t.fill&&this.map.fill.render(e,t.fill),t.alignment&&this.map.alignment.render(e,t.alignment),t.border&&this.map.border.render(e,t.border),t.protection&&this.map.protection.render(e,t.protection),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:return this.reset(),!0;default:return this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e),!0}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):e===this.tag?(this.model={alignment:this.map.alignment.model,border:this.map.border.model,fill:this.map.fill.model,font:this.map.font.model,numFmt:this.map.numFmt.model,protection:this.map.protection.model},!1):!0}},rc=class e extends ${constructor(t){super(),this.map={numFmts:new Ms({tag:`numFmts`,count:!0,childXform:new Js}),fonts:new Ms({tag:`fonts`,count:!0,childXform:new Rs,$:{"x14ac:knownFonts":1}}),fills:new Ms({tag:`fills`,count:!0,childXform:new Hs}),borders:new Ms({tag:`borders`,count:!0,childXform:new Ws}),cellStyleXfs:new Ms({tag:`cellStyleXfs`,count:!0,childXform:new tc}),cellXfs:new Ms({tag:`cellXfs`,count:!0,childXform:new tc({xfId:!0})}),dxfs:new Ms({tag:`dxfs`,always:!0,count:!0,childXform:new nc}),numFmt:new Js,font:new Rs,fill:new Hs,border:new Ws,style:new tc({xfId:!0}),cellStyles:e.STATIC_XFORMS.cellStyles,tableStyles:e.STATIC_XFORMS.tableStyles,extLst:e.STATIC_XFORMS.extLst},t&&this.init()}initIndex(){this.index={style:{},numFmt:{},numFmtNextId:164,font:{},border:{},fill:{}}}init(){this.model={styles:[],numFmts:[],fonts:[],borders:[],fills:[],dxfs:[]},this.initIndex(),this._addBorder({}),this._addStyle({numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}),this._addFill({type:`pattern`,pattern:`none`}),this._addFill({type:`pattern`,pattern:`gray125`}),this.weakMap=new WeakMap}render(t,n){let r=n||this.model;t.openXml(ws.StdDocAttributes),t.openNode(`styleSheet`,e.STYLESHEET_ATTRIBUTES),this.index?(r.numFmts&&r.numFmts.length&&(t.openNode(`numFmts`,{count:r.numFmts.length}),r.numFmts.forEach(e=>{t.writeXml(e)}),t.closeNode()),r.fonts.length||this._addFont({size:11,color:{theme:1},name:`Calibri`,family:2,scheme:`minor`}),t.openNode(`fonts`,{count:r.fonts.length,"x14ac:knownFonts":1}),r.fonts.forEach(e=>{t.writeXml(e)}),t.closeNode(),t.openNode(`fills`,{count:r.fills.length}),r.fills.forEach(e=>{t.writeXml(e)}),t.closeNode(),t.openNode(`borders`,{count:r.borders.length}),r.borders.forEach(e=>{t.writeXml(e)}),t.closeNode(),this.map.cellStyleXfs.render(t,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),t.openNode(`cellXfs`,{count:r.styles.length}),r.styles.forEach(e=>{t.writeXml(e)}),t.closeNode()):(this.map.numFmts.render(t,r.numFmts),this.map.fonts.render(t,r.fonts),this.map.fills.render(t,r.fills),this.map.borders.render(t,r.borders),this.map.cellStyleXfs.render(t,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),this.map.cellXfs.render(t,r.styles)),e.STATIC_XFORMS.cellStyles.render(t),this.map.dxfs.render(t,r.dxfs),e.STATIC_XFORMS.tableStyles.render(t),e.STATIC_XFORMS.extLst.render(t),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`styleSheet`:return this.initIndex(),!0;default:return this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e),!0}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`styleSheet`:{this.model={};let e=(e,t)=>{t.model&&t.model.length&&(this.model[e]=t.model)};if(e(`numFmts`,this.map.numFmts),e(`fonts`,this.map.fonts),e(`fills`,this.map.fills),e(`borders`,this.map.borders),e(`styles`,this.map.cellXfs),e(`dxfs`,this.map.dxfs),this.index={model:[],numFmt:{}},this.model.numFmts){let e=this.index.numFmt;this.model.numFmts.forEach(t=>{e[t.id]=t.formatCode})}return!1}default:return!0}}addStyleModel(e,t){if(!e)return 0;if(this.model.fonts.length||this._addFont({size:11,color:{theme:1},name:`Calibri`,family:2,scheme:`minor`}),this.weakMap&&this.weakMap.has(e))return this.weakMap.get(e);let n={},r=t||S.ValueType.Number;if(e.numFmt)n.numFmtId=this._addNumFmtStr(e.numFmt);else switch(r){case S.ValueType.Number:n.numFmtId=this._addNumFmtStr(`General`);break;case S.ValueType.Date:n.numFmtId=this._addNumFmtStr(`mm-dd-yy`);break;default:break}e.font&&(n.fontId=this._addFont(e.font)),e.border&&(n.borderId=this._addBorder(e.border)),e.fill&&(n.fillId=this._addFill(e.fill)),e.alignment&&(n.alignment=e.alignment),e.protection&&(n.protection=e.protection);let i=this._addStyle(n);return this.weakMap&&this.weakMap.set(e,i),i}getStyleModel(e){let t=this.model.styles[e];if(!t)return null;let n=this.index.model[e];if(n)return n;if(n=this.index.model[e]={},t.numFmtId){let e=this.index.numFmt[t.numFmtId]||Js.getDefaultFmtCode(t.numFmtId);e&&(n.numFmt=e)}function r(e,t,r){if(r||r===0){let i=t[r];i&&(n[e]=i)}}return r(`font`,this.model.fonts,t.fontId),r(`border`,this.model.borders,t.borderId),r(`fill`,this.model.fills,t.fillId),t.alignment&&(n.alignment=t.alignment),t.protection&&(n.protection=t.protection),n}addDxfStyle(e){return e.numFmt&&(e.numFmtId=this._addNumFmtStr(e.numFmt)),this.model.dxfs.push(e),this.model.dxfs.length-1}getDxfStyle(e){return this.model.dxfs[e]}_addStyle(e){let t=this.map.style.toXml(e),n=this.index.style[t];return n===void 0&&(n=this.index.style[t]=this.model.styles.length,this.model.styles.push(t)),n}_addNumFmtStr(e){let t=Js.getDefaultFmtId(e);if(t!==void 0||(t=this.index.numFmt[e],t!==void 0))return t;t=this.index.numFmt[e]=164+this.model.numFmts.length;let n=this.map.numFmt.toXml({id:t,formatCode:e});return this.model.numFmts.push(n),t}_addFont(e){let t=this.map.font.toXml(e),n=this.index.font[t];return n===void 0&&(n=this.index.font[t]=this.model.fonts.length,this.model.fonts.push(t)),n}_addBorder(e){let t=this.map.border.toXml(e),n=this.index.border[t];return n===void 0&&(n=this.index.border[t]=this.model.borders.length,this.model.borders.push(t)),n}_addFill(e){let t=this.map.fill.toXml(e),n=this.index.fill[t];return n===void 0&&(n=this.index.fill[t]=this.model.fills.length,this.model.fills.push(t)),n}static{this.STYLESHEET_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`x14ac x16r2`,"xmlns:x14ac":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac`,"xmlns:x16r2":`http://schemas.microsoft.com/office/spreadsheetml/2015/02/main`}}static{this.STATIC_XFORMS={cellStyles:new js({tag:`cellStyles`,$:{count:1},c:[{tag:`cellStyle`,$:{name:`Normal`,xfId:0,builtinId:0}}]}),dxfs:new js({tag:`dxfs`,$:{count:0}}),tableStyles:new js({tag:`tableStyles`,$:{count:0,defaultTableStyle:`TableStyleMedium2`,defaultPivotStyle:`PivotStyleLight16`}}),extLst:new js({tag:`extLst`,c:[{tag:`ext`,$:{uri:`{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}`,"xmlns:x14":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/main`},c:[{tag:`x14:slicerStyles`,$:{defaultSlicerStyle:`SlicerStyleLight1`}}]},{tag:`ext`,$:{uri:`{9260A510-F301-46a8-8635-F512D64BE5F5}`,"xmlns:x15":`http://schemas.microsoft.com/office/spreadsheetml/2010/11/main`},c:[{tag:`x15:timelineStyles`,$:{defaultTimelineStyle:`TimeSlicerStyleLight1`}}]}]})}}};rc.Mock=class extends rc{constructor(){super(),this.model={styles:[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}],numFmts:[],fonts:[{size:11,color:{theme:1},name:`Calibri`,family:2,scheme:`minor`}],borders:[{}],fills:[{type:`pattern`,pattern:`none`},{type:`pattern`,pattern:`gray125`}]}}parseStream(e){return e.autodrain(),Promise.resolve()}addStyleModel(e,t){switch(t){case S.ValueType.Date:return this.dateStyleId;default:return 0}}get dateStyleId(){if(!this._dateStyleId){let e={numFmtId:Js.getDefaultFmtId(`mm-dd-yy`)};this._dateStyleId=this.model.styles.length,this.model.styles.push(e)}return this._dateStyleId}getStyleModel(){return{}}};var ic=class extends ${constructor(e){super(),this.tag=e.tag,this.attr=e.attr,this.attrs=e.attrs,this.text=[],this._format=e.format||function(e){try{return Number.isNaN(e.getTime())?``:e.toISOString()}catch{return``}},this._parse=e.parse||function(e){return new Date(e)}}render(e,t){t&&(e.openNode(this.tag),this.attrs&&e.addAttributes(this.attrs),this.attr?e.addAttribute(this.attr,this._format(t)):e.writeText(this._format(t)),e.closeNode())}parseOpen(e){e.name===this.tag&&(this.attr?this.model=this._parse(e.attributes[this.attr]):this.text=[])}parseText(e){this.attr||this.text.push(e)}parseClose(){return this.attr||(this.model=this._parse(this.text.join(``))),!1}},ac=class e extends ${constructor(){super(),this.map={"dc:creator":new Is({tag:`dc:creator`}),"dc:title":new Is({tag:`dc:title`}),"dc:subject":new Is({tag:`dc:subject`}),"dc:description":new Is({tag:`dc:description`}),"dc:identifier":new Is({tag:`dc:identifier`}),"dc:language":new Is({tag:`dc:language`}),"cp:keywords":new Is({tag:`cp:keywords`}),"cp:category":new Is({tag:`cp:category`}),"cp:lastModifiedBy":new Is({tag:`cp:lastModifiedBy`}),"cp:lastPrinted":new ic({tag:`cp:lastPrinted`,format:e.DateFormat}),"cp:revision":new Fs({tag:`cp:revision`}),"cp:version":new Is({tag:`cp:version`}),"cp:contentStatus":new Is({tag:`cp:contentStatus`}),"cp:contentType":new Is({tag:`cp:contentType`}),"dcterms:created":new ic({tag:`dcterms:created`,attrs:e.DateAttrs,format:e.DateFormat}),"dcterms:modified":new ic({tag:`dcterms:modified`,attrs:e.DateAttrs,format:e.DateFormat})}}render(t,n){t.openXml(ws.StdDocAttributes),t.openNode(`cp:coreProperties`,e.CORE_PROPERTY_ATTRIBUTES),this.map[`dc:creator`].render(t,n.creator),this.map[`dc:title`].render(t,n.title),this.map[`dc:subject`].render(t,n.subject),this.map[`dc:description`].render(t,n.description),this.map[`dc:identifier`].render(t,n.identifier),this.map[`dc:language`].render(t,n.language),this.map[`cp:keywords`].render(t,n.keywords),this.map[`cp:category`].render(t,n.category),this.map[`cp:lastModifiedBy`].render(t,n.lastModifiedBy),this.map[`cp:lastPrinted`].render(t,n.lastPrinted),this.map[`cp:revision`].render(t,n.revision),this.map[`cp:version`].render(t,n.version),this.map[`cp:contentStatus`].render(t,n.contentStatus),this.map[`cp:contentType`].render(t,n.contentType),this.map[`dcterms:created`].render(t,n.created),this.map[`dcterms:modified`].render(t,n.modified),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`cp:coreProperties`:case`coreProperties`:return!0;default:if(this.parser=this.map[e.name],this.parser)return this.parser.parseOpen(e),!0;throw Error(`Unexpected xml node in parseOpen: ${JSON.stringify(e)}`)}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`cp:coreProperties`:case`coreProperties`:return this.model={creator:this.map[`dc:creator`].model,title:this.map[`dc:title`].model,subject:this.map[`dc:subject`].model,description:this.map[`dc:description`].model,identifier:this.map[`dc:identifier`].model,language:this.map[`dc:language`].model,keywords:this.map[`cp:keywords`].model,category:this.map[`cp:category`].model,lastModifiedBy:this.map[`cp:lastModifiedBy`].model,lastPrinted:this.map[`cp:lastPrinted`].model,revision:this.map[`cp:revision`].model,contentStatus:this.map[`cp:contentStatus`].model,contentType:this.map[`cp:contentType`].model,created:this.map[`dcterms:created`].model,modified:this.map[`dcterms:modified`].model},!1;default:throw Error(`Unexpected xml node in parseClose: ${e}`)}}static{this.DateFormat=function(e){return e.toISOString().replace(/[.]\d{3}/,``)}}static{this.DateAttrs={"xsi:type":`dcterms:W3CDTF`}}static{this.CORE_PROPERTY_ATTRIBUTES={"xmlns:cp":`http://schemas.openxmlformats.org/package/2006/metadata/core-properties`,"xmlns:dc":`http://purl.org/dc/elements/1.1/`,"xmlns:dcterms":`http://purl.org/dc/terms/`,"xmlns:dcmitype":`http://purl.org/dc/dcmitype/`,"xmlns:xsi":`http://www.w3.org/2001/XMLSchema-instance`}}},oc=class extends ${get tag(){return`t`}render(e,t){e.openNode(`t`),/^\s|\n|\s$/.test(t)&&e.addAttribute(`xml:space`,`preserve`),e.writeText(t),e.closeNode()}parseOpen(e){switch(e.name){case`t`:return this._text=[],this.model=``,!0;default:return!1}}parseText(e){this._text.push(e),this.model=this._text.join(``).replace(/_x([0-9A-F]{4})_/g,(e,t)=>String.fromCharCode(parseInt(t,16)))}parseClose(){return!1}},sc=class e extends ${constructor(e){super(),this.model=e}get tag(){return`r`}get textXform(){return this._textXform||=new oc}get fontXform(){return this._fontXform||=new Rs(e.FONT_OPTIONS)}render(e,t){let n=t||this.model;e.openNode(`r`),n.font&&this.fontXform.render(e,n.font),this.textXform.render(e,n.text),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`r`:return this.model={},!0;case`t`:return this.parser=this.textXform,this.parser.parseOpen(e),!0;case`rPr`:return this.parser=this.fontXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){switch(e){case`r`:return!1;case`t`:return this.model.text=this.parser.model,this.parser=void 0,!0;case`rPr`:return this.model.font=this.parser.model,this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}static{this.FONT_OPTIONS={tagName:`rPr`,fontNameTag:`rFont`}}},cc=class extends ${constructor(){super(),this.map={r:new sc,t:new oc}}get tag(){return`rPh`}render(e,t){if(e.openNode(this.tag,{sb:t.sb||0,eb:t.eb||0}),t&&Object.prototype.hasOwnProperty.call(t,`richText`)&&t.richText){let{r:n}=this.map;t.richText.forEach(t=>{n.render(e,t)})}else t&&this.map.t.render(e,t.text);e.closeNode()}parseOpen(e){let{name:t}=e;return this.parser?(this.parser.parseOpen(e),!0):t===this.tag?(this.model={sb:parseInt(e.attributes.sb,10),eb:parseInt(e.attributes.eb,10)},!0):(this.parser=this.map[t],this.parser?(this.parser.parseOpen(e),!0):!1)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)){switch(e){case`r`:{let e=this.model.richText;e||=this.model.richText=[],e.push(this.parser.model);break}case`t`:this.model.text=this.parser.model;break;default:break}this.parser=void 0}return!0}switch(e){case this.tag:return!1;default:return!0}}},lc=class extends ${constructor(e){super(),this.model=e,this.map={r:new sc,t:new oc,rPh:new cc}}get tag(){return`si`}render(e,t){e.openNode(this.tag),t&&typeof t==`object`&&Object.prototype.hasOwnProperty.call(t,`richText`)&&t.richText?t.richText.length?t.richText.forEach(t=>{this.map.r.render(e,t)}):this.map.t.render(e,``):t!=null&&this.map.t.render(e,t),e.closeNode()}parseOpen(e){let{name:t}=e;return this.parser?(this.parser.parseOpen(e),!0):t===this.tag?(this.model={},!0):(this.parser=this.map[t],this.parser?(this.parser.parseOpen(e),!0):!1)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)){switch(e){case`r`:{let e=this.model.richText;e||=this.model.richText=[],e.push(this.parser.model);break}case`t`:this.model=this.parser.model;break;default:break}this.parser=void 0}return!0}switch(e){case this.tag:return!1;default:return!0}}},uc=class extends ${constructor(e){super(),this.model=e||{values:[],count:0},this.hash=Object.create(null),this.rich=Object.create(null)}get sharedStringXform(){return this._sharedStringXform||=new lc}get values(){return this.model.values}get uniqueCount(){return this.model.values.length}get count(){return this.model.count}getString(e){return this.model.values[e]}add(e){return e.richText?this.addRichText(e):this.addText(e)}addText(e){let t=this.hash[e];return t===void 0&&(t=this.hash[e]=this.model.values.length,this.model.values.push(e)),this.model.count++,t}addRichText(e){let t=this.sharedStringXform.toXml(e),n=this.rich[t];return n===void 0&&(n=this.rich[t]=this.model.values.length,this.model.values.push(e)),this.model.count++,n}render(e,t){let n=t||this._values;e.openXml(ws.StdDocAttributes),e.openNode(`sst`,{xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,count:n.count,uniqueCount:n.values.length});let r=this.sharedStringXform;n.values.forEach(t=>{r.render(e,t)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`sst`:return!0;case`si`:return this.parser=this.sharedStringXform,this.parser.parseOpen(e),!0;default:throw Error(`Unexpected xml node in parseOpen: ${JSON.stringify(e)}`)}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.values.push(this.parser.model),this.model.count++,this.parser=void 0),!0;switch(e){case`sst`:return!1;default:throw Error(`Unexpected xml node in parseClose: ${e}`)}}},dc=class extends ${render(e,t){e.leafNode(`Relationship`,t)}parseOpen(e){switch(e.name){case`Relationship`:return this.model=e.attributes,!0;default:return!1}}parseText(){}parseClose(){return!1}},fc=class e extends ${constructor(){super(),this.map={Relationship:new dc}}render(t,n){let r=n||this._values;t.openXml(ws.StdDocAttributes),t.openNode(`Relationships`,e.RELATIONSHIPS_ATTRIBUTES),r.forEach(e=>{this.map.Relationship.render(t,e)}),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`Relationships`:return this.model=[],!0;default:if(this.parser=this.map[e.name],this.parser)return this.parser.parseOpen(e),!0;throw Error(`Unexpected xml node in parseOpen: ${JSON.stringify(e)}`)}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.push(this.parser.model),this.parser=void 0),!0;switch(e){case`Relationships`:return!1;default:throw Error(`Unexpected xml node in parseClose: ${e}`)}}static{this.RELATIONSHIPS_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/package/2006/relationships`}}},pc=class e extends ${render(t,n){t.openXml(ws.StdDocAttributes),t.openNode(`Types`,e.PROPERTY_ATTRIBUTES);let r={};(n.media||[]).forEach(e=>{if(e.type===`image`){let n=e.extension;r[n]||(r[n]=!0,t.leafNode(`Default`,{Extension:n,ContentType:`image/${n}`}))}}),t.leafNode(`Default`,{Extension:`rels`,ContentType:`application/vnd.openxmlformats-package.relationships+xml`}),t.leafNode(`Default`,{Extension:`xml`,ContentType:`application/xml`}),t.leafNode(`Override`,{PartName:`/xl/workbook.xml`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml`}),n.worksheets.forEach((e,n)=>{let r=`/xl/worksheets/sheet${e.fileIndex||n+1}.xml`;t.leafNode(`Override`,{PartName:r,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml`})}),(n.pivotTables||[]).length&&(n.pivotTables||[]).forEach(e=>{let n=e.tableNumber;t.leafNode(`Override`,{PartName:`/xl/pivotCache/pivotCacheDefinition${n}.xml`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml`}),t.leafNode(`Override`,{PartName:`/xl/pivotCache/pivotCacheRecords${n}.xml`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml`}),t.leafNode(`Override`,{PartName:`/xl/pivotTables/pivotTable${n}.xml`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml`})}),t.leafNode(`Override`,{PartName:`/xl/theme/theme1.xml`,ContentType:`application/vnd.openxmlformats-officedocument.theme+xml`}),t.leafNode(`Override`,{PartName:`/xl/styles.xml`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml`}),n.sharedStrings&&n.sharedStrings.count&&t.leafNode(`Override`,{PartName:`/xl/sharedStrings.xml`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml`}),n.tables&&n.tables.forEach(e=>{t.leafNode(`Override`,{PartName:`/xl/tables/${e.target}`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml`})}),n.drawings&&n.drawings.forEach(e=>{t.leafNode(`Override`,{PartName:`/xl/drawings/${e.name}.xml`,ContentType:`application/vnd.openxmlformats-officedocument.drawing+xml`})}),n.commentRefs&&(t.leafNode(`Default`,{Extension:`vml`,ContentType:`application/vnd.openxmlformats-officedocument.vmlDrawing`}),n.commentRefs.forEach(({commentName:e})=>{t.leafNode(`Override`,{PartName:`/xl/${e}.xml`,ContentType:`application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml`})})),t.leafNode(`Override`,{PartName:`/docProps/core.xml`,ContentType:`application/vnd.openxmlformats-package.core-properties+xml`}),t.leafNode(`Override`,{PartName:`/docProps/app.xml`,ContentType:`application/vnd.openxmlformats-officedocument.extended-properties+xml`}),t.closeNode()}parseOpen(){return!1}parseText(){}parseClose(){return!1}static{this.PROPERTY_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/package/2006/content-types`}}},mc=class extends ${render(e,t){e.openNode(`HeadingPairs`),e.openNode(`vt:vector`,{size:2,baseType:`variant`}),e.openNode(`vt:variant`),e.leafNode(`vt:lpstr`,void 0,`Worksheets`),e.closeNode(),e.openNode(`vt:variant`),e.leafNode(`vt:i4`,void 0,t.length),e.closeNode(),e.closeNode(),e.closeNode()}parseOpen(e){return e.name===`HeadingPairs`}parseText(){}parseClose(e){return e!==`HeadingPairs`}},hc=class extends ${render(e,t){e.openNode(`TitlesOfParts`),e.openNode(`vt:vector`,{size:t.length,baseType:`lpstr`}),t.forEach(t=>{e.leafNode(`vt:lpstr`,void 0,t.name)}),e.closeNode(),e.closeNode()}parseOpen(e){return e.name===`TitlesOfParts`}parseText(){}parseClose(e){return e!==`TitlesOfParts`}},gc=class e extends ${constructor(){super(),this.map={Company:new Is({tag:`Company`}),Manager:new Is({tag:`Manager`}),HeadingPairs:new mc,TitleOfParts:new hc}}render(t,n){t.openXml(ws.StdDocAttributes),t.openNode(`Properties`,e.PROPERTY_ATTRIBUTES),t.leafNode(`Application`,void 0,`Microsoft Excel`),t.leafNode(`DocSecurity`,void 0,`0`),t.leafNode(`ScaleCrop`,void 0,`false`),this.map.HeadingPairs.render(t,n.worksheets),this.map.TitleOfParts.render(t,n.worksheets),this.map.Company.render(t,n.company||``),this.map.Manager.render(t,n.manager),t.leafNode(`LinksUpToDate`,void 0,`false`),t.leafNode(`SharedDoc`,void 0,`false`),t.leafNode(`HyperlinksChanged`,void 0,`false`),t.leafNode(`AppVersion`,void 0,`16.0300`),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`Properties`:return!0;default:return this.parser=this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`Properties`:return this.model={worksheets:this.map.TitleOfParts.model,company:this.map.Company.model,manager:this.map.Manager.model},!1;default:return!0}}static{this.DateFormat=function(e){return e.toISOString().replace(/[.]\d{3,6}/,``)}}static{this.DateAttrs={"xsi:type":`dcterms:W3CDTF`}}static{this.PROPERTY_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/officeDocument/2006/extended-properties`,"xmlns:vt":`http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes`}}},_c=class extends ${constructor(){super(),this._parsedText=[]}render(e,t){e.openNode(`definedName`,{name:t.name,localSheetId:t.localSheetId}),e.writeText(t.ranges.join(`,`)),e.closeNode()}parseOpen(e){switch(e.name){case`definedName`:return this._parsedName=e.attributes.name,this._parsedLocalSheetId=e.attributes.localSheetId,this._parsedText=[],!0;default:return!1}}parseText(e){this._parsedText.push(e)}parseClose(){return this.model={name:this._parsedName,ranges:Sc(this._parsedText.join(``))},this._parsedLocalSheetId!==void 0&&(this.model.localSheetId=parseInt(this._parsedLocalSheetId,10)),!1}};let vc=/^[$]?[A-Za-z]{1,3}[$]?\d+(:[$]?[A-Za-z]{1,3}[$]?\d+)?$/,yc=/^[$]?\d+:[$]?\d+$/,bc=/^[$]?[A-Za-z]{1,3}:[$]?[A-Za-z]{1,3}$/;function xc(e){if(e.startsWith(`{`)||e.endsWith(`}`))return!1;let t=e.split(`!`).pop()||``;if(!vc.test(t)&&!yc.test(t)&&!bc.test(t))return!1;try{let t=m.decodeEx(e);return`row`in t&&typeof t.row==`number`||`top`in t&&typeof t.top==`number`||`left`in t&&typeof t.left==`number`}catch{return!1}}function Sc(e){let t=e.trim();if(t.startsWith(`{`)&&t.endsWith(`}`))return[];let n=[],r=!1,i=``;return e.split(`,`).forEach(e=>{if(!e)return;let t=(e.match(/'/g)||[]).length;if(!t){r?i+=`${e},`:xc(e)&&n.push(e);return}let a=t%2==0;!r&&a&&xc(e)?n.push(e):r&&!a?(r=!1,xc(i+e)&&n.push(i+e),i=``):(r=!0,i+=`${e},`)}),n}var Cc=class extends ${render(e,t){e.leafNode(`sheet`,{sheetId:t.id,name:t.name,state:t.state,"r:id":t.rId})}parseOpen(e){return e.name===`sheet`?(this.model={name:ra(e.attributes.name),id:parseInt(e.attributes.sheetId,10),state:e.attributes.state,rId:e.attributes[`r:id`]},!0):!1}parseText(){}parseClose(){return!1}},wc=class extends ${render(e,t){let n={xWindow:t.x||0,yWindow:t.y||0,windowWidth:t.width||12e3,windowHeight:t.height||24e3,firstSheet:t.firstSheet,activeTab:t.activeTab};t.visibility&&t.visibility!==`visible`&&(n.visibility=t.visibility),e.leafNode(`workbookView`,n)}parseOpen(e){if(e.name===`workbookView`){let t=this.model={},n=function(e,n,r){t[e]=n===void 0?r:n},r=function(e,n,r){let i=n===void 0?r:parseInt(n,10);i!==void 0&&(t[e]=i)};return r(`x`,e.attributes.xWindow,0),r(`y`,e.attributes.yWindow,0),r(`width`,e.attributes.windowWidth,25e3),r(`height`,e.attributes.windowHeight,1e4),n(`visibility`,e.attributes.visibility,`visible`),r(`activeTab`,e.attributes.activeTab,void 0),r(`firstSheet`,e.attributes.firstSheet,void 0),!0}return!1}parseText(){}parseClose(){return!1}},Tc=class extends ${render(e,t){e.leafNode(`workbookPr`,{date1904:t.date1904?1:void 0,defaultThemeVersion:164011,filterPrivacy:1})}parseOpen(e){return e.name===`workbookPr`?(this.model={date1904:e.attributes.date1904===`1`},!0):!1}parseText(){}parseClose(){return!1}},Ec=class extends ${render(e,t){e.leafNode(`calcPr`,{calcId:171027,fullCalcOnLoad:t.fullCalcOnLoad?1:void 0})}parseOpen(e){return e.name===`calcPr`?(this.model={},!0):!1}parseText(){}parseClose(){return!1}},Dc=class extends ${render(e,t){e.leafNode(`pivotCache`,{cacheId:t.cacheId,"r:id":t.rId})}parseOpen(e){return e.name===`pivotCache`?(this.model={cacheId:e.attributes.cacheId,rId:e.attributes[`r:id`]},!0):!1}parseText(){}parseClose(){return!1}},Oc=class e extends ${constructor(){super(),this.map={fileVersion:e.STATIC_XFORMS.fileVersion,workbookPr:new Tc,bookViews:new Ms({tag:`bookViews`,count:!1,childXform:new wc}),sheets:new Ms({tag:`sheets`,count:!1,childXform:new Cc}),definedNames:new Ms({tag:`definedNames`,count:!1,childXform:new _c}),calcPr:new Ec,pivotCaches:new Ms({tag:`pivotCaches`,count:!1,childXform:new Dc})}}prepare(e){e.sheets=e.worksheets;let t=[],n=0;e.sheets.forEach(e=>{if(e.pageSetup&&e.pageSetup.printArea&&e.pageSetup.printArea.split(`&&`).forEach(r=>{let i=r.split(`:`),a={name:`_xlnm.Print_Area`,ranges:[`'${e.name}'!$${i[0]}:$${i[1]}`],localSheetId:n};t.push(a)}),e.pageSetup&&(e.pageSetup.printTitlesRow||e.pageSetup.printTitlesColumn)){let r=[];if(e.pageSetup.printTitlesColumn){let t=e.pageSetup.printTitlesColumn.split(`:`);r.push(`'${e.name}'!$${t[0]}:$${t[1]}`)}if(e.pageSetup.printTitlesRow){let t=e.pageSetup.printTitlesRow.split(`:`);r.push(`'${e.name}'!$${t[0]}:$${t[1]}`)}let i={name:`_xlnm.Print_Titles`,ranges:r,localSheetId:n};t.push(i)}n++}),t.length&&(e.definedNames=e.definedNames.concat(t)),(e.media||[]).forEach((e,t)=>{e.name=e.type+(t+1)})}render(t,n){t.openXml(ws.StdDocAttributes),t.openNode(`workbook`,e.WORKBOOK_ATTRIBUTES),this.map.fileVersion.render(t),this.map.workbookPr.render(t,n.properties),this.map.bookViews.render(t,n.views),this.map.sheets.render(t,n.sheets),this.map.definedNames.render(t,n.definedNames),this.map.calcPr.render(t,n.calcProperties),this.map.pivotCaches.render(t,n.pivotTables),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`workbook`:return!0;default:return this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e),!0}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`workbook`:return this.model={sheets:this.map.sheets.model,properties:this.map.workbookPr.model||{},views:this.map.bookViews.model,calcProperties:{}},this.map.definedNames.model&&(this.model.definedNames=this.map.definedNames.model),this.map.pivotCaches.model&&this.map.pivotCaches.model.length>0&&(this.model.pivotCaches=this.map.pivotCaches.model),!1;default:return!0}}reconcile(e){let t=(e.workbookRels||[]).reduce((e,t)=>(e[t.Id]=t,e),{}),n=[],r,i=0;(e.sheets||[]).forEach(a=>{let o=t[a.rId];o&&(r=e.worksheetHash[`xl/${o.Target.replace(/^(\s|\/xl\/)+/,``)}`],r&&(r.name=a.name,r.id=a.id,r.state=a.state,n[i++]=r))});let a=[];e.definedNames&&e.definedNames.forEach(e=>{if(e.name===`_xlnm.Print_Area`){if(r=n[e.localSheetId],r){r.pageSetup||={};let t=m.decodeEx(e.ranges[0]);r.pageSetup.printArea=r.pageSetup.printArea?`${r.pageSetup.printArea}&&${t.dimensions}`:t.dimensions}}else if(e.name===`_xlnm.Print_Titles`){if(r=n[e.localSheetId],r){r.pageSetup||={};let t=e.ranges.join(`,`),n=/\$/g,i=t.match(/\$\d+:\$\d+/);if(i&&i.length){let e=i[0];r.pageSetup.printTitlesRow=e.replace(n,``)}let a=t.match(/\$[A-Z]+:\$[A-Z]+/);if(a&&a.length){let e=a[0];r.pageSetup.printTitlesColumn=e.replace(n,``)}}}else a.push(e)}),e.definedNames=a,e.media.forEach((e,t)=>{e.index=t})}static{this.WORKBOOK_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`x15`,"xmlns:x15":`http://schemas.microsoft.com/office/spreadsheetml/2010/11/main`}}static{this.STATIC_XFORMS={fileVersion:new js({tag:`fileVersion`,$:{appName:`xl`,lastEdited:5,lowestEdited:5,rupBuild:9303}})}}};let kc={OfficeDocument:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument`,Worksheet:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet`,CalcChain:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/calcChain`,SharedStrings:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings`,Styles:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles`,Theme:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme`,Hyperlink:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink`,Image:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/image`,CoreProperties:`http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties`,ExtenderProperties:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties`,Comments:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments`,VmlDrawing:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing`,Table:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/table`,PivotCacheDefinition:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition`,PivotCacheRecords:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheRecords`,PivotTable:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable`};var Ac=class{constructor(){this.merges={}}add(e){if(this.merges[e.master])this.merges[e.master].expandToAddress(e.address);else{let t=`${e.master}:${e.address}`;this.merges[e.master]=new h(t)}}get mergeCells(){return Object.values(this.merges).map(e=>e.range)}reconcile(e,t){e.forEach(e=>{let n=m.decode(e);for(let e=n.top;e<=n.bottom;e++){let r=t[e-1];for(let t=n.left;t<=n.right;t++){let i=r.cells[t-1];i?i.type===S.ValueType.Merge&&(i.master=n.tl):r.cells[t]={type:S.ValueType.Null,address:m.encodeAddress(e,t)}}}})}getMasterAddress(e){let t=this.hash[e];return t&&t.tl}};function jc(e){if(e==null)return S.ValueType.Null;if(e instanceof String||typeof e==`string`)return S.ValueType.String;if(typeof e==`number`)return S.ValueType.Number;if(typeof e==`boolean`)return S.ValueType.Boolean;if(e instanceof Date)return S.ValueType.Date;if(e.text&&e.hyperlink)return S.ValueType.Hyperlink;if(e.formula)return S.ValueType.Formula;if(e.error)return S.ValueType.Error;throw Error(`I could not understand type of value`)}function Mc(e){switch(e.type){case S.ValueType.Formula:return jc(e.result);default:return e.type}}var Nc=class extends ${constructor(){super(),this.richTextXform=new sc}get tag(){return`c`}prepare(e,t){let n=t.styles.addStyleModel(e.style||{},Mc(e));switch(n&&(e.styleId=n),e.comment&&t.comments.push({...e.comment,ref:e.address}),e.type){case S.ValueType.String:case S.ValueType.RichText:t.sharedStrings&&(e.ssId=t.sharedStrings.add(e.value));break;case S.ValueType.Date:t.date1904&&(e.date1904=!0);break;case S.ValueType.Hyperlink:t.sharedStrings&&e.text!==void 0&&e.text!==null&&(e.ssId=t.sharedStrings.add(e.text)),t.hyperlinks.push({address:e.address,target:e.hyperlink,tooltip:e.tooltip});break;case S.ValueType.Merge:t.merges.add(e);break;case S.ValueType.Formula:if(t.date1904&&(e.date1904=!0),e.shareType===`shared`&&(e.si=t.siFormulae++),e.formula)t.formulae[e.address]=e;else if(e.sharedFormula){let n=t.formulae[e.sharedFormula];if(!n)throw Error(`Shared Formula master must exist above and or left of clone for cell ${e.address}`);n.si===void 0?(n.shareType=`shared`,n.si=t.siFormulae++,n.range=new h(n.address,e.address)):n.range&&n.range.expandToAddress(e.address),e.si=n.si}break;default:break}}renderFormula(e,t){let n=null;switch(t.shareType){case`shared`:n={t:`shared`,ref:t.ref||t.range.range,si:t.si};break;case`array`:n={t:`array`,ref:t.ref};break;default:t.si!==void 0&&(n={t:`shared`,si:t.si});break}switch(jc(t.result)){case S.ValueType.Null:e.leafNode(`f`,n,t.formula);break;case S.ValueType.String:e.addAttribute(`t`,`str`),e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,t.result);break;case S.ValueType.Number:e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,t.result);break;case S.ValueType.Boolean:e.addAttribute(`t`,`b`),e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,t.result?1:0);break;case S.ValueType.Error:e.addAttribute(`t`,`e`),e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,t.result.error);break;case S.ValueType.Date:e.leafNode(`f`,n,t.formula),e.leafNode(`v`,null,$i(t.result,t.date1904));break;default:throw Error(`I could not understand type of value`)}}render(e,t){if(!(t.type===S.ValueType.Null&&!t.styleId)){switch(e.openNode(`c`),e.addAttribute(`r`,t.address),t.styleId&&e.addAttribute(`s`,t.styleId),t.type){case S.ValueType.Null:break;case S.ValueType.Number:e.leafNode(`v`,null,t.value);break;case S.ValueType.Boolean:e.addAttribute(`t`,`b`),e.leafNode(`v`,null,t.value?`1`:`0`);break;case S.ValueType.Error:e.addAttribute(`t`,`e`),e.leafNode(`v`,null,t.value.error);break;case S.ValueType.String:case S.ValueType.RichText:t.ssId===void 0?t.value&&t.value.richText?(e.addAttribute(`t`,`inlineStr`),e.openNode(`is`),t.value.richText.forEach(t=>{this.richTextXform.render(e,t)}),e.closeNode(`is`)):(e.addAttribute(`t`,`str`),e.leafNode(`v`,null,t.value)):(e.addAttribute(`t`,`s`),e.leafNode(`v`,null,t.ssId));break;case S.ValueType.Date:e.leafNode(`v`,null,$i(t.value,t.date1904));break;case S.ValueType.Hyperlink:t.ssId===void 0?(e.addAttribute(`t`,`str`),e.leafNode(`v`,null,t.text)):(e.addAttribute(`t`,`s`),e.leafNode(`v`,null,t.ssId));break;case S.ValueType.Formula:this.renderFormula(e,t);break;case S.ValueType.Merge:break;default:break}e.closeNode()}}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`c`:return this.model={address:e.attributes.r},this.t=e.attributes.t,e.attributes.s&&(this.model.styleId=parseInt(e.attributes.s,10)),!0;case`f`:return this.currentNode=`f`,this.model.si=e.attributes.si,this.model.shareType=e.attributes.t,this.model.ref=e.attributes.ref,!0;case`v`:return this.currentNode=`v`,!0;case`t`:return this.currentNode=`t`,!0;case`r`:return this.parser=this.richTextXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){if(this.parser){this.parser.parseText(e);return}switch(this.currentNode){case`f`:this.model.formula=this.model.formula?this.model.formula+e:e;break;case`v`:case`t`:this.model.value&&this.model.value.richText?this.model.value.richText.text=this.model.value.richText.text?this.model.value.richText.text+e:e:this.model.value=this.model.value?this.model.value+e:e;break;default:break}}parseClose(e){switch(e){case`c`:{let{model:e}=this;if(e.formula||e.shareType)e.type=S.ValueType.Formula,e.value&&=(this.t===`str`?e.result=ra(e.value):this.t===`b`?e.result=parseInt(e.value,10)!==0:this.t===`e`?e.result={error:e.value}:e.result=parseFloat(e.value),void 0);else if(e.value!==void 0)switch(this.t){case`s`:e.type=S.ValueType.String,e.value=parseInt(e.value,10);break;case`str`:e.type=S.ValueType.String,e.value=ra(e.value);break;case`inlineStr`:e.type=S.ValueType.String;break;case`b`:e.type=S.ValueType.Boolean,e.value=parseInt(e.value,10)!==0;break;case`e`:e.type=S.ValueType.Error,e.value={error:e.value};break;case`d`:e.type=S.ValueType.Date,e.value=new Date(e.value);break;default:e.type=S.ValueType.Number,e.value=parseFloat(e.value);break}else e.styleId?e.type=S.ValueType.Null:e.type=S.ValueType.Merge;return!1}case`f`:case`v`:case`is`:return this.currentNode=void 0,!0;case`t`:return this.parser?(this.parser.parseClose(e),!0):(this.currentNode=void 0,!0);case`r`:return this.model.value=this.model.value||{},this.model.value.richText=this.model.value.richText||[],this.model.value.richText.push(this.parser.model),this.parser=void 0,this.currentNode=void 0,!0;default:return this.parser?(this.parser.parseClose(e),!0):!1}}reconcile(e,t){let n=e.styleId&&t.styles&&t.styles.getStyleModel(e.styleId);switch(n&&(e.style=n),e.styleId!==void 0&&(e.styleId=void 0),e.type){case S.ValueType.String:typeof e.value==`number`&&t.sharedStrings&&(e.value=t.sharedStrings.getString(e.value)),e.value.richText&&(e.type=S.ValueType.RichText);break;case S.ValueType.Number:n&&aa(n.numFmt)&&(e.type=S.ValueType.Date,e.value=ea(e.value,t.date1904));break;case S.ValueType.Formula:e.result!==void 0&&typeof e.result==`number`&&n&&aa(n.numFmt)&&(e.result=ea(e.result,t.date1904)),e.shareType===`shared`&&(e.ref?t.formulae[e.si]=e.address:(e.sharedFormula=t.formulae[e.si],delete e.shareType),delete e.si);break;default:break}let r=t.hyperlinkMap[e.address];r&&(e.type===S.ValueType.Formula?(e.text=e.result,e.result=void 0):(e.text=e.value,e.value=void 0),e.type=S.ValueType.Hyperlink,e.hyperlink=r);let i=t.commentsMap&&t.commentsMap[e.address];i&&(e.comment=i)}},Pc=class extends ${constructor(e){super(),this.maxItems=e&&e.maxItems,this.map={c:new Nc}}get tag(){return`row`}reset(){super.reset(),this.numRowsSeen=0,this.lastCellCol=0}prepare(e,t){let n=t.styles.addStyleModel(e.style);n&&(e.styleId=n);let r=this.map.c;e.cells.forEach(e=>{r.prepare(e,t)})}render(e,t,n){if(!t)return;e.openNode(`row`),e.addAttribute(`r`,t.number),t.height&&(e.addAttribute(`ht`,t.height),e.addAttribute(`customHeight`,`1`)),t.hidden&&e.addAttribute(`hidden`,`1`),t.min>0&&t.max>0&&t.min<=t.max&&e.addAttribute(`spans`,`${t.min}:${t.max}`),t.styleId&&(e.addAttribute(`s`,t.styleId),e.addAttribute(`customFormat`,`1`)),e.addAttribute(`x14ac:dyDescent`,`0.25`),t.outlineLevel&&e.addAttribute(`outlineLevel`,t.outlineLevel),t.collapsed&&e.addAttribute(`collapsed`,`1`);let r=this.map.c;t.cells.forEach(t=>{r.render(e,t,n)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;if(e.name===`row`){this.numRowsSeen+=1,this.lastCellCol=0;let t=e.attributes.spans?e.attributes.spans.split(`:`).map(e=>parseInt(e,10)):[void 0,void 0],n=this.model={number:e.attributes.r?parseInt(e.attributes.r,10):this.numRowsSeen,min:t[0],max:t[1],cells:[]};return e.attributes.s&&(n.styleId=parseInt(e.attributes.s,10)),sa(e.attributes.hidden)&&(n.hidden=!0),sa(e.attributes.bestFit)&&(n.bestFit=!0),e.attributes.ht&&(n.height=parseFloat(e.attributes.ht)),e.attributes.outlineLevel&&(n.outlineLevel=parseInt(e.attributes.outlineLevel,10)),sa(e.attributes.collapsed)&&(n.collapsed=!0),!0}return this.parser=this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):!1}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser){if(!this.parser.parseClose(e)){let e=this.parser.model;if(e.address?this.lastCellCol=m.decodeAddress(e.address).col:(this.lastCellCol+=1,e.address=m.encodeAddress(this.model.number,this.lastCellCol)),this.model.cells.push(e),this.maxItems&&this.model.cells.length>this.maxItems)throw Error(`Max column count (${this.maxItems}) exceeded`);this.parser=void 0}return!0}return!1}reconcile(e,t){e.style=e.styleId?t.styles.getStyleModel(e.styleId):{},e.styleId!==void 0&&(e.styleId=void 0);let n=this.map.c;e.cells.forEach(e=>{n.reconcile(e,t)})}},Fc=class extends ${get tag(){return`col`}prepare(e,t){let n=t.styles.addStyleModel(e.style||{});n&&(e.styleId=n)}render(e,t){e.openNode(`col`),e.addAttribute(`min`,t.min),e.addAttribute(`max`,t.max),t.width&&e.addAttribute(`width`,t.width),t.styleId&&e.addAttribute(`style`,t.styleId),t.hidden&&e.addAttribute(`hidden`,`1`),t.bestFit&&e.addAttribute(`bestFit`,`1`),t.outlineLevel&&e.addAttribute(`outlineLevel`,t.outlineLevel),t.collapsed&&e.addAttribute(`collapsed`,`1`),e.addAttribute(`customWidth`,`1`),e.closeNode()}parseOpen(e){if(e.name===`col`){let t=this.model={min:parseInt(e.attributes.min||`0`,10),max:parseInt(e.attributes.max||`0`,10),width:e.attributes.width===void 0?void 0:parseFloat(e.attributes.width||`0`)};return e.attributes.style&&(t.styleId=parseInt(e.attributes.style,10)),sa(e.attributes.hidden)&&(t.hidden=!0),sa(e.attributes.bestFit)&&(t.bestFit=!0),e.attributes.outlineLevel&&(t.outlineLevel=parseInt(e.attributes.outlineLevel,10)),sa(e.attributes.collapsed)&&(t.collapsed=!0),!0}return!1}parseText(){}parseClose(){return!1}reconcile(e,t){e.styleId&&(e.style=t.styles.getStyleModel(e.styleId))}},Ic=class extends ${get tag(){return`dimension`}render(e,t){t&&e.leafNode(`dimension`,{ref:t})}parseOpen(e){return e.name===`dimension`?(this.model=e.attributes.ref,!0):!1}parseText(){}parseClose(){return!1}},Lc=class extends ${get tag(){return`hyperlink`}render(e,t){this.isInternalLink(t)?e.leafNode(`hyperlink`,{ref:t.address,"r:id":t.rId,tooltip:t.tooltip,location:t.target}):e.leafNode(`hyperlink`,{ref:t.address,"r:id":t.rId,tooltip:t.tooltip})}parseOpen(e){return e.name===`hyperlink`?(this.model={address:e.attributes.ref,rId:e.attributes[`r:id`],tooltip:e.attributes.tooltip},e.attributes.location&&(this.model.target=e.attributes.location),!0):!1}parseText(){}parseClose(){return!1}isInternalLink(e){return!!(e.target&&/^[^!]+![a-zA-Z]+[\d]+$/.test(e.target))}},Rc=class extends ${get tag(){return`mergeCell`}render(e,t){e.leafNode(`mergeCell`,{ref:t})}parseOpen(e){return e.name===`mergeCell`?(this.model=e.attributes.ref,!0):!1}parseText(){}parseClose(){return!1}};function zc(e,t,n,r){let i=t[n];i===void 0?r!==void 0&&(e[n]=r):e[n]=i}function Bc(e,t,n,r){let i=t[n];i===void 0?r!==void 0&&(e[n]=r):e[n]=sa(i)}function Vc(e){if(!e)return[];let t=[],n={};for(let[r,i]of Object.entries(e))if(i!=null)if(r.startsWith(`range:`)){let e=r.slice(6),{sqref:n,...a}=i;t.push({...a,sqref:e})}else n[r]=i;if(Object.keys(n).length===0)return t;let r=Object.entries(n).map(([e,t])=>({address:e,dataValidation:t,marked:!1})).sort((e,t)=>e.address.localeCompare(t.address)),i=Object.fromEntries(r.map(e=>[e.address,e])),a=(e,t,r)=>{for(let i=0;i<t;i++){let t=m.encodeAddress(e.row+i,r);if(!n[t]||!T(n[e.address],n[t]))return!1}return!0},o=r.map(e=>{if(!e.marked){let t=m.decodeEx(e.address);if(t.dimensions)return i[t.dimensions].marked=!0,{...e.dataValidation,sqref:e.address};let r=1,o=m.encodeAddress(t.row+r,t.col);for(;n[o]&&T(e.dataValidation,n[o]);)r++,o=m.encodeAddress(t.row+r,t.col);let s=1;for(;a(t,r,t.col+s);)s++;for(let e=0;e<r;e++)for(let n=0;n<s;n++)o=m.encodeAddress(t.row+e,t.col+n),i[o].marked=!0;if(r>1||s>1){let n=t.row+(r-1),i=t.col+(s-1);return{...e.dataValidation,sqref:`${e.address}:${m.encodeAddress(n,i)}`}}return{...e.dataValidation,sqref:e.address}}return null}).filter(Boolean);return[...t,...o]}var Hc=class extends ${get tag(){return`dataValidations`}render(e,t){let n=Vc(t);n.length&&(e.openNode(`dataValidations`,{count:n.length}),n.forEach(t=>{e.openNode(`dataValidation`),t.type!==`any`&&(e.addAttribute(`type`,t.type),t.operator&&t.type!==`list`&&t.operator!==`between`&&e.addAttribute(`operator`,t.operator),t.allowBlank&&e.addAttribute(`allowBlank`,`1`)),t.showInputMessage&&e.addAttribute(`showInputMessage`,`1`),t.promptTitle&&e.addAttribute(`promptTitle`,t.promptTitle),t.prompt&&e.addAttribute(`prompt`,t.prompt),t.showErrorMessage&&e.addAttribute(`showErrorMessage`,`1`),t.errorStyle&&e.addAttribute(`errorStyle`,t.errorStyle),t.errorTitle&&e.addAttribute(`errorTitle`,t.errorTitle),t.error&&e.addAttribute(`error`,t.error),e.addAttribute(`sqref`,t.sqref),(t.formulae||[]).forEach((n,r)=>{e.openNode(`formula${r+1}`),t.type===`date`?e.writeText($i(new Date(n))):e.writeText(n),e.closeNode()}),e.closeNode()}),e.closeNode())}parseOpen(e){switch(e.name){case`dataValidations`:return this.model={},!0;case`dataValidation`:{this._address=e.attributes.sqref;let t={type:e.attributes.type||`any`,formulae:[]};switch(e.attributes.type&&Bc(t,e.attributes,`allowBlank`),Bc(t,e.attributes,`showInputMessage`),Bc(t,e.attributes,`showErrorMessage`),t.type){case`any`:case`list`:case`custom`:break;default:zc(t,e.attributes,`operator`,`between`);break}return zc(t,e.attributes,`promptTitle`),zc(t,e.attributes,`prompt`),zc(t,e.attributes,`errorStyle`),zc(t,e.attributes,`errorTitle`),zc(t,e.attributes,`error`),this._dataValidation=t,!0}case`formula1`:case`formula2`:return this._formula=[],!0;default:return!1}}parseText(e){this._formula&&this._formula.push(e)}parseClose(e){switch(e){case`dataValidations`:return!1;case`dataValidation`:return(!this._dataValidation.formulae||!this._dataValidation.formulae.length)&&(delete this._dataValidation.formulae,delete this._dataValidation.operator),(this._address.split(/\s+/g)||[]).forEach(e=>{if(e.includes(`:`)){let t=new h(e);(t.bottom-t.top+1)*(t.right-t.left+1)<=1e3?t.forEachAddress(e=>{this.model[e]=this._dataValidation}):this.model[`range:${e}`]=this._dataValidation}else this.model[e]=this._dataValidation}),!0;case`formula1`:case`formula2`:{let e=this._formula.join(``);switch(this._dataValidation.type){case`whole`:case`textLength`:e=parseInt(e,10);break;case`decimal`:e=parseFloat(e);break;case`date`:e=ea(parseFloat(e));break;default:break}return this._dataValidation.formulae.push(e),this._formula=void 0,!0}default:return!0}}},Uc=class extends ${get tag(){return`pageSetUpPr`}render(e,t){return t&&t.fitToPage?(e.leafNode(this.tag,{fitToPage:t.fitToPage?`1`:void 0}),!0):!1}parseOpen(e){return e.name===this.tag?(this.model={fitToPage:e.attributes.fitToPage===`1`},!0):!1}parseText(){}parseClose(){return!1}};let Wc=e=>e!==void 0;var Gc=class extends ${get tag(){return`outlinePr`}render(e,t){return t&&(Wc(t.summaryBelow)||Wc(t.summaryRight))?(e.leafNode(this.tag,{summaryBelow:Wc(t.summaryBelow)?Number(t.summaryBelow):void 0,summaryRight:Wc(t.summaryRight)?Number(t.summaryRight):void 0}),!0):!1}parseOpen(e){return e.name===this.tag?(this.model={summaryBelow:Wc(e.attributes.summaryBelow)?!!Number(e.attributes.summaryBelow):void 0,summaryRight:Wc(e.attributes.summaryRight)?!!Number(e.attributes.summaryRight):void 0},!0):!1}parseText(){}parseClose(){return!1}},Kc=class extends ${constructor(){super(),this.map={tabColor:new Ns(`tabColor`),pageSetUpPr:new Uc,outlinePr:new Gc}}get tag(){return`sheetPr`}render(e,t){if(t){e.addRollback(),e.openNode(`sheetPr`);let n=!1;n=this.map.tabColor.render(e,t.tabColor)||n,n=this.map.pageSetUpPr.render(e,t.pageSetup)||n,n=this.map.outlinePr.render(e,t.outlineProperties)||n,n?(e.closeNode(),e.commit()):e.rollback()}}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):e.name===this.tag?(this.reset(),!0):this.map[e.name]?(this.parser=this.map[e.name],this.parser.parseOpen(e),!0):!1}parseText(e){return this.parser?(this.parser.parseText(e),!0):!1}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.parser=void 0),!0):(this.map.tabColor.model||this.map.pageSetUpPr.model||this.map.outlinePr.model?(this.model={},this.map.tabColor.model&&(this.model.tabColor=this.map.tabColor.model),this.map.pageSetUpPr.model&&(this.model.pageSetup=this.map.pageSetUpPr.model),this.map.outlinePr.model&&(this.model.outlineProperties=this.map.outlinePr.model)):this.model=null,!1)}},qc=class extends ${get tag(){return`sheetFormatPr`}render(e,t){if(t){let n={defaultRowHeight:t.defaultRowHeight,outlineLevelRow:t.outlineLevelRow,outlineLevelCol:t.outlineLevelCol,"x14ac:dyDescent":t.dyDescent};t.defaultColWidth&&(n.defaultColWidth=t.defaultColWidth),(!t.defaultRowHeight||t.defaultRowHeight!==15)&&(n.customHeight=`1`),Object.values(n).some(e=>e!==void 0)&&e.leafNode(`sheetFormatPr`,n)}}parseOpen(e){return e.name===`sheetFormatPr`?(this.model={defaultRowHeight:parseFloat(e.attributes.defaultRowHeight||`0`),dyDescent:parseFloat(e.attributes[`x14ac:dyDescent`]||`0`),outlineLevelRow:parseInt(e.attributes.outlineLevelRow||`0`,10),outlineLevelCol:parseInt(e.attributes.outlineLevelCol||`0`,10)},e.attributes.defaultColWidth&&(this.model.defaultColWidth=parseFloat(e.attributes.defaultColWidth)),!0):!1}parseText(){}parseClose(){return!1}};let Jc={frozen:`frozen`,frozenSplit:`frozen`,split:`split`};var Yc=class extends ${get tag(){return`sheetView`}prepare(e){switch(e.state){case`frozen`:case`split`:break;default:e.state=`normal`;break}}render(e,t){e.openNode(`sheetView`,{workbookViewId:t.workbookViewId||0});let n=function(t,n,r){r&&e.addAttribute(t,n)};n(`rightToLeft`,`1`,t.rightToLeft===!0),n(`tabSelected`,`1`,t.tabSelected),n(`showRuler`,`0`,t.showRuler===!1),n(`showRowColHeaders`,`0`,t.showRowColHeaders===!1),n(`showGridLines`,`0`,t.showGridLines===!1),n(`zoomScale`,t.zoomScale,t.zoomScale),n(`zoomScaleNormal`,t.zoomScaleNormal,t.zoomScaleNormal),n(`view`,t.style,t.style);let r,i,a,o;switch(t.state){case`frozen`:i=t.xSplit||0,a=t.ySplit||0,r=t.topLeftCell||m.getAddress(a+1,i+1).address,o=t.xSplit&&t.ySplit&&`bottomRight`||t.xSplit&&`topRight`||`bottomLeft`,e.leafNode(`pane`,{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:r,activePane:o,state:`frozen`}),e.leafNode(`selection`,{pane:o,activeCell:t.activeCell,sqref:t.activeCell});break;case`split`:t.activePane===`topLeft`&&(t.activePane=void 0),e.leafNode(`pane`,{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:t.topLeftCell,activePane:t.activePane}),e.leafNode(`selection`,{pane:t.activePane,activeCell:t.activeCell,sqref:t.activeCell});break;case`normal`:t.activeCell&&e.leafNode(`selection`,{activeCell:t.activeCell,sqref:t.activeCell});break;default:break}e.closeNode()}parseOpen(e){switch(e.name){case`sheetView`:return this.sheetView={workbookViewId:parseInt(e.attributes.workbookViewId,10),rightToLeft:e.attributes.rightToLeft===`1`,tabSelected:e.attributes.tabSelected===`1`,showRuler:e.attributes.showRuler!==`0`,showRowColHeaders:e.attributes.showRowColHeaders!==`0`,showGridLines:e.attributes.showGridLines!==`0`,zoomScale:parseInt(e.attributes.zoomScale||`100`,10),zoomScaleNormal:parseInt(e.attributes.zoomScaleNormal||`100`,10),style:e.attributes.view},this.pane=void 0,this.selections={},!0;case`pane`:return this.pane={xSplit:parseInt(e.attributes.xSplit||`0`,10),ySplit:parseInt(e.attributes.ySplit||`0`,10),topLeftCell:e.attributes.topLeftCell,activePane:e.attributes.activePane||`topLeft`,state:e.attributes.state},!0;case`selection`:{let t=e.attributes.pane||`topLeft`;return this.selections[t]={pane:t,activeCell:e.attributes.activeCell},!0}default:return!1}}parseText(){}parseClose(e){let t,n;switch(e){case`sheetView`:return this.sheetView&&this.pane?(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:Jc[this.pane.state]||`split`,xSplit:this.pane.xSplit,ySplit:this.pane.ySplit,topLeftCell:this.pane.topLeftCell,showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},this.model.state===`split`&&(t.activePane=this.pane.activePane),n=this.selections[this.pane.activePane],n&&n.activeCell&&(t.activeCell=n.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)):(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:`normal`,showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},n=this.selections.topLeft,n&&n.activeCell&&(t.activeCell=n.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)),!1;default:return!0}}reconcile(){}};function Xc(e,t){return e?t:void 0}function Zc(e,t){return e===t?!0:void 0}var Qc=class extends ${get tag(){return`sheetProtection`}render(e,t){if(t){let n={sheet:Xc(t.sheet,`1`),selectLockedCells:t.selectLockedCells===!1?`1`:void 0,selectUnlockedCells:t.selectUnlockedCells===!1?`1`:void 0,formatCells:Xc(t.formatCells,`0`),formatColumns:Xc(t.formatColumns,`0`),formatRows:Xc(t.formatRows,`0`),insertColumns:Xc(t.insertColumns,`0`),insertRows:Xc(t.insertRows,`0`),insertHyperlinks:Xc(t.insertHyperlinks,`0`),deleteColumns:Xc(t.deleteColumns,`0`),deleteRows:Xc(t.deleteRows,`0`),sort:Xc(t.sort,`0`),autoFilter:Xc(t.autoFilter,`0`),pivotTables:Xc(t.pivotTables,`0`)};t.sheet&&(n.algorithmName=t.algorithmName,n.hashValue=t.hashValue,n.saltValue=t.saltValue,n.spinCount=t.spinCount,n.objects=Xc(t.objects===!1,`1`),n.scenarios=Xc(t.scenarios===!1,`1`)),Object.values(n).some(e=>e!==void 0)&&e.leafNode(this.tag,n)}}parseOpen(e){switch(e.name){case this.tag:return this.model={sheet:Zc(e.attributes.sheet,`1`),objects:e.attributes.objects===`1`?!1:void 0,scenarios:e.attributes.scenarios===`1`?!1:void 0,selectLockedCells:e.attributes.selectLockedCells===`1`?!1:void 0,selectUnlockedCells:e.attributes.selectUnlockedCells===`1`?!1:void 0,formatCells:Zc(e.attributes.formatCells,`0`),formatColumns:Zc(e.attributes.formatColumns,`0`),formatRows:Zc(e.attributes.formatRows,`0`),insertColumns:Zc(e.attributes.insertColumns,`0`),insertRows:Zc(e.attributes.insertRows,`0`),insertHyperlinks:Zc(e.attributes.insertHyperlinks,`0`),deleteColumns:Zc(e.attributes.deleteColumns,`0`),deleteRows:Zc(e.attributes.deleteRows,`0`),sort:Zc(e.attributes.sort,`0`),autoFilter:Zc(e.attributes.autoFilter,`0`),pivotTables:Zc(e.attributes.pivotTables,`0`)},e.attributes.algorithmName&&(this.model.algorithmName=e.attributes.algorithmName,this.model.hashValue=e.attributes.hashValue,this.model.saltValue=e.attributes.saltValue,this.model.spinCount=parseInt(e.attributes.spinCount,10)),!0;default:return!1}}parseText(){}parseClose(){return!1}},$c=class extends ${get tag(){return`pageMargins`}render(e,t){if(t){let n={left:t.left,right:t.right,top:t.top,bottom:t.bottom,header:t.header,footer:t.footer};Object.values(n).some(e=>e!==void 0)&&e.leafNode(this.tag,n)}}parseOpen(e){switch(e.name){case this.tag:return this.model={left:parseFloat(e.attributes.left||.7),right:parseFloat(e.attributes.right||.7),top:parseFloat(e.attributes.top||.75),bottom:parseFloat(e.attributes.bottom||.75),header:parseFloat(e.attributes.header||.3),footer:parseFloat(e.attributes.footer||.3)},!0;default:return!1}}parseText(){}parseClose(){return!1}};function el(e){return e?`1`:void 0}function tl(e){switch(e){case`overThenDown`:return e;default:return}}function nl(e){switch(e){case`atEnd`:case`asDisplyed`:return e;default:return}}function rl(e){switch(e){case`dash`:case`blank`:case`NA`:return e;default:return}}function il(e){return e===void 0?void 0:parseInt(e,10)}var al=class extends ${get tag(){return`pageSetup`}render(e,t){if(t){let n={paperSize:t.paperSize,orientation:t.orientation,horizontalDpi:t.horizontalDpi,verticalDpi:t.verticalDpi,pageOrder:tl(t.pageOrder),blackAndWhite:el(t.blackAndWhite),draft:el(t.draft),cellComments:nl(t.cellComments),errors:rl(t.errors),scale:t.scale,fitToWidth:t.fitToWidth,fitToHeight:t.fitToHeight,firstPageNumber:t.firstPageNumber,useFirstPageNumber:el(!!t.firstPageNumber),usePrinterDefaults:el(t.usePrinterDefaults),copies:t.copies};Object.values(n).some(e=>e!==void 0)&&e.leafNode(this.tag,n)}}parseOpen(e){switch(e.name){case this.tag:return this.model={paperSize:il(e.attributes.paperSize),orientation:e.attributes.orientation||`portrait`,horizontalDpi:parseInt(e.attributes.horizontalDpi||`4294967295`,10),verticalDpi:parseInt(e.attributes.verticalDpi||`4294967295`,10),pageOrder:e.attributes.pageOrder||`downThenOver`,blackAndWhite:e.attributes.blackAndWhite===`1`,draft:e.attributes.draft===`1`,cellComments:e.attributes.cellComments||`None`,errors:e.attributes.errors||`displayed`,scale:parseInt(e.attributes.scale||`100`,10),fitToWidth:parseInt(e.attributes.fitToWidth||`1`,10),fitToHeight:parseInt(e.attributes.fitToHeight||`1`,10),firstPageNumber:parseInt(e.attributes.firstPageNumber||`1`,10),useFirstPageNumber:e.attributes.useFirstPageNumber===`1`,usePrinterDefaults:e.attributes.usePrinterDefaults===`1`,copies:parseInt(e.attributes.copies||`1`,10)},!0;default:return!1}}parseText(){}parseClose(){return!1}};function ol(e){return e?`1`:void 0}var sl=class extends ${get tag(){return`printOptions`}render(e,t){if(t){let n={headings:ol(t.showRowColHeaders),gridLines:ol(t.showGridLines),horizontalCentered:ol(t.horizontalCentered),verticalCentered:ol(t.verticalCentered)};Object.values(n).some(e=>e!==void 0)&&e.leafNode(this.tag,n)}}parseOpen(e){switch(e.name){case this.tag:return this.model={showRowColHeaders:e.attributes.headings===`1`,showGridLines:e.attributes.gridLines===`1`,horizontalCentered:e.attributes.horizontalCentered===`1`,verticalCentered:e.attributes.verticalCentered===`1`},!0;default:return!1}}parseText(){}parseClose(){return!1}},cl=class extends ${get tag(){return`autoFilter`}render(e,t){if(t)if(typeof t==`string`)e.leafNode(`autoFilter`,{ref:t});else{let n=function(e){return typeof e==`string`?e:m.getAddress(e.row,e.column).address},r=n(t.from),i=n(t.to);r&&i&&e.leafNode(`autoFilter`,{ref:`${r}:${i}`})}}parseOpen(e){e.name===`autoFilter`&&(this.model=e.attributes.ref)}},ll=class extends ${get tag(){return`picture`}render(e,t){t&&e.leafNode(this.tag,{"r:id":t.rId})}parseOpen(e){switch(e.name){case this.tag:return this.model={rId:e.attributes[`r:id`]},!0;default:return!1}}parseText(){}parseClose(){return!1}},ul=class extends ${get tag(){return`drawing`}render(e,t){t&&e.leafNode(this.tag,{"r:id":t.rId})}parseOpen(e){switch(e.name){case this.tag:return this.model={rId:e.attributes[`r:id`]},!0;default:return!1}}parseText(){}parseClose(){return!1}},dl=class extends ${get tag(){return`tablePart`}render(e,t){t&&e.leafNode(this.tag,{"r:id":t.rId})}parseOpen(e){switch(e.name){case this.tag:return this.model={rId:e.attributes[`r:id`]},!0;default:return!1}}parseText(){}parseClose(){return!1}},fl=class extends ${get tag(){return`brk`}render(e,t){e.leafNode(`brk`,t)}parseOpen(e){return e.name===`brk`?(this.model=e.attributes.ref,!0):!1}parseText(){}parseClose(){return!1}},pl=class extends Ms{constructor(){let e={tag:`rowBreaks`,count:!0,childXform:new fl};super(e)}render(e,t){if(t&&t.length){e.openNode(this.tag,this.$),this.count&&(e.addAttribute(this.$count,t.length),e.addAttribute(`manualBreakCount`,t.length));let{childXform:n}=this;t.forEach(t=>{n.render(e,t)}),e.closeNode()}else this.empty&&e.leafNode(this.tag)}},ml=class extends ${get tag(){return`headerFooter`}render(e,t){if(t){e.addRollback();let n=!1;e.openNode(`headerFooter`),t.differentFirst&&(e.addAttribute(`differentFirst`,`1`),n=!0),t.differentOddEven&&(e.addAttribute(`differentOddEven`,`1`),n=!0),t.oddHeader&&typeof t.oddHeader==`string`&&(e.leafNode(`oddHeader`,null,t.oddHeader),n=!0),t.oddFooter&&typeof t.oddFooter==`string`&&(e.leafNode(`oddFooter`,null,t.oddFooter),n=!0),t.evenHeader&&typeof t.evenHeader==`string`&&(e.leafNode(`evenHeader`,null,t.evenHeader),n=!0),t.evenFooter&&typeof t.evenFooter==`string`&&(e.leafNode(`evenFooter`,null,t.evenFooter),n=!0),t.firstHeader&&typeof t.firstHeader==`string`&&(e.leafNode(`firstHeader`,null,t.firstHeader),n=!0),t.firstFooter&&typeof t.firstFooter==`string`&&(e.leafNode(`firstFooter`,null,t.firstFooter),n=!0),n?(e.closeNode(),e.commit()):e.rollback()}}parseOpen(e){switch(e.name){case`headerFooter`:return this.model={},e.attributes.differentFirst&&(this.model.differentFirst=parseInt(e.attributes.differentFirst,0)===1),e.attributes.differentOddEven&&(this.model.differentOddEven=parseInt(e.attributes.differentOddEven,0)===1),!0;case`oddHeader`:return this.currentNode=`oddHeader`,!0;case`oddFooter`:return this.currentNode=`oddFooter`,!0;case`evenHeader`:return this.currentNode=`evenHeader`,!0;case`evenFooter`:return this.currentNode=`evenFooter`,!0;case`firstHeader`:return this.currentNode=`firstHeader`,!0;case`firstFooter`:return this.currentNode=`firstFooter`,!0;default:return!1}}parseText(e){switch(this.currentNode){case`oddHeader`:this.model.oddHeader=(this.model.oddHeader||``)+e;break;case`oddFooter`:this.model.oddFooter=(this.model.oddFooter||``)+e;break;case`evenHeader`:this.model.evenHeader=(this.model.evenHeader||``)+e;break;case`evenFooter`:this.model.evenFooter=(this.model.evenFooter||``)+e;break;case`firstHeader`:this.model.firstHeader=(this.model.firstHeader||``)+e;break;case`firstFooter`:this.model.firstFooter=(this.model.firstFooter||``)+e;break;default:break}}parseClose(){switch(this.currentNode){case`oddHeader`:case`oddFooter`:case`evenHeader`:case`evenFooter`:case`firstHeader`:case`firstFooter`:return this.currentNode=void 0,!0;default:return!1}}},hl=class extends ${createNewModel(e){return{}}parseOpen(e){return this.parser=this.parser||this.map[e.name],this.parser?(this.parser.parseOpen(e),!0):e.name===this.tag?(this.model=this.createNewModel(e),!0):!1}parseText(e){this.parser&&this.parser.parseText(e)}onParserClose(e,t){this.model[e]=t.model}parseClose(e){return this.parser?(this.parser.parseClose(e)||(this.onParserClose(e,this.parser),this.parser=void 0),!0):e!==this.tag}get tag(){return``}},gl=class extends ${get tag(){return`cfvo`}render(e,t){e.leafNode(this.tag,{type:t.type,val:t.value})}parseOpen(e){this.model={type:e.attributes.type,value:$.toFloatValue(e.attributes.val)}}parseClose(e){return e!==this.tag}},_l=class extends hl{constructor(){super(),this.map={cfvo:this.cfvoXform=new gl,color:this.colorXform=new Ns}}get tag(){return`dataBar`}render(e,t){e.openNode(this.tag),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),this.colorXform.render(e,t.color),e.closeNode()}createNewModel(){return{cfvo:[]}}onParserClose(e,t){switch(e){case`cfvo`:this.model.cfvo.push(t.model);break;case`color`:this.model.color=t.model;break}}},vl=class extends ${get tag(){return`x14:id`}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=``}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}},yl=class extends hl{constructor(){super(),this.map={"x14:id":this.idXform=new vl}}get tag(){return`ext`}render(e,t){e.openNode(this.tag,{uri:`{B025F937-C7B1-47D3-B67F-A62EFF666E3E}`,"xmlns:x14":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/main`}),this.idXform.render(e,t.x14Id),e.closeNode()}createNewModel(){return{}}onParserClose(e,t){this.model.x14Id=t.model}},bl=class extends hl{constructor(){super(),this.map={ext:new yl}}get tag(){return`extLst`}render(e,t){e.openNode(this.tag),this.map.ext.render(e,t),e.closeNode()}createNewModel(){return{}}onParserClose(e,t){Object.assign(this.model,t.model)}},xl=class extends ${get tag(){return`formula`}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=``}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}},Sl=class extends hl{constructor(){super(),this.map={cfvo:this.cfvoXform=new gl,color:this.colorXform=new Ns}}get tag(){return`colorScale`}render(e,t){e.openNode(this.tag),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),t.color.forEach(t=>{this.colorXform.render(e,t)}),e.closeNode()}createNewModel(e){return{cfvo:[],color:[]}}onParserClose(e,t){this.model[e].push(t.model)}},Cl=class extends hl{constructor(){super(),this.map={cfvo:this.cfvoXform=new gl}}get tag(){return`iconSet`}render(e,t){e.openNode(this.tag,{iconSet:$.toStringAttribute(t.iconSet,`3TrafficLights`),reverse:$.toBoolAttribute(t.reverse,!1),showValue:$.toBoolAttribute(t.showValue,!0)}),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),e.closeNode()}createNewModel({attributes:e}){return{iconSet:$.toStringValue(e.iconSet,`3TrafficLights`),reverse:$.toBoolValue(e.reverse),showValue:$.toBoolValue(e.showValue),cfvo:[]}}onParserClose(e,t){this.model[e].push(t.model)}};let wl={"3Triangles":!0,"3Stars":!0,"5Boxes":!0},Tl=e=>{if(e.formulae&&e.formulae[0])return e.formulae[0];let{tl:t}=new h(e.ref);switch(e.operator){case`containsText`:return`NOT(ISERROR(SEARCH("${e.text}",${t})))`;case`containsBlanks`:return`LEN(TRIM(${t}))=0`;case`notContainsBlanks`:return`LEN(TRIM(${t}))>0`;case`containsErrors`:return`ISERROR(${t})`;case`notContainsErrors`:return`NOT(ISERROR(${t}))`;default:return}},El=e=>{if(e.formulae&&e.formulae[0])return e.formulae[0];let{tl:t}=new h(e.ref);switch(e.timePeriod){case`thisWeek`:return`AND(TODAY()-ROUNDDOWN(${t},0)<=WEEKDAY(TODAY())-1,ROUNDDOWN(${t},0)-TODAY()<=7-WEEKDAY(TODAY()))`;case`lastWeek`:return`AND(TODAY()-ROUNDDOWN(${t},0)>=(WEEKDAY(TODAY())),TODAY()-ROUNDDOWN(${t},0)<(WEEKDAY(TODAY())+7))`;case`nextWeek`:return`AND(ROUNDDOWN(${t},0)-TODAY()>(7-WEEKDAY(TODAY())),ROUNDDOWN(${t},0)-TODAY()<(15-WEEKDAY(TODAY())))`;case`yesterday`:return`FLOOR(${t},1)=TODAY()-1`;case`today`:return`FLOOR(${t},1)=TODAY()`;case`tomorrow`:return`FLOOR(${t},1)=TODAY()+1`;case`last7Days`:return`AND(TODAY()-FLOOR(${t},1)<=6,FLOOR(${t},1)<=TODAY())`;case`lastMonth`:return`AND(MONTH(${t})=MONTH(EDATE(TODAY(),0-1)),YEAR(${t})=YEAR(EDATE(TODAY(),0-1)))`;case`thisMonth`:return`AND(MONTH(${t})=MONTH(TODAY()),YEAR(${t})=YEAR(TODAY()))`;case`nextMonth`:return`AND(MONTH(${t})=MONTH(EDATE(TODAY(),0+1)),YEAR(${t})=YEAR(EDATE(TODAY(),0+1)))`;default:return}},Dl=e=>{let{type:t,operator:n}=e;switch(t){case`containsText`:case`containsBlanks`:case`notContainsBlanks`:case`containsErrors`:case`notContainsErrors`:return{type:`containsText`,operator:t};default:return{type:t,operator:n}}};var Ol=class e extends hl{constructor(){super(),this.map={dataBar:this.databarXform=new _l,extLst:this.extLstRefXform=new bl,formula:this.formulaXform=new xl,colorScale:this.colorScaleXform=new Sl,iconSet:this.iconSetXform=new Cl}}get tag(){return`cfRule`}static isPrimitive(e){return!(e.type===`iconSet`&&(e.custom||wl[e.iconSet]))}render(e,t){switch(t.type){case`expression`:this.renderExpression(e,t);break;case`cellIs`:this.renderCellIs(e,t);break;case`top10`:this.renderTop10(e,t);break;case`aboveAverage`:this.renderAboveAverage(e,t);break;case`dataBar`:this.renderDataBar(e,t);break;case`colorScale`:this.renderColorScale(e,t);break;case`iconSet`:this.renderIconSet(e,t);break;case`containsText`:this.renderText(e,t);break;case`timePeriod`:this.renderTimePeriod(e,t);break}}renderExpression(e,t){e.openNode(this.tag,{type:`expression`,dxfId:t.dxfId,priority:t.priority}),this.formulaXform.render(e,t.formulae[0]),e.closeNode()}renderCellIs(e,t){e.openNode(this.tag,{type:`cellIs`,dxfId:t.dxfId,priority:t.priority,operator:t.operator}),t.formulae.forEach(t=>{this.formulaXform.render(e,t)}),e.closeNode()}renderTop10(e,t){e.leafNode(this.tag,{type:`top10`,dxfId:t.dxfId,priority:t.priority,percent:$.toBoolAttribute(t.percent,!1),bottom:$.toBoolAttribute(t.bottom,!1),rank:$.toIntValue(t.rank,10)})}renderAboveAverage(e,t){e.leafNode(this.tag,{type:`aboveAverage`,dxfId:t.dxfId,priority:t.priority,aboveAverage:$.toBoolAttribute(t.aboveAverage,!0)})}renderDataBar(e,t){e.openNode(this.tag,{type:`dataBar`,priority:t.priority}),this.databarXform.render(e,t),this.extLstRefXform.render(e,t),e.closeNode()}renderColorScale(e,t){e.openNode(this.tag,{type:`colorScale`,priority:t.priority}),this.colorScaleXform.render(e,t),e.closeNode()}renderIconSet(t,n){e.isPrimitive(n)&&(t.openNode(this.tag,{type:`iconSet`,priority:n.priority}),this.iconSetXform.render(t,n),t.closeNode())}renderText(e,t){e.openNode(this.tag,{type:t.operator,dxfId:t.dxfId,priority:t.priority,operator:$.toStringAttribute(t.operator,`containsText`)});let n=Tl(t);n&&this.formulaXform.render(e,n),e.closeNode()}renderTimePeriod(e,t){e.openNode(this.tag,{type:`timePeriod`,dxfId:t.dxfId,priority:t.priority,timePeriod:t.timePeriod});let n=El(t);n&&this.formulaXform.render(e,n),e.closeNode()}createNewModel({attributes:e}){return{...Dl(e),dxfId:$.toIntValue(e.dxfId),priority:$.toIntValue(e.priority),timePeriod:e.timePeriod,percent:$.toBoolValue(e.percent),bottom:$.toBoolValue(e.bottom),rank:$.toIntValue(e.rank),aboveAverage:$.toBoolValue(e.aboveAverage)}}onParserClose(e,t){switch(e){case`dataBar`:case`extLst`:case`colorScale`:case`iconSet`:Object.assign(this.model,t.model);break;case`formula`:this.model.formulae=this.model.formulae||[],this.model.formulae.push(t.model);break}}},kl=class extends hl{constructor(){super(),this.map={cfRule:new Ol}}get tag(){return`conditionalFormatting`}render(e,t){t.rules.some(Ol.isPrimitive)&&(e.openNode(this.tag,{sqref:t.ref}),t.rules.forEach(n=>{Ol.isPrimitive(n)&&(n.ref=t.ref,this.map.cfRule.render(e,n))}),e.closeNode())}createNewModel({attributes:e}){return{ref:e.sqref,rules:[]}}onParserClose(e,t){this.model.rules.push(t.model)}},Al=class extends ${constructor(){super(),this.cfXform=new kl}get tag(){return`conditionalFormatting`}reset(){this.model=[]}prepare(e,t){let n=e.reduce((e,t)=>Math.max(e,...t.rules.map(e=>e.priority||0)),1);e.forEach(e=>{e.rules.forEach(e=>{e.priority||=n++,e.style&&(e.dxfId=t.styles.addDxfStyle(e.style))})})}render(e,t){t.forEach(t=>{this.cfXform.render(e,t)})}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`conditionalFormatting`:return this.parser=this.cfXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){return this.parser?this.parser.parseClose(e)?!0:(this.model.push(this.parser.model),this.parser=void 0,!1):!1}reconcile(e,t){e.forEach(e=>{e.rules.forEach(e=>{e.dxfId!==void 0&&(e.style=t.styles.getDxfStyle(e.dxfId),delete e.dxfId)})})}};let jl=[];for(let e=0;e<256;++e)jl.push((e+256).toString(16).slice(1));function Ml(e,t=0){return(jl[e[t+0]]+jl[e[t+1]]+jl[e[t+2]]+jl[e[t+3]]+`-`+jl[e[t+4]]+jl[e[t+5]]+`-`+jl[e[t+6]]+jl[e[t+7]]+`-`+jl[e[t+8]]+jl[e[t+9]]+`-`+jl[e[t+10]]+jl[e[t+11]]+jl[e[t+12]]+jl[e[t+13]]+jl[e[t+14]]+jl[e[t+15]]).toLowerCase()}let Nl,Pl=new Uint8Array(16);function Fl(){if(!Nl){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);Nl=crypto.getRandomValues.bind(crypto)}return Nl(Pl)}var Il={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Ll(e,t,n){e||={};let r=e.random??e.rng?.()??Fl();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return Ml(r)}function Rl(e,t,n){return Il.randomUUID&&!t&&!e?Il.randomUUID():Ll(e,t,n)}var zl=Rl,Bl=class extends ${get tag(){return`xm:f`}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=``}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}},Vl=class extends hl{constructor(){super(),this.map={"xm:f":this.fExtXform=new Bl}}get tag(){return`x14:cfvo`}render(e,t){e.openNode(this.tag,{type:t.type}),t.value!==void 0&&this.fExtXform.render(e,t.value),e.closeNode()}createNewModel(e){return{type:e.attributes.type}}onParserClose(e,t){switch(e){case`xm:f`:this.model.value=t.model?parseFloat(t.model):0;break}}},Hl=class extends hl{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new Vl,"x14:borderColor":this.borderColorXform=new Ns(`x14:borderColor`),"x14:negativeBorderColor":this.negativeBorderColorXform=new Ns(`x14:negativeBorderColor`),"x14:negativeFillColor":this.negativeFillColorXform=new Ns(`x14:negativeFillColor`),"x14:axisColor":this.axisColorXform=new Ns(`x14:axisColor`)}}static isExt(e){return!e.gradient}get tag(){return`x14:dataBar`}render(e,t){e.openNode(this.tag,{minLength:$.toIntAttribute(t.minLength,0,!0),maxLength:$.toIntAttribute(t.maxLength,100,!0),border:$.toBoolAttribute(t.border,!1),gradient:$.toBoolAttribute(t.gradient,!0),negativeBarColorSameAsPositive:$.toBoolAttribute(t.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:$.toBoolAttribute(t.negativeBarBorderColorSameAsPositive,!0),axisPosition:$.toAttribute(t.axisPosition,`auto`),direction:$.toAttribute(t.direction,`leftToRight`)}),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),this.borderColorXform.render(e,t.borderColor),this.negativeBorderColorXform.render(e,t.negativeBorderColor),this.negativeFillColorXform.render(e,t.negativeFillColor),this.axisColorXform.render(e,t.axisColor),e.closeNode()}createNewModel({attributes:e}){return{cfvo:[],minLength:$.toIntValue(e.minLength,0),maxLength:$.toIntValue(e.maxLength,100),border:$.toBoolValue(e.border,!1),gradient:$.toBoolValue(e.gradient,!0),negativeBarColorSameAsPositive:$.toBoolValue(e.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:$.toBoolValue(e.negativeBarBorderColorSameAsPositive,!0),axisPosition:$.toStringValue(e.axisPosition,`auto`),direction:$.toStringValue(e.direction,`leftToRight`)}}onParserClose(e,t){let[,n]=e.split(`:`);switch(n){case`cfvo`:this.model.cfvo.push(t.model);break;default:this.model[n]=t.model;break}}},Ul=class extends ${get tag(){return`x14:cfIcon`}render(e,t){e.leafNode(this.tag,{iconSet:t.iconSet,iconId:t.iconId})}parseOpen({attributes:e}){this.model={iconSet:e.iconSet,iconId:$.toIntValue(e.iconId)}}parseClose(e){return e!==this.tag}},Wl=class extends hl{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new Vl,"x14:cfIcon":this.cfIconXform=new Ul}}get tag(){return`x14:iconSet`}render(e,t){e.openNode(this.tag,{iconSet:$.toStringAttribute(t.iconSet),reverse:$.toBoolAttribute(t.reverse,!1),showValue:$.toBoolAttribute(t.showValue,!0),custom:$.toBoolAttribute(t.icons,!1)}),t.cfvo.forEach(t=>{this.cfvoXform.render(e,t)}),t.icons&&t.icons.forEach((t,n)=>{t.iconId=n,this.cfIconXform.render(e,t)}),e.closeNode()}createNewModel({attributes:e}){return{cfvo:[],iconSet:$.toStringValue(e.iconSet,`3TrafficLights`),reverse:$.toBoolValue(e.reverse,!1),showValue:$.toBoolValue(e.showValue,!0)}}onParserClose(e,t){let[,n]=e.split(`:`);switch(n){case`cfvo`:this.model.cfvo.push(t.model);break;case`cfIcon`:this.model.icons||(this.model.icons=[]),this.model.icons.push(t.model);break;default:this.model[n]=t.model;break}}};let Gl={"3Triangles":!0,"3Stars":!0,"5Boxes":!0};var Kl=class e extends hl{constructor(){super(),this.map={"x14:dataBar":this.databarXform=new Hl,"x14:iconSet":this.iconSetXform=new Wl}}get tag(){return`x14:cfRule`}static isExt(e){return e.type===`dataBar`?Hl.isExt(e):!!(e.type===`iconSet`&&(e.custom||Gl[e.iconSet]))}prepare(t){e.isExt(t)&&(t.x14Id=`{${zl()}}`.toUpperCase())}render(t,n){if(e.isExt(n))switch(n.type){case`dataBar`:this.renderDataBar(t,n);break;case`iconSet`:this.renderIconSet(t,n);break}}renderDataBar(e,t){e.openNode(this.tag,{type:`dataBar`,id:t.x14Id}),this.databarXform.render(e,t),e.closeNode()}renderIconSet(e,t){e.openNode(this.tag,{type:`iconSet`,priority:t.priority,id:t.x14Id||`{${zl()}}`}),this.iconSetXform.render(e,t),e.closeNode()}createNewModel({attributes:e}){return{type:e.type,x14Id:e.id,priority:$.toIntValue(e.priority)}}onParserClose(e,t){Object.assign(this.model,t.model)}},ql=class extends ${get tag(){return`xm:sqref`}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(){this.model=``}parseText(e){this.model+=e}parseClose(e){return e!==this.tag}},Jl=class extends hl{constructor(){super(),this.map={"xm:sqref":this.sqRef=new ql,"x14:cfRule":this.cfRule=new Kl}}get tag(){return`x14:conditionalFormatting`}prepare(e){e.rules.forEach(e=>{this.cfRule.prepare(e)})}render(e,t){t.rules.some(Kl.isExt)&&(e.openNode(this.tag,{"xmlns:xm":`http://schemas.microsoft.com/office/excel/2006/main`}),t.rules.filter(Kl.isExt).forEach(t=>this.cfRule.render(e,t)),this.sqRef.render(e,t.ref),e.closeNode())}createNewModel(){return{rules:[]}}onParserClose(e,t){switch(e){case`xm:sqref`:this.model.ref=t.model;break;case`x14:cfRule`:this.model.rules.push(t.model);break}}},Yl=class extends hl{constructor(){super(),this.map={"x14:conditionalFormatting":this.cfXform=new Jl}}get tag(){return`x14:conditionalFormattings`}hasContent(e){return e.hasExtContent===void 0&&(e.hasExtContent=e.some(e=>e.rules.some(Kl.isExt))),e.hasExtContent}prepare(e){e.forEach(e=>{this.cfXform.prepare(e)})}render(e,t){this.hasContent(t)&&(e.openNode(this.tag),t.forEach(t=>this.cfXform.render(e,t)),e.closeNode())}createNewModel(){return[]}onParserClose(e,t){this.model.push(t.model)}},Xl=class extends hl{constructor(){super(),this.map={"x14:conditionalFormattings":this.conditionalFormattings=new Yl}}get tag(){return`ext`}hasContent(e){return this.conditionalFormattings.hasContent(e.conditionalFormattings)}prepare(e){this.conditionalFormattings.prepare(e.conditionalFormattings)}render(e,t){e.openNode(`ext`,{uri:`{78C0D931-6437-407d-A8EE-F0AAD7539E65}`,"xmlns:x14":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/main`}),this.conditionalFormattings.render(e,t.conditionalFormattings),e.closeNode()}createNewModel(){return{}}onParserClose(e,t){this.model[e]=t.model}},Zl=class extends hl{constructor(){super(),this.map={ext:this.ext=new Xl}}get tag(){return`extLst`}prepare(e,t){this.ext.prepare(e)}hasContent(e){return this.ext.hasContent(e)}render(e,t){this.hasContent(t)&&(e.openNode(`extLst`),this.ext.render(e,t),e.closeNode())}createNewModel(){return{}}onParserClose(e,t){this.model[e]=t.model}};let Ql=(e,t)=>{Object.keys(t).forEach(n=>{let r=e[n],i=t[n];r===void 0&&i!==void 0&&(e[n]=i)})},$l=(e,t)=>{if(!t||!t.length)return e;if(!e||!e.length)return t;let n={},r={};return e.forEach(e=>{n[e.ref]=e,e.rules.forEach(e=>{let{x14Id:t}=e;t&&(r[t]=e)})}),t.forEach(t=>{t.rules.forEach(i=>{let a=r[i.x14Id];a?Ql(a,i):n[t.ref]?n[t.ref].rules.push(i):e.push({ref:t.ref,rules:[i]})})}),e};var eu=class e extends ${static{this.WORKSHEET_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`x14ac`,"xmlns:x14ac":`http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac`}}constructor(e){super();let{maxRows:t,maxCols:n,ignoreNodes:r}=e||{};this.ignoreNodes=r||[],this.map={sheetPr:new Kc,dimension:new Ic,sheetViews:new Ms({tag:`sheetViews`,count:!1,childXform:new Yc}),sheetFormatPr:new qc,cols:new Ms({tag:`cols`,count:!1,childXform:new Fc}),sheetData:new Ms({tag:`sheetData`,count:!1,empty:!0,childXform:new Pc({maxItems:n}),maxItems:t}),autoFilter:new cl,mergeCells:new Ms({tag:`mergeCells`,count:!0,childXform:new Rc}),rowBreaks:new pl,hyperlinks:new Ms({tag:`hyperlinks`,count:!1,childXform:new Lc}),pageMargins:new $c,dataValidations:new Hc,pageSetup:new al,headerFooter:new ml,printOptions:new sl,picture:new ll,drawing:new ul,sheetProtection:new Qc,tableParts:new Ms({tag:`tableParts`,count:!0,childXform:new dl}),conditionalFormatting:new Al,extLst:new Zl}}prepare(e,t){t.merges=new Ac,e.hyperlinks=t.hyperlinks=[],e.comments=t.comments=[],t.formulae={},t.siFormulae=0,this.map.cols.prepare(e.cols,t),this.map.sheetData.prepare(e.rows,t),this.map.conditionalFormatting.prepare(e.conditionalFormattings,t),e.mergeCells=t.merges.mergeCells;let n=e.rels=[];function r(e){return`rId${e.length+1}`}if(e.hyperlinks.forEach(e=>{let t=r(n);e.rId=t,n.push({Id:t,Type:kc.Hyperlink,Target:e.target,TargetMode:`External`})}),e.comments.length>0){let i={Id:r(n),Type:kc.Comments,Target:`../comments${e.id}.xml`};n.push(i);let a={Id:r(n),Type:kc.VmlDrawing,Target:`../drawings/vmlDrawing${e.id}.vml`};n.push(a),e.comments.forEach(e=>{e.refAddress=m.decodeAddress(e.ref)}),t.commentRefs.push({commentName:`comments${e.id}`,vmlDrawing:`vmlDrawing${e.id}`})}let i=[],a;e.media.forEach(o=>{if(o.type===`background`){let i=r(n);a=t.media[o.imageId],n.push({Id:i,Type:kc.Image,Target:`../media/${a.name}.${a.extension}`}),e.background={rId:i},e.image=t.media[o.imageId]}else if(o.type===`image`){let{drawing:s}=e;a=t.media[o.imageId],s||(s=e.drawing={rId:r(n),name:`drawing${++t.drawingsCount}`,anchors:[],rels:[]},t.drawings.push(s),n.push({Id:s.rId,Type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing`,Target:`../drawings/${s.name}.xml`}));let c=this.preImageId===o.imageId?i[o.imageId]:i[s.rels.length];c||(c=r(s.rels),i[s.rels.length]=c,s.rels.push({Id:c,Type:`http://schemas.openxmlformats.org/officeDocument/2006/relationships/image`,Target:`../media/${a.name}.${a.extension}`}));let l={picture:{rId:c},range:o.range};if(o.hyperlinks&&o.hyperlinks.hyperlink){let e=r(s.rels);i[s.rels.length]=e,l.picture.hyperlinks={tooltip:o.hyperlinks.tooltip,rId:e},s.rels.push({Id:e,Type:kc.Hyperlink,Target:o.hyperlinks.hyperlink,TargetMode:`External`})}this.preImageId=o.imageId,s.anchors.push(l)}}),e.tables.forEach(e=>{let i=r(n);e.rId=i,n.push({Id:i,Type:kc.Table,Target:`../tables/${e.target}`}),e.columns.forEach(e=>{let{style:n}=e;n&&(e.dxfId=t.styles.addDxfStyle(n))})}),(e.pivotTables||[]).forEach(e=>{n.push({Id:r(n),Type:kc.PivotTable,Target:`../pivotTables/pivotTable${e.tableNumber}.xml`})}),this.map.extLst.prepare(e,t)}render(t,n){t.openXml(ws.StdDocAttributes),t.openNode(`worksheet`,e.WORKSHEET_ATTRIBUTES);let r=n.properties?{defaultRowHeight:n.properties.defaultRowHeight,dyDescent:n.properties.dyDescent,outlineLevelCol:n.properties.outlineLevelCol,outlineLevelRow:n.properties.outlineLevelRow}:void 0;n.properties&&n.properties.defaultColWidth&&(r.defaultColWidth=n.properties.defaultColWidth);let i={outlineProperties:n.properties&&n.properties.outlineProperties,tabColor:n.properties&&n.properties.tabColor,pageSetup:n.pageSetup&&n.pageSetup.fitToPage?{fitToPage:n.pageSetup.fitToPage}:void 0},a=n.pageSetup&&n.pageSetup.margins,o={showRowColHeaders:n.pageSetup&&n.pageSetup.showRowColHeaders,showGridLines:n.pageSetup&&n.pageSetup.showGridLines,horizontalCentered:n.pageSetup&&n.pageSetup.horizontalCentered,verticalCentered:n.pageSetup&&n.pageSetup.verticalCentered},s=n.sheetProtection;this.map.sheetPr.render(t,i),this.map.dimension.render(t,n.dimensions),this.map.sheetViews.render(t,n.views),this.map.sheetFormatPr.render(t,r),this.map.cols.render(t,n.cols),this.map.sheetData.render(t,n.rows),this.map.sheetProtection.render(t,s),this.map.autoFilter.render(t,n.autoFilter),this.map.mergeCells.render(t,n.mergeCells),this.map.conditionalFormatting.render(t,n.conditionalFormattings),this.map.dataValidations.render(t,n.dataValidations),this.map.hyperlinks.render(t,n.hyperlinks),this.map.printOptions.render(t,o),this.map.pageMargins.render(t,a),this.map.pageSetup.render(t,n.pageSetup),this.map.headerFooter.render(t,n.headerFooter),this.map.rowBreaks.render(t,n.rowBreaks),this.map.drawing.render(t,n.drawing),this.map.picture.render(t,n.background),this.map.tableParts.render(t,n.tables),this.map.extLst.render(t,n),n.rels&&n.rels.forEach(e=>{e.Type===kc.VmlDrawing&&t.leafNode(`legacyDrawing`,{"r:id":e.Id})}),t.closeNode()}parseOpen(e){return this.parser?(this.parser.parseOpen(e),!0):e.name===`worksheet`?(Object.values(this.map).forEach(e=>{e.reset()}),!0):(this.map[e.name]&&!this.ignoreNodes.includes(e.name)&&(this.parser=this.map[e.name],this.parser.parseOpen(e)),!0)}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case`worksheet`:{let e=this.map.sheetFormatPr.model||{};this.map.sheetPr.model&&this.map.sheetPr.model.tabColor&&(e.tabColor=this.map.sheetPr.model.tabColor),this.map.sheetPr.model&&this.map.sheetPr.model.outlineProperties&&(e.outlineProperties=this.map.sheetPr.model.outlineProperties);let t={fitToPage:this.map.sheetPr.model&&this.map.sheetPr.model.pageSetup&&this.map.sheetPr.model.pageSetup.fitToPage||!1,margins:this.map.pageMargins.model},n=Object.assign(t,this.map.pageSetup.model,this.map.printOptions.model),r=$l(this.map.conditionalFormatting.model,this.map.extLst.model&&this.map.extLst.model[`x14:conditionalFormattings`]);return this.model={dimensions:this.map.dimension.model,cols:this.map.cols.model,rows:this.map.sheetData.model,mergeCells:this.map.mergeCells.model,hyperlinks:this.map.hyperlinks.model,dataValidations:this.map.dataValidations.model,properties:e,views:this.map.sheetViews.model,pageSetup:n,headerFooter:this.map.headerFooter.model,background:this.map.picture.model,drawing:this.map.drawing.model,tables:this.map.tableParts.model,conditionalFormattings:r},this.map.autoFilter.model&&(this.model.autoFilter=this.map.autoFilter.model),this.map.sheetProtection.model&&(this.model.sheetProtection=this.map.sheetProtection.model),!1}default:return!0}}reconcile(e,t){let n=(e.relationships||[]).reduce((n,r)=>{if(n[r.Id]=r,r.Type===kc.Comments&&(e.comments=t.comments[r.Target].comments),r.Type===kc.VmlDrawing&&e.comments&&e.comments.length){let n=t.vmlDrawings[r.Target].comments;e.comments.forEach((e,t)=>{e.note=Object.assign({},e.note,n[t])})}return n},{});if(t.commentsMap=(e.comments||[]).reduce((e,t)=>(t.ref&&(e[t.ref]=t),e),{}),t.hyperlinkMap=(e.hyperlinks||[]).reduce((e,t)=>(t.rId&&(e[t.address]=n[t.rId].Target),e),{}),t.formulae={},e.rows=e.rows&&e.rows.filter(Boolean)||[],e.rows.forEach(e=>{e.cells=e.cells&&e.cells.filter(Boolean)||[]}),this.map.cols.reconcile(e.cols,t),this.map.sheetData.reconcile(e.rows,t),this.map.conditionalFormatting.reconcile(e.conditionalFormattings,t),e.media=[],e.drawing){let r=n[e.drawing.rId].Target.match(/\/drawings\/([a-zA-Z0-9]+)[.][a-zA-Z]{3,4}$/);if(r){let n=r[1];t.drawings[n].anchors.forEach(t=>{if(t.medium){let n={type:`image`,imageId:t.medium.index,range:t.range,hyperlinks:t.picture.hyperlinks};e.media.push(n)}})}}let r=e.background&&n[e.background.rId];if(r){let n=r.Target.split(`/media/`)[1],i=t.mediaIndex&&t.mediaIndex[n];i!==void 0&&e.media.push({type:`background`,imageId:i})}e.tables=(e.tables||[]).map(e=>{let r=n[e.rId];return t.tables[r.Target]}),e.pivotTables=[],(e.relationships||[]).forEach(n=>{if(n.Type===kc.PivotTable&&t.pivotTables){let r=t.pivotTables[n.Target];r&&e.pivotTables.push(r)}}),delete e.relationships,delete e.hyperlinks,delete e.comments}},tu=class extends ${parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={range:{editAs:e.attributes.editAs||`oneCell`}};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}reconcilePicture(e,t){if(e&&e.rId){let n=t.rels[e.rId].Target.match(/.*\/media\/(.+[.][a-zA-Z]{3,4})/);if(n){let e=n[1],r=t.mediaIndex[e];return t.media[r]}}}},nu=class extends ${constructor(e){super(),this.tag=e.tag,this.map={"xdr:col":new Fs({tag:`xdr:col`,zero:!0}),"xdr:colOff":new Fs({tag:`xdr:colOff`,zero:!0}),"xdr:row":new Fs({tag:`xdr:row`,zero:!0}),"xdr:rowOff":new Fs({tag:`xdr:rowOff`,zero:!0})},this.model={nativeCol:0,nativeColOff:0,nativeRow:0,nativeRowOff:0}}render(e,t){e.openNode(this.tag),this.map[`xdr:col`].render(e,t.nativeCol),this.map[`xdr:colOff`].render(e,t.nativeColOff),this.map[`xdr:row`].render(e,t.nativeRow),this.map[`xdr:rowOff`].render(e,t.nativeRowOff),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model={nativeCol:this.map[`xdr:col`].model,nativeColOff:this.map[`xdr:colOff`].model,nativeRow:this.map[`xdr:row`].model,nativeRowOff:this.map[`xdr:rowOff`].model},!1;default:return!0}}},ru=class extends ${constructor(){super(),this.model={rId:``}}get tag(){return`a:blip`}render(e,t){e.leafNode(this.tag,{"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"r:embed":t.rId,cstate:`print`})}parseOpen(e){switch(e.name){case this.tag:return this.model={rId:e.attributes[`r:embed`]},!0;default:return!0}}parseText(){}parseClose(e){switch(e){case this.tag:return!1;default:return!0}}},iu=class extends ${constructor(){super(),this.map={"a:blip":new ru}}get tag(){return`xdr:blipFill`}render(e,t){e.openNode(this.tag),this.map[`a:blip`].render(e,t),e.openNode(`a:stretch`),e.leafNode(`a:fillRect`),e.closeNode(),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model=this.map[`a:blip`].model,!1;default:return!0}}},au=class extends ${constructor(){super(),this.model={}}get tag(){return`a:hlinkClick`}render(e,t){t.hyperlinks&&t.hyperlinks.rId&&e.leafNode(this.tag,{"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"r:id":t.hyperlinks.rId,tooltip:t.hyperlinks.tooltip})}parseOpen(e){switch(e.name){case this.tag:return this.model={hyperlinks:{rId:e.attributes[`r:id`],tooltip:e.attributes.tooltip}},!0;default:return!0}}parseText(){}parseClose(){return!1}},ou=class extends ${get tag(){return`a:extLst`}render(e){e.openNode(this.tag),e.openNode(`a:ext`,{uri:`{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}`}),e.leafNode(`a16:creationId`,{"xmlns:a16":`http://schemas.microsoft.com/office/drawing/2014/main`,id:`{00000000-0008-0000-0000-000002000000}`}),e.closeNode(),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:return!0;default:return!0}}parseText(){}parseClose(e){switch(e){case this.tag:return!1;default:return!0}}},su=class extends ${constructor(){super(),this.map={"a:hlinkClick":new au,"a:extLst":new ou}}get tag(){return`xdr:cNvPr`}render(e,t){e.openNode(this.tag,{id:t.index,name:`Picture ${t.index}`}),this.map[`a:hlinkClick`].render(e,t),this.map[`a:extLst`].render(e,t),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model=this.map[`a:hlinkClick`].model,!1;default:return!0}}},cu=class extends ${get tag(){return`xdr:cNvPicPr`}render(e){e.openNode(this.tag),e.leafNode(`a:picLocks`,{noChangeAspect:`1`}),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:return!0;default:return!0}}parseText(){}parseClose(e){switch(e){case this.tag:return!1;default:return!0}}},lu=class extends ${constructor(){super(),this.map={"xdr:cNvPr":new su,"xdr:cNvPicPr":new cu}}get tag(){return`xdr:nvPicPr`}render(e,t){e.openNode(this.tag),this.map[`xdr:cNvPr`].render(e,t),this.map[`xdr:cNvPicPr`].render(e,t),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model=this.map[`xdr:cNvPr`].model,!1;default:return!0}}};let uu={tag:`xdr:spPr`,c:[{tag:`a:xfrm`,c:[{tag:`a:off`,$:{x:`0`,y:`0`}},{tag:`a:ext`,$:{cx:`0`,cy:`0`}}]},{tag:`a:prstGeom`,$:{prst:`rect`},c:[{tag:`a:avLst`}]}]};var du=class extends ${constructor(){super(),this.map={"xdr:nvPicPr":new lu,"xdr:blipFill":new iu,"xdr:spPr":new js(uu)}}get tag(){return`xdr:pic`}prepare(e,t){e.index=t.index+1}render(e,t){e.openNode(this.tag),this.map[`xdr:nvPicPr`].render(e,t),this.map[`xdr:blipFill`].render(e,t),this.map[`xdr:spPr`].render(e,t),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset();break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.mergeModel(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:return!0}}},fu=class extends tu{constructor(){super(),this.map={"xdr:from":new nu({tag:`xdr:from`}),"xdr:to":new nu({tag:`xdr:to`}),"xdr:pic":new du,"xdr:clientData":new js({tag:`xdr:clientData`})}}get tag(){return`xdr:twoCellAnchor`}prepare(e,t){this.map[`xdr:pic`].prepare(e.picture,t)}render(e,t){e.openNode(this.tag,{editAs:t.range.editAs||`oneCell`}),this.map[`xdr:from`].render(e,t.range.tl),this.map[`xdr:to`].render(e,t.range.br),this.map[`xdr:pic`].render(e,t.picture),this.map[`xdr:clientData`].render(e,{}),e.closeNode()}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.range.tl=this.map[`xdr:from`].model,this.model.range.br=this.map[`xdr:to`].model,this.model.picture=this.map[`xdr:pic`].model,!1;default:return!0}}reconcile(e,t){e.medium=this.reconcilePicture(e.picture,t)}};let pu=9525;var mu=class extends ${constructor(e){super(),this.tag=e.tag,this.map={},this.model={width:0,height:0}}render(e,t){e.openNode(this.tag);let n=Math.floor(t.width*pu),r=Math.floor(t.height*pu);e.addAttribute(`cx`,n),e.addAttribute(`cy`,r),e.closeNode()}parseOpen(e){return e.name===this.tag?(this.model={width:parseInt(e.attributes.cx||`0`,10)/pu,height:parseInt(e.attributes.cy||`0`,10)/pu},!0):!1}parseText(e){}parseClose(e){return!1}},hu=class extends tu{constructor(){super(),this.map={"xdr:from":new nu({tag:`xdr:from`}),"xdr:ext":new mu({tag:`xdr:ext`}),"xdr:pic":new du,"xdr:clientData":new js({tag:`xdr:clientData`})}}get tag(){return`xdr:oneCellAnchor`}prepare(e,t){this.map[`xdr:pic`].prepare(e.picture,t)}render(e,t){e.openNode(this.tag,{editAs:t.range.editAs||`oneCell`}),this.map[`xdr:from`].render(e,t.range.tl),this.map[`xdr:ext`].render(e,t.range.ext),this.map[`xdr:pic`].render(e,t.picture),this.map[`xdr:clientData`].render(e,{}),e.closeNode()}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.range.tl=this.map[`xdr:from`].model,this.model.range.ext=this.map[`xdr:ext`].model,this.model.picture=this.map[`xdr:pic`].model,!1;default:return!0}}reconcile(e,t){e.medium=this.reconcilePicture(e.picture,t)}};function gu(e){return(typeof e.range==`string`?m.decode(e.range):e.range).br?`xdr:twoCellAnchor`:`xdr:oneCellAnchor`}var _u=class e extends ${constructor(){super(),this.map={"xdr:twoCellAnchor":new fu,"xdr:oneCellAnchor":new hu},this.model={anchors:[]}}prepare(e){e.anchors.forEach((e,t)=>{e.anchorType=gu(e),this.map[e.anchorType].prepare(e,{index:t})})}get tag(){return`xdr:wsDr`}render(t,n){let r=n||this.model;t.openXml(ws.StdDocAttributes),t.openNode(this.tag,e.DRAWING_ATTRIBUTES),r.anchors.forEach(e=>{this.map[e.anchorType].render(t,e)}),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={anchors:[]};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.anchors.push(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:return!0}}reconcile(e,t){e.anchors.forEach(e=>{e.br?this.map[`xdr:twoCellAnchor`].reconcile(e,t):this.map[`xdr:oneCellAnchor`].reconcile(e,t)})}static{this.DRAWING_ATTRIBUTES={"xmlns:xdr":`http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing`,"xmlns:a":`http://schemas.openxmlformats.org/drawingml/2006/main`}}},vu=class extends ${constructor(){super(),this.model={val:``}}get tag(){return`customFilter`}render(e,t){e.leafNode(this.tag,{val:t.val,operator:t.operator})}parseOpen(e){return e.name===this.tag?(this.model={val:e.attributes.val,operator:e.attributes.operator},!0):!1}parseText(){}parseClose(){return!1}},yu=class extends ${constructor(){super(),this.model={val:``}}get tag(){return`filter`}render(e,t){e.leafNode(this.tag,{val:t.val})}parseOpen(e){return e.name===this.tag?(this.model={val:e.attributes.val},!0):!1}parseText(){}parseClose(){return!1}},bu=class extends ${constructor(){super(),this.map={customFilters:new Ms({tag:`customFilters`,count:!1,empty:!0,childXform:new vu}),filters:new Ms({tag:`filters`,count:!1,empty:!0,childXform:new yu})},this.model={filterButton:!1}}get tag(){return`filterColumn`}prepare(e,t){e.colId=t.index.toString()}render(e,t){if(t.customFilters){e.openNode(this.tag,{colId:t.colId,hiddenButton:t.filterButton?`0`:`1`}),this.map.customFilters.render(e,t.customFilters),e.closeNode();return}e.leafNode(this.tag,{colId:t.colId,hiddenButton:t.filterButton?`0`:`1`})}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;let{attributes:t}=e;switch(e.name){case this.tag:return this.model={filterButton:t.hiddenButton===`0`},!0;case`dynamicFilter`:return!0;default:if(this.parser=this.map[e.name],this.parser)return this.parseOpen(e),!0;throw Error(`Unexpected xml node in parseOpen: ${JSON.stringify(e)}`)}}parseText(){}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.customFilters=this.map.customFilters.model,!1;default:return!0}}},xu=class extends ${constructor(){super(),this.map={filterColumn:new bu},this.model={autoFilterRef:``,columns:[]}}get tag(){return`autoFilter`}prepare(e){e.columns.forEach((e,t)=>{this.map.filterColumn.prepare(e,{index:t})})}render(e,t){e.openNode(this.tag,{ref:t.autoFilterRef}),t.columns.forEach(t=>{this.map.filterColumn.render(e,t)}),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:return this.model={autoFilterRef:e.attributes.ref,columns:[]},!0;default:if(this.parser=this.map[e.name],this.parser)return this.parseOpen(e),!0;throw Error(`Unexpected xml node in parseOpen: ${JSON.stringify(e)}`)}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.columns.push(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:throw Error(`Unexpected xml node in parseClose: ${e}`)}}},Su=class extends ${constructor(){super(),this.model={name:``}}get tag(){return`tableColumn`}prepare(e,t){e.id=t.index+1}render(e,t){e.leafNode(this.tag,{id:t.id.toString(),name:t.name,totalsRowLabel:t.totalsRowLabel,totalsRowFunction:t.totalsRowFunction,dxfId:t.dxfId})}parseOpen(e){if(e.name===this.tag){let{attributes:t}=e;return this.model={name:t.name,totalsRowLabel:t.totalsRowLabel,totalsRowFunction:t.totalsRowFunction,dxfId:t.dxfId},!0}return!1}parseText(){}parseClose(){return!1}},Cu=class extends ${constructor(){super(),this.model={theme:null,showFirstColumn:!1,showLastColumn:!1,showRowStripes:!1,showColumnStripes:!1}}get tag(){return`tableStyleInfo`}render(e,t){e.leafNode(this.tag,{name:t.theme?t.theme:void 0,showFirstColumn:t.showFirstColumn?`1`:`0`,showLastColumn:t.showLastColumn?`1`:`0`,showRowStripes:t.showRowStripes?`1`:`0`,showColumnStripes:t.showColumnStripes?`1`:`0`})}parseOpen(e){if(e.name===this.tag){let{attributes:t}=e;return this.model={theme:t.name?t.name:null,showFirstColumn:t.showFirstColumn===`1`,showLastColumn:t.showLastColumn===`1`,showRowStripes:t.showRowStripes===`1`,showColumnStripes:t.showColumnStripes===`1`},!0}return!1}parseText(){}parseClose(){return!1}},wu=class e extends ${constructor(){super(),this.map={autoFilter:new xu,tableColumns:new Ms({tag:`tableColumns`,count:!0,empty:!0,childXform:new Su}),tableStyleInfo:new Cu},this.model={id:0,name:``,tableRef:``,columns:[]}}prepare(e,t){this.map.autoFilter.prepare(e),this.map.tableColumns.prepare(e.columns,t)}get tag(){return`table`}render(t,n){t.openXml(ws.StdDocAttributes),t.openNode(this.tag,{...e.TABLE_ATTRIBUTES,id:n.id,name:n.name,displayName:n.displayName||n.name,ref:n.tableRef,totalsRowCount:n.totalsRow?`1`:void 0,totalsRowShown:n.totalsRow?void 0:`1`,headerRowCount:n.headerRow?`1`:`0`}),this.map.autoFilter.render(t,n),this.map.tableColumns.render(t,n.columns),this.map.tableStyleInfo.render(t,n.style),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;let{name:t,attributes:n}=e;switch(t){case this.tag:this.reset(),this.model={name:n.name,displayName:n.displayName||n.name,tableRef:n.ref,totalsRow:n.totalsRowCount===`1`,headerRow:n.headerRowCount===`1`};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.columns=this.map.tableColumns.model,this.map.autoFilter.model&&(this.model.autoFilterRef=this.map.autoFilter.model.autoFilterRef,this.map.autoFilter.model.columns.forEach((e,t)=>{this.model.columns[t].filterButton=e.filterButton})),this.model.style=this.map.tableStyleInfo.model,!1;default:return!0}}reconcile(e,t){e.tableRef&&!e.ref&&(e.ref=e.tableRef),e.rows||=[],e.columns.forEach(e=>{e.dxfId!==void 0&&(e.style=t.styles.getDxfStyle(e.dxfId))})}static{this.TABLE_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`xr xr3`,"xmlns:xr":`http://schemas.microsoft.com/office/spreadsheetml/2014/revision`,"xmlns:xr3":`http://schemas.microsoft.com/office/spreadsheetml/2016/revision3`}}},Tu=class e extends ${constructor(){super(),this.map={},this.model=null,this.currentRecord=null}prepare(e){}get tag(){return`pivotCacheRecords`}reset(){this.model=null,this.currentRecord=null}render(e,t){t.isLoaded||!(`source`in t)?this.renderLoaded(e,t):this.renderNew(e,t)}renderNew(t,n){let{source:r,cacheFields:i}=n,a=r.getSheetValues().slice(2);t.openXml(ws.StdDocAttributes),t.openNode(this.tag,{...e.PIVOT_CACHE_RECORDS_ATTRIBUTES,count:a.length}),t.writeXml(this.renderTableNew(a,i)),t.closeNode()}renderLoaded(t,n){t.openXml(ws.StdDocAttributes),t.openNode(this.tag,{...e.PIVOT_CACHE_RECORDS_ATTRIBUTES,count:n.count});for(let e of n.records){t.writeXml(`
94
+ <r>`);for(let n of e)t.writeXml(`
95
+ `),t.writeXml(this.renderRecordValue(n));t.writeXml(`
96
+ </r>`)}t.closeNode()}renderRecordValue(e){switch(e.type){case`x`:return`<x v="${e.value}" />`;case`n`:return`<n v="${e.value}" />`;case`s`:return`<s v="${na(String(e.value))}" />`;case`b`:return`<b v="${e.value?`1`:`0`}" />`;case`m`:return`<m />`;case`d`:return`<d v="${e.value.toISOString()}" />`;case`e`:return`<e v="${e.value}" />`;default:return`<m />`}}renderTableNew(e,t){let n=[];for(let r of e){let e=r.slice(1);n.push(`
97
+ <r>`);for(let r=0;r<e.length;r++)n.push(`
98
+ `),n.push(this.renderCellNew(e[r],t[r].sharedItems));n.push(`
99
+ </r>`)}return n.join(``)}renderCellNew(e,t){if(e==null)return`<m />`;if(t===null)return Number.isFinite(e)?`<n v="${e}" />`:`<s v="${na(String(e))}" />`;let n=t.indexOf(e);if(n<0)throw Error(`${JSON.stringify(e)} not in sharedItems ${JSON.stringify(t)}`);return`<x v="${n}" />`}parseOpen(e){let{name:t,attributes:n}=e;switch(t){case this.tag:this.reset(),this.model={records:[],count:parseInt(n.count||`0`,10),isLoaded:!0};break;case`r`:this.currentRecord=[];break;case`x`:this.currentRecord&&this.currentRecord.push({type:`x`,value:parseInt(n.v||`0`,10)});break;case`n`:this.currentRecord&&this.currentRecord.push({type:`n`,value:parseFloat(n.v||`0`)});break;case`s`:this.currentRecord&&this.currentRecord.push({type:`s`,value:ra(n.v||``)});break;case`b`:this.currentRecord&&this.currentRecord.push({type:`b`,value:n.v===`1`});break;case`m`:this.currentRecord&&this.currentRecord.push({type:`m`});break;case`d`:this.currentRecord&&this.currentRecord.push({type:`d`,value:new Date(n.v||``)});break;case`e`:this.currentRecord&&this.currentRecord.push({type:`e`,value:n.v||``});break}return!0}parseText(e){}parseClose(e){switch(e){case this.tag:return!1;case`r`:this.model&&this.currentRecord&&(this.model.records.push(this.currentRecord),this.currentRecord=null);break}return!0}reconcile(e,t){}static{this.PIVOT_CACHE_RECORDS_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`xr`,"xmlns:xr":`http://schemas.microsoft.com/office/spreadsheetml/2014/revision`}}},Eu=class{constructor({name:e,sharedItems:t}){this.name=e,this.sharedItems=t}render(){let e=na(this.name);return this.sharedItems===null?`<cacheField name="${e}" numFmtId="0">
98
100
  <sharedItems containsSemiMixedTypes="0" containsString="0" containsNumber="1" containsInteger="1" />
99
- </cacheField>`:`<cacheField name="${this.name}" numFmtId="0">
101
+ </cacheField>`:`<cacheField name="${e}" numFmtId="0">
100
102
  <sharedItems count="${this.sharedItems.length}">
101
- ${this.sharedItems.map(e=>`<s v="${e}" />`).join(``)}
103
+ ${this.sharedItems.map(e=>`<s v="${na(String(e))}" />`).join(``)}
102
104
  </sharedItems>
103
- </cacheField>`}},Au=class e extends ${constructor(){super(),this.map={}}prepare(e){}get tag(){return`pivotCacheDefinition`}render(t,n){let{sourceSheet:r,cacheFields:i}=n;t.openXml(Ds.StdDocAttributes),t.openNode(this.tag,{...e.PIVOT_CACHE_DEFINITION_ATTRIBUTES,"r:id":`rId1`,refreshOnLoad:`1`,refreshedBy:`Author`,refreshedDate:`45125.026046874998`,createdVersion:`8`,refreshedVersion:`8`,minRefreshableVersion:`3`,recordCount:i.length+1}),t.openNode(`cacheSource`,{type:`worksheet`}),t.leafNode(`worksheetSource`,{ref:r.dimensions.shortRange,sheet:r.name}),t.closeNode(),t.openNode(`cacheFields`,{count:i.length}),t.writeXml(i.map(e=>new ku(e).render()).join(`
104
- `)),t.closeNode(),t.closeNode()}parseOpen(e){return!1}parseText(e){}parseClose(e){return!1}reconcile(e,t){}static{this.PIVOT_CACHE_DEFINITION_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`xr`,"xmlns:xr":`http://schemas.microsoft.com/office/spreadsheetml/2014/revision`}}},ju=class e extends ${constructor(){super(),this.map={}}prepare(e){}get tag(){return`pivotTableDefinition`}render(t,n){let{rows:r,columns:i,values:a,cacheFields:o,cacheId:s}=n;t.openXml(Ds.StdDocAttributes),t.openNode(this.tag,{...e.PIVOT_TABLE_ATTRIBUTES,"xr:uid":`{267EE50F-B116-784D-8DC2-BA77DE3F4F4A}`,name:`PivotTable2`,cacheId:s,applyNumberFormats:`0`,applyBorderFormats:`0`,applyFontFormats:`0`,applyPatternFormats:`0`,applyAlignmentFormats:`0`,applyWidthHeightFormats:`1`,dataCaption:`Values`,updatedVersion:`8`,minRefreshableVersion:`3`,useAutoFormatting:`1`,itemPrintTitles:`1`,createdVersion:`8`,indent:`0`,compact:`0`,compactData:`0`,multipleFieldFilters:`0`}),t.writeXml(`
105
+ </cacheField>`}},Du=class extends ${constructor(){super(),this.model=null,this.inSharedItems=!1}get tag(){return`cacheField`}reset(){this.model=null,this.inSharedItems=!1}parseOpen(e){let{name:t,attributes:n}=e;switch(t){case`cacheField`:this.model={name:ra(n.name||``),sharedItems:null};break;case`sharedItems`:this.inSharedItems=!0,n.containsNumber===`1`||n.containsInteger===`1`?this.model&&(this.model.containsNumber=n.containsNumber===`1`,this.model.containsInteger=n.containsInteger===`1`,n.minValue!==void 0&&(this.model.minValue=parseFloat(n.minValue)),n.maxValue!==void 0&&(this.model.maxValue=parseFloat(n.maxValue)),this.model.sharedItems=null):this.model&&parseInt(n.count||`0`,10)>0&&(this.model.sharedItems=[]);break;case`s`:if(this.inSharedItems&&this.model?.sharedItems!==null){let e=ra(n.v||``);this.model.sharedItems.push(e)}break;case`n`:if(this.inSharedItems&&this.model?.sharedItems!==null){let e=parseFloat(n.v||`0`);this.model.sharedItems.push(e)}break;case`b`:if(this.inSharedItems&&this.model?.sharedItems!==null){let e=n.v===`1`;this.model.sharedItems.push(e)}break;case`e`:if(this.inSharedItems&&this.model?.sharedItems!==null){let e=`#${n.v||`ERROR!`}`;this.model.sharedItems.push(e)}break;case`m`:this.inSharedItems&&this.model?.sharedItems!==null&&this.model.sharedItems.push(null);break;case`d`:if(this.inSharedItems&&this.model?.sharedItems!==null){let e=new Date(n.v||``);this.model.sharedItems.push(e)}break}return!0}parseText(e){}parseClose(e){switch(e){case`cacheField`:return!1;case`sharedItems`:this.inSharedItems=!1;break}return!0}},Ou=class e extends ${constructor(){super(),this.map={},this.model=null,this.currentCacheField=null,this.inCacheFields=!1,this.inCacheSource=!1}prepare(e){}get tag(){return`pivotCacheDefinition`}reset(){this.model=null,this.currentCacheField=null,this.inCacheFields=!1,this.inCacheSource=!1}render(e,t){t.isLoaded||!(`source`in t)?this.renderLoaded(e,t):this.renderNew(e,t)}renderNew(t,n){let{source:r,cacheFields:i}=n;t.openXml(ws.StdDocAttributes),t.openNode(this.tag,{...e.PIVOT_CACHE_DEFINITION_ATTRIBUTES,"r:id":`rId1`,refreshOnLoad:`1`,refreshedBy:`Author`,refreshedDate:`45125.026046874998`,createdVersion:`8`,refreshedVersion:`8`,minRefreshableVersion:`3`,recordCount:i.length+1}),t.openNode(`cacheSource`,{type:`worksheet`}),t.leafNode(`worksheetSource`,{ref:r.dimensions.shortRange,sheet:r.name}),t.closeNode(),t.openNode(`cacheFields`,{count:i.length}),t.writeXml(i.map(e=>new Eu(e).render()).join(`
106
+ `)),t.closeNode(),t.closeNode()}renderLoaded(t,n){let{cacheFields:r,sourceRef:i,sourceSheet:a,recordCount:o}=n;t.openXml(ws.StdDocAttributes),t.openNode(this.tag,{...e.PIVOT_CACHE_DEFINITION_ATTRIBUTES,"r:id":n.rId||`rId1`,refreshOnLoad:n.refreshOnLoad||`1`,refreshedBy:n.refreshedBy||`Author`,refreshedDate:n.refreshedDate||`45125.026046874998`,createdVersion:n.createdVersion||`8`,refreshedVersion:n.refreshedVersion||`8`,minRefreshableVersion:n.minRefreshableVersion||`3`,recordCount:o||r.length+1}),t.openNode(`cacheSource`,{type:`worksheet`}),t.leafNode(`worksheetSource`,{ref:i,sheet:a}),t.closeNode(),t.openNode(`cacheFields`,{count:r.length}),t.writeXml(r.map(e=>new Eu(e).render()).join(`
107
+ `)),t.closeNode(),t.closeNode()}parseOpen(e){let{name:t,attributes:n}=e;if(this.currentCacheField)return this.currentCacheField.parseOpen(e),!0;switch(t){case this.tag:this.reset(),this.model={cacheFields:[],rId:n[`r:id`],refreshOnLoad:n.refreshOnLoad,refreshedBy:n.refreshedBy,refreshedDate:n.refreshedDate,createdVersion:n.createdVersion,refreshedVersion:n.refreshedVersion,minRefreshableVersion:n.minRefreshableVersion,recordCount:n.recordCount?parseInt(n.recordCount,10):void 0,isLoaded:!0};break;case`cacheSource`:this.inCacheSource=!0;break;case`worksheetSource`:this.inCacheSource&&this.model&&(this.model.sourceRef=n.ref,this.model.sourceSheet=n.sheet);break;case`cacheFields`:this.inCacheFields=!0;break;case`cacheField`:this.inCacheFields&&(this.currentCacheField=new Du,this.currentCacheField.parseOpen(e));break}return!0}parseText(e){this.currentCacheField&&this.currentCacheField.parseText(e)}parseClose(e){if(this.currentCacheField)return this.currentCacheField.parseClose(e)||(this.model&&this.currentCacheField.model&&this.model.cacheFields.push(this.currentCacheField.model),this.currentCacheField=null),!0;switch(e){case this.tag:return!1;case`cacheSource`:this.inCacheSource=!1;break;case`cacheFields`:this.inCacheFields=!1;break}return!0}reconcile(e,t){}static{this.PIVOT_CACHE_DEFINITION_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:r":`http://schemas.openxmlformats.org/officeDocument/2006/relationships`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`xr`,"xmlns:xr":`http://schemas.microsoft.com/office/spreadsheetml/2014/revision`}}},ku=class e extends ${constructor(){super(),this.map={},this.model=null,this.inPivotFields=!1,this.inRowFields=!1,this.inColFields=!1,this.inDataFields=!1,this.inRowItems=!1,this.inColItems=!1,this.inLocation=!1,this.currentPivotField=null,this.inItems=!1,this.inPivotTableStyleInfo=!1}prepare(e){}get tag(){return`pivotTableDefinition`}reset(){this.model=null,this.inPivotFields=!1,this.inRowFields=!1,this.inColFields=!1,this.inDataFields=!1,this.inRowItems=!1,this.inColItems=!1,this.inLocation=!1,this.currentPivotField=null,this.inItems=!1,this.inPivotTableStyleInfo=!1}render(e,t){t.isLoaded?this.renderLoaded(e,t):this.renderNew(e,t)}renderNew(t,n){let{rows:r,columns:i,values:a,cacheFields:o,cacheId:s,applyWidthHeightFormats:c}=n,l=`{${zl().toUpperCase()}}`;t.openXml(ws.StdDocAttributes),t.openNode(this.tag,{...e.PIVOT_TABLE_ATTRIBUTES,"xr:uid":l,name:`PivotTable2`,cacheId:s,applyNumberFormats:`0`,applyBorderFormats:`0`,applyFontFormats:`0`,applyPatternFormats:`0`,applyAlignmentFormats:`0`,applyWidthHeightFormats:c,dataCaption:`Values`,updatedVersion:`8`,minRefreshableVersion:`3`,useAutoFormatting:`1`,itemPrintTitles:`1`,createdVersion:`8`,indent:`0`,compact:`0`,compactData:`0`,multipleFieldFilters:`0`}),t.writeXml(`
105
108
  <location ref="A3:E15" firstHeaderRow="1" firstDataRow="2" firstDataCol="1" />
106
109
  <pivotFields count="${o.length}">
107
- ${Mu(n)}
110
+ ${ju(n)}
108
111
  </pivotFields>
109
112
  <rowFields count="${r.length}">
110
113
  ${r.map(e=>`<field x="${e}" />`).join(`
@@ -113,20 +116,15 @@ ${h}.`);break;case m:switch(t){case`xml`:break;case``:e.fail(`the default namesp
113
116
  <rowItems count="1">
114
117
  <i t="grand"><x /></i>
115
118
  </rowItems>
116
- <colFields count="${i.length}">
117
- ${i.map(e=>`<field x="${e}" />`).join(`
119
+ <colFields count="${i.length===0?1:i.length}">
120
+ ${i.length===0?`<field x="-2" />`:i.map(e=>`<field x="${e}" />`).join(`
118
121
  `)}
119
122
  </colFields>
120
123
  <colItems count="1">
121
124
  <i t="grand"><x /></i>
122
125
  </colItems>
123
126
  <dataFields count="${a.length}">
124
- <dataField
125
- name="Sum of ${o[a[0]].name}"
126
- fld="${a[0]}"
127
- baseField="0"
128
- baseItem="0"
129
- />
127
+ ${Au(o,a,n.metric)}
130
128
  </dataFields>
131
129
  <pivotTableStyleInfo
132
130
  name="PivotStyleLight16"
@@ -156,7 +154,39 @@ ${h}.`);break;case m:switch(t){case`xml`:break;case``:e.fail(`the default namesp
156
154
  />
157
155
  </ext>
158
156
  </extLst>
159
- `),t.closeNode()}parseOpen(e){return!1}parseText(e){}parseClose(e){return!1}reconcile(e,t){}static{this.PIVOT_TABLE_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`xr`,"xmlns:xr":`http://schemas.microsoft.com/office/spreadsheetml/2014/revision`}}};function Mu(e){return e.cacheFields.map((t,n)=>Nu(e.rows.indexOf(n)>=0?`row`:e.columns.indexOf(n)>=0?`column`:e.values.indexOf(n)>=0?`value`:null,t.sharedItems)).join(``)}function Nu(e,t){let n=`compact="0" outline="0" showAll="0" defaultSubtotal="0"`;return e===`row`||e===`column`?`
157
+ `),t.closeNode()}renderLoaded(t,n){let r=n.uid||`{${zl().toUpperCase()}}`;if(t.openXml(ws.StdDocAttributes),t.openNode(this.tag,{...e.PIVOT_TABLE_ATTRIBUTES,"xr:uid":r,name:n.name||`PivotTable1`,cacheId:n.cacheId,applyNumberFormats:n.applyNumberFormats||`0`,applyBorderFormats:n.applyBorderFormats||`0`,applyFontFormats:n.applyFontFormats||`0`,applyPatternFormats:n.applyPatternFormats||`0`,applyAlignmentFormats:n.applyAlignmentFormats||`0`,applyWidthHeightFormats:n.applyWidthHeightFormats||`0`,dataCaption:n.dataCaption||`Values`,updatedVersion:n.updatedVersion||`8`,minRefreshableVersion:n.minRefreshableVersion||`3`,useAutoFormatting:n.useAutoFormatting?`1`:`0`,itemPrintTitles:n.itemPrintTitles?`1`:`0`,createdVersion:n.createdVersion||`8`,indent:n.indent===void 0?`0`:String(n.indent),compact:n.compact?`1`:`0`,compactData:n.compactData?`1`:`0`,multipleFieldFilters:n.multipleFieldFilters?`1`:`0`}),n.location&&t.leafNode(`location`,{ref:n.location.ref,firstHeaderRow:n.location.firstHeaderRow,firstDataRow:n.location.firstDataRow,firstDataCol:n.location.firstDataCol}),n.pivotFields.length>0){t.openNode(`pivotFields`,{count:n.pivotFields.length});for(let e of n.pivotFields)this.renderPivotFieldLoaded(t,e);t.closeNode()}if(n.rowFields.length>0){t.openNode(`rowFields`,{count:n.rowFields.length});for(let e of n.rowFields)t.leafNode(`field`,{x:e});t.closeNode()}t.writeXml(`
158
+ <rowItems count="1">
159
+ <i t="grand"><x /></i>
160
+ </rowItems>`);let i=n.colFields.length===0?1:n.colFields.length;if(t.openNode(`colFields`,{count:i}),n.colFields.length===0)t.leafNode(`field`,{x:-2});else for(let e of n.colFields)t.leafNode(`field`,{x:e});if(t.closeNode(),t.writeXml(`
161
+ <colItems count="1">
162
+ <i t="grand"><x /></i>
163
+ </colItems>`),n.dataFields.length>0){t.openNode(`dataFields`,{count:n.dataFields.length});for(let e of n.dataFields){let n={name:e.name,fld:e.fld,baseField:e.baseField??0,baseItem:e.baseItem??0};e.subtotal&&e.subtotal!==`sum`&&(n.subtotal=e.subtotal),t.leafNode(`dataField`,n)}t.closeNode()}t.leafNode(`pivotTableStyleInfo`,{name:n.styleName||`PivotStyleLight16`,showRowHeaders:`1`,showColHeaders:`1`,showRowStripes:`0`,showColStripes:`0`,showLastColumn:`1`}),t.writeXml(`
164
+ <extLst>
165
+ <ext
166
+ uri="{962EF5D1-5CA2-4c93-8EF4-DBF5C05439D2}"
167
+ xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"
168
+ >
169
+ <x14:pivotTableDefinition
170
+ hideValuesRow="1"
171
+ xmlns:xm="http://schemas.microsoft.com/office/excel/2006/main"
172
+ />
173
+ </ext>
174
+ <ext
175
+ uri="{747A6164-185A-40DC-8AA5-F01512510D54}"
176
+ xmlns:xpdl="http://schemas.microsoft.com/office/spreadsheetml/2016/pivotdefaultlayout"
177
+ >
178
+ <xpdl:pivotTableDefinition16
179
+ EnabledSubtotalsDefault="0"
180
+ SubtotalsOnTopDefault="0"
181
+ />
182
+ </ext>
183
+ </extLst>
184
+ `),t.closeNode()}renderPivotFieldLoaded(e,t){let n={compact:t.compact?`1`:`0`,outline:t.outline?`1`:`0`,showAll:t.showAll?`1`:`0`,defaultSubtotal:t.defaultSubtotal?`1`:`0`};if(t.axis&&(n.axis=t.axis),t.dataField&&(n.dataField=`1`),t.items&&t.items.length>0){e.openNode(`pivotField`,n),e.openNode(`items`,{count:t.items.length+1});for(let n of t.items)e.leafNode(`item`,{x:n});e.writeXml(`<item t="default" />`),e.closeNode(),e.closeNode()}else e.leafNode(`pivotField`,n)}parseOpen(e){let{name:t,attributes:n}=e;switch(t){case this.tag:this.reset(),this.model={name:n.name,cacheId:parseInt(n.cacheId||`0`,10),uid:n[`xr:uid`],pivotFields:[],rowFields:[],colFields:[],dataFields:[],applyNumberFormats:n.applyNumberFormats,applyBorderFormats:n.applyBorderFormats,applyFontFormats:n.applyFontFormats,applyPatternFormats:n.applyPatternFormats,applyAlignmentFormats:n.applyAlignmentFormats,applyWidthHeightFormats:n.applyWidthHeightFormats,dataCaption:n.dataCaption,updatedVersion:n.updatedVersion,minRefreshableVersion:n.minRefreshableVersion,createdVersion:n.createdVersion,useAutoFormatting:n.useAutoFormatting===`1`,itemPrintTitles:n.itemPrintTitles===`1`,indent:n.indent?parseInt(n.indent,10):0,compact:n.compact===`1`,compactData:n.compactData===`1`,multipleFieldFilters:n.multipleFieldFilters===`1`,isLoaded:!0};break;case`location`:this.model&&(this.model.location={ref:n.ref,firstHeaderRow:n.firstHeaderRow?parseInt(n.firstHeaderRow,10):void 0,firstDataRow:n.firstDataRow?parseInt(n.firstDataRow,10):void 0,firstDataCol:n.firstDataCol?parseInt(n.firstDataCol,10):void 0});break;case`pivotFields`:this.inPivotFields=!0;break;case`pivotField`:this.inPivotFields&&(this.currentPivotField={axis:n.axis,dataField:n.dataField===`1`,items:[],compact:n.compact===`1`,outline:n.outline===`1`,showAll:n.showAll===`1`,defaultSubtotal:n.defaultSubtotal===`1`});break;case`items`:this.currentPivotField&&(this.inItems=!0);break;case`item`:this.inItems&&this.currentPivotField&&n.x!==void 0&&this.currentPivotField.items.push(parseInt(n.x,10));break;case`rowFields`:this.inRowFields=!0;break;case`colFields`:this.inColFields=!0;break;case`dataFields`:this.inDataFields=!0;break;case`rowItems`:this.inRowItems=!0;break;case`colItems`:this.inColItems=!0;break;case`field`:if(this.model){let e=parseInt(n.x||`0`,10);this.inRowFields?this.model.rowFields.push(e):this.inColFields&&this.model.colFields.push(e)}break;case`dataField`:this.inDataFields&&this.model&&this.model.dataFields.push({name:ra(n.name||``),fld:parseInt(n.fld||`0`,10),baseField:n.baseField?parseInt(n.baseField,10):0,baseItem:n.baseItem?parseInt(n.baseItem,10):0,subtotal:n.subtotal});break;case`pivotTableStyleInfo`:this.model&&(this.model.styleName=n.name);break}return!0}parseText(e){}parseClose(e){switch(e){case this.tag:return!1;case`pivotFields`:this.inPivotFields=!1;break;case`pivotField`:this.currentPivotField&&this.model&&(this.model.pivotFields.push(this.currentPivotField),this.currentPivotField=null);break;case`items`:this.inItems=!1;break;case`rowFields`:this.inRowFields=!1;break;case`colFields`:this.inColFields=!1;break;case`dataFields`:this.inDataFields=!1;break;case`rowItems`:this.inRowItems=!1;break;case`colItems`:this.inColItems=!1;break}return!0}reconcile(e,t){}static{this.PIVOT_TABLE_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`,"xmlns:mc":`http://schemas.openxmlformats.org/markup-compatibility/2006`,"mc:Ignorable":`xr`,"xmlns:xr":`http://schemas.microsoft.com/office/spreadsheetml/2014/revision`}}};function Au(e,t,n){let r=n===`count`?`Count`:`Sum`,i=n===`count`?` subtotal="count"`:``;return t.map(t=>`<dataField
185
+ name="${r} of ${na(e[t].name)}"
186
+ fld="${t}"
187
+ baseField="0"
188
+ baseItem="0"${i}
189
+ />`).join(``)}function ju(e){let t=new Set(e.rows),n=new Set(e.columns),r=new Set(e.values);return e.cacheFields.map((e,i)=>Mu(t.has(i)?`row`:n.has(i)?`column`:r.has(i)?`value`:null,e.sharedItems)).join(``)}function Mu(e,t){let n=`compact="0" outline="0" showAll="0" defaultSubtotal="0"`;return e===`row`||e===`column`?`
160
190
  <pivotField axis="${e===`row`?`axisRow`:`axisCol`}" ${n}>
161
191
  <items count="${t.length+1}">
162
192
  ${t.map((e,t)=>`<item x="${t}" />`).join(`
@@ -168,10 +198,10 @@ ${h}.`);break;case m:switch(t){case`xml`:break;case``:e.fail(`the default namesp
168
198
  ${e===`value`?`dataField="1"`:``}
169
199
  ${n}
170
200
  />
171
- `}var Pu=class extends ${constructor(e){super(),this.model=e||{type:`note`,note:{texts:[]},ref:``}}get tag(){return`r`}get richTextXform(){return this._richTextXform||=new uc,this._richTextXform}render(e,t){let n=t||this.model;e.openNode(`comment`,{ref:n.ref,authorId:0}),e.openNode(`text`),n&&n.note&&n.note.texts&&n.note.texts.forEach(t=>{this.richTextXform.render(e,t)}),e.closeNode(),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`comment`:return this.model={type:`note`,note:{texts:[]},...e.attributes},!0;case`r`:return this.parser=this.richTextXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){switch(e){case`comment`:return!1;case`r`:return this.model.note.texts.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}},Fu=class e extends ${constructor(){super(),this.map={comment:new Pu},this.model={comments:[]}}render(t,n){let r=n||this.model;t.openXml(Ds.StdDocAttributes),t.openNode(`comments`,e.COMMENTS_ATTRIBUTES),t.openNode(`authors`),t.leafNode(`author`,null,`Author`),t.closeNode(),t.openNode(`commentList`),r.comments.forEach(e=>{this.map.comment.render(t,e)}),t.closeNode(),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`commentList`:return this.model={comments:[]},!0;case`comment`:return this.parser=this.map.comment,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){switch(e){case`commentList`:return!1;case`comment`:return this.model.comments.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}static{this.COMMENTS_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`}}},Iu=class extends ${constructor(){super(),this.model={}}get tag(){return`v:textbox`}conversionUnit(e,t,n){return`${(parseFloat(e.toString())*t).toFixed(2)}${n}`}reverseConversionUnit(e){return(e||``).split(`,`).map(e=>Number(parseFloat(this.conversionUnit(parseFloat(e),.1,``)).toFixed(2)))}render(e,t){let n={style:`mso-direction-alt:auto`};if(t&&t.note){let{inset:e}=t.note&&t.note.margins||{};Array.isArray(e)&&(e=e.map(e=>this.conversionUnit(e,10,`mm`)).join(`,`)),e&&(n.inset=e)}e.openNode(`v:textbox`,n),e.leafNode(`div`,{style:`text-align:left`}),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:return this.model={inset:this.reverseConversionUnit(e.attributes.inset)},!0;default:return!0}}parseText(){}parseClose(e){switch(e){case this.tag:return!1;default:return!0}}},Lu=class extends ${constructor(){super(),this.text=``}get tag(){return`x:Anchor`}getAnchorRect(e){let t=Math.floor(e.left),n=Math.floor((e.left-t)*68),r=Math.floor(e.top),i=Math.floor((e.top-r)*18),a=Math.floor(e.right),o=Math.floor((e.right-a)*68),s=Math.floor(e.bottom);return[t,n,r,i,a,o,s,Math.floor((e.bottom-s)*18)]}getDefaultRect(e){let t=e.col,n=Math.max(e.row-2,0);return[t,6,n,14,t+2,2,n+4,16]}render(e,t){let n=t.anchor?this.getAnchorRect(t.anchor):this.getDefaultRect(t.refAddress);e.leafNode(`x:Anchor`,null,n.join(`, `))}parseOpen(e){switch(e.name){case this.tag:return this.text=``,!0;default:return!1}}parseText(e){this.text=e}parseClose(){return!1}},Ru=class extends ${constructor(e){super(),this._model=e||{},this.text=``}get tag(){return this._model&&this._model.tag||``}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(e){switch(e.name){case this.tag:return this.text=``,!0;default:return!1}}parseText(e){this.text=e}parseClose(){return!1}},zu=class extends ${constructor(e){super(),this._model=e||{},this.model={}}get tag(){return this._model&&this._model.tag||``}render(e,t,n){(n&&t===n[2]||n&&this.tag===`x:SizeWithCells`&&t===n[1])&&e.leafNode(this.tag)}parseOpen(e){switch(e.name){case this.tag:return this.model={},this.model[this.tag]=!0,!0;default:return!1}}parseText(){}parseClose(){return!1}};let Bu=[`twoCells`,`oneCells`,`absolute`];var Vu=class extends ${constructor(){super(),this.map={"x:Anchor":new Lu,"x:Locked":new Ru({tag:`x:Locked`}),"x:LockText":new Ru({tag:`x:LockText`}),"x:SizeWithCells":new zu({tag:`x:SizeWithCells`}),"x:MoveWithCells":new zu({tag:`x:MoveWithCells`})},this.model={anchor:[],protection:{},editAs:``}}get tag(){return`x:ClientData`}render(e,t){let{protection:n,editAs:r}=t.note;e.openNode(this.tag,{ObjectType:`Note`}),this.map[`x:MoveWithCells`].render(e,r,Bu),this.map[`x:SizeWithCells`].render(e,r,Bu),this.map[`x:Anchor`].render(e,t),this.map[`x:Locked`].render(e,n.locked),e.leafNode(`x:AutoFill`,null,`False`),this.map[`x:LockText`].render(e,n.lockText),e.leafNode(`x:Row`,null,t.refAddress.row-1),e.leafNode(`x:Column`,null,t.refAddress.col-1),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:this.reset(),this.model={anchor:[],protection:{},editAs:``};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.normalizeModel(),!1;default:return!0}}normalizeModel(){let e=Object.assign({},this.map[`x:MoveWithCells`].model,this.map[`x:SizeWithCells`].model),t=Object.keys(e).length;this.model.editAs=Bu[t],this.model.anchor=this.map[`x:Anchor`].text,this.model.protection.locked=this.map[`x:Locked`].text,this.model.protection.lockText=this.map[`x:LockText`].text}},Hu=class e extends ${constructor(){super(),this.map={"v:textbox":new Iu,"x:ClientData":new Vu}}get tag(){return`v:shape`}render(t,n,r){t.openNode(`v:shape`,e.V_SHAPE_ATTRIBUTES(n,r||0)),t.leafNode(`v:fill`,{color2:`infoBackground [80]`}),t.leafNode(`v:shadow`,{color:`none [81]`,obscured:`t`}),t.leafNode(`v:path`,{"o:connecttype":`none`}),this.map[`v:textbox`].render(t,n),this.map[`x:ClientData`].render(t,n),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={margins:{insetmode:e.attributes[`o:insetmode`]},anchor:``,editAs:``,protection:{}};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.margins.inset=this.map[`v:textbox`].model&&this.map[`v:textbox`].model.inset,this.model.protection=this.map[`x:ClientData`].model&&this.map[`x:ClientData`].model.protection,this.model.anchor=this.map[`x:ClientData`].model&&this.map[`x:ClientData`].model.anchor,this.model.editAs=this.map[`x:ClientData`].model&&this.map[`x:ClientData`].model.editAs,!1;default:return!0}}static{this.V_SHAPE_ATTRIBUTES=(e,t)=>({id:`_x0000_s${1025+t}`,type:`#_x0000_t202`,style:`position:absolute; margin-left:105.3pt;margin-top:10.5pt;width:97.8pt;height:59.1pt;z-index:1;visibility:hidden`,fillcolor:`infoBackground [80]`,strokecolor:`none [81]`,"o:insetmode":e.note.margins&&e.note.margins.insetmode})}},Uu=class e extends ${constructor(){super(),this.map={"v:shape":new Hu},this.model={comments:[]}}get tag(){return`xml`}render(t,n){let r=n||this.model;t.openXml(Ds.StdDocAttributes),t.openNode(this.tag,e.DRAWING_ATTRIBUTES),t.openNode(`o:shapelayout`,{"v:ext":`edit`}),t.leafNode(`o:idmap`,{"v:ext":`edit`,data:1}),t.closeNode(),t.openNode(`v:shapetype`,{id:`_x0000_t202`,coordsize:`21600,21600`,"o:spt":202,path:`m,l,21600r21600,l21600,xe`}),t.leafNode(`v:stroke`,{joinstyle:`miter`}),t.leafNode(`v:path`,{gradientshapeok:`t`,"o:connecttype":`rect`}),t.closeNode(),r.comments.forEach((e,n)=>{this.map[`v:shape`].render(t,e,n)}),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={comments:[]};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.comments.push(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:return!0}}reconcile(e,t){e.anchors.forEach(e=>{e.br?this.map[`xdr:twoCellAnchor`].reconcile(e,t):this.map[`xdr:oneCellAnchor`].reconcile(e,t)})}static{this.DRAWING_ATTRIBUTES={"xmlns:v":`urn:schemas-microsoft-com:vml`,"xmlns:o":`urn:schemas-microsoft-com:office:office`,"xmlns:x":`urn:schemas-microsoft-com:office:excel`}}},Wu=K();Xi();var Gu=ln();function Ku(e,t){return new Promise((n,r)=>{Yi.readFile(e,t,(e,t)=>{e?r(e):n(t)})})}var qu=class e{constructor(e){this.workbook=e}async readFile(e,t){if(!await oa(e))throw Error(`File not found: ${e}`);let n=Yi.createReadStream(e);try{let e=await this.read(n,t);return n.close(),e}catch(e){throw n.close(),e}}parseRels(e){return new hc().parseStream(e)}parseWorkbook(e){return new jc().parseStream(e)}parseSharedStrings(e){return new pc().parseStream(e)}reconcile(e,t){let n=new jc,r=new ru(t),i=new bu,a=new Du;n.reconcile(e);let o={media:e.media,mediaIndex:e.mediaIndex};Object.keys(e.drawings).forEach(t=>{let n=e.drawings[t],r=e.drawingRels[t];r&&(o.rels=r.reduce((e,t)=>(e[t.Id]=t,e),{}),(n.anchors||[]).forEach(e=>{let t=e.picture&&e.picture.hyperlinks;t&&o.rels[t.rId]&&(t.hyperlink=o.rels[t.rId].Target,delete t.rId)}),i.reconcile(n,o))});let s={styles:e.styles};Object.values(e.tables).forEach(e=>{a.reconcile(e,s)});let c={styles:e.styles,sharedStrings:e.sharedStrings,media:e.media,mediaIndex:e.mediaIndex,date1904:e.properties&&e.properties.date1904,drawings:e.drawings,comments:e.comments,tables:e.tables,vmlDrawings:e.vmlDrawings};e.worksheets.forEach(t=>{t.relationships=e.worksheetRels[t.sheetNo],r.reconcile(t,c)}),delete e.worksheetHash,delete e.worksheetRels,delete e.globalRels,delete e.sharedStrings,delete e.workbookRels,delete e.sheetDefs,delete e.styles,delete e.mediaIndex,delete e.drawings,delete e.drawingRels,delete e.vmlDrawings}async _processWorksheetEntry(e,t,n,r,i){let a=await new ru(r).parseStream(e);if(!a)throw Error(`Failed to parse worksheet ${i}`);a.sheetNo=n,t.worksheetHash[i]=a,t.worksheets.push(a)}async _processCommentEntry(e,t,n){let r=await new Fu().parseStream(e);t.comments[`../${n}.xml`]=r}async _processTableEntry(e,t,n){let r=await new Du().parseStream(e);t.tables[`../tables/${n}.xml`]=r}async _processWorksheetRelsEntry(e,t,n){let r=await new hc().parseStream(e);t.worksheetRels[n]=r}async _processMediaEntry(e,t,n){let r=n.lastIndexOf(`.`);if(r>=1){let i=n.substr(r+1),a=n.substr(0,r);await new Promise((r,o)=>{let s=new xs,c=()=>{e.removeListener(`error`,u),s.removeListener(`error`,u),s.removeListener(`finish`,l)},l=()=>{c(),t.mediaIndex[n]=t.media.length,t.mediaIndex[a]=t.media.length;let e={type:`image`,name:a,extension:i,buffer:s.toBuffer()};t.media.push(e),r()},u=e=>{c(),o(e)};s.once(`finish`,l),e.on(`error`,u),s.on(`error`,u),e.pipe(s)})}}async _processDrawingEntry(e,t,n){let r=await new bu().parseStream(e);t.drawings[n]=r}async _processDrawingRelsEntry(e,t,n){let r=await new hc().parseStream(e);t.drawingRels[n]=r}async _processVmlDrawingEntry(e,t,n){let r=await new Uu().parseStream(e);t.vmlDrawings[`../drawings/${n}.vml`]=r}async _processThemeEntry(e,t,n){await new Promise((r,i)=>{let a=new xs,o=()=>{e.removeListener(`error`,c),a.removeListener(`error`,c),a.removeListener(`finish`,s)},s=()=>{o(),t.themes[n]=a.read().toString(),r()},c=e=>{o(),i(e)};a.once(`finish`,s),e.on(`error`,c),a.on(`error`,c),e.pipe(a)})}async read(e,t){let n={};return await new Promise((t,r)=>{let i=0,a=!1,o=0,s=()=>{e.removeListener(`data`,u),e.removeListener(`end`,d),e.removeListener(`error`,f)},c=()=>{a&&i===o&&(s(),t())},l=new fo(e=>{o++;let t=[],a=0;e.ondata=(o,l,u)=>{if(o){s(),r(o);return}if(l&&(t.push(l),a+=l.length),u){if(t.length===1)n[e.name]=t[0];else if(t.length>1){let r=new Uint8Array(a),i=0;for(let e of t)r.set(e,i),i+=e.length;n[e.name]=r}else n[e.name]=new Uint8Array;i++,t.length=0,c()}},e.start()});l.register(uo);let u=e=>{l.push(e)},d=()=>{l.push(new Uint8Array,!0),a=!0,c()},f=e=>{s(),r(e)};e.on(`data`,u),e.on(`end`,d),e.on(`error`,f)}),this.loadFromFiles(n,t)}async load(e,t){let n;if(!e||typeof e==`object`&&!Wu.Buffer.isBuffer(e)&&!(e instanceof Uint8Array)&&!(e instanceof ArrayBuffer))throw Error(`Can't read the data of 'the loaded zip file'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?`);n=t&&t.base64?Wu.Buffer.from(e.toString(),`base64`):e;let r=new Gu.PassThrough;return r.end(n),this.read(r,t)}async loadFromFiles(e,t){let n={worksheets:[],worksheetHash:{},worksheetRels:[],themes:{},media:[],mediaIndex:{},drawings:{},drawingRels:{},comments:{},tables:{},vmlDrawings:{}},r=Object.keys(e).map(t=>({name:t,dir:t.endsWith(`/`),data:e[t]}));for(let e of r)if(!e.dir){let r=e.name;r[0]===`/`&&(r=r.substr(1));let i;if(r.match(/xl\/media\//)||r.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/))i=new Gu.PassThrough,i.end(Wu.Buffer.from(e.data));else{i=new Gu.PassThrough({readableObjectMode:!0,writableObjectMode:!0});let t=fa(Wu.Buffer.from(e.data));i.end(t)}let a;if(a=r.match(/xl\/worksheets\/sheet(\d+)[.]xml/),a){let e=parseInt(a[1],10);await this._processWorksheetEntry(i,n,e,t,r)}else switch(r){case`_rels/.rels`:n.globalRels=await this.parseRels(i);break;case`xl/workbook.xml`:{let e=await this.parseWorkbook(i);n.sheets=e.sheets,n.definedNames=e.definedNames,n.views=e.views,n.properties=e.properties,n.calcProperties=e.calcProperties;break}case`xl/sharedStrings.xml`:n.sharedStrings=new pc,await n.sharedStrings.parseStream(i);break;case`xl/_rels/workbook.xml.rels`:n.workbookRels=await this.parseRels(i);break;case`docProps/app.xml`:{let e=await new yc().parseStream(i);n.company=e.company,n.manager=e.manager;break}case`docProps/core.xml`:{let e=await new cc().parseStream(i);Object.assign(n,e);break}case`xl/styles.xml`:n.styles=new oc,await n.styles.parseStream(i);break;default:if(a=r.match(/xl\/worksheets\/_rels\/sheet(\d+)[.]xml[.]rels/),a){let e=parseInt(a[1],10);await this._processWorksheetRelsEntry(i,n,e);break}if(a=r.match(/xl\/media\/([a-zA-Z0-9]+[.][a-zA-Z0-9]{3,4})$/),a){await this._processMediaEntry(i,n,a[1]);break}if(a=r.match(/xl\/drawings\/(drawing\d+)[.]xml/),a){await this._processDrawingEntry(i,n,a[1]);break}if(a=r.match(/xl\/drawings\/_rels\/(drawing\d+)[.]xml[.]rels/),a){await this._processDrawingRelsEntry(i,n,a[1]);break}if(a=r.match(/xl\/drawings\/(vmlDrawing\d+)[.]vml/),a){await this._processVmlDrawingEntry(i,n,a[1]);break}if(a=r.match(/xl\/comments(\d+)[.]xml/),a){await this._processCommentEntry(i,n,`comments${a[1]}`);break}if(a=r.match(/xl\/tables\/(table\d+)[.]xml/),a){await this._processTableEntry(i,n,a[1]);break}if(a=r.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/),a){await this._processThemeEntry(i,n,a[1]);break}}}return this.reconcile(n,t),this.workbook.model=n,this.workbook}async addContentTypes(e,t){let n=new gc().toXml(t);e.append(n,{name:`[Content_Types].xml`})}async addApp(e,t){let n=new yc().toXml(t);e.append(n,{name:`docProps/app.xml`})}async addCore(e,t){let n=new cc;e.append(n.toXml(t),{name:`docProps/core.xml`})}async addThemes(e,t){let n=t.themes||{theme1:`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
172
- <a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"> <a:themeElements> <a:clrScheme name="Office"> <a:dk1> <a:sysClr val="windowText" lastClr="000000"/> </a:dk1> <a:lt1> <a:sysClr val="window" lastClr="FFFFFF"/> </a:lt1> <a:dk2> <a:srgbClr val="1F497D"/> </a:dk2> <a:lt2> <a:srgbClr val="EEECE1"/> </a:lt2> <a:accent1> <a:srgbClr val="4F81BD"/> </a:accent1> <a:accent2> <a:srgbClr val="C0504D"/> </a:accent2> <a:accent3> <a:srgbClr val="9BBB59"/> </a:accent3> <a:accent4> <a:srgbClr val="8064A2"/> </a:accent4> <a:accent5> <a:srgbClr val="4BACC6"/> </a:accent5> <a:accent6> <a:srgbClr val="F79646"/> </a:accent6> <a:hlink> <a:srgbClr val="0000FF"/> </a:hlink> <a:folHlink> <a:srgbClr val="800080"/> </a:folHlink> </a:clrScheme> <a:fontScheme name="Office"> <a:majorFont> <a:latin typeface="Cambria"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Times New Roman"/> <a:font script="Hebr" typeface="Times New Roman"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="MoolBoran"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Times New Roman"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:majorFont> <a:minorFont> <a:latin typeface="Calibri"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Arial"/> <a:font script="Hebr" typeface="Arial"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="DaunPenh"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Arial"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:minorFont> </a:fontScheme> <a:fmtScheme name="Office"> <a:fillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="35000"> <a:schemeClr val="phClr"> <a:tint val="37000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="15000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="1"/> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="100000"/> <a:shade val="100000"/> <a:satMod val="130000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:shade val="100000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="0"/> </a:gradFill> </a:fillStyleLst> <a:lnStyleLst> <a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"> <a:shade val="95000"/> <a:satMod val="105000"/> </a:schemeClr> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> </a:lnStyleLst> <a:effectStyleLst> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="38000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> <a:scene3d> <a:camera prst="orthographicFront"> <a:rot lat="0" lon="0" rev="0"/> </a:camera> <a:lightRig rig="threePt" dir="t"> <a:rot lat="0" lon="0" rev="1200000"/> </a:lightRig> </a:scene3d> <a:sp3d> <a:bevelT w="63500" h="25400"/> </a:sp3d> </a:effectStyle> </a:effectStyleLst> <a:bgFillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="40000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="40000"> <a:schemeClr val="phClr"> <a:tint val="45000"/> <a:shade val="99000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="20000"/> <a:satMod val="255000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="-80000" r="50000" b="180000"/> </a:path> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="80000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="30000"/> <a:satMod val="200000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="50000" r="50000" b="50000"/> </a:path> </a:gradFill> </a:bgFillStyleLst> </a:fmtScheme> </a:themeElements> <a:objectDefaults> <a:spDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="1"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="3"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="2"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="lt1"/> </a:fontRef> </a:style> </a:spDef> <a:lnDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="2"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="0"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="1"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="tx1"/> </a:fontRef> </a:style> </a:lnDef> </a:objectDefaults> <a:extraClrSchemeLst/> </a:theme>`};Object.keys(n).forEach(t=>{let r=n[t],i=`xl/theme/${t}.xml`;e.append(r,{name:i})})}async addOfficeRels(t,n){let r=new hc().toXml([{Id:`rId1`,Type:e.RelType.OfficeDocument,Target:`xl/workbook.xml`},{Id:`rId2`,Type:e.RelType.CoreProperties,Target:`docProps/core.xml`},{Id:`rId3`,Type:e.RelType.ExtenderProperties,Target:`docProps/app.xml`}]);t.append(r,{name:`_rels/.rels`})}async addWorkbookRels(t,n){let r=1,i=[{Id:`rId${r++}`,Type:e.RelType.Styles,Target:`styles.xml`},{Id:`rId${r++}`,Type:e.RelType.Theme,Target:`theme/theme1.xml`}];if(n.sharedStrings.count&&i.push({Id:`rId${r++}`,Type:e.RelType.SharedStrings,Target:`sharedStrings.xml`}),(n.pivotTables||[]).length){let t=n.pivotTables[0];t.rId=`rId${r++}`,i.push({Id:t.rId,Type:e.RelType.PivotCacheDefinition,Target:`pivotCache/pivotCacheDefinition1.xml`})}n.worksheets.forEach(t=>{t.rId=`rId${r++}`,i.push({Id:t.rId,Type:e.RelType.Worksheet,Target:`worksheets/sheet${t.id}.xml`})});let a=new hc().toXml(i);t.append(a,{name:`xl/_rels/workbook.xml.rels`})}async addSharedStrings(e,t){t.sharedStrings&&t.sharedStrings.count&&e.append(t.sharedStrings.xml,{name:`xl/sharedStrings.xml`})}async addStyles(e,t){let{xml:n}=t.styles;n&&e.append(n,{name:`xl/styles.xml`})}async addWorkbook(e,t){let n=new jc;e.append(n.toXml(t),{name:`xl/workbook.xml`})}async addWorksheets(e,t){let n=new ru,r=new hc,i=new Fu,a=new Uu;t.worksheets.forEach(t=>{let o=new Ds;n.render(o,t),e.append(o.xml,{name:`xl/worksheets/sheet${t.id}.xml`}),t.rels&&t.rels.length&&(o=new Ds,r.render(o,t.rels),e.append(o.xml,{name:`xl/worksheets/_rels/sheet${t.id}.xml.rels`})),t.comments.length>0&&(o=new Ds,i.render(o,t),e.append(o.xml,{name:`xl/comments${t.id}.xml`}),o=new Ds,a.render(o,t),e.append(o.xml,{name:`xl/drawings/vmlDrawing${t.id}.vml`}))})}async addMedia(e,t){await Promise.all(t.media.map(async t=>{if(t.type===`image`){let n=`xl/media/${t.name}.${t.extension}`;if(t.filename){let r=await Ku(t.filename);return e.append(r,{name:n})}if(t.buffer)return e.append(t.buffer,{name:n});if(t.base64){let r=t.base64,i=r.substring(r.indexOf(`,`)+1);return e.append(i,{name:n,base64:!0})}}throw Error(`Unsupported media`)}))}addDrawings(e,t){let n=new bu,r=new hc;t.worksheets.forEach(t=>{let{drawing:i}=t;if(i){n.prepare(i);let t=n.toXml(i);e.append(t,{name:`xl/drawings/${i.name}.xml`}),t=r.toXml(i.rels),e.append(t,{name:`xl/drawings/_rels/${i.name}.xml.rels`})}})}addTables(e,t){let n=new Du;t.worksheets.forEach(t=>{let{tables:r}=t;r.forEach(t=>{n.prepare(t,{});let r=n.toXml(t);e.append(r,{name:`xl/tables/${t.target}`})})})}addPivotTables(t,n){if(!n.pivotTables.length)return;let r=n.pivotTables[0],i=new Ou,a=new Au,o=new ju,s=new hc,c=i.toXml(r);t.append(c,{name:`xl/pivotCache/pivotCacheRecords1.xml`}),c=a.toXml(r),t.append(c,{name:`xl/pivotCache/pivotCacheDefinition1.xml`}),c=s.toXml([{Id:`rId1`,Type:e.RelType.PivotCacheRecords,Target:`pivotCacheRecords1.xml`}]),t.append(c,{name:`xl/pivotCache/_rels/pivotCacheDefinition1.xml.rels`}),c=o.toXml(r),t.append(c,{name:`xl/pivotTables/pivotTable1.xml`}),c=s.toXml([{Id:`rId1`,Type:e.RelType.PivotCacheDefinition,Target:`../pivotCache/pivotCacheDefinition1.xml`}]),t.append(c,{name:`xl/pivotTables/_rels/pivotTable1.xml.rels`})}_finalize(e){return new Promise((t,n)=>{e.on(`finish`,()=>{t(this)}),e.on(`error`,n),e.finalize()})}prepareModel(e,t){e.creator=e.creator||`ExcelTS`,e.lastModifiedBy=e.lastModifiedBy||`ExcelTS`,e.created=e.created||new Date,e.modified=e.modified||new Date,e.useSharedStrings=t.useSharedStrings===void 0?!0:t.useSharedStrings,e.useStyles=t.useStyles===void 0?!0:t.useStyles,e.sharedStrings=new pc,e.styles=e.useStyles?new oc(!0):new oc.Mock;let n=new jc,r=new ru;n.prepare(e);let i={sharedStrings:e.sharedStrings,styles:e.styles,date1904:e.properties.date1904,drawingsCount:0,media:e.media};i.drawings=e.drawings=[],i.commentRefs=e.commentRefs=[];let a=0;e.tables=[],e.worksheets.forEach(t=>{t.tables.forEach(t=>{a++,t.target=`table${a}.xml`,t.id=a,e.tables.push(t)}),r.prepare(t,i)})}async write(e,t){t||={};let{model:n}=this.workbook,r=new Cs(t.zip);return r.pipe(e),this.prepareModel(n,t),await this.addContentTypes(r,n),await this.addOfficeRels(r,n),await this.addWorkbookRels(r,n),await this.addWorksheets(r,n),await this.addSharedStrings(r,n),this.addDrawings(r,n),this.addTables(r,n),this.addPivotTables(r,n),await Promise.all([this.addThemes(r,n),this.addStyles(r,n)]),await this.addMedia(r,n),await Promise.all([this.addApp(r,n),this.addCore(r,n)]),await this.addWorkbook(r,n),this._finalize(r)}writeFile(e,t){let n=Yi.createWriteStream(e);return new Promise((e,r)=>{let i=()=>{n.removeListener(`finish`,a),n.removeListener(`error`,o)},a=()=>{i(),e()},o=e=>{i(),r(e)};n.once(`finish`,a),n.on(`error`,o),this.write(n,t).then(()=>{n.end()}).catch(e=>{i(),r(e)})})}async writeBuffer(e){let t=new xs;return await this.write(t,e),t.read()}static{this.RelType=Mc}},Ju=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.FormatterOptions=void 0,e.FormatterOptions=class{objectMode=!0;delimiter=`,`;rowDelimiter=`
173
- `;quote=`"`;escape=this.quote;quoteColumns=!1;quoteHeaders=this.quoteColumns;headers=null;includeEndRowDelimiter=!1;transform;shouldWriteHeaders;writeBOM=!1;escapedQuote;BOM=``;alwaysWriteHeaders=!1;constructor(e={}){Object.assign(this,e||{}),e?.quoteHeaders===void 0&&(this.quoteHeaders=this.quoteColumns),e?.quote===!0?this.quote=`"`:e?.quote===!1&&(this.quote=``),typeof e?.escape!=`string`&&(this.escape=this.quote),this.shouldWriteHeaders=!!this.headers&&(e.writeHeaders??!0),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote=`${this.escape}${this.quote}`}}})),Yu=c(((e,t)=>{var n=`[object AsyncFunction]`,r=`[object Function]`,i=`[object GeneratorFunction]`,a=`[object Null]`,o=`[object Proxy]`,s=`[object Undefined]`,c=typeof global==`object`&&global&&global.Object===Object&&global,l=typeof self==`object`&&self&&self.Object===Object&&self,u=c||l||Function(`return this`)(),d=Object.prototype,f=d.hasOwnProperty,p=d.toString,m=u.Symbol,h=m?m.toStringTag:void 0;function g(e){return e==null?e===void 0?s:a:h&&h in Object(e)?_(e):v(e)}function _(e){var t=f.call(e,h),n=e[h];try{e[h]=void 0;var r=!0}catch{}var i=p.call(e);return r&&(t?e[h]=n:delete e[h]),i}function v(e){return p.call(e)}function y(e){if(!b(e))return!1;var t=g(e);return t==r||t==i||t==n||t==o}function b(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=y})),Xu=c(((e,t)=>{var n=`[object Boolean]`,r=Object.prototype.toString;function i(e){return e===!0||e===!1||a(e)&&r.call(e)==n}function a(e){return!!e&&typeof e==`object`}t.exports=i})),Zu=c(((e,t)=>{function n(e){return e==null}t.exports=n})),Qu=c(((e,t)=>{var n=1/0,r=`[object Symbol]`,i=/[\\^$.*+?()[\]{}|]/g,a=RegExp(i.source),o=typeof global==`object`&&global&&global.Object===Object&&global,s=typeof self==`object`&&self&&self.Object===Object&&self,c=o||s||Function(`return this`)(),l=Object.prototype.toString,u=c.Symbol,d=u?u.prototype:void 0,f=d?d.toString:void 0;function p(e){if(typeof e==`string`)return e;if(h(e))return f?f.call(e):``;var t=e+``;return t==`0`&&1/e==-n?`-0`:t}function m(e){return!!e&&typeof e==`object`}function h(e){return typeof e==`symbol`||m(e)&&l.call(e)==r}function g(e){return e==null?``:p(e)}function _(e){return e=g(e),e&&a.test(e)?e.replace(i,`\\$&`):e}t.exports=_})),$u=c((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.FieldFormatter=void 0;let n=t(Xu()),r=t(Zu()),i=t(Qu());e.FieldFormatter=class{formatterOptions;_headers=null;REPLACE_REGEXP;ESCAPE_REGEXP;constructor(e){this.formatterOptions=e,e.headers!==null&&(this.headers=e.headers),this.REPLACE_REGEXP=new RegExp(e.quote,`g`);let t=`[${e.delimiter}${(0,i.default)(e.rowDelimiter)}|\r|\n]`;this.ESCAPE_REGEXP=new RegExp(t)}set headers(e){this._headers=e}shouldQuote(e,t){let r=t?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;return(0,n.default)(r)?r:Array.isArray(r)?r[e]:this._headers===null?!1:r[this._headers[e]]}format(e,t,n){let i=`${(0,r.default)(e)?``:e}`.replace(/\0/g,``),{formatterOptions:a}=this;return a.quote!==``&&i.indexOf(a.quote)!==-1?this.quoteField(i.replace(this.REPLACE_REGEXP,a.escapedQuote)):i.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(t,n)?this.quoteField(i):i}quoteField(e){let{quote:t}=this.formatterOptions;return`${t}${e}${t}`}}})),ed=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isSyncTransform=void 0,e.isSyncTransform=e=>e.length===1})),td=c((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.RowFormatter=void 0;let n=t(Yu()),r=$u(),i=ed();e.RowFormatter=class e{static isRowHashArray(e){return Array.isArray(e)?Array.isArray(e[0])&&e[0].length===2:!1}static isRowArray(e){return Array.isArray(e)&&!this.isRowHashArray(e)}static gatherHeaders(t){return e.isRowHashArray(t)?t.map(e=>e[0]):Array.isArray(t)?t:Object.keys(t)}static createTransform(e){return(0,i.isSyncTransform)(e)?(t,n)=>{let r=null;try{r=e(t)}catch(e){return n(e)}return n(null,r)}:(t,n)=>{e(t,n)}}formatterOptions;fieldFormatter;shouldWriteHeaders;_rowTransform;headers;hasWrittenHeaders;rowCount=0;constructor(e){this.formatterOptions=e,this.fieldFormatter=new r.FieldFormatter(e),this.headers=e.headers,this.shouldWriteHeaders=e.shouldWriteHeaders,this.hasWrittenHeaders=!1,this.headers!==null&&(this.fieldFormatter.headers=this.headers),e.transform&&(this.rowTransform=e.transform)}set rowTransform(t){if(!(0,n.default)(t))throw TypeError(`The transform should be a function`);this._rowTransform=e.createTransform(t)}format(e,t){this.callTransformer(e,(n,r)=>{if(n)return t(n);if(!e)return t(null);let i=[];if(r){let{shouldFormatColumns:e,headers:t}=this.checkHeaders(r);if(this.shouldWriteHeaders&&t&&!this.hasWrittenHeaders&&(i.push(this.formatColumns(t,!0)),this.hasWrittenHeaders=!0),e){let e=this.gatherColumns(r);i.push(this.formatColumns(e,!1))}}return t(null,i)})}finish(e){let t=[];if(this.formatterOptions.alwaysWriteHeaders&&this.rowCount===0){if(!this.headers)return e(Error("`alwaysWriteHeaders` option is set to true but `headers` option not provided."));t.push(this.formatColumns(this.headers,!0))}return this.formatterOptions.includeEndRowDelimiter&&t.push(this.formatterOptions.rowDelimiter),e(null,t)}checkHeaders(t){if(this.headers)return{shouldFormatColumns:!0,headers:this.headers};let n=e.gatherHeaders(t);return this.headers=n,this.fieldFormatter.headers=n,this.shouldWriteHeaders?Array.isArray(t)&&n.every((e,n)=>e===t[n])?{shouldFormatColumns:!1,headers:n}:{shouldFormatColumns:!0,headers:n}:{shouldFormatColumns:!0,headers:null}}gatherColumns(t){if(this.headers===null)throw Error(`Headers is currently null`);return Array.isArray(t)?e.isRowHashArray(t)?this.headers.map((e,n)=>{let r=t[n];return r?r[1]:``}):e.isRowArray(t)&&!this.shouldWriteHeaders?t:this.headers.map((e,n)=>t[n]):this.headers.map(e=>t[e])}callTransformer(e,t){return this._rowTransform?this._rowTransform(e,t):t(null,e)}formatColumns(e,t){let n=e.map((e,n)=>this.fieldFormatter.format(e,n,t)).join(this.formatterOptions.delimiter),{rowCount:r}=this;return this.rowCount+=1,r?[this.formatterOptions.rowDelimiter,n].join(``):n}}})),nd=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.FieldFormatter=e.RowFormatter=void 0;var t=td();Object.defineProperty(e,`RowFormatter`,{enumerable:!0,get:function(){return t.RowFormatter}});var n=$u();Object.defineProperty(e,`FieldFormatter`,{enumerable:!0,get:function(){return n.FieldFormatter}})})),rd=c((e=>{var t=K();Object.defineProperty(e,`__esModule`,{value:!0}),e.CsvFormatterStream=void 0;let n=ln(),r=nd();e.CsvFormatterStream=class extends n.Transform{formatterOptions;rowFormatter;hasWrittenBOM=!1;constructor(e){super({writableObjectMode:e.objectMode}),this.formatterOptions=e,this.rowFormatter=new r.RowFormatter(e),this.hasWrittenBOM=!e.writeBOM}transform(e){return this.rowFormatter.rowTransform=e,this}_transform(e,n,r){let i=!1;try{this.hasWrittenBOM||=(this.push(this.formatterOptions.BOM),!0),this.rowFormatter.format(e,(e,n)=>e?(i=!0,r(e)):(n&&n.forEach(e=>{this.push(t.Buffer.from(e,`utf8`))}),i=!0,r()))}catch(e){if(i)throw e;r(e)}}_flush(e){this.rowFormatter.finish((n,r)=>n?e(n):(r&&r.forEach(e=>{this.push(t.Buffer.from(e,`utf8`))}),e()))}}})),id=c((e=>{var t=K(),n=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),r=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),i=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return r(t,e),t},a=e&&e.__exportStar||function(e,t){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(t,r)&&n(t,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),e.writeToPath=e.writeToString=e.writeToBuffer=e.writeToStream=e.write=e.format=e.FormatterOptions=e.CsvFormatterStream=void 0;let o=Kt(),s=ln(),c=i((Xi(),f(Ji))),l=Ju(),u=rd();a(ed(),e);var d=rd();Object.defineProperty(e,`CsvFormatterStream`,{enumerable:!0,get:function(){return d.CsvFormatterStream}});var p=Ju();Object.defineProperty(e,`FormatterOptions`,{enumerable:!0,get:function(){return p.FormatterOptions}}),e.format=e=>new u.CsvFormatterStream(new l.FormatterOptions(e)),e.write=(t,n)=>{let r=(0,e.format)(n),i=(0,o.promisify)((e,t)=>{r.write(e,void 0,t)});return t.reduce((e,t)=>e.then(()=>i(t)),Promise.resolve()).then(()=>{r.end()}).catch(e=>{r.emit(`error`,e)}),r},e.writeToStream=(t,n,r)=>(0,e.write)(n,r).pipe(t),e.writeToBuffer=(n,r={})=>{let i=[],a=new s.Writable({write(e,t,n){i.push(e),n()}});return new Promise((o,s)=>{a.on(`error`,s).on(`finish`,()=>o(t.Buffer.concat(i))),(0,e.write)(n,r).pipe(a)})},e.writeToString=(t,n)=>(0,e.writeToBuffer)(t,n).then(e=>e.toString()),e.writeToPath=(t,n,r)=>{let i=c.createWriteStream(t,{encoding:`utf8`});return(0,e.write)(n,r).pipe(i)}})),ad=c((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.ParserOptions=void 0;let n=t(Qu()),r=t(Zu());e.ParserOptions=class{escapedDelimiter;objectMode=!0;delimiter=`,`;ignoreEmpty=!1;quote=`"`;escape=null;escapeChar=this.quote;comment=null;supportsComments=!1;ltrim=!1;rtrim=!1;trim=!1;headers=null;renameHeaders=!1;strictColumnHandling=!1;discardUnmappedColumns=!1;carriageReturn=`\r`;NEXT_TOKEN_REGEXP;encoding=`utf8`;limitRows=!1;maxRows=0;skipLines=0;skipRows=0;constructor(e){if(Object.assign(this,e||{}),this.delimiter.length>1)throw Error(`delimiter option must be one character long`);this.escapedDelimiter=(0,n.default)(this.delimiter),this.escapeChar=this.escape??this.quote,this.supportsComments=!(0,r.default)(this.comment),this.NEXT_TOKEN_REGEXP=RegExp(`([^\\s]|\\r\\n|\\n|\\r|${this.escapedDelimiter})`),this.maxRows>0&&(this.limitRows=!0)}}})),od=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isSyncValidate=e.isSyncTransform=void 0,e.isSyncTransform=e=>e.length===1,e.isSyncValidate=e=>e.length===1})),sd=c((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.RowTransformerValidator=void 0;let n=t(Yu()),r=od();e.RowTransformerValidator=class e{static createTransform(e){return(0,r.isSyncTransform)(e)?(t,n)=>{let r=null;try{r=e(t)}catch(e){return n(e)}return n(null,r)}:e}static createValidator(e){return(0,r.isSyncValidate)(e)?(t,n)=>{n(null,{row:t,isValid:e(t)})}:(t,n)=>{e(t,(e,r,i)=>e?n(e):r?n(null,{row:t,isValid:r,reason:i}):n(null,{row:t,isValid:!1,reason:i}))}}_rowTransform=null;_rowValidator=null;set rowTransform(t){if(!(0,n.default)(t))throw TypeError(`The transform should be a function`);this._rowTransform=e.createTransform(t)}set rowValidator(t){if(!(0,n.default)(t))throw TypeError(`The validate should be a function`);this._rowValidator=e.createValidator(t)}transformAndValidate(e,t){return this.callTransformer(e,(e,n)=>e?t(e):n?this.callValidator(n,(e,r)=>e?t(e):r&&!r.isValid?t(null,{row:n,isValid:!1,reason:r.reason}):t(null,{row:n,isValid:!0})):t(null,{row:null,isValid:!0}))}callTransformer(e,t){return this._rowTransform?this._rowTransform(e,t):t(null,e)}callValidator(e,t){return this._rowValidator?this._rowValidator(e,t):t(null,{row:e,isValid:!0})}}})),cd=c(((e,t)=>{function n(e){return e===void 0}t.exports=n})),ld=c(((e,t)=>{var n=200,r=`__lodash_hash_undefined__`,i=1/0,a=`[object Function]`,o=`[object GeneratorFunction]`,s=/[\\^$.*+?()[\]{}|]/g,c=/^\[object .+?Constructor\]$/,l=typeof global==`object`&&global&&global.Object===Object&&global,u=typeof self==`object`&&self&&self.Object===Object&&self,d=l||u||Function(`return this`)();function f(e,t){return!!(e&&e.length)&&h(e,t,0)>-1}function p(e,t,n){for(var r=-1,i=e?e.length:0;++r<i;)if(n(t,e[r]))return!0;return!1}function m(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}function h(e,t,n){if(t!==t)return m(e,g,n);for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function g(e){return e!==e}function _(e,t){return e.has(t)}function v(e,t){return e?.[t]}function y(e){var t=!1;if(e!=null&&typeof e.toString!=`function`)try{t=!!(e+``)}catch{}return t}function b(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var x=Array.prototype,S=Function.prototype,C=Object.prototype,w=d[`__core-js_shared__`],T=function(){var e=/[^.]+$/.exec(w&&w.keys&&w.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}(),E=S.toString,D=C.hasOwnProperty,O=C.toString,k=RegExp(`^`+E.call(D).replace(s,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),A=x.splice,ee=q(d,`Map`),j=q(d,`Set`),M=q(Object,`create`);function N(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function P(){this.__data__=M?M(null):{}}function F(e){return this.has(e)&&delete this.__data__[e]}function te(e){var t=this.__data__;if(M){var n=t[e];return n===r?void 0:n}return D.call(t,e)?t[e]:void 0}function I(e){var t=this.__data__;return M?t[e]!==void 0:D.call(t,e)}function L(e,t){var n=this.__data__;return n[e]=M&&t===void 0?r:t,this}N.prototype.clear=P,N.prototype.delete=F,N.prototype.get=te,N.prototype.has=I,N.prototype.set=L;function ne(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function R(){this.__data__=[]}function z(e){var t=this.__data__,n=ue(t,e);return n<0?!1:(n==t.length-1?t.pop():A.call(t,n,1),!0)}function re(e){var t=this.__data__,n=ue(t,e);return n<0?void 0:t[n][1]}function B(e){return ue(this.__data__,e)>-1}function V(e,t){var n=this.__data__,r=ue(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}ne.prototype.clear=R,ne.prototype.delete=z,ne.prototype.get=re,ne.prototype.has=B,ne.prototype.set=V;function ie(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ae(){this.__data__={hash:new N,map:new(ee||ne),string:new N}}function oe(e){return K(this,e).delete(e)}function se(e){return K(this,e).get(e)}function H(e){return K(this,e).has(e)}function ce(e,t){return K(this,e).set(e,t),this}ie.prototype.clear=ae,ie.prototype.delete=oe,ie.prototype.get=se,ie.prototype.has=H,ie.prototype.set=ce;function le(e){var t=-1,n=e?e.length:0;for(this.__data__=new ie;++t<n;)this.add(e[t])}function U(e){return this.__data__.set(e,r),this}function W(e){return this.__data__.has(e)}le.prototype.add=le.prototype.push=U,le.prototype.has=W;function ue(e,t){for(var n=e.length;n--;)if(he(e[n][0],t))return n;return-1}function de(e){return!X(e)||Y(e)?!1:(ge(e)||y(e)?k:c).test(pe(e))}function G(e,t,r){var i=-1,a=f,o=e.length,s=!0,c=[],l=c;if(r)s=!1,a=p;else if(o>=n){var u=t?null:fe(e);if(u)return b(u);s=!1,a=_,l=new le}else l=t?[]:c;outer:for(;++i<o;){var d=e[i],m=t?t(d):d;if(d=r||d!==0?d:0,s&&m===m){for(var h=l.length;h--;)if(l[h]===m)continue outer;t&&l.push(m),c.push(d)}else a(l,m,r)||(l!==c&&l.push(m),c.push(d))}return c}var fe=j&&1/b(new j([,-0]))[1]==i?function(e){return new j(e)}:_e;function K(e,t){var n=e.__data__;return J(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function q(e,t){var n=v(e,t);return de(n)?n:void 0}function J(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function Y(e){return!!T&&T in e}function pe(e){if(e!=null){try{return E.call(e)}catch{}try{return e+``}catch{}}return``}function me(e){return e&&e.length?G(e):[]}function he(e,t){return e===t||e!==e&&t!==t}function ge(e){var t=X(e)?O.call(e):``;return t==a||t==o}function X(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function _e(){}t.exports=me})),ud=c(((e,t)=>{var n=200,r=`Expected a function`,i=`__lodash_hash_undefined__`,a=1,o=2,s=1/0,c=9007199254740991,l=`[object Arguments]`,u=`[object Array]`,d=`[object Boolean]`,f=`[object Date]`,p=`[object Error]`,m=`[object Function]`,h=`[object GeneratorFunction]`,g=`[object Map]`,_=`[object Number]`,v=`[object Object]`,y=`[object Promise]`,b=`[object RegExp]`,x=`[object Set]`,S=`[object String]`,C=`[object Symbol]`,w=`[object WeakMap]`,T=`[object ArrayBuffer]`,E=`[object DataView]`,D=`[object Float32Array]`,O=`[object Float64Array]`,k=`[object Int8Array]`,A=`[object Int16Array]`,ee=`[object Int32Array]`,j=`[object Uint8Array]`,M=`[object Uint8ClampedArray]`,N=`[object Uint16Array]`,P=`[object Uint32Array]`,F=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,te=/^\w*$/,I=/^\./,L=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ne=/[\\^$.*+?()[\]{}|]/g,R=/\\(\\)?/g,z=/^\[object .+?Constructor\]$/,re=/^(?:0|[1-9]\d*)$/,B={};B[D]=B[O]=B[k]=B[A]=B[ee]=B[j]=B[M]=B[N]=B[P]=!0,B[l]=B[u]=B[T]=B[d]=B[E]=B[f]=B[p]=B[m]=B[g]=B[_]=B[v]=B[b]=B[x]=B[S]=B[w]=!1;var V=typeof global==`object`&&global&&global.Object===Object&&global,ie=typeof self==`object`&&self&&self.Object===Object&&self,ae=V||ie||Function(`return this`)(),oe=typeof e==`object`&&e&&!e.nodeType&&e,se=oe&&typeof t==`object`&&t&&!t.nodeType&&t,H=se&&se.exports===oe&&V.process,ce=function(){try{return H&&H.binding(`util`)}catch{}}(),le=ce&&ce.isTypedArray;function U(e,t,n,r){for(var i=-1,a=e?e.length:0;++i<a;){var o=e[i];t(r,o,n(o),e)}return r}function W(e,t){for(var n=-1,r=e?e.length:0;++n<r;)if(t(e[n],n,e))return!0;return!1}function ue(e){return function(t){return t?.[e]}}function de(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function G(e){return function(t){return e(t)}}function fe(e,t){return e?.[t]}function K(e){var t=!1;if(e!=null&&typeof e.toString!=`function`)try{t=!!(e+``)}catch{}return t}function q(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function J(e,t){return function(n){return e(t(n))}}function Y(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var pe=Array.prototype,me=Function.prototype,he=Object.prototype,ge=ae[`__core-js_shared__`],X=function(){var e=/[^.]+$/.exec(ge&&ge.keys&&ge.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}(),_e=me.toString,Z=he.hasOwnProperty,ve=he.toString,ye=RegExp(`^`+_e.call(Z).replace(ne,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),be=ae.Symbol,xe=ae.Uint8Array,Se=he.propertyIsEnumerable,Ce=pe.splice,we=J(Object.keys,Object),Te=Bt(ae,`DataView`),Ee=Bt(ae,`Map`),De=Bt(ae,`Promise`),Oe=Bt(ae,`Set`),ke=Bt(ae,`WeakMap`),Ae=Bt(Object,`create`),je=Qt(Te),Me=Qt(Ee),Ne=Qt(De),Pe=Qt(Oe),Fe=Qt(ke),Ie=be?be.prototype:void 0,Le=Ie?Ie.valueOf:void 0,Re=Ie?Ie.toString:void 0;function ze(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Q(){this.__data__=Ae?Ae(null):{}}function Be(e){return this.has(e)&&delete this.__data__[e]}function Ve(e){var t=this.__data__;if(Ae){var n=t[e];return n===i?void 0:n}return Z.call(t,e)?t[e]:void 0}function He(e){var t=this.__data__;return Ae?t[e]!==void 0:Z.call(t,e)}function Ue(e,t){var n=this.__data__;return n[e]=Ae&&t===void 0?i:t,this}ze.prototype.clear=Q,ze.prototype.delete=Be,ze.prototype.get=Ve,ze.prototype.has=He,ze.prototype.set=Ue;function We(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ge(){this.__data__=[]}function Ke(e){var t=this.__data__,n=ft(t,e);return n<0?!1:(n==t.length-1?t.pop():Ce.call(t,n,1),!0)}function qe(e){var t=this.__data__,n=ft(t,e);return n<0?void 0:t[n][1]}function Je(e){return ft(this.__data__,e)>-1}function Ye(e,t){var n=this.__data__,r=ft(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}We.prototype.clear=Ge,We.prototype.delete=Ke,We.prototype.get=qe,We.prototype.has=Je,We.prototype.set=Ye;function Xe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ze(){this.__data__={hash:new ze,map:new(Ee||We),string:new ze}}function Qe(e){return Rt(this,e).delete(e)}function $e(e){return Rt(this,e).get(e)}function et(e){return Rt(this,e).has(e)}function tt(e,t){return Rt(this,e).set(e,t),this}Xe.prototype.clear=Ze,Xe.prototype.delete=Qe,Xe.prototype.get=$e,Xe.prototype.has=et,Xe.prototype.set=tt;function nt(e){var t=-1,n=e?e.length:0;for(this.__data__=new Xe;++t<n;)this.add(e[t])}function rt(e){return this.__data__.set(e,i),this}function it(e){return this.__data__.has(e)}nt.prototype.add=nt.prototype.push=rt,nt.prototype.has=it;function at(e){this.__data__=new We(e)}function ot(){this.__data__=new We}function st(e){return this.__data__.delete(e)}function ct(e){return this.__data__.get(e)}function lt(e){return this.__data__.has(e)}function ut(e,t){var r=this.__data__;if(r instanceof We){var i=r.__data__;if(!Ee||i.length<n-1)return i.push([e,t]),this;r=this.__data__=new Xe(i)}return r.set(e,t),this}at.prototype.clear=ot,at.prototype.delete=st,at.prototype.get=ct,at.prototype.has=lt,at.prototype.set=ut;function dt(e,t){var n=rn(e)||nn(e)?de(e.length,String):[],r=n.length,i=!!r;for(var a in e)(t||Z.call(e,a))&&!(i&&(a==`length`||Ut(a,r)))&&n.push(a);return n}function ft(e,t){for(var n=e.length;n--;)if(tn(e[n][0],t))return n;return-1}function pt(e,t,n,r){return mt(e,function(e,i,a){t(r,e,n(e),a)}),r}var mt=Nt(gt),ht=Pt();function gt(e,t){return e&&ht(e,t,gn)}function _t(e,t){t=Wt(t,e)?[t]:jt(t);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Zt(t[n++])];return n&&n==r?e:void 0}function vt(e){return ve.call(e)}function yt(e,t){return e!=null&&t in Object(e)}function bt(e,t,n,r,i){return e===t?!0:e==null||t==null||!ln(e)&&!un(t)?e!==e&&t!==t:xt(e,t,bt,n,r,i)}function xt(e,t,n,r,i,a){var s=rn(e),c=rn(t),d=u,f=u;s||(d=Vt(e),d=d==l?v:d),c||(f=Vt(t),f=f==l?v:f);var p=d==v&&!K(e),m=f==v&&!K(t),h=d==f;if(h&&!p)return a||=new at,s||fn(e)?Ft(e,t,n,r,i,a):It(e,t,d,n,r,i,a);if(!(i&o)){var g=p&&Z.call(e,`__wrapped__`),_=m&&Z.call(t,`__wrapped__`);if(g||_){var y=g?e.value():e,b=_?t.value():t;return a||=new at,n(y,b,r,i,a)}}return h?(a||=new at,Lt(e,t,n,r,i,a)):!1}function St(e,t,n,r){var i=n.length,s=i,c=!r;if(e==null)return!s;for(e=Object(e);i--;){var l=n[i];if(c&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<s;){l=n[i];var u=l[0],d=e[u],f=l[1];if(c&&l[2]){if(d===void 0&&!(u in e))return!1}else{var p=new at;if(r)var m=r(d,f,u,e,t,p);if(!(m===void 0?bt(f,d,r,a|o,p):m))return!1}}return!0}function Ct(e){return!ln(e)||Kt(e)?!1:(sn(e)||K(e)?ye:z).test(Qt(e))}function wt(e){return un(e)&&cn(e.length)&&!!B[ve.call(e)]}function Tt(e){return typeof e==`function`?e:e==null?_n:typeof e==`object`?rn(e)?Ot(e[0],e[1]):Dt(e):vn(e)}function Et(e){if(!qt(e))return we(e);var t=[];for(var n in Object(e))Z.call(e,n)&&n!=`constructor`&&t.push(n);return t}function Dt(e){var t=zt(e);return t.length==1&&t[0][2]?Yt(t[0][0],t[0][1]):function(n){return n===e||St(n,e,t)}}function Ot(e,t){return Wt(e)&&Jt(t)?Yt(Zt(e),t):function(n){var r=mn(n,e);return r===void 0&&r===t?hn(n,e):bt(t,r,void 0,a|o)}}function kt(e){return function(t){return _t(t,e)}}function At(e){if(typeof e==`string`)return e;if(dn(e))return Re?Re.call(e):``;var t=e+``;return t==`0`&&1/e==-s?`-0`:t}function jt(e){return rn(e)?e:Xt(e)}function Mt(e,t){return function(n,r){var i=rn(n)?U:pt,a=t?t():{};return i(n,e,Tt(r,2),a)}}function Nt(e,t){return function(n,r){if(n==null)return n;if(!an(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}function Pt(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}function Ft(e,t,n,r,i,s){var c=i&o,l=e.length,u=t.length;if(l!=u&&!(c&&u>l))return!1;var d=s.get(e);if(d&&s.get(t))return d==t;var f=-1,p=!0,m=i&a?new nt:void 0;for(s.set(e,t),s.set(t,e);++f<l;){var h=e[f],g=t[f];if(r)var _=c?r(g,h,f,t,e,s):r(h,g,f,e,t,s);if(_!==void 0){if(_)continue;p=!1;break}if(m){if(!W(t,function(e,t){if(!m.has(t)&&(h===e||n(h,e,r,i,s)))return m.add(t)})){p=!1;break}}else if(!(h===g||n(h,g,r,i,s))){p=!1;break}}return s.delete(e),s.delete(t),p}function It(e,t,n,r,i,s,c){switch(n){case E:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case T:return!(e.byteLength!=t.byteLength||!r(new xe(e),new xe(t)));case d:case f:case _:return tn(+e,+t);case p:return e.name==t.name&&e.message==t.message;case b:case S:return e==t+``;case g:var l=q;case x:var u=s&o;if(l||=Y,e.size!=t.size&&!u)return!1;var m=c.get(e);if(m)return m==t;s|=a,c.set(e,t);var h=Ft(l(e),l(t),r,i,s,c);return c.delete(e),h;case C:if(Le)return Le.call(e)==Le.call(t)}return!1}function Lt(e,t,n,r,i,a){var s=i&o,c=gn(e),l=c.length;if(l!=gn(t).length&&!s)return!1;for(var u=l;u--;){var d=c[u];if(!(s?d in t:Z.call(t,d)))return!1}var f=a.get(e);if(f&&a.get(t))return f==t;var p=!0;a.set(e,t),a.set(t,e);for(var m=s;++u<l;){d=c[u];var h=e[d],g=t[d];if(r)var _=s?r(g,h,d,t,e,a):r(h,g,d,e,t,a);if(!(_===void 0?h===g||n(h,g,r,i,a):_)){p=!1;break}m||=d==`constructor`}if(p&&!m){var v=e.constructor,y=t.constructor;v!=y&&`constructor`in e&&`constructor`in t&&!(typeof v==`function`&&v instanceof v&&typeof y==`function`&&y instanceof y)&&(p=!1)}return a.delete(e),a.delete(t),p}function Rt(e,t){var n=e.__data__;return Gt(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function zt(e){for(var t=gn(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Jt(i)]}return t}function Bt(e,t){var n=fe(e,t);return Ct(n)?n:void 0}var Vt=vt;(Te&&Vt(new Te(new ArrayBuffer(1)))!=E||Ee&&Vt(new Ee)!=g||De&&Vt(De.resolve())!=y||Oe&&Vt(new Oe)!=x||ke&&Vt(new ke)!=w)&&(Vt=function(e){var t=ve.call(e),n=t==v?e.constructor:void 0,r=n?Qt(n):void 0;if(r)switch(r){case je:return E;case Me:return g;case Ne:return y;case Pe:return x;case Fe:return w}return t});function Ht(e,t,n){t=Wt(t,e)?[t]:jt(t);for(var r,i=-1,a=t.length;++i<a;){var o=Zt(t[i]);if(!(r=e!=null&&n(e,o)))break;e=e[o]}if(r)return r;var a=e?e.length:0;return!!a&&cn(a)&&Ut(o,a)&&(rn(e)||nn(e))}function Ut(e,t){return t??=c,!!t&&(typeof e==`number`||re.test(e))&&e>-1&&e%1==0&&e<t}function Wt(e,t){if(rn(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||dn(e)?!0:te.test(e)||!F.test(e)||t!=null&&e in Object(t)}function Gt(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function Kt(e){return!!X&&X in e}function qt(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||he)}function Jt(e){return e===e&&!ln(e)}function Yt(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var Xt=en(function(e){e=pn(e);var t=[];return I.test(e)&&t.push(``),e.replace(L,function(e,n,r,i){t.push(r?i.replace(R,`$1`):n||e)}),t});function Zt(e){if(typeof e==`string`||dn(e))return e;var t=e+``;return t==`0`&&1/e==-s?`-0`:t}function Qt(e){if(e!=null){try{return _e.call(e)}catch{}try{return e+``}catch{}}return``}var $t=Mt(function(e,t,n){Z.call(e,n)?e[n].push(t):e[n]=[t]});function en(e,t){if(typeof e!=`function`||t&&typeof t!=`function`)throw TypeError(r);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o),o};return n.cache=new(en.Cache||Xe),n}en.Cache=Xe;function tn(e,t){return e===t||e!==e&&t!==t}function nn(e){return on(e)&&Z.call(e,`callee`)&&(!Se.call(e,`callee`)||ve.call(e)==l)}var rn=Array.isArray;function an(e){return e!=null&&cn(e.length)&&!sn(e)}function on(e){return un(e)&&an(e)}function sn(e){var t=ln(e)?ve.call(e):``;return t==m||t==h}function cn(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=c}function ln(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function un(e){return!!e&&typeof e==`object`}function dn(e){return typeof e==`symbol`||un(e)&&ve.call(e)==C}var fn=le?G(le):wt;function pn(e){return e==null?``:At(e)}function mn(e,t,n){var r=e==null?void 0:_t(e,t);return r===void 0?n:r}function hn(e,t){return e!=null&&Ht(e,t,yt)}function gn(e){return an(e)?dt(e):Et(e)}function _n(e){return e}function vn(e){return Wt(e)?ue(Zt(e)):kt(e)}t.exports=$t})),dd=c((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.HeaderTransformer=void 0;let n=t(cd()),r=t(Yu()),i=t(ld()),a=t(ud());e.HeaderTransformer=class{parserOptions;headers=null;receivedHeaders=!1;shouldUseFirstRow=!1;processedFirstRow=!1;headersLength=0;headersTransform;constructor(e){this.parserOptions=e,e.headers===!0?this.shouldUseFirstRow=!0:Array.isArray(e.headers)?this.setHeaders(e.headers):(0,r.default)(e.headers)&&(this.headersTransform=e.headers)}transform(e,t){return this.shouldMapRow(e)?t(null,this.processRow(e)):t(null,{row:null,isValid:!0})}shouldMapRow(e){let{parserOptions:t}=this;if(!this.headersTransform&&t.renameHeaders&&!this.processedFirstRow){if(!this.receivedHeaders)throw Error(`Error renaming headers: new headers must be provided in an array`);return this.processedFirstRow=!0,!1}if(!this.receivedHeaders&&Array.isArray(e)){if(this.headersTransform)this.setHeaders(this.headersTransform(e));else if(this.shouldUseFirstRow)this.setHeaders(e);else return!0;return!1}return!0}processRow(e){if(!this.headers)return{row:e,isValid:!0};let{parserOptions:t}=this;if(!t.discardUnmappedColumns&&e.length>this.headersLength){if(!t.strictColumnHandling)throw Error(`Unexpected Error: column header mismatch expected: ${this.headersLength} columns got: ${e.length}`);return{row:e,isValid:!1,reason:`Column header mismatch expected: ${this.headersLength} columns got: ${e.length}`}}return t.strictColumnHandling&&e.length<this.headersLength?{row:e,isValid:!1,reason:`Column header mismatch expected: ${this.headersLength} columns got: ${e.length}`}:{row:this.mapHeaders(e),isValid:!0}}mapHeaders(e){let t={},{headers:r,headersLength:i}=this;for(let a=0;a<i;a+=1){let i=r[a];if(!(0,n.default)(i)){let r=e[a];(0,n.default)(r)?t[i]=``:t[i]=r}}return t}setHeaders(e){let t=e.filter(e=>!!e);if((0,i.default)(t).length!==t.length){let e=(0,a.default)(t),n=Object.keys(e).filter(t=>e[t].length>1);throw Error(`Duplicate headers found ${JSON.stringify(n)}`)}this.headers=e,this.receivedHeaders=!0,this.headersLength=this.headers?.length||0}}})),fd=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.HeaderTransformer=e.RowTransformerValidator=void 0;var t=sd();Object.defineProperty(e,`RowTransformerValidator`,{enumerable:!0,get:function(){return t.RowTransformerValidator}});var n=dd();Object.defineProperty(e,`HeaderTransformer`,{enumerable:!0,get:function(){return n.HeaderTransformer}})})),pd=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Token=void 0,e.Token=class{static isTokenRowDelimiter(e){let t=e.token;return t===`\r`||t===`
201
+ `}var Nu=class extends ${constructor(e){super(),this.model=e||{type:`note`,note:{texts:[]},ref:``}}get tag(){return`r`}get richTextXform(){return this._richTextXform||=new sc,this._richTextXform}render(e,t){let n=t||this.model;e.openNode(`comment`,{ref:n.ref,authorId:0}),e.openNode(`text`),n&&n.note&&n.note.texts&&n.note.texts.forEach(t=>{this.richTextXform.render(e,t)}),e.closeNode(),e.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`comment`:return this.model={type:`note`,note:{texts:[]},...e.attributes},!0;case`r`:return this.parser=this.richTextXform,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){switch(e){case`comment`:return!1;case`r`:return this.model.note.texts.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}},Pu=class e extends ${constructor(){super(),this.map={comment:new Nu},this.model={comments:[]}}render(t,n){let r=n||this.model;t.openXml(ws.StdDocAttributes),t.openNode(`comments`,e.COMMENTS_ATTRIBUTES),t.openNode(`authors`),t.leafNode(`author`,null,`Author`),t.closeNode(),t.openNode(`commentList`),r.comments.forEach(e=>{this.map.comment.render(t,e)}),t.closeNode(),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case`commentList`:return this.model={comments:[]},!0;case`comment`:return this.parser=this.map.comment,this.parser.parseOpen(e),!0;default:return!1}}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){switch(e){case`commentList`:return!1;case`comment`:return this.model.comments.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(e),!0}}static{this.COMMENTS_ATTRIBUTES={xmlns:`http://schemas.openxmlformats.org/spreadsheetml/2006/main`}}},Fu=class extends ${constructor(){super(),this.model={}}get tag(){return`v:textbox`}conversionUnit(e,t,n){return`${(parseFloat(e.toString())*t).toFixed(2)}${n}`}reverseConversionUnit(e){return(e||``).split(`,`).map(e=>Number(parseFloat(this.conversionUnit(parseFloat(e),.1,``)).toFixed(2)))}render(e,t){let n={style:`mso-direction-alt:auto`};if(t&&t.note){let{inset:e}=t.note&&t.note.margins||{};Array.isArray(e)&&(e=e.map(e=>this.conversionUnit(e,10,`mm`)).join(`,`)),e&&(n.inset=e)}e.openNode(`v:textbox`,n),e.leafNode(`div`,{style:`text-align:left`}),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:return this.model={inset:this.reverseConversionUnit(e.attributes.inset)},!0;default:return!0}}parseText(){}parseClose(e){switch(e){case this.tag:return!1;default:return!0}}},Iu=class extends ${constructor(){super(),this.text=``}get tag(){return`x:Anchor`}getAnchorRect(e){let t=Math.floor(e.left),n=Math.floor((e.left-t)*68),r=Math.floor(e.top),i=Math.floor((e.top-r)*18),a=Math.floor(e.right),o=Math.floor((e.right-a)*68),s=Math.floor(e.bottom);return[t,n,r,i,a,o,s,Math.floor((e.bottom-s)*18)]}getDefaultRect(e){let t=e.col,n=Math.max(e.row-2,0);return[t,6,n,14,t+2,2,n+4,16]}render(e,t){let n=t.anchor?this.getAnchorRect(t.anchor):this.getDefaultRect(t.refAddress);e.leafNode(`x:Anchor`,null,n.join(`, `))}parseOpen(e){switch(e.name){case this.tag:return this.text=``,!0;default:return!1}}parseText(e){this.text=e}parseClose(){return!1}},Lu=class extends ${constructor(e){super(),this._model=e||{},this.text=``}get tag(){return this._model&&this._model.tag||``}render(e,t){e.leafNode(this.tag,null,t)}parseOpen(e){switch(e.name){case this.tag:return this.text=``,!0;default:return!1}}parseText(e){this.text=e}parseClose(){return!1}},Ru=class extends ${constructor(e){super(),this._model=e||{},this.model={}}get tag(){return this._model&&this._model.tag||``}render(e,t,n){(n&&t===n[2]||n&&this.tag===`x:SizeWithCells`&&t===n[1])&&e.leafNode(this.tag)}parseOpen(e){switch(e.name){case this.tag:return this.model={},this.model[this.tag]=!0,!0;default:return!1}}parseText(){}parseClose(){return!1}};let zu=[`twoCells`,`oneCells`,`absolute`];var Bu=class extends ${constructor(){super(),this.map={"x:Anchor":new Iu,"x:Locked":new Lu({tag:`x:Locked`}),"x:LockText":new Lu({tag:`x:LockText`}),"x:SizeWithCells":new Ru({tag:`x:SizeWithCells`}),"x:MoveWithCells":new Ru({tag:`x:MoveWithCells`})},this.model={anchor:[],protection:{},editAs:``}}get tag(){return`x:ClientData`}render(e,t){let{protection:n,editAs:r}=t.note;e.openNode(this.tag,{ObjectType:`Note`}),this.map[`x:MoveWithCells`].render(e,r,zu),this.map[`x:SizeWithCells`].render(e,r,zu),this.map[`x:Anchor`].render(e,t),this.map[`x:Locked`].render(e,n.locked),e.leafNode(`x:AutoFill`,null,`False`),this.map[`x:LockText`].render(e,n.lockText),e.leafNode(`x:Row`,null,t.refAddress.row-1),e.leafNode(`x:Column`,null,t.refAddress.col-1),e.closeNode()}parseOpen(e){switch(e.name){case this.tag:this.reset(),this.model={anchor:[],protection:{},editAs:``};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.normalizeModel(),!1;default:return!0}}normalizeModel(){let e=Object.assign({},this.map[`x:MoveWithCells`].model,this.map[`x:SizeWithCells`].model),t=Object.keys(e).length;this.model.editAs=zu[t],this.model.anchor=this.map[`x:Anchor`].text,this.model.protection.locked=this.map[`x:Locked`].text,this.model.protection.lockText=this.map[`x:LockText`].text}},Vu=class e extends ${constructor(){super(),this.map={"v:textbox":new Fu,"x:ClientData":new Bu}}get tag(){return`v:shape`}render(t,n,r){t.openNode(`v:shape`,e.V_SHAPE_ATTRIBUTES(n,r||0)),t.leafNode(`v:fill`,{color2:`infoBackground [80]`}),t.leafNode(`v:shadow`,{color:`none [81]`,obscured:`t`}),t.leafNode(`v:path`,{"o:connecttype":`none`}),this.map[`v:textbox`].render(t,n),this.map[`x:ClientData`].render(t,n),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={margins:{insetmode:e.attributes[`o:insetmode`]},anchor:``,editAs:``,protection:{}};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.parser=void 0),!0;switch(e){case this.tag:return this.model.margins.inset=this.map[`v:textbox`].model&&this.map[`v:textbox`].model.inset,this.model.protection=this.map[`x:ClientData`].model&&this.map[`x:ClientData`].model.protection,this.model.anchor=this.map[`x:ClientData`].model&&this.map[`x:ClientData`].model.anchor,this.model.editAs=this.map[`x:ClientData`].model&&this.map[`x:ClientData`].model.editAs,!1;default:return!0}}static{this.V_SHAPE_ATTRIBUTES=(e,t)=>({id:`_x0000_s${1025+t}`,type:`#_x0000_t202`,style:`position:absolute; margin-left:105.3pt;margin-top:10.5pt;width:97.8pt;height:59.1pt;z-index:1;visibility:hidden`,fillcolor:`infoBackground [80]`,strokecolor:`none [81]`,"o:insetmode":e.note.margins&&e.note.margins.insetmode})}},Hu=class e extends ${constructor(){super(),this.map={"v:shape":new Vu},this.model={comments:[]}}get tag(){return`xml`}render(t,n){let r=n||this.model;t.openXml(ws.StdDocAttributes),t.openNode(this.tag,e.DRAWING_ATTRIBUTES),t.openNode(`o:shapelayout`,{"v:ext":`edit`}),t.leafNode(`o:idmap`,{"v:ext":`edit`,data:1}),t.closeNode(),t.openNode(`v:shapetype`,{id:`_x0000_t202`,coordsize:`21600,21600`,"o:spt":202,path:`m,l,21600r21600,l21600,xe`}),t.leafNode(`v:stroke`,{joinstyle:`miter`}),t.leafNode(`v:path`,{gradientshapeok:`t`,"o:connecttype":`rect`}),t.closeNode(),r.comments.forEach((e,n)=>{this.map[`v:shape`].render(t,e,n)}),t.closeNode()}parseOpen(e){if(this.parser)return this.parser.parseOpen(e),!0;switch(e.name){case this.tag:this.reset(),this.model={comments:[]};break;default:this.parser=this.map[e.name],this.parser&&this.parser.parseOpen(e);break}return!0}parseText(e){this.parser&&this.parser.parseText(e)}parseClose(e){if(this.parser)return this.parser.parseClose(e)||(this.model.comments.push(this.parser.model),this.parser=void 0),!0;switch(e){case this.tag:return!1;default:return!0}}reconcile(e,t){e.anchors.forEach(e=>{e.br?this.map[`xdr:twoCellAnchor`].reconcile(e,t):this.map[`xdr:oneCellAnchor`].reconcile(e,t)})}static{this.DRAWING_ATTRIBUTES={"xmlns:v":`urn:schemas-microsoft-com:vml`,"xmlns:o":`urn:schemas-microsoft-com:office:office`,"xmlns:x":`urn:schemas-microsoft-com:office:excel`}}};Xi();function Uu(e,t){return new Promise((n,r)=>{Yi.readFile(e,t,(e,t)=>{e?r(e):n(t)})})}var Wu=class e{constructor(e){this.workbook=e}async readFile(e,t){if(!await oa(e))throw Error(`File not found: ${e}`);let n=Yi.createReadStream(e);try{let e=await this.read(n,t);return n.close(),e}catch(e){throw n.close(),e}}parseRels(e){return new fc().parseStream(e)}parseWorkbook(e){return new Oc().parseStream(e)}parseSharedStrings(e){return new uc().parseStream(e)}reconcile(e,t){let n=new Oc,r=new eu(t),i=new _u,a=new wu;n.reconcile(e);let o={media:e.media,mediaIndex:e.mediaIndex};Object.keys(e.drawings).forEach(t=>{let n=e.drawings[t],r=e.drawingRels[t];r&&(o.rels=r.reduce((e,t)=>(e[t.Id]=t,e),{}),(n.anchors||[]).forEach(e=>{let t=e.picture&&e.picture.hyperlinks;t&&o.rels[t.rId]&&(t.hyperlink=o.rels[t.rId].Target,delete t.rId)}),i.reconcile(n,o))});let s={styles:e.styles};Object.values(e.tables).forEach(e=>{a.reconcile(e,s)}),this._reconcilePivotTables(e);let c={styles:e.styles,sharedStrings:e.sharedStrings,media:e.media,mediaIndex:e.mediaIndex,date1904:e.properties&&e.properties.date1904,drawings:e.drawings,comments:e.comments,tables:e.tables,vmlDrawings:e.vmlDrawings,pivotTables:e.pivotTablesIndexed};e.worksheets.forEach(t=>{t.relationships=e.worksheetRels[t.sheetNo],r.reconcile(t,c)}),delete e.worksheetHash,delete e.worksheetRels,delete e.globalRels,delete e.sharedStrings,delete e.workbookRels,delete e.sheetDefs,delete e.styles,delete e.mediaIndex,delete e.drawings,delete e.drawingRels,delete e.vmlDrawings,delete e.pivotTableRels,delete e.pivotCacheDefinitionRels}_reconcilePivotTables(e){let t=e.pivotTables||{};if(typeof t!=`object`||Object.keys(t).length===0){e.pivotTables=[],e.pivotTablesIndexed={};return}let n=this._buildDefinitionToCacheIdMap(e),r=new Map;Object.entries(e.pivotCacheDefinitions||{}).forEach(([t,i])=>{let a=n.get(t);if(a!==void 0){let n=t.replace(`Definition`,`Records`);r.set(a,{definition:i,records:e.pivotCacheRecords?.[n],definitionName:t})}});let i=[],a={};Object.entries(t).forEach(([e,t])=>{let n=t,o=this._extractTableNumber(e),s=r.get(n.cacheId),c={...n,tableNumber:o,cacheDefinition:s?.definition,cacheRecords:s?.records,cacheFields:s?.definition?.cacheFields||[],rows:n.rowFields.filter(e=>e>=0),columns:n.colFields.filter(e=>e>=0&&e!==-2),values:n.dataFields.map(e=>e.fld),metric:this._determineMetric(n.dataFields),applyWidthHeightFormats:n.applyWidthHeightFormats||`0`};i.push(c),a[`../pivotTables/${e}.xml`]=c}),i.sort((e,t)=>e.tableNumber-t.tableNumber),e.pivotTables=i,e.pivotTablesIndexed=a,e.loadedPivotTables=i}_extractTableNumber(e){let t=e.match(/pivotTable(\d+)/);return t?parseInt(t[1],10):1}_buildCacheIdMap(e){let t=new Map,n=e.pivotCaches||[];for(let e of n)e.cacheId&&e.rId&&t.set(e.rId,parseInt(e.cacheId,10));return t}_buildDefinitionToCacheIdMap(t){let n=new Map,r=this._buildCacheIdMap(t),i=t.workbookRels||[];for(let t of i)if(t.Type===e.RelType.PivotCacheDefinition&&t.Target){let e=t.Target.match(/pivotCacheDefinition(\d+)\.xml/);if(e){let i=`pivotCacheDefinition${e[1]}`,a=r.get(t.Id);a!==void 0&&n.set(i,a)}}return n}_determineMetric(e){return e.length>0&&e[0].subtotal===`count`?`count`:`sum`}async _processWorksheetEntry(e,t,n,r,i){let a=await new eu(r).parseStream(e);if(!a)throw Error(`Failed to parse worksheet ${i}`);a.sheetNo=n,t.worksheetHash[i]=a,t.worksheets.push(a)}async _processCommentEntry(e,t,n){let r=await new Pu().parseStream(e);t.comments[`../${n}.xml`]=r}async _processTableEntry(e,t,n){let r=await new wu().parseStream(e);t.tables[`../tables/${n}.xml`]=r}async _processWorksheetRelsEntry(e,t,n){let r=await new fc().parseStream(e);t.worksheetRels[n]=r}async _processMediaEntry(e,t,n){let r=n.lastIndexOf(`.`);if(r>=1){let i=n.substr(r+1),a=n.substr(0,r);await new Promise((r,o)=>{let s=new ys,c=()=>{e.removeListener(`error`,u),s.removeListener(`error`,u),s.removeListener(`finish`,l)},l=()=>{c(),t.mediaIndex[n]=t.media.length,t.mediaIndex[a]=t.media.length;let e={type:`image`,name:a,extension:i,buffer:s.toBuffer()};t.media.push(e),r()},u=e=>{c(),o(e)};s.once(`finish`,l),e.on(`error`,u),s.on(`error`,u),e.pipe(s)})}}async _processDrawingEntry(e,t,n){let r=await new _u().parseStream(e);t.drawings[n]=r}async _processDrawingRelsEntry(e,t,n){let r=await new fc().parseStream(e);t.drawingRels[n]=r}async _processVmlDrawingEntry(e,t,n){let r=await new Hu().parseStream(e);t.vmlDrawings[`../drawings/${n}.vml`]=r}async _processThemeEntry(e,t,n){await new Promise((r,i)=>{let a=new ys,o=()=>{e.removeListener(`error`,c),a.removeListener(`error`,c),a.removeListener(`finish`,s)},s=()=>{o(),t.themes[n]=a.read().toString(),r()},c=e=>{o(),i(e)};a.once(`finish`,s),e.on(`error`,c),a.on(`error`,c),e.pipe(a)})}async _processPivotTableEntry(e,t,n){let r=await new ku().parseStream(e);r&&(t.pivotTables[n]=r)}async _processPivotTableRelsEntry(e,t,n){let r=await new fc().parseStream(e);t.pivotTableRels[n]=r}async _processPivotCacheDefinitionEntry(e,t,n){let r=await new Ou().parseStream(e);r&&(t.pivotCacheDefinitions[n]=r)}async _processPivotCacheDefinitionRelsEntry(e,t,n){let r=await new fc().parseStream(e);t.pivotCacheDefinitionRels[n]=r}async _processPivotCacheRecordsEntry(e,t,n){let r=await new Tu().parseStream(e);r&&(t.pivotCacheRecords[n]=r)}async read(e,t){let n={};return await new Promise((t,r)=>{let i=0,a=!1,o=0,s=()=>{e.removeListener(`data`,u),e.removeListener(`end`,d),e.removeListener(`error`,f)},c=()=>{a&&i===o&&(s(),t())},l=new po(e=>{o++;let t=[],a=0;e.ondata=(o,l,u)=>{if(o){s(),r(o);return}if(l&&(t.push(l),a+=l.length),u){if(t.length===1)n[e.name]=t[0];else if(t.length>1){let r=new Uint8Array(a),i=0;for(let e of t)r.set(e,i),i+=e.length;n[e.name]=r}else n[e.name]=new Uint8Array;i++,t.length=0,c()}},e.start()});l.register(fo);let u=e=>{l.push(e)},d=()=>{l.push(new Uint8Array,!0),a=!0,c()},f=e=>{s(),r(e)};e.on(`data`,u),e.on(`end`,d),e.on(`error`,f)}),this.loadFromFiles(n,t)}async load(e,t){let n;if(!e||typeof e==`object`&&!Gi.Buffer.isBuffer(e)&&!(e instanceof Uint8Array)&&!(e instanceof ArrayBuffer))throw Error(`Can't read the data of 'the loaded zip file'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?`);n=t&&t.base64?Gi.Buffer.from(e.toString(),`base64`):e;let r=new Ko.PassThrough;return r.end(n),this.read(r,t)}async loadFromFiles(e,t){let n={worksheets:[],worksheetHash:{},worksheetRels:[],themes:{},media:[],mediaIndex:{},drawings:{},drawingRels:{},comments:{},tables:{},vmlDrawings:{},pivotTables:{},pivotTableRels:{},pivotCacheDefinitions:{},pivotCacheDefinitionRels:{},pivotCacheRecords:{}},r=Object.keys(e).map(t=>({name:t,dir:t.endsWith(`/`),data:e[t]}));for(let e of r)if(!e.dir){let r=e.name;r[0]===`/`&&(r=r.substr(1));let i;if(r.match(/xl\/media\//)||r.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/))i=new Ko.PassThrough,i.end(Gi.Buffer.from(e.data));else{i=new Ko.PassThrough({readableObjectMode:!0,writableObjectMode:!0});let t=da(Gi.Buffer.from(e.data));i.end(t)}let a;if(a=r.match(/xl\/worksheets\/sheet(\d+)[.]xml/),a){let e=parseInt(a[1],10);await this._processWorksheetEntry(i,n,e,t,r)}else switch(r){case`_rels/.rels`:n.globalRels=await this.parseRels(i);break;case`xl/workbook.xml`:{let e=await this.parseWorkbook(i);n.sheets=e.sheets,n.definedNames=e.definedNames,n.views=e.views,n.properties=e.properties,n.calcProperties=e.calcProperties,n.pivotCaches=e.pivotCaches;break}case`xl/sharedStrings.xml`:n.sharedStrings=new uc,await n.sharedStrings.parseStream(i);break;case`xl/_rels/workbook.xml.rels`:n.workbookRels=await this.parseRels(i);break;case`docProps/app.xml`:{let e=await new gc().parseStream(i);n.company=e.company,n.manager=e.manager;break}case`docProps/core.xml`:{let e=await new ac().parseStream(i);Object.assign(n,e);break}case`xl/styles.xml`:n.styles=new rc,await n.styles.parseStream(i);break;default:if(a=r.match(/xl\/worksheets\/_rels\/sheet(\d+)[.]xml[.]rels/),a){let e=parseInt(a[1],10);await this._processWorksheetRelsEntry(i,n,e);break}if(a=r.match(/xl\/media\/([a-zA-Z0-9]+[.][a-zA-Z0-9]{3,4})$/),a){await this._processMediaEntry(i,n,a[1]);break}if(a=r.match(/xl\/drawings\/(drawing\d+)[.]xml/),a){await this._processDrawingEntry(i,n,a[1]);break}if(a=r.match(/xl\/drawings\/_rels\/(drawing\d+)[.]xml[.]rels/),a){await this._processDrawingRelsEntry(i,n,a[1]);break}if(a=r.match(/xl\/drawings\/(vmlDrawing\d+)[.]vml/),a){await this._processVmlDrawingEntry(i,n,a[1]);break}if(a=r.match(/xl\/comments(\d+)[.]xml/),a){await this._processCommentEntry(i,n,`comments${a[1]}`);break}if(a=r.match(/xl\/tables\/(table\d+)[.]xml/),a){await this._processTableEntry(i,n,a[1]);break}if(a=r.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/),a){await this._processThemeEntry(i,n,a[1]);break}if(a=r.match(/xl\/pivotTables\/(pivotTable\d+)[.]xml/),a){await this._processPivotTableEntry(i,n,a[1]);break}if(a=r.match(/xl\/pivotTables\/_rels\/(pivotTable\d+)[.]xml[.]rels/),a){await this._processPivotTableRelsEntry(i,n,a[1]);break}if(a=r.match(/xl\/pivotCache\/(pivotCacheDefinition\d+)[.]xml/),a){await this._processPivotCacheDefinitionEntry(i,n,a[1]);break}if(a=r.match(/xl\/pivotCache\/_rels\/(pivotCacheDefinition\d+)[.]xml[.]rels/),a){await this._processPivotCacheDefinitionRelsEntry(i,n,a[1]);break}if(a=r.match(/xl\/pivotCache\/(pivotCacheRecords\d+)[.]xml/),a){await this._processPivotCacheRecordsEntry(i,n,a[1]);break}}}return this.reconcile(n,t),this.workbook.model=n,this.workbook}async addContentTypes(e,t){let n=new pc().toXml(t);e.append(n,{name:`[Content_Types].xml`})}async addApp(e,t){let n=new gc().toXml(t);e.append(n,{name:`docProps/app.xml`})}async addCore(e,t){let n=new ac;e.append(n.toXml(t),{name:`docProps/core.xml`})}async addThemes(e,t){let n=t.themes||{theme1:`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
202
+ <a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"> <a:themeElements> <a:clrScheme name="Office"> <a:dk1> <a:sysClr val="windowText" lastClr="000000"/> </a:dk1> <a:lt1> <a:sysClr val="window" lastClr="FFFFFF"/> </a:lt1> <a:dk2> <a:srgbClr val="1F497D"/> </a:dk2> <a:lt2> <a:srgbClr val="EEECE1"/> </a:lt2> <a:accent1> <a:srgbClr val="4F81BD"/> </a:accent1> <a:accent2> <a:srgbClr val="C0504D"/> </a:accent2> <a:accent3> <a:srgbClr val="9BBB59"/> </a:accent3> <a:accent4> <a:srgbClr val="8064A2"/> </a:accent4> <a:accent5> <a:srgbClr val="4BACC6"/> </a:accent5> <a:accent6> <a:srgbClr val="F79646"/> </a:accent6> <a:hlink> <a:srgbClr val="0000FF"/> </a:hlink> <a:folHlink> <a:srgbClr val="800080"/> </a:folHlink> </a:clrScheme> <a:fontScheme name="Office"> <a:majorFont> <a:latin typeface="Cambria"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Times New Roman"/> <a:font script="Hebr" typeface="Times New Roman"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="MoolBoran"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Times New Roman"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:majorFont> <a:minorFont> <a:latin typeface="Calibri"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Arial"/> <a:font script="Hebr" typeface="Arial"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="DaunPenh"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Arial"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:minorFont> </a:fontScheme> <a:fmtScheme name="Office"> <a:fillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="35000"> <a:schemeClr val="phClr"> <a:tint val="37000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="15000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="1"/> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="100000"/> <a:shade val="100000"/> <a:satMod val="130000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:shade val="100000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="0"/> </a:gradFill> </a:fillStyleLst> <a:lnStyleLst> <a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"> <a:shade val="95000"/> <a:satMod val="105000"/> </a:schemeClr> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> </a:lnStyleLst> <a:effectStyleLst> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="38000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> <a:scene3d> <a:camera prst="orthographicFront"> <a:rot lat="0" lon="0" rev="0"/> </a:camera> <a:lightRig rig="threePt" dir="t"> <a:rot lat="0" lon="0" rev="1200000"/> </a:lightRig> </a:scene3d> <a:sp3d> <a:bevelT w="63500" h="25400"/> </a:sp3d> </a:effectStyle> </a:effectStyleLst> <a:bgFillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="40000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="40000"> <a:schemeClr val="phClr"> <a:tint val="45000"/> <a:shade val="99000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="20000"/> <a:satMod val="255000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="-80000" r="50000" b="180000"/> </a:path> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="80000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="30000"/> <a:satMod val="200000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="50000" r="50000" b="50000"/> </a:path> </a:gradFill> </a:bgFillStyleLst> </a:fmtScheme> </a:themeElements> <a:objectDefaults> <a:spDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="1"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="3"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="2"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="lt1"/> </a:fontRef> </a:style> </a:spDef> <a:lnDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="2"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="0"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="1"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="tx1"/> </a:fontRef> </a:style> </a:lnDef> </a:objectDefaults> <a:extraClrSchemeLst/> </a:theme>`};Object.keys(n).forEach(t=>{let r=n[t],i=`xl/theme/${t}.xml`;e.append(r,{name:i})})}async addOfficeRels(t,n){let r=new fc().toXml([{Id:`rId1`,Type:e.RelType.OfficeDocument,Target:`xl/workbook.xml`},{Id:`rId2`,Type:e.RelType.CoreProperties,Target:`docProps/core.xml`},{Id:`rId3`,Type:e.RelType.ExtenderProperties,Target:`docProps/app.xml`}]);t.append(r,{name:`_rels/.rels`})}async addWorkbookRels(t,n){let r=1,i=[{Id:`rId${r++}`,Type:e.RelType.Styles,Target:`styles.xml`},{Id:`rId${r++}`,Type:e.RelType.Theme,Target:`theme/theme1.xml`}];n.sharedStrings.count&&i.push({Id:`rId${r++}`,Type:e.RelType.SharedStrings,Target:`sharedStrings.xml`}),(n.pivotTables||[]).forEach(t=>{t.rId=`rId${r++}`,i.push({Id:t.rId,Type:e.RelType.PivotCacheDefinition,Target:`pivotCache/pivotCacheDefinition${t.tableNumber}.xml`})}),n.worksheets.forEach((t,n)=>{t.rId=`rId${r++}`,t.fileIndex=n+1,i.push({Id:t.rId,Type:e.RelType.Worksheet,Target:`worksheets/sheet${t.fileIndex}.xml`})});let a=new fc().toXml(i);t.append(a,{name:`xl/_rels/workbook.xml.rels`})}async addSharedStrings(e,t){t.sharedStrings&&t.sharedStrings.count&&e.append(t.sharedStrings.xml,{name:`xl/sharedStrings.xml`})}async addStyles(e,t){let{xml:n}=t.styles;n&&e.append(n,{name:`xl/styles.xml`})}async addWorkbook(e,t){let n=new Oc;e.append(n.toXml(t),{name:`xl/workbook.xml`})}async addWorksheets(e,t){let n=new eu,r=new fc,i=new Pu,a=new Hu;t.worksheets.forEach((t,o)=>{let s=t.fileIndex||o+1,c=new ws;n.render(c,t),e.append(c.xml,{name:`xl/worksheets/sheet${s}.xml`}),t.rels&&t.rels.length&&(c=new ws,r.render(c,t.rels),e.append(c.xml,{name:`xl/worksheets/_rels/sheet${s}.xml.rels`})),t.comments.length>0&&(c=new ws,i.render(c,t),e.append(c.xml,{name:`xl/comments${s}.xml`}),c=new ws,a.render(c,t),e.append(c.xml,{name:`xl/drawings/vmlDrawing${s}.vml`}))})}async addMedia(e,t){await Promise.all(t.media.map(async t=>{if(t.type===`image`){let n=`xl/media/${t.name}.${t.extension}`;if(t.filename){let r=await Uu(t.filename);return e.append(r,{name:n})}if(t.buffer)return e.append(t.buffer,{name:n});if(t.base64){let r=t.base64,i=r.substring(r.indexOf(`,`)+1);return e.append(i,{name:n,base64:!0})}}throw Error(`Unsupported media`)}))}addDrawings(e,t){let n=new _u,r=new fc;t.worksheets.forEach(t=>{let{drawing:i}=t;if(i){n.prepare(i);let t=n.toXml(i);e.append(t,{name:`xl/drawings/${i.name}.xml`}),t=r.toXml(i.rels),e.append(t,{name:`xl/drawings/_rels/${i.name}.xml.rels`})}})}addTables(e,t){let n=new wu;t.worksheets.forEach(t=>{let{tables:r}=t;r.forEach(t=>{n.prepare(t,{});let r=n.toXml(t);e.append(r,{name:`xl/tables/${t.target}`})})})}addPivotTables(t,n){if(!n.pivotTables.length)return;let r=new Tu,i=new Ou,a=new ku,o=new fc;n.pivotTables.forEach(n=>{let s=n.tableNumber;if(n.isLoaded){if(n.cacheDefinition){let e=i.toXml(n.cacheDefinition);t.append(e,{name:`xl/pivotCache/pivotCacheDefinition${s}.xml`})}if(n.cacheRecords){let e=r.toXml(n.cacheRecords);t.append(e,{name:`xl/pivotCache/pivotCacheRecords${s}.xml`})}}else{let e=r.toXml(n);t.append(e,{name:`xl/pivotCache/pivotCacheRecords${s}.xml`}),e=i.toXml(n),t.append(e,{name:`xl/pivotCache/pivotCacheDefinition${s}.xml`})}let c=o.toXml([{Id:`rId1`,Type:e.RelType.PivotCacheRecords,Target:`pivotCacheRecords${s}.xml`}]);t.append(c,{name:`xl/pivotCache/_rels/pivotCacheDefinition${s}.xml.rels`}),c=a.toXml(n),t.append(c,{name:`xl/pivotTables/pivotTable${s}.xml`}),c=o.toXml([{Id:`rId1`,Type:e.RelType.PivotCacheDefinition,Target:`../pivotCache/pivotCacheDefinition${s}.xml`}]),t.append(c,{name:`xl/pivotTables/_rels/pivotTable${s}.xml.rels`})})}_finalize(e){return new Promise((t,n)=>{e.on(`finish`,()=>{t(this)}),e.on(`error`,n),e.finalize()})}prepareModel(e,t){e.creator=e.creator||`ExcelTS`,e.lastModifiedBy=e.lastModifiedBy||`ExcelTS`,e.created=e.created||new Date,e.modified=e.modified||new Date,e.useSharedStrings=t.useSharedStrings===void 0?!0:t.useSharedStrings,e.useStyles=t.useStyles===void 0?!0:t.useStyles,e.sharedStrings=new uc,e.styles=e.useStyles?new rc(!0):new rc.Mock;let n=new Oc,r=new eu;n.prepare(e);let i={sharedStrings:e.sharedStrings,styles:e.styles,date1904:e.properties.date1904,drawingsCount:0,media:e.media};i.drawings=e.drawings=[],i.commentRefs=e.commentRefs=[];let a=0;e.tables=[],e.worksheets.forEach(t=>{t.tables.forEach(t=>{a++,t.target=`table${a}.xml`,t.id=a,e.tables.push(t)}),r.prepare(t,i)})}async write(e,t){t||={};let{model:n}=this.workbook,r=new bs(t.zip);return r.pipe(e),this.prepareModel(n,t),await this.addContentTypes(r,n),await this.addOfficeRels(r,n),await this.addWorkbookRels(r,n),await this.addWorksheets(r,n),await this.addSharedStrings(r,n),this.addDrawings(r,n),this.addTables(r,n),this.addPivotTables(r,n),await Promise.all([this.addThemes(r,n),this.addStyles(r,n)]),await this.addMedia(r,n),await Promise.all([this.addApp(r,n),this.addCore(r,n)]),await this.addWorkbook(r,n),this._finalize(r)}writeFile(e,t){let n=Yi.createWriteStream(e);return new Promise((e,r)=>{let i=()=>{n.removeListener(`finish`,a),n.removeListener(`error`,o)},a=()=>{i(),e()},o=e=>{i(),r(e)};n.once(`finish`,a),n.on(`error`,o),this.write(n,t).then(()=>{n.end()}).catch(e=>{i(),r(e)})})}async writeBuffer(e){let t=new ys;return await this.write(t,e),t.read()}static{this.RelType=kc}},Gu=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.FormatterOptions=void 0,e.FormatterOptions=class{objectMode=!0;delimiter=`,`;rowDelimiter=`
203
+ `;quote=`"`;escape=this.quote;quoteColumns=!1;quoteHeaders=this.quoteColumns;headers=null;includeEndRowDelimiter=!1;transform;shouldWriteHeaders;writeBOM=!1;escapedQuote;BOM=``;alwaysWriteHeaders=!1;constructor(e={}){Object.assign(this,e||{}),e?.quoteHeaders===void 0&&(this.quoteHeaders=this.quoteColumns),e?.quote===!0?this.quote=`"`:e?.quote===!1&&(this.quote=``),typeof e?.escape!=`string`&&(this.escape=this.quote),this.shouldWriteHeaders=!!this.headers&&(e.writeHeaders??!0),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote=`${this.escape}${this.quote}`}}})),Ku=c(((e,t)=>{var n=`[object AsyncFunction]`,r=`[object Function]`,i=`[object GeneratorFunction]`,a=`[object Null]`,o=`[object Proxy]`,s=`[object Undefined]`,c=typeof global==`object`&&global&&global.Object===Object&&global,l=typeof self==`object`&&self&&self.Object===Object&&self,u=c||l||Function(`return this`)(),d=Object.prototype,f=d.hasOwnProperty,p=d.toString,m=u.Symbol,h=m?m.toStringTag:void 0;function g(e){return e==null?e===void 0?s:a:h&&h in Object(e)?_(e):v(e)}function _(e){var t=f.call(e,h),n=e[h];try{e[h]=void 0;var r=!0}catch{}var i=p.call(e);return r&&(t?e[h]=n:delete e[h]),i}function v(e){return p.call(e)}function y(e){if(!b(e))return!1;var t=g(e);return t==r||t==i||t==n||t==o}function b(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=y})),qu=c(((e,t)=>{var n=`[object Boolean]`,r=Object.prototype.toString;function i(e){return e===!0||e===!1||a(e)&&r.call(e)==n}function a(e){return!!e&&typeof e==`object`}t.exports=i})),Ju=c(((e,t)=>{function n(e){return e==null}t.exports=n})),Yu=c(((e,t)=>{var n=1/0,r=`[object Symbol]`,i=/[\\^$.*+?()[\]{}|]/g,a=RegExp(i.source),o=typeof global==`object`&&global&&global.Object===Object&&global,s=typeof self==`object`&&self&&self.Object===Object&&self,c=o||s||Function(`return this`)(),l=Object.prototype.toString,u=c.Symbol,d=u?u.prototype:void 0,f=d?d.toString:void 0;function p(e){if(typeof e==`string`)return e;if(h(e))return f?f.call(e):``;var t=e+``;return t==`0`&&1/e==-n?`-0`:t}function m(e){return!!e&&typeof e==`object`}function h(e){return typeof e==`symbol`||m(e)&&l.call(e)==r}function g(e){return e==null?``:p(e)}function _(e){return e=g(e),e&&a.test(e)?e.replace(i,`\\$&`):e}t.exports=_})),Xu=c((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.FieldFormatter=void 0;let n=t(qu()),r=t(Ju()),i=t(Yu());e.FieldFormatter=class{formatterOptions;_headers=null;REPLACE_REGEXP;ESCAPE_REGEXP;constructor(e){this.formatterOptions=e,e.headers!==null&&(this.headers=e.headers),this.REPLACE_REGEXP=new RegExp(e.quote,`g`);let t=`[${e.delimiter}${(0,i.default)(e.rowDelimiter)}|\r|\n]`;this.ESCAPE_REGEXP=new RegExp(t)}set headers(e){this._headers=e}shouldQuote(e,t){let r=t?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;return(0,n.default)(r)?r:Array.isArray(r)?r[e]:this._headers===null?!1:r[this._headers[e]]}format(e,t,n){let i=`${(0,r.default)(e)?``:e}`.replace(/\0/g,``),{formatterOptions:a}=this;return a.quote!==``&&i.indexOf(a.quote)!==-1?this.quoteField(i.replace(this.REPLACE_REGEXP,a.escapedQuote)):i.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(t,n)?this.quoteField(i):i}quoteField(e){let{quote:t}=this.formatterOptions;return`${t}${e}${t}`}}})),Zu=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isSyncTransform=void 0,e.isSyncTransform=e=>e.length===1})),Qu=c((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.RowFormatter=void 0;let n=t(Ku()),r=Xu(),i=Zu();e.RowFormatter=class e{static isRowHashArray(e){return Array.isArray(e)?Array.isArray(e[0])&&e[0].length===2:!1}static isRowArray(e){return Array.isArray(e)&&!this.isRowHashArray(e)}static gatherHeaders(t){return e.isRowHashArray(t)?t.map(e=>e[0]):Array.isArray(t)?t:Object.keys(t)}static createTransform(e){return(0,i.isSyncTransform)(e)?(t,n)=>{let r=null;try{r=e(t)}catch(e){return n(e)}return n(null,r)}:(t,n)=>{e(t,n)}}formatterOptions;fieldFormatter;shouldWriteHeaders;_rowTransform;headers;hasWrittenHeaders;rowCount=0;constructor(e){this.formatterOptions=e,this.fieldFormatter=new r.FieldFormatter(e),this.headers=e.headers,this.shouldWriteHeaders=e.shouldWriteHeaders,this.hasWrittenHeaders=!1,this.headers!==null&&(this.fieldFormatter.headers=this.headers),e.transform&&(this.rowTransform=e.transform)}set rowTransform(t){if(!(0,n.default)(t))throw TypeError(`The transform should be a function`);this._rowTransform=e.createTransform(t)}format(e,t){this.callTransformer(e,(n,r)=>{if(n)return t(n);if(!e)return t(null);let i=[];if(r){let{shouldFormatColumns:e,headers:t}=this.checkHeaders(r);if(this.shouldWriteHeaders&&t&&!this.hasWrittenHeaders&&(i.push(this.formatColumns(t,!0)),this.hasWrittenHeaders=!0),e){let e=this.gatherColumns(r);i.push(this.formatColumns(e,!1))}}return t(null,i)})}finish(e){let t=[];if(this.formatterOptions.alwaysWriteHeaders&&this.rowCount===0){if(!this.headers)return e(Error("`alwaysWriteHeaders` option is set to true but `headers` option not provided."));t.push(this.formatColumns(this.headers,!0))}return this.formatterOptions.includeEndRowDelimiter&&t.push(this.formatterOptions.rowDelimiter),e(null,t)}checkHeaders(t){if(this.headers)return{shouldFormatColumns:!0,headers:this.headers};let n=e.gatherHeaders(t);return this.headers=n,this.fieldFormatter.headers=n,this.shouldWriteHeaders?Array.isArray(t)&&n.every((e,n)=>e===t[n])?{shouldFormatColumns:!1,headers:n}:{shouldFormatColumns:!0,headers:n}:{shouldFormatColumns:!0,headers:null}}gatherColumns(t){if(this.headers===null)throw Error(`Headers is currently null`);return Array.isArray(t)?e.isRowHashArray(t)?this.headers.map((e,n)=>{let r=t[n];return r?r[1]:``}):e.isRowArray(t)&&!this.shouldWriteHeaders?t:this.headers.map((e,n)=>t[n]):this.headers.map(e=>t[e])}callTransformer(e,t){return this._rowTransform?this._rowTransform(e,t):t(null,e)}formatColumns(e,t){let n=e.map((e,n)=>this.fieldFormatter.format(e,n,t)).join(this.formatterOptions.delimiter),{rowCount:r}=this;return this.rowCount+=1,r?[this.formatterOptions.rowDelimiter,n].join(``):n}}})),$u=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.FieldFormatter=e.RowFormatter=void 0;var t=Qu();Object.defineProperty(e,`RowFormatter`,{enumerable:!0,get:function(){return t.RowFormatter}});var n=Xu();Object.defineProperty(e,`FieldFormatter`,{enumerable:!0,get:function(){return n.FieldFormatter}})})),ed=c((e=>{var t=K();Object.defineProperty(e,`__esModule`,{value:!0}),e.CsvFormatterStream=void 0;let n=ln(),r=$u();e.CsvFormatterStream=class extends n.Transform{formatterOptions;rowFormatter;hasWrittenBOM=!1;constructor(e){super({writableObjectMode:e.objectMode}),this.formatterOptions=e,this.rowFormatter=new r.RowFormatter(e),this.hasWrittenBOM=!e.writeBOM}transform(e){return this.rowFormatter.rowTransform=e,this}_transform(e,n,r){let i=!1;try{this.hasWrittenBOM||=(this.push(this.formatterOptions.BOM),!0),this.rowFormatter.format(e,(e,n)=>e?(i=!0,r(e)):(n&&n.forEach(e=>{this.push(t.Buffer.from(e,`utf8`))}),i=!0,r()))}catch(e){if(i)throw e;r(e)}}_flush(e){this.rowFormatter.finish((n,r)=>n?e(n):(r&&r.forEach(e=>{this.push(t.Buffer.from(e,`utf8`))}),e()))}}})),td=c((e=>{var t=K(),n=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),r=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),i=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return r(t,e),t},a=e&&e.__exportStar||function(e,t){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(t,r)&&n(t,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),e.writeToPath=e.writeToString=e.writeToBuffer=e.writeToStream=e.write=e.format=e.FormatterOptions=e.CsvFormatterStream=void 0;let o=Kt(),s=ln(),c=i((Xi(),f(Ji))),l=Gu(),u=ed();a(Zu(),e);var d=ed();Object.defineProperty(e,`CsvFormatterStream`,{enumerable:!0,get:function(){return d.CsvFormatterStream}});var p=Gu();Object.defineProperty(e,`FormatterOptions`,{enumerable:!0,get:function(){return p.FormatterOptions}}),e.format=e=>new u.CsvFormatterStream(new l.FormatterOptions(e)),e.write=(t,n)=>{let r=(0,e.format)(n),i=(0,o.promisify)((e,t)=>{r.write(e,void 0,t)});return t.reduce((e,t)=>e.then(()=>i(t)),Promise.resolve()).then(()=>{r.end()}).catch(e=>{r.emit(`error`,e)}),r},e.writeToStream=(t,n,r)=>(0,e.write)(n,r).pipe(t),e.writeToBuffer=(n,r={})=>{let i=[],a=new s.Writable({write(e,t,n){i.push(e),n()}});return new Promise((o,s)=>{a.on(`error`,s).on(`finish`,()=>o(t.Buffer.concat(i))),(0,e.write)(n,r).pipe(a)})},e.writeToString=(t,n)=>(0,e.writeToBuffer)(t,n).then(e=>e.toString()),e.writeToPath=(t,n,r)=>{let i=c.createWriteStream(t,{encoding:`utf8`});return(0,e.write)(n,r).pipe(i)}})),nd=c((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.ParserOptions=void 0;let n=t(Yu()),r=t(Ju());e.ParserOptions=class{escapedDelimiter;objectMode=!0;delimiter=`,`;ignoreEmpty=!1;quote=`"`;escape=null;escapeChar=this.quote;comment=null;supportsComments=!1;ltrim=!1;rtrim=!1;trim=!1;headers=null;renameHeaders=!1;strictColumnHandling=!1;discardUnmappedColumns=!1;carriageReturn=`\r`;NEXT_TOKEN_REGEXP;encoding=`utf8`;limitRows=!1;maxRows=0;skipLines=0;skipRows=0;constructor(e){if(Object.assign(this,e||{}),this.delimiter.length>1)throw Error(`delimiter option must be one character long`);this.escapedDelimiter=(0,n.default)(this.delimiter),this.escapeChar=this.escape??this.quote,this.supportsComments=!(0,r.default)(this.comment),this.NEXT_TOKEN_REGEXP=RegExp(`([^\\s]|\\r\\n|\\n|\\r|${this.escapedDelimiter})`),this.maxRows>0&&(this.limitRows=!0)}}})),rd=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isSyncValidate=e.isSyncTransform=void 0,e.isSyncTransform=e=>e.length===1,e.isSyncValidate=e=>e.length===1})),id=c((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.RowTransformerValidator=void 0;let n=t(Ku()),r=rd();e.RowTransformerValidator=class e{static createTransform(e){return(0,r.isSyncTransform)(e)?(t,n)=>{let r=null;try{r=e(t)}catch(e){return n(e)}return n(null,r)}:e}static createValidator(e){return(0,r.isSyncValidate)(e)?(t,n)=>{n(null,{row:t,isValid:e(t)})}:(t,n)=>{e(t,(e,r,i)=>e?n(e):r?n(null,{row:t,isValid:r,reason:i}):n(null,{row:t,isValid:!1,reason:i}))}}_rowTransform=null;_rowValidator=null;set rowTransform(t){if(!(0,n.default)(t))throw TypeError(`The transform should be a function`);this._rowTransform=e.createTransform(t)}set rowValidator(t){if(!(0,n.default)(t))throw TypeError(`The validate should be a function`);this._rowValidator=e.createValidator(t)}transformAndValidate(e,t){return this.callTransformer(e,(e,n)=>e?t(e):n?this.callValidator(n,(e,r)=>e?t(e):r&&!r.isValid?t(null,{row:n,isValid:!1,reason:r.reason}):t(null,{row:n,isValid:!0})):t(null,{row:null,isValid:!0}))}callTransformer(e,t){return this._rowTransform?this._rowTransform(e,t):t(null,e)}callValidator(e,t){return this._rowValidator?this._rowValidator(e,t):t(null,{row:e,isValid:!0})}}})),ad=c(((e,t)=>{function n(e){return e===void 0}t.exports=n})),od=c(((e,t)=>{var n=200,r=`__lodash_hash_undefined__`,i=1/0,a=`[object Function]`,o=`[object GeneratorFunction]`,s=/[\\^$.*+?()[\]{}|]/g,c=/^\[object .+?Constructor\]$/,l=typeof global==`object`&&global&&global.Object===Object&&global,u=typeof self==`object`&&self&&self.Object===Object&&self,d=l||u||Function(`return this`)();function f(e,t){return!!(e&&e.length)&&h(e,t,0)>-1}function p(e,t,n){for(var r=-1,i=e?e.length:0;++r<i;)if(n(t,e[r]))return!0;return!1}function m(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}function h(e,t,n){if(t!==t)return m(e,g,n);for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function g(e){return e!==e}function _(e,t){return e.has(t)}function v(e,t){return e?.[t]}function y(e){var t=!1;if(e!=null&&typeof e.toString!=`function`)try{t=!!(e+``)}catch{}return t}function b(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var x=Array.prototype,S=Function.prototype,C=Object.prototype,w=d[`__core-js_shared__`],T=function(){var e=/[^.]+$/.exec(w&&w.keys&&w.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}(),E=S.toString,D=C.hasOwnProperty,O=C.toString,k=RegExp(`^`+E.call(D).replace(s,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),A=x.splice,ee=q(d,`Map`),j=q(d,`Set`),M=q(Object,`create`);function N(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function P(){this.__data__=M?M(null):{}}function F(e){return this.has(e)&&delete this.__data__[e]}function te(e){var t=this.__data__;if(M){var n=t[e];return n===r?void 0:n}return D.call(t,e)?t[e]:void 0}function I(e){var t=this.__data__;return M?t[e]!==void 0:D.call(t,e)}function L(e,t){var n=this.__data__;return n[e]=M&&t===void 0?r:t,this}N.prototype.clear=P,N.prototype.delete=F,N.prototype.get=te,N.prototype.has=I,N.prototype.set=L;function ne(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function R(){this.__data__=[]}function z(e){var t=this.__data__,n=ue(t,e);return n<0?!1:(n==t.length-1?t.pop():A.call(t,n,1),!0)}function re(e){var t=this.__data__,n=ue(t,e);return n<0?void 0:t[n][1]}function B(e){return ue(this.__data__,e)>-1}function V(e,t){var n=this.__data__,r=ue(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}ne.prototype.clear=R,ne.prototype.delete=z,ne.prototype.get=re,ne.prototype.has=B,ne.prototype.set=V;function ie(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ae(){this.__data__={hash:new N,map:new(ee||ne),string:new N}}function oe(e){return K(this,e).delete(e)}function se(e){return K(this,e).get(e)}function H(e){return K(this,e).has(e)}function ce(e,t){return K(this,e).set(e,t),this}ie.prototype.clear=ae,ie.prototype.delete=oe,ie.prototype.get=se,ie.prototype.has=H,ie.prototype.set=ce;function le(e){var t=-1,n=e?e.length:0;for(this.__data__=new ie;++t<n;)this.add(e[t])}function U(e){return this.__data__.set(e,r),this}function W(e){return this.__data__.has(e)}le.prototype.add=le.prototype.push=U,le.prototype.has=W;function ue(e,t){for(var n=e.length;n--;)if(he(e[n][0],t))return n;return-1}function de(e){return!X(e)||Y(e)?!1:(ge(e)||y(e)?k:c).test(pe(e))}function G(e,t,r){var i=-1,a=f,o=e.length,s=!0,c=[],l=c;if(r)s=!1,a=p;else if(o>=n){var u=t?null:fe(e);if(u)return b(u);s=!1,a=_,l=new le}else l=t?[]:c;outer:for(;++i<o;){var d=e[i],m=t?t(d):d;if(d=r||d!==0?d:0,s&&m===m){for(var h=l.length;h--;)if(l[h]===m)continue outer;t&&l.push(m),c.push(d)}else a(l,m,r)||(l!==c&&l.push(m),c.push(d))}return c}var fe=j&&1/b(new j([,-0]))[1]==i?function(e){return new j(e)}:_e;function K(e,t){var n=e.__data__;return J(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function q(e,t){var n=v(e,t);return de(n)?n:void 0}function J(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function Y(e){return!!T&&T in e}function pe(e){if(e!=null){try{return E.call(e)}catch{}try{return e+``}catch{}}return``}function me(e){return e&&e.length?G(e):[]}function he(e,t){return e===t||e!==e&&t!==t}function ge(e){var t=X(e)?O.call(e):``;return t==a||t==o}function X(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function _e(){}t.exports=me})),sd=c(((e,t)=>{var n=200,r=`Expected a function`,i=`__lodash_hash_undefined__`,a=1,o=2,s=1/0,c=9007199254740991,l=`[object Arguments]`,u=`[object Array]`,d=`[object Boolean]`,f=`[object Date]`,p=`[object Error]`,m=`[object Function]`,h=`[object GeneratorFunction]`,g=`[object Map]`,_=`[object Number]`,v=`[object Object]`,y=`[object Promise]`,b=`[object RegExp]`,x=`[object Set]`,S=`[object String]`,C=`[object Symbol]`,w=`[object WeakMap]`,T=`[object ArrayBuffer]`,E=`[object DataView]`,D=`[object Float32Array]`,O=`[object Float64Array]`,k=`[object Int8Array]`,A=`[object Int16Array]`,ee=`[object Int32Array]`,j=`[object Uint8Array]`,M=`[object Uint8ClampedArray]`,N=`[object Uint16Array]`,P=`[object Uint32Array]`,F=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,te=/^\w*$/,I=/^\./,L=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ne=/[\\^$.*+?()[\]{}|]/g,R=/\\(\\)?/g,z=/^\[object .+?Constructor\]$/,re=/^(?:0|[1-9]\d*)$/,B={};B[D]=B[O]=B[k]=B[A]=B[ee]=B[j]=B[M]=B[N]=B[P]=!0,B[l]=B[u]=B[T]=B[d]=B[E]=B[f]=B[p]=B[m]=B[g]=B[_]=B[v]=B[b]=B[x]=B[S]=B[w]=!1;var V=typeof global==`object`&&global&&global.Object===Object&&global,ie=typeof self==`object`&&self&&self.Object===Object&&self,ae=V||ie||Function(`return this`)(),oe=typeof e==`object`&&e&&!e.nodeType&&e,se=oe&&typeof t==`object`&&t&&!t.nodeType&&t,H=se&&se.exports===oe&&V.process,ce=function(){try{return H&&H.binding(`util`)}catch{}}(),le=ce&&ce.isTypedArray;function U(e,t,n,r){for(var i=-1,a=e?e.length:0;++i<a;){var o=e[i];t(r,o,n(o),e)}return r}function W(e,t){for(var n=-1,r=e?e.length:0;++n<r;)if(t(e[n],n,e))return!0;return!1}function ue(e){return function(t){return t?.[e]}}function de(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function G(e){return function(t){return e(t)}}function fe(e,t){return e?.[t]}function K(e){var t=!1;if(e!=null&&typeof e.toString!=`function`)try{t=!!(e+``)}catch{}return t}function q(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function J(e,t){return function(n){return e(t(n))}}function Y(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var pe=Array.prototype,me=Function.prototype,he=Object.prototype,ge=ae[`__core-js_shared__`],X=function(){var e=/[^.]+$/.exec(ge&&ge.keys&&ge.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}(),_e=me.toString,Z=he.hasOwnProperty,ve=he.toString,ye=RegExp(`^`+_e.call(Z).replace(ne,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),be=ae.Symbol,xe=ae.Uint8Array,Se=he.propertyIsEnumerable,Ce=pe.splice,we=J(Object.keys,Object),Te=Bt(ae,`DataView`),Ee=Bt(ae,`Map`),De=Bt(ae,`Promise`),Oe=Bt(ae,`Set`),ke=Bt(ae,`WeakMap`),Ae=Bt(Object,`create`),je=Qt(Te),Me=Qt(Ee),Ne=Qt(De),Pe=Qt(Oe),Fe=Qt(ke),Ie=be?be.prototype:void 0,Le=Ie?Ie.valueOf:void 0,Re=Ie?Ie.toString:void 0;function ze(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Q(){this.__data__=Ae?Ae(null):{}}function Be(e){return this.has(e)&&delete this.__data__[e]}function Ve(e){var t=this.__data__;if(Ae){var n=t[e];return n===i?void 0:n}return Z.call(t,e)?t[e]:void 0}function He(e){var t=this.__data__;return Ae?t[e]!==void 0:Z.call(t,e)}function Ue(e,t){var n=this.__data__;return n[e]=Ae&&t===void 0?i:t,this}ze.prototype.clear=Q,ze.prototype.delete=Be,ze.prototype.get=Ve,ze.prototype.has=He,ze.prototype.set=Ue;function We(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ge(){this.__data__=[]}function Ke(e){var t=this.__data__,n=ft(t,e);return n<0?!1:(n==t.length-1?t.pop():Ce.call(t,n,1),!0)}function qe(e){var t=this.__data__,n=ft(t,e);return n<0?void 0:t[n][1]}function Je(e){return ft(this.__data__,e)>-1}function Ye(e,t){var n=this.__data__,r=ft(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}We.prototype.clear=Ge,We.prototype.delete=Ke,We.prototype.get=qe,We.prototype.has=Je,We.prototype.set=Ye;function Xe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ze(){this.__data__={hash:new ze,map:new(Ee||We),string:new ze}}function Qe(e){return Rt(this,e).delete(e)}function $e(e){return Rt(this,e).get(e)}function et(e){return Rt(this,e).has(e)}function tt(e,t){return Rt(this,e).set(e,t),this}Xe.prototype.clear=Ze,Xe.prototype.delete=Qe,Xe.prototype.get=$e,Xe.prototype.has=et,Xe.prototype.set=tt;function nt(e){var t=-1,n=e?e.length:0;for(this.__data__=new Xe;++t<n;)this.add(e[t])}function rt(e){return this.__data__.set(e,i),this}function it(e){return this.__data__.has(e)}nt.prototype.add=nt.prototype.push=rt,nt.prototype.has=it;function at(e){this.__data__=new We(e)}function ot(){this.__data__=new We}function st(e){return this.__data__.delete(e)}function ct(e){return this.__data__.get(e)}function lt(e){return this.__data__.has(e)}function ut(e,t){var r=this.__data__;if(r instanceof We){var i=r.__data__;if(!Ee||i.length<n-1)return i.push([e,t]),this;r=this.__data__=new Xe(i)}return r.set(e,t),this}at.prototype.clear=ot,at.prototype.delete=st,at.prototype.get=ct,at.prototype.has=lt,at.prototype.set=ut;function dt(e,t){var n=rn(e)||nn(e)?de(e.length,String):[],r=n.length,i=!!r;for(var a in e)(t||Z.call(e,a))&&!(i&&(a==`length`||Ut(a,r)))&&n.push(a);return n}function ft(e,t){for(var n=e.length;n--;)if(tn(e[n][0],t))return n;return-1}function pt(e,t,n,r){return mt(e,function(e,i,a){t(r,e,n(e),a)}),r}var mt=Nt(gt),ht=Pt();function gt(e,t){return e&&ht(e,t,gn)}function _t(e,t){t=Wt(t,e)?[t]:jt(t);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Zt(t[n++])];return n&&n==r?e:void 0}function vt(e){return ve.call(e)}function yt(e,t){return e!=null&&t in Object(e)}function bt(e,t,n,r,i){return e===t?!0:e==null||t==null||!ln(e)&&!un(t)?e!==e&&t!==t:xt(e,t,bt,n,r,i)}function xt(e,t,n,r,i,a){var s=rn(e),c=rn(t),d=u,f=u;s||(d=Vt(e),d=d==l?v:d),c||(f=Vt(t),f=f==l?v:f);var p=d==v&&!K(e),m=f==v&&!K(t),h=d==f;if(h&&!p)return a||=new at,s||fn(e)?Ft(e,t,n,r,i,a):It(e,t,d,n,r,i,a);if(!(i&o)){var g=p&&Z.call(e,`__wrapped__`),_=m&&Z.call(t,`__wrapped__`);if(g||_){var y=g?e.value():e,b=_?t.value():t;return a||=new at,n(y,b,r,i,a)}}return h?(a||=new at,Lt(e,t,n,r,i,a)):!1}function St(e,t,n,r){var i=n.length,s=i,c=!r;if(e==null)return!s;for(e=Object(e);i--;){var l=n[i];if(c&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<s;){l=n[i];var u=l[0],d=e[u],f=l[1];if(c&&l[2]){if(d===void 0&&!(u in e))return!1}else{var p=new at;if(r)var m=r(d,f,u,e,t,p);if(!(m===void 0?bt(f,d,r,a|o,p):m))return!1}}return!0}function Ct(e){return!ln(e)||Kt(e)?!1:(sn(e)||K(e)?ye:z).test(Qt(e))}function wt(e){return un(e)&&cn(e.length)&&!!B[ve.call(e)]}function Tt(e){return typeof e==`function`?e:e==null?_n:typeof e==`object`?rn(e)?Ot(e[0],e[1]):Dt(e):vn(e)}function Et(e){if(!qt(e))return we(e);var t=[];for(var n in Object(e))Z.call(e,n)&&n!=`constructor`&&t.push(n);return t}function Dt(e){var t=zt(e);return t.length==1&&t[0][2]?Yt(t[0][0],t[0][1]):function(n){return n===e||St(n,e,t)}}function Ot(e,t){return Wt(e)&&Jt(t)?Yt(Zt(e),t):function(n){var r=mn(n,e);return r===void 0&&r===t?hn(n,e):bt(t,r,void 0,a|o)}}function kt(e){return function(t){return _t(t,e)}}function At(e){if(typeof e==`string`)return e;if(dn(e))return Re?Re.call(e):``;var t=e+``;return t==`0`&&1/e==-s?`-0`:t}function jt(e){return rn(e)?e:Xt(e)}function Mt(e,t){return function(n,r){var i=rn(n)?U:pt,a=t?t():{};return i(n,e,Tt(r,2),a)}}function Nt(e,t){return function(n,r){if(n==null)return n;if(!an(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}function Pt(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}function Ft(e,t,n,r,i,s){var c=i&o,l=e.length,u=t.length;if(l!=u&&!(c&&u>l))return!1;var d=s.get(e);if(d&&s.get(t))return d==t;var f=-1,p=!0,m=i&a?new nt:void 0;for(s.set(e,t),s.set(t,e);++f<l;){var h=e[f],g=t[f];if(r)var _=c?r(g,h,f,t,e,s):r(h,g,f,e,t,s);if(_!==void 0){if(_)continue;p=!1;break}if(m){if(!W(t,function(e,t){if(!m.has(t)&&(h===e||n(h,e,r,i,s)))return m.add(t)})){p=!1;break}}else if(!(h===g||n(h,g,r,i,s))){p=!1;break}}return s.delete(e),s.delete(t),p}function It(e,t,n,r,i,s,c){switch(n){case E:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case T:return!(e.byteLength!=t.byteLength||!r(new xe(e),new xe(t)));case d:case f:case _:return tn(+e,+t);case p:return e.name==t.name&&e.message==t.message;case b:case S:return e==t+``;case g:var l=q;case x:var u=s&o;if(l||=Y,e.size!=t.size&&!u)return!1;var m=c.get(e);if(m)return m==t;s|=a,c.set(e,t);var h=Ft(l(e),l(t),r,i,s,c);return c.delete(e),h;case C:if(Le)return Le.call(e)==Le.call(t)}return!1}function Lt(e,t,n,r,i,a){var s=i&o,c=gn(e),l=c.length;if(l!=gn(t).length&&!s)return!1;for(var u=l;u--;){var d=c[u];if(!(s?d in t:Z.call(t,d)))return!1}var f=a.get(e);if(f&&a.get(t))return f==t;var p=!0;a.set(e,t),a.set(t,e);for(var m=s;++u<l;){d=c[u];var h=e[d],g=t[d];if(r)var _=s?r(g,h,d,t,e,a):r(h,g,d,e,t,a);if(!(_===void 0?h===g||n(h,g,r,i,a):_)){p=!1;break}m||=d==`constructor`}if(p&&!m){var v=e.constructor,y=t.constructor;v!=y&&`constructor`in e&&`constructor`in t&&!(typeof v==`function`&&v instanceof v&&typeof y==`function`&&y instanceof y)&&(p=!1)}return a.delete(e),a.delete(t),p}function Rt(e,t){var n=e.__data__;return Gt(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function zt(e){for(var t=gn(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Jt(i)]}return t}function Bt(e,t){var n=fe(e,t);return Ct(n)?n:void 0}var Vt=vt;(Te&&Vt(new Te(new ArrayBuffer(1)))!=E||Ee&&Vt(new Ee)!=g||De&&Vt(De.resolve())!=y||Oe&&Vt(new Oe)!=x||ke&&Vt(new ke)!=w)&&(Vt=function(e){var t=ve.call(e),n=t==v?e.constructor:void 0,r=n?Qt(n):void 0;if(r)switch(r){case je:return E;case Me:return g;case Ne:return y;case Pe:return x;case Fe:return w}return t});function Ht(e,t,n){t=Wt(t,e)?[t]:jt(t);for(var r,i=-1,a=t.length;++i<a;){var o=Zt(t[i]);if(!(r=e!=null&&n(e,o)))break;e=e[o]}if(r)return r;var a=e?e.length:0;return!!a&&cn(a)&&Ut(o,a)&&(rn(e)||nn(e))}function Ut(e,t){return t??=c,!!t&&(typeof e==`number`||re.test(e))&&e>-1&&e%1==0&&e<t}function Wt(e,t){if(rn(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||dn(e)?!0:te.test(e)||!F.test(e)||t!=null&&e in Object(t)}function Gt(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function Kt(e){return!!X&&X in e}function qt(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||he)}function Jt(e){return e===e&&!ln(e)}function Yt(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var Xt=en(function(e){e=pn(e);var t=[];return I.test(e)&&t.push(``),e.replace(L,function(e,n,r,i){t.push(r?i.replace(R,`$1`):n||e)}),t});function Zt(e){if(typeof e==`string`||dn(e))return e;var t=e+``;return t==`0`&&1/e==-s?`-0`:t}function Qt(e){if(e!=null){try{return _e.call(e)}catch{}try{return e+``}catch{}}return``}var $t=Mt(function(e,t,n){Z.call(e,n)?e[n].push(t):e[n]=[t]});function en(e,t){if(typeof e!=`function`||t&&typeof t!=`function`)throw TypeError(r);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o),o};return n.cache=new(en.Cache||Xe),n}en.Cache=Xe;function tn(e,t){return e===t||e!==e&&t!==t}function nn(e){return on(e)&&Z.call(e,`callee`)&&(!Se.call(e,`callee`)||ve.call(e)==l)}var rn=Array.isArray;function an(e){return e!=null&&cn(e.length)&&!sn(e)}function on(e){return un(e)&&an(e)}function sn(e){var t=ln(e)?ve.call(e):``;return t==m||t==h}function cn(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=c}function ln(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function un(e){return!!e&&typeof e==`object`}function dn(e){return typeof e==`symbol`||un(e)&&ve.call(e)==C}var fn=le?G(le):wt;function pn(e){return e==null?``:At(e)}function mn(e,t,n){var r=e==null?void 0:_t(e,t);return r===void 0?n:r}function hn(e,t){return e!=null&&Ht(e,t,yt)}function gn(e){return an(e)?dt(e):Et(e)}function _n(e){return e}function vn(e){return Wt(e)?ue(Zt(e)):kt(e)}t.exports=$t})),cd=c((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.HeaderTransformer=void 0;let n=t(ad()),r=t(Ku()),i=t(od()),a=t(sd());e.HeaderTransformer=class{parserOptions;headers=null;receivedHeaders=!1;shouldUseFirstRow=!1;processedFirstRow=!1;headersLength=0;headersTransform;constructor(e){this.parserOptions=e,e.headers===!0?this.shouldUseFirstRow=!0:Array.isArray(e.headers)?this.setHeaders(e.headers):(0,r.default)(e.headers)&&(this.headersTransform=e.headers)}transform(e,t){return this.shouldMapRow(e)?t(null,this.processRow(e)):t(null,{row:null,isValid:!0})}shouldMapRow(e){let{parserOptions:t}=this;if(!this.headersTransform&&t.renameHeaders&&!this.processedFirstRow){if(!this.receivedHeaders)throw Error(`Error renaming headers: new headers must be provided in an array`);return this.processedFirstRow=!0,!1}if(!this.receivedHeaders&&Array.isArray(e)){if(this.headersTransform)this.setHeaders(this.headersTransform(e));else if(this.shouldUseFirstRow)this.setHeaders(e);else return!0;return!1}return!0}processRow(e){if(!this.headers)return{row:e,isValid:!0};let{parserOptions:t}=this;if(!t.discardUnmappedColumns&&e.length>this.headersLength){if(!t.strictColumnHandling)throw Error(`Unexpected Error: column header mismatch expected: ${this.headersLength} columns got: ${e.length}`);return{row:e,isValid:!1,reason:`Column header mismatch expected: ${this.headersLength} columns got: ${e.length}`}}return t.strictColumnHandling&&e.length<this.headersLength?{row:e,isValid:!1,reason:`Column header mismatch expected: ${this.headersLength} columns got: ${e.length}`}:{row:this.mapHeaders(e),isValid:!0}}mapHeaders(e){let t={},{headers:r,headersLength:i}=this;for(let a=0;a<i;a+=1){let i=r[a];if(!(0,n.default)(i)){let r=e[a];(0,n.default)(r)?t[i]=``:t[i]=r}}return t}setHeaders(e){let t=e.filter(e=>!!e);if((0,i.default)(t).length!==t.length){let e=(0,a.default)(t),n=Object.keys(e).filter(t=>e[t].length>1);throw Error(`Duplicate headers found ${JSON.stringify(n)}`)}this.headers=e,this.receivedHeaders=!0,this.headersLength=this.headers?.length||0}}})),ld=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.HeaderTransformer=e.RowTransformerValidator=void 0;var t=id();Object.defineProperty(e,`RowTransformerValidator`,{enumerable:!0,get:function(){return t.RowTransformerValidator}});var n=cd();Object.defineProperty(e,`HeaderTransformer`,{enumerable:!0,get:function(){return n.HeaderTransformer}})})),ud=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Token=void 0,e.Token=class{static isTokenRowDelimiter(e){let t=e.token;return t===`\r`||t===`
174
204
  `||t===`\r
175
- `}static isTokenCarriageReturn(e,t){return e.token===t.carriageReturn}static isTokenComment(e,t){return t.supportsComments&&!!e&&e.token===t.comment}static isTokenEscapeCharacter(e,t){return e.token===t.escapeChar}static isTokenQuote(e,t){return e.token===t.quote}static isTokenDelimiter(e,t){return e.token===t.delimiter}token;startCursor;endCursor;constructor(e){this.token=e.token,this.startCursor=e.startCursor,this.endCursor=e.endCursor}}})),md=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Scanner=void 0;let t=pd(),n=/((?:\r\n)|\n|\r)/;e.Scanner=class{line;parserOptions;lineLength;hasMoreData;cursor=0;constructor(e){this.line=e.line,this.lineLength=this.line.length,this.parserOptions=e.parserOptions,this.hasMoreData=e.hasMoreData,this.cursor=e.cursor||0}get hasMoreCharacters(){return this.lineLength>this.cursor}get nextNonSpaceToken(){let{lineFromCursor:e}=this,n=this.parserOptions.NEXT_TOKEN_REGEXP;if(e.search(n)===-1)return null;let r=n.exec(e);if(r==null)return null;let i=r[1],a=this.cursor+(r.index||0);return new t.Token({token:i,startCursor:a,endCursor:a+i.length-1})}get nextCharacterToken(){let{cursor:e,lineLength:n}=this;return n<=e?null:new t.Token({token:this.line[e],startCursor:e,endCursor:e})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){let e=n.exec(this.lineFromCursor);return e?(this.cursor+=(e.index||0)+e[0].length,this):this.hasMoreData?null:(this.cursor=this.lineLength,this)}advanceTo(e){return this.cursor=e,this}advanceToToken(e){return this.cursor=e.startCursor,this}advancePastToken(e){return this.cursor=e.endCursor+1,this}truncateToCursor(){return this.line=this.lineFromCursor,this.lineLength=this.line.length,this.cursor=0,this}}})),hd=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ColumnFormatter=void 0,e.ColumnFormatter=class{format;constructor(e){e.trim?this.format=e=>e.trim():e.ltrim?this.format=e=>e.trimLeft():e.rtrim?this.format=e=>e.trimRight():this.format=e=>e}}})),gd=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.NonQuotedColumnParser=void 0;let t=hd(),n=pd();e.NonQuotedColumnParser=class{parserOptions;columnFormatter;constructor(e){this.parserOptions=e,this.columnFormatter=new t.ColumnFormatter(e)}parse(e){if(!e.hasMoreCharacters)return null;let{parserOptions:t}=this,r=[],i=e.nextCharacterToken;for(;i&&!(n.Token.isTokenDelimiter(i,t)||n.Token.isTokenRowDelimiter(i));i=e.nextCharacterToken)r.push(i.token),e.advancePastToken(i);return this.columnFormatter.format(r.join(``))}}})),_d=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.QuotedColumnParser=void 0;let t=hd(),n=pd();e.QuotedColumnParser=class{parserOptions;columnFormatter;constructor(e){this.parserOptions=e,this.columnFormatter=new t.ColumnFormatter(e)}parse(e){if(!e.hasMoreCharacters)return null;let t=e.cursor,{foundClosingQuote:n,col:r}=this.gatherDataBetweenQuotes(e);if(!n){if(e.advanceTo(t),!e.hasMoreData)throw Error(`Parse Error: missing closing: '${this.parserOptions.quote||``}' in line: at '${e.lineFromCursor.replace(/[\r\n]/g,`\\n'`)}'`);return null}return this.checkForMalformedColumn(e),r}gatherDataBetweenQuotes(e){let{parserOptions:t}=this,r=!1,i=!1,a=[],o=e.nextCharacterToken;for(;!i&&o!==null;o=e.nextCharacterToken){let s=n.Token.isTokenQuote(o,t);if(!r&&s)r=!0;else if(r)if(n.Token.isTokenEscapeCharacter(o,t)){e.advancePastToken(o);let r=e.nextCharacterToken;r!==null&&(n.Token.isTokenQuote(r,t)||n.Token.isTokenEscapeCharacter(r,t))?(a.push(r.token),o=r):s?i=!0:a.push(o.token)}else s?i=!0:a.push(o.token);e.advancePastToken(o)}return{col:this.columnFormatter.format(a.join(``)),foundClosingQuote:i}}checkForMalformedColumn(e){let{parserOptions:t}=this,{nextNonSpaceToken:r}=e;if(r){let i=n.Token.isTokenDelimiter(r,t),a=n.Token.isTokenRowDelimiter(r);if(!(i||a)){let n=e.lineFromCursor.substr(0,10).replace(/[\r\n]/g,`\\n'`);throw Error(`Parse Error: expected: '${t.escapedDelimiter}' OR new line got: '${r.token}'. at '${n}'`)}e.advanceToToken(r)}else e.hasMoreData||e.advancePastLine()}}})),vd=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ColumnParser=void 0;let t=gd(),n=_d(),r=pd();e.ColumnParser=class{parserOptions;nonQuotedColumnParser;quotedColumnParser;constructor(e){this.parserOptions=e,this.quotedColumnParser=new n.QuotedColumnParser(e),this.nonQuotedColumnParser=new t.NonQuotedColumnParser(e)}parse(e){let{nextNonSpaceToken:t}=e;return t!==null&&r.Token.isTokenQuote(t,this.parserOptions)?(e.advanceToToken(t),this.quotedColumnParser.parse(e)):this.nonQuotedColumnParser.parse(e)}}})),yd=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ColumnFormatter=e.QuotedColumnParser=e.NonQuotedColumnParser=e.ColumnParser=void 0;var t=vd();Object.defineProperty(e,`ColumnParser`,{enumerable:!0,get:function(){return t.ColumnParser}});var n=gd();Object.defineProperty(e,`NonQuotedColumnParser`,{enumerable:!0,get:function(){return n.NonQuotedColumnParser}});var r=_d();Object.defineProperty(e,`QuotedColumnParser`,{enumerable:!0,get:function(){return r.QuotedColumnParser}});var i=hd();Object.defineProperty(e,`ColumnFormatter`,{enumerable:!0,get:function(){return i.ColumnFormatter}})})),bd=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.RowParser=void 0;let t=yd(),n=pd();e.RowParser=class{static isEmptyRow(e){return e.join(``).replace(/\s+/g,``)===``}parserOptions;columnParser;constructor(e){this.parserOptions=e,this.columnParser=new t.ColumnParser(e)}parse(e){let{parserOptions:t}=this,{hasMoreData:r}=e,i=e,a=[],o=this.getStartToken(i,a);for(;o;){if(n.Token.isTokenRowDelimiter(o))return i.advancePastToken(o),!i.hasMoreCharacters&&n.Token.isTokenCarriageReturn(o,t)&&r?null:(i.truncateToCursor(),a);if(!this.shouldSkipColumnParse(i,o,a)){let e=this.columnParser.parse(i);if(e===null)return null;a.push(e)}o=i.nextNonSpaceToken}return r?null:(i.truncateToCursor(),a)}getStartToken(e,t){let r=e.nextNonSpaceToken;return r!==null&&n.Token.isTokenDelimiter(r,this.parserOptions)?(t.push(``),e.nextNonSpaceToken):r}shouldSkipColumnParse(e,t,r){let{parserOptions:i}=this;if(n.Token.isTokenDelimiter(t,i)){e.advancePastToken(t);let a=e.nextCharacterToken;if(!e.hasMoreCharacters||a!==null&&n.Token.isTokenRowDelimiter(a)||a!==null&&n.Token.isTokenDelimiter(a,i))return r.push(``),!0}return!1}}})),xd=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Parser=void 0;let t=md(),n=bd(),r=pd();e.Parser=class e{static removeBOM(e){return e&&e.charCodeAt(0)===65279?e.slice(1):e}parserOptions;rowParser;constructor(e){this.parserOptions=e,this.rowParser=new n.RowParser(this.parserOptions)}parse(n,r){let i=new t.Scanner({line:e.removeBOM(n),parserOptions:this.parserOptions,hasMoreData:r});return this.parserOptions.supportsComments?this.parseWithComments(i):this.parseWithoutComments(i)}parseWithoutComments(e){let t=[],n=!0;for(;n;)n=this.parseRow(e,t);return{line:e.line,rows:t}}parseWithComments(e){let{parserOptions:t}=this,n=[];for(let i=e.nextCharacterToken;i!==null;i=e.nextCharacterToken)if(r.Token.isTokenComment(i,t)){if(e.advancePastLine()===null||!e.hasMoreCharacters)return{line:e.lineFromCursor,rows:n};e.truncateToCursor()}else if(!this.parseRow(e,n))break;return{line:e.line,rows:n}}parseRow(e,t){if(!e.nextNonSpaceToken)return!1;let r=this.rowParser.parse(e);return r===null?!1:(this.parserOptions.ignoreEmpty&&n.RowParser.isEmptyRow(r)||t.push(r),!0)}}})),Sd=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.QuotedColumnParser=e.NonQuotedColumnParser=e.ColumnParser=e.Token=e.Scanner=e.RowParser=e.Parser=void 0;var t=xd();Object.defineProperty(e,`Parser`,{enumerable:!0,get:function(){return t.Parser}});var n=bd();Object.defineProperty(e,`RowParser`,{enumerable:!0,get:function(){return n.RowParser}});var r=md();Object.defineProperty(e,`Scanner`,{enumerable:!0,get:function(){return r.Scanner}});var i=pd();Object.defineProperty(e,`Token`,{enumerable:!0,get:function(){return i.Token}});var a=yd();Object.defineProperty(e,`ColumnParser`,{enumerable:!0,get:function(){return a.ColumnParser}}),Object.defineProperty(e,`NonQuotedColumnParser`,{enumerable:!0,get:function(){return a.NonQuotedColumnParser}}),Object.defineProperty(e,`QuotedColumnParser`,{enumerable:!0,get:function(){return a.QuotedColumnParser}})})),Cd=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CsvParserStream=void 0;let t=en(),n=ln(),r=fd(),i=Sd();e.CsvParserStream=class e extends n.Transform{parserOptions;decoder;parser;headerTransformer;rowTransformerValidator;lines=``;rowCount=0;parsedRowCount=0;parsedLineCount=0;endEmitted=!1;headersEmitted=!1;constructor(e){super({objectMode:e.objectMode}),this.parserOptions=e,this.parser=new i.Parser(e),this.headerTransformer=new r.HeaderTransformer(e),this.decoder=new t.StringDecoder(e.encoding),this.rowTransformerValidator=new r.RowTransformerValidator}get hasHitRowLimit(){return this.parserOptions.limitRows&&this.rowCount>=this.parserOptions.maxRows}get shouldEmitRows(){return this.parsedRowCount>this.parserOptions.skipRows}get shouldSkipLine(){return this.parsedLineCount<=this.parserOptions.skipLines}transform(e){return this.rowTransformerValidator.rowTransform=e,this}validate(e){return this.rowTransformerValidator.rowValidator=e,this}emit(e,...t){return e===`end`?(this.endEmitted||(this.endEmitted=!0,super.emit(`end`,this.rowCount)),!1):super.emit(e,...t)}_transform(t,n,r){if(this.hasHitRowLimit)return r();let i=e.wrapDoneCallback(r);try{let{lines:e}=this,n=e+this.decoder.write(t),r=this.parse(n,!0);return this.processRows(r,i)}catch(e){return i(e)}}_flush(t){let n=e.wrapDoneCallback(t);if(this.hasHitRowLimit)return n();try{let e=this.lines+this.decoder.end(),t=this.parse(e,!1);return this.processRows(t,n)}catch(e){return n(e)}}parse(e,t){if(!e)return[];let{line:n,rows:r}=this.parser.parse(e,t);return this.lines=n,r}processRows(e,t){let n=e.length,r=i=>{let a=e=>{if(e)return t(e);if(i%100==0){setImmediate(()=>r(i+1));return}return r(i+1)};if(this.checkAndEmitHeaders(),i>=n||this.hasHitRowLimit)return t();if(this.parsedLineCount+=1,this.shouldSkipLine)return a();let o=e[i];this.rowCount+=1,this.parsedRowCount+=1;let s=this.rowCount;return this.transformRow(o,(e,t)=>{if(e)return--this.rowCount,a(e);if(!t)return a(Error(`expected transform result`));if(!t.isValid)this.emit(`data-invalid`,t.row,s,t.reason);else if(t.row)return this.pushRow(t.row,a);return a()})};r(0)}transformRow(e,t){try{this.headerTransformer.transform(e,(n,r)=>n?t(n):r?r.isValid?r.row?this.shouldEmitRows?this.rowTransformerValidator.transformAndValidate(r.row,t):this.skipRow(t):(--this.rowCount,--this.parsedRowCount,t(null,{row:null,isValid:!0})):this.shouldEmitRows?t(null,{isValid:!1,row:e}):this.skipRow(t):t(Error(`Expected result from header transform`)))}catch(e){t(e)}}checkAndEmitHeaders(){!this.headersEmitted&&this.headerTransformer.headers&&(this.headersEmitted=!0,this.emit(`headers`,this.headerTransformer.headers))}skipRow(e){return--this.rowCount,e(null,{row:null,isValid:!0})}pushRow(e,t){try{this.parserOptions.objectMode?this.push(e):this.push(JSON.stringify(e)),t()}catch(e){t(e)}}static wrapDoneCallback(e){let t=!1;return(n,...r)=>{if(n){if(t)throw n;t=!0,e(n);return}e(...r)}}}})),wd=c((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),e.parseString=e.parseFile=e.parseStream=e.parse=e.ParserOptions=e.CsvParserStream=void 0;let a=r((Xi(),f(Ji))),o=ln(),s=ad(),c=Cd();i(od(),e);var l=Cd();Object.defineProperty(e,`CsvParserStream`,{enumerable:!0,get:function(){return l.CsvParserStream}});var u=ad();Object.defineProperty(e,`ParserOptions`,{enumerable:!0,get:function(){return u.ParserOptions}}),e.parse=e=>new c.CsvParserStream(new s.ParserOptions(e)),e.parseStream=(e,t)=>e.pipe(new c.CsvParserStream(new s.ParserOptions(t))),e.parseFile=(e,t={})=>a.createReadStream(e).pipe(new c.CsvParserStream(new s.ParserOptions(t))),e.parseString=(e,t)=>{let n=new o.Readable;return n.push(e),n.push(null),n.pipe(new c.CsvParserStream(new s.ParserOptions(t)))}})),Td=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CsvParserStream=e.ParserOptions=e.parseFile=e.parseStream=e.parseString=e.parse=e.FormatterOptions=e.CsvFormatterStream=e.writeToPath=e.writeToString=e.writeToBuffer=e.writeToStream=e.write=e.format=void 0;var t=id();Object.defineProperty(e,`format`,{enumerable:!0,get:function(){return t.format}}),Object.defineProperty(e,`write`,{enumerable:!0,get:function(){return t.write}}),Object.defineProperty(e,`writeToStream`,{enumerable:!0,get:function(){return t.writeToStream}}),Object.defineProperty(e,`writeToBuffer`,{enumerable:!0,get:function(){return t.writeToBuffer}}),Object.defineProperty(e,`writeToString`,{enumerable:!0,get:function(){return t.writeToString}}),Object.defineProperty(e,`writeToPath`,{enumerable:!0,get:function(){return t.writeToPath}}),Object.defineProperty(e,`CsvFormatterStream`,{enumerable:!0,get:function(){return t.CsvFormatterStream}}),Object.defineProperty(e,`FormatterOptions`,{enumerable:!0,get:function(){return t.FormatterOptions}});var n=wd();Object.defineProperty(e,`parse`,{enumerable:!0,get:function(){return n.parse}}),Object.defineProperty(e,`parseString`,{enumerable:!0,get:function(){return n.parseString}}),Object.defineProperty(e,`parseStream`,{enumerable:!0,get:function(){return n.parseStream}}),Object.defineProperty(e,`parseFile`,{enumerable:!0,get:function(){return n.parseFile}}),Object.defineProperty(e,`ParserOptions`,{enumerable:!0,get:function(){return n.ParserOptions}}),Object.defineProperty(e,`CsvParserStream`,{enumerable:!0,get:function(){return n.CsvParserStream}})})),Ed=c(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_customParseFormat=r()})(e,(function(){"use strict";var e={LTS:`h:mm:ss A`,LT:`h:mm A`,L:`MM/DD/YYYY`,LL:`MMMM D, YYYY`,LLL:`MMMM D, YYYY h:mm A`,LLLL:`dddd, MMMM D, YYYY h:mm A`},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,r=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)},c=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||={}).offset=function(e){if(!e||e===`Z`)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return n===0?0:t[0]===`+`?-n:n}(e)}],u=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?`pm`:`PM`);return n},f={A:[a,function(e){this.afternoon=d(e,!1)}],a:[a,function(e){this.afternoon=d(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*e}],SS:[r,function(e){this.milliseconds=10*e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[i,c(`seconds`)],ss:[i,c(`seconds`)],m:[i,c(`minutes`)],mm:[i,c(`minutes`)],H:[i,c(`hours`)],h:[i,c(`hours`)],HH:[i,c(`hours`)],hh:[i,c(`hours`)],D:[i,c(`day`)],DD:[r,c(`day`)],Do:[a,function(e){var t=o.ordinal;if(this.day=e.match(/\d+/)[0],t)for(var n=1;n<=31;n+=1)t(n).replace(/\[|\]/g,``)===e&&(this.day=n)}],w:[i,c(`week`)],ww:[r,c(`week`)],M:[i,c(`month`)],MM:[r,c(`month`)],MMM:[a,function(e){var t=u(`months`),n=(u(`monthsShort`)||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw Error();this.month=n%12||n}],MMMM:[a,function(e){var t=u(`months`).indexOf(e)+1;if(t<1)throw Error();this.month=t%12||t}],Y:[/[+-]?\d+/,c(`year`)],YY:[r,function(e){this.year=s(e)}],YYYY:[/\d{4}/,c(`year`)],Z:l,ZZ:l};function p(n){for(var r=n,i=o&&o.formats,a=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var a=r&&r.toUpperCase();return n||i[r]||e[r]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),s=a.length,c=0;c<s;c+=1){var l=a[c],u=f[l],d=u&&u[0],p=u&&u[1];a[c]=p?{regex:d,parser:p}:l.replace(/^\[|\]$/g,``)}return function(e){for(var t={},n=0,r=0;n<s;n+=1){var i=a[n];if(typeof i==`string`)r+=i.length;else{var o=i.regex,c=i.parser,l=e.slice(r),u=o.exec(l)[0];c.call(t,u),e=e.replace(u,``)}}return function(e){var t=e.afternoon;if(t!==void 0){var n=e.hours;t?n<12&&(e.hours+=12):n===12&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,a=e.args;this.$u=r;var s=a[1];if(typeof s==`string`){var c=!0===a[2],l=!0===a[3],u=c||l,d=a[2];l&&(d=a[2]),o=this.$locale(),!c&&d&&(o=n.Ls[d]),this.$d=function(e,t,n,r){try{if([`x`,`X`].indexOf(t)>-1)return new Date((t===`X`?1e3:1)*e);var i=p(t)(e),a=i.year,o=i.month,s=i.day,c=i.hours,l=i.minutes,u=i.seconds,d=i.milliseconds,f=i.zone,m=i.week,h=new Date,g=s||(a||o?1:h.getDate()),_=a||h.getFullYear(),v=0;a&&!o||(v=o>0?o-1:h.getMonth());var y,b=c||0,x=l||0,S=u||0,C=d||0;return f?new Date(Date.UTC(_,v,g,b,x,S,C+60*f.offset*1e3)):n?new Date(Date.UTC(_,v,g,b,x,S,C)):(y=new Date(_,v,g,b,x,S,C),m&&(y=r(y).week(m).toDate()),y)}catch{return new Date(``)}}(t,s,r,n),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(s)&&(this.$d=new Date(``)),o={}}else if(s instanceof Array)for(var f=s.length,m=1;m<=f;m+=1){a[1]=s[m-1];var h=n.apply(this,a);if(h.isValid()){this.$d=h.$d,this.$L=h.$L,this.init();break}m===f&&(this.$d=new Date(``))}else i.call(this,e)}}}))})),Dd=c(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_utc=r()})(e,(function(){"use strict";var e=`minute`,t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,i,a){var o=i.prototype;a.utc=function(e){return new i({date:e,utc:!0,args:arguments})},o.utc=function(t){var n=a(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},o.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var s=o.parse;o.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var c=o.init;o.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else c.call(this)};var l=o.utcOffset;o.utcOffset=function(r,i){var a=this.$utils().u;if(a(r))return this.$u?0:a(this.$offset)?l.call(this):this.$offset;if(typeof r==`string`&&(r=function(e){e===void 0&&(e=``);var r=e.match(t);if(!r)return null;var i=(``+r[0]).match(n)||[`-`,0,0],a=i[0],o=60*i[1]+ +i[2];return o===0?0:a===`+`?o:-o}(r),r===null))return this;var o=Math.abs(r)<=16?60*r:r;if(o===0)return this.utc(i);var s=this.clone();if(i)return s.$offset=o,s.$u=!1,s;var c=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(s=this.local().add(o+c,e)).$offset=o,s.$x.$localOffset=c,s};var u=o.format;o.format=function(e){var t=e||(this.$u?`YYYY-MM-DDTHH:mm:ss[Z]`:``);return u.call(this,t)},o.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var d=o.toDate;o.toDate=function(e){return e===`s`&&this.$offset?a(this.format(`YYYY-MM-DD HH:mm:ss:SSS`)).toDate():d.call(this)};var f=o.diff;o.diff=function(e,t,n){if(e&&this.$u===e.$u)return f.call(this,e,t,n);var r=this.local(),i=a(e).local();return f.call(r,i,t,n)}}}))})),Od=c(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){"use strict";var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),D=E.prototype;return w.prototype=D,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){D[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,E,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))}));Xi();var kd=Td(),Ad=d(Ed(),1),jd=d(Dd(),1),Md=d(Od(),1);let Nd={true:!0,false:!1,"#N/A":{error:`#N/A`},"#REF!":{error:`#REF!`},"#NAME?":{error:`#NAME?`},"#DIV/0!":{error:`#DIV/0!`},"#NULL!":{error:`#NULL!`},"#VALUE!":{error:`#VALUE!`},"#NUM!":{error:`#NUM!`}};Md.default.extend(Ad.default),Md.default.extend(jd.default);var Pd=class{constructor(e){this.workbook=e,this.worksheet=null}async readFile(e,t){if(t||={},!await oa(e))throw Error(`File not found: ${e}`);let n=Yi.createReadStream(e);try{let e=await this.read(n,t);return n.close(),e}catch(e){throw n.close(),e}}read(e,t){return t||={},new Promise((n,r)=>{let i=this.workbook.addWorksheet(t.sheetName),a=t.dateFormats||[`YYYY-MM-DD[T]HH:mm:ssZ`,`YYYY-MM-DD[T]HH:mm:ss`,`MM-DD-YYYY`,`YYYY-MM-DD`],o=t.map||function(e){if(e===``)return null;let t=Number(e);if(!Number.isNaN(t)&&t!==1/0)return t;let n=a.reduce((t,n)=>{if(t)return t;let r=(0,Md.default)(e,n,!0);return r.isValid()?r:null},null);if(n)return new Date(n.valueOf());let r=Nd[e];return r===void 0?e:r},s=e=>{i.addRow(e.map(o))},c=()=>{f.emit(`worksheet`,i)},l=()=>{f.removeListener(`data`,s),f.removeListener(`end`,c),f.removeListener(`worksheet`,u),f.removeListener(`error`,d)},u=e=>{l(),n(e)},d=e=>{l(),r(e)},f=(0,kd.parse)(t.parserOptions).on(`data`,s).on(`end`,c);f.once(`worksheet`,u).on(`error`,d),e.pipe(f)})}write(e,t){return new Promise((n,r)=>{t||={};let i=this.workbook.getWorksheet(t.sheetName||t.sheetId),a=(0,kd.format)(t.formatterOptions),o=()=>{e.removeListener(`finish`,s),a.removeListener(`error`,c)},s=()=>{o(),n()},c=e=>{o(),r(e)};e.once(`finish`,s),a.on(`error`,c),a.pipe(e);let{dateFormat:l,dateUTC:u}=t,d=t.map||(e=>{if(e){if(e.text||e.hyperlink)return e.hyperlink||e.text||``;if(e.formula||e.result)return e.result||``;if(e instanceof Date)return l?u?Md.default.utc(e).format(l):(0,Md.default)(e).format(l):u?Md.default.utc(e).format():(0,Md.default)(e).format();if(e.error)return e.error;if(typeof e==`object`)return JSON.stringify(e)}return e}),f=t.includeEmptyRows===void 0||t.includeEmptyRows,p=1;i&&i.eachRow((e,t)=>{if(f)for(;p++<t-1;)a.write([]);let{values:n}=e;n.shift(),a.write(n.map(d)),p=t}),a.end()})}writeFile(e,t){t||={};let n={encoding:t.encoding||`utf8`},r=Yi.createWriteStream(e,n);return this.write(r,t)}async writeBuffer(e){let t=new xs;return await this.write(t,e),t.read()}},Fd=class{constructor(){this.category=``,this.company=``,this.created=new Date,this.description=``,this.keywords=``,this.manager=``,this.modified=this.created,this.properties={},this.calcProperties={},this._worksheets=[],this.subject=``,this.title=``,this.views=[],this.media=[],this.pivotTables=[],this._definedNames=new Ta}get xlsx(){return this._xlsx||=new qu(this),this._xlsx}get csv(){return this._csv||=new Pd(this),this._csv}get nextId(){for(let e=1;e<this._worksheets.length;e++)if(!this._worksheets[e])return e;return this._worksheets.length||1}addWorksheet(e,t){let n=this.nextId,r=this._worksheets.reduce((e,t)=>(t&&t.orderNo)>e?t.orderNo:e,0),i=new ba({...t,id:n,name:e,orderNo:r+1,workbook:this});return this._worksheets[n]=i,i}removeWorksheetEx(e){delete this._worksheets[e.id]}removeWorksheet(e){let t=this.getWorksheet(e);t&&t.destroy()}getWorksheet(e){if(e===void 0)return this._worksheets.find(Boolean);if(typeof e==`number`)return this._worksheets[e];if(typeof e==`string`)return this._worksheets.find(t=>t&&t.name===e)}get worksheets(){return this._worksheets.slice(1).sort((e,t)=>e.orderNo-t.orderNo).filter(Boolean)}eachSheet(e){this.worksheets.forEach(t=>{e(t,t.id)})}get definedNames(){return this._definedNames}clearThemes(){this._themes=void 0}addImage(e){let t=this.media.length;return this.media.push({...e,type:`image`}),t}getImage(e){return this.media[Number(e)]}get model(){return{creator:this.creator||`Unknown`,lastModifiedBy:this.lastModifiedBy||`Unknown`,lastPrinted:this.lastPrinted,created:this.created,modified:this.modified,properties:this.properties,worksheets:this.worksheets.map(e=>e.model),sheets:this.worksheets.map(e=>e.model).filter(Boolean),definedNames:this._definedNames.model,views:this.views,company:this.company,manager:this.manager,title:this.title,subject:this.subject,keywords:this.keywords,category:this.category,description:this.description,language:this.language,revision:this.revision,contentStatus:this.contentStatus,themes:this._themes,media:this.media,pivotTables:this.pivotTables,calcProperties:this.calcProperties}}set model(e){this.creator=e.creator,this.lastModifiedBy=e.lastModifiedBy,this.lastPrinted=e.lastPrinted,this.created=e.created,this.modified=e.modified,this.company=e.company,this.manager=e.manager,this.title=e.title,this.subject=e.subject,this.keywords=e.keywords,this.category=e.category,this.description=e.description,this.language=e.language,this.revision=e.revision,this.contentStatus=e.contentStatus,this.properties=e.properties,this.calcProperties=e.calcProperties,this._worksheets=[],e.worksheets.forEach(t=>{let{id:n,name:r,state:i}=t,a=e.sheets&&e.sheets.findIndex(e=>e.id===n),o=this._worksheets[n]=new ba({id:n,name:r,orderNo:a===-1?void 0:a,state:i,workbook:this});o.model=t}),this._definedNames.model=e.definedNames,this.views=e.views,this._themes=e.themes,this.media=e.media||[],this.pivotTables=e.pivotTables||[]}};let Id=function(e){return e[e.Legal=5]=`Legal`,e[e.Executive=7]=`Executive`,e[e.A4=9]=`A4`,e[e.A5=11]=`A5`,e[e.B5=13]=`B5`,e[e.Envelope_10=20]=`Envelope_10`,e[e.Envelope_DL=27]=`Envelope_DL`,e[e.Envelope_C5=28]=`Envelope_C5`,e[e.Envelope_B5=34]=`Envelope_B5`,e[e.Envelope_Monarch=37]=`Envelope_Monarch`,e[e.Double_Japan_Postcard_Rotated=82]=`Double_Japan_Postcard_Rotated`,e[e.K16_197x273_mm=119]=`K16_197x273_mm`,e}({});function Ld(e,t){let n=Math.round(e).toString();for(;n.length<t;)n=`0`+n;return n}function Rd(e){if(e.length<=3)return e;let t=e.length%3,n=e.substring(0,t);for(let r=t;r<e.length;r+=3)n+=(n.length>0?`,`:``)+e.substring(r,r+3);return n}function zd(e,t){let n=10**t;return Math.round(e*n)/n}function Bd(e){let t=e.replace(/_./g,` `);return t=t.replace(/\*./g,``),t}function Vd(e){return/^General$/i.test(e.trim())}function Hd(e){let t=e.replace(/\[[^\]]*\]/g,``);return/[ymdhs]/i.test(t)&&!/^[#0.,E%$\s()\-+]+$/i.test(t)}let Ud=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],Wd=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],Gd=[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],Kd=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],qd=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`];function Jd(e,t){let n=Math.round(e*86400)%86400,r=Math.floor(n/3600),i=Math.floor(n%3600/60),a=n%60,o=ea(e,!1),s=o.getUTCFullYear(),c=o.getUTCMonth(),l=o.getUTCDate(),u=o.getUTCDay(),d=e*86400-Math.floor(e*86400),f=/AM\/PM|A\/P/i.test(t),p=r>=12,m=r%12||12,h=t.replace(/\[(Red|Green|Blue|Yellow|Magenta|Cyan|White|Black|Color\d+)\]/gi,``);h=Bd(h);let g=h.match(/ss\.(0+)/i),_=``;if(g){let e=g[1].length;_=Math.round(d*10**e).toString().padStart(e,`0`),h=h.replace(/ss\.0+/gi,`\0SF\0`)}h=h.replace(/yyyy/gi,`\0Y4\0`),h=h.replace(/yy/gi,`\0Y2\0`),h=h.replace(/mmmmm/gi,`\0MN5\0`),h=h.replace(/mmmm/gi,`\0MN4\0`),h=h.replace(/mmm/gi,`\0MN3\0`),h=h.replace(/dddd/gi,`\0DN4\0`),h=h.replace(/ddd/gi,`\0DN3\0`),h=h.replace(/dd/gi,`\0D2\0`),h=h.replace(/\bd\b/gi,`\0D1\0`),h=h.replace(/hh/gi,`\0H2\0`),h=h.replace(/\bh\b/gi,`\0H1\0`),h=h.replace(/ss/gi,`\0S2\0`),h=h.replace(/\bs\b/gi,`\0S1\0`),h=/\x00H[12]\x00.*mm|mm.*\x00S[12]\x00/i.test(h)?h.replace(/mm/gi,`\0MI2\0`):h.replace(/mm/gi,`\0M2\0`),h=h.replace(/\bm\b/gi,`\0M1\0`),h=h.replace(/AM\/PM/gi,`\0AMPM\0`),h=h.replace(/A\/P/gi,`\0AP\0`);let v=f?m:r;return h=h.replace(/\x00Y4\x00/g,s.toString()).replace(/\x00Y2\x00/g,(s%100).toString().padStart(2,`0`)).replace(/\x00MN5\x00/g,Gd[c]).replace(/\x00MN4\x00/g,Wd[c]).replace(/\x00MN3\x00/g,Ud[c]).replace(/\x00M2\x00/g,(c+1).toString().padStart(2,`0`)).replace(/\x00M1\x00/g,(c+1).toString()).replace(/\x00DN4\x00/g,qd[u]).replace(/\x00DN3\x00/g,Kd[u]).replace(/\x00D2\x00/g,l.toString().padStart(2,`0`)).replace(/\x00D1\x00/g,l.toString()).replace(/\x00H2\x00/g,v.toString().padStart(2,`0`)).replace(/\x00H1\x00/g,v.toString()).replace(/\x00MI2\x00/g,i.toString().padStart(2,`0`)).replace(/\x00S2\x00/g,a.toString().padStart(2,`0`)).replace(/\x00S1\x00/g,a.toString()).replace(/\x00SF\x00/g,a.toString().padStart(2,`0`)+`.`+_).replace(/\x00AMPM\x00/g,p?`PM`:`AM`).replace(/\x00AP\x00/g,p?`P`:`A`),h=h.replace(/\\/g,``),h}function Yd(e){return typeof e==`boolean`?e?`TRUE`:`FALSE`:typeof e==`string`?e:Number.isInteger(e)?e.toString():e.toPrecision(11).replace(/\.?0+$/,``).replace(/\.?0+e/,`e`)}function Xd(e,t){let n=(t.match(/%/g)||[]).length;return tf(e*100**n,t.replace(/%/g,``)||`0`)+`%`.repeat(n)}function Zd(e,t){let n=e<0?`-`:``,r=Math.abs(e);if(r===0){let e=t.match(/\.([0#]+)E/i),n=e?e[1].length:2;return`0.`+`0`.repeat(n)+`E+00`}let i=t.match(/\.([0#]+)E/i),a=i?i[1].length:2,o=t.includes(`E+`),s=Math.floor(Math.log10(r)),c=zd(r/10**s,a).toFixed(a),l=s>=0?o?`+`:``:`-`,u=Ld(Math.abs(s),2);return n+c+`E`+l+u}function Qd(e,t){let n=e<0?-1:1,r=Math.abs(e),i=Math.floor(r);if(r-=i,r<1e-10)return[n*i,0,1];let a=0,o=1,s=1,c=0,l=Math.floor(r),u=l,d=1;for(;c<t&&(l=Math.floor(r),u=l*o+a,d=l*c+s,!(r-l<1e-10));)r=1/(r-l),a=o,o=u,s=c,c=d;return d>t&&(d=c,u=o),[n*i,n*u,d]}function $d(e,t){let n=e<0?`-`:``,r=Math.abs(e),i=t.match(/\?+\s*\/\s*(\d+)/);if(i){let e=parseInt(i[1],10),a=Math.floor(r),o=r-a,s=Math.round(o*e);return t.includes(`#`)||t.includes(`0`)?s===0?n+a.toString():n+(a>0?a+` `:``)+s+`/`+e:n+(a*e+s)+`/`+e}let a=t.match(/\/\s*(\?+)/),[o,s,c]=Qd(r,10**(a?a[1].length:2)-1);return t.includes(`#`)&&o!==0?s===0?n+Math.abs(o).toString():n+Math.abs(o)+` `+Math.abs(s)+`/`+c:s===0?o===0?`0`:n+Math.abs(o).toString():n+(Math.abs(o)*c+Math.abs(s))+`/`+c}function ef(e,t){let n=Math.round(e*86400),r=Math.floor(n/60),i=Math.floor(r/60),a=n%60,o=r%60,s=i,c=t;return/\[h+\]/i.test(c)&&(c=c.replace(/\[h+\]/gi,s.toString())),/\[m+\]/i.test(c)&&(c=c.replace(/\[m+\]/gi,r.toString())),/\[s+\]/i.test(c)&&(c=c.replace(/\[s+\]/gi,n.toString())),c=c.replace(/mm/gi,o.toString().padStart(2,`0`)),c=c.replace(/ss/gi,a.toString().padStart(2,`0`)),c}function tf(e,t){let n=Math.abs(e),r=e<0?`-`:``,i=0,a=t;for(;a.endsWith(`,`);)i++,a=a.slice(0,-1);let o=n/1e3**i,s=a.indexOf(`.`),c=a,l=``;s!==-1&&(c=a.substring(0,s),l=a.substring(s+1));let u=l.replace(/[^0#?]/g,``).length,[d,f=``]=zd(o,u).toString().split(`.`),p=/[0#?][^0#?,.\s][0#?]/.test(c),m;if(p){let e=c.replace(/[^0#?]/g,``).length,t=d;t.length<e&&(t=`0`.repeat(e-t.length)+t),m=``;let n=t.length-e;for(let e=0;e<c.length;e++){let r=c[e];r===`0`||r===`#`||r===`?`?n<t.length&&(m+=t[n],n++):r!==`,`&&(m+=r)}}else{m=d,c.includes(`,`)&&(m=Rd(d));let e=(c.match(/0/g)||[]).length;m.length<e&&(m=`0`.repeat(e-m.length)+m)}let h=``;return u>0&&(h=`.`+(f+`0`.repeat(u)).substring(0,u)),r+m+h}function nf(e){let t=``,n=0;for(;n<e.length;)if(e[n]===`"`){for(n++;n<e.length&&e[n]!==`"`;)t+=e[n],n++;n++}else e[n]===`\\`&&n+1<e.length?(n++,t+=e[n],n++):(t+=e[n],n++);return t}function rf(e,t){let n=t.match(/\[(=|>|<|>=|<=|<>)(-?\d+(?:\.\d*)?)\]/);if(!n)return!1;let r=n[1],i=parseFloat(n[2]);switch(r){case`=`:return e===i;case`>`:return e>i;case`<`:return e<i;case`>=`:return e>=i;case`<=`:return e<=i;case`<>`:return e!==i;default:return!1}}function af(e,t){if(typeof t==`string`){let n=sf(e);return n.length>=4&&n[3]?nf(n[3]).replace(/@/g,t):t}if(typeof t==`boolean`)return t?`TRUE`:`FALSE`;let n=sf(e),r=/\[(=|>|<|>=|<=|<>)-?\d+(?:\.\d*)?\]/;if((n[0]&&r.test(n[0])||n[1]&&r.test(n[1]))&&n.length>=2){for(let e=0;e<Math.min(n.length,2);e++){let r=n[e].match(/\[(=|>|<|>=|<=|<>)-?\d+(?:\.\d*)?\]/);if(r&&rf(t,r[0]))return n[e]}return n[n.length>2?2:1]}return n.length===1?n[0]:n.length===2?t>=0?n[0]:n[1]:t>0?n[0]:t<0?n[1]:n[2]||n[0]}function of(e,t){let n=sf(e);return n.length>=2&&n[1]===t}function sf(e){let t=[],n=``,r=!1,i=!1;for(let a=0;a<e.length;a++){let o=e[a];o===`"`&&!i?(r=!r,n+=o):o===`[`&&!r?(i=!0,n+=o):o===`]`&&!r?(i=!1,n+=o):o===`;`&&!r&&!i?(t.push(n),n=``):n+=o}return t.push(n),t}function cf(e,t){if(t==null)return``;if(Vd(e))return Yd(t);if(typeof t==`string`)return af(e,t);if(typeof t==`boolean`)return t?`TRUE`:`FALSE`;let n=t,r=af(e,n);n<0&&of(e,r)&&(n=Math.abs(n));let i=r.replace(/\[(Red|Green|Blue|Yellow|Magenta|Cyan|White|Black|Color\d+)\]/gi,``);if(i=i.replace(/\[(>|<|>=|<=|=|<>)-?\d+(\.\d+)?\]/g,``),i=i.replace(/\[\$[^\]]*\]/g,``),i=Bd(i),i=nf(i),/\[[hms]+\]/i.test(i))return ef(n,i);if(Hd(i))return Jd(n,i);if(i.includes(`%`))return Xd(n,i);if(/E[+-]?/i.test(i))return Zd(n,i);if(/\?+\s*\/\s*[\d?]+/.test(i))return $d(n,i);if(i.includes(`(`)&&i.includes(`)`)&&n<0){let e=i.replace(/\(|\)/g,``);return`(`+tf(-n,e)+`)`}if(i===`@`)return n.toString();let a=``,o=``,s=i.match(/^([^#0?.,]+)/);s&&(a=s[1],i=i.substring(s[0].length));let c=i.match(/([^#0?.,]+)$/);c&&!c[1].includes(`%`)&&(o=c[1],i=i.substring(0,i.length-c[0].length));let l=tf(n,i);return a+l+o}function lf(e){return e.getTime()/(24*3600*1e3)+25569}function uf(e){let t=e.replace(/"[^"]*"/g,``);if(/\[[hms]\]/i.test(t))return!1;let n=t.replace(/\[[^\]]*\]/g,``),r=/[hs]/i.test(n)||/AM\/PM|A\/P/i.test(n);return/[yd]/i.test(n)||/m/i.test(n)&&!r?!1:r}function df(e){let t=e.replace(/"[^"]*"/g,``);if(/\[[hms]\]/i.test(t))return!1;let n=t.replace(/\[[^\]]*\]/g,``);return!!(/[yd]/i.test(n)||/m/i.test(n)&&!(/[hs]/i.test(n)||/AM\/PM|A\/P/i.test(n)))}function ff(e,t,n){if(e instanceof Date){let r=lf(e);return uf(t)?(r%=1,r<0&&(r+=1),cf(t,r)):cf(n&&df(t)?n:t,r)}return cf(t,e)}function pf(e,t){let n=e.value,r=e.numFmt,i=typeof r==`string`?r:r?.formatCode??`General`;if(n==null)return``;if(n instanceof Date||typeof n==`number`||typeof n==`boolean`||typeof n==`string`)return ff(n,i,t);if(typeof n==`object`&&`formula`in n){let e=n.result;if(e==null)return``;if(e instanceof Date||typeof e==`number`||typeof e==`boolean`||typeof e==`string`)return ff(e,i,t)}return e.text}function mf(e){return m.l2n(e.toUpperCase())-1}function hf(e){return m.n2l(e+1)}function gf(e){return parseInt(e,10)-1}function _f(e){return String(e+1)}function vf(e){let t=m.decodeAddress(e.toUpperCase());return{c:t.col-1,r:t.row-1}}function yf(e){return m.encodeAddress(e.r+1,e.c+1)}function bf(e){let t=e.indexOf(`:`);if(t===-1){let t=vf(e);return{s:t,e:{...t}}}return{s:vf(e.slice(0,t)),e:vf(e.slice(t+1))}}function xf(e,t){if(t===void 0){let t=e;return xf(t.s,t.e)}let n=yf(e),r=yf(t);return n===r?n:`${n}:${r}`}function Sf(e,t){let n=t||{},r=new Fd().addWorksheet(`Sheet1`);if(e.length===0)return r;let i=new Set;e.forEach(e=>Object.keys(e).forEach(e=>i.add(e)));let a=n.header?[...n.header]:[...i];n.header&&i.forEach(e=>{a.includes(e)||a.push(e)});let o=1;n.skipHeader||(a.forEach((e,t)=>{r.getCell(o,t+1).value=e}),o++);for(let t of e)a.forEach((e,i)=>{let a=t[e];a===null&&n.nullError?r.getCell(o,i+1).value={error:`#NULL!`}:a!=null&&(r.getCell(o,i+1).value=a)}),o++;return r}function Cf(e,t,n){let r=n||{};if(t.length===0)return e;let i=1,a=1;if(r.origin!==void 0)if(typeof r.origin==`string`){let e=vf(r.origin);i=e.r+1,a=e.c+1}else typeof r.origin==`number`?i=r.origin===-1?e.rowCount+1:r.origin+1:(i=r.origin.r+1,a=r.origin.c+1);let o=new Set;t.forEach(e=>Object.keys(e).forEach(e=>o.add(e)));let s=r.header?[...r.header]:[...o];r.header&&o.forEach(e=>{s.includes(e)||s.push(e)});let c=i;r.skipHeader||(s.forEach((t,n)=>{e.getCell(c,a+n).value=t}),c++);for(let n of t)s.forEach((t,i)=>{let o=n[t];o===null&&r.nullError?e.getCell(c,a+i).value={error:`#NULL!`}:o!=null&&(e.getCell(c,a+i).value=o)}),c++;return e}function wf(e,t){let n=t||{},r=1,i=e.rowCount,a=1,o=e.columnCount;if(n.range!==void 0){if(typeof n.range==`number`)r=n.range+1;else if(typeof n.range==`string`){let e=bf(n.range);r=e.s.r+1,i=e.e.r+1,a=e.s.c+1,o=e.e.c+1}}if(i<r||o<a)return[];let s=n.header;if(s===1){let t=[],s=n.blankrows!==!1;for(let c=r;c<=i;c++){let r=[],i=!0;for(let t=a;t<=o;t++){let o=e.getCell(c,t),s=n.raw===!1?pf(o,n.dateFormat).trim():o.value;s!=null&&s!==``?(r[t-a]=s,i=!1):n.defval===void 0?r[t-a]=null:r[t-a]=n.defval}(!i||s)&&t.push(r)}return t}if(s===`A`){let t=[],s=n.blankrows===!0;for(let c=r;c<=i;c++){let r={},i=!0;for(let t=a;t<=o;t++){let a=e.getCell(c,t),o=n.raw===!1?pf(a,n.dateFormat).trim():a.value,s=hf(t-1);o!=null&&o!==``?(r[s]=o,i=!1):n.defval!==void 0&&(r[s]=n.defval)}(!i||s)&&t.push(r)}return t}if(Array.isArray(s)){let t=[],c=n.blankrows===!0;for(let l=r;l<=i;l++){let r={},i=!0;for(let t=a;t<=o;t++){let o=t-a,c=s[o]??`__EMPTY_${o}`,u=e.getCell(l,t),d=n.raw===!1?pf(u,n.dateFormat).trim():u.value;d!=null&&d!==``?(r[c]=d,i=!1):n.defval!==void 0&&(r[c]=n.defval)}(!i||c)&&t.push(r)}return t}let c=[],l={};for(let t=a;t<=o;t++){let n=e.getCell(r,t).value,i=n==null?`__EMPTY_${t-a}`:String(n);l[i]===void 0?l[i]=0:(l[i]++,i=`${i}_${l[i]}`),c.push(i)}let u=[],d=r+1,f=n.blankrows===!0;for(let t=d;t<=i;t++){let r={},i=!0;for(let s=a;s<=o;s++){let o=e.getCell(t,s),l=n.raw===!1?pf(o,n.dateFormat).trim():o.value,u=c[s-a];l!=null&&l!==``?(r[u]=l,i=!1):n.defval!==void 0&&(r[u]=n.defval)}(!i||f)&&u.push(r)}return u}function Tf(e,t){let n=t||{},r=n.FS??`,`,i=n.RS??`
205
+ `}static isTokenCarriageReturn(e,t){return e.token===t.carriageReturn}static isTokenComment(e,t){return t.supportsComments&&!!e&&e.token===t.comment}static isTokenEscapeCharacter(e,t){return e.token===t.escapeChar}static isTokenQuote(e,t){return e.token===t.quote}static isTokenDelimiter(e,t){return e.token===t.delimiter}token;startCursor;endCursor;constructor(e){this.token=e.token,this.startCursor=e.startCursor,this.endCursor=e.endCursor}}})),dd=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Scanner=void 0;let t=ud(),n=/((?:\r\n)|\n|\r)/;e.Scanner=class{line;parserOptions;lineLength;hasMoreData;cursor=0;constructor(e){this.line=e.line,this.lineLength=this.line.length,this.parserOptions=e.parserOptions,this.hasMoreData=e.hasMoreData,this.cursor=e.cursor||0}get hasMoreCharacters(){return this.lineLength>this.cursor}get nextNonSpaceToken(){let{lineFromCursor:e}=this,n=this.parserOptions.NEXT_TOKEN_REGEXP;if(e.search(n)===-1)return null;let r=n.exec(e);if(r==null)return null;let i=r[1],a=this.cursor+(r.index||0);return new t.Token({token:i,startCursor:a,endCursor:a+i.length-1})}get nextCharacterToken(){let{cursor:e,lineLength:n}=this;return n<=e?null:new t.Token({token:this.line[e],startCursor:e,endCursor:e})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){let e=n.exec(this.lineFromCursor);return e?(this.cursor+=(e.index||0)+e[0].length,this):this.hasMoreData?null:(this.cursor=this.lineLength,this)}advanceTo(e){return this.cursor=e,this}advanceToToken(e){return this.cursor=e.startCursor,this}advancePastToken(e){return this.cursor=e.endCursor+1,this}truncateToCursor(){return this.line=this.lineFromCursor,this.lineLength=this.line.length,this.cursor=0,this}}})),fd=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ColumnFormatter=void 0,e.ColumnFormatter=class{format;constructor(e){e.trim?this.format=e=>e.trim():e.ltrim?this.format=e=>e.trimLeft():e.rtrim?this.format=e=>e.trimRight():this.format=e=>e}}})),pd=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.NonQuotedColumnParser=void 0;let t=fd(),n=ud();e.NonQuotedColumnParser=class{parserOptions;columnFormatter;constructor(e){this.parserOptions=e,this.columnFormatter=new t.ColumnFormatter(e)}parse(e){if(!e.hasMoreCharacters)return null;let{parserOptions:t}=this,r=[],i=e.nextCharacterToken;for(;i&&!(n.Token.isTokenDelimiter(i,t)||n.Token.isTokenRowDelimiter(i));i=e.nextCharacterToken)r.push(i.token),e.advancePastToken(i);return this.columnFormatter.format(r.join(``))}}})),md=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.QuotedColumnParser=void 0;let t=fd(),n=ud();e.QuotedColumnParser=class{parserOptions;columnFormatter;constructor(e){this.parserOptions=e,this.columnFormatter=new t.ColumnFormatter(e)}parse(e){if(!e.hasMoreCharacters)return null;let t=e.cursor,{foundClosingQuote:n,col:r}=this.gatherDataBetweenQuotes(e);if(!n){if(e.advanceTo(t),!e.hasMoreData)throw Error(`Parse Error: missing closing: '${this.parserOptions.quote||``}' in line: at '${e.lineFromCursor.replace(/[\r\n]/g,`\\n'`)}'`);return null}return this.checkForMalformedColumn(e),r}gatherDataBetweenQuotes(e){let{parserOptions:t}=this,r=!1,i=!1,a=[],o=e.nextCharacterToken;for(;!i&&o!==null;o=e.nextCharacterToken){let s=n.Token.isTokenQuote(o,t);if(!r&&s)r=!0;else if(r)if(n.Token.isTokenEscapeCharacter(o,t)){e.advancePastToken(o);let r=e.nextCharacterToken;r!==null&&(n.Token.isTokenQuote(r,t)||n.Token.isTokenEscapeCharacter(r,t))?(a.push(r.token),o=r):s?i=!0:a.push(o.token)}else s?i=!0:a.push(o.token);e.advancePastToken(o)}return{col:this.columnFormatter.format(a.join(``)),foundClosingQuote:i}}checkForMalformedColumn(e){let{parserOptions:t}=this,{nextNonSpaceToken:r}=e;if(r){let i=n.Token.isTokenDelimiter(r,t),a=n.Token.isTokenRowDelimiter(r);if(!(i||a)){let n=e.lineFromCursor.substr(0,10).replace(/[\r\n]/g,`\\n'`);throw Error(`Parse Error: expected: '${t.escapedDelimiter}' OR new line got: '${r.token}'. at '${n}'`)}e.advanceToToken(r)}else e.hasMoreData||e.advancePastLine()}}})),hd=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ColumnParser=void 0;let t=pd(),n=md(),r=ud();e.ColumnParser=class{parserOptions;nonQuotedColumnParser;quotedColumnParser;constructor(e){this.parserOptions=e,this.quotedColumnParser=new n.QuotedColumnParser(e),this.nonQuotedColumnParser=new t.NonQuotedColumnParser(e)}parse(e){let{nextNonSpaceToken:t}=e;return t!==null&&r.Token.isTokenQuote(t,this.parserOptions)?(e.advanceToToken(t),this.quotedColumnParser.parse(e)):this.nonQuotedColumnParser.parse(e)}}})),gd=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ColumnFormatter=e.QuotedColumnParser=e.NonQuotedColumnParser=e.ColumnParser=void 0;var t=hd();Object.defineProperty(e,`ColumnParser`,{enumerable:!0,get:function(){return t.ColumnParser}});var n=pd();Object.defineProperty(e,`NonQuotedColumnParser`,{enumerable:!0,get:function(){return n.NonQuotedColumnParser}});var r=md();Object.defineProperty(e,`QuotedColumnParser`,{enumerable:!0,get:function(){return r.QuotedColumnParser}});var i=fd();Object.defineProperty(e,`ColumnFormatter`,{enumerable:!0,get:function(){return i.ColumnFormatter}})})),_d=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.RowParser=void 0;let t=gd(),n=ud();e.RowParser=class{static isEmptyRow(e){return e.join(``).replace(/\s+/g,``)===``}parserOptions;columnParser;constructor(e){this.parserOptions=e,this.columnParser=new t.ColumnParser(e)}parse(e){let{parserOptions:t}=this,{hasMoreData:r}=e,i=e,a=[],o=this.getStartToken(i,a);for(;o;){if(n.Token.isTokenRowDelimiter(o))return i.advancePastToken(o),!i.hasMoreCharacters&&n.Token.isTokenCarriageReturn(o,t)&&r?null:(i.truncateToCursor(),a);if(!this.shouldSkipColumnParse(i,o,a)){let e=this.columnParser.parse(i);if(e===null)return null;a.push(e)}o=i.nextNonSpaceToken}return r?null:(i.truncateToCursor(),a)}getStartToken(e,t){let r=e.nextNonSpaceToken;return r!==null&&n.Token.isTokenDelimiter(r,this.parserOptions)?(t.push(``),e.nextNonSpaceToken):r}shouldSkipColumnParse(e,t,r){let{parserOptions:i}=this;if(n.Token.isTokenDelimiter(t,i)){e.advancePastToken(t);let a=e.nextCharacterToken;if(!e.hasMoreCharacters||a!==null&&n.Token.isTokenRowDelimiter(a)||a!==null&&n.Token.isTokenDelimiter(a,i))return r.push(``),!0}return!1}}})),vd=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Parser=void 0;let t=dd(),n=_d(),r=ud();e.Parser=class e{static removeBOM(e){return e&&e.charCodeAt(0)===65279?e.slice(1):e}parserOptions;rowParser;constructor(e){this.parserOptions=e,this.rowParser=new n.RowParser(this.parserOptions)}parse(n,r){let i=new t.Scanner({line:e.removeBOM(n),parserOptions:this.parserOptions,hasMoreData:r});return this.parserOptions.supportsComments?this.parseWithComments(i):this.parseWithoutComments(i)}parseWithoutComments(e){let t=[],n=!0;for(;n;)n=this.parseRow(e,t);return{line:e.line,rows:t}}parseWithComments(e){let{parserOptions:t}=this,n=[];for(let i=e.nextCharacterToken;i!==null;i=e.nextCharacterToken)if(r.Token.isTokenComment(i,t)){if(e.advancePastLine()===null||!e.hasMoreCharacters)return{line:e.lineFromCursor,rows:n};e.truncateToCursor()}else if(!this.parseRow(e,n))break;return{line:e.line,rows:n}}parseRow(e,t){if(!e.nextNonSpaceToken)return!1;let r=this.rowParser.parse(e);return r===null?!1:(this.parserOptions.ignoreEmpty&&n.RowParser.isEmptyRow(r)||t.push(r),!0)}}})),yd=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.QuotedColumnParser=e.NonQuotedColumnParser=e.ColumnParser=e.Token=e.Scanner=e.RowParser=e.Parser=void 0;var t=vd();Object.defineProperty(e,`Parser`,{enumerable:!0,get:function(){return t.Parser}});var n=_d();Object.defineProperty(e,`RowParser`,{enumerable:!0,get:function(){return n.RowParser}});var r=dd();Object.defineProperty(e,`Scanner`,{enumerable:!0,get:function(){return r.Scanner}});var i=ud();Object.defineProperty(e,`Token`,{enumerable:!0,get:function(){return i.Token}});var a=gd();Object.defineProperty(e,`ColumnParser`,{enumerable:!0,get:function(){return a.ColumnParser}}),Object.defineProperty(e,`NonQuotedColumnParser`,{enumerable:!0,get:function(){return a.NonQuotedColumnParser}}),Object.defineProperty(e,`QuotedColumnParser`,{enumerable:!0,get:function(){return a.QuotedColumnParser}})})),bd=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CsvParserStream=void 0;let t=en(),n=ln(),r=ld(),i=yd();e.CsvParserStream=class e extends n.Transform{parserOptions;decoder;parser;headerTransformer;rowTransformerValidator;lines=``;rowCount=0;parsedRowCount=0;parsedLineCount=0;endEmitted=!1;headersEmitted=!1;constructor(e){super({objectMode:e.objectMode}),this.parserOptions=e,this.parser=new i.Parser(e),this.headerTransformer=new r.HeaderTransformer(e),this.decoder=new t.StringDecoder(e.encoding),this.rowTransformerValidator=new r.RowTransformerValidator}get hasHitRowLimit(){return this.parserOptions.limitRows&&this.rowCount>=this.parserOptions.maxRows}get shouldEmitRows(){return this.parsedRowCount>this.parserOptions.skipRows}get shouldSkipLine(){return this.parsedLineCount<=this.parserOptions.skipLines}transform(e){return this.rowTransformerValidator.rowTransform=e,this}validate(e){return this.rowTransformerValidator.rowValidator=e,this}emit(e,...t){return e===`end`?(this.endEmitted||(this.endEmitted=!0,super.emit(`end`,this.rowCount)),!1):super.emit(e,...t)}_transform(t,n,r){if(this.hasHitRowLimit)return r();let i=e.wrapDoneCallback(r);try{let{lines:e}=this,n=e+this.decoder.write(t),r=this.parse(n,!0);return this.processRows(r,i)}catch(e){return i(e)}}_flush(t){let n=e.wrapDoneCallback(t);if(this.hasHitRowLimit)return n();try{let e=this.lines+this.decoder.end(),t=this.parse(e,!1);return this.processRows(t,n)}catch(e){return n(e)}}parse(e,t){if(!e)return[];let{line:n,rows:r}=this.parser.parse(e,t);return this.lines=n,r}processRows(e,t){let n=e.length,r=i=>{let a=e=>{if(e)return t(e);if(i%100==0){setImmediate(()=>r(i+1));return}return r(i+1)};if(this.checkAndEmitHeaders(),i>=n||this.hasHitRowLimit)return t();if(this.parsedLineCount+=1,this.shouldSkipLine)return a();let o=e[i];this.rowCount+=1,this.parsedRowCount+=1;let s=this.rowCount;return this.transformRow(o,(e,t)=>{if(e)return--this.rowCount,a(e);if(!t)return a(Error(`expected transform result`));if(!t.isValid)this.emit(`data-invalid`,t.row,s,t.reason);else if(t.row)return this.pushRow(t.row,a);return a()})};r(0)}transformRow(e,t){try{this.headerTransformer.transform(e,(n,r)=>n?t(n):r?r.isValid?r.row?this.shouldEmitRows?this.rowTransformerValidator.transformAndValidate(r.row,t):this.skipRow(t):(--this.rowCount,--this.parsedRowCount,t(null,{row:null,isValid:!0})):this.shouldEmitRows?t(null,{isValid:!1,row:e}):this.skipRow(t):t(Error(`Expected result from header transform`)))}catch(e){t(e)}}checkAndEmitHeaders(){!this.headersEmitted&&this.headerTransformer.headers&&(this.headersEmitted=!0,this.emit(`headers`,this.headerTransformer.headers))}skipRow(e){return--this.rowCount,e(null,{row:null,isValid:!0})}pushRow(e,t){try{this.parserOptions.objectMode?this.push(e):this.push(JSON.stringify(e)),t()}catch(e){t(e)}}static wrapDoneCallback(e){let t=!1;return(n,...r)=>{if(n){if(t)throw n;t=!0,e(n);return}e(...r)}}}})),xd=c((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),e.parseString=e.parseFile=e.parseStream=e.parse=e.ParserOptions=e.CsvParserStream=void 0;let a=r((Xi(),f(Ji))),o=ln(),s=nd(),c=bd();i(rd(),e);var l=bd();Object.defineProperty(e,`CsvParserStream`,{enumerable:!0,get:function(){return l.CsvParserStream}});var u=nd();Object.defineProperty(e,`ParserOptions`,{enumerable:!0,get:function(){return u.ParserOptions}}),e.parse=e=>new c.CsvParserStream(new s.ParserOptions(e)),e.parseStream=(e,t)=>e.pipe(new c.CsvParserStream(new s.ParserOptions(t))),e.parseFile=(e,t={})=>a.createReadStream(e).pipe(new c.CsvParserStream(new s.ParserOptions(t))),e.parseString=(e,t)=>{let n=new o.Readable;return n.push(e),n.push(null),n.pipe(new c.CsvParserStream(new s.ParserOptions(t)))}})),Sd=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CsvParserStream=e.ParserOptions=e.parseFile=e.parseStream=e.parseString=e.parse=e.FormatterOptions=e.CsvFormatterStream=e.writeToPath=e.writeToString=e.writeToBuffer=e.writeToStream=e.write=e.format=void 0;var t=td();Object.defineProperty(e,`format`,{enumerable:!0,get:function(){return t.format}}),Object.defineProperty(e,`write`,{enumerable:!0,get:function(){return t.write}}),Object.defineProperty(e,`writeToStream`,{enumerable:!0,get:function(){return t.writeToStream}}),Object.defineProperty(e,`writeToBuffer`,{enumerable:!0,get:function(){return t.writeToBuffer}}),Object.defineProperty(e,`writeToString`,{enumerable:!0,get:function(){return t.writeToString}}),Object.defineProperty(e,`writeToPath`,{enumerable:!0,get:function(){return t.writeToPath}}),Object.defineProperty(e,`CsvFormatterStream`,{enumerable:!0,get:function(){return t.CsvFormatterStream}}),Object.defineProperty(e,`FormatterOptions`,{enumerable:!0,get:function(){return t.FormatterOptions}});var n=xd();Object.defineProperty(e,`parse`,{enumerable:!0,get:function(){return n.parse}}),Object.defineProperty(e,`parseString`,{enumerable:!0,get:function(){return n.parseString}}),Object.defineProperty(e,`parseStream`,{enumerable:!0,get:function(){return n.parseStream}}),Object.defineProperty(e,`parseFile`,{enumerable:!0,get:function(){return n.parseFile}}),Object.defineProperty(e,`ParserOptions`,{enumerable:!0,get:function(){return n.ParserOptions}}),Object.defineProperty(e,`CsvParserStream`,{enumerable:!0,get:function(){return n.CsvParserStream}})})),Cd=c(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_customParseFormat=r()})(e,(function(){"use strict";var e={LTS:`h:mm:ss A`,LT:`h:mm A`,L:`MM/DD/YYYY`,LL:`MMMM D, YYYY`,LLL:`MMMM D, YYYY h:mm A`,LLLL:`dddd, MMMM D, YYYY h:mm A`},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,r=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)},c=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||={}).offset=function(e){if(!e||e===`Z`)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return n===0?0:t[0]===`+`?-n:n}(e)}],u=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?`pm`:`PM`);return n},f={A:[a,function(e){this.afternoon=d(e,!1)}],a:[a,function(e){this.afternoon=d(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*e}],SS:[r,function(e){this.milliseconds=10*e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[i,c(`seconds`)],ss:[i,c(`seconds`)],m:[i,c(`minutes`)],mm:[i,c(`minutes`)],H:[i,c(`hours`)],h:[i,c(`hours`)],HH:[i,c(`hours`)],hh:[i,c(`hours`)],D:[i,c(`day`)],DD:[r,c(`day`)],Do:[a,function(e){var t=o.ordinal;if(this.day=e.match(/\d+/)[0],t)for(var n=1;n<=31;n+=1)t(n).replace(/\[|\]/g,``)===e&&(this.day=n)}],w:[i,c(`week`)],ww:[r,c(`week`)],M:[i,c(`month`)],MM:[r,c(`month`)],MMM:[a,function(e){var t=u(`months`),n=(u(`monthsShort`)||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw Error();this.month=n%12||n}],MMMM:[a,function(e){var t=u(`months`).indexOf(e)+1;if(t<1)throw Error();this.month=t%12||t}],Y:[/[+-]?\d+/,c(`year`)],YY:[r,function(e){this.year=s(e)}],YYYY:[/\d{4}/,c(`year`)],Z:l,ZZ:l};function p(n){for(var r=n,i=o&&o.formats,a=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var a=r&&r.toUpperCase();return n||i[r]||e[r]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),s=a.length,c=0;c<s;c+=1){var l=a[c],u=f[l],d=u&&u[0],p=u&&u[1];a[c]=p?{regex:d,parser:p}:l.replace(/^\[|\]$/g,``)}return function(e){for(var t={},n=0,r=0;n<s;n+=1){var i=a[n];if(typeof i==`string`)r+=i.length;else{var o=i.regex,c=i.parser,l=e.slice(r),u=o.exec(l)[0];c.call(t,u),e=e.replace(u,``)}}return function(e){var t=e.afternoon;if(t!==void 0){var n=e.hours;t?n<12&&(e.hours+=12):n===12&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,a=e.args;this.$u=r;var s=a[1];if(typeof s==`string`){var c=!0===a[2],l=!0===a[3],u=c||l,d=a[2];l&&(d=a[2]),o=this.$locale(),!c&&d&&(o=n.Ls[d]),this.$d=function(e,t,n,r){try{if([`x`,`X`].indexOf(t)>-1)return new Date((t===`X`?1e3:1)*e);var i=p(t)(e),a=i.year,o=i.month,s=i.day,c=i.hours,l=i.minutes,u=i.seconds,d=i.milliseconds,f=i.zone,m=i.week,h=new Date,g=s||(a||o?1:h.getDate()),_=a||h.getFullYear(),v=0;a&&!o||(v=o>0?o-1:h.getMonth());var y,b=c||0,x=l||0,S=u||0,C=d||0;return f?new Date(Date.UTC(_,v,g,b,x,S,C+60*f.offset*1e3)):n?new Date(Date.UTC(_,v,g,b,x,S,C)):(y=new Date(_,v,g,b,x,S,C),m&&(y=r(y).week(m).toDate()),y)}catch{return new Date(``)}}(t,s,r,n),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(s)&&(this.$d=new Date(``)),o={}}else if(s instanceof Array)for(var f=s.length,m=1;m<=f;m+=1){a[1]=s[m-1];var h=n.apply(this,a);if(h.isValid()){this.$d=h.$d,this.$L=h.$L,this.init();break}m===f&&(this.$d=new Date(``))}else i.call(this,e)}}}))})),wd=c(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_utc=r()})(e,(function(){"use strict";var e=`minute`,t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,i,a){var o=i.prototype;a.utc=function(e){return new i({date:e,utc:!0,args:arguments})},o.utc=function(t){var n=a(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},o.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var s=o.parse;o.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var c=o.init;o.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else c.call(this)};var l=o.utcOffset;o.utcOffset=function(r,i){var a=this.$utils().u;if(a(r))return this.$u?0:a(this.$offset)?l.call(this):this.$offset;if(typeof r==`string`&&(r=function(e){e===void 0&&(e=``);var r=e.match(t);if(!r)return null;var i=(``+r[0]).match(n)||[`-`,0,0],a=i[0],o=60*i[1]+ +i[2];return o===0?0:a===`+`?o:-o}(r),r===null))return this;var o=Math.abs(r)<=16?60*r:r;if(o===0)return this.utc(i);var s=this.clone();if(i)return s.$offset=o,s.$u=!1,s;var c=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(s=this.local().add(o+c,e)).$offset=o,s.$x.$localOffset=c,s};var u=o.format;o.format=function(e){var t=e||(this.$u?`YYYY-MM-DDTHH:mm:ss[Z]`:``);return u.call(this,t)},o.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var d=o.toDate;o.toDate=function(e){return e===`s`&&this.$offset?a(this.format(`YYYY-MM-DD HH:mm:ss:SSS`)).toDate():d.call(this)};var f=o.diff;o.diff=function(e,t,n){if(e&&this.$u===e.$u)return f.call(this,e,t,n);var r=this.local(),i=a(e).local();return f.call(r,i,t,n)}}}))})),Td=c(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){"use strict";var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),D=E.prototype;return w.prototype=D,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){D[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,E,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))}));Xi();var Ed=Sd(),Dd=d(Cd(),1),Od=d(wd(),1),kd=d(Td(),1);let Ad={true:!0,false:!1,"#N/A":{error:`#N/A`},"#REF!":{error:`#REF!`},"#NAME?":{error:`#NAME?`},"#DIV/0!":{error:`#DIV/0!`},"#NULL!":{error:`#NULL!`},"#VALUE!":{error:`#VALUE!`},"#NUM!":{error:`#NUM!`}};kd.default.extend(Dd.default),kd.default.extend(Od.default);var jd=class{constructor(e){this.workbook=e,this.worksheet=null}async readFile(e,t){if(t||={},!await oa(e))throw Error(`File not found: ${e}`);let n=Yi.createReadStream(e);try{let e=await this.read(n,t);return n.close(),e}catch(e){throw n.close(),e}}read(e,t){return t||={},new Promise((n,r)=>{let i=this.workbook.addWorksheet(t.sheetName),a=t.dateFormats||[`YYYY-MM-DD[T]HH:mm:ssZ`,`YYYY-MM-DD[T]HH:mm:ss`,`MM-DD-YYYY`,`YYYY-MM-DD`],o=t.map||function(e){if(e===``)return null;let t=Number(e);if(!Number.isNaN(t)&&t!==1/0)return t;let n=a.reduce((t,n)=>{if(t)return t;let r=(0,kd.default)(e,n,!0);return r.isValid()?r:null},null);if(n)return new Date(n.valueOf());let r=Ad[e];return r===void 0?e:r},s=e=>{i.addRow(e.map(o))},c=()=>{f.emit(`worksheet`,i)},l=()=>{f.removeListener(`data`,s),f.removeListener(`end`,c),f.removeListener(`worksheet`,u),f.removeListener(`error`,d)},u=e=>{l(),n(e)},d=e=>{l(),r(e)},f=(0,Ed.parse)(t.parserOptions).on(`data`,s).on(`end`,c);f.once(`worksheet`,u).on(`error`,d),e.pipe(f)})}write(e,t){return new Promise((n,r)=>{t||={};let i=this.workbook.getWorksheet(t.sheetName||t.sheetId),a=(0,Ed.format)(t.formatterOptions),o=()=>{e.removeListener(`finish`,s),a.removeListener(`error`,c)},s=()=>{o(),n()},c=e=>{o(),r(e)};e.once(`finish`,s),a.on(`error`,c),a.pipe(e);let{dateFormat:l,dateUTC:u}=t,d=t.map||(e=>{if(e){if(e.text||e.hyperlink)return e.hyperlink||e.text||``;if(e.formula||e.result)return e.result||``;if(e instanceof Date)return l?u?kd.default.utc(e).format(l):(0,kd.default)(e).format(l):u?kd.default.utc(e).format():(0,kd.default)(e).format();if(e.error)return e.error;if(typeof e==`object`)return JSON.stringify(e)}return e}),f=t.includeEmptyRows===void 0||t.includeEmptyRows,p=1;i&&i.eachRow((e,t)=>{if(f)for(;p++<t-1;)a.write([]);let{values:n}=e;n.shift(),a.write(n.map(d)),p=t}),a.end()})}writeFile(e,t){t||={};let n={encoding:t.encoding||`utf8`},r=Yi.createWriteStream(e,n);return this.write(r,t)}async writeBuffer(e){let t=new ys;return await this.write(t,e),t.read()}},Md=class{constructor(){this.category=``,this.company=``,this.created=new Date,this.description=``,this.keywords=``,this.manager=``,this.modified=this.created,this.properties={},this.calcProperties={},this._worksheets=[],this.subject=``,this.title=``,this.views=[],this.media=[],this.pivotTables=[],this._definedNames=new Ea}get xlsx(){return this._xlsx||=new Wu(this),this._xlsx}get csv(){return this._csv||=new jd(this),this._csv}get nextId(){for(let e=1;e<this._worksheets.length;e++)if(!this._worksheets[e])return e;return this._worksheets.length||1}addWorksheet(e,t){let n=this.nextId,r=this._worksheets.reduce((e,t)=>(t&&t.orderNo)>e?t.orderNo:e,0),i=new xa({...t,id:n,name:e,orderNo:r+1,workbook:this});return this._worksheets[n]=i,i}removeWorksheetEx(e){delete this._worksheets[e.id]}removeWorksheet(e){let t=this.getWorksheet(e);t&&t.destroy()}getWorksheet(e){if(e===void 0)return this._worksheets.find(Boolean);if(typeof e==`number`)return this._worksheets[e];if(typeof e==`string`)return this._worksheets.find(t=>t&&t.name===e)}get worksheets(){return this._worksheets.slice(1).sort((e,t)=>e.orderNo-t.orderNo).filter(Boolean)}eachSheet(e){this.worksheets.forEach(t=>{e(t,t.id)})}get definedNames(){return this._definedNames}clearThemes(){this._themes=void 0}addImage(e){let t=this.media.length;return this.media.push({...e,type:`image`}),t}getImage(e){return this.media[Number(e)]}get model(){return{creator:this.creator||`Unknown`,lastModifiedBy:this.lastModifiedBy||`Unknown`,lastPrinted:this.lastPrinted,created:this.created,modified:this.modified,properties:this.properties,worksheets:this.worksheets.map(e=>e.model),sheets:this.worksheets.map(e=>e.model).filter(Boolean),definedNames:this._definedNames.model,views:this.views,company:this.company,manager:this.manager,title:this.title,subject:this.subject,keywords:this.keywords,category:this.category,description:this.description,language:this.language,revision:this.revision,contentStatus:this.contentStatus,themes:this._themes,media:this.media,pivotTables:this.pivotTables,calcProperties:this.calcProperties}}set model(e){this.creator=e.creator,this.lastModifiedBy=e.lastModifiedBy,this.lastPrinted=e.lastPrinted,this.created=e.created,this.modified=e.modified,this.company=e.company,this.manager=e.manager,this.title=e.title,this.subject=e.subject,this.keywords=e.keywords,this.category=e.category,this.description=e.description,this.language=e.language,this.revision=e.revision,this.contentStatus=e.contentStatus,this.properties=e.properties,this.calcProperties=e.calcProperties,this._worksheets=[],e.worksheets.forEach(t=>{let{id:n,name:r,state:i}=t,a=e.sheets&&e.sheets.findIndex(e=>e.id===n),o=this._worksheets[n]=new xa({id:n,name:r,orderNo:a===-1?void 0:a,state:i,workbook:this});o.model=t}),this._definedNames.model=e.definedNames,this.views=e.views,this._themes=e.themes,this.media=e.media||[],this.pivotTables=e.pivotTables||e.loadedPivotTables||[]}};let Nd=function(e){return e[e.Legal=5]=`Legal`,e[e.Executive=7]=`Executive`,e[e.A4=9]=`A4`,e[e.A5=11]=`A5`,e[e.B5=13]=`B5`,e[e.Envelope_10=20]=`Envelope_10`,e[e.Envelope_DL=27]=`Envelope_DL`,e[e.Envelope_C5=28]=`Envelope_C5`,e[e.Envelope_B5=34]=`Envelope_B5`,e[e.Envelope_Monarch=37]=`Envelope_Monarch`,e[e.Double_Japan_Postcard_Rotated=82]=`Double_Japan_Postcard_Rotated`,e[e.K16_197x273_mm=119]=`K16_197x273_mm`,e}({});function Pd(e,t){let n=Math.round(e).toString();for(;n.length<t;)n=`0`+n;return n}function Fd(e){if(e.length<=3)return e;let t=e.length%3,n=e.substring(0,t);for(let r=t;r<e.length;r+=3)n+=(n.length>0?`,`:``)+e.substring(r,r+3);return n}function Id(e,t){let n=10**t;return Math.round(e*n)/n}function Ld(e){let t=e.replace(/_./g,` `);return t=t.replace(/\*./g,``),t}function Rd(e){return/^General$/i.test(e.trim())}function zd(e){let t=e.replace(/\[[^\]]*\]/g,``);return/[ymdhs]/i.test(t)&&!/^[#0.,E%$\s()\-+]+$/i.test(t)}let Bd=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],Vd=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],Hd=[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],Ud=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],Wd=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`];function Gd(e,t){let n=Math.round(e*86400)%86400,r=Math.floor(n/3600),i=Math.floor(n%3600/60),a=n%60,o=ea(e,!1),s=o.getUTCFullYear(),c=o.getUTCMonth(),l=o.getUTCDate(),u=o.getUTCDay(),d=e*86400-Math.floor(e*86400),f=/AM\/PM|A\/P/i.test(t),p=r>=12,m=r%12||12,h=t.replace(/\[(Red|Green|Blue|Yellow|Magenta|Cyan|White|Black|Color\d+)\]/gi,``);h=Ld(h);let g=h.match(/ss\.(0+)/i),_=``;if(g){let e=g[1].length;_=Math.round(d*10**e).toString().padStart(e,`0`),h=h.replace(/ss\.0+/gi,`\0SF\0`)}h=h.replace(/yyyy/gi,`\0Y4\0`),h=h.replace(/yy/gi,`\0Y2\0`),h=h.replace(/mmmmm/gi,`\0MN5\0`),h=h.replace(/mmmm/gi,`\0MN4\0`),h=h.replace(/mmm/gi,`\0MN3\0`),h=h.replace(/dddd/gi,`\0DN4\0`),h=h.replace(/ddd/gi,`\0DN3\0`),h=h.replace(/dd/gi,`\0D2\0`),h=h.replace(/\bd\b/gi,`\0D1\0`),h=h.replace(/hh/gi,`\0H2\0`),h=h.replace(/\bh\b/gi,`\0H1\0`),h=h.replace(/ss/gi,`\0S2\0`),h=h.replace(/\bs\b/gi,`\0S1\0`),h=/\x00H[12]\x00.*mm|mm.*\x00S[12]\x00/i.test(h)?h.replace(/mm/gi,`\0MI2\0`):h.replace(/mm/gi,`\0M2\0`),h=h.replace(/\bm\b/gi,`\0M1\0`),h=h.replace(/AM\/PM/gi,`\0AMPM\0`),h=h.replace(/A\/P/gi,`\0AP\0`);let v=f?m:r;return h=h.replace(/\x00Y4\x00/g,s.toString()).replace(/\x00Y2\x00/g,(s%100).toString().padStart(2,`0`)).replace(/\x00MN5\x00/g,Hd[c]).replace(/\x00MN4\x00/g,Vd[c]).replace(/\x00MN3\x00/g,Bd[c]).replace(/\x00M2\x00/g,(c+1).toString().padStart(2,`0`)).replace(/\x00M1\x00/g,(c+1).toString()).replace(/\x00DN4\x00/g,Wd[u]).replace(/\x00DN3\x00/g,Ud[u]).replace(/\x00D2\x00/g,l.toString().padStart(2,`0`)).replace(/\x00D1\x00/g,l.toString()).replace(/\x00H2\x00/g,v.toString().padStart(2,`0`)).replace(/\x00H1\x00/g,v.toString()).replace(/\x00MI2\x00/g,i.toString().padStart(2,`0`)).replace(/\x00S2\x00/g,a.toString().padStart(2,`0`)).replace(/\x00S1\x00/g,a.toString()).replace(/\x00SF\x00/g,a.toString().padStart(2,`0`)+`.`+_).replace(/\x00AMPM\x00/g,p?`PM`:`AM`).replace(/\x00AP\x00/g,p?`P`:`A`),h=h.replace(/\\/g,``),h}function Kd(e){return typeof e==`boolean`?e?`TRUE`:`FALSE`:typeof e==`string`?e:Number.isInteger(e)?e.toString():e.toPrecision(11).replace(/\.?0+$/,``).replace(/\.?0+e/,`e`)}function qd(e,t){let n=(t.match(/%/g)||[]).length;return Qd(e*100**n,t.replace(/%/g,``)||`0`)+`%`.repeat(n)}function Jd(e,t){let n=e<0?`-`:``,r=Math.abs(e);if(r===0){let e=t.match(/\.([0#]+)E/i),n=e?e[1].length:2;return`0.`+`0`.repeat(n)+`E+00`}let i=t.match(/\.([0#]+)E/i),a=i?i[1].length:2,o=t.includes(`E+`),s=Math.floor(Math.log10(r)),c=Id(r/10**s,a).toFixed(a),l=s>=0?o?`+`:``:`-`,u=Pd(Math.abs(s),2);return n+c+`E`+l+u}function Yd(e,t){let n=e<0?-1:1,r=Math.abs(e),i=Math.floor(r);if(r-=i,r<1e-10)return[n*i,0,1];let a=0,o=1,s=1,c=0,l=Math.floor(r),u=l,d=1;for(;c<t&&(l=Math.floor(r),u=l*o+a,d=l*c+s,!(r-l<1e-10));)r=1/(r-l),a=o,o=u,s=c,c=d;return d>t&&(d=c,u=o),[n*i,n*u,d]}function Xd(e,t){let n=e<0?`-`:``,r=Math.abs(e),i=t.match(/\?+\s*\/\s*(\d+)/);if(i){let e=parseInt(i[1],10),a=Math.floor(r),o=r-a,s=Math.round(o*e);return t.includes(`#`)||t.includes(`0`)?s===0?n+a.toString():n+(a>0?a+` `:``)+s+`/`+e:n+(a*e+s)+`/`+e}let a=t.match(/\/\s*(\?+)/),[o,s,c]=Yd(r,10**(a?a[1].length:2)-1);return t.includes(`#`)&&o!==0?s===0?n+Math.abs(o).toString():n+Math.abs(o)+` `+Math.abs(s)+`/`+c:s===0?o===0?`0`:n+Math.abs(o).toString():n+(Math.abs(o)*c+Math.abs(s))+`/`+c}function Zd(e,t){let n=Math.round(e*86400),r=Math.floor(n/60),i=Math.floor(r/60),a=n%60,o=r%60,s=i,c=t;return/\[h+\]/i.test(c)&&(c=c.replace(/\[h+\]/gi,s.toString())),/\[m+\]/i.test(c)&&(c=c.replace(/\[m+\]/gi,r.toString())),/\[s+\]/i.test(c)&&(c=c.replace(/\[s+\]/gi,n.toString())),c=c.replace(/mm/gi,o.toString().padStart(2,`0`)),c=c.replace(/ss/gi,a.toString().padStart(2,`0`)),c}function Qd(e,t){let n=Math.abs(e),r=e<0?`-`:``,i=0,a=t;for(;a.endsWith(`,`);)i++,a=a.slice(0,-1);let o=n/1e3**i,s=a.indexOf(`.`),c=a,l=``;s!==-1&&(c=a.substring(0,s),l=a.substring(s+1));let u=l.replace(/[^0#?]/g,``).length,[d,f=``]=Id(o,u).toString().split(`.`),p=/[0#?][^0#?,.\s][0#?]/.test(c),m;if(p){let e=c.replace(/[^0#?]/g,``).length,t=d;t.length<e&&(t=`0`.repeat(e-t.length)+t),m=``;let n=t.length-e;for(let e=0;e<c.length;e++){let r=c[e];r===`0`||r===`#`||r===`?`?n<t.length&&(m+=t[n],n++):r!==`,`&&(m+=r)}}else{m=d,c.includes(`,`)&&(m=Fd(d));let e=(c.match(/0/g)||[]).length;m.length<e&&(m=`0`.repeat(e-m.length)+m)}let h=``;return u>0&&(h=`.`+(f+`0`.repeat(u)).substring(0,u)),r+m+h}function $d(e){let t=``,n=0;for(;n<e.length;)if(e[n]===`"`){for(n++;n<e.length&&e[n]!==`"`;)t+=e[n],n++;n++}else e[n]===`\\`&&n+1<e.length?(n++,t+=e[n],n++):(t+=e[n],n++);return t}function ef(e,t){let n=t.match(/\[(=|>|<|>=|<=|<>)(-?\d+(?:\.\d*)?)\]/);if(!n)return!1;let r=n[1],i=parseFloat(n[2]);switch(r){case`=`:return e===i;case`>`:return e>i;case`<`:return e<i;case`>=`:return e>=i;case`<=`:return e<=i;case`<>`:return e!==i;default:return!1}}function tf(e,t){if(typeof t==`string`){let n=rf(e);return n.length>=4&&n[3]?$d(n[3]).replace(/@/g,t):t}if(typeof t==`boolean`)return t?`TRUE`:`FALSE`;let n=rf(e),r=/\[(=|>|<|>=|<=|<>)-?\d+(?:\.\d*)?\]/;if((n[0]&&r.test(n[0])||n[1]&&r.test(n[1]))&&n.length>=2){for(let e=0;e<Math.min(n.length,2);e++){let r=n[e].match(/\[(=|>|<|>=|<=|<>)-?\d+(?:\.\d*)?\]/);if(r&&ef(t,r[0]))return n[e]}return n[n.length>2?2:1]}return n.length===1?n[0]:n.length===2?t>=0?n[0]:n[1]:t>0?n[0]:t<0?n[1]:n[2]||n[0]}function nf(e,t){let n=rf(e);return n.length>=2&&n[1]===t}function rf(e){let t=[],n=``,r=!1,i=!1;for(let a=0;a<e.length;a++){let o=e[a];o===`"`&&!i?(r=!r,n+=o):o===`[`&&!r?(i=!0,n+=o):o===`]`&&!r?(i=!1,n+=o):o===`;`&&!r&&!i?(t.push(n),n=``):n+=o}return t.push(n),t}function af(e,t){if(t==null)return``;if(Rd(e))return Kd(t);if(typeof t==`string`)return tf(e,t);if(typeof t==`boolean`)return t?`TRUE`:`FALSE`;let n=t,r=tf(e,n);n<0&&nf(e,r)&&(n=Math.abs(n));let i=r.replace(/\[(Red|Green|Blue|Yellow|Magenta|Cyan|White|Black|Color\d+)\]/gi,``);if(i=i.replace(/\[(>|<|>=|<=|=|<>)-?\d+(\.\d+)?\]/g,``),i=i.replace(/\[\$[^\]]*\]/g,``),i=Ld(i),i=$d(i),/\[[hms]+\]/i.test(i))return Zd(n,i);if(zd(i))return Gd(n,i);if(i.includes(`%`))return qd(n,i);if(/E[+-]?/i.test(i))return Jd(n,i);if(/\?+\s*\/\s*[\d?]+/.test(i))return Xd(n,i);if(i.includes(`(`)&&i.includes(`)`)&&n<0){let e=i.replace(/\(|\)/g,``);return`(`+Qd(-n,e)+`)`}if(i===`@`)return n.toString();let a=``,o=``,s=i.match(/^([^#0?.,]+)/);s&&(a=s[1],i=i.substring(s[0].length));let c=i.match(/([^#0?.,]+)$/);c&&!c[1].includes(`%`)&&(o=c[1],i=i.substring(0,i.length-c[0].length));let l=Qd(n,i);return a+l+o}function of(e){return e.getTime()/(24*3600*1e3)+25569}function sf(e){let t=e.replace(/"[^"]*"/g,``);if(/\[[hms]\]/i.test(t))return!1;let n=t.replace(/\[[^\]]*\]/g,``),r=/[hs]/i.test(n)||/AM\/PM|A\/P/i.test(n);return/[yd]/i.test(n)||/m/i.test(n)&&!r?!1:r}function cf(e){let t=e.replace(/"[^"]*"/g,``);if(/\[[hms]\]/i.test(t))return!1;let n=t.replace(/\[[^\]]*\]/g,``);return!!(/[yd]/i.test(n)||/m/i.test(n)&&!(/[hs]/i.test(n)||/AM\/PM|A\/P/i.test(n)))}function lf(e,t,n){if(e instanceof Date){let r=of(e);return sf(t)?(r%=1,r<0&&(r+=1),af(t,r)):af(n&&cf(t)?n:t,r)}return af(t,e)}function uf(e,t){let n=e.value,r=e.numFmt,i=typeof r==`string`?r:r?.formatCode??`General`;if(n==null)return``;if(n instanceof Date||typeof n==`number`||typeof n==`boolean`||typeof n==`string`)return lf(n,i,t);if(typeof n==`object`&&`formula`in n){let e=n.result;if(e==null)return``;if(e instanceof Date||typeof e==`number`||typeof e==`boolean`||typeof e==`string`)return lf(e,i,t)}return e.text}function df(e){return m.l2n(e.toUpperCase())-1}function ff(e){return m.n2l(e+1)}function pf(e){return parseInt(e,10)-1}function mf(e){return String(e+1)}function hf(e){let t=m.decodeAddress(e.toUpperCase());return{c:t.col-1,r:t.row-1}}function gf(e){return m.encodeAddress(e.r+1,e.c+1)}function _f(e){let t=e.indexOf(`:`);if(t===-1){let t=hf(e);return{s:t,e:{...t}}}return{s:hf(e.slice(0,t)),e:hf(e.slice(t+1))}}function vf(e,t){if(t===void 0){let t=e;return vf(t.s,t.e)}let n=gf(e),r=gf(t);return n===r?n:`${n}:${r}`}function yf(e,t){let n=t||{},r=new Md().addWorksheet(`Sheet1`);if(e.length===0)return r;let i=new Set;e.forEach(e=>Object.keys(e).forEach(e=>i.add(e)));let a=n.header?[...n.header]:[...i];n.header&&i.forEach(e=>{a.includes(e)||a.push(e)});let o=1;n.skipHeader||(a.forEach((e,t)=>{r.getCell(o,t+1).value=e}),o++);for(let t of e)a.forEach((e,i)=>{let a=t[e];a===null&&n.nullError?r.getCell(o,i+1).value={error:`#NULL!`}:a!=null&&(r.getCell(o,i+1).value=a)}),o++;return r}function bf(e,t,n){let r=n||{};if(t.length===0)return e;let i=1,a=1;if(r.origin!==void 0)if(typeof r.origin==`string`){let e=hf(r.origin);i=e.r+1,a=e.c+1}else typeof r.origin==`number`?i=r.origin===-1?e.rowCount+1:r.origin+1:(i=r.origin.r+1,a=r.origin.c+1);let o=new Set;t.forEach(e=>Object.keys(e).forEach(e=>o.add(e)));let s=r.header?[...r.header]:[...o];r.header&&o.forEach(e=>{s.includes(e)||s.push(e)});let c=i;r.skipHeader||(s.forEach((t,n)=>{e.getCell(c,a+n).value=t}),c++);for(let n of t)s.forEach((t,i)=>{let o=n[t];o===null&&r.nullError?e.getCell(c,a+i).value={error:`#NULL!`}:o!=null&&(e.getCell(c,a+i).value=o)}),c++;return e}function xf(e,t){let n=t||{},r=1,i=e.rowCount,a=1,o=e.columnCount;if(n.range!==void 0){if(typeof n.range==`number`)r=n.range+1;else if(typeof n.range==`string`){let e=_f(n.range);r=e.s.r+1,i=e.e.r+1,a=e.s.c+1,o=e.e.c+1}}if(i<r||o<a)return[];let s=n.header;if(s===1){let t=[],s=n.blankrows!==!1;for(let c=r;c<=i;c++){let r=[],i=!0;for(let t=a;t<=o;t++){let o=e.getCell(c,t),s=n.raw===!1?uf(o,n.dateFormat).trim():o.value;s!=null&&s!==``?(r[t-a]=s,i=!1):n.defval===void 0?r[t-a]=null:r[t-a]=n.defval}(!i||s)&&t.push(r)}return t}if(s===`A`){let t=[],s=n.blankrows===!0;for(let c=r;c<=i;c++){let r={},i=!0;for(let t=a;t<=o;t++){let a=e.getCell(c,t),o=n.raw===!1?uf(a,n.dateFormat).trim():a.value,s=ff(t-1);o!=null&&o!==``?(r[s]=o,i=!1):n.defval!==void 0&&(r[s]=n.defval)}(!i||s)&&t.push(r)}return t}if(Array.isArray(s)){let t=[],c=n.blankrows===!0;for(let l=r;l<=i;l++){let r={},i=!0;for(let t=a;t<=o;t++){let o=t-a,c=s[o]??`__EMPTY_${o}`,u=e.getCell(l,t),d=n.raw===!1?uf(u,n.dateFormat).trim():u.value;d!=null&&d!==``?(r[c]=d,i=!1):n.defval!==void 0&&(r[c]=n.defval)}(!i||c)&&t.push(r)}return t}let c=[],l={};for(let t=a;t<=o;t++){let n=e.getCell(r,t).value,i=n==null?`__EMPTY_${t-a}`:String(n);l[i]===void 0?l[i]=0:(l[i]++,i=`${i}_${l[i]}`),c.push(i)}let u=[],d=r+1,f=n.blankrows===!0;for(let t=d;t<=i;t++){let r={},i=!0;for(let s=a;s<=o;s++){let o=e.getCell(t,s),l=n.raw===!1?uf(o,n.dateFormat).trim():o.value,u=c[s-a];l!=null&&l!==``?(r[u]=l,i=!1):n.defval!==void 0&&(r[u]=n.defval)}(!i||f)&&u.push(r)}return u}function Sf(e,t){let n=t||{},r=n.FS??`,`,i=n.RS??`
176
206
  `,a=[];return e.eachRow({includeEmpty:n.blankrows!==!1},(t,i)=>{let o=[],s=!0;for(t.eachCell({includeEmpty:!0},(e,t)=>{let i=``;e.value!=null&&(i=e.value instanceof Date?e.value.toISOString():typeof e.value==`object`?`result`in e.value?String(e.value.result??``):`text`in e.value?String(e.value.text??``):`richText`in e.value?e.value.richText.map(e=>e.text).join(``):String(e.value):String(e.value),s=!1),(n.forceQuotes||i.includes(r)||i.includes(`"`)||i.includes(`
177
- `)||i.includes(`\r`))&&(i=`"${i.replace(/"/g,`""`)}"`),o.push(i)});o.length<e.columnCount;)o.push(``);(!s||n.blankrows!==!1)&&a.push(o.join(r))}),a.join(i)}function Ef(){return new Fd}function Df(e,t,n){let r=e.addWorksheet(n);t.eachRow({includeEmpty:!0},(e,t)=>{e.eachCell({includeEmpty:!0},(e,n)=>{let i=r.getCell(t,n);i.value=e.value,e.style&&(i.style=e.style)})}),t.columns?.forEach((e,t)=>{e&&r.columns[t]&&e.width&&(r.getColumn(t+1).width=e.width)})}function Of(e,t){let n=new Fd().addWorksheet(`Sheet1`);if(e.length===0)return n;let r=1,i=1;if(t?.origin!==void 0)if(typeof t.origin==`string`){let e=vf(t.origin);r=e.r+1,i=e.c+1}else typeof t.origin==`number`?r=t.origin+1:(r=t.origin.r+1,i=t.origin.c+1);return e.forEach((e,t)=>{e&&e.forEach((e,a)=>{e!=null&&(n.getCell(r+t,i+a).value=e)})}),n}function kf(e,t,n){if(t.length===0)return e;let r=1,i=1;if(n?.origin!==void 0)if(typeof n.origin==`string`){let e=vf(n.origin);r=e.r+1,i=e.c+1}else typeof n.origin==`number`?r=n.origin===-1?e.rowCount+1:n.origin+1:(r=n.origin.r+1,i=n.origin.c+1);return t.forEach((t,n)=>{t&&t.forEach((t,a)=>{t!=null&&(e.getCell(r+n,i+a).value=t)})}),e}function Af(e){let t=[];return e.eachRow({includeEmpty:!0},(e,n)=>{let r=[];e.eachCell({includeEmpty:!0},(e,t)=>{r[t-1]=e.value}),t[n-1]=r}),t}let jf={decodeCol:mf,encodeCol:hf,decodeRow:gf,encodeRow:_f,decodeCell:vf,encodeCell:yf,decodeRange:bf,encodeRange:xf,jsonToSheet:Sf,sheetAddJson:Cf,sheetToJson:wf,sheetToCsv:Tf,aoaToSheet:Of,sheetAddAoa:kf,sheetToAoa:Af,bookNew:Ef,bookAppendSheet:Df};return e.DocumentType=y,e.Enums=S,e.ErrorValue=x,e.FormulaType=_,e.PaperSize=Id,e.ReadingOrder=b,e.RelationshipType=v,e.ValueType=g,e.Workbook=Fd,e.aoaToSheet=Of,e.bookAppendSheet=Df,e.bookNew=Ef,e.decodeCell=vf,e.decodeCol=mf,e.decodeRange=bf,e.decodeRow=gf,e.encodeCell=yf,e.encodeCol=hf,e.encodeRange=xf,e.encodeRow=_f,e.jsonToSheet=Sf,e.sheetAddAoa=kf,e.sheetAddJson=Cf,e.sheetToAoa=Af,e.sheetToCsv=Tf,e.sheetToJson=wf,e.utils=jf,e})({});
207
+ `)||i.includes(`\r`))&&(i=`"${i.replace(/"/g,`""`)}"`),o.push(i)});o.length<e.columnCount;)o.push(``);(!s||n.blankrows!==!1)&&a.push(o.join(r))}),a.join(i)}function Cf(){return new Md}function wf(e,t,n){let r=e.addWorksheet(n);t.eachRow({includeEmpty:!0},(e,t)=>{e.eachCell({includeEmpty:!0},(e,n)=>{let i=r.getCell(t,n);i.value=e.value,e.style&&(i.style=e.style)})}),t.columns?.forEach((e,t)=>{e&&r.columns[t]&&e.width&&(r.getColumn(t+1).width=e.width)})}function Tf(e,t){let n=new Md().addWorksheet(`Sheet1`);if(e.length===0)return n;let r=1,i=1;if(t?.origin!==void 0)if(typeof t.origin==`string`){let e=hf(t.origin);r=e.r+1,i=e.c+1}else typeof t.origin==`number`?r=t.origin+1:(r=t.origin.r+1,i=t.origin.c+1);return e.forEach((e,t)=>{e&&e.forEach((e,a)=>{e!=null&&(n.getCell(r+t,i+a).value=e)})}),n}function Ef(e,t,n){if(t.length===0)return e;let r=1,i=1;if(n?.origin!==void 0)if(typeof n.origin==`string`){let e=hf(n.origin);r=e.r+1,i=e.c+1}else typeof n.origin==`number`?r=n.origin===-1?e.rowCount+1:n.origin+1:(r=n.origin.r+1,i=n.origin.c+1);return t.forEach((t,n)=>{t&&t.forEach((t,a)=>{t!=null&&(e.getCell(r+n,i+a).value=t)})}),e}function Df(e){let t=[];return e.eachRow({includeEmpty:!0},(e,n)=>{let r=[];e.eachCell({includeEmpty:!0},(e,t)=>{r[t-1]=e.value}),t[n-1]=r}),t}let Of={decodeCol:df,encodeCol:ff,decodeRow:pf,encodeRow:mf,decodeCell:hf,encodeCell:gf,decodeRange:_f,encodeRange:vf,jsonToSheet:yf,sheetAddJson:bf,sheetToJson:xf,sheetToCsv:Sf,aoaToSheet:Tf,sheetAddAoa:Ef,sheetToAoa:Df,bookNew:Cf,bookAppendSheet:wf};return e.DocumentType=y,e.Enums=S,e.ErrorValue=x,e.FormulaType=_,e.PaperSize=Nd,e.ReadingOrder=b,e.RelationshipType=v,e.ValueType=g,e.Workbook=Md,e.aoaToSheet=Tf,e.bookAppendSheet=wf,e.bookNew=Cf,e.decodeCell=hf,e.decodeCol=df,e.decodeRange=_f,e.decodeRow=pf,e.encodeCell=gf,e.encodeCol=ff,e.encodeRange=vf,e.encodeRow=mf,e.jsonToSheet=yf,e.sheetAddAoa=Ef,e.sheetAddJson=bf,e.sheetToAoa=Df,e.sheetToCsv=Sf,e.sheetToJson=xf,e.utils=Of,e})({});