pivotkit-xlsx 0.1.0 → 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 +33 -1
- package/dist/chunks/chunk-KDJGTIXW.js +1 -0
- package/dist/chunks/{chunk-GPNA7WRL.js → chunk-TEWBHPQ4.js} +1 -1
- package/dist/chunks/{import-csv-QZDVETIW.js → import-csv-TRZA6M7W.js} +1 -1
- package/dist/chunks/{import-json-GKBVWJSK.js → import-json-YR5ADN4H.js} +1 -1
- package/dist/chunks/reader-S5MTRZAR.js +9 -0
- package/dist/index.js +1 -1
- package/package.json +6 -3
- package/src/reader.js +30 -20
- package/src/xml.js +360 -45
- package/src/zip.js +3 -3
- package/types/xml.d.ts +48 -4
- package/dist/chunks/chunk-FI6VROG7.js +0 -1
- package/dist/chunks/reader-VGOKIFNW.js +0 -9
|
@@ -1 +0,0 @@
|
|
|
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,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});function P(e){let t=e&&e.limits;if(t==null)return R;if(typeof t!="object")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(":",""),N=Number(h.slice(0,2)),E=Number(h.slice(2)||0);if(N>23||E>59)return null;p=(n[0]==="-"?-1:1)*(N*60+E)}return{ms:a,offsetMinutes:p}}var V=Object.freeze(["string","number","date","boolean"]),De=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"]),M=20,K=50,we=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"),B=/[\t\r\n\u2028\u2029]+/g;function Ae(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 limits.${e}`,{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 Se(e,t){let n=e&&typeof e=="object"&&typeof e.name=="string"?e.name:"";return v(String(t?.name??n??"")).slice(0,256)||"file"}async function be(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 Ce(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 Re=()=>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 T(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(B," ").trim()}var Z=/^[+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?$/,ee=/^[+-]?(?:\d{1,3}(?:\.\d{3})+|\d+)(?:,\d+)?$/,te=/^[+-]?0\d/,ne=15,j=/^(\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 x(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=j.exec(e);if(n){let[r,o,l,u,s,i]=k(n);return x(l,o,r,u,s,i)}if(n=G.exec(e),n){let[r,o,l,u,s,i]=k(n);return t==="mdy"?x(l,r,o,u,s,i):x(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&&(!j.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 I(e,t,n){if(e==null)return null;switch(typeof e){case"string":return F(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 F(JSON.stringify(e)??"",t,n)}catch{return null}default:return null}}function F(e,t,n){let r=e;return W.test(r)&&(r=r.replace(b,""),n.removed++),r=r.replace(B," ").trim(),r.length>t&&(r=r.slice(0,t),n.cut++),r===""?null:r}function Le(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=I(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)},N=c=>{s=c.map(d=>{let y=I(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)I(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(T("LINES_SKIPPED",{count:m})),N(m<c.length?c[m]:[]),c.splice(0,m+1)}for(let d of c)h(d)};return{header(c){N(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(T(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<=M&&n.push(T("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>M&&n.push(T("COLUMNS_RENAMED_MORE",{count:l-M})),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(T("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(T("COLUMNS_ADDED",{rows:o.extraRows,count:h})),o.empty>0&&r.push(T("ROWS_EMPTY",{count:o.empty})),o.cut>0&&r.push(T("TEXT_CUT",{count:o.cut,max:u.textLength})),o.removed>0&&r.push(T("CHARACTERS_REMOVED",{count:o.removed}));let N={columns:a,types:[],data:[],raw:p,detected:[],rowCount:n,notes:r,hints:l},E=p.map(c=>ae(c,l));return N.detected=E.map(c=>c.type),E.forEach((c,d)=>{c.ambiguousOrder&&r.push(T("DATE_ORDER",{column:a[d],order:c.dateOrder}))}),pe(N,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 N=e.notes.find(E=>E.code==="VALUES_NOT_CONVERTED"&&E.params.column===e.columns[s]);N&&o.push(N);continue}let{values:p,failed:h}=ce(e.raw[s],f,a);h>0&&o.push(T("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,we as b,Ae as c,q as d,O as e,Se as f,be as g,Ce as h,Re as i,v as j,Le as k};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{a as Yt,c as L,d as Ze,f as vr,g as mr,h as yr,j as zr,k as Ur}from"./chunk-FI6VROG7.js";var dr=1,_o=/^[a-z0-9][a-z0-9-]{0,63}$/,To=/^\.[a-z0-9]{1,16}$/,Po=/^[a-z0-9][a-z0-9!#$&^_.+-]*\/[a-z0-9][a-z0-9!#$&^_.+-]*$/,qt=["reader"];function Ht(e){let r=e,t=n=>{throw new Yt("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!==dr&&t(`uses plugin API version ${JSON.stringify(r.apiVersion)}; this pivotkit-core supports version ${dr}. Use a version of the plugin made for API ${dr}, or update pivotkit.`),qt.includes(r.kind)||t(`has kind ${JSON.stringify(r.kind)}; API ${dr} knows ${qt.map(n=>`"${n}"`).join(", ")}`),(typeof r.name!="string"||!_o.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"&&(To.test(n)||Po.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 Io=Ht({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-QZDVETIW.js")}),Do=Ht({apiVersion:1,kind:"reader",name:"json",label:"JSON",accept:[".json","application/json"],load:()=>import("./import-json-GKBVWJSK.js")}),kf=Object.freeze([Io,Do]);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)}function Br(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(y){o[y.toUpperCase()]=o[y]});function i(y,w,A,T){return T?t.call(o,T)?o[T]:"&"+T+";":r(w||parseInt(A,16))}function f(y){return y.length>3&&y.indexOf("&")!==-1?y.replace(n,i):y}var a="non-whitespace outside of root node";function u(y){return new Error(y)}function s(y){return"missing namespace for prefix <"+y+">"}function l(y){return{get:y,enumerable:!0}}function c(y){var w={},A;for(A in y)w[A]=y[A];return w}var h=Symbol("nameCache");function v(y){return y+"$uri"}function O(y){var w={},A,T;for(A in y)T=y[A],w[T]=T,w[v(T)]=A;return w}function S(){return{line:0,column:0}}function g(y){throw y}function x(y){if(!this)return new x(y);var w=y&&y.proxy,A,T,z,b,P=g,M,Y,B,me,q=S,be=!1,xe=!1,ne="",ue=!1,ie=!1,J=null,re=!1,m,p,E,_;function k(d){d instanceof Error||(d=u(d)),J=d,P(d,q)}function N(d){M&&(d instanceof Error||(d=u(d)),M(d,q))}this.on=function(d,U){if(typeof U!="function")throw u("required args <name, cb>");switch(d){case"openTag":T=U;break;case"text":A=U;break;case"closeTag":z=U;break;case"error":P=U;break;case"warn":M=U;break;case"cdata":b=U;break;case"attention":me=U;break;case"question":B=U;break;case"comment":Y=U;break;default:throw u("unsupported event: "+d)}return this},this.ns=function(d){if(typeof d>"u"&&(d={}),Vr(d)!=="object")throw u("required args <nsMap={}>");var U={},se;for(se in d)U[se]=d[se];return ie=!0,_=U,this};function X(){m=ie?[]:null,p=ie?O(_):null,E=[],q=S,re=!1,J=null,xe=!1,ne=""}this.parse=function(d){if(typeof d!="string")throw u("required args <xml=string>");if(be)throw u("parse during stream; call end() first");return X(),ee(d),q=S,re=!1,J},this.write=function(d){if(typeof d!="string")throw u("required args <xml=string>");return be||(X(),be=!0),J||(ne=ee(ne+d,!0)||""),this},this.end=function(){return be||X(),be=!1,J||ee(ne),ne="",q=S,re=!1,J},this.stop=function(){re=!0};function ee(d){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,se=null,We=null,Le,Eo=0,De=!1,_e=!1,R=0,I=0,G,Bt,$,j,Ye,qe,H,pr,Cr,Lr="",Fr=0,Fe;function $t(te,Se){var ae=te.indexOf(":");if(ae===-1)return te;var le=p[te.substring(0,ae)];return le?Se===le?te.substr(ae+1):le+te.substr(ae):(N(s(te.substring(0,ae))),null)}function Mr(){if(Fe!==null)return Fe;var te,Se,ae=ie&&p.xmlns,le=ie&&ue?[]:null,V=Fr,Q=Lr,ce=Q.length,Gt,Te,Pe,de,W,He={},Wt=new Set,ye,D,C;e:for(;V<ce;V++)if(ye=!1,D=Q.charCodeAt(V),!(D===32||D<14&&D>8)){for((D<65||D>122||D>90&&D<97)&&D!==95&&D!==58&&(N("illegal first char attribute name"),ye=!0),C=V+1;C<ce;C++)if(D=Q.charCodeAt(C),!(D>96&&D<123||D>64&&D<91||D>47&&D<59||D===46||D===45||D===95)){if(D===32||D<14&&D>8){N("missing attribute value"),V=C;continue e}if(D===61)break;N("illegal attribute name char"),ye=!0}if(W=Q.substring(V,C),W==="xmlns:xmlns"&&(N("illegal declaration of xmlns"),ye=!0),D=Q.charCodeAt(C+1),D===34)C=Q.indexOf('"',V=C+2),C===-1&&(C=Q.indexOf("'",V),C!==-1&&(N("attribute value quote missmatch"),ye=!0));else if(D===39)C=Q.indexOf("'",V=C+2),C===-1&&(C=Q.indexOf('"',V),C!==-1&&(N("attribute value quote missmatch"),ye=!0));else for(N("missing attribute value quotes"),ye=!0,C=C+1;C<ce&&(D=Q.charCodeAt(C+1),!(D===32||D<14&&D>8));C++);for(C===-1&&(N("missing closing quotes"),C=ce,ye=!0),ye||(Pe=Q.substring(V,C)),V=C;C+1<ce&&(D=Q.charCodeAt(C+1),!(D===32||D<14&&D>8));C++)V===C&&(N("illegal character after attribute end"),ye=!0);if(V=C+1,ye)continue e;if(Wt.has(W)){N("attribute <"+W+"> already defined");continue}if(Wt.add(W),!ie){He[W]=Pe;continue}if(ue){if(Te=W==="xmlns"?"xmlns":W.charCodeAt(0)===120&&W.substr(0,6)==="xmlns:"?W.substr(6):null,Te!==null){if(te=f(Pe),Se=v(Te),de=_[te],!de){if(Te==="xmlns"||Se in p&&p[Se]!==te)do de="ns"+Eo++;while(typeof p[de]<"u");else de=Te;_[te]=de}p[Te]!==de&&(Gt||(p=c(p),Gt=!0),p[Te]=de,Te==="xmlns"&&(p[v(de)]=te,ae=de),p[Se]=te),He[W]=Pe;continue}le.push(W,Pe);continue}W=$t(W,ae),W!==null&&(He[W]=Pe)}if(ue)for(V=0,ce=le.length;V<ce;V++)W=$t(le[V++],ae),Pe=le[V],W!==null&&(He[W]=Pe);return Fe=He}function Ao(){for(var te=/(\r\n|\r|\n)/g,Se=0,ae=0,le=0,V=I,Q,ce;R>=le&&(Q=te.exec(d),!(!Q||(V=Q[0].length+Q.index,V>R)));)Se+=1,le=V;return R==-1?(ae=V,ce=d.substring(I)):I===0?ce=d.substring(I,R):(ae=R-le,ce=I==-1?d.substring(R):d.substring(R,I+1)),{data:ce,line:Se,column:ae}}for(q=Ao,w&&(Cr=Object.create({},{name:l(function(){return H}),originalName:l(function(){return pr}),attrs:l(Mr),ns:l(function(){return p})}));I!==-1;){if(d.charCodeAt(I)===60?R=I:R=d.indexOf("<",I),R===-1){if(U)return d.substring(I);if(E.length)return k("unexpected end of file");if(!xe)return k("missing start tag");I<d.length&&d.substring(I).trim()&&N(a);return}if(xe||(xe=!0),I!==R){if(E.length){if(A&&(A(d.substring(I,R),f,q),re))return}else if(d.substring(I,R).trim()&&(N(a),re))return}if(j=d.charCodeAt(R+1),j===33){if($=d.charCodeAt(R+2),$===91&&d.substr(R+3,6)==="CDATA["){if(I=d.indexOf("]]>",R),I===-1)return U?d.substring(R):k("unclosed cdata");if(b&&(b(d.substring(R+9,I),q),re))return;I+=3;continue}if($===45&&d.charCodeAt(R+3)===45){if(I=d.indexOf("-->",R),I===-1)return U?d.substring(R):k("unclosed comment");if(Y&&(Y(d.substring(R+4,I),f,q),re))return;I+=3;continue}}if(j===63){if(I=d.indexOf("?>",R),I===-1)return U?d.substring(R):k("unclosed question");if(B&&(B(d.substring(R,I+2),q),re))return;I+=2;continue}for(G=R+1;;G++){if(Ye=d.charCodeAt(G),isNaN(Ye))return U?d.substring(R):(I=-1,k("unclosed tag"));if(Ye===34)$=d.indexOf('"',G+1),G=$!==-1?$:G;else if(Ye===39)$=d.indexOf("'",G+1),G=$!==-1?$:G;else if(Ye===62){I=G;break}}if(j===33){if(me&&(me(d.substring(R,I+1),f,q),re))return;I+=1;continue}if(Fe={},j===47){if(De=!1,_e=!0,!E.length)return k("missing open tag");if(G=H=E.pop(),$=R+2+G.length,d.substring(R+2,$)!==G)return k("closing tag mismatch");for(;$<I;$++)if(j=d.charCodeAt($),!(j===32||j>8&&j<14))return k("close tag")}else{if(d.charCodeAt(I-1)===47?(G=H=d.substring(R+1,I-1),De=!0,_e=!0):(G=H=d.substring(R+1,I),De=!0,_e=!1),!(j>96&&j<123||j>64&&j<91||j===95||j===58))return k("illegal first char nodeName");for($=1,Bt=G.length;$<Bt;$++)if(j=G.charCodeAt($),!(j>96&&j<123||j>64&&j<91||j>47&&j<59||j===45||j===95||j==46)){if(j===32||j<14&&j>8){H=G.substring(0,$),Fe=null;break}return k("invalid nodeName")}_e||E.push(H)}if(ie){Le=p,De&&(_e||m.push(Le),Fe===null&&(ue=G.indexOf("xmlns",$)!==-1)&&(Fr=$,Lr=G,Mr(),ue=!1)),pr=H,We!==p&&(se=p[h],se===void 0&&(se=p[h]={}),We=p);var Xt=se[H];if(Xt!==void 0)H=Xt;else{if(j=H.indexOf(":"),j!==-1){if(qe=p[H.substring(0,j)],!qe)return k("missing namespace on <"+pr+">");H=H.substr(j+1)}else qe=p.xmlns;qe&&(H=qe+":"+H),se[pr]=H}}if(De&&(Fr=$,Lr=G,T&&(w?T(Cr,f,_e,q):T(H,Mr,f,_e,q),re)))return;if(_e){if(z&&(z(w?Cr:H,f,De,q),re))return;ie&&(De?p=Le:p=m.pop())}I+=1}}}return new x(e)}function gr(e,r,t,n){var o=!1,i=function(){if(o)throw new Error("Errored")},f,a=new Br,u=function(h){i(),a.write(h)},s=function(){i(),a.end(),f()},l=new Promise(function(c,h){f=c;var v=function(y){throw o=!0,y},O=function(y,w){n&&n(w(y),e)},S=function(y,w,A,T,z){if(r){var b=w();for(var P in b)b[$r(P,!0)]=A(b[P]);r($r(y),b,e)}},g=function(y){t&&t($r(y),e)};a.on("error",v),a.on("text",O),a.on("openTag",S),a.on("closeTag",g)});return{promise:l,write:u,end:s}}function $r(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 Me(e){"@babel/helpers - typeof";return Me=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},Me(e)}function Zt(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,No(n.key),n)}}function ko(e,r,t){return r&&Zt(e.prototype,r),t&&Zt(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function No(e){var r=Ro(e,"string");return Me(r)==="symbol"?r:String(r)}function Ro(e,r){if(Me(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(Me(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function jo(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function Co(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&&Ke(e,r)}function Lo(e){var r=Kt();return function(){var n=Je(e),o;if(r){var i=Je(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Fo(this,o)}}function Fo(e,r){if(r&&(Me(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Mo(e)}function Mo(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xr(e){var r=typeof Map=="function"?new Map:void 0;return Xr=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 wr(n,arguments,Je(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),Ke(o,n)},Xr(e)}function wr(e,r,t){return Kt()?wr=Reflect.construct.bind():wr=function(o,i,f){var a=[null];a.push.apply(a,i);var u=Function.bind.apply(o,a),s=new u;return f&&Ke(s,f.prototype),s},wr.apply(null,arguments)}function Kt(){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 Ke(e,r){return Ke=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Ke(e,r)}function Je(e){return Je=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Je(e)}var Ie=(function(e){Co(t,e);var r=Lo(t);function t(n){var o;return jo(this,t),o=r.call(this,n),o.name="InvalidSpreadsheetError",o}return ko(t)})(Xr(Error));function Gr(e,r,t,n,o,i){var f=gr(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 Ie(u.message);throw s.stack=u.stack,s.cause=u,s});function a(u,s,l,c){var h=7,v=64*1024,O=0,S=v,g=function(){O++;var w=Date.now();if(s.length>S){u.write(s.slice(0,S)),l&&l(!1),s=s.slice(S);var A=Date.now()-w;return A<h*.5?S*=2:A>h&&(S/=2),!0}else return u.write(s),u.end(),l&&l(!0),!1},x=function y(){g()&&(c?typeof setImmediate<"u"?setImmediate(y):setTimeout(y,0):y())};x()}}var Jt={},Uo=(function(e,r,t,n,o){var i=new Worker(Jt[r]||(Jt[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}),K=Uint8Array,ke=Uint16Array,rn=Int32Array,qr=new K([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]),Hr=new K([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]),tn=new K([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),nn=function(e,r){for(var t=new ke(31),n=0;n<31;++n)t[n]=r+=1<<e[n-1];for(var o=new rn(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}},on=nn(qr,2),Zr=on.b,Vo=on.r;Zr[28]=258,Vo[258]=28;var an=nn(Hr,0),fn=an.b,$f=an.r,Or=new ke(32768);for(F=0;F<32768;++F)Oe=(F&43690)>>1|(F&21845)<<1,Oe=(Oe&52428)>>2|(Oe&13107)<<2,Oe=(Oe&61680)>>4|(Oe&3855)<<4,Or[F]=((Oe&65280)>>8|(Oe&255)<<8)>>1;var Oe,F,ze=(function(e,r,t){for(var n=e.length,o=0,i=new ke(r);o<n;++o)e[o]&&++i[e[o]-1];var f=new ke(r);for(o=1;o<r;++o)f[o]=f[o-1]+i[o-1]<<1;var a;if(t){a=new ke(1<<r);var u=15-r;for(o=0;o<n;++o)if(e[o])for(var s=o<<4|e[o],l=r-e[o],c=f[e[o]-1]++<<l,h=c|(1<<l)-1;c<=h;++c)a[Or[c]>>u]=s}else for(a=new ke(n),o=0;o<n;++o)e[o]&&(a[o]=Or[f[e[o]-1]++]>>15-e[o]);return a}),Qe=new K(288);for(F=0;F<144;++F)Qe[F]=8;var F;for(F=144;F<256;++F)Qe[F]=9;var F;for(F=256;F<280;++F)Qe[F]=7;var F;for(F=280;F<288;++F)Qe[F]=8;var F,un=new K(32);for(F=0;F<32;++F)un[F]=5;var F;var sn=ze(Qe,9,1);var ln=ze(un,5,1),xr=function(e){for(var r=e[0],t=1;t<e.length;++t)e[t]>r&&(r=e[t]);return r},he=function(e,r,t){var n=r/8|0;return(e[n]|e[n+1]<<8)>>(r&7)&t},Sr=function(e,r){var t=r/8|0;return(e[t]|e[t+1]<<8|e[t+2]<<16)>>(r&7)},cn=function(e){return(e+7)/8|0},Ne=function(e,r,t){return(r==null||r<0)&&(r=0),(t==null||t>e.length)&&(t=e.length),new K(e.subarray(r,t))};var hn=["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"],Z=function(e,r,t){var n=new Error(r||hn[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,Z),!t)throw n;return n},Kr=function(e,r,t,n){var o=e.length,i=n?n.length:0;if(!o||r.f&&!r.l)return t||new K(0);var f=!t,a=f||r.i!=2,u=r.i;f&&(t=new K(o*3));var s=function(se){var We=t.length;if(se>We){var Le=new K(Math.max(We*2,se));Le.set(t),t=Le}},l=r.f||0,c=r.p||0,h=r.b||0,v=r.l,O=r.d,S=r.m,g=r.n,x=o*8;do{if(!v){l=he(e,c,1);var y=he(e,c+1,3);if(c+=3,y)if(y==1)v=sn,O=ln,S=9,g=5;else if(y==2){var z=he(e,c,31)+257,b=he(e,c+10,15)+4,P=z+he(e,c+5,31)+1;c+=14;for(var M=new K(P),Y=new K(19),B=0;B<b;++B)Y[tn[B]]=he(e,c+B*3,7);c+=b*3;for(var me=xr(Y),q=(1<<me)-1,be=ze(Y,me,1),B=0;B<P;){var xe=be[he(e,c,q)];c+=xe&15;var w=xe>>4;if(w<16)M[B++]=w;else{var ne=0,ue=0;for(w==16?(ue=3+he(e,c,3),c+=2,ne=M[B-1]):w==17?(ue=3+he(e,c,7),c+=3):w==18&&(ue=11+he(e,c,127),c+=7);ue--;)M[B++]=ne}}var ie=M.subarray(0,z),J=M.subarray(z);S=xr(ie),g=xr(J),v=ze(ie,S,1),O=ze(J,g,1)}else Z(1);else{var w=cn(c)+4,A=e[w-4]|e[w-3]<<8,T=w+A;if(T>o){u&&Z(0);break}a&&s(h+A),t.set(e.subarray(w,T),h),r.b=h+=A,r.p=c=T*8,r.f=l;continue}if(c>x){u&&Z(0);break}}a&&s(h+131072);for(var re=(1<<S)-1,m=(1<<g)-1,p=c;;p=c){var ne=v[Sr(e,c)&re],E=ne>>4;if(c+=ne&15,c>x){u&&Z(0);break}if(ne||Z(2),E<256)t[h++]=E;else if(E==256){p=c,v=null;break}else{var _=E-254;if(E>264){var B=E-257,k=qr[B];_=he(e,c,(1<<k)-1)+Zr[B],c+=k}var N=O[Sr(e,c)&m],X=N>>4;N||Z(3),c+=N&15;var J=fn[X];if(X>3){var k=Hr[X];J+=Sr(e,c)&(1<<k)-1,c+=k}if(c>x){u&&Z(0);break}a&&s(h+131072);var ee=h+_;if(h<J){var d=i-J,U=Math.min(J,ee);for(d+h<0&&Z(3);h<U;++h)t[h]=n[d+h]}for(;h<ee;++h)t[h]=t[h-J]}}r.l=v,r.p=p,r.b=h,r.f=l,v&&(l=1,r.m=S,r.d=O,r.n=g)}while(!l);return h!=t.length&&f?Ne(t,0,h):t.subarray(0,h)};var Bo=new K(0);var $o=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},Qt=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 l=s.indexOf(" ",8)+1;r+=s.slice(l,s.indexOf("(",l))}else{r+=s;for(var c in a.prototype)r+=";"+u+".prototype."+c+"="+a.prototype[c].toString()}else r+=s}else t[u]=a}return r},br=[],Xo=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},Go=function(e,r,t,n){if(!br[t]){for(var o="",i={},f=e.length-1,a=0;a<f;++a)o=Qt(e[a],o,i);br[t]={c:Qt(e[f],o,i),e:i}}var u=$o({},br[t].e);return Uo(br[t].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+r.toString()+"}",t,u,Xo(u),n)},Wo=function(){return[K,ke,rn,qr,Hr,tn,Zr,fn,sn,ln,Or,hn,ze,xr,he,Sr,cn,Ne,Z,Kr,Jr,pn,vn]};var pn=function(e){return postMessage(e,[e.buffer])},vn=function(e){return e&&{out:e.size&&new K(e.size),dictionary:e.dictionary}},Yo=function(e,r,t,n,o,i){var f=Go(t,n,o,function(a,u){f.terminate(),i(a,u)});return f.postMessage([e,r],r.consume?[e.buffer]:[]),function(){f.terminate()}};var ge=function(e,r){return e[r]|e[r+1]<<8},pe=function(e,r){return(e[r]|e[r+1]<<8|e[r+2]<<16|e[r+3]<<24)>>>0},Wr=function(e,r){return pe(e,r)+pe(e,r+4)*4294967296};var mn=(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 K(32768),this.p=new K(0),n&&this.o.set(n)}return e.prototype.e=function(r){if(this.ondata||Z(5),this.d&&Z(4),!this.p.length)this.p=r;else if(r.length){var t=new K(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=Kr(this.p,this.s,this.o);this.ondata(Ne(n,t,this.s.b),this.d),this.o=Ne(n,this.s.b-32768),this.s.b=this.o.length,this.p=Ne(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 qo(e,r,t){return t||(t=r,r={}),typeof t!="function"&&Z(7),Yo(e,r,[Wo],function(n){return pn(Jr(n.data[0],vn(n.data[1])))},1,t)}function Jr(e,r){return Kr(e,{i:2},r&&r.out,r&&r.dictionary)}var Yr=typeof TextDecoder<"u"&&new TextDecoder,Ho=0;try{Yr.decode(Bo,{stream:!0}),Ho=1}catch{}var Zo=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:Ne(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 Qr(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(Yr)return Yr.decode(e);var o=Zo(e),i=o.s,t=o.r;return t.length&&Z(8),i}}var Ko=function(e,r){return r+30+ge(e,r+26)+ge(e,r+28)},Jo=function(e,r,t){var n=ge(e,r+28),o=ge(e,r+30),i=Qr(e.subarray(r+46,r+46+n),!(ge(e,r+8)&2048)),f=r+46+n,a=Qo(e,f,o,t,pe(e,r+20),pe(e,r+24),pe(e,r+42)),u=a[0],s=a[1],l=a[2];return[ge(e,r+10),u,s,i,f+o+ge(e,r+32),l]},Qo=function(e,r,t,n,o,i,f){var a=o==4294967295,u=i==4294967295,s=f==4294967295,l=r+t,c=a+u+s;if(n&&c){for(;r+4<l;r+=4+ge(e,r+2))if(ge(e,r)==1)return[a?Wr(e,r+4+8*u):o,u?Wr(e,r+4):i,s?Wr(e,r+4+8*(u+a)):f,1];n<2&&Z(13)}return[o,i,f,0]};var en=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(e){e()};function yn(e,r,t){t||(t=r,r={}),typeof t!="function"&&Z(7);var n=[],o=function(){for(var g=0;g<n.length;++g)n[g]()},i={},f=function(g,x){en(function(){t(g,x)})};en(function(){f=t});for(var a=e.length-22;pe(e,a)!=101010256;--a)if(!a||e.length-a>65558)return f(Z(13,0,1),null),o;var u=ge(e,a+8);if(u){var s=u,l=pe(e,a+16),c=pe(e,a-20)==117853008;if(c){var h=pe(e,a-12);c=pe(e,h)==101075792,c&&(s=u=pe(e,h+32),l=pe(e,h+48))}for(var v=r&&r.filter,O=function(g){var x=Jo(e,l,c),y=x[0],w=x[1],A=x[2],T=x[3],z=x[4],b=x[5],P=Ko(e,b);l=z;var M=function(B,me){B?(o(),f(B,null)):(me&&(i[T]=me),--u||f(null,i))};if(!v||v({name:T,size:w,originalSize:A,compression:y}))if(!y)M(null,Ne(e,P,P+w));else if(y==8){var Y=e.subarray(P,P+w);if(A<524288||w>.8*A)try{M(null,Jr(Y,{out:new K(A)}))}catch(B){M(B,null)}else n.push(qo(Y,{size:A},M))}else M(Z(14,"unknown compression type "+y,1),null);else M(null,null)},S=0;S<s;++S)O(S)}else f(null,{});return o}function Ue(e){"@babel/helpers - typeof";return Ue=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},Ue(e)}function dn(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,ri(n.key),n)}}function ei(e,r,t){return r&&dn(e.prototype,r),t&&dn(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ri(e){var r=ti(e,"string");return Ue(r)==="symbol"?r:String(r)}function ti(e,r){if(Ue(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(Ue(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function ni(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function oi(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&&er(e,r)}function ii(e){var r=gn();return function(){var n=rr(e),o;if(r){var i=rr(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return ai(this,o)}}function ai(e,r){if(r&&(Ue(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fi(e)}function fi(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function et(e){var r=typeof Map=="function"?new Map:void 0;return et=function(n){if(n===null||!ui(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,rr(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),er(o,n)},et(e)}function Er(e,r,t){return gn()?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&&er(s,f.prototype),s},Er.apply(null,arguments)}function gn(){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 ui(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function er(e,r){return er=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},er(e,r)}function rr(e){return rr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},rr(e)}var rt=(function(e){oi(t,e);var r=ii(t);function t(){return ni(this,t),r.apply(this,arguments)}return ei(t)})(et(Error));function tt(e){var r=new rt(e.message);return e.stack&&(r.stack=e.stack),Error.captureStackTrace&&Error.captureStackTrace(r,tt),r.cause=e,r}function nt(e,r){return si(e,r,li,!0)}function si(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 ci(i)?tt(i):i})}function li(e){return new Promise(function(r,t){yn(e,function(n,o){n?t(n):r(o)})})}function ci(e){return typeof e.code=="number"}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 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,pi(n.key),n)}}function hi(e,r,t){return r&&wn(e.prototype,r),t&&wn(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function pi(e){var r=vi(e,"string");return Ve(r)==="symbol"?r:String(r)}function vi(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 mi(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function yi(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 di(e){var r=bn();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 gi(this,o)}}function gi(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 wi(e)}function wi(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ot(e){var r=typeof Map=="function"?new Map:void 0;return ot=function(n){if(n===null||!bi(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 Ar(n,arguments,nr(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),tr(o,n)},ot(e)}function Ar(e,r,t){return bn()?Ar=Reflect.construct.bind():Ar=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},Ar.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 bi(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 xi={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"},Re=(function(e){yi(t,e);var r=di(t);function t(n,o){var i;return mi(this,t),i=r.call(this,xi[n]||n),i.code=n,i.name="InvalidInputError",i.cause=o,i}return hi(t)})(ot(Error));function it(e){var r=e.path;return r.endsWith(".xml")||r.endsWith(".xml.rels")}var xn=[80,75],Sn=[208,207,17,224],or=[xn,Sn],Kf=or.indexOf(xn),On=or.indexOf(Sn);function at(){var e,r=Si(or),t=0;return function(n){if(isNaN(e)){var o;r=r.filter(function(i){if(n===or[i][t])return or[i].length===t+1&&(o=i),!0}),r.length===1?e=o:r.length===0&&(e=-1)}return t++,e}}function Si(e){for(var r=[],t=0;t<e.length;)r.push(t),t++;return r}function Oi(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=Ei(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 Ei(e,r){if(e){if(typeof e=="string")return En(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 En(e,r)}}function En(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 ft(e){for(var r=at(),t=Oi(e),n;!(n=t()).done;){var o=n.value;if(Ai(o,r))return}_i(e.length)}function Ai(e,r){var t=r(e);if(t!==void 0){if(t===On)throw new Re("XLS_FILE_NOT_SUPPORTED");if(t<0)throw new Re("FILE_NOT_SUPPORTED");return!0}}function _i(e){throw new Re(e===0?"NO_DATA":"FILE_NOT_SUPPORTED")}var _r;function fe(e){var r=Date.now(),t=typeof global<"u"?!!global.READ_EXCEL_FILE_CHECKPOINTS:typeof window<"u"?!!window.READ_EXCEL_FILE_CHECKPOINTS:!1;t&&(_r&&console.log(" -",r-_r,"ms"),console.log("*",e)),_r=r}function An(){_r=void 0}function ut(e){return An(),fe("unpack files"),Ti(e).then(function(r){return ft(new Uint8Array(r)),nt(r,{filter:it}).then(function(t){return t},function(t){throw t instanceof rt?new Re("INVALID_ZIP",t.cause):t})})}function Ti(e){if(e instanceof Blob)return e.arrayBuffer();if(e instanceof ArrayBuffer)return Promise.resolve(e);throw new Re("INPUT_TYPE_NOT_SUPPORTED")}function st(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 lt(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(l){return l}function a(l,c,h){l==="Relationship"&&u(h,c.Id,c.Type,c.Target)}function u(l,c,h,v){switch(h){case t+"styles":case n+"styles":l.styles=s(v);break;case t+"sharedStrings":case n+"sharedStrings":l.sharedStrings=s(v);break;case t+"worksheet":case n+"worksheet":l.sheets[c]=s(v);break}}function s(l){return l[0]==="/"?l.slice(1):"xl/"+l}}function ir(e){"@babel/helpers - typeof";return ir=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},ir(e)}var Pi=["xfId"];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 Tn(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){Ii(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 Ii(e,r,t){return r=Di(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Di(e){var r=ki(e,"string");return ir(r)==="symbol"?r:String(r)}function ki(e,r){if(ir(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(ir(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Ni(e,r){if(e==null)return{};var t=Ri(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 Ri(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 ct(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 l=s.xfId,c=Ni(s,Pi);return Tn(Tn({},u.baseStyles[l]),c)}else return s})}function i(u,s,l){if(u==="numFmt"){var c=Number(s.numFmtId),h={id:c};c>=100&&(h.template=s.formatCode),l.numberFormats[c]=h}else if(u==="cellStyleXfs")l.cellStyleXfs=!0;else if(u==="cellXfs")l.cellXfs=!0;else if(u==="xf"){if(l.cellStyleXfs)l.baseStyles.push(a(s));else if(l.cellXfs){var v=a(s,l.numberFormats);s.xfId&&(v.xfId=Number(s.xfId)),l.styles.push(v)}}}function f(u,s){u==="cellStyleXfs"?s.cellStyleXfs=!1:u==="cellXfs"&&(s.cellXfs=!1)}function a(u,s){var l={};if(u.numFmtId){var c=Number(u.numFmtId);s&&s[c]?l.numberFormat=s[c]:l.numberFormat={id:c}}return l}}function ht(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(h){return h.strings}function i(h,v,O){h==="si"?O.si=u():O.si&&s(h,v,O.si)}function f(h,v){h==="si"?(v.strings.push(v.si.string),v.si=void 0):v.si&&l(h,v.si)}function a(h,v){v.si&&c(h,v.si)}function u(){return{t:!1,r:!1,rPh:!1,string:""}}function s(h,v,O){h==="t"?O.t=!0:h==="r"?O.r=!0:h==="rPh"&&(O.rPh=!0)}function l(h,v){h==="t"?v.t=!1:h==="r"?v.r=!1:h==="rPh"&&(v.rPh=!1)}function c(h,v){v.rPh||v.t&&(v.r?v.string+=h:v.string=h)}}function pt(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 ji=/;@$/,Ci=/[^a-z0#\?%]+/;function vt(e,r,t){var n=t[e];return n===void 0?t[e]=Li(r):n}function Li(e){e=e.toLowerCase(),e=e.replace(ji,""),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(Ci).filter(function(i){return i});return o.length===0?!1:o.every(function(i){return Fi.indexOf(i)>=0})}}var Fi=["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 yt(e,r,t,n){return e.numberFormat?!!(Ui.indexOf(e.numberFormat.id)>=0||r&&e.numberFormat.template===r||t&&e.numberFormat.template&&vt(e.numberFormat.id,e.numberFormat.template,n)):!1}var Mi=[14,15,16,17,18,19,20,21,22,45,46,47],mt=[27,28,29,30,31,32,33,34,35,36,50,51,52,53,54,55,56,57,58],Pn=[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],Ui=Mi.concat(mt).concat(Pn.filter(function(e){return mt.indexOf(e)<0})).concat(zi.filter(function(e){return mt.indexOf(e)<0}).filter(function(e){return Pn.indexOf(e)<0}));function Vi(e,r){return Gi(e)||Xi(e,r)||$i(e,r)||Bi()}function Bi(){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 $i(e,r){if(e){if(typeof e=="string")return In(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 In(e,r)}}function In(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 Xi(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(l){s=!0,o=l}finally{try{if(!u&&t.return!=null&&(f=t.return(),Object(f)!==f))return}finally{if(s)throw o}}return a}}function Gi(e){if(Array.isArray(e))return e}var Wi=null,je=[null,Wi];function dt(e,r,t,n,o){var i=Vi(o,7),f=i[0],a=i[1],u=i[2],s=i[3],l=i[4],c=i[5],h=i[6];switch(e||"n"){case"str":return t===void 0?"VALUE_MISSING":t?["s",t]:je;case"inlineStr":return n===void 0?"VALUE_MISSING":["s",n];case"s":if(!t)return"VALUE_MISSING";var v=Number(t);return isNaN(v)||f[v]===void 0?"VALUE_INVALID":["s",f[v]];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 je;var O=new Date(t);return isNaN(O.valueOf())?"VALUE_INVALID":["d",O.getTime()];case"n":if(!t)return je;if(r){var S=Number(r);if(isNaN(S)||a[S]===void 0)return"FORMAT_INVALID";if(yt(a[S],l,c,s)){var g=Number(t);return isNaN(g)?"VALUE_INVALID":["d",pt(g,u)]}}if(h)return["n",t];var x=Number(t);return isNaN(x)?"VALUE_INVALID":["n",x];default:return"TYPE_INVALID"}}function Tr(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)&&Dn(e),[o,r]}r*=26,r+=e.charCodeAt(t)-64,t++}Dn(e)}function Dn(e){throw new Error('<c r="'.concat(e,'">'))}function Yi(e,r){return Zi(e)||Hi(e,r)||Rn(e,r)||qi()}function qi(){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 Hi(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(l){s=!0,o=l}finally{try{if(!u&&t.return!=null&&(f=t.return(),Object(f)!==f))return}finally{if(s)throw o}}return a}}function Zi(e){if(Array.isArray(e))return e}function kn(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=Rn(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 Rn(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}var gt=null;function wt(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=[],l=[],c=h();return r(e,c,A,T,z,w).then(function(){var m=c.sheetData,p=m.rowCount,E=m.columnCount,_=m.dataRowCount,k=m.dataColumnCount;if(_<p&&(s=s.slice(0,_)),k<E)for(var N=0;N<s.length;)s[N].length>k&&(s[N]=s[N].slice(0,k)),N++;for(var X=Date.now(),ee=kn(s),d;!(d=ee()).done;)for(var U=d.value;U.length<k;)U.push(gt);return s});function h(){return{dimension:void 0,sheetData:void 0}}function v(m){return m.sheetData.rows}function O(m,p){m.sheetData.rowIndexShift+=m.sheetData.rows.length-p.length,m.sheetData.rows=p}function S(m){return m.sheetData.errors}function g(m,p){m.sheetData.errors=p}var x;function y(m){var p=m.row,E=m.column,_=m.error;throw new Ie("<c/> at row ".concat(p,", col ").concat(E,": ").concat(_))}function w(m){if(c.sheetData){var p=v(c),E=S(c);if(m)s=s.concat(p),l=l.concat(E),l.length>0&&y(l[0]);else if(p.length>1){var _=p.slice(0,-1);s=s.concat(_),l=l.concat(E),O(c,p.slice(-1)),g(c,[])}}}function A(m,p,E){m==="dimension"?E.dimension=b(p.ref):m==="sheetData"?E.sheetData=P():E.sheetData&&M(m,p,E.sheetData)}function T(m,p){p.sheetData&&Y(m,p.sheetData)}function z(m,p){p.sheetData&&B(m,p.sheetData)}function b(m){var p=m.split(":").map(Tr);return p.length===1&&(p=[p[0],p[0]]),p}function P(){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 M(m,p,E){m==="row"?(p.r&&(E.rowNumber=Number(p.r)),E.row=[]):m==="c"?(E.c=ne(),E.c.attributes=p):E.c&&ue(m,p,E.c)}function Y(m,p){if(m==="row"){if(p.rowNumber){var E=p.rowIndexShift+p.rows.length;if(p.rowNumber<=E)throw new Ie("Out-of-place <row/> number ".concat(p.rowNumber," follows <row/> number ").concat(E));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(m==="c"){var _=me(p.c);if(_.row<p.cursor[0]||_.row===p.cursor[0]&&_.column<=p.cursor[1])throw new Ie("Out-of-place <c/> at row ".concat(_.row," col ").concat(_.column," follows <c/> at row ").concat(p.cursor[0]," col ").concat(p.cursor[1]));if(p.cursor[0]=_.row,p.cursor[1]=_.column,p.rowNumber||(p.rowNumber=_.row),_.error)x&&y(_),p.errors.push(_);else if(_.value!==gt){for(;_.column>p.row.length+1;)p.row.push(gt);p.row.push(_.value),_.column>p.dataColumnCount&&(p.dataColumnCount=_.column)}_.column>p.columnCount&&(p.columnCount=_.column),p.c=void 0}else p.c&&ie(m,p.c)}function B(m,p){p.c&&J(m,p.c)}function me(m){var p=m.attributes,E=m.inlineString,_=m.vText,k=Tr(p.r),N=Yi(k,2),X=N[0],ee=N[1],d=q(p.t,p.s,_,E,u,a.trim!==!1);return typeof d=="string"?{row:X,column:ee,error:d}:{row:X,column:ee,value:xe(d[1],d[0])}}function q(m,p,E,_,k,N){var X=be(m,p,E,_,k);return Array.isArray(X)&&X[0]==="s"&&(N&&(X[1]=X[1].trim()),X[1]==="")?je:X}function be(m,p,E,_,k){var N=dt(m,p,E,_,k);if(N==="VALUE_MISSING")switch(m||"n"){case"str":case"inlineStr":case"s":case"b":return je}return m==="e"?je:N}function xe(m,p){return p==="n"?a.parseNumber?a.parseNumber(m):m:p==="d"?new Date(m):m}function ne(){return{v:!1,is:!1,t:!1,r:!1,rPh:!1,vText:void 0,inlineString:void 0,attributes:void 0}}function ue(m,p,E){m==="v"?E.v=!0:m==="is"?(E.is=!0,E.inlineString=""):m==="t"?E.t=!0:m==="r"?E.r=!0:m==="rPh"&&(E.rPh=!0)}function ie(m,p){m==="v"?(p.v=!1,p.vText||(p.vText="")):m==="is"?p.is=!1:m==="t"?p.t=!1:m==="r"?p.r=!1:m==="rPh"&&(p.rPh=!1)}function J(m,p){p.v?p.vText=m:p.is&&(p.rPh||p.t&&(p.r?p.inlineString+=m:p.inlineString=m))}function re(m){for(var p=m.length===0?0:1,E=m.length===0?0:1,_=0,k=0,N=kn(m),X;!(X=N()).done;){var ee=X.value;_<ee.row&&(_=ee.row),k<ee.column&&(k=ee.column)}return[[p,E],[_,k]]}}function bt(e){fe("convert files to strings");for(var r={},t=0,n=Object.keys(e);t<n.length;t++){var o=n[t];r[o]=Ki(e[o])}return r}function Ki(e){return typeof TextDecoder<"u"?new TextDecoder().decode(e):Qr(e)}function xt(e){"@babel/helpers - typeof";return xt=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},xt(e)}function St(e){return xt(e)==="object"&&typeof e.then=="function"}function Be(e){"@babel/helpers - typeof";return Be=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},Be(e)}function jn(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,Qi(n.key),n)}}function Ji(e,r,t){return r&&jn(e.prototype,r),t&&jn(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Qi(e){var r=ea(e,"string");return Be(r)==="symbol"?r:String(r)}function ea(e,r){if(Be(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(Be(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function ra(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function ta(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&&ar(e,r)}function na(e){var r=Cn();return function(){var n=fr(e),o;if(r){var i=fr(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return oa(this,o)}}function oa(e,r){if(r&&(Be(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ia(e)}function ia(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ot(e){var r=typeof Map=="function"?new Map:void 0;return Ot=function(n){if(n===null||!aa(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 Pr(n,arguments,fr(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),ar(o,n)},Ot(e)}function Pr(e,r,t){return Cn()?Pr=Reflect.construct.bind():Pr=function(o,i,f){var a=[null];a.push.apply(a,i);var u=Function.bind.apply(o,a),s=new u;return f&&ar(s,f.prototype),s},Pr.apply(null,arguments)}function Cn(){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 aa(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function ar(e,r){return ar=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},ar(e,r)}function fr(e){return fr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fr(e)}var Ln=(function(e){ta(t,e);var r=na(t);function t(n,o){var i;return ra(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 Ji(t)})(Ot(Error));function ur(e){"@babel/helpers - typeof";return ur=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},ur(e)}function zn(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=fa(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 fa(e,r){if(e){if(typeof e=="string")return Fn(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 Fn(e,r)}}function Fn(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 Mn(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 Ir(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Mn(Object(t),!0).forEach(function(n){Dr(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Mn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Dr(e,r,t){return r=ua(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ua(e){var r=sa(e,"string");return ur(r)==="symbol"?r:String(r)}function sa(e,r){if(ur(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(ur(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function la(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=bt(r);return fe("parse spreadsheet info and file paths"),Et(pa(),n,e).then(function(o){var i=o.spreadsheetInfo,f=o.filePaths;return fe('parse "shared strings" and "styles"'),Et(va(f),n,e).then(function(a){var u=a.sharedStrings,s=a.styles,l=t.sheets?t.sheets.map(function(h){return ca(h,i.sheets)}):i.sheets.map(function(h){return h.relationId});fe("parse sheet".concat(l.length===1?"":"s"," data"));var c=[];return Et(ma(f,l,{sharedStrings:u,styles:s,epoch1904:i.epoch1904,dateFormatDetectionCache:c,options:t}),n,e).then(function(h){return fe("end"),l.map(function(v){return{sheet:ha(v,i.sheets),data:h[v]}})})})})}function At(e,r,t,n){return n&&n.parseNumber||(n=Ir(Ir({},n),{},{parseNumber:null})),la(r,t,n)}function ca(e,r){if(typeof e=="string")for(var t=zn(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 Ln(e,r.map(function(i){return i.name}))}function ha(e,r){for(var t=zn(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 pa(){return{"xl/_rels/workbook.xml.rels":{name:"filePaths",parse:lt},"xl/workbook.xml":{name:"spreadsheetInfo",parse:st}}}function va(e){var r;return r={},Dr(r,e.sharedStrings||"xl/sharedStrings.xml",{name:"sharedStrings",parse:ht,fallback:Promise.resolve([])}),Dr(r,e.styles||"xl/styles.xml",{name:"styles",parse:ct,fallback:{}}),r}function ma(e,r,t){return Object.keys(e.sheets).filter(function(n){return r.includes(n)}).reduce(function(n,o){return Ir(Ir({},n),{},Dr({},e.sheets[o],{name:o,parse:function(f,a){return wt(f,a,t)}}))},{})}function Et(e,r,t){for(var n={},o=function(){var h=f[i],v=e[h];n[v.name]=r[h]===void 0?v.fallback===void 0?(function(){throw new Ie('"'.concat(h,'" file not found inside the `.xlsx` file'))})():v.fallback:v.parse(r[h],t)},i=0,f=Object.keys(e);i<f.length;i++)o();for(var a=[],u=function(){var h=l[s];St(n[h])&&a.push(n[h].then(function(v){n[h]=v}))},s=0,l=Object.keys(n);s<l.length;s++)u();return a.length>0?Promise.all(a).then(function(){return n}):n}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 Un(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,da(n.key),n)}}function ya(e,r,t){return r&&Un(e.prototype,r),t&&Un(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function da(e){var r=ga(e,"string");return $e(r)==="symbol"?r:String(r)}function ga(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 wa(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function ba(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&&sr(e,r)}function xa(e){var r=Vn();return function(){var n=lr(e),o;if(r){var i=lr(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Sa(this,o)}}function Sa(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 Oa(e)}function Oa(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _t(e){var r=typeof Map=="function"?new Map:void 0;return _t=function(n){if(n===null||!Ea(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 kr(n,arguments,lr(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),sr(o,n)},_t(e)}function kr(e,r,t){return Vn()?kr=Reflect.construct.bind():kr=function(o,i,f){var a=[null];a.push.apply(a,i);var u=Function.bind.apply(o,a),s=new u;return f&&sr(s,f.prototype),s},kr.apply(null,arguments)}function Vn(){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 Ea(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function sr(e,r){return sr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},sr(e,r)}function lr(e){return lr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},lr(e)}var oe=(function(e){ba(t,e);var r=xa(t);function t(n){var o;return wa(this,t),o=r.call(this,"invalid"),o.reason=n,o}return ya(t)})(_t(Error));function Tt(e){if(typeof e=="string"){var r=e;if(e=Number(e),String(e)!==r)throw new oe("not_a_number")}if(typeof e!="number")throw new oe("not_a_number");if(isNaN(e))throw new oe("invalid_number");if(!isFinite(e))throw new oe("out_of_bounds");return e}function Pt(e){if(typeof e=="string")return e;if(typeof e=="number"){if(isNaN(e))throw new oe("invalid_number");if(!isFinite(e))throw new oe("out_of_bounds");return String(e)}throw new oe("not_a_string")}function It(e){if(typeof e=="boolean")return e;throw new oe("not_a_boolean")}function Dt(e){if(e instanceof Date){if(isNaN(e.valueOf()))throw new oe("out_of_bounds");return e}throw new oe("not_a_date")}var Aa={}.constructor;function Nr(e){return e!=null&&e.constructor===Aa}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 _a(e,r){return Yn(e)||Ta(e,r)||kt(e,r)||Wn()}function Ta(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(l){s=!0,o=l}finally{try{if(!u&&t.return!=null&&(f=t.return(),Object(f)!==f))return}finally{if(s)throw o}}return a}}function Pa(e){return Yn(e)||Ia(e)||kt(e)||Wn()}function Wn(){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 Ia(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Yn(e){if(Array.isArray(e))return e}function Bn(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 Ge(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Bn(Object(t),!0).forEach(function(n){Da(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Bn(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Da(e,r,t){return r=ka(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ka(e){var r=Na(e,"string");return Xe(r)==="symbol"?r:String(r)}function Na(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 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=kt(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 kt(e,r){if(e){if(typeof e=="string")return $n(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 $n(e,r)}}function $n(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 Rr=null;function Nt(e,r,t){fe("parse sheet data using schema");for(var n=[],o=[],i=Ra(e,r,t),f=0,a=qn(i),u;!(u=a()).done;){var s=u.value,l=s.object,c=s.errors;c?o=o.concat(c.map(function(h){return Ge(Ge({},h),{},{row:f+1})})):n.push(l),f++}return fe("end"),o.length>0?{errors:o,columns:e[0]}:{objects:n,columns:e[0]||[]}}function Ra(e,r,t){Xa(r);var n=Wa(t),o=Pa(e),i=o[0],f=o.slice(1);return f.map(function(a){return ja(a,r,i,n)})}function ja(e,r,t,n){var o={schema:r},i=Hn(e,o,void 0,t,n),f=i.value,a=i.isEmptyValue,u=i.errors,s=i.children,l={value:Ya,isEmptyValue:a,errors:u,isRequired:void 0},c=Jn(o,f,a,u,s,l.isRequired,l.value,l.isEmptyValue,l.errors,t);return u||c?{errors:(u||[]).concat(c||[])}:{object:Kn(f,a,!1,void 0,n)}}function Ca(e,r,t,n,o){for(var i={},f=!0,a=[],u=[],s=0,l=Object.keys(r);s<l.length;s++){var c=l[s],h=Hn(e,r[c],Xn(c,t),n,o);h.errors?a=a.concat(h.errors):(i[c]=Kn(h.value,h.isEmptyValue,Array.isArray(r[c].type),Xn(c,t),o),f&&!h.isEmptyValue&&(f=!1)),u.push(Ge(Ge({},h),{},{schemaEntry:r[c]}))}return a.length>0?{errors:a,children:u}:{value:i,isEmptyValue:f,children:u}}function Hn(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}:La(e[i],r,i,o):Ca(e,r.schema,t,n,o),u=a.value,s=a.isEmptyValue,l=a.errors,c=a.children;return l?{errors:l,children:c}:{value:u,isEmptyValue:s,children:c}}function La(e,r,t,n){var o=Fa(e,r,n),i=o.value,f=o.isEmptyValue,a=o.error,u=o.reason;if(a){var s=Qn({error:a,reason:u,column:r.column,columnIndex:t,valueType:r.type,value:e});return{errors:[s]}}return{value:i,isEmptyValue:f}}function Fa(e,r,t){return e===void 0?{value:t.propertyValueWhenColumnIsMissing,isEmptyValue:!0}:e===Rr?{value:t.propertyValueWhenCellIsEmpty,isEmptyValue:!0}:Array.isArray(r.type)?Ma(e,r,t):Zn(e,r,t)}function Ma(e,r,t){if(typeof e!="string")return{error:"not_a_string"};var n=!0,o=[],i=[],f=Ba(e,t.separatorCharacter).map(function(a){if(!(o.length>0)){if(!a){o.push("invalid"),i.push("syntax");return}var u=Zn(a,r,t),s=u.value,l=u.isEmptyValue,c=u.error,h=u.reason;if(c){o.push(c),i.push(h);return}return n&&!l&&(n=!1),s}});return o.length>0?{error:o[0],reason:i[0]}:{value:f,isEmptyValue:n}}function Zn(e,r,t){if(e===Rr)return{value:e,isEmptyValue:!0};var n;if(r.type?n=Ua(e,Array.isArray(r.type)?r.type[0]:r.type,t):n={value:e},n.error)return n;if(e===Rr)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:Ga(n.value)}}function za(e,r){if(r.indexOf(e)<0)return{error:"invalid",reason:"unknown"}}function Ua(e,r){switch(r){case String:return cr(e,Pt);case Number:return cr(e,Tt);case Date:return cr(e,Dt);case Boolean:return cr(e,It);default:if(typeof r!="function")throw new Error("Unsupported schema `type`: ".concat(r&&r.name||r));return cr(e,r)}}function cr(e,r){try{var t=r(e);return t===void 0?{value:Rr}:{value:t}}catch(o){var n={error:o.message};return o.reason&&(n.reason=o.reason),n}}function Va(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 Ba(e,r){for(var t=[],n=0;n<e.length;){var o=Va(e,r,n),i=_a(o,2),f=i[0],a=i[1];n+=a+r.length,t.push(f.trim())}return t}function Kn(e,r,t,n,o){if(r){if(Nr(e))return o.transformEmptyObject(e,{path:n});if(t)return o.transformEmptyArray(e,{path:n})}return e}function Xn(e,r){return"".concat(r?r+".":"").concat(e)}function Jn(e,r,t,n,o,i,f,a,u,s){var l=[],c=$a(e,i,f,a,u);if(c&&t&&l.push(Qn({error:"required",column:e.column,columnIndex:s.indexOf(e.column),valueType:e.type,value:r})),o)for(var h=qn(o),v;!(v=h()).done;){var O=v.value,S=Jn(O.schemaEntry,O.value,O.isEmptyValue,O.errors,O.children,c,r,t,n,s);S&&(l=l.concat(S))}if(l.length>0)return l}function $a(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 Qn(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 Xa(e){for(var r=0,t=Object.keys(e);r<t.length;r++){var n=t[r],o=e[n];if(Xe(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,'".'))}eo(e,void 0)}function eo(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(Nr(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)));eo(e[o].schema,e[o].required)}}}function Ga(e){return e==null}var Gn={propertyValueWhenColumnIsMissing:void 0,propertyValueWhenCellIsEmpty:null,transformEmptyObject:function(){return null},transformEmptyArray:function(){return null},separatorCharacter:","};function Wa(e){return e?Ge(Ge({},Gn),e):Gn}var Ya={};function hr(e){"@babel/helpers - typeof";return hr=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},hr(e)}var qa=["schema"];function ro(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 to(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?ro(Object(t),!0).forEach(function(n){Ha(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ro(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Ha(e,r,t){return r=Za(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Za(e){var r=Ka(e,"string");return hr(r)==="symbol"?r:String(r)}function Ka(e,r){if(hr(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(hr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function Ja(e,r){if(e==null)return{};var t=Qa(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 Qa(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 Rt(e,r,t,n,o){var i=o||{},f=i.schema,a=Ja(i,qa);return At(e,r,t,to(to({},a),{},{sheets:[n===void 0?1:n]})).then(function(u){var s=u[0].data;return f?Nt(s,f,a):s})}var ef=void 0;function jr(e,r,t){return!t&&r&&typeof r!="number"&&typeof r!="string"&&(t=r,r=void 0),ut(e).then(function(n){return Rt(ef,Gr,n,r,t)})}var Ae=e=>Uint8Array.from(e,r=>r.charCodeAt(0)),co=60,no=33,rf=Ae("DOCTYPE"),tf=Ae("ENTITY"),oo=Ae("<sheetData"),io=Ae("</sheetData>"),ao=Ae("<row"),fo=Ae("</row>"),nf=Ae("</c>"),uo=Ae(' t="e"');function Ee(e,r,t=0,n=e.length){let o=r[0],i=n-r.length;for(let f=e.indexOf(o,t);f!==-1&&f<=i;f=e.indexOf(o,f+1)){let a=1;for(;a<r.length&&e[f+a]===r[a];)a++;if(a===r.length)return f}return-1}function so(e,r,t){for(let n=0;n<t.length;n++)if((e[r+n]|32)!==(t[n]|32))return!1;return!0}function jt(e,r){let t=new Uint8Array(0),n=!0;return o=>{if(n&&o.length>=2&&(o[0]===254&&o[1]===255||o[0]===255&&o[1]===254)||o.indexOf(0)!==-1)throw L("XML_DECLARATION",e,`the part "${r}" is not UTF-8 XML, which a workbook always is; it is refused.`,{part:r});n=!1;let i=t.length?of(t,o):o;for(let f=i.indexOf(no,1);f!==-1;f=i.indexOf(no,f+1))if(i[f-1]===co&&(so(i,f+1,rf)||so(i,f+1,tf)))throw L("XML_DECLARATION",e,`the part "${r}" declares a document type or entities, which a workbook never needs; it is refused.`,{part:r});t=i.slice(Math.max(0,i.length-9))}}function Ct(e,r,t){jt(r,t)(e)}function of(e,r){let t=new Uint8Array(e.length+r.length);return t.set(e),t.set(r,e.length),t}function af(e,r,t){for(let n=r;n<t-3;n++)if((e[n]===32||e[n]===9||e[n]===10||e[n]===13)&&e[n+1]===114&&e[n+2]===61&&e[n+3]===34){let o=0;for(let i=n+4;i<t&&e[i]>=48&&e[i]<=57;i++)o=o*10+(e[i]-48);return o}return 0}var ff=64*1024*1024,lo=Ae("<c ");function uf(e,r,t){let n=0,o=0;for(let i=Ee(e,lo,r,t);i!==-1;i=Ee(e,lo,i+3,t)){let f=e.indexOf(62,i),a=f===-1||f>t?t:f;for(let u=i+2;u<a-3;u++)if((e[u]===32||e[u]===9)&&e[u+1]===114&&e[u+2]===61&&e[u+3]===34){let s=0,l=u+4;for(;l<a&&(e[l]|32)>=97&&(e[l]|32)<=122&&s<=1e7;l++)s=s*26+((e[l]|32)-96);let c=0;for(;l<a&&e[l]>=48&&e[l]<=57&&c<=1e12;l++)c=c*10+(e[l]-48);n=Math.max(n,s),o=Math.max(o,c);break}}return{column:n,row:o}}function ho(e,r={}){let t=r.file??"file",n=0,o=0,i=new Uint8Array(0),f=0,a=0,u=0,s=0,l=S=>{let g=i,x=0;for(;x<g.length;){if(o===0){let b=Ee(g,oo,x);if(b===-1){let M=S?g.length:Math.max(x,g.length-oo.length);e.write(g,x,M),x=M;break}let P=g.indexOf(62,b);if(P===-1){e.write(g,x,b),x=b;break}e.write(g,x,P+1),x=P+1,o=g[P-1]===47?2:1;continue}if(o===2){e.write(g,x,g.length),x=g.length;break}let y=g.indexOf(co,x);if(y===-1){x=g.length;break}if(Ee(g,io,y,y+io.length)===y){o=2,x=y;continue}if(Ee(g,ao,y,y+ao.length)!==y){let b=g.indexOf(62,y);if(b===-1){x=y;break}e.write(g,y,b+1),x=b+1;continue}let w=g.indexOf(62,y);if(w===-1){x=y;break}let A=af(g,y,w);if(g[w-1]===47){a=Math.max(a,A),u++,x=w+1;continue}let T=Ee(g,fo,w);if(T===-1){x=y;break}let z=T+fo.length;if(a=Math.max(a,A),Ee(g,nf,w,T)!==-1){let b=uf(g,w,T),P=Math.max(A,b.row);if(n=Math.max(n,b.column),r.maxRow!==void 0&&P>r.maxRow)throw Ze("rows",P,r.maxRow,t,"rows");if(r.maxColumn!==void 0&&n>r.maxColumn)throw Ze("columns",n,r.maxColumn,t,"columns");if(r.maxCells!==void 0&&P*n>r.maxCells)throw Ze("importCells",P*n,r.maxCells,t,"values (rows x columns)");e.write(g,y,z),f=Math.max(f,P);for(let M=Ee(g,uo,w,T);M!==-1;M=Ee(g,uo,M+1,T))s++}else u++;x=z}if(i=x<g.length?g.slice(x):new Uint8Array(0),i.length>ff)throw L("DAMAGED",t,"a row of the sheet is larger than 64 MiB, or the sheet's XML is broken; the workbook is refused.")},c=[],h=0,v=0,O=()=>{if(c.length===1)return c[0];let S=new Uint8Array(h),g=0;for(let x of c)S.set(x,g),g+=x.length;return S};return{push(S){c.push(S),h+=S.length,!(h<v)&&(i=O(),l(!1),c=i.length?[i]:[],h=i.length,v=i.length*2)},end(){return i=h?O():new Uint8Array(0),c=[],l(!0),i.length&&e.write(i),{lastRow:a,lastValueRow:f,dropped:u,errors:s}}}}var vo=101010256,sf=117853008,lf=101075792,mo=33639248,yo=67324752,po=16384,we=(e,r)=>e[r]|e[r+1]<<8,ve=(e,r)=>(e[r]|e[r+1]<<8|e[r+2]<<16|e[r+3]<<24)>>>0,Ce=(e,r)=>ve(e,r)+ve(e,r+4)*2**32;function go(e,r,t){let n=h=>L("DAMAGED",r,`the workbook is damaged or cut off (${h}); open it in Excel and save it again.`),o=-1;for(let h=e.length-22;h>=0&&h>=e.length-65557;h--)if(ve(e,h)===vo){o=h;break}if(o<0)throw n("no ZIP directory");let i=we(e,o+10),f=ve(e,o+12),a=ve(e,o+16);if((i===65535||a===4294967295||f===4294967295)&&o>=20&&ve(e,o-20)===sf){let h=Ce(e,o-12);if(h+56>e.length||ve(e,h)!==lf)throw n("ZIP64 directory");i=Ce(e,h+32),f=Ce(e,h+40),a=Ce(e,h+48)}if(i>t.archiveEntries)throw L("LIMIT",r,`the workbook has ${i.toLocaleString("en-US")} parts, more than ${t.archiveEntries.toLocaleString("en-US")} (limits.archiveEntries).`,{limit:"archiveEntries",value:i,max:t.archiveEntries});if(a+f>e.length)throw n("directory outside the file");let u=[],s=0,l=a,c=new TextDecoder;for(let h=0;h<i;h++){if(l+46>e.length||ve(e,l)!==mo)throw n("directory entry");let v=we(e,l+8),O=we(e,l+10),S=ve(e,l+20),g=ve(e,l+24),x=we(e,l+28),y=we(e,l+30),w=we(e,l+32),A=ve(e,l+42),T=c.decode(e.subarray(l+46,l+46+x)),z=l+46+x,b=z+y;for(;z+4<=b;){let P=we(e,z),M=we(e,z+2);if(P===1){let Y=z+4;g===4294967295&&(g=Ce(e,Y),Y+=8),S===4294967295&&(S=Ce(e,Y),Y+=8),A===4294967295&&(A=Ce(e,Y))}z+=4+M}if(v&1)throw L("ENCRYPTED",r,"the workbook is encrypted; save it without a password, then load it.");if(O!==0&&O!==8)throw L("DAMAGED",r,`a part of the workbook uses compression method ${O}, which is not read; save it again in Excel.`);if(s+=g,s>t.unpackedBytes)throw L("LIMIT",r,`the workbook unpacks to more than ${t.unpackedBytes.toLocaleString("en-US")} bytes (limits.unpackedBytes): a ZIP bomb, or a workbook too large to load.`,{limit:"unpackedBytes",value:s,max:t.unpackedBytes});u.push({name:T,method:O,compressedSize:S,size:g,localOffset:A}),l=b+w}return u}function cf(e,r,t){let n=r.localOffset;if(n+30>e.length||ve(e,n)!==yo)throw L("DAMAGED",t,`the workbook is damaged (part "${r.name}"); open it in Excel and save it again.`);let o=n+30+we(e,n+26)+we(e,n+28),i=o+r.compressedSize;if(i>e.length)throw L("DAMAGED",t,`the workbook is cut off (part "${r.name}"); load the whole file.`);return[o,i]}async function Lt(e,r,t,n,o){let[i,f]=cf(e,r,t),a=0,u=s=>{if(a+=s.length,a>r.size)throw L("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 mn(l=>u(l));for(let l=i;l<f;l+=po){let c=Math.min(f,l+po);try{s.push(e.subarray(l,c),c===f)}catch(h){throw h?.code===void 0||typeof h.code!="number"?h:L("DAMAGED",t,`the part "${r.name}" cannot be unpacked; the workbook is damaged or cut off.`)}await o?.()}}if(a!==r.size)throw L("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 Ft(e,r,t,n){let o=new Uint8Array(r.size),i=0;return await Lt(e,r,t,f=>{o.set(f,i),i+=f.length},n),o}var hf=(()=>{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 pf(e,r=0,t=0,n=e.length){let o=~r;for(let i=t;i<n;i++)o=hf[(o^e[i])&255]^o>>>8;return~o>>>0}function wo(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,yo),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 l=t,c=0;return{write(h,v=0,O=h.length){o(O-v),r.set(h.subarray(v,O),t),c=pf(h,c,v,O),t+=O-v},end(){let h=t-l;if(h>4294967294)throw new RangeError("a stored part over 4 GiB");f(s+14,c),f(s+18,h),f(s+22,h),n.push({name:u,crc:c,size:h,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,mo),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,vo),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 vf={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 vf[o.toLowerCase()]??r;let i=t?parseInt(t,16):Number(n);return i>0&&i<=1114111?String.fromCodePoint(i):""})}function yf(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 Mt(e,r){return[...e.matchAll(new RegExp(`<(?:[\\w.-]+:)?${r}\\b([^<>]*)>`,"g"))].map(t=>yf(t[1]))}function zt(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 bo(e,r){let t=new Map;for(let o of Mt(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"),zt(o.get("Target")))}let n=[];for(let o of Mt(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 xo(e){let r={sharedStrings:"xl/sharedStrings.xml",styles:"xl/styles.xml"};for(let t of Mt(e,"Relationship")){let n=t.get("Type")??"";/\/sharedStrings$/.test(n)&&t.has("Target")&&(r.sharedStrings=zt(t.get("Target"))),/\/styles$/.test(n)&&t.has("Target")&&(r.styles=zt(t.get("Target")))}return r}var df=[208,207,17,224,161,177,26,225],gf=[80,75,3,4],So=(e,r)=>r.every((t,n)=>e[n]===t),Vt=e=>zr(String(e)).slice(0,100),Ut=4*1024*1024,wf=e=>Array.from(e,r=>r.charCodeAt(0)),bf=wf("EncryptedPackage").flatMap(e=>[e,0]);function xf(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 Sf(e,r){if(/\.xlsm$/i.test(r))throw L("MACROS",r,"a workbook with macros (.xlsm) is not loaded; save it as an Excel workbook (.xlsx) or as CSV.");if(So(e,df))throw xf(e,bf)?L("ENCRYPTED",r,"the workbook is protected with a password; save it without one, then load it."):L("XLS",r,"this is an Excel 97-2003 workbook (.xls); save it as an Excel workbook (.xlsx) or as CSV, then load it.");if(!So(e,gf))throw L("WRONG_TYPE",r,"this is no Excel workbook (.xlsx); check the file, or load a CSV file with the CSV reader.")}async function Oo(e,r,t,n){Sf(e,r);let o=go(e,r,t),i=new Map(o.map(v=>[v.name,v]));for(let v of o)if(/(^|\/)vbaProject\.bin$/i.test(v.name))throw L("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")?L("XLSB",r,"this is an Excel binary workbook (.xlsb); save it as an Excel workbook (.xlsx) or as CSV, then load it."):L("WRONG_TYPE",r,"this ZIP file is no Excel workbook (it has no xl/workbook.xml).");let f=new Map,a=async(v,O=1/0)=>{let S=i.get(v);if(!S)return null;if(S.size>O)throw L("DAMAGED",r,`the part "${v}" is ${S.size.toLocaleString("en-US")} bytes, far more than a workbook's list of sheets holds; it is refused.`);let g=await Ft(e,S,r,n);return Ct(g,r,v),f.set(v,g),g},u=await a("[Content_Types].xml",Ut);if(u&&/macroEnabled/i.test(new TextDecoder().decode(u)))throw L("MACROS",r,"a workbook with macros (.xlsm) is not loaded; save it as an Excel workbook (.xlsx) or as CSV.");let s=v=>v?new TextDecoder().decode(v):"",l=s(await a("xl/workbook.xml",Ut)),c=s(await a("xl/_rels/workbook.xml.rels",Ut)),h=bo(l,c);if(h.length===0)throw L("NO_TABLE",r,"the workbook has no worksheet.");return{entries:i,parts:f,sheets:h,shared:xo(c)}}function Of(e,r,t){if(typeof r=="string"){let n=e.find(o=>o.name===r);if(!n)throw L("NO_SHEET",t,`the workbook has no sheet "${Vt(r)}".`,{sheet:r});return n}if(typeof r=="number"){let n=e[r];if(!n)throw L("NO_SHEET",t,`the workbook has no sheet ${r+1}.`,{sheet:r});return n}return e.find(n=>n.visible)??e[0]}async function As(e,r){let t=yr(r),n=vr(e,t),o=await mr(e,t.limits,n),{sheets:i}=await Oo(o,n,t.limits,()=>t.signal?.throwIfAborted());return i.map(({name:f,index:a,visible:u})=>({name:f,index:a,visible:u}))}async function _s(e,r){let t=yr(r),n=vr(e,t),o=t.signal;o?.throwIfAborted();let i=await mr(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:l}=await Oo(i,n,t.limits,f),c=Of(s,t.sheet,n);for(let b of[l.sharedStrings,l.styles]){let P=a.get(b);if(P&&!u.has(b)){let M=await Ft(i,P,n,f);Ct(M,n,b),u.set(b,M)}}let h=a.get(c.path);if(!h)throw L("DAMAGED",n,`the part of sheet "${Vt(c.name)}" is missing; open the workbook in Excel and save it again.`);let v=h.size+22;for(let[b,P]of u)v+=P.length+2*(76+b.length);let O=wo(v+2*(76+c.path.length));for(let[b,P]of u)O.add(b,P);u.clear();let S=O.begin(c.path),g=ho(S,{file:n,maxRow:t.limits.rows+1e3,maxColumn:t.limits.columns,maxCells:t.limits.importCells+t.limits.columns*1e3}),x=jt(n,c.path),y=0;await Lt(i,h,n,b=>{x(b),g.push(b),y+=b.length},()=>{o?.throwIfAborted(),t.onProgress?.({phase:"unpack",done:y,total:h.size})});let w=g.end();S.end();let A=O.finish();o?.throwIfAborted(),t.onProgress?.({phase:"parse",done:0,total:w.lastValueRow});let T;try{let b=A.buffer,P=b.byteLength===A.length?b:typeof b.transfer=="function"?b.transfer(A.length):A.slice().buffer;A=null,T=await jr(P,c.name)}catch(b){throw L("DAMAGED",n,`sheet "${Vt(c.name)}" cannot be read (${String(b?.message??b).slice(0,200)}); open the workbook in Excel and save it again.`)}o?.throwIfAborted(),t.onProgress?.({phase:"parse",done:w.lastValueRow,total:w.lastValueRow});let z=Ur({file:n,limits:t.limits,locale:t.locale,hints:{decimal:".",serialDates:!0}});z.note("SHEET",{sheet:c.name,count:s.length,visible:s.filter(b=>b.visible).length}),w.lastRow>w.lastValueRow&&w.lastRow-w.lastValueRow>=100&&z.note("USED_RANGE",{usedRow:w.lastRow,lastRow:w.lastValueRow});for(let b=0;b<T.length;b++)z.row(T[b]),T[b]=null;return w.errors>0&&z.note("ERROR_CELLS",{count:w.errors}),o?.throwIfAborted(),z.finish(t.types)}export{_s as read,As as sheets};
|