read-excel-file 8.0.0 → 8.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # `read-excel-file`
2
2
 
3
- Read `.xlsx` files in a browser or in Node.js.
3
+ Read `.xlsx` files in a browser or Node.js.
4
4
 
5
5
  It also supports parsing spreadsheet rows into JSON objects using a [schema](#schema).
6
6
 
@@ -59,33 +59,42 @@ Also check out [`write-excel-file`](https://www.npmjs.com/package/write-excel-fi
59
59
  * `ParsedObjectsResult` → `ParseDataResult`
60
60
  </details>
61
61
 
62
- ## Performance
63
-
64
- Here're the results of reading [sample `.xlsx` files](https://examplefile.com/document/xlsx) of different size:
65
-
66
- |File Size| Browser | Node.js |
67
- |---------|---------|-----------|
68
- | 1 MB | 0.2 sec.| 0.25 sec. |
69
- | 10 MB | 1.5 sec.| 2 sec. |
70
- | 50 MB | 8.5 sec.| 14 sec. |
71
-
72
62
  ## Install
73
63
 
74
64
  ```js
75
65
  npm install read-excel-file --save
76
66
  ```
77
67
 
78
- Alternatively, one could include it on a web page [directly](#cdn) via a `<script/>` tag.
68
+ Alternatively, it could be included on a web page [directly](#cdn) via a `<script/>` tag.
79
69
 
80
70
  ## Use
81
71
 
82
- The default exported function let's call it `readExcelFile()` reads an `.xslx` file and returns a `Promise` that resolves to an array of "sheets". At least one "sheet" always exists. Each "sheet" is an object with properties:
83
- * `sheet` — Sheet name.
84
- * Example: `"Sheet1"`
85
- * `data` Sheet data. An array of rows. Each row is an array of values — `string`, `number`, `boolean` or `Date`.
86
- * Example: `[ ['John Smith',35,true,...], ['Kate Brown',28,false,...], ... ]`
72
+ If your `.xlsx` file only has a single "sheet", or if you only care for a single "sheet", or if you don't know or care what a "sheet" is, use `readSheet()` function.
73
+
74
+ ```js
75
+ import { readSheet } from 'read-excel-file/node'
76
+
77
+ await readSheet(file)
78
+
79
+ // Returns
80
+ [
81
+ ['John Smith',35,true,...],
82
+ ['Kate Brown',28,false,...],
83
+ ...
84
+ ]
85
+ ```
86
+
87
+ It resolves to an array of rows. Each row is an array of values — `string`, `number`, `boolean` or `Date`.
88
+
89
+ <!-- It's same as the default exported function shown above with the only difference that it returns just `data` instead of `[{ name: 'Sheet1', data }]`, so it's just a bit simpler to use. It has an optional second argument — `sheet` — which could be a sheet number (starting from `1`) or a sheet name. By default, it reads the first sheet. -->
90
+
91
+ And it has an optional second argument — `sheet` — which could be a sheet number (starting from `1`) or a sheet name. By default, it reads the first sheet.
92
+
93
+ But if you need to read all "sheets" for some reason, use the default exported function which resolves to an array of "sheets".
87
94
 
88
95
  ```js
96
+ import readExcelFile from 'read-excel-file/node'
97
+
89
98
  await readExcelFile(file)
90
99
 
91
100
  // Returns
@@ -102,20 +111,13 @@ await readExcelFile(file)
102
111
  }]
103
112
  ```
104
113
 
105
- In simple cases when there're no multiple sheets in an `.xlsx` file, or if only one sheet in an `.xlsx` file is of any interest, use a named exported function `readSheet()`. It's same as the default exported function shown above with the only difference that it returns just `data` instead of `[{ name: 'Sheet1', data }]`, so it's just a bit simpler to use. It has an optional second argument — `sheet` — which could be a sheet number (starting from `1`) or a sheet name. By default, it reads the first sheet.
106
-
107
- ```js
108
- await readSheet(file)
109
-
110
- // Returns
111
- [
112
- ['John Smith',35,true,...],
113
- ['Kate Brown',28,false,...],
114
- ...
115
- ]
116
- ```
114
+ At least one "sheet" always exists. Each "sheet" is an object with properties:
115
+ * `sheet` — Sheet name.
116
+ * Example: `"Sheet1"`
117
+ * `data` — Sheet data. An array of rows. Each row is an array of values — `string`, `number`, `boolean` or `Date`.
118
+ * Example: `[ ['John Smith',35,true,...], ['Kate Brown',28,false,...], ... ]`
117
119
 
118
- As for where to `import` those two functions from, the package provides a separate `import` path for each different environment, as described below.
120
+ This package provides a separate `import` path for each different environment, as described below.
119
121
 
120
122
  ### Browser
121
123
 
@@ -259,6 +261,16 @@ readExcelFile(file, {
259
261
 
260
262
  This package doesn't support reading cells that use formulas to calculate the value: `SUM`, `AVERAGE`, etc.
261
263
 
264
+ ## Performance
265
+
266
+ Here're the results of reading [sample `.xlsx` files](https://examplefile.com/document/xlsx) of different size:
267
+
268
+ |File Size| Browser | Node.js |
269
+ |---------|---------|-----------|
270
+ | 1 MB | 0.2 sec.| 0.25 sec. |
271
+ | 10 MB | 1.5 sec.| 2 sec. |
272
+ | 50 MB | 8.5 sec.| 14 sec. |
273
+
262
274
  ## Schema
263
275
 
264
276
  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 exports a named function `parseData(data, schema)` which does exactly that. It parses sheet data into an array of JSON objects according to a pre-defined `schema` which describes how should a row of data be converted to a JSON object.
@@ -372,8 +384,8 @@ const schema = {
372
384
  contact: {
373
385
  column: 'CONTACT',
374
386
  required: true,
375
- // A custom `type` transformation function can be specified.
376
- // It will transform the cell value if it's not empty.
387
+ // A custom `type` parsing function can be specified.
388
+ // It will parse the cell value if it's not empty.
377
389
  type: (value) => {
378
390
  const number = parsePhoneNumber(value)
379
391
  if (!number) {
@@ -395,12 +407,14 @@ const schema = {
395
407
 
396
408
  const data = await readSheet(file)
397
409
 
398
- const { rows, errors } = parseData(data, schema)
410
+ const results = parseData(data, schema)
399
411
 
400
- // `errors` list items have shape: `{ row, column, error, reason?, value?, type? }`.
401
- errors.length === 0
412
+ results.length === 1
402
413
 
403
- rows === [{
414
+ // `errors` items have shape: `{ column, error, reason?, value?, type? }`.
415
+ results[0].errors === undefined
416
+
417
+ results[0].object === {
404
418
  date: new Date(2018, 3 - 1, 24),
405
419
  numberOfStudents: 10,
406
420
  course: {
@@ -409,7 +423,7 @@ rows === [{
409
423
  },
410
424
  contact: '+11234567890',
411
425
  status: 'SCHEDULED'
412
- }]
426
+ }
413
427
  ```
414
428
 
415
429
  <!-- #### Schema: Tips and Features -->
@@ -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).readExcelFile=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),B=0;B<$;++B)R[u[B]]=S(r,p+3*B,7);p+=3*$;var V=A(R),W=(1<<V)-1,X=y(R,V,1);for(B=0;B<z;){var G,_=X[S(r,p,W)];if(p+=15&_,(G=_>>4)<16)L[B++]=G;else{var q=0,H=0;for(16==G?(H=3+S(r,p,3),p+=2,q=L[B-1]):17==G?(H=3+S(r,p,7),p+=3):18==G&&(H=11+S(r,p,127),p+=7);H--;)L[B++]=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[B=rr-257];er=S(r,p,(1<<tr)-1)+c[B],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 B="undefined"!=typeof TextDecoder&&new TextDecoder;try{B.decode(T,{stream:!0}),1}catch(r){}var V=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 W(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(B)return B.decode(r);var o=V(r),i=o.s;return(t=o.r).length&&E(8),i}var X=function(r,e){return e+30+$(r,e+26)+$(r,e+28)},G=function(r,e,t){var n=$(r,e+28),o=W(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=X(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]=W(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),Vr(t.trim())]}var Br=["","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 Vr(r){for(var e=0,t=0;t<r.length;)e*=26,e+=Br.indexOf(r[t]),t++;return e}function Wr(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 Xr(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 Wr(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=Xr(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=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)}))}}));
2
2
  //# sourceMappingURL=read-excel-file.min.js.map