01c7f7d55d
Former-commit-id: 89c43b4cd8
247 lines
No EOL
116 KiB
JavaScript
247 lines
No EOL
116 KiB
JavaScript
/*
|
||
JSZip v3.1.3 - A Javascript class for generating and reading zip files
|
||
<http://stuartk.com/jszip>
|
||
|
||
(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
|
||
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown.
|
||
|
||
JSZip uses the library pako released under the MIT license :
|
||
https://github.com/nodeca/pako/blob/master/LICENSE
|
||
*/
|
||
!function(w){"object"==typeof exports&&"undefined"!=typeof module?module.exports=w():"function"==typeof define&&define.amd?define([],w):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).JSZip=w()}(function(){return function b(f,c,a){function e(g,l){if(!c[g]){if(!f[g]){var h="function"==typeof require&&require;if(!l&&h)return h(g,!0);if(d)return d(g,!0);h=Error("Cannot find module '"+g+"'");throw h.code="MODULE_NOT_FOUND",h;}h=c[g]={exports:{}};
|
||
f[g][0].call(h.exports,function(d){var a=f[g][1][d];return e(a?a:d)},h,h.exports,b,f,c,a)}return c[g].exports}for(var d="function"==typeof require&&require,g=0;g<a.length;g++)e(a[g]);return e}({1:[function(b,f,c){var a=b("./utils"),e=b("./support");c.encode=function(d){for(var e,b,c,n,q,u,y,F=[],f=0,H=d.length,v="string"!==a.getTypeOf(d);f<d.length;)y=H-f,v?(e=d[f++],b=f<H?d[f++]:0,c=f<H?d[f++]:0):(e=d.charCodeAt(f++),b=f<H?d.charCodeAt(f++):0,c=f<H?d.charCodeAt(f++):0),n=e>>2,q=(3&e)<<4|b>>4,u=1<
|
||
y?(15&b)<<2|c>>6:64,y=2<y?63&c:64,F.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(n)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(q)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(u)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(y));return F.join("")};c.decode=function(d){var a,b,c,n,q,u=0,y=0;if("data:"===d.substr(0,5))throw Error("Invalid base64 input, it looks like a data url.");
|
||
d=d.replace(/[^A-Za-z0-9\+\/\=]/g,"");n=3*d.length/4;if("="===d.charAt(d.length-1)&&n--,"="===d.charAt(d.length-2)&&n--,0!==n%1)throw Error("Invalid base64 input, bad content length.");var F;for(F=e.uint8array?new Uint8Array(0|n):Array(0|n);u<d.length;)a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(d.charAt(u++)),b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(d.charAt(u++)),n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(d.charAt(u++)),
|
||
q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(d.charAt(u++)),a=a<<2|b>>4,b=(15&b)<<4|n>>2,c=(3&n)<<6|q,F[y++]=a,64!==n&&(F[y++]=b),64!==q&&(F[y++]=c);return F}},{"./support":30,"./utils":32}],2:[function(b,f,c){function a(a,d,b,e,g){this.compressedSize=a;this.uncompressedSize=d;this.crc32=b;this.compression=e;this.compressedContent=g}var e=b("./external"),d=b("./stream/DataWorker"),g=b("./stream/DataLengthProbe"),h=b("./stream/Crc32Probe"),g=b("./stream/DataLengthProbe");
|
||
a.prototype={getContentWorker:function(){var a=(new d(e.Promise.resolve(this.compressedContent))).pipe(this.compression.uncompressWorker()).pipe(new g("data_length")),b=this;return a.on("end",function(){if(this.streamInfo.data_length!==b.uncompressedSize)throw Error("Bug : uncompressed data size mismatch");}),a},getCompressedWorker:function(){return(new d(e.Promise.resolve(this.compressedContent))).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",
|
||
this.crc32).withStreamInfo("compression",this.compression)}};a.createWorkerFrom=function(a,d,b){return a.pipe(new h).pipe(new g("uncompressedSize")).pipe(d.compressWorker(b)).pipe(new g("compressedSize")).withStreamInfo("compression",d)};f.exports=a},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(b,f,c){var a=b("./stream/GenericWorker");c.STORE={magic:"\x00\x00",compressWorker:function(b){return new a("STORE compression")},uncompressWorker:function(){return new a("STORE decompression")}};
|
||
c.DEFLATE=b("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(b,f,c){var a=b("./utils"),e=function(){for(var a,b=[],e=0;256>e;e++){a=e;for(var c=0;8>c;c++)a=1&a?3988292384^a>>>1:a>>>1;b[e]=a}return b}();f.exports=function(d,b){if("undefined"==typeof d||!d.length)return 0;var g;if("string"!==a.getTypeOf(d)){var c=0+d.length;g=(0|b)^-1;for(var n=0;n<c;n++)g=g>>>8^e[255&(g^d[n])]}else for(c=0+d.length,g=(0|b)^-1,n=0;n<c;n++)g=g>>>8^e[255&(g^d.charCodeAt(n))];return g^=-1}},{"./utils":32}],
|
||
5:[function(b,f,c){c.base64=!1;c.binary=!1;c.dir=!1;c.createFolders=!0;c.date=null;c.compression=null;c.compressionOptions=null;c.comment=null;c.unixPermissions=null;c.dosPermissions=null},{}],6:[function(b,f,c){b="undefined"!=typeof Promise?Promise:b("lie");f.exports={Promise:b}},{lie:58}],7:[function(b,f,c){function a(a,d){g.call(this,"FlateWorker/"+a);this._pako=new e[a]({raw:!0,level:d.level||-1});this.meta={};var b=this;this._pako.onData=function(a){b.push({data:a,meta:b.meta})}}f="undefined"!=
|
||
typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array;var e=b("pako"),d=b("./utils"),g=b("./stream/GenericWorker"),h=f?"uint8array":"array";c.magic="\b\x00";d.inherits(a,g);a.prototype.processChunk=function(a){this.meta=a.meta;this._pako.push(d.transformTo(h,a.data),!1)};a.prototype.flush=function(){g.prototype.flush.call(this);this._pako.push([],!0)};a.prototype.cleanUp=function(){g.prototype.cleanUp.call(this);this._pako=null};c.compressWorker=function(d){return new a("Deflate",
|
||
d)};c.uncompressWorker=function(){return new a("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:59}],8:[function(b,f,c){function a(a,b,e,g){d.call(this,"ZipFileWorker");this.bytesWritten=0;this.zipComment=b;this.zipPlatform=e;this.encodeFileName=g;this.streamFiles=a;this.accumulate=!1;this.contentBuffer=[];this.dirRecords=[];this.entriesCount=this.currentSourceOffset=0;this.currentFile=null;this._sources=[]}var e=b("../utils"),d=b("../stream/GenericWorker"),g=b("../utf8"),h=b("../crc32"),
|
||
l=b("../signature"),n=function(a,d){var b,e="";for(b=0;b<d;b++)e+=String.fromCharCode(255&a),a>>>=8;return e},q=function(a,d,b,c,v,u){var t,y;t=a.file;var H=a.compression,z=u!==g.utf8encode,q=e.transformTo("string",u(t.name)),p=e.transformTo("string",g.utf8encode(t.name)),f=t.comment;u=e.transformTo("string",u(f));var x=e.transformTo("string",g.utf8encode(f)),F=p.length!==t.name.length,D=x.length!==f.length,G=f="",X="";y=t.dir;var T=t.date,aa=0,V=0,r=0;d&&!b||(aa=a.crc32,V=a.compressedSize,r=a.uncompressedSize);
|
||
a=0;d&&(a|=8);z||!F&&!D||(a|=2048);d=0;y&&(d|=16);"UNIX"===v?(v=798,t=z=t.unixPermissions,y=(z||(t=y?16893:33204),(65535&t)<<16),d|=y):(v=20,d|=63&(t.dosPermissions||0));t=T.getUTCHours();t=t<<6|T.getUTCMinutes();t=t<<5|T.getUTCSeconds()/2;y=T.getUTCFullYear()-1980;y=y<<4|T.getUTCMonth()+1;y=y<<5|T.getUTCDate();F&&(G=n(1,1)+n(h(q),4)+p,f+="up"+n(G.length,2)+G);D&&(X=n(1,1)+n(h(u),4)+x,f+="uc"+n(X.length,2)+X);p="\n\x00"+n(a,2);p+=H.magic;p+=n(t,2);p+=n(y,2);p+=n(aa,4);p+=n(V,4);p+=n(r,4);p+=n(q.length,
|
||
2);p+=n(f.length,2);H=l.LOCAL_FILE_HEADER+p+q+f;c=l.CENTRAL_FILE_HEADER+n(v,2)+p+n(u.length,2)+"\x00\x00\x00\x00"+n(d,4)+n(c,4)+q+f+u;return{fileRecord:H,dirRecord:c}},u=function(a){return l.DATA_DESCRIPTOR+n(a.crc32,4)+n(a.compressedSize,4)+n(a.uncompressedSize,4)};e.inherits(a,d);a.prototype.push=function(a){var b=a.meta.percent||0,e=this.entriesCount,g=this._sources.length;this.accumulate?this.contentBuffer.push(a):(this.bytesWritten+=a.data.length,d.prototype.push.call(this,{data:a.data,meta:{currentFile:this.currentFile,
|
||
percent:e?(b+100*(e-g-1))/e:100}}))};a.prototype.openedSource=function(a){this.currentSourceOffset=this.bytesWritten;this.currentFile=a.file.name;var d=this.streamFiles&&!a.file.dir;d?(a=q(a,d,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName),this.push({data:a.fileRecord,meta:{percent:0}})):this.accumulate=!0};a.prototype.closedSource=function(a){this.accumulate=!1;var d=this.streamFiles&&!a.file.dir,b=q(a,d,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(b.dirRecord),
|
||
d)this.push({data:u(a),meta:{percent:100}});else for(this.push({data:b.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null};a.prototype.flush=function(){for(var a=this.bytesWritten,d=0;d<this.dirRecords.length;d++)this.push({data:this.dirRecords[d],meta:{percent:100}});var d=this.dirRecords.length,b=this.bytesWritten-a,g=e.transformTo("string",(0,this.encodeFileName)(this.zipComment)),a=l.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+n(d,
|
||
2)+n(d,2)+n(b,4)+n(a,4)+n(g.length,2)+g;this.push({data:a,meta:{percent:100}})};a.prototype.prepareNextSource=function(){this.previous=this._sources.shift();this.openedSource(this.previous.streamInfo);this.isPaused?this.previous.pause():this.previous.resume()};a.prototype.registerPrevious=function(a){this._sources.push(a);var d=this;return a.on("data",function(a){d.processChunk(a)}),a.on("end",function(){d.closedSource(d.previous.streamInfo);d._sources.length?d.prepareNextSource():d.end()}),a.on("error",
|
||
function(a){d.error(a)}),this};a.prototype.resume=function(){return!!d.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))};a.prototype.error=function(a){var b=this._sources;if(!d.prototype.error.call(this,a))return!1;for(var e=0;e<b.length;e++)try{b[e].error(a)}catch(H){}return!0};a.prototype.lock=function(){d.prototype.lock.call(this);for(var a=this._sources,b=0;b<a.length;b++)a[b].lock()};
|
||
f.exports=a},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(b,f,c){var a=b("../compressions"),e=b("./ZipFileWorker");c.generateWorker=function(d,b,c){var g=new e(b.streamFiles,c,b.platform,b.encodeFileName),h=0;try{d.forEach(function(d,e){h++;var c=e.options.compression||b.compression,u=a[c];if(!u)throw Error(c+" is not a valid compression method !");var c=e.dir,n=e.date;e._compressWorker(u,e.options.compressionOptions||b.compressionOptions||
|
||
{}).withStreamInfo("file",{name:d,dir:c,date:n,comment:e.comment||"",unixPermissions:e.unixPermissions,dosPermissions:e.dosPermissions}).pipe(g)}),g.entriesCount=h}catch(q){g.error(q)}return g}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(b,f,c){function a(){if(!(this instanceof a))return new a;if(arguments.length)throw Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files={};this.comment=null;this.root="";this.clone=function(){var b=
|
||
new a,d;for(d in this)"function"!=typeof this[d]&&(b[d]=this[d]);return b}}a.prototype=b("./object");a.prototype.loadAsync=b("./load");a.support=b("./support");a.defaults=b("./defaults");a.version="3.1.3";a.loadAsync=function(b,d){return(new a).loadAsync(b,d)};a.external=b("./external");f.exports=a},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(b,f,c){function a(a){return new d.Promise(function(d,b){var e=a.decompressed.getContentWorker().pipe(new l);e.on("error",
|
||
function(a){b(a)}).on("end",function(){e.streamInfo.crc32!==a.decompressed.crc32?b(Error("Corrupted zip : CRC32 mismatch")):d()}).resume()})}var e=b("./utils"),d=b("./external"),g=b("./utf8"),e=b("./utils"),h=b("./zipEntries"),l=b("./stream/Crc32Probe"),n=b("./nodejsUtils");f.exports=function(b,c){var u=this;return c=e.extend(c||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:g.utf8decode}),n.isNode&&n.isStream(b)?d.Promise.reject(Error("JSZip can't accept a stream when loading a zip file.")):
|
||
e.prepareContent("the loaded zip file",b,!0,c.optimizedBinaryString,c.base64).then(function(a){var d=new h(c);return d.load(a),d}).then(function(b){var e=[d.Promise.resolve(b)];b=b.files;if(c.checkCRC32)for(var g=0;g<b.length;g++)e.push(a(b[g]));return d.Promise.all(e)}).then(function(a){a=a.shift();for(var d=a.files,b=0;b<d.length;b++){var e=d[b];u.file(e.fileNameStr,e.decompressed,{binary:!0,optimizedBinaryString:!0,date:e.date,dir:e.dir,comment:e.fileCommentStr.length?e.fileCommentStr:null,unixPermissions:e.unixPermissions,
|
||
dosPermissions:e.dosPermissions,createFolders:c.createFolders})}return a.zipComment.length&&(u.comment=a.zipComment),u})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(b,f,c){function a(a,b){e.call(this,"Nodejs stream input adapter for "+a);this._upstreamEnded=!1;this._bindStream(b)}c=b("../utils");var e=b("../stream/GenericWorker");c.inherits(a,e);a.prototype._bindStream=function(a){var d=this;this._stream=a;a.pause();a.on("data",
|
||
function(a){d.push({data:a,meta:{percent:0}})}).on("error",function(a){d.isPaused?this.generatedError=a:d.error(a)}).on("end",function(){d.isPaused?d._upstreamEnded=!0:d.end()})};a.prototype.pause=function(){return!!e.prototype.pause.call(this)&&(this._stream.pause(),!0)};a.prototype.resume=function(){return!!e.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)};f.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(b,f,c){function a(a,b,c){e.call(this,
|
||
b);this._helper=a;var d=this;a.on("data",function(a,b){d.push(a)||d._helper.pause();c&&c(b)}).on("error",function(a){d.emit("error",a)}).on("end",function(){d.push(null)})}var e=b("readable-stream").Readable;b("util").inherits(a,e);a.prototype._read=function(){this._helper.resume()};f.exports=a},{"readable-stream":16,util:void 0}],14:[function(b,f,c){f.exports={isNode:"undefined"!=typeof Buffer,newBuffer:function(a,b){return new Buffer(a,b)},isBuffer:function(a){return Buffer.isBuffer(a)},isStream:function(a){return a&&
|
||
"function"==typeof a.on&&"function"==typeof a.pause&&"function"==typeof a.resume}}},{}],15:[function(b,f,c){var a=b("./utf8"),e=b("./utils"),d=b("./stream/GenericWorker"),g=b("./stream/StreamHelper"),h=b("./defaults"),l=b("./compressedObject"),n=b("./zipObject"),q=b("./generate"),u=b("./nodejsUtils"),y=b("./nodejs/NodejsStreamInputAdapter"),F=function(a,b,t){var v,g=e.getTypeOf(b),c=e.extend(t||{},h);c.date=c.date||new Date;null!==c.compression&&(c.compression=c.compression.toUpperCase());"string"==
|
||
typeof c.unixPermissions&&(c.unixPermissions=parseInt(c.unixPermissions,8));c.unixPermissions&&16384&c.unixPermissions&&(c.dir=!0);c.dosPermissions&&16&c.dosPermissions&&(c.dir=!0);c.dir&&(a=D(a));var f;if(f=c.createFolders)v=a,"/"===v.slice(-1)&&(v=v.substring(0,v.length-1)),f=v.lastIndexOf("/"),f=v=0<f?v.substring(0,f):"";f&&H.call(this,v,!0);g="string"===g&&!1===c.binary&&!1===c.base64;t&&"undefined"!=typeof t.binary||(c.binary=!g);(b instanceof l&&0===b.uncompressedSize||c.dir||!b||0===b.length)&&
|
||
(c.base64=!1,c.binary=!0,b="",c.compression="STORE");b=b instanceof l||b instanceof d?b:u.isNode&&u.isStream(b)?new y(a,b):e.prepareContent(a,b,c.binary,c.optimizedBinaryString,c.base64);c=new n(a,b,c);this.files[a]=c},D=function(a){return"/"!==a.slice(-1)&&(a+="/"),a},H=function(a,d){return d="undefined"!=typeof d?d:h.createFolders,a=D(a),this.files[a]||F.call(this,a,null,{dir:!0,createFolders:d}),this.files[a]};f.exports={load:function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
|
||
},forEach:function(a){var d,b,e;for(d in this.files)this.files.hasOwnProperty(d)&&(e=this.files[d],b=d.slice(this.root.length,d.length),b&&d.slice(0,this.root.length)===this.root&&a(b,e))},filter:function(a){var d=[];return this.forEach(function(b,e){a(b,e)&&d.push(e)}),d},file:function(a,d,b){if(1===arguments.length){if("[object RegExp]"===Object.prototype.toString.call(a)){var e=a;return this.filter(function(a,d){return!d.dir&&e.test(a)})}var c=this.files[this.root+a];return c&&!c.dir?c:null}return a=
|
||
this.root+a,F.call(this,a,d,b),this},folder:function(a){if(!a)return this;if("[object RegExp]"===Object.prototype.toString.call(a))return this.filter(function(d,b){return b.dir&&a.test(d)});var d=H.call(this,this.root+a),b=this.clone();return b.root=d.name,b},remove:function(a){a=this.root+a;var d=this.files[a];if(d||("/"!==a.slice(-1)&&(a+="/"),d=this.files[a]),d&&!d.dir)delete this.files[a];else for(var d=this.filter(function(d,b){return b.name.slice(0,a.length)===a}),b=0;b<d.length;b++)delete this.files[d[b].name];
|
||
return this},generate:function(a){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");},generateInternalStream:function(b){var c,t={};try{if(t=e.extend(b||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:a.utf8encode}),t.type=t.type.toLowerCase(),t.compression=t.compression.toUpperCase(),"binarystring"===t.type&&(t.type="string"),!t.type)throw Error("No output type specified.");
|
||
e.checkSupport(t.type);"darwin"!==t.platform&&"freebsd"!==t.platform&&"linux"!==t.platform&&"sunos"!==t.platform||(t.platform="UNIX");"win32"===t.platform&&(t.platform="DOS");c=q.generateWorker(this,t,t.comment||this.comment||"")}catch(E){c=new d("error"),c.error(E)}return new g(c,t.type||"string",t.mimeType)},generateAsync:function(a,d){return this.generateInternalStream(a).accumulate(d)},generateNodeStream:function(a,d){return a=a||{},a.type||(a.type="nodebuffer"),this.generateInternalStream(a).toNodejsStream(d)}}},
|
||
{"./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(b,f,c){f.exports=b("stream")},{stream:void 0}],17:[function(b,f,c){function a(a){e.call(this,a);for(var d=0;d<this.data.length;d++)a[d]&=255}var e=b("./DataReader");b("../utils").inherits(a,e);a.prototype.byteAt=function(a){return this.data[this.zero+a]};a.prototype.lastIndexOfSignature=
|
||
function(a){var d=a.charCodeAt(0),b=a.charCodeAt(1),e=a.charCodeAt(2);a=a.charCodeAt(3);for(var c=this.length-4;0<=c;--c)if(this.data[c]===d&&this.data[c+1]===b&&this.data[c+2]===e&&this.data[c+3]===a)return c-this.zero;return-1};a.prototype.readAndCheckSignature=function(a){var d=a.charCodeAt(0),b=a.charCodeAt(1),e=a.charCodeAt(2);a=a.charCodeAt(3);var c=this.readData(4);return d===c[0]&&b===c[1]&&e===c[2]&&a===c[3]};a.prototype.readData=function(a){if(this.checkOffset(a),0===a)return[];var b=this.data.slice(this.zero+
|
||
this.index,this.zero+this.index+a);return this.index+=a,b};f.exports=a},{"../utils":32,"./DataReader":18}],18:[function(b,f,c){function a(a){this.data=a;this.length=a.length;this.zero=this.index=0}var e=b("../utils");a.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length<this.zero+a||0>a)throw Error("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?");},setIndex:function(a){this.checkIndex(a);this.index=a},
|
||
skip:function(a){this.setIndex(this.index+a)},byteAt:function(a){},readInt:function(a){var b,d=0;this.checkOffset(a);for(b=this.index+a-1;b>=this.index;b--)d=(d<<8)+this.byteAt(b);return this.index+=a,d},readString:function(a){return e.transformTo("string",this.readData(a))},readData:function(a){},lastIndexOfSignature:function(a){},readAndCheckSignature:function(a){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC((a>>25&127)+1980,(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<
|
||
1))}};f.exports=a},{"../utils":32}],19:[function(b,f,c){function a(a){e.call(this,a)}var e=b("./Uint8ArrayReader");b("../utils").inherits(a,e);a.prototype.readData=function(a){this.checkOffset(a);var b=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,b};f.exports=a},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(b,f,c){function a(a){e.call(this,a)}var e=b("./DataReader");b("../utils").inherits(a,e);a.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+
|
||
a)};a.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero};a.prototype.readAndCheckSignature=function(a){var b=this.readData(4);return a===b};a.prototype.readData=function(a){this.checkOffset(a);var b=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,b};f.exports=a},{"../utils":32,"./DataReader":18}],21:[function(b,f,c){function a(a){e.call(this,a)}var e=b("./ArrayReader");b("../utils").inherits(a,e);a.prototype.readData=function(a){if(this.checkOffset(a),
|
||
0===a)return new Uint8Array(0);var b=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,b};f.exports=a},{"../utils":32,"./ArrayReader":17}],22:[function(b,f,c){var a=b("../utils"),e=b("../support"),d=b("./ArrayReader"),g=b("./StringReader"),h=b("./NodeBufferReader"),l=b("./Uint8ArrayReader");f.exports=function(b){var c=a.getTypeOf(b);return a.checkSupport(c),"string"!==c||e.uint8array?"nodebuffer"===c?new h(b):e.uint8array?new l(a.transformTo("uint8array",b)):new d(a.transformTo("array",
|
||
b)):new g(b)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(b,f,c){c.LOCAL_FILE_HEADER="PK";c.CENTRAL_FILE_HEADER="PK";c.CENTRAL_DIRECTORY_END="PK";c.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK";c.ZIP64_CENTRAL_DIRECTORY_END="PK";c.DATA_DESCRIPTOR="PK\b"},{}],24:[function(b,f,c){function a(a){e.call(this,"ConvertWorker to "+a);this.destType=a}var e=b("./GenericWorker"),d=b("../utils");d.inherits(a,e);a.prototype.processChunk=
|
||
function(a){this.push({data:d.transformTo(this.destType,a.data),meta:a.meta})};f.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(b,f,c){function a(){e.call(this,"Crc32Probe");this.withStreamInfo("crc32",0)}var e=b("./GenericWorker"),d=b("../crc32");b("../utils").inherits(a,e);a.prototype.processChunk=function(a){this.streamInfo.crc32=d(a.data,this.streamInfo.crc32||0);this.push(a)};f.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(b,f,c){function a(a){e.call(this,
|
||
"DataLengthProbe for "+a);this.propName=a;this.withStreamInfo(a,0)}c=b("../utils");var e=b("./GenericWorker");c.inherits(a,e);a.prototype.processChunk=function(a){a&&(this.streamInfo[this.propName]=(this.streamInfo[this.propName]||0)+a.data.length);e.prototype.processChunk.call(this,a)};f.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(b,f,c){function a(a){d.call(this,"DataWorker");var b=this;this.dataIsReady=!1;this.max=this.index=0;this.data=null;this.type="";this._tickScheduled=!1;
|
||
a.then(function(a){b.dataIsReady=!0;b.data=a;b.max=a&&a.length||0;b.type=e.getTypeOf(a);b.isPaused||b._tickAndRepeat()},function(a){b.error(a)})}var e=b("../utils"),d=b("./GenericWorker");e.inherits(a,d);a.prototype.cleanUp=function(){d.prototype.cleanUp.call(this);this.data=null};a.prototype.resume=function(){return!!d.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,e.delay(this._tickAndRepeat,[],this)),!0)};a.prototype._tickAndRepeat=function(){this._tickScheduled=
|
||
!1;this.isPaused||this.isFinished||(this._tick(),this.isFinished||(e.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))};a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var a=null,b=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,b);break;case "uint8array":a=this.data.subarray(this.index,b);break;case "array":case "nodebuffer":a=this.data.slice(this.index,b)}return this.index=
|
||
b,this.push({data:a,meta:{percent:this.max?this.index/this.max*100:0}})};f.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(b,f,c){function a(a){this.name=a||"default";this.streamInfo={};this.generatedError=null;this.extraStreamInfo={};this.isPaused=!0;this.isLocked=this.isFinished=!1;this._listeners={data:[],end:[],error:[]};this.previous=null}a.prototype={push:function(a){this.emit("data",a)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),
|
||
this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(a){return!this.isFinished&&(this.isPaused?this.generatedError=a:(this.isFinished=!0,this.emit("error",a),this.previous&&this.previous.error(a),this.cleanUp()),!0)},on:function(a,b){return this._listeners[a].push(b),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null;this._listeners=[]},emit:function(a,b){if(this._listeners[a])for(var d=0;d<this._listeners[a].length;d++)this._listeners[a][d].call(this,
|
||
b)},pipe:function(a){return a.registerPrevious(this)},registerPrevious:function(a){if(this.isLocked)throw Error("The stream '"+this+"' has already been used.");this.streamInfo=a.streamInfo;this.mergeStreamInfo();this.previous=a;var b=this;return a.on("data",function(a){b.processChunk(a)}),a.on("end",function(){b.end()}),a.on("error",function(a){b.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 a=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),a=!0),this.previous&&this.previous.resume(),!a},flush:function(){},processChunk:function(a){this.push(a)},withStreamInfo:function(a,b){return this.extraStreamInfo[a]=b,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var a in this.extraStreamInfo)this.extraStreamInfo.hasOwnProperty(a)&&(this.streamInfo[a]=this.extraStreamInfo[a])},lock:function(){if(this.isLocked)throw Error("The stream '"+
|
||
this+"' has already been used.");this.isLocked=!0;this.previous&&this.previous.lock()},toString:function(){var a="Worker "+this.name;return this.previous?this.previous+" -> "+a:a}};f.exports=a},{}],29:[function(b,f,c){function a(a,b){var d,e=0,c;for(d=c=0;d<b.length;d++)c+=b[d].length;switch(a){case "string":return b.join("");case "array":return Array.prototype.concat.apply([],b);case "uint8array":c=new Uint8Array(c);for(d=0;d<b.length;d++)c.set(b[d],e),e+=b[d].length;return c;case "nodebuffer":return Buffer.concat(b);
|
||
default:throw Error("concat : unsupported type '"+a+"'");}}function e(b,d){return new q.Promise(function(e,c){var v=[],u=b._internalType,t=b._outputType,f=b._mimeType;b.on("data",function(a,b){v.push(a);d&&d(b)}).on("error",function(a){v=[];c(a)}).on("end",function(){try{var b;a:{var d=v,y=null;switch(t){case "blob":b=g.newBlob(d,f);break a;case "base64":b=(y=a(u,d),n.encode(y));break a;default:b=(y=a(u,d),g.transformTo(t,y))}}e(b)}catch(p){c(p)}v=[]}).resume()})}function d(a,b,d){var c=b;switch(b){case "blob":c=
|
||
"arraybuffer";break;case "arraybuffer":c="uint8array";break;case "base64":c="string"}try{this._internalType=c,this._outputType=b,this._mimeType=d,g.checkSupport(c),this._worker=a.pipe(new h(c)),a.lock()}catch(v){this._worker=new l("error"),this._worker.error(v)}}var g=b("../utils"),h=b("./ConvertWorker"),l=b("./GenericWorker"),n=b("../base64");c=b("../support");var q=b("../external"),u=null;if(c.nodestream)try{u=b("../nodejs/NodejsStreamOutputAdapter")}catch(y){}d.prototype={accumulate:function(a){return e(this,
|
||
a)},on:function(a,b){var d=this;return"data"===a?this._worker.on(a,function(a){b.call(d,a.data,a.meta)}):this._worker.on(a,function(){g.delay(b,arguments,d)}),this},resume:function(){return g.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(a){if(g.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw Error(this._outputType+" is not supported by this method");return new u(this,{objectMode:"nodebuffer"!==this._outputType},
|
||
a)}};f.exports=d},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(b,f,c){if(c.base64=!0,c.array=!0,c.string=!0,c.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,c.nodebuffer="undefined"!=typeof Buffer,c.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)c.blob=!1;else{f=new ArrayBuffer(0);try{c.blob=0===(new Blob([f],{type:"application/zip"})).size}catch(e){try{var a=
|
||
new (window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder);a.append(f);c.blob=0===a.getBlob("application/zip").size}catch(d){c.blob=!1}}}try{c.nodestream=!!b("readable-stream").Readable}catch(e){c.nodestream=!1}},{"readable-stream":16}],31:[function(b,f,c){function a(){l.call(this,"utf-8 decode");this.leftOver=null}function e(){l.call(this,"utf-8 encode")}var d=b("./utils"),g=b("./support"),h=b("./nodejsUtils"),l=b("./stream/GenericWorker"),n=Array(256);for(b=
|
||
0;256>b;b++)n[b]=252<=b?6:248<=b?5:240<=b?4:224<=b?3:192<=b?2:1;n[254]=n[254]=1;c.utf8encode=function(a){if(g.nodebuffer)a=h.newBuffer(a,"utf-8");else{var b,d,c,e,f,v=a.length,n=0;for(e=0;e<v;e++)d=a.charCodeAt(e),55296===(64512&d)&&e+1<v&&(c=a.charCodeAt(e+1),56320===(64512&c)&&(d=65536+(d-55296<<10)+(c-56320),e++)),n+=128>d?1:2048>d?2:65536>d?3:4;b=g.uint8array?new Uint8Array(n):Array(n);for(e=f=0;f<n;e++)d=a.charCodeAt(e),55296===(64512&d)&&e+1<v&&(c=a.charCodeAt(e+1),56320===(64512&c)&&(d=65536+
|
||
(d-55296<<10)+(c-56320),e++)),128>d?b[f++]=d:2048>d?(b[f++]=192|d>>>6,b[f++]=128|63&d):65536>d?(b[f++]=224|d>>>12,b[f++]=128|d>>>6&63,b[f++]=128|63&d):(b[f++]=240|d>>>18,b[f++]=128|d>>>12&63,b[f++]=128|d>>>6&63,b[f++]=128|63&d);a=b}return a};c.utf8decode=function(a){var b;if(g.nodebuffer)b=d.transformTo("nodebuffer",a).toString("utf-8");else{var c=a=d.transformTo(g.uint8array?"uint8array":"array",a),e,f,h,v=c.length;a=Array(2*v);for(e=f=0;e<v;)if(b=c[e++],128>b)a[f++]=b;else if(h=n[b],4<h)a[f++]=
|
||
65533,e+=h-1;else{for(b&=2===h?31:3===h?15:7;1<h&&e<v;)b=b<<6|63&c[e++],h--;1<h?a[f++]=65533:65536>b?a[f++]=b:(b-=65536,a[f++]=55296|b>>10&1023,a[f++]=56320|1023&b)}b=(a.length!==f&&(a.subarray?a=a.subarray(0,f):a.length=f),d.applyFromCharCode(a))}return b};d.inherits(a,l);a.prototype.processChunk=function(a){var b=d.transformTo(g.uint8array?"uint8array":"array",a.data);if(this.leftOver&&this.leftOver.length){if(g.uint8array){var e=b,b=new Uint8Array(e.length+this.leftOver.length);b.set(this.leftOver,
|
||
0);b.set(e,this.leftOver.length)}else b=this.leftOver.concat(b);this.leftOver=null}var f,e=b.length;e>b.length&&(e=b.length);for(f=e-1;0<=f&&128===(192&b[f]);)f--;e=0>f?e:0===f?e:f+n[b[f]]>e?f:e;f=b;e!==b.length&&(g.uint8array?(f=b.subarray(0,e),this.leftOver=b.subarray(e,b.length)):(f=b.slice(0,e),this.leftOver=b.slice(e,b.length)));this.push({data:c.utf8decode(f),meta:a.meta})};a.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:c.utf8decode(this.leftOver),meta:{}}),
|
||
this.leftOver=null)};c.Utf8DecodeWorker=a;d.inherits(e,l);e.prototype.processChunk=function(a){this.push({data:c.utf8encode(a.data),meta:a.meta})};c.Utf8EncodeWorker=e},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(b,f,c){function a(a){return a}function e(a,b){for(var d=0;d<a.length;++d)b[d]=255&a.charCodeAt(d);return b}function d(a){var b=65536,d=c.getTypeOf(a),e=!0;if("uint8array"===d?e=D.applyCanBeUsed.uint8array:"nodebuffer"===d&&(e=D.applyCanBeUsed.nodebuffer),
|
||
e)for(;1<b;)try{return D.stringifyByChunk(a,d,b)}catch(m){b=Math.floor(b/2)}return D.stringifyByChar(a)}function g(a,b){for(var d=0;d<a.length;d++)b[d]=a[d];return b}var h=b("./support"),l=b("./base64"),n=b("./nodejsUtils"),q=b("core-js/library/fn/set-immediate"),u=b("./external");c.newBlob=function(a,b){c.checkSupport("blob");try{return new Blob(a,{type:b})}catch(m){try{for(var d=new (window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder),e=0;e<a.length;e++)d.append(a[e]);
|
||
return d.getBlob(b)}catch(P){throw Error("Bug : can't construct the Blob.");}}};var y;try{y=h.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(v){y=!1}b=y;var F;try{F=h.nodebuffer&&1===String.fromCharCode.apply(null,n.newBuffer(1)).length}catch(v){F=!1}var D={stringifyByChunk:function(a,b,d){var e=[],c=0,t=a.length;if(t<=d)return String.fromCharCode.apply(null,a);for(;c<t;)"array"===b||"nodebuffer"===b?e.push(String.fromCharCode.apply(null,a.slice(c,Math.min(c+d,t)))):
|
||
e.push(String.fromCharCode.apply(null,a.subarray(c,Math.min(c+d,t)))),c+=d;return e.join("")},stringifyByChar:function(a){for(var b="",d=0;d<a.length;d++)b+=String.fromCharCode(a[d]);return b},applyCanBeUsed:{uint8array:b,nodebuffer:F}};c.applyFromCharCode=d;var H={};H.string={string:a,array:function(a){return e(a,Array(a.length))},arraybuffer:function(a){return H.string.uint8array(a).buffer},uint8array:function(a){return e(a,new Uint8Array(a.length))},nodebuffer:function(a){return e(a,n.newBuffer(a.length))}};
|
||
H.array={string:d,array:a,arraybuffer:function(a){return(new Uint8Array(a)).buffer},uint8array:function(a){return new Uint8Array(a)},nodebuffer:function(a){return n.newBuffer(a)}};H.arraybuffer={string:function(a){return d(new Uint8Array(a))},array:function(a){return g(new Uint8Array(a),Array(a.byteLength))},arraybuffer:a,uint8array:function(a){return new Uint8Array(a)},nodebuffer:function(a){return n.newBuffer(new Uint8Array(a))}};H.uint8array={string:d,array:function(a){return g(a,Array(a.length))},
|
||
arraybuffer:function(a){var b=new Uint8Array(a.length);return a.length&&b.set(a,0),b.buffer},uint8array:a,nodebuffer:function(a){return n.newBuffer(a)}};H.nodebuffer={string:d,array:function(a){return g(a,Array(a.length))},arraybuffer:function(a){return H.nodebuffer.uint8array(a).buffer},uint8array:function(a){return g(a,new Uint8Array(a.length))},nodebuffer:a};c.transformTo=function(a,b){if(b||(b=""),!a)return b;c.checkSupport(a);var d=c.getTypeOf(b);return H[d][a](b)};c.getTypeOf=function(a){return"string"==
|
||
typeof a?"string":"[object Array]"===Object.prototype.toString.call(a)?"array":h.nodebuffer&&n.isBuffer(a)?"nodebuffer":h.uint8array&&a instanceof Uint8Array?"uint8array":h.arraybuffer&&a instanceof ArrayBuffer?"arraybuffer":void 0};c.checkSupport=function(a){if(!h[a.toLowerCase()])throw Error(a+" is not supported by this platform");};c.MAX_VALUE_16BITS=65535;c.MAX_VALUE_32BITS=-1;c.pretty=function(a){var b,d,e="";for(d=0;d<(a||"").length;d++)b=a.charCodeAt(d),e+="\\x"+(16>b?"0":"")+b.toString(16).toUpperCase();
|
||
return e};c.delay=function(a,b,d){q(function(){a.apply(d||null,b||[])})};c.inherits=function(a,b){var d=function(){};d.prototype=b.prototype;a.prototype=new d};c.extend=function(){var a,b,d={};for(a=0;a<arguments.length;a++)for(b in arguments[a])arguments[a].hasOwnProperty(b)&&"undefined"==typeof d[b]&&(d[b]=arguments[a][b]);return d};c.prepareContent=function(a,b,d,f,g){return u.Promise.resolve(b).then(function(a){return h.blob&&(a instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(a)))&&
|
||
"undefined"!=typeof FileReader?new u.Promise(function(b,d){var e=new FileReader;e.onload=function(a){b(a.target.result)};e.onerror=function(a){d(a.target.error)};e.readAsArrayBuffer(a)}):a}).then(function(b){var t=c.getTypeOf(b);t?"arraybuffer"===t?b=c.transformTo("uint8array",b):"string"===t&&(g?b=l.decode(b):d&&!0!==f&&(t=null,b=(t=h.uint8array?new Uint8Array(b.length):Array(b.length),e(b,t)))):b=u.Promise.reject(Error("The data of '"+a+"' is in an unsupported format !"));return b})}},{"./base64":1,
|
||
"./external":6,"./nodejsUtils":14,"./support":30,"core-js/library/fn/set-immediate":36}],33:[function(b,f,c){function a(a){this.files=[];this.loadOptions=a}var e=b("./reader/readerFor"),d=b("./utils"),g=b("./signature"),h=b("./zipEntry"),l=(b("./utf8"),b("./support"));a.prototype={checkSignature:function(a){if(!this.reader.readAndCheckSignature(a)){this.reader.index-=4;var b=this.reader.readString(4);throw Error("Corrupted zip or bug : unexpected signature ("+d.pretty(b)+", expected "+d.pretty(a)+
|
||
")");}},isSignature:function(a,b){var d=this.reader.index;this.reader.setIndex(a);var e=this.reader.readString(4)===b;return this.reader.setIndex(d),e},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 a=this.reader.readData(this.zipCommentLength),a=d.transformTo(l.uint8array?"uint8array":"array",a);this.zipComment=this.loadOptions.decodeFileName(a)},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 a,b,d,e=this.zip64EndOfCentralSize-44;0<e;)a=this.reader.readInt(2),b=this.reader.readInt(4),d=this.reader.readData(b),this.zip64ExtensibleData[a]={id:a,length:b,value:d}},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 Error("Multi-volumes zip are not supported");
|
||
},readLocalFiles:function(){var a,b;for(a=0;a<this.files.length;a++)b=this.files[a],this.reader.setIndex(b.localHeaderOffset),this.checkSignature(g.LOCAL_FILE_HEADER),b.readLocalPart(this.reader),b.handleUTF8(),b.processAttributes()},readCentralDir:function(){var a;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(g.CENTRAL_FILE_HEADER);)a=new h({zip64:this.zip64},this.loadOptions),a.readCentralPart(this.reader),this.files.push(a);if(this.centralDirRecords!==this.files.length&&
|
||
0!==this.centralDirRecords&&0===this.files.length)throw Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length);},readEndOfCentral:function(){var a=this.reader.lastIndexOfSignature(g.CENTRAL_DIRECTORY_END);if(0>a)throw this.isSignature(0,g.LOCAL_FILE_HEADER)?Error("Corrupted zip : can't find end of central directory"):Error("Can't find end of central directory : is this a zip file ? If it is, see http://stuk.github.io/jszip/documentation/howto/read_zip.html");
|
||
this.reader.setIndex(a);var b=a;if(this.checkSignature(g.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===d.MAX_VALUE_16BITS||this.diskWithCentralDirStart===d.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===d.MAX_VALUE_16BITS||this.centralDirRecords===d.MAX_VALUE_16BITS||this.centralDirSize===d.MAX_VALUE_32BITS||this.centralDirOffset===d.MAX_VALUE_32BITS){if(this.zip64=!0,a=this.reader.lastIndexOfSignature(g.ZIP64_CENTRAL_DIRECTORY_LOCATOR),0>a)throw Error("Corrupted zip : can't find the ZIP64 end of central directory locator");
|
||
if(this.reader.setIndex(a),this.checkSignature(g.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,g.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(g.ZIP64_CENTRAL_DIRECTORY_END),0>this.relativeOffsetEndOfZip64CentralDir))throw Error("Corrupted zip : can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir);this.checkSignature(g.ZIP64_CENTRAL_DIRECTORY_END);
|
||
this.readBlockZip64EndOfCentral()}a=this.centralDirOffset+this.centralDirSize;this.zip64&&(a+=20,a+=12+this.zip64EndOfCentralSize);a=b-a;if(0<a)this.isSignature(b,g.CENTRAL_FILE_HEADER)||(this.reader.zero=a);else if(0>a)throw Error("Corrupted zip: missing "+Math.abs(a)+" bytes.");},prepareReader:function(a){this.reader=e(a)},load:function(a){this.prepareReader(a);this.readEndOfCentral();this.readCentralDir();this.readLocalFiles()}};f.exports=a},{"./reader/readerFor":22,"./signature":23,"./support":30,
|
||
"./utf8":31,"./utils":32,"./zipEntry":34}],34:[function(b,f,c){function a(a,b){this.options=a;this.loadOptions=b}var e=b("./reader/readerFor"),d=b("./utils"),g=b("./compressedObject"),h=b("./crc32"),l=b("./utf8"),n=b("./compressions"),q=b("./support");a.prototype={isEncrypted:function(){return 1===(1&this.bitFlag)},useUTF8:function(){return 2048===(2048&this.bitFlag)},readLocalPart:function(a){var b,e;if(a.skip(22),this.fileNameLength=a.readInt(2),e=a.readInt(2),this.fileName=a.readData(this.fileNameLength),
|
||
a.skip(e),-1===this.compressedSize||-1===this.uncompressedSize)throw Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize === -1 || uncompressedSize === -1)");var c;a:{e=this.compressionMethod;for(c in n)if(n.hasOwnProperty(c)&&n[c].magic===e){c=n[c];break a}c=null}if(b=c,null===b)throw Error("Corrupted zip : compression "+d.pretty(this.compressionMethod)+" unknown (inner file : "+d.transformTo("string",this.fileName)+")");this.decompressed=new g(this.compressedSize,
|
||
this.uncompressedSize,this.crc32,b,a.readData(this.compressedSize))},readCentralPart:function(a){this.versionMadeBy=a.readInt(2);a.skip(2);this.bitFlag=a.readInt(2);this.compressionMethod=a.readString(2);this.date=a.readDate();this.crc32=a.readInt(4);this.compressedSize=a.readInt(4);this.uncompressedSize=a.readInt(4);var b=a.readInt(2);if(this.extraFieldsLength=a.readInt(2),this.fileCommentLength=a.readInt(2),this.diskNumberStart=a.readInt(2),this.internalFileAttributes=a.readInt(2),this.externalFileAttributes=
|
||
a.readInt(4),this.localHeaderOffset=a.readInt(4),this.isEncrypted())throw Error("Encrypted zip are not supported");a.skip(b);this.readExtraFields(a);this.parseZIP64ExtraField(a);this.fileComment=a.readData(this.fileCommentLength)},processAttributes:function(){this.dosPermissions=this.unixPermissions=null;var a=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes);0===a&&(this.dosPermissions=63&this.externalFileAttributes);3===a&&(this.unixPermissions=this.externalFileAttributes>>16&65535);
|
||
this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(a){this.extraFields[1]&&(a=e(this.extraFields[1].value),this.uncompressedSize===d.MAX_VALUE_32BITS&&(this.uncompressedSize=a.readInt(8)),this.compressedSize===d.MAX_VALUE_32BITS&&(this.compressedSize=a.readInt(8)),this.localHeaderOffset===d.MAX_VALUE_32BITS&&(this.localHeaderOffset=a.readInt(8)),this.diskNumberStart===d.MAX_VALUE_32BITS&&(this.diskNumberStart=a.readInt(4)))},readExtraFields:function(a){var b,
|
||
d,e,c=a.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});a.index<c;)b=a.readInt(2),d=a.readInt(2),e=a.readData(d),this.extraFields[b]={id:b,length:d,value:e}},handleUTF8:function(){var a=q.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=l.utf8decode(this.fileName),this.fileCommentStr=l.utf8decode(this.fileComment);else{var b=this.findExtraFieldUnicodePath();null!==b?this.fileNameStr=b:(b=d.transformTo(a,this.fileName),this.fileNameStr=this.loadOptions.decodeFileName(b));
|
||
b=this.findExtraFieldUnicodeComment();null!==b?this.fileCommentStr=b:(a=d.transformTo(a,this.fileComment),this.fileCommentStr=this.loadOptions.decodeFileName(a))}},findExtraFieldUnicodePath:function(){var a=this.extraFields[28789];if(a){var b=e(a.value);return 1!==b.readInt(1)?null:h(this.fileName)!==b.readInt(4)?null:l.utf8decode(b.readData(a.length-5))}return null},findExtraFieldUnicodeComment:function(){var a=this.extraFields[25461];if(a){var b=e(a.value);return 1!==b.readInt(1)?null:h(this.fileComment)!==
|
||
b.readInt(4)?null:l.utf8decode(b.readData(a.length-5))}return null}};f.exports=a},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(b,f,c){var a=b("./stream/StreamHelper"),e=b("./stream/DataWorker"),d=b("./utf8"),g=b("./compressedObject"),h=b("./stream/GenericWorker");b=function(a,b,d){this.name=a;this.dir=d.dir;this.date=d.date;this.comment=d.comment;this.unixPermissions=d.unixPermissions;this.dosPermissions=d.dosPermissions;
|
||
this._data=b;this._dataBinary=d.binary;this.options={compression:d.compression,compressionOptions:d.compressionOptions}};b.prototype={internalStream:function(b){b=b.toLowerCase();var e="string"===b||"text"===b;"binarystring"!==b&&"text"!==b||(b="string");var c=this._decompressWorker(),f=!this._dataBinary;return f&&!e&&(c=c.pipe(new d.Utf8EncodeWorker)),!f&&e&&(c=c.pipe(new d.Utf8DecodeWorker)),new a(c,b,"")},async:function(a,b){return this.internalStream(a).accumulate(b)},nodeStream:function(a,b){return this.internalStream(a||
|
||
"nodebuffer").toNodejsStream(b)},_compressWorker:function(a,b){if(this._data instanceof g&&this._data.compression.magic===a.magic)return this._data.getCompressedWorker();var e=this._decompressWorker();return this._dataBinary||(e=e.pipe(new d.Utf8EncodeWorker)),g.createWorkerFrom(e,a,b)},_decompressWorker:function(){return this._data instanceof g?this._data.getContentWorker():this._data instanceof h?this._data:new e(this._data)}};c=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"];
|
||
for(var l=function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");},n=0;n<c.length;n++)b.prototype[c[n]]=l;f.exports=b},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(b,f,c){b("../modules/web.immediate");f.exports=b("../modules/_core").setImmediate},{"../modules/_core":40,"../modules/web.immediate":56}],37:[function(b,f,c){f.exports=function(a){if("function"!=typeof a)throw TypeError(a+
|
||
" is not a function!");return a}},{}],38:[function(b,f,c){var a=b("./_is-object");f.exports=function(b){if(!a(b))throw TypeError(b+" is not an object!");return b}},{"./_is-object":51}],39:[function(b,f,c){var a={}.toString;f.exports=function(b){return a.call(b).slice(8,-1)}},{}],40:[function(b,f,c){b=f.exports={version:"2.3.0"};"number"==typeof __e&&(__e=b)},{}],41:[function(b,f,c){var a=b("./_a-function");f.exports=function(b,d,c){if(a(b),void 0===d)return b;switch(c){case 1:return function(a){return b.call(d,
|
||
a)};case 2:return function(a,e){return b.call(d,a,e)};case 3:return function(a,e,c){return b.call(d,a,e,c)}}return function(){return b.apply(d,arguments)}}},{"./_a-function":37}],42:[function(b,f,c){f.exports=!b("./_fails")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{"./_fails":45}],43:[function(b,f,c){c=b("./_is-object");var a=b("./_global").document,e=c(a)&&c(a.createElement);f.exports=function(b){return e?a.createElement(b):{}}},{"./_global":46,"./_is-object":51}],
|
||
44:[function(b,f,c){var a=b("./_global"),e=b("./_core"),d=b("./_ctx"),g=b("./_hide"),h=function(b,c,f){var l,n,q=b&h.F,D=b&h.G,H=b&h.S,v=b&h.P,z=b&h.B,t=b&h.W,E=D?e:e[c]||(e[c]={}),m=E.prototype,H=D?a:H?a[c]:(a[c]||{}).prototype;D&&(f=c);for(l in f)(c=!q&&H&&void 0!==H[l])&&l in E||(n=c?H[l]:f[l],E[l]=D&&"function"!=typeof H[l]?f[l]:z&&c?d(n,a):t&&H[l]==n?function(a){var b=function(b,d,x){if(this instanceof a){switch(arguments.length){case 0:return new a;case 1:return new a(b);case 2:return new a(b,
|
||
d)}return new a(b,d,x)}return a.apply(this,arguments)};return b.prototype=a.prototype,b}(n):v&&"function"==typeof n?d(Function.call,n):n,v&&((E.virtual||(E.virtual={}))[l]=n,b&h.R&&m&&!m[l]&&g(m,l,n)))};h.F=1;h.G=2;h.S=4;h.P=8;h.B=16;h.W=32;h.U=64;h.R=128;f.exports=h},{"./_core":40,"./_ctx":41,"./_global":46,"./_hide":47}],45:[function(b,f,c){f.exports=function(a){try{return!!a()}catch(e){return!0}}},{}],46:[function(b,f,c){b=f.exports="undefined"!=typeof window&&Math==Math?window:"undefined"!=typeof self&&
|
||
self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=b)},{}],47:[function(b,f,c){var a=b("./_object-dp"),e=b("./_property-desc");f.exports=b("./_descriptors")?function(b,c,f){return a.f(b,c,e(1,f))}:function(a,b,e){return a[b]=e,a}},{"./_descriptors":42,"./_object-dp":52,"./_property-desc":53}],48:[function(b,f,c){f.exports=b("./_global").document&&document.documentElement},{"./_global":46}],49:[function(b,f,c){f.exports=!b("./_descriptors")&&!b("./_fails")(function(){return 7!=
|
||
Object.defineProperty(b("./_dom-create")("div"),"a",{get:function(){return 7}}).a})},{"./_descriptors":42,"./_dom-create":43,"./_fails":45}],50:[function(b,f,c){f.exports=function(a,b,d){var c=void 0===d;switch(b.length){case 0:return c?a():a.call(d);case 1:return c?a(b[0]):a.call(d,b[0]);case 2:return c?a(b[0],b[1]):a.call(d,b[0],b[1]);case 3:return c?a(b[0],b[1],b[2]):a.call(d,b[0],b[1],b[2]);case 4:return c?a(b[0],b[1],b[2],b[3]):a.call(d,b[0],b[1],b[2],b[3])}return a.apply(d,b)}},{}],51:[function(b,
|
||
f,c){f.exports=function(a){return"object"==typeof a?null!==a:"function"==typeof a}},{}],52:[function(b,f,c){var a=b("./_an-object"),e=b("./_ie8-dom-define"),d=b("./_to-primitive"),g=Object.defineProperty;c.f=b("./_descriptors")?Object.defineProperty:function(b,c,f){if(a(b),c=d(c,!0),a(f),e)try{return g(b,c,f)}catch(q){}if("get"in f||"set"in f)throw TypeError("Accessors not supported!");return"value"in f&&(b[c]=f.value),b}},{"./_an-object":38,"./_descriptors":42,"./_ie8-dom-define":49,"./_to-primitive":55}],
|
||
53:[function(b,f,c){f.exports=function(a,b){return{enumerable:!(1&a),configurable:!(2&a),writable:!(4&a),value:b}}},{}],54:[function(b,f,c){var a,e,d,g=b("./_ctx"),h=b("./_invoke"),l=b("./_html"),n=b("./_dom-create"),q=b("./_global"),u=q.process;c=q.setImmediate;var y=q.clearImmediate,F=q.MessageChannel,D=0,H={},v=function(){var a=+this;if(H.hasOwnProperty(a)){var b=H[a];delete H[a];b()}},z=function(a){v.call(a.data)};c&&y||(c=function(b){for(var d=[],c=1;arguments.length>c;)d.push(arguments[c++]);
|
||
return H[++D]=function(){h("function"==typeof b?b:Function(b),d)},a(D),D},y=function(a){delete H[a]},"process"==b("./_cof")(u)?a=function(a){u.nextTick(g(v,a,1))}:F?(e=new F,d=e.port2,e.port1.onmessage=z,a=g(d.postMessage,d,1)):q.addEventListener&&"function"==typeof postMessage&&!q.importScripts?(a=function(a){q.postMessage(a+"","*")},q.addEventListener("message",z,!1)):a="onreadystatechange"in n("script")?function(a){l.appendChild(n("script")).onreadystatechange=function(){l.removeChild(this);v.call(a)}}:
|
||
function(a){setTimeout(g(v,a,1),0)});f.exports={set:c,clear:y}},{"./_cof":39,"./_ctx":41,"./_dom-create":43,"./_global":46,"./_html":48,"./_invoke":50}],55:[function(b,f,c){var a=b("./_is-object");f.exports=function(b,d){if(!a(b))return b;var c,e;if(d&&"function"==typeof(c=b.toString)&&!a(e=c.call(b))||"function"==typeof(c=b.valueOf)&&!a(e=c.call(b))||!d&&"function"==typeof(c=b.toString)&&!a(e=c.call(b)))return e;throw TypeError("Can't convert object to primitive value");}},{"./_is-object":51}],56:[function(b,
|
||
f,c){f=b("./_export");b=b("./_task");f(f.G+f.B,{setImmediate:b.set,clearImmediate:b.clear})},{"./_export":44,"./_task":54}],57:[function(b,f,c){(function(a){function b(){q=!0;for(var a,b,d=u.length;d;){b=u;u=[];for(a=-1;++a<d;)b[a]();d=u.length}q=!1}var d,c=a.MutationObserver||a.WebKitMutationObserver;if(c){var h=0,c=new c(b),l=a.document.createTextNode("");c.observe(l,{characterData:!0});d=function(){l.data=h=++h%2}}else if(a.setImmediate||"undefined"==typeof a.MessageChannel)d="document"in a&&"onreadystatechange"in
|
||
a.document.createElement("script")?function(){var d=a.document.createElement("script");d.onreadystatechange=function(){b();d.onreadystatechange=null;d.parentNode.removeChild(d);d=null};a.document.documentElement.appendChild(d)}:function(){setTimeout(b,0)};else{var n=new a.MessageChannel;n.port1.onmessage=b;d=function(){n.port2.postMessage(0)}}var q,u=[];f.exports=function(a){1!==u.push(a)||q||d()}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?
|
||
window:{})},{}],58:[function(b,f,c){function a(){}function e(b){if("function"!=typeof b)throw new TypeError("resolver must be a function");this.state=D;this.queue=[];this.outcome=void 0;b!==a&&l(this,b)}function d(a,b,d){this.promise=a;"function"==typeof b&&(this.onFulfilled=b,this.callFulfilled=this.otherCallFulfilled);"function"==typeof d&&(this.onRejected=d,this.callRejected=this.otherCallRejected)}function g(a,b,d){q(function(){var c;try{c=b(d)}catch(E){return u.reject(a,E)}c===a?u.reject(a,new TypeError("Cannot resolve promise with itself")):
|
||
u.resolve(a,c)})}function h(a){var b=a&&a.then;if(a&&"object"==typeof a&&"function"==typeof b)return function(){b.apply(a,arguments)}}function l(a,b){function d(b){e||(e=!0,u.reject(a,b))}function c(b){e||(e=!0,u.resolve(a,b))}var e=!1,f=n(function(){b(c,d)});"error"===f.status&&d(f.value)}function n(a,b){var d={};try{d.value=a(b),d.status="success"}catch(t){d.status="error",d.value=t}return d}var q=b("immediate"),u={},y=["REJECTED"],F=["FULFILLED"],D=["PENDING"];f.exports=e;e.prototype["catch"]=
|
||
function(a){return this.then(null,a)};e.prototype.then=function(b,c){if("function"!=typeof b&&this.state===F||"function"!=typeof c&&this.state===y)return this;var e=new this.constructor(a);this.state!==D?g(e,this.state===F?b:c,this.outcome):this.queue.push(new d(e,b,c));return e};d.prototype.callFulfilled=function(a){u.resolve(this.promise,a)};d.prototype.otherCallFulfilled=function(a){g(this.promise,this.onFulfilled,a)};d.prototype.callRejected=function(a){u.reject(this.promise,a)};d.prototype.otherCallRejected=
|
||
function(a){g(this.promise,this.onRejected,a)};u.resolve=function(a,b){var d=n(h,b);if("error"===d.status)return u.reject(a,d.value);if(d=d.value)l(a,d);else{a.state=F;a.outcome=b;for(var d=-1,c=a.queue.length;++d<c;)a.queue[d].callFulfilled(b)}return a};u.reject=function(a,b){a.state=y;a.outcome=b;for(var d=-1,c=a.queue.length;++d<c;)a.queue[d].callRejected(b);return a};e.resolve=function(b){return b instanceof this?b:u.resolve(new this(a),b)};e.reject=function(b){var d=new this(a);return u.reject(d,
|
||
b)};e.all=function(b){function d(a,b){c.resolve(a).then(function(a){g[b]=a;++h!==e||f||(f=!0,u.resolve(p,g))},function(a){f||(f=!0,u.reject(p,a))})}var c=this;if("[object Array]"!==Object.prototype.toString.call(b))return this.reject(new TypeError("must be an array"));var e=b.length,f=!1;if(!e)return this.resolve([]);for(var g=Array(e),h=0,l=-1,p=new this(a);++l<e;)d(b[l],l);return p};e.race=function(b){function d(a){c.resolve(a).then(function(a){f||(f=!0,u.resolve(l,a))},function(a){f||(f=!0,u.reject(l,
|
||
a))})}var c=this;if("[object Array]"!==Object.prototype.toString.call(b))return this.reject(new TypeError("must be an array"));var e=b.length,f=!1;if(!e)return this.resolve([]);for(var g=-1,l=new this(a);++g<e;)d(b[g]);return l}},{immediate:57}],59:[function(b,f,c){c=b("./lib/utils/common").assign;var a=b("./lib/deflate"),e=b("./lib/inflate");b=b("./lib/zlib/constants");var d={};c(d,a,e,b);f.exports=d},{"./lib/deflate":60,"./lib/inflate":61,"./lib/utils/common":62,"./lib/zlib/constants":65}],60:[function(b,
|
||
f,c){function a(b){if(!(this instanceof a))return new a(b);b=this.options=g.assign({level:y,method:D,chunkSize:16384,windowBits:15,memLevel:8,strategy:F,to:""},b||{});b.raw&&0<b.windowBits?b.windowBits=-b.windowBits:b.gzip&&0<b.windowBits&&16>b.windowBits&&(b.windowBits+=16);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new n;this.strm.avail_out=0;var c=d.deflateInit2(this.strm,b.level,b.method,b.windowBits,b.memLevel,b.strategy);if(c!==u)throw Error(l[c]);if(b.header&&d.deflateSetHeader(this.strm,
|
||
b.header),b.dictionary){var e;if(e="string"==typeof b.dictionary?h.string2buf(b.dictionary):"[object ArrayBuffer]"===q.call(b.dictionary)?new Uint8Array(b.dictionary):b.dictionary,c=d.deflateSetDictionary(this.strm,e),c!==u)throw Error(l[c]);this._dict_set=!0}}function e(b,d){var c=new a(d);if(c.push(b,!0),c.err)throw c.msg;return c.result}var d=b("./zlib/deflate"),g=b("./utils/common"),h=b("./utils/strings"),l=b("./zlib/messages"),n=b("./zlib/zstream"),q=Object.prototype.toString,u=0,y=-1,F=0,D=
|
||
8;a.prototype.push=function(a,b){var c,e,f=this.strm,l=this.options.chunkSize;if(this.ended)return!1;e=b===~~b?b:!0===b?4:0;"string"==typeof a?f.input=h.string2buf(a):"[object ArrayBuffer]"===q.call(a)?f.input=new Uint8Array(a):f.input=a;f.next_in=0;f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new g.Buf8(l),f.next_out=0,f.avail_out=l),c=d.deflate(f,e),1!==c&&c!==u)return this.onEnd(c),this.ended=!0,!1;0!==f.avail_out&&(0!==f.avail_in||4!==e&&2!==e)||("string"===this.options.to?this.onData(h.buf2binstring(g.shrinkBuf(f.output,
|
||
f.next_out))):this.onData(g.shrinkBuf(f.output,f.next_out)))}while((0<f.avail_in||0===f.avail_out)&&1!==c);return 4===e?(c=d.deflateEnd(this.strm),this.onEnd(c),this.ended=!0,c===u):2!==e||(this.onEnd(u),f.avail_out=0,!0)};a.prototype.onData=function(a){this.chunks.push(a)};a.prototype.onEnd=function(a){a===u&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=g.flattenChunks(this.chunks));this.chunks=[];this.err=a;this.msg=this.strm.msg};c.Deflate=a;c.deflate=e;c.deflateRaw=
|
||
function(a,b){return b=b||{},b.raw=!0,e(a,b)};c.gzip=function(a,b){return b=b||{},b.gzip=!0,e(a,b)}},{"./utils/common":62,"./utils/strings":63,"./zlib/deflate":67,"./zlib/messages":72,"./zlib/zstream":74}],61:[function(b,f,c){function a(b){if(!(this instanceof a))return new a(b);var c=this.options=g.assign({chunkSize:16384,windowBits:0,to:""},b||{});c.raw&&0<=c.windowBits&&16>c.windowBits&&(c.windowBits=-c.windowBits,0===c.windowBits&&(c.windowBits=-15));!(0<=c.windowBits&&16>c.windowBits)||b&&b.windowBits||
|
||
(c.windowBits+=32);15<c.windowBits&&48>c.windowBits&&0===(15&c.windowBits)&&(c.windowBits|=15);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new q;this.strm.avail_out=0;b=d.inflateInit2(this.strm,c.windowBits);if(b!==l.Z_OK)throw Error(n[b]);this.header=new u;d.inflateGetHeader(this.strm,this.header)}function e(b,d){var c=new a(d);if(c.push(b,!0),c.err)throw c.msg;return c.result}var d=b("./zlib/inflate"),g=b("./utils/common"),h=b("./utils/strings"),l=b("./zlib/constants"),n=b("./zlib/messages"),
|
||
q=b("./zlib/zstream"),u=b("./zlib/gzheader"),y=Object.prototype.toString;a.prototype.push=function(a,b){var c,e,f,t,n,m,q=this.strm,C=this.options.chunkSize,p=this.options.dictionary,I=!1;if(this.ended)return!1;e=b===~~b?b:!0===b?l.Z_FINISH:l.Z_NO_FLUSH;"string"==typeof a?q.input=h.binstring2buf(a):"[object ArrayBuffer]"===y.call(a)?q.input=new Uint8Array(a):q.input=a;q.next_in=0;q.avail_in=q.input.length;do{if(0===q.avail_out&&(q.output=new g.Buf8(C),q.next_out=0,q.avail_out=C),c=d.inflate(q,l.Z_NO_FLUSH),
|
||
c===l.Z_NEED_DICT&&p&&(m="string"==typeof p?h.string2buf(p):"[object ArrayBuffer]"===y.call(p)?new Uint8Array(p):p,c=d.inflateSetDictionary(this.strm,m)),c===l.Z_BUF_ERROR&&!0===I&&(c=l.Z_OK,I=!1),c!==l.Z_STREAM_END&&c!==l.Z_OK)return this.onEnd(c),this.ended=!0,!1;q.next_out&&(0!==q.avail_out&&c!==l.Z_STREAM_END&&(0!==q.avail_in||e!==l.Z_FINISH&&e!==l.Z_SYNC_FLUSH)||("string"===this.options.to?(f=h.utf8border(q.output,q.next_out),t=q.next_out-f,n=h.buf2string(q.output,f),q.next_out=t,q.avail_out=
|
||
C-t,t&&g.arraySet(q.output,q.output,f,t,0),this.onData(n)):this.onData(g.shrinkBuf(q.output,q.next_out))));0===q.avail_in&&0===q.avail_out&&(I=!0)}while((0<q.avail_in||0===q.avail_out)&&c!==l.Z_STREAM_END);return c===l.Z_STREAM_END&&(e=l.Z_FINISH),e===l.Z_FINISH?(c=d.inflateEnd(this.strm),this.onEnd(c),this.ended=!0,c===l.Z_OK):e!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),q.avail_out=0,!0)};a.prototype.onData=function(a){this.chunks.push(a)};a.prototype.onEnd=function(a){a===l.Z_OK&&("string"===this.options.to?
|
||
this.result=this.chunks.join(""):this.result=g.flattenChunks(this.chunks));this.chunks=[];this.err=a;this.msg=this.strm.msg};c.Inflate=a;c.inflate=e;c.inflateRaw=function(a,b){return b=b||{},b.raw=!0,e(a,b)};c.ungzip=e},{"./utils/common":62,"./utils/strings":63,"./zlib/constants":65,"./zlib/gzheader":68,"./zlib/inflate":70,"./zlib/messages":72,"./zlib/zstream":74}],62:[function(b,f,c){b="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;c.assign=function(a){for(var b=
|
||
Array.prototype.slice.call(arguments,1);b.length;){var d=b.shift();if(d){if("object"!=typeof d)throw new TypeError(d+"must be non-object");for(var c in d)d.hasOwnProperty(c)&&(a[c]=d[c])}}return a};c.shrinkBuf=function(a,b){return a.length===b?a:a.subarray?a.subarray(0,b):(a.length=b,a)};var a={arraySet:function(a,b,c,e,f){if(b.subarray&&a.subarray)return void a.set(b.subarray(c,c+e),f);for(var d=0;d<e;d++)a[f+d]=b[c+d]},flattenChunks:function(a){var b,d,c,e,f;b=c=0;for(d=a.length;b<d;b++)c+=a[b].length;
|
||
f=new Uint8Array(c);b=c=0;for(d=a.length;b<d;b++)e=a[b],f.set(e,c),c+=e.length;return f}},e={arraySet:function(a,b,c,e,f){for(var d=0;d<e;d++)a[f+d]=b[c+d]},flattenChunks:function(a){return[].concat.apply([],a)}};c.setTyped=function(b){b?(c.Buf8=Uint8Array,c.Buf16=Uint16Array,c.Buf32=Int32Array,c.assign(c,a)):(c.Buf8=Array,c.Buf16=Array,c.Buf32=Array,c.assign(c,e))};c.setTyped(b)},{}],63:[function(b,f,c){function a(a,b){if(65537>b&&(a.subarray&&g||!a.subarray&&d))return String.fromCharCode.apply(null,
|
||
e.shrinkBuf(a,b));for(var c="",f=0;f<b;f++)c+=String.fromCharCode(a[f]);return c}var e=b("./common"),d=!0,g=!0;try{String.fromCharCode.apply(null,[0])}catch(l){d=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(l){g=!1}var h=new e.Buf8(256);for(b=0;256>b;b++)h[b]=252<=b?6:248<=b?5:240<=b?4:224<=b?3:192<=b?2:1;h[254]=h[254]=1;c.string2buf=function(a){var b,d,c,f,g,h=a.length,l=0;for(f=0;f<h;f++)d=a.charCodeAt(f),55296===(64512&d)&&f+1<h&&(c=a.charCodeAt(f+1),56320===(64512&c)&&(d=65536+
|
||
(d-55296<<10)+(c-56320),f++)),l+=128>d?1:2048>d?2:65536>d?3:4;b=new e.Buf8(l);for(f=g=0;g<l;f++)d=a.charCodeAt(f),55296===(64512&d)&&f+1<h&&(c=a.charCodeAt(f+1),56320===(64512&c)&&(d=65536+(d-55296<<10)+(c-56320),f++)),128>d?b[g++]=d:2048>d?(b[g++]=192|d>>>6,b[g++]=128|63&d):65536>d?(b[g++]=224|d>>>12,b[g++]=128|d>>>6&63,b[g++]=128|63&d):(b[g++]=240|d>>>18,b[g++]=128|d>>>12&63,b[g++]=128|d>>>6&63,b[g++]=128|63&d);return b};c.buf2binstring=function(b){return a(b,b.length)};c.binstring2buf=function(a){for(var b=
|
||
new e.Buf8(a.length),d=0,c=b.length;d<c;d++)b[d]=a.charCodeAt(d);return b};c.buf2string=function(b,d){var c,e,f,g,l=d||b.length,n=Array(2*l);for(c=e=0;c<l;)if(f=b[c++],128>f)n[e++]=f;else if(g=h[f],4<g)n[e++]=65533,c+=g-1;else{for(f&=2===g?31:3===g?15:7;1<g&&c<l;)f=f<<6|63&b[c++],g--;1<g?n[e++]=65533:65536>f?n[e++]=f:(f-=65536,n[e++]=55296|f>>10&1023,n[e++]=56320|1023&f)}return a(n,e)};c.utf8border=function(a,b){var d;b=b||a.length;b>a.length&&(b=a.length);for(d=b-1;0<=d&&128===(192&a[d]);)d--;return 0>
|
||
d?b:0===d?b:d+h[a[d]]>b?d:b}},{"./common":62}],64:[function(b,f,c){f.exports=function(a,b,d,c){var e=65535&a|0;a=a>>>16&65535|0;for(var f;0!==d;){f=2E3<d?2E3:d;d-=f;do e=e+b[c++]|0,a=a+e|0;while(--f);e%=65521;a%=65521}return e|a<<16|0}},{}],65:[function(b,f,c){f.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,
|
||
Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],66:[function(b,f,c){var a=function(){for(var a,b=[],c=0;256>c;c++){a=c;for(var f=0;8>f;f++)a=1&a?3988292384^a>>>1:a>>>1;b[c]=a}return b}();f.exports=function(b,d,c,f){c=f+c;for(b^=-1;f<c;f++)b=b>>>8^a[255&(b^d[f])];return b^-1}},{}],67:[function(b,f,c){function a(a,b){return a.msg=p[b],b}function e(a){for(var b=a.length;0<=--b;)a[b]=0}function d(a){var b=
|
||
a.state,d=b.pending;d>a.avail_out&&(d=a.avail_out);0!==d&&(E.arraySet(a.output,b.pending_buf,b.pending_out,d,a.next_out),a.next_out+=d,b.pending_out+=d,a.total_out+=d,a.avail_out-=d,b.pending-=d,0===b.pending&&(b.pending_out=0))}function g(a,b){m._tr_flush_block(a,0<=a.block_start?a.block_start:-1,a.strstart-a.block_start,b);a.block_start=a.strstart;d(a.strm)}function h(a,b){a.pending_buf[a.pending++]=b}function l(a,b){a.pending_buf[a.pending++]=b>>>8&255;a.pending_buf[a.pending++]=255&b}function n(a,
|
||
b){var d,c,x=a.max_chain_length,e=a.strstart,L=a.prev_length,f=a.nice_match,p=a.strstart>a.w_size-Q?a.strstart-(a.w_size-Q):0,g=a.window,t=a.w_mask,h=a.prev,l=a.strstart+J,I=g[e+L-1],E=g[e+L];a.prev_length>=a.good_match&&(x>>=2);f>a.lookahead&&(f=a.lookahead);do if(d=b,g[d+L]===E&&g[d+L-1]===I&&g[d]===g[e]&&g[++d]===g[e+1]){e+=2;for(d++;g[++e]===g[++d]&&g[++e]===g[++d]&&g[++e]===g[++d]&&g[++e]===g[++d]&&g[++e]===g[++d]&&g[++e]===g[++d]&&g[++e]===g[++d]&&g[++e]===g[++d]&&e<l;);if(c=J-(l-e),e=l-J,c>
|
||
L){if(a.match_start=b,L=c,c>=f)break;I=g[e+L-1];E=g[e+L]}}while((b=h[b&t])>p&&0!==--x);return L<=a.lookahead?L:a.lookahead}function q(a){var b,d,c,e,x=a.w_size;do{if(e=a.window_size-a.lookahead-a.strstart,a.strstart>=x+(x-Q)){E.arraySet(a.window,a.window,x,x,0);a.match_start-=x;a.strstart-=x;a.block_start-=x;b=d=a.hash_size;do c=a.head[--b],a.head[b]=c>=x?c-x:0;while(--d);b=d=x;do c=a.prev[--b],a.prev[b]=c>=x?c-x:0;while(--d);e+=x}if(0===a.strm.avail_in)break;b=a.strm;c=a.window;var f=a.strstart+
|
||
a.lookahead,L=b.avail_in;if(d=(L>e&&(L=e),0===L?0:(b.avail_in-=L,E.arraySet(c,b.input,b.next_in,L,f),1===b.state.wrap?b.adler=P(b.adler,c,L,f):2===b.state.wrap&&(b.adler=C(b.adler,c,L,f)),b.next_in+=L,b.total_in+=L,L)),a.lookahead+=d,a.lookahead+a.insert>=A)for(e=a.strstart-a.insert,a.ins_h=a.window[e],a.ins_h=(a.ins_h<<a.hash_shift^a.window[e+1])&a.hash_mask;a.insert&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[e+A-1])&a.hash_mask,a.prev[e&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=e,e++,a.insert--,
|
||
!(a.lookahead+a.insert<A)););}while(a.lookahead<Q&&0!==a.strm.avail_in)}function u(a,b){for(var d,c;;){if(a.lookahead<Q){if(q(a),a.lookahead<Q&&b===I)return M;if(0===a.lookahead)break}if(d=0,a.lookahead>=A&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+A-1])&a.hash_mask,d=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart),0!==d&&a.strstart-d<=a.w_size-Q&&(a.match_length=n(a,d)),a.match_length>=A)if(c=m._tr_tally(a,a.strstart-a.match_start,a.match_length-A),a.lookahead-=
|
||
a.match_length,a.match_length<=a.max_lazy_match&&a.lookahead>=A){a.match_length--;do a.strstart++,a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+A-1])&a.hash_mask,d=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart;while(0!==--a.match_length);a.strstart++}else a.strstart+=a.match_length,a.match_length=0,a.ins_h=a.window[a.strstart],a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+1])&a.hash_mask;else c=m._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++;if(c&&
|
||
(g(a,!1),0===a.strm.avail_out))return M}return a.insert=a.strstart<A-1?a.strstart:A-1,b===x?(g(a,!0),0===a.strm.avail_out?W:R):a.last_lit&&(g(a,!1),0===a.strm.avail_out)?M:U}function y(a,b){for(var d,c,e;;){if(a.lookahead<Q){if(q(a),a.lookahead<Q&&b===I)return M;if(0===a.lookahead)break}if(d=0,a.lookahead>=A&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+A-1])&a.hash_mask,d=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart),a.prev_length=a.match_length,a.prev_match=a.match_start,
|
||
a.match_length=A-1,0!==d&&a.prev_length<a.max_lazy_match&&a.strstart-d<=a.w_size-Q&&(a.match_length=n(a,d),5>=a.match_length&&(a.strategy===X||a.match_length===A&&4096<a.strstart-a.match_start)&&(a.match_length=A-1)),a.prev_length>=A&&a.match_length<=a.prev_length){e=a.strstart+a.lookahead-A;c=m._tr_tally(a,a.strstart-1-a.prev_match,a.prev_length-A);a.lookahead-=a.prev_length-1;a.prev_length-=2;do++a.strstart<=e&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+A-1])&a.hash_mask,d=a.prev[a.strstart&
|
||
a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart);while(0!==--a.prev_length);if(a.match_available=0,a.match_length=A-1,a.strstart++,c&&(g(a,!1),0===a.strm.avail_out))return M}else if(a.match_available){if(c=m._tr_tally(a,0,a.window[a.strstart-1]),c&&g(a,!1),a.strstart++,a.lookahead--,0===a.strm.avail_out)return M}else a.match_available=1,a.strstart++,a.lookahead--}return a.match_available&&(m._tr_tally(a,0,a.window[a.strstart-1]),a.match_available=0),a.insert=a.strstart<A-1?a.strstart:A-1,b===
|
||
x?(g(a,!0),0===a.strm.avail_out?W:R):a.last_lit&&(g(a,!1),0===a.strm.avail_out)?M:U}function F(a,b,d,c,e){this.good_length=a;this.max_lazy=b;this.nice_length=d;this.max_chain=c;this.func=e}function D(){this.strm=null;this.status=0;this.pending_buf=null;this.wrap=this.pending=this.pending_out=this.pending_buf_size=0;this.gzhead=null;this.gzindex=0;this.method=V;this.last_flush=-1;this.w_mask=this.w_bits=this.w_size=0;this.window=null;this.window_size=0;this.head=this.prev=null;this.nice_match=this.good_match=
|
||
this.strategy=this.level=this.max_lazy_match=this.max_chain_length=this.prev_length=this.lookahead=this.match_start=this.strstart=this.match_available=this.prev_match=this.match_length=this.block_start=this.hash_shift=this.hash_mask=this.hash_bits=this.hash_size=this.ins_h=0;this.dyn_ltree=new E.Buf16(2*ba);this.dyn_dtree=new E.Buf16(2*(2*ca+1));this.bl_tree=new E.Buf16(2*(2*B+1));e(this.dyn_ltree);e(this.dyn_dtree);e(this.bl_tree);this.bl_desc=this.d_desc=this.l_desc=null;this.bl_count=new E.Buf16(K+
|
||
1);this.heap=new E.Buf16(2*da+1);e(this.heap);this.heap_max=this.heap_len=0;this.depth=new E.Buf16(2*da+1);e(this.depth);this.bi_valid=this.bi_buf=this.insert=this.matches=this.static_len=this.opt_len=this.d_buf=this.last_lit=this.lit_bufsize=this.l_buf=0}function H(b){var d;return b&&b.state?(b.total_in=b.total_out=0,b.data_type=aa,d=b.state,d.pending=0,d.pending_out=0,0>d.wrap&&(d.wrap=-d.wrap),d.status=d.wrap?Z:Y,b.adler=2===d.wrap?0:1,d.last_flush=I,m._tr_init(d),S):a(b,O)}function v(a){var b=
|
||
H(a);b===S&&(a=a.state,a.window_size=2*a.w_size,e(a.head),a.max_lazy_match=t[a.level].max_lazy,a.good_match=t[a.level].good_length,a.nice_match=t[a.level].nice_length,a.max_chain_length=t[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=A-1,a.match_available=0,a.ins_h=0);return b}function z(b,d,c,e,x,f){if(!b)return O;var k=1;if(d===G&&(d=6),0>e?(k=0,e=-e):15<e&&(k=2,e-=16),1>x||x>r||c!==V||8>e||15<e||0>d||9<d||0>f||f>T)return a(b,O);8===e&&(e=
|
||
9);var N=new D;return b.state=N,N.strm=b,N.wrap=k,N.gzhead=null,N.w_bits=e,N.w_size=1<<N.w_bits,N.w_mask=N.w_size-1,N.hash_bits=x+7,N.hash_size=1<<N.hash_bits,N.hash_mask=N.hash_size-1,N.hash_shift=~~((N.hash_bits+A-1)/A),N.window=new E.Buf8(2*N.w_size),N.head=new E.Buf16(N.hash_size),N.prev=new E.Buf16(N.w_size),N.lit_bufsize=1<<x+6,N.pending_buf_size=4*N.lit_bufsize,N.pending_buf=new E.Buf8(N.pending_buf_size),N.d_buf=1*N.lit_bufsize,N.l_buf=3*N.lit_bufsize,N.level=d,N.strategy=f,N.method=c,v(b)}
|
||
var t,E=b("../utils/common"),m=b("./trees"),P=b("./adler32"),C=b("./crc32"),p=b("./messages"),I=0,x=4,S=0,O=-2,G=-1,X=1,T=4,aa=2,V=8,r=9,da=286,ca=30,B=19,ba=2*da+1,K=15,A=3,J=258,Q=J+A+1,Z=42,Y=113,M=1,U=2,W=3,R=4;t=[new F(0,0,0,0,function(a,b){var d=65535;for(d>a.pending_buf_size-5&&(d=a.pending_buf_size-5);;){if(1>=a.lookahead){if(q(a),0===a.lookahead&&b===I)return M;if(0===a.lookahead)break}a.strstart+=a.lookahead;a.lookahead=0;var c=a.block_start+d;if((0===a.strstart||a.strstart>=c)&&(a.lookahead=
|
||
a.strstart-c,a.strstart=c,g(a,!1),0===a.strm.avail_out)||a.strstart-a.block_start>=a.w_size-Q&&(g(a,!1),0===a.strm.avail_out))return M}return a.insert=0,b===x?(g(a,!0),0===a.strm.avail_out?W:R):(a.strstart>a.block_start&&g(a,!1),M)}),new F(4,4,8,4,u),new F(4,5,16,8,u),new F(4,6,32,32,u),new F(4,4,16,16,y),new F(8,16,32,32,y),new F(8,16,128,128,y),new F(8,32,128,256,y),new F(32,128,258,1024,y),new F(32,258,258,4096,y)];c.deflateInit=function(a,b){return z(a,b,V,15,8,0)};c.deflateInit2=z;c.deflateReset=
|
||
v;c.deflateResetKeep=H;c.deflateSetHeader=function(a,b){return a&&a.state?2!==a.state.wrap?O:(a.state.gzhead=b,S):O};c.deflate=function(b,c){var f,k,p,E;if(!b||!b.state||5<c||0>c)return b?a(b,O):O;if(k=b.state,!b.output||!b.input&&0!==b.avail_in||666===k.status&&c!==x)return a(b,0===b.avail_out?-5:O);if(k.strm=b,f=k.last_flush,k.last_flush=c,k.status===Z)2===k.wrap?(b.adler=0,h(k,31),h(k,139),h(k,8),k.gzhead?(h(k,(k.gzhead.text?1:0)+(k.gzhead.hcrc?2:0)+(k.gzhead.extra?4:0)+(k.gzhead.name?8:0)+(k.gzhead.comment?
|
||
16:0)),h(k,255&k.gzhead.time),h(k,k.gzhead.time>>8&255),h(k,k.gzhead.time>>16&255),h(k,k.gzhead.time>>24&255),h(k,9===k.level?2:2<=k.strategy||2>k.level?4:0),h(k,255&k.gzhead.os),k.gzhead.extra&&k.gzhead.extra.length&&(h(k,255&k.gzhead.extra.length),h(k,k.gzhead.extra.length>>8&255)),k.gzhead.hcrc&&(b.adler=C(b.adler,k.pending_buf,k.pending,0)),k.gzindex=0,k.status=69):(h(k,0),h(k,0),h(k,0),h(k,0),h(k,0),h(k,9===k.level?2:2<=k.strategy||2>k.level?4:0),h(k,3),k.status=Y)):(p=V+(k.w_bits-8<<4)<<8,p|=
|
||
(2<=k.strategy||2>k.level?0:6>k.level?1:6===k.level?2:3)<<6,0!==k.strstart&&(p|=32),k.status=Y,l(k,p+(31-p%31)),0!==k.strstart&&(l(k,b.adler>>>16),l(k,65535&b.adler)),b.adler=1);if(69===k.status)if(k.gzhead.extra){for(p=k.pending;k.gzindex<(65535&k.gzhead.extra.length)&&(k.pending!==k.pending_buf_size||(k.gzhead.hcrc&&k.pending>p&&(b.adler=C(b.adler,k.pending_buf,k.pending-p,p)),d(b),p=k.pending,k.pending!==k.pending_buf_size));)h(k,255&k.gzhead.extra[k.gzindex]),k.gzindex++;k.gzhead.hcrc&&k.pending>
|
||
p&&(b.adler=C(b.adler,k.pending_buf,k.pending-p,p));k.gzindex===k.gzhead.extra.length&&(k.gzindex=0,k.status=73)}else k.status=73;if(73===k.status)if(k.gzhead.name){p=k.pending;do{if(k.pending===k.pending_buf_size&&(k.gzhead.hcrc&&k.pending>p&&(b.adler=C(b.adler,k.pending_buf,k.pending-p,p)),d(b),p=k.pending,k.pending===k.pending_buf_size)){E=1;break}E=k.gzindex<k.gzhead.name.length?255&k.gzhead.name.charCodeAt(k.gzindex++):0;h(k,E)}while(0!==E);k.gzhead.hcrc&&k.pending>p&&(b.adler=C(b.adler,k.pending_buf,
|
||
k.pending-p,p));0===E&&(k.gzindex=0,k.status=91)}else k.status=91;if(91===k.status)if(k.gzhead.comment){p=k.pending;do{if(k.pending===k.pending_buf_size&&(k.gzhead.hcrc&&k.pending>p&&(b.adler=C(b.adler,k.pending_buf,k.pending-p,p)),d(b),p=k.pending,k.pending===k.pending_buf_size)){E=1;break}E=k.gzindex<k.gzhead.comment.length?255&k.gzhead.comment.charCodeAt(k.gzindex++):0;h(k,E)}while(0!==E);k.gzhead.hcrc&&k.pending>p&&(b.adler=C(b.adler,k.pending_buf,k.pending-p,p));0===E&&(k.status=103)}else k.status=
|
||
103;if(103===k.status&&(k.gzhead.hcrc?(k.pending+2>k.pending_buf_size&&d(b),k.pending+2<=k.pending_buf_size&&(h(k,255&b.adler),h(k,b.adler>>8&255),b.adler=0,k.status=Y)):k.status=Y),0!==k.pending){if(d(b),0===b.avail_out)return k.last_flush=-1,S}else if(0===b.avail_in&&(c<<1)-(4<c?9:0)<=(f<<1)-(4<f?9:0)&&c!==x)return a(b,-5);if(666===k.status&&0!==b.avail_in)return a(b,-5);if(0!==b.avail_in||0!==k.lookahead||c!==I&&666!==k.status){var n;if(2===k.strategy)a:{for(var r;;){if(0===k.lookahead&&(q(k),
|
||
0===k.lookahead)){if(c===I){n=M;break a}break}if(k.match_length=0,r=m._tr_tally(k,0,k.window[k.strstart]),k.lookahead--,k.strstart++,r&&(g(k,!1),0===k.strm.avail_out)){n=M;break a}}n=(k.insert=0,c===x?(g(k,!0),0===k.strm.avail_out?W:R):k.last_lit&&(g(k,!1),0===k.strm.avail_out)?M:U)}else if(3===k.strategy)a:{var G,v;for(r=k.window;;){if(k.lookahead<=J){if(q(k),k.lookahead<=J&&c===I){n=M;break a}if(0===k.lookahead)break}if(k.match_length=0,k.lookahead>=A&&0<k.strstart&&(v=k.strstart-1,G=r[v],G===r[++v]&&
|
||
G===r[++v]&&G===r[++v])){for(f=k.strstart+J;G===r[++v]&&G===r[++v]&&G===r[++v]&&G===r[++v]&&G===r[++v]&&G===r[++v]&&G===r[++v]&&G===r[++v]&&v<f;);k.match_length=J-(f-v);k.match_length>k.lookahead&&(k.match_length=k.lookahead)}if(k.match_length>=A?(n=m._tr_tally(k,1,k.match_length-A),k.lookahead-=k.match_length,k.strstart+=k.match_length,k.match_length=0):(n=m._tr_tally(k,0,k.window[k.strstart]),k.lookahead--,k.strstart++),n&&(g(k,!1),0===k.strm.avail_out)){n=M;break a}}n=(k.insert=0,c===x?(g(k,!0),
|
||
0===k.strm.avail_out?W:R):k.last_lit&&(g(k,!1),0===k.strm.avail_out)?M:U)}else n=t[k.level].func(k,c);if(n!==W&&n!==R||(k.status=666),n===M||n===W)return 0===b.avail_out&&(k.last_flush=-1),S;if(n===U&&(1===c?m._tr_align(k):5!==c&&(m._tr_stored_block(k,0,0,!1),3===c&&(e(k.head),0===k.lookahead&&(k.strstart=0,k.block_start=0,k.insert=0))),d(b),0===b.avail_out))return k.last_flush=-1,S}return c!==x?S:0>=k.wrap?1:(2===k.wrap?(h(k,255&b.adler),h(k,b.adler>>8&255),h(k,b.adler>>16&255),h(k,b.adler>>24&255),
|
||
h(k,255&b.total_in),h(k,b.total_in>>8&255),h(k,b.total_in>>16&255),h(k,b.total_in>>24&255)):(l(k,b.adler>>>16),l(k,65535&b.adler)),d(b),0<k.wrap&&(k.wrap=-k.wrap),0!==k.pending?S:1)};c.deflateEnd=function(b){var d;return b&&b.state?(d=b.state.status,d!==Z&&69!==d&&73!==d&&91!==d&&103!==d&&d!==Y&&666!==d?a(b,O):(b.state=null,d===Y?a(b,-3):S)):O};c.deflateSetDictionary=function(a,b){var d,c,x,f,p,g,t;c=b.length;if(!a||!a.state||(d=a.state,f=d.wrap,2===f||1===f&&d.status!==Z||d.lookahead))return O;1===
|
||
f&&(a.adler=P(a.adler,b,c,0));d.wrap=0;c>=d.w_size&&(0===f&&(e(d.head),d.strstart=0,d.block_start=0,d.insert=0),p=new E.Buf8(d.w_size),E.arraySet(p,b,c-d.w_size,d.w_size,0),b=p,c=d.w_size);p=a.avail_in;g=a.next_in;t=a.input;a.avail_in=c;a.next_in=0;a.input=b;for(q(d);d.lookahead>=A;){c=d.strstart;x=d.lookahead-(A-1);do d.ins_h=(d.ins_h<<d.hash_shift^d.window[c+A-1])&d.hash_mask,d.prev[c&d.w_mask]=d.head[d.ins_h],d.head[d.ins_h]=c,c++;while(--x);d.strstart=c;d.lookahead=A-1;q(d)}return d.strstart+=
|
||
d.lookahead,d.block_start=d.strstart,d.insert=d.lookahead,d.lookahead=0,d.match_length=d.prev_length=A-1,d.match_available=0,a.next_in=g,a.input=t,a.avail_in=p,d.wrap=f,S};c.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":62,"./adler32":64,"./crc32":66,"./messages":72,"./trees":73}],68:[function(b,f,c){f.exports=function(){this.os=this.xflags=this.time=this.text=0;this.extra=null;this.extra_len=0;this.comment=this.name="";this.hcrc=0;this.done=!1}},{}],69:[function(b,f,c){f.exports=
|
||
function(a,b){var d,c,e,f,n,q,u,y,F,D,H,v,z,t,E,m,P,C,p,I,x,S,O,G;d=a.state;c=a.next_in;O=a.input;e=c+(a.avail_in-5);f=a.next_out;G=a.output;n=f-(b-a.avail_out);q=f+(a.avail_out-257);u=d.dmax;y=d.wsize;F=d.whave;D=d.wnext;H=d.window;v=d.hold;z=d.bits;t=d.lencode;E=d.distcode;m=(1<<d.lenbits)-1;P=(1<<d.distbits)-1;a:do b:for(15>z&&(v+=O[c++]<<z,z+=8,v+=O[c++]<<z,z+=8),C=t[v&m];;){if(p=C>>>24,v>>>=p,z-=p,p=C>>>16&255,0===p)G[f++]=65535&C;else{if(!(16&p)){if(0===(64&p)){C=t[(65535&C)+(v&(1<<p)-1)];continue b}if(32&
|
||
p){d.mode=12;break a}a.msg="invalid literal/length code";d.mode=30;break a}I=65535&C;(p&=15)&&(z<p&&(v+=O[c++]<<z,z+=8),I+=v&(1<<p)-1,v>>>=p,z-=p);15>z&&(v+=O[c++]<<z,z+=8,v+=O[c++]<<z,z+=8);C=E[v&P];c:for(;;){if(p=C>>>24,v>>>=p,z-=p,p=C>>>16&255,!(16&p)){if(0===(64&p)){C=E[(65535&C)+(v&(1<<p)-1)];continue c}a.msg="invalid distance code";d.mode=30;break a}if(x=65535&C,p&=15,z<p&&(v+=O[c++]<<z,z+=8,z<p&&(v+=O[c++]<<z,z+=8)),x+=v&(1<<p)-1,x>u){a.msg="invalid distance too far back";d.mode=30;break a}if(v>>>=
|
||
p,z-=p,p=f-n,x>p){if(p=x-p,p>F&&d.sane){a.msg="invalid distance too far back";d.mode=30;break a}if(C=0,S=H,0===D){if(C+=y-p,p<I){I-=p;do G[f++]=H[C++];while(--p);C=f-x;S=G}}else if(D<p){if(C+=y+D-p,p-=D,p<I){I-=p;do G[f++]=H[C++];while(--p);if(C=0,D<I){p=D;I-=p;do G[f++]=H[C++];while(--p);C=f-x;S=G}}}else if(C+=D-p,p<I){I-=p;do G[f++]=H[C++];while(--p);C=f-x;S=G}for(;2<I;)G[f++]=S[C++],G[f++]=S[C++],G[f++]=S[C++],I-=3;I&&(G[f++]=S[C++],1<I&&(G[f++]=S[C++]))}else{C=f-x;do G[f++]=G[C++],G[f++]=G[C++],
|
||
G[f++]=G[C++],I-=3;while(2<I);I&&(G[f++]=G[C++],1<I&&(G[f++]=G[C++]))}break}}break}while(c<e&&f<q);I=z>>3;c-=I;z-=I<<3;a.next_in=c;a.next_out=f;a.avail_in=c<e?5+(e-c):5-(c-e);a.avail_out=f<q?257+(q-f):257-(f-q);d.hold=v&(1<<z)-1;d.bits=z}},{}],70:[function(b,f,c){function a(a){return(a>>>24&255)+(a>>>8&65280)+((65280&a)<<8)+((255&a)<<24)}function e(){this.mode=0;this.last=!1;this.wrap=0;this.havedict=!1;this.total=this.check=this.dmax=this.flags=0;this.head=null;this.wnext=this.whave=this.wsize=this.wbits=
|
||
0;this.window=null;this.extra=this.offset=this.length=this.bits=this.hold=0;this.distcode=this.lencode=null;this.have=this.ndist=this.nlen=this.ncode=this.distbits=this.lenbits=0;this.next=null;this.lens=new y.Buf16(320);this.work=new y.Buf16(288);this.distdyn=this.lendyn=null;this.was=this.back=this.sane=0}function d(a){var b;return a&&a.state?(b=a.state,a.total_in=a.total_out=b.total=0,a.msg="",b.wrap&&(a.adler=1&b.wrap),b.mode=E,b.last=0,b.havedict=0,b.dmax=32768,b.head=null,b.hold=0,b.bits=0,
|
||
b.lencode=b.lendyn=new y.Buf32(m),b.distcode=b.distdyn=new y.Buf32(P),b.sane=1,b.back=-1,z):t}function g(a){var b;return a&&a.state?(b=a.state,b.wsize=0,b.whave=0,b.wnext=0,d(a)):t}function h(a,b){var d,c;return a&&a.state?(c=a.state,0>b?(d=0,b=-b):(d=(b>>4)+1,48>b&&(b&=15)),b&&(8>b||15<b)?t:(null!==c.window&&c.wbits!==b&&(c.window=null),c.wrap=d,c.wbits=b,g(a))):t}function l(a,b){var d,c;return a?(c=new e,a.state=c,c.window=null,d=h(a,b),d!==z&&(a.state=null),d):t}function n(a,b,d,c){var e;a=a.state;
|
||
return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new y.Buf8(a.wsize)),c>=a.wsize?(y.arraySet(a.window,b,d-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(e=a.wsize-a.wnext,e>c&&(e=c),y.arraySet(a.window,b,d-c,e,a.wnext),c-=e,c?(y.arraySet(a.window,b,d-c,c,0),a.wnext=c,a.whave=a.wsize):(a.wnext+=e,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=e))),0}var q,u,y=b("../utils/common"),F=b("./adler32"),D=b("./crc32"),H=b("./inffast"),v=b("./inftrees"),z=0,t=-2,E=1,m=852,
|
||
P=592,C=!0;c.inflateReset=g;c.inflateReset2=h;c.inflateResetKeep=d;c.inflateInit=function(a){return l(a,15)};c.inflateInit2=l;c.inflate=function(b,d){var c,e,f,g,p,h,l,m,r,I,P,B,ba,K,A,J,Q,Z,Y,M,U,W,R=0,L=new y.Buf8(4),ea=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!b||!b.state||!b.output||!b.input&&0!==b.avail_in)return t;c=b.state;12===c.mode&&(c.mode=13);p=b.next_out;f=b.output;l=b.avail_out;g=b.next_in;e=b.input;h=b.avail_in;m=c.hold;r=c.bits;I=h;P=l;U=z;a:for(;;)switch(c.mode){case E:if(0===
|
||
c.wrap){c.mode=13;break}for(;16>r;){if(0===h)break a;h--;m+=e[g++]<<r;r+=8}if(2&c.wrap&&35615===m){c.check=0;L[0]=255&m;L[1]=m>>>8&255;c.check=D(c.check,L,2,0);r=m=0;c.mode=2;break}if(c.flags=0,c.head&&(c.head.done=!1),!(1&c.wrap)||(((255&m)<<8)+(m>>8))%31){b.msg="incorrect header check";c.mode=30;break}if(8!==(15&m)){b.msg="unknown compression method";c.mode=30;break}if(m>>>=4,r-=4,M=(15&m)+8,0===c.wbits)c.wbits=M;else if(M>c.wbits){b.msg="invalid window size";c.mode=30;break}c.dmax=1<<M;b.adler=
|
||
c.check=1;c.mode=512&m?10:12;r=m=0;break;case 2:for(;16>r;){if(0===h)break a;h--;m+=e[g++]<<r;r+=8}if(c.flags=m,8!==(255&c.flags)){b.msg="unknown compression method";c.mode=30;break}if(57344&c.flags){b.msg="unknown header flags set";c.mode=30;break}c.head&&(c.head.text=m>>8&1);512&c.flags&&(L[0]=255&m,L[1]=m>>>8&255,c.check=D(c.check,L,2,0));r=m=0;c.mode=3;case 3:for(;32>r;){if(0===h)break a;h--;m+=e[g++]<<r;r+=8}c.head&&(c.head.time=m);512&c.flags&&(L[0]=255&m,L[1]=m>>>8&255,L[2]=m>>>16&255,L[3]=
|
||
m>>>24&255,c.check=D(c.check,L,4,0));r=m=0;c.mode=4;case 4:for(;16>r;){if(0===h)break a;h--;m+=e[g++]<<r;r+=8}c.head&&(c.head.xflags=255&m,c.head.os=m>>8);512&c.flags&&(L[0]=255&m,L[1]=m>>>8&255,c.check=D(c.check,L,2,0));r=m=0;c.mode=5;case 5:if(1024&c.flags){for(;16>r;){if(0===h)break a;h--;m+=e[g++]<<r;r+=8}c.length=m;c.head&&(c.head.extra_len=m);512&c.flags&&(L[0]=255&m,L[1]=m>>>8&255,c.check=D(c.check,L,2,0));r=m=0}else c.head&&(c.head.extra=null);c.mode=6;case 6:if(1024&c.flags&&(B=c.length,
|
||
B>h&&(B=h),B&&(c.head&&(M=c.head.extra_len-c.length,c.head.extra||(c.head.extra=Array(c.head.extra_len)),y.arraySet(c.head.extra,e,g,B,M)),512&c.flags&&(c.check=D(c.check,e,B,g)),h-=B,g+=B,c.length-=B),c.length))break a;c.length=0;c.mode=7;case 7:if(2048&c.flags){if(0===h)break a;B=0;do M=e[g+B++],c.head&&M&&65536>c.length&&(c.head.name+=String.fromCharCode(M));while(M&&B<h);if(512&c.flags&&(c.check=D(c.check,e,B,g)),h-=B,g+=B,M)break a}else c.head&&(c.head.name=null);c.length=0;c.mode=8;case 8:if(4096&
|
||
c.flags){if(0===h)break a;B=0;do M=e[g+B++],c.head&&M&&65536>c.length&&(c.head.comment+=String.fromCharCode(M));while(M&&B<h);if(512&c.flags&&(c.check=D(c.check,e,B,g)),h-=B,g+=B,M)break a}else c.head&&(c.head.comment=null);c.mode=9;case 9:if(512&c.flags){for(;16>r;){if(0===h)break a;h--;m+=e[g++]<<r;r+=8}if(m!==(65535&c.check)){b.msg="header crc mismatch";c.mode=30;break}r=m=0}c.head&&(c.head.hcrc=c.flags>>9&1,c.head.done=!0);b.adler=c.check=0;c.mode=12;break;case 10:for(;32>r;){if(0===h)break a;
|
||
h--;m+=e[g++]<<r;r+=8}b.adler=c.check=a(m);r=m=0;c.mode=11;case 11:if(0===c.havedict)return b.next_out=p,b.avail_out=l,b.next_in=g,b.avail_in=h,c.hold=m,c.bits=r,2;b.adler=c.check=1;c.mode=12;case 12:if(5===d||6===d)break a;case 13:if(c.last){m>>>=7&r;r-=7&r;c.mode=27;break}for(;3>r;){if(0===h)break a;h--;m+=e[g++]<<r;r+=8}switch(c.last=1&m,m>>>=1,--r,3&m){case 0:c.mode=14;break;case 1:J=c;if(C){q=new y.Buf32(512);u=new y.Buf32(32);for(K=0;144>K;)J.lens[K++]=8;for(;256>K;)J.lens[K++]=9;for(;280>K;)J.lens[K++]=
|
||
7;for(;288>K;)J.lens[K++]=8;v(1,J.lens,0,288,q,0,J.work,{bits:9});for(K=0;32>K;)J.lens[K++]=5;v(2,J.lens,0,32,u,0,J.work,{bits:5});C=!1}J.lencode=q;J.lenbits=9;J.distcode=u;J.distbits=5;if(c.mode=20,6===d){m>>>=2;r-=2;break a}break;case 2:c.mode=17;break;case 3:b.msg="invalid block type",c.mode=30}m>>>=2;r-=2;break;case 14:m>>>=7&r;for(r-=7&r;32>r;){if(0===h)break a;h--;m+=e[g++]<<r;r+=8}if((65535&m)!==(m>>>16^65535)){b.msg="invalid stored block lengths";c.mode=30;break}if(c.length=65535&m,m=0,r=
|
||
0,c.mode=15,6===d)break a;case 15:c.mode=16;case 16:if(B=c.length){if(B>h&&(B=h),B>l&&(B=l),0===B)break a;y.arraySet(f,e,g,B,p);h-=B;g+=B;l-=B;p+=B;c.length-=B;break}c.mode=12;break;case 17:for(;14>r;){if(0===h)break a;h--;m+=e[g++]<<r;r+=8}if(c.nlen=(31&m)+257,m>>>=5,r-=5,c.ndist=(31&m)+1,m>>>=5,r-=5,c.ncode=(15&m)+4,m>>>=4,r-=4,286<c.nlen||30<c.ndist){b.msg="too many length or distance symbols";c.mode=30;break}c.have=0;c.mode=18;case 18:for(;c.have<c.ncode;){for(;3>r;){if(0===h)break a;h--;m+=e[g++]<<
|
||
r;r+=8}c.lens[ea[c.have++]]=7&m;m>>>=3;r-=3}for(;19>c.have;)c.lens[ea[c.have++]]=0;if(c.lencode=c.lendyn,c.lenbits=7,W={bits:c.lenbits},U=v(0,c.lens,0,19,c.lencode,0,c.work,W),c.lenbits=W.bits,U){b.msg="invalid code lengths set";c.mode=30;break}c.have=0;c.mode=19;case 19:for(;c.have<c.nlen+c.ndist;){for(;R=c.lencode[m&(1<<c.lenbits)-1],A=R>>>24,J=65535&R,!(A<=r);){if(0===h)break a;h--;m+=e[g++]<<r;r+=8}if(16>J)m>>>=A,r-=A,c.lens[c.have++]=J;else{if(16===J){for(K=A+2;r<K;){if(0===h)break a;h--;m+=
|
||
e[g++]<<r;r+=8}if(m>>>=A,r-=A,0===c.have){b.msg="invalid bit length repeat";c.mode=30;break}M=c.lens[c.have-1];B=3+(3&m);m>>>=2;r-=2}else if(17===J){for(K=A+3;r<K;){if(0===h)break a;h--;m+=e[g++]<<r;r+=8}m>>>=A;r-=A;M=0;B=3+(7&m);m>>>=3;r-=3}else{for(K=A+7;r<K;){if(0===h)break a;h--;m+=e[g++]<<r;r+=8}m>>>=A;r-=A;M=0;B=11+(127&m);m>>>=7;r-=7}if(c.have+B>c.nlen+c.ndist){b.msg="invalid bit length repeat";c.mode=30;break}for(;B--;)c.lens[c.have++]=M}}if(30===c.mode)break;if(0===c.lens[256]){b.msg="invalid code -- missing end-of-block";
|
||
c.mode=30;break}if(c.lenbits=9,W={bits:c.lenbits},U=v(1,c.lens,0,c.nlen,c.lencode,0,c.work,W),c.lenbits=W.bits,U){b.msg="invalid literal/lengths set";c.mode=30;break}if(c.distbits=6,c.distcode=c.distdyn,W={bits:c.distbits},U=v(2,c.lens,c.nlen,c.ndist,c.distcode,0,c.work,W),c.distbits=W.bits,U){b.msg="invalid distances set";c.mode=30;break}if(c.mode=20,6===d)break a;case 20:c.mode=21;case 21:if(6<=h&&258<=l){b.next_out=p;b.avail_out=l;b.next_in=g;b.avail_in=h;c.hold=m;c.bits=r;H(b,P);p=b.next_out;
|
||
f=b.output;l=b.avail_out;g=b.next_in;e=b.input;h=b.avail_in;m=c.hold;r=c.bits;12===c.mode&&(c.back=-1);break}for(c.back=0;R=c.lencode[m&(1<<c.lenbits)-1],A=R>>>24,K=R>>>16&255,J=65535&R,!(A<=r);){if(0===h)break a;h--;m+=e[g++]<<r;r+=8}if(K&&0===(240&K)){Q=A;Z=K;for(Y=J;R=c.lencode[Y+((m&(1<<Q+Z)-1)>>Q)],A=R>>>24,K=R>>>16&255,J=65535&R,!(Q+A<=r);){if(0===h)break a;h--;m+=e[g++]<<r;r+=8}m>>>=Q;r-=Q;c.back+=Q}if(m>>>=A,r-=A,c.back+=A,c.length=J,0===K){c.mode=26;break}if(32&K){c.back=-1;c.mode=12;break}if(64&
|
||
K){b.msg="invalid literal/length code";c.mode=30;break}c.extra=15&K;c.mode=22;case 22:if(c.extra){for(K=c.extra;r<K;){if(0===h)break a;h--;m+=e[g++]<<r;r+=8}c.length+=m&(1<<c.extra)-1;m>>>=c.extra;r-=c.extra;c.back+=c.extra}c.was=c.length;c.mode=23;case 23:for(;R=c.distcode[m&(1<<c.distbits)-1],A=R>>>24,K=R>>>16&255,J=65535&R,!(A<=r);){if(0===h)break a;h--;m+=e[g++]<<r;r+=8}if(0===(240&K)){Q=A;Z=K;for(Y=J;R=c.distcode[Y+((m&(1<<Q+Z)-1)>>Q)],A=R>>>24,K=R>>>16&255,J=65535&R,!(Q+A<=r);){if(0===h)break a;
|
||
h--;m+=e[g++]<<r;r+=8}m>>>=Q;r-=Q;c.back+=Q}if(m>>>=A,r-=A,c.back+=A,64&K){b.msg="invalid distance code";c.mode=30;break}c.offset=J;c.extra=15&K;c.mode=24;case 24:if(c.extra){for(K=c.extra;r<K;){if(0===h)break a;h--;m+=e[g++]<<r;r+=8}c.offset+=m&(1<<c.extra)-1;m>>>=c.extra;r-=c.extra;c.back+=c.extra}if(c.offset>c.dmax){b.msg="invalid distance too far back";c.mode=30;break}c.mode=25;case 25:if(0===l)break a;if(B=P-l,c.offset>B){if(B=c.offset-B,B>c.whave&&c.sane){b.msg="invalid distance too far back";
|
||
c.mode=30;break}B>c.wnext?(B-=c.wnext,ba=c.wsize-B):ba=c.wnext-B;B>c.length&&(B=c.length);K=c.window}else K=f,ba=p-c.offset,B=c.length;B>l&&(B=l);l-=B;c.length-=B;do f[p++]=K[ba++];while(--B);0===c.length&&(c.mode=21);break;case 26:if(0===l)break a;f[p++]=c.length;l--;c.mode=21;break;case 27:if(c.wrap){for(;32>r;){if(0===h)break a;h--;m|=e[g++]<<r;r+=8}if(P-=l,b.total_out+=P,c.total+=P,P&&(b.adler=c.check=c.flags?D(c.check,f,P,p-P):F(c.check,f,P,p-P)),P=l,(c.flags?m:a(m))!==c.check){b.msg="incorrect data check";
|
||
c.mode=30;break}r=m=0}c.mode=28;case 28:if(c.wrap&&c.flags){for(;32>r;){if(0===h)break a;h--;m+=e[g++]<<r;r+=8}if(m!==(4294967295&c.total)){b.msg="incorrect length check";c.mode=30;break}r=m=0}c.mode=29;case 29:U=1;break a;case 30:U=-3;break a;case 31:return-4;default:return t}return b.next_out=p,b.avail_out=l,b.next_in=g,b.avail_in=h,c.hold=m,c.bits=r,(c.wsize||P!==b.avail_out&&30>c.mode&&(27>c.mode||4!==d))&&n(b,b.output,b.next_out,P-b.avail_out)?(c.mode=31,-4):(I-=b.avail_in,P-=b.avail_out,b.total_in+=
|
||
I,b.total_out+=P,c.total+=P,c.wrap&&P&&(b.adler=c.check=c.flags?D(c.check,f,P,b.next_out-P):F(c.check,f,P,b.next_out-P)),b.data_type=c.bits+(c.last?64:0)+(12===c.mode?128:0)+(20===c.mode||15===c.mode?256:0),(0===I&&0===P||4===d)&&U===z&&(U=-5),U)};c.inflateEnd=function(a){if(!a||!a.state)return t;var b=a.state;return b.window&&(b.window=null),a.state=null,z};c.inflateGetHeader=function(a,b){var c;return a&&a.state?(c=a.state,0===(2&c.wrap)?t:(c.head=b,b.done=!1,z)):t};c.inflateSetDictionary=function(a,
|
||
b){var c,d,e=b.length;return a&&a.state?(c=a.state,0!==c.wrap&&11!==c.mode?t:11===c.mode&&(d=1,d=F(d,b,e,0),d!==c.check)?-3:n(a,b,e,e)?(c.mode=31,-4):(c.havedict=1,z)):t};c.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":62,"./adler32":64,"./crc32":66,"./inffast":69,"./inftrees":71}],71:[function(b,f,c){var a=b("../utils/common"),e=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],d=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,
|
||
19,19,19,20,20,20,20,21,21,21,21,16,72,78],g=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],h=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];f.exports=function(b,c,f,u,y,F,D,H){var l,n,t,E,m,P,C,p,I=H.bits,x,q,O,G,X,T,aa=0,V,r=null,da=0,ca=new a.Buf16(16);E=new a.Buf16(16);var B=null,ba=0;for(x=0;15>=x;x++)ca[x]=0;for(q=0;q<u;q++)ca[c[f+q]]++;G=I;for(O=15;1<=O&&0===ca[O];O--);
|
||
if(G>O&&(G=O),0===O)return y[F++]=20971520,y[F++]=20971520,H.bits=1,0;for(I=1;I<O&&0===ca[I];I++);G<I&&(G=I);for(x=l=1;15>=x;x++)if(l<<=1,l-=ca[x],0>l)return-1;if(0<l&&(0===b||1!==O))return-1;E[1]=0;for(x=1;15>x;x++)E[x+1]=E[x]+ca[x];for(q=0;q<u;q++)0!==c[f+q]&&(D[E[c[f+q]]++]=q);if(0===b?(r=B=D,m=19):1===b?(r=e,da-=257,B=d,ba-=257,m=256):(r=g,B=h,m=-1),V=0,q=0,x=I,E=F,X=G,T=0,t=-1,aa=1<<G,u=aa-1,1===b&&852<aa||2===b&&592<aa)return 1;for(var K=0;;){K++;P=x-T;D[q]<m?(C=0,p=D[q]):D[q]>m?(C=B[ba+D[q]],
|
||
p=r[da+D[q]]):(C=96,p=0);l=1<<x-T;I=n=1<<X;do n-=l,y[E+(V>>T)+n]=P<<24|C<<16|p|0;while(0!==n);for(l=1<<x-1;V&l;)l>>=1;if(0!==l?(V&=l-1,V+=l):V=0,q++,0===--ca[x]){if(x===O)break;x=c[f+D[q]]}if(x>G&&(V&u)!==t){0===T&&(T=G);E+=I;X=x-T;for(l=1<<X;X+T<O&&(l-=ca[X+T],!(0>=l));)X++,l<<=1;if(aa+=1<<X,1===b&&852<aa||2===b&&592<aa)return 1;t=V&u;y[t]=G<<24|X<<16|E-F|0}}return 0!==V&&(y[E+V]=x-T<<24|4194304),H.bits=G,0}},{"../utils/common":62}],72:[function(b,f,c){f.exports={2:"need dictionary",1:"stream end",
|
||
0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],73:[function(b,f,c){function a(a){for(var b=a.length;0<=--b;)a[b]=0}function e(a,b,c,d,e){this.static_tree=a;this.extra_bits=b;this.extra_base=c;this.elems=d;this.max_length=e;this.has_stree=a&&a.length}function d(a,b){this.dyn_tree=a;this.max_code=0;this.stat_desc=b}function g(a,b){a.pending_buf[a.pending++]=255&b;a.pending_buf[a.pending++]=b>>>8&255}function h(a,
|
||
b,c){a.bi_valid>aa-c?(a.bi_buf|=b<<a.bi_valid&65535,g(a,a.bi_buf),a.bi_buf=b>>aa-a.bi_valid,a.bi_valid+=c-aa):(a.bi_buf|=b<<a.bi_valid&65535,a.bi_valid+=c)}function l(a,b,c){h(a,c[2*b],c[2*b+1])}function n(a,b){var c=0;do c|=1&a,a>>>=1,c<<=1;while(0<--b);return c>>>1}function q(a,b,c){var d,e=Array(T+1),f=0;for(d=1;d<=T;d++)e[d]=f=f+c[d-1]<<1;for(c=0;c<=b;c++)d=a[2*c+1],0!==d&&(a[2*c]=n(e[d]++,d))}function u(a){var b;for(b=0;b<S;b++)a.dyn_ltree[2*b]=0;for(b=0;b<O;b++)a.dyn_dtree[2*b]=0;for(b=0;b<
|
||
G;b++)a.bl_tree[2*b]=0;a.dyn_ltree[2*V]=1;a.opt_len=a.static_len=0;a.last_lit=a.matches=0}function y(a){8<a.bi_valid?g(a,a.bi_buf):0<a.bi_valid&&(a.pending_buf[a.pending++]=a.bi_buf);a.bi_buf=0;a.bi_valid=0}function F(a,b,c,d){var e=2*b,f=2*c;return a[e]<a[f]||a[e]===a[f]&&d[b]<=d[c]}function D(a,b,c){for(var d=a.heap[c],e=c<<1;e<=a.heap_len&&(e<a.heap_len&&F(b,a.heap[e+1],a.heap[e],a.depth)&&e++,!F(b,d,a.heap[e],a.depth));)a.heap[c]=a.heap[e],c=e,e<<=1;a.heap[c]=d}function H(a,b,c){var d,e,f,k,g=
|
||
0;if(0!==a.last_lit){do d=a.pending_buf[a.d_buf+2*g]<<8|a.pending_buf[a.d_buf+2*g+1],e=a.pending_buf[a.l_buf+g],g++,0===d?l(a,e,b):(f=Y[e],l(a,f+x+1,b),k=B[f],0!==k&&(e-=M[f],h(a,e,k)),d--,f=256>d?Z[d]:Z[256+(d>>>7)],l(a,f,c),k=ba[f],0!==k&&(d-=U[f],h(a,d,k)));while(g<a.last_lit)}l(a,V,b)}function v(a,b){var c,d,e,f=b.dyn_tree;d=b.stat_desc.static_tree;var k=b.stat_desc.has_stree,g=b.stat_desc.elems,m=-1;a.heap_len=0;a.heap_max=X;for(c=0;c<g;c++)0!==f[2*c]?(a.heap[++a.heap_len]=m=c,a.depth[c]=0):
|
||
f[2*c+1]=0;for(;2>a.heap_len;)e=a.heap[++a.heap_len]=2>m?++m:0,f[2*e]=1,a.depth[e]=0,a.opt_len--,k&&(a.static_len-=d[2*e+1]);b.max_code=m;for(c=a.heap_len>>1;1<=c;c--)D(a,f,c);e=g;do c=a.heap[1],a.heap[1]=a.heap[a.heap_len--],D(a,f,1),d=a.heap[1],a.heap[--a.heap_max]=c,a.heap[--a.heap_max]=d,f[2*e]=f[2*c]+f[2*d],a.depth[e]=(a.depth[c]>=a.depth[d]?a.depth[c]:a.depth[d])+1,f[2*c+1]=f[2*d+1]=e,a.heap[1]=e++,D(a,f,1);while(2<=a.heap_len);a.heap[--a.heap_max]=a.heap[1];var h,t,k=b.dyn_tree,g=b.max_code,
|
||
p=b.stat_desc.static_tree,l=b.stat_desc.has_stree,E=b.stat_desc.extra_bits,n=b.stat_desc.extra_base,N=b.stat_desc.max_length,C=0;for(d=0;d<=T;d++)a.bl_count[d]=0;k[2*a.heap[a.heap_max]+1]=0;for(c=a.heap_max+1;c<X;c++)e=a.heap[c],d=k[2*k[2*e+1]+1]+1,d>N&&(d=N,C++),k[2*e+1]=d,e>g||(a.bl_count[d]++,h=0,e>=n&&(h=E[e-n]),t=k[2*e],a.opt_len+=t*(d+h),l&&(a.static_len+=t*(p[2*e+1]+h)));if(0!==C){do{for(d=N-1;0===a.bl_count[d];)d--;a.bl_count[d]--;a.bl_count[d+1]+=2;a.bl_count[N]--;C-=2}while(0<C);for(d=N;0!==
|
||
d;d--)for(e=a.bl_count[d];0!==e;)h=a.heap[--c],h>g||(k[2*h+1]!==d&&(a.opt_len+=(d-k[2*h+1])*k[2*h],k[2*h+1]=d),e--)}q(f,m,a.bl_count)}function z(a,b,c){var d,e,f=-1,k=b[1],g=0,m=7,h=4;0===k&&(m=138,h=3);b[2*(c+1)+1]=65535;for(d=0;d<=c;d++)e=k,k=b[2*(d+1)+1],++g<m&&e===k||(g<h?a.bl_tree[2*e]+=g:0!==e?(e!==f&&a.bl_tree[2*e]++,a.bl_tree[2*r]++):10>=g?a.bl_tree[2*da]++:a.bl_tree[2*ca]++,g=0,f=e,0===k?(m=138,h=3):e===k?(m=6,h=3):(m=7,h=4))}function t(a,b,c){var d,e,f=-1,k=b[1],g=0,m=7,t=4;0===k&&(m=138,
|
||
t=3);for(d=0;d<=c;d++)if(e=k,k=b[2*(d+1)+1],!(++g<m&&e===k)){if(g<t){do l(a,e,a.bl_tree);while(0!==--g)}else 0!==e?(e!==f&&(l(a,e,a.bl_tree),g--),l(a,r,a.bl_tree),h(a,g-3,2)):10>=g?(l(a,da,a.bl_tree),h(a,g-3,3)):(l(a,ca,a.bl_tree),h(a,g-11,7));g=0;f=e;0===k?(m=138,t=3):e===k?(m=6,t=3):(m=7,t=4)}}function E(a){var b,c=4093624447;for(b=0;31>=b;b++,c>>>=1)if(1&c&&0!==a.dyn_ltree[2*b])return C;if(0!==a.dyn_ltree[18]||0!==a.dyn_ltree[20]||0!==a.dyn_ltree[26])return p;for(b=32;b<x;b++)if(0!==a.dyn_ltree[2*
|
||
b])return p;return C}function m(a,b,c,d){h(a,(I<<1)+(d?1:0),3);y(a);g(a,c);g(a,~c);P.arraySet(a.pending_buf,a.window,b,c,a.pending);a.pending+=c}var P=b("../utils/common"),C=0,p=1,I=0,x=256,S=x+1+29,O=30,G=19,X=2*S+1,T=15,aa=16,V=256,r=16,da=17,ca=18,B=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ba=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],K=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],A=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],J=Array(2*(S+2));a(J);
|
||
var Q=Array(2*O);a(Q);var Z=Array(512);a(Z);var Y=Array(256);a(Y);var M=Array(29);a(M);var U=Array(O);a(U);var W,R,L,ea=!1;c._tr_init=function(a){if(!ea){var b,c,f,g=Array(T+1);for(f=c=0;28>f;f++)for(M[f]=c,b=0;b<1<<B[f];b++)Y[c++]=f;Y[c-1]=f;for(f=c=0;16>f;f++)for(U[f]=c,b=0;b<1<<ba[f];b++)Z[c++]=f;for(c>>=7;f<O;f++)for(U[f]=c<<7,b=0;b<1<<ba[f]-7;b++)Z[256+c++]=f;for(b=0;b<=T;b++)g[b]=0;for(b=0;143>=b;)J[2*b+1]=8,b++,g[8]++;for(;255>=b;)J[2*b+1]=9,b++,g[9]++;for(;279>=b;)J[2*b+1]=7,b++,g[7]++;for(;287>=
|
||
b;)J[2*b+1]=8,b++,g[8]++;q(J,S+1,g);for(b=0;b<O;b++)Q[2*b+1]=5,Q[2*b]=n(b,5);W=new e(J,B,x+1,S,T);R=new e(Q,ba,0,O,T);L=new e([],K,0,G,7);ea=!0}a.l_desc=new d(a.dyn_ltree,W);a.d_desc=new d(a.dyn_dtree,R);a.bl_desc=new d(a.bl_tree,L);a.bi_buf=0;a.bi_valid=0;u(a)};c._tr_stored_block=m;c._tr_flush_block=function(a,b,c,d){var e,f,g=0;if(0<a.level){2===a.strm.data_type&&(a.strm.data_type=E(a));v(a,a.l_desc);v(a,a.d_desc);z(a,a.dyn_ltree,a.l_desc.max_code);z(a,a.dyn_dtree,a.d_desc.max_code);v(a,a.bl_desc);
|
||
for(g=G-1;3<=g&&0===a.bl_tree[2*A[g]+1];g--);g=(a.opt_len+=3*(g+1)+14,g);e=a.opt_len+3+7>>>3;f=a.static_len+3+7>>>3;f<=e&&(e=f)}else e=f=c+5;if(c+4<=e&&-1!==b)m(a,b,c,d);else if(4===a.strategy||f===e)h(a,2+(d?1:0),3),H(a,J,Q);else{h(a,4+(d?1:0),3);b=a.l_desc.max_code+1;c=a.d_desc.max_code+1;g+=1;h(a,b-257,5);h(a,c-1,5);h(a,g-4,4);for(e=0;e<g;e++)h(a,a.bl_tree[2*A[e]+1],3);t(a,a.dyn_ltree,b-1);t(a,a.dyn_dtree,c-1);H(a,a.dyn_ltree,a.dyn_dtree)}u(a);d&&y(a)};c._tr_tally=function(a,b,c){return a.pending_buf[a.d_buf+
|
||
2*a.last_lit]=b>>>8&255,a.pending_buf[a.d_buf+2*a.last_lit+1]=255&b,a.pending_buf[a.l_buf+a.last_lit]=255&c,a.last_lit++,0===b?a.dyn_ltree[2*c]++:(a.matches++,b--,a.dyn_ltree[2*(Y[c]+x+1)]++,a.dyn_dtree[2*(256>b?Z[b]:Z[256+(b>>>7)])]++),a.last_lit===a.lit_bufsize-1};c._tr_align=function(a){h(a,2,3);l(a,V,J);16===a.bi_valid?(g(a,a.bi_buf),a.bi_buf=0,a.bi_valid=0):8<=a.bi_valid&&(a.pending_buf[a.pending++]=255&a.bi_buf,a.bi_buf>>=8,a.bi_valid-=8)}},{"../utils/common":62}],74:[function(b,f,c){f.exports=
|
||
function(){this.input=null;this.total_in=this.avail_in=this.next_in=0;this.output=null;this.total_out=this.avail_out=this.next_out=0;this.msg="";this.state=null;this.data_type=2;this.adler=0}},{}]},{},[10])(10)});function VsdxExport(w,b){function f(a,c,d){mxUtils.get(b+"/allConstants.json",function(b){b=JSON.parse(b.request.responseText);for(var e in b)if(1<c&&e==v.CONTENT_TYPES_XML){for(var f=mxUtils.parseXml(b[e]),g=f.documentElement,m=g.children,h=null,t=0;t<m.length;t++){var l=m[t];"/visio/pages/page1.xml"==l.getAttribute(v.PART_NAME)&&(h=l)}for(t=2;t<=c;t++)m=h.cloneNode(),m.setAttribute(v.PART_NAME,"/visio/pages/page"+t+".xml"),g.appendChild(m);F(a,e,f,!0)}else a.file(e,b[e]);d&&d()})}function c(a){var b=
|
||
{};try{var c=a.getGraphBounds().clone(),d=a.view.scale,e=a.view.translate,f=Math.round(c.x/d)-e.x,g=Math.round(c.y/d)-e.y,h=a.pageFormat.width,t=a.pageFormat.height;0>f&&(f+=Math.ceil((e.x-c.x/d)/h)*h);0>g&&(g+=Math.ceil((e.y-c.y/d)/t)*t);var l=Math.max(1,Math.ceil((c.width/d+f)/h)),n=Math.max(1,Math.ceil((c.height/d+g)/t));b.gridEnabled=a.gridEnabled;b.gridSize=a.gridSize;b.guidesEnabled=a.graphHandler.guidesEnabled;b.pageVisible=a.pageVisible;b.pageScale=a.pageScale;b.pageWidth=a.pageFormat.width*
|
||
l;b.pageHeight=a.pageFormat.height*n;b.backgroundClr=a.background;b.mathEnabled=a.mathEnabled;b.shadowVisible=a.shadowVisible}catch(X){}return b}function a(a,b,c){return e(a,b/v.CONVERSION_FACTOR,c)}function e(a,b,c){c=c.createElement("Cell");c.setAttribute("N",a);c.setAttribute("V",b);return c}function d(b,c,d,e,f){var g=f.createElement("Row");g.setAttribute("T",b);g.setAttribute("IX",c);g.appendChild(a("X",d,f));g.appendChild(a("Y",e,f));return g}function g(b,c,d){var f=b.style[mxConstants.STYLE_FILLCOLOR];
|
||
if(f&&"none"!=f){if(c.appendChild(e("FillForegnd",f,d)),(f=b.style[mxConstants.STYLE_GRADIENTCOLOR])&&"none"!=f){c.appendChild(e("FillBkgnd",f,d));var f=b.style[mxConstants.STYLE_GRADIENT_DIRECTION],g=28;if(f)switch(f){case mxConstants.DIRECTION_EAST:g=25;break;case mxConstants.DIRECTION_WEST:g=27;break;case mxConstants.DIRECTION_NORTH:g=30}c.appendChild(e("FillPattern",g,d))}}else c.appendChild(e("FillPattern",0,d));(f=b.style[mxConstants.STYLE_STROKECOLOR])&&"none"!=f?c.appendChild(e("LineColor",
|
||
f,d)):c.appendChild(e("LinePattern",0,d));(f=b.style[mxConstants.STYLE_STROKEWIDTH])&&c.appendChild(a("LineWeight",f,d));(g=b.style[mxConstants.STYLE_OPACITY])?f=g:(f=b.style[mxConstants.STYLE_FILL_OPACITY],g=b.style[mxConstants.STYLE_STROKE_OPACITY]);f&&c.appendChild(e("FillForegndTrans",1-parseInt(f)/100,d));g&&c.appendChild(e("LineColorTrans",1-parseInt(g)/100,d));if(1==b.style[mxConstants.STYLE_DASHED]){f=b.style[mxConstants.STYLE_DASH_PATTERN];g=9;if(f)switch(f){case "1 1":g=10;break;case "1 2":g=
|
||
3;break;case "1 4":g=17}c.appendChild(e("LinePattern",g,d))}1==b.style[mxConstants.STYLE_SHADOW]&&(c.appendChild(e("ShdwPattern",1,d)),c.appendChild(e("ShdwForegnd","#000000",d)),c.appendChild(e("ShdwForegndTrans",.6,d)),c.appendChild(e("ShapeShdwType",1,d)),c.appendChild(e("ShapeShdwOffsetX","0.02946278254943948",d)),c.appendChild(e("ShapeShdwOffsetY","-0.02946278254943948",d)),c.appendChild(e("ShapeShdwScaleFactor","1",d)),c.appendChild(e("ShapeShdwBlur","0.05555555555555555",d)),c.appendChild(e("ShapeShdwShow",
|
||
2,d)));1==b.style[mxConstants.STYLE_FLIPH]&&c.appendChild(e("FlipX",1,d));1==b.style[mxConstants.STYLE_FLIPV]&&c.appendChild(e("FlipY",1,d));1==b.style[mxConstants.STYLE_ROUNDED]&&c.appendChild(a("Rounding",.1*b.cell.geometry.width,d));(b=b.style[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR])&&c.appendChild(e("TextBkgnd",b,d))}function h(b,c,d,e){var f=d.createElement("Shape");f.setAttribute("ID",b);f.setAttribute("NameU","Shape"+b);f.setAttribute("LineStyle","0");f.setAttribute("FillStyle","0");f.setAttribute("TextStyle",
|
||
"0");b=c.width/2;var g=c.height/2;f.appendChild(a("PinX",c.x+b,d));f.appendChild(a("PinY",e-c.y-g,d));f.appendChild(a("Width",c.width,d));f.appendChild(a("Height",c.height,d));f.appendChild(a("LocPinX",b,d));f.appendChild(a("LocPinY",g,d));return f}function l(a,b){var c=v.ARROWS_MAP[(null==a?"none":a)+"|"+(null==b?"1":b)];return null!=c?c:1}function n(a){return null==a?2:2>=a?0:3>=a?1:5>=a?2:7>=a?3:9>=a?4:22>=a?5:6}function q(b,c,f,h){var m=c.view.getState(b);c=f.createElement("Shape");c.setAttribute("ID",
|
||
b.id);c.setAttribute("NameU","Edge"+b.id);c.setAttribute("LineStyle","0");c.setAttribute("FillStyle","0");c.setAttribute("TextStyle","0");b=m.absolutePoints;var p=m.cellBounds,t=p.width/2,x=p.height/2;c.appendChild(a("PinX",p.x+t,f));c.appendChild(a("PinY",h-p.y-x,f));c.appendChild(a("Width",p.width,f));c.appendChild(a("Height",p.height,f));c.appendChild(a("LocPinX",t,f));c.appendChild(a("LocPinY",x,f));var q=z.state,t=function(a,b){var c=a.x,d=a.y,c=(c-p.x+q.dx)*q.scale,d=((b?0:p.height)-d+p.y-q.dy)*
|
||
q.scale;return{x:c,y:d}},x=t(b[0],!0);c.appendChild(a("BeginX",p.x+x.x,f));c.appendChild(a("BeginY",h-p.y+x.y,f));x=t(b[b.length-1],!0);c.appendChild(a("EndX",p.x+x.x,f));c.appendChild(a("EndY",h-p.y+x.y,f));c.appendChild(e("BegTrigger","2",f));c.appendChild(e("EndTrigger","2",f));c.appendChild(e("ConFixedCode","6",f));c.appendChild(e("LockHeight","1",f));c.appendChild(e("LockCalcWH","1",f));c.appendChild(e("NoAlignBox","1",f));c.appendChild(e("DynFeedback","2",f));c.appendChild(e("GlueType","2",
|
||
f));c.appendChild(e("ObjType","2",f));c.appendChild(e("NoLiveDynamics","1",f));c.appendChild(e("ShapeSplittable","1",f));c.appendChild(e("LayerMember","0",f));g(m,c,f);x=m.style[mxConstants.STYLE_STARTSIZE];h=l(m.style[mxConstants.STYLE_STARTARROW],m.style[mxConstants.STYLE_STARTFILL]);c.appendChild(e("BeginArrow",h,f));c.appendChild(e("BeginArrowSize",n(x),f));x=m.style[mxConstants.STYLE_ENDSIZE];h=l(m.style[mxConstants.STYLE_ENDARROW],m.style[mxConstants.STYLE_ENDFILL]);c.appendChild(e("EndArrow",
|
||
h,f));c.appendChild(e("EndArrowSize",n(x),f));null!=m.text&&m.text.checkBounds()&&(z.save(),m.text.paint(z),z.restore());m=f.createElement("Section");m.setAttribute("N","Geometry");m.setAttribute("IX","0");for(h=0;h<b.length;h++)x=t(b[h]),m.appendChild(d(0==h?"MoveTo":"LineTo",h+1,x.x,x.y,f));m.appendChild(e("NoFill","1",f));m.appendChild(e("NoLine","0",f));c.appendChild(m);return c}function u(a,b,c,d,e){var f=a.geometry;if(null!=f){f.relative&&e&&(f=f.clone(),f.x*=e.width,f.y*=e.height,f.relative=
|
||
0);if(!a.treatAsSingle&&0<a.getChildCount()){d=h(a.id+"10000",f,c,d);d.setAttribute("Type","Group");e=c.createElement("Shapes");z.save();z.translate(-f.x,-f.y);var m=f.clone();m.x=0;m.y=0;a.setGeometry(m);a.treatAsSingle=!0;m=u(a,b,c,f.height,f);a.treatAsSingle=!1;a.setGeometry(f);e.appendChild(m);for(var l=0;l<a.children.length;l++)m=u(a.children[l],b,c,f.height,f),e.appendChild(m);d.appendChild(e);z.restore();return d}return a.vertex?(d=h(a.id,f,c,d),a=b.view.getState(a),g(a,d,c),z.newShape(d,a,
|
||
c),null!=a.text&&a.text.checkBounds()&&(z.save(),a.text.paint(z),z.restore()),null!=a.shape&&a.shape.checkBounds()&&(z.save(),a.shape.paint(z),z.restore()),d.appendChild(z.getShapeGeo()),z.endShape(),d.setAttribute("Type",z.getShapeType()),d):q(a,b,c,d)}return null}function y(a,b){var c=mxUtils.createXmlDocument(),d=c.createElement("PageContents");d.setAttribute("xmlns",v.XMLNS);d.setAttribute("xmlns:r",v.XMLNS_R);d.setAttribute("xml:space",v.XML_SPACE);var e=c.createElement("Shapes");d.appendChild(e);
|
||
var f=a.model,g=a.view.translate,h=a.view.scale,l=a.getGraphBounds(),n=0,t=0;if(l.x/h<g.x||l.y/h<g.y)n=Math.ceil((g.x-l.x/h)/a.pageFormat.width)*a.pageFormat.width,t=Math.ceil((g.y-l.y/h)/a.pageFormat.height)*a.pageFormat.height;z.save();z.translate(-g.x+n,-g.y+t);z.scale(1/h);z.newPage();var h=a.getDefaultParent(),q;for(q in f.cells)g=f.cells[q],g.parent==h&&(g=u(g,a,c,b.pageHeight),null!=g&&e.appendChild(g));e=c.createElement("Connects");d.appendChild(e);for(q in f.cells)g=f.cells[q],g.edge&&(g.source&&
|
||
(h=c.createElement("Connect"),h.setAttribute("FromSheet",g.id),h.setAttribute("FromCell","BeginX"),h.setAttribute("ToSheet",g.source.id),e.appendChild(h)),g.target&&(h=c.createElement("Connect"),h.setAttribute("FromSheet",g.id),h.setAttribute("FromCell","EndX"),h.setAttribute("ToSheet",g.target.id),e.appendChild(h)));c.appendChild(d);z.restore();return c}function F(a,b,c,d){a.file(b,(d?"":'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>')+mxUtils.getXml(c))}function D(b,c,d){var f=mxUtils.createXmlDocument(),
|
||
g=mxUtils.createXmlDocument(),h=f.createElement("Pages");h.setAttribute("xmlns",v.XMLNS);h.setAttribute("xmlns:r",v.XMLNS_R);h.setAttribute("xml:space",v.XML_SPACE);var l=g.createElement("Relationships");l.setAttribute("xmlns",v.RELS_XMLNS);var m=1,n;for(n in c){var t="page"+m+".xml",q=f.createElement("Page");q.setAttribute("ID",m-1);q.setAttribute("NameU",n);q.setAttribute("Name",n);var u=f.createElement("PageSheet"),w=d[n];u.appendChild(a("PageWidth",w.pageWidth,f));u.appendChild(a("PageHeight",
|
||
w.pageHeight,f));u.appendChild(e("PageScale",w.pageScale,f));u.appendChild(e("DrawingScale",1,f));w=f.createElement("Rel");w.setAttribute("r:id","rId"+m);q.appendChild(u);q.appendChild(w);h.appendChild(q);q=g.createElement("Relationship");q.setAttribute("Id","rId"+m);q.setAttribute("Type",v.PAGES_TYPE);q.setAttribute("Target",t);l.appendChild(q);F(b,v.VISIO_PAGES+t,c[n]);m++}f.appendChild(h);g.appendChild(l);F(b,v.VISIO_PAGES+"pages.xml",f);F(b,v.VISIO_PAGES+"_rels/pages.xml.rels",g)}function H(a,
|
||
b){var c=v.VISIO_PAGES_RELS+"page"+b+".xml.rels",d=mxUtils.createXmlDocument(),e=d.createElement("Relationships");e.setAttribute("xmlns",v.RELS_XMLNS);var f=z.images;if(0<f.length)for(var g=0;g<f.length;g++){var h=d.createElement("Relationship");h.setAttribute("Type",v.XMLNS_R+"/image");h.setAttribute("Id","rId"+(g+1));h.setAttribute("Target","../media/"+f[g]);e.appendChild(h)}d.appendChild(e);F(a,c,d)}var v=this;b=b||"js/diagramly/vsdx/resources";var z=new mxVsdxCanvas2D;this.exportCurrentDiagrams=
|
||
function(){try{var a=new JSZip;z.init(a);pages={};modelsAttr={};var b=null!=w.pages?w.pages.length:1;if(null!=w.pages){for(var d=w.currentPage,e=0;e<w.pages.length;e++){var g=w.pages[e];w.selectPage(g);var h=g.getName(),l=w.editor.graph,n=c(l);pages[h]=y(l,n);H(a,e+1);modelsAttr[h]=n}w.selectPage(d)}else l=w.editor.graph,n=c(l),h="Page1",pages[h]=y(l,n),H(a,1),modelsAttr[h]=n;f(a,b,function(){D(a,pages,modelsAttr);var b=function(){0<z.filesLoading?setTimeout(b,200*z.filesLoading):a.generateAsync({type:"blob"}).then(function(a){var b=
|
||
w.getCurrentFile(),b=null!=b&&null!=b.getTitle()?b.getTitle():w.defaultFilename;w.saveData(b+".vsdx","vsdx",a,"application/vnd.visio2013")})};b()});return!0}catch(S){return console.log(S),!1}}}VsdxExport.prototype.CONVERSION_FACTOR=101.6;VsdxExport.prototype.PAGES_TYPE="http://schemas.microsoft.com/visio/2010/relationships/page";VsdxExport.prototype.RELS_XMLNS="http://schemas.openxmlformats.org/package/2006/relationships";VsdxExport.prototype.XML_SPACE="preserve";VsdxExport.prototype.XMLNS_R="http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
||
VsdxExport.prototype.XMLNS="http://schemas.microsoft.com/office/visio/2012/main";VsdxExport.prototype.VISIO_PAGES="visio/pages/";VsdxExport.prototype.PREFEX="com/mxgraph/io/vsdx/resources/export/";VsdxExport.prototype.VSDX_ENC="ISO-8859-1";VsdxExport.prototype.PART_NAME="PartName";VsdxExport.prototype.CONTENT_TYPES_XML="[Content_Types].xml";VsdxExport.prototype.VISIO_PAGES_RELS="visio/pages/_rels/";
|
||
VsdxExport.prototype.ARROWS_MAP={"none|1":0,"none|0":0,"open|1":1,"open|0":1,"block|0":4,"block|1":14,"classic|1":5,"classic|0":17,"oval|1":10,"oval|0":20,"diamond|1":11,"diamond|0":22,"blockThin|1":2,"blockThin|0":2,"dash|1":23,"dash|0":23,"ERone|1":24,"ERone|0":24,"ERmandOne|1":25,"ERmandOne|0":25,"ERmany|1":27,"ERmany|0":27,"ERoneToMany|1":28,"ERoneToMany|0":28,"ERzeroToMany|1":29,"ERzeroToMany|0":29,"ERzeroToOne|1":30,"ERzeroToOne|0":30,"openAsync|1":9,"openAsync|0":9};function mxVsdxCanvas2D(w){mxAbstractCanvas2D.call(this)}mxUtils.extend(mxVsdxCanvas2D,mxAbstractCanvas2D);mxVsdxCanvas2D.prototype.textEnabled=!0;mxVsdxCanvas2D.prototype.init=function(w){this.filesLoading=0;this.zip=w};
|
||
mxVsdxCanvas2D.prototype.createGeoSec=function(){null!=this.geoSec&&this.shape.appendChild(this.geoSec);var w=this.xmlDoc.createElement("Section");w.setAttribute("N","Geometry");w.setAttribute("IX",this.geoIndex++);this.geoSec=w;this.geoStepIndex=1;this.lastMoveToY=this.lastMoveToX=this.lastY=this.lastX=0};mxVsdxCanvas2D.prototype.newShape=function(w,b,f){this.geoIndex=0;this.shape=w;this.cellState=b;this.xmGeo=b.cell.geometry;this.xmlDoc=f;this.shapeImg=this.geoSec=null;this.shapeType="Shape";this.createGeoSec()};
|
||
mxVsdxCanvas2D.prototype.endShape=function(){null!=this.shapeImg&&this.addForeignData(this.shapeImg.type,this.shapeImg.id)};mxVsdxCanvas2D.prototype.newPage=function(){this.images=[]};mxVsdxCanvas2D.prototype.getShapeType=function(){return this.shapeType};mxVsdxCanvas2D.prototype.getShapeGeo=function(){return this.geoSec};mxVsdxCanvas2D.prototype.createCellElemScaled=function(w,b,f){return this.createCellElem(w,b/VsdxExport.prototype.CONVERSION_FACTOR,f)};
|
||
mxVsdxCanvas2D.prototype.createCellElem=function(w,b,f){var c=this.xmlDoc.createElement("Cell");c.setAttribute("N",w);c.setAttribute("V",b);f&&c.setAttribute("F",f);return c};
|
||
mxVsdxCanvas2D.prototype.createRowRel=function(w,b,f,c,a,e,d,g){var h=this.xmlDoc.createElement("Row");h.setAttribute("T",w);h.setAttribute("IX",b);h.appendChild(this.createCellElem("X",f));h.appendChild(this.createCellElem("Y",c));null!=a&&h.appendChild(this.createCellElem("A",a));null!=e&&h.appendChild(this.createCellElem("B",e));null!=d&&h.appendChild(this.createCellElem("C",d));null!=g&&h.appendChild(this.createCellElem("D",g));return h};
|
||
mxVsdxCanvas2D.prototype.begin=function(){1<this.geoStepIndex&&this.createGeoSec()};
|
||
mxVsdxCanvas2D.prototype.rect=function(w,b,f,c){1<this.geoStepIndex&&this.createGeoSec();var a=this.state;f*=a.scale;c*=a.scale;var e=this.xmGeo;w=(w-e.x+a.dx)*a.scale/f;b=(e.height-b+e.y-a.dy)*a.scale/c;this.geoSec.appendChild(this.createRowRel("RelMoveTo",this.geoStepIndex++,w,b));this.geoSec.appendChild(this.createRowRel("RelLineTo",this.geoStepIndex++,w+1,b));this.geoSec.appendChild(this.createRowRel("RelLineTo",this.geoStepIndex++,w+1,b-1));this.geoSec.appendChild(this.createRowRel("RelLineTo",
|
||
this.geoStepIndex++,w,b-1));this.geoSec.appendChild(this.createRowRel("RelLineTo",this.geoStepIndex++,w,b))};mxVsdxCanvas2D.prototype.roundrect=function(w,b,f,c,a,e){this.rect(w,b,f,c);this.shape.appendChild(this.createCellElemScaled("Rounding",a))};
|
||
mxVsdxCanvas2D.prototype.ellipse=function(w,b,f,c){1<this.geoStepIndex&&this.createGeoSec();var a=this.state;f*=a.scale;c*=a.scale;var e=this.xmGeo,d=e.height*a.scale,g=e.width*a.scale;w=(w-e.x+a.dx)*a.scale;b=d+(-b+e.y-a.dy)*a.scale;a=c/d;e=f/g;this.geoSec.appendChild(this.createRowRel("RelMoveTo",this.geoStepIndex++,w/g,b/d-.5*a));w=this.createRowRel("RelEllipticalArcTo",this.geoStepIndex++,w/g,b/d-.5001*a,.5*e+w/g,b/d-a,0);w.appendChild(this.createCellElem("D",f/c,"Width/Height*"+e/a));this.geoSec.appendChild(w)};
|
||
mxVsdxCanvas2D.prototype.moveTo=function(w,b){this.lastMoveToX=w;this.lastMoveToY=b;this.lastX=w;this.lastY=b;var f=this.xmGeo,c=this.state;w=(w-f.x+c.dx)*c.scale;b=(f.height-b+f.y-c.dy)*c.scale;var a=f.height*c.scale,f=f.width*c.scale;this.geoSec.appendChild(this.createRowRel("RelMoveTo",this.geoStepIndex++,w/f,b/a))};
|
||
mxVsdxCanvas2D.prototype.lineTo=function(w,b){this.lastX=w;this.lastY=b;var f=this.xmGeo,c=this.state;w=(w-f.x+c.dx)*c.scale;b=(f.height-b+f.y-c.dy)*c.scale;var a=f.height*c.scale,f=f.width*c.scale;this.geoSec.appendChild(this.createRowRel("RelLineTo",this.geoStepIndex++,w/f,b/a))};
|
||
mxVsdxCanvas2D.prototype.quadTo=function(w,b,f,c){this.lastX=f;this.lastY=c;var a=this.state,e=this.xmGeo,d=e.height*a.scale,g=e.width*a.scale;w=(w-e.x+a.dx)*a.scale;b=(e.height-b+e.y-a.dy)*a.scale;f=(f-e.x+a.dx)*a.scale;c=(e.height-c+e.y-a.dy)*a.scale;this.geoSec.appendChild(this.createRowRel("RelQuadBezTo",this.geoStepIndex++,f/g,c/d,w/g,b/d))};
|
||
mxVsdxCanvas2D.prototype.curveTo=function(w,b,f,c,a,e){this.lastX=a;this.lastY=e;var d=this.state,g=this.xmGeo,h=g.height*d.scale,l=g.width*d.scale;w=(w-g.x+d.dx)*d.scale;b=(g.height-b+g.y-d.dy)*d.scale;f=(f-g.x+d.dx)*d.scale;c=(g.height-c+g.y-d.dy)*d.scale;a=(a-g.x+d.dx)*d.scale;e=(g.height-e+g.y-d.dy)*d.scale;this.geoSec.appendChild(this.createRowRel("RelCubBezTo",this.geoStepIndex++,a/l,e/h,w/l,b/h,f/l,c/h))};
|
||
mxVsdxCanvas2D.prototype.close=function(){this.lastMoveToX==this.lastX&&this.lastMoveToY==this.lastY||this.lineTo(this.lastMoveToX,this.lastMoveToY)};mxVsdxCanvas2D.prototype.addForeignData=function(w,b){var f=this.xmlDoc.createElement("ForeignData");f.setAttribute("ForeignType","Bitmap");w=w.toUpperCase();"BMP"!=w&&f.setAttribute("CompressionType",w);var c=this.xmlDoc.createElement("Rel");c.setAttribute("r:id","rId"+b);f.appendChild(c);this.shape.appendChild(f);this.shapeType="Foreign"};
|
||
mxVsdxCanvas2D.prototype.image=function(w,b,f,c,a,e,d,g){var h="image"+(this.images.length+1)+".",l;if(0==a.indexOf("data:"))l=a.indexOf("base64,"),e=a.substring(l+7),l=a.substring(11,l-1),h+=l,this.zip.file("visio/media/"+h,e,{base64:!0});else if(window.XMLHttpRequest){a=this.converter.convert(a);this.filesLoading++;var n=this;l=a.lastIndexOf(".");l=a.substring(l+1);h+=l;e=new XMLHttpRequest;e.open("GET",a,!0);e.responseType="arraybuffer";e.onreadystatechange=function(a){4==this.readyState&&200==
|
||
this.status&&(n.zip.file("visio/media/"+h,this.response),n.filesLoading--)};e.send()}this.images.push(h);this.shapeImg={type:l,id:this.images.length};a=this.state;f*=a.scale;c*=a.scale;l=this.xmGeo;w=(w-l.x+a.dx)*a.scale;b=(l.height-b+l.y-a.dy)*a.scale;this.shape.appendChild(this.createCellElemScaled("ImgOffsetX",w));this.shape.appendChild(this.createCellElemScaled("ImgOffsetY",b-c));this.shape.appendChild(this.createCellElemScaled("ImgWidth",f));this.shape.appendChild(this.createCellElemScaled("ImgHeight",
|
||
c))};
|
||
mxVsdxCanvas2D.prototype.text=function(w,b,f,c,a,e,d,g,h,l,n,q,u){if(this.textEnabled&&null!=a){mxUtils.isNode(a)&&(a=mxUtils.getOuterHtml(a));"html"==h&&("0"!=mxUtils.getValue(this.cellState.style,"nl2Br","1")&&(a=a.replace(/\n/g,"").replace(/<br\s*.?>/g,"\n")),null==this.html2txtDiv&&(this.html2txtDiv=document.createElement("div")),this.html2txtDiv.innerHTML=a,a=mxUtils.extractTextWithWhitespace(this.html2txtDiv.childNodes));l=this.state;n=this.xmGeo;u=mxUtils.getSizeForString(a,null,null,0<f?f:
|
||
null);h=g=0;switch(e){case "right":g=u.width/4;break;case "left":g=-u.width/4}switch(d){case "top":h=u.height/2;break;case "bottom":h=-u.height/2}c=0<c?c:u.height;f=0<f?f:u.width;f*=l.scale;c*=l.scale;w=(w-n.x+l.dx)*l.scale;b=(n.height-b+n.y-l.dy)*l.scale;e=f/2;d=c/2;this.shape.appendChild(this.createCellElemScaled("TxtPinX",w));this.shape.appendChild(this.createCellElemScaled("TxtPinY",b));this.shape.appendChild(this.createCellElemScaled("TxtWidth",f));this.shape.appendChild(this.createCellElemScaled("TxtHeight",
|
||
c));this.shape.appendChild(this.createCellElemScaled("TxtLocPinX",e+g));this.shape.appendChild(this.createCellElemScaled("TxtLocPinY",d+h));0!=q&&this.shape.appendChild(this.createCellElemScaled("TxtAngle",(360-q)*Math.PI/180));w=this.xmlDoc.createElement("Text");w.textContent=a;this.shape.appendChild(w)}};
|
||
mxVsdxCanvas2D.prototype.rotate=function(w,b,f,c,a){0!=w&&(b=this.state,c+=b.dx,a+=b.dy,c*=b.scale,a*=b.scale,this.shape.appendChild(this.createCellElem("Angle",(360-w)*Math.PI/180)),b.rotation+=w,b.rotationCx=c,b.rotationCy=a)};mxVsdxCanvas2D.prototype.stroke=function(){this.geoSec.appendChild(this.createCellElem("NoFill","1"));this.geoSec.appendChild(this.createCellElem("NoLine","0"))};
|
||
mxVsdxCanvas2D.prototype.fill=function(){this.geoSec.appendChild(this.createCellElem("NoFill","0"));this.geoSec.appendChild(this.createCellElem("NoLine","1"))};mxVsdxCanvas2D.prototype.fillAndStroke=function(){this.geoSec.appendChild(this.createCellElem("NoFill","0"));this.geoSec.appendChild(this.createCellElem("NoLine","0"))}; |