}returnres};exports.findCompression=function(compressionMethod){for(varmethodincompressions){if(!compressions.hasOwnProperty(method)){continue}if(compressions[method].magic===compressionMethod){returncompressions[method]}}returnnull};exports.isRegExp=function(object){returnObject.prototype.toString.call(object)==="[object RegExp]"}},{"./compressions":3,"./nodeBuffer":11,"./support":17}],22:[function(_dereq_,module,exports){"use strict";varStringReader=_dereq_("./stringReader");varNodeBufferReader=_dereq_("./nodeBufferReader");varUint8ArrayReader=_dereq_("./uint8ArrayReader");varutils=_dereq_("./utils");varsig=_dereq_("./signature");varZipEntry=_dereq_("./zipEntry");varsupport=_dereq_("./support");varjszipProto=_dereq_("./object");functionZipEntries(data,loadOptions){this.files=[];this.loadOptions=loadOptions;if(data){this.load(data)}}ZipEntries.prototype={checkSignature:function(expectedSignature){varsignature=this.reader.readString(4);if(signature!==expectedSignature){thrownewError("Corrupted zip or bug : unexpected signature "+"("+utils.pretty(signature)+", expected "+utils.pretty(expectedSignature)+")")}},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2);this.diskWithCentralDirStart=this.reader.readInt(2);this.centralDirRecordsOnThisDisk=this.reader.readInt(2);this.centralDirRecords=this.reader.readInt(2);this.centralDirSize=this.reader.readInt(4);this.centralDirOffset=this.reader.readInt(4);this.zipCommentLength=this.reader.readInt(2);this.zipComment=this.reader.readString(this.zipCommentLength);this.zipComment=jszipProto.utf8decode(this.zipComment)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8);this.versionMadeBy=this.reader.readString(2);this.versionNeeded=this.reader.readInt(2);this.diskNumber=this.reader.readInt(4);this.diskWithCentralDirStart=this.reader.readInt(4);this.centralDirRecordsOnThisDisk=this.reader.readInt(8);this.centralDirRecords=this.reader.readInt(8);this.centralDirSize=this.reader.readInt(8);this.centralDirOffset=this.reader.readInt(8);this.zip64ExtensibleData={};varextraDataSize=this.zip64EndOfCentralSize-44,index=0,extraFieldId,extraFieldLength,extraFieldValue;while(index<extraDataSize){extraFieldId=this.reader.readInt(2);extraFieldLength=this.reader.readInt(4);extraFieldValue=this.reader.readString(extraFieldLength);this.zip64ExtensibleData[extraFieldId]={id:extraFieldId,length:extraFieldLength,value:extraFieldValue}}},readBlockZip64EndOfCentralLocator:function(){this.diskWithZip64CentralDirStart=this.reader.readInt(4);this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8);this.disksCount=this.reader.readInt(4);if(this.disksCount>1){thrownewError("Multi-volumes zip are not supported")}},readLocalFiles:function(){vari,file;for(i=0;i<this.files.length;i++){file=this.files[i];this.reader.setIndex(file.localHeaderOffset);this.checkSignature(sig.LOCAL_FILE_HEADER);file.readLocalPart(this.reader);file.handleUTF8()}},readCentralDir:function(){varfile;this.reader.setIndex(this.centralDirOffset);while(this.reader.readString(4)===sig.CENTRAL_FILE_HEADER){file=newZipEntry({zip64:this.zip64},this.loadOptions);file.readCentralPart(this.reader);this.files.push(file)}},readEndOfCentral:function(){varoffset=this.reader.lastIndexOfSignature(sig.CENTRAL_DIRECTORY_END);if(offset===-1){thrownewError("Corrupted zip : can't find end of central directory")}this.reader.setIndex(offset);this.checkSignature(sig.CENTRAL_DIRECTORY_END);this.readBlockEndOfCentral();if(this.diskNumber===utils.MAX_VALUE_16BITS||this.diskWithCentralDirStart===utils.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===utils.MAX_VALUE_16BITS||this.centralDirRecords===utils.MAX_VALUE_16BITS||this.centralDirSize===utils.MAX_VALUE_32BITS||this.centralDirOffset===utils.MAX_VALUE_32BITS){this.zip64=true;offset=this.reader.lastIndexOfSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR);if(offset===-1){thrownewError("Corrupted zip : can't find the ZIP64 end of central directory locator")}this.reader.setIndex(offset);this.checkSignature(sig.ZIP64_CENTRAL_D
module.exports=CFB}functionisval(x){returnx!==undefined&&x!==null}functionkeys(o){returnObject.keys(o)}functionevert_key(obj,key){varo=[],K=keys(obj);for(vari=0;i!==K.length;++i)o[obj[K[i]][key]]=K[i];returno}functionevert(obj){varo=[],K=keys(obj);for(vari=0;i!==K.length;++i)o[obj[K[i]]]=K[i];returno}functionevert_num(obj){varo=[],K=keys(obj);for(vari=0;i!==K.length;++i)o[obj[K[i]]]=parseInt(K[i],10);returno}functionevert_arr(obj){varo=[],K=keys(obj);for(vari=0;i!==K.length;++i){if(o[obj[K[i]]]==null)o[obj[K[i]]]=[];o[obj[K[i]]].push(K[i])}returno}functiondatenum(v,date1904){varepoch=v.getTime();if(date1904)epoch+=1462*24*60*60*1e3;return(epoch+22091616e5)/(24*60*60*1e3)}functionnumdate(v){vardate=SSF.parse_date_code(v);varval=newDate;if(date==null)thrownewError("Bad Date Code: "+v);val.setUTCDate(date.d);val.setUTCMonth(date.m-1);val.setUTCFullYear(date.y);val.setUTCHours(date.H);val.setUTCMinutes(date.M);val.setUTCSeconds(date.S);returnval}functionparse_isodur(s){varsec=0,mt=0,time=false;varm=s.match(/P([0-9\.]+Y)?([0-9\.]+M)?([0-9\.]+D)?T([0-9\.]+H)?([0-9\.]+M)?([0-9\.]+S)?/);if(!m)thrownewError("|"+s+"| is not an ISO8601 Duration");for(vari=1;i!=m.length;++i){if(!m[i])continue;mt=1;if(i>3)time=true;switch(m[i].substr(m[i].length-1)){case"Y":thrownewError("Unsupported ISO Duration Field: "+m[i].substr(m[i].length-1));case"D":mt*=24;case"H":mt*=60;case"M":if(!time)thrownewError("Unsupported ISO Duration Field: M");elsemt*=60;case"S":break}sec+=mt*parseInt(m[i],10)}returnsec}vargood_pd_date=newDate("2017-02-19T19:06:09.000Z");vargood_pd=good_pd_date.getFullYear()==2017;functionparseDate(str){if(good_pd)returnnewDate(str);if(strinstanceofDate)returnstr;varn=str.match(/\d+/g)||["2017","2","19","0","0","0"];returnnewDate(Date.UTC(+n[0],+n[1]-1,+n[2],+n[3],+n[4],+n[5]))}functioncc2str(arr){varo="";for(vari=0;i!=arr.length;++i)o+=String.fromCharCode(arr[i]);returno}functionstr2cc(str){varo=[];for(vari=0;i!=str.length;++i)o.push(str.charCodeAt(i));returno}functiondup(o){if(typeofJSON!="undefined"&&!Array.isArray(o))returnJSON.parse(JSON.stringify(o));if(typeofo!="object"||o==null)returno;varout={};for(varkino)if(o.hasOwnProperty(k))out[k]=dup(o[k]);returnout}functionfill(c,l){varo="";while(o.length<l)o+=c;returno}functiongetdatastr(data){if(!data)returnnull;if(data.data)returndebom(data.data);if(data.asNodeBuffer&&has_buf)returndebom(data.asNodeBuffer().toString("binary"));if(data.asBinary)returndebom(data.asBinary());if(data._data&&data._data.getContent)returndebom(cc2str(Array.prototype.slice.call(data._data.getContent(),0)));returnnull}functiongetdatabin(data){if(!data)returnnull;if(data.data)returnchar_codes(data.data);if(data.asNodeBuffer&&has_buf)returndata.asNodeBuffer();if(data._data&&data._data.getContent){varo=data._data.getContent();if(typeofo=="string")returnstr2cc(o);returnArray.prototype.slice.call(o)}returnnull}functiongetdata(data){returndata&&data.name.slice(-4)===".bin"?getdatabin(data):getdatastr(data)}functionsafegetzipfile(zip,file){vark=keys(zip.files);varf=file.toLowerCase(),g=f.replace(/\//g,"\\");for(vari=0;i<k.length;++i){varn=k[i].toLowerCase();if(f==n||g==n)returnzip.files[k[i]]}returnnull}functiongetzipfile(zip,file){varo=safegetzipfile(zip,file);if(o==null)thrownewError("Cannot find file "+file+" in zip");returno}functiongetzipdata(zip,file,safe){if(!safe)returngetdata(getzipfile(zip,file));if(!file)returnnull;try{returngetzipdata(zip,file)}catch(e){returnnull}}functiongetzipstr(zip,file,safe){if(!safe)returngetdatastr(getzipfile(zip,file));if(!file)returnnull;try{returngetzipstr(zip,file)}catch(e){returnnull}}var_fs,jszip;if(typeofJSZip!=="undefined")jszip=JSZip;if(typeofexports!=="undefined"){if(typeofmodule!=="undefined"&&module.exports){if(typeofjszip==="undefined")jszip=require("./jszip.js");_fs=require("fs")}}functionresolve_path(path,base){varresult=base.split("/");if(base.slice(-1)!="/")result.pop();vartarget=path.split("/");while(target.length!==0){varstep=target.sh
vars=blob.l;varfts=[];while(blob.l<s+length){varft=blob.read_shift(2);blob.l-=2;try{fts.push(FtTab[ft](blob,s+length-blob.l))}catch(e){blob.l=s+length;returnfts}}if(blob.l!=s+length)blob.l=s+length;returnfts}varparse_FontIndex=parseuint16;functionparse_BOF(blob,length){varo={BIFFVer:0,dt:0};o.BIFFVer=blob.read_shift(2);length-=2;if(length>=2){o.dt=blob.read_shift(2);blob.l-=2}switch(o.BIFFVer){case1536:case1280:case2:case7:break;default:if(length>6)thrownewError("Unexpected BIFF Ver "+o.BIFFVer)}blob.read_shift(length);returno}functionparse_InterfaceHdr(blob,length){if(length===0)return1200;varq;if((q=blob.read_shift(2))!==1200){}return1200}functionparse_WriteAccess(blob,length,opts){if(opts.enc){blob.l+=length;return""}varl=blob.l;varUserName=parse_XLUnicodeString(blob,0,opts);blob.read_shift(length+l-blob.l);returnUserName}functionparse_BoundSheet8(blob,length,opts){varpos=blob.read_shift(4);varhidden=blob.read_shift(1)&3;vardt=blob.read_shift(1);switch(dt){case0:dt="Worksheet";break;case1:dt="Macrosheet";break;case2:dt="Chartsheet";break;case6:dt="VBAModule";break}varname=parse_ShortXLUnicodeString(blob,0,opts);if(name.length===0)name="Sheet1";return{pos:pos,hs:hidden,dt:dt,name:name}}functionparse_SST(blob,length){varcnt=blob.read_shift(4);varucnt=blob.read_shift(4);varstrs=[];for(vari=0;i!=ucnt;++i){strs.push(parse_XLUnicodeRichExtendedString(blob))}strs.Count=cnt;strs.Unique=ucnt;returnstrs}functionparse_ExtSST(blob,length){varextsst={};extsst.dsst=blob.read_shift(2);blob.l+=length-2;returnextsst}functionparse_Row(blob,length){varrw=blob.read_shift(2),col=blob.read_shift(2),Col=blob.read_shift(2),rht=blob.read_shift(2);blob.read_shift(4);varflags=blob.read_shift(1);blob.read_shift(1);blob.read_shift(2);return{r:rw,c:col,cnt:Col-col}}functionparse_ForceFullCalculation(blob,length){varheader=parse_frtHeader(blob);if(header.type!=2211)thrownewError("Invalid Future Record "+header.type);varfullcalc=blob.read_shift(4);returnfullcalc!==0}varparse_CompressPictures=parsenoop2;functionparse_RecalcId(blob,length){blob.read_shift(2);returnblob.read_shift(4)}functionparse_DefaultRowHeight(blob,length){varf=blob.read_shift(2);varfl={Unsynced:f&1,DyZero:(f&2)>>1,ExAsc:(f&4)>>2,ExDsc:(f&8)>>3};varmiyRw=blob.read_shift(2);return[fl,miyRw]}functionparse_Window1(blob,length){varxWn=blob.read_shift(2),yWn=blob.read_shift(2),dxWn=blob.read_shift(2),dyWn=blob.read_shift(2);varflags=blob.read_shift(2),iTabCur=blob.read_shift(2),iTabFirst=blob.read_shift(2);varctabSel=blob.read_shift(2),wTabRatio=blob.read_shift(2);return{Pos:[xWn,yWn],Dim:[dxWn,dyWn],Flags:flags,CurTab:iTabCur,FirstTab:iTabFirst,Selected:ctabSel,TabRatio:wTabRatio}}functionparse_Font(blob,length,opts){blob.l+=14;varname=parse_ShortXLUnicodeString(blob,0,opts);returnname}functionparse_LabelSst(blob,length){varcell=parse_XLSCell(blob);cell.isst=blob.read_shift(4);returncell}functionparse_Label(blob,length,opts){vartarget=blob.l+length;varcell=parse_XLSCell(blob,6);if(opts.biff==2)blob.l++;varstr=parse_XLUnicodeString(blob,target-blob.l,opts);cell.val=str;returncell}functionparse_Format(blob,length,opts){varifmt=blob.read_shift(2);varfmtstr=parse_XLUnicodeString2(blob,0,opts);return[ifmt,fmtstr]}varparse_BIFF2Format=parse_XLUnicodeString2;functionparse_Dimensions(blob,length,opts){varend=blob.l+length;varw=opts.biff==8||!opts.biff?4:2;varr=blob.read_shift(w),R=blob.read_shift(w),c=blob.read_shift(2),C=blob.read_shift(2);blob.l=end;return{s:{r:r,c:c},e:{r:R,c:C}}}functionparse_RK(blob,length){varrw=blob.read_shift(2),col=blob.read_shift(2);varrkrec=parse_RkRec(blob);return{r:rw,c:col,ixfe:rkrec[0],rknum:rkrec[1]}}functionparse_MulRk(blob,length){vartarget=blob.l+length-2;varrw=blob.read_shift(2),col=blob.read_shift(2);varrkrecs=[];while(blob.l<target)rkrecs.push(parse_RkRec(blob));if(blob.l!==target)thrownewError("MulRK read error");varlastcol=blob.read_shift(2);if(rkrecs.length!=lastcol-col+1)thrownewError("MulRK length mismatch");return{r:rw,c:col,C:lastcol,rkrec:rkrecs}}function
}functionprn_to_sheet(d,opts){switch(opts.type){case"base64":returnprn_to_sheet_str(Base64.decode(d),opts);case"binary":returnprn_to_sheet_str(d,opts);case"buffer":returnprn_to_sheet_str(d.toString("binary"),opts);case"array":returnprn_to_sheet_str(cc2str(d),opts)}thrownewError("Unrecognized type "+opts.type)}functionprn_to_workbook(str,opts){returnsheet_to_workbook(prn_to_sheet(str,opts),opts)}functionsheet_to_prn(ws,opts){varo=[];varr=decode_range(ws["!ref"]),cell;vardense=Array.isArray(ws);for(varR=r.s.r;R<=r.e.r;++R){varoo=[];for(varC=r.s.c;C<=r.e.c;++C){varcoord=encode_cell({r:R,c:C});cell=dense?(ws[R]||[])[C]:ws[coord];if(!cell||cell.v==null){oo.push(" ");continue}varw=(cell.w||(format_cell(cell),cell.w)||"").substr(0,10);while(w.length<10)w+=" ";oo.push(w+(C==0?" ":""))}o.push(oo.join(""))}returno.join("\n")}return{to_workbook:prn_to_workbook,to_sheet:prn_to_sheet,from_sheet:sheet_to_prn}}();varWK_=function(){functionlotushopper(data,cb,opts){if(!data)return;prep_blob(data,data.l||0);varEnum=opts.Enum||WK1Enum;while(data.l<data.length){varRT=data.read_shift(2);varR=Enum[RT]||Enum[255];varlength=data.read_shift(2);vartgt=data.l+length;vard=R.f(data,length,opts);data.l=tgt;if(cb(d,R.n,RT))return}}functionlotus_to_workbook(d,opts){switch(opts.type){case"base64":returnlotus_to_workbook_buf(s2a(Base64.decode(d)),opts);case"binary":returnlotus_to_workbook_buf(s2a(d),opts);case"buffer":case"array":returnlotus_to_workbook_buf(d,opts)}throw"Unsupported type "+opts.type}functionlotus_to_workbook_buf(d,opts){if(!d)returnd;varo=opts||{};if(DENSE!=null&&o.dense==null)o.dense=DENSE;vars=o.dense?[]:{},n="Sheet1",sidx=0;varsheets={},snames=[n];varrefguess={s:{r:0,c:0},e:{r:0,c:0}};if(d[2]==2)o.Enum=WK1Enum;elseif(d[2]==26)o.Enum=WK3Enum;elseif(d[2]==14){o.Enum=WK3Enum;o.qpro=true;d.l=0}elsethrownewError("Unrecognized LOTUS BOF "+d[2]);lotushopper(d,function(val,Rn,RT){if(d[2]==2)switch(RT){case0:o.vers=val;if(val>=4096)o.qpro=true;break;case6:refguess=val;break;case15:if(!o.qpro)val[1].v=val[1].v.substr(1);case13:case14:case16:case51:if(o.dense){if(!s[val[0].r])s[val[0].r]=[];s[val[0].r][val[0].c]=val[1]}elses[encode_cell(val[0])]=val[1];break}elseswitch(RT){case22:val[1].v=val[1].v.substr(1);case23:case24:case25:case37:case39:case40:if(val[3]>sidx){s["!ref"]=encode_range(refguess);sheets[n]=s;s=o.dense?[]:{};refguess={s:{r:0,c:0},e:{r:0,c:0}};sidx=val[3];n="Sheet"+(sidx+1);snames.push(n)}s[encode_cell(val[0])]=val[1];if(refguess.e.c<val[0].c)refguess.e.c=val[0].c;if(refguess.e.r<val[0].r)refguess.e.r=val[0].r;break;default:break}},o);s["!ref"]=encode_range(refguess);sheets[n]=s;return{SheetNames:snames,Sheets:sheets}}functionparse_RANGE(blob,length){varo={s:{c:0,r:0},e:{c:0,r:0}};o.s.c=blob.read_shift(2);o.s.r=blob.read_shift(2);o.e.c=blob.read_shift(2);o.e.r=blob.read_shift(2);if(o.s.c==65535)o.s.c=o.e.c=o.s.r=o.e.r=0;returno}functionparse_cell(blob,length,opts){varo=[{c:0,r:0},{t:"n",v:0},0];if(opts.qpro&&opts.vers!=20768){o[0].c=blob.read_shift(1);blob.l++;o[0].r=blob.read_shift(2);blob.l+=2}else{o[2]=blob.read_shift(1);o[0].c=blob.read_shift(2);o[0].r=blob.read_shift(2)}returno}functionparse_LABEL(blob,length,opts){vartgt=blob.l+length;varo=parse_cell(blob,length,opts);o[1].t="s";if(opts.vers==20768){blob.l++;varlen=blob.read_shift(1);o[1].v=blob.read_shift(len,"utf8");returno}if(opts.qpro)blob.l++;o[1].v=blob.read_shift(tgt-blob.l,"cstr");returno}functionparse_INTEGER(blob,length,opts){varo=parse_cell(blob,length,opts);o[1].v=blob.read_shift(2,"i");returno}functionparse_NUMBER(blob,length,opts){varo=parse_cell(blob,length,opts);o[1].v=blob.read_shift(8,"f");returno}functionparse_FORMULA(blob,length,opts){vartgt=blob.l+length;varo=parse_cell(blob,length,opts);o[1].v=blob.read_shift(8,"f");if(opts.qpro)blob.l=tgt;else{varflen=blob.read_shift(2);blob.l+=flen}returno}functionparse_cell_3(blob,length){varo=[{c:0,r:0},{t:"n",v:0},0];o[0].r=blob.read_shift(2);o[3]=blob[blob.l++];o[0].c=blob[blob.l++];returno}functionparse_LABEL_16(blob,l
styles.CellXf=[];varstate=[];varpass=false;recordhopper(data,functionhopper_sty(val,R_n,RT){switch(RT){case44:styles.NumberFmt[val[0]]=val[1];SSF.load(val[1],val[0]);break;case43:break;case1025:break;case45:break;case46:break;case47:if(state[state.length-1]=="BrtBeginCellXFs"){styles.CellXf.push(val)}break;case48:case507:case572:case475:break;case1171:case2102:case1130:case512:case2095:break;case35:pass=true;break;case36:pass=false;break;case37:state.push(R_n);break;case38:state.pop();break;default:if((R_n||"").indexOf("Begin")>0)state.push(R_n);elseif((R_n||"").indexOf("End")>0)state.pop();elseif(!pass||opts.WTF)thrownewError("Unexpected record "+RT+" "+R_n)}});returnstyles}functionwrite_sty_bin(data,opts){varba=buf_array();write_record(ba,"BrtBeginStyleSheet");write_record(ba,"BrtEndStyleSheet");returnba.end()}RELS.THEME="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme";functionparse_clrScheme(t,themes,opts){themes.themeElements.clrScheme=[];varcolor={};(t[0].match(tagregex)||[]).forEach(function(x){vary=parsexmltag(x);switch(y[0]){case"<a:clrScheme":case"</a:clrScheme>":break;case"<a:srgbClr":color.rgb=y.val;break;case"<a:sysClr":color.rgb=y.lastClr;break;case"<a:dk1>":case"</a:dk1>":case"<a:dk2>":case"</a:dk2>":case"<a:lt1>":case"</a:lt1>":case"<a:lt2>":case"</a:lt2>":case"<a:accent1>":case"</a:accent1>":case"<a:accent2>":case"</a:accent2>":case"<a:accent3>":case"</a:accent3>":case"<a:accent4>":case"</a:accent4>":case"<a:accent5>":case"</a:accent5>":case"<a:accent6>":case"</a:accent6>":case"<a:hlink>":case"</a:hlink>":case"<a:folHlink>":case"</a:folHlink>":if(y[0][1]==="/"){themes.themeElements.clrScheme.push(color);color={}}else{color.name=y[0].substring(3,y[0].length-1)}break;default:if(opts&&opts.WTF)thrownewError("Unrecognized "+y[0]+" in clrScheme")}})}functionparse_fontScheme(t,themes,opts){}functionparse_fmtScheme(t,themes,opts){}varclrsregex=/<a:clrScheme([^>]*)>[^\u2603]*<\/a:clrScheme>/;varfntsregex=/<a:fontScheme([^>]*)>[^\u2603]*<\/a:fontScheme>/;varfmtsregex=/<a:fmtScheme([^>]*)>[^\u2603]*<\/a:fmtScheme>/;functionparse_themeElements(data,themes,opts){themes.themeElements={};vart;[["clrScheme",clrsregex,parse_clrScheme],["fontScheme",fntsregex,parse_fontScheme],["fmtScheme",fmtsregex,parse_fmtScheme]].forEach(function(m){if(!(t=data.match(m[1])))thrownewError(m[0]+" not found in themeElements");m[2](t,themes,opts)})}varthemeltregex=/<a:themeElements([^>]*)>[^\u2603]*<\/a:themeElements>/;functionparse_theme_xml(data,opts){if(!data||data.length===0)returnparse_theme_xml(write_theme());vart;varthemes={};if(!(t=data.match(themeltregex)))thrownewError("themeElements not found in theme");parse_themeElements(t[0],themes,opts);returnthemes}functionwrite_theme(Themes,opts){varo=[XML_HEADER];o[o.length]='<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme">';o[o.length]="<a:themeElements>";o[o.length]='<a:clrScheme name="Office">';o[o.length]='<a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1>';o[o.length]='<a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1>';o[o.length]='<a:dk2><a:srgbClr val="1F497D"/></a:dk2>';o[o.length]='<a:lt2><a:srgbClr val="EEECE1"/></a:lt2>';o[o.length]='<a:accent1><a:srgbClr val="4F81BD"/></a:accent1>';o[o.length]='<a:accent2><a:srgbClr val="C0504D"/></a:accent2>';o[o.length]='<a:accent3><a:srgbClr val="9BBB59"/></a:accent3>';o[o.length]='<a:accent4><a:srgbClr val="8064A2"/></a:accent4>';o[o.length]='<a:accent5><a:srgbClr val="4BACC6"/></a:accent5>';o[o.length]='<a:accent6><a:srgbClr val="F79646"/></a:accent6>';o[o.length]='<a:hlink><a:srgbClr val="0000FF"/></a:hlink>';o[o.length]='<a:folHlink><a:srgbClr val="800080"/></a:folHlink>';o[o.length]="</a:clrScheme>";o[o.length]='<a:fontScheme name="Office">';o[o.length]="<a:majorFont>";o[o.length]='<a:latin typeface="Cambria"/>';o[o.length]='<a:ea typeface=""/>';o[o.length]='<a:cs typeface=""/>';o[o.length]='<a:font script="Jpan" typeface="MS Pゴシック"/>';o[o.length]='<a:fontscript="Hang"typeface=
vardraw=parse_drawing(getzipstr(zip,dfile,true),parse_rels(getzipstr(zip,drelsp,true),dfile));varchartp=resolve_path(draw,dfile);varcrelsp=get_rels_path(chartp);cs=parse_chart(getzipstr(zip,chartp,true),chartp,opts,parse_rels(getzipstr(zip,crelsp,true),chartp),wb,cs);break;case"macro":sheets[sheet]=parse_ms(data,path,opts,sheetRels[sheet],wb,themes,styles);break;case"dialog":sheets[sheet]=parse_ds(data,path,opts,sheetRels[sheet],wb,themes,styles);break}}catch(e){if(opts.WTF)throwe}}varnodirs=functionnodirs(x){returnx.slice(-1)!="/"};functionparse_zip(zip,opts){make_ssf(SSF);opts=opts||{};fix_read_opts(opts);reset_cp();if(safegetzipfile(zip,"META-INF/manifest.xml"))returnparse_ods(zip,opts);if(safegetzipfile(zip,"objectdata.xml"))returnparse_ods(zip,opts);varentries=keys(zip.files).filter(nodirs).sort();vardir=parse_ct(getzipstr(zip,"[Content_Types].xml"),opts);varxlsb=false;varsheets,binname;if(dir.workbooks.length===0){binname="xl/workbook.xml";if(getzipdata(zip,binname,true))dir.workbooks.push(binname)}if(dir.workbooks.length===0){binname="xl/workbook.bin";if(!getzipfile(zip,binname,true))thrownewError("Could not find workbook");dir.workbooks.push(binname);xlsb=true}if(dir.workbooks[0].slice(-3)=="bin")xlsb=true;if(xlsb)set_cp(1200);varthemes={};varstyles={};if(!opts.bookSheets&&!opts.bookProps){strs=[];if(dir.sst)strs=parse_sst(getzipdata(zip,dir.sst.replace(/^\//,"")),dir.sst,opts);if(opts.cellStyles&&dir.themes.length)themes=parse_theme(getzipstr(zip,dir.themes[0].replace(/^\//,""),true)||"",dir.themes[0],opts);if(dir.style)styles=parse_sty(getzipdata(zip,dir.style.replace(/^\//,"")),dir.style,themes,opts)}varwb=parse_wb(getzipdata(zip,dir.workbooks[0].replace(/^\//,"")),dir.workbooks[0],opts);varprops={},propdata="";if(dir.coreprops.length!==0){propdata=getzipstr(zip,dir.coreprops[0].replace(/^\//,""),true);if(propdata)props=parse_core_props(propdata);if(dir.extprops.length!==0){propdata=getzipstr(zip,dir.extprops[0].replace(/^\//,""),true);if(propdata)parse_ext_props(propdata,props)}}varcustprops={};if(!opts.bookSheets||opts.bookProps){if(dir.custprops.length!==0){propdata=getzipstr(zip,dir.custprops[0].replace(/^\//,""),true);if(propdata)custprops=parse_cust_props(propdata,opts)}}varout={};if(opts.bookSheets||opts.bookProps){if(wb.Sheets)sheets=wb.Sheets.map(functionpluck(x){returnx.name});elseif(props.Worksheets&&props.SheetNames.length>0)sheets=props.SheetNames;if(opts.bookProps){out.Props=props;out.Custprops=custprops}if(opts.bookSheets&&typeofsheets!=="undefined")out.SheetNames=sheets;if(opts.bookSheets?out.SheetNames:opts.bookProps)returnout}sheets={};vardeps={};if(opts.bookDeps&&dir.calcchain)deps=parse_cc(getzipdata(zip,dir.calcchain.replace(/^\//,"")),dir.calcchain,opts);vari=0;varsheetRels={};varpath,relsPath;{varwbsheets=wb.Sheets;props.Worksheets=wbsheets.length;props.SheetNames=[];for(varj=0;j!=wbsheets.length;++j){props.SheetNames[j]=wbsheets[j].name}}varwbext=xlsb?"bin":"xml";varwbrelsfile="xl/_rels/workbook."+wbext+".rels";varwbrels=parse_rels(getzipstr(zip,wbrelsfile,true),wbrelsfile);if(wbrels)wbrels=safe_parse_wbrels(wbrels,wb.Sheets);varnmode=getzipdata(zip,"xl/worksheets/sheet.xml",true)?1:0;for(i=0;i!=props.Worksheets;++i){varstype="sheet";if(wbrels&&wbrels[i]){path="xl/"+wbrels[i][1].replace(/[\/]?xl\//,"");stype=wbrels[i][2]}else{path="xl/worksheets/sheet"+(i+1-nmode)+"."+wbext;path=path.replace(/sheet0\./,"sheet.")}relsPath=path.replace(/^(.*)(\/)([^\/]*)$/,"$1/_rels/$3.rels");safe_parse_sheet(zip,path,relsPath,props.SheetNames[i],sheetRels,sheets,stype,opts,wb,themes,styles)}if(dir.comments)parse_comments(zip,dir.comments,sheets,sheetRels,opts);out={Directory:dir,Workbook:wb,Props:props,Custprops:custprops,Deps:deps,Sheets:sheets,SheetNames:props.SheetNames,Strings:strs,Styles:styles,Themes:themes,SSF:SSF.get_table()};if(opts.bookFiles){out.keys=entries;out.files=zip.files}if(opts.bookVBA){if(dir.vba.length>0)out.vbaraw=getzipdata(zip,dir.vba[0].replace(/^\//,""),true);elseif(dir.defaults&&dir.defaults.bin==="application/vnd.ms-office.vbaProject")ou