UNPKG

@vue-office/pptx

Version:

支持多种文件(**docx、excel、pdf、pptx**)预览的vue组件库,支持vue2/3。也支持非Vue框架的预览。

951 lines (948 loc) 1.99 MB
import { defineComponent as u6, ref as c6, onMounted as f6, watch as h6 } from "vue-demi"; import { openBlock as v6, createElementBlock as d6, createElementVNode as p6 } from "vue"; var Q0 = function(r, e) { return Q0 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, n) { t.__proto__ = n; } || function(t, n) { for (var a in n) Object.prototype.hasOwnProperty.call(n, a) && (t[a] = n[a]); }, Q0(r, e); }; function Ef(r, e) { if (typeof e != "function" && e !== null) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null"); Q0(r, e); function t() { this.constructor = r; } r.prototype = e === null ? Object.create(e) : (t.prototype = e.prototype, new t()); } var It = function() { return It = Object.assign || function(e) { for (var t, n = 1, a = arguments.length; n < a; n++) { t = arguments[n]; for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]); } return e; }, It.apply(this, arguments); }; function yr(r, e, t, n) { function a(i) { return i instanceof t ? i : new t(function(o) { o(i); }); } return new (t || (t = Promise))(function(i, o) { function s(c) { try { u(n.next(c)); } catch (f) { o(f); } } function l(c) { try { u(n.throw(c)); } catch (f) { o(f); } } function u(c) { c.done ? i(c.value) : a(c.value).then(s, l); } u((n = n.apply(r, e || [])).next()); }); } function mr(r, e) { var t = { label: 0, sent: function() { if (i[0] & 1) throw i[1]; return i[1]; }, trys: [], ops: [] }, n, a, i, o = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype); return o.next = s(0), o.throw = s(1), o.return = s(2), typeof Symbol == "function" && (o[Symbol.iterator] = function() { return this; }), o; function s(u) { return function(c) { return l([u, c]); }; } function l(u) { if (n) throw new TypeError("Generator is already executing."); for (; o && (o = 0, u[0] && (t = 0)), t; ) try { if (n = 1, a && (i = u[0] & 2 ? a.return : u[0] ? a.throw || ((i = a.return) && i.call(a), 0) : a.next) && !(i = i.call(a, u[1])).done) return i; switch (a = 0, i && (u = [u[0] & 2, i.value]), u[0]) { case 0: case 1: i = u; break; case 4: return t.label++, { value: u[1], done: !1 }; case 5: t.label++, a = u[1], u = [0]; continue; case 7: u = t.ops.pop(), t.trys.pop(); continue; default: if (i = t.trys, !(i = i.length > 0 && i[i.length - 1]) && (u[0] === 6 || u[0] === 2)) { t = 0; continue; } if (u[0] === 3 && (!i || u[1] > i[0] && u[1] < i[3])) { t.label = u[1]; break; } if (u[0] === 6 && t.label < i[1]) { t.label = i[1], i = u; break; } if (i && t.label < i[2]) { t.label = i[2], t.ops.push(u); break; } i[2] && t.ops.pop(), t.trys.pop(); continue; } u = e.call(r, t); } catch (c) { u = [6, c], a = 0; } finally { n = i = 0; } if (u[0] & 5) throw u[1]; return { value: u[0] ? u[1] : void 0, done: !0 }; } } function Fc(r, e, t) { if (t || arguments.length === 2) for (var n = 0, a = e.length, i; n < a; n++) (i || !(n in e)) && (i || (i = Array.prototype.slice.call(e, 0, n)), i[n] = e[n]); return r.concat(i || Array.prototype.slice.call(e)); } var _i = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {}; function g6(r) { return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r; } function Zh(r) { throw new Error('Could not dynamically require "' + r + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'); } var YI = { exports: {} }; /*! JSZip v3.10.1 - 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/main/LICENSE.markdown. JSZip uses the library pako released under the MIT license : https://github.com/nodeca/pako/blob/main/LICENSE */ (function(r, e) { (function(t) { r.exports = t(); })(function() { return function t(n, a, i) { function o(u, c) { if (!a[u]) { if (!n[u]) { var f = typeof Zh == "function" && Zh; if (!c && f) return f(u, !0); if (s) return s(u, !0); var d = new Error("Cannot find module '" + u + "'"); throw d.code = "MODULE_NOT_FOUND", d; } var v = a[u] = { exports: {} }; n[u][0].call(v.exports, function(p) { var y = n[u][1][p]; return o(y || p); }, v, v.exports, t, n, a, i); } return a[u].exports; } for (var s = typeof Zh == "function" && Zh, l = 0; l < i.length; l++) o(i[l]); return o; }({ 1: [function(t, n, a) { var i = t("./utils"), o = t("./support"), s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; a.encode = function(l) { for (var u, c, f, d, v, p, y, _ = [], g = 0, h = l.length, w = h, b = i.getTypeOf(l) !== "string"; g < l.length; ) w = h - g, f = b ? (u = l[g++], c = g < h ? l[g++] : 0, g < h ? l[g++] : 0) : (u = l.charCodeAt(g++), c = g < h ? l.charCodeAt(g++) : 0, g < h ? l.charCodeAt(g++) : 0), d = u >> 2, v = (3 & u) << 4 | c >> 4, p = 1 < w ? (15 & c) << 2 | f >> 6 : 64, y = 2 < w ? 63 & f : 64, _.push(s.charAt(d) + s.charAt(v) + s.charAt(p) + s.charAt(y)); return _.join(""); }, a.decode = function(l) { var u, c, f, d, v, p, y = 0, _ = 0, g = "data:"; if (l.substr(0, g.length) === g) throw new Error("Invalid base64 input, it looks like a data url."); var h, w = 3 * (l = l.replace(/[^A-Za-z0-9+/=]/g, "")).length / 4; if (l.charAt(l.length - 1) === s.charAt(64) && w--, l.charAt(l.length - 2) === s.charAt(64) && w--, w % 1 != 0) throw new Error("Invalid base64 input, bad content length."); for (h = o.uint8array ? new Uint8Array(0 | w) : new Array(0 | w); y < l.length; ) u = s.indexOf(l.charAt(y++)) << 2 | (d = s.indexOf(l.charAt(y++))) >> 4, c = (15 & d) << 4 | (v = s.indexOf(l.charAt(y++))) >> 2, f = (3 & v) << 6 | (p = s.indexOf(l.charAt(y++))), h[_++] = u, v !== 64 && (h[_++] = c), p !== 64 && (h[_++] = f); return h; }; }, { "./support": 30, "./utils": 32 }], 2: [function(t, n, a) { var i = t("./external"), o = t("./stream/DataWorker"), s = t("./stream/Crc32Probe"), l = t("./stream/DataLengthProbe"); function u(c, f, d, v, p) { this.compressedSize = c, this.uncompressedSize = f, this.crc32 = d, this.compression = v, this.compressedContent = p; } u.prototype = { getContentWorker: function() { var c = new o(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")), f = this; return c.on("end", function() { if (this.streamInfo.data_length !== f.uncompressedSize) throw new Error("Bug : uncompressed data size mismatch"); }), c; }, getCompressedWorker: function() { return new o(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize", this.compressedSize).withStreamInfo("uncompressedSize", this.uncompressedSize).withStreamInfo("crc32", this.crc32).withStreamInfo("compression", this.compression); } }, u.createWorkerFrom = function(c, f, d) { return c.pipe(new s()).pipe(new l("uncompressedSize")).pipe(f.compressWorker(d)).pipe(new l("compressedSize")).withStreamInfo("compression", f); }, n.exports = u; }, { "./external": 6, "./stream/Crc32Probe": 25, "./stream/DataLengthProbe": 26, "./stream/DataWorker": 27 }], 3: [function(t, n, a) { var i = t("./stream/GenericWorker"); a.STORE = { magic: "\0\0", compressWorker: function() { return new i("STORE compression"); }, uncompressWorker: function() { return new i("STORE decompression"); } }, a.DEFLATE = t("./flate"); }, { "./flate": 7, "./stream/GenericWorker": 28 }], 4: [function(t, n, a) { var i = t("./utils"), o = function() { for (var s, l = [], u = 0; u < 256; u++) { s = u; for (var c = 0; c < 8; c++) s = 1 & s ? 3988292384 ^ s >>> 1 : s >>> 1; l[u] = s; } return l; }(); n.exports = function(s, l) { return s !== void 0 && s.length ? i.getTypeOf(s) !== "string" ? function(u, c, f, d) { var v = o, p = d + f; u ^= -1; for (var y = d; y < p; y++) u = u >>> 8 ^ v[255 & (u ^ c[y])]; return -1 ^ u; }(0 | l, s, s.length, 0) : function(u, c, f, d) { var v = o, p = d + f; u ^= -1; for (var y = d; y < p; y++) u = u >>> 8 ^ v[255 & (u ^ c.charCodeAt(y))]; return -1 ^ u; }(0 | l, s, s.length, 0) : 0; }; }, { "./utils": 32 }], 5: [function(t, n, a) { a.base64 = !1, a.binary = !1, a.dir = !1, a.createFolders = !0, a.date = null, a.compression = null, a.compressionOptions = null, a.comment = null, a.unixPermissions = null, a.dosPermissions = null; }, {}], 6: [function(t, n, a) { var i = null; i = typeof Promise != "undefined" ? Promise : t("lie"), n.exports = { Promise: i }; }, { lie: 37 }], 7: [function(t, n, a) { var i = typeof Uint8Array != "undefined" && typeof Uint16Array != "undefined" && typeof Uint32Array != "undefined", o = t("pako"), s = t("./utils"), l = t("./stream/GenericWorker"), u = i ? "uint8array" : "array"; function c(f, d) { l.call(this, "FlateWorker/" + f), this._pako = null, this._pakoAction = f, this._pakoOptions = d, this.meta = {}; } a.magic = "\b\0", s.inherits(c, l), c.prototype.processChunk = function(f) { this.meta = f.meta, this._pako === null && this._createPako(), this._pako.push(s.transformTo(u, f.data), !1); }, c.prototype.flush = function() { l.prototype.flush.call(this), this._pako === null && this._createPako(), this._pako.push([], !0); }, c.prototype.cleanUp = function() { l.prototype.cleanUp.call(this), this._pako = null; }, c.prototype._createPako = function() { this._pako = new o[this._pakoAction]({ raw: !0, level: this._pakoOptions.level || -1 }); var f = this; this._pako.onData = function(d) { f.push({ data: d, meta: f.meta }); }; }, a.compressWorker = function(f) { return new c("Deflate", f); }, a.uncompressWorker = function() { return new c("Inflate", {}); }; }, { "./stream/GenericWorker": 28, "./utils": 32, pako: 38 }], 8: [function(t, n, a) { function i(v, p) { var y, _ = ""; for (y = 0; y < p; y++) _ += String.fromCharCode(255 & v), v >>>= 8; return _; } function o(v, p, y, _, g, h) { var w, b, S = v.file, A = v.compression, T = h !== u.utf8encode, D = s.transformTo("string", h(S.name)), L = s.transformTo("string", u.utf8encode(S.name)), I = S.comment, P = s.transformTo("string", h(I)), E = s.transformTo("string", u.utf8encode(I)), R = L.length !== S.name.length, M = E.length !== I.length, B = "", F = "", W = "", j = S.dir, H = S.date, K = { crc32: 0, compressedSize: 0, uncompressedSize: 0 }; p && !y || (K.crc32 = v.crc32, K.compressedSize = v.compressedSize, K.uncompressedSize = v.uncompressedSize); var U = 0; p && (U |= 8), T || !R && !M || (U |= 2048); var $ = 0, ut = 0; j && ($ |= 16), g === "UNIX" ? (ut = 798, $ |= function(it, Rt) { var qt = it; return it || (qt = Rt ? 16893 : 33204), (65535 & qt) << 16; }(S.unixPermissions, j)) : (ut = 20, $ |= function(it) { return 63 & (it || 0); }(S.dosPermissions)), w = H.getUTCHours(), w <<= 6, w |= H.getUTCMinutes(), w <<= 5, w |= H.getUTCSeconds() / 2, b = H.getUTCFullYear() - 1980, b <<= 4, b |= H.getUTCMonth() + 1, b <<= 5, b |= H.getUTCDate(), R && (F = i(1, 1) + i(c(D), 4) + L, B += "up" + i(F.length, 2) + F), M && (W = i(1, 1) + i(c(P), 4) + E, B += "uc" + i(W.length, 2) + W); var ot = ""; return ot += ` \0`, ot += i(U, 2), ot += A.magic, ot += i(w, 2), ot += i(b, 2), ot += i(K.crc32, 4), ot += i(K.compressedSize, 4), ot += i(K.uncompressedSize, 4), ot += i(D.length, 2), ot += i(B.length, 2), { fileRecord: f.LOCAL_FILE_HEADER + ot + D + B, dirRecord: f.CENTRAL_FILE_HEADER + i(ut, 2) + ot + i(P.length, 2) + "\0\0\0\0" + i($, 4) + i(_, 4) + D + B + P }; } var s = t("../utils"), l = t("../stream/GenericWorker"), u = t("../utf8"), c = t("../crc32"), f = t("../signature"); function d(v, p, y, _) { l.call(this, "ZipFileWorker"), this.bytesWritten = 0, this.zipComment = p, this.zipPlatform = y, this.encodeFileName = _, this.streamFiles = v, this.accumulate = !1, this.contentBuffer = [], this.dirRecords = [], this.currentSourceOffset = 0, this.entriesCount = 0, this.currentFile = null, this._sources = []; } s.inherits(d, l), d.prototype.push = function(v) { var p = v.meta.percent || 0, y = this.entriesCount, _ = this._sources.length; this.accumulate ? this.contentBuffer.push(v) : (this.bytesWritten += v.data.length, l.prototype.push.call(this, { data: v.data, meta: { currentFile: this.currentFile, percent: y ? (p + 100 * (y - _ - 1)) / y : 100 } })); }, d.prototype.openedSource = function(v) { this.currentSourceOffset = this.bytesWritten, this.currentFile = v.file.name; var p = this.streamFiles && !v.file.dir; if (p) { var y = o(v, p, !1, this.currentSourceOffset, this.zipPlatform, this.encodeFileName); this.push({ data: y.fileRecord, meta: { percent: 0 } }); } else this.accumulate = !0; }, d.prototype.closedSource = function(v) { this.accumulate = !1; var p = this.streamFiles && !v.file.dir, y = o(v, p, !0, this.currentSourceOffset, this.zipPlatform, this.encodeFileName); if (this.dirRecords.push(y.dirRecord), p) this.push({ data: function(_) { return f.DATA_DESCRIPTOR + i(_.crc32, 4) + i(_.compressedSize, 4) + i(_.uncompressedSize, 4); }(v), meta: { percent: 100 } }); else for (this.push({ data: y.fileRecord, meta: { percent: 0 } }); this.contentBuffer.length; ) this.push(this.contentBuffer.shift()); this.currentFile = null; }, d.prototype.flush = function() { for (var v = this.bytesWritten, p = 0; p < this.dirRecords.length; p++) this.push({ data: this.dirRecords[p], meta: { percent: 100 } }); var y = this.bytesWritten - v, _ = function(g, h, w, b, S) { var A = s.transformTo("string", S(b)); return f.CENTRAL_DIRECTORY_END + "\0\0\0\0" + i(g, 2) + i(g, 2) + i(h, 4) + i(w, 4) + i(A.length, 2) + A; }(this.dirRecords.length, y, v, this.zipComment, this.encodeFileName); this.push({ data: _, meta: { percent: 100 } }); }, d.prototype.prepareNextSource = function() { this.previous = this._sources.shift(), this.openedSource(this.previous.streamInfo), this.isPaused ? this.previous.pause() : this.previous.resume(); }, d.prototype.registerPrevious = function(v) { this._sources.push(v); var p = this; return v.on("data", function(y) { p.processChunk(y); }), v.on("end", function() { p.closedSource(p.previous.streamInfo), p._sources.length ? p.prepareNextSource() : p.end(); }), v.on("error", function(y) { p.error(y); }), this; }, d.prototype.resume = function() { return !!l.prototype.resume.call(this) && (!this.previous && this._sources.length ? (this.prepareNextSource(), !0) : this.previous || this._sources.length || this.generatedError ? void 0 : (this.end(), !0)); }, d.prototype.error = function(v) { var p = this._sources; if (!l.prototype.error.call(this, v)) return !1; for (var y = 0; y < p.length; y++) try { p[y].error(v); } catch (_) { } return !0; }, d.prototype.lock = function() { l.prototype.lock.call(this); for (var v = this._sources, p = 0; p < v.length; p++) v[p].lock(); }, n.exports = d; }, { "../crc32": 4, "../signature": 23, "../stream/GenericWorker": 28, "../utf8": 31, "../utils": 32 }], 9: [function(t, n, a) { var i = t("../compressions"), o = t("./ZipFileWorker"); a.generateWorker = function(s, l, u) { var c = new o(l.streamFiles, u, l.platform, l.encodeFileName), f = 0; try { s.forEach(function(d, v) { f++; var p = function(h, w) { var b = h || w, S = i[b]; if (!S) throw new Error(b + " is not a valid compression method !"); return S; }(v.options.compression, l.compression), y = v.options.compressionOptions || l.compressionOptions || {}, _ = v.dir, g = v.date; v._compressWorker(p, y).withStreamInfo("file", { name: d, dir: _, date: g, comment: v.comment || "", unixPermissions: v.unixPermissions, dosPermissions: v.dosPermissions }).pipe(c); }), c.entriesCount = f; } catch (d) { c.error(d); } return c; }; }, { "../compressions": 3, "./ZipFileWorker": 8 }], 10: [function(t, n, a) { function i() { if (!(this instanceof i)) return new i(); if (arguments.length) throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide."); this.files = /* @__PURE__ */ Object.create(null), this.comment = null, this.root = "", this.clone = function() { var o = new i(); for (var s in this) typeof this[s] != "function" && (o[s] = this[s]); return o; }; } (i.prototype = t("./object")).loadAsync = t("./load"), i.support = t("./support"), i.defaults = t("./defaults"), i.version = "3.10.1", i.loadAsync = function(o, s) { return new i().loadAsync(o, s); }, i.external = t("./external"), n.exports = i; }, { "./defaults": 5, "./external": 6, "./load": 11, "./object": 15, "./support": 30 }], 11: [function(t, n, a) { var i = t("./utils"), o = t("./external"), s = t("./utf8"), l = t("./zipEntries"), u = t("./stream/Crc32Probe"), c = t("./nodejsUtils"); function f(d) { return new o.Promise(function(v, p) { var y = d.decompressed.getContentWorker().pipe(new u()); y.on("error", function(_) { p(_); }).on("end", function() { y.streamInfo.crc32 !== d.decompressed.crc32 ? p(new Error("Corrupted zip : CRC32 mismatch")) : v(); }).resume(); }); } n.exports = function(d, v) { var p = this; return v = i.extend(v || {}, { base64: !1, checkCRC32: !1, optimizedBinaryString: !1, createFolders: !1, decodeFileName: s.utf8decode }), c.isNode && c.isStream(d) ? o.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")) : i.prepareContent("the loaded zip file", d, !0, v.optimizedBinaryString, v.base64).then(function(y) { var _ = new l(v); return _.load(y), _; }).then(function(y) { var _ = [o.Promise.resolve(y)], g = y.files; if (v.checkCRC32) for (var h = 0; h < g.length; h++) _.push(f(g[h])); return o.Promise.all(_); }).then(function(y) { for (var _ = y.shift(), g = _.files, h = 0; h < g.length; h++) { var w = g[h], b = w.fileNameStr, S = i.resolve(w.fileNameStr); p.file(S, w.decompressed, { binary: !0, optimizedBinaryString: !0, date: w.date, dir: w.dir, comment: w.fileCommentStr.length ? w.fileCommentStr : null, unixPermissions: w.unixPermissions, dosPermissions: w.dosPermissions, createFolders: v.createFolders }), w.dir || (p.file(S).unsafeOriginalName = b); } return _.zipComment.length && (p.comment = _.zipComment), p; }); }; }, { "./external": 6, "./nodejsUtils": 14, "./stream/Crc32Probe": 25, "./utf8": 31, "./utils": 32, "./zipEntries": 33 }], 12: [function(t, n, a) { var i = t("../utils"), o = t("../stream/GenericWorker"); function s(l, u) { o.call(this, "Nodejs stream input adapter for " + l), this._upstreamEnded = !1, this._bindStream(u); } i.inherits(s, o), s.prototype._bindStream = function(l) { var u = this; (this._stream = l).pause(), l.on("data", function(c) { u.push({ data: c, meta: { percent: 0 } }); }).on("error", function(c) { u.isPaused ? this.generatedError = c : u.error(c); }).on("end", function() { u.isPaused ? u._upstreamEnded = !0 : u.end(); }); }, s.prototype.pause = function() { return !!o.prototype.pause.call(this) && (this._stream.pause(), !0); }, s.prototype.resume = function() { return !!o.prototype.resume.call(this) && (this._upstreamEnded ? this.end() : this._stream.resume(), !0); }, n.exports = s; }, { "../stream/GenericWorker": 28, "../utils": 32 }], 13: [function(t, n, a) { var i = t("readable-stream").Readable; function o(s, l, u) { i.call(this, l), this._helper = s; var c = this; s.on("data", function(f, d) { c.push(f) || c._helper.pause(), u && u(d); }).on("error", function(f) { c.emit("error", f); }).on("end", function() { c.push(null); }); } t("../utils").inherits(o, i), o.prototype._read = function() { this._helper.resume(); }, n.exports = o; }, { "../utils": 32, "readable-stream": 16 }], 14: [function(t, n, a) { n.exports = { isNode: typeof Buffer != "undefined", newBufferFrom: function(i, o) { if (Buffer.from && Buffer.from !== Uint8Array.from) return Buffer.from(i, o); if (typeof i == "number") throw new Error('The "data" argument must not be a number'); return new Buffer(i, o); }, allocBuffer: function(i) { if (Buffer.alloc) return Buffer.alloc(i); var o = new Buffer(i); return o.fill(0), o; }, isBuffer: function(i) { return Buffer.isBuffer(i); }, isStream: function(i) { return i && typeof i.on == "function" && typeof i.pause == "function" && typeof i.resume == "function"; } }; }, {}], 15: [function(t, n, a) { function i(S, A, T) { var D, L = s.getTypeOf(A), I = s.extend(T || {}, c); I.date = I.date || /* @__PURE__ */ new Date(), I.compression !== null && (I.compression = I.compression.toUpperCase()), typeof I.unixPermissions == "string" && (I.unixPermissions = parseInt(I.unixPermissions, 8)), I.unixPermissions && 16384 & I.unixPermissions && (I.dir = !0), I.dosPermissions && 16 & I.dosPermissions && (I.dir = !0), I.dir && (S = g(S)), I.createFolders && (D = _(S)) && h.call(this, D, !0); var P = L === "string" && I.binary === !1 && I.base64 === !1; T && T.binary !== void 0 || (I.binary = !P), (A instanceof f && A.uncompressedSize === 0 || I.dir || !A || A.length === 0) && (I.base64 = !1, I.binary = !0, A = "", I.compression = "STORE", L = "string"); var E = null; E = A instanceof f || A instanceof l ? A : p.isNode && p.isStream(A) ? new y(S, A) : s.prepareContent(S, A, I.binary, I.optimizedBinaryString, I.base64); var R = new d(S, E, I); this.files[S] = R; } var o = t("./utf8"), s = t("./utils"), l = t("./stream/GenericWorker"), u = t("./stream/StreamHelper"), c = t("./defaults"), f = t("./compressedObject"), d = t("./zipObject"), v = t("./generate"), p = t("./nodejsUtils"), y = t("./nodejs/NodejsStreamInputAdapter"), _ = function(S) { S.slice(-1) === "/" && (S = S.substring(0, S.length - 1)); var A = S.lastIndexOf("/"); return 0 < A ? S.substring(0, A) : ""; }, g = function(S) { return S.slice(-1) !== "/" && (S += "/"), S; }, h = function(S, A) { return A = A !== void 0 ? A : c.createFolders, S = g(S), this.files[S] || i.call(this, S, null, { dir: !0, createFolders: A }), this.files[S]; }; function w(S) { return Object.prototype.toString.call(S) === "[object RegExp]"; } var b = { load: function() { throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide."); }, forEach: function(S) { var A, T, D; for (A in this.files) D = this.files[A], (T = A.slice(this.root.length, A.length)) && A.slice(0, this.root.length) === this.root && S(T, D); }, filter: function(S) { var A = []; return this.forEach(function(T, D) { S(T, D) && A.push(D); }), A; }, file: function(S, A, T) { if (arguments.length !== 1) return S = this.root + S, i.call(this, S, A, T), this; if (w(S)) { var D = S; return this.filter(function(I, P) { return !P.dir && D.test(I); }); } var L = this.files[this.root + S]; return L && !L.dir ? L : null; }, folder: function(S) { if (!S) return this; if (w(S)) return this.filter(function(L, I) { return I.dir && S.test(L); }); var A = this.root + S, T = h.call(this, A), D = this.clone(); return D.root = T.name, D; }, remove: function(S) { S = this.root + S; var A = this.files[S]; if (A || (S.slice(-1) !== "/" && (S += "/"), A = this.files[S]), A && !A.dir) delete this.files[S]; else for (var T = this.filter(function(L, I) { return I.name.slice(0, S.length) === S; }), D = 0; D < T.length; D++) delete this.files[T[D].name]; return this; }, generate: function() { throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide."); }, generateInternalStream: function(S) { var A, T = {}; try { if ((T = s.extend(S || {}, { streamFiles: !1, compression: "STORE", compressionOptions: null, type: "", platform: "DOS", comment: null, mimeType: "application/zip", encodeFileName: o.utf8encode })).type = T.type.toLowerCase(), T.compression = T.compression.toUpperCase(), T.type === "binarystring" && (T.type = "string"), !T.type) throw new Error("No output type specified."); s.checkSupport(T.type), T.platform !== "darwin" && T.platform !== "freebsd" && T.platform !== "linux" && T.platform !== "sunos" || (T.platform = "UNIX"), T.platform === "win32" && (T.platform = "DOS"); var D = T.comment || this.comment || ""; A = v.generateWorker(this, T, D); } catch (L) { (A = new l("error")).error(L); } return new u(A, T.type || "string", T.mimeType); }, generateAsync: function(S, A) { return this.generateInternalStream(S).accumulate(A); }, generateNodeStream: function(S, A) { return (S = S || {}).type || (S.type = "nodebuffer"), this.generateInternalStream(S).toNodejsStream(A); } }; n.exports = b; }, { "./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(t, n, a) { n.exports = t("stream"); }, { stream: void 0 }], 17: [function(t, n, a) { var i = t("./DataReader"); function o(s) { i.call(this, s); for (var l = 0; l < this.data.length; l++) s[l] = 255 & s[l]; } t("../utils").inherits(o, i), o.prototype.byteAt = function(s) { return this.data[this.zero + s]; }, o.prototype.lastIndexOfSignature = function(s) { for (var l = s.charCodeAt(0), u = s.charCodeAt(1), c = s.charCodeAt(2), f = s.charCodeAt(3), d = this.length - 4; 0 <= d; --d) if (this.data[d] === l && this.data[d + 1] === u && this.data[d + 2] === c && this.data[d + 3] === f) return d - this.zero; return -1; }, o.prototype.readAndCheckSignature = function(s) { var l = s.charCodeAt(0), u = s.charCodeAt(1), c = s.charCodeAt(2), f = s.charCodeAt(3), d = this.readData(4); return l === d[0] && u === d[1] && c === d[2] && f === d[3]; }, o.prototype.readData = function(s) { if (this.checkOffset(s), s === 0) return []; var l = this.data.slice(this.zero + this.index, this.zero + this.index + s); return this.index += s, l; }, n.exports = o; }, { "../utils": 32, "./DataReader": 18 }], 18: [function(t, n, a) { var i = t("../utils"); function o(s) { this.data = s, this.length = s.length, this.index = 0, this.zero = 0; } o.prototype = { checkOffset: function(s) { this.checkIndex(this.index + s); }, checkIndex: function(s) { if (this.length < this.zero + s || s < 0) throw new Error("End of data reached (data length = " + this.length + ", asked index = " + s + "). Corrupted zip ?"); }, setIndex: function(s) { this.checkIndex(s), this.index = s; }, skip: function(s) { this.setIndex(this.index + s); }, byteAt: function() { }, readInt: function(s) { var l, u = 0; for (this.checkOffset(s), l = this.index + s - 1; l >= this.index; l--) u = (u << 8) + this.byteAt(l); return this.index += s, u; }, readString: function(s) { return i.transformTo("string", this.readData(s)); }, readData: function() { }, lastIndexOfSignature: function() { }, readAndCheckSignature: function() { }, readDate: function() { var s = this.readInt(4); return new Date(Date.UTC(1980 + (s >> 25 & 127), (s >> 21 & 15) - 1, s >> 16 & 31, s >> 11 & 31, s >> 5 & 63, (31 & s) << 1)); } }, n.exports = o; }, { "../utils": 32 }], 19: [function(t, n, a) { var i = t("./Uint8ArrayReader"); function o(s) { i.call(this, s); } t("../utils").inherits(o, i), o.prototype.readData = function(s) { this.checkOffset(s); var l = this.data.slice(this.zero + this.index, this.zero + this.index + s); return this.index += s, l; }, n.exports = o; }, { "../utils": 32, "./Uint8ArrayReader": 21 }], 20: [function(t, n, a) { var i = t("./DataReader"); function o(s) { i.call(this, s); } t("../utils").inherits(o, i), o.prototype.byteAt = function(s) { return this.data.charCodeAt(this.zero + s); }, o.prototype.lastIndexOfSignature = function(s) { return this.data.lastIndexOf(s) - this.zero; }, o.prototype.readAndCheckSignature = function(s) { return s === this.readData(4); }, o.prototype.readData = function(s) { this.checkOffset(s); var l = this.data.slice(this.zero + this.index, this.zero + this.index + s); return this.index += s, l; }, n.exports = o; }, { "../utils": 32, "./DataReader": 18 }], 21: [function(t, n, a) { var i = t("./ArrayReader"); function o(s) { i.call(this, s); } t("../utils").inherits(o, i), o.prototype.readData = function(s) { if (this.checkOffset(s), s === 0) return new Uint8Array(0); var l = this.data.subarray(this.zero + this.index, this.zero + this.index + s); return this.index += s, l; }, n.exports = o; }, { "../utils": 32, "./ArrayReader": 17 }], 22: [function(t, n, a) { var i = t("../utils"), o = t("../support"), s = t("./ArrayReader"), l = t("./StringReader"), u = t("./NodeBufferReader"), c = t("./Uint8ArrayReader"); n.exports = function(f) { var d = i.getTypeOf(f); return i.checkSupport(d), d !== "string" || o.uint8array ? d === "nodebuffer" ? new u(f) : o.uint8array ? new c(i.transformTo("uint8array", f)) : new s(i.transformTo("array", f)) : new l(f); }; }, { "../support": 30, "../utils": 32, "./ArrayReader": 17, "./NodeBufferReader": 19, "./StringReader": 20, "./Uint8ArrayReader": 21 }], 23: [function(t, n, a) { a.LOCAL_FILE_HEADER = "PK", a.CENTRAL_FILE_HEADER = "PK", a.CENTRAL_DIRECTORY_END = "PK", a.ZIP64_CENTRAL_DIRECTORY_LOCATOR = "PK\x07", a.ZIP64_CENTRAL_DIRECTORY_END = "PK", a.DATA_DESCRIPTOR = "PK\x07\b"; }, {}], 24: [function(t, n, a) { var i = t("./GenericWorker"), o = t("../utils"); function s(l) { i.call(this, "ConvertWorker to " + l), this.destType = l; } o.inherits(s, i), s.prototype.processChunk = function(l) { this.push({ data: o.transformTo(this.destType, l.data), meta: l.meta }); }, n.exports = s; }, { "../utils": 32, "./GenericWorker": 28 }], 25: [function(t, n, a) { var i = t("./GenericWorker"), o = t("../crc32"); function s() { i.call(this, "Crc32Probe"), this.withStreamInfo("crc32", 0); } t("../utils").inherits(s, i), s.prototype.processChunk = function(l) { this.streamInfo.crc32 = o(l.data, this.streamInfo.crc32 || 0), this.push(l); }, n.exports = s; }, { "../crc32": 4, "../utils": 32, "./GenericWorker": 28 }], 26: [function(t, n, a) { var i = t("../utils"), o = t("./GenericWorker"); function s(l) { o.call(this, "DataLengthProbe for " + l), this.propName = l, this.withStreamInfo(l, 0); } i.inherits(s, o), s.prototype.processChunk = function(l) { if (l) { var u = this.streamInfo[this.propName] || 0; this.streamInfo[this.propName] = u + l.data.length; } o.prototype.processChunk.call(this, l); }, n.exports = s; }, { "../utils": 32, "./GenericWorker": 28 }], 27: [function(t, n, a) { var i = t("../utils"), o = t("./GenericWorker"); function s(l) { o.call(this, "DataWorker"); var u = this; this.dataIsReady = !1, this.index = 0, this.max = 0, this.data = null, this.type = "", this._tickScheduled = !1, l.then(function(c) { u.dataIsReady = !0, u.data = c, u.max = c && c.length || 0, u.type = i.getTypeOf(c), u.isPaused || u._tickAndRepeat(); }, function(c) { u.error(c); }); } i.inherits(s, o), s.prototype.cleanUp = function() { o.prototype.cleanUp.call(this), this.data = null; }, s.prototype.resume = function() { return !!o.prototype.resume.call(this) && (!this._tickScheduled && this.dataIsReady && (this._tickScheduled = !0, i.delay(this._tickAndRepeat, [], this)), !0); }, s.prototype._tickAndRepeat = function() { this._tickScheduled = !1, this.isPaused || this.isFinished || (this._tick(), this.isFinished || (i.delay(this._tickAndRepeat, [], this), this._tickScheduled = !0)); }, s.prototype._tick = function() { if (this.isPaused || this.isFinished) return !1; var l = null, u = Math.min(this.max, this.index + 16384); if (this.index >= this.max) return this.end(); switch (this.type) { case "string": l = this.data.substring(this.index, u); break; case "uint8array": l = this.data.subarray(this.index, u); break; case "array": case "nodebuffer": l = this.data.slice(this.index, u); } return this.index = u, this.push({ data: l, meta: { percent: this.max ? this.index / this.max * 100 : 0 } }); }, n.exports = s; }, { "../utils": 32, "./GenericWorker": 28 }], 28: [function(t, n, a) { function i(o) { this.name = o || "default", this.streamInfo = {}, this.generatedError = null, this.extraStreamInfo = {}, this.isPaused = !0, this.isFinished = !1, this.isLocked = !1, this._listeners = { data: [], end: [], error: [] }, this.previous = null; } i.prototype = { push: function(o) { this.emit("data", o); }, end: function() { if (this.isFinished) return !1; this.flush(); try { this.emit("end"), this.cleanUp(), this.isFinished = !0; } catch (o) { this.emit("error", o); } return !0; }, error: function(o) { return !this.isFinished && (this.isPaused ? this.generatedError = o : (this.isFinished = !0, this.emit("error", o), this.previous && this.previous.error(o), this.cleanUp()), !0); }, on: function(o, s) { return this._listeners[o].push(s), this; }, cleanUp: function() { this.streamInfo = this.generatedError = this.extraStreamInfo = null, this._listeners = []; }, emit: function(o, s) { if (this._listeners[o]) for (var l = 0; l < this._listeners[o].length; l++) this._listeners[o][l].call(this, s); }, pipe: function(o) { return o.registerPrevious(this); }, registerPrevious: function(o) { if (this.isLocked) throw new Error("The stream '" + this + "' has already been used."); this.streamInfo = o.streamInfo, this.mergeStreamInfo(), this.previous = o; var s = this; return o.on("data", function(l) { s.processChunk(l); }), o.on("end", function() { s.end(); }), o.on("error", function(l) { s.error(l); }), 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 o = this.isPaused = !1; return this.generatedError && (this.error(this.generatedError), o = !0), this.previous && this.previous.resume(), !o; }, flush: function() { }, processChunk: function(o) { this.push(o); }, withStreamInfo: function(o, s) { return this.extraStreamInfo[o] = s, this.mergeStreamInfo(), this; }, mergeStreamInfo: function() { for (var o in this.extraStreamInfo) Object.prototype.hasOwnProperty.call(this.extraStreamInfo, o) && (this.streamInfo[o] = this.extraStreamInfo[o]); }, lock: function() { if (this.isLocked) throw new Error("The stream '" + this + "' has already been used."); this.isLocked = !0, this.previous && this.previous.lock(); }, toString: function() { var o = "Worker " + this.name; return this.previous ? this.previous + " -> " + o : o; } }, n.exports = i; }, {}], 29: [function(t, n, a) { var i = t("../utils"), o = t("./ConvertWorker"), s = t("./GenericWorker"), l = t("../base64"), u = t("../support"), c = t("../external"), f = null; if (u.nodestream) try { f = t("../nodejs/NodejsStreamOutputAdapter"); } catch (p) { } function d(p, y) { return new c.Promise(function(_, g) { var h = [], w = p._internalType, b = p._outputType, S = p._mimeType; p.on("data", function(A, T) { h.push(A), y && y(T); }).on("error", function(A) { h = [], g(A); }).on("end", function() { try { var A = function(T, D, L) { switch (T) { case "blob": return i.newBlob(i.transformTo("arraybuffer", D), L); case "base64": return l.encode(D); default: return i.transformTo(T, D); } }(b, function(T, D) { var L, I = 0, P = null, E = 0; for (L = 0; L < D.length; L++) E += D[L].length; switch (T) { case "string": return D.join(""); case "array": return Array.prototype.concat.apply([], D); case "uint8array": for (P = new Uint8Array(E), L = 0; L < D.length; L++) P.set(D[L], I), I += D[L].length; return P; case "nodebuffer": return Buffer.concat(D); default: throw new Error("concat : unsupported type '" + T + "'"); } }(w, h), S); _(A); } catch (T) { g(T); } h = []; }).resume(); }); } function v(p, y, _) { var g = y; switch (y) { case "blob": case "arraybuffer": g = "uint8array"; break; case "base64": g = "string"; } try { this._internalType = g, this._outputType = y, this._mimeType = _, i.checkSupport(g), this._worker = p.pipe(new o(g)), p.lock(); } catch (h) { this._worker = new s("error"), this._worker.error(h); } } v.prototype = { accumulate: function(p) { return d(this, p); }, on: function(p, y) { var _ = this; return p === "data" ? this._worker.on(p, function(g) { y.call(_, g.data, g.meta); }) : this._worker.on(p, function() { i.delay(y, arguments, _); }), this; }, resume: function() { return i.delay(this._worker.resume, [], this._worker), this; }, pause: function() { return this._worker.pause(), this; }, toNodejsStream: function(p) { if (i.checkSupport("nodestream"), this._outputType !== "nodebuffer") throw new Error(this._outputType + " is not supported by this method"); return new f(this, { objectMode: this._outputType !== "nodebuffer" }, p); } }, n.exports = v; }, { "../base64": 1, "../external": 6, "../nodejs/NodejsStreamOutputAdapter": 13, "../support": 30, "../utils": 32, "./ConvertWorker": 24, "./GenericWorker": 28 }], 30: [function(t, n, a) { if (a.base64 = !0, a.array = !0, a.string = !0, a.arraybuffer = typeof ArrayBuffer != "undefined" && typeof Uint8Array != "undefined", a.nodebuffer = typeof Buffer != "undefined", a.uint8array = typeof Uint8Array != "undefined", typeof ArrayBuffer == "undefined") a.blob = !1; else { var i = new ArrayBuffer(0); try { a.blob = new Blob([i], { type: "application/zip" }).size === 0; } catch (s) { try { var o = new (self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder)(); o.append(i), a.blob = o.getBlob("application/zip").size === 0; } catch (l) { a.blob = !1; } } } try { a.nodestream = !!t("readable-stream").Readable; } catch (s) { a.nodestream = !1; } }, { "readable-stream": 16 }], 31: [function(t, n, a) { for (var i = t("./utils"), o = t("./support"), s = t("./nodejsUtils"), l = t("./stream/GenericWorker"), u = new Array(256), c = 0; c < 256; c++) u[c] = 252 <= c ? 6 : 248 <= c ? 5 : 240 <= c ? 4 : 224 <= c ? 3 : 192 <= c ? 2 : 1; u[254] = u[254] = 1; function f() { l.call(this, "utf-8 decode"), this.leftOver = null; } function d() { l.call(this, "utf-8 encode"); } a.utf8encode = function(v) { return o.nodebuffer ? s.newBufferFrom(v, "utf-8") : function(p) { var y, _, g, h, w, b = p.length, S = 0; for (h = 0; h < b; h++) (64512 & (_ = p.charCodeAt(h))) == 55296 && h + 1 < b && (64512 & (g = p.charCodeAt(h + 1))) == 56320 && (_ = 65536 + (_ - 55296 << 10) + (g - 56320), h++), S += _ < 128 ? 1 : _ < 2048 ? 2 : _ < 65536 ? 3 : 4; for (y = o.uint8array ? new Uint8Array(S) : new Array(S), h = w = 0; w < S; h++) (64512 & (_ = p.charCodeAt(h))) == 55296 && h + 1 < b && (64512 & (g = p.charCodeAt(h + 1))) == 56320 && (_ = 65536 + (_ - 55296 << 10) + (g - 56320), h++), _ < 128 ? y[w++] = _ : (_ < 2048 ? y[w++] = 192 | _ >>> 6 : (_ < 65536 ? y[w++] = 224 | _ >>> 12 : (y[w++] = 240 | _ >>> 18, y[w++] = 128 | _ >>> 12 & 63), y[w++] = 128 | _ >>> 6 & 63), y[w++] = 128 | 63 & _); return y; }(v); }, a.utf8decode = function(v) { return o.nodebuffer ? i.transformTo("nodebuffer", v).toString("utf-8") : function(p) { var y, _, g, h, w = p.length, b = new Array(2 * w); for (y = _ = 0; y < w; ) if ((g = p[y++]) < 128) b[_++] = g; else if (4 < (h = u[g])) b[_++] = 65533, y += h - 1; else { for (g &= h === 2 ? 31 : h === 3 ? 15 : 7; 1 < h && y < w; ) g = g << 6 | 63 & p[y++], h--; 1 < h ? b[_++] = 65533 : g < 65536 ? b[_++] = g : (g -= 65536, b[_++] = 55296 | g >> 10 & 1023, b[_++] = 56320 | 1023 & g); } return b.length !== _ && (b.subarray ? b = b.subarray(0, _) : b.length = _), i.applyFromCharCode(b); }(v = i.transformTo(o.uint8array ? "uint8array" : "array", v)); }, i.inherits(f, l), f.prototype.processChunk = function(v) { var p = i.transformTo(o.uint8array ? "uint8array" : "array", v.data); if (this.leftOver && this.leftOver.length) { if (o.uint8array) { var y = p; (p = new Uint8Array(y.length + this.leftOver.length)).set(this.leftOver, 0), p.set(y, this.leftOver.length); } else p = this.leftOver.concat(p); this.leftOver = null; } var _ = function(h, w) { var b; for ((w = w || h.length) > h.length && (w = h.length), b = w - 1; 0 <= b && (192 & h[b]) == 128; ) b--; return b < 0 || b === 0 ? w : b + u[h[b]] > w ? b : w; }(p), g = p; _ !== p.length && (o.uint8array ? (g = p.subarray(0, _), this.leftOver = p.subarray(_, p.length)) : (g = p.slice(0, _), this.leftOver = p.slice(_, p.length))), this.push({ data: a.utf8decode(g), meta: v.meta }); }, f.prototype.flush = function() { this.leftOver && this.leftOver.length && (this.push({ data: a.utf8decode(this.leftOver), meta: {} }), this.leftOver = null); }, a.Utf8DecodeWorker = f, i.inherits(d, l), d.prototype.processChunk = function(v) { this.push({ data: a.utf8encode(v.data), meta: v.meta }); }, a.Utf8EncodeWorker = d; }, { "./nodejsUtils": 14, "./stream/GenericWorker": 28, "./support": 30, "./utils": 32 }], 32: [function(t, n, a) { var i = t("./support"), o = t("./base64"), s = t("./nodejsUtils"), l = t("./external"); function u(y) { return y; } function c(y, _) { for (var g = 0; g < y.length; ++g) _[g] = 255 & y.charCodeAt(g); return _; } t("setimmediate"), a.newBlob = function(y, _) { a.checkSupport("blob"); try { return new Blob([y], { type: _ }); } catch (h) { try { var g = new (self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder)(); return g.append(y), g.getBlob(_); } catch (w) { throw new Error("Bug : can't construct the Blob."); } } }; var f = { stringifyByChunk: function(y, _, g) { var h = [], w = 0, b = y.length; if (b <= g) return String.fromCharCode.apply(null, y); for (; w < b; ) _ === "array" || _ === "nodebuffer" ? h.push(String.fromCharCode.apply(null, y.slice(w, Math.min(w + g, b)))) : h.push(String.fromCharCode.apply(null, y.subarray(w, Math.min(w + g, b)))), w += g; return h.join(""); }, stringifyByChar: function(y) { for (var _ = "", g = 0; g < y.length; g++) _ += String.fromCharCode(y[g]); return _; }, applyCanBeUsed: { uint8array: function() { try { return i.uint8array && String.fromCharCode.apply(null, new Uint8Array(1)).length === 1; } catch (y) { return !1; } }(), nodebuffer: function() { try { return i.nodebuffer && String.fromCharCode.apply(null, s.allocBuffer(1)).length === 1; } catch (y) { return !1; } }() } }; function d(y) { var _ = 65536, g = a.getTypeOf(y), h = !0; if (g === "uint8array" ? h = f.applyCanBeUsed.uint8array : g === "nodebuffer" && (h = f.applyCanBeUsed.nodebuffer), h) for (; 1 < _; ) try { return f.stringifyByChunk(y, g, _); } catch (w) { _ = Math.floor(_ / 2); } return f.stringifyByChar(y); } function v(y, _) { for (var g = 0; g < y.length; g++) _[g] = y[g]; return _; } a.applyFromCharCode = d; var p = {}; p.string = { string: u, array: function(y) { return c(y, new Array(y.length)); }, arraybuffer: function(y) { return p.string.uint8array(y).buffer; }, uint8array: function(y) { return c(y, new Uint8Array(y.length)); }, nodebuffer: function(y) { return c(y, s.allocBuffer(y.length)); } }, p.array = { string: d, array: u, arraybuffer: function(y) { return new Uint8Array(y).buffer; }, uint8array: function(y) { return new Uint8Array(y); }, nodebuffer: function(y) { return s.newBufferFrom(y); } }, p.arraybuffer = { string: function(y) { return d(new Uint8Array(y)); }, array: function(y) { return v(new Uint8Array(y), new Array(y.byteLength)); }, arraybuffer: u, uint8array: function(y) { return new Uint8Array(y); }, nodebuffer: function(y) { return s.newBufferFrom(new Uint8Array(y)); } }, p.uint8array = { string: d, array: function(y) { return v(y, new