pivotkit-xlsx 0.0.0-stage → 0.2.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 +60 -0
- package/LICENSE +21 -0
- package/README.md +42 -2
- package/dist/THIRD_PARTY_LICENSES.txt +85 -0
- package/dist/chunks/chunk-KDJGTIXW.js +1 -0
- package/dist/chunks/chunk-TEWBHPQ4.js +1 -0
- package/dist/chunks/import-csv-TRZA6M7W.js +1 -0
- package/dist/chunks/import-json-YR5ADN4H.js +1 -0
- package/dist/chunks/reader-S5MTRZAR.js +9 -0
- package/dist/index.js +1 -0
- package/package.json +66 -4
- package/src/index.js +21 -0
- package/src/reader.js +231 -0
- package/src/workbook.js +79 -0
- package/src/xml.js +593 -0
- package/src/zip.js +292 -0
- package/types/index.d.ts +3 -0
- package/types/reader.d.ts +15 -0
- package/types/workbook.d.ts +21 -0
- package/types/xml.d.ts +84 -0
- package/types/zip.d.ts +55 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `pivotkit-xlsx` are documented in this file. The format is based on
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this package adheres to
|
|
5
|
+
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.2.0] - 2026-11-13
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Depends on `pivotkit-core` `^0.5.0` (was `^0.4.0`): a host updates both together, or it gets
|
|
14
|
+
two copies of pivotkit-core.
|
|
15
|
+
- npm keywords `pivot-grid` and `pivottable`, as the repository's topics.
|
|
16
|
+
- npm keyword `pivot-table` ([#172](https://github.com/eizedev/pivotkit/issues/172)).
|
|
17
|
+
- A workbook over `limits.archiveEntries` or `limits.unpackedBytes` throws `LIMIT_EXCEEDED` with
|
|
18
|
+
`details` `{ limit, value, max, file }`, as every other limit does, not `INVALID_FILE` with the
|
|
19
|
+
reason `LIMIT` ([#208](https://github.com/eizedev/pivotkit/issues/208)).
|
|
20
|
+
- Markup between a sheet's rows that is no row (a comment) and what follows its `</sheetData>`
|
|
21
|
+
(merged cells, conditional formats, print settings) are no longer handed to read-excel-file, which
|
|
22
|
+
reads nothing there; shared strings and styles stream into the archive it gets instead of being
|
|
23
|
+
unpacked whole first.
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
|
|
27
|
+
- A workbook a few dozen kilobytes small whose XML is padded with whitespace (tens of megabytes
|
|
28
|
+
unpacked, under every default limit) took about a minute and a gigabyte of memory and then failed
|
|
29
|
+
with `DAMAGED` ("Maximum call stack size exceeded"): read-excel-file parses a sheet in pieces and
|
|
30
|
+
reads an unfinished text or tag again from its start with every piece. Runs of whitespace in text
|
|
31
|
+
and between attributes are now cut to 128 KiB before it parses a part, and a text, comment, CDATA
|
|
32
|
+
section or processing instruction of more than 1 MiB, or a tag of more than 256 KiB, is refused as
|
|
33
|
+
`DAMAGED` at once (an Excel cell holds at most 32,767 characters). Such a workbook of 50 MiB unpacked is read in about half a
|
|
34
|
+
second with about 200 MB of memory.
|
|
35
|
+
- The position of a cell or row (`r`) is read in single quotes, with whitespace around `=` and after
|
|
36
|
+
a line break too, so such a value far out is refused before parsing like any other; a row of many
|
|
37
|
+
unclosed `<c ` tags is scanned in linear time, no longer quadratic; a row inside a comment, CDATA
|
|
38
|
+
section or processing instruction between rows is no longer read as data.
|
|
39
|
+
|
|
40
|
+
## [0.1.0] - 2026-11-11
|
|
41
|
+
|
|
42
|
+
First release.
|
|
43
|
+
|
|
44
|
+
### Added
|
|
45
|
+
|
|
46
|
+
- The reader plugin for Excel workbooks (.xlsx) of `pivotkit-core/import`, plugin API 1
|
|
47
|
+
([#44](https://github.com/eizedev/pivotkit/issues/44)): the first visible sheet or the one asked for
|
|
48
|
+
(`sheets()` lists them), dates from the cell formats, a formula's saved value, a cell with an Excel
|
|
49
|
+
error as blank with a note. Before anything is parsed: `.xls`, `.xlsb`, macro and password-protected
|
|
50
|
+
workbooks are refused with what to do; the ZIP directory's parts and unpacked size are checked
|
|
51
|
+
against `limits.archiveEntries` and `limits.unpackedBytes`; a part that unpacks to more than its
|
|
52
|
+
directory states stops the read; `<!DOCTYPE` and `<!ENTITY` in an XML part are refused. Rows without
|
|
53
|
+
a value (a used range of formatted empty cells) are left out while the sheet is unpacked. Built on
|
|
54
|
+
read-excel-file 9.3.14 (MIT), which gets an uncompressed archive of only the parts it needs, so no
|
|
55
|
+
worker is started and a strict Content-Security-Policy works. `dist/` holds a bundle for pages
|
|
56
|
+
without a bundler, with `THIRD_PARTY_LICENSES.txt`.
|
|
57
|
+
|
|
58
|
+
[Unreleased]: https://github.com/eizedev/pivotkit/compare/pivotkit-xlsx@0.2.0...HEAD
|
|
59
|
+
[0.2.0]: https://github.com/eizedev/pivotkit/compare/pivotkit-xlsx@0.1.0...pivotkit-xlsx@0.2.0
|
|
60
|
+
[0.1.0]: https://github.com/eizedev/pivotkit/releases/tag/pivotkit-xlsx@0.1.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 eizedev
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,43 @@
|
|
|
1
|
-
#
|
|
1
|
+
# pivotkit-xlsx
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A reader plugin for [pivotkit](https://pivotkit.eize.dev/): it loads Excel workbooks (.xlsx) into a
|
|
4
|
+
pivot report in the browser, nothing uploaded. It checks the file before anything is parsed: `.xls`,
|
|
5
|
+
macro and password-protected workbooks, ZIP bombs and XML with a document type are refused with what
|
|
6
|
+
to do, and a used range of formatted empty cells far below the data is left out while the sheet is
|
|
7
|
+
unpacked. Built on [read-excel-file](https://www.npmjs.com/package/read-excel-file) (MIT); no worker,
|
|
8
|
+
so a strict Content-Security-Policy works.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install pivotkit-xlsx
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
ES modules for Node 22 or later and browsers from Chrome 111, Firefox 113 and Safari 16.4; it needs
|
|
17
|
+
pivotkit-core with `pivotkit-core/import` (plugin API 1). A page without a bundler serves the whole
|
|
18
|
+
`dist/` folder (the plugin and the reader chunk it loads; licences in `dist/THIRD_PARTY_LICENSES.txt`).
|
|
19
|
+
TypeScript declarations are included.
|
|
20
|
+
|
|
21
|
+
## Example
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
import { readFile } from "pivotkit-core/import";
|
|
25
|
+
import { encode } from "pivotkit-core";
|
|
26
|
+
import xlsxReader from "pivotkit-xlsx";
|
|
27
|
+
|
|
28
|
+
const table = await readFile(file, { plugins: [xlsxReader] }); // the first visible sheet
|
|
29
|
+
const data = encode(table); // typed columns for the report
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Where in the docs
|
|
33
|
+
|
|
34
|
+
| Topic | Page |
|
|
35
|
+
| --- | --- |
|
|
36
|
+
| What it reads and refuses, sizes, measurements | [Plugins: pivotkit-xlsx](https://pivotkit.eize.dev/reference/plugins/#pivotkit-xlsx) |
|
|
37
|
+
| Types, notes, limits and errors of a loaded table | [Loading files](https://pivotkit.eize.dev/reference/import/) |
|
|
38
|
+
| Security of loaded files | [Security](https://pivotkit.eize.dev/security/#loaded-files-are-untrusted-input) |
|
|
39
|
+
| Changes | [CHANGELOG](https://github.com/eizedev/pivotkit/blob/main/packages/pivotkit-xlsx/CHANGELOG.md) |
|
|
40
|
+
|
|
41
|
+
## License
|
|
42
|
+
|
|
43
|
+
[MIT](https://github.com/eizedev/pivotkit/blob/main/LICENSE)
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
pivotkit-xlsx's dist/ bundles the following packages. Their license texts follow; pivotkit-core is part of pivotkit (MIT, see LICENSE).
|
|
2
|
+
|
|
3
|
+
==============================================================================
|
|
4
|
+
fflate 0.8.3 (MIT)
|
|
5
|
+
==============================================================================
|
|
6
|
+
|
|
7
|
+
--- LICENSE ---
|
|
8
|
+
|
|
9
|
+
MIT License
|
|
10
|
+
|
|
11
|
+
Copyright (c) 2026 Arjun Barrett
|
|
12
|
+
|
|
13
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
15
|
+
in the Software without restriction, including without limitation the rights
|
|
16
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
17
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
18
|
+
furnished to do so, subject to the following conditions:
|
|
19
|
+
|
|
20
|
+
The above copyright notice and this permission notice shall be included in all
|
|
21
|
+
copies or substantial portions of the Software.
|
|
22
|
+
|
|
23
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
24
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
25
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
26
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
27
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
28
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
29
|
+
SOFTWARE.
|
|
30
|
+
|
|
31
|
+
==============================================================================
|
|
32
|
+
read-excel-file 9.3.14 (MIT)
|
|
33
|
+
==============================================================================
|
|
34
|
+
|
|
35
|
+
--- LICENSE ---
|
|
36
|
+
|
|
37
|
+
MIT License
|
|
38
|
+
|
|
39
|
+
Copyright (c) 2018 gitlab.com/catamphetamine
|
|
40
|
+
|
|
41
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
42
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
43
|
+
in the Software without restriction, including without limitation the rights
|
|
44
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
45
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
46
|
+
furnished to do so, subject to the following conditions:
|
|
47
|
+
|
|
48
|
+
The above copyright notice and this permission notice shall be included in all
|
|
49
|
+
copies or substantial portions of the Software.
|
|
50
|
+
|
|
51
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
52
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
53
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
54
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
55
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
56
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
57
|
+
SOFTWARE.
|
|
58
|
+
|
|
59
|
+
==============================================================================
|
|
60
|
+
saxen 11.2.0 (MIT)
|
|
61
|
+
==============================================================================
|
|
62
|
+
|
|
63
|
+
--- LICENSE ---
|
|
64
|
+
|
|
65
|
+
The MIT License (MIT)
|
|
66
|
+
Copyright (c) 2012 Vopilovskii Konstantin <flash.vkv@gmail.com>
|
|
67
|
+
Copyright (c) 2017-present Nico Rehwaldt
|
|
68
|
+
|
|
69
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
70
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
71
|
+
the Software without restriction, including without limitation the rights to
|
|
72
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
73
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
74
|
+
so, subject to the following conditions:
|
|
75
|
+
|
|
76
|
+
The above copyright notice and this permission notice shall be included in all
|
|
77
|
+
copies or substantial portions of the Software.
|
|
78
|
+
|
|
79
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
80
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
81
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
82
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
83
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
84
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
85
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var _=class extends Error{constructor(t,n,r={}){super(n),this.name="PivotkitError",this.code=t,this.details=r}};var R=Object.freeze({json:5e6,name:256,axisFields:8,values:16,filters:128,items:1e5,derived:64,sort:64,collapsed:1e4,topCount:1e6,textValue:1e3,srcParams:16,srcParamLength:256,rows:1e6,groups:5e5,pivotCells:2e6,work:1e8,cells:2e6,cacheEntries:16,fileBytes:104857600,columns:1e3,importCells:1e7,textLength:32767,archiveEntries:1e4,unpackedBytes:524288e3}),L=Object.freeze({groups:2**27});var _e=Object.freeze({filters:50,json:1e6});var Te=Object.freeze({perCode:100,total:1e3});function P(e){let t=e&&e.limits;if(t==null)return R;if(typeof t!="object"||Array.isArray(t))throw new _("INVALID_OPTION","options.limits must be an object");let n={...R};for(let r of Object.keys(t)){let o=t[r];if(!Object.hasOwn(R,r))throw new _("INVALID_OPTION",`unknown limit "${r}"`);if(!Number.isInteger(o)||o<1)throw new _("INVALID_OPTION",`limits.${r} must be a whole number of 1 or more`);if(Object.hasOwn(L,r)&&o>L[r])throw new _("INVALID_OPTION",`limits.${r} must be at most ${L[r]}`);n[r]=o}return Object.freeze(n)}var z=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,9}))?)?(Z|[+-]\d{2}(?::?\d{2})?)?)?$/;function J(e,t,n,r=0,o=0,l=0,u=0){if(e>=100)return Date.UTC(e,t-1,n,r,o,l,u);let s=new Date(Date.UTC(2e3,t-1,n,r,o,l,u));return s.setUTCFullYear(e),s.getTime()}function D(e){let t=z.exec(e.trim());if(!t)return null;let n=t[8],r=+t[1],o=+t[2],l=+t[3],u=t[4]===void 0?0:+t[4],s=t[5]===void 0?0:+t[5],i=t[6]===void 0?0:+t[6],f=t[7];if(o<1||o>12||l<1||u>23||s>59||i>59)return null;let a=J(r,o,l,u,s,i,f?Math.round(+`0.${f}`*1e3):0);if(new Date(a).getUTCDate()!==l)return null;let p=null;if(n)if(n==="Z")p=0;else{let h=n.slice(1).replace(":",""),T=Number(h.slice(0,2)),E=Number(h.slice(2)||0);if(T>23||E>59)return null;p=(n[0]==="-"?-1:1)*(T*60+E)}return{ms:a,offsetMinutes:p}}var V=Object.freeze(["string","number","date","boolean"]),Ae=Object.freeze(["ENCODING","SEPARATOR","LINES_SKIPPED","COLUMN_RENAMED","COLUMNS_RENAMED_MORE","COLUMN_DROPPED","COLUMNS_ADDED","ROWS_EMPTY","TEXT_CUT","CHARACTERS_REMOVED","DATE_ORDER","VALUES_NOT_CONVERTED","JSON_PROPERTY","JSON_FLATTENED","SHEET","USED_RANGE","ERROR_CELLS"]),x=20,K=50,Se=16384,b=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f-\u009f\u00ad\u061c\u180e\u200b\u200e-\u200f\u202a-\u202e\u2060-\u2064\u2066-\u206f\ufeff\u{E0000}-\u{E007F}]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/gu,W=new RegExp(b.source,"u"),F=/[\t\r\n\u2028\u2029]+/g;function be(e,t,n,r={}){return new _("INVALID_FILE",`"${t}": ${n}`,{reason:e,file:t,...r})}function q(e,t,n,r,o){let l=u=>u.toLocaleString("en-US");return new _("LIMIT_EXCEEDED",`"${r}" has more than ${l(n)} ${o} (limits.${e}): load a smaller extract of it, or a host can raise this limit`,{limit:e,value:t,max:n,file:r})}function O(e,t,n,r,o){if(t>n)throw q(e,t,n,r,o)}function Ce(e,t){let n=e&&typeof e=="object"&&typeof e.name=="string"?e.name:"",r=v(String(t?.name??n??"")).slice(0,256);return(new RegExp("\\p{Surrogate}$","u").test(r)?r.slice(0,-1):r)||"file"}async function Re(e,t,n){if(e instanceof Uint8Array)return O("fileBytes",e.byteLength,t.fileBytes,n,"bytes"),e;if(e instanceof ArrayBuffer)return O("fileBytes",e.byteLength,t.fileBytes,n,"bytes"),new Uint8Array(e);if(typeof Blob<"u"&&e instanceof Blob)return O("fileBytes",e.size,t.fileBytes,n,"bytes"),new Uint8Array(await e.arrayBuffer());throw new _("INVALID_ARGUMENT","read(file): file must be a File, a Blob, an ArrayBuffer or a Uint8Array")}function Le(e){let t=e??{};if(typeof t!="object")throw new _("INVALID_OPTION","read(file, options): options must be an object");return{...t,limits:P(t)}}var xe=()=>new Promise(e=>setTimeout(e,0));function Q(e,t){let n=r=>typeof r=="number"?r.toLocaleString("en-US"):r;switch(e){case"ENCODING":return`Read as ${t.encoding}.`;case"SEPARATOR":return`Values separated by ${t.name}.`;case"LINES_SKIPPED":return`${n(t.count)} line(s) above the column names were skipped (a title block).`;case"COLUMN_RENAMED":return t.from===""?`Column ${n(t.position)} has no name; it is named "${t.to}".`:`Column "${t.from}" is named "${t.to}".`;case"COLUMNS_RENAMED_MORE":return`${n(t.count)} more columns were renamed.`;case"COLUMN_DROPPED":return`Column ${n(t.position)} has no name and no values and was left out.`;case"COLUMNS_ADDED":return`${n(t.rows)} row(s) have more values than there are column names; the extra values are in ${n(t.count)} column(s) named "Column \u2026".`;case"ROWS_EMPTY":return`${n(t.count)} empty row(s) were left out.`;case"TEXT_CUT":return`${n(t.count)} value(s) longer than ${n(t.max)} characters were cut.`;case"CHARACTERS_REMOVED":return`Control or text direction characters were removed from ${n(t.count)} value(s).`;case"DATE_ORDER":return`Dates in "${t.column}" were read as ${t.order==="mdy"?"month/day/year":"day/month/year"}; the values fit both.`;case"VALUES_NOT_CONVERTED":return`${n(t.count)} value(s) in "${t.column}" are no ${t.type} and are empty.`;case"JSON_PROPERTY":return`The rows were read from "${t.property}".`;case"JSON_FLATTENED":return`Nested values became columns named with a dot ("${t.example}").`;case"SHEET":return Number(t.count)>1?`Read sheet "${t.sheet}" of ${n(t.count)} sheets.`:`Read sheet "${t.sheet}".`;case"USED_RANGE":return`The sheet's used range reaches row ${n(t.usedRow)}; values end at row ${n(t.lastRow)}, the empty rows below were skipped.`;case"ERROR_CELLS":return`${n(t.count)} cell(s) hold an Excel error (such as #N/A) and are empty.`;default:return e}}function N(e,t={}){let n={};for(let[r,o]of Object.entries(t))n[r]=typeof o=="string"?o.replace(b,"").slice(0,256):o;return{code:e,params:n,message:Q(e,n)}}function v(e){return e.replace(b,"").replace(F," ").trim()}var Z=/^[+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?$/,ee=/^[+-]?(?:\d{1,3}(?:\.\d{3})+|\d+)(?:,\d+)?$/,te=/^[+-]?0\d/,ne=15,B=/^(\d{1,2})\.(\d{1,2})\.(\d{4})(?:[ T,]+(\d{1,2}):(\d{2})(?::(\d{2}))?)?$/,G=/^(\d{1,2})\/(\d{1,2})\/(\d{4})(?:[ T,]+(\d{1,2}):(\d{2})(?::(\d{2}))?)?$/,re=new Set(["true","wahr"]),oe=new Set(["false","falsch"]),w=e=>String(e).padStart(2,"0");function I(e,t,n,r,o,l){if(t<1||t>12||n<1||r>23||o>59||l>59)return null;let u=new Date(Date.UTC(2e3,t-1,n));if(u.setUTCFullYear(e),u.getUTCDate()!==n)return null;let s=`${String(e).padStart(4,"0")}-${w(t)}-${w(n)}`;return r===0&&o===0&&l===0?s:`${s}T${w(r)}:${w(o)}:${w(l)}`}function k(e){return[+e[1],+e[2],+e[3],e[4]===void 0?0:+e[4],e[5]===void 0?0:+e[5],e[6]===void 0?0:+e[6]]}function $(e,t){if(e.length>40)return null;if(D(e)!==null)return e;let n=B.exec(e);if(n){let[r,o,l,u,s,i]=k(n);return I(l,o,r,u,s,i)}if(n=G.exec(e),n){let[r,o,l,u,s,i]=k(n);return t==="mdy"?I(l,r,o,u,s,i):I(l,o,r,u,s,i)}return null}function se(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r>=48&&r<=57&&t++}return t}function S(e,t){if(e.length>40||!(t===","?ee:Z).test(e))return null;let n=Number(t===","?e.replaceAll(".","").replace(",","."):e);return Number.isFinite(n)?n:null}function ue(e){return te.test(e)?!0:/^[+-]?\d+$/.test(e)&&se(e)>ne}function H(e){let t=e.toLowerCase();return re.has(t)?!0:oe.has(t)?!1:null}var X=864e5,ie=Date.UTC(1899,11,30);function A(e){let t=e.getTime();if(!Number.isFinite(t)||Math.abs(t)>864e13)return null;let n=Math.round(t/1e3)*1e3;Math.abs(t-n)<=2&&(t=n);let r=new Date(t).toISOString();return t%X===0?r.slice(0,10):t%1e3===0?r.slice(0,19):r.slice(0,23)}var le={string(e){return typeof e=="string"?e:e instanceof Date?A(e)??void 0:String(e)},number(e,t){if(typeof e=="number")return e;if(typeof e=="boolean")return e?1:0;if(typeof e=="string")return S(e,t.decimal)??S(e,t.decimal===","?".":",")??void 0},date(e,t){if(e instanceof Date)return A(e)??void 0;if(typeof e=="string")return $(e,t.dateOrder)??void 0;if(typeof e=="number"&&t.serialDates&&e>0&&e<2958466)return A(new Date(Math.round((ie+e*X)/1e3)*1e3))??void 0},boolean(e){if(typeof e=="boolean")return e;if(typeof e=="number")return e===1?!0:e===0?!1:void 0;if(typeof e=="string"){let t=H(e);if(t!==null)return t;let n=e.toLowerCase();if(n==="yes"||n==="1")return!0;if(n==="no"||n==="0")return!1}}};function ce(e,t,n){if(t==="string"&&e.every(u=>u===null||typeof u=="string"))return{values:e,failed:0};let r=le[t],o=new Array(e.length),l=0;for(let u=0;u<e.length;u++){let s=e[u];if(s===null){o[u]=null;continue}let i=r(s,n);i===void 0?(o[u]=null,l++):o[u]=i}return{values:o,failed:l}}function ae(e,t){let n=0,r=0,o=0,l=0;for(let s of e)s!==null&&(typeof s=="number"?n++:typeof s=="boolean"?r++:s instanceof Date?o++:l++);let u=n+r+o+l;return u===0?{type:"string"}:l===0?n===u?{type:"number"}:r===u?{type:"boolean"}:o===u?{type:"date"}:{type:"string"}:l!==u?n===0&&r===0&&e.every(s=>s===null||s instanceof Date||typeof s=="string"&&D(s)!==null)?{type:"date"}:{type:"string"}:t.textNumbers===!1?{type:e.every(s=>s===null||D(s)!==null)?"date":"string"}:fe(e,t)}function fe(e,t){let n=!0,r=!0,o=!0,l=!0,u=!1,s=!1,i=!0,f=!0;for(let a of e)if(a!==null){if(n&&H(a)===null&&(n=!1),r&&D(a)===null&&(r=!1),o&&(!B.test(a)||$(a,"dmy")===null)&&(o=!1),l){let p=a.length<=40?G.exec(a):null;p?(+p[1]>12&&(u=!0),+p[2]>12&&(s=!0)):l=!1}if((i||f)&&(ue(a)?(i=!1,f=!1):(i&&S(a,".")===null&&(i=!1),f&&S(a,",")===null&&(f=!1))),!n&&!r&&!o&&!l&&!i&&!f)return{type:"string"}}if(n)return{type:"boolean"};if(r||o)return{type:"date"};if(l&&!(u&&s)){let a=u?"dmy":s?"mdy":t.dateOrder;if(e.every(h=>h===null||$(h,a)!==null))return{type:"date",dateOrder:a,ambiguousOrder:!u&&!s}}return i&&f?{type:"number",decimal:t.decimal}:i?{type:"number",decimal:"."}:f?{type:"number",decimal:","}:{type:"string"}}function M(e,t,n){if(e==null)return null;switch(typeof e){case"string":return j(e,t,n);case"number":return Number.isFinite(e)?e:null;case"boolean":return e;case"bigint":return Number.isSafeInteger(Number(e))?Number(e):String(e);case"object":if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;try{return j(JSON.stringify(e)??"",t,n)}catch{return null}default:return null}}function j(e,t,n){let r=e;return W.test(r)&&(r=r.replace(b,""),n.removed++),r=r.replace(F," ").trim(),r.length>t&&(r=r.slice(0,t),n.cut++),r===""?null:r}function Ie(e){let{file:t,limits:n}=e,r={decimal:e.hints?.decimal??".",dateOrder:e.hints?.dateOrder??(!e.locale||/^en-US$/i.test(e.locale)?"mdy":"dmy"),...e.hints?.serialDates?{serialDates:!0}:{},...e.hints?.textNumbers===!1?{textNumbers:!1}:{}},o=[],l={removed:0,cut:0,empty:0,extraRows:0},u=[],s=null,i=0,f=0,a=[],p=()=>{O("columns",u.length+1,n.columns,t,"columns"),u.push(new Array(f).fill(null))},h=c=>{let d=0,y=new Array(c.length);for(let m=0;m<c.length;m++){let C=M(c[m],n.textLength,l);y[m]=C,C!==null&&(d=m+1)}if(d===0){l.empty++;return}for(d>i&&l.extraRows++,d>u.length&&(O("columns",d,n.columns,t,"columns"),O("importCells",(f+1)*d,n.importCells,t,"values (rows x columns)"));u.length<d;)p();f++,O("rows",f,n.rows,t,"rows"),O("importCells",f*u.length,n.importCells,t,"values (rows x columns)");for(let m=0;m<u.length;m++)u[m].push(m<d?y[m]:null)},T=c=>{s=c.map(d=>{let y=M(d,n.name,{removed:0,cut:0});return y===null?null:y instanceof Date?A(y):String(y)}),i=s.length,O("columns",i,n.columns,t,"columns");for(let d=0;d<i;d++)u.push([])},E=()=>{let c=a??[];if(a=null,s===null){let d=0,y=c.map(g=>{let U=0;for(let Y of g)M(Y,n.textLength,{removed:0,cut:0})!==null&&U++;return U});for(let g of y)d=Math.max(d,g);let m=y.findIndex(g=>g>0&&g*2>=d);m<0&&(m=c.length),y.slice(0,m).filter(g=>g>0).length>0&&o.push(N("LINES_SKIPPED",{count:m})),T(m<c.length?c[m]:[]),c.splice(0,m+1)}for(let d of c)h(d)};return{header(c){T(c)},row(c){if(a!==null&&s===null){a.push(c),a.length>=K&&E();return}a!==null&&E(),h(c)},get rowCount(){return f+(a?.length??0)},note(c,d){o.push(N(c,d))},finish(c){return a!==null&&E(),me({header:s??[],columns:u,rowCount:f,notes:o,counts:l,hints:r,limits:n,types:c})}}}function de(e,t,n){let r=[],o=new Set,l=0,u=(i,f,a)=>{l++,l<=x&&n.push(N("COLUMN_RENAMED",{position:i,from:f,to:a}))},s=i=>{let f=i;for(let a=2;o.has(f.toLowerCase());a++)f=`${i} (${a})`;return f};for(let i=0;i<t;i++){let f=i<e.length?e[i]:null,a;f===null||f===""?(a=s(`Column ${i+1}`),i<e.length&&u(i+1,"",a)):(a=s(f),a!==f&&u(i+1,f,a)),o.add(a.toLowerCase()),r.push(a)}return l>x&&n.push(N("COLUMNS_RENAMED_MORE",{count:l-x})),r}function me({header:e,columns:t,rowCount:n,notes:r,counts:o,hints:l,limits:u,types:s}){let i=[];for(let c=0;c<t.length;c++){if(!(c<e.length&&e[c]!==null&&e[c]!=="")&&t[c].every(y=>y===null)){c<e.length&&r.push(N("COLUMN_DROPPED",{position:c+1}));continue}i.push(c)}let f=i.map(c=>c<e.length?e[c]:null),a=de(f,i.length,r),p=i.map(c=>t[c]),h=i.filter(c=>c>=e.length).length;o.extraRows>0&&h>0&&r.push(N("COLUMNS_ADDED",{rows:o.extraRows,count:h})),o.empty>0&&r.push(N("ROWS_EMPTY",{count:o.empty})),o.cut>0&&r.push(N("TEXT_CUT",{count:o.cut,max:u.textLength})),o.removed>0&&r.push(N("CHARACTERS_REMOVED",{count:o.removed}));let T={columns:a,types:[],data:[],raw:p,detected:[],rowCount:n,notes:r,hints:l},E=p.map(c=>ae(c,l));return T.detected=E.map(c=>c.type),E.forEach((c,d)=>{c.ambiguousOrder&&r.push(N("DATE_ORDER",{column:a[d],order:c.dateOrder}))}),pe(T,s,E)}function pe(e,t,n){let r=he(e.columns,t),o=e.notes.filter(s=>s.code!=="VALUES_NOT_CONVERTED"),l=[],u=[];for(let s=0;s<e.columns.length;s++){let i=n?.[s],f=r[s]??e.detected[s],a=i&&i.type===f?{...e.hints,...i.decimal?{decimal:i.decimal}:{},...i.dateOrder?{dateOrder:i.dateOrder}:{}}:e.hints;if(e.types[s]===f&&e.data[s]!==void 0){l.push(f),u.push(e.data[s]);let T=e.notes.find(E=>E.code==="VALUES_NOT_CONVERTED"&&E.params.column===e.columns[s]);T&&o.push(T);continue}let{values:p,failed:h}=ce(e.raw[s],f,a);h>0&&o.push(N("VALUES_NOT_CONVERTED",{column:e.columns[s],type:f,count:h})),l.push(f),u.push(p)}return{...e,types:l,data:u,notes:o}}function he(e,t){let n=new Array(e.length).fill(void 0);if(Array.isArray(t))for(let r=0;r<e.length;r++)V.includes(t[r])&&(n[r]=t[r]);else if(t&&typeof t=="object"){let r=new Map;for(let o of Object.keys(t))V.includes(t[o])&&r.set(o.toLowerCase(),t[o]);e.forEach((o,l)=>{n[l]=r.get(o.toLowerCase())})}return n}export{_ as a,Se as b,be as c,q as d,O as e,Ce as f,Re as g,Le as h,xe as i,v as j,Ie as k};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as x}from"./chunk-KDJGTIXW.js";var l=[{bytes:[80,75,3,4],what:"a ZIP archive (an Excel workbook .xlsx is one); load it with a spreadsheet reader, or save it as CSV"},{bytes:[208,207,17,224,161,177,26,225],what:"an old Excel workbook (.xls) or a password-protected file; save it as .xlsx or CSV"},{bytes:[37,80,68,70],what:"a PDF document"},{bytes:[31,139],what:"a gzip archive; unpack it first"}],f=(t,r)=>r.every((e,o)=>t[o]===e);function d(t){let r=Math.min(t.length,4096)&-2;if(r<8)return!1;let e=0;for(let o=1;o<r;o+=2)t[o]===0&&t[o-1]!==0&&e++;return e>r/2*.9}function w(t,r){for(let s of l)if(f(t,s.bytes))throw x("WRONG_TYPE",r,`this is ${s.what}, not text.`);let e,o=0;f(t,[239,187,191])?(e="utf-8",o=3):f(t,[255,254])?(e="utf-16le",o=2):f(t,[254,255])?(e="utf-16be",o=2):d(t)&&(e="utf-16le");let a=t.subarray(o),i;if(e)i=new TextDecoder(e,{fatal:!1,ignoreBOM:!0}).decode(a);else try{i=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0}).decode(a),e="utf-8"}catch{i=new TextDecoder("windows-1252",{ignoreBOM:!0}).decode(a),e="windows-1252"}let n=i.indexOf("\0");if(n!==-1&&n<i.length-1)throw x("BINARY",r,"this file holds binary data, not text.");return{text:n===-1?i:i.slice(0,n),encoding:c[e]}}var c={"utf-8":"UTF-8","utf-16le":"UTF-16 (little endian)","utf-16be":"UTF-16 (big endian)","windows-1252":"Windows-1252"};export{w as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as y}from"./chunk-TEWBHPQ4.js";import{b as C,c as E,d as S,f as O,g as R,h as T,i as k,k as P}from"./chunk-KDJGTIXW.js";var I=[",",";"," ","|"],F={",":"commas",";":"semicolons"," ":"tabs","|":"vertical bars"},L=65536,_=100,N=34,A=10,b=13;function v(n,m,e,c,o={}){let s=m.charCodeAt(0),a=n.length,t=e,i=o.line??1;for(;t<a;){let f=i,l=[];for(;;){let r;if(n.charCodeAt(t)===N){let h=i,d=t+1,g="";for(;;){let u=n.indexOf('"',d);if(u===-1){if(o.sample)return a;throw E("UNCLOSED_QUOTE",o.file??"file",`the quote that opens a value in line ${h} is never closed.`,{line:h})}if(i+=D(n,d,u),g+=n.slice(d,u),n.charCodeAt(u+1)===N){g+='"',d=u+2;continue}t=u+1;break}let p=t;for(;p<a;){let u=n.charCodeAt(p);if(u===s||u===A||u===b)break;p++}r=p>t?g+n.slice(t,p):g,t=p}else{let h=t;for(;h<a;){let d=n.charCodeAt(h);if(d===s||d===A||d===b)break;h++}r=n.slice(t,h),t=h}if(l.push(r),o.maxFields!==void 0&&l.length>o.maxFields)throw S("columns",l.length,o.maxFields,o.file??"file","columns");let w=t<a?n.charCodeAt(t):-1;if(w===s){t++;continue}w===b?(t+=n.charCodeAt(t+1)===A?2:1,i++):w===A&&(t++,i++);break}if(c(l,f))break}return o.line=i,t}function D(n,m,e){let c=0;for(let o=m;o<e;o++){let s=n.charCodeAt(o);(s===A||s===b&&n.charCodeAt(o+1)!==A)&&c++}return c}function M(n,m,e){let c=n.slice(m,m+L),o={sep:e??",",score:-1,width:1},s=e?[e,...I.filter(a=>a!==e)]:I;for(let a of s){let t=new Map,i=0;v(c,a,0,r=>(r.length===1&&r[0]===""||(t.set(r.length,(t.get(r.length)??0)+1),i++),i>=_),{sample:!0});let f=1,l=0;for(let[r,w]of t)r>1&&(w>l||w===l&&r>f)&&(f=r,l=w);f>1&&(l>o.score||l===o.score&&f>o.width)&&(o={sep:a,score:l,width:f})}return o.sep}function U(n){if(!n)return".";try{return new Intl.NumberFormat(n).formatToParts(1.5).find(e=>e.type==="decimal")?.value===","?",":"."}catch{return"."}}async function W(n,m){let e=T(m),c=O(n,e);e.signal?.throwIfAborted();let o=await R(n,e.limits,c);e.onProgress?.({phase:"read",done:o.length,total:o.length});let{text:s,encoding:a}=y(o,c);e.signal?.throwIfAborted();let t=0,i=typeof e.separator=="string"&&e.separator.length===1?e.separator:null,f=/^sep=(.)\r?\n/i.exec(s.slice(0,8));f&&(t=f[0].length,i??=f[1]),i??=M(s,t,/\.tsv$/i.test(c)?" ":void 0);let l=P({file:c,limits:e.limits,locale:e.locale,hints:{decimal:i===";"?",":U(e.locale)}});l.note("ENCODING",{encoding:a}),l.note("SEPARATOR",{separator:i,name:F[i]??`"${i}"`});let r=t,w={file:c,line:t>0?2:1,maxFields:e.limits.columns};for(;r<s.length;){let h=0;r=v(s,i,r,d=>(l.row(d),++h>=C),w),e.onProgress?.({phase:"parse",done:r,total:s.length}),r<s.length&&(await k(),e.signal?.throwIfAborted())}return e.signal?.throwIfAborted(),l.finish(e.types)}export{M as detectSeparator,W as read,v as splitRows};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as v}from"./chunk-TEWBHPQ4.js";import{b as N,c as d,e as h,f as T,g as j,h as E,i as S,k as _}from"./chunk-KDJGTIXW.js";var z=4,w=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);function L(e){if(Array.isArray(e)){let a=e.find(r=>r!=null);return a===void 0?{kind:"objects",rows:[]}:Array.isArray(a)&&e.every(r=>r===null||Array.isArray(r))?{kind:"arrays",rows:e}:w(a)&&e.every(r=>r===null||w(r))?{kind:"objects",rows:e}:null}return w(e)?Array.isArray(e.columns)&&Array.isArray(e.data)&&e.data.every(a=>Array.isArray(a))?{kind:"columnar",columns:e.columns,data:e.data}:Array.isArray(e.columns)&&Array.isArray(e.rows)?{kind:e.rows.every(a=>a===null||Array.isArray(a))?"header":"objects",columns:e.columns,rows:e.rows}:null:null}function P(e){let a=L(e);if(a)return{shape:a,property:null};if(!w(e))return null;let r=null;for(let s of Object.keys(e)){let l=L(e[s]);if(l&&(l.kind!=="objects"||l.rows.length>0)){let f=l.rows?.length??l.data?.[0]?.length??0;(!r||f>r.size)&&(r={shape:l,property:s,size:f})}}return r}function I(e,a,r,s,l,f){for(let y of Object.keys(e)){let i=a+y,n=e[y];w(n)&&r<z&&Object.keys(n).length>0?I(n,`${i}.`,r+1,s,l,f):s.has(i)||(r>0&&(f.nested??=i),l(),s.set(i,s.size))}}function J(e,a,r,s,l){for(let f of Object.keys(e)){let y=a+f,i=e[f];if(w(i)&&r<z&&Object.keys(i).length>0)J(i,`${y}.`,r+1,s,l);else{let n=s.get(y);n!==void 0&&(l[n]=i)}}}async function $(e,a){let r=E(a),s=T(e,r);r.signal?.throwIfAborted();let l=await j(e,r.limits,s);r.onProgress?.({phase:"read",done:l.length,total:l.length});let{text:f}=v(l,s),y;try{y=JSON.parse(f)}catch(t){throw d("INVALID_JSON",s,`this is no valid JSON (${String(t.message).slice(0,200)}).`)}r.signal?.throwIfAborted();let i=P(y);if(!i)throw d("NO_TABLE",s,"no table found: the JSON must be an array of objects, an array of arrays, { columns, rows } or { columns, data }, or an object with one of these under a property.");let{shape:n,property:b}=i,c=_({file:s,limits:r.limits,locale:r.locale,hints:{textNumbers:!1}});b!==null&&c.note("JSON_PROPERTY",{property:b});let m=r.limits,k=0,A=async t=>{++k%N===0&&(r.onProgress?.({phase:"parse",done:k,total:t}),await S(),r.signal?.throwIfAborted())};if(n.kind==="columnar"){let t=n.data[0]?.length??0;if(n.columns.length!==n.data.length)throw d("NO_TABLE",s,`"columns" names ${n.columns.length} columns, but "data" holds ${n.data.length} arrays.`);if(!n.data.every(o=>o.length===t))throw d("NO_TABLE",s,'the arrays in "data" have different lengths.');h("columns",n.columns.length,m.columns,s,"columns"),h("rows",t,m.rows,s,"rows"),c.header(n.columns);for(let o=0;o<t;o++)c.row(n.data.map(g=>g[o])),await A(t)}else if(n.kind==="arrays"||n.kind==="header"){let t=n.rows;h("rows",t.length,m.rows+1,s,"rows");let o=0;for(n.kind==="header"?c.header(n.columns):(c.header(t[0]??[]),o=1);o<t.length;o++)c.row(t[o]??[]),await A(t.length)}else{let t=n.rows;h("rows",t.length,m.rows,s,"rows");let o=new Map;if(Array.isArray(n.columns))for(let u of n.columns)typeof u=="string"&&!o.has(u)&&o.set(u,o.size);let g=()=>h("columns",o.size+1,m.columns,s,"columns"),p={nested:null};for(let u of t)u&&I(u,"",0,o,g,p);p.nested&&c.note("JSON_FLATTENED",{example:p.nested}),c.header([...o.keys()]);for(let u of t){let O=new Array(o.size).fill(null);u&&J(u,"",0,o,O),c.row(O),await A(t.length)}}return r.signal?.throwIfAborted(),c.finish(r.types)}export{$ as read};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{a as en,c as U,d as De,f as wr,g as br,h as xr,j as Yr,k as Hr}from"./chunk-KDJGTIXW.js";var Sr=1,Lo=/^[a-z0-9][a-z0-9-]{0,63}$/,Fo=/^\.[a-z0-9]{1,16}$/,zo=/^[a-z0-9][a-z0-9!#$&^_.+-]*\/[a-z0-9][a-z0-9!#$&^_.+-]*$/,rn=["reader"];function tn(e){let r=e,t=n=>{throw new en("INVALID_ARGUMENT",`plugin ${typeof r?.name=="string"?`"${r.name.slice(0,64)}" `:""}${n}`)};return(r===null||typeof r!="object"||Array.isArray(r))&&t("must be an object"),r.apiVersion!==Sr&&t(`uses plugin API version ${JSON.stringify(r.apiVersion)}; this pivotkit-core supports version ${Sr}. Use a version of the plugin made for API ${Sr}, or update pivotkit.`),rn.includes(r.kind)||t(`has kind ${JSON.stringify(r.kind)}; API ${Sr} knows ${rn.map(n=>`"${n}"`).join(", ")}`),(typeof r.name!="string"||!Lo.test(r.name))&&t('needs a name of lower-case letters, digits and "-"'),(typeof r.label!="string"||r.label.trim()===""||r.label.length>100)&&t("needs a label of 1 to 100 characters"),(!Array.isArray(r.accept)||r.accept.length===0||!r.accept.every(n=>typeof n=="string"&&(Fo.test(n)||zo.test(n))))&&t('needs accept: file name extensions (".xlsx") and media types ("text/csv"), in lower case'),typeof r.load!="function"&&t("needs load(): a function that imports the reader"),Object.freeze({apiVersion:r.apiVersion,kind:r.kind,name:r.name,label:r.label,accept:[...r.accept],load:r.load})}var Uo=tn({apiVersion:1,kind:"reader",name:"csv",label:"CSV or text",accept:[".csv",".tsv",".txt",".tab","text/csv","text/tab-separated-values","text/plain"],load:()=>import("./import-csv-TRZA6M7W.js")}),Vo=tn({apiVersion:1,kind:"reader",name:"json",label:"JSON",accept:[".json","application/json"],load:()=>import("./import-json-YR5ADN4H.js")}),Jf=Object.freeze([Uo,Vo]);function Zr(e){"@babel/helpers - typeof";return Zr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Zr(e)}function Kr(e){var r=String.fromCharCode,t=Object.prototype.hasOwnProperty,n=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig,o={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};Object.keys(o).forEach(function(v){o[v.toUpperCase()]=o[v]});function i(v,d,g,E){return E?t.call(o,E)?o[E]:"&"+E+";":r(d||parseInt(g,16))}function f(v){return v.length>3&&v.indexOf("&")!==-1?v.replace(n,i):v}var a="non-whitespace outside of root node";function u(v){return new Error(v)}function s(v){return"missing namespace for prefix <"+v+">"}function h(v){return{get:v,enumerable:!0}}function l(v){var d={},g;for(g in v)d[g]=v[g];return d}var c=Symbol("nameCache");function m(v){return v+"$uri"}function A(v){var d={},g,E;for(g in v)E=v[g],d[E]=E,d[m(E)]=g;return d}function _(){return{line:0,column:0}}function O(v){throw v}function P(v){if(!this)return new P(v);var d=v&&v.proxy,g,E,N,j,S=O,y,b,I,B,H=_,Oe=!1,Ee=!1,ie="",le=!1,fe=!1,Q=null,ne=!1,w,p,T,D;function C(x){x instanceof Error||(x=u(x)),Q=x,S(x,H)}function M(x){y&&(x instanceof Error||(x=u(x)),y(x,H))}this.on=function(x,G){if(typeof G!="function")throw u("required args <name, cb>");switch(x){case"openTag":E=G;break;case"text":g=G;break;case"closeTag":N=G;break;case"error":S=G;break;case"warn":y=G;break;case"cdata":j=G;break;case"attention":B=G;break;case"question":I=G;break;case"comment":b=G;break;default:throw u("unsupported event: "+x)}return this},this.ns=function(x){if(typeof x>"u"&&(x={}),Zr(x)!=="object")throw u("required args <nsMap={}>");var G={},ce;for(ce in x)G[ce]=x[ce];return fe=!0,D=G,this};function q(){w=fe?[]:null,p=fe?A(D):null,T=[],H=_,ne=!1,Q=null,Ee=!1,ie=""}this.parse=function(x){if(typeof x!="string")throw u("required args <xml=string>");if(Oe)throw u("parse during stream; call end() first");return q(),te(x),H=_,ne=!1,Q},this.write=function(x){if(typeof x!="string")throw u("required args <xml=string>");return Oe||(q(),Oe=!0),Q||(ie=te(ie+x,!0)||""),this},this.end=function(){return Oe||q(),Oe=!1,Q||te(ie),ie="",H=_,ne=!1,Q},this.stop=function(){ne=!0};function te(x){var G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ce=null,He=null,ze,Co=0,Re=!1,Te=!1,L=0,k=0,W,Ht,$,F,Ze,Ke,Z,gr,Xr,$r="",qr=0,Ue;function Zt(oe,Ae){var ue=oe.indexOf(":");if(ue===-1)return oe;var he=p[oe.substring(0,ue)];return he?Ae===he?oe.substr(ue+1):he+oe.substr(ue):(M(s(oe.substring(0,ue))),null)}function Wr(){if(Ue!==null)return Ue;var oe,Ae,ue=fe&&p.xmlns,he=fe&&le?[]:null,X=qr,ee=$r,pe=ee.length,Jt,Pe,Ie,we,Y,Je={},Qt=new Set,ge,R,z;e:for(;X<pe;X++)if(ge=!1,R=ee.charCodeAt(X),!(R===32||R<14&&R>8)){for((R<65||R>122||R>90&&R<97)&&R!==95&&R!==58&&(M("illegal first char attribute name"),ge=!0),z=X+1;z<pe;z++)if(R=ee.charCodeAt(z),!(R>96&&R<123||R>64&&R<91||R>47&&R<59||R===46||R===45||R===95)){if(R===32||R<14&&R>8){M("missing attribute value"),X=z;continue e}if(R===61)break;M("illegal attribute name char"),ge=!0}if(Y=ee.substring(X,z),Y==="xmlns:xmlns"&&(M("illegal declaration of xmlns"),ge=!0),R=ee.charCodeAt(z+1),R===34)z=ee.indexOf('"',X=z+2),z===-1&&(z=ee.indexOf("'",X),z!==-1&&(M("attribute value quote missmatch"),ge=!0));else if(R===39)z=ee.indexOf("'",X=z+2),z===-1&&(z=ee.indexOf('"',X),z!==-1&&(M("attribute value quote missmatch"),ge=!0));else for(M("missing attribute value quotes"),ge=!0,z=z+1;z<pe&&(R=ee.charCodeAt(z+1),!(R===32||R<14&&R>8));z++);for(z===-1&&(M("missing closing quotes"),z=pe,ge=!0),ge||(Ie=ee.substring(X,z)),X=z;z+1<pe&&(R=ee.charCodeAt(z+1),!(R===32||R<14&&R>8));z++)X===z&&(M("illegal character after attribute end"),ge=!0);if(X=z+1,ge)continue e;if(Qt.has(Y)){M("attribute <"+Y+"> already defined");continue}if(Qt.add(Y),!fe){Je[Y]=Ie;continue}if(le){if(Pe=Y==="xmlns"?"xmlns":Y.charCodeAt(0)===120&&Y.substr(0,6)==="xmlns:"?Y.substr(6):null,Pe!==null){if(oe=f(Ie),Ae=m(Pe),we=D[oe],!we){if(Pe==="xmlns"||Ae in p&&p[Ae]!==oe)do we="ns"+Co++;while(typeof p[we]<"u");else we=Pe;D[oe]=we}p[Pe]!==we&&(Jt||(p=l(p),Jt=!0),p[Pe]=we,Pe==="xmlns"&&(p[m(we)]=oe,ue=we),p[Ae]=oe),Je[Y]=Ie;continue}he.push(Y,Ie);continue}Y=Zt(Y,ue),Y!==null&&(Je[Y]=Ie)}if(le)for(X=0,pe=he.length;X<pe;X++)Y=Zt(he[X++],ue),Ie=he[X],Y!==null&&(Je[Y]=Ie);return Ue=Je}function Mo(){for(var oe=/(\r\n|\r|\n)/g,Ae=0,ue=0,he=0,X=k,ee,pe;L>=he&&(ee=oe.exec(x),!(!ee||(X=ee[0].length+ee.index,X>L)));)Ae+=1,he=X;return L==-1?(ue=X,pe=x.substring(k)):k===0?pe=x.substring(k,L):(ue=L-he,pe=k==-1?x.substring(L):x.substring(L,k+1)),{data:pe,line:Ae,column:ue}}for(H=Mo,d&&(Xr=Object.create({},{name:h(function(){return Z}),originalName:h(function(){return gr}),attrs:h(Wr),ns:h(function(){return p})}));k!==-1;){if(x.charCodeAt(k)===60?L=k:L=x.indexOf("<",k),L===-1){if(G)return x.substring(k);if(T.length)return C("unexpected end of file");if(!Ee)return C("missing start tag");k<x.length&&x.substring(k).trim()&&M(a);return}if(Ee||(Ee=!0),k!==L){if(T.length){if(g&&(g(x.substring(k,L),f,H),ne))return}else if(x.substring(k,L).trim()&&(M(a),ne))return}if(F=x.charCodeAt(L+1),F===33){if($=x.charCodeAt(L+2),$===91&&x.substr(L+3,6)==="CDATA["){if(k=x.indexOf("]]>",L),k===-1)return G?x.substring(L):C("unclosed cdata");if(j&&(j(x.substring(L+9,k),H),ne))return;k+=3;continue}if($===45&&x.charCodeAt(L+3)===45){if(k=x.indexOf("-->",L),k===-1)return G?x.substring(L):C("unclosed comment");if(b&&(b(x.substring(L+4,k),f,H),ne))return;k+=3;continue}}if(F===63){if(k=x.indexOf("?>",L),k===-1)return G?x.substring(L):C("unclosed question");if(I&&(I(x.substring(L,k+2),H),ne))return;k+=2;continue}for(W=L+1;;W++){if(Ze=x.charCodeAt(W),isNaN(Ze))return G?x.substring(L):(k=-1,C("unclosed tag"));if(Ze===34)$=x.indexOf('"',W+1),W=$!==-1?$:W;else if(Ze===39)$=x.indexOf("'",W+1),W=$!==-1?$:W;else if(Ze===62){k=W;break}}if(F===33){if(B&&(B(x.substring(L,k+1),f,H),ne))return;k+=1;continue}if(Ue={},F===47){if(Re=!1,Te=!0,!T.length)return C("missing open tag");if(W=Z=T.pop(),$=L+2+W.length,x.substring(L+2,$)!==W)return C("closing tag mismatch");for(;$<k;$++)if(F=x.charCodeAt($),!(F===32||F>8&&F<14))return C("close tag")}else{if(x.charCodeAt(k-1)===47?(W=Z=x.substring(L+1,k-1),Re=!0,Te=!0):(W=Z=x.substring(L+1,k),Re=!0,Te=!1),!(F>96&&F<123||F>64&&F<91||F===95||F===58))return C("illegal first char nodeName");for($=1,Ht=W.length;$<Ht;$++)if(F=W.charCodeAt($),!(F>96&&F<123||F>64&&F<91||F>47&&F<59||F===45||F===95||F==46)){if(F===32||F<14&&F>8){Z=W.substring(0,$),Ue=null;break}return C("invalid nodeName")}Te||T.push(Z)}if(fe){ze=p,Re&&(Te||w.push(ze),Ue===null&&(le=W.indexOf("xmlns",$)!==-1)&&(qr=$,$r=W,Wr(),le=!1)),gr=Z,He!==p&&(ce=p[c],ce===void 0&&(ce=p[c]={}),He=p);var Kt=ce[Z];if(Kt!==void 0)Z=Kt;else{if(F=Z.indexOf(":"),F!==-1){if(Ke=p[Z.substring(0,F)],!Ke)return C("missing namespace on <"+gr+">");Z=Z.substr(F+1)}else Ke=p.xmlns;Ke&&(Z=Ke+":"+Z),ce[gr]=Z}}if(Re&&(qr=$,$r=W,E&&(d?E(Xr,f,Te,H):E(Z,Wr,f,Te,H),ne)))return;if(Te){if(N&&(N(d?Xr:Z,f,Re,H),ne))return;fe&&(Re?p=ze:p=w.pop())}k+=1}}}return new P(e)}function Or(e,r,t,n){var o=!1,i=function(){if(o)throw new Error("Errored")},f,a=new Kr,u=function(c){i(),a.write(c)},s=function(){i(),a.end(),f()},h=new Promise(function(l,c){f=l;var m=function(v){throw o=!0,v},A=function(v,d){n&&n(d(v),e)},_=function(v,d,g,E,N){if(r){var j=d();for(var S in j)j[Jr(S,!0)]=g(j[S]);r(Jr(v),j,e)}},O=function(v){t&&t(Jr(v),e)};a.on("error",m),a.on("text",A),a.on("openTag",_),a.on("closeTag",O)});return{promise:h,write:u,end:s}}function Jr(e,r){for(var t=0;t<e.length;){if(e[t]===":"&&!(r&&t===5&&e.slice(0,5)==="xmlns"))return e.slice(t+1);t++}return e}function Ve(e){"@babel/helpers - typeof";return Ve=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ve(e)}function nn(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Go(n.key),n)}}function Bo(e,r,t){return r&&nn(e.prototype,r),t&&nn(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Go(e){var r=Xo(e,"string");return Ve(r)==="symbol"?r:String(r)}function Xo(e,r){if(Ve(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(Ve(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function $o(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function qo(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&Qe(e,r)}function Wo(e){var r=on();return function(){var n=er(e),o;if(r){var i=er(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Yo(this,o)}}function Yo(e,r){if(r&&(Ve(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ho(e)}function Ho(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Qr(e){var r=typeof Map=="function"?new Map:void 0;return Qr=function(n){if(n===null||!Zo(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r<"u"){if(r.has(n))return r.get(n);r.set(n,o)}function o(){return Er(n,arguments,er(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),Qe(o,n)},Qr(e)}function Er(e,r,t){return on()?Er=Reflect.construct.bind():Er=function(o,i,f){var a=[null];a.push.apply(a,i);var u=Function.bind.apply(o,a),s=new u;return f&&Qe(s,f.prototype),s},Er.apply(null,arguments)}function on(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Zo(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Qe(e,r){return Qe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Qe(e,r)}function er(e){return er=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},er(e)}var Ne=(function(e){qo(t,e);var r=Wo(t);function t(n){var o;return $o(this,t),o=r.call(this,n),o.name="InvalidSpreadsheetError",o}return Bo(t)})(Qr(Error));function et(e,r,t,n,o,i){var f=Or(r,t,n,o);return i?a(f,e,i):(f.write(e),f.end()),f.promise.then(function(u){return u},function(u){var s=new Ne(u.message);throw s.stack=u.stack,s.cause=u,s});function a(u,s,h,l){var c=7,m=64*1024,A=0,_=m,O=function(){A++;var d=Date.now();if(s.length>_){u.write(s.slice(0,_)),h&&h(!1),s=s.slice(_);var g=Date.now()-d;return g<c*.5?_*=2:g>c&&(_/=2),!0}else return u.write(s),u.end(),h&&h(!0),!1},P=function v(){O()&&(l?typeof setImmediate<"u"?setImmediate(v):setTimeout(v,0):v())};P()}}var an={},Ko=(function(e,r,t,n,o){var i=new Worker(an[r]||(an[r]=URL.createObjectURL(new Blob([e+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return i.onmessage=function(f){var a=f.data,u=a.$e$;if(u){var s=new Error(u[0]);s.code=u[1],s.stack=u[2],o(s,null)}else o(null,a)},i.postMessage(t,n),i}),J=Uint8Array,je=Uint16Array,sn=Int32Array,nt=new J([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]),ot=new J([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]),ln=new J([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),cn=function(e,r){for(var t=new je(31),n=0;n<31;++n)t[n]=r+=1<<e[n-1];for(var o=new sn(t[30]),n=1;n<30;++n)for(var i=t[n];i<t[n+1];++i)o[i]=i-t[n]<<5|n;return{b:t,r:o}},hn=cn(nt,2),it=hn.b,Jo=hn.r;it[28]=258,Jo[258]=28;var pn=cn(ot,0),vn=pn.b,lu=pn.r,Pr=new je(32768);for(V=0;V<32768;++V)_e=(V&43690)>>1|(V&21845)<<1,_e=(_e&52428)>>2|(_e&13107)<<2,_e=(_e&61680)>>4|(_e&3855)<<4,Pr[V]=((_e&65280)>>8|(_e&255)<<8)>>1;var _e,V,Be=(function(e,r,t){for(var n=e.length,o=0,i=new je(r);o<n;++o)e[o]&&++i[e[o]-1];var f=new je(r);for(o=1;o<r;++o)f[o]=f[o-1]+i[o-1]<<1;var a;if(t){a=new je(1<<r);var u=15-r;for(o=0;o<n;++o)if(e[o])for(var s=o<<4|e[o],h=r-e[o],l=f[e[o]-1]++<<h,c=l|(1<<h)-1;l<=c;++l)a[Pr[l]>>u]=s}else for(a=new je(n),o=0;o<n;++o)e[o]&&(a[o]=Pr[f[e[o]-1]++]>>15-e[o]);return a}),rr=new J(288);for(V=0;V<144;++V)rr[V]=8;var V;for(V=144;V<256;++V)rr[V]=9;var V;for(V=256;V<280;++V)rr[V]=7;var V;for(V=280;V<288;++V)rr[V]=8;var V,mn=new J(32);for(V=0;V<32;++V)mn[V]=5;var V;var yn=Be(rr,9,1);var dn=Be(mn,5,1),_r=function(e){for(var r=e[0],t=1;t<e.length;++t)e[t]>r&&(r=e[t]);return r},ve=function(e,r,t){var n=r/8|0;return(e[n]|e[n+1]<<8)>>(r&7)&t},Tr=function(e,r){var t=r/8|0;return(e[t]|e[t+1]<<8|e[t+2]<<16)>>(r&7)},gn=function(e){return(e+7)/8|0},Ce=function(e,r,t){return(r==null||r<0)&&(r=0),(t==null||t>e.length)&&(t=e.length),new J(e.subarray(r,t))};var wn=["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"],K=function(e,r,t){var n=new Error(r||wn[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,K),!t)throw n;return n},at=function(e,r,t,n){var o=e.length,i=n?n.length:0;if(!o||r.f&&!r.l)return t||new J(0);var f=!t,a=f||r.i!=2,u=r.i;f&&(t=new J(o*3));var s=function(ce){var He=t.length;if(ce>He){var ze=new J(Math.max(He*2,ce));ze.set(t),t=ze}},h=r.f||0,l=r.p||0,c=r.b||0,m=r.l,A=r.d,_=r.m,O=r.n,P=o*8;do{if(!m){h=ve(e,l,1);var v=ve(e,l+1,3);if(l+=3,v)if(v==1)m=yn,A=dn,_=9,O=5;else if(v==2){var N=ve(e,l,31)+257,j=ve(e,l+10,15)+4,S=N+ve(e,l+5,31)+1;l+=14;for(var y=new J(S),b=new J(19),I=0;I<j;++I)b[ln[I]]=ve(e,l+I*3,7);l+=j*3;for(var B=_r(b),H=(1<<B)-1,Oe=Be(b,B,1),I=0;I<S;){var Ee=Oe[ve(e,l,H)];l+=Ee&15;var d=Ee>>4;if(d<16)y[I++]=d;else{var ie=0,le=0;for(d==16?(le=3+ve(e,l,3),l+=2,ie=y[I-1]):d==17?(le=3+ve(e,l,7),l+=3):d==18&&(le=11+ve(e,l,127),l+=7);le--;)y[I++]=ie}}var fe=y.subarray(0,N),Q=y.subarray(N);_=_r(fe),O=_r(Q),m=Be(fe,_,1),A=Be(Q,O,1)}else K(1);else{var d=gn(l)+4,g=e[d-4]|e[d-3]<<8,E=d+g;if(E>o){u&&K(0);break}a&&s(c+g),t.set(e.subarray(d,E),c),r.b=c+=g,r.p=l=E*8,r.f=h;continue}if(l>P){u&&K(0);break}}a&&s(c+131072);for(var ne=(1<<_)-1,w=(1<<O)-1,p=l;;p=l){var ie=m[Tr(e,l)&ne],T=ie>>4;if(l+=ie&15,l>P){u&&K(0);break}if(ie||K(2),T<256)t[c++]=T;else if(T==256){p=l,m=null;break}else{var D=T-254;if(T>264){var I=T-257,C=nt[I];D=ve(e,l,(1<<C)-1)+it[I],l+=C}var M=A[Tr(e,l)&w],q=M>>4;M||K(3),l+=M&15;var Q=vn[q];if(q>3){var C=ot[q];Q+=Tr(e,l)&(1<<C)-1,l+=C}if(l>P){u&&K(0);break}a&&s(c+131072);var te=c+D;if(c<Q){var x=i-Q,G=Math.min(Q,te);for(x+c<0&&K(3);c<G;++c)t[c]=n[x+c]}for(;c<te;++c)t[c]=t[c-Q]}}r.l=m,r.p=p,r.b=c,r.f=h,m&&(h=1,r.m=_,r.d=A,r.n=O)}while(!h);return c!=t.length&&f?Ce(t,0,c):t.subarray(0,c)};var Qo=new J(0);var ei=function(e,r){var t={};for(var n in e)t[n]=e[n];for(var n in r)t[n]=r[n];return t},fn=function(e,r,t){for(var n=e(),o=e.toString(),i=o.slice(o.indexOf("[")+1,o.lastIndexOf("]")).replace(/\s+/g,"").split(","),f=0;f<n.length;++f){var a=n[f],u=i[f];if(typeof a=="function"){r+=";"+u+"=";var s=a.toString();if(a.prototype)if(s.indexOf("[native code]")!=-1){var h=s.indexOf(" ",8)+1;r+=s.slice(h,s.indexOf("(",h))}else{r+=s;for(var l in a.prototype)r+=";"+u+".prototype."+l+"="+a.prototype[l].toString()}else r+=s}else t[u]=a}return r},Ar=[],ri=function(e){var r=[];for(var t in e)e[t].buffer&&r.push((e[t]=new e[t].constructor(e[t])).buffer);return r},ti=function(e,r,t,n){if(!Ar[t]){for(var o="",i={},f=e.length-1,a=0;a<f;++a)o=fn(e[a],o,i);Ar[t]={c:fn(e[f],o,i),e:i}}var u=ei({},Ar[t].e);return Ko(Ar[t].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+r.toString()+"}",t,u,ri(u),n)},ni=function(){return[J,je,sn,nt,ot,ln,it,vn,yn,dn,Pr,wn,Be,_r,ve,Tr,gn,Ce,K,at,ft,bn,xn]};var bn=function(e){return postMessage(e,[e.buffer])},xn=function(e){return e&&{out:e.size&&new J(e.size),dictionary:e.dictionary}},oi=function(e,r,t,n,o,i){var f=ti(t,n,o,function(a,u){f.terminate(),i(a,u)});return f.postMessage([e,r],r.consume?[e.buffer]:[]),function(){f.terminate()}};var be=function(e,r){return e[r]|e[r+1]<<8},me=function(e,r){return(e[r]|e[r+1]<<8|e[r+2]<<16|e[r+3]<<24)>>>0},rt=function(e,r){return me(e,r)+me(e,r+4)*4294967296};var Sn=(function(){function e(r,t){typeof r=="function"&&(t=r,r={}),this.ondata=t;var n=r&&r.dictionary&&r.dictionary.subarray(-32768);this.s={i:0,b:n?n.length:0},this.o=new J(32768),this.p=new J(0),n&&this.o.set(n)}return e.prototype.e=function(r){if(this.ondata||K(5),this.d&&K(4),!this.p.length)this.p=r;else if(r.length){var t=new J(this.p.length+r.length);t.set(this.p),t.set(r,this.p.length),this.p=t}},e.prototype.c=function(r){this.s.i=+(this.d=r||!1);var t=this.s.b,n=at(this.p,this.s,this.o);this.ondata(Ce(n,t,this.s.b),this.d),this.o=Ce(n,this.s.b-32768),this.s.b=this.o.length,this.p=Ce(this.p,this.s.p/8|0),this.s.p&=7},e.prototype.push=function(r,t){this.e(r),this.c(t)},e})();function ii(e,r,t){return t||(t=r,r={}),typeof t!="function"&&K(7),oi(e,r,[ni],function(n){return bn(ft(n.data[0],xn(n.data[1])))},1,t)}function ft(e,r){return at(e,{i:2},r&&r.out,r&&r.dictionary)}var tt=typeof TextDecoder<"u"&&new TextDecoder,ai=0;try{tt.decode(Qo,{stream:!0}),ai=1}catch{}var fi=function(e){for(var r="",t=0;;){var n=e[t++],o=(n>127)+(n>223)+(n>239);if(t+o>e.length)return{s:r,r:Ce(e,t-1)};o?o==3?(n=((n&15)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,r+=String.fromCharCode(55296|n>>10,56320|n&1023)):o&1?r+=String.fromCharCode((n&31)<<6|e[t++]&63):r+=String.fromCharCode((n&15)<<12|(e[t++]&63)<<6|e[t++]&63):r+=String.fromCharCode(n)}};function ut(e,r){if(r){for(var t="",n=0;n<e.length;n+=16384)t+=String.fromCharCode.apply(null,e.subarray(n,n+16384));return t}else{if(tt)return tt.decode(e);var o=fi(e),i=o.s,t=o.r;return t.length&&K(8),i}}var ui=function(e,r){return r+30+be(e,r+26)+be(e,r+28)},si=function(e,r,t){var n=be(e,r+28),o=be(e,r+30),i=ut(e.subarray(r+46,r+46+n),!(be(e,r+8)&2048)),f=r+46+n,a=li(e,f,o,t,me(e,r+20),me(e,r+24),me(e,r+42)),u=a[0],s=a[1],h=a[2];return[be(e,r+10),u,s,i,f+o+be(e,r+32),h]},li=function(e,r,t,n,o,i,f){var a=o==4294967295,u=i==4294967295,s=f==4294967295,h=r+t,l=a+u+s;if(n&&l){for(;r+4<h;r+=4+be(e,r+2))if(be(e,r)==1)return[a?rt(e,r+4+8*u):o,u?rt(e,r+4):i,s?rt(e,r+4+8*(u+a)):f,1];n<2&&K(13)}return[o,i,f,0]};var un=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(e){e()};function On(e,r,t){t||(t=r,r={}),typeof t!="function"&&K(7);var n=[],o=function(){for(var O=0;O<n.length;++O)n[O]()},i={},f=function(O,P){un(function(){t(O,P)})};un(function(){f=t});for(var a=e.length-22;me(e,a)!=101010256;--a)if(!a||e.length-a>65558)return f(K(13,0,1),null),o;var u=be(e,a+8);if(u){var s=u,h=me(e,a+16),l=me(e,a-20)==117853008;if(l){var c=me(e,a-12);l=me(e,c)==101075792,l&&(s=u=me(e,c+32),h=me(e,c+48))}for(var m=r&&r.filter,A=function(O){var P=si(e,h,l),v=P[0],d=P[1],g=P[2],E=P[3],N=P[4],j=P[5],S=ui(e,j);h=N;var y=function(I,B){I?(o(),f(I,null)):(B&&(i[E]=B),--u||f(null,i))};if(!m||m({name:E,size:d,originalSize:g,compression:v}))if(!v)y(null,Ce(e,S,S+d));else if(v==8){var b=e.subarray(S,S+d);if(g<524288||d>.8*g)try{y(null,ft(b,{out:new J(g)}))}catch(I){y(I,null)}else n.push(ii(b,{size:g},y))}else y(K(14,"unknown compression type "+v,1),null);else y(null,null)},_=0;_<s;++_)A(_)}else f(null,{});return o}function Ge(e){"@babel/helpers - typeof";return Ge=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ge(e)}function En(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,hi(n.key),n)}}function ci(e,r,t){return r&&En(e.prototype,r),t&&En(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function hi(e){var r=pi(e,"string");return Ge(r)==="symbol"?r:String(r)}function pi(e,r){if(Ge(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(Ge(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function vi(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function mi(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&tr(e,r)}function yi(e){var r=An();return function(){var n=nr(e),o;if(r){var i=nr(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return di(this,o)}}function di(e,r){if(r&&(Ge(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gi(e)}function gi(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function st(e){var r=typeof Map=="function"?new Map:void 0;return st=function(n){if(n===null||!wi(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r<"u"){if(r.has(n))return r.get(n);r.set(n,o)}function o(){return Ir(n,arguments,nr(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),tr(o,n)},st(e)}function Ir(e,r,t){return An()?Ir=Reflect.construct.bind():Ir=function(o,i,f){var a=[null];a.push.apply(a,i);var u=Function.bind.apply(o,a),s=new u;return f&&tr(s,f.prototype),s},Ir.apply(null,arguments)}function An(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function wi(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function tr(e,r){return tr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},tr(e,r)}function nr(e){return nr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},nr(e)}var lt=(function(e){mi(t,e);var r=yi(t);function t(){return vi(this,t),r.apply(this,arguments)}return ci(t)})(st(Error));function ct(e){var r=new lt(e.message);return e.stack&&(r.stack=e.stack),Error.captureStackTrace&&Error.captureStackTrace(r,ct),r.cause=e,r}function ht(e,r){return bi(e,r,xi,!0)}function bi(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.filter,n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0;return n(new Uint8Array(e),{filter:function(f){return t?t({path:f.name}):!0}}).then(function(i){return i},function(i){throw Si(i)?ct(i):i})}function xi(e){return new Promise(function(r,t){On(e,function(n,o){n?t(n):r(o)})})}function Si(e){return typeof e.code=="number"}function Xe(e){"@babel/helpers - typeof";return Xe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Xe(e)}function _n(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ei(n.key),n)}}function Oi(e,r,t){return r&&_n(e.prototype,r),t&&_n(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ei(e){var r=Ai(e,"string");return Xe(r)==="symbol"?r:String(r)}function Ai(e,r){if(Xe(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(Xe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function _i(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function Ti(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&or(e,r)}function Pi(e){var r=Tn();return function(){var n=ir(e),o;if(r){var i=ir(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Ii(this,o)}}function Ii(e,r){if(r&&(Xe(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Di(e)}function Di(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pt(e){var r=typeof Map=="function"?new Map:void 0;return pt=function(n){if(n===null||!Ni(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r<"u"){if(r.has(n))return r.get(n);r.set(n,o)}function o(){return Dr(n,arguments,ir(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),or(o,n)},pt(e)}function Dr(e,r,t){return Tn()?Dr=Reflect.construct.bind():Dr=function(o,i,f){var a=[null];a.push.apply(a,i);var u=Function.bind.apply(o,a),s=new u;return f&&or(s,f.prototype),s},Dr.apply(null,arguments)}function Tn(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ni(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function or(e,r){return or=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},or(e,r)}function ir(e){return ir=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ir(e)}var ki={XLS_FILE_NOT_SUPPORTED:"You passed a legacy `.xls` file. Only `.xlsx` files are supported",FILE_NOT_SUPPORTED:"Doesn't look like an `.xlsx` file",INVALID_ZIP:"Couldn't unzip `.xlsx` file contents",NO_DATA:"No data"},Me=(function(e){Ti(t,e);var r=Pi(t);function t(n,o){var i;return _i(this,t),i=r.call(this,ki[n]||n),i.code=n,i.name="InvalidInputError",i.cause=o,i}return Oi(t)})(pt(Error));function vt(e){var r=e.path;return r.endsWith(".xml")||r.endsWith(".xml.rels")}var Pn=[80,75],In=[208,207,17,224],ar=[Pn,In],gu=ar.indexOf(Pn),Dn=ar.indexOf(In);function mt(){var e,r=Ri(ar),t=0;return function(n){if(isNaN(e)){var o;r=r.filter(function(i){if(n===ar[i][t])return ar[i].length===t+1&&(o=i),!0}),r.length===1?e=o:r.length===0&&(e=-1)}return t++,e}}function Ri(e){for(var r=[],t=0;t<e.length;)r.push(t),t++;return r}function ji(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=Ci(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ci(e,r){if(e){if(typeof e=="string")return Nn(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Nn(e,r)}}function Nn(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function yt(e){for(var r=mt(),t=ji(e),n;!(n=t()).done;){var o=n.value;if(Mi(o,r))return}Li(e.length)}function Mi(e,r){var t=r(e);if(t!==void 0){if(t===Dn)throw new Me("XLS_FILE_NOT_SUPPORTED");if(t<0)throw new Me("FILE_NOT_SUPPORTED");return!0}}function Li(e){throw new Me(e===0?"NO_DATA":"FILE_NOT_SUPPORTED")}var Nr;function se(e){var r=Date.now(),t=typeof global<"u"?!!global.READ_EXCEL_FILE_CHECKPOINTS:typeof window<"u"?!!window.READ_EXCEL_FILE_CHECKPOINTS:!1;t&&(Nr&&console.log(" -",r-Nr,"ms"),console.log("*",e)),Nr=r}function kn(){Nr=void 0}function dt(e){return kn(),se("unpack files"),Fi(e).then(function(r){return yt(new Uint8Array(r)),ht(r,{filter:vt}).then(function(t){return t},function(t){throw t instanceof lt?new Me("INVALID_ZIP",t.cause):t})})}function Fi(e){if(e instanceof Blob)return e.arrayBuffer();if(e instanceof ArrayBuffer)return Promise.resolve(e);throw new Me("INPUT_TYPE_NOT_SUPPORTED")}function gt(e,r){var t=n();return r(e,t,i,null,null).then(function(){return o(t)});function n(){return{workbookPr:void 0,sheets:[]}}function o(f){return{epoch1904:f.workbookPr?f.workbookPr.epoch1904:!1,sheets:f.sheets}}function i(f,a,u){f==="workbookPr"?u.workbookPr||(u.workbookPr={epoch1904:a.date1904==="1"}):f==="sheet"&&a.name&&u.sheets.push({id:Number(a.sheetId),name:a.name,relationId:a.id})}}function wt(e,r){var t="http://schemas.openxmlformats.org/officeDocument/2006/relationships/",n="http://purl.oclc.org/ooxml/officeDocument/relationships/",o=i();return r(e,o,a,null,null).then(function(){return o});function i(){return{sheets:{},sharedStrings:void 0,styles:void 0}}function f(h){return h}function a(h,l,c){h==="Relationship"&&u(c,l.Id,l.Type,l.Target)}function u(h,l,c,m){switch(c){case t+"styles":case n+"styles":h.styles=s(m);break;case t+"sharedStrings":case n+"sharedStrings":h.sharedStrings=s(m);break;case t+"worksheet":case n+"worksheet":h.sheets[l]=s(m);break}}function s(h){return h[0]==="/"?h.slice(1):"xl/"+h}}function fr(e){"@babel/helpers - typeof";return fr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},fr(e)}var zi=["xfId"];function Rn(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),t.push.apply(t,n)}return t}function jn(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Rn(Object(t),!0).forEach(function(n){Ui(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Rn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Ui(e,r,t){return r=Vi(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Vi(e){var r=Bi(e,"string");return fr(r)==="symbol"?r:String(r)}function Bi(e,r){if(fr(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(fr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Gi(e,r){if(e==null)return{};var t=Xi(e,r),n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}function Xi(e,r){if(e==null)return{};var t={},n=Object.keys(e),o,i;for(i=0;i<n.length;i++)o=n[i],!(r.indexOf(o)>=0)&&(t[o]=e[o]);return t}function bt(e,r){var t=n();return r(e,t,i,f,null).then(function(){return o(t)});function n(){return{numberFormats:[],baseStyles:[],styles:[],cellStyleXfs:!1,cellXfs:!1}}function o(u){return u.styles.map(function(s){if(s.xfId){var h=s.xfId,l=Gi(s,zi);return jn(jn({},u.baseStyles[h]),l)}else return s})}function i(u,s,h){if(u==="numFmt"){var l=Number(s.numFmtId),c={id:l};l>=100&&(c.template=s.formatCode),h.numberFormats[l]=c}else if(u==="cellStyleXfs")h.cellStyleXfs=!0;else if(u==="cellXfs")h.cellXfs=!0;else if(u==="xf"){if(h.cellStyleXfs)h.baseStyles.push(a(s));else if(h.cellXfs){var m=a(s,h.numberFormats);s.xfId&&(m.xfId=Number(s.xfId)),h.styles.push(m)}}}function f(u,s){u==="cellStyleXfs"?s.cellStyleXfs=!1:u==="cellXfs"&&(s.cellXfs=!1)}function a(u,s){var h={};if(u.numFmtId){var l=Number(u.numFmtId);s&&s[l]?h.numberFormat=s[l]:h.numberFormat={id:l}}return h}}function xt(e,r){var t=n();return r(e,t,i,f,a).then(function(){return o(t)});function n(){return{si:void 0,strings:[]}}function o(c){return c.strings}function i(c,m,A){c==="si"?A.si=u():A.si&&s(c,m,A.si)}function f(c,m){c==="si"?(m.strings.push(m.si.string),m.si=void 0):m.si&&h(c,m.si)}function a(c,m){m.si&&l(c,m.si)}function u(){return{t:!1,r:!1,rPh:!1,string:""}}function s(c,m,A){c==="t"?A.t=!0:c==="r"?A.r=!0:c==="rPh"&&(A.rPh=!0)}function h(c,m){c==="t"?m.t=!1:c==="r"?m.r=!1:c==="rPh"&&(m.rPh=!1)}function l(c,m){m.rPh||m.t&&(m.r?m.string+=c:m.string=c)}}function St(e,r){var t=17,n=1,o=1,i=1440*60*1e3,f=365;r&&(e+=4*f+n+o);var a=n+o+70*f+t;return Math.floor((e-a)*i)}var $i=/;@$/,qi=/[^a-z0#\?%]+/;function Ot(e,r,t){var n=t[e];return n===void 0?t[e]=Wi(r):n}function Wi(e){e=e.toLowerCase(),e=e.replace($i,""),e=e.replace(/\\./g," ");var r=e.split(";");return r.some(t);function t(n){n=n.replace(/"[^"]*"/g," "),n=n.replace(/(\[?[smhd]{1,2}\]?)[\.\,]00?0?/g,"$1"),n=n.replace(/\[([smhd]{1,2})\]/g,"$1"),n=n.replace(/\[[^\]]*\]/g,"");var o=n.split(qi).filter(function(i){return i});return o.length===0?!1:o.every(function(i){return Yi.indexOf(i)>=0})}}var Yi=["s","ss","m","mm","h","hh","am","pm","a","p","d","dd","ddd","dddd","aaa","aaaa","aaaaa","m","mm","mmm","mmmm","mmmmm","y","yy","yyyy","e","ee","eeee"];function At(e,r,t,n){return e.numberFormat?!!(Ki.indexOf(e.numberFormat.id)>=0||r&&e.numberFormat.template===r||t&&e.numberFormat.template&&Ot(e.numberFormat.id,e.numberFormat.template,n)):!1}var Hi=[14,15,16,17,18,19,20,21,22,45,46,47],Et=[27,28,29,30,31,32,33,34,35,36,50,51,52,53,54,55,56,57,58],Cn=[27,28,29,30,31,32,33,34,35,36,50,51,52,53,54,55,56,57,58],Zi=[71,72,73,74,75,76,77,78,79,80,81],Ki=Hi.concat(Et).concat(Cn.filter(function(e){return Et.indexOf(e)<0})).concat(Zi.filter(function(e){return Et.indexOf(e)<0}).filter(function(e){return Cn.indexOf(e)<0}));function Ji(e,r){return ta(e)||ra(e,r)||ea(e,r)||Qi()}function Qi(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ea(e,r){if(e){if(typeof e=="string")return Mn(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Mn(e,r)}}function Mn(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function ra(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n,o,i,f,a=[],u=!0,s=!1;try{if(i=(t=t.call(e)).next,r===0){if(Object(t)!==t)return;u=!1}else for(;!(u=(n=i.call(t)).done)&&(a.push(n.value),a.length!==r);u=!0);}catch(h){s=!0,o=h}finally{try{if(!u&&t.return!=null&&(f=t.return(),Object(f)!==f))return}finally{if(s)throw o}}return a}}function ta(e){if(Array.isArray(e))return e}var na=null,Le=[null,na];function _t(e,r,t,n,o){var i=Ji(o,7),f=i[0],a=i[1],u=i[2],s=i[3],h=i[4],l=i[5],c=i[6];switch(e||"n"){case"str":return t===void 0?"VALUE_MISSING":t?["s",t]:Le;case"inlineStr":return n===void 0?"VALUE_MISSING":["s",n];case"s":if(!t)return"VALUE_MISSING";var m=Number(t);return isNaN(m)||f[m]===void 0?"VALUE_INVALID":["s",f[m]];case"b":return t?t==="1"?["b",!0]:t==="0"?["b",!1]:"VALUE_INVALID":"VALUE_MISSING";case"e":return t?["e",t]:"VALUE_MISSING";case"d":if(!t)return Le;var A=new Date(t);return isNaN(A.valueOf())?"VALUE_INVALID":["d",A.getTime()];case"n":if(!t)return Le;if(r){var _=Number(r);if(isNaN(_)||a[_]===void 0)return"FORMAT_INVALID";if(At(a[_],h,l,s)){var O=Number(t);return isNaN(O)?"VALUE_INVALID":["d",St(O,u)]}}if(c)return["n",t];var P=Number(t);return isNaN(P)?"VALUE_INVALID":["n",P];default:return"TYPE_INVALID"}}function kr(e){for(var r=0,t=0;t<e.length;){var n=e.charCodeAt(t);if(n>=48&&n<=57){var o=Number(e.slice(t));return isNaN(o)&&Ln(e),[o,r]}r*=26,r+=e.charCodeAt(t)-64,t++}Ln(e)}function Ln(e){throw new Error('<c r="'.concat(e,'">'))}function oa(e,r){return fa(e)||aa(e,r)||Un(e,r)||ia()}function ia(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
4
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aa(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n,o,i,f,a=[],u=!0,s=!1;try{if(i=(t=t.call(e)).next,r===0){if(Object(t)!==t)return;u=!1}else for(;!(u=(n=i.call(t)).done)&&(a.push(n.value),a.length!==r);u=!0);}catch(h){s=!0,o=h}finally{try{if(!u&&t.return!=null&&(f=t.return(),Object(f)!==f))return}finally{if(s)throw o}}return a}}function fa(e){if(Array.isArray(e))return e}function Fn(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=Un(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
5
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Un(e,r){if(e){if(typeof e=="string")return zn(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return zn(e,r)}}function zn(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var Tt=null;function Pt(e,r,t){var n=t.sharedStrings,o=t.styles,i=t.epoch1904,f=t.dateFormatDetectionCache,a=t.options,u=[n,o,i,f,a.dateFormat,a.smartDateParser!==!1,a.parseNumber],s=[],h=[],l=c();return r(e,l,g,E,N,d).then(function(){var w=l.sheetData,p=w.rowCount,T=w.columnCount,D=w.dataRowCount,C=w.dataColumnCount;if(D<p&&(s=s.slice(0,D)),C<T)for(var M=0;M<s.length;)s[M].length>C&&(s[M]=s[M].slice(0,C)),M++;for(var q=Date.now(),te=Fn(s),x;!(x=te()).done;)for(var G=x.value;G.length<C;)G.push(Tt);return s});function c(){return{dimension:void 0,sheetData:void 0}}function m(w){return w.sheetData.rows}function A(w,p){w.sheetData.rowIndexShift+=w.sheetData.rows.length-p.length,w.sheetData.rows=p}function _(w){return w.sheetData.errors}function O(w,p){w.sheetData.errors=p}var P;function v(w){var p=w.row,T=w.column,D=w.error;throw new Ne("<c/> at row ".concat(p,", col ").concat(T,": ").concat(D))}function d(w){if(l.sheetData){var p=m(l),T=_(l);if(w)s=s.concat(p),h=h.concat(T),h.length>0&&v(h[0]);else if(p.length>1){var D=p.slice(0,-1);s=s.concat(D),h=h.concat(T),A(l,p.slice(-1)),O(l,[])}}}function g(w,p,T){w==="dimension"?T.dimension=j(p.ref):w==="sheetData"?T.sheetData=S():T.sheetData&&y(w,p,T.sheetData)}function E(w,p){p.sheetData&&b(w,p.sheetData)}function N(w,p){p.sheetData&&I(w,p.sheetData)}function j(w){var p=w.split(":").map(kr);return p.length===1&&(p=[p[0],p[0]]),p}function S(){return{c:void 0,rows:[],row:void 0,rowNumber:void 0,rowIndexShift:0,cursor:[0,0],rowCount:0,columnCount:0,dataRowCount:0,dataColumnCount:0,errors:[]}}function y(w,p,T){w==="row"?(p.r&&(T.rowNumber=Number(p.r)),T.row=[]):w==="c"?(T.c=ie(),T.c.attributes=p):T.c&&le(w,p,T.c)}function b(w,p){if(w==="row"){if(p.rowNumber){var T=p.rowIndexShift+p.rows.length;if(p.rowNumber<=T)throw new Ne("Out-of-place <row/> number ".concat(p.rowNumber," follows <row/> number ").concat(T));for(;p.rowNumber>p.rowIndexShift+p.rows.length+1;)p.rows.push([])}p.rows.push(p.row),p.row.length>0&&(p.dataRowCount=p.rowNumber),p.rowNumber>p.rowCount&&(p.rowCount=p.rowNumber),p.row=void 0,p.rowNumber=void 0}else if(w==="c"){var D=B(p.c);if(D.row<p.cursor[0]||D.row===p.cursor[0]&&D.column<=p.cursor[1])throw new Ne("Out-of-place <c/> at row ".concat(D.row," col ").concat(D.column," follows <c/> at row ").concat(p.cursor[0]," col ").concat(p.cursor[1]));if(p.cursor[0]=D.row,p.cursor[1]=D.column,p.rowNumber||(p.rowNumber=D.row),D.error)P&&v(D),p.errors.push(D);else if(D.value!==Tt){for(;D.column>p.row.length+1;)p.row.push(Tt);p.row.push(D.value),D.column>p.dataColumnCount&&(p.dataColumnCount=D.column)}D.column>p.columnCount&&(p.columnCount=D.column),p.c=void 0}else p.c&&fe(w,p.c)}function I(w,p){p.c&&Q(w,p.c)}function B(w){var p=w.attributes,T=w.inlineString,D=w.vText,C=kr(p.r),M=oa(C,2),q=M[0],te=M[1],x=H(p.t,p.s,D,T,u,a.trim!==!1);return typeof x=="string"?{row:q,column:te,error:x}:{row:q,column:te,value:Ee(x[1],x[0])}}function H(w,p,T,D,C,M){var q=Oe(w,p,T,D,C);return Array.isArray(q)&&q[0]==="s"&&(M&&(q[1]=q[1].trim()),q[1]==="")?Le:q}function Oe(w,p,T,D,C){var M=_t(w,p,T,D,C);if(M==="VALUE_MISSING")switch(w||"n"){case"str":case"inlineStr":case"s":case"b":return Le}return w==="e"?Le:M}function Ee(w,p){return p==="n"?a.parseNumber?a.parseNumber(w):w:p==="d"?new Date(w):w}function ie(){return{v:!1,is:!1,t:!1,r:!1,rPh:!1,vText:void 0,inlineString:void 0,attributes:void 0}}function le(w,p,T){w==="v"?T.v=!0:w==="is"?(T.is=!0,T.inlineString=""):w==="t"?T.t=!0:w==="r"?T.r=!0:w==="rPh"&&(T.rPh=!0)}function fe(w,p){w==="v"?(p.v=!1,p.vText||(p.vText="")):w==="is"?p.is=!1:w==="t"?p.t=!1:w==="r"?p.r=!1:w==="rPh"&&(p.rPh=!1)}function Q(w,p){p.v?p.vText=w:p.is&&(p.rPh||p.t&&(p.r?p.inlineString+=w:p.inlineString=w))}function ne(w){for(var p=w.length===0?0:1,T=w.length===0?0:1,D=0,C=0,M=Fn(w),q;!(q=M()).done;){var te=q.value;D<te.row&&(D=te.row),C<te.column&&(C=te.column)}return[[p,T],[D,C]]}}function It(e){se("convert files to strings");for(var r={},t=0,n=Object.keys(e);t<n.length;t++){var o=n[t];r[o]=ua(e[o])}return r}function ua(e){return typeof TextDecoder<"u"?new TextDecoder().decode(e):ut(e)}function Dt(e){"@babel/helpers - typeof";return Dt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Dt(e)}function Nt(e){return Dt(e)==="object"&&typeof e.then=="function"}function $e(e){"@babel/helpers - typeof";return $e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},$e(e)}function Vn(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,la(n.key),n)}}function sa(e,r,t){return r&&Vn(e.prototype,r),t&&Vn(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function la(e){var r=ca(e,"string");return $e(r)==="symbol"?r:String(r)}function ca(e,r){if($e(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if($e(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function ha(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function pa(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&ur(e,r)}function va(e){var r=Bn();return function(){var n=sr(e),o;if(r){var i=sr(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return ma(this,o)}}function ma(e,r){if(r&&($e(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ya(e)}function ya(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kt(e){var r=typeof Map=="function"?new Map:void 0;return kt=function(n){if(n===null||!da(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r<"u"){if(r.has(n))return r.get(n);r.set(n,o)}function o(){return Rr(n,arguments,sr(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),ur(o,n)},kt(e)}function Rr(e,r,t){return Bn()?Rr=Reflect.construct.bind():Rr=function(o,i,f){var a=[null];a.push.apply(a,i);var u=Function.bind.apply(o,a),s=new u;return f&&ur(s,f.prototype),s},Rr.apply(null,arguments)}function Bn(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function da(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function ur(e,r){return ur=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},ur(e,r)}function sr(e){return sr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},sr(e)}var Gn=(function(e){pa(t,e);var r=va(t);function t(n,o){var i;return ha(this,t),i=r.call(this,"Sheet not found: ".concat(typeof n=="number"?n+". Sheet count: "+o.length:n+". Available sheets: "+o.join(", "))),i.name="SheetNotFoundError",i.sheet=n,i.sheets=o,i}return sa(t)})(kt(Error));function lr(e){"@babel/helpers - typeof";return lr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},lr(e)}function qn(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=ga(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
6
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ga(e,r){if(e){if(typeof e=="string")return Xn(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Xn(e,r)}}function Xn(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function $n(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),t.push.apply(t,n)}return t}function jr(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?$n(Object(t),!0).forEach(function(n){Cr(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):$n(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Cr(e,r,t){return r=wa(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function wa(e){var r=ba(e,"string");return lr(r)==="symbol"?r:String(r)}function ba(e,r){if(lr(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(lr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function xa(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=It(r);return se("parse spreadsheet info and file paths"),Rt(Ea(),n,e).then(function(o){var i=o.spreadsheetInfo,f=o.filePaths;return se('parse "shared strings" and "styles"'),Rt(Aa(f),n,e).then(function(a){var u=a.sharedStrings,s=a.styles,h=t.sheets?t.sheets.map(function(c){return Sa(c,i.sheets)}):i.sheets.map(function(c){return c.relationId});se("parse sheet".concat(h.length===1?"":"s"," data"));var l=[];return Rt(_a(f,h,{sharedStrings:u,styles:s,epoch1904:i.epoch1904,dateFormatDetectionCache:l,options:t}),n,e).then(function(c){return se("end"),h.map(function(m){return{sheet:Oa(m,i.sheets),data:c[m]}})})})})}function jt(e,r,t,n){return n&&n.parseNumber||(n=jr(jr({},n),{},{parseNumber:null})),xa(r,t,n)}function Sa(e,r){if(typeof e=="string")for(var t=qn(r),n;!(n=t()).done;){var o=n.value;if(o.name===e)return o.relationId}else if(e<=r.length)return r[e-1].relationId;throw new Gn(e,r.map(function(i){return i.name}))}function Oa(e,r){for(var t=qn(r),n;!(n=t()).done;){var o=n.value;if(o.relationId===e)return o.name}throw new Error("Sheet relation ID not found: ".concat(e))}function Ea(){return{"xl/_rels/workbook.xml.rels":{name:"filePaths",parse:wt},"xl/workbook.xml":{name:"spreadsheetInfo",parse:gt}}}function Aa(e){var r;return r={},Cr(r,e.sharedStrings||"xl/sharedStrings.xml",{name:"sharedStrings",parse:xt,fallback:Promise.resolve([])}),Cr(r,e.styles||"xl/styles.xml",{name:"styles",parse:bt,fallback:{}}),r}function _a(e,r,t){return Object.keys(e.sheets).filter(function(n){return r.includes(n)}).reduce(function(n,o){return jr(jr({},n),{},Cr({},e.sheets[o],{name:o,parse:function(f,a){return Pt(f,a,t)}}))},{})}function Rt(e,r,t){for(var n={},o=function(){var c=f[i],m=e[c];n[m.name]=r[c]===void 0?m.fallback===void 0?(function(){throw new Ne('"'.concat(c,'" file not found inside the `.xlsx` file'))})():m.fallback:m.parse(r[c],t)},i=0,f=Object.keys(e);i<f.length;i++)o();for(var a=[],u=function(){var c=h[s];Nt(n[c])&&a.push(n[c].then(function(m){n[c]=m}))},s=0,h=Object.keys(n);s<h.length;s++)u();return a.length>0?Promise.all(a).then(function(){return n}):n}function qe(e){"@babel/helpers - typeof";return qe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},qe(e)}function Wn(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Pa(n.key),n)}}function Ta(e,r,t){return r&&Wn(e.prototype,r),t&&Wn(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pa(e){var r=Ia(e,"string");return qe(r)==="symbol"?r:String(r)}function Ia(e,r){if(qe(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(qe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Da(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function Na(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&cr(e,r)}function ka(e){var r=Yn();return function(){var n=hr(e),o;if(r){var i=hr(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Ra(this,o)}}function Ra(e,r){if(r&&(qe(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ja(e)}function ja(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ct(e){var r=typeof Map=="function"?new Map:void 0;return Ct=function(n){if(n===null||!Ca(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r<"u"){if(r.has(n))return r.get(n);r.set(n,o)}function o(){return Mr(n,arguments,hr(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),cr(o,n)},Ct(e)}function Mr(e,r,t){return Yn()?Mr=Reflect.construct.bind():Mr=function(o,i,f){var a=[null];a.push.apply(a,i);var u=Function.bind.apply(o,a),s=new u;return f&&cr(s,f.prototype),s},Mr.apply(null,arguments)}function Yn(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ca(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function cr(e,r){return cr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},cr(e,r)}function hr(e){return hr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},hr(e)}var ae=(function(e){Na(t,e);var r=ka(t);function t(n){var o;return Da(this,t),o=r.call(this,"invalid"),o.reason=n,o}return Ta(t)})(Ct(Error));function Mt(e){if(typeof e=="string"){var r=e;if(e=Number(e),String(e)!==r)throw new ae("not_a_number")}if(typeof e!="number")throw new ae("not_a_number");if(isNaN(e))throw new ae("invalid_number");if(!isFinite(e))throw new ae("out_of_bounds");return e}function Lt(e){if(typeof e=="string")return e;if(typeof e=="number"){if(isNaN(e))throw new ae("invalid_number");if(!isFinite(e))throw new ae("out_of_bounds");return String(e)}throw new ae("not_a_string")}function Ft(e){if(typeof e=="boolean")return e;throw new ae("not_a_boolean")}function zt(e){if(e instanceof Date){if(isNaN(e.valueOf()))throw new ae("out_of_bounds");return e}throw new ae("not_a_date")}var Ma={}.constructor;function Lr(e){return e!=null&&e.constructor===Ma}function We(e){"@babel/helpers - typeof";return We=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},We(e)}function La(e,r){return eo(e)||Fa(e,r)||Ut(e,r)||Qn()}function Fa(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n,o,i,f,a=[],u=!0,s=!1;try{if(i=(t=t.call(e)).next,r===0){if(Object(t)!==t)return;u=!1}else for(;!(u=(n=i.call(t)).done)&&(a.push(n.value),a.length!==r);u=!0);}catch(h){s=!0,o=h}finally{try{if(!u&&t.return!=null&&(f=t.return(),Object(f)!==f))return}finally{if(s)throw o}}return a}}function za(e){return eo(e)||Ua(e)||Ut(e)||Qn()}function Qn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
7
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ua(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function eo(e){if(Array.isArray(e))return e}function Hn(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),t.push.apply(t,n)}return t}function Ye(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Hn(Object(t),!0).forEach(function(n){Va(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Hn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Va(e,r,t){return r=Ba(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Ba(e){var r=Ga(e,"string");return We(r)==="symbol"?r:String(r)}function Ga(e,r){if(We(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(We(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function ro(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=Ut(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
8
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ut(e,r){if(e){if(typeof e=="string")return Zn(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Zn(e,r)}}function Zn(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var Fr=null;function Vt(e,r,t){se("parse sheet data using schema");for(var n=[],o=[],i=Xa(e,r,t),f=0,a=ro(i),u;!(u=a()).done;){var s=u.value,h=s.object,l=s.errors;l?o=o.concat(l.map(function(c){return Ye(Ye({},c),{},{row:f+1})})):n.push(h),f++}return se("end"),o.length>0?{errors:o,columns:e[0]}:{objects:n,columns:e[0]||[]}}function Xa(e,r,t){rf(r);var n=nf(t),o=za(e),i=o[0],f=o.slice(1);return f.map(function(a){return $a(a,r,i,n)})}function $a(e,r,t,n){var o={schema:r},i=to(e,o,void 0,t,n),f=i.value,a=i.isEmptyValue,u=i.errors,s=i.children,h={value:of,isEmptyValue:a,errors:u,isRequired:void 0},l=io(o,f,a,u,s,h.isRequired,h.value,h.isEmptyValue,h.errors,t);return u||l?{errors:(u||[]).concat(l||[])}:{object:oo(f,a,!1,void 0,n)}}function qa(e,r,t,n,o){for(var i={},f=!0,a=[],u=[],s=0,h=Object.keys(r);s<h.length;s++){var l=h[s],c=to(e,r[l],Kn(l,t),n,o);c.errors?a=a.concat(c.errors):(i[l]=oo(c.value,c.isEmptyValue,Array.isArray(r[l].type),Kn(l,t),o),f&&!c.isEmptyValue&&(f=!1)),u.push(Ye(Ye({},c),{},{schemaEntry:r[l]}))}return a.length>0?{errors:a,children:u}:{value:i,isEmptyValue:f,children:u}}function to(e,r,t,n,o){var i=r.column?n.indexOf(r.column):void 0,f=r.column?i<0:void 0,a=r.column?f?{value:o.propertyValueWhenColumnIsMissing,isEmptyValue:!0}:Wa(e[i],r,i,o):qa(e,r.schema,t,n,o),u=a.value,s=a.isEmptyValue,h=a.errors,l=a.children;return h?{errors:h,children:l}:{value:u,isEmptyValue:s,children:l}}function Wa(e,r,t,n){var o=Ya(e,r,n),i=o.value,f=o.isEmptyValue,a=o.error,u=o.reason;if(a){var s=ao({error:a,reason:u,column:r.column,columnIndex:t,valueType:r.type,value:e});return{errors:[s]}}return{value:i,isEmptyValue:f}}function Ya(e,r,t){return e===void 0?{value:t.propertyValueWhenColumnIsMissing,isEmptyValue:!0}:e===Fr?{value:t.propertyValueWhenCellIsEmpty,isEmptyValue:!0}:Array.isArray(r.type)?Ha(e,r,t):no(e,r,t)}function Ha(e,r,t){if(typeof e!="string")return{error:"not_a_string"};var n=!0,o=[],i=[],f=Qa(e,t.separatorCharacter).map(function(a){if(!(o.length>0)){if(!a){o.push("invalid"),i.push("syntax");return}var u=no(a,r,t),s=u.value,h=u.isEmptyValue,l=u.error,c=u.reason;if(l){o.push(l),i.push(c);return}return n&&!h&&(n=!1),s}});return o.length>0?{error:o[0],reason:i[0]}:{value:f,isEmptyValue:n}}function no(e,r,t){if(e===Fr)return{value:e,isEmptyValue:!0};var n;if(r.type?n=Ka(e,Array.isArray(r.type)?r.type[0]:r.type,t):n={value:e},n.error)return n;if(e===Fr)return{value:e,isEmptyValue:!0};if(r.oneOf){var o=Za(n.value,r.oneOf);if(o)return o}if(r.validate)try{r.validate(n.value)}catch(i){return{error:i.message}}return{value:n.value,isEmptyValue:tf(n.value)}}function Za(e,r){if(r.indexOf(e)<0)return{error:"invalid",reason:"unknown"}}function Ka(e,r){switch(r){case String:return pr(e,Lt);case Number:return pr(e,Mt);case Date:return pr(e,zt);case Boolean:return pr(e,Ft);default:if(typeof r!="function")throw new Error("Unsupported schema `type`: ".concat(r&&r.name||r));return pr(e,r)}}function pr(e,r){try{var t=r(e);return t===void 0?{value:Fr}:{value:t}}catch(o){var n={error:o.message};return o.reason&&(n.reason=o.reason),n}}function Ja(e,r,t){for(var n=0,o="";t+n<e.length;){var i=e[t+n];if(i===r)return[o,n];o+=i,n++}return[o,n]}function Qa(e,r){for(var t=[],n=0;n<e.length;){var o=Ja(e,r,n),i=La(o,2),f=i[0],a=i[1];n+=a+r.length,t.push(f.trim())}return t}function oo(e,r,t,n,o){if(r){if(Lr(e))return o.transformEmptyObject(e,{path:n});if(t)return o.transformEmptyArray(e,{path:n})}return e}function Kn(e,r){return"".concat(r?r+".":"").concat(e)}function io(e,r,t,n,o,i,f,a,u,s){var h=[],l=ef(e,i,f,a,u);if(l&&t&&h.push(ao({error:"required",column:e.column,columnIndex:s.indexOf(e.column),valueType:e.type,value:r})),o)for(var c=ro(o),m;!(m=c()).done;){var A=m.value,_=io(A.schemaEntry,A.value,A.isEmptyValue,A.errors,A.children,l,r,t,n,s);_&&(h=h.concat(_))}if(h.length>0)return h}function ef(e,r,t,n,o){return r===!1&&(n||o)?!1:e.required&&(typeof e.required=="boolean"?e.required:o?!1:e.required(t))}function ao(e){var r=e.column,t=e.columnIndex,n=e.valueType,o=e.value,i=e.error,f=e.reason,a={error:i,column:r,columnIndex:t,value:o};return f&&(a.reason=f),n&&(a.type=n),a}function rf(e){for(var r=0,t=Object.keys(e);r<t.length;r++){var n=t[r],o=e[n];if(We(o.type)==="object"&&!Array.isArray(o.type))throw new Error("When defining a nested schema, use a `schema` property instead of a `type` property");if(!o.schema&&!o.column)throw new Error('"column" not defined for schema entry "'.concat(n,'".'))}fo(e,void 0)}function fo(e,r){if(r!==void 0&&r!==!1)throw new Error("In a schema, a nested object can have a `required` property but the only allowed value is `undefined` or `false`. Otherwise, a \"required\" error for a nested object would have to include a specific `column` title and a nested object doesn't have one. You've specified the following `required`: ".concat(r));for(var t=0,n=Object.keys(e);t<n.length;t++){var o=n[t];if(Lr(e[o].schema)){if(e[o].column)throw new Error("In a schema, `column` property is only allowed when describing a property value rather than a nested object. Key: ".concat(o,`. Schema:
|
|
9
|
+
`).concat(JSON.stringify(e[o],null,2)));fo(e[o].schema,e[o].required)}}}function tf(e){return e==null}var Jn={propertyValueWhenColumnIsMissing:void 0,propertyValueWhenCellIsEmpty:null,transformEmptyObject:function(){return null},transformEmptyArray:function(){return null},separatorCharacter:","};function nf(e){return e?Ye(Ye({},Jn),e):Jn}var of={};function vr(e){"@babel/helpers - typeof";return vr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},vr(e)}var af=["schema"];function uo(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),t.push.apply(t,n)}return t}function so(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?uo(Object(t),!0).forEach(function(n){ff(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):uo(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function ff(e,r,t){return r=uf(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function uf(e){var r=sf(e,"string");return vr(r)==="symbol"?r:String(r)}function sf(e,r){if(vr(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(vr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function lf(e,r){if(e==null)return{};var t=cf(e,r),n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}function cf(e,r){if(e==null)return{};var t={},n=Object.keys(e),o,i;for(i=0;i<n.length;i++)o=n[i],!(r.indexOf(o)>=0)&&(t[o]=e[o]);return t}function Bt(e,r,t,n,o){var i=o||{},f=i.schema,a=lf(i,af);return jt(e,r,t,so(so({},a),{},{sheets:[n===void 0?1:n]})).then(function(u){var s=u[0].data;return f?Vt(s,f,a):s})}var hf=void 0;function zr(e,r,t){return!t&&r&&typeof r!="number"&&typeof r!="string"&&(t=r,r=void 0),dt(e).then(function(n){return Bt(hf,et,n,r,t)})}var re=e=>Uint8Array.from(e,r=>r.charCodeAt(0)),ke=60,yr=33,pf=re("DOCTYPE"),vf=re("ENTITY"),lo=re("<sheetData"),Ur=re("</sheetData>"),co=re("<row"),mf=re("<!--"),yf=re("-->"),df=re("<![CDATA["),gf=re("]]>"),wf=re("?>"),bf=re(">"),ho=re("</row>"),xf=re("</c>"),po=re('t="e"');function ye(e,r,t=0,n=e.length){let o=r[0],i=n-r.length,f=n<e.length?e.subarray(0,n):e;for(let a=f.indexOf(o,t);a!==-1&&a<=i;a=f.indexOf(o,a+1)){let u=1;for(;u<r.length&&e[a+u]===r[u];)u++;if(u===r.length)return a}return-1}function vo(e,r,t){for(let n=0;n<t.length;n++)if((e[r+n]|32)!==(t[n]|32))return!1;return!0}function Br(e,r){let t=new Uint8Array(0),n=!0;return i=>{if(n&&i.length>=2&&(i[0]===254&&i[1]===255||i[0]===255&&i[1]===254)||i.indexOf(0)!==-1)throw U("XML_DECLARATION",e,`the part "${r}" is not UTF-8 XML, which a workbook always is; it is refused.`,{part:r});n=!1,t.length&&o(mo(t,i.subarray(0,9))),o(i),t=i.length>=9?i.slice(i.length-9):mo(t,i).slice(-9)};function o(i){for(let f=i.indexOf(yr,1);f!==-1;f=i.indexOf(yr,f+1))if(i[f-1]===ke&&(vo(i,f+1,pf)||vo(i,f+1,vf)))throw U("XML_DECLARATION",e,`the part "${r}" declares a document type or entities, which a workbook never needs; it is refused.`,{part:r})}}function xo(e,r,t){Br(r,t)(e)}function mo(e,r){let t=new Uint8Array(e.length+r.length);return t.set(e),t.set(r,e.length),t}var Gt=128*1024,Vr=1024*1024,Sf=256*1024,mr=0,Xt=1,yo=2,Of=3,go=re("![CDATA["),wo=re("!--"),xe=e=>e===32||e===9||e===10||e===13;function dr(e,r,t){let n=mr,o=0,i=0,f=0,a=[],u=0,s=0,h=0,l=0,c=()=>U("DAMAGED",r,`the part "${t}" holds a text of more than 1 MiB (an Excel cell holds at most 32,767 characters); the workbook is refused.`,{part:t}),m=()=>U("DAMAGED",r,`the part "${t}" holds a tag of more than 256 KiB; the workbook is refused.`,{part:t}),A=O=>a.length<=O.length&&a.every((P,v)=>P===O[v]),_=O=>(u=O.at(-1)??0,s=O.length>1?O[0]:0,h=a.at(-1)??0,l=a.at(-2)??0,Of);return{write(O,P=0,v=O.length){let d=n,g=o,E=f,N=i,j=v<O.length?O.subarray(0,v):O,S=P,y=P;for(;y<v;)if(d===mr){let b=y,I=Math.min(v,y+16);for(;b<I&&O[b]!==ke;)b++;if(b===I&&I<v){let B=j.indexOf(ke,I);b=B===-1?v:B}if(E+(b-y)>Gt)for(;y<b;){let B=O[y];if(B===32||B===9||B===10||B===13){if(E===Gt){for(S<y&&e.write(O,S,y);y<b&&xe(O[y]);)y++;S=y;continue}E++}else E=0;if(y++,++N>Vr)throw c()}else{if(N+=b-y,N>Vr)throw c();let B=b;for(;B>y&&xe(O[B-1]);)B--;E=B===y?E+(b-y):b-B,y=b}y<v&&(E=0,N=1,y++,y<v&&O[y]!==yr&&O[y]!==63?(d=Xt,g=0):(d=yo,a=[]))}else if(d===Xt){for(;y<v;y++){let b=O[y];if(g!==0)b===g&&(g=0);else{if(b===62)break;if(b===32||b===9||b===10||b===13){if(E===Gt){for(S<y&&e.write(O,S,y);y<v&&xe(O[y]);)y++;S=y,y--;continue}E++}else E=0,(b===34||b===39)&&(g=b)}if(++N>Sf)throw m()}y<v&&(d=mr,E=0,N=0,y++)}else if(d===yo){let b=O[y++];if(a.push(b),++N>Vr)throw c();if(a.length===1&&b===63)d=_([63]);else if(a[0]===yr&&A(wo))a.length===wo.length&&(d=_([45,45]));else if(a[0]===yr&&A(go))a.length===go.length&&(d=_([93,93]));else{d=Xt,g=0,E=0;for(let I of a)if(g!==0)I===g&&(g=0);else if(I===34||I===39)g=I;else if(I===62){d=mr,N=0,E=0;break}else E=xe(I)?E+1:0}}else for(;y<v;y++){let b=O[y];if(++N>Vr)throw c();if(b===62&&h===u&&(s===0||l===s)){d=mr,N=0,y++;break}l=h,h=b}S<v&&e.write(O,S,v),n=d,o=g,f=E,i=N}}}function So(e,r,t){for(let n=r;n<t;n++){let o=e[n];if(o===34||o===39)for(n++;n<t&&e[n]!==o;)n++;else if(xe(o)&&e[n+1]===114){let i=n+2;for(;i<t&&xe(e[i]);)i++;if(i<t&&e[i]===61){for(i++;i<t&&xe(e[i]);)i++;if(i<t&&(e[i]===34||e[i]===39)){for(i++;i<t&&xe(e[i]);)i++;return i}}}}return-1}function Ef(e,r,t){for(let n=r;n<t;n++){let o=e[n];if(o===62||o===ke)return n;if(o===34||o===39){for(n++;n<t&&e[n]!==o&&e[n]!==ke;)n++;if(e[n]===ke)return n}}return t}function Af(e,r,t){let n=So(e,r+4,t),o=0;if(n!==-1)for(let i=n;i<t&&e[i]>=48&&e[i]<=57&&o<=1e12;i++)o=o*10+(e[i]-48);return o}var _f=64*1024*1024,Tf=1024*1024,bo=re("<c");function Pf(e,r,t){let n=[],o=0;if(dr({write:(a,u=0,s=a.length)=>{n.push(a.subarray(u,s)),o+=s-u}},r,t).write(e),n.length===1)return n[0];let i=new Uint8Array(o),f=0;for(let a of n)i.set(a,f),f+=a.length;return i}function If(e,r,t){let n=0,o=0;for(let i=ye(e,bo,r,t);i!==-1;i=ye(e,bo,i+2,t)){if(!xe(e[i+2]))continue;let f=Ef(e,i+1,t),a=So(e,i+2,f);if(a===-1)continue;let u=0;for(;a<f&&(e[a]|32)>=97&&(e[a]|32)<=122&&u<=1e7;a++)u=u*26+((e[a]|32)-96);let s=0;for(;a<f&&e[a]>=48&&e[a]<=57&&s<=1e12;a++)s=s*10+(e[a]-48);n=Math.max(n,u),o=Math.max(o,s)}return{column:n,row:o}}function Oo(e,r={}){let t=r.file??"file",n=r.part??"sheet",o=0,i=0,f=new Uint8Array(0),a=0,u=0,s=0,h=0,l=new Uint8Array(0),c=P=>{let v=f,d=0;for(;d<v.length;){if(i===0){let y=ye(v,lo,d);if(y===-1){let I=P?v.length:Math.max(d,v.length-lo.length);e.write(v,d,I),d=I;break}let b=v.indexOf(62,y);if(b===-1){e.write(v,d,y),d=y;break}e.write(v,d,b+1),d=b+1,i=v[b-1]===47?2:1;continue}if(i===2){let y=v.indexOf(ke,d);if(y===-1){d=v.length;break}let b=v.indexOf(62,y);if(b===-1){d=P?v.length:y;break}v[y+1]===47&&b-y<1024&&(l=v.slice(y,b+1)),d=b+1;continue}let g=v.indexOf(ke,d);if(g===-1){d=v.length;break}if(ye(v,Ur,g,g+Ur.length)===g){e.write(v,g,g+Ur.length),i=2,d=g+Ur.length;continue}if(ye(v,co,g,g+co.length)!==g){let y=v[g+1]===63?wf:ye(v,mf,g,g+4)===g?yf:ye(v,df,g,g+9)===g?gf:bf,b=ye(v,y,g+1);if(b===-1){d=g;break}d=b+y.length;continue}let E=v.indexOf(62,g);if(E===-1){d=g;break}let N=Af(v,g,E);if(v[E-1]===47){u=Math.max(u,N),s++,d=E+1;continue}let j=ye(v,ho,E);if(j===-1){d=g;break}let S=j+ho.length;if(u=Math.max(u,N),ye(v,xf,E,j)!==-1){let y=If(v,E,j),b=Math.max(N,y.row);if(o=Math.max(o,y.column),r.maxRow!==void 0&&b>r.maxRow)throw De("rows",b,r.maxRow,t,"rows");if(r.maxColumn!==void 0&&o>r.maxColumn)throw De("columns",o,r.maxColumn,t,"columns");if(r.maxCells!==void 0&&b*o>r.maxCells)throw De("importCells",b*o,r.maxCells,t,"values (rows x columns)");e.write(v,g,S),a=Math.max(a,b);for(let I=ye(v,po,E,j);I!==-1;I=ye(v,po,I+1,j))xe(v[I-1])&&h++}else s++;d=S}if(f=d<v.length?v.slice(d):new Uint8Array(0),i===1&&f.length>Tf&&(f=Pf(f,t,n)),f.length>_f)throw U("DAMAGED",t,"a row of the sheet is larger than 64 MiB, or the sheet's XML is broken; the workbook is refused.")},m=[],A=0,_=0,O=()=>{if(m.length===1)return m[0];let P=new Uint8Array(A),v=0;for(let d of m)P.set(d,v),v+=d.length;return P};return{push(P){m.push(P),A+=P.length,!(A<_)&&(f=O(),c(!1),m=f.length?[f]:[],A=f.length,_=f.length*2)},end(){return f=A?O():new Uint8Array(0),m=[],c(!0),f.length&&e.write(f),l.length&&e.write(l),{lastRow:u,lastValueRow:a,dropped:s,errors:h}}}}var Ao=101010256,Df=117853008,Nf=101075792,_o=33639248,To=67324752,Eo=16384,Se=(e,r)=>e[r]|e[r+1]<<8,de=(e,r)=>(e[r]|e[r+1]<<8|e[r+2]<<16|e[r+3]<<24)>>>0,Fe=(e,r)=>de(e,r)+de(e,r+4)*2**32;function Po(e,r,t){let n=c=>U("DAMAGED",r,`the workbook is damaged or cut off (${c}); open it in Excel and save it again.`),o=-1;for(let c=e.length-22;c>=0&&c>=e.length-65557;c--)if(de(e,c)===Ao){o=c;break}if(o<0)throw n("no ZIP directory");let i=Se(e,o+10),f=de(e,o+12),a=de(e,o+16);if((i===65535||a===4294967295||f===4294967295)&&o>=20&&de(e,o-20)===Df){let c=Fe(e,o-12);if(c+56>e.length||de(e,c)!==Nf)throw n("ZIP64 directory");i=Fe(e,c+32),f=Fe(e,c+40),a=Fe(e,c+48)}if(i>t.archiveEntries)throw De("archiveEntries",i,t.archiveEntries,r,"parts in its ZIP directory");if(a+f>e.length)throw n("directory outside the file");let u=[],s=0,h=a,l=new TextDecoder;for(let c=0;c<i;c++){if(h+46>e.length||de(e,h)!==_o)throw n("directory entry");let m=Se(e,h+8),A=Se(e,h+10),_=de(e,h+20),O=de(e,h+24),P=Se(e,h+28),v=Se(e,h+30),d=Se(e,h+32),g=de(e,h+42),E=l.decode(e.subarray(h+46,h+46+P)),N=h+46+P,j=N+v;for(;N+4<=j;){let S=Se(e,N),y=Se(e,N+2);if(S===1){let b=N+4;O===4294967295&&(O=Fe(e,b),b+=8),_===4294967295&&(_=Fe(e,b),b+=8),g===4294967295&&(g=Fe(e,b))}N+=4+y}if(m&1)throw U("ENCRYPTED",r,"the workbook is encrypted; save it without a password, then load it.");if(A!==0&&A!==8)throw U("DAMAGED",r,`a part of the workbook uses compression method ${A}, which is not read; save it again in Excel.`);if(s+=O,s>t.unpackedBytes)throw De("unpackedBytes",s,t.unpackedBytes,r,"bytes unpacked, by its ZIP directory; a ZIP bomb or a workbook too large to load");u.push({name:E,method:A,compressedSize:_,size:O,localOffset:g}),h=j+d}return u}function kf(e,r,t){let n=r.localOffset;if(n+30>e.length||de(e,n)!==To)throw U("DAMAGED",t,`the workbook is damaged (part "${r.name}"); open it in Excel and save it again.`);let o=n+30+Se(e,n+26)+Se(e,n+28),i=o+r.compressedSize;if(i>e.length)throw U("DAMAGED",t,`the workbook is cut off (part "${r.name}"); load the whole file.`);return[o,i]}async function Gr(e,r,t,n,o){let[i,f]=kf(e,r,t),a=0,u=s=>{if(a+=s.length,a>r.size)throw U("DAMAGED",t,`the part "${r.name}" unpacks to more than the ${r.size.toLocaleString("en-US")} bytes its directory states: a damaged or forged workbook.`);s.length>0&&n(s)};if(r.method===0)for(let s=i;s<f;s+=1<<20)u(e.subarray(s,Math.min(f,s+(1<<20)))),await o?.();else{let s=new Sn(h=>u(h));for(let h=i;h<f;h+=Eo){let l=Math.min(f,h+Eo);try{s.push(e.subarray(h,l),l===f)}catch(c){throw c?.code===void 0||typeof c.code!="number"?c:U("DAMAGED",t,`the part "${r.name}" cannot be unpacked; the workbook is damaged or cut off.`)}await o?.()}}if(a!==r.size)throw U("DAMAGED",t,`the part "${r.name}" unpacks to ${a.toLocaleString("en-US")} bytes, not the ${r.size.toLocaleString("en-US")} its directory states; the workbook is damaged.`)}async function Io(e,r,t,n){let o=new Uint8Array(r.size),i=0;return await Gr(e,r,t,f=>{o.set(f,i),i+=f.length},n),o}var Rf=(()=>{let e=new Int32Array(256);for(let r=0;r<256;r++){let t=r;for(let n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e})();function jf(e,r=0,t=0,n=e.length){let o=~r;for(let i=t;i<n;i++)o=Rf[(o^e[i])&255]^o>>>8;return~o>>>0}function Do(e=1<<20){let r=new Uint8Array(e),t=0,n=[],o=a=>{if(t+a<=r.length)return;let u=Math.ceil(r.length*1.5);for(;u<t+a;)u=Math.ceil(u*1.5);let s=new Uint8Array(u);s.set(r.subarray(0,t)),r=s},i=(a,u)=>{r[a]=u&255,r[a+1]=u>>>8&255},f=(a,u)=>{i(a,u&65535),i(a+2,u>>>16)};return{begin(a){let u=new TextEncoder().encode(a);o(30+u.length);let s=t;f(s,To),i(s+4,20),r.fill(0,s+6,s+26),i(s+26,u.length),i(s+28,0),r.set(u,s+30),t+=30+u.length;let h=t,l=0;return{write(c,m=0,A=c.length){o(A-m),r.set(c.subarray(m,A),t),l=jf(c,l,m,A),t+=A-m},end(){let c=t-h;if(c>4294967294)throw new RangeError("a stored part over 4 GiB");f(s+14,l),f(s+18,c),f(s+22,c),n.push({name:u,crc:l,size:c,offset:s})}}},add(a,u){let s=this.begin(a);s.write(u),s.end()},finish(){let a=t;for(let u of n)o(46+u.name.length),f(t,_o),i(t+4,20),i(t+6,20),r.fill(0,t+8,t+46),f(t+16,u.crc),f(t+20,u.size),f(t+24,u.size),i(t+28,u.name.length),f(t+42,u.offset),r.set(u.name,t+46),t+=46+u.name.length;return o(22),f(t,Ao),r.fill(0,t+4,t+22),i(t+8,n.length),i(t+10,n.length),f(t+12,t-a),f(t+16,a),t+=22,r.subarray(0,t)}}}var Cf={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};function Mf(e){return e.replace(/&(?:#x([0-9a-f]{1,6})|#(\d{1,7})|(amp|lt|gt|quot|apos));/gi,(r,t,n,o)=>{if(o)return Cf[o.toLowerCase()]??r;let i=t?parseInt(t,16):Number(n);return i>0&&i<=1114111?String.fromCodePoint(i):""})}function Lf(e){let r=new Map;for(let t of e.matchAll(/(?:[\w.-]+:)?([\w.-]+)\s*=\s*("([^"]*)"|'([^']*)')/g))r.has(t[1])||r.set(t[1],Mf(t[3]??t[4]??""));return r}function $t(e,r){return[...e.matchAll(new RegExp(`<(?:[\\w.-]+:)?${r}\\b([^<>]*)>`,"g"))].map(t=>Lf(t[1]))}function qt(e){let r=(e.startsWith("/")?e.slice(1):`xl/${e}`).split("/"),t=[];for(let n of r)n===".."?t.pop():n!=="."&&n!==""&&t.push(n);return t.join("/")}function No(e,r){let t=new Map;for(let o of $t(r,"Relationship")){let i=o.get("Type")??"";/\/worksheet$/.test(i)&&o.has("Id")&&o.has("Target")&&o.get("TargetMode")!=="External"&&t.set(o.get("Id"),qt(o.get("Target")))}let n=[];for(let o of $t(e,"sheet")){let i=t.get(o.get("id")??"");if(i===void 0)continue;let f=o.get("state");n.push({name:o.get("name")??"",index:n.length,visible:f!=="hidden"&&f!=="veryHidden",path:i})}return n}function ko(e){let r={sharedStrings:"xl/sharedStrings.xml",styles:"xl/styles.xml"};for(let t of $t(e,"Relationship")){let n=t.get("Type")??"";/\/sharedStrings$/.test(n)&&t.has("Target")&&(r.sharedStrings=qt(t.get("Target"))),/\/styles$/.test(n)&&t.has("Target")&&(r.styles=qt(t.get("Target")))}return r}var Ff=[208,207,17,224,161,177,26,225],zf=[80,75,3,4],Ro=(e,r)=>r.every((t,n)=>e[n]===t),Yt=e=>Yr(String(e)).slice(0,100),Wt=4*1024*1024,Uf=e=>Array.from(e,r=>r.charCodeAt(0)),Vf=Uf("EncryptedPackage").flatMap(e=>[e,0]);function Bf(e,r){let t=r[0];for(let n=e.indexOf(t);n!==-1&&n<=e.length-r.length;n=e.indexOf(t,n+1)){let o=1;for(;o<r.length&&e[n+o]===r[o];)o++;if(o===r.length)return!0}return!1}function Gf(e,r){if(/\.xlsm$/i.test(r))throw U("MACROS",r,"a workbook with macros (.xlsm) is not loaded; save it as an Excel workbook (.xlsx) or as CSV.");if(Ro(e,Ff))throw Bf(e,Vf)?U("ENCRYPTED",r,"the workbook is protected with a password; save it without one, then load it."):U("XLS",r,"this is an Excel 97-2003 workbook (.xls); save it as an Excel workbook (.xlsx) or as CSV, then load it.");if(!Ro(e,zf))throw U("WRONG_TYPE",r,"this is no Excel workbook (.xlsx); check the file, or load a CSV file with the CSV reader.")}async function jo(e,r,t,n){Gf(e,r);let o=Po(e,r,t),i=new Map(o.map(m=>[m.name,m]));for(let m of o)if(/(^|\/)vbaProject\.bin$/i.test(m.name))throw U("MACROS",r,"the workbook holds macros (vbaProject.bin); save it as an Excel workbook (.xlsx) without macros, or as CSV.");if(!i.has("xl/workbook.xml"))throw i.has("xl/workbook.bin")?U("XLSB",r,"this is an Excel binary workbook (.xlsb); save it as an Excel workbook (.xlsx) or as CSV, then load it."):U("WRONG_TYPE",r,"this ZIP file is no Excel workbook (it has no xl/workbook.xml).");let f=new Map,a=async(m,A=1/0)=>{let _=i.get(m);if(!_)return null;if(_.size>A)throw U("DAMAGED",r,`the part "${m}" is ${_.size.toLocaleString("en-US")} bytes, far more than a workbook's list of sheets holds; it is refused.`);let O=await Io(e,_,r,n);return xo(O,r,m),f.set(m,O),O},u=await a("[Content_Types].xml",Wt);if(u&&/macroEnabled/i.test(new TextDecoder().decode(u)))throw U("MACROS",r,"a workbook with macros (.xlsm) is not loaded; save it as an Excel workbook (.xlsx) or as CSV.");let s=m=>m?new TextDecoder().decode(m):"",h=s(await a("xl/workbook.xml",Wt)),l=s(await a("xl/_rels/workbook.xml.rels",Wt)),c=No(h,l);if(c.length===0)throw U("NO_TABLE",r,"the workbook has no worksheet.");return{entries:i,parts:f,sheets:c,shared:ko(l)}}function Xf(e,r,t){if(typeof r=="string"){let n=e.find(o=>o.name===r);if(!n)throw U("NO_SHEET",t,`the workbook has no sheet "${Yt(r)}".`,{sheet:r});return n}if(typeof r=="number"){let n=e[r];if(!n)throw U("NO_SHEET",t,`the workbook has no sheet ${r+1}.`,{sheet:r});return n}return e.find(n=>n.visible)??e[0]}async function qs(e,r){let t=xr(r),n=wr(e,t),o=await br(e,t.limits,n),{sheets:i}=await jo(o,n,t.limits,()=>t.signal?.throwIfAborted());return i.map(({name:f,index:a,visible:u})=>({name:f,index:a,visible:u}))}async function Ws(e,r){let t=xr(r),n=wr(e,t),o=t.signal;o?.throwIfAborted();let i=await br(e,t.limits,n);t.onProgress?.({phase:"read",done:i.length,total:i.length});let f=()=>o?.throwIfAborted(),{entries:a,parts:u,sheets:s,shared:h}=await jo(i,n,t.limits,f),l=Xf(s,t.sheet,n),c=a.get(l.path);if(!c)throw U("DAMAGED",n,`the part of sheet "${Yt(l.name)}" is missing; open the workbook in Excel and save it again.`);let m=[h.sharedStrings,h.styles].filter((S,y,b)=>a.has(S)&&!u.has(S)&&b.indexOf(S)===y&&S!==l.path),A=c.size+22+2*(76+l.path.length);for(let[S,y]of u)A+=y.length+2*(76+S.length);for(let S of m)A+=a.get(S).size+2*(76+S.length);let _=Do(A);for(let[S,y]of u){let b=_.begin(S);dr(b,n,S).write(y),b.end()}u.clear();for(let S of m){let y=_.begin(S),b=dr(y,n,S),I=Br(n,S);await Gr(i,a.get(S),n,B=>{I(B),b.write(B)},f),y.end()}let O=_.begin(l.path),P=Oo(dr(O,n,l.path),{file:n,part:l.path,maxRow:t.limits.rows+1e3,maxColumn:t.limits.columns,maxCells:t.limits.importCells+t.limits.columns*1e3}),v=Br(n,l.path),d=0;await Gr(i,c,n,S=>{v(S),P.push(S),d+=S.length},()=>{o?.throwIfAborted(),t.onProgress?.({phase:"unpack",done:d,total:c.size})});let g=P.end();O.end();let E=_.finish();o?.throwIfAborted(),t.onProgress?.({phase:"parse",done:0,total:g.lastValueRow});let N;try{let S=E.buffer,y=S.byteLength===E.length?S:typeof S.transfer=="function"?S.transfer(E.length):E.slice().buffer;E=null,N=await zr(y,l.name)}catch(S){throw U("DAMAGED",n,`sheet "${Yt(l.name)}" cannot be read (${String(S?.message??S).slice(0,200)}); open the workbook in Excel and save it again.`)}o?.throwIfAborted(),t.onProgress?.({phase:"parse",done:g.lastValueRow,total:g.lastValueRow});let j=Hr({file:n,limits:t.limits,locale:t.locale,hints:{decimal:".",serialDates:!0}});j.note("SHEET",{sheet:l.name,count:s.length,visible:s.filter(S=>S.visible).length}),g.lastRow>g.lastValueRow&&g.lastRow-g.lastValueRow>=100&&j.note("USED_RANGE",{usedRow:g.lastRow,lastRow:g.lastValueRow});for(let S=0;S<N.length;S++)j.row(N[S]),N[S]=null;return g.errors>0&&j.note("ERROR_CELLS",{count:g.errors}),o?.throwIfAborted(),j.finish(t.types)}export{Ws as read,qs as sheets};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.freeze({apiVersion:1,kind:"reader",name:"xlsx",label:"Excel workbook",accept:Object.freeze([".xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]),load:()=>import("./chunks/reader-S5MTRZAR.js")}),o=e;export{o as default,e as xlsxReader};
|
package/package.json
CHANGED
|
@@ -1,6 +1,68 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pivotkit-xlsx",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Reader plugin for pivotkit: load Excel workbooks (.xlsx) into a pivot report in the browser, with checks against ZIP bombs, macros and oversized used ranges before parsing.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "eizedev <oss@eize.dev>",
|
|
7
|
+
"homepage": "https://pivotkit.eize.dev/reference/plugins/",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/eizedev/pivotkit.git",
|
|
11
|
+
"directory": "packages/pivotkit-xlsx"
|
|
12
|
+
},
|
|
13
|
+
"bugs": "https://github.com/eizedev/pivotkit/issues",
|
|
14
|
+
"keywords": [
|
|
15
|
+
"pivotkit-plugin",
|
|
16
|
+
"pivotkit",
|
|
17
|
+
"xlsx",
|
|
18
|
+
"excel",
|
|
19
|
+
"import",
|
|
20
|
+
"spreadsheet",
|
|
21
|
+
"pivot-table",
|
|
22
|
+
"pivot-grid",
|
|
23
|
+
"pivottable"
|
|
24
|
+
],
|
|
25
|
+
"type": "module",
|
|
26
|
+
"sideEffects": false,
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./types/index.d.ts",
|
|
30
|
+
"default": "./src/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./reader": {
|
|
33
|
+
"types": "./types/reader.d.ts",
|
|
34
|
+
"default": "./src/reader.js"
|
|
35
|
+
},
|
|
36
|
+
"./package.json": "./package.json"
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"src",
|
|
40
|
+
"types",
|
|
41
|
+
"dist",
|
|
42
|
+
"README.md",
|
|
43
|
+
"CHANGELOG.md",
|
|
44
|
+
"LICENSE"
|
|
45
|
+
],
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": ">=22"
|
|
48
|
+
},
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build": "node build.js",
|
|
51
|
+
"size": "node build.js --size",
|
|
52
|
+
"test": "node --test \"test/*.test.js\"",
|
|
53
|
+
"coverage": "node --test --experimental-test-coverage --test-coverage-include=\"src/**\" \"test/*.test.js\"",
|
|
54
|
+
"types": "tsc -p .",
|
|
55
|
+
"bench": "node test/bench.js",
|
|
56
|
+
"prepack": "npm run types && node build.js && node -e \"require('node:fs').copyFileSync('../../LICENSE', 'LICENSE')\"",
|
|
57
|
+
"test:types": "tsc -p test/types"
|
|
58
|
+
},
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"fflate": "0.8.3",
|
|
61
|
+
"pivotkit-core": "^0.5.0",
|
|
62
|
+
"read-excel-file": "9.3.14"
|
|
63
|
+
},
|
|
64
|
+
"types": "./types/index.d.ts",
|
|
65
|
+
"publishConfig": {
|
|
66
|
+
"access": "public"
|
|
67
|
+
}
|
|
68
|
+
}
|
package/src/index.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* pivotkit-xlsx: the reader plugin for Excel workbooks (.xlsx) of pivotkit-core/import, contract
|
|
3
|
+
* version 1. This module is the plugin's descriptor only; the reader (reader.js, with read-excel-file
|
|
4
|
+
* and fflate) is loaded when the first workbook is read.
|
|
5
|
+
*
|
|
6
|
+
* import { readFile } from "pivotkit-core/import";
|
|
7
|
+
* import xlsxReader from "pivotkit-xlsx";
|
|
8
|
+
* const table = await readFile(file, { plugins: [xlsxReader] });
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/** @type {import("pivotkit-core/import").ReaderPlugin} */
|
|
12
|
+
export const xlsxReader = Object.freeze({
|
|
13
|
+
apiVersion: 1,
|
|
14
|
+
kind: "reader",
|
|
15
|
+
name: "xlsx",
|
|
16
|
+
label: "Excel workbook",
|
|
17
|
+
accept: Object.freeze([".xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]),
|
|
18
|
+
load: () => import("./reader.js")
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export default xlsxReader;
|