@mescius/activereportsjs
Version:
ActiveReportsJS
12 lines (11 loc) • 108 kB
JavaScript
/*!
* @mescius/activereportsjs 6.1.0
* Description: ActiveReportsJS
* https://www.npmjs.com/package/@mescius/activereportsjs
* Copyright ©️ MESCIUS inc. All rights reserved.
* Licensed under the Commercial license
*/
(function(ct,_t){typeof exports=="object"&&typeof module<"u"?_t(exports):typeof define=="function"&&define.amd?define(["exports"],_t):(ct=typeof globalThis<"u"?globalThis:ct||self,_t((ct.MESCIUS=ct.MESCIUS||{},ct.MESCIUS.ActiveReportsJS=ct.MESCIUS.ActiveReportsJS||{},ct.MESCIUS.ActiveReportsJS.TabularDataExport={})))})(this,(function(ct){"use strict";function _t(L){return L&&L.__esModule&&Object.prototype.hasOwnProperty.call(L,"default")?L.default:L}var kt={exports:{}},jt=kt.exports,Tt;function Zt(){return Tt||(Tt=1,(function(L,Z){(function(f,S){L.exports=S()})(jt,function(){return function f(S,_,u){var s=window,r="application/octet-stream",a=u||r,m=S,w=!_&&!u&&m,g=document.createElement("a"),y=function(C){return String(C)},i=s.Blob||s.MozBlob||s.WebKitBlob||y,d=_||"download",n,h;if(i=i.call?i.bind(s):Blob,String(this)==="true"&&(m=[m,a],a=m[0],m=m[1]),w&&w.length<2048&&(d=w.split("/").pop().split("?")[0],g.href=w,g.href.indexOf(w)!==-1)){var o=new XMLHttpRequest;return o.open("GET",w,!0),o.responseType="blob",o.onload=function(C){f(C.target.response,d,r)},setTimeout(function(){o.send()},0),o}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(m))if(m.length>1024*1024*1.999&&i!==y)m=x(m),a=m.type||r;else return navigator.msSaveBlob?navigator.msSaveBlob(x(m),d):B(m);else if(/([\x80-\xff])/.test(m)){var p=0,v=new Uint8Array(m.length),E=v.length;for(p;p<E;++p)v[p]=m.charCodeAt(p);m=new i([v],{type:a})}n=m instanceof i?m:new i([m],{type:a});function x(C){var P=C.split(/[:;,]/),R=P[1],H=P[2]=="base64"?atob:decodeURIComponent,X=H(P.pop()),b=X.length,O=0,e=new Uint8Array(b);for(O;O<b;++O)e[O]=X.charCodeAt(O);return new i([e],{type:R})}function B(C,P){if("download"in g)return g.href=C,g.setAttribute("download",d),g.className="download-js-link",g.innerHTML="downloading...",g.style.display="none",document.body.appendChild(g),setTimeout(function(){g.click(),document.body.removeChild(g),P===!0&&setTimeout(function(){s.URL.revokeObjectURL(g.href)},250)},66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(C)&&(C="data:"+C.replace(/^data:([\w\/\-\+]+)/,r)),window.open(C)||confirm(`Displaying New Document
Use Save As... to download, then click back to return to this page.`)&&(location.href=C),!0;var R=document.createElement("iframe");document.body.appendChild(R),!P&&/^data:/.test(C)&&(C="data:"+C.replace(/^data:([\w\/\-\+]+)/,r)),R.src=C,setTimeout(function(){document.body.removeChild(R)},333)}if(navigator.msSaveBlob)return navigator.msSaveBlob(n,d);if(s.URL)B(s.URL.createObjectURL(n),!0);else{if(typeof n=="string"||n.constructor===y)try{return B("data:"+a+";base64,"+s.btoa(n))}catch{return B("data:"+a+","+encodeURIComponent(n))}h=new FileReader,h.onload=function(C){B(this.result)},h.readAsDataURL(n)}return!0}})})(kt)),kt.exports}var Wt=Zt();const Rt=_t(Wt);function Mt(L){return Array.prototype.concat(...L)}const bt=L=>L[L.length-1],xt=L=>L!=null?L.replace(/\\n/g,`
`).replace(/\\r/g,"\r").replace(/\\t/g," "):L;function Ot(L,Z="untitled"){if(typeof L=="string"){const f=new Blob(["\uFEFF"+L],{type:"text/csv"});Rt(f,Z+".csv","text/csv")}else Rt(L,Z+".zip","application/zip")}function Ht(){if(window&&window.arjsViewer&&typeof window.arjsViewer.registerExport=="function"){const L={formatKey:"tabular-data",friendlyName:"Tabular data",settingsDescriptors:[{name:"colSeparator",type:"string",label:"Columns Separator",category:"csv"},{name:"rowSeparator",type:"string",label:"Rows Separator",category:"csv"},{name:"quotationSymbol",type:"string",label:"Quotation Symbol",category:"csv"},{name:"tableSeparator",type:"string",label:"Tables Separator",category:"csv"},{name:"outputType",type:"enum",label:"Output Type",enumValues:{plain:"Plain text",zip:"ZIP"},category:"csv"},{name:"filename",type:"string",label:"File Name"}],defaultSettings:{filename:"ActiveReports",colSeparator:",",rowSeparator:"\\n",quotationSymbol:'"',tableSeparator:"===============",outputType:"plain"},invoke:async(Z,f,S,_)=>{const{filename:u,...s}=f,r={csvSettings:{colSeparator:xt(s.colSeparator),rowSeparator:xt(s.rowSeparator),quotationSymbol:xt(s.quotationSymbol),tableSeparator:xt(s.tableSeparator),outputType:s.outputType},filename:s.filename,format:"csv"},a=await Dt(Z._renderer,r,S,_);return{data:a.data,download:m=>a.download(m||u)}}};window.arjsViewer.registerExport(L)}}function St(L){throw new Error('Could not dynamically require "'+L+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ct={exports:{}};var Bt;function Gt(){return Bt||(Bt=1,(function(L,Z){(function(f){L.exports=f()})(function(){return(function f(S,_,u){function s(m,w){if(!_[m]){if(!S[m]){var g=typeof St=="function"&&St;if(!w&&g)return g(m,!0);if(r)return r(m,!0);var y=new Error("Cannot find module '"+m+"'");throw y.code="MODULE_NOT_FOUND",y}var i=_[m]={exports:{}};S[m][0].call(i.exports,function(d){var n=S[m][1][d];return s(n||d)},i,i.exports,f,S,_,u)}return _[m].exports}for(var r=typeof St=="function"&&St,a=0;a<u.length;a++)s(u[a]);return s})({1:[function(f,S,_){var u=f("./utils"),s=f("./support"),r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";_.encode=function(a){for(var m,w,g,y,i,d,n,h=[],o=0,p=a.length,v=p,E=u.getTypeOf(a)!=="string";o<a.length;)v=p-o,g=E?(m=a[o++],w=o<p?a[o++]:0,o<p?a[o++]:0):(m=a.charCodeAt(o++),w=o<p?a.charCodeAt(o++):0,o<p?a.charCodeAt(o++):0),y=m>>2,i=(3&m)<<4|w>>4,d=1<v?(15&w)<<2|g>>6:64,n=2<v?63&g:64,h.push(r.charAt(y)+r.charAt(i)+r.charAt(d)+r.charAt(n));return h.join("")},_.decode=function(a){var m,w,g,y,i,d,n=0,h=0,o="data:";if(a.substr(0,o.length)===o)throw new Error("Invalid base64 input, it looks like a data url.");var p,v=3*(a=a.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(a.charAt(a.length-1)===r.charAt(64)&&v--,a.charAt(a.length-2)===r.charAt(64)&&v--,v%1!=0)throw new Error("Invalid base64 input, bad content length.");for(p=s.uint8array?new Uint8Array(0|v):new Array(0|v);n<a.length;)m=r.indexOf(a.charAt(n++))<<2|(y=r.indexOf(a.charAt(n++)))>>4,w=(15&y)<<4|(i=r.indexOf(a.charAt(n++)))>>2,g=(3&i)<<6|(d=r.indexOf(a.charAt(n++))),p[h++]=m,i!==64&&(p[h++]=w),d!==64&&(p[h++]=g);return p}},{"./support":30,"./utils":32}],2:[function(f,S,_){var u=f("./external"),s=f("./stream/DataWorker"),r=f("./stream/Crc32Probe"),a=f("./stream/DataLengthProbe");function m(w,g,y,i,d){this.compressedSize=w,this.uncompressedSize=g,this.crc32=y,this.compression=i,this.compressedContent=d}m.prototype={getContentWorker:function(){var w=new s(u.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),g=this;return w.on("end",function(){if(this.streamInfo.data_length!==g.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),w},getCompressedWorker:function(){return new s(u.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},m.createWorkerFrom=function(w,g,y){return w.pipe(new r).pipe(new a("uncompressedSize")).pipe(g.compressWorker(y)).pipe(new a("compressedSize")).withStreamInfo("compression",g)},S.exports=m},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(f,S,_){var u=f("./stream/GenericWorker");_.STORE={magic:"\0\0",compressWorker:function(){return new u("STORE compression")},uncompressWorker:function(){return new u("STORE decompression")}},_.DEFLATE=f("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(f,S,_){var u=f("./utils"),s=(function(){for(var r,a=[],m=0;m<256;m++){r=m;for(var w=0;w<8;w++)r=1&r?3988292384^r>>>1:r>>>1;a[m]=r}return a})();S.exports=function(r,a){return r!==void 0&&r.length?u.getTypeOf(r)!=="string"?(function(m,w,g,y){var i=s,d=y+g;m^=-1;for(var n=y;n<d;n++)m=m>>>8^i[255&(m^w[n])];return-1^m})(0|a,r,r.length,0):(function(m,w,g,y){var i=s,d=y+g;m^=-1;for(var n=y;n<d;n++)m=m>>>8^i[255&(m^w.charCodeAt(n))];return-1^m})(0|a,r,r.length,0):0}},{"./utils":32}],5:[function(f,S,_){_.base64=!1,_.binary=!1,_.dir=!1,_.createFolders=!0,_.date=null,_.compression=null,_.compressionOptions=null,_.comment=null,_.unixPermissions=null,_.dosPermissions=null},{}],6:[function(f,S,_){var u=null;u=typeof Promise<"u"?Promise:f("lie"),S.exports={Promise:u}},{lie:37}],7:[function(f,S,_){var u=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",s=f("pako"),r=f("./utils"),a=f("./stream/GenericWorker"),m=u?"uint8array":"array";function w(g,y){a.call(this,"FlateWorker/"+g),this._pako=null,this._pakoAction=g,this._pakoOptions=y,this.meta={}}_.magic="\b\0",r.inherits(w,a),w.prototype.processChunk=function(g){this.meta=g.meta,this._pako===null&&this._createPako(),this._pako.push(r.transformTo(m,g.data),!1)},w.prototype.flush=function(){a.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},w.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},w.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var g=this;this._pako.onData=function(y){g.push({data:y,meta:g.meta})}},_.compressWorker=function(g){return new w("Deflate",g)},_.uncompressWorker=function(){return new w("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(f,S,_){function u(i,d){var n,h="";for(n=0;n<d;n++)h+=String.fromCharCode(255&i),i>>>=8;return h}function s(i,d,n,h,o,p){var v,E,x=i.file,B=i.compression,C=p!==m.utf8encode,P=r.transformTo("string",p(x.name)),R=r.transformTo("string",m.utf8encode(x.name)),H=x.comment,X=r.transformTo("string",p(H)),b=r.transformTo("string",m.utf8encode(H)),O=R.length!==x.name.length,e=b.length!==H.length,N="",Q="",j="",tt=x.dir,W=x.date,J={crc32:0,compressedSize:0,uncompressedSize:0};d&&!n||(J.crc32=i.crc32,J.compressedSize=i.compressedSize,J.uncompressedSize=i.uncompressedSize);var I=0;d&&(I|=8),C||!O&&!e||(I|=2048);var A=0,$=0;tt&&(A|=16),o==="UNIX"?($=798,A|=(function(q,at){var lt=q;return q||(lt=at?16893:33204),(65535<)<<16})(x.unixPermissions,tt)):($=20,A|=(function(q){return 63&(q||0)})(x.dosPermissions)),v=W.getUTCHours(),v<<=6,v|=W.getUTCMinutes(),v<<=5,v|=W.getUTCSeconds()/2,E=W.getUTCFullYear()-1980,E<<=4,E|=W.getUTCMonth()+1,E<<=5,E|=W.getUTCDate(),O&&(Q=u(1,1)+u(w(P),4)+R,N+="up"+u(Q.length,2)+Q),e&&(j=u(1,1)+u(w(X),4)+b,N+="uc"+u(j.length,2)+j);var V="";return V+=`
\0`,V+=u(I,2),V+=B.magic,V+=u(v,2),V+=u(E,2),V+=u(J.crc32,4),V+=u(J.compressedSize,4),V+=u(J.uncompressedSize,4),V+=u(P.length,2),V+=u(N.length,2),{fileRecord:g.LOCAL_FILE_HEADER+V+P+N,dirRecord:g.CENTRAL_FILE_HEADER+u($,2)+V+u(X.length,2)+"\0\0\0\0"+u(A,4)+u(h,4)+P+N+X}}var r=f("../utils"),a=f("../stream/GenericWorker"),m=f("../utf8"),w=f("../crc32"),g=f("../signature");function y(i,d,n,h){a.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=d,this.zipPlatform=n,this.encodeFileName=h,this.streamFiles=i,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}r.inherits(y,a),y.prototype.push=function(i){var d=i.meta.percent||0,n=this.entriesCount,h=this._sources.length;this.accumulate?this.contentBuffer.push(i):(this.bytesWritten+=i.data.length,a.prototype.push.call(this,{data:i.data,meta:{currentFile:this.currentFile,percent:n?(d+100*(n-h-1))/n:100}}))},y.prototype.openedSource=function(i){this.currentSourceOffset=this.bytesWritten,this.currentFile=i.file.name;var d=this.streamFiles&&!i.file.dir;if(d){var n=s(i,d,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},y.prototype.closedSource=function(i){this.accumulate=!1;var d=this.streamFiles&&!i.file.dir,n=s(i,d,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),d)this.push({data:(function(h){return g.DATA_DESCRIPTOR+u(h.crc32,4)+u(h.compressedSize,4)+u(h.uncompressedSize,4)})(i),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},y.prototype.flush=function(){for(var i=this.bytesWritten,d=0;d<this.dirRecords.length;d++)this.push({data:this.dirRecords[d],meta:{percent:100}});var n=this.bytesWritten-i,h=(function(o,p,v,E,x){var B=r.transformTo("string",x(E));return g.CENTRAL_DIRECTORY_END+"\0\0\0\0"+u(o,2)+u(o,2)+u(p,4)+u(v,4)+u(B.length,2)+B})(this.dirRecords.length,n,i,this.zipComment,this.encodeFileName);this.push({data:h,meta:{percent:100}})},y.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},y.prototype.registerPrevious=function(i){this._sources.push(i);var d=this;return i.on("data",function(n){d.processChunk(n)}),i.on("end",function(){d.closedSource(d.previous.streamInfo),d._sources.length?d.prepareNextSource():d.end()}),i.on("error",function(n){d.error(n)}),this},y.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},y.prototype.error=function(i){var d=this._sources;if(!a.prototype.error.call(this,i))return!1;for(var n=0;n<d.length;n++)try{d[n].error(i)}catch{}return!0},y.prototype.lock=function(){a.prototype.lock.call(this);for(var i=this._sources,d=0;d<i.length;d++)i[d].lock()},S.exports=y},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(f,S,_){var u=f("../compressions"),s=f("./ZipFileWorker");_.generateWorker=function(r,a,m){var w=new s(a.streamFiles,m,a.platform,a.encodeFileName),g=0;try{r.forEach(function(y,i){g++;var d=(function(p,v){var E=p||v,x=u[E];if(!x)throw new Error(E+" is not a valid compression method !");return x})(i.options.compression,a.compression),n=i.options.compressionOptions||a.compressionOptions||{},h=i.dir,o=i.date;i._compressWorker(d,n).withStreamInfo("file",{name:y,dir:h,date:o,comment:i.comment||"",unixPermissions:i.unixPermissions,dosPermissions:i.dosPermissions}).pipe(w)}),w.entriesCount=g}catch(y){w.error(y)}return w}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(f,S,_){function u(){if(!(this instanceof u))return new u;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var s=new u;for(var r in this)typeof this[r]!="function"&&(s[r]=this[r]);return s}}(u.prototype=f("./object")).loadAsync=f("./load"),u.support=f("./support"),u.defaults=f("./defaults"),u.version="3.10.1",u.loadAsync=function(s,r){return new u().loadAsync(s,r)},u.external=f("./external"),S.exports=u},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(f,S,_){var u=f("./utils"),s=f("./external"),r=f("./utf8"),a=f("./zipEntries"),m=f("./stream/Crc32Probe"),w=f("./nodejsUtils");function g(y){return new s.Promise(function(i,d){var n=y.decompressed.getContentWorker().pipe(new m);n.on("error",function(h){d(h)}).on("end",function(){n.streamInfo.crc32!==y.decompressed.crc32?d(new Error("Corrupted zip : CRC32 mismatch")):i()}).resume()})}S.exports=function(y,i){var d=this;return i=u.extend(i||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:r.utf8decode}),w.isNode&&w.isStream(y)?s.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):u.prepareContent("the loaded zip file",y,!0,i.optimizedBinaryString,i.base64).then(function(n){var h=new a(i);return h.load(n),h}).then(function(n){var h=[s.Promise.resolve(n)],o=n.files;if(i.checkCRC32)for(var p=0;p<o.length;p++)h.push(g(o[p]));return s.Promise.all(h)}).then(function(n){for(var h=n.shift(),o=h.files,p=0;p<o.length;p++){var v=o[p],E=v.fileNameStr,x=u.resolve(v.fileNameStr);d.file(x,v.decompressed,{binary:!0,optimizedBinaryString:!0,date:v.date,dir:v.dir,comment:v.fileCommentStr.length?v.fileCommentStr:null,unixPermissions:v.unixPermissions,dosPermissions:v.dosPermissions,createFolders:i.createFolders}),v.dir||(d.file(x).unsafeOriginalName=E)}return h.zipComment.length&&(d.comment=h.zipComment),d})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(f,S,_){var u=f("../utils"),s=f("../stream/GenericWorker");function r(a,m){s.call(this,"Nodejs stream input adapter for "+a),this._upstreamEnded=!1,this._bindStream(m)}u.inherits(r,s),r.prototype._bindStream=function(a){var m=this;(this._stream=a).pause(),a.on("data",function(w){m.push({data:w,meta:{percent:0}})}).on("error",function(w){m.isPaused?this.generatedError=w:m.error(w)}).on("end",function(){m.isPaused?m._upstreamEnded=!0:m.end()})},r.prototype.pause=function(){return!!s.prototype.pause.call(this)&&(this._stream.pause(),!0)},r.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},S.exports=r},{"../stream/GenericWorker":28,"../utils":32}],13:[function(f,S,_){var u=f("readable-stream").Readable;function s(r,a,m){u.call(this,a),this._helper=r;var w=this;r.on("data",function(g,y){w.push(g)||w._helper.pause(),m&&m(y)}).on("error",function(g){w.emit("error",g)}).on("end",function(){w.push(null)})}f("../utils").inherits(s,u),s.prototype._read=function(){this._helper.resume()},S.exports=s},{"../utils":32,"readable-stream":16}],14:[function(f,S,_){S.exports={isNode:typeof Buffer<"u",newBufferFrom:function(u,s){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(u,s);if(typeof u=="number")throw new Error('The "data" argument must not be a number');return new Buffer(u,s)},allocBuffer:function(u){if(Buffer.alloc)return Buffer.alloc(u);var s=new Buffer(u);return s.fill(0),s},isBuffer:function(u){return Buffer.isBuffer(u)},isStream:function(u){return u&&typeof u.on=="function"&&typeof u.pause=="function"&&typeof u.resume=="function"}}},{}],15:[function(f,S,_){function u(x,B,C){var P,R=r.getTypeOf(B),H=r.extend(C||{},w);H.date=H.date||new Date,H.compression!==null&&(H.compression=H.compression.toUpperCase()),typeof H.unixPermissions=="string"&&(H.unixPermissions=parseInt(H.unixPermissions,8)),H.unixPermissions&&16384&H.unixPermissions&&(H.dir=!0),H.dosPermissions&&16&H.dosPermissions&&(H.dir=!0),H.dir&&(x=o(x)),H.createFolders&&(P=h(x))&&p.call(this,P,!0);var X=R==="string"&&H.binary===!1&&H.base64===!1;C&&C.binary!==void 0||(H.binary=!X),(B instanceof g&&B.uncompressedSize===0||H.dir||!B||B.length===0)&&(H.base64=!1,H.binary=!0,B="",H.compression="STORE",R="string");var b=null;b=B instanceof g||B instanceof a?B:d.isNode&&d.isStream(B)?new n(x,B):r.prepareContent(x,B,H.binary,H.optimizedBinaryString,H.base64);var O=new y(x,b,H);this.files[x]=O}var s=f("./utf8"),r=f("./utils"),a=f("./stream/GenericWorker"),m=f("./stream/StreamHelper"),w=f("./defaults"),g=f("./compressedObject"),y=f("./zipObject"),i=f("./generate"),d=f("./nodejsUtils"),n=f("./nodejs/NodejsStreamInputAdapter"),h=function(x){x.slice(-1)==="/"&&(x=x.substring(0,x.length-1));var B=x.lastIndexOf("/");return 0<B?x.substring(0,B):""},o=function(x){return x.slice(-1)!=="/"&&(x+="/"),x},p=function(x,B){return B=B!==void 0?B:w.createFolders,x=o(x),this.files[x]||u.call(this,x,null,{dir:!0,createFolders:B}),this.files[x]};function v(x){return Object.prototype.toString.call(x)==="[object RegExp]"}var E={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(x){var B,C,P;for(B in this.files)P=this.files[B],(C=B.slice(this.root.length,B.length))&&B.slice(0,this.root.length)===this.root&&x(C,P)},filter:function(x){var B=[];return this.forEach(function(C,P){x(C,P)&&B.push(P)}),B},file:function(x,B,C){if(arguments.length!==1)return x=this.root+x,u.call(this,x,B,C),this;if(v(x)){var P=x;return this.filter(function(H,X){return!X.dir&&P.test(H)})}var R=this.files[this.root+x];return R&&!R.dir?R:null},folder:function(x){if(!x)return this;if(v(x))return this.filter(function(R,H){return H.dir&&x.test(R)});var B=this.root+x,C=p.call(this,B),P=this.clone();return P.root=C.name,P},remove:function(x){x=this.root+x;var B=this.files[x];if(B||(x.slice(-1)!=="/"&&(x+="/"),B=this.files[x]),B&&!B.dir)delete this.files[x];else for(var C=this.filter(function(R,H){return H.name.slice(0,x.length)===x}),P=0;P<C.length;P++)delete this.files[C[P].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(x){var B,C={};try{if((C=r.extend(x||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:s.utf8encode})).type=C.type.toLowerCase(),C.compression=C.compression.toUpperCase(),C.type==="binarystring"&&(C.type="string"),!C.type)throw new Error("No output type specified.");r.checkSupport(C.type),C.platform!=="darwin"&&C.platform!=="freebsd"&&C.platform!=="linux"&&C.platform!=="sunos"||(C.platform="UNIX"),C.platform==="win32"&&(C.platform="DOS");var P=C.comment||this.comment||"";B=i.generateWorker(this,C,P)}catch(R){(B=new a("error")).error(R)}return new m(B,C.type||"string",C.mimeType)},generateAsync:function(x,B){return this.generateInternalStream(x).accumulate(B)},generateNodeStream:function(x,B){return(x=x||{}).type||(x.type="nodebuffer"),this.generateInternalStream(x).toNodejsStream(B)}};S.exports=E},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(f,S,_){S.exports=f("stream")},{stream:void 0}],17:[function(f,S,_){var u=f("./DataReader");function s(r){u.call(this,r);for(var a=0;a<this.data.length;a++)r[a]=255&r[a]}f("../utils").inherits(s,u),s.prototype.byteAt=function(r){return this.data[this.zero+r]},s.prototype.lastIndexOfSignature=function(r){for(var a=r.charCodeAt(0),m=r.charCodeAt(1),w=r.charCodeAt(2),g=r.charCodeAt(3),y=this.length-4;0<=y;--y)if(this.data[y]===a&&this.data[y+1]===m&&this.data[y+2]===w&&this.data[y+3]===g)return y-this.zero;return-1},s.prototype.readAndCheckSignature=function(r){var a=r.charCodeAt(0),m=r.charCodeAt(1),w=r.charCodeAt(2),g=r.charCodeAt(3),y=this.readData(4);return a===y[0]&&m===y[1]&&w===y[2]&&g===y[3]},s.prototype.readData=function(r){if(this.checkOffset(r),r===0)return[];var a=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,a},S.exports=s},{"../utils":32,"./DataReader":18}],18:[function(f,S,_){var u=f("../utils");function s(r){this.data=r,this.length=r.length,this.index=0,this.zero=0}s.prototype={checkOffset:function(r){this.checkIndex(this.index+r)},checkIndex:function(r){if(this.length<this.zero+r||r<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+r+"). Corrupted zip ?")},setIndex:function(r){this.checkIndex(r),this.index=r},skip:function(r){this.setIndex(this.index+r)},byteAt:function(){},readInt:function(r){var a,m=0;for(this.checkOffset(r),a=this.index+r-1;a>=this.index;a--)m=(m<<8)+this.byteAt(a);return this.index+=r,m},readString:function(r){return u.transformTo("string",this.readData(r))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var r=this.readInt(4);return new Date(Date.UTC(1980+(r>>25&127),(r>>21&15)-1,r>>16&31,r>>11&31,r>>5&63,(31&r)<<1))}},S.exports=s},{"../utils":32}],19:[function(f,S,_){var u=f("./Uint8ArrayReader");function s(r){u.call(this,r)}f("../utils").inherits(s,u),s.prototype.readData=function(r){this.checkOffset(r);var a=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,a},S.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(f,S,_){var u=f("./DataReader");function s(r){u.call(this,r)}f("../utils").inherits(s,u),s.prototype.byteAt=function(r){return this.data.charCodeAt(this.zero+r)},s.prototype.lastIndexOfSignature=function(r){return this.data.lastIndexOf(r)-this.zero},s.prototype.readAndCheckSignature=function(r){return r===this.readData(4)},s.prototype.readData=function(r){this.checkOffset(r);var a=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,a},S.exports=s},{"../utils":32,"./DataReader":18}],21:[function(f,S,_){var u=f("./ArrayReader");function s(r){u.call(this,r)}f("../utils").inherits(s,u),s.prototype.readData=function(r){if(this.checkOffset(r),r===0)return new Uint8Array(0);var a=this.data.subarray(this.zero+this.index,this.zero+this.index+r);return this.index+=r,a},S.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(f,S,_){var u=f("../utils"),s=f("../support"),r=f("./ArrayReader"),a=f("./StringReader"),m=f("./NodeBufferReader"),w=f("./Uint8ArrayReader");S.exports=function(g){var y=u.getTypeOf(g);return u.checkSupport(y),y!=="string"||s.uint8array?y==="nodebuffer"?new m(g):s.uint8array?new w(u.transformTo("uint8array",g)):new r(u.transformTo("array",g)):new a(g)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(f,S,_){_.LOCAL_FILE_HEADER="PK",_.CENTRAL_FILE_HEADER="PK",_.CENTRAL_DIRECTORY_END="PK",_.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",_.ZIP64_CENTRAL_DIRECTORY_END="PK",_.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(f,S,_){var u=f("./GenericWorker"),s=f("../utils");function r(a){u.call(this,"ConvertWorker to "+a),this.destType=a}s.inherits(r,u),r.prototype.processChunk=function(a){this.push({data:s.transformTo(this.destType,a.data),meta:a.meta})},S.exports=r},{"../utils":32,"./GenericWorker":28}],25:[function(f,S,_){var u=f("./GenericWorker"),s=f("../crc32");function r(){u.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}f("../utils").inherits(r,u),r.prototype.processChunk=function(a){this.streamInfo.crc32=s(a.data,this.streamInfo.crc32||0),this.push(a)},S.exports=r},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(f,S,_){var u=f("../utils"),s=f("./GenericWorker");function r(a){s.call(this,"DataLengthProbe for "+a),this.propName=a,this.withStreamInfo(a,0)}u.inherits(r,s),r.prototype.processChunk=function(a){if(a){var m=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=m+a.data.length}s.prototype.processChunk.call(this,a)},S.exports=r},{"../utils":32,"./GenericWorker":28}],27:[function(f,S,_){var u=f("../utils"),s=f("./GenericWorker");function r(a){s.call(this,"DataWorker");var m=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,a.then(function(w){m.dataIsReady=!0,m.data=w,m.max=w&&w.length||0,m.type=u.getTypeOf(w),m.isPaused||m._tickAndRepeat()},function(w){m.error(w)})}u.inherits(r,s),r.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},r.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,u.delay(this._tickAndRepeat,[],this)),!0)},r.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(u.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},r.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var a=null,m=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":a=this.data.substring(this.index,m);break;case"uint8array":a=this.data.subarray(this.index,m);break;case"array":case"nodebuffer":a=this.data.slice(this.index,m)}return this.index=m,this.push({data:a,meta:{percent:this.max?this.index/this.max*100:0}})},S.exports=r},{"../utils":32,"./GenericWorker":28}],28:[function(f,S,_){function u(s){this.name=s||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}u.prototype={push:function(s){this.emit("data",s)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(s){this.emit("error",s)}return!0},error:function(s){return!this.isFinished&&(this.isPaused?this.generatedError=s:(this.isFinished=!0,this.emit("error",s),this.previous&&this.previous.error(s),this.cleanUp()),!0)},on:function(s,r){return this._listeners[s].push(r),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(s,r){if(this._listeners[s])for(var a=0;a<this._listeners[s].length;a++)this._listeners[s][a].call(this,r)},pipe:function(s){return s.registerPrevious(this)},registerPrevious:function(s){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=s.streamInfo,this.mergeStreamInfo(),this.previous=s;var r=this;return s.on("data",function(a){r.processChunk(a)}),s.on("end",function(){r.end()}),s.on("error",function(a){r.error(a)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var s=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),s=!0),this.previous&&this.previous.resume(),!s},flush:function(){},processChunk:function(s){this.push(s)},withStreamInfo:function(s,r){return this.extraStreamInfo[s]=r,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var s in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,s)&&(this.streamInfo[s]=this.extraStreamInfo[s])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var s="Worker "+this.name;return this.previous?this.previous+" -> "+s:s}},S.exports=u},{}],29:[function(f,S,_){var u=f("../utils"),s=f("./ConvertWorker"),r=f("./GenericWorker"),a=f("../base64"),m=f("../support"),w=f("../external"),g=null;if(m.nodestream)try{g=f("../nodejs/NodejsStreamOutputAdapter")}catch{}function y(d,n){return new w.Promise(function(h,o){var p=[],v=d._internalType,E=d._outputType,x=d._mimeType;d.on("data",function(B,C){p.push(B),n&&n(C)}).on("error",function(B){p=[],o(B)}).on("end",function(){try{var B=(function(C,P,R){switch(C){case"blob":return u.newBlob(u.transformTo("arraybuffer",P),R);case"base64":return a.encode(P);default:return u.transformTo(C,P)}})(E,(function(C,P){var R,H=0,X=null,b=0;for(R=0;R<P.length;R++)b+=P[R].length;switch(C){case"string":return P.join("");case"array":return Array.prototype.concat.apply([],P);case"uint8array":for(X=new Uint8Array(b),R=0;R<P.length;R++)X.set(P[R],H),H+=P[R].length;return X;case"nodebuffer":return Buffer.concat(P);default:throw new Error("concat : unsupported type '"+C+"'")}})(v,p),x);h(B)}catch(C){o(C)}p=[]}).resume()})}function i(d,n,h){var o=n;switch(n){case"blob":case"arraybuffer":o="uint8array";break;case"base64":o="string"}try{this._internalType=o,this._outputType=n,this._mimeType=h,u.checkSupport(o),this._worker=d.pipe(new s(o)),d.lock()}catch(p){this._worker=new r("error"),this._worker.error(p)}}i.prototype={accumulate:function(d){return y(this,d)},on:function(d,n){var h=this;return d==="data"?this._worker.on(d,function(o){n.call(h,o.data,o.meta)}):this._worker.on(d,function(){u.delay(n,arguments,h)}),this},resume:function(){return u.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(d){if(u.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new g(this,{objectMode:this._outputType!=="nodebuffer"},d)}},S.exports=i},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(f,S,_){if(_.base64=!0,_.array=!0,_.string=!0,_.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",_.nodebuffer=typeof Buffer<"u",_.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")_.blob=!1;else{var u=new ArrayBuffer(0);try{_.blob=new Blob([u],{type:"application/zip"}).size===0}catch{try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);s.append(u),_.blob=s.getBlob("application/zip").size===0}catch{_.blob=!1}}}try{_.nodestream=!!f("readable-stream").Readable}catch{_.nodestream=!1}},{"readable-stream":16}],31:[function(f,S,_){for(var u=f("./utils"),s=f("./support"),r=f("./nodejsUtils"),a=f("./stream/GenericWorker"),m=new Array(256),w=0;w<256;w++)m[w]=252<=w?6:248<=w?5:240<=w?4:224<=w?3:192<=w?2:1;m[254]=m[254]=1;function g(){a.call(this,"utf-8 decode"),this.leftOver=null}function y(){a.call(this,"utf-8 encode")}_.utf8encode=function(i){return s.nodebuffer?r.newBufferFrom(i,"utf-8"):(function(d){var n,h,o,p,v,E=d.length,x=0;for(p=0;p<E;p++)(64512&(h=d.charCodeAt(p)))==55296&&p+1<E&&(64512&(o=d.charCodeAt(p+1)))==56320&&(h=65536+(h-55296<<10)+(o-56320),p++),x+=h<128?1:h<2048?2:h<65536?3:4;for(n=s.uint8array?new Uint8Array(x):new Array(x),p=v=0;v<x;p++)(64512&(h=d.charCodeAt(p)))==55296&&p+1<E&&(64512&(o=d.charCodeAt(p+1)))==56320&&(h=65536+(h-55296<<10)+(o-56320),p++),h<128?n[v++]=h:(h<2048?n[v++]=192|h>>>6:(h<65536?n[v++]=224|h>>>12:(n[v++]=240|h>>>18,n[v++]=128|h>>>12&63),n[v++]=128|h>>>6&63),n[v++]=128|63&h);return n})(i)},_.utf8decode=function(i){return s.nodebuffer?u.transformTo("nodebuffer",i).toString("utf-8"):(function(d){var n,h,o,p,v=d.length,E=new Array(2*v);for(n=h=0;n<v;)if((o=d[n++])<128)E[h++]=o;else if(4<(p=m[o]))E[h++]=65533,n+=p-1;else{for(o&=p===2?31:p===3?15:7;1<p&&n<v;)o=o<<6|63&d[n++],p--;1<p?E[h++]=65533:o<65536?E[h++]=o:(o-=65536,E[h++]=55296|o>>10&1023,E[h++]=56320|1023&o)}return E.length!==h&&(E.subarray?E=E.subarray(0,h):E.length=h),u.applyFromCharCode(E)})(i=u.transformTo(s.uint8array?"uint8array":"array",i))},u.inherits(g,a),g.prototype.processChunk=function(i){var d=u.transformTo(s.uint8array?"uint8array":"array",i.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var n=d;(d=new Uint8Array(n.length+this.leftOver.length)).set(this.leftOver,0),d.set(n,this.leftOver.length)}else d=this.leftOver.concat(d);this.leftOver=null}var h=(function(p,v){var E;for((v=v||p.length)>p.length&&(v=p.length),E=v-1;0<=E&&(192&p[E])==128;)E--;return E<0||E===0?v:E+m[p[E]]>v?E:v})(d),o=d;h!==d.length&&(s.uint8array?(o=d.subarray(0,h),this.leftOver=d.subarray(h,d.length)):(o=d.slice(0,h),this.leftOver=d.slice(h,d.length))),this.push({data:_.utf8decode(o),meta:i.meta})},g.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:_.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},_.Utf8DecodeWorker=g,u.inherits(y,a),y.prototype.processChunk=function(i){this.push({data:_.utf8encode(i.data),meta:i.meta})},_.Utf8EncodeWorker=y},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(f,S,_){var u=f("./support"),s=f("./base64"),r=f("./nodejsUtils"),a=f("./external");function m(n){return n}function w(n,h){for(var o=0;o<n.length;++o)h[o]=255&n.charCodeAt(o);return h}f("setimmediate"),_.newBlob=function(n,h){_.checkSupport("blob");try{return new Blob([n],{type:h})}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return o.append(n),o.getBlob(h)}catch{throw new Error("Bug : can't construct the Blob.")}}};var g={stringifyByChunk:function(n,h,o){var p=[],v=0,E=n.length;if(E<=o)return String.fromCharCode.apply(null,n);for(;v<E;)h==="array"||h==="nodebuffer"?p.push(String.fromCharCode.apply(null,n.slice(v,Math.min(v+o,E)))):p.push(String.fromCharCode.apply(null,n.subarray(v,Math.min(v+o,E)))),v+=o;return p.join("")},stringifyByChar:function(n){for(var h="",o=0;o<n.length;o++)h+=String.fromCharCode(n[o]);return h},applyCanBeUsed:{uint8array:(function(){try{return u.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return u.nodebuffer&&String.fromCharCode.apply(null,r.allocBuffer(1)).length===1}catch{return!1}})()}};function y(n){var h=65536,o=_.getTypeOf(n),p=!0;if(o==="uint8array"?p=g.applyCanBeUsed.uint8array:o==="nodebuffer"&&(p=g.applyCanBeUsed.nodebuffer),p)for(;1<h;)try{return g.stringifyByChunk(n,o,h)}catch{h=Math.floor(h/2)}return g.stringifyByChar(n)}function i(n,h){for(var o=0;o<n.length;o++)h[o]=n[o];return h}_.applyFromCharCode=y;var d={};d.string={string:m,array:function(n){return w(n,new Array(n.length))},arraybuffer:function(n){return d.string.uint8array(n).buffer},uint8array:function(n){return w(n,new Uint8Array(n.length))},nodebuffer:function(n){return w(n,r.allocBuffer(n.length))}},d.array={string:y,array:m,arraybuffer:function(n){return new Uint8Array(n).buffer},uint8array:function(n){return new Uint8Array(n)},nodebuffer:function(n){return r.newBufferFrom(n)}},d.arraybuffer={string:function(n){return y(new Uint8Array(n))},array:function(n){return i(new Uint8Array(n),new Array(n.byteLength))},arraybuffer:m,uint8array:function(n){return new Uint8Array(n)},nodebuffer:function(n){return r.newBufferFrom(new Uint8Array(n))}},d.uint8array={string:y,array:function(n){return i(n,new Array(n.length))},arraybuffer:function(n){return n.buffer},uint8array:m,nodebuffer:function(n){return r.newBufferFrom(n)}},d.nodebuffer={string:y,array:function(n){return i(n,new Array(n.length))},arraybuffer:function(n){return d.nodebuffer.uint8array(n).buffer},uint8array:function(n){return i(n,new Uint8Array(n.length))},nodebuffer:m},_.transformTo=function(n,h){if(h=h||"",!n)return h;_.checkSupport(n);var o=_.getTypeOf(h);return d[o][n](h)},_.resolve=function(n){for(var h=n.split("/"),o=[],p=0;p<h.length;p++){var v=h[p];v==="."||v===""&&p!==0&&p!==h.length-1||(v===".."?o.pop():o.push(v))}return o.join("/")},_.getTypeOf=function(n){return typeof n=="string"?"string":Object.prototype.toString.call(n)==="[object Array]"?"array":u.nodebuffer&&r.isBuffer(n)?"nodebuffer":u.uint8array&&n instanceof Uint8Array?"uint8array":u.arraybuffer&&n instanceof ArrayBuffer?"arraybuffer":void 0},_.checkSupport=function(n){if(!u[n.toLowerCase()])throw new Error(n+" is not supported by this platform")},_.MAX_VALUE_16BITS=65535,_.MAX_VALUE_32BITS=-1,_.pretty=function(n){var h,o,p="";for(o=0;o<(n||"").length;o++)p+="\\x"+((h=n.charCodeAt(o))<16?"0":"")+h.toString(16).toUpperCase();return p},_.delay=function(n,h,o){setImmediate(function(){n.apply(o||null,h||[])})},_.inherits=function(n,h){function o(){}o.prototype=h.prototype,n.prototype=new o},_.extend=function(){var n,h,o={};for(n=0;n<arguments.length;n++)for(h in arguments[n])Object.prototype.hasOwnProperty.call(arguments[n],h)&&o[h]===void 0&&(o[h]=arguments[n][h]);return o},_.prepareContent=function(n,h,o,p,v){return a.Promise.resolve(h).then(function(E){return u.blob&&(E instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(E))!==-1)&&typeof FileReader<"u"?new a.Promise(function(x,B){var C=new FileReader;C.onload=function(P){x(P.target.result)},C.onerror=function(P){B(P.target.error)},C.readAsArrayBuffer(E)}):E}).then(function(E){var x=_.getTypeOf(E);return x?(x==="arraybuffer"?E=_.transformTo("uint8array",E):x==="string"&&(v?E=s.decode(E):o&&p!==!0&&(E=(function(B){return w(B,u.uint8array?new Uint8Array(B.length):new Array(B.length))})(E))),E):a.Promise.reject(new Error("Can't read the data of '"+n+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(f,S,_){var u=f("./reader/readerFor"),s=f("./utils"),r=f("./signature"),a=f("./zipEntry"),m=f("./support");function w(g){this.files=[],this.loadOptions=g}w.prototype={checkSignature:function(g){if(!this.reader.readAndCheckSignature(g)){this.reader.index-=4;var y=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+s.pretty(y)+", expected "+s.pretty(g)+")")}},isSignature:function(g,y){var i=this.reader.index;this.reader.setIndex(g);var d=this.reader.readString(4)===y;return this.reader.setIndex(i),d},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);var g=this.reader.readData(this.zipCommentLength),y=m.uint8array?"uint8array":"array",i=s.transformTo(y,g);this.zipComment=this.loadOptions.decodeFileName(i)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),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={};for(var g,y,i,d=this.zip64EndOfCentralSize-44;0<d;)g=this.reader.readInt(2),y=this.reader.readInt(4),i=this.reader.readData(y),this.zip64ExtensibleData[g]={id:g,length:y,value:i}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var g,y;for(g=0;g<this.files.length;g++)y=this.files[g],this.reader.setIndex(y.localHeaderOffset),this.checkSignature(r.LOCAL_FILE_HEADER),y.readLocalPart(this.reader),y.handleUTF8(),y.processAttributes()},readCentralDir:function(){var g;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(r.CENTRAL_FILE_HEADER);)(g=new a({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(g);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var g=this.reader.lastIndexOfSignature(r.CENTRAL_DIRECTORY_END);if(g<0)throw this.isSignature(0,r.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(g);var y=g;if(this.checkSignature(r.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===s.MAX_VALUE_16BITS||this.diskWithCentralDirStart===s.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===s.MAX_VALUE_16BITS||this.centralDirRecords===s.MAX_VALUE_16BITS||this.centralDirSize===s.MAX_VALUE_32BITS||this.centralDirOffset===s.MAX_VALUE_32BITS){if(this.zip64=!0,(g=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(g),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,r.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var i=this.centralDirOffset+this.centralDirSize;this.zip64&&(i+=20,i+=12+this.zip64EndOfCentralSize);var d=y-i;if(0<d)this.isSignature(y,r.CENTRAL_FILE_HEADER)||(this.reader.zero=d);else if(d<0)throw new Error("Corrupted zip: missing "+Math.abs(d)+" bytes.")},prepareReader:function(g){this.reader=u(g)},load:function(g){this.prepareReader(g),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},S.exports=w},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(f,S,_){var u=f("./reader/readerFor"),s=f("./utils"),r=f("./compressedObject"),a=f("./crc32"),m=f("./utf8"),w=f("./compressions"),g=f("./support");function y(i,d){this.options=i,this.loadOptions=d}y.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(i){var d,n;if(i.skip(22),this.fileNameLength=i.readInt(2),n=i.readInt(2),this.fileName=i.readData(this.fileNameLength),i.skip(n),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((d=(function(h){for(var o in w)if(Object.prototype.hasOwnProperty.call(w,o)&&w[o].magic===h)return w[o];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+s.pretty(this.compressionMethod)+" unknown (inner file : "+s.transformTo("string",this.fileName)+")");this.decompressed=new r(this.compressedSize,this.uncompressedSize,this.crc32,d,i.readData(this.compressedSize))},readCentralPart:function(i){this.versionMadeBy=i.readInt(2),i.skip(2),this.bitFlag=i.readInt(2),this.compressionMethod=i.readString(2),this.date=i.readDate(),this.crc32=i.readInt(4),this.compressedSize=i.readInt(4),this.uncompressedSize=i.readInt(4);var d=i.readInt(2);if(this.extraFieldsLength=i.readInt(2),this.fileCommentLength=i.readInt(2),this.diskNumberStart=i.readInt(2),this.internalFileAttributes=i.readInt(2),this.externalFileAttributes=i.readInt(4),this.localHeaderOffset=i.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");i.skip(d),this.readExtraFields(i),this.parseZIP64ExtraField(i),this.fileComment=i.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var i=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),i==0&&(this.dosPermissions=63&this.externalFileAttributes),i==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var i=u(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=i.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=i.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=i.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=i.readInt(4))}},readExtraFields:function(i){var d,n,h,o=i.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});i.index+4<o;)d=i.readInt(2),n=i.readInt(2),h=i.readData(n),this.extraFields[d]={id:d,length:n,value:h};i.setIndex(o)},handleUTF8:function(){var i=g.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=m.utf8decode(this.fileName),this.fileCommentStr=m.utf8decode(this.fileComment);else{var d=this.findExtraFieldUnicodePath();if(d!==null)this.fileNameStr=d;else{var n=s.transformTo(i,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(n)}var h=this.findExtraFieldUnicodeComment();if(h!==null)this.fileCommentStr=h;else{var o=s.transformTo(i,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(o)}}},findExtraFieldUnicodePath:function(){var i=this.extraFields[28789];if(i){var d=u(i.value);return d.readInt(1)!==1||a(this.fileName)!==d.readInt(4)?null:m.utf8decode(d.readData(i.length-5))}return null},findExtraFieldUnicodeComment:function(){var i=this.extraFields[25461];if(i){var d=u(i.value);return d.readInt(1)!==1||a(this.fileComment)!==d.readInt(4)?null:m.utf8decode(d.readData(i.length-5))}return null}},S.exports=y},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(f,S,_){function u(d,n,h){this.name=d,this.dir=h.dir,this.date=h.date,this.comment=h.comment,this.unixPermissions=h.unixPermissions,this.dosPermissions=h.dosPermissions,this._data=n,this._dataBinary=h.binary,this.options={compression:h.compression,compressionOptions:h.compressionOptions}}var s=f("./stream/StreamHelper"),r=f("./stream/DataWorker"),a=f("./utf8"),m=f("./compressedObject"),w=f("./stream/GenericWorker");u.prototype={internalStream:function(d){var n=null,h="string";try{if(!d)throw new Error("No output type specified.");var o=(h=d.toLowerCase())==="string"||h==="text";h!=="binarystring"&&h!=="text"||(h="string"),n=this._decompressWorker();var p=!this._dataBinary;p&&!o&&(n=n.pipe(new a.Utf8EncodeWorker)),!p&&o&&(n=n.pipe(new a.Utf8DecodeWorker))}catch(v){(n=new w("error")).error(v)}return new s(n,h,"")},async:function(d,n){return this.internalStream(d).accumulate(n)},nodeStream:function(d,n){return this.internalStream(d||"nodebuffer").toNodejsStream(n)},_compressWorker:function(d,n){if(this._data instanceof m&&this._data.compression.magic===d.magic)return this._data.getCompressedWorker();var h=this._decompressWorker();return this._dataBinary||(h=h.pipe(new a.Utf8EncodeWorker)),m.createWorkerFrom(h,d,n)},_decompressWorker:function(){return this._data instanceof m?this._data.getContentWork