sheetjs-clone/dist/xlsx.mini.min.js

11 lines
268 KiB
JavaScript
Raw Normal View History

/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
2023-06-23 09:48:47 +00:00
var XLSX={};function make_xlsx_lib(e){e.version="0.20.0";var r=1200,t=1252;var a;var n=[874,932,936,949,950,1250,1251,1252,1253,1254,1255,1256,1257,1258,1e4];var i={0:1252,1:65001,2:65001,77:1e4,128:932,129:949,130:1361,134:936,136:950,161:1253,162:1254,163:1258,177:1255,178:1256,186:1257,204:1251,222:874,238:1250,255:1252,69:6969};var s=function(e){if(n.indexOf(e)==-1)return;t=i[0]=e};function l(){s(1252)}var o=function(e){r=e;s(e)};function c(){o(1200);l()}function f(e){var r=[];for(var t=0,a=e.length;t<a;++t)r[t]=e.charCodeAt(t);return r}function u(e){var r=[];for(var t=0;t<e.length>>1;++t)r[t]=String.fromCharCode(e.charCodeAt(2*t)+(e.charCodeAt(2*t+1)<<8));return r.join("")}function h(e){var r=[];for(var t=0;t<e.length>>1;++t)r[t]=String.fromCharCode(e[2*t]+(e[2*t+1]<<8));return r.join("")}function d(e){var r=[];for(var t=0;t<e.length>>1;++t)r[t]=String.fromCharCode(e.charCodeAt(2*t+1)+(e.charCodeAt(2*t)<<8));return r.join("")}var p=function(e){var r=e.charCodeAt(0),t=e.charCodeAt(1);if(r==255&&t==254)return u(e.slice(2));if(r==254&&t==255)return d(e.slice(2));if(r==65279)return e.slice(1);return e};var m=function Oc(e){return String.fromCharCode(e)};var v=function Mc(e){return String.fromCharCode(e)};function g(e){a=e;o=function(e){r=e;s(e)};p=function(e){if(e.charCodeAt(0)===255&&e.charCodeAt(1)===254){return a.utils.decode(1200,f(e.slice(2)))}return e};m=function n(e){if(r===1200)return String.fromCharCode(e);return a.utils.decode(r,[e&255,e>>8])[0]};v=function i(e){return a.utils.decode(t,[e])[0]};la()}var b=null;var w=true;var k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function y(e){var r="";var t=0,a=0,n=0,i=0,s=0,l=0,o=0;for(var c=0;c<e.length;){t=e.charCodeAt(c++);i=t>>2;a=e.charCodeAt(c++);s=(t&3)<<4|a>>4;n=e.charCodeAt(c++);l=(a&15)<<2|n>>6;o=n&63;if(isNaN(a)){l=o=64}else if(isNaN(n)){o=64}r+=k.charAt(i)+k.charAt(s)+k.charAt(l)+k.charAt(o)}return r}function x(e){var r="";var t=0,a=0,n=0,i=0,s=0,l=0,o=0;for(var c=0;c<e.length;){t=e.charCodeAt(c++);if(t>255)t=95;i=t>>2;a=e.charCodeAt(c++);if(a>255)a=95;s=(t&3)<<4|a>>4;n=e.charCodeAt(c++);if(n>255)n=95;l=(a&15)<<2|n>>6;o=n&63;if(isNaN(a)){l=o=64}else if(isNaN(n)){o=64}r+=k.charAt(i)+k.charAt(s)+k.charAt(l)+k.charAt(o)}return r}function S(e){var r="";var t=0,a=0,n=0,i=0,s=0,l=0,o=0;for(var c=0;c<e.length;){t=e[c++];i=t>>2;a=e[c++];s=(t&3)<<4|a>>4;n=e[c++];l=(a&15)<<2|n>>6;o=n&63;if(isNaN(a)){l=o=64}else if(isNaN(n)){o=64}r+=k.charAt(i)+k.charAt(s)+k.charAt(l)+k.charAt(o)}return r}function C(e){var r="";var t=0,a=0,n=0,i=0,s=0,l=0,o=0;e=e.replace(/^data:([^\/]+\/[^\/]+)?;base64\,/,"").replace(/[^\w\+\/\=]/g,"");for(var c=0;c<e.length;){i=k.indexOf(e.charAt(c++));s=k.indexOf(e.charAt(c++));t=i<<2|s>>4;r+=String.fromCharCode(t);l=k.indexOf(e.charAt(c++));a=(s&15)<<4|l>>2;if(l!==64){r+=String.fromCharCode(a)}o=k.indexOf(e.charAt(c++));n=(l&3)<<6|o;if(o!==64){r+=String.fromCharCode(n)}}return r}var _=function(){return typeof Buffer!=="undefined"&&typeof undefined!=="undefined"&&typeof{}!=="undefined"&&!!{}.node}();var A=function(){if(typeof Buffer!=="undefined"){var e=!Buffer.from;if(!e)try{Buffer.from("foo","utf8")}catch(r){e=true}return e?function(e,r){return r?new Buffer(e,r):new Buffer(e)}:Buffer.from.bind(Buffer)}return function(){}}();var T=function(){if(typeof Buffer==="undefined")return false;var e=A([65,0]);if(!e)return false;var r=e.toString("utf16le");return r.length==1}();function E(e){if(_)return Buffer.alloc?Buffer.alloc(e):new Buffer(e);return typeof Uint8Array!="undefined"?new Uint8Array(e):new Array(e)}function F(e){if(_)return Buffer.allocUnsafe?Buffer.allocUnsafe(e):new Buffer(e);return typeof Uint8Array!="undefined"?new Uint8Array(e):new Array(e)}var D=function Nc(e){if(_)return A(e,"binary");return e.split("").map(function(e){return e.charCodeAt(0)&255})};function O(e){if(typeof ArrayBuffer==="undefined")return D(e);var r=new ArrayBuffer(e.length),t=new Uint8Array(r);for(var a=0;a!=e.length;++a)t[a]=e.charCodeAt(a)&255;return r}function M(e){if(Array.isArray(e))return e.map(function(e){return String.fromCharCode(e)}).
e=e&1?-306674912^e>>>1:e>>>1;e=e&1?-306674912^e>>>1:e>>>1;e=e&1?-306674912^e>>>1:e>>>1;e=e&1?-306674912^e>>>1:e>>>1;r[t]=e}return typeof Int32Array!=="undefined"?new Int32Array(r):r}var t=r();function a(e){var r=0,t=0,a=0,n=typeof Int32Array!=="undefined"?new Int32Array(4096):new Array(4096);for(a=0;a!=256;++a)n[a]=e[a];for(a=0;a!=256;++a){t=e[a];for(r=256+a;r<4096;r+=256)t=n[r]=t>>>8^e[t&255]}var i=[];for(a=1;a!=16;++a)i[a-1]=typeof Int32Array!=="undefined"&&typeof n.subarray=="function"?n.subarray(a*256,a*256+256):n.slice(a*256,a*256+256);return i}var n=a(t);var i=n[0],s=n[1],l=n[2],o=n[3],c=n[4];var f=n[5],u=n[6],h=n[7],d=n[8],p=n[9];var m=n[10],v=n[11],g=n[12],b=n[13],w=n[14];function k(e,r){var a=r^-1;for(var n=0,i=e.length;n<i;)a=a>>>8^t[(a^e.charCodeAt(n++))&255];return~a}function y(e,r){var a=r^-1,n=e.length-15,k=0;for(;k<n;)a=w[e[k++]^a&255]^b[e[k++]^a>>8&255]^g[e[k++]^a>>16&255]^v[e[k++]^a>>>24]^m[e[k++]]^p[e[k++]]^d[e[k++]]^h[e[k++]]^u[e[k++]]^f[e[k++]]^c[e[k++]]^o[e[k++]]^l[e[k++]]^s[e[k++]]^i[e[k++]]^t[e[k++]];n+=15;while(k<n)a=a>>>8^t[(a^e[k++])&255];return~a}function x(e,r){var a=r^-1;for(var n=0,i=e.length,s=0,l=0;n<i;){s=e.charCodeAt(n++);if(s<128){a=a>>>8^t[(a^s)&255]}else if(s<2048){a=a>>>8^t[(a^(192|s>>6&31))&255];a=a>>>8^t[(a^(128|s&63))&255]}else if(s>=55296&&s<57344){s=(s&1023)+64;l=e.charCodeAt(n++)&1023;a=a>>>8^t[(a^(240|s>>8&7))&255];a=a>>>8^t[(a^(128|s>>2&63))&255];a=a>>>8^t[(a^(128|l>>6&15|(s&3)<<4))&255];a=a>>>8^t[(a^(128|l&63))&255]}else{a=a>>>8^t[(a^(224|s>>12&15))&255];a=a>>>8^t[(a^(128|s>>6&63))&255];a=a>>>8^t[(a^(128|s&63))&255]}}return~a}e.table=t;e.bstr=k;e.buf=y;e.str=x;return e}();var qe=function Pc(){var e={};e.version="1.2.2";function r(e,r){var t=e.split("/"),a=r.split("/");for(var n=0,i=0,s=Math.min(t.length,a.length);n<s;++n){if(i=t[n].length-a[n].length)return i;if(t[n]!=a[n])return t[n]<a[n]?-1:1}return t.length-a.length}function t(e){if(e.charAt(e.length-1)=="/")return e.slice(0,-1).indexOf("/")===-1?e:t(e.slice(0,-1));var r=e.lastIndexOf("/");return r===-1?e:e.slice(0,r+1)}function a(e){if(e.charAt(e.length-1)=="/")return a(e.slice(0,-1));var r=e.lastIndexOf("/");return r===-1?e:e.slice(r+1)}function n(e,r){if(typeof r==="string")r=new Date(r);var t=r.getHours();t=t<<6|r.getMinutes();t=t<<5|r.getSeconds()>>>1;e._W(2,t);var a=r.getFullYear()-1980;a=a<<4|r.getMonth()+1;a=a<<5|r.getDate();e._W(2,a)}function i(e){var r=e._R(2)&65535;var t=e._R(2)&65535;var a=new Date;var n=t&31;t>>>=5;var i=t&15;t>>>=4;a.setMilliseconds(0);a.setFullYear(t+1980);a.setMonth(i-1);a.setDate(n);var s=r&31;r>>>=5;var l=r&63;r>>>=6;a.setHours(r);a.setMinutes(l);a.setSeconds(s<<1);return a}function s(e){ka(e,0);var r={};var t=0;while(e.l<=e.length-4){var a=e._R(2);var n=e._R(2),i=e.l+n;var s={};switch(a){case 21589:{t=e._R(1);if(t&1)s.mtime=e._R(4);if(n>5){if(t&2)s.atime=e._R(4);if(t&4)s.ctime=e._R(4)}if(s.mtime)s.mt=new Date(s.mtime*1e3)}break;case 1:{var l=e._R(4),o=e._R(4);s.usz=o*Math.pow(2,32)+l;l=e._R(4);o=e._R(4);s.csz=o*Math.pow(2,32)+l}break;}e.l=i;r[a]=s}return r}var l;function o(){return l||(l=Qe)}function c(e,r){if(e[0]==80&&e[1]==75)return Oe(e,r);if((e[0]|32)==109&&(e[1]|32)==105)return ze(e,r);if(e.length<512)throw new Error("CFB file size "+e.length+" < 512");var t=3;var a=512;var n=0;var i=0;var s=0;var l=0;var o=0;var c=[];var p=e.slice(0,512);ka(p,0);var v=f(p);t=v[0];switch(t){case 3:a=512;break;case 4:a=4096;break;case 0:if(v[1]==0)return Oe(e,r);default:throw new Error("Major Version: Expected 3 or 4 saw "+t);}if(a!==512){p=e.slice(0,a);ka(p,28)}var w=e.slice(0,a);u(p,t);var k=p._R(4,"i");if(t===3&&k!==0)throw new Error("# Directory Sectors: Expected 0 saw "+k);p.l+=4;s=p._R(4,"i");p.l+=4;p.chk("00100000","Mini Stream Cutoff Size: ");l=p._R(4,"i");n=p._R(4,"i");o=p._R(4,"i");i=p._R(4,"i");for(var y=-1,x=0;x<109;++x){y=p._R(4,"i");if(y<0)break;c[x]=y}var S=h(e,a);m(o,i,S,a,c);var C=g(S,s,c,a);if(s<C.length)C[s].name="!Directory";if(n>0&&l!==R)C[l].name="!MiniFAT";C[c[0]].name="!FAT";C.fat_addrs=c;C.ssz=a;var _={},A=[],T=[],E=[];b(s,C,S,A,n,_,T,l);d(T,E,A);A.shift();var F={FileIndex
for(var a=0;a!==t.length;++a){if(r[e[t[a]]]==null)r[e[t[a]]]=[];r[e[t[a]]].push(t[a])}return r}var cr=Date.UTC(1899,11,30,0,0,0);var fr=Date.UTC(1899,11,31,0,0,0);var ur=Date.UTC(1904,0,1,0,0,0);function hr(e,r){var t=e.getTime();var a=(t-cr)/(24*60*60*1e3);if(r){a-=1462;return a<-1402?a-1:a}return a<60?a-1:a}function dr(e){if(e>=60&&e<61)return e;var r=new Date;r.setTime((e>60?e:e+1)*24*60*60*1e3+cr);return r}function pr(e){var r=0,t=0,a=false;var n=e.match(/P([0-9\.]+Y)?([0-9\.]+M)?([0-9\.]+D)?T([0-9\.]+H)?([0-9\.]+M)?([0-9\.]+S)?/);if(!n)throw new Error("|"+e+"| is not an ISO8601 Duration");for(var i=1;i!=n.length;++i){if(!n[i])continue;t=1;if(i>3)a=true;switch(n[i].slice(n[i].length-1)){case"Y":throw new Error("Unsupported ISO Duration Field: "+n[i].slice(n[i].length-1));case"D":t*=24;case"H":t*=60;case"M":if(!a)throw new Error("Unsupported ISO Duration Field: M");else t*=60;case"S":break;}r+=t*parseInt(n[i],10)}return r}var mr=/^(\d+):(\d+)(:\d+)?(\.\d+)?$/;var vr=/^(\d+)-(\d+)-(\d+)$/;var gr=/^(\d+)-(\d+)-(\d+)[T ](\d+):(\d+)(:\d+)?(\.\d+)?$/;function br(e,r){if(e instanceof Date)return e;var t=e.match(mr);if(t)return new Date((r?ur:fr)+((parseInt(t[1],10)*60+parseInt(t[2],10))*60+(t[3]?parseInt(t[3].slice(1),10):0))*1e3+(t[4]?parseInt((t[4]+"000").slice(1,4),10):0));t=e.match(vr);if(t)return new Date(Date.UTC(+t[1],+t[2]-1,+t[3],0,0,0,0));t=e.match(gr);if(t)return new Date(Date.UTC(+t[1],+t[2]-1,+t[3],+t[4],+t[5],t[6]&&parseInt(t[6].slice(1),10)||0,t[7]&&parseInt(t[7].slice(1),10)||0));var a=new Date(e);return a}function wr(e,r){if(_&&Buffer.isBuffer(e)){if(r&&T){if(e[0]==255&&e[1]==254)return kt(e.slice(2).toString("utf16le"));if(e[1]==254&&e[2]==255)return kt(d(e.slice(2).toString("binary")))}return e.toString("binary")}if(typeof TextDecoder!=="undefined")try{if(r){if(e[0]==255&&e[1]==254)return kt(new TextDecoder("utf-16le").decode(e.slice(2)));if(e[0]==254&&e[1]==255)return kt(new TextDecoder("utf-16be").decode(e.slice(2)))}var t={"€":"€","":"‚","ƒ":"ƒ","„":"„","…":"…","†":"†","‡":"‡","ˆ":"ˆ","‰":"‰","Š":"Š","":"‹","Œ":"Œ","Ž":"Ž","":"‘","":"’","“":"“","”":"”","•":"•","":"–","—":"—","˜":"˜","™":"™","š":"š","":"›","œ":"œ","ž":"ž","Ÿ":"Ÿ"};if(Array.isArray(e))e=new Uint8Array(e);return new TextDecoder("latin1").decode(e).replace(/[€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ]/g,function(e){return t[e]||e})}catch(a){}var n=[],i=0;try{for(i=0;i<e.length-65536;i+=65536)n.push(String.fromCharCode.apply(0,e.slice(i,i+65536)));n.push(String.fromCharCode.apply(0,e.slice(i)))}catch(a){try{for(;i<e.length-16384;i+=16384)n.push(String.fromCharCode.apply(0,e.slice(i,i+16384)));n.push(String.fromCharCode.apply(0,e.slice(i)))}catch(a){for(;i!=e.length;++i)n.push(String.fromCharCode(e[i]))}}return n.join("")}function kr(e){if(typeof JSON!="undefined"&&!Array.isArray(e))return JSON.parse(JSON.stringify(e));if(typeof e!="object"||e==null)return e;if(e instanceof Date)return new Date(e.getTime());var r={};for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))r[t]=kr(e[t]);return r}function yr(e,r){var t="";while(t.length<r)t+=e;return t}function xr(e){var r=Number(e);if(!isNaN(r))return isFinite(r)?r:NaN;if(!/\d/.test(e))return r;var t=1;var a=e.replace(/([\d]),([\d])/g,"$1$2").replace(/[$]/g,"").replace(/[%]/g,function(){t*=100;return""});if(!isNaN(r=Number(a)))return r/t;a=a.replace(/[(](.*)[)]/,function(e,r){t=-t;return r});if(!isNaN(r=Number(a)))return r/t;return r}var Sr=/^(0?\d|1[0-2])(?:|:([0-5]?\d)(?:|(\.\d+)(?:|:([0-5]?\d))|:([0-5]?\d)(|\.\d+)))\s+([ap])m?$/;var Cr=/^([01]?\d|2[0-3])(?:|:([0-5]?\d)(?:|(\.\d+)(?:|:([0-5]?\d))|:([0-5]?\d)(|\.\d+)))$/;var _r=/^(\d+)-(\d+)-(\d+)[T ](\d+):(\d+)(:\d+)(\.\d+)?[Z]?$/;var Ar=new Date("6/9/69 00:00 UTC").valueOf()==-177984e5;function Tr(e){if(!e[2])return new Date(Date.UTC(1899,11,31,+e[1]%12+(e[7]=="p"?12:0),0,0,0));if(e[3]){if(e[4])return new Date(Date.UTC(1899,11,31,+e[1]%12+(e[7]=="p"?12:0),+e[2],+e[4],parseFloat(e[3])*1e3));else return new Date(Date.UTC(1899,11,31,e
function mn(e){return e.map(function(e){return[e>>16&255,e>>8&255,e&255]})}var vn=mn([0,16777215,16711680,65280,255,16776960,16711935,65535,0,16777215,16711680,65280,255,16776960,16711935,65535,8388608,32768,128,8421376,8388736,32896,12632256,8421504,10066431,10040166,16777164,13434879,6684774,16744576,26316,13421823,128,16711935,16776960,65535,8388736,8388608,32896,255,52479,13434879,13434828,16777113,10079487,16751052,13408767,16764057,3368703,3394764,10079232,16763904,16750848,16737792,6710937,9868950,13158,3381606,13056,3355392,10040064,10040166,3355545,3355443,0,16777215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);var gn=kr(vn);var bn={0:"#NULL!",7:"#DIV/0!",15:"#VALUE!",23:"#REF!",29:"#NAME?",36:"#NUM!",42:"#N/A",43:"#GETTING_DATA",255:"#WTF?"};var wn={"#NULL!":0,"#DIV/0!":7,"#VALUE!":15,"#REF!":23,"#NAME?":29,"#NUM!":36,"#N/A":42,"#GETTING_DATA":43,"#WTF?":255};var kn=["_xlnm.Consolidate_Area","_xlnm.Auto_Open","_xlnm.Auto_Close","_xlnm.Extract","_xlnm.Database","_xlnm.Criteria","_xlnm.Print_Area","_xlnm.Print_Titles","_xlnm.Recorder","_xlnm.Data_Form","_xlnm.Auto_Activate","_xlnm.Auto_Deactivate","_xlnm.Sheet_Title","_xlnm._FilterDatabase"];var yn={"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":"workbooks","application/vnd.ms-excel.sheet.macroEnabled.main+xml":"workbooks","application/vnd.ms-excel.sheet.binary.macroEnabled.main":"workbooks","application/vnd.ms-excel.addin.macroEnabled.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":"sheets","application/vnd.ms-excel.worksheet":"sheets","application/vnd.ms-excel.binIndexWs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":"charts","application/vnd.ms-excel.chartsheet":"charts","application/vnd.ms-excel.macrosheet+xml":"macros","application/vnd.ms-excel.macrosheet":"macros","application/vnd.ms-excel.intlmacrosheet":"TODO","application/vnd.ms-excel.binIndexMs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":"dialogs","application/vnd.ms-excel.dialogsheet":"dialogs","application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml":"strs","application/vnd.ms-excel.sharedStrings":"strs","application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":"styles","application/vnd.ms-excel.styles":"styles","application/vnd.openxmlformats-package.core-properties+xml":"coreprops","application/vnd.openxmlformats-officedocument.custom-properties+xml":"custprops","application/vnd.openxmlformats-officedocument.extended-properties+xml":"extprops","application/vnd.openxmlformats-officedocument.customXmlProperties+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":"comments","application/vnd.ms-excel.comments":"comments","application/vnd.ms-excel.threadedcomments+xml":"threadedcomments","application/vnd.ms-excel.person+xml":"people","application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml":"metadata","application/vnd.ms-excel.sheetMetadata":"metadata","application/vnd.ms-excel.pivotTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.chart+xml":"TODO","application/vnd.ms-office.chartcolorstyle+xml":"TODO","application/vnd.ms-office.chartstyle+xml":"TODO","application/vnd.ms-office.chartex+xml":"TODO","application/vnd.ms-excel.calcChain":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings":"TODO","application/vnd.ms-office.activeX":"TODO","application/vnd.ms-office.activeX+xml":"TODO","application/vnd.ms-excel.attachedToolbars":"TODO","application/vnd.ms-excel.connections":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":"TODO","app
P="n";if(p!==null&&Pe(p)&&i.cellDates){_=dr(y.Workbook.WBProps.date1904?_+1462:_);P=typeof _=="number"?"n":"d"}}if(typeof a!=="undefined"&&typeof _=="string"&&(i||{}).type!="string"&&(i||{}).codepage)_=a.utils.decode(i.codepage,_);E=true;break;case"E":O=true;I=Fs(S[u].slice(1),{r:l,c:c});break;case"S":D=true;break;case"G":break;case"R":M=parseInt(S[u].slice(1),10)-1;break;case"C":N=parseInt(S[u].slice(1),10)-1;break;default:if(i&&i.WTF)throw new Error("SYLK bad record "+x);}if(E){if(!h[l][c])h[l][c]={t:P,v:_};else{h[l][c].t=P;h[l][c].v=_}if(p)h[l][c].z=p;if(i.cellText!==false&&p)h[l][c].w=ze(h[l][c].z,h[l][c].v,{date1904:y.Workbook.WBProps.date1904});p=null}if(D){if(O)throw new Error("SYLK shared formula cannot have own formula");var L=M>-1&&h[M][N];if(!L||!L[1])throw new Error("SYLK shared formula cannot find base");I=Ms(L[1],{r:l-M,c:c-N})}if(I){if(!h[l][c])h[l][c]={t:"n",f:I};else h[l][c].f=I}if(R){if(!h[l][c])h[l][c]={t:"z"};h[l][c].c=[{a:"SheetJSYLK",t:R}]}break;case"F":var B=0;for(u=1;u<S.length;++u)switch(S[u].charAt(0)){case"X":c=parseInt(S[u].slice(1),10)-1;++B;break;case"Y":l=parseInt(S[u].slice(1),10)-1;for(k=h.length;k<=l;++k)h[k]=[];break;case"M":w=parseInt(S[u].slice(1),10)/20;break;case"F":break;case"G":break;case"P":p=d[parseInt(S[u].slice(1),10)];break;case"S":break;case"D":break;case"N":break;case"W":b=S[u].slice(1).split(" ");for(k=parseInt(b[0],10);k<=parseInt(b[1],10);++k){w=parseInt(b[2],10);g[k-1]=w===0?{hidden:true}:{wch:w}}break;case"C":c=parseInt(S[u].slice(1),10)-1;if(!g[c])g[c]={};break;case"R":l=parseInt(S[u].slice(1),10)-1;if(!v[l])v[l]={};if(w>0){v[l].hpt=w;v[l].hpx=Pi(w)}else if(w===0)v[l].hidden=true;break;default:if(i&&i.WTF)throw new Error("SYLK bad record "+x);}if(B<1)p=null;break;default:if(i&&i.WTF)throw new Error("SYLK bad record "+x);}}if(v.length>0)m["!rows"]=v;if(g.length>0)m["!cols"]=g;g.forEach(function(e){Oi(e)});if(i&&i.sheetRows)h=h.slice(0,i.sheetRows);return[h,m,y]}function c(e,r){var t=s(e,r);var a=t[0],n=t[1],i=t[2];var l=kr(r);l.date1904=(((i||{}).Workbook||{}).WBProps||{}).date1904;var o=Ka(a,l);nr(n).forEach(function(e){o[e]=n[e]});var c=Ya(o,r);nr(i).forEach(function(e){c[e]=i[e]});c.bookType="sylk";return c}function f(e,r,t,a,n,i){var s="C;Y"+(t+1)+";X"+(a+1)+";K";switch(e.t){case"n":s+=e.v||0;if(e.f&&!e.F)s+=";E"+Os(e.f,{r:t,c:a});break;case"b":s+=e.v?"TRUE":"FALSE";break;case"e":s+=e.w||e.v;break;case"d":s+=hr(br(e.v,i),i);break;case"s":s+='"'+(e.v==null?"":String(e.v)).replace(/"/g,"").replace(/;/g,";;")+'"';break;}return s}function u(e,r,t){var a="C;Y"+(r+1)+";X"+(t+1)+";A";a+=i(e.map(function(e){return e.t}).join(""));return a}function h(e,r){r.forEach(function(r,t){var a="F;W"+(t+1)+" "+(t+1)+" ";if(r.hidden)a+="0";else{if(typeof r.width=="number"&&!r.wpx)r.wpx=Ai(r.width);if(typeof r.wpx=="number"&&!r.wch)r.wch=Ti(r.wpx);if(typeof r.wch=="number")a+=Math.round(r.wch)}if(a.charAt(a.length-1)!=" ")e.push(a)})}function d(e,r){r.forEach(function(r,t){var a="F;";if(r.hidden)a+="M0;";else if(r.hpt)a+="M"+20*r.hpt+";";else if(r.hpx)a+="M"+20*Ii(r.hpx)+";";if(a.length>2)e.push(a+"R"+(t+1))})}function p(e,r,t){if(!r)r={};r._formats=["General"];var a=["ID;PSheetJS;N;E"],n=[];var i=Va(e["!ref"]),s;var l=e["!data"]!=null;var o="\r\n";var c=(((t||{}).Workbook||{}).WBProps||{}).date1904;var p="General";a.push("P;PGeneral");var m=i.s.r,v=i.s.c,g=[];for(m=i.s.r;m<=i.e.r;++m){if(l&&!e["!data"][m])continue;g=[];for(v=i.s.c;v<=i.e.c;++v){s=l?e["!data"][m][v]:e[Pa(v)+Oa(m)];if(!s||!s.c)continue;g.push(u(s.c,m,v))}if(g.length)n.push(g.join(o))}for(m=i.s.r;m<=i.e.r;++m){if(l&&!e["!data"][m])continue;g=[];for(v=i.s.c;v<=i.e.c;++v){s=l?e["!data"][m][v]:e[Pa(v)+Oa(m)];if(!s||s.v==null&&(!s.f||s.F))continue;if((s.z||(s.t=="d"?q[14]:"General"))!=p){var b=r._formats.indexOf(s.z);if(b==-1){r._formats.push(s.z);b=r._formats.length-1;a.push("P;P"+s.z.replace(/;/g,";;"))}g.push("F;P"+b+";Y"+(m+1)+";X"+(v+1))}g.push(f(s,e,m,v,r,c))}n.push(g.join(o))}a.push("F;P0;DG0G8;M255");if(e["!cols"])h(a,e["!cols"]);if(e["!rows"])d(a,e["!rows"]);a.push("B;Y"+(i.e.r-i.s.r+1)+";X"+(i.e.c-i.s.c+1)+";D"+[i
t[t.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>';t[t.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>';t[t.length]='<a:font script="Thaa" typeface="MV Boli"/>';t[t.length]='<a:font script="Deva" typeface="Mangal"/>';t[t.length]='<a:font script="Telu" typeface="Gautami"/>';t[t.length]='<a:font script="Taml" typeface="Latha"/>';t[t.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>';t[t.length]='<a:font script="Orya" typeface="Kalinga"/>';t[t.length]='<a:font script="Mlym" typeface="Kartika"/>';t[t.length]='<a:font script="Laoo" typeface="DokChampa"/>';t[t.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>';t[t.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>';t[t.length]='<a:font script="Viet" typeface="Times New Roman"/>';t[t.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>';t[t.length]='<a:font script="Geor" typeface="Sylfaen"/>';t[t.length]="</a:majorFont>";t[t.length]="<a:minorFont>";t[t.length]='<a:latin typeface="Calibri"/>';t[t.length]='<a:ea typeface=""/>';t[t.length]='<a:cs typeface=""/>';t[t.length]='<a:font script="Jpan" typeface=" Pゴシック"/>';t[t.length]='<a:font script="Hang" typeface="맑은 고딕"/>';t[t.length]='<a:font script="Hans" typeface="宋体"/>';t[t.length]='<a:font script="Hant" typeface="新細明體"/>';t[t.length]='<a:font script="Arab" typeface="Arial"/>';t[t.length]='<a:font script="Hebr" typeface="Arial"/>';t[t.length]='<a:font script="Thai" typeface="Tahoma"/>';t[t.length]='<a:font script="Ethi" typeface="Nyala"/>';t[t.length]='<a:font script="Beng" typeface="Vrinda"/>';t[t.length]='<a:font script="Gujr" typeface="Shruti"/>';t[t.length]='<a:font script="Khmr" typeface="DaunPenh"/>';t[t.length]='<a:font script="Knda" typeface="Tunga"/>';t[t.length]='<a:font script="Guru" typeface="Raavi"/>';t[t.length]='<a:font script="Cans" typeface="Euphemia"/>';t[t.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>';t[t.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>';t[t.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>';t[t.length]='<a:font script="Thaa" typeface="MV Boli"/>';t[t.length]='<a:font script="Deva" typeface="Mangal"/>';t[t.length]='<a:font script="Telu" typeface="Gautami"/>';t[t.length]='<a:font script="Taml" typeface="Latha"/>';t[t.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>';t[t.length]='<a:font script="Orya" typeface="Kalinga"/>';t[t.length]='<a:font script="Mlym" typeface="Kartika"/>';t[t.length]='<a:font script="Laoo" typeface="DokChampa"/>';t[t.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>';t[t.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>';t[t.length]='<a:font script="Viet" typeface="Arial"/>';t[t.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>';t[t.length]='<a:font script="Geor" typeface="Sylfaen"/>';t[t.length]="</a:minorFont>";t[t.length]="</a:fontScheme>";t[t.length]='<a:fmtScheme name="Office">';t[t.length]="<a:fillStyleLst>";t[t.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>';t[t.length]='<a:gradFill rotWithShape="1">';t[t.length]="<a:gsLst>";t[t.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs>';t[t.length]='<a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs>';t[t.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs>';t[t.length]="</a:gsLst>";t[t.length]='<a:lin ang="16200000" scaled="1"/>';t[t.length]="</a:gradFill>";t[t.length]='<a:gradFill rotWithShape="1">';t[t.length]="<a:gsLst>";t[t.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="100000"/><a:shade val="100000"/><a:satMod val="130000"/></a:schemeClr></a:gs>';t[t.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="50000"/><a:shade val="100000"/><a:satMod val="350000"/></a:schemeClr></a:gs>';t[t.length]="</a:gsLst>";t[t.length]='<a:lin ang="16200000" scaled="0"/>';t[t.length]="</a:gradFill>";t[t.length]="</a:fill
if(b[1]==""){if(b[0].indexOf('t="shared"')>-1){E=et(b[0]);if(I[E.si])S.f=Ns(I[E.si][1],I[E.si][2],C.r)}}else{S.f=nt(wt(b[1]),true);if(!f.xlfn)S.f=Ps(S.f);if(b[0].indexOf('t="array"')>-1){S.F=(x.match(n)||[])[1];if(S.F.indexOf(":")>-1)N.push([Va(S.F),S.F])}else if(b[0].indexOf('t="shared"')>-1){E=et(b[0]);var G=nt(wt(b[1]));if(!f.xlfn)G=Ps(G);I[parseInt(E.si,10)]=[E,G,C.r]}}}else if(b=x.match(/<f[^>]*\/>/)){E=et(b[0]);if(I[E.si])S.f=Ns(I[E.si][1],I[E.si][2],C.r)}var Y=Ua(C.r);for(k=0;k<N.length;++k)if(Y.r>=N[k][0].s.r&&Y.r<=N[k][0].e.r)if(Y.c>=N[k][0].s.c&&Y.c<=N[k][0].e.c)S.F=N[k][1]}if(C.t==null&&S.v===undefined){if(S.f||S.F){S.v=0;S.t="n"}else if(!U)continue;else S.t="z"}else S.t=C.t||"n";if(u.s.c>A)u.s.c=A;if(u.e.c<A)u.e.c=A;switch(S.t){case"n":if(S.v==""||S.v==null){if(!U)continue;S.t="z"}else S.v=parseFloat(S.v);break;case"s":if(typeof S.v=="undefined"){if(!U)continue;S.t="z"}else{T=zs[parseInt(S.v,10)];S.v=T.t;S.r=T.r;if(f.cellHTML)S.h=T.h}break;case"str":S.t="s";S.v=S.v!=null?nt(wt(S.v),true):"";if(f.cellHTML)S.h=ft(S.v);break;case"inlineStr":b=x.match(a);S.t="s";if(b!=null&&(T=fi(b[1]))){S.v=T.t;if(f.cellHTML)S.h=T.h}else S.v="";break;case"b":S.v=pt(S.v);break;case"d":if(f.cellDates)S.v=br(S.v,z);else{S.v=hr(br(S.v,z),z);S.t="n"}break;case"e":if(!f||f.cellText!==false)S.w=S.v;S.v=wn[S.v];break;}F=D=0;M=null;if(O&&C.s!==undefined){M=d.CellXf[C.s];if(M!=null){if(M.numFmtId!=null)F=M.numFmtId;if(f.cellStyles){if(M.fillId!=null)D=M.fillId}}}Gs(S,F,D,f,h,d,z);if(f.cellDates&&O&&S.t=="n"&&Pe(q[F])){S.v=dr(S.v+(z?1462:0));S.t=typeof S.v=="number"?"n":"d"}if(C.cm&&f.xlmeta){var J=(f.xlmeta.Cell||[])[+C.cm-1];if(J&&J.type=="XLDAPR")S.D=true}var K;if(f.nodim){K=Ua(C.r);if(u.s.r>K.r)u.s.r=K.r;if(u.e.r<K.r)u.e.r=K.r}if(P){K=Ua(C.r);if(!c["!data"][K.r])c["!data"][K.r]=[];c["!data"][K.r][K.c]=S}else c[C.r]=S}}if(R.length>0)c["!rows"]=R}}();function Al(e,r,t,a){var n=[],i=[],s=Va(e["!ref"]),l="",o,c="",f=[],u=0,h=0,d=e["!rows"];var p=e["!data"]!=null;var m={r:c},v,g=-1;var b=(((a||{}).Workbook||{}).WBProps||{}).date1904;for(h=s.s.c;h<=s.e.c;++h)f[h]=Pa(h);for(u=s.s.r;u<=s.e.r;++u){i=[];c=Oa(u);for(h=s.s.c;h<=s.e.c;++h){o=f[h]+c;var w=p?(e["!data"][u]||[])[h]:e[o];if(w===undefined)continue;if((l=Cl(w,o,e,r,t,a,b))!=null)i.push(l)}if(i.length>0||d&&d[u]){m={r:c};if(d&&d[u]){v=d[u];if(v.hidden)m.hidden=1;g=-1;if(v.hpx)g=Ii(v.hpx);else if(v.hpt)g=v.hpt;if(g>-1){m.ht=g;m.customHeight=1}if(v.level){m.outlineLevel=v.level}}n[n.length]=Dt("row",i.join(""),m)}}if(d)for(;u<d.length;++u){if(d&&d[u]){m={r:u+1};v=d[u];if(v.hidden)m.hidden=1;g=-1;if(v.hpx)g=Ii(v.hpx);else if(v.hpt)g=v.hpt;if(g>-1){m.ht=g;m.customHeight=1}if(v.level){m.outlineLevel=v.level}n[n.length]=Dt("row","",m)}}return n.join("")}function Tl(e,r,t,a){var n=[Gr,Dt("worksheet",null,{xmlns:Rt[0],"xmlns:r":Pt.r})];var i=t.SheetNames[e],s=0,l="";var o=t.Sheets[i];if(o==null)o={};var c=o["!ref"]||"A1";var f=Va(c);if(f.e.c>16383||f.e.r>1048575){if(r.WTF)throw new Error("Range "+c+" exceeds format limit A1:XFD1048576");f.e.c=Math.min(f.e.c,16383);f.e.r=Math.min(f.e.c,1048575);c=Wa(f)}if(!a)a={};o["!comments"]=[];var u=[];fl(o,t,e,r,n);n[n.length]=Dt("dimension",null,{ref:c});n[n.length]=Sl(o,r,e,t);if(r.sheetFormat)n[n.length]=Dt("sheetFormatPr",null,{defaultRowHeight:r.sheetFormat.defaultRowHeight||"16",baseColWidth:r.sheetFormat.baseColWidth||"10",outlineLevelRow:r.sheetFormat.outlineLevelRow||"7"});if(o["!cols"]!=null&&o["!cols"].length>0)n[n.length]=bl(o,o["!cols"]);n[s=n.length]="<sheetData/>";o["!links"]=[];if(o["!ref"]!=null){l=Al(o,r,e,t,a);if(l.length>0)n[n.length]=l}if(n.length>s+1){n[n.length]="</sheetData>";n[s]=n[s].replace("/>",">")}if(o["!protect"])n[n.length]=dl(o["!protect"]);if(o["!autofilter"]!=null)n[n.length]=kl(o["!autofilter"],o,t,e);if(o["!merges"]!=null&&o["!merges"].length>0)n[n.length]=ll(o["!merges"]);var h=-1,d,p=-1;if(o["!links"].length>0){n[n.length]="<hyperlinks>";o["!links"].forEach(function(e){if(!e[1].Target)return;d={ref:e[0]};if(e[1].Target.charAt(0)!="#"){p=Dn(a,-1,lt(e[1].Target).replace(/#.*$/,""),An.HLINK);d["r:id"]="rId"+p}if((h=e[1].Ta
case"number-style":;case"date-style":;case"time-style":c+=n.slice(f,v.index);break;}else f=v.index+v[0].length;break;case"named-range":l=et(v[0],false);j=Bs(l["cell-range-address"]);var te={Name:l.name,Ref:j[0]+"!"+j[1]};if(J)te.Sheet=p.length;$.Names.push(te);break;case"text-content":break;case"text-properties":break;case"embedded-text":break;case"body":;case"电子表格":break;case"forms":break;case"table-column":break;case"table-header-rows":break;case"table-rows":break;case"table-column-group":break;case"table-header-columns":break;case"table-columns":break;case"null-date":l=et(v[0],false);switch(l["date-value"]){case"1904-01-01":$.WBProps.date1904=true;break;}break;case"graphic-properties":break;case"calculation-settings":break;case"named-expressions":break;case"label-range":break;case"label-ranges":break;case"named-expression":break;case"sort":break;case"sort-by":break;case"sort-groups":break;case"tab":break;case"line-break":break;case"span":break;case"p":;case"文本串":if(["master-styles"].indexOf(i[i.length-1][0])>-1)break;if(v[1]==="/"&&(!w||!w["string-value"])){var ae=vo(n.slice(y,v.index),x);k=(k.length>0?k+"\n":"")+ae[0]}else if(v[0].slice(-2)=="/>"){k+="\n"}else{x=et(v[0],false);y=v.index+v[0].length}break;case"s":break;case"database-range":if(v[1]==="/")break;try{j=Bs(et(v[0])["target-range-address"]);d[j[0]]["!autofilter"]={ref:j[1]}}catch(ne){}break;case"date":break;case"object":break;case"title":;case"标题":break;case"desc":break;case"binary-data":break;case"table-source":break;case"scenario":break;case"iteration":break;case"content-validations":break;case"content-validation":break;case"help-message":break;case"error-message":break;case"database-ranges":break;case"filter":break;case"filter-and":break;case"filter-or":break;case"filter-condition":break;case"list-level-style-bullet":break;case"list-level-style-number":break;case"list-level-properties":break;case"sender-firstname":;case"sender-lastname":;case"sender-initials":;case"sender-title":;case"sender-position":;case"sender-email":;case"sender-phone-private":;case"sender-fax":;case"sender-company":;case"sender-phone-work":;case"sender-street":;case"sender-city":;case"sender-postal-code":;case"sender-country":;case"sender-state-or-province":;case"author-name":;case"author-initials":;case"chapter":;case"file-name":;case"template-name":;case"sheet-name":break;case"event-listener":break;case"initial-creator":;case"creation-date":;case"print-date":;case"generator":;case"document-statistic":;case"user-defined":;case"editing-duration":;case"editing-cycles":break;case"config-item":break;case"page-number":break;case"page-count":break;case"time":break;case"cell-range-source":break;case"detective":break;case"operation":break;case"highlighted-range":break;case"data-pilot-table":;case"source-cell-range":;case"source-service":;case"data-pilot-field":;case"data-pilot-level":;case"data-pilot-subtotals":;case"data-pilot-subtotal":;case"data-pilot-members":;case"data-pilot-member":;case"data-pilot-display-info":;case"data-pilot-sort-info":;case"data-pilot-layout-info":;case"data-pilot-field-reference":;case"data-pilot-groups":;case"data-pilot-group":;case"data-pilot-group-member":break;case"rect":break;case"dde-connection-decls":;case"dde-connection-decl":;case"dde-link":;case"dde-source":break;case"properties":break;case"property":break;case"a":if(v[1]!=="/"){W=et(v[0],false);if(!W.href)break;W.Target=nt(W.href);delete W.href;if(W.Target.charAt(0)=="#"&&W.Target.indexOf(".")>-1){j=Bs(W.Target.slice(1));W.Target="#"+j[0]+"!"+j[1]}else if(W.Target.match(/^\.\.[\\\/]/))W.Target=W.Target.slice(3)}break;case"table-protection":break;case"data-pilot-grand-total":break;case"office-document-common-attrs":break;default:switch(v[2]){case"dc:":;case"calcext:":;case"loext:":;case"ooo:":;case"chartooo:":;case"draw:":;case"style:":;case"chart:":;case"form:":;case"uof:":;case"表:":;case"字:":break;default:if(a.WTF)throw new Error(v);};}var ie={Sheets:d,SheetNames:p,Workbook:$};if(a.bookSheets)delete ie.Sheets;return ie}function wo(e,r){r=r||{};if(Lr(e,"META-INF/manifest.xml")
n.threadedcomments.push(v);Dn(u,-1,"../threadedComments/threadedComment"+l+".xml",An.TCMNT)}v="xl/comments"+l+"."+t;jr(i,v,vs(p,r));n.comments.push(v);Dn(u,-1,"../comments"+l+"."+t,An.CMNT);m=true}if(h["!legacy"]){if(m)jr(i,"xl/drawings/vmlDrawing"+l+".vml",hs(l,h["!comments"]))}delete h["!comments"];delete h["!legacy"]}if(u["!id"].rId1)jr(i,Tn(s),Fn(u))}if(r.Strings!=null&&r.Strings.length>0){s="xl/sharedStrings."+t;jr(i,s,vi(r.Strings,r));n.strs.push(s);Dn(r.wbrels,-1,"sharedStrings."+t,An.SST)}s="xl/workbook."+t;jr(i,s,Vl(e,r));n.workbooks.push(s);Dn(r.rels,1,s,An.WB);s="xl/theme/theme1.xml";jr(i,s,ns(e.Themes,r));n.themes.push(s);Dn(r.wbrels,-1,"theme/theme1.xml",An.THEME);s="xl/styles."+t;jr(i,s,Gi(e,r));n.styles.push(s);Dn(r.wbrels,-1,"styles."+t,An.STY);if(e.vbaraw&&a){s="xl/vbaProject.bin";jr(i,s,e.vbaraw);n.vba.push(s);Dn(r.wbrels,-1,"vbaProject.bin",An.VBA)}s="xl/metadata."+t;jr(i,s,ss());n.metadata.push(s);Dn(r.wbrels,-1,"metadata."+t,An.XLMETA);if(f.length>1){s="xl/persons/person.xml";jr(i,s,ks(f,r));n.people.push(s);Dn(r.wbrels,-1,"persons/person.xml",An.PEOPLE)}jr(i,"[Content_Types].xml",_n(n,r));jr(i,"_rels/.rels",Fn(r.rels));jr(i,"xl/_rels/workbook."+t+".rels",Fn(r.wbrels));delete r.revssf;delete r.ssf;return i}function Bo(e,r){var t="";switch((r||{}).type||"base64"){case"buffer":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];case"base64":t=C(e.slice(0,12));break;case"binary":t=e;break;case"array":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];default:throw new Error("Unrecognized type "+(r&&r.type||"undefined"));}return[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3),t.charCodeAt(4),t.charCodeAt(5),t.charCodeAt(6),t.charCodeAt(7)]}function Uo(e,r){if(qe.find(e,"EncryptedPackage"))return Po(e,r);return parse_xlscfb(e,r)}function zo(e,r){var t,a=e;var n=r||{};if(!n.type)n.type=_&&Buffer.isBuffer(e)?"buffer":"base64";t=Vr(a,n);return Io(t,n)}function $o(e,r){var t=0;e:while(t<e.length)switch(e.charCodeAt(t)){case 10:;case 13:;case 32:++t;break;case 60:return parse_xlml(e.slice(t),r);default:break e;}return ti.to_workbook(e,r)}function Wo(e,r){var t="",a=Bo(e,r);switch(r.type){case"base64":t=C(e);break;case"binary":t=e;break;case"buffer":t=e.toString("binary");break;case"array":t=wr(e);break;default:throw new Error("Unrecognized type "+r.type);}if(a[0]==239&&a[1]==187&&a[2]==191)t=wt(t);r.type="binary";return $o(t,r)}function jo(e,r){var t=e;if(r.type=="base64")t=C(t);if(typeof ArrayBuffer!=="undefined"&&e instanceof ArrayBuffer)t=new Uint8Array(e);t=typeof a!=="undefined"?a.utils.decode(1200,t.slice(2),"str"):_&&Buffer.isBuffer(e)?e.slice(2).toString("utf16le"):typeof Uint8Array!=="undefined"&&t instanceof Uint8Array?typeof TextDecoder!=="undefined"?new TextDecoder("utf-16le").decode(t.slice(2)):h(t.slice(2)):u(t.slice(2));r.type="binary";return $o(t,r)}function Ho(e){return!e.match(/[^\x00-\x7F]/)?e:kt(e)}function Vo(e,r,t,a){if(a){t.type="string";return ti.to_workbook(e,t)}return ti.to_workbook(r,t)}function Xo(e,r){c();var t=r||{};if(t.codepage&&typeof a==="undefined")console.error("Codepage tables are not loaded. Non-ASCII characters may not give expected results");if(typeof ArrayBuffer!=="undefined"&&e instanceof ArrayBuffer)return Xo(new Uint8Array(e),(t=kr(t),t.type="array",t));if(typeof Uint8Array!=="undefined"&&e instanceof Uint8Array&&!t.type)t.type=typeof Deno!=="undefined"?"buffer":"array";var n=e,i=[0,0,0,0],s=false;if(t.cellStyles){t.cellNF=true;t.sheetStubs=true}$s={};if(t.dateNF)$s.dateNF=t.dateNF;if(!t.type)t.type=_&&Buffer.isBuffer(e)?"buffer":"base64";if(t.type=="file"){t.type=_?"buffer":"binary";n=ar(e);if(typeof Uint8Array!=="undefined"&&!_)t.type="array"}if(t.type=="string"){s=true;t.type="binary";t.codepage=65001;n=Ho(e)}if(t.type=="array"&&typeof Uint8Array!=="undefined"&&e instanceof Uint8Array&&typeof ArrayBuffer!=="undefined"){var l=new ArrayBuffer(3),o=new Uint8Array(l);o.foo="bar";if(!o.foo){t=kr(t);t.type="array";return Xo(I(n),t)}}switch((i=Bo(n,t))[0]){case 208:if(i[1]===207&&i[2]===17&&i[3]===224&&i[4]===161&&i[5]===177&&i[6]===26&&i[7]===225)return Uo(qe