bytev-charts-beta
Version:
基于echarts和JavaScript及ES6封装的一个可以直接调用的图表组件库,内置主题设计,简单快捷,且支持用户自定义配置; npm 安装方式: npm install bytev-charts 若启动提示还需额外install插件,则运行 npm install @babel/runtime-corejs2 即可;
1,216 lines (1,098 loc) • 130 kB
JavaScript
import _typeof from "@babel/runtime-corejs2/helpers/typeof";
import _parseInt from "@babel/runtime-corejs2/core-js/parse-int";
import "core-js/modules/es.array.slice.js";
import "core-js/modules/es.regexp.exec.js";
import "core-js/modules/es.string.replace.js";
import "core-js/modules/es.date.to-string.js";
import "core-js/modules/es.array.iterator.js";
import "core-js/modules/es.array-buffer.slice.js";
import "core-js/modules/es.object.to-string.js";
import "core-js/modules/es.typed-array.uint8-array.js";
import "core-js/modules/es.typed-array.copy-within.js";
import "core-js/modules/es.typed-array.every.js";
import "core-js/modules/es.typed-array.fill.js";
import "core-js/modules/es.typed-array.filter.js";
import "core-js/modules/es.typed-array.find.js";
import "core-js/modules/es.typed-array.find-index.js";
import "core-js/modules/es.typed-array.for-each.js";
import "core-js/modules/es.typed-array.includes.js";
import "core-js/modules/es.typed-array.index-of.js";
import "core-js/modules/es.typed-array.iterator.js";
import "core-js/modules/es.typed-array.join.js";
import "core-js/modules/es.typed-array.last-index-of.js";
import "core-js/modules/es.typed-array.map.js";
import "core-js/modules/es.typed-array.reduce.js";
import "core-js/modules/es.typed-array.reduce-right.js";
import "core-js/modules/es.typed-array.reverse.js";
import "core-js/modules/es.typed-array.set.js";
import "core-js/modules/es.typed-array.slice.js";
import "core-js/modules/es.typed-array.some.js";
import "core-js/modules/es.typed-array.sort.js";
import "core-js/modules/es.typed-array.subarray.js";
import "core-js/modules/es.typed-array.to-locale-string.js";
import "core-js/modules/es.typed-array.to-string.js";
import "core-js/modules/es.typed-array.uint16-array.js";
import "core-js/modules/es.typed-array.uint32-array.js";
import "core-js/modules/es.function.name.js";
import "core-js/modules/es.array.last-index-of.js";
import "core-js/modules/es.array.filter.js";
import "core-js/modules/es.array.join.js";
import "core-js/modules/es.array-buffer.constructor.js";
import "core-js/modules/es.regexp.to-string.js";
import "core-js/modules/es.typed-array.int32-array.js";
import "core-js/modules/es.array.concat.js";
import "core-js/modules/es.regexp.flags.js";
/*!
JSZip - A Javascript class for generating and reading zip files
<http://stuartk.com/jszip>
(c) 2009-2014 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 (a) {
if ("object" == (typeof exports === "undefined" ? "undefined" : _typeof(exports)) && "undefined" != typeof module) module.exports = a();else if ("function" == typeof define && define.amd) define([], a);else {
var b;
b = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this, b.JSZip = a();
}
}(function () {
return function a(b, c, d) {
function e(g, h) {
if (!c[g]) {
if (!b[g]) {
var i = "function" == typeof require && require;
if (!h && i) return i(g, !0);
if (f) return f(g, !0);
var j = new Error("Cannot find module '" + g + "'");
throw j.code = "MODULE_NOT_FOUND", j;
}
var k = c[g] = {
exports: {}
};
b[g][0].call(k.exports, function (a) {
var c = b[g][1][a];
return e(c ? c : a);
}, k, k.exports, a, b, c, d);
}
return c[g].exports;
}
for (var f = "function" == typeof require && require, g = 0; g < d.length; g++) {
e(d[g]);
}
return e;
}({
1: [function (a, b, c) {
"use strict";
function d(a) {
if (a) {
this.data = a, this.length = this.data.length, this.index = 0, this.zero = 0;
for (var b = 0; b < this.data.length; b++) {
a[b] = 255 & a[b];
}
}
}
var e = a("./dataReader");
d.prototype = new e(), d.prototype.byteAt = function (a) {
return this.data[this.zero + a];
}, d.prototype.lastIndexOfSignature = function (a) {
for (var b = a.charCodeAt(0), c = a.charCodeAt(1), d = a.charCodeAt(2), e = a.charCodeAt(3), f = this.length - 4; f >= 0; --f) {
if (this.data[f] === b && this.data[f + 1] === c && this.data[f + 2] === d && this.data[f + 3] === e) return f - this.zero;
}
return -1;
}, d.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;
}, b.exports = d;
}, {
"./dataReader": 6
}],
2: [function (a, b, c) {
"use strict";
var d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
c.encode = function (a, b) {
for (var c, e, f, g, h, i, j, k = "", l = 0; l < a.length;) {
c = a.charCodeAt(l++), e = a.charCodeAt(l++), f = a.charCodeAt(l++), g = c >> 2, h = (3 & c) << 4 | e >> 4, i = (15 & e) << 2 | f >> 6, j = 63 & f, isNaN(e) ? i = j = 64 : isNaN(f) && (j = 64), k = k + d.charAt(g) + d.charAt(h) + d.charAt(i) + d.charAt(j);
}
return k;
}, c.decode = function (a, b) {
var c,
e,
f,
g,
h,
i,
j,
k = "",
l = 0;
for (a = a.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < a.length;) {
g = d.indexOf(a.charAt(l++)), h = d.indexOf(a.charAt(l++)), i = d.indexOf(a.charAt(l++)), j = d.indexOf(a.charAt(l++)), c = g << 2 | h >> 4, e = (15 & h) << 4 | i >> 2, f = (3 & i) << 6 | j, k += String.fromCharCode(c), 64 != i && (k += String.fromCharCode(e)), 64 != j && (k += String.fromCharCode(f));
}
return k;
};
}, {}],
3: [function (a, b, c) {
"use strict";
function d() {
this.compressedSize = 0, this.uncompressedSize = 0, this.crc32 = 0, this.compressionMethod = null, this.compressedContent = null;
}
d.prototype = {
getContent: function getContent() {
return null;
},
getCompressedContent: function getCompressedContent() {
return null;
}
}, b.exports = d;
}, {}],
4: [function (a, b, c) {
"use strict";
c.STORE = {
magic: "\x00\x00",
compress: function compress(a, b) {
return a;
},
uncompress: function uncompress(a) {
return a;
},
compressInputType: null,
uncompressInputType: null
}, c.DEFLATE = a("./flate");
}, {
"./flate": 9
}],
5: [function (a, b, c) {
"use strict";
var d = a("./utils"),
e = [0, 1996959894, 3993919788, 2567524794, 124634137, 1886057615, 3915621685, 2657392035, 249268274, 2044508324, 3772115230, 2547177864, 162941995, 2125561021, 3887607047, 2428444049, 498536548, 1789927666, 4089016648, 2227061214, 450548861, 1843258603, 4107580753, 2211677639, 325883990, 1684777152, 4251122042, 2321926636, 335633487, 1661365465, 4195302755, 2366115317, 997073096, 1281953886, 3579855332, 2724688242, 1006888145, 1258607687, 3524101629, 2768942443, 901097722, 1119000684, 3686517206, 2898065728, 853044451, 1172266101, 3705015759, 2882616665, 651767980, 1373503546, 3369554304, 3218104598, 565507253, 1454621731, 3485111705, 3099436303, 671266974, 1594198024, 3322730930, 2970347812, 795835527, 1483230225, 3244367275, 3060149565, 1994146192, 31158534, 2563907772, 4023717930, 1907459465, 112637215, 2680153253, 3904427059, 2013776290, 251722036, 2517215374, 3775830040, 2137656763, 141376813, 2439277719, 3865271297, 1802195444, 476864866, 2238001368, 4066508878, 1812370925, 453092731, 2181625025, 4111451223, 1706088902, 314042704, 2344532202, 4240017532, 1658658271, 366619977, 2362670323, 4224994405, 1303535960, 984961486, 2747007092, 3569037538, 1256170817, 1037604311, 2765210733, 3554079995, 1131014506, 879679996, 2909243462, 3663771856, 1141124467, 855842277, 2852801631, 3708648649, 1342533948, 654459306, 3188396048, 3373015174, 1466479909, 544179635, 3110523913, 3462522015, 1591671054, 702138776, 2966460450, 3352799412, 1504918807, 783551873, 3082640443, 3233442989, 3988292384, 2596254646, 62317068, 1957810842, 3939845945, 2647816111, 81470997, 1943803523, 3814918930, 2489596804, 225274430, 2053790376, 3826175755, 2466906013, 167816743, 2097651377, 4027552580, 2265490386, 503444072, 1762050814, 4150417245, 2154129355, 426522225, 1852507879, 4275313526, 2312317920, 282753626, 1742555852, 4189708143, 2394877945, 397917763, 1622183637, 3604390888, 2714866558, 953729732, 1340076626, 3518719985, 2797360999, 1068828381, 1219638859, 3624741850, 2936675148, 906185462, 1090812512, 3747672003, 2825379669, 829329135, 1181335161, 3412177804, 3160834842, 628085408, 1382605366, 3423369109, 3138078467, 570562233, 1426400815, 3317316542, 2998733608, 733239954, 1555261956, 3268935591, 3050360625, 752459403, 1541320221, 2607071920, 3965973030, 1969922972, 40735498, 2617837225, 3943577151, 1913087877, 83908371, 2512341634, 3803740692, 2075208622, 213261112, 2463272603, 3855990285, 2094854071, 198958881, 2262029012, 4057260610, 1759359992, 534414190, 2176718541, 4139329115, 1873836001, 414664567, 2282248934, 4279200368, 1711684554, 285281116, 2405801727, 4167216745, 1634467795, 376229701, 2685067896, 3608007406, 1308918612, 956543938, 2808555105, 3495958263, 1231636301, 1047427035, 2932959818, 3654703836, 1088359270, 936918e3, 2847714899, 3736837829, 1202900863, 817233897, 3183342108, 3401237130, 1404277552, 615818150, 3134207493, 3453421203, 1423857449, 601450431, 3009837614, 3294710456, 1567103746, 711928724, 3020668471, 3272380065, 1510334235, 755167117];
b.exports = function (a, b) {
if ("undefined" == typeof a || !a.length) return 0;
var c = "string" !== d.getTypeOf(a);
"undefined" == typeof b && (b = 0);
var f = 0,
g = 0,
h = 0;
b = -1 ^ b;
for (var i = 0, j = a.length; j > i; i++) {
h = c ? a[i] : a.charCodeAt(i), g = 255 & (b ^ h), f = e[g], b = b >>> 8 ^ f;
}
return -1 ^ b;
};
}, {
"./utils": 22
}],
6: [function (a, b, c) {
"use strict";
function d(a) {
this.data = null, this.length = 0, this.index = 0, this.zero = 0;
}
var e = a("./utils");
d.prototype = {
checkOffset: function checkOffset(a) {
this.checkIndex(this.index + a);
},
checkIndex: function checkIndex(a) {
if (this.length < this.zero + a || 0 > a) throw new Error("End of data reached (data length = " + this.length + ", asked index = " + a + "). Corrupted zip ?");
},
setIndex: function setIndex(a) {
this.checkIndex(a), this.index = a;
},
skip: function skip(a) {
this.setIndex(this.index + a);
},
byteAt: function byteAt(a) {},
readInt: function readInt(a) {
var b,
c = 0;
for (this.checkOffset(a), b = this.index + a - 1; b >= this.index; b--) {
c = (c << 8) + this.byteAt(b);
}
return this.index += a, c;
},
readString: function readString(a) {
return e.transformTo("string", this.readData(a));
},
readData: function readData(a) {},
lastIndexOfSignature: function lastIndexOfSignature(a) {},
readDate: function readDate() {
var a = this.readInt(4);
return new Date((a >> 25 & 127) + 1980, (a >> 21 & 15) - 1, a >> 16 & 31, a >> 11 & 31, a >> 5 & 63, (31 & a) << 1);
}
}, b.exports = d;
}, {
"./utils": 22
}],
7: [function (a, b, c) {
"use strict";
c.base64 = !1, c.binary = !1, c.dir = !1, c.createFolders = !1, c.date = null, c.compression = null, c.compressionOptions = null, c.comment = null, c.unixPermissions = null, c.dosPermissions = null;
}, {}],
8: [function (a, b, c) {
"use strict";
var d = a("./utils");
c.string2binary = function (a) {
return d.string2binary(a);
}, c.string2Uint8Array = function (a) {
return d.transformTo("uint8array", a);
}, c.uint8Array2String = function (a) {
return d.transformTo("string", a);
}, c.string2Blob = function (a) {
var b = d.transformTo("arraybuffer", a);
return d.arrayBuffer2Blob(b);
}, c.arrayBuffer2Blob = function (a) {
return d.arrayBuffer2Blob(a);
}, c.transformTo = function (a, b) {
return d.transformTo(a, b);
}, c.getTypeOf = function (a) {
return d.getTypeOf(a);
}, c.checkSupport = function (a) {
return d.checkSupport(a);
}, c.MAX_VALUE_16BITS = d.MAX_VALUE_16BITS, c.MAX_VALUE_32BITS = d.MAX_VALUE_32BITS, c.pretty = function (a) {
return d.pretty(a);
}, c.findCompression = function (a) {
return d.findCompression(a);
}, c.isRegExp = function (a) {
return d.isRegExp(a);
};
}, {
"./utils": 22
}],
9: [function (a, b, c) {
"use strict";
var d = "undefined" != typeof Uint8Array && "undefined" != typeof Uint16Array && "undefined" != typeof Uint32Array,
e = a("pako");
c.uncompressInputType = d ? "uint8array" : "array", c.compressInputType = d ? "uint8array" : "array", c.magic = "\b\x00", c.compress = function (a, b) {
return e.deflateRaw(a, {
level: b.level || -1
});
}, c.uncompress = function (a) {
return e.inflateRaw(a);
};
}, {
pako: 25
}],
10: [function (a, b, c) {
"use strict";
function d(a, b) {
return this instanceof d ? (this.files = {}, this.comment = null, this.root = "", a && this.load(a, b), void (this.clone = function () {
var a = new d();
for (var b in this) {
"function" != typeof this[b] && (a[b] = this[b]);
}
return a;
})) : new d(a, b);
}
var e = a("./base64");
d.prototype = a("./object"), d.prototype.load = a("./load"), d.support = a("./support"), d.defaults = a("./defaults"), d.utils = a("./deprecatedPublicUtils"), d.base64 = {
encode: function encode(a) {
return e.encode(a);
},
decode: function decode(a) {
return e.decode(a);
}
}, d.compressions = a("./compressions"), b.exports = d;
}, {
"./base64": 2,
"./compressions": 4,
"./defaults": 7,
"./deprecatedPublicUtils": 8,
"./load": 11,
"./object": 14,
"./support": 18
}],
11: [function (a, b, c) {
"use strict";
var d = a("./base64"),
e = a("./utf8"),
f = a("./utils"),
g = a("./zipEntries");
b.exports = function (a, b) {
var c, h, i, j;
for (b = f.extend(b || {}, {
base64: !1,
checkCRC32: !1,
optimizedBinaryString: !1,
createFolders: !1,
decodeFileName: e.utf8decode
}), b.base64 && (a = d.decode(a)), h = new g(a, b), c = h.files, i = 0; i < c.length; i++) {
j = c[i], this.file(j.fileNameStr, j.decompressed, {
binary: !0,
optimizedBinaryString: !0,
date: j.date,
dir: j.dir,
comment: j.fileCommentStr.length ? j.fileCommentStr : null,
unixPermissions: j.unixPermissions,
dosPermissions: j.dosPermissions,
createFolders: b.createFolders
});
}
return h.zipComment.length && (this.comment = h.zipComment), this;
};
}, {
"./base64": 2,
"./utf8": 21,
"./utils": 22,
"./zipEntries": 23
}],
12: [function (a, b, c) {
(function (a) {
"use strict";
b.exports = function (b, c) {
return new a(b, c);
}, b.exports.test = function (b) {
return a.isBuffer(b);
};
}).call(this, "undefined" != typeof Buffer ? Buffer : void 0);
}, {}],
13: [function (a, b, c) {
"use strict";
function d(a) {
this.data = a, this.length = this.data.length, this.index = 0, this.zero = 0;
}
var e = a("./uint8ArrayReader");
d.prototype = new e(), d.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;
}, b.exports = d;
}, {
"./uint8ArrayReader": 19
}],
14: [function (a, b, c) {
"use strict";
var d = a("./support"),
e = a("./utils"),
f = a("./crc32"),
g = a("./signature"),
h = a("./defaults"),
i = a("./base64"),
j = a("./compressions"),
k = a("./compressedObject"),
l = a("./nodeBuffer"),
m = a("./utf8"),
n = a("./stringWriter"),
o = a("./uint8ArrayWriter"),
p = function p(a) {
if (a._data instanceof k && (a._data = a._data.getContent(), a.options.binary = !0, a.options.base64 = !1, "uint8array" === e.getTypeOf(a._data))) {
var b = a._data;
a._data = new Uint8Array(b.length), 0 !== b.length && a._data.set(b, 0);
}
return a._data;
},
q = function q(a) {
var b = p(a),
c = e.getTypeOf(b);
return "string" === c ? !a.options.binary && d.nodebuffer ? l(b, "utf-8") : a.asBinary() : b;
},
r = function r(a) {
var b = p(this);
return null === b || "undefined" == typeof b ? "" : (this.options.base64 && (b = i.decode(b)), b = a && this.options.binary ? D.utf8decode(b) : e.transformTo("string", b), a || this.options.binary || (b = e.transformTo("string", D.utf8encode(b))), b);
},
s = function s(a, b, c) {
this.name = a, this.dir = c.dir, this.date = c.date, this.comment = c.comment, this.unixPermissions = c.unixPermissions, this.dosPermissions = c.dosPermissions, this._data = b, this.options = c, this._initialMetadata = {
dir: c.dir,
date: c.date
};
};
s.prototype = {
asText: function asText() {
return r.call(this, !0);
},
asBinary: function asBinary() {
return r.call(this, !1);
},
asNodeBuffer: function asNodeBuffer() {
var a = q(this);
return e.transformTo("nodebuffer", a);
},
asUint8Array: function asUint8Array() {
var a = q(this);
return e.transformTo("uint8array", a);
},
asArrayBuffer: function asArrayBuffer() {
return this.asUint8Array().buffer;
}
};
var t = function t(a, b) {
var c,
d = "";
for (c = 0; b > c; c++) {
d += String.fromCharCode(255 & a), a >>>= 8;
}
return d;
},
u = function u(a) {
return a = a || {}, a.base64 !== !0 || null !== a.binary && void 0 !== a.binary || (a.binary = !0), a = e.extend(a, h), a.date = a.date || new Date(), null !== a.compression && (a.compression = a.compression.toUpperCase()), a;
},
v = function v(a, b, c) {
var d,
f = e.getTypeOf(b);
if (c = u(c), "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 = x(a)), c.createFolders && (d = w(a)) && y.call(this, d, !0), c.dir || null === b || "undefined" == typeof b) c.base64 = !1, c.binary = !1, b = null, f = null;else if ("string" === f) c.binary && !c.base64 && c.optimizedBinaryString !== !0 && (b = e.string2binary(b));else {
if (c.base64 = !1, c.binary = !0, !(f || b instanceof k)) throw new Error("The data of '" + a + "' is in an unsupported format !");
"arraybuffer" === f && (b = e.transformTo("uint8array", b));
}
var g = new s(a, b, c);
return this.files[a] = g, g;
},
w = function w(a) {
"/" == a.slice(-1) && (a = a.substring(0, a.length - 1));
var b = a.lastIndexOf("/");
return b > 0 ? a.substring(0, b) : "";
},
x = function x(a) {
return "/" != a.slice(-1) && (a += "/"), a;
},
y = function y(a, b) {
return b = "undefined" != typeof b ? b : !1, a = x(a), this.files[a] || v.call(this, a, null, {
dir: !0,
createFolders: b
}), this.files[a];
},
z = function z(a, b, c) {
var d,
g = new k();
return a._data instanceof k ? (g.uncompressedSize = a._data.uncompressedSize, g.crc32 = a._data.crc32, 0 === g.uncompressedSize || a.dir ? (b = j.STORE, g.compressedContent = "", g.crc32 = 0) : a._data.compressionMethod === b.magic ? g.compressedContent = a._data.getCompressedContent() : (d = a._data.getContent(), g.compressedContent = b.compress(e.transformTo(b.compressInputType, d), c))) : (d = q(a), d && 0 !== d.length && !a.dir || (b = j.STORE, d = ""), g.uncompressedSize = d.length, g.crc32 = f(d), g.compressedContent = b.compress(e.transformTo(b.compressInputType, d), c)), g.compressedSize = g.compressedContent.length, g.compressionMethod = b.magic, g;
},
A = function A(a, b) {
var c = a;
return a || (c = b ? 16893 : 33204), (65535 & c) << 16;
},
B = function B(a, b) {
return 63 & (a || 0);
},
C = function C(a, b, c, d, h, i) {
var j,
k,
l,
n,
o = (c.compressedContent, i !== m.utf8encode),
p = e.transformTo("string", i(b.name)),
q = e.transformTo("string", m.utf8encode(b.name)),
r = b.comment || "",
s = e.transformTo("string", i(r)),
u = e.transformTo("string", m.utf8encode(r)),
v = q.length !== b.name.length,
w = u.length !== r.length,
x = b.options,
y = "",
z = "",
C = "";
l = b._initialMetadata.dir !== b.dir ? b.dir : x.dir, n = b._initialMetadata.date !== b.date ? b.date : x.date;
var D = 0,
E = 0;
l && (D |= 16), "UNIX" === h ? (E = 798, D |= A(b.unixPermissions, l)) : (E = 20, D |= B(b.dosPermissions, l)), j = n.getHours(), j <<= 6, j |= n.getMinutes(), j <<= 5, j |= n.getSeconds() / 2, k = n.getFullYear() - 1980, k <<= 4, k |= n.getMonth() + 1, k <<= 5, k |= n.getDate(), v && (z = t(1, 1) + t(f(p), 4) + q, y += "up" + t(z.length, 2) + z), w && (C = t(1, 1) + t(this.crc32(s), 4) + u, y += "uc" + t(C.length, 2) + C);
var F = "";
F += "\n\x00", F += o || !v && !w ? "\x00\x00" : "\x00\b", F += c.compressionMethod, F += t(j, 2), F += t(k, 2), F += t(c.crc32, 4), F += t(c.compressedSize, 4), F += t(c.uncompressedSize, 4), F += t(p.length, 2), F += t(y.length, 2);
var G = g.LOCAL_FILE_HEADER + F + p + y,
H = g.CENTRAL_FILE_HEADER + t(E, 2) + F + t(s.length, 2) + "\x00\x00\x00\x00" + t(D, 4) + t(d, 4) + p + y + s;
return {
fileRecord: G,
dirRecord: H,
compressedObject: c
};
},
D = {
load: function load(a, b) {
throw new Error("Load method is not defined. Is the file jszip-load.js included ?");
},
filter: function filter(a) {
var b,
c,
d,
f,
g = [];
for (b in this.files) {
this.files.hasOwnProperty(b) && (d = this.files[b], f = new s(d.name, d._data, e.extend(d.options)), c = b.slice(this.root.length, b.length), b.slice(0, this.root.length) === this.root && a(c, f) && g.push(f));
}
return g;
},
file: function file(a, b, c) {
if (1 === arguments.length) {
if (e.isRegExp(a)) {
var d = a;
return this.filter(function (a, b) {
return !b.dir && d.test(a);
});
}
return this.filter(function (b, c) {
return !c.dir && b === a;
})[0] || null;
}
return a = this.root + a, v.call(this, a, b, c), this;
},
folder: function folder(a) {
if (!a) return this;
if (e.isRegExp(a)) return this.filter(function (b, c) {
return c.dir && a.test(b);
});
var b = this.root + a,
c = y.call(this, b),
d = this.clone();
return d.root = c.name, d;
},
remove: function remove(a) {
a = this.root + a;
var b = this.files[a];
if (b || ("/" != a.slice(-1) && (a += "/"), b = this.files[a]), b && !b.dir) delete this.files[a];else for (var c = this.filter(function (b, c) {
return c.name.slice(0, a.length) === a;
}), d = 0; d < c.length; d++) {
delete this.files[c[d].name];
}
return this;
},
generate: function generate(a) {
a = e.extend(a || {}, {
base64: !0,
compression: "STORE",
compressionOptions: null,
type: "base64",
platform: "DOS",
comment: null,
mimeType: "application/zip",
encodeFileName: m.utf8encode
}), e.checkSupport(a.type), "darwin" !== a.platform && "freebsd" !== a.platform && "linux" !== a.platform && "sunos" !== a.platform || (a.platform = "UNIX"), "win32" === a.platform && (a.platform = "DOS");
var b,
c,
d = [],
f = 0,
h = 0,
k = e.transformTo("string", a.encodeFileName(a.comment || this.comment || ""));
for (var l in this.files) {
if (this.files.hasOwnProperty(l)) {
var p = this.files[l],
q = p.options.compression || a.compression.toUpperCase(),
r = j[q];
if (!r) throw new Error(q + " is not a valid compression method !");
var s = p.options.compressionOptions || a.compressionOptions || {},
u = z.call(this, p, r, s),
v = C.call(this, l, p, u, f, a.platform, a.encodeFileName);
f += v.fileRecord.length + u.compressedSize, h += v.dirRecord.length, d.push(v);
}
}
var w = "";
w = g.CENTRAL_DIRECTORY_END + "\x00\x00\x00\x00" + t(d.length, 2) + t(d.length, 2) + t(h, 4) + t(f, 4) + t(k.length, 2) + k;
var x = a.type.toLowerCase();
for (b = "uint8array" === x || "arraybuffer" === x || "blob" === x || "nodebuffer" === x ? new o(f + h + w.length) : new n(f + h + w.length), c = 0; c < d.length; c++) {
b.append(d[c].fileRecord), b.append(d[c].compressedObject.compressedContent);
}
for (c = 0; c < d.length; c++) {
b.append(d[c].dirRecord);
}
b.append(w);
var y = b.finalize();
switch (a.type.toLowerCase()) {
case "uint8array":
case "arraybuffer":
case "nodebuffer":
return e.transformTo(a.type.toLowerCase(), y);
case "blob":
return e.arrayBuffer2Blob(e.transformTo("arraybuffer", y), a.mimeType);
case "base64":
return a.base64 ? i.encode(y) : y;
default:
return y;
}
},
crc32: function crc32(a, b) {
return f(a, b);
},
utf8encode: function utf8encode(a) {
return e.transformTo("string", m.utf8encode(a));
},
utf8decode: function utf8decode(a) {
return m.utf8decode(a);
}
};
b.exports = D;
}, {
"./base64": 2,
"./compressedObject": 3,
"./compressions": 4,
"./crc32": 5,
"./defaults": 7,
"./nodeBuffer": 12,
"./signature": 15,
"./stringWriter": 17,
"./support": 18,
"./uint8ArrayWriter": 20,
"./utf8": 21,
"./utils": 22
}],
15: [function (a, b, c) {
"use strict";
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";
}, {}],
16: [function (a, b, c) {
"use strict";
function d(a, b) {
this.data = a, b || (this.data = f.string2binary(this.data)), this.length = this.data.length, this.index = 0, this.zero = 0;
}
var e = a("./dataReader"),
f = a("./utils");
d.prototype = new e(), d.prototype.byteAt = function (a) {
return this.data.charCodeAt(this.zero + a);
}, d.prototype.lastIndexOfSignature = function (a) {
return this.data.lastIndexOf(a) - this.zero;
}, d.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;
}, b.exports = d;
}, {
"./dataReader": 6,
"./utils": 22
}],
17: [function (a, b, c) {
"use strict";
var d = a("./utils"),
e = function e() {
this.data = [];
};
e.prototype = {
append: function append(a) {
a = d.transformTo("string", a), this.data.push(a);
},
finalize: function finalize() {
return this.data.join("");
}
}, b.exports = e;
}, {
"./utils": 22
}],
18: [function (a, b, c) {
(function (a) {
"use strict";
if (c.base64 = !0, c.array = !0, c.string = !0, c.arraybuffer = "undefined" != typeof ArrayBuffer && "undefined" != typeof Uint8Array, c.nodebuffer = "undefined" != typeof a, c.uint8array = "undefined" != typeof Uint8Array, "undefined" == typeof ArrayBuffer) c.blob = !1;else {
var b = new ArrayBuffer(0);
try {
c.blob = 0 === new Blob([b], {
type: "application/zip"
}).size;
} catch (d) {
try {
var e = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder,
f = new e();
f.append(b), c.blob = 0 === f.getBlob("application/zip").size;
} catch (d) {
c.blob = !1;
}
}
}
}).call(this, "undefined" != typeof Buffer ? Buffer : void 0);
}, {}],
19: [function (a, b, c) {
"use strict";
function d(a) {
a && (this.data = a, this.length = this.data.length, this.index = 0, this.zero = 0);
}
var e = a("./arrayReader");
d.prototype = new e(), d.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;
}, b.exports = d;
}, {
"./arrayReader": 1
}],
20: [function (a, b, c) {
"use strict";
var d = a("./utils"),
e = function e(a) {
this.data = new Uint8Array(a), this.index = 0;
};
e.prototype = {
append: function append(a) {
0 !== a.length && (a = d.transformTo("uint8array", a), this.data.set(a, this.index), this.index += a.length);
},
finalize: function finalize() {
return this.data;
}
}, b.exports = e;
}, {
"./utils": 22
}],
21: [function (a, b, c) {
"use strict";
for (var d = a("./utils"), e = a("./support"), f = a("./nodeBuffer"), g = new Array(256), h = 0; 256 > h; h++) {
g[h] = h >= 252 ? 6 : h >= 248 ? 5 : h >= 240 ? 4 : h >= 224 ? 3 : h >= 192 ? 2 : 1;
}
g[254] = g[254] = 1;
var i = function i(a) {
var b,
c,
d,
f,
g,
h = a.length,
i = 0;
for (f = 0; h > f; f++) {
c = a.charCodeAt(f), 55296 === (64512 & c) && h > f + 1 && (d = a.charCodeAt(f + 1), 56320 === (64512 & d) && (c = 65536 + (c - 55296 << 10) + (d - 56320), f++)), i += 128 > c ? 1 : 2048 > c ? 2 : 65536 > c ? 3 : 4;
}
for (b = e.uint8array ? new Uint8Array(i) : new Array(i), g = 0, f = 0; i > g; f++) {
c = a.charCodeAt(f), 55296 === (64512 & c) && h > f + 1 && (d = a.charCodeAt(f + 1), 56320 === (64512 & d) && (c = 65536 + (c - 55296 << 10) + (d - 56320), f++)), 128 > c ? b[g++] = c : 2048 > c ? (b[g++] = 192 | c >>> 6, b[g++] = 128 | 63 & c) : 65536 > c ? (b[g++] = 224 | c >>> 12, b[g++] = 128 | c >>> 6 & 63, b[g++] = 128 | 63 & c) : (b[g++] = 240 | c >>> 18, b[g++] = 128 | c >>> 12 & 63, b[g++] = 128 | c >>> 6 & 63, b[g++] = 128 | 63 & c);
}
return b;
},
j = function j(a, b) {
var c;
for (b = b || a.length, b > a.length && (b = a.length), c = b - 1; c >= 0 && 128 === (192 & a[c]);) {
c--;
}
return 0 > c ? b : 0 === c ? b : c + g[a[c]] > b ? c : b;
},
k = function k(a) {
var b,
c,
e,
f,
h = a.length,
i = new Array(2 * h);
for (c = 0, b = 0; h > b;) {
if (e = a[b++], 128 > e) i[c++] = e;else if (f = g[e], f > 4) i[c++] = 65533, b += f - 1;else {
for (e &= 2 === f ? 31 : 3 === f ? 15 : 7; f > 1 && h > b;) {
e = e << 6 | 63 & a[b++], f--;
}
f > 1 ? i[c++] = 65533 : 65536 > e ? i[c++] = e : (e -= 65536, i[c++] = 55296 | e >> 10 & 1023, i[c++] = 56320 | 1023 & e);
}
}
return i.length !== c && (i.subarray ? i = i.subarray(0, c) : i.length = c), d.applyFromCharCode(i);
};
c.utf8encode = function (a) {
return e.nodebuffer ? f(a, "utf-8") : i(a);
}, c.utf8decode = function (a) {
if (e.nodebuffer) return d.transformTo("nodebuffer", a).toString("utf-8");
a = d.transformTo(e.uint8array ? "uint8array" : "array", a);
for (var b = [], c = 0, f = a.length, g = 65536; f > c;) {
var h = j(a, Math.min(c + g, f));
e.uint8array ? b.push(k(a.subarray(c, h))) : b.push(k(a.slice(c, h))), c = h;
}
return b.join("");
};
}, {
"./nodeBuffer": 12,
"./support": 18,
"./utils": 22
}],
22: [function (a, b, c) {
"use strict";
function d(a) {
return a;
}
function e(a, b) {
for (var c = 0; c < a.length; ++c) {
b[c] = 255 & a.charCodeAt(c);
}
return b;
}
function f(a) {
var b = 65536,
d = [],
e = a.length,
f = c.getTypeOf(a),
g = 0,
h = !0;
try {
switch (f) {
case "uint8array":
String.fromCharCode.apply(null, new Uint8Array(0));
break;
case "nodebuffer":
String.fromCharCode.apply(null, j(0));
}
} catch (i) {
h = !1;
}
if (!h) {
for (var k = "", l = 0; l < a.length; l++) {
k += String.fromCharCode(a[l]);
}
return k;
}
for (; e > g && b > 1;) {
try {
"array" === f || "nodebuffer" === f ? d.push(String.fromCharCode.apply(null, a.slice(g, Math.min(g + b, e)))) : d.push(String.fromCharCode.apply(null, a.subarray(g, Math.min(g + b, e)))), g += b;
} catch (i) {
b = Math.floor(b / 2);
}
}
return d.join("");
}
function g(a, b) {
for (var c = 0; c < a.length; c++) {
b[c] = a[c];
}
return b;
}
var h = a("./support"),
i = a("./compressions"),
j = a("./nodeBuffer");
c.string2binary = function (a) {
for (var b = "", c = 0; c < a.length; c++) {
b += String.fromCharCode(255 & a.charCodeAt(c));
}
return b;
}, c.arrayBuffer2Blob = function (a, b) {
c.checkSupport("blob"), b = b || "application/zip";
try {
return new Blob([a], {
type: b
});
} catch (d) {
try {
var e = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder,
f = new e();
return f.append(a), f.getBlob(b);
} catch (d) {
throw new Error("Bug : can't construct the Blob.");
}
}
}, c.applyFromCharCode = f;
var k = {};
k.string = {
string: d,
array: function array(a) {
return e(a, new Array(a.length));
},
arraybuffer: function arraybuffer(a) {
return k.string.uint8array(a).buffer;
},
uint8array: function uint8array(a) {
return e(a, new Uint8Array(a.length));
},
nodebuffer: function nodebuffer(a) {
return e(a, j(a.length));
}
}, k.array = {
string: f,
array: d,
arraybuffer: function arraybuffer(a) {
return new Uint8Array(a).buffer;
},
uint8array: function uint8array(a) {
return new Uint8Array(a);
},
nodebuffer: function nodebuffer(a) {
return j(a);
}
}, k.arraybuffer = {
string: function string(a) {
return f(new Uint8Array(a));
},
array: function array(a) {
return g(new Uint8Array(a), new Array(a.byteLength));
},
arraybuffer: d,
uint8array: function uint8array(a) {
return new Uint8Array(a);
},
nodebuffer: function nodebuffer(a) {
return j(new Uint8Array(a));
}
}, k.uint8array = {
string: f,
array: function array(a) {
return g(a, new Array(a.length));
},
arraybuffer: function arraybuffer(a) {
return a.buffer;
},
uint8array: d,
nodebuffer: function nodebuffer(a) {
return j(a);
}
}, k.nodebuffer = {
string: f,
array: function array(a) {
return g(a, new Array(a.length));
},
arraybuffer: function arraybuffer(a) {
return k.nodebuffer.uint8array(a).buffer;
},
uint8array: function uint8array(a) {
return g(a, new Uint8Array(a.length));
},
nodebuffer: d
}, c.transformTo = function (a, b) {
if (b || (b = ""), !a) return b;
c.checkSupport(a);
var d = c.getTypeOf(b),
e = k[d][a](b);
return e;
}, c.getTypeOf = function (a) {
return "string" == typeof a ? "string" : "[object Array]" === Object.prototype.toString.call(a) ? "array" : h.nodebuffer && j.test(a) ? "nodebuffer" : h.uint8array && a instanceof Uint8Array ? "uint8array" : h.arraybuffer && a instanceof ArrayBuffer ? "arraybuffer" : void 0;
}, c.checkSupport = function (a) {
var b = h[a.toLowerCase()];
if (!b) throw new Error(a + " is not supported by this browser");
}, c.MAX_VALUE_16BITS = 65535, c.MAX_VALUE_32BITS = -1, c.pretty = function (a) {
var b,
c,
d = "";
for (c = 0; c < (a || "").length; c++) {
b = a.charCodeAt(c), d += "\\x" + (16 > b ? "0" : "") + b.toString(16).toUpperCase();
}
return d;
}, c.findCompression = function (a) {
for (var b in i) {
if (i.hasOwnProperty(b) && i[b].magic === a) return i[b];
}
return null;
}, c.isRegExp = function (a) {
return "[object RegExp]" === Object.prototype.toString.call(a);
}, c.extend = function () {
var a,
b,
c = {};
for (a = 0; a < arguments.length; a++) {
for (b in arguments[a]) {
arguments[a].hasOwnProperty(b) && "undefined" == typeof c[b] && (c[b] = arguments[a][b]);
}
}
return c;
};
}, {
"./compressions": 4,
"./nodeBuffer": 12,
"./support": 18
}],
23: [function (a, b, c) {
"use strict";
function d(a, b) {
this.files = [], this.loadOptions = b, a && this.load(a);
}
var e = a("./stringReader"),
f = a("./nodeBufferReader"),
g = a("./uint8ArrayReader"),
h = a("./arrayReader"),
i = a("./utils"),
j = a("./signature"),
k = a("./zipEntry"),
l = a("./support");
a("./object");
d.prototype = {
checkSignature: function checkSignature(a) {
var b = this.reader.readString(4);
if (b !== a) throw new Error("Corrupted zip or bug : unexpected signature (" + i.pretty(b) + ", expected " + i.pretty(a) + ")");
},
isSignature: function isSignature(a, b) {
var c = this.reader.index;
this.reader.setIndex(a);
var d = this.reader.readString(4),
e = d === b;
return this.reader.setIndex(c), e;
},
readBlockEndOfCentral: function readBlockEndOfCentral() {
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),
b = l.uint8array ? "uint8array" : "array",
c = i.transformTo(b, a);
this.zipComment = this.loadOptions.decodeFileName(c);
},
readBlockZip64EndOfCentral: function readBlockZip64EndOfCentral() {
this.zip64EndOfCentralSize = this.reader.readInt(8), this.versionMadeBy = this.reader.readString(2), this.versionNeeded = this.reader.readInt(2), this.diskNumber = this.reader.readInt(4), this.diskWithCentralDirStart = this.reader.readInt(4), this.centralDirRecordsOnThisDisk = this.reader.readInt(8), this.centralDirRecords = this.reader.readInt(8), this.centralDirSize = this.reader.readInt(8), this.centralDirOffset = this.reader.readInt(8), this.zip64ExtensibleData = {};
for (var a, b, c, d = this.zip64EndOfCentralSize - 44, e = 0; d > e;) {
a = this.reader.readInt(2), b = this.reader.readInt(4), c = this.reader.readString(b), this.zip64ExtensibleData[a] = {
id: a,
length: b,
value: c
};
}
},
readBlockZip64EndOfCentralLocator: function readBlockZip64EndOfCentralLocator() {
if (this.diskWithZip64CentralDirStart = this.reader.readInt(4), this.relativeOffsetEndOfZip64CentralDir = this.reader.readInt(8), this.disksCount = this.reader.readInt(4), this.disksCount > 1) throw new Error("Multi-volumes zip are not supported");
},
readLocalFiles: function readLocalFiles() {
var a, b;
for (a = 0; a < this.files.length; a++) {
b = this.files[a], this.reader.setIndex(b.localHeaderOffset), this.checkSignature(j.LOCAL_FILE_HEADER), b.readLocalPart(this.reader), b.handleUTF8(), b.processAttributes();
}
},
readCentralDir: function readCentralDir() {
var a;
for (this.reader.setIndex(this.centralDirOffset); this.reader.readString(4) === j.CENTRAL_FILE_HEADER;) {
a = new k({
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 new Error("Corrupted zip or bug: expected " + this.centralDirRecords + " records in central dir, got " + this.files.length);
},
readEndOfCentral: function readEndOfCentral() {
var a = this.reader.lastIndexOfSignature(j.CENTRAL_DIRECTORY_END);
if (0 > a) {
var b = !this.isSignature(0, j.LOCAL_FILE_HEADER);
throw b ? new 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") : new Error("Corrupted zip : can't find end of central directory");
}
this.reader.setIndex(a);
var c = a;
if (this.checkSignature(j.CENTRAL_DIRECTORY_END), this.readBlockEndOfCentral(), this.diskNumber === i.MAX_VALUE_16BITS || this.diskWithCentralDirStart === i.MAX_VALUE_16BITS || this.centralDirRecordsOnThisDisk === i.MAX_VALUE_16BITS || this.centralDirRecords === i.MAX_VALUE_16BITS || this.centralDirSize === i.MAX_VALUE_32BITS || this.centralDirOffset === i.MAX_VALUE_32BITS) {
if (this.zip64 = !0, a = this.reader.lastIndexOfSignature(j.ZIP64_CENTRAL_DIRECTORY_LOCATOR), 0 > a) throw new Error("Corrupted zip : can't find the ZIP64 end of central directory locator");
if (this.reader.setIndex(a), this.checkSignature(j.ZIP64_CENTRAL_DIRECTORY_LOCATOR), this.readBlockZip64EndOfCentralLocator(), !this.isSignature(this.relativeOffsetEndOfZip64CentralDir, j.ZIP64_CENTRAL_DIRECTORY_END) && (this.relativeOffsetEndOfZip64CentralDir = this.reader.lastIndexOfSignature(j.ZIP64_CENTRAL_DIRECTORY_END), this.relativeOffsetEndOfZip64CentralDir < 0)) throw new Error("Corrupted zip : can't find the ZIP64 end of central directory");
this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir), this.checkSignature(j.ZIP64_CENTRAL_DIRECTORY_END), this.readBlockZip64EndOfCentral();
}
var d = this.centralDirOffset + this.centralDirSize;
this.zip64 && (d += 20, d += 12 + this.zip64EndOfCentralSize);
var e = c - d;
if (e > 0) this.isSignature(c, j.CENTRAL_FILE_HEADER) || (this.reader.zero = e);else if (0 > e) throw new Error("Corrupted zip: missing " + Math.abs(e) + " bytes.");
},
prepareReader: function prepareReader(a) {
var b = i.getTypeOf(a);
if (i.checkSupport(b), "string" !== b || l.uint8array) {
if ("nodebuffer" === b) this.reader = new f(a);else if (l.uint8array) this.reader = new g(i.transformTo("uint8array", a));else {
if (!l.array) throw new Error("Unexpected error: unsupported type '" + b + "'");
this.reader = new h(i.transformTo("array", a));
}
} else this.reader = new e(a, this.loadOptions.optimizedBinaryString);
},
load: function load(a) {
this.prepareReader(a), this.readEndOfCentral(), this.readCentralDir(), this.readLocalFiles();
}
}, b.exports = d;
}, {
"./arrayReader": 1,
"./nodeBufferReader": 13,
"./object": 14,
"./signature": 15,
"./stringReader": 16,
"./support": 18,
"./uint8ArrayReader": 19,
"./utils": 22,
"./zipEntry": 24
}],
24: [function (a, b, c) {
"use strict";
function d(a, b) {
this.options = a, this.loadOptions = b;
}
var e = a("./stringReader"),
f = a("./utils"),
g = a("./compressedObject"),
h = a("./object"),
i = a("./support"),
j = 0,
k = 3;
d.prototype = {
isEncrypted: function isEncrypted() {
return 1 === (1 & this.bitFlag);
},
useUTF8: function useUTF8() {
return 2048 === (2048 & this.bitFlag);
},
prepareCompressedContent: function prepareCompressedContent(a, b, c) {
return function () {
var d = a.index;
a.setIndex(b);
var e = a.readData(c);
return a.setIndex(d), e;
};
},
prepareContent: function prepareContent(a, b, c, d, e) {
return function () {
var a = f.transformTo(d.uncompressInputType, this.getCompressedContent()),
b = d.uncompress(a);
if (b.length !== e) throw new Error("Bug : uncompressed data size mismatch");
return b;
};
},
readLocalPart: function readLocalPart(a) {
var b, c;
if (a.skip(22), this.fileNameLength = a.readInt(2), c = a.readInt(2), this.fileName = a.readData(this.fileNameLength), a.skip(c), -1 == this.compressedSize || -1 == this.uncompressedSize) throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize == -1 || uncompressedSize == -1)");
if (b = f.findCompression(this.compressionMethod), null === b) throw new Error("Corrupted zip : compression " + f.pretty(this.compressionMethod) + " unknown (inner file : " + f.transformTo("string", this.fileName) + ")");
if (this.decompressed = new g(), this.decompressed.compressedSize = this.compressedSize, this.decompressed.uncompressedSize = this.uncompressedSize, this.decompressed.crc32 = this.crc32, this.decompressed.compressionMethod = this.compressionMethod, this.decompressed.getCompressedContent = this.prepareCompressedContent(a, a.index, this.compressedSize, b), this.decompressed.getContent = this.prepareContent(a, a.index, this.compressedSize, b, this.uncompressedSize), this.loadOptions.checkCRC32 && (this.decompressed = f.transformTo("string", this.decompressed.getContent()), h.crc32(this.decompressed) !== this.crc32))