read-excel-file 9.0.9 → 9.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/README.md +42 -5
- package/bundle/read-excel-file.min.js +1 -1
- package/bundle/read-excel-file.min.js.map +1 -1
- package/commonjs/parseSheetData/parseSheetData.js +1 -1
- package/commonjs/parseSheetData/parseSheetData.js.map +1 -1
- package/commonjs/zip/unzipFromStream.js +159 -82
- package/commonjs/zip/unzipFromStream.js.map +1 -1
- package/commonjs/zip/unzipFromStream.test.js.map +1 -0
- package/modules/parseSheetData/parseSheetData.js +1 -1
- package/modules/parseSheetData/parseSheetData.js.map +1 -1
- package/modules/zip/unzipFromStream.js +158 -83
- package/modules/zip/unzipFromStream.js.map +1 -1
- package/modules/zip/unzipFromStream.test.js.map +1 -0
- package/package.json +3 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
9.1.0 / 07.06.2026
|
|
2
|
+
==================
|
|
3
|
+
|
|
4
|
+
* Merged [Stian Jensen](https://github.com/stianjensen)'s [pull request](https://github.com/catamphetamine/read-excel-file/pull/122) that replaces `unzipper` package with `fflate`. This prunes 15 packages from `node_modules` (`unzipper` plus 14 transitive deps, e.g. `bluebird`, `fs-extra`, `readable-stream`).
|
|
5
|
+
|
|
1
6
|
9.0.7 / 28.04.2026
|
|
2
7
|
==================
|
|
3
8
|
|
package/README.md
CHANGED
|
@@ -330,19 +330,56 @@ Here're the results of reading [sample `.xlsx` files](https://examplefile.com/do
|
|
|
330
330
|
|
|
331
331
|
## Schema
|
|
332
332
|
|
|
333
|
-
Oftentimes, the task is not just to read the "raw" spreadsheet data but also to convert each row of that data to a JSON object having a certain structure. Because it's such a common task, this package provides an easy way to do that — just pass a `schema` parameter when calling `readSheet()` function and it will automatically parse sheet data into an array of JSON objects according to that `schema` (which basically describes all properties of the object and which column should be mapped to which property).
|
|
333
|
+
Oftentimes, the task is not just to read the "raw" spreadsheet data but also to convert each row of that data to a JSON object having a certain structure. Because it's such a common task, this package provides an easy way to do that — just pass a `schema` parameter when calling `readSheet()` function and it will automatically parse sheet data into an array of JSON objects according to that `schema` (which basically describes all properties of the object and which column should be mapped to which property).
|
|
334
|
+
|
|
335
|
+
The only requirement is that the sheet data should adhere to a simple structure: the first row should be a header row with just column titles, and each following row should specify the values for those columns.
|
|
336
|
+
|
|
337
|
+
| Name | Date of Birth | Married | Kids |
|
|
338
|
+
| ---------- | ------------- | ------- | ---- |
|
|
339
|
+
| John Smith | 1/1/1995 | TRUE | 3 |
|
|
340
|
+
| Kate Brown | 3/1/2010 | FALSE | 0 |
|
|
334
341
|
|
|
335
342
|
```js
|
|
336
343
|
import { readSheet } from 'read-excel-file/node'
|
|
337
344
|
|
|
338
|
-
const schema = {
|
|
345
|
+
const schema = {
|
|
346
|
+
name: {
|
|
347
|
+
column: 'Name',
|
|
348
|
+
type: String
|
|
349
|
+
},
|
|
350
|
+
dateOfBirth: {
|
|
351
|
+
column: 'Date of Birth',
|
|
352
|
+
type: Date
|
|
353
|
+
},
|
|
354
|
+
married: {
|
|
355
|
+
column: 'Married',
|
|
356
|
+
type: Boolean
|
|
357
|
+
},
|
|
358
|
+
kids: {
|
|
359
|
+
column: 'Kids',
|
|
360
|
+
type: Number
|
|
361
|
+
}
|
|
362
|
+
}
|
|
339
363
|
|
|
340
364
|
const { objects, errors } = await readSheet(file, { schema })
|
|
341
365
|
|
|
342
366
|
if (errors) {
|
|
343
367
|
console.error(errors)
|
|
344
368
|
} else {
|
|
345
|
-
|
|
369
|
+
objects === [
|
|
370
|
+
{
|
|
371
|
+
name: 'John Smith',
|
|
372
|
+
dateOfBirth: 1995-01-01T00:00:00.000Z,
|
|
373
|
+
married: true,
|
|
374
|
+
kids: 3
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
name: 'Kate Brown',
|
|
378
|
+
dateOfBirth: 2010-03-01T00:00:00.000Z,
|
|
379
|
+
married: false,
|
|
380
|
+
kids: 0
|
|
381
|
+
}
|
|
382
|
+
]
|
|
346
383
|
}
|
|
347
384
|
```
|
|
348
385
|
|
|
@@ -350,7 +387,7 @@ The result is `{ objects, errors }`
|
|
|
350
387
|
* If there were any errors, `objects` will be `undefined` and `errors` will be a list of errors.
|
|
351
388
|
* If there were no errors, `errors` will be `undefined` and `objects` will be a list of objects.
|
|
352
389
|
|
|
353
|
-
`schema` should describe the structure of the resulting JSON objects.
|
|
390
|
+
`schema` should describe the structure of the resulting JSON objects. A slightly more complex example of a `schema` is provided at the end of this section.
|
|
354
391
|
|
|
355
392
|
Specifically, a `schema` should be an object having the same keys as a resulting JSON object, with values being nested objects having the following properties:
|
|
356
393
|
|
|
@@ -371,7 +408,7 @@ Specifically, a `schema` should be an object having the same keys as a resulting
|
|
|
371
408
|
* If when parsing such nested object, all of its property values happen to be empty — `undefined` or `null` — then the nested object will be itself set to `null`.
|
|
372
409
|
* This can be overridden by passing `transformEmptyObject(object, { path? })` function as an option. By default, it returns `null`.
|
|
373
410
|
* This applies both to nested objects and to the top-level object itself.
|
|
374
|
-
* `type` — (optional) If the value is not going to be a nested object, `type` should describe the type of the value. It will determine how the cell value will be converted to a property value. If no `type` is specified then the
|
|
411
|
+
* `type` — (optional) If the value is not going to be a nested object, `type` should describe the type of the value. It will determine how the cell value will be converted to a property value. If no `type` is specified then there will be no conversion, and the cell value will simply be copied to the property value as is.
|
|
375
412
|
* Valid `type`s:
|
|
376
413
|
* Standard types:
|
|
377
414
|
* `String`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(r="undefined"!=typeof globalThis?globalThis:r||self).readXlsxFile=e()}(this,(function(){"use strict";var r={createDocument:function(r){return(new DOMParser).parseFromString(r.trim(),"text/xml")}},e={},t=Uint8Array,n=Uint16Array,o=Int32Array,i=new 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,0,0,0]),a=new t([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]),u=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),f=function(r,e){for(var t=new n(31),i=0;i<31;++i)t[i]=e+=1<<r[i-1];var a=new o(t[30]);for(i=1;i<30;++i)for(var u=t[i];u<t[i+1];++u)a[u]=u-t[i]<<5|i;return{b:t,r:a}},l=f(i,2),c=l.b,s=l.r;c[28]=258,s[258]=28;for(var m=f(a,0).b,d=new n(32768),v=0;v<32768;++v){var h=(43690&v)>>1|(21845&v)<<1;h=(61680&(h=(52428&h)>>2|(13107&h)<<2))>>4|(3855&h)<<4,d[v]=((65280&h)>>8|(255&h)<<8)>>1}var y=function(r,e,t){for(var o=r.length,i=0,a=new n(e);i<o;++i)r[i]&&++a[r[i]-1];var u,f=new n(e);for(i=1;i<e;++i)f[i]=f[i-1]+a[i-1]<<1;if(t){u=new n(1<<e);var l=15-e;for(i=0;i<o;++i)if(r[i])for(var c=i<<4|r[i],s=e-r[i],m=f[r[i]-1]++<<s,v=m|(1<<s)-1;m<=v;++m)u[d[m]>>l]=c}else for(u=new n(o),i=0;i<o;++i)r[i]&&(u[i]=d[f[r[i]-1]++]>>15-r[i]);return u},b=new t(288);for(v=0;v<144;++v)b[v]=8;for(v=144;v<256;++v)b[v]=9;for(v=256;v<280;++v)b[v]=7;for(v=280;v<288;++v)b[v]=8;var p=new t(32);for(v=0;v<32;++v)p[v]=5;var g=y(b,9,1),w=y(p,5,1),A=function(r){for(var e=r[0],t=1;t<r.length;++t)r[t]>e&&(e=r[t]);return e},S=function(r,e,t){var n=e/8|0;return(r[n]|r[n+1]<<8)>>(7&e)&t},O=function(r,e){var t=e/8|0;return(r[t]|r[t+1]<<8|r[t+2]<<16)>>(7&e)},x=function(r){return(r+7)/8|0},I=function(r,e,n){return(null==e||e<0)&&(e=0),(null==n||n>r.length)&&(n=r.length),new t(r.subarray(e,n))},j=["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"],E=function(r,e,t){var n=new Error(e||j[r]);if(n.code=r,Error.captureStackTrace&&Error.captureStackTrace(n,E),!t)throw n;return n},k=function(r,e,n,o){var f=r.length,l=o?o.length:0;if(!f||e.f&&!e.l)return n||new t(0);var s=!n,d=s||2!=e.i,v=e.i;s&&(n=new t(3*f));var h=function(r){var e=n.length;if(r>e){var o=new t(Math.max(2*e,r));o.set(n),n=o}},b=e.f||0,p=e.p||0,j=e.b||0,k=e.l,T=e.d,N=e.m,C=e.n,D=8*f;do{if(!k){b=S(r,p,1);var M=S(r,p+1,3);if(p+=3,!M){var F=r[(G=x(p)+4)-4]|r[G-3]<<8,U=G+F;if(U>f){v&&E(0);break}d&&h(j+F),n.set(r.subarray(G,U),j),e.b=j+=F,e.p=p=8*U,e.f=b;continue}if(1==M)k=g,T=w,N=9,C=5;else if(2==M){var P=S(r,p,31)+257,$=S(r,p+10,15)+4,z=P+S(r,p+5,31)+1;p+=14;for(var L=new t(z),R=new t(19),X=0;X<$;++X)R[u[X]]=S(r,p+3*X,7);p+=3*$;var B=A(R),V=(1<<B)-1,W=y(R,B,1);for(X=0;X<z;){var G,_=W[S(r,p,V)];if(p+=15&_,(G=_>>4)<16)L[X++]=G;else{var q=0,H=0;for(16==G?(H=3+S(r,p,3),p+=2,q=L[X-1]):17==G?(H=3+S(r,p,7),p+=3):18==G&&(H=11+S(r,p,127),p+=7);H--;)L[X++]=q}}var J=L.subarray(0,P),K=L.subarray(P);N=A(J),C=A(K),k=y(J,N,1),T=y(K,C,1)}else E(1);if(p>D){v&&E(0);break}}d&&h(j+131072);for(var Q=(1<<N)-1,Y=(1<<C)-1,Z=p;;Z=p){var rr=(q=k[O(r,p)&Q])>>4;if((p+=15&q)>D){v&&E(0);break}if(q||E(2),rr<256)n[j++]=rr;else{if(256==rr){Z=p,k=null;break}var er=rr-254;if(rr>264){var tr=i[X=rr-257];er=S(r,p,(1<<tr)-1)+c[X],p+=tr}var nr=T[O(r,p)&Y],or=nr>>4;nr||E(3),p+=15&nr;K=m[or];if(or>3){tr=a[or];K+=O(r,p)&(1<<tr)-1,p+=tr}if(p>D){v&&E(0);break}d&&h(j+131072);var ir=j+er;if(j<K){var ar=l-K,ur=Math.min(K,ir);for(ar+j<0&&E(3);j<ur;++j)n[j]=o[ar+j]}for(;j<ir;++j)n[j]=n[j-K]}}e.l=k,e.p=Z,e.b=j,e.f=b,k&&(b=1,e.m=N,e.d=T,e.n=C)}while(!b);return j!=n.length&&s?I(n,0,j):n.subarray(0,j)},T=new t(0),N=function(r,e,t){for(var n=r(),o=r.toString(),i=o.slice(o.indexOf("[")+1,o.lastIndexOf("]")).replace(/\s+/g,"").split(","),a=0;a<n.length;++a){var u=n[a],f=i[a];if("function"==typeof u){e+=";"+f+"=";var l=u.toString();if(u.prototype)if(-1!=l.indexOf("[native code]")){var c=l.indexOf(" ",8)+1;e+=l.slice(c,l.indexOf("(",c))}else for(var s in e+=l,u.prototype)e+=";"+f+".prototype."+s+"="+u.prototype[s].toString();else e+=l}else t[f]=u}return e},C=[],D=function(r,t,n,o){if(!C[n]){for(var i="",a={},u=r.length-1,f=0;f<u;++f)i=N(r[f],i,a);C[n]={c:N(r[u],i,a),e:a}}var l=function(r,e){var t={};for(var n in r)t[n]=r[n];for(var n in e)t[n]=e[n];return t}({},C[n].e);return function(r,t,n,o,i){var a=new Worker(e[t]||(e[t]=URL.createObjectURL(new Blob([r+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return a.onmessage=function(r){var e=r.data,t=e.$e$;if(t){var n=new Error(t[0]);n.code=t[1],n.stack=t[2],i(n,null)}else i(null,e)},a.postMessage(n,o),a}(C[n].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",n,l,function(r){var e=[];for(var t in r)r[t].buffer&&e.push((r[t]=new r[t].constructor(r[t])).buffer);return e}(l),o)},M=function(){return[t,n,o,i,a,u,c,m,g,w,d,j,y,A,S,O,x,I,E,k,R,F,U]},F=function(r){return postMessage(r,[r.buffer])},U=function(r){return r&&{out:r.size&&new t(r.size),dictionary:r.dictionary}},P=function(r,e,t,n,o,i){var a=D(t,n,o,(function(r,e){a.terminate(),i(r,e)}));return a.postMessage([r,e],e.consume?[r.buffer]:[]),function(){a.terminate()}},$=function(r,e){return r[e]|r[e+1]<<8},z=function(r,e){return(r[e]|r[e+1]<<8|r[e+2]<<16|r[e+3]<<24)>>>0},L=function(r,e){return z(r,e)+4294967296*z(r,e+4)};function R(r,e){return k(r,{i:2},e&&e.out,e&&e.dictionary)}var X="undefined"!=typeof TextDecoder&&new TextDecoder;try{X.decode(T,{stream:!0}),1}catch(r){}var B=function(r){for(var e="",t=0;;){var n=r[t++],o=(n>127)+(n>223)+(n>239);if(t+o>r.length)return{s:e,r:I(r,t-1)};o?3==o?(n=((15&n)<<18|(63&r[t++])<<12|(63&r[t++])<<6|63&r[t++])-65536,e+=String.fromCharCode(55296|n>>10,56320|1023&n)):e+=1&o?String.fromCharCode((31&n)<<6|63&r[t++]):String.fromCharCode((15&n)<<12|(63&r[t++])<<6|63&r[t++]):e+=String.fromCharCode(n)}};function V(r,e){if(e){for(var t="",n=0;n<r.length;n+=16384)t+=String.fromCharCode.apply(null,r.subarray(n,n+16384));return t}if(X)return X.decode(r);var o=B(r),i=o.s;return(t=o.r).length&&E(8),i}var W=function(r,e){return e+30+$(r,e+26)+$(r,e+28)},G=function(r,e,t){var n=$(r,e+28),o=V(r.subarray(e+46,e+46+n),!(2048&$(r,e+8))),i=e+46+n,a=z(r,e+20),u=t&&4294967295==a?_(r,i):[a,z(r,e+24),z(r,e+42)],f=u[0],l=u[1],c=u[2];return[$(r,e+10),f,l,o,i+$(r,e+30)+$(r,e+32),c]},_=function(r,e){for(;1!=$(r,e);e+=4+$(r,e+2));return[L(r,e+12),L(r,e+4),L(r,e+20)]},q="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(r){r()};function H(r,e,n){n||(n=e,e={}),"function"!=typeof n&&E(7);var o=[],i=function(){for(var r=0;r<o.length;++r)o[r]()},a={},u=function(r,e){q((function(){n(r,e)}))};q((function(){u=n}));for(var f=r.length-22;101010256!=z(r,f);--f)if(!f||r.length-f>65558)return u(E(13,0,1),null),i;var l=$(r,f+8);if(l){var c=l,s=z(r,f+16),m=4294967295==s||65535==c;if(m){var d=z(r,f-12);(m=101075792==z(r,d))&&(c=l=z(r,d+32),s=z(r,d+48))}for(var v=e&&e.filter,h=function(e){var n=G(r,s,m),f=n[0],c=n[1],d=n[2],h=n[3],y=n[4],b=n[5],p=W(r,b);s=y;var g=function(r,e){r?(i(),u(r,null)):(e&&(a[h]=e),--l||u(null,a))};if(!v||v({name:h,size:c,originalSize:d,compression:f}))if(f)if(8==f){var w=r.subarray(p,p+c);if(d<524288||c>.8*d)try{g(null,R(w,{out:new t(d)}))}catch(r){g(r,null)}else o.push(function(r,e,t){return t||(t=e,e={}),"function"!=typeof t&&E(7),P(r,e,[M],(function(r){return F(R(r.data[0],U(r.data[1])))}),1,t)}(w,{size:d},g))}else g(E(14,"unknown compression type "+f,1),null);else g(null,I(r,p,p+c));else g(null,null)},y=0;y<c;++y)h()}else u(null,{});return i}function J(r,e){return function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.filter,n=arguments.length>2?arguments[2]:void 0;return n(new Uint8Array(r),{filter:function(r){return!t||t({path:r.name})}})}(r,e,K,!0)}function K(r){return new Promise((function(e,t){H(r,(function(r,n){r?t(r):e(n)}))}))}function Q(r){for(var e={},t=0,n=Object.keys(r);t<n.length;t++){var o=n[t];e[o]=V(r[o])}return e}function Y(r){var e=r.path;return e.endsWith(".xml")||e.endsWith(".xml.rels")}function Z(r){return J(r,{filter:Y}).then(Q)}function rr(r,e){for(var t=0;t<r.childNodes.length;){var n=r.childNodes[t];if(1===n.nodeType&&or(n)===e)return n;t++}}function er(r,e){for(var t=[],n=0;n<r.childNodes.length;){var o=r.childNodes[n];1===o.nodeType&&or(o)===e&&t.push(o),n++}return t}function tr(r,e,t){for(var n=0;n<r.childNodes.length;){var o=r.childNodes[n];e?1===o.nodeType&&or(o)===e&&t(o,n):t(o,n),n++}}var nr=/.+\:/;function or(r){return r.tagName.replace(nr,"")}function ir(r){for(var e=0;e<r.childNodes.length;){if(1===r.childNodes[e].nodeType)return r.childNodes[e];e++}}function ar(r){if(1!==r.nodeType)return r.textContent;for(var e="<"+or(r),t=0;t<r.attributes.length;)e+=" "+r.attributes[t].name+'="'+r.attributes[t].value+'"',t++;e+=">";for(var n=0;n<r.childNodes.length;)e+=ar(r.childNodes[n]),n++;return e+="</"+or(r)+">"}function ur(r){var e,t,n=r.documentElement;return e=function(r){var e=rr(r,"t");if(e)return e.textContent;var t="";return tr(r,"r",(function(r){t+=rr(r,"t").textContent})),t},t=[],tr(n,"si",(function(r,n){t.push(e(r,n))})),t}function fr(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(t)return(t=t.call(r)).next.bind(t);if(Array.isArray(r)||(t=function(r,e){if(!r)return;if("string"==typeof r)return lr(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);"Object"===t&&r.constructor&&(t=r.constructor.name);if("Map"===t||"Set"===t)return Array.from(r);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return lr(r,e)}(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var n=0;return function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function lr(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function cr(r,e){for(var t,n=e.createDocument(r),o=rr(n.documentElement,"workbookPr"),i=Boolean(o)&&"1"===o.getAttribute("date1904"),a=[],u=fr(function(r){return er(rr(r.documentElement,"sheets"),"sheet")}(n));!(t=u()).done;){var f=t.value;f.getAttribute("name")&&a.push({id:f.getAttribute("sheetId"),name:f.getAttribute("name"),relationId:f.getAttribute("r:id")})}return{epoch1904:i,sheets:a}}function sr(r,e){var t=e.createDocument(r),n={sheets:{},sharedStrings:void 0,styles:void 0};return function(r){return er(r.documentElement,"Relationship")}(t).forEach((function(r){var e=r.getAttribute("Target");switch(r.getAttribute("Type")){case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles":n.styles=mr(e);break;case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings":n.sharedStrings=mr(e);break;case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet":n.sheets[r.getAttribute("Id")]=mr(e)}})),n}function mr(r){return"/"===r[0]?r.slice(1):"xl/"+r}function dr(r){return dr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},dr(r)}function vr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function hr(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?vr(Object(t),!0).forEach((function(e){yr(r,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):vr(Object(t)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}))}return r}function yr(r,e,t){return(e=function(r){var e=function(r,e){if("object"!==dr(r)||null===r)return r;var t=r[Symbol.toPrimitive];if(void 0!==t){var n=t.call(r,e||"default");if("object"!==dr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(r)}(r,"string");return"symbol"===dr(e)?e:String(e)}(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function br(r,e){if(!r)return{};var t,n,o=e.createDocument(r),i=(t=o,n=rr(t.documentElement,"cellStyleXfs"),n?er(n,"xf"):[]).map(gr),a=function(r){var e=rr(r.documentElement,"numFmts");return e?er(e,"numFmt"):[]}(o).map(pr).reduce((function(r,e){return r[e.id]=e,r}),[]);return function(r){var e=rr(r.documentElement,"cellXfs");return e?er(e,"xf"):[]}(o).map((function(r){return r.hasAttribute("xfId")?hr(hr({},i[r.xfId]),gr(r,a)):gr(r,a)}))}function pr(r){return{id:r.getAttribute("numFmtId"),template:r.getAttribute("formatCode")}}function gr(r,e){var t={};if(r.hasAttribute("numFmtId")){var n=r.getAttribute("numFmtId");e[n]?t.numberFormat=e[n]:t.numberFormat={id:n}}return t}var wr=17,Ar=1,Sr=1,Or=864e5,xr=365;function Ir(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(t)return(t=t.call(r)).next.bind(t);if(Array.isArray(r)||(t=function(r,e){if(!r)return;if("string"==typeof r)return jr(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);"Object"===t&&r.constructor&&(t=r.constructor.name);if("Map"===t||"Set"===t)return Array.from(r);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return jr(r,e)}(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var n=0;return function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function jr(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}var Er=/^\[\$-[^\]]+\]/,kr=/;@$/,Tr={};function Nr(r){if(r in Tr)return Tr[r];var e=function(r){r=r.toLowerCase(),r=r.replace(Er,""),r=r.replace(kr,"");var e=r.split(/\W+/);if(e.length<0)return!1;for(var t,n=Ir(e);!(t=n()).done;){var o=t.value;if(Cr.indexOf(o)<0)return!1}return!0}(r);return Tr[r]=e,e}var Cr=["ss","mm","h","hh","am","pm","d","dd","m","mm","mmm","mmmm","yy","yyyy","e"];var Dr=[27,28,29,30,31,32,33,34,35,36,50,51,52,53,54,55,56,57,58],Mr=[27,28,29,30,31,32,33,34,35,36,50,51,52,53,54,55,56,57,58],Fr=[14,15,16,17,18,19,20,21,22,45,46,47].concat(Dr).concat(Mr.filter((function(r){return Dr.indexOf(r)<0}))).concat([71,72,73,74,75,76,77,78,79,80,81].filter((function(r){return Dr.indexOf(r)<0})).filter((function(r){return Mr.indexOf(r)<0})));function Ur(r,e,t){var n=t.getInlineStringValue,o=t.getInlineStringXml,i=t.getStyleId,a=t.styles,u=t.sharedStrings,f=t.epoch1904,l=t.options;switch(e||(e="n"),e){case"str":r=Pr(r,l);break;case"inlineStr":if(void 0===(r=n()))throw new Error('Unsupported "inline string" cell value structure: '.concat(o()));r=Pr(r,l);break;case"s":var c=Number(r);if(isNaN(c))throw new Error('Invalid "shared" string index: '.concat(r));if(c>=u.length)throw new Error('An out-of-bounds "shared" string index: '.concat(r));r=Pr(r=u[c],l);break;case"b":if("1"===r)r=!0;else{if("0"!==r)throw new Error('Unsupported "boolean" cell value: '.concat(r));r=!1}break;case"z":r=void 0;break;case"e":r=function(r){switch(r){case 0:return"#NULL!";case 7:return"#DIV/0!";case 15:return"#VALUE!";case 23:return"#REF!";case 29:return"#NAME?";case 36:return"#NUM!";case 42:return"#N/A";case 43:return"#GETTING_DATA";default:return"#ERROR_".concat(r)}}(r);break;case"d":if(void 0===r)break;var s=new Date(r);if(isNaN(s.valueOf()))throw new Error('Unsupported "date" cell value: '.concat(r));r=s;break;case"n":if(void 0===r)break;var m=i();if(m&&function(r,e,t){if(r){var n=e[r];if(!n)throw new Error("Cell style not found: ".concat(r));if(!n.numberFormat)return!1;if(Fr.indexOf(Number(n.numberFormat.id))>=0||t.dateFormat&&n.numberFormat.template===t.dateFormat||!1!==t.smartDateParser&&n.numberFormat.template&&Nr(n.numberFormat.template))return!0}}(m,a,l))r=function(r,e){e&&e.epoch1904&&(r+=4*xr+Ar+Sr);var t=Ar+Sr+70*xr+wr;return new Date(Math.floor((r-t)*Or))}(r=$r(r),{epoch1904:f});else r=(l.parseNumber||$r)(r);break;default:throw new TypeError("Cell type not supported: ".concat(e))}return void 0===r&&(r=null),r}function Pr(r,e){return!1!==e.trim&&(r=r.trim()),""===r&&(r=void 0),r}function $r(r){var e=Number(r);if(isNaN(e))throw new Error('Invalid "numeric" cell value: '.concat(r));return e}function zr(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var n,o,i,a,u=[],f=!0,l=!1;try{if(i=(t=t.call(r)).next,0===e){if(Object(t)!==t)return;f=!1}else for(;!(f=(n=i.call(t)).done)&&(u.push(n.value),u.length!==e);f=!0);}catch(r){l=!0,o=r}finally{try{if(!f&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(r,e)||function(r,e){if(!r)return;if("string"==typeof r)return Lr(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);"Object"===t&&r.constructor&&(t=r.constructor.name);if("Map"===t||"Set"===t)return Array.from(r);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Lr(r,e)}(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Lr(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function Rr(r){var e=zr(r.split(/(\d+)/),2),t=e[0],n=e[1];return[Number(n),Br(t.trim())]}var Xr=["","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];function Br(r){for(var e=0,t=0;t<r.length;)e*=26,e+=Xr.indexOf(r[t]),t++;return e}function Vr(r,e,t,n,o,i){var a=Rr(r.getAttribute("r")),u=function(r,e){return rr(e,"v")}(0,r),f=u&&u.textContent,l=r.getAttribute("t");return{row:a[0],column:a[1],value:Ur(f,l,{getInlineStringValue:function(){return function(r,e){var t=ir(e);if(t&&"is"===or(t)){var n=ir(t);if(n&&"t"===or(n))return n.textContent}}(0,r)},getInlineStringXml:function(){return ar(r)},getStyleId:function(){return r.getAttribute("s")},styles:n,sharedStrings:t,epoch1904:o,options:i})}}function Wr(r,e,t,n,o){var i=function(r){var e=rr(r.documentElement,"sheetData"),t=[];return tr(e,"row",(function(r){tr(r,"c",(function(r){t.push(r)}))})),t}(r);return 0===i.length?[]:i.map((function(r){return Vr(r,0,e,t,n,o)}))}function Gr(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var n,o,i,a,u=[],f=!0,l=!1;try{if(i=(t=t.call(r)).next,0===e){if(Object(t)!==t)return;f=!1}else for(;!(f=(n=i.call(t)).done)&&(u.push(n.value),u.length!==e);f=!0);}catch(r){l=!0,o=r}finally{try{if(!f&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(r,e)||function(r,e){if(!r)return;if("string"==typeof r)return _r(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);"Object"===t&&r.constructor&&(t=r.constructor.name);if("Map"===t||"Set"===t)return Array.from(r);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return _r(r,e)}(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _r(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function qr(r){var e=function(r){var e=rr(r.documentElement,"dimension");if(e)return e.getAttribute("ref")}(r);if(e)return 1===(e=e.split(":").map(Rr).map((function(r){var e=Gr(r,2);return{row:e[0],column:e[1]}}))).length&&(e=[e[0],e[0]]),e}function Hr(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(t)return(t=t.call(r)).next.bind(t);if(Array.isArray(r)||(t=function(r,e){if(!r)return;if("string"==typeof r)return Jr(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);"Object"===t&&r.constructor&&(t=r.constructor.name);if("Map"===t||"Set"===t)return Array.from(r);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Jr(r,e)}(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var n=0;return function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Jr(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function Kr(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(t)return(t=t.call(r)).next.bind(t);if(Array.isArray(r)||(t=function(r,e){if(!r)return;if("string"==typeof r)return Qr(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);"Object"===t&&r.constructor&&(t=r.constructor.name);if("Map"===t||"Set"===t)return Array.from(r);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Qr(r,e)}(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var n=0;return function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Qr(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function Yr(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var n,o,i,a,u=[],f=!0,l=!1;try{if(i=(t=t.call(r)).next,0===e){if(Object(t)!==t)return;f=!1}else for(;!(f=(n=i.call(t)).done)&&(u.push(n.value),u.length!==e);f=!0);}catch(r){l=!0,o=r}finally{try{if(!f&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(r,e)||Zr(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Zr(r,e){if(r){if("string"==typeof r)return re(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?re(r,e):void 0}}function re(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function ee(r,e){if(0===r.length)return[];var t=Yr(e,2);t[0];for(var n=t[1],o=n.column,i=n.row,a=new Array(i),u=0;u<i;){a[u]=new Array(o);for(var f=0;f<o;)a[u][f]=null,f++;u++}for(var l,c=function(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(t)return(t=t.call(r)).next.bind(t);if(Array.isArray(r)||(t=Zr(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var n=0;return function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(r);!(l=c()).done;){var s=l.value,m=s.row-1,d=s.column-1;d<o&&m<i&&(a[m][d]=s.value)}return a=function(r){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.rowIndexSourceMap,n=e.accessor,o=void 0===n?function(r){return r}:n,i=e.onlyTrimAtTheEnd,a=r.length-1;a>=0;){for(var u,f=!0,l=Hr(r[a]);!(u=l()).done;)if(null!==o(u.value)){f=!1;break}if(f)r.splice(a,1),t&&t.splice(a,1);else if(i)break;a--}return r}(function(r){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.accessor,n=void 0===t?function(r){return r}:t,o=e.onlyTrimAtTheEnd,i=r[0].length-1;i>=0;){for(var a,u=!0,f=Kr(r);!(a=f()).done;)if(null!==n(a.value[i])){u=!1;break}if(u)for(var l=0;l<r.length;)r[l].splice(i,1),l++;else if(o)break;i--}return r}(a,{onlyTrimAtTheEnd:!0}),{onlyTrimAtTheEnd:!0}),a}function te(r,e,t,n,o,i){var a=e.createDocument(r),u=Wr(a,t,n,o,i),f=qr(a)||function(r){var e=function(r,e){return r-e},t=r.map((function(r){return r.row})).sort(e),n=r.map((function(r){return r.column})).sort(e),o=t[0],i=t[t.length-1];return[{row:o,column:n[0]},{row:i,column:n[n.length-1]}]}(u);return ee(u,f)}function ne(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(t)return(t=t.call(r)).next.bind(t);if(Array.isArray(r)||(t=function(r,e){if(!r)return;if("string"==typeof r)return oe(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);"Object"===t&&r.constructor&&(t=r.constructor.name);if("Map"===t||"Set"===t)return Array.from(r);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return oe(r,e)}(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var n=0;return function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function oe(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function ie(r,e){for(var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=function(e){if(!r[e])throw new Error('"'.concat(e,'" file not found inside the *.xlsx file zip archive'));return r[e]},o=sr(n("xl/_rels/workbook.xml.rels"),e),i=o.sharedStrings?function(r,e){return r?ur(e.createDocument(r)):[]}(n(o.sharedStrings),e):[],a=o.styles?br(n(o.styles),e):{},u=cr(n("xl/workbook.xml"),e),f=u.sheets,l=u.epoch1904,c=t.sheets&&t.sheets.map((function(r){return function(r,e){if("string"==typeof r){for(var t,n=ne(e);!(t=n()).done;){var o=t.value;if(o.name===r)return o.relationId}throw new Error('Sheet "'.concat(r,'" not found. Available sheets: ').concat(e.map((function(r){var e=r.name;return'"'.concat(e,'"')})).join(", ")))}if(r<=e.length)return e[r-1].relationId;throw new Error("Sheet number out of bounds: ".concat(r,". Available sheets count: ").concat(e.length))}(r,f)})),s=[],m=0,d=Object.keys(o.sheets);m<d.length;m++){var v=d[m];c&&!c.includes(v)||s.push({sheet:ae(v,f),data:te(n(o.sheets[v]),e,i,a,l,t)})}return s}function ae(r,e){for(var t,n=ne(e);!(t=n()).done;){var o=t.value;if(o.relationId===r)return o.name}throw new Error("Sheet ID not found: ".concat(r))}return function(e,t){return function(r){return r instanceof File||r instanceof Blob?r.arrayBuffer().then(Z):Promise.resolve(r).then(Z)}(e).then((function(e){return ie(e,r,t)}))}}));
|
|
1
|
+
!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(r="undefined"!=typeof globalThis?globalThis:r||self).readXlsxFile=e()}(this,(function(){"use strict";var r={createDocument:function(r){return(new DOMParser).parseFromString(r.trim(),"text/xml")}},e={},t=Uint8Array,n=Uint16Array,o=Int32Array,i=new 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,0,0,0]),a=new t([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]),u=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),f=function(r,e){for(var t=new n(31),i=0;i<31;++i)t[i]=e+=1<<r[i-1];var a=new o(t[30]);for(i=1;i<30;++i)for(var u=t[i];u<t[i+1];++u)a[u]=u-t[i]<<5|i;return{b:t,r:a}},l=f(i,2),c=l.b,s=l.r;c[28]=258,s[258]=28;for(var m=f(a,0).b,d=new n(32768),v=0;v<32768;++v){var h=(43690&v)>>1|(21845&v)<<1;h=(61680&(h=(52428&h)>>2|(13107&h)<<2))>>4|(3855&h)<<4,d[v]=((65280&h)>>8|(255&h)<<8)>>1}var y=function(r,e,t){for(var o=r.length,i=0,a=new n(e);i<o;++i)r[i]&&++a[r[i]-1];var u,f=new n(e);for(i=1;i<e;++i)f[i]=f[i-1]+a[i-1]<<1;if(t){u=new n(1<<e);var l=15-e;for(i=0;i<o;++i)if(r[i])for(var c=i<<4|r[i],s=e-r[i],m=f[r[i]-1]++<<s,v=m|(1<<s)-1;m<=v;++m)u[d[m]>>l]=c}else for(u=new n(o),i=0;i<o;++i)r[i]&&(u[i]=d[f[r[i]-1]++]>>15-r[i]);return u},b=new t(288);for(v=0;v<144;++v)b[v]=8;for(v=144;v<256;++v)b[v]=9;for(v=256;v<280;++v)b[v]=7;for(v=280;v<288;++v)b[v]=8;var p=new t(32);for(v=0;v<32;++v)p[v]=5;var g=y(b,9,1),w=y(p,5,1),A=function(r){for(var e=r[0],t=1;t<r.length;++t)r[t]>e&&(e=r[t]);return e},S=function(r,e,t){var n=e/8|0;return(r[n]|r[n+1]<<8)>>(7&e)&t},O=function(r,e){var t=e/8|0;return(r[t]|r[t+1]<<8|r[t+2]<<16)>>(7&e)},x=function(r){return(r+7)/8|0},I=function(r,e,n){return(null==e||e<0)&&(e=0),(null==n||n>r.length)&&(n=r.length),new t(r.subarray(e,n))},j=["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"],E=function(r,e,t){var n=new Error(e||j[r]);if(n.code=r,Error.captureStackTrace&&Error.captureStackTrace(n,E),!t)throw n;return n},k=function(r,e,n,o){var f=r.length,l=o?o.length:0;if(!f||e.f&&!e.l)return n||new t(0);var s=!n,d=s||2!=e.i,v=e.i;s&&(n=new t(3*f));var h=function(r){var e=n.length;if(r>e){var o=new t(Math.max(2*e,r));o.set(n),n=o}},b=e.f||0,p=e.p||0,j=e.b||0,k=e.l,T=e.d,N=e.m,C=e.n,D=8*f;do{if(!k){b=S(r,p,1);var M=S(r,p+1,3);if(p+=3,!M){var F=r[(G=x(p)+4)-4]|r[G-3]<<8,U=G+F;if(U>f){v&&E(0);break}d&&h(j+F),n.set(r.subarray(G,U),j),e.b=j+=F,e.p=p=8*U,e.f=b;continue}if(1==M)k=g,T=w,N=9,C=5;else if(2==M){var P=S(r,p,31)+257,$=S(r,p+10,15)+4,z=P+S(r,p+5,31)+1;p+=14;for(var L=new t(z),R=new t(19),X=0;X<$;++X)R[u[X]]=S(r,p+3*X,7);p+=3*$;var B=A(R),V=(1<<B)-1,W=y(R,B,1);for(X=0;X<z;){var G,_=W[S(r,p,V)];if(p+=15&_,(G=_>>4)<16)L[X++]=G;else{var q=0,H=0;for(16==G?(H=3+S(r,p,3),p+=2,q=L[X-1]):17==G?(H=3+S(r,p,7),p+=3):18==G&&(H=11+S(r,p,127),p+=7);H--;)L[X++]=q}}var J=L.subarray(0,P),K=L.subarray(P);N=A(J),C=A(K),k=y(J,N,1),T=y(K,C,1)}else E(1);if(p>D){v&&E(0);break}}d&&h(j+131072);for(var Q=(1<<N)-1,Y=(1<<C)-1,Z=p;;Z=p){var rr=(q=k[O(r,p)&Q])>>4;if((p+=15&q)>D){v&&E(0);break}if(q||E(2),rr<256)n[j++]=rr;else{if(256==rr){Z=p,k=null;break}var er=rr-254;if(rr>264){var tr=i[X=rr-257];er=S(r,p,(1<<tr)-1)+c[X],p+=tr}var nr=T[O(r,p)&Y],or=nr>>4;nr||E(3),p+=15&nr;K=m[or];if(or>3){tr=a[or];K+=O(r,p)&(1<<tr)-1,p+=tr}if(p>D){v&&E(0);break}d&&h(j+131072);var ir=j+er;if(j<K){var ar=l-K,ur=Math.min(K,ir);for(ar+j<0&&E(3);j<ur;++j)n[j]=o[ar+j]}for(;j<ir;++j)n[j]=n[j-K]}}e.l=k,e.p=Z,e.b=j,e.f=b,k&&(b=1,e.m=N,e.d=T,e.n=C)}while(!b);return j!=n.length&&s?I(n,0,j):n.subarray(0,j)},T=new t(0),N=function(r,e,t){for(var n=r(),o=r.toString(),i=o.slice(o.indexOf("[")+1,o.lastIndexOf("]")).replace(/\s+/g,"").split(","),a=0;a<n.length;++a){var u=n[a],f=i[a];if("function"==typeof u){e+=";"+f+"=";var l=u.toString();if(u.prototype)if(-1!=l.indexOf("[native code]")){var c=l.indexOf(" ",8)+1;e+=l.slice(c,l.indexOf("(",c))}else for(var s in e+=l,u.prototype)e+=";"+f+".prototype."+s+"="+u.prototype[s].toString();else e+=l}else t[f]=u}return e},C=[],D=function(r,t,n,o){if(!C[n]){for(var i="",a={},u=r.length-1,f=0;f<u;++f)i=N(r[f],i,a);C[n]={c:N(r[u],i,a),e:a}}var l=function(r,e){var t={};for(var n in r)t[n]=r[n];for(var n in e)t[n]=e[n];return t}({},C[n].e);return function(r,t,n,o,i){var a=new Worker(e[t]||(e[t]=URL.createObjectURL(new Blob([r+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return a.onmessage=function(r){var e=r.data,t=e.$e$;if(t){var n=new Error(t[0]);n.code=t[1],n.stack=t[2],i(n,null)}else i(null,e)},a.postMessage(n,o),a}(C[n].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",n,l,function(r){var e=[];for(var t in r)r[t].buffer&&e.push((r[t]=new r[t].constructor(r[t])).buffer);return e}(l),o)},M=function(){return[t,n,o,i,a,u,c,m,g,w,d,j,y,A,S,O,x,I,E,k,R,F,U]},F=function(r){return postMessage(r,[r.buffer])},U=function(r){return r&&{out:r.size&&new t(r.size),dictionary:r.dictionary}},P=function(r,e,t,n,o,i){var a=D(t,n,o,(function(r,e){a.terminate(),i(r,e)}));return a.postMessage([r,e],e.consume?[r.buffer]:[]),function(){a.terminate()}},$=function(r,e){return r[e]|r[e+1]<<8},z=function(r,e){return(r[e]|r[e+1]<<8|r[e+2]<<16|r[e+3]<<24)>>>0},L=function(r,e){return z(r,e)+4294967296*z(r,e+4)};function R(r,e){return k(r,{i:2},e&&e.out,e&&e.dictionary)}var X="undefined"!=typeof TextDecoder&&new TextDecoder;try{X.decode(T,{stream:!0}),1}catch(r){}var B=function(r){for(var e="",t=0;;){var n=r[t++],o=(n>127)+(n>223)+(n>239);if(t+o>r.length)return{s:e,r:I(r,t-1)};o?3==o?(n=((15&n)<<18|(63&r[t++])<<12|(63&r[t++])<<6|63&r[t++])-65536,e+=String.fromCharCode(55296|n>>10,56320|1023&n)):e+=1&o?String.fromCharCode((31&n)<<6|63&r[t++]):String.fromCharCode((15&n)<<12|(63&r[t++])<<6|63&r[t++]):e+=String.fromCharCode(n)}};function V(r,e){if(e){for(var t="",n=0;n<r.length;n+=16384)t+=String.fromCharCode.apply(null,r.subarray(n,n+16384));return t}if(X)return X.decode(r);var o=B(r),i=o.s;return(t=o.r).length&&E(8),i}var W=function(r,e){return e+30+$(r,e+26)+$(r,e+28)},G=function(r,e,t){var n=$(r,e+28),o=$(r,e+30),i=V(r.subarray(e+46,e+46+n),!(2048&$(r,e+8))),a=e+46+n,u=_(r,a,o,t,z(r,e+20),z(r,e+24),z(r,e+42)),f=u[0],l=u[1],c=u[2];return[$(r,e+10),f,l,i,a+o+$(r,e+32),c]},_=function(r,e,t,n,o,i,a){var u=4294967295==o,f=4294967295==i,l=4294967295==a,c=e+t;if(n&&u+f+l){for(;e+4<c;e+=4+$(r,e+2))if(1==$(r,e))return[u?L(r,e+4+8*f):o,f?L(r,e+4):i,l?L(r,e+4+8*(f+u)):a,1];n<2&&E(13)}return[o,i,a,0]},q="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(r){r()};function H(r,e,n){n||(n=e,e={}),"function"!=typeof n&&E(7);var o=[],i=function(){for(var r=0;r<o.length;++r)o[r]()},a={},u=function(r,e){q((function(){n(r,e)}))};q((function(){u=n}));for(var f=r.length-22;101010256!=z(r,f);--f)if(!f||r.length-f>65558)return u(E(13,0,1),null),i;var l=$(r,f+8);if(l){var c=l,s=z(r,f+16),m=117853008==z(r,f-20);if(m){var d=z(r,f-12);(m=101075792==z(r,d))&&(c=l=z(r,d+32),s=z(r,d+48))}for(var v=e&&e.filter,h=function(e){var n=G(r,s,m),f=n[0],c=n[1],d=n[2],h=n[3],y=n[4],b=n[5],p=W(r,b);s=y;var g=function(r,e){r?(i(),u(r,null)):(e&&(a[h]=e),--l||u(null,a))};if(!v||v({name:h,size:c,originalSize:d,compression:f}))if(f)if(8==f){var w=r.subarray(p,p+c);if(d<524288||c>.8*d)try{g(null,R(w,{out:new t(d)}))}catch(r){g(r,null)}else o.push(function(r,e,t){return t||(t=e,e={}),"function"!=typeof t&&E(7),P(r,e,[M],(function(r){return F(R(r.data[0],U(r.data[1])))}),1,t)}(w,{size:d},g))}else g(E(14,"unknown compression type "+f,1),null);else g(null,I(r,p,p+c));else g(null,null)},y=0;y<c;++y)h()}else u(null,{});return i}function J(r,e){return function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.filter,n=arguments.length>2?arguments[2]:void 0;return n(new Uint8Array(r),{filter:function(r){return!t||t({path:r.name})}})}(r,e,K,!0)}function K(r){return new Promise((function(e,t){H(r,(function(r,n){r?t(r):e(n)}))}))}function Q(r){for(var e={},t=0,n=Object.keys(r);t<n.length;t++){var o=n[t];e[o]=V(r[o])}return e}function Y(r){var e=r.path;return e.endsWith(".xml")||e.endsWith(".xml.rels")}function Z(r){return J(r,{filter:Y}).then(Q)}function rr(r,e){for(var t=0;t<r.childNodes.length;){var n=r.childNodes[t];if(1===n.nodeType&&or(n)===e)return n;t++}}function er(r,e){for(var t=[],n=0;n<r.childNodes.length;){var o=r.childNodes[n];1===o.nodeType&&or(o)===e&&t.push(o),n++}return t}function tr(r,e,t){for(var n=0;n<r.childNodes.length;){var o=r.childNodes[n];e?1===o.nodeType&&or(o)===e&&t(o,n):t(o,n),n++}}var nr=/.+\:/;function or(r){return r.tagName.replace(nr,"")}function ir(r){for(var e=0;e<r.childNodes.length;){if(1===r.childNodes[e].nodeType)return r.childNodes[e];e++}}function ar(r){if(1!==r.nodeType)return r.textContent;for(var e="<"+or(r),t=0;t<r.attributes.length;)e+=" "+r.attributes[t].name+'="'+r.attributes[t].value+'"',t++;e+=">";for(var n=0;n<r.childNodes.length;)e+=ar(r.childNodes[n]),n++;return e+="</"+or(r)+">"}function ur(r){var e,t,n=r.documentElement;return e=function(r){var e=rr(r,"t");if(e)return e.textContent;var t="";return tr(r,"r",(function(r){t+=rr(r,"t").textContent})),t},t=[],tr(n,"si",(function(r,n){t.push(e(r,n))})),t}function fr(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(t)return(t=t.call(r)).next.bind(t);if(Array.isArray(r)||(t=function(r,e){if(!r)return;if("string"==typeof r)return lr(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);"Object"===t&&r.constructor&&(t=r.constructor.name);if("Map"===t||"Set"===t)return Array.from(r);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return lr(r,e)}(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var n=0;return function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function lr(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function cr(r,e){for(var t,n=e.createDocument(r),o=rr(n.documentElement,"workbookPr"),i=Boolean(o)&&"1"===o.getAttribute("date1904"),a=[],u=fr(function(r){return er(rr(r.documentElement,"sheets"),"sheet")}(n));!(t=u()).done;){var f=t.value;f.getAttribute("name")&&a.push({id:f.getAttribute("sheetId"),name:f.getAttribute("name"),relationId:f.getAttribute("r:id")})}return{epoch1904:i,sheets:a}}function sr(r,e){var t=e.createDocument(r),n={sheets:{},sharedStrings:void 0,styles:void 0};return function(r){return er(r.documentElement,"Relationship")}(t).forEach((function(r){var e=r.getAttribute("Target");switch(r.getAttribute("Type")){case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles":n.styles=mr(e);break;case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings":n.sharedStrings=mr(e);break;case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet":n.sheets[r.getAttribute("Id")]=mr(e)}})),n}function mr(r){return"/"===r[0]?r.slice(1):"xl/"+r}function dr(r){return dr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},dr(r)}function vr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function hr(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?vr(Object(t),!0).forEach((function(e){yr(r,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):vr(Object(t)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}))}return r}function yr(r,e,t){return(e=function(r){var e=function(r,e){if("object"!==dr(r)||null===r)return r;var t=r[Symbol.toPrimitive];if(void 0!==t){var n=t.call(r,e||"default");if("object"!==dr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(r)}(r,"string");return"symbol"===dr(e)?e:String(e)}(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function br(r,e){if(!r)return{};var t,n,o=e.createDocument(r),i=(t=o,n=rr(t.documentElement,"cellStyleXfs"),n?er(n,"xf"):[]).map(gr),a=function(r){var e=rr(r.documentElement,"numFmts");return e?er(e,"numFmt"):[]}(o).map(pr).reduce((function(r,e){return r[e.id]=e,r}),[]);return function(r){var e=rr(r.documentElement,"cellXfs");return e?er(e,"xf"):[]}(o).map((function(r){return r.hasAttribute("xfId")?hr(hr({},i[r.xfId]),gr(r,a)):gr(r,a)}))}function pr(r){return{id:r.getAttribute("numFmtId"),template:r.getAttribute("formatCode")}}function gr(r,e){var t={};if(r.hasAttribute("numFmtId")){var n=r.getAttribute("numFmtId");e[n]?t.numberFormat=e[n]:t.numberFormat={id:n}}return t}var wr=17,Ar=1,Sr=1,Or=864e5,xr=365;function Ir(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(t)return(t=t.call(r)).next.bind(t);if(Array.isArray(r)||(t=function(r,e){if(!r)return;if("string"==typeof r)return jr(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);"Object"===t&&r.constructor&&(t=r.constructor.name);if("Map"===t||"Set"===t)return Array.from(r);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return jr(r,e)}(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var n=0;return function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function jr(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}var Er=/^\[\$-[^\]]+\]/,kr=/;@$/,Tr={};function Nr(r){if(r in Tr)return Tr[r];var e=function(r){r=r.toLowerCase(),r=r.replace(Er,""),r=r.replace(kr,"");var e=r.split(/\W+/);if(e.length<0)return!1;for(var t,n=Ir(e);!(t=n()).done;){var o=t.value;if(Cr.indexOf(o)<0)return!1}return!0}(r);return Tr[r]=e,e}var Cr=["ss","mm","h","hh","am","pm","d","dd","m","mm","mmm","mmmm","yy","yyyy","e"];var Dr=[27,28,29,30,31,32,33,34,35,36,50,51,52,53,54,55,56,57,58],Mr=[27,28,29,30,31,32,33,34,35,36,50,51,52,53,54,55,56,57,58],Fr=[14,15,16,17,18,19,20,21,22,45,46,47].concat(Dr).concat(Mr.filter((function(r){return Dr.indexOf(r)<0}))).concat([71,72,73,74,75,76,77,78,79,80,81].filter((function(r){return Dr.indexOf(r)<0})).filter((function(r){return Mr.indexOf(r)<0})));function Ur(r,e,t){var n=t.getInlineStringValue,o=t.getInlineStringXml,i=t.getStyleId,a=t.styles,u=t.sharedStrings,f=t.epoch1904,l=t.options;switch(e||(e="n"),e){case"str":r=Pr(r,l);break;case"inlineStr":if(void 0===(r=n()))throw new Error('Unsupported "inline string" cell value structure: '.concat(o()));r=Pr(r,l);break;case"s":var c=Number(r);if(isNaN(c))throw new Error('Invalid "shared" string index: '.concat(r));if(c>=u.length)throw new Error('An out-of-bounds "shared" string index: '.concat(r));r=Pr(r=u[c],l);break;case"b":if("1"===r)r=!0;else{if("0"!==r)throw new Error('Unsupported "boolean" cell value: '.concat(r));r=!1}break;case"z":r=void 0;break;case"e":r=function(r){switch(r){case 0:return"#NULL!";case 7:return"#DIV/0!";case 15:return"#VALUE!";case 23:return"#REF!";case 29:return"#NAME?";case 36:return"#NUM!";case 42:return"#N/A";case 43:return"#GETTING_DATA";default:return"#ERROR_".concat(r)}}(r);break;case"d":if(void 0===r)break;var s=new Date(r);if(isNaN(s.valueOf()))throw new Error('Unsupported "date" cell value: '.concat(r));r=s;break;case"n":if(void 0===r)break;var m=i();if(m&&function(r,e,t){if(r){var n=e[r];if(!n)throw new Error("Cell style not found: ".concat(r));if(!n.numberFormat)return!1;if(Fr.indexOf(Number(n.numberFormat.id))>=0||t.dateFormat&&n.numberFormat.template===t.dateFormat||!1!==t.smartDateParser&&n.numberFormat.template&&Nr(n.numberFormat.template))return!0}}(m,a,l))r=function(r,e){e&&e.epoch1904&&(r+=4*xr+Ar+Sr);var t=Ar+Sr+70*xr+wr;return new Date(Math.floor((r-t)*Or))}(r=$r(r),{epoch1904:f});else r=(l.parseNumber||$r)(r);break;default:throw new TypeError("Cell type not supported: ".concat(e))}return void 0===r&&(r=null),r}function Pr(r,e){return!1!==e.trim&&(r=r.trim()),""===r&&(r=void 0),r}function $r(r){var e=Number(r);if(isNaN(e))throw new Error('Invalid "numeric" cell value: '.concat(r));return e}function zr(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var n,o,i,a,u=[],f=!0,l=!1;try{if(i=(t=t.call(r)).next,0===e){if(Object(t)!==t)return;f=!1}else for(;!(f=(n=i.call(t)).done)&&(u.push(n.value),u.length!==e);f=!0);}catch(r){l=!0,o=r}finally{try{if(!f&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(r,e)||function(r,e){if(!r)return;if("string"==typeof r)return Lr(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);"Object"===t&&r.constructor&&(t=r.constructor.name);if("Map"===t||"Set"===t)return Array.from(r);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Lr(r,e)}(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Lr(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function Rr(r){var e=zr(r.split(/(\d+)/),2),t=e[0],n=e[1];return[Number(n),Br(t.trim())]}var Xr=["","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];function Br(r){for(var e=0,t=0;t<r.length;)e*=26,e+=Xr.indexOf(r[t]),t++;return e}function Vr(r,e,t,n,o,i){var a=Rr(r.getAttribute("r")),u=function(r,e){return rr(e,"v")}(0,r),f=u&&u.textContent,l=r.getAttribute("t");return{row:a[0],column:a[1],value:Ur(f,l,{getInlineStringValue:function(){return function(r,e){var t=ir(e);if(t&&"is"===or(t)){var n=ir(t);if(n&&"t"===or(n))return n.textContent}}(0,r)},getInlineStringXml:function(){return ar(r)},getStyleId:function(){return r.getAttribute("s")},styles:n,sharedStrings:t,epoch1904:o,options:i})}}function Wr(r,e,t,n,o){var i=function(r){var e=rr(r.documentElement,"sheetData"),t=[];return tr(e,"row",(function(r){tr(r,"c",(function(r){t.push(r)}))})),t}(r);return 0===i.length?[]:i.map((function(r){return Vr(r,0,e,t,n,o)}))}function Gr(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var n,o,i,a,u=[],f=!0,l=!1;try{if(i=(t=t.call(r)).next,0===e){if(Object(t)!==t)return;f=!1}else for(;!(f=(n=i.call(t)).done)&&(u.push(n.value),u.length!==e);f=!0);}catch(r){l=!0,o=r}finally{try{if(!f&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(r,e)||function(r,e){if(!r)return;if("string"==typeof r)return _r(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);"Object"===t&&r.constructor&&(t=r.constructor.name);if("Map"===t||"Set"===t)return Array.from(r);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return _r(r,e)}(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _r(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function qr(r){var e=function(r){var e=rr(r.documentElement,"dimension");if(e)return e.getAttribute("ref")}(r);if(e)return 1===(e=e.split(":").map(Rr).map((function(r){var e=Gr(r,2);return{row:e[0],column:e[1]}}))).length&&(e=[e[0],e[0]]),e}function Hr(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(t)return(t=t.call(r)).next.bind(t);if(Array.isArray(r)||(t=function(r,e){if(!r)return;if("string"==typeof r)return Jr(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);"Object"===t&&r.constructor&&(t=r.constructor.name);if("Map"===t||"Set"===t)return Array.from(r);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Jr(r,e)}(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var n=0;return function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Jr(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function Kr(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(t)return(t=t.call(r)).next.bind(t);if(Array.isArray(r)||(t=function(r,e){if(!r)return;if("string"==typeof r)return Qr(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);"Object"===t&&r.constructor&&(t=r.constructor.name);if("Map"===t||"Set"===t)return Array.from(r);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Qr(r,e)}(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var n=0;return function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Qr(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function Yr(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var n,o,i,a,u=[],f=!0,l=!1;try{if(i=(t=t.call(r)).next,0===e){if(Object(t)!==t)return;f=!1}else for(;!(f=(n=i.call(t)).done)&&(u.push(n.value),u.length!==e);f=!0);}catch(r){l=!0,o=r}finally{try{if(!f&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(r,e)||Zr(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Zr(r,e){if(r){if("string"==typeof r)return re(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?re(r,e):void 0}}function re(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function ee(r,e){if(0===r.length)return[];var t=Yr(e,2);t[0];for(var n=t[1],o=n.column,i=n.row,a=new Array(i),u=0;u<i;){a[u]=new Array(o);for(var f=0;f<o;)a[u][f]=null,f++;u++}for(var l,c=function(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(t)return(t=t.call(r)).next.bind(t);if(Array.isArray(r)||(t=Zr(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var n=0;return function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(r);!(l=c()).done;){var s=l.value,m=s.row-1,d=s.column-1;d<o&&m<i&&(a[m][d]=s.value)}return a=function(r){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.rowIndexSourceMap,n=e.accessor,o=void 0===n?function(r){return r}:n,i=e.onlyTrimAtTheEnd,a=r.length-1;a>=0;){for(var u,f=!0,l=Hr(r[a]);!(u=l()).done;)if(null!==o(u.value)){f=!1;break}if(f)r.splice(a,1),t&&t.splice(a,1);else if(i)break;a--}return r}(function(r){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.accessor,n=void 0===t?function(r){return r}:t,o=e.onlyTrimAtTheEnd,i=r[0].length-1;i>=0;){for(var a,u=!0,f=Kr(r);!(a=f()).done;)if(null!==n(a.value[i])){u=!1;break}if(u)for(var l=0;l<r.length;)r[l].splice(i,1),l++;else if(o)break;i--}return r}(a,{onlyTrimAtTheEnd:!0}),{onlyTrimAtTheEnd:!0}),a}function te(r,e,t,n,o,i){var a=e.createDocument(r),u=Wr(a,t,n,o,i),f=qr(a)||function(r){var e=function(r,e){return r-e},t=r.map((function(r){return r.row})).sort(e),n=r.map((function(r){return r.column})).sort(e),o=t[0],i=t[t.length-1];return[{row:o,column:n[0]},{row:i,column:n[n.length-1]}]}(u);return ee(u,f)}function ne(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(t)return(t=t.call(r)).next.bind(t);if(Array.isArray(r)||(t=function(r,e){if(!r)return;if("string"==typeof r)return oe(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);"Object"===t&&r.constructor&&(t=r.constructor.name);if("Map"===t||"Set"===t)return Array.from(r);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return oe(r,e)}(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var n=0;return function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function oe(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function ie(r,e){for(var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=function(e){if(!r[e])throw new Error('"'.concat(e,'" file not found inside the *.xlsx file zip archive'));return r[e]},o=sr(n("xl/_rels/workbook.xml.rels"),e),i=o.sharedStrings?function(r,e){return r?ur(e.createDocument(r)):[]}(n(o.sharedStrings),e):[],a=o.styles?br(n(o.styles),e):{},u=cr(n("xl/workbook.xml"),e),f=u.sheets,l=u.epoch1904,c=t.sheets&&t.sheets.map((function(r){return function(r,e){if("string"==typeof r){for(var t,n=ne(e);!(t=n()).done;){var o=t.value;if(o.name===r)return o.relationId}throw new Error('Sheet "'.concat(r,'" not found. Available sheets: ').concat(e.map((function(r){var e=r.name;return'"'.concat(e,'"')})).join(", ")))}if(r<=e.length)return e[r-1].relationId;throw new Error("Sheet number out of bounds: ".concat(r,". Available sheets count: ").concat(e.length))}(r,f)})),s=[],m=0,d=Object.keys(o.sheets);m<d.length;m++){var v=d[m];c&&!c.includes(v)||s.push({sheet:ae(v,f),data:te(n(o.sheets[v]),e,i,a,l,t)})}return s}function ae(r,e){for(var t,n=ne(e);!(t=n()).done;){var o=t.value;if(o.relationId===r)return o.name}throw new Error("Sheet ID not found: ".concat(r))}return function(e,t){return function(r){return r instanceof File||r instanceof Blob?r.arrayBuffer().then(Z):Promise.resolve(r).then(Z)}(e).then((function(e){return ie(e,r,t)}))}}));
|
|
2
2
|
//# sourceMappingURL=read-excel-file.min.js.map
|