UNPKG

read-excel-file

Version:

Read `.xlsx` files in a web browser or in Node.js

3 lines (2 loc) 48 kB
!function(r,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(r="undefined"!=typeof globalThis?globalThis:r||self).readXlsxFile=t()}(this,(function(){"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},r(t)}function t(t){var e=String.fromCharCode,n=Object.prototype.hasOwnProperty,o=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,i={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function u(r,t,o,u){return u?n.call(i,u)?i[u]:"&"+u+";":e(t||parseInt(o,16))}function a(r){return r.length>3&&-1!==r.indexOf("&")?r.replace(o,u):r}Object.keys(i).forEach((function(r){i[r.toUpperCase()]=i[r]}));var f="non-whitespace outside of root node";function c(r){return new Error(r)}function l(r){return{get:r,enumerable:!0}}function s(r){var t,e={};for(t in r)e[t]=r[t];return e}var p=Symbol("nameCache");function b(r){return r+"$uri"}function y(){return{line:0,column:0}}function d(r){throw r}return new function t(e){if(!this)return new t(e);var n,o,i,u,m,v,h,g,w,O,S,x,j=e&&e.proxy,P=d,E=y,I=!1,A=!1,N="",k=!1,T=!1,C=null,_=!1;function D(r){r instanceof Error||(r=c(r)),C=r,P(r,E)}function R(r){m&&(r instanceof Error||(r=c(r)),m(r,E))}function F(){w=T?[]:null,O=T?function(r){var t,e,n={};for(t in r)n[e=r[t]]=e,n[b(e)]=t;return n}(x):null,S=[],E=y,_=!1,C=null,A=!1,N=""}function L(r){var t,e,c,y,d,m,P,I,N,C,F,L=arguments.length>1&&void 0!==arguments[1]&&arguments[1],M=null,U=null,V=0,X=!1,q=!1,B=0,$=0,z="",G=0;function W(r,t){var e=r.indexOf(":");if(-1===e)return r;var n=O[r.substring(0,e)];return n?t===n?r.substr(e+1):n+r.substr(e):(R("missing namespace for prefix <"+r.substring(0,e)+">"),null)}function H(){if(null!==F)return F;var r,t,e,n,o,i,u,f,c,l,p=T&&O.xmlns,y=T&&k?[]:null,d=G,m=z,v=m.length,h={},g=new Set;r:for(;d<v;d++)if(f=!1,!(32===(c=m.charCodeAt(d))||c<14&&c>8)){for((c<65||c>122||c>90&&c<97)&&95!==c&&58!==c&&(R("illegal first char attribute name"),f=!0),l=d+1;l<v;l++)if(!((c=m.charCodeAt(l))>96&&c<123||c>64&&c<91||c>47&&c<59||46===c||45===c||95===c)){if(32===c||c<14&&c>8){R("missing attribute value"),d=l;continue r}if(61===c)break;R("illegal attribute name char"),f=!0}if("xmlns:xmlns"===(u=m.substring(d,l))&&(R("illegal declaration of xmlns"),f=!0),34===(c=m.charCodeAt(l+1)))-1===(l=m.indexOf('"',d=l+2))&&-1!==(l=m.indexOf("'",d))&&(R("attribute value quote missmatch"),f=!0);else if(39===c)-1===(l=m.indexOf("'",d=l+2))&&-1!==(l=m.indexOf('"',d))&&(R("attribute value quote missmatch"),f=!0);else for(R("missing attribute value quotes"),f=!0,l+=1;l<v&&!(32===(c=m.charCodeAt(l+1))||c<14&&c>8);l++);for(-1===l&&(R("missing closing quotes"),l=v,f=!0),f||(o=m.substring(d,l)),d=l;l+1<v&&!(32===(c=m.charCodeAt(l+1))||c<14&&c>8);l++)d===l&&(R("illegal character after attribute end"),f=!0);if(d=l+1,!f)if(g.has(u))R("attribute <"+u+"> already defined");else if(g.add(u),T)if(k){if(null!==(n="xmlns"===u?"xmlns":120===u.charCodeAt(0)&&"xmlns:"===u.substr(0,6)?u.substr(6):null)){if(r=a(o),t=b(n),!(i=x[r])){if("xmlns"===n||t in O&&O[t]!==r)do{i="ns"+V++}while(void 0!==O[i]);else i=n;x[r]=i}O[n]!==i&&(e||(O=s(O),e=!0),O[n]=i,"xmlns"===n&&(O[b(i)]=r,p=i),O[t]=r),h[u]=o;continue}y.push(u,o)}else null!==(u=W(u,p))&&(h[u]=o);else h[u]=o}if(k)for(d=0,v=y.length;d<v;d++)u=W(y[d++],p),o=y[d],null!==u&&(h[u]=o);return F=h}for(E=function(){for(var t,e,n=/(\r\n|\r|\n)/g,o=0,i=0,u=0,a=$;B>=u&&(t=n.exec(r))&&!((a=t[0].length+t.index)>B);)o+=1,u=a;return-1==B?(i=a,e=r.substring($)):0===$?e=r.substring($,B):(i=B-u,e=-1==$?r.substring(B):r.substring(B,$+1)),{data:e,line:o,column:i}},j&&(C=Object.create({},{name:l((function(){return I})),originalName:l((function(){return N})),attrs:l(H),ns:l((function(){return O}))}));-1!==$;){if(-1===(B=60===r.charCodeAt($)?$:r.indexOf("<",$)))return L?r.substring($):S.length?D("unexpected end of file"):A?void($<r.length&&r.substring($).trim()&&R(f)):D("missing start tag");if(A||(A=!0),$!==B)if(S.length){if(n&&(n(r.substring($,B),a,E),_))return}else if(r.substring($,B).trim()&&(R(f),_))return;if(33===(d=r.charCodeAt(B+1))){if(91===(y=r.charCodeAt(B+2))&&"CDATA["===r.substr(B+3,6)){if(-1===($=r.indexOf("]]>",B)))return L?r.substring(B):D("unclosed cdata");if(u&&(u(r.substring(B+9,$),E),_))return;$+=3;continue}if(45===y&&45===r.charCodeAt(B+3)){if(-1===($=r.indexOf("--\x3e",B)))return L?r.substring(B):D("unclosed comment");if(v&&(v(r.substring(B+4,$),a,E),_))return;$+=3;continue}}if(63!==d){for(e=B+1;;e++){if(m=r.charCodeAt(e),isNaN(m))return L?r.substring(B):($=-1,D("unclosed tag"));if(34===m)e=-1!==(y=r.indexOf('"',e+1))?y:e;else if(39===m)e=-1!==(y=r.indexOf("'",e+1))?y:e;else if(62===m){$=e;break}}if(33!==d){if(F={},47===d){if(X=!1,q=!0,!S.length)return D("missing open tag");if(e=I=S.pop(),y=B+2+e.length,r.substring(B+2,y)!==e)return D("closing tag mismatch");for(;y<$;y++)if(!(32===(d=r.charCodeAt(y))||d>8&&d<14))return D("close tag")}else{if(47===r.charCodeAt($-1)?(e=I=r.substring(B+1,$-1),X=!0,q=!0):(e=I=r.substring(B+1,$),X=!0,q=!1),!(d>96&&d<123||d>64&&d<91||95===d||58===d))return D("illegal first char nodeName");for(y=1,c=e.length;y<c;y++)if(!((d=e.charCodeAt(y))>96&&d<123||d>64&&d<91||d>47&&d<59||45===d||95===d||46==d)){if(32===d||d<14&&d>8){I=e.substring(0,y),F=null;break}return D("invalid nodeName")}q||S.push(I)}if(T){t=O,X&&(q||w.push(t),null===F&&(k=-1!==e.indexOf("xmlns",y))&&(G=y,z=e,H(),k=!1)),N=I,U!==O&&(void 0===(M=O[p])&&(M=O[p]={}),U=O);var K=M[I];if(void 0!==K)I=K;else{if(-1!==(d=I.indexOf(":"))){if(!(P=O[I.substring(0,d)]))return D("missing namespace on <"+N+">");I=I.substr(d+1)}else P=O.xmlns;P&&(I=P+":"+I),M[N]=I}}if(X&&(G=y,z=e,o&&(j?o(C,a,q,E):o(I,H,a,q,E),_)))return;if(q){if(i&&(i(j?C:I,a,X,E),_))return;T&&(O=X?t:w.pop())}$+=1}else{if(g&&(g(r.substring(B,$+1),a,E),_))return;$+=1}}else{if(-1===($=r.indexOf("?>",B)))return L?r.substring(B):D("unclosed question");if(h&&(h(r.substring(B,$+2),E),_))return;$+=2}}}this.on=function(r,t){if("function"!=typeof t)throw c("required args <name, cb>");switch(r){case"openTag":o=t;break;case"text":n=t;break;case"closeTag":i=t;break;case"error":P=t;break;case"warn":m=t;break;case"cdata":u=t;break;case"attention":g=t;break;case"question":h=t;break;case"comment":v=t;break;default:throw c("unsupported event: "+r)}return this},this.ns=function(t){if(void 0===t&&(t={}),"object"!==r(t))throw c("required args <nsMap={}>");var e,n={};for(e in t)n[e]=t[e];return T=!0,x=n,this},this.parse=function(r){if("string"!=typeof r)throw c("required args <xml=string>");if(I)throw c("parse during stream; call end() first");return F(),L(r),E=y,_=!1,C},this.write=function(r){if("string"!=typeof r)throw c("required args <xml=string>");return I||(F(),I=!0),C||(N=L(N+r,!0)||""),this},this.end=function(){return I||F(),I=!1,C||L(N),N="",E=y,_=!1,C},this.stop=function(){_=!0}}(t)}function e(r,t){for(var e=0;e<r.length;){if(":"===r[e]&&(!t||5!==e||"xmlns"!==r.slice(0,5)))return r.slice(e+1);e++}return r}function n(r){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},n(r)}function o(r,t){for(var e=0;e<t.length;e++){var o=t[e];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(r,(i=o.key,u=void 0,u=function(r,t){if("object"!==n(r)||null===r)return r;var e=r[Symbol.toPrimitive];if(void 0!==e){var o=e.call(r,t||"default");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(r)}(i,"string"),"symbol"===n(u)?u:String(u)),o)}var i,u}function i(r){var t=f();return function(){var e,o=l(r);if(t){var i=l(this).constructor;e=Reflect.construct(o,arguments,i)}else e=o.apply(this,arguments);return function(r,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(r){if(void 0===r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}(r)}(this,e)}}function u(r){var t="function"==typeof Map?new Map:void 0;return u=function(r){if(null===r||(e=r,-1===Function.toString.call(e).indexOf("[native code]")))return r;var e;if("function"!=typeof r)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(r))return t.get(r);t.set(r,n)}function n(){return a(r,arguments,l(this).constructor)}return n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,r)},u(r)}function a(r,t,e){return a=f()?Reflect.construct.bind():function(r,t,e){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(r,n));return e&&c(o,e.prototype),o},a.apply(null,arguments)}function f(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(r){return!1}}function c(r,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,t){return r.__proto__=t,r},c(r,t)}function l(r){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},l(r)}var s=function(r){!function(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(t&&t.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),t&&c(r,t)}(a,r);var t,e,n,u=i(a);function a(r){var t;return function(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=u.call(this,r)).name="InvalidSpreadsheetError",t}return t=a,e&&o(t.prototype,e),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(u(Error));function p(r,n,o,i,u,a){var f=function(r,n,o,i){var u,a=!1,f=function(){if(a)throw new Error("Errored")},c=new t;return{promise:new Promise((function(t,f){u=t,c.on("error",(function(r){throw a=!0,r})),c.on("text",(function(t,e){i&&i(e(t),r)})),c.on("openTag",(function(t,o,i,u,a){if(n){var f=o();for(var c in f)f[e(c,!0)]=i(f[c]);n(e(t),f,r)}})),c.on("closeTag",(function(t){o&&o(e(t),r)}))})),write:function(r){f(),c.write(r)},end:function(){f(),c.end(),u()}}}(n,o,i,u);return a?function(r,t,e,n){var o=7,i=65536,u=function(){var n=Date.now();if(t.length>i){r.write(t.slice(0,i)),e&&e(!1),t=t.slice(i);var u=Date.now()-n;return u<.5*o?i*=2:u>o&&(i/=2),!0}return r.write(t),r.end(),e&&e(!0),!1};!function r(){u()&&(n?"undefined"!=typeof setImmediate?setImmediate(r):setTimeout(r,0):r())}()}(f,r,a):(f.write(r),f.end()),f.promise.then((function(r){return r}),(function(r){var t=new s(r.message);throw t.stack=r.stack,t.cause=r,t}))}var b={},y=Uint8Array,d=Uint16Array,m=Int32Array,v=new y([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]),h=new y([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]),g=new y([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),w=function(r,t){for(var e=new d(31),n=0;n<31;++n)e[n]=t+=1<<r[n-1];var o=new m(e[30]);for(n=1;n<30;++n)for(var i=e[n];i<e[n+1];++i)o[i]=i-e[n]<<5|n;return{b:e,r:o}},O=w(v,2),S=O.b,x=O.r;S[28]=258,x[258]=28;for(var j=w(h,0).b,P=new d(32768),E=0;E<32768;++E){var I=(43690&E)>>1|(21845&E)<<1;I=(61680&(I=(52428&I)>>2|(13107&I)<<2))>>4|(3855&I)<<4,P[E]=((65280&I)>>8|(255&I)<<8)>>1}var A=function(r,t,e){for(var n=r.length,o=0,i=new d(t);o<n;++o)r[o]&&++i[r[o]-1];var u,a=new d(t);for(o=1;o<t;++o)a[o]=a[o-1]+i[o-1]<<1;if(e){u=new d(1<<t);var f=15-t;for(o=0;o<n;++o)if(r[o])for(var c=o<<4|r[o],l=t-r[o],s=a[r[o]-1]++<<l,p=s|(1<<l)-1;s<=p;++s)u[P[s]>>f]=c}else for(u=new d(n),o=0;o<n;++o)r[o]&&(u[o]=P[a[r[o]-1]++]>>15-r[o]);return u},N=new y(288);for(E=0;E<144;++E)N[E]=8;for(E=144;E<256;++E)N[E]=9;for(E=256;E<280;++E)N[E]=7;for(E=280;E<288;++E)N[E]=8;var k=new y(32);for(E=0;E<32;++E)k[E]=5;var T=A(N,9,1),C=A(k,5,1),_=function(r){for(var t=r[0],e=1;e<r.length;++e)r[e]>t&&(t=r[e]);return t},D=function(r,t,e){var n=t/8|0;return(r[n]|r[n+1]<<8)>>(7&t)&e},R=function(r,t){var e=t/8|0;return(r[e]|r[e+1]<<8|r[e+2]<<16)>>(7&t)},F=function(r){return(r+7)/8|0},L=function(r,t,e){return(null==t||t<0)&&(t=0),(null==e||e>r.length)&&(e=r.length),new y(r.subarray(t,e))},M=["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"],U=function(r,t,e){var n=new Error(t||M[r]);if(n.code=r,Error.captureStackTrace&&Error.captureStackTrace(n,U),!e)throw n;return n},V=function(r,t,e,n){var o=r.length,i=n?n.length:0;if(!o||t.f&&!t.l)return e||new y(0);var u=!e,a=u||2!=t.i,f=t.i;u&&(e=new y(3*o));var c=function(r){var t=e.length;if(r>t){var n=new y(Math.max(2*t,r));n.set(e),e=n}},l=t.f||0,s=t.p||0,p=t.b||0,b=t.l,d=t.d,m=t.m,w=t.n,O=8*o;do{if(!b){l=D(r,s,1);var x=D(r,s+1,3);if(s+=3,!x){var P=r[(z=F(s)+4)-4]|r[z-3]<<8,E=z+P;if(E>o){f&&U(0);break}a&&c(p+P),e.set(r.subarray(z,E),p),t.b=p+=P,t.p=s=8*E,t.f=l;continue}if(1==x)b=T,d=C,m=9,w=5;else if(2==x){var I=D(r,s,31)+257,N=D(r,s+10,15)+4,k=I+D(r,s+5,31)+1;s+=14;for(var M=new y(k),V=new y(19),X=0;X<N;++X)V[g[X]]=D(r,s+3*X,7);s+=3*N;var q=_(V),B=(1<<q)-1,$=A(V,q,1);for(X=0;X<k;){var z,G=$[D(r,s,B)];if(s+=15&G,(z=G>>4)<16)M[X++]=z;else{var W=0,H=0;for(16==z?(H=3+D(r,s,3),s+=2,W=M[X-1]):17==z?(H=3+D(r,s,7),s+=3):18==z&&(H=11+D(r,s,127),s+=7);H--;)M[X++]=W}}var K=M.subarray(0,I),Y=M.subarray(I);m=_(K),w=_(Y),b=A(K,m,1),d=A(Y,w,1)}else U(1);if(s>O){f&&U(0);break}}a&&c(p+131072);for(var Z=(1<<m)-1,J=(1<<w)-1,Q=s;;Q=s){var rr=(W=b[R(r,s)&Z])>>4;if((s+=15&W)>O){f&&U(0);break}if(W||U(2),rr<256)e[p++]=rr;else{if(256==rr){Q=s,b=null;break}var tr=rr-254;if(rr>264){var er=v[X=rr-257];tr=D(r,s,(1<<er)-1)+S[X],s+=er}var nr=d[R(r,s)&J],or=nr>>4;nr||U(3),s+=15&nr;Y=j[or];if(or>3){er=h[or];Y+=R(r,s)&(1<<er)-1,s+=er}if(s>O){f&&U(0);break}a&&c(p+131072);var ir=p+tr;if(p<Y){var ur=i-Y,ar=Math.min(Y,ir);for(ur+p<0&&U(3);p<ar;++p)e[p]=n[ur+p]}for(;p<ir;++p)e[p]=e[p-Y]}}t.l=b,t.p=Q,t.b=p,t.f=l,b&&(l=1,t.m=m,t.d=d,t.n=w)}while(!l);return p!=e.length&&u?L(e,0,p):e.subarray(0,p)},X=new y(0),q=function(r,t,e){for(var n=r(),o=r.toString(),i=o.slice(o.indexOf("[")+1,o.lastIndexOf("]")).replace(/\s+/g,"").split(","),u=0;u<n.length;++u){var a=n[u],f=i[u];if("function"==typeof a){t+=";"+f+"=";var c=a.toString();if(a.prototype)if(-1!=c.indexOf("[native code]")){var l=c.indexOf(" ",8)+1;t+=c.slice(l,c.indexOf("(",l))}else for(var s in t+=c,a.prototype)t+=";"+f+".prototype."+s+"="+a.prototype[s].toString();else t+=c}else e[f]=a}return t},B=[],$=function(r,t,e,n){if(!B[e]){for(var o="",i={},u=r.length-1,a=0;a<u;++a)o=q(r[a],o,i);B[e]={c:q(r[u],o,i),e:i}}var f=function(r,t){var e={};for(var n in r)e[n]=r[n];for(var n in t)e[n]=t[n];return e}({},B[e].e);return function(r,t,e,n,o){var i=new Worker(b[t]||(b[t]=URL.createObjectURL(new Blob([r+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return i.onmessage=function(r){var t=r.data,e=t.$e$;if(e){var n=new Error(e[0]);n.code=e[1],n.stack=e[2],o(n,null)}else o(null,t)},i.postMessage(e,n),i}(B[e].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",e,f,function(r){var t=[];for(var e in r)r[e].buffer&&t.push((r[e]=new r[e].constructor(r[e])).buffer);return t}(f),n)},z=function(){return[y,d,m,v,h,g,S,j,T,C,P,M,A,_,D,R,F,L,U,V,J,G,W]},G=function(r){return postMessage(r,[r.buffer])},W=function(r){return r&&{out:r.size&&new y(r.size),dictionary:r.dictionary}},H=function(r,t,e,n,o,i){var u=$(e,n,o,(function(r,t){u.terminate(),i(r,t)}));return u.postMessage([r,t],t.consume?[r.buffer]:[]),function(){u.terminate()}},K=function(r,t){return r[t]|r[t+1]<<8},Y=function(r,t){return(r[t]|r[t+1]<<8|r[t+2]<<16|r[t+3]<<24)>>>0},Z=function(r,t){return Y(r,t)+4294967296*Y(r,t+4)};function J(r,t){return V(r,{i:2},t&&t.out,t&&t.dictionary)}var Q="undefined"!=typeof TextDecoder&&new TextDecoder;try{Q.decode(X,{stream:!0}),1}catch(r){}var rr=function(r){for(var t="",e=0;;){var n=r[e++],o=(n>127)+(n>223)+(n>239);if(e+o>r.length)return{s:t,r:L(r,e-1)};o?3==o?(n=((15&n)<<18|(63&r[e++])<<12|(63&r[e++])<<6|63&r[e++])-65536,t+=String.fromCharCode(55296|n>>10,56320|1023&n)):t+=1&o?String.fromCharCode((31&n)<<6|63&r[e++]):String.fromCharCode((15&n)<<12|(63&r[e++])<<6|63&r[e++]):t+=String.fromCharCode(n)}};function tr(r,t){if(t){for(var e="",n=0;n<r.length;n+=16384)e+=String.fromCharCode.apply(null,r.subarray(n,n+16384));return e}if(Q)return Q.decode(r);var o=rr(r),i=o.s;return(e=o.r).length&&U(8),i}var er=function(r,t){return t+30+K(r,t+26)+K(r,t+28)},nr=function(r,t,e){var n=K(r,t+28),o=K(r,t+30),i=tr(r.subarray(t+46,t+46+n),!(2048&K(r,t+8))),u=t+46+n,a=or(r,u,o,e,Y(r,t+20),Y(r,t+24),Y(r,t+42)),f=a[0],c=a[1],l=a[2];return[K(r,t+10),f,c,i,u+o+K(r,t+32),l]},or=function(r,t,e,n,o,i,u){var a=4294967295==o,f=4294967295==i,c=4294967295==u,l=t+e;if(n&&a+f+c){for(;t+4<l;t+=4+K(r,t+2))if(1==K(r,t))return[a?Z(r,t+4+8*f):o,f?Z(r,t+4):i,c?Z(r,t+4+8*(f+a)):u,1];n<2&&U(13)}return[o,i,u,0]},ir="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(r){r()};function ur(r,t,e){e||(e=t,t={}),"function"!=typeof e&&U(7);var n=[],o=function(){for(var r=0;r<n.length;++r)n[r]()},i={},u=function(r,t){ir((function(){e(r,t)}))};ir((function(){u=e}));for(var a=r.length-22;101010256!=Y(r,a);--a)if(!a||r.length-a>65558)return u(U(13,0,1),null),o;var f=K(r,a+8);if(f){var c=f,l=Y(r,a+16),s=117853008==Y(r,a-20);if(s){var p=Y(r,a-12);(s=101075792==Y(r,p))&&(c=f=Y(r,p+32),l=Y(r,p+48))}for(var b=t&&t.filter,d=function(t){var e=nr(r,l,s),a=e[0],c=e[1],p=e[2],d=e[3],m=e[4],v=e[5],h=er(r,v);l=m;var g=function(r,t){r?(o(),u(r,null)):(t&&(i[d]=t),--f||u(null,i))};if(!b||b({name:d,size:c,originalSize:p,compression:a}))if(a)if(8==a){var w=r.subarray(h,h+c);if(p<524288||c>.8*p)try{g(null,J(w,{out:new y(p)}))}catch(r){g(r,null)}else n.push(function(r,t,e){return e||(e=t,t={}),"function"!=typeof e&&U(7),H(r,t,[z],(function(r){return G(J(r.data[0],W(r.data[1])))}),1,e)}(w,{size:p},g))}else g(U(14,"unknown compression type "+a,1),null);else g(null,L(r,h,h+c));else g(null,null)},m=0;m<c;++m)d()}else u(null,{});return o}function ar(r){return ar="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ar(r)}function fr(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,(o=n.key,i=void 0,i=function(r,t){if("object"!==ar(r)||null===r)return r;var e=r[Symbol.toPrimitive];if(void 0!==e){var n=e.call(r,t||"default");if("object"!==ar(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(r)}(o,"string"),"symbol"===ar(i)?i:String(i)),n)}var o,i}function cr(r){var t=pr();return function(){var e,n=yr(r);if(t){var o=yr(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return function(r,t){if(t&&("object"===ar(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(r){if(void 0===r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}(r)}(this,e)}}function lr(r){var t="function"==typeof Map?new Map:void 0;return lr=function(r){if(null===r||(e=r,-1===Function.toString.call(e).indexOf("[native code]")))return r;var e;if("function"!=typeof r)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(r))return t.get(r);t.set(r,n)}function n(){return sr(r,arguments,yr(this).constructor)}return n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),br(n,r)},lr(r)}function sr(r,t,e){return sr=pr()?Reflect.construct.bind():function(r,t,e){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(r,n));return e&&br(o,e.prototype),o},sr.apply(null,arguments)}function pr(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(r){return!1}}function br(r,t){return br=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,t){return r.__proto__=t,r},br(r,t)}function yr(r){return yr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},yr(r)}var dr=function(r){!function(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(t&&t.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),t&&br(r,t)}(i,r);var t,e,n,o=cr(i);function i(){return function(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),o.apply(this,arguments)}return t=i,e&&fr(t.prototype,e),n&&fr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(lr(Error));function mr(r){var t=new dr(r.message);return r.stack&&(t.stack=r.stack),Error.captureStackTrace&&Error.captureStackTrace(t,mr),t.cause=r,t}function vr(r,t){return function(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=t.filter,n=arguments.length>2?arguments[2]:void 0;return n(new Uint8Array(r),{filter:function(r){return!e||e({path:r.name})}}).then((function(r){return r}),(function(r){throw function(r){return"number"==typeof r.code}(r)?mr(r):r}))}(r,t,hr,!0)}function hr(r){return new Promise((function(t,e){ur(r,(function(r,n){r?e(r):t(n)}))}))}function gr(r){return gr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},gr(r)}function wr(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,(o=n.key,i=void 0,i=function(r,t){if("object"!==gr(r)||null===r)return r;var e=r[Symbol.toPrimitive];if(void 0!==e){var n=e.call(r,t||"default");if("object"!==gr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(r)}(o,"string"),"symbol"===gr(i)?i:String(i)),n)}var o,i}function Or(r){var t=jr();return function(){var e,n=Er(r);if(t){var o=Er(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return function(r,t){if(t&&("object"===gr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(r){if(void 0===r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}(r)}(this,e)}}function Sr(r){var t="function"==typeof Map?new Map:void 0;return Sr=function(r){if(null===r||(e=r,-1===Function.toString.call(e).indexOf("[native code]")))return r;var e;if("function"!=typeof r)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(r))return t.get(r);t.set(r,n)}function n(){return xr(r,arguments,Er(this).constructor)}return n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Pr(n,r)},Sr(r)}function xr(r,t,e){return xr=jr()?Reflect.construct.bind():function(r,t,e){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(r,n));return e&&Pr(o,e.prototype),o},xr.apply(null,arguments)}function jr(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(r){return!1}}function Pr(r,t){return Pr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,t){return r.__proto__=t,r},Pr(r,t)}function Er(r){return Er=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Er(r)}var Ir={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"},Ar=function(r){!function(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(t&&t.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),t&&Pr(r,t)}(i,r);var t,e,n,o=Or(i);function i(r,t){var e;return function(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this,Ir[r]||r)).code=r,e.name="InvalidInputError",e.cause=t,e}return t=i,e&&wr(t.prototype,e),n&&wr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(Sr(Error));function Nr(r){var t=r.path;return t.endsWith(".xml")||t.endsWith(".xml.rels")}var kr=[80,75],Tr=[208,207,17,224],Cr=[kr,Tr];Cr.indexOf(kr);var _r,Dr=Cr.indexOf(Tr);function Rr(r,t){var e="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(e)return(e=e.call(r)).next.bind(e);if(Array.isArray(r)||(e=function(r,t){if(!r)return;if("string"==typeof r)return Fr(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);"Object"===e&&r.constructor&&(e=r.constructor.name);if("Map"===e||"Set"===e)return Array.from(r);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Fr(r,t)}(r))||t&&r&&"number"==typeof r.length){e&&(r=e);var n=0;return function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Fr(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function Lr(r){for(var t,e=function(){var r,t=function(r){for(var t=[],e=0;e<r.length;)t.push(e),e++;return t}(Cr),e=0;return function(n){var o;return isNaN(r)&&(1===(t=t.filter((function(r){if(n===Cr[r][e])return Cr[r].length===e+1&&(o=r),!0}))).length?r=o:0===t.length&&(r=-1)),e++,r}}(),n=Rr(r);!(t=n()).done;){if(Mr(t.value,e))return}!function(r){throw new Ar(0===r?"NO_DATA":"FILE_NOT_SUPPORTED")}(r.length)}function Mr(r,t){var e=t(r);if(void 0!==e){if(e===Dr)throw new Ar("XLS_FILE_NOT_SUPPORTED");if(e<0)throw new Ar("FILE_NOT_SUPPORTED");return!0}}function Ur(r){var t=Date.now();("undefined"!=typeof global?Boolean(global.READ_EXCEL_FILE_CHECKPOINTS):"undefined"!=typeof window&&Boolean(window.READ_EXCEL_FILE_CHECKPOINTS))&&(_r&&console.log(" -",t-_r,"ms"),console.log("*",r)),_r=t}function Vr(r){return _r=void 0,Ur("unpack files"),r instanceof File||r instanceof Blob?r.arrayBuffer().then(Xr):Promise.resolve(r).then(Xr)}function Xr(r){return Lr(new Uint8Array(r)),vr(r,{filter:Nr}).then((function(r){return r}),(function(r){throw r instanceof dr?new Ar("INVALID_ZIP",r.cause):r}))}function qr(r,t){var e={workbookPr:void 0,sheets:[]};return t(r,e,(function(r,t,e){"workbookPr"===r?e.workbookPr||(e.workbookPr={epoch1904:"1"===t.date1904}):"sheet"===r&&t.name&&e.sheets.push({id:Number(t.sheetId),name:t.name,relationId:t.id})}),null,null).then((function(){return function(r){return{epoch1904:!!r.workbookPr&&r.workbookPr.epoch1904,sheets:r.sheets}}(e)}))}function Br(r,t){var e="http://schemas.openxmlformats.org/officeDocument/2006/relationships/",n="http://purl.oclc.org/ooxml/officeDocument/relationships/",o={sheets:{},sharedStrings:void 0,styles:void 0};return t(r,o,(function(r,t,o){"Relationship"===r&&function(r,t,o,u){switch(o){case e+"styles":case n+"styles":r.styles=i(u);break;case e+"sharedStrings":case n+"sharedStrings":r.sharedStrings=i(u);break;case e+"worksheet":case n+"worksheet":r.sheets[t]=i(u)}}(o,t.Id,t.Type,t.Target)}),null,null).then((function(){return o}));function i(r){return"/"===r[0]?r.slice(1):"xl/"+r}}function $r(r){return $r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},$r(r)}var zr=["xfId"];function Gr(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),e.push.apply(e,n)}return e}function Wr(r){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?Gr(Object(e),!0).forEach((function(t){Hr(r,t,e[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):Gr(Object(e)).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))}))}return r}function Hr(r,t,e){return(t=function(r){var t=function(r,t){if("object"!==$r(r)||null===r)return r;var e=r[Symbol.toPrimitive];if(void 0!==e){var n=e.call(r,t||"default");if("object"!==$r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(r)}(r,"string");return"symbol"===$r(t)?t:String(t)}(t))in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}function Kr(r,t){if(null==r)return{};var e,n,o=function(r,t){if(null==r)return{};var e,n,o={},i=Object.keys(r);for(n=0;n<i.length;n++)e=i[n],t.indexOf(e)>=0||(o[e]=r[e]);return o}(r,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(n=0;n<i.length;n++)e=i[n],t.indexOf(e)>=0||Object.prototype.propertyIsEnumerable.call(r,e)&&(o[e]=r[e])}return o}function Yr(r,t){var e={numberFormats:[],baseStyles:[],styles:[],cellStyleXfs:!1,cellXfs:!1};return t(r,e,(function(r,t,e){if("numFmt"===r){var o=Number(t.numFmtId),i={id:o};o>=100&&(i.template=t.formatCode),e.numberFormats[o]=i}else if("cellStyleXfs"===r)e.cellStyleXfs=!0;else if("cellXfs"===r)e.cellXfs=!0;else if("xf"===r)if(e.cellStyleXfs)e.baseStyles.push(n(t));else if(e.cellXfs){var u=n(t,e.numberFormats);t.xfId&&(u.xfId=Number(t.xfId)),e.styles.push(u)}}),(function(r,t){"cellStyleXfs"===r?t.cellStyleXfs=!1:"cellXfs"===r&&(t.cellXfs=!1)}),null).then((function(){return function(r){return r.styles.map((function(t){if(t.xfId){var e=t.xfId,n=Kr(t,zr);return Wr(Wr({},r.baseStyles[e]),n)}return t}))}(e)}));function n(r,t){var e={};if(r.numFmtId){var n=Number(r.numFmtId);t&&t[n]?e.numberFormat=t[n]:e.numberFormat={id:n}}return e}}function Zr(r,t){var e={si:void 0,strings:[]};return t(r,e,(function(r,t,e){"si"===r?e.si={t:!1,r:!1,rPh:!1,string:""}:e.si&&function(r,t,e){"t"===r?e.t=!0:"r"===r?e.r=!0:"rPh"===r&&(e.rPh=!0)}(r,0,e.si)}),(function(r,t){"si"===r?(t.strings.push(t.si.string),t.si=void 0):t.si&&function(r,t){"t"===r?t.t=!1:"r"===r?t.r=!1:"rPh"===r&&(t.rPh=!1)}(r,t.si)}),(function(r,t){t.si&&function(r,t){t.rPh||t.t&&(t.r?t.string+=r:t.string=r)}(r,t.si)})).then((function(){return function(r){return r.strings}(e)}))}function Jr(r,t){t&&(r+=1462);return Math.floor(864e5*(r-25569))}var Qr=/;@$/,rt=/[^a-z0#\?%]+/;function tt(r,t,e){var n=e[r];return void 0===n?e[r]=function(r){r=r.toLowerCase(),r=r.replace(Qr,""),r=r.replace(/\\./g," ");var t=r.split(";");return t.some(e);function e(r){var t=(r=(r=(r=(r=r.replace(/"[^"]*"/g," ")).replace(/(\[?[smhd]{1,2}\]?)[\.\,]00?0?/g,"$1")).replace(/\[([smhd]{1,2})\]/g,"$1")).replace(/\[[^\]]*\]/g,"")).split(rt).filter((function(r){return r}));return 0!==t.length&&t.every((function(r){return et.indexOf(r)>=0}))}}(t):n}var et=["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"];var nt=[27,28,29,30,31,32,33,34,35,36,50,51,52,53,54,55,56,57,58],ot=[27,28,29,30,31,32,33,34,35,36,50,51,52,53,54,55,56,57,58],it=[14,15,16,17,18,19,20,21,22,45,46,47].concat(nt).concat(ot.filter((function(r){return nt.indexOf(r)<0}))).concat([71,72,73,74,75,76,77,78,79,80,81].filter((function(r){return nt.indexOf(r)<0})).filter((function(r){return ot.indexOf(r)<0})));function ut(r,t){return function(r){if(Array.isArray(r))return r}(r)||function(r,t){var e=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=e){var n,o,i,u,a=[],f=!0,c=!1;try{if(i=(e=e.call(r)).next,0===t){if(Object(e)!==e)return;f=!1}else for(;!(f=(n=i.call(e)).done)&&(a.push(n.value),a.length!==t);f=!0);}catch(r){c=!0,o=r}finally{try{if(!f&&null!=e.return&&(u=e.return(),Object(u)!==u))return}finally{if(c)throw o}}return a}}(r,t)||function(r,t){if(!r)return;if("string"==typeof r)return at(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);"Object"===e&&r.constructor&&(e=r.constructor.name);if("Map"===e||"Set"===e)return Array.from(r);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return at(r,t)}(r,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function at(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}var ft=[null,null];function ct(r,t,e,n,o){var i=ut(o,7),u=i[0],a=i[1],f=i[2],c=i[3],l=i[4],s=i[5],p=i[6];switch(r||"n"){case"str":return void 0===e?"VALUE_MISSING":e?["s",e]:ft;case"inlineStr":return void 0===n?"VALUE_MISSING":["s",n];case"s":if(!e)return"VALUE_MISSING";var b=Number(e);return isNaN(b)||void 0===u[b]?"VALUE_INVALID":["s",u[b]];case"b":return e?"1"===e?["b",!0]:"0"===e?["b",!1]:"VALUE_INVALID":"VALUE_MISSING";case"e":return e?["e",e]:"VALUE_MISSING";case"d":if(!e)return ft;var y=new Date(e);return isNaN(y.valueOf())?"VALUE_INVALID":["d",y.getTime()];case"n":if(!e)return ft;if(t){var d=Number(t);if(isNaN(d)||void 0===a[d])return"FORMAT_INVALID";if(function(r,t,e,n){return!!r.numberFormat&&!!(it.indexOf(r.numberFormat.id)>=0||t&&r.numberFormat.template===t||e&&r.numberFormat.template&&tt(r.numberFormat.id,r.numberFormat.template,n))}(a[d],l,s,c)){var m=Number(e);return isNaN(m)?"VALUE_INVALID":["d",Jr(m,f)]}}if(p)return["n",e];var v=Number(e);return isNaN(v)?"VALUE_INVALID":["n",v];default:return"TYPE_INVALID"}}function lt(r){for(var t=0,e=0;e<r.length;){var n=r.charCodeAt(e);if(n>=48&&n<=57){var o=Number(r.slice(e));return isNaN(o)&&st(r),[o,t]}t*=26,t+=r.charCodeAt(e)-64,e++}st(r)}function st(r){throw new Error('<c r="'.concat(r,'">'))}function pt(r,t){return function(r){if(Array.isArray(r))return r}(r)||function(r,t){var e=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=e){var n,o,i,u,a=[],f=!0,c=!1;try{if(i=(e=e.call(r)).next,0===t){if(Object(e)!==e)return;f=!1}else for(;!(f=(n=i.call(e)).done)&&(a.push(n.value),a.length!==t);f=!0);}catch(r){c=!0,o=r}finally{try{if(!f&&null!=e.return&&(u=e.return(),Object(u)!==u))return}finally{if(c)throw o}}return a}}(r,t)||bt(r,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bt(r,t){if(r){if("string"==typeof r)return yt(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);return"Object"===e&&r.constructor&&(e=r.constructor.name),"Map"===e||"Set"===e?Array.from(r):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?yt(r,t):void 0}}function yt(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}var dt=null;function mt(r,t,e){var n,o=e.sharedStrings,i=e.styles,u=e.epoch1904,a=e.dateFormatDetectionCache,f=e.options,c=[o,i,u,a,f.dateFormat,!1!==f.smartDateParser,f.parseNumber],l=[],p=[],b={dimension:void 0,sheetData:void 0};return t(r,b,(function(r,t,e){"dimension"===r?e.dimension=function(r){var t=r.split(":").map(lt);1===t.length&&(t=[t[0],t[0]]);return t}(t.ref):"sheetData"===r?e.sheetData={c:void 0,rows:[],row:void 0,rowNumber:void 0,rowIndexShift:0,cursor:[0,0],rowCount:0,columnCount:0,dataRowCount:0,dataColumnCount:0,errors:[]}:e.sheetData&&function(r,t,e){"row"===r?(t.r&&(e.rowNumber=Number(t.r)),e.row=[]):"c"===r?(e.c={v:!1,is:!1,t:!1,r:!1,rPh:!1,vText:void 0,inlineString:void 0,attributes:void 0},e.c.attributes=t):e.c&&function(r,t,e){"v"===r?e.v=!0:"is"===r?(e.is=!0,e.inlineString=""):"t"===r?e.t=!0:"r"===r?e.r=!0:"rPh"===r&&(e.rPh=!0)}(r,0,e.c)}(r,t,e.sheetData)}),(function(r,t){t.sheetData&&function(r,t){if("row"===r){if(t.rowNumber){var e=t.rowIndexShift+t.rows.length;if(t.rowNumber<=e)throw new s("Out-of-place <row/> number ".concat(t.rowNumber," follows <row/> number ").concat(e));for(;t.rowNumber>t.rowIndexShift+t.rows.length+1;)t.rows.push([])}t.rows.push(t.row),t.row.length>0&&(t.dataRowCount=t.rowNumber),t.rowNumber>t.rowCount&&(t.rowCount=t.rowNumber),t.row=void 0,t.rowNumber=void 0}else if("c"===r){var o=function(r){var t=r.attributes,e=r.inlineString,n=r.vText,o=pt(lt(t.r),2),i=o[0],u=o[1],a=function(r,t,e,n,o,i){var u=function(r,t,e,n,o){var i=ct(r,t,e,n,o);if("VALUE_MISSING"===i)switch(r||"n"){case"str":case"inlineStr":case"s":case"b":return ft}if("e"===r)return ft;return i}(r,t,e,n,o);if(Array.isArray(u)&&"s"===u[0]&&(i&&(u[1]=u[1].trim()),""===u[1]))return ft;return u}(t.t,t.s,n,e,c,!1!==f.trim);if("string"==typeof a)return{row:i,column:u,error:a};return{row:i,column:u,value:d(a[1],a[0])}}(t.c);if(o.row<t.cursor[0]||o.row===t.cursor[0]&&o.column<=t.cursor[1])throw new s("Out-of-place <c/> at row ".concat(o.row," col ").concat(o.column," follows <c/> at row ").concat(t.cursor[0]," col ").concat(t.cursor[1]));if(t.cursor[0]=o.row,t.cursor[1]=o.column,t.rowNumber||(t.rowNumber=o.row),o.error)n&&y(o),t.errors.push(o);else if(o.value!==dt){for(;o.column>t.row.length+1;)t.row.push(dt);t.row.push(o.value),o.column>t.dataColumnCount&&(t.dataColumnCount=o.column)}o.column>t.columnCount&&(t.columnCount=o.column),t.c=void 0}else t.c&&function(r,t){"v"===r?(t.v=!1,t.vText||(t.vText="")):"is"===r?t.is=!1:"t"===r?t.t=!1:"r"===r?t.r=!1:"rPh"===r&&(t.rPh=!1)}(r,t.c)}(r,t.sheetData)}),(function(r,t){t.sheetData&&function(r,t){t.c&&function(r,t){t.v?t.vText=r:t.is&&(t.rPh||t.t&&(t.r?t.inlineString+=r:t.inlineString=r))}(r,t.c)}(r,t.sheetData)}),(function(r){var t=function(r){return r.sheetData.rows}(b),e=function(r){return r.sheetData.errors}(b);if(r)l=l.concat(t),(p=p.concat(e)).length>0&&y(p[0]);else if(t.length>1){var n=t.slice(0,-1);l=l.concat(n),p=p.concat(e),function(r,t){r.sheetData.rowIndexShift+=r.sheetData.rows.length-t.length,r.sheetData.rows=t}(b,t.slice(-1)),function(r,t){r.sheetData.errors=t}(b,[])}})).then((function(){var r=b.sheetData,t=r.rowCount,e=r.columnCount,n=r.dataRowCount,o=r.dataColumnCount;if(n<t&&(l=l.slice(0,n)),o<e)for(var i=0;i<l.length;)l[i].length>o&&(l[i]=l[i].slice(0,o)),i++;for(var u,a=function(r,t){var e="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(e)return(e=e.call(r)).next.bind(e);if(Array.isArray(r)||(e=bt(r))||t&&r&&"number"==typeof r.length){e&&(r=e);var n=0;return function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(l);!(u=a()).done;)for(var f=u.value;f.length<o;)f.push(dt);return l}));function y(r){var t=r.row,e=r.column,n=r.error;throw new s("<c/> at row ".concat(t,", col ").concat(e,": ").concat(n))}function d(r,t){return"n"===t?f.parseNumber?f.parseNumber(r):r:"d"===t?new Date(r):r}}function vt(r){return"undefined"!=typeof TextDecoder?(new TextDecoder).decode(r):tr(r)}function ht(r){return ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ht(r)}function gt(r){return gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},gt(r)}function wt(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,(o=n.key,i=void 0,i=function(r,t){if("object"!==gt(r)||null===r)return r;var e=r[Symbol.toPrimitive];if(void 0!==e){var n=e.call(r,t||"default");if("object"!==gt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(r)}(o,"string"),"symbol"===gt(i)?i:String(i)),n)}var o,i}function Ot(r){var t=jt();return function(){var e,n=Et(r);if(t){var o=Et(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return function(r,t){if(t&&("object"===gt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(r){if(void 0===r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}(r)}(this,e)}}function St(r){var t="function"==typeof Map?new Map:void 0;return St=function(r){if(null===r||(e=r,-1===Function.toString.call(e).indexOf("[native code]")))return r;var e;if("function"!=typeof r)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(r))return t.get(r);t.set(r,n)}function n(){return xt(r,arguments,Et(this).constructor)}return n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Pt(n,r)},St(r)}function xt(r,t,e){return xt=jt()?Reflect.construct.bind():function(r,t,e){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(r,n));return e&&Pt(o,e.prototype),o},xt.apply(null,arguments)}function jt(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(r){return!1}}function Pt(r,t){return Pt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,t){return r.__proto__=t,r},Pt(r,t)}function Et(r){return Et=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Et(r)}var It=function(r){!function(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(t&&t.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),t&&Pt(r,t)}(i,r);var t,e,n,o=Ot(i);function i(r,t){var e;return function(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this,"Sheet not found: ".concat("number"==typeof r?r+". Sheet count: "+t.length:r+". Available sheets: "+t.join(", ")))).name="SheetNotFoundError",e.sheet=r,e.sheets=t,e}return t=i,e&&wt(t.prototype,e),n&&wt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(St(Error));function At(r){return At="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},At(r)}function Nt(r,t){var e="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(e)return(e=e.call(r)).next.bind(e);if(Array.isArray(r)||(e=function(r,t){if(!r)return;if("string"==typeof r)return kt(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);"Object"===e&&r.constructor&&(e=r.constructor.name);if("Map"===e||"Set"===e)return Array.from(r);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return kt(r,t)}(r))||t&&r&&"number"==typeof r.length){e&&(r=e);var n=0;return function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function kt(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function Tt(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),e.push.apply(e,n)}return e}function Ct(r){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?Tt(Object(e),!0).forEach((function(t){_t(r,t,e[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):Tt(Object(e)).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))}))}return r}function _t(r,t,e){return(t=function(r){var t=function(r,t){if("object"!==At(r)||null===r)return r;var e=r[Symbol.toPrimitive];if(void 0!==e){var n=e.call(r,t||"default");if("object"!==At(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(r)}(r,"string");return"symbol"===At(t)?t:String(t)}(t))in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}function Dt(r,t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=function(r){Ur("convert files to strings");for(var t={},e=0,n=Object.keys(r);e<n.length;e++){var o=n[e];t[o]=vt(r[o])}return t}(t);return Ur("parse spreadsheet info and file paths"),Ft({"xl/_rels/workbook.xml.rels":{name:"filePaths",parse:Br},"xl/workbook.xml":{name:"spreadsheetInfo",parse:qr}},n,r).then((function(t){var o=t.spreadsheetInfo,i=t.filePaths;return Ur('parse "shared strings" and "styles"'),Ft(function(r){var t;return _t(t={},r.sharedStrings||"xl/sharedStrings.xml",{name:"sharedStrings",parse:Zr,fallback:Promise.resolve([])}),_t(t,r.styles||"xl/styles.xml",{name:"styles",parse:Yr,fallback:{}}),t}(i),n,r).then((function(t){var u=t.sharedStrings,a=t.styles,f=e.sheets?e.sheets.map((function(r){return function(r,t){if("string"==typeof r)for(var e,n=Nt(t);!(e=n()).done;){var o=e.value;if(o.name===r)return o.relationId}else if(r<=t.length)return t[r-1].relationId;throw new It(r,t.map((function(r){return r.name})))}(r,o.sheets)})):o.sheets.map((function(r){return r.relationId}));Ur("parse sheet".concat(1===f.length?"":"s"," data"));return Ft(function(r,t,e){return Object.keys(r.sheets).filter((function(r){return t.includes(r)})).reduce((function(t,n){return Ct(Ct({},t),{},_t({},r.sheets[n],{name:n,parse:function(r,t){return mt(r,t,e)}}))}),{})}(i,f,{sharedStrings:u,styles:a,epoch1904:o.epoch1904,dateFormatDetectionCache:[],options:e}),n,r).then((function(r){return Ur("end"),f.map((function(t){return{sheet:Rt(t,o.sheets),data:r[t]}}))}))}))}))}function Rt(r,t){for(var e,n=Nt(t);!(e=n()).done;){var o=e.value;if(o.relationId===r)return o.name}throw new Error("Sheet relation ID not found: ".concat(r))}function Ft(r,t,e){for(var n,o,i={},u=0,a=Object.keys(r);u<a.length;u++)n=void 0,o=void 0,n=a[u],o=r[n],i[o.name]=void 0===t[n]?void 0===o.fallback?function(){throw new s('"'.concat(n,'" file not found inside the `.xlsx` file'))}():o.fallback:o.parse(t[n],e);for(var f=[],c=function(){var r,t=p[l];"object"===ht(r=i[t])&&"function"==typeof r.then&&f.push(i[t].then((function(r){i[t]=r})))},l=0,p=Object.keys(i);l<p.length;l++)c();return f.length>0?Promise.all(f).then((function(){return i})):i}return function(r,t){return Vr(r).then((function(r){return function(r,t,e,n){return n&&n.parseNumber||(n=Ct(Ct({},n),{},{parseNumber:null})),Dt(t,e,n)}(0,p,r,t)}))}})); //# sourceMappingURL=read-excel-file.min.js.map