vue-book-reader 1.2.5 → 1.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -35
- package/dist/index.css +3 -3
- package/dist/vue-book-reader.es.js +1397 -1305
- package/dist/vue-book-reader.umd.js +1358 -1265
- package/package.json +1 -4
|
@@ -1613,6 +1613,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1613
1613
|
location: {
|
|
1614
1614
|
type: [String, Number]
|
|
1615
1615
|
},
|
|
1616
|
+
initOption: {
|
|
1617
|
+
type: Object
|
|
1618
|
+
},
|
|
1616
1619
|
tocChanged: Function,
|
|
1617
1620
|
getRendition: Function
|
|
1618
1621
|
},
|
|
@@ -1630,7 +1633,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1630
1633
|
};
|
|
1631
1634
|
}
|
|
1632
1635
|
const props = __props;
|
|
1633
|
-
const { tocChanged, getRendition } = props;
|
|
1636
|
+
const { tocChanged, getRendition, initOption } = props;
|
|
1634
1637
|
const { url, location } = toRefs(props);
|
|
1635
1638
|
const emit = __emit;
|
|
1636
1639
|
let view$1 = null;
|
|
@@ -1648,20 +1651,20 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1648
1651
|
}
|
|
1649
1652
|
await view$1.open(url.value);
|
|
1650
1653
|
getRendition && getRendition(view$1);
|
|
1651
|
-
initReader();
|
|
1654
|
+
await initReader();
|
|
1652
1655
|
}
|
|
1653
1656
|
} catch (error) {
|
|
1654
1657
|
console.error("Error opening book:", error);
|
|
1655
1658
|
isError.value = true;
|
|
1656
1659
|
}
|
|
1657
1660
|
};
|
|
1658
|
-
const initReader = () => {
|
|
1661
|
+
const initReader = async () => {
|
|
1659
1662
|
isLoaded.value = true;
|
|
1660
1663
|
const { book } = view$1;
|
|
1661
1664
|
registerEvents();
|
|
1662
1665
|
tocChanged && tocChanged(book.toc);
|
|
1663
|
-
if (
|
|
1664
|
-
|
|
1666
|
+
if (initOption) {
|
|
1667
|
+
await view$1.init(initOption);
|
|
1665
1668
|
} else {
|
|
1666
1669
|
view$1.renderer.next();
|
|
1667
1670
|
}
|
|
@@ -1728,7 +1731,7 @@ const _export_sfc = (sfc, props) => {
|
|
|
1728
1731
|
}
|
|
1729
1732
|
return target;
|
|
1730
1733
|
};
|
|
1731
|
-
const BookView = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-
|
|
1734
|
+
const BookView = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-0c743b16"]]);
|
|
1732
1735
|
const _hoisted_1$1 = ["onClick"];
|
|
1733
1736
|
const _hoisted_2$1 = { key: 0 };
|
|
1734
1737
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
@@ -1933,8 +1936,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1933
1936
|
});
|
|
1934
1937
|
const VueReader = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ce33d15c"]]);
|
|
1935
1938
|
const findIndices = (arr, f2) => arr.map((x2, i2, a2) => f2(x2, i2, a2) ? i2 : null).filter((x2) => x2 != null);
|
|
1936
|
-
const splitAt = (arr, is) => [-1, ...is, arr.length].reduce(({ xs, a: a2 },
|
|
1937
|
-
const concatArrays = (a2,
|
|
1939
|
+
const splitAt = (arr, is) => [-1, ...is, arr.length].reduce(({ xs, a: a2 }, b3) => ({ xs: (xs == null ? void 0 : xs.concat([arr.slice(a2 + 1, b3)])) ?? [], a: b3 }), {}).xs;
|
|
1940
|
+
const concatArrays = (a2, b3) => a2.slice(0, -1).concat([a2[a2.length - 1].concat(b3[0])]).concat(b3.slice(1));
|
|
1938
1941
|
const isNumber = /\d/;
|
|
1939
1942
|
const isCFI = /^epubcfi\((.*)\)$/;
|
|
1940
1943
|
const escapeCFI = (str) => str.replace(/[\^[\](),;=]/g, "^$&");
|
|
@@ -2055,12 +2058,12 @@ const buildRange = (from, to) => {
|
|
|
2055
2058
|
let pushToParent = true;
|
|
2056
2059
|
const len = Math.max(localFrom.length, localTo.length);
|
|
2057
2060
|
for (let i2 = 0; i2 < len; i2++) {
|
|
2058
|
-
const a2 = localFrom[i2],
|
|
2059
|
-
pushToParent &&= (a2 == null ? void 0 : a2.index) === (
|
|
2061
|
+
const a2 = localFrom[i2], b3 = localTo[i2];
|
|
2062
|
+
pushToParent &&= (a2 == null ? void 0 : a2.index) === (b3 == null ? void 0 : b3.index) && !(a2 == null ? void 0 : a2.offset) && !(b3 == null ? void 0 : b3.offset);
|
|
2060
2063
|
if (pushToParent) localParent.push(a2);
|
|
2061
2064
|
else {
|
|
2062
2065
|
if (a2) localStart.push(a2);
|
|
2063
|
-
if (
|
|
2066
|
+
if (b3) localEnd.push(b3);
|
|
2064
2067
|
}
|
|
2065
2068
|
}
|
|
2066
2069
|
const parent = from.slice(0, -1).concat([localParent]);
|
|
@@ -2121,7 +2124,9 @@ const partsToNode = (node, parts, filter2) => {
|
|
|
2121
2124
|
}
|
|
2122
2125
|
};
|
|
2123
2126
|
const nodeToParts = (node, offset, filter2) => {
|
|
2124
|
-
|
|
2127
|
+
let { id, parentNode } = node;
|
|
2128
|
+
while (filter2)
|
|
2129
|
+
parentNode = parentNode.parentNode;
|
|
2125
2130
|
const indexed = indexChildNodes(parentNode, filter2);
|
|
2126
2131
|
const index = indexed.findIndex((x2) => Array.isArray(x2) ? x2.some((x3) => x3 === node) : x2 === node);
|
|
2127
2132
|
const chunk = indexed[index];
|
|
@@ -2233,7 +2238,7 @@ class SectionProgress {
|
|
|
2233
2238
|
this.sizes = sections.map((s2) => s2.linear != "no" && s2.size > 0 ? s2.size : 0);
|
|
2234
2239
|
this.sizePerLoc = sizePerLoc;
|
|
2235
2240
|
this.sizePerTimeUnit = sizePerTimeUnit;
|
|
2236
|
-
this.sizeTotal = this.sizes.reduce((a2,
|
|
2241
|
+
this.sizeTotal = this.sizes.reduce((a2, b3) => a2 + b3, 0);
|
|
2237
2242
|
this.sectionFractions = this.#getSectionFractions();
|
|
2238
2243
|
}
|
|
2239
2244
|
#getSectionFractions() {
|
|
@@ -2247,7 +2252,7 @@ class SectionProgress {
|
|
|
2247
2252
|
getProgress(index, fractionInSection, pageFraction = 0) {
|
|
2248
2253
|
const { sizes, sizePerLoc, sizePerTimeUnit, sizeTotal } = this;
|
|
2249
2254
|
const sizeInSection = sizes[index] ?? 0;
|
|
2250
|
-
const sizeBefore = sizes.slice(0, index).reduce((a2,
|
|
2255
|
+
const sizeBefore = sizes.slice(0, index).reduce((a2, b3) => a2 + b3, 0);
|
|
2251
2256
|
const size = sizeBefore + fractionInSection * sizeInSection;
|
|
2252
2257
|
const nextSize = size + pageFraction * sizeInSection;
|
|
2253
2258
|
const remainingTotal = sizeTotal - size;
|
|
@@ -2324,12 +2329,12 @@ class Overlayer {
|
|
|
2324
2329
|
obj.rects = rects;
|
|
2325
2330
|
}
|
|
2326
2331
|
}
|
|
2327
|
-
hitTest({ x: x2, y:
|
|
2332
|
+
hitTest({ x: x2, y: y3 }) {
|
|
2328
2333
|
const arr = Array.from(this.#map.entries());
|
|
2329
2334
|
for (let i2 = arr.length - 1; i2 >= 0; i2--) {
|
|
2330
2335
|
const [key, obj] = arr[i2];
|
|
2331
2336
|
for (const { left, top, right, bottom } of obj.rects)
|
|
2332
|
-
if (top <=
|
|
2337
|
+
if (top <= y3 && left <= x2 && bottom > y3 && right > x2)
|
|
2333
2338
|
return [key, obj.range];
|
|
2334
2339
|
}
|
|
2335
2340
|
return [];
|
|
@@ -2490,7 +2495,7 @@ const textWalker = function* (x2, func, filterFunc) {
|
|
|
2490
2495
|
const walker = document.createTreeWalker(root, filter$1, { acceptNode: filterFunc || acceptNode });
|
|
2491
2496
|
const walk = x2.commonAncestorContainer ? walkRange : walkDocument;
|
|
2492
2497
|
const nodes = walk(x2, walker);
|
|
2493
|
-
const strs = nodes.map((node) => node.nodeValue);
|
|
2498
|
+
const strs = nodes.map((node) => node.nodeValue ?? "");
|
|
2494
2499
|
const makeRange2 = (startIndex, startOffset, endIndex, endOffset) => {
|
|
2495
2500
|
const range = document.createRange();
|
|
2496
2501
|
range.setStart(nodes[startIndex], startOffset);
|
|
@@ -2697,6 +2702,8 @@ let View$1 = class View extends HTMLElement {
|
|
|
2697
2702
|
#tocProgress;
|
|
2698
2703
|
#pageProgress;
|
|
2699
2704
|
#searchResults = /* @__PURE__ */ new Map();
|
|
2705
|
+
#searchDraw;
|
|
2706
|
+
#searchDrawOptions;
|
|
2700
2707
|
#cursorAutohider = new CursorAutohider(this, () => this.hasAttribute("autohide-cursor"));
|
|
2701
2708
|
isFixedLayout = false;
|
|
2702
2709
|
lastLocation;
|
|
@@ -2799,6 +2806,17 @@ let View$1 = class View extends HTMLElement {
|
|
|
2799
2806
|
await this.next();
|
|
2800
2807
|
}
|
|
2801
2808
|
}
|
|
2809
|
+
getLabelByFraction(fraction) {
|
|
2810
|
+
if (!this.#sectionProgress || !this.#tocProgress) return null;
|
|
2811
|
+
try {
|
|
2812
|
+
const [index] = this.#sectionProgress.getSection(fraction);
|
|
2813
|
+
if (index == null) return null;
|
|
2814
|
+
const tocItem = this.#tocProgress.getProgress(index, null);
|
|
2815
|
+
return (tocItem == null ? void 0 : tocItem.label) || null;
|
|
2816
|
+
} catch (e2) {
|
|
2817
|
+
return null;
|
|
2818
|
+
}
|
|
2819
|
+
}
|
|
2802
2820
|
#emit(name, detail, cancelable) {
|
|
2803
2821
|
return this.dispatchEvent(new CustomEvent(name, { detail, cancelable }));
|
|
2804
2822
|
}
|
|
@@ -2850,7 +2868,7 @@ let View$1 = class View extends HTMLElement {
|
|
|
2850
2868
|
return;
|
|
2851
2869
|
}
|
|
2852
2870
|
const range = doc ? anchor2(doc) : anchor2;
|
|
2853
|
-
overlayer.add(value, range,
|
|
2871
|
+
overlayer.add(value, range, this.#searchDraw, this.#searchDrawOptions);
|
|
2854
2872
|
}
|
|
2855
2873
|
return;
|
|
2856
2874
|
}
|
|
@@ -3011,6 +3029,8 @@ let View$1 = class View extends HTMLElement {
|
|
|
3011
3029
|
async *search(opts) {
|
|
3012
3030
|
var _a;
|
|
3013
3031
|
this.clearSearch();
|
|
3032
|
+
this.#searchDraw = opts.draw ?? Overlayer.outline;
|
|
3033
|
+
this.#searchDrawOptions = opts.drawOptions;
|
|
3014
3034
|
const { searchMatcher: searchMatcher2 } = await Promise.resolve().then(() => search$1);
|
|
3015
3035
|
const { query, index } = opts;
|
|
3016
3036
|
const matcher = searchMatcher2(
|
|
@@ -3065,511 +3085,81 @@ const view = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
|
|
|
3065
3085
|
View: View$1,
|
|
3066
3086
|
makeBook
|
|
3067
3087
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3068
|
-
const e$1 =
|
|
3069
|
-
|
|
3070
|
-
let e2, i2, r2, a2, d, f2;
|
|
3071
|
-
function h2(e3, i3, s2, o2, l2, c, h3, w2, _2, b2, p2) {
|
|
3072
|
-
let m2, g2, y2, x2, k2, v2, S2, z2, A2, U3, D2, E2, T2, F2, O2;
|
|
3073
|
-
U3 = 0, k2 = s2;
|
|
3074
|
-
do {
|
|
3075
|
-
r2[e3[i3 + U3]]++, U3++, k2--;
|
|
3076
|
-
} while (0 !== k2);
|
|
3077
|
-
if (r2[0] == s2) return h3[0] = -1, w2[0] = 0, 0;
|
|
3078
|
-
for (z2 = w2[0], v2 = 1; v2 <= u$1 && 0 === r2[v2]; v2++) ;
|
|
3079
|
-
for (S2 = v2, z2 < v2 && (z2 = v2), k2 = u$1; 0 !== k2 && 0 === r2[k2]; k2--) ;
|
|
3080
|
-
for (y2 = k2, z2 > k2 && (z2 = k2), w2[0] = z2, F2 = 1 << v2; v2 < k2; v2++, F2 <<= 1) if ((F2 -= r2[v2]) < 0) return t$1;
|
|
3081
|
-
if ((F2 -= r2[k2]) < 0) return t$1;
|
|
3082
|
-
for (r2[k2] += F2, f2[1] = v2 = 0, U3 = 1, T2 = 2; 0 != --k2; ) f2[T2] = v2 += r2[U3], T2++, U3++;
|
|
3083
|
-
k2 = 0, U3 = 0;
|
|
3084
|
-
do {
|
|
3085
|
-
0 !== (v2 = e3[i3 + U3]) && (p2[f2[v2]++] = k2), U3++;
|
|
3086
|
-
} while (++k2 < s2);
|
|
3087
|
-
for (s2 = f2[y2], f2[0] = k2 = 0, U3 = 0, x2 = -1, E2 = -z2, d[0] = 0, D2 = 0, O2 = 0; S2 <= y2; S2++) for (m2 = r2[S2]; 0 != m2--; ) {
|
|
3088
|
-
for (; S2 > E2 + z2; ) {
|
|
3089
|
-
if (x2++, E2 += z2, O2 = y2 - E2, O2 = O2 > z2 ? z2 : O2, (g2 = 1 << (v2 = S2 - E2)) > m2 + 1 && (g2 -= m2 + 1, T2 = S2, v2 < O2)) for (; ++v2 < O2 && !((g2 <<= 1) <= r2[++T2]); ) g2 -= r2[T2];
|
|
3090
|
-
if (O2 = 1 << v2, b2[0] + O2 > 1440) return t$1;
|
|
3091
|
-
d[x2] = D2 = b2[0], b2[0] += O2, 0 !== x2 ? (f2[x2] = k2, a2[0] = v2, a2[1] = z2, v2 = k2 >>> E2 - z2, a2[2] = D2 - d[x2 - 1] - v2, _2.set(a2, 3 * (d[x2 - 1] + v2))) : h3[0] = D2;
|
|
3092
|
-
}
|
|
3093
|
-
for (a2[1] = S2 - E2, U3 >= s2 ? a2[0] = 192 : p2[U3] < o2 ? (a2[0] = p2[U3] < 256 ? 0 : 96, a2[2] = p2[U3++]) : (a2[0] = c[p2[U3] - o2] + 16 + 64, a2[2] = l2[p2[U3++] - o2]), g2 = 1 << S2 - E2, v2 = k2 >>> E2; v2 < O2; v2 += g2) _2.set(a2, 3 * (D2 + v2));
|
|
3094
|
-
for (v2 = 1 << S2 - 1; k2 & v2; v2 >>>= 1) k2 ^= v2;
|
|
3095
|
-
for (k2 ^= v2, A2 = (1 << E2) - 1; (k2 & A2) != f2[x2]; ) x2--, E2 -= z2, A2 = (1 << E2) - 1;
|
|
3096
|
-
}
|
|
3097
|
-
return 0 !== F2 && 1 != y2 ? n$1 : 0;
|
|
3098
|
-
}
|
|
3099
|
-
function w(t2) {
|
|
3100
|
-
let n2;
|
|
3101
|
-
for (e2 || (e2 = [], i2 = [], r2 = new Int32Array(16), a2 = [], d = new Int32Array(u$1), f2 = new Int32Array(16)), i2.length < t2 && (i2 = []), n2 = 0; n2 < t2; n2++) i2[n2] = 0;
|
|
3102
|
-
for (n2 = 0; n2 < 16; n2++) r2[n2] = 0;
|
|
3103
|
-
for (n2 = 0; n2 < 3; n2++) a2[n2] = 0;
|
|
3104
|
-
d.set(r2.subarray(0, u$1), 0), f2.set(r2.subarray(0, 16), 0);
|
|
3105
|
-
}
|
|
3106
|
-
this.inflate_trees_bits = function(r3, a3, s2, o2, l2) {
|
|
3107
|
-
let c;
|
|
3108
|
-
return w(19), e2[0] = 0, c = h2(r3, 0, 19, 19, null, null, s2, a3, o2, e2, i2), c == t$1 ? l2.msg = "oversubscribed dynamic bit lengths tree" : c != n$1 && 0 !== a3[0] || (l2.msg = "incomplete dynamic bit lengths tree", c = t$1), c;
|
|
3109
|
-
}, this.inflate_trees_dynamic = function(r3, a3, u, d2, f3, _2, b2, p2, m2) {
|
|
3110
|
-
let g2;
|
|
3111
|
-
return w(288), e2[0] = 0, g2 = h2(u, 0, r3, 257, s$1, o$1, _2, d2, p2, e2, i2), 0 != g2 || 0 === d2[0] ? (g2 == t$1 ? m2.msg = "oversubscribed literal/length tree" : -4 != g2 && (m2.msg = "incomplete literal/length tree", g2 = t$1), g2) : (w(288), g2 = h2(u, r3, a3, 0, l$1, c$1, b2, f3, p2, e2, i2), 0 != g2 || 0 === f3[0] && r3 > 257 ? (g2 == t$1 ? m2.msg = "oversubscribed distance tree" : g2 == n$1 ? (m2.msg = "incomplete distance tree", g2 = t$1) : -4 != g2 && (m2.msg = "empty distance tree with lengths", g2 = t$1), g2) : 0);
|
|
3112
|
-
};
|
|
3113
|
-
}
|
|
3114
|
-
d$1.inflate_trees_fixed = function(e2, t2, n2, i2) {
|
|
3115
|
-
return e2[0] = 9, t2[0] = 5, n2[0] = r$1, i2[0] = a$1, 0;
|
|
3116
|
-
};
|
|
3117
|
-
function f$1() {
|
|
3118
|
-
const n2 = this;
|
|
3119
|
-
let r2, a2, s2, o2, l2 = 0, c = 0, u = 0, d = 0, f2 = 0, h2 = 0, w = 0, _2 = 0, b2 = 0, p2 = 0;
|
|
3120
|
-
function m2(e2, n3, r3, a3, s3, o3, l3, c2) {
|
|
3121
|
-
let u2, d2, f3, h3, w2, _3, b3, p3, m3, g2, y2, x2, k2, v2, S2, z2;
|
|
3122
|
-
b3 = c2.next_in_index, p3 = c2.avail_in, w2 = l3.bitb, _3 = l3.bitk, m3 = l3.write, g2 = m3 < l3.read ? l3.read - m3 - 1 : l3.end - m3, y2 = i$1[e2], x2 = i$1[n3];
|
|
3123
|
-
do {
|
|
3124
|
-
for (; _3 < 20; ) p3--, w2 |= (255 & c2.read_byte(b3++)) << _3, _3 += 8;
|
|
3125
|
-
if (u2 = w2 & y2, d2 = r3, f3 = a3, z2 = 3 * (f3 + u2), 0 !== (h3 = d2[z2])) for (; ; ) {
|
|
3126
|
-
if (w2 >>= d2[z2 + 1], _3 -= d2[z2 + 1], 16 & h3) {
|
|
3127
|
-
for (h3 &= 15, k2 = d2[z2 + 2] + (w2 & i$1[h3]), w2 >>= h3, _3 -= h3; _3 < 15; ) p3--, w2 |= (255 & c2.read_byte(b3++)) << _3, _3 += 8;
|
|
3128
|
-
for (u2 = w2 & x2, d2 = s3, f3 = o3, z2 = 3 * (f3 + u2), h3 = d2[z2]; ; ) {
|
|
3129
|
-
if (w2 >>= d2[z2 + 1], _3 -= d2[z2 + 1], 16 & h3) {
|
|
3130
|
-
for (h3 &= 15; _3 < h3; ) p3--, w2 |= (255 & c2.read_byte(b3++)) << _3, _3 += 8;
|
|
3131
|
-
if (v2 = d2[z2 + 2] + (w2 & i$1[h3]), w2 >>= h3, _3 -= h3, g2 -= k2, m3 >= v2) S2 = m3 - v2, m3 - S2 > 0 && 2 > m3 - S2 ? (l3.win[m3++] = l3.win[S2++], l3.win[m3++] = l3.win[S2++], k2 -= 2) : (l3.win.set(l3.win.subarray(S2, S2 + 2), m3), m3 += 2, S2 += 2, k2 -= 2);
|
|
3132
|
-
else {
|
|
3133
|
-
S2 = m3 - v2;
|
|
3134
|
-
do {
|
|
3135
|
-
S2 += l3.end;
|
|
3136
|
-
} while (S2 < 0);
|
|
3137
|
-
if (h3 = l3.end - S2, k2 > h3) {
|
|
3138
|
-
if (k2 -= h3, m3 - S2 > 0 && h3 > m3 - S2) do {
|
|
3139
|
-
l3.win[m3++] = l3.win[S2++];
|
|
3140
|
-
} while (0 != --h3);
|
|
3141
|
-
else l3.win.set(l3.win.subarray(S2, S2 + h3), m3), m3 += h3, S2 += h3, h3 = 0;
|
|
3142
|
-
S2 = 0;
|
|
3143
|
-
}
|
|
3144
|
-
}
|
|
3145
|
-
if (m3 - S2 > 0 && k2 > m3 - S2) do {
|
|
3146
|
-
l3.win[m3++] = l3.win[S2++];
|
|
3147
|
-
} while (0 != --k2);
|
|
3148
|
-
else l3.win.set(l3.win.subarray(S2, S2 + k2), m3), m3 += k2, S2 += k2, k2 = 0;
|
|
3149
|
-
break;
|
|
3150
|
-
}
|
|
3151
|
-
if (64 & h3) return c2.msg = "invalid distance code", k2 = c2.avail_in - p3, k2 = _3 >> 3 < k2 ? _3 >> 3 : k2, p3 += k2, b3 -= k2, _3 -= k2 << 3, l3.bitb = w2, l3.bitk = _3, c2.avail_in = p3, c2.total_in += b3 - c2.next_in_index, c2.next_in_index = b3, l3.write = m3, t$1;
|
|
3152
|
-
u2 += d2[z2 + 2], u2 += w2 & i$1[h3], z2 = 3 * (f3 + u2), h3 = d2[z2];
|
|
3153
|
-
}
|
|
3154
|
-
break;
|
|
3155
|
-
}
|
|
3156
|
-
if (64 & h3) return 32 & h3 ? (k2 = c2.avail_in - p3, k2 = _3 >> 3 < k2 ? _3 >> 3 : k2, p3 += k2, b3 -= k2, _3 -= k2 << 3, l3.bitb = w2, l3.bitk = _3, c2.avail_in = p3, c2.total_in += b3 - c2.next_in_index, c2.next_in_index = b3, l3.write = m3, 1) : (c2.msg = "invalid literal/length code", k2 = c2.avail_in - p3, k2 = _3 >> 3 < k2 ? _3 >> 3 : k2, p3 += k2, b3 -= k2, _3 -= k2 << 3, l3.bitb = w2, l3.bitk = _3, c2.avail_in = p3, c2.total_in += b3 - c2.next_in_index, c2.next_in_index = b3, l3.write = m3, t$1);
|
|
3157
|
-
if (u2 += d2[z2 + 2], u2 += w2 & i$1[h3], z2 = 3 * (f3 + u2), 0 === (h3 = d2[z2])) {
|
|
3158
|
-
w2 >>= d2[z2 + 1], _3 -= d2[z2 + 1], l3.win[m3++] = d2[z2 + 2], g2--;
|
|
3159
|
-
break;
|
|
3160
|
-
}
|
|
3161
|
-
}
|
|
3162
|
-
else w2 >>= d2[z2 + 1], _3 -= d2[z2 + 1], l3.win[m3++] = d2[z2 + 2], g2--;
|
|
3163
|
-
} while (g2 >= 258 && p3 >= 10);
|
|
3164
|
-
return k2 = c2.avail_in - p3, k2 = _3 >> 3 < k2 ? _3 >> 3 : k2, p3 += k2, b3 -= k2, _3 -= k2 << 3, l3.bitb = w2, l3.bitk = _3, c2.avail_in = p3, c2.total_in += b3 - c2.next_in_index, c2.next_in_index = b3, l3.write = m3, 0;
|
|
3165
|
-
}
|
|
3166
|
-
n2.init = function(e2, t2, n3, i2, l3, c2) {
|
|
3167
|
-
r2 = 0, w = e2, _2 = t2, s2 = n3, b2 = i2, o2 = l3, p2 = c2, a2 = null;
|
|
3168
|
-
}, n2.proc = function(n3, g2, y2) {
|
|
3169
|
-
let x2, k2, v2, S2, z2, A2, U3, D2 = 0, E2 = 0, T2 = 0;
|
|
3170
|
-
for (T2 = g2.next_in_index, S2 = g2.avail_in, D2 = n3.bitb, E2 = n3.bitk, z2 = n3.write, A2 = z2 < n3.read ? n3.read - z2 - 1 : n3.end - z2; ; ) switch (r2) {
|
|
3171
|
-
case 0:
|
|
3172
|
-
if (A2 >= 258 && S2 >= 10 && (n3.bitb = D2, n3.bitk = E2, g2.avail_in = S2, g2.total_in += T2 - g2.next_in_index, g2.next_in_index = T2, n3.write = z2, y2 = m2(w, _2, s2, b2, o2, p2, n3, g2), T2 = g2.next_in_index, S2 = g2.avail_in, D2 = n3.bitb, E2 = n3.bitk, z2 = n3.write, A2 = z2 < n3.read ? n3.read - z2 - 1 : n3.end - z2, 0 != y2)) {
|
|
3173
|
-
r2 = 1 == y2 ? 7 : 9;
|
|
3174
|
-
break;
|
|
3175
|
-
}
|
|
3176
|
-
u = w, a2 = s2, c = b2, r2 = 1;
|
|
3177
|
-
case 1:
|
|
3178
|
-
for (x2 = u; E2 < x2; ) {
|
|
3179
|
-
if (0 === S2) return n3.bitb = D2, n3.bitk = E2, g2.avail_in = S2, g2.total_in += T2 - g2.next_in_index, g2.next_in_index = T2, n3.write = z2, n3.inflate_flush(g2, y2);
|
|
3180
|
-
y2 = 0, S2--, D2 |= (255 & g2.read_byte(T2++)) << E2, E2 += 8;
|
|
3181
|
-
}
|
|
3182
|
-
if (k2 = 3 * (c + (D2 & i$1[x2])), D2 >>>= a2[k2 + 1], E2 -= a2[k2 + 1], v2 = a2[k2], 0 === v2) {
|
|
3183
|
-
d = a2[k2 + 2], r2 = 6;
|
|
3184
|
-
break;
|
|
3185
|
-
}
|
|
3186
|
-
if (16 & v2) {
|
|
3187
|
-
f2 = 15 & v2, l2 = a2[k2 + 2], r2 = 2;
|
|
3188
|
-
break;
|
|
3189
|
-
}
|
|
3190
|
-
if (!(64 & v2)) {
|
|
3191
|
-
u = v2, c = k2 / 3 + a2[k2 + 2];
|
|
3192
|
-
break;
|
|
3193
|
-
}
|
|
3194
|
-
if (32 & v2) {
|
|
3195
|
-
r2 = 7;
|
|
3196
|
-
break;
|
|
3197
|
-
}
|
|
3198
|
-
return r2 = 9, g2.msg = "invalid literal/length code", y2 = t$1, n3.bitb = D2, n3.bitk = E2, g2.avail_in = S2, g2.total_in += T2 - g2.next_in_index, g2.next_in_index = T2, n3.write = z2, n3.inflate_flush(g2, y2);
|
|
3199
|
-
case 2:
|
|
3200
|
-
for (x2 = f2; E2 < x2; ) {
|
|
3201
|
-
if (0 === S2) return n3.bitb = D2, n3.bitk = E2, g2.avail_in = S2, g2.total_in += T2 - g2.next_in_index, g2.next_in_index = T2, n3.write = z2, n3.inflate_flush(g2, y2);
|
|
3202
|
-
y2 = 0, S2--, D2 |= (255 & g2.read_byte(T2++)) << E2, E2 += 8;
|
|
3203
|
-
}
|
|
3204
|
-
l2 += D2 & i$1[x2], D2 >>= x2, E2 -= x2, u = _2, a2 = o2, c = p2, r2 = 3;
|
|
3205
|
-
case 3:
|
|
3206
|
-
for (x2 = u; E2 < x2; ) {
|
|
3207
|
-
if (0 === S2) return n3.bitb = D2, n3.bitk = E2, g2.avail_in = S2, g2.total_in += T2 - g2.next_in_index, g2.next_in_index = T2, n3.write = z2, n3.inflate_flush(g2, y2);
|
|
3208
|
-
y2 = 0, S2--, D2 |= (255 & g2.read_byte(T2++)) << E2, E2 += 8;
|
|
3209
|
-
}
|
|
3210
|
-
if (k2 = 3 * (c + (D2 & i$1[x2])), D2 >>= a2[k2 + 1], E2 -= a2[k2 + 1], v2 = a2[k2], 16 & v2) {
|
|
3211
|
-
f2 = 15 & v2, h2 = a2[k2 + 2], r2 = 4;
|
|
3212
|
-
break;
|
|
3213
|
-
}
|
|
3214
|
-
if (!(64 & v2)) {
|
|
3215
|
-
u = v2, c = k2 / 3 + a2[k2 + 2];
|
|
3216
|
-
break;
|
|
3217
|
-
}
|
|
3218
|
-
return r2 = 9, g2.msg = "invalid distance code", y2 = t$1, n3.bitb = D2, n3.bitk = E2, g2.avail_in = S2, g2.total_in += T2 - g2.next_in_index, g2.next_in_index = T2, n3.write = z2, n3.inflate_flush(g2, y2);
|
|
3219
|
-
case 4:
|
|
3220
|
-
for (x2 = f2; E2 < x2; ) {
|
|
3221
|
-
if (0 === S2) return n3.bitb = D2, n3.bitk = E2, g2.avail_in = S2, g2.total_in += T2 - g2.next_in_index, g2.next_in_index = T2, n3.write = z2, n3.inflate_flush(g2, y2);
|
|
3222
|
-
y2 = 0, S2--, D2 |= (255 & g2.read_byte(T2++)) << E2, E2 += 8;
|
|
3223
|
-
}
|
|
3224
|
-
h2 += D2 & i$1[x2], D2 >>= x2, E2 -= x2, r2 = 5;
|
|
3225
|
-
case 5:
|
|
3226
|
-
for (U3 = z2 - h2; U3 < 0; ) U3 += n3.end;
|
|
3227
|
-
for (; 0 !== l2; ) {
|
|
3228
|
-
if (0 === A2 && (z2 == n3.end && 0 !== n3.read && (z2 = 0, A2 = z2 < n3.read ? n3.read - z2 - 1 : n3.end - z2), 0 === A2 && (n3.write = z2, y2 = n3.inflate_flush(g2, y2), z2 = n3.write, A2 = z2 < n3.read ? n3.read - z2 - 1 : n3.end - z2, z2 == n3.end && 0 !== n3.read && (z2 = 0, A2 = z2 < n3.read ? n3.read - z2 - 1 : n3.end - z2), 0 === A2))) return n3.bitb = D2, n3.bitk = E2, g2.avail_in = S2, g2.total_in += T2 - g2.next_in_index, g2.next_in_index = T2, n3.write = z2, n3.inflate_flush(g2, y2);
|
|
3229
|
-
n3.win[z2++] = n3.win[U3++], A2--, U3 == n3.end && (U3 = 0), l2--;
|
|
3230
|
-
}
|
|
3231
|
-
r2 = 0;
|
|
3232
|
-
break;
|
|
3233
|
-
case 6:
|
|
3234
|
-
if (0 === A2 && (z2 == n3.end && 0 !== n3.read && (z2 = 0, A2 = z2 < n3.read ? n3.read - z2 - 1 : n3.end - z2), 0 === A2 && (n3.write = z2, y2 = n3.inflate_flush(g2, y2), z2 = n3.write, A2 = z2 < n3.read ? n3.read - z2 - 1 : n3.end - z2, z2 == n3.end && 0 !== n3.read && (z2 = 0, A2 = z2 < n3.read ? n3.read - z2 - 1 : n3.end - z2), 0 === A2))) return n3.bitb = D2, n3.bitk = E2, g2.avail_in = S2, g2.total_in += T2 - g2.next_in_index, g2.next_in_index = T2, n3.write = z2, n3.inflate_flush(g2, y2);
|
|
3235
|
-
y2 = 0, n3.win[z2++] = d, A2--, r2 = 0;
|
|
3236
|
-
break;
|
|
3237
|
-
case 7:
|
|
3238
|
-
if (E2 > 7 && (E2 -= 8, S2++, T2--), n3.write = z2, y2 = n3.inflate_flush(g2, y2), z2 = n3.write, A2 = z2 < n3.read ? n3.read - z2 - 1 : n3.end - z2, n3.read != n3.write) return n3.bitb = D2, n3.bitk = E2, g2.avail_in = S2, g2.total_in += T2 - g2.next_in_index, g2.next_in_index = T2, n3.write = z2, n3.inflate_flush(g2, y2);
|
|
3239
|
-
r2 = 8;
|
|
3240
|
-
case 8:
|
|
3241
|
-
return y2 = 1, n3.bitb = D2, n3.bitk = E2, g2.avail_in = S2, g2.total_in += T2 - g2.next_in_index, g2.next_in_index = T2, n3.write = z2, n3.inflate_flush(g2, y2);
|
|
3242
|
-
case 9:
|
|
3243
|
-
return y2 = t$1, n3.bitb = D2, n3.bitk = E2, g2.avail_in = S2, g2.total_in += T2 - g2.next_in_index, g2.next_in_index = T2, n3.write = z2, n3.inflate_flush(g2, y2);
|
|
3244
|
-
default:
|
|
3245
|
-
return y2 = e$1, n3.bitb = D2, n3.bitk = E2, g2.avail_in = S2, g2.total_in += T2 - g2.next_in_index, g2.next_in_index = T2, n3.write = z2, n3.inflate_flush(g2, y2);
|
|
3246
|
-
}
|
|
3247
|
-
}, n2.free = function() {
|
|
3248
|
-
};
|
|
3249
|
-
}
|
|
3250
|
-
const h$1 = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
|
|
3251
|
-
function w$1(r2, a2) {
|
|
3252
|
-
const s2 = this;
|
|
3253
|
-
let o2, l2 = 0, c = 0, u = 0, w = 0;
|
|
3254
|
-
const _2 = [0], b2 = [0], p2 = new f$1();
|
|
3255
|
-
let m2 = 0, g2 = new Int32Array(4320);
|
|
3256
|
-
const y2 = new d$1();
|
|
3257
|
-
s2.bitk = 0, s2.bitb = 0, s2.win = new Uint8Array(a2), s2.end = a2, s2.read = 0, s2.write = 0, s2.reset = function(e2, t2) {
|
|
3258
|
-
t2 && (t2[0] = 0), 6 == l2 && p2.free(e2), l2 = 0, s2.bitk = 0, s2.bitb = 0, s2.read = s2.write = 0;
|
|
3259
|
-
}, s2.reset(r2, null), s2.inflate_flush = function(e2, t2) {
|
|
3260
|
-
let i2, r3, a3;
|
|
3261
|
-
return r3 = e2.next_out_index, a3 = s2.read, i2 = (a3 <= s2.write ? s2.write : s2.end) - a3, i2 > e2.avail_out && (i2 = e2.avail_out), 0 !== i2 && t2 == n$1 && (t2 = 0), e2.avail_out -= i2, e2.total_out += i2, e2.next_out.set(s2.win.subarray(a3, a3 + i2), r3), r3 += i2, a3 += i2, a3 == s2.end && (a3 = 0, s2.write == s2.end && (s2.write = 0), i2 = s2.write - a3, i2 > e2.avail_out && (i2 = e2.avail_out), 0 !== i2 && t2 == n$1 && (t2 = 0), e2.avail_out -= i2, e2.total_out += i2, e2.next_out.set(s2.win.subarray(a3, a3 + i2), r3), r3 += i2, a3 += i2), e2.next_out_index = r3, s2.read = a3, t2;
|
|
3262
|
-
}, s2.proc = function(n2, r3) {
|
|
3263
|
-
let a3, f2, x2, k2, v2, S2, z2, A2;
|
|
3264
|
-
for (k2 = n2.next_in_index, v2 = n2.avail_in, f2 = s2.bitb, x2 = s2.bitk, S2 = s2.write, z2 = S2 < s2.read ? s2.read - S2 - 1 : s2.end - S2; ; ) {
|
|
3265
|
-
let U3, D2, E2, T2, F2, O2, C2, W2;
|
|
3266
|
-
switch (l2) {
|
|
3267
|
-
case 0:
|
|
3268
|
-
for (; x2 < 3; ) {
|
|
3269
|
-
if (0 === v2) return s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3270
|
-
r3 = 0, v2--, f2 |= (255 & n2.read_byte(k2++)) << x2, x2 += 8;
|
|
3271
|
-
}
|
|
3272
|
-
switch (a3 = 7 & f2, m2 = 1 & a3, a3 >>> 1) {
|
|
3273
|
-
case 0:
|
|
3274
|
-
f2 >>>= 3, x2 -= 3, a3 = 7 & x2, f2 >>>= a3, x2 -= a3, l2 = 1;
|
|
3275
|
-
break;
|
|
3276
|
-
case 1:
|
|
3277
|
-
U3 = [], D2 = [], E2 = [[]], T2 = [[]], d$1.inflate_trees_fixed(U3, D2, E2, T2), p2.init(U3[0], D2[0], E2[0], 0, T2[0], 0), f2 >>>= 3, x2 -= 3, l2 = 6;
|
|
3278
|
-
break;
|
|
3279
|
-
case 2:
|
|
3280
|
-
f2 >>>= 3, x2 -= 3, l2 = 3;
|
|
3281
|
-
break;
|
|
3282
|
-
case 3:
|
|
3283
|
-
return f2 >>>= 3, x2 -= 3, l2 = 9, n2.msg = "invalid block type", r3 = t$1, s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3284
|
-
}
|
|
3285
|
-
break;
|
|
3286
|
-
case 1:
|
|
3287
|
-
for (; x2 < 32; ) {
|
|
3288
|
-
if (0 === v2) return s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3289
|
-
r3 = 0, v2--, f2 |= (255 & n2.read_byte(k2++)) << x2, x2 += 8;
|
|
3290
|
-
}
|
|
3291
|
-
if ((~f2 >>> 16 & 65535) != (65535 & f2)) return l2 = 9, n2.msg = "invalid stored block lengths", r3 = t$1, s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3292
|
-
c = 65535 & f2, f2 = x2 = 0, l2 = 0 !== c ? 2 : 0 !== m2 ? 7 : 0;
|
|
3293
|
-
break;
|
|
3294
|
-
case 2:
|
|
3295
|
-
if (0 === v2) return s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3296
|
-
if (0 === z2 && (S2 == s2.end && 0 !== s2.read && (S2 = 0, z2 = S2 < s2.read ? s2.read - S2 - 1 : s2.end - S2), 0 === z2 && (s2.write = S2, r3 = s2.inflate_flush(n2, r3), S2 = s2.write, z2 = S2 < s2.read ? s2.read - S2 - 1 : s2.end - S2, S2 == s2.end && 0 !== s2.read && (S2 = 0, z2 = S2 < s2.read ? s2.read - S2 - 1 : s2.end - S2), 0 === z2))) return s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3297
|
-
if (r3 = 0, a3 = c, a3 > v2 && (a3 = v2), a3 > z2 && (a3 = z2), s2.win.set(n2.read_buf(k2, a3), S2), k2 += a3, v2 -= a3, S2 += a3, z2 -= a3, 0 != (c -= a3)) break;
|
|
3298
|
-
l2 = 0 !== m2 ? 7 : 0;
|
|
3299
|
-
break;
|
|
3300
|
-
case 3:
|
|
3301
|
-
for (; x2 < 14; ) {
|
|
3302
|
-
if (0 === v2) return s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3303
|
-
r3 = 0, v2--, f2 |= (255 & n2.read_byte(k2++)) << x2, x2 += 8;
|
|
3304
|
-
}
|
|
3305
|
-
if (u = a3 = 16383 & f2, (31 & a3) > 29 || (a3 >> 5 & 31) > 29) return l2 = 9, n2.msg = "too many length or distance symbols", r3 = t$1, s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3306
|
-
if (a3 = 258 + (31 & a3) + (a3 >> 5 & 31), !o2 || o2.length < a3) o2 = [];
|
|
3307
|
-
else for (A2 = 0; A2 < a3; A2++) o2[A2] = 0;
|
|
3308
|
-
f2 >>>= 14, x2 -= 14, w = 0, l2 = 4;
|
|
3309
|
-
case 4:
|
|
3310
|
-
for (; w < 4 + (u >>> 10); ) {
|
|
3311
|
-
for (; x2 < 3; ) {
|
|
3312
|
-
if (0 === v2) return s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3313
|
-
r3 = 0, v2--, f2 |= (255 & n2.read_byte(k2++)) << x2, x2 += 8;
|
|
3314
|
-
}
|
|
3315
|
-
o2[h$1[w++]] = 7 & f2, f2 >>>= 3, x2 -= 3;
|
|
3316
|
-
}
|
|
3317
|
-
for (; w < 19; ) o2[h$1[w++]] = 0;
|
|
3318
|
-
if (_2[0] = 7, a3 = y2.inflate_trees_bits(o2, _2, b2, g2, n2), 0 != a3) return (r3 = a3) == t$1 && (o2 = null, l2 = 9), s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3319
|
-
w = 0, l2 = 5;
|
|
3320
|
-
case 5:
|
|
3321
|
-
for (; a3 = u, !(w >= 258 + (31 & a3) + (a3 >> 5 & 31)); ) {
|
|
3322
|
-
let e2, c2;
|
|
3323
|
-
for (a3 = _2[0]; x2 < a3; ) {
|
|
3324
|
-
if (0 === v2) return s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3325
|
-
r3 = 0, v2--, f2 |= (255 & n2.read_byte(k2++)) << x2, x2 += 8;
|
|
3326
|
-
}
|
|
3327
|
-
if (a3 = g2[3 * (b2[0] + (f2 & i$1[a3])) + 1], c2 = g2[3 * (b2[0] + (f2 & i$1[a3])) + 2], c2 < 16) f2 >>>= a3, x2 -= a3, o2[w++] = c2;
|
|
3328
|
-
else {
|
|
3329
|
-
for (A2 = 18 == c2 ? 7 : c2 - 14, e2 = 18 == c2 ? 11 : 3; x2 < a3 + A2; ) {
|
|
3330
|
-
if (0 === v2) return s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3331
|
-
r3 = 0, v2--, f2 |= (255 & n2.read_byte(k2++)) << x2, x2 += 8;
|
|
3332
|
-
}
|
|
3333
|
-
if (f2 >>>= a3, x2 -= a3, e2 += f2 & i$1[A2], f2 >>>= A2, x2 -= A2, A2 = w, a3 = u, A2 + e2 > 258 + (31 & a3) + (a3 >> 5 & 31) || 16 == c2 && A2 < 1) return o2 = null, l2 = 9, n2.msg = "invalid bit length repeat", r3 = t$1, s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3334
|
-
c2 = 16 == c2 ? o2[A2 - 1] : 0;
|
|
3335
|
-
do {
|
|
3336
|
-
o2[A2++] = c2;
|
|
3337
|
-
} while (0 != --e2);
|
|
3338
|
-
w = A2;
|
|
3339
|
-
}
|
|
3340
|
-
}
|
|
3341
|
-
if (b2[0] = -1, F2 = [], O2 = [], C2 = [], W2 = [], F2[0] = 9, O2[0] = 6, a3 = u, a3 = y2.inflate_trees_dynamic(257 + (31 & a3), 1 + (a3 >> 5 & 31), o2, F2, O2, C2, W2, g2, n2), 0 != a3) return a3 == t$1 && (o2 = null, l2 = 9), r3 = a3, s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3342
|
-
p2.init(F2[0], O2[0], g2, C2[0], g2, W2[0]), l2 = 6;
|
|
3343
|
-
case 6:
|
|
3344
|
-
if (s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, 1 != (r3 = p2.proc(s2, n2, r3))) return s2.inflate_flush(n2, r3);
|
|
3345
|
-
if (r3 = 0, p2.free(n2), k2 = n2.next_in_index, v2 = n2.avail_in, f2 = s2.bitb, x2 = s2.bitk, S2 = s2.write, z2 = S2 < s2.read ? s2.read - S2 - 1 : s2.end - S2, 0 === m2) {
|
|
3346
|
-
l2 = 0;
|
|
3347
|
-
break;
|
|
3348
|
-
}
|
|
3349
|
-
l2 = 7;
|
|
3350
|
-
case 7:
|
|
3351
|
-
if (s2.write = S2, r3 = s2.inflate_flush(n2, r3), S2 = s2.write, z2 = S2 < s2.read ? s2.read - S2 - 1 : s2.end - S2, s2.read != s2.write) return s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3352
|
-
l2 = 8;
|
|
3353
|
-
case 8:
|
|
3354
|
-
return r3 = 1, s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3355
|
-
case 9:
|
|
3356
|
-
return r3 = t$1, s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3357
|
-
default:
|
|
3358
|
-
return r3 = e$1, s2.bitb = f2, s2.bitk = x2, n2.avail_in = v2, n2.total_in += k2 - n2.next_in_index, n2.next_in_index = k2, s2.write = S2, s2.inflate_flush(n2, r3);
|
|
3359
|
-
}
|
|
3360
|
-
}
|
|
3361
|
-
}, s2.free = function(e2) {
|
|
3362
|
-
s2.reset(e2, null), s2.win = null, g2 = null;
|
|
3363
|
-
}, s2.set_dictionary = function(e2, t2, n2) {
|
|
3364
|
-
s2.win.set(e2.subarray(t2, t2 + n2), 0), s2.read = s2.write = n2;
|
|
3365
|
-
}, s2.sync_point = function() {
|
|
3366
|
-
return 1 == l2 ? 1 : 0;
|
|
3367
|
-
};
|
|
3368
|
-
}
|
|
3369
|
-
const _ = 13, b$1 = [0, 0, 255, 255];
|
|
3370
|
-
function p$1() {
|
|
3371
|
-
const i2 = this;
|
|
3372
|
-
function r2(t2) {
|
|
3373
|
-
return t2 && t2.istate ? (t2.total_in = t2.total_out = 0, t2.msg = null, t2.istate.mode = 7, t2.istate.blocks.reset(t2, null), 0) : e$1;
|
|
3374
|
-
}
|
|
3375
|
-
i2.mode = 0, i2.method = 0, i2.was = [0], i2.need = 0, i2.marker = 0, i2.wbits = 0, i2.inflateEnd = function(e2) {
|
|
3376
|
-
return i2.blocks && i2.blocks.free(e2), i2.blocks = null, 0;
|
|
3377
|
-
}, i2.inflateInit = function(t2, n2) {
|
|
3378
|
-
return t2.msg = null, i2.blocks = null, n2 < 8 || n2 > 15 ? (i2.inflateEnd(t2), e$1) : (i2.wbits = n2, t2.istate.blocks = new w$1(t2, 1 << n2), r2(t2), 0);
|
|
3379
|
-
}, i2.inflate = function(i3, r3) {
|
|
3380
|
-
let a2, s2;
|
|
3381
|
-
if (!i3 || !i3.istate || !i3.next_in) return e$1;
|
|
3382
|
-
const o2 = i3.istate;
|
|
3383
|
-
for (r3 = 4 == r3 ? n$1 : 0, a2 = n$1; ; ) switch (o2.mode) {
|
|
3384
|
-
case 0:
|
|
3385
|
-
if (0 === i3.avail_in) return a2;
|
|
3386
|
-
if (a2 = r3, i3.avail_in--, i3.total_in++, 8 != (15 & (o2.method = i3.read_byte(i3.next_in_index++)))) {
|
|
3387
|
-
o2.mode = _, i3.msg = "unknown compression method", o2.marker = 5;
|
|
3388
|
-
break;
|
|
3389
|
-
}
|
|
3390
|
-
if (8 + (o2.method >> 4) > o2.wbits) {
|
|
3391
|
-
o2.mode = _, i3.msg = "invalid win size", o2.marker = 5;
|
|
3392
|
-
break;
|
|
3393
|
-
}
|
|
3394
|
-
o2.mode = 1;
|
|
3395
|
-
case 1:
|
|
3396
|
-
if (0 === i3.avail_in) return a2;
|
|
3397
|
-
if (a2 = r3, i3.avail_in--, i3.total_in++, s2 = 255 & i3.read_byte(i3.next_in_index++), ((o2.method << 8) + s2) % 31 != 0) {
|
|
3398
|
-
o2.mode = _, i3.msg = "incorrect header check", o2.marker = 5;
|
|
3399
|
-
break;
|
|
3400
|
-
}
|
|
3401
|
-
if (!(32 & s2)) {
|
|
3402
|
-
o2.mode = 7;
|
|
3403
|
-
break;
|
|
3404
|
-
}
|
|
3405
|
-
o2.mode = 2;
|
|
3406
|
-
case 2:
|
|
3407
|
-
if (0 === i3.avail_in) return a2;
|
|
3408
|
-
a2 = r3, i3.avail_in--, i3.total_in++, o2.need = (255 & i3.read_byte(i3.next_in_index++)) << 24 & 4278190080, o2.mode = 3;
|
|
3409
|
-
case 3:
|
|
3410
|
-
if (0 === i3.avail_in) return a2;
|
|
3411
|
-
a2 = r3, i3.avail_in--, i3.total_in++, o2.need += (255 & i3.read_byte(i3.next_in_index++)) << 16 & 16711680, o2.mode = 4;
|
|
3412
|
-
case 4:
|
|
3413
|
-
if (0 === i3.avail_in) return a2;
|
|
3414
|
-
a2 = r3, i3.avail_in--, i3.total_in++, o2.need += (255 & i3.read_byte(i3.next_in_index++)) << 8 & 65280, o2.mode = 5;
|
|
3415
|
-
case 5:
|
|
3416
|
-
return 0 === i3.avail_in ? a2 : (a2 = r3, i3.avail_in--, i3.total_in++, o2.need += 255 & i3.read_byte(i3.next_in_index++), o2.mode = 6, 2);
|
|
3417
|
-
case 6:
|
|
3418
|
-
return o2.mode = _, i3.msg = "need dictionary", o2.marker = 0, e$1;
|
|
3419
|
-
case 7:
|
|
3420
|
-
if (a2 = o2.blocks.proc(i3, a2), a2 == t$1) {
|
|
3421
|
-
o2.mode = _, o2.marker = 0;
|
|
3422
|
-
break;
|
|
3423
|
-
}
|
|
3424
|
-
if (0 == a2 && (a2 = r3), 1 != a2) return a2;
|
|
3425
|
-
a2 = r3, o2.blocks.reset(i3, o2.was), o2.mode = 12;
|
|
3426
|
-
case 12:
|
|
3427
|
-
return i3.avail_in = 0, 1;
|
|
3428
|
-
case _:
|
|
3429
|
-
return t$1;
|
|
3430
|
-
default:
|
|
3431
|
-
return e$1;
|
|
3432
|
-
}
|
|
3433
|
-
}, i2.inflateSetDictionary = function(t2, n2, i3) {
|
|
3434
|
-
let r3 = 0, a2 = i3;
|
|
3435
|
-
if (!t2 || !t2.istate || 6 != t2.istate.mode) return e$1;
|
|
3436
|
-
const s2 = t2.istate;
|
|
3437
|
-
return a2 >= 1 << s2.wbits && (a2 = (1 << s2.wbits) - 1, r3 = i3 - a2), s2.blocks.set_dictionary(n2, r3, a2), s2.mode = 7, 0;
|
|
3438
|
-
}, i2.inflateSync = function(i3) {
|
|
3439
|
-
let a2, s2, o2, l2, c;
|
|
3440
|
-
if (!i3 || !i3.istate) return e$1;
|
|
3441
|
-
const u = i3.istate;
|
|
3442
|
-
if (u.mode != _ && (u.mode = _, u.marker = 0), 0 === (a2 = i3.avail_in)) return n$1;
|
|
3443
|
-
for (s2 = i3.next_in_index, o2 = u.marker; 0 !== a2 && o2 < 4; ) i3.read_byte(s2) == b$1[o2] ? o2++ : o2 = 0 !== i3.read_byte(s2) ? 0 : 4 - o2, s2++, a2--;
|
|
3444
|
-
return i3.total_in += s2 - i3.next_in_index, i3.next_in_index = s2, i3.avail_in = a2, u.marker = o2, 4 != o2 ? t$1 : (l2 = i3.total_in, c = i3.total_out, r2(i3), i3.total_in = l2, i3.total_out = c, u.mode = 7, 0);
|
|
3445
|
-
}, i2.inflateSyncPoint = function(t2) {
|
|
3446
|
-
return t2 && t2.istate && t2.istate.blocks ? t2.istate.blocks.sync_point() : e$1;
|
|
3447
|
-
};
|
|
3448
|
-
}
|
|
3449
|
-
function m$1() {
|
|
3450
|
-
}
|
|
3451
|
-
m$1.prototype = { inflateInit(e2) {
|
|
3452
|
-
const t2 = this;
|
|
3453
|
-
return t2.istate = new p$1(), e2 || (e2 = 15), t2.istate.inflateInit(t2, e2);
|
|
3454
|
-
}, inflate(t2) {
|
|
3455
|
-
const n2 = this;
|
|
3456
|
-
return n2.istate ? n2.istate.inflate(n2, t2) : e$1;
|
|
3457
|
-
}, inflateEnd() {
|
|
3458
|
-
const t2 = this;
|
|
3459
|
-
if (!t2.istate) return e$1;
|
|
3460
|
-
const n2 = t2.istate.inflateEnd(t2);
|
|
3461
|
-
return t2.istate = null, n2;
|
|
3462
|
-
}, inflateSync() {
|
|
3463
|
-
const t2 = this;
|
|
3464
|
-
return t2.istate ? t2.istate.inflateSync(t2) : e$1;
|
|
3465
|
-
}, inflateSetDictionary(t2, n2) {
|
|
3466
|
-
const i2 = this;
|
|
3467
|
-
return i2.istate ? i2.istate.inflateSetDictionary(i2, t2, n2) : e$1;
|
|
3468
|
-
}, read_byte(e2) {
|
|
3469
|
-
return this.next_in[e2];
|
|
3470
|
-
}, read_buf(e2, t2) {
|
|
3471
|
-
return this.next_in.subarray(e2, e2 + t2);
|
|
3472
|
-
} };
|
|
3473
|
-
const g$1 = 4294967295, y$1 = 65535, x$1 = 33639248, k$1 = 101075792, v$1 = 22, S = void 0, z$1 = "undefined", A$1 = "function";
|
|
3474
|
-
let U$1 = class U {
|
|
3475
|
-
constructor(e2) {
|
|
3476
|
-
return class extends TransformStream {
|
|
3477
|
-
constructor(t2, n2) {
|
|
3478
|
-
const i2 = new e2(n2);
|
|
3479
|
-
super({ transform(e3, t3) {
|
|
3480
|
-
t3.enqueue(i2.append(e3));
|
|
3481
|
-
}, flush(e3) {
|
|
3482
|
-
const t3 = i2.flush();
|
|
3483
|
-
t3 && e3.enqueue(t3);
|
|
3484
|
-
} });
|
|
3485
|
-
}
|
|
3486
|
-
};
|
|
3487
|
-
}
|
|
3488
|
-
};
|
|
3489
|
-
let D = 2;
|
|
3088
|
+
const e$1 = 4294967295, t$1 = 65535, r$1 = 134695760, n$1 = r$1, s$1 = 33639248, a$1 = 101075792, i$1 = 22, o$1 = 16384, c$1 = void 0, l$1 = 1 / 0, u$1 = "undefined", d$1 = "function";
|
|
3089
|
+
let f$1 = 2;
|
|
3490
3090
|
try {
|
|
3491
|
-
typeof navigator !=
|
|
3492
|
-
} catch
|
|
3091
|
+
typeof navigator != u$1 && navigator.hardwareConcurrency && (f$1 = navigator.hardwareConcurrency);
|
|
3092
|
+
} catch {
|
|
3493
3093
|
}
|
|
3494
|
-
const
|
|
3495
|
-
function
|
|
3496
|
-
const {
|
|
3497
|
-
|
|
3498
|
-
const { deflate: e3, inflate: t3 } = d;
|
|
3499
|
-
if ((e3 || t3) && (T$1.workerScripts || (T$1.workerScripts = {})), e3) {
|
|
3500
|
-
if (!Array.isArray(e3)) throw new Error("workerScripts.deflate must be an array");
|
|
3501
|
-
T$1.workerScripts.deflate = e3;
|
|
3502
|
-
}
|
|
3503
|
-
if (t3) {
|
|
3504
|
-
if (!Array.isArray(t3)) throw new Error("workerScripts.inflate must be an array");
|
|
3505
|
-
T$1.workerScripts.inflate = t3;
|
|
3506
|
-
}
|
|
3507
|
-
}
|
|
3094
|
+
const h$1 = { workerURI: "./core/web-worker-wasm.js", wasmURI: "./core/streams/zlib-wasm/zlib-streams.wasm", chunkSize: 65536, maxWorkers: f$1, terminateWorkerTimeout: 5e3, useWebWorkers: true, useCompressionStream: true, CompressionStream: typeof CompressionStream != u$1 && CompressionStream, DecompressionStream: typeof DecompressionStream != u$1 && DecompressionStream }, p$1 = Object.assign({}, h$1);
|
|
3095
|
+
function w$1(e2) {
|
|
3096
|
+
const { baseURI: t2, chunkSize: r2, maxWorkers: n2, terminateWorkerTimeout: s2, useCompressionStream: a2, useWebWorkers: i2, CompressionStream: o2, DecompressionStream: c, CompressionStreamZlib: l2, DecompressionStreamZlib: u, workerURI: d, wasmURI: f2 } = e2;
|
|
3097
|
+
g$1("baseURI", t2), g$1("wasmURI", f2), g$1("workerURI", d), g$1("chunkSize", r2), g$1("maxWorkers", n2), g$1("terminateWorkerTimeout", s2), g$1("useCompressionStream", a2), g$1("useWebWorkers", i2), g$1("CompressionStream", o2), g$1("DecompressionStream", c), g$1("CompressionStreamZlib", l2), g$1("DecompressionStreamZlib", u);
|
|
3508
3098
|
}
|
|
3509
|
-
function
|
|
3510
|
-
t2 !==
|
|
3099
|
+
function g$1(e2, t2) {
|
|
3100
|
+
t2 !== c$1 && (p$1[e2] = t2);
|
|
3511
3101
|
}
|
|
3512
|
-
const
|
|
3102
|
+
const m$1 = [];
|
|
3513
3103
|
for (let e2 = 0; e2 < 256; e2++) {
|
|
3514
3104
|
let t2 = e2;
|
|
3515
3105
|
for (let e3 = 0; e3 < 8; e3++) 1 & t2 ? t2 = t2 >>> 1 ^ 3988292384 : t2 >>>= 1;
|
|
3516
|
-
|
|
3106
|
+
m$1[e2] = t2;
|
|
3517
3107
|
}
|
|
3518
|
-
class
|
|
3108
|
+
let y$1 = class y {
|
|
3519
3109
|
constructor(e2) {
|
|
3520
3110
|
this.crc = e2 || -1;
|
|
3521
3111
|
}
|
|
3522
3112
|
append(e2) {
|
|
3523
3113
|
let t2 = 0 | this.crc;
|
|
3524
|
-
for (let
|
|
3114
|
+
for (let r2 = 0, n2 = 0 | e2.length; r2 < n2; r2++) t2 = t2 >>> 8 ^ m$1[255 & (t2 ^ e2[r2])];
|
|
3525
3115
|
this.crc = t2;
|
|
3526
3116
|
}
|
|
3527
3117
|
get() {
|
|
3528
3118
|
return ~this.crc;
|
|
3529
3119
|
}
|
|
3530
|
-
}
|
|
3531
|
-
class
|
|
3120
|
+
};
|
|
3121
|
+
let b$1 = class b extends TransformStream {
|
|
3532
3122
|
constructor() {
|
|
3533
3123
|
let e2;
|
|
3534
|
-
const t2 = new
|
|
3535
|
-
super({ transform(e3,
|
|
3536
|
-
t2.append(e3),
|
|
3124
|
+
const t2 = new y$1();
|
|
3125
|
+
super({ transform(e3, r2) {
|
|
3126
|
+
t2.append(e3), r2.enqueue(e3);
|
|
3537
3127
|
}, flush() {
|
|
3538
|
-
const
|
|
3539
|
-
new DataView(
|
|
3128
|
+
const r2 = new Uint8Array(4);
|
|
3129
|
+
new DataView(r2.buffer).setUint32(0, t2.get()), e2.value = r2;
|
|
3540
3130
|
} }), e2 = this;
|
|
3541
3131
|
}
|
|
3542
|
-
}
|
|
3543
|
-
const
|
|
3132
|
+
};
|
|
3133
|
+
const S = { concat(e2, t2) {
|
|
3544
3134
|
if (0 === e2.length || 0 === t2.length) return e2.concat(t2);
|
|
3545
|
-
const
|
|
3546
|
-
return 32 ===
|
|
3135
|
+
const r2 = e2[e2.length - 1], n2 = S.getPartial(r2);
|
|
3136
|
+
return 32 === n2 ? e2.concat(t2) : S._shiftRight(t2, n2, 0 | r2, e2.slice(0, e2.length - 1));
|
|
3547
3137
|
}, bitLength(e2) {
|
|
3548
3138
|
const t2 = e2.length;
|
|
3549
3139
|
if (0 === t2) return 0;
|
|
3550
|
-
const
|
|
3551
|
-
return 32 * (t2 - 1) +
|
|
3140
|
+
const r2 = e2[t2 - 1];
|
|
3141
|
+
return 32 * (t2 - 1) + S.getPartial(r2);
|
|
3552
3142
|
}, clamp(e2, t2) {
|
|
3553
3143
|
if (32 * e2.length < t2) return e2;
|
|
3554
|
-
const
|
|
3555
|
-
return t2 &= 31,
|
|
3556
|
-
}, partial: (e2, t2,
|
|
3557
|
-
for (void 0 ===
|
|
3558
|
-
if (0 === t2) return
|
|
3559
|
-
for (let
|
|
3560
|
-
const
|
|
3561
|
-
return
|
|
3562
|
-
} },
|
|
3563
|
-
const t2 =
|
|
3564
|
-
let
|
|
3565
|
-
for (let
|
|
3566
|
-
return
|
|
3144
|
+
const r2 = (e2 = e2.slice(0, Math.ceil(t2 / 32))).length;
|
|
3145
|
+
return t2 &= 31, r2 > 0 && t2 && (e2[r2 - 1] = S.partial(t2, e2[r2 - 1] & 2147483648 >> t2 - 1, 1)), e2;
|
|
3146
|
+
}, partial: (e2, t2, r2) => 32 === e2 ? t2 : (r2 ? 0 | t2 : t2 << 32 - e2) + 1099511627776 * e2, getPartial: (e2) => Math.round(e2 / 1099511627776) || 32, _shiftRight(e2, t2, r2, n2) {
|
|
3147
|
+
for (void 0 === n2 && (n2 = []); t2 >= 32; t2 -= 32) n2.push(r2), r2 = 0;
|
|
3148
|
+
if (0 === t2) return n2.concat(e2);
|
|
3149
|
+
for (let s3 = 0; s3 < e2.length; s3++) n2.push(r2 | e2[s3] >>> t2), r2 = e2[s3] << 32 - t2;
|
|
3150
|
+
const s2 = e2.length ? e2[e2.length - 1] : 0, a2 = S.getPartial(s2);
|
|
3151
|
+
return n2.push(S.partial(t2 + a2 & 31, t2 + a2 > 32 ? r2 : n2.pop(), 1)), n2;
|
|
3152
|
+
} }, k$1 = { bytes: { fromBits(e2) {
|
|
3153
|
+
const t2 = S.bitLength(e2) / 8, r2 = new Uint8Array(t2);
|
|
3154
|
+
let n2;
|
|
3155
|
+
for (let s2 = 0; s2 < t2; s2++) 3 & s2 || (n2 = e2[s2 / 4]), r2[s2] = n2 >>> 24, n2 <<= 8;
|
|
3156
|
+
return r2;
|
|
3567
3157
|
}, toBits(e2) {
|
|
3568
3158
|
const t2 = [];
|
|
3569
|
-
let
|
|
3570
|
-
for (
|
|
3571
|
-
return 3 &
|
|
3572
|
-
} } },
|
|
3159
|
+
let r2, n2 = 0;
|
|
3160
|
+
for (r2 = 0; r2 < e2.length; r2++) n2 = n2 << 8 | e2[r2], 3 & ~r2 || (t2.push(n2), n2 = 0);
|
|
3161
|
+
return 3 & r2 && t2.push(S.partial(8 * (3 & r2), n2)), t2;
|
|
3162
|
+
} } }, z$1 = { sha1: class {
|
|
3573
3163
|
constructor(e2) {
|
|
3574
3164
|
const t2 = this;
|
|
3575
3165
|
t2.blockSize = 512, t2._init = [1732584193, 4023233417, 2562383102, 271733878, 3285377520], t2._key = [1518500249, 1859775393, 2400959708, 3395469782], e2 ? (t2._h = e2._h.slice(0), t2._buffer = e2._buffer.slice(0), t2._length = e2._length) : t2.reset();
|
|
@@ -3580,54 +3170,54 @@ const M = { concat(e2, t2) {
|
|
|
3580
3170
|
}
|
|
3581
3171
|
update(e2) {
|
|
3582
3172
|
const t2 = this;
|
|
3583
|
-
"string" == typeof e2 && (e2 =
|
|
3584
|
-
const
|
|
3585
|
-
if (
|
|
3586
|
-
const a2 = new Uint32Array(
|
|
3587
|
-
let
|
|
3588
|
-
for (let e3 = t2.blockSize +
|
|
3589
|
-
return
|
|
3173
|
+
"string" == typeof e2 && (e2 = k$1.utf8String.toBits(e2));
|
|
3174
|
+
const r2 = t2._buffer = S.concat(t2._buffer, e2), n2 = t2._length, s2 = t2._length = n2 + S.bitLength(e2);
|
|
3175
|
+
if (s2 > 9007199254740991) throw new Error("Cannot hash more than 2^53 - 1 bits");
|
|
3176
|
+
const a2 = new Uint32Array(r2);
|
|
3177
|
+
let i2 = 0;
|
|
3178
|
+
for (let e3 = t2.blockSize + n2 - (t2.blockSize + n2 & t2.blockSize - 1); e3 <= s2; e3 += t2.blockSize) t2._block(a2.subarray(16 * i2, 16 * (i2 + 1))), i2 += 1;
|
|
3179
|
+
return r2.splice(0, 16 * i2), t2;
|
|
3590
3180
|
}
|
|
3591
3181
|
finalize() {
|
|
3592
3182
|
const e2 = this;
|
|
3593
3183
|
let t2 = e2._buffer;
|
|
3594
|
-
const
|
|
3595
|
-
t2 =
|
|
3184
|
+
const r2 = e2._h;
|
|
3185
|
+
t2 = S.concat(t2, [S.partial(1, 1)]);
|
|
3596
3186
|
for (let e3 = t2.length + 2; 15 & e3; e3++) t2.push(0);
|
|
3597
3187
|
for (t2.push(Math.floor(e2._length / 4294967296)), t2.push(0 | e2._length); t2.length; ) e2._block(t2.splice(0, 16));
|
|
3598
|
-
return e2.reset(),
|
|
3188
|
+
return e2.reset(), r2;
|
|
3599
3189
|
}
|
|
3600
|
-
_f(e2, t2,
|
|
3601
|
-
return e2 <= 19 ? t2 &
|
|
3190
|
+
_f(e2, t2, r2, n2) {
|
|
3191
|
+
return e2 <= 19 ? t2 & r2 | ~t2 & n2 : e2 <= 39 ? t2 ^ r2 ^ n2 : e2 <= 59 ? t2 & r2 | t2 & n2 | r2 & n2 : e2 <= 79 ? t2 ^ r2 ^ n2 : void 0;
|
|
3602
3192
|
}
|
|
3603
3193
|
_S(e2, t2) {
|
|
3604
3194
|
return t2 << e2 | t2 >>> 32 - e2;
|
|
3605
3195
|
}
|
|
3606
3196
|
_block(e2) {
|
|
3607
|
-
const t2 = this,
|
|
3608
|
-
for (let t3 = 0; t3 < 16; t3++)
|
|
3609
|
-
let
|
|
3197
|
+
const t2 = this, r2 = t2._h, n2 = Array(80);
|
|
3198
|
+
for (let t3 = 0; t3 < 16; t3++) n2[t3] = e2[t3];
|
|
3199
|
+
let s2 = r2[0], a2 = r2[1], i2 = r2[2], o2 = r2[3], c = r2[4];
|
|
3610
3200
|
for (let e3 = 0; e3 <= 79; e3++) {
|
|
3611
|
-
e3 >= 16 && (
|
|
3612
|
-
const
|
|
3613
|
-
|
|
3201
|
+
e3 >= 16 && (n2[e3] = t2._S(1, n2[e3 - 3] ^ n2[e3 - 8] ^ n2[e3 - 14] ^ n2[e3 - 16]));
|
|
3202
|
+
const r3 = t2._S(5, s2) + t2._f(e3, a2, i2, o2) + c + n2[e3] + t2._key[Math.floor(e3 / 20)] | 0;
|
|
3203
|
+
c = o2, o2 = i2, i2 = t2._S(30, a2), a2 = s2, s2 = r3;
|
|
3614
3204
|
}
|
|
3615
|
-
|
|
3205
|
+
r2[0] = r2[0] + s2 | 0, r2[1] = r2[1] + a2 | 0, r2[2] = r2[2] + i2 | 0, r2[3] = r2[3] + o2 | 0, r2[4] = r2[4] + c | 0;
|
|
3616
3206
|
}
|
|
3617
|
-
} },
|
|
3207
|
+
} }, x$1 = { aes: class {
|
|
3618
3208
|
constructor(e2) {
|
|
3619
3209
|
const t2 = this;
|
|
3620
3210
|
t2._tables = [[[], [], [], [], []], [[], [], [], [], []]], t2._tables[0][0][0] || t2._precompute();
|
|
3621
|
-
const
|
|
3622
|
-
let a2,
|
|
3623
|
-
if (4 !==
|
|
3624
|
-
for (t2._key = [
|
|
3625
|
-
let e3 =
|
|
3626
|
-
(a2 %
|
|
3211
|
+
const r2 = t2._tables[0][4], n2 = t2._tables[1], s2 = e2.length;
|
|
3212
|
+
let a2, i2, o2, c = 1;
|
|
3213
|
+
if (4 !== s2 && 6 !== s2 && 8 !== s2) throw new Error("invalid aes key size");
|
|
3214
|
+
for (t2._key = [i2 = e2.slice(0), o2 = []], a2 = s2; a2 < 4 * s2 + 28; a2++) {
|
|
3215
|
+
let e3 = i2[a2 - 1];
|
|
3216
|
+
(a2 % s2 === 0 || 8 === s2 && a2 % s2 === 4) && (e3 = r2[e3 >>> 24] << 24 ^ r2[e3 >> 16 & 255] << 16 ^ r2[e3 >> 8 & 255] << 8 ^ r2[255 & e3], a2 % s2 === 0 && (e3 = e3 << 8 ^ e3 >>> 24 ^ c << 24, c = c << 1 ^ 283 * (c >> 7))), i2[a2] = i2[a2 - s2] ^ e3;
|
|
3627
3217
|
}
|
|
3628
3218
|
for (let e3 = 0; a2; e3++, a2--) {
|
|
3629
|
-
const t3 =
|
|
3630
|
-
o2[e3] = a2 <= 4 || e3 < 4 ? t3 :
|
|
3219
|
+
const t3 = i2[3 & e3 ? a2 : a2 - 4];
|
|
3220
|
+
o2[e3] = a2 <= 4 || e3 < 4 ? t3 : n2[0][r2[t3 >>> 24]] ^ n2[1][r2[t3 >> 16 & 255]] ^ n2[2][r2[t3 >> 8 & 255]] ^ n2[3][r2[255 & t3]];
|
|
3631
3221
|
}
|
|
3632
3222
|
}
|
|
3633
3223
|
encrypt(e2) {
|
|
@@ -3637,40 +3227,40 @@ const M = { concat(e2, t2) {
|
|
|
3637
3227
|
return this._crypt(e2, 1);
|
|
3638
3228
|
}
|
|
3639
3229
|
_precompute() {
|
|
3640
|
-
const e2 = this._tables[0], t2 = this._tables[1],
|
|
3641
|
-
let
|
|
3642
|
-
for (let e3 = 0; e3 < 256; e3++) a2[(
|
|
3643
|
-
for (let u =
|
|
3644
|
-
let a3 =
|
|
3645
|
-
a3 = a3 >> 8 ^ 255 & a3 ^ 99,
|
|
3646
|
-
let d = 16843009 *
|
|
3647
|
-
for (let
|
|
3230
|
+
const e2 = this._tables[0], t2 = this._tables[1], r2 = e2[4], n2 = t2[4], s2 = [], a2 = [];
|
|
3231
|
+
let i2, o2, c, l2;
|
|
3232
|
+
for (let e3 = 0; e3 < 256; e3++) a2[(s2[e3] = e3 << 1 ^ 283 * (e3 >> 7)) ^ e3] = e3;
|
|
3233
|
+
for (let u = i2 = 0; !r2[u]; u ^= o2 || 1, i2 = a2[i2] || 1) {
|
|
3234
|
+
let a3 = i2 ^ i2 << 1 ^ i2 << 2 ^ i2 << 3 ^ i2 << 4;
|
|
3235
|
+
a3 = a3 >> 8 ^ 255 & a3 ^ 99, r2[u] = a3, n2[a3] = u, l2 = s2[c = s2[o2 = s2[u]]];
|
|
3236
|
+
let d = 16843009 * l2 ^ 65537 * c ^ 257 * o2 ^ 16843008 * u, f2 = 257 * s2[a3] ^ 16843008 * a3;
|
|
3237
|
+
for (let r3 = 0; r3 < 4; r3++) e2[r3][u] = f2 = f2 << 24 ^ f2 >>> 8, t2[r3][a3] = d = d << 24 ^ d >>> 8;
|
|
3648
3238
|
}
|
|
3649
|
-
for (let
|
|
3239
|
+
for (let r3 = 0; r3 < 5; r3++) e2[r3] = e2[r3].slice(0), t2[r3] = t2[r3].slice(0);
|
|
3650
3240
|
}
|
|
3651
3241
|
_crypt(e2, t2) {
|
|
3652
3242
|
if (4 !== e2.length) throw new Error("invalid aes block size");
|
|
3653
|
-
const
|
|
3654
|
-
let d, f2, h2,
|
|
3655
|
-
for (let e3 = 0; e3 <
|
|
3656
|
-
for (let e3 = 0; e3 < 4; e3++)
|
|
3657
|
-
return
|
|
3658
|
-
}
|
|
3659
|
-
} },
|
|
3660
|
-
const t2 = new Uint32Array(e2.buffer),
|
|
3243
|
+
const r2 = this._key[t2], n2 = r2.length / 4 - 2, s2 = [0, 0, 0, 0], a2 = this._tables[t2], i2 = a2[0], o2 = a2[1], c = a2[2], l2 = a2[3], u = a2[4];
|
|
3244
|
+
let d, f2, h2, p2 = e2[0] ^ r2[0], w = e2[t2 ? 3 : 1] ^ r2[1], g2 = e2[2] ^ r2[2], m2 = e2[t2 ? 1 : 3] ^ r2[3], y3 = 4;
|
|
3245
|
+
for (let e3 = 0; e3 < n2; e3++) d = i2[p2 >>> 24] ^ o2[w >> 16 & 255] ^ c[g2 >> 8 & 255] ^ l2[255 & m2] ^ r2[y3], f2 = i2[w >>> 24] ^ o2[g2 >> 16 & 255] ^ c[m2 >> 8 & 255] ^ l2[255 & p2] ^ r2[y3 + 1], h2 = i2[g2 >>> 24] ^ o2[m2 >> 16 & 255] ^ c[p2 >> 8 & 255] ^ l2[255 & w] ^ r2[y3 + 2], m2 = i2[m2 >>> 24] ^ o2[p2 >> 16 & 255] ^ c[w >> 8 & 255] ^ l2[255 & g2] ^ r2[y3 + 3], y3 += 4, p2 = d, w = f2, g2 = h2;
|
|
3246
|
+
for (let e3 = 0; e3 < 4; e3++) s2[t2 ? 3 & -e3 : e3] = u[p2 >>> 24] << 24 ^ u[w >> 16 & 255] << 16 ^ u[g2 >> 8 & 255] << 8 ^ u[255 & m2] ^ r2[y3++], d = p2, p2 = w, w = g2, g2 = m2, m2 = d;
|
|
3247
|
+
return s2;
|
|
3248
|
+
}
|
|
3249
|
+
} }, U$1 = { getRandomValues(e2) {
|
|
3250
|
+
const t2 = new Uint32Array(e2.buffer), r2 = (e3) => {
|
|
3661
3251
|
let t3 = 987654321;
|
|
3662
|
-
const
|
|
3252
|
+
const r3 = 4294967295;
|
|
3663
3253
|
return function() {
|
|
3664
|
-
t3 = 36969 * (65535 & t3) + (t3 >> 16) &
|
|
3665
|
-
return (((t3 << 16) + (e3 = 18e3 * (65535 & e3) + (e3 >> 16) &
|
|
3254
|
+
t3 = 36969 * (65535 & t3) + (t3 >> 16) & r3;
|
|
3255
|
+
return (((t3 << 16) + (e3 = 18e3 * (65535 & e3) + (e3 >> 16) & r3) & r3) / 4294967296 + 0.5) * (Math.random() > 0.5 ? 1 : -1);
|
|
3666
3256
|
};
|
|
3667
3257
|
};
|
|
3668
|
-
for (let
|
|
3669
|
-
const e3 =
|
|
3670
|
-
|
|
3258
|
+
for (let n2, s2 = 0; s2 < e2.length; s2 += 4) {
|
|
3259
|
+
const e3 = r2(4294967296 * (n2 || Math.random()));
|
|
3260
|
+
n2 = 987654071 * e3(), t2[s2 / 4] = 4294967296 * e3() | 0;
|
|
3671
3261
|
}
|
|
3672
3262
|
return e2;
|
|
3673
|
-
} },
|
|
3263
|
+
} }, A$1 = { ctrGladman: class {
|
|
3674
3264
|
constructor(e2, t2) {
|
|
3675
3265
|
this._prf = e2, this._initIv = t2, this._iv = t2;
|
|
3676
3266
|
}
|
|
@@ -3683,45 +3273,45 @@ const M = { concat(e2, t2) {
|
|
|
3683
3273
|
incWord(e2) {
|
|
3684
3274
|
if (255 & ~(e2 >> 24)) e2 += 1 << 24;
|
|
3685
3275
|
else {
|
|
3686
|
-
let t2 = e2 >> 16 & 255,
|
|
3687
|
-
255 === t2 ? (t2 = 0, 255 ===
|
|
3276
|
+
let t2 = e2 >> 16 & 255, r2 = e2 >> 8 & 255, n2 = 255 & e2;
|
|
3277
|
+
255 === t2 ? (t2 = 0, 255 === r2 ? (r2 = 0, 255 === n2 ? n2 = 0 : ++n2) : ++r2) : ++t2, e2 = 0, e2 += t2 << 16, e2 += r2 << 8, e2 += n2;
|
|
3688
3278
|
}
|
|
3689
3279
|
return e2;
|
|
3690
3280
|
}
|
|
3691
3281
|
incCounter(e2) {
|
|
3692
3282
|
0 === (e2[0] = this.incWord(e2[0])) && (e2[1] = this.incWord(e2[1]));
|
|
3693
3283
|
}
|
|
3694
|
-
calculate(e2, t2,
|
|
3695
|
-
let
|
|
3696
|
-
if (!(
|
|
3697
|
-
const
|
|
3698
|
-
for (let
|
|
3699
|
-
this.incCounter(
|
|
3700
|
-
const
|
|
3701
|
-
t2[
|
|
3702
|
-
}
|
|
3703
|
-
return
|
|
3704
|
-
}
|
|
3705
|
-
} },
|
|
3706
|
-
if (
|
|
3707
|
-
const
|
|
3708
|
-
let a2,
|
|
3709
|
-
const u = new ArrayBuffer(
|
|
3284
|
+
calculate(e2, t2, r2) {
|
|
3285
|
+
let n2;
|
|
3286
|
+
if (!(n2 = t2.length)) return [];
|
|
3287
|
+
const s2 = S.bitLength(t2);
|
|
3288
|
+
for (let s3 = 0; s3 < n2; s3 += 4) {
|
|
3289
|
+
this.incCounter(r2);
|
|
3290
|
+
const n3 = e2.encrypt(r2);
|
|
3291
|
+
t2[s3] ^= n3[0], t2[s3 + 1] ^= n3[1], t2[s3 + 2] ^= n3[2], t2[s3 + 3] ^= n3[3];
|
|
3292
|
+
}
|
|
3293
|
+
return S.clamp(t2, s2);
|
|
3294
|
+
}
|
|
3295
|
+
} }, v$1 = { importKey: (e2) => new v$1.hmacSha1(k$1.bytes.toBits(e2)), pbkdf2(e2, t2, r2, n2) {
|
|
3296
|
+
if (r2 = r2 || 1e4, n2 < 0 || r2 < 0) throw new Error("invalid params to pbkdf2");
|
|
3297
|
+
const s2 = 1 + (n2 >> 5) << 2;
|
|
3298
|
+
let a2, i2, o2, c, l2;
|
|
3299
|
+
const u = new ArrayBuffer(s2), d = new DataView(u);
|
|
3710
3300
|
let f2 = 0;
|
|
3711
|
-
const h2 =
|
|
3712
|
-
for (t2 =
|
|
3713
|
-
for (a2 =
|
|
3714
|
-
for (o2 = 0; f2 < (
|
|
3301
|
+
const h2 = S;
|
|
3302
|
+
for (t2 = k$1.bytes.toBits(t2), l2 = 1; f2 < (s2 || 1); l2++) {
|
|
3303
|
+
for (a2 = i2 = e2.encrypt(h2.concat(t2, [l2])), o2 = 1; o2 < r2; o2++) for (i2 = e2.encrypt(i2), c = 0; c < i2.length; c++) a2[c] ^= i2[c];
|
|
3304
|
+
for (o2 = 0; f2 < (s2 || 1) && o2 < a2.length; o2++) d.setInt32(f2, a2[o2]), f2 += 4;
|
|
3715
3305
|
}
|
|
3716
|
-
return u.slice(0,
|
|
3306
|
+
return u.slice(0, n2 / 8);
|
|
3717
3307
|
}, hmacSha1: class {
|
|
3718
3308
|
constructor(e2) {
|
|
3719
|
-
const t2 = this,
|
|
3720
|
-
t2._baseHash = [new
|
|
3721
|
-
const
|
|
3722
|
-
e2.length >
|
|
3723
|
-
for (let t3 = 0; t3 <
|
|
3724
|
-
t2._baseHash[0].update(
|
|
3309
|
+
const t2 = this, r2 = t2._hash = z$1.sha1, n2 = [[], []];
|
|
3310
|
+
t2._baseHash = [new r2(), new r2()];
|
|
3311
|
+
const s2 = t2._baseHash[0].blockSize / 32;
|
|
3312
|
+
e2.length > s2 && (e2 = new r2().update(e2).finalize());
|
|
3313
|
+
for (let t3 = 0; t3 < s2; t3++) n2[0][t3] = 909522486 ^ e2[t3], n2[1][t3] = 1549556828 ^ e2[t3];
|
|
3314
|
+
t2._baseHash[0].update(n2[0]), t2._baseHash[1].update(n2[1]), t2._resultHash = new r2(t2._baseHash[0]);
|
|
3725
3315
|
}
|
|
3726
3316
|
reset() {
|
|
3727
3317
|
const e2 = this;
|
|
@@ -3731,449 +3321,470 @@ const M = { concat(e2, t2) {
|
|
|
3731
3321
|
this._updated = true, this._resultHash.update(e2);
|
|
3732
3322
|
}
|
|
3733
3323
|
digest() {
|
|
3734
|
-
const e2 = this, t2 = e2._resultHash.finalize(),
|
|
3735
|
-
return e2.reset(),
|
|
3324
|
+
const e2 = this, t2 = e2._resultHash.finalize(), r2 = new e2._hash(e2._baseHash[1]).update(t2).finalize();
|
|
3325
|
+
return e2.reset(), r2;
|
|
3736
3326
|
}
|
|
3737
3327
|
encrypt(e2) {
|
|
3738
3328
|
if (this._updated) throw new Error("encrypt on already updated hmac called!");
|
|
3739
3329
|
return this.update(e2), this.digest(e2);
|
|
3740
3330
|
}
|
|
3741
|
-
} },
|
|
3742
|
-
function
|
|
3743
|
-
return
|
|
3331
|
+
} }, D$1 = typeof crypto != u$1 && typeof crypto.getRandomValues == d$1, _ = "Invalid password", F = "Invalid signature", O = "zipjs-abort-check-password";
|
|
3332
|
+
function E$1(e2) {
|
|
3333
|
+
return D$1 ? crypto.getRandomValues(e2) : U$1.getRandomValues(e2);
|
|
3744
3334
|
}
|
|
3745
|
-
const
|
|
3746
|
-
let
|
|
3747
|
-
class
|
|
3748
|
-
constructor({ password: e2, rawPassword: t2, signed:
|
|
3335
|
+
const T$1 = 16, C = { name: "PBKDF2" }, R = Object.assign({ hash: { name: "HMAC" } }, C), W = Object.assign({ iterations: 1e3, hash: { name: "SHA-1" } }, C), M = ["deriveBits"], j = [8, 12, 16], I = [16, 24, 32], B = 10, P = [0, 0, 0, 0], L = typeof crypto != u$1, V = L && crypto.subtle, N = L && typeof V != u$1, Z = k$1.bytes, q = x$1.aes, H = A$1.ctrGladman, K = v$1.hmacSha1;
|
|
3336
|
+
let G = L && N && typeof V.importKey == d$1, J = L && N && typeof V.deriveBits == d$1;
|
|
3337
|
+
class Q extends TransformStream {
|
|
3338
|
+
constructor({ password: e2, rawPassword: t2, signed: r2, encryptionStrength: n2, checkPasswordOnly: s2 }) {
|
|
3749
3339
|
super({ start() {
|
|
3750
|
-
Object.assign(this, { ready: new Promise((
|
|
3340
|
+
Object.assign(this, { ready: new Promise((e3) => this.resolveReady = e3), password: ee(e2, t2), signed: r2, strength: n2 - 1, pending: new Uint8Array() });
|
|
3751
3341
|
}, async transform(e3, t3) {
|
|
3752
|
-
const
|
|
3753
|
-
|
|
3754
|
-
const
|
|
3755
|
-
if (
|
|
3756
|
-
})(
|
|
3757
|
-
const
|
|
3758
|
-
t3.enqueue(
|
|
3342
|
+
const r3 = this, { password: n3, strength: a2, resolveReady: i2, ready: o2 } = r3;
|
|
3343
|
+
n3 ? (await (async function(e4, t4, r4, n4) {
|
|
3344
|
+
const s3 = await $(e4, t4, r4, re(n4, 0, j[t4])), a3 = re(n4, j[t4]);
|
|
3345
|
+
if (s3[0] != a3[0] || s3[1] != a3[1]) throw new Error(_);
|
|
3346
|
+
})(r3, a2, n3, re(e3, 0, j[a2] + 2)), e3 = re(e3, j[a2] + 2), s2 ? t3.error(new Error(O)) : i2()) : await o2;
|
|
3347
|
+
const c = new Uint8Array(e3.length - B - (e3.length - B) % T$1);
|
|
3348
|
+
t3.enqueue(Y(r3, e3, c, 0, B, true));
|
|
3759
3349
|
}, async flush(e3) {
|
|
3760
|
-
const { signed: t3, ctr:
|
|
3761
|
-
if (
|
|
3350
|
+
const { signed: t3, ctr: r3, hmac: n3, pending: s3, ready: a2 } = this;
|
|
3351
|
+
if (n3 && r3) {
|
|
3762
3352
|
await a2;
|
|
3763
|
-
const
|
|
3764
|
-
let
|
|
3765
|
-
if (
|
|
3766
|
-
const e4 =
|
|
3767
|
-
|
|
3768
|
-
const t4 =
|
|
3769
|
-
|
|
3353
|
+
const i2 = re(s3, 0, s3.length - B), o2 = re(s3, s3.length - B);
|
|
3354
|
+
let c = new Uint8Array();
|
|
3355
|
+
if (i2.length) {
|
|
3356
|
+
const e4 = se(Z, i2);
|
|
3357
|
+
n3.update(e4);
|
|
3358
|
+
const t4 = r3.update(e4);
|
|
3359
|
+
c = ne(Z, t4);
|
|
3770
3360
|
}
|
|
3771
3361
|
if (t3) {
|
|
3772
|
-
const e4 =
|
|
3773
|
-
for (let t4 = 0; t4 <
|
|
3362
|
+
const e4 = re(ne(Z, n3.digest()), 0, B);
|
|
3363
|
+
for (let t4 = 0; t4 < B; t4++) if (e4[t4] != o2[t4]) throw new Error(F);
|
|
3774
3364
|
}
|
|
3775
|
-
e3.enqueue(
|
|
3365
|
+
e3.enqueue(c);
|
|
3776
3366
|
}
|
|
3777
3367
|
} });
|
|
3778
3368
|
}
|
|
3779
3369
|
}
|
|
3780
|
-
class
|
|
3781
|
-
constructor({ password: e2, rawPassword: t2, encryptionStrength:
|
|
3782
|
-
let
|
|
3370
|
+
class X extends TransformStream {
|
|
3371
|
+
constructor({ password: e2, rawPassword: t2, encryptionStrength: r2 }) {
|
|
3372
|
+
let n2;
|
|
3783
3373
|
super({ start() {
|
|
3784
|
-
Object.assign(this, { ready: new Promise((
|
|
3374
|
+
Object.assign(this, { ready: new Promise((e3) => this.resolveReady = e3), password: ee(e2, t2), strength: r2 - 1, pending: new Uint8Array() });
|
|
3785
3375
|
}, async transform(e3, t3) {
|
|
3786
|
-
const
|
|
3376
|
+
const r3 = this, { password: n3, strength: s2, resolveReady: a2, ready: i2 } = r3;
|
|
3787
3377
|
let o2 = new Uint8Array();
|
|
3788
|
-
|
|
3789
|
-
const
|
|
3790
|
-
return
|
|
3791
|
-
})(
|
|
3792
|
-
const
|
|
3793
|
-
|
|
3378
|
+
n3 ? (o2 = await (async function(e4, t4, r4) {
|
|
3379
|
+
const n4 = E$1(new Uint8Array(j[t4])), s3 = await $(e4, t4, r4, n4);
|
|
3380
|
+
return te(n4, s3);
|
|
3381
|
+
})(r3, s2, n3), a2()) : await i2;
|
|
3382
|
+
const c = new Uint8Array(o2.length + e3.length - e3.length % T$1);
|
|
3383
|
+
c.set(o2, 0), t3.enqueue(Y(r3, e3, c, o2.length, 0));
|
|
3794
3384
|
}, async flush(e3) {
|
|
3795
|
-
const { ctr: t3, hmac:
|
|
3796
|
-
if (
|
|
3385
|
+
const { ctr: t3, hmac: r3, pending: s2, ready: a2 } = this;
|
|
3386
|
+
if (r3 && t3) {
|
|
3797
3387
|
await a2;
|
|
3798
|
-
let
|
|
3799
|
-
if (
|
|
3800
|
-
const e4 = t3.update(
|
|
3801
|
-
|
|
3388
|
+
let i2 = new Uint8Array();
|
|
3389
|
+
if (s2.length) {
|
|
3390
|
+
const e4 = t3.update(se(Z, s2));
|
|
3391
|
+
r3.update(e4), i2 = ne(Z, e4);
|
|
3802
3392
|
}
|
|
3803
|
-
|
|
3393
|
+
n2.signature = ne(Z, r3.digest()).slice(0, B), e3.enqueue(te(i2, n2.signature));
|
|
3804
3394
|
}
|
|
3805
|
-
} }),
|
|
3395
|
+
} }), n2 = this;
|
|
3806
3396
|
}
|
|
3807
3397
|
}
|
|
3808
|
-
function
|
|
3809
|
-
const { ctr:
|
|
3398
|
+
function Y(e2, t2, r2, n2, s2, a2) {
|
|
3399
|
+
const { ctr: i2, hmac: o2, pending: c } = e2, l2 = t2.length - s2;
|
|
3810
3400
|
let u;
|
|
3811
|
-
for (
|
|
3401
|
+
for (c.length && (t2 = te(c, t2), r2 = (function(e3, t3) {
|
|
3812
3402
|
if (t3 && t3 > e3.length) {
|
|
3813
|
-
const
|
|
3814
|
-
(e3 = new Uint8Array(t3)).set(
|
|
3403
|
+
const r3 = e3;
|
|
3404
|
+
(e3 = new Uint8Array(t3)).set(r3, 0);
|
|
3815
3405
|
}
|
|
3816
3406
|
return e3;
|
|
3817
|
-
})(
|
|
3818
|
-
const e3 =
|
|
3407
|
+
})(r2, l2 - l2 % T$1)), u = 0; u <= l2 - T$1; u += T$1) {
|
|
3408
|
+
const e3 = se(Z, re(t2, u, u + T$1));
|
|
3819
3409
|
a2 && o2.update(e3);
|
|
3820
|
-
const
|
|
3821
|
-
a2 || o2.update(
|
|
3410
|
+
const s3 = i2.update(e3);
|
|
3411
|
+
a2 || o2.update(s3), r2.set(ne(Z, s3), u + n2);
|
|
3822
3412
|
}
|
|
3823
|
-
return e2.pending =
|
|
3413
|
+
return e2.pending = re(t2, u), r2;
|
|
3824
3414
|
}
|
|
3825
|
-
async function
|
|
3415
|
+
async function $(e2, t2, r2, n2) {
|
|
3826
3416
|
e2.password = null;
|
|
3827
|
-
const
|
|
3828
|
-
if (!
|
|
3417
|
+
const s2 = await (async function(e3, t3, r3, n3, s3) {
|
|
3418
|
+
if (!G) return v$1.importKey(t3);
|
|
3829
3419
|
try {
|
|
3830
|
-
return await
|
|
3831
|
-
} catch
|
|
3832
|
-
return
|
|
3420
|
+
return await V.importKey(e3, t3, r3, n3, s3);
|
|
3421
|
+
} catch {
|
|
3422
|
+
return G = false, v$1.importKey(t3);
|
|
3833
3423
|
}
|
|
3834
|
-
})("raw",
|
|
3835
|
-
if (!
|
|
3424
|
+
})("raw", r2, R, false, M), a2 = await (async function(e3, t3, r3) {
|
|
3425
|
+
if (!J) return v$1.pbkdf2(t3, e3.salt, W.iterations, r3);
|
|
3836
3426
|
try {
|
|
3837
|
-
return await
|
|
3838
|
-
} catch
|
|
3839
|
-
return
|
|
3427
|
+
return await V.deriveBits(e3, t3, r3);
|
|
3428
|
+
} catch {
|
|
3429
|
+
return J = false, v$1.pbkdf2(t3, e3.salt, W.iterations, r3);
|
|
3840
3430
|
}
|
|
3841
|
-
})(Object.assign({ salt:
|
|
3842
|
-
return Object.assign(e2, { keys: { key: o2, authentication:
|
|
3431
|
+
})(Object.assign({ salt: n2 }, W), s2, 8 * (2 * I[t2] + 2)), i2 = new Uint8Array(a2), o2 = se(Z, re(i2, 0, I[t2])), c = se(Z, re(i2, I[t2], 2 * I[t2])), l2 = re(i2, 2 * I[t2]);
|
|
3432
|
+
return Object.assign(e2, { keys: { key: o2, authentication: c, passwordVerification: l2 }, ctr: new H(new q(o2), Array.from(P)), hmac: new K(c) }), l2;
|
|
3843
3433
|
}
|
|
3844
|
-
function
|
|
3845
|
-
return t2 ===
|
|
3846
|
-
if (typeof TextEncoder ==
|
|
3434
|
+
function ee(e2, t2) {
|
|
3435
|
+
return t2 === c$1 ? (function(e3) {
|
|
3436
|
+
if (typeof TextEncoder == u$1) {
|
|
3847
3437
|
e3 = unescape(encodeURIComponent(e3));
|
|
3848
3438
|
const t3 = new Uint8Array(e3.length);
|
|
3849
|
-
for (let
|
|
3439
|
+
for (let r2 = 0; r2 < t3.length; r2++) t3[r2] = e3.charCodeAt(r2);
|
|
3850
3440
|
return t3;
|
|
3851
3441
|
}
|
|
3852
3442
|
return new TextEncoder().encode(e3);
|
|
3853
3443
|
})(e2) : t2;
|
|
3854
3444
|
}
|
|
3855
|
-
function
|
|
3856
|
-
let
|
|
3857
|
-
return e2.length + t2.length && (
|
|
3445
|
+
function te(e2, t2) {
|
|
3446
|
+
let r2 = e2;
|
|
3447
|
+
return e2.length + t2.length && (r2 = new Uint8Array(e2.length + t2.length), r2.set(e2, 0), r2.set(t2, e2.length)), r2;
|
|
3858
3448
|
}
|
|
3859
|
-
function
|
|
3860
|
-
return e2.subarray(t2,
|
|
3449
|
+
function re(e2, t2, r2) {
|
|
3450
|
+
return e2.subarray(t2, r2);
|
|
3861
3451
|
}
|
|
3862
|
-
function
|
|
3452
|
+
function ne(e2, t2) {
|
|
3863
3453
|
return e2.fromBits(t2);
|
|
3864
3454
|
}
|
|
3865
|
-
function
|
|
3455
|
+
function se(e2, t2) {
|
|
3866
3456
|
return e2.toBits(t2);
|
|
3867
3457
|
}
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
constructor({ password: e2, passwordVerification: t2, checkPasswordOnly: n2 }) {
|
|
3458
|
+
class ae extends TransformStream {
|
|
3459
|
+
constructor({ password: e2, passwordVerification: t2, checkPasswordOnly: r2 }) {
|
|
3871
3460
|
super({ start() {
|
|
3872
|
-
Object.assign(this, { password: e2, passwordVerification: t2 }),
|
|
3461
|
+
Object.assign(this, { password: e2, passwordVerification: t2 }), le(this, e2);
|
|
3873
3462
|
}, transform(e3, t3) {
|
|
3874
|
-
const
|
|
3875
|
-
if (
|
|
3876
|
-
const t4 =
|
|
3877
|
-
if (
|
|
3878
|
-
e3 = e3.subarray(
|
|
3463
|
+
const n2 = this;
|
|
3464
|
+
if (n2.password) {
|
|
3465
|
+
const t4 = oe(n2, e3.subarray(0, 12));
|
|
3466
|
+
if (n2.password = null, t4.at(-1) != n2.passwordVerification) throw new Error(_);
|
|
3467
|
+
e3 = e3.subarray(12);
|
|
3879
3468
|
}
|
|
3880
|
-
|
|
3469
|
+
r2 ? t3.error(new Error(O)) : t3.enqueue(oe(n2, e3));
|
|
3881
3470
|
} });
|
|
3882
3471
|
}
|
|
3883
3472
|
}
|
|
3884
|
-
class
|
|
3473
|
+
class ie extends TransformStream {
|
|
3885
3474
|
constructor({ password: e2, passwordVerification: t2 }) {
|
|
3886
3475
|
super({ start() {
|
|
3887
|
-
Object.assign(this, { password: e2, passwordVerification: t2 }),
|
|
3476
|
+
Object.assign(this, { password: e2, passwordVerification: t2 }), le(this, e2);
|
|
3888
3477
|
}, transform(e3, t3) {
|
|
3889
|
-
const
|
|
3890
|
-
let
|
|
3891
|
-
if (
|
|
3892
|
-
|
|
3893
|
-
const t4 =
|
|
3894
|
-
t4[11] =
|
|
3895
|
-
} else
|
|
3896
|
-
|
|
3478
|
+
const r2 = this;
|
|
3479
|
+
let n2, s2;
|
|
3480
|
+
if (r2.password) {
|
|
3481
|
+
r2.password = null;
|
|
3482
|
+
const t4 = E$1(new Uint8Array(12));
|
|
3483
|
+
t4[11] = r2.passwordVerification, n2 = new Uint8Array(e3.length + t4.length), n2.set(ce(r2, t4), 0), s2 = 12;
|
|
3484
|
+
} else n2 = new Uint8Array(e3.length), s2 = 0;
|
|
3485
|
+
n2.set(ce(r2, e3), s2), t3.enqueue(n2);
|
|
3897
3486
|
} });
|
|
3898
3487
|
}
|
|
3899
3488
|
}
|
|
3900
|
-
function
|
|
3901
|
-
const
|
|
3902
|
-
for (let
|
|
3903
|
-
return
|
|
3489
|
+
function oe(e2, t2) {
|
|
3490
|
+
const r2 = new Uint8Array(t2.length);
|
|
3491
|
+
for (let n2 = 0; n2 < t2.length; n2++) r2[n2] = de(e2) ^ t2[n2], ue(e2, r2[n2]);
|
|
3492
|
+
return r2;
|
|
3904
3493
|
}
|
|
3905
|
-
function
|
|
3906
|
-
const
|
|
3907
|
-
for (let
|
|
3908
|
-
return
|
|
3494
|
+
function ce(e2, t2) {
|
|
3495
|
+
const r2 = new Uint8Array(t2.length);
|
|
3496
|
+
for (let n2 = 0; n2 < t2.length; n2++) r2[n2] = de(e2) ^ t2[n2], ue(e2, t2[n2]);
|
|
3497
|
+
return r2;
|
|
3909
3498
|
}
|
|
3910
|
-
function
|
|
3911
|
-
const
|
|
3912
|
-
Object.assign(e2, { keys:
|
|
3913
|
-
for (let
|
|
3499
|
+
function le(e2, t2) {
|
|
3500
|
+
const r2 = [305419896, 591751049, 878082192];
|
|
3501
|
+
Object.assign(e2, { keys: r2, crcKey0: new y$1(r2[0]), crcKey2: new y$1(r2[2]) });
|
|
3502
|
+
for (let r3 = 0; r3 < t2.length; r3++) ue(e2, t2.charCodeAt(r3));
|
|
3914
3503
|
}
|
|
3915
|
-
function
|
|
3916
|
-
let [
|
|
3917
|
-
e2.crcKey0.append([t2]),
|
|
3504
|
+
function ue(e2, t2) {
|
|
3505
|
+
let [r2, n2, s2] = e2.keys;
|
|
3506
|
+
e2.crcKey0.append([t2]), r2 = ~e2.crcKey0.get(), n2 = he(Math.imul(he(n2 + fe(r2)), 134775813) + 1), e2.crcKey2.append([n2 >>> 24]), s2 = ~e2.crcKey2.get(), e2.keys = [r2, n2, s2];
|
|
3918
3507
|
}
|
|
3919
|
-
function
|
|
3508
|
+
function de(e2) {
|
|
3920
3509
|
const t2 = 2 | e2.keys[2];
|
|
3921
|
-
return
|
|
3510
|
+
return fe(Math.imul(t2, 1 ^ t2) >>> 8);
|
|
3922
3511
|
}
|
|
3923
|
-
function
|
|
3512
|
+
function fe(e2) {
|
|
3924
3513
|
return 255 & e2;
|
|
3925
3514
|
}
|
|
3926
|
-
function
|
|
3515
|
+
function he(e2) {
|
|
3927
3516
|
return 4294967295 & e2;
|
|
3928
3517
|
}
|
|
3929
|
-
const
|
|
3930
|
-
class
|
|
3931
|
-
constructor(e2, { chunkSize: t2,
|
|
3518
|
+
const pe = "Invalid uncompressed size";
|
|
3519
|
+
class we extends TransformStream {
|
|
3520
|
+
constructor(e2, { chunkSize: t2, CompressionStreamZlib: r2, CompressionStream: n2 }) {
|
|
3932
3521
|
super({});
|
|
3933
|
-
const { compressed:
|
|
3934
|
-
let d, f2, h2 =
|
|
3935
|
-
a2 && !o2 || !
|
|
3522
|
+
const { compressed: s2, encrypted: a2, useCompressionStream: i2, zipCrypto: o2, signed: c, level: l2 } = e2, u = this;
|
|
3523
|
+
let d, f2, h2 = super.readable;
|
|
3524
|
+
a2 && !o2 || !c || (d = new b$1(), h2 = be(h2, d)), s2 && (h2 = ye(h2, i2, { level: l2, chunkSize: t2 }, n2, r2, n2)), a2 && (o2 ? h2 = be(h2, new ie(e2)) : (f2 = new X(e2), h2 = be(h2, f2))), me(u, h2, () => {
|
|
3936
3525
|
let e3;
|
|
3937
|
-
a2 && !o2 && (e3 = f2.signature), a2 && !o2 || !
|
|
3938
|
-
})
|
|
3526
|
+
a2 && !o2 && (e3 = f2.signature), a2 && !o2 || !c || (e3 = new DataView(d.value.buffer).getUint32(0)), u.signature = e3;
|
|
3527
|
+
});
|
|
3939
3528
|
}
|
|
3940
3529
|
}
|
|
3941
|
-
class
|
|
3942
|
-
constructor(e2, { chunkSize: t2,
|
|
3530
|
+
class ge extends TransformStream {
|
|
3531
|
+
constructor(e2, { chunkSize: t2, DecompressionStreamZlib: r2, DecompressionStream: n2 }) {
|
|
3943
3532
|
super({});
|
|
3944
|
-
const { zipCrypto:
|
|
3945
|
-
let
|
|
3946
|
-
a2 && (
|
|
3947
|
-
if ((!a2 ||
|
|
3948
|
-
const e3 = new DataView(
|
|
3949
|
-
if (o2 != e3.getUint32(0, false)) throw new Error(
|
|
3533
|
+
const { zipCrypto: s2, encrypted: a2, signed: i2, signature: o2, compressed: c, useCompressionStream: l2, deflate64: u } = e2;
|
|
3534
|
+
let d, f2, h2 = super.readable;
|
|
3535
|
+
a2 && (s2 ? h2 = be(h2, new ae(e2)) : (f2 = new Q(e2), h2 = be(h2, f2))), c && (h2 = ye(h2, l2, { chunkSize: t2, deflate64: u }, n2, r2, n2)), a2 && !s2 || !i2 || (d = new b$1(), h2 = be(h2, d)), me(this, h2, () => {
|
|
3536
|
+
if ((!a2 || s2) && i2) {
|
|
3537
|
+
const e3 = new DataView(d.value.buffer);
|
|
3538
|
+
if (o2 != e3.getUint32(0, false)) throw new Error(F);
|
|
3950
3539
|
}
|
|
3951
|
-
})
|
|
3540
|
+
});
|
|
3952
3541
|
}
|
|
3953
3542
|
}
|
|
3954
|
-
function
|
|
3955
|
-
|
|
3956
|
-
e3 && e3.length && t2.enqueue(e3);
|
|
3957
|
-
} }));
|
|
3958
|
-
}
|
|
3959
|
-
function je(e2, t2, n2) {
|
|
3960
|
-
t2 = Le(t2, new TransformStream({ flush: n2 })), Object.defineProperty(e2, "readable", { get: () => t2 });
|
|
3543
|
+
function me(e2, t2, r2) {
|
|
3544
|
+
t2 = be(t2, new TransformStream({ flush: r2 })), Object.defineProperty(e2, "readable", { get: () => t2 });
|
|
3961
3545
|
}
|
|
3962
|
-
function
|
|
3546
|
+
function ye(e2, t2, r2, n2, s2, a2) {
|
|
3547
|
+
const i2 = t2 && n2 ? n2 : s2 || a2, o2 = r2.deflate64 ? "deflate64-raw" : "deflate-raw";
|
|
3963
3548
|
try {
|
|
3964
|
-
e2 =
|
|
3965
|
-
} catch (
|
|
3966
|
-
if (!t2)
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3549
|
+
e2 = be(e2, new i2(o2, r2));
|
|
3550
|
+
} catch (n3) {
|
|
3551
|
+
if (!t2) throw n3;
|
|
3552
|
+
if (s2) e2 = be(e2, new s2(o2, r2));
|
|
3553
|
+
else {
|
|
3554
|
+
if (!a2) throw n3;
|
|
3555
|
+
e2 = be(e2, new a2(o2, r2));
|
|
3971
3556
|
}
|
|
3972
3557
|
}
|
|
3973
3558
|
return e2;
|
|
3974
3559
|
}
|
|
3975
|
-
function
|
|
3560
|
+
function be(e2, t2) {
|
|
3976
3561
|
return e2.pipeThrough(t2);
|
|
3977
3562
|
}
|
|
3978
|
-
const
|
|
3979
|
-
class
|
|
3563
|
+
const Se = "start", ke = "pull", ze = "data", xe = "close", Ue = "inflate";
|
|
3564
|
+
class Ae extends TransformStream {
|
|
3980
3565
|
constructor(e2, t2) {
|
|
3981
3566
|
super({});
|
|
3982
|
-
const
|
|
3983
|
-
let
|
|
3984
|
-
|
|
3985
|
-
let a2 = 0
|
|
3986
|
-
const
|
|
3987
|
-
e3 && e3.length && (s2 += e3.length, t3.enqueue(e3));
|
|
3988
|
-
}, flush() {
|
|
3989
|
-
Object.assign(n2, { inputSize: s2 });
|
|
3990
|
-
} }), u = new TransformStream({ transform(e3, t3) {
|
|
3567
|
+
const r2 = this, { codecType: n2 } = e2;
|
|
3568
|
+
let s2;
|
|
3569
|
+
n2.startsWith("deflate") ? s2 = we : n2.startsWith(Ue) && (s2 = ge), r2.outputSize = 0;
|
|
3570
|
+
let a2 = 0;
|
|
3571
|
+
const i2 = new s2(e2, t2), o2 = super.readable, l2 = new TransformStream({ transform(e3, t3) {
|
|
3991
3572
|
e3 && e3.length && (a2 += e3.length, t3.enqueue(e3));
|
|
3992
3573
|
}, flush() {
|
|
3993
|
-
|
|
3994
|
-
|
|
3574
|
+
Object.assign(r2, { inputSize: a2 });
|
|
3575
|
+
} }), u = new TransformStream({ transform(t3, n3) {
|
|
3576
|
+
if (t3 && t3.length && (n3.enqueue(t3), r2.outputSize += t3.length, e2.outputSize !== c$1 && r2.outputSize > e2.outputSize)) throw new Error(pe);
|
|
3577
|
+
}, flush() {
|
|
3578
|
+
const { signature: e3 } = i2;
|
|
3579
|
+
Object.assign(r2, { signature: e3, inputSize: a2 });
|
|
3995
3580
|
} });
|
|
3996
|
-
Object.defineProperty(
|
|
3581
|
+
Object.defineProperty(r2, "readable", { get: () => o2.pipeThrough(l2).pipeThrough(i2).pipeThrough(u) });
|
|
3997
3582
|
}
|
|
3998
3583
|
}
|
|
3999
|
-
class
|
|
3584
|
+
class ve extends TransformStream {
|
|
4000
3585
|
constructor(e2) {
|
|
4001
3586
|
let t2;
|
|
4002
|
-
super({ transform: function n2
|
|
3587
|
+
super({ transform: function r2(n2, s2) {
|
|
4003
3588
|
if (t2) {
|
|
4004
|
-
const e3 = new Uint8Array(t2.length +
|
|
4005
|
-
e3.set(t2), e3.set(
|
|
3589
|
+
const e3 = new Uint8Array(t2.length + n2.length);
|
|
3590
|
+
e3.set(t2), e3.set(n2, t2.length), n2 = e3, t2 = null;
|
|
4006
3591
|
}
|
|
4007
|
-
|
|
3592
|
+
n2.length > e2 ? (s2.enqueue(n2.slice(0, e2)), r2(n2.slice(e2), s2)) : t2 = n2;
|
|
4008
3593
|
}, flush(e3) {
|
|
4009
3594
|
t2 && t2.length && e3.enqueue(t2);
|
|
4010
3595
|
} });
|
|
4011
3596
|
}
|
|
4012
3597
|
}
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
3598
|
+
const De = { type: "module" };
|
|
3599
|
+
let _e, Fe, Oe, Ee = true;
|
|
3600
|
+
try {
|
|
3601
|
+
Ee = typeof structuredClone == d$1 && structuredClone(new DOMException("", "AbortError")).code !== c$1;
|
|
3602
|
+
} catch {
|
|
3603
|
+
}
|
|
3604
|
+
class Te {
|
|
3605
|
+
constructor(e2, { readable: t2, writable: r2 }, { options: n2, config: s2, streamOptions: a2, useWebWorkers: i2, transferStreams: o2, workerURI: l2 }, d) {
|
|
3606
|
+
const { signal: f2 } = a2;
|
|
3607
|
+
return Object.assign(e2, { busy: true, readable: t2.pipeThrough(new ve(s2.chunkSize)).pipeThrough(new Ce(a2), { signal: f2 }), writable: r2, options: Object.assign({}, n2), workerURI: l2, transferStreams: o2, terminate: () => new Promise((t3) => {
|
|
3608
|
+
const { worker: r3, busy: n3 } = e2;
|
|
3609
|
+
r3 ? (n3 ? e2.resolveTerminated = t3 : (r3.terminate(), t3()), e2.interface = null) : t3();
|
|
3610
|
+
}), onTaskFinished() {
|
|
4021
3611
|
const { resolveTerminated: t3 } = e2;
|
|
4022
|
-
t3 && (e2.resolveTerminated = null, e2.terminated = true, e2.worker.terminate(), t3()), e2.busy = false,
|
|
4023
|
-
} }), (
|
|
3612
|
+
t3 && (e2.resolveTerminated = null, e2.terminated = true, e2.worker.terminate(), t3()), e2.busy = false, d(e2);
|
|
3613
|
+
} }), _e === c$1 && (_e = typeof Worker != u$1), (i2 && _e ? Me : We)(e2, s2);
|
|
4024
3614
|
}
|
|
4025
3615
|
}
|
|
4026
|
-
class
|
|
4027
|
-
constructor(
|
|
4028
|
-
let
|
|
3616
|
+
class Ce extends TransformStream {
|
|
3617
|
+
constructor({ onstart: e2, onprogress: t2, size: r2, onend: n2 }) {
|
|
3618
|
+
let s2 = 0;
|
|
4029
3619
|
super({ async start() {
|
|
4030
|
-
|
|
4031
|
-
}, async transform(e3,
|
|
4032
|
-
|
|
3620
|
+
e2 && await Re(e2, r2);
|
|
3621
|
+
}, async transform(e3, n3) {
|
|
3622
|
+
s2 += e3.length, t2 && await Re(t2, s2, r2), n3.enqueue(e3);
|
|
4033
3623
|
}, async flush() {
|
|
4034
|
-
|
|
3624
|
+
n2 && await Re(n2, s2);
|
|
4035
3625
|
} });
|
|
4036
3626
|
}
|
|
4037
3627
|
}
|
|
4038
|
-
async function
|
|
3628
|
+
async function Re(e2, ...t2) {
|
|
4039
3629
|
try {
|
|
4040
3630
|
await e2(...t2);
|
|
4041
|
-
} catch
|
|
3631
|
+
} catch {
|
|
4042
3632
|
}
|
|
4043
3633
|
}
|
|
4044
|
-
function
|
|
4045
|
-
return { run: () => (async function({ options: e3, readable: t3, writable:
|
|
3634
|
+
function We(e2, t2) {
|
|
3635
|
+
return { run: () => (async function({ options: e3, readable: t3, writable: r2, onTaskFinished: n2 }, s2) {
|
|
3636
|
+
let a2;
|
|
4046
3637
|
try {
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
3638
|
+
if (!e3.useCompressionStream) try {
|
|
3639
|
+
await void 0;
|
|
3640
|
+
} catch {
|
|
3641
|
+
e3.useCompressionStream = true;
|
|
3642
|
+
}
|
|
3643
|
+
a2 = new Ae(e3, s2), await t3.pipeThrough(a2).pipeTo(r2, { preventClose: true, preventAbort: true });
|
|
3644
|
+
const { signature: n3, inputSize: i2, outputSize: o2 } = a2;
|
|
3645
|
+
return { signature: n3, inputSize: i2, outputSize: o2 };
|
|
3646
|
+
} catch (e4) {
|
|
3647
|
+
throw a2 && (e4.outputSize = a2.outputSize), e4;
|
|
4051
3648
|
} finally {
|
|
4052
|
-
|
|
3649
|
+
n2();
|
|
4053
3650
|
}
|
|
4054
3651
|
})(e2, t2) };
|
|
4055
3652
|
}
|
|
4056
|
-
function
|
|
4057
|
-
const {
|
|
3653
|
+
function Me(e2, t2) {
|
|
3654
|
+
const { baseURI: r2, chunkSize: n2 } = t2;
|
|
3655
|
+
let { wasmURI: s2 } = t2;
|
|
4058
3656
|
if (!e2.interface) {
|
|
4059
|
-
let
|
|
3657
|
+
let a2;
|
|
3658
|
+
typeof s2 == d$1 && (s2 = s2());
|
|
4060
3659
|
try {
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
}
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
const { message: e6, stack: t5, code: n5, name: i5 } = s2, r5 = new Error(e6);
|
|
4081
|
-
Object.assign(r5, { stack: t5, code: n5, name: i5 }), f2(r5);
|
|
4082
|
-
} else {
|
|
4083
|
-
if (n4 == Be) {
|
|
4084
|
-
const { value: e6, done: n5 } = await o2.read();
|
|
4085
|
-
et({ type: Ie, value: e6, done: n5, messageId: r4 }, t4);
|
|
4086
|
-
}
|
|
4087
|
-
n4 == Ie && (await l2.ready, await l2.write(new Uint8Array(i4)), et({ type: "ack", messageId: r4 }, t4)), n4 == Ne && f2(null, a3);
|
|
4088
|
-
}
|
|
4089
|
-
} catch (s3) {
|
|
4090
|
-
et({ type: Ne, messageId: r4 }, t4), f2(s3);
|
|
4091
|
-
}
|
|
4092
|
-
function f2(e6, t5) {
|
|
4093
|
-
e6 ? u(e6) : c(t5), l2 && l2.releaseLock(), d();
|
|
4094
|
-
}
|
|
4095
|
-
})(e4, n3))), a2;
|
|
4096
|
-
})(e2.scripts[0], n2, e2);
|
|
4097
|
-
} catch (n3) {
|
|
4098
|
-
return Ke = false, Qe(e2, t2);
|
|
4099
|
-
}
|
|
4100
|
-
Object.assign(e2, { worker: r2, interface: { run: () => (async function(e3, t3) {
|
|
4101
|
-
let n3, i3;
|
|
4102
|
-
const r3 = new Promise(((e4, t4) => {
|
|
4103
|
-
n3 = e4, i3 = t4;
|
|
4104
|
-
}));
|
|
4105
|
-
Object.assign(e3, { reader: null, writer: null, resolveResult: n3, rejectResult: i3, result: r3 });
|
|
4106
|
-
const { readable: a2, options: s2, scripts: o2 } = e3, { writable: l2, closed: c } = (function(e4) {
|
|
4107
|
-
let t4;
|
|
4108
|
-
const n4 = new Promise(((e5) => t4 = e5)), i4 = new WritableStream({ async write(t5) {
|
|
4109
|
-
const n5 = e4.getWriter();
|
|
4110
|
-
await n5.ready, await n5.write(t5), n5.releaseLock();
|
|
4111
|
-
}, close() {
|
|
4112
|
-
t4();
|
|
4113
|
-
}, abort: (t5) => e4.getWriter().abort(t5) });
|
|
4114
|
-
return { writable: i4, closed: n4 };
|
|
4115
|
-
})(e3.writable), u = et({ type: Re, scripts: o2.slice(1), options: s2, config: t3, readable: a2, writable: l2 }, e3);
|
|
4116
|
-
u || Object.assign(e3, { reader: a2.getReader(), writer: l2.getWriter() });
|
|
4117
|
-
const d = await r3;
|
|
4118
|
-
u || await l2.getWriter().close();
|
|
4119
|
-
return await c, d;
|
|
4120
|
-
})(e2, { chunkSize: i2 }) } });
|
|
3660
|
+
a2 = je(e2.workerURI, r2, e2);
|
|
3661
|
+
} catch {
|
|
3662
|
+
return _e = false, We(e2, t2);
|
|
3663
|
+
}
|
|
3664
|
+
Object.assign(e2, { worker: a2, interface: { run: () => (async function(e3, t3) {
|
|
3665
|
+
let r3, n3;
|
|
3666
|
+
const s3 = new Promise((e4, t4) => {
|
|
3667
|
+
r3 = e4, n3 = t4;
|
|
3668
|
+
});
|
|
3669
|
+
Object.assign(e3, { reader: null, writer: null, resolveResult: r3, rejectResult: n3, result: s3 });
|
|
3670
|
+
const { readable: a3, options: i2 } = e3, { writable: o2, closed: c } = (function(e4) {
|
|
3671
|
+
const { writable: t4, readable: r4 } = new TransformStream(), n4 = r4.pipeTo(e4, { preventClose: true });
|
|
3672
|
+
return { writable: t4, closed: n4 };
|
|
3673
|
+
})(e3.writable), l2 = Ie({ type: Se, options: i2, config: t3, readable: a3, writable: o2 }, e3);
|
|
3674
|
+
l2 || Object.assign(e3, { reader: a3.getReader(), writer: o2.getWriter() });
|
|
3675
|
+
const u = await s3;
|
|
3676
|
+
l2 || await o2.getWriter().close();
|
|
3677
|
+
return await c, u;
|
|
3678
|
+
})(e2, { chunkSize: n2, wasmURI: s2, baseURI: r2 }) } });
|
|
4121
3679
|
}
|
|
4122
3680
|
return e2.interface;
|
|
4123
3681
|
}
|
|
4124
|
-
|
|
4125
|
-
|
|
3682
|
+
function je(e2, t2, r2, n2, s2 = true) {
|
|
3683
|
+
let a2, i2, o2;
|
|
3684
|
+
if (Fe === c$1) {
|
|
3685
|
+
const l2 = typeof e2 == d$1;
|
|
3686
|
+
i2 = l2 ? e2(s2) : e2;
|
|
3687
|
+
const u = i2.startsWith("data:"), f2 = i2.startsWith("blob:");
|
|
3688
|
+
if (u || f2) {
|
|
3689
|
+
n2 === c$1 && (n2 = false), n2 && (o2 = De);
|
|
3690
|
+
try {
|
|
3691
|
+
a2 = new Worker(i2, o2);
|
|
3692
|
+
} catch (s3) {
|
|
3693
|
+
if (f2) try {
|
|
3694
|
+
URL.revokeObjectURL(i2);
|
|
3695
|
+
} catch {
|
|
3696
|
+
}
|
|
3697
|
+
if (l2 && f2) return je(e2, t2, r2, n2, false);
|
|
3698
|
+
if (n2) throw s3;
|
|
3699
|
+
return je(e2, t2, r2, true, false);
|
|
3700
|
+
}
|
|
3701
|
+
} else {
|
|
3702
|
+
n2 === c$1 && (n2 = true), n2 && (o2 = De);
|
|
3703
|
+
try {
|
|
3704
|
+
i2 = new URL(i2, t2);
|
|
3705
|
+
} catch {
|
|
3706
|
+
}
|
|
3707
|
+
try {
|
|
3708
|
+
a2 = new Worker(i2, o2);
|
|
3709
|
+
} catch (a3) {
|
|
3710
|
+
if (n2) throw a3;
|
|
3711
|
+
return je(e2, t2, r2, false, s2);
|
|
3712
|
+
}
|
|
3713
|
+
}
|
|
3714
|
+
Fe = i2, Oe = o2;
|
|
3715
|
+
} else a2 = new Worker(Fe, Oe);
|
|
3716
|
+
return a2.addEventListener("message", (e3) => (async function({ data: e4 }, t3) {
|
|
3717
|
+
const { type: r3, value: n3, messageId: s3, result: a3, error: i3 } = e4, { reader: o3, writer: c, resolveResult: l2, rejectResult: u, onTaskFinished: d } = t3;
|
|
3718
|
+
try {
|
|
3719
|
+
if (i3) {
|
|
3720
|
+
const { message: e5, stack: t4, code: r4, name: n4, outputSize: s4 } = i3, a4 = new Error(e5);
|
|
3721
|
+
Object.assign(a4, { stack: t4, code: r4, name: n4, outputSize: s4 }), f2(a4);
|
|
3722
|
+
} else {
|
|
3723
|
+
if (r3 == ke) {
|
|
3724
|
+
const { value: e5, done: r4 } = await o3.read();
|
|
3725
|
+
Ie({ type: ze, value: e5, done: r4, messageId: s3 }, t3);
|
|
3726
|
+
}
|
|
3727
|
+
r3 == ze && (await c.ready, await c.write(new Uint8Array(n3)), Ie({ type: "ack", messageId: s3 }, t3)), r3 == xe && f2(null, a3);
|
|
3728
|
+
}
|
|
3729
|
+
} catch (i4) {
|
|
3730
|
+
Ie({ type: xe, messageId: s3 }, t3), f2(i4);
|
|
3731
|
+
}
|
|
3732
|
+
function f2(e5, t4) {
|
|
3733
|
+
e5 ? u(e5) : l2(t4), c && c.releaseLock(), d();
|
|
3734
|
+
}
|
|
3735
|
+
})(e3, r2)), a2;
|
|
3736
|
+
}
|
|
3737
|
+
function Ie(e2, { worker: t2, writer: r2, onTaskFinished: n2, transferStreams: s2 }) {
|
|
4126
3738
|
try {
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
$e = false, e2.readable = e2.writable = null, t2.postMessage(e2);
|
|
3739
|
+
const { value: r3, readable: n3, writable: a2 } = e2, i2 = [];
|
|
3740
|
+
if (r3 && (e2.value = r3, i2.push(e2.value.buffer)), s2 && Ee ? (n3 && i2.push(n3), a2 && i2.push(a2)) : e2.readable = e2.writable = null, i2.length) try {
|
|
3741
|
+
return t2.postMessage(e2, i2), true;
|
|
3742
|
+
} catch {
|
|
3743
|
+
Ee = false, e2.readable = e2.writable = null, t2.postMessage(e2);
|
|
4133
3744
|
}
|
|
4134
3745
|
else t2.postMessage(e2);
|
|
4135
3746
|
} catch (e3) {
|
|
4136
|
-
throw
|
|
4137
|
-
}
|
|
4138
|
-
}
|
|
4139
|
-
let
|
|
4140
|
-
const
|
|
4141
|
-
let
|
|
4142
|
-
async function
|
|
4143
|
-
const { options:
|
|
4144
|
-
t2.transferStreams =
|
|
4145
|
-
const h2 = !(
|
|
4146
|
-
return t2.useWebWorkers = !h2 && (a2 || a2 ===
|
|
4147
|
-
const
|
|
4148
|
-
if (
|
|
4149
|
-
if (
|
|
4150
|
-
const
|
|
4151
|
-
return
|
|
4152
|
-
}
|
|
4153
|
-
return new Promise((
|
|
3747
|
+
throw r2 && r2.releaseLock(), n2(), e3;
|
|
3748
|
+
}
|
|
3749
|
+
}
|
|
3750
|
+
let Be = [];
|
|
3751
|
+
const Pe = [];
|
|
3752
|
+
let Le = 0;
|
|
3753
|
+
async function Ve(e2, t2) {
|
|
3754
|
+
const { options: r2, config: n2 } = t2, { transferStreams: s2, useWebWorkers: a2, useCompressionStream: i2, compressed: o2, signed: l2, encrypted: u } = r2, { workerURI: d, maxWorkers: f2 } = n2;
|
|
3755
|
+
t2.transferStreams = s2 || s2 === c$1;
|
|
3756
|
+
const h2 = !(o2 || l2 || u || t2.transferStreams);
|
|
3757
|
+
return t2.useWebWorkers = !h2 && (a2 || a2 === c$1 && n2.useWebWorkers), t2.workerURI = t2.useWebWorkers && d ? d : c$1, r2.useCompressionStream = i2 || i2 === c$1 && n2.useCompressionStream, (await (async function() {
|
|
3758
|
+
const r3 = Be.find((e3) => !e3.busy);
|
|
3759
|
+
if (r3) return Ne(r3), new Te(r3, e2, t2, p2);
|
|
3760
|
+
if (Be.length < f2) {
|
|
3761
|
+
const r4 = { indexWorker: Le };
|
|
3762
|
+
return Le++, Be.push(r4), new Te(r4, e2, t2, p2);
|
|
3763
|
+
}
|
|
3764
|
+
return new Promise((r4) => Pe.push({ resolve: r4, stream: e2, workerOptions: t2 }));
|
|
4154
3765
|
})()).run();
|
|
4155
|
-
function
|
|
4156
|
-
if (
|
|
4157
|
-
const [{ resolve: t3, stream:
|
|
4158
|
-
t3(new
|
|
4159
|
-
} else e3.worker ? (
|
|
4160
|
-
const { config:
|
|
4161
|
-
Number.isFinite(
|
|
4162
|
-
|
|
3766
|
+
function p2(e3) {
|
|
3767
|
+
if (Pe.length) {
|
|
3768
|
+
const [{ resolve: t3, stream: r3, workerOptions: n3 }] = Pe.splice(0, 1);
|
|
3769
|
+
t3(new Te(e3, r3, n3, p2));
|
|
3770
|
+
} else e3.worker ? (Ne(e3), (function(e4, t3) {
|
|
3771
|
+
const { config: r3 } = t3, { terminateWorkerTimeout: n3 } = r3;
|
|
3772
|
+
Number.isFinite(n3) && n3 >= 0 && (e4.terminated ? e4.terminated = false : e4.terminateTimeout = setTimeout(async () => {
|
|
3773
|
+
Be = Be.filter((t4) => t4 != e4);
|
|
4163
3774
|
try {
|
|
4164
3775
|
await e4.terminate();
|
|
4165
|
-
} catch
|
|
3776
|
+
} catch {
|
|
4166
3777
|
}
|
|
4167
|
-
}
|
|
4168
|
-
})(e3, t2)) :
|
|
3778
|
+
}, n3));
|
|
3779
|
+
})(e3, t2)) : Be = Be.filter((t3) => t3 != e3);
|
|
4169
3780
|
}
|
|
4170
3781
|
}
|
|
4171
|
-
function
|
|
3782
|
+
function Ne(e2) {
|
|
4172
3783
|
const { terminateTimeout: t2 } = e2;
|
|
4173
3784
|
t2 && (clearTimeout(t2), e2.terminateTimeout = null);
|
|
4174
3785
|
}
|
|
4175
|
-
const
|
|
4176
|
-
class
|
|
3786
|
+
const Ze = 65536, qe = "writable";
|
|
3787
|
+
class He {
|
|
4177
3788
|
constructor() {
|
|
4178
3789
|
this.size = 0;
|
|
4179
3790
|
}
|
|
@@ -4181,403 +3792,461 @@ class lt {
|
|
|
4181
3792
|
this.initialized = true;
|
|
4182
3793
|
}
|
|
4183
3794
|
}
|
|
4184
|
-
class
|
|
3795
|
+
class Ke extends He {
|
|
4185
3796
|
get readable() {
|
|
4186
|
-
const e2 = this, { chunkSize: t2 =
|
|
3797
|
+
const e2 = this, { chunkSize: t2 = Ze } = e2, r2 = new ReadableStream({ start() {
|
|
4187
3798
|
this.chunkOffset = 0;
|
|
4188
|
-
}, async pull(
|
|
4189
|
-
const { offset:
|
|
4190
|
-
|
|
3799
|
+
}, async pull(n2) {
|
|
3800
|
+
const { offset: s2 = 0, size: a2, diskNumberStart: i2 } = r2, { chunkOffset: o2 } = this, l2 = a2 === c$1 ? t2 : Math.min(t2, a2 - o2), u = await rt(e2, s2 + o2, l2, i2);
|
|
3801
|
+
n2.enqueue(u), o2 + t2 > a2 || a2 === c$1 && !u.length && l2 ? n2.close() : this.chunkOffset += t2;
|
|
4191
3802
|
} });
|
|
4192
|
-
return
|
|
3803
|
+
return r2;
|
|
4193
3804
|
}
|
|
4194
3805
|
}
|
|
4195
|
-
class
|
|
3806
|
+
class Ge extends Ke {
|
|
4196
3807
|
constructor(e2) {
|
|
4197
3808
|
super(), Object.assign(this, { blob: e2, size: e2.size });
|
|
4198
3809
|
}
|
|
4199
3810
|
async readUint8Array(e2, t2) {
|
|
4200
|
-
const
|
|
4201
|
-
let a2 = await
|
|
4202
|
-
return a2.byteLength > t2 && (a2 = a2.slice(e2,
|
|
3811
|
+
const r2 = this, n2 = e2 + t2, s2 = e2 || n2 < r2.size ? r2.blob.slice(e2, n2) : r2.blob;
|
|
3812
|
+
let a2 = await s2.arrayBuffer();
|
|
3813
|
+
return a2.byteLength > t2 && (a2 = a2.slice(e2, n2)), new Uint8Array(a2);
|
|
4203
3814
|
}
|
|
4204
3815
|
}
|
|
4205
|
-
class
|
|
3816
|
+
class Je extends He {
|
|
4206
3817
|
constructor(e2) {
|
|
4207
3818
|
super();
|
|
4208
|
-
const t2 = new TransformStream(),
|
|
4209
|
-
e2 &&
|
|
3819
|
+
const t2 = new TransformStream(), r2 = [];
|
|
3820
|
+
e2 && r2.push(["Content-Type", e2]), Object.defineProperty(this, qe, { get: () => t2.writable }), this.blob = new Response(t2.readable, { headers: r2 }).blob();
|
|
4210
3821
|
}
|
|
4211
3822
|
getData() {
|
|
4212
3823
|
return this.blob;
|
|
4213
3824
|
}
|
|
4214
3825
|
}
|
|
4215
|
-
class
|
|
3826
|
+
class Qe extends Je {
|
|
4216
3827
|
constructor(e2) {
|
|
4217
3828
|
super(e2), Object.assign(this, { encoding: e2, utf8: !e2 || "utf-8" == e2.toLowerCase() });
|
|
4218
3829
|
}
|
|
4219
3830
|
async getData() {
|
|
4220
|
-
const { encoding: e2, utf8: t2 } = this,
|
|
4221
|
-
if (
|
|
3831
|
+
const { encoding: e2, utf8: t2 } = this, r2 = await super.getData();
|
|
3832
|
+
if (r2.text && t2) return r2.text();
|
|
4222
3833
|
{
|
|
4223
3834
|
const t3 = new FileReader();
|
|
4224
|
-
return new Promise((
|
|
4225
|
-
Object.assign(t3, { onload: ({ target: e3 }) =>
|
|
4226
|
-
})
|
|
3835
|
+
return new Promise((n2, s2) => {
|
|
3836
|
+
Object.assign(t3, { onload: ({ target: e3 }) => n2(e3.result), onerror: () => s2(t3.error) }), t3.readAsText(r2, e2);
|
|
3837
|
+
});
|
|
4227
3838
|
}
|
|
4228
3839
|
}
|
|
4229
3840
|
}
|
|
4230
|
-
class
|
|
3841
|
+
class Xe extends Ke {
|
|
4231
3842
|
constructor(e2) {
|
|
4232
3843
|
super(), this.readers = e2;
|
|
4233
3844
|
}
|
|
4234
3845
|
async init() {
|
|
4235
3846
|
const e2 = this, { readers: t2 } = e2;
|
|
4236
|
-
e2.lastDiskNumber = 0, e2.lastDiskOffset = 0, await Promise.all(t2.map(
|
|
4237
|
-
await
|
|
4238
|
-
}))
|
|
4239
|
-
}
|
|
4240
|
-
async readUint8Array(e2, t2,
|
|
4241
|
-
const
|
|
4242
|
-
let a2,
|
|
4243
|
-
-1 ==
|
|
3847
|
+
e2.lastDiskNumber = 0, e2.lastDiskOffset = 0, await Promise.all(t2.map(async (r2, n2) => {
|
|
3848
|
+
await r2.init(), n2 != t2.length - 1 && (e2.lastDiskOffset += r2.size), e2.size += r2.size;
|
|
3849
|
+
})), super.init();
|
|
3850
|
+
}
|
|
3851
|
+
async readUint8Array(e2, t2, r2 = 0) {
|
|
3852
|
+
const n2 = this, { readers: s2 } = this;
|
|
3853
|
+
let a2, i2 = r2;
|
|
3854
|
+
-1 == i2 && (i2 = s2.length - 1);
|
|
4244
3855
|
let o2 = e2;
|
|
4245
|
-
for (; o2 >=
|
|
4246
|
-
const
|
|
4247
|
-
if (
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
3856
|
+
for (; s2[i2] && o2 >= s2[i2].size; ) o2 -= s2[i2].size, i2++;
|
|
3857
|
+
const c = s2[i2];
|
|
3858
|
+
if (c) {
|
|
3859
|
+
const s3 = c.size;
|
|
3860
|
+
if (o2 + t2 <= s3) a2 = await rt(c, o2, t2);
|
|
3861
|
+
else {
|
|
3862
|
+
const i3 = s3 - o2;
|
|
3863
|
+
a2 = new Uint8Array(t2);
|
|
3864
|
+
const l2 = await rt(c, o2, i3);
|
|
3865
|
+
a2.set(l2, 0);
|
|
3866
|
+
const u = await n2.readUint8Array(e2 + i3, t2 - i3, r2);
|
|
3867
|
+
a2.set(u, i3), l2.length + u.length < t2 && (a2 = a2.subarray(0, l2.length + u.length));
|
|
3868
|
+
}
|
|
3869
|
+
} else a2 = new Uint8Array();
|
|
3870
|
+
return n2.lastDiskNumber = Math.max(i2, n2.lastDiskNumber), a2;
|
|
4253
3871
|
}
|
|
4254
3872
|
}
|
|
4255
|
-
class
|
|
3873
|
+
class Ye extends He {
|
|
4256
3874
|
constructor(e2, t2 = 4294967295) {
|
|
4257
3875
|
super();
|
|
4258
|
-
const
|
|
4259
|
-
let
|
|
4260
|
-
Object.assign(
|
|
4261
|
-
const
|
|
4262
|
-
const { availableSize:
|
|
4263
|
-
if (a2) t3.length >=
|
|
3876
|
+
const r2 = this;
|
|
3877
|
+
let n2, s2, a2;
|
|
3878
|
+
Object.assign(r2, { diskNumber: 0, diskOffset: 0, size: 0, maxSize: t2, availableSize: t2 });
|
|
3879
|
+
const i2 = new WritableStream({ async write(t3) {
|
|
3880
|
+
const { availableSize: i3 } = r2;
|
|
3881
|
+
if (a2) t3.length >= i3 ? (await o2(t3.subarray(0, i3)), await c(), r2.diskOffset += n2.size, r2.diskNumber++, a2 = null, await this.write(t3.subarray(i3))) : await o2(t3);
|
|
4264
3882
|
else {
|
|
4265
|
-
const { value:
|
|
4266
|
-
if (o3 && !
|
|
4267
|
-
|
|
3883
|
+
const { value: i4, done: o3 } = await e2.next();
|
|
3884
|
+
if (o3 && !i4) throw new Error("Writer iterator completed too soon");
|
|
3885
|
+
n2 = i4, n2.size = 0, n2.maxSize && (r2.maxSize = n2.maxSize), r2.availableSize = r2.maxSize, await tt(n2), s2 = i4.writable, a2 = s2.getWriter(), await this.write(t3);
|
|
4268
3886
|
}
|
|
4269
3887
|
}, async close() {
|
|
4270
|
-
await a2.ready, await
|
|
3888
|
+
await a2.ready, await c();
|
|
4271
3889
|
} });
|
|
4272
3890
|
async function o2(e3) {
|
|
4273
3891
|
const t3 = e3.length;
|
|
4274
|
-
t3 && (await a2.ready, await a2.write(e3),
|
|
3892
|
+
t3 && (await a2.ready, await a2.write(e3), n2.size += t3, r2.size += t3, r2.availableSize -= t3);
|
|
4275
3893
|
}
|
|
4276
|
-
async function
|
|
4277
|
-
|
|
3894
|
+
async function c() {
|
|
3895
|
+
await a2.close();
|
|
4278
3896
|
}
|
|
4279
|
-
Object.defineProperty(
|
|
3897
|
+
Object.defineProperty(r2, qe, { get: () => i2 });
|
|
3898
|
+
}
|
|
3899
|
+
}
|
|
3900
|
+
class $e {
|
|
3901
|
+
constructor(e2) {
|
|
3902
|
+
return Array.isArray(e2) && (e2 = new Xe(e2)), e2 instanceof ReadableStream && (e2 = { readable: e2 }), e2;
|
|
4280
3903
|
}
|
|
4281
3904
|
}
|
|
4282
|
-
|
|
3905
|
+
class et {
|
|
3906
|
+
constructor(e2) {
|
|
3907
|
+
return e2.writable === c$1 && typeof e2.next == d$1 && (e2 = new Ye(e2)), e2 instanceof WritableStream && (e2 = { writable: e2 }), e2.size === c$1 && (e2.size = 0), e2 instanceof Ye || Object.assign(e2, { diskNumber: 0, diskOffset: 0, availableSize: l$1, maxSize: l$1 }), e2;
|
|
3908
|
+
}
|
|
3909
|
+
}
|
|
3910
|
+
async function tt(e2, t2) {
|
|
4283
3911
|
if (!e2.init || e2.initialized) return Promise.resolve();
|
|
4284
3912
|
await e2.init(t2);
|
|
4285
3913
|
}
|
|
4286
|
-
function
|
|
4287
|
-
return
|
|
4288
|
-
}
|
|
4289
|
-
function pt(e2, t2, n2, i2) {
|
|
4290
|
-
return e2.readUint8Array(t2, n2, i2);
|
|
3914
|
+
function rt(e2, t2, r2, n2) {
|
|
3915
|
+
return e2.readUint8Array(t2, r2, n2);
|
|
4291
3916
|
}
|
|
4292
|
-
const
|
|
4293
|
-
function
|
|
3917
|
+
const nt = "\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split(""), st = 256 == nt.length;
|
|
3918
|
+
function at(e2, t2) {
|
|
4294
3919
|
return t2 && "cp437" == t2.trim().toLowerCase() ? (function(e3) {
|
|
4295
|
-
if (
|
|
3920
|
+
if (st) {
|
|
4296
3921
|
let t3 = "";
|
|
4297
|
-
for (let
|
|
3922
|
+
for (let r2 = 0; r2 < e3.length; r2++) t3 += nt[e3[r2]];
|
|
4298
3923
|
return t3;
|
|
4299
3924
|
}
|
|
4300
3925
|
return new TextDecoder().decode(e3);
|
|
4301
3926
|
})(e2) : new TextDecoder(t2).decode(e2);
|
|
4302
3927
|
}
|
|
4303
|
-
const
|
|
4304
|
-
class
|
|
3928
|
+
const it = "filename", ot = "rawFilename", ct = "comment", lt = "rawComment", ut = "uncompressedSize", dt = "compressedSize", ft = "offset", ht = "diskNumberStart", pt = "lastModDate", wt = "rawLastModDate", gt = "lastAccessDate", mt = "rawLastAccessDate", yt = "creationDate", bt = "rawCreationDate", St = [it, ot, ut, dt, pt, wt, ct, lt, gt, yt, bt, ft, ht, "internalFileAttributes", "externalFileAttributes", "msdosAttributesRaw", "msdosAttributes", "msDosCompatible", "zip64", "encrypted", "version", "versionMadeBy", "zipCrypto", "directory", "executable", "compressionMethod", "signature", "extraField", "extraFieldUnix", "extraFieldInfoZip", "uid", "gid", "unixMode", "setuid", "setgid", "sticky", "bitFlag", "filenameUTF8", "commentUTF8", "rawExtraField", "extraFieldZip64", "extraFieldUnicodePath", "extraFieldUnicodeComment", "extraFieldAES", "extraFieldNTFS", "extraFieldExtendedTimestamp"];
|
|
3929
|
+
class kt {
|
|
4305
3930
|
constructor(e2) {
|
|
4306
|
-
|
|
3931
|
+
St.forEach((t2) => this[t2] = e2[t2]);
|
|
4307
3932
|
}
|
|
4308
3933
|
}
|
|
4309
|
-
const
|
|
4310
|
-
class
|
|
3934
|
+
const zt = "File format is not recognized", xt = "Zip64 extra field not found", Ut = "Compression method not supported", At = "Split zip file", vt = "Overlapping entry found", Dt = "utf-8", _t = "cp437", Ft = [[ut, e$1], [dt, e$1], [ft, e$1], [ht, t$1]], Ot = { [t$1]: { getValue: Nt, bytes: 4 }, [e$1]: { getValue: Zt, bytes: 8 } };
|
|
3935
|
+
class Et {
|
|
4311
3936
|
constructor(e2, t2 = {}) {
|
|
4312
|
-
Object.assign(this, { reader:
|
|
4313
|
-
}
|
|
4314
|
-
async *getEntriesGenerator(
|
|
4315
|
-
const
|
|
4316
|
-
let { reader:
|
|
4317
|
-
const { config:
|
|
4318
|
-
if (await
|
|
4319
|
-
|
|
4320
|
-
return Math.max(
|
|
4321
|
-
})(
|
|
4322
|
-
const
|
|
4323
|
-
const
|
|
4324
|
-
!(function(
|
|
4325
|
-
|
|
4326
|
-
})(
|
|
4327
|
-
const
|
|
4328
|
-
return await
|
|
4329
|
-
async function
|
|
4330
|
-
const
|
|
4331
|
-
for (let
|
|
3937
|
+
Object.assign(this, { reader: new $e(e2), options: t2, config: p$1, readRanges: [] });
|
|
3938
|
+
}
|
|
3939
|
+
async *getEntriesGenerator(n2 = {}) {
|
|
3940
|
+
const l2 = this;
|
|
3941
|
+
let { reader: u } = l2;
|
|
3942
|
+
const { config: d } = l2;
|
|
3943
|
+
if (await tt(u), u.size !== c$1 && u.readUint8Array || (u = new Ge(await new Response(u.readable).blob()), await tt(u)), u.size < i$1) throw new Error(zt);
|
|
3944
|
+
u.chunkSize = (function(e2) {
|
|
3945
|
+
return Math.max(e2.chunkSize, 64);
|
|
3946
|
+
})(d);
|
|
3947
|
+
const f2 = await (async function(e2, t2, r2, n3, s2) {
|
|
3948
|
+
const a2 = new Uint8Array(4);
|
|
3949
|
+
!(function(e3, t3, r3) {
|
|
3950
|
+
e3.setUint32(t3, r3, true);
|
|
3951
|
+
})(qt(a2), 0, t2);
|
|
3952
|
+
const i2 = n3 + s2;
|
|
3953
|
+
return await o2(n3) || await o2(Math.min(i2, r2));
|
|
3954
|
+
async function o2(t3) {
|
|
3955
|
+
const s3 = r2 - t3, i3 = await rt(e2, s3, t3);
|
|
3956
|
+
for (let e3 = i3.length - n3; e3 >= 0; e3--) if (i3[e3] == a2[0] && i3[e3 + 1] == a2[1] && i3[e3 + 2] == a2[2] && i3[e3 + 3] == a2[3]) return { offset: s3 + e3, buffer: i3.slice(e3, e3 + n3).buffer };
|
|
4332
3957
|
}
|
|
4333
|
-
})(
|
|
4334
|
-
if (!
|
|
4335
|
-
throw
|
|
4336
|
-
}
|
|
4337
|
-
const
|
|
4338
|
-
let
|
|
4339
|
-
const
|
|
4340
|
-
let
|
|
4341
|
-
const
|
|
4342
|
-
let
|
|
4343
|
-
if (
|
|
4344
|
-
const
|
|
4345
|
-
if (117853008 ==
|
|
4346
|
-
|
|
4347
|
-
let
|
|
4348
|
-
const
|
|
4349
|
-
if (
|
|
4350
|
-
const
|
|
4351
|
-
|
|
3958
|
+
})(u, 101010256, u.size, i$1, 1048560);
|
|
3959
|
+
if (!f2) {
|
|
3960
|
+
throw Nt(qt(await rt(u, 0, 4))) == r$1 ? new Error(At) : new Error("End of central directory not found");
|
|
3961
|
+
}
|
|
3962
|
+
const h2 = qt(f2);
|
|
3963
|
+
let p2 = Nt(h2, 12), w = Nt(h2, 16);
|
|
3964
|
+
const g2 = f2.offset, m2 = Vt(h2, 20), y3 = g2 + i$1 + m2;
|
|
3965
|
+
let b3 = Vt(h2, 4);
|
|
3966
|
+
const S2 = u.lastDiskNumber || 0;
|
|
3967
|
+
let k2 = Vt(h2, 6), z2 = Vt(h2, 8), x2 = 0, U2 = 0;
|
|
3968
|
+
if (w == e$1 || p2 == e$1 || z2 == t$1 || k2 == t$1) {
|
|
3969
|
+
const r2 = qt(await rt(u, f2.offset - 20, 20));
|
|
3970
|
+
if (117853008 == Nt(r2, 0)) {
|
|
3971
|
+
w = Zt(r2, 8);
|
|
3972
|
+
let n3 = await rt(u, w, 56, -1), s2 = qt(n3);
|
|
3973
|
+
const i2 = f2.offset - 20 - 56;
|
|
3974
|
+
if (Nt(s2, 0) != a$1 && w != i2) {
|
|
3975
|
+
const e2 = w;
|
|
3976
|
+
w = i2, w > e2 && (x2 = w - e2), n3 = await rt(u, w, 56, -1), s2 = qt(n3);
|
|
4352
3977
|
}
|
|
4353
|
-
if (
|
|
4354
|
-
|
|
3978
|
+
if (Nt(s2, 0) != a$1) throw new Error("End of Zip64 central directory locator not found");
|
|
3979
|
+
b3 == t$1 && (b3 = Nt(s2, 16)), k2 == t$1 && (k2 = Nt(s2, 20)), z2 == t$1 && (z2 = Zt(s2, 32)), p2 == e$1 && (p2 = Zt(s2, 40)), w -= p2;
|
|
4355
3980
|
}
|
|
4356
3981
|
}
|
|
4357
|
-
if (
|
|
4358
|
-
if (
|
|
4359
|
-
let
|
|
4360
|
-
if (
|
|
4361
|
-
const
|
|
4362
|
-
if (
|
|
4363
|
-
const
|
|
4364
|
-
|
|
3982
|
+
if (w >= u.size && (x2 = u.size - w - p2 - i$1, w = u.size - p2 - i$1), S2 != b3) throw new Error(At);
|
|
3983
|
+
if (w < 0) throw new Error(zt);
|
|
3984
|
+
let A2 = 0, v2 = await rt(u, w, p2, k2), D2 = qt(v2);
|
|
3985
|
+
if (p2) {
|
|
3986
|
+
const e2 = f2.offset - p2;
|
|
3987
|
+
if (Nt(D2, A2) != s$1 && w != e2) {
|
|
3988
|
+
const t2 = w;
|
|
3989
|
+
w = e2, w > t2 && (x2 += w - t2), v2 = await rt(u, w, p2, k2), D2 = qt(v2);
|
|
4365
3990
|
}
|
|
4366
3991
|
}
|
|
4367
|
-
const
|
|
4368
|
-
if (
|
|
4369
|
-
const
|
|
4370
|
-
for (let
|
|
4371
|
-
const
|
|
4372
|
-
if (
|
|
4373
|
-
|
|
4374
|
-
const
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
let
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
const
|
|
4382
|
-
|
|
4383
|
-
const
|
|
4384
|
-
|
|
4385
|
-
await
|
|
4386
|
-
|
|
3992
|
+
const _2 = f2.offset - w - (u.lastDiskOffset || 0);
|
|
3993
|
+
if (p2 != _2 && _2 >= 0 && (p2 = _2, v2 = await rt(u, w, p2, k2), D2 = qt(v2)), w < 0 || w >= u.size) throw new Error(zt);
|
|
3994
|
+
const F2 = It(l2, n2, "filenameEncoding"), O2 = It(l2, n2, "commentEncoding");
|
|
3995
|
+
for (let e2 = 0; e2 < z2; e2++) {
|
|
3996
|
+
const r2 = new Tt(u, d, l2.options);
|
|
3997
|
+
if (Nt(D2, A2) != s$1) throw new Error("Central directory header not found");
|
|
3998
|
+
Ct(r2, D2, A2 + 6);
|
|
3999
|
+
const a2 = Boolean(r2.bitFlag.languageEncodingFlag), i2 = A2 + 46, f3 = i2 + r2.filenameLength, h3 = f3 + r2.extraFieldLength, p3 = Vt(D2, A2 + 4), w2 = !(p3 >> 8), g3 = p3 >> 8 == 3, m3 = v2.subarray(i2, f3), y4 = Vt(D2, A2 + 32), b4 = h3 + y4, S3 = v2.subarray(h3, b4), k3 = a2, _3 = a2, E3 = Nt(D2, A2 + 38), T3 = 255 & E3, C2 = { readOnly: Boolean(1 & T3), hidden: Boolean(2 & T3), system: Boolean(4 & T3), directory: Boolean(16 & T3), archive: Boolean(32 & T3) }, R2 = Nt(D2, A2 + 42) + x2, W2 = It(l2, n2, "decodeText") || at, M2 = k3 ? Dt : F2 || _t, j2 = _3 ? Dt : O2 || _t;
|
|
4000
|
+
let I2 = W2(m3, M2);
|
|
4001
|
+
I2 === c$1 && (I2 = at(m3, M2));
|
|
4002
|
+
let B2 = W2(S3, j2);
|
|
4003
|
+
B2 === c$1 && (B2 = at(S3, j2)), Object.assign(r2, { versionMadeBy: p3, msDosCompatible: w2, compressedSize: 0, uncompressedSize: 0, commentLength: y4, offset: R2, diskNumberStart: Vt(D2, A2 + 34), internalFileAttributes: Vt(D2, A2 + 36), externalFileAttributes: E3, msdosAttributesRaw: T3, msdosAttributes: C2, rawFilename: m3, filenameUTF8: k3, commentUTF8: _3, rawExtraField: v2.subarray(f3, h3), rawComment: S3, filename: I2, comment: B2 }), U2 = Math.max(R2, U2), Rt(r2, r2, D2, A2 + 6);
|
|
4004
|
+
const P2 = r2.externalFileAttributes >> 16 & t$1;
|
|
4005
|
+
r2.unixMode === c$1 && 16877 & P2 && (r2.unixMode = P2);
|
|
4006
|
+
const L2 = Boolean(2048 & r2.unixMode), V2 = Boolean(1024 & r2.unixMode), N2 = Boolean(512 & r2.unixMode), Z2 = r2.unixMode !== c$1 ? !!(73 & r2.unixMode) : g3 && !!(73 & P2), q2 = r2.unixMode !== c$1 && (61440 & r2.unixMode) == o$1, H2 = (61440 & P2) == o$1;
|
|
4007
|
+
Object.assign(r2, { setuid: L2, setgid: V2, sticky: N2, unixExternalUpper: P2, internalFileAttribute: r2.internalFileAttributes, externalFileAttribute: r2.externalFileAttributes, executable: Z2, directory: q2 || H2 || w2 && C2.directory || I2.endsWith("/") && !r2.uncompressedSize, zipCrypto: r2.encrypted && !r2.extraFieldAES });
|
|
4008
|
+
const K2 = new kt(r2);
|
|
4009
|
+
K2.getData = (e3, t2) => r2.getData(e3, K2, l2.readRanges, t2), K2.arrayBuffer = async (e3) => {
|
|
4010
|
+
const t2 = new TransformStream(), [n3] = await Promise.all([new Response(t2.readable).arrayBuffer(), r2.getData(t2, K2, l2.readRanges, e3)]);
|
|
4011
|
+
return n3;
|
|
4012
|
+
}, A2 = b4;
|
|
4013
|
+
const { onprogress: G2 } = n2;
|
|
4014
|
+
if (G2) try {
|
|
4015
|
+
await G2(e2 + 1, z2, new kt(r2));
|
|
4016
|
+
} catch {
|
|
4387
4017
|
}
|
|
4388
|
-
yield
|
|
4018
|
+
yield K2;
|
|
4389
4019
|
}
|
|
4390
|
-
const E2 =
|
|
4391
|
-
return E2 && (
|
|
4020
|
+
const E2 = It(l2, n2, "extractPrependedData"), T2 = It(l2, n2, "extractAppendedData");
|
|
4021
|
+
return E2 && (l2.prependedData = U2 > 0 ? await rt(u, 0, U2) : new Uint8Array()), l2.comment = m2 ? await rt(u, g2 + i$1, m2) : new Uint8Array(), T2 && (l2.appendedData = y3 < u.size ? await rt(u, y3, u.size - y3) : new Uint8Array()), true;
|
|
4392
4022
|
}
|
|
4393
4023
|
async getEntries(e2 = {}) {
|
|
4394
4024
|
const t2 = [];
|
|
4395
|
-
for await (const
|
|
4025
|
+
for await (const r2 of this.getEntriesGenerator(e2)) t2.push(r2);
|
|
4396
4026
|
return t2;
|
|
4397
4027
|
}
|
|
4398
4028
|
async close() {
|
|
4399
4029
|
}
|
|
4400
4030
|
}
|
|
4401
|
-
class
|
|
4402
|
-
constructor(e2, t2,
|
|
4403
|
-
Object.assign(this, { reader: e2, config: t2, options:
|
|
4404
|
-
}
|
|
4405
|
-
async getData(e2, t2,
|
|
4406
|
-
const
|
|
4407
|
-
let
|
|
4408
|
-
const
|
|
4409
|
-
if (
|
|
4410
|
-
if (0 !=
|
|
4411
|
-
if (67324752 !=
|
|
4412
|
-
|
|
4413
|
-
const
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
const
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
const {
|
|
4427
|
-
let
|
|
4031
|
+
class Tt {
|
|
4032
|
+
constructor(e2, t2, r2) {
|
|
4033
|
+
Object.assign(this, { reader: e2, config: t2, options: r2 });
|
|
4034
|
+
}
|
|
4035
|
+
async getData(e2, t2, r2, s2 = {}) {
|
|
4036
|
+
const a2 = this, { reader: i2, offset: o2, diskNumberStart: l2, extraFieldAES: u, extraFieldZip64: d, compressionMethod: f2, config: h2, bitFlag: p2, signature: w, rawLastModDate: g2, uncompressedSize: m2, compressedSize: y3 } = a2, { dataDescriptor: b3 } = p2, S2 = t2.localDirectory = {}, k2 = qt(await rt(i2, o2, 30, l2));
|
|
4037
|
+
let z2 = It(a2, s2, "password"), x2 = It(a2, s2, "rawPassword");
|
|
4038
|
+
const U2 = It(a2, s2, "passThrough");
|
|
4039
|
+
if (z2 = z2 && z2.length && z2, x2 = x2 && x2.length && x2, u && 99 != u.originalCompressionMethod) throw new Error(Ut);
|
|
4040
|
+
if (0 != f2 && 8 != f2 && 9 != f2 && !U2) throw new Error(Ut);
|
|
4041
|
+
if (67324752 != Nt(k2, 0)) throw new Error("Local file header not found");
|
|
4042
|
+
Ct(S2, k2, 4);
|
|
4043
|
+
const { extraFieldLength: A2, filenameLength: v2, lastAccessDate: D2, creationDate: _2 } = S2;
|
|
4044
|
+
S2.rawExtraField = A2 ? await rt(i2, o2 + 30 + v2, A2, l2) : new Uint8Array(), Rt(a2, S2, k2, 4, true), Object.assign(t2, { lastAccessDate: D2, creationDate: _2 });
|
|
4045
|
+
const F2 = a2.encrypted && S2.encrypted && !U2, E2 = F2 && !u;
|
|
4046
|
+
if (U2 || (t2.zipCrypto = E2), F2) {
|
|
4047
|
+
if (!E2 && u.strength === c$1) throw new Error("Encryption method not supported");
|
|
4048
|
+
if (!z2 && !x2) throw new Error("File contains encrypted entry");
|
|
4049
|
+
}
|
|
4050
|
+
const T2 = o2 + 30 + v2 + A2, C2 = y3, R2 = i2.readable;
|
|
4051
|
+
Object.assign(R2, { diskNumberStart: l2, offset: T2, size: C2 });
|
|
4052
|
+
const W2 = It(a2, s2, "signal"), M2 = It(a2, s2, "checkPasswordOnly");
|
|
4053
|
+
let j2 = It(a2, s2, "checkOverlappingEntry");
|
|
4054
|
+
const I2 = It(a2, s2, "checkOverlappingEntryOnly");
|
|
4055
|
+
I2 && (j2 = true);
|
|
4056
|
+
const { onstart: B2, onprogress: P2, onend: L2 } = s2, V2 = 9 == f2;
|
|
4057
|
+
let N2 = It(a2, s2, "useCompressionStream");
|
|
4058
|
+
V2 && (N2 = false);
|
|
4059
|
+
const Z2 = { options: { codecType: Ue, password: z2, rawPassword: x2, zipCrypto: E2, encryptionStrength: u && u.strength, signed: It(a2, s2, "checkSignature") && !U2, passwordVerification: E2 && (b3 ? g2 >>> 8 & 255 : w >>> 24 & 255), outputSize: U2 ? y3 : m2, signature: w, compressed: 0 != f2 && !U2, encrypted: a2.encrypted && !U2, useWebWorkers: It(a2, s2, "useWebWorkers"), useCompressionStream: N2, transferStreams: It(a2, s2, "transferStreams"), deflate64: V2, checkPasswordOnly: M2 }, config: h2, streamOptions: { signal: W2, size: C2, onstart: B2, onprogress: P2, onend: L2 } };
|
|
4060
|
+
let q2;
|
|
4061
|
+
j2 && await (async function({ reader: e3, fileEntry: t3, offset: r3, diskNumberStart: s3, signature: a3, compressedSize: i3, uncompressedSize: o3, dataOffset: c, dataDescriptor: l3, extraFieldZip64: u2, readRanges: d2 }) {
|
|
4062
|
+
let f3 = 0;
|
|
4063
|
+
if (s3) for (let t4 = 0; t4 < s3; t4++) {
|
|
4064
|
+
f3 += e3.readers[t4].size;
|
|
4065
|
+
}
|
|
4066
|
+
let h3 = 0;
|
|
4067
|
+
l3 && (h3 = u2 ? 20 : 12);
|
|
4068
|
+
if (h3) {
|
|
4069
|
+
const r4 = await rt(e3, c + i3, h3 + 4, s3);
|
|
4070
|
+
if (Nt(qt(r4), 0) == n$1) {
|
|
4071
|
+
const e4 = Nt(qt(r4), 4);
|
|
4072
|
+
let n2, s4;
|
|
4073
|
+
u2 ? (n2 = Zt(qt(r4), 8), s4 = Zt(qt(r4), 16)) : (n2 = Nt(qt(r4), 8), s4 = Nt(qt(r4), 12));
|
|
4074
|
+
(t3.encrypted && !t3.zipCrypto || e4 == a3) && n2 == i3 && s4 == o3 && (h3 += 4);
|
|
4075
|
+
}
|
|
4076
|
+
}
|
|
4077
|
+
const p3 = { start: f3 + r3, end: f3 + c + i3 + h3, fileEntry: t3 };
|
|
4078
|
+
for (const e4 of d2) if (e4.fileEntry != t3 && p3.start >= e4.start && p3.start < e4.end) {
|
|
4079
|
+
const t4 = new Error(vt);
|
|
4080
|
+
throw t4.overlappingEntry = e4.fileEntry, t4;
|
|
4081
|
+
}
|
|
4082
|
+
d2.push(p3);
|
|
4083
|
+
})({ reader: i2, fileEntry: t2, offset: o2, diskNumberStart: l2, signature: w, compressedSize: y3, uncompressedSize: m2, dataOffset: T2, dataDescriptor: b3 || S2.bitFlag.dataDescriptor, extraFieldZip64: d || S2.extraFieldZip64, readRanges: r2 });
|
|
4428
4084
|
try {
|
|
4429
|
-
(
|
|
4430
|
-
|
|
4431
|
-
|
|
4085
|
+
if (!I2) {
|
|
4086
|
+
M2 && (e2 = new WritableStream()), e2 = new et(e2), await tt(e2, U2 ? y3 : m2), { writable: q2 } = e2;
|
|
4087
|
+
const { outputSize: t3 } = await Ve({ readable: R2, writable: q2 }, Z2);
|
|
4088
|
+
if (e2.size += t3, t3 != (U2 ? y3 : m2)) throw new Error(pe);
|
|
4089
|
+
}
|
|
4090
|
+
} catch (t3) {
|
|
4091
|
+
if (t3.outputSize !== c$1 && (e2.size += t3.outputSize), !M2 || t3.message != O) throw t3;
|
|
4432
4092
|
} finally {
|
|
4433
|
-
|
|
4434
|
-
E2.size += W2, e3 || E2.locked || await E2.getWriter().close();
|
|
4093
|
+
It(a2, s2, "preventClose") || !q2 || q2.locked || await q2.getWriter().close();
|
|
4435
4094
|
}
|
|
4436
|
-
return
|
|
4095
|
+
return M2 || I2 ? c$1 : e2.getData ? e2.getData() : q2;
|
|
4437
4096
|
}
|
|
4438
4097
|
}
|
|
4439
|
-
function
|
|
4440
|
-
const
|
|
4441
|
-
Object.assign(e2, { encrypted:
|
|
4098
|
+
function Ct(e2, t2, r2) {
|
|
4099
|
+
const n2 = e2.rawBitFlag = Vt(t2, r2 + 2), s2 = !(1 & ~n2), a2 = Nt(t2, r2 + 6);
|
|
4100
|
+
Object.assign(e2, { encrypted: s2, version: Vt(t2, r2), bitFlag: { level: (6 & n2) >> 1, dataDescriptor: !(8 & ~n2), languageEncodingFlag: !(2048 & ~n2) }, rawLastModDate: a2, lastModDate: Bt(a2), filenameLength: Vt(t2, r2 + 22), extraFieldLength: Vt(t2, r2 + 24) });
|
|
4442
4101
|
}
|
|
4443
|
-
|
|
4444
|
-
const { rawExtraField: a2 } = t2,
|
|
4445
|
-
let
|
|
4102
|
+
function Rt(e2, t2, r2, n2, s2) {
|
|
4103
|
+
const { rawExtraField: a2 } = t2, i2 = t2.extraField = /* @__PURE__ */ new Map(), o2 = qt(new Uint8Array(a2));
|
|
4104
|
+
let c = 0;
|
|
4446
4105
|
try {
|
|
4447
|
-
for (;
|
|
4448
|
-
const e3 =
|
|
4449
|
-
|
|
4106
|
+
for (; c < a2.length; ) {
|
|
4107
|
+
const e3 = Vt(o2, c), t3 = Vt(o2, c + 2);
|
|
4108
|
+
i2.set(e3, { type: e3, data: a2.slice(c + 4, c + 4 + t3) }), c += 4 + t3;
|
|
4450
4109
|
}
|
|
4451
|
-
} catch
|
|
4110
|
+
} catch {
|
|
4452
4111
|
}
|
|
4453
|
-
const
|
|
4454
|
-
Object.assign(t2, { signature:
|
|
4455
|
-
const u =
|
|
4112
|
+
const l2 = Vt(r2, n2 + 4);
|
|
4113
|
+
Object.assign(t2, { signature: Nt(r2, n2 + 10), compressedSize: Nt(r2, n2 + 14), uncompressedSize: Nt(r2, n2 + 18) });
|
|
4114
|
+
const u = i2.get(1);
|
|
4456
4115
|
u && (!(function(e3, t3) {
|
|
4457
4116
|
t3.zip64 = true;
|
|
4458
|
-
const
|
|
4459
|
-
for (let
|
|
4460
|
-
const [
|
|
4461
|
-
if (t3[
|
|
4462
|
-
const
|
|
4463
|
-
t3[
|
|
4464
|
-
} else if (e3[
|
|
4117
|
+
const r3 = qt(e3.data), n3 = Ft.filter(([e4, r4]) => t3[e4] == r4);
|
|
4118
|
+
for (let s3 = 0, a3 = 0; s3 < n3.length; s3++) {
|
|
4119
|
+
const [i3, o3] = n3[s3];
|
|
4120
|
+
if (t3[i3] == o3) {
|
|
4121
|
+
const n4 = Ot[o3];
|
|
4122
|
+
t3[i3] = e3[i3] = n4.getValue(r3, a3), a3 += n4.bytes;
|
|
4123
|
+
} else if (e3[i3]) throw new Error(xt);
|
|
4465
4124
|
}
|
|
4466
4125
|
})(u, t2), t2.extraFieldZip64 = u);
|
|
4467
|
-
const d =
|
|
4468
|
-
d && (
|
|
4469
|
-
const f2 =
|
|
4470
|
-
f2 && (
|
|
4471
|
-
const h2 =
|
|
4472
|
-
h2 ? (!(function(e3, t3,
|
|
4473
|
-
const
|
|
4474
|
-
Object.assign(e3, { vendorVersion:
|
|
4475
|
-
})(h2, t2,
|
|
4476
|
-
const
|
|
4477
|
-
|
|
4478
|
-
const
|
|
4479
|
-
let
|
|
4126
|
+
const d = i2.get(28789);
|
|
4127
|
+
d && (Wt(d, it, ot, t2, e2), t2.extraFieldUnicodePath = d);
|
|
4128
|
+
const f2 = i2.get(25461);
|
|
4129
|
+
f2 && (Wt(f2, ct, lt, t2, e2), t2.extraFieldUnicodeComment = f2);
|
|
4130
|
+
const h2 = i2.get(39169);
|
|
4131
|
+
h2 ? (!(function(e3, t3, r3) {
|
|
4132
|
+
const n3 = qt(e3.data), s3 = Lt(n3, 4);
|
|
4133
|
+
Object.assign(e3, { vendorVersion: Lt(n3, 0), vendorId: Lt(n3, 2), strength: s3, originalCompressionMethod: r3, compressionMethod: Vt(n3, 5) }), t3.compressionMethod = e3.compressionMethod;
|
|
4134
|
+
})(h2, t2, l2), t2.extraFieldAES = h2) : t2.compressionMethod = l2;
|
|
4135
|
+
const p2 = i2.get(10);
|
|
4136
|
+
p2 && (!(function(e3, t3) {
|
|
4137
|
+
const r3 = qt(e3.data);
|
|
4138
|
+
let n3, s3 = 4;
|
|
4480
4139
|
try {
|
|
4481
|
-
for (;
|
|
4482
|
-
const t4 =
|
|
4483
|
-
1 == t4 && (
|
|
4140
|
+
for (; s3 < e3.data.length && !n3; ) {
|
|
4141
|
+
const t4 = Vt(r3, s3), a3 = Vt(r3, s3 + 2);
|
|
4142
|
+
1 == t4 && (n3 = e3.data.slice(s3 + 4, s3 + 4 + a3)), s3 += 4 + a3;
|
|
4484
4143
|
}
|
|
4485
|
-
} catch
|
|
4144
|
+
} catch {
|
|
4486
4145
|
}
|
|
4487
4146
|
try {
|
|
4488
|
-
if (
|
|
4489
|
-
const
|
|
4490
|
-
Object.assign(e3, { rawLastModDate:
|
|
4491
|
-
const o3 =
|
|
4492
|
-
Object.assign(e3,
|
|
4147
|
+
if (n3 && 24 == n3.length) {
|
|
4148
|
+
const r4 = qt(n3), s4 = r4.getBigUint64(0, true), a3 = r4.getBigUint64(8, true), i3 = r4.getBigUint64(16, true);
|
|
4149
|
+
Object.assign(e3, { rawLastModDate: s4, rawLastAccessDate: a3, rawCreationDate: i3 });
|
|
4150
|
+
const o3 = Pt(s4), c2 = Pt(a3), l3 = { lastModDate: o3, lastAccessDate: c2, creationDate: Pt(i3) };
|
|
4151
|
+
Object.assign(e3, l3), Object.assign(t3, l3);
|
|
4493
4152
|
}
|
|
4494
|
-
} catch
|
|
4153
|
+
} catch {
|
|
4495
4154
|
}
|
|
4496
|
-
})(
|
|
4497
|
-
const
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4155
|
+
})(p2, t2), t2.extraFieldNTFS = p2);
|
|
4156
|
+
const w = i2.get(30805);
|
|
4157
|
+
if (w) Mt(w, t2, false), t2.extraFieldUnix = w;
|
|
4158
|
+
else {
|
|
4159
|
+
const e3 = i2.get(30837);
|
|
4160
|
+
e3 && (Mt(e3, t2, true), t2.extraFieldInfoZip = e3);
|
|
4161
|
+
}
|
|
4162
|
+
const g2 = i2.get(21589);
|
|
4163
|
+
g2 && (!(function(e3, t3, r3) {
|
|
4164
|
+
const n3 = qt(e3.data), s3 = Lt(n3, 0), a3 = [], i3 = [];
|
|
4165
|
+
r3 ? (1 & ~s3 || (a3.push(pt), i3.push(wt)), 2 & ~s3 || (a3.push(gt), i3.push(mt)), 4 & ~s3 || (a3.push(yt), i3.push(bt))) : e3.data.length >= 5 && (a3.push(pt), i3.push(wt));
|
|
4501
4166
|
let o3 = 1;
|
|
4502
|
-
a3.forEach((
|
|
4167
|
+
a3.forEach((r4, s4) => {
|
|
4503
4168
|
if (e3.data.length >= o3 + 4) {
|
|
4504
|
-
const a4 =
|
|
4505
|
-
t3[
|
|
4506
|
-
const
|
|
4507
|
-
e3[
|
|
4169
|
+
const a4 = Nt(n3, o3);
|
|
4170
|
+
t3[r4] = e3[r4] = new Date(1e3 * a4);
|
|
4171
|
+
const c2 = i3[s4];
|
|
4172
|
+
e3[c2] = a4;
|
|
4508
4173
|
}
|
|
4509
4174
|
o3 += 4;
|
|
4510
|
-
})
|
|
4511
|
-
})(
|
|
4512
|
-
const
|
|
4513
|
-
|
|
4514
|
-
}
|
|
4515
|
-
|
|
4516
|
-
const a2 =
|
|
4517
|
-
|
|
4518
|
-
const o2 =
|
|
4519
|
-
o2.setUint32(0,
|
|
4520
|
-
const
|
|
4521
|
-
Object.assign(e2, { version:
|
|
4522
|
-
}
|
|
4523
|
-
function
|
|
4524
|
-
return t2[n2] === S ? e2.options[n2] : t2[n2];
|
|
4525
|
-
}
|
|
4526
|
-
function Xt(e2) {
|
|
4527
|
-
const t2 = (4294901760 & e2) >> 16, n2 = 65535 & e2;
|
|
4175
|
+
});
|
|
4176
|
+
})(g2, t2, s2), t2.extraFieldExtendedTimestamp = g2);
|
|
4177
|
+
const m2 = i2.get(6534);
|
|
4178
|
+
m2 && (t2.extraFieldUSDZ = m2);
|
|
4179
|
+
}
|
|
4180
|
+
function Wt(e2, t2, r2, n2, s2) {
|
|
4181
|
+
const a2 = qt(e2.data), i2 = new y$1();
|
|
4182
|
+
i2.append(s2[r2]);
|
|
4183
|
+
const o2 = qt(new Uint8Array(4));
|
|
4184
|
+
o2.setUint32(0, i2.get(), true);
|
|
4185
|
+
const c = Nt(a2, 1);
|
|
4186
|
+
Object.assign(e2, { version: Lt(a2, 0), [t2]: at(e2.data.subarray(5)), valid: !s2.bitFlag.languageEncodingFlag && c == Nt(o2, 0) }), e2.valid && (n2[t2] = e2[t2], n2[t2 + "UTF8"] = true);
|
|
4187
|
+
}
|
|
4188
|
+
function Mt(e2, t2, r2) {
|
|
4528
4189
|
try {
|
|
4529
|
-
|
|
4530
|
-
|
|
4190
|
+
const n2 = qt(new Uint8Array(e2.data));
|
|
4191
|
+
let s2 = 0;
|
|
4192
|
+
const a2 = Lt(n2, s2++), i2 = Lt(n2, s2++), o2 = e2.data.subarray(s2, s2 + i2);
|
|
4193
|
+
s2 += i2;
|
|
4194
|
+
const l2 = jt(o2), u = Lt(n2, s2++), d = e2.data.subarray(s2, s2 + u);
|
|
4195
|
+
s2 += u;
|
|
4196
|
+
const f2 = jt(d);
|
|
4197
|
+
let h2 = c$1;
|
|
4198
|
+
if (!r2 && s2 + 2 <= e2.data.length) {
|
|
4199
|
+
const t3 = e2.data;
|
|
4200
|
+
h2 = new DataView(t3.buffer, t3.byteOffset + s2, 2).getUint16(0, true);
|
|
4201
|
+
}
|
|
4202
|
+
Object.assign(e2, { version: a2, uid: l2, gid: f2, unixMode: h2 }), l2 !== c$1 && (t2.uid = l2), f2 !== c$1 && (t2.gid = f2), h2 !== c$1 && (t2.unixMode = h2);
|
|
4203
|
+
} catch {
|
|
4204
|
+
}
|
|
4205
|
+
}
|
|
4206
|
+
function jt(e2) {
|
|
4207
|
+
const t2 = new Uint8Array(4);
|
|
4208
|
+
t2.set(e2, 0);
|
|
4209
|
+
return new DataView(t2.buffer, t2.byteOffset, 4).getUint32(0, true);
|
|
4210
|
+
}
|
|
4211
|
+
function It(e2, t2, r2) {
|
|
4212
|
+
return t2[r2] === c$1 ? e2.options[r2] : t2[r2];
|
|
4213
|
+
}
|
|
4214
|
+
function Bt(e2) {
|
|
4215
|
+
const r2 = (4294901760 & e2) >> 16, n2 = e2 & t$1;
|
|
4216
|
+
try {
|
|
4217
|
+
return new Date(1980 + ((65024 & r2) >> 9), ((480 & r2) >> 5) - 1, 31 & r2, (63488 & n2) >> 11, (2016 & n2) >> 5, 2 * (31 & n2), 0);
|
|
4218
|
+
} catch {
|
|
4531
4219
|
}
|
|
4532
4220
|
}
|
|
4533
|
-
function
|
|
4221
|
+
function Pt(e2) {
|
|
4534
4222
|
return new Date(Number(e2 / BigInt(1e4) - BigInt(116444736e5)));
|
|
4535
4223
|
}
|
|
4536
|
-
function
|
|
4224
|
+
function Lt(e2, t2) {
|
|
4537
4225
|
return e2.getUint8(t2);
|
|
4538
4226
|
}
|
|
4539
|
-
function
|
|
4227
|
+
function Vt(e2, t2) {
|
|
4540
4228
|
return e2.getUint16(t2, true);
|
|
4541
4229
|
}
|
|
4542
|
-
function
|
|
4230
|
+
function Nt(e2, t2) {
|
|
4543
4231
|
return e2.getUint32(t2, true);
|
|
4544
4232
|
}
|
|
4545
|
-
function
|
|
4233
|
+
function Zt(e2, t2) {
|
|
4546
4234
|
return Number(e2.getBigUint64(t2, true));
|
|
4547
4235
|
}
|
|
4548
|
-
function
|
|
4236
|
+
function qt(e2) {
|
|
4549
4237
|
return new DataView(e2.buffer);
|
|
4550
4238
|
}
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
const o2 = [];
|
|
4556
|
-
let l2, c, u = 0, d = 0, f2 = 0;
|
|
4557
|
-
if (0 !== e3.length) {
|
|
4558
|
-
t2.next_in_index = 0, t2.next_in = e3, t2.avail_in = e3.length;
|
|
4559
|
-
do {
|
|
4560
|
-
if (t2.next_out_index = 0, t2.avail_out = i2, 0 !== t2.avail_in || a2 || (t2.next_in_index = 0, a2 = true), l2 = t2.inflate(0), a2 && l2 === n$1) {
|
|
4561
|
-
if (0 !== t2.avail_in) throw new Error("inflating: bad input");
|
|
4562
|
-
} else if (0 !== l2 && 1 !== l2) throw new Error("inflating: " + t2.msg);
|
|
4563
|
-
if ((a2 || 1 === l2) && t2.avail_in === e3.length) throw new Error("inflating: bad input");
|
|
4564
|
-
t2.next_out_index && (t2.next_out_index === i2 ? o2.push(new Uint8Array(r2)) : o2.push(r2.subarray(0, t2.next_out_index))), f2 += t2.next_out_index, s2 && t2.next_in_index > 0 && t2.next_in_index != u && (s2(t2.next_in_index), u = t2.next_in_index);
|
|
4565
|
-
} while (t2.avail_in > 0 || 0 === t2.avail_out);
|
|
4566
|
-
return o2.length > 1 ? (c = new Uint8Array(f2), o2.forEach((function(e4) {
|
|
4567
|
-
c.set(e4, d), d += e4.length;
|
|
4568
|
-
}))) : c = o2[0] ? new Uint8Array(o2[0]) : new Uint8Array(), c;
|
|
4569
|
-
}
|
|
4570
|
-
}, this.flush = function() {
|
|
4571
|
-
t2.inflateEnd();
|
|
4572
|
-
};
|
|
4573
|
-
} });
|
|
4239
|
+
try {
|
|
4240
|
+
w$1({ baseURI: import.meta.url });
|
|
4241
|
+
} catch {
|
|
4242
|
+
}
|
|
4574
4243
|
const zip = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4575
4244
|
__proto__: null,
|
|
4576
|
-
BlobReader:
|
|
4577
|
-
BlobWriter:
|
|
4578
|
-
TextWriter:
|
|
4579
|
-
ZipReader:
|
|
4580
|
-
configure:
|
|
4245
|
+
BlobReader: Ge,
|
|
4246
|
+
BlobWriter: Je,
|
|
4247
|
+
TextWriter: Qe,
|
|
4248
|
+
ZipReader: Et,
|
|
4249
|
+
configure: w$1
|
|
4581
4250
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4582
4251
|
const NS$2 = {
|
|
4583
4252
|
CONTAINER: "urn:oasis:names:tc:opendocument:xmlns:container",
|
|
@@ -4697,9 +4366,9 @@ const getPrefixes = (doc) => {
|
|
|
4697
4366
|
};
|
|
4698
4367
|
const getPropertyURL = (value, prefixes) => {
|
|
4699
4368
|
if (!value) return null;
|
|
4700
|
-
const [a2,
|
|
4701
|
-
const prefix =
|
|
4702
|
-
const reference =
|
|
4369
|
+
const [a2, b3] = value.split(":");
|
|
4370
|
+
const prefix = b3 ? a2 : null;
|
|
4371
|
+
const reference = b3 ? b3 : a2;
|
|
4703
4372
|
const baseURL = prefixes.get(prefix);
|
|
4704
4373
|
return baseURL ? baseURL + reference : null;
|
|
4705
4374
|
};
|
|
@@ -4748,7 +4417,7 @@ const getMetadata = (opf) => {
|
|
|
4748
4417
|
if (!alts.length && (!x2.lang || x2.lang === baseLang) && !altRep) return x2.value;
|
|
4749
4418
|
const map = { [x2.lang ?? baseLang]: x2.value };
|
|
4750
4419
|
if (altRep) map[x2.attrs["alt-rep-lang"]] = altRep;
|
|
4751
|
-
for (const
|
|
4420
|
+
for (const y3 of alts) map[y3.lang] ??= y3.value;
|
|
4752
4421
|
return map;
|
|
4753
4422
|
};
|
|
4754
4423
|
const makeContributor = (x2) => {
|
|
@@ -4799,7 +4468,7 @@ const getMetadata = (opf) => {
|
|
|
4799
4468
|
subtitle: (_h = (_g = dc.title) == null ? void 0 : _g.find((x2) => prop(x2, "title-type") === "subtitle")) == null ? void 0 : _h.value,
|
|
4800
4469
|
language: (_i = dc.language) == null ? void 0 : _i.map((x2) => x2.value),
|
|
4801
4470
|
description: one(dc.description),
|
|
4802
|
-
publisher:
|
|
4471
|
+
publisher: (_j = dc.publisher) == null ? void 0 : _j.map(makeContributor),
|
|
4803
4472
|
published: ((_l = (_k = dc.date) == null ? void 0 : _k.find((x2) => x2.attrs.event === "publication")) == null ? void 0 : _l.value) ?? one(dc.date),
|
|
4804
4473
|
modified: one(properties[PREFIX.dcterms + "modified"]) ?? ((_n = (_m = dc.date) == null ? void 0 : _m.find((x2) => x2.attrs.event === "modification")) == null ? void 0 : _n.value),
|
|
4805
4474
|
subject: (_o = dc.subject) == null ? void 0 : _o.map(makeContributor),
|
|
@@ -4813,7 +4482,9 @@ const getMetadata = (opf) => {
|
|
|
4813
4482
|
altIdentifier: (_r = dc.identifier) == null ? void 0 : _r.map(makeAltIdentifier),
|
|
4814
4483
|
source: (_s = dc.source) == null ? void 0 : _s.map(makeAltIdentifier),
|
|
4815
4484
|
// NOTE: not in webpub schema
|
|
4816
|
-
rights: one(dc.rights)
|
|
4485
|
+
rights: one(dc.rights),
|
|
4486
|
+
// NOTE: not in webpub schema
|
|
4487
|
+
pageBreakSource: one(properties["pageBreakSource"])
|
|
4817
4488
|
// NOTE: not in webpub schema
|
|
4818
4489
|
};
|
|
4819
4490
|
const remapContributor = (defaultKey) => (x2) => {
|
|
@@ -5568,7 +5239,7 @@ const makeComicBook = ({ entries, loadBlob, getSize }, file) => {
|
|
|
5568
5239
|
cache.delete(name);
|
|
5569
5240
|
};
|
|
5570
5241
|
const exts = [".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp", ".svg", ".jxl", ".avif"];
|
|
5571
|
-
const files = entries.map((entry) => entry.filename).filter((name) => exts.some((ext) => name.endsWith(ext))).sort();
|
|
5242
|
+
const files = entries.map((entry) => entry.filename).filter((name) => exts.some((ext) => name.endsWith(ext))).sort(new Intl.Collator([], { numeric: true }).compare);
|
|
5572
5243
|
if (!files.length) throw new Error("No supported image files in archive");
|
|
5573
5244
|
const book = {};
|
|
5574
5245
|
book.getCover = () => loadBlob(files[0]);
|
|
@@ -5879,7 +5550,7 @@ const makeFB2 = async (blob) => {
|
|
|
5879
5550
|
var _a2;
|
|
5880
5551
|
return ((_a2 = el2.getAttribute("src")) == null ? void 0 : _a2.length) ?? 0;
|
|
5881
5552
|
}
|
|
5882
|
-
).reduce((a2,
|
|
5553
|
+
).reduce((a2, b3) => a2 + b3, 0),
|
|
5883
5554
|
linear
|
|
5884
5555
|
};
|
|
5885
5556
|
});
|
|
@@ -5901,8 +5572,8 @@ const makeFB2 = async (blob) => {
|
|
|
5901
5572
|
};
|
|
5902
5573
|
}).filter((item) => item);
|
|
5903
5574
|
book.resolveHref = (href) => {
|
|
5904
|
-
const [a2,
|
|
5905
|
-
return a2 ? { index: Number(a2), anchor: (doc2) => doc2.querySelector(`[${dataID}="${
|
|
5575
|
+
const [a2, b3] = href.split("#");
|
|
5576
|
+
return a2 ? { index: Number(a2), anchor: (doc2) => doc2.querySelector(`[${dataID}="${b3}"]`) } : { index: idMap.get(b3), anchor: (doc2) => doc2.getElementById(b3) };
|
|
5906
5577
|
};
|
|
5907
5578
|
book.splitTOCHref = (href) => {
|
|
5908
5579
|
var _a;
|
|
@@ -5918,6 +5589,415 @@ const fb2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty(
|
|
|
5918
5589
|
__proto__: null,
|
|
5919
5590
|
makeFB2
|
|
5920
5591
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
5592
|
+
const textLayerBuilderCSS = '/* Copyright 2014 Mozilla Foundation\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the "License");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an "AS IS" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n.textLayer {\r\n color-scheme: only light;\r\n\r\n position: absolute;\r\n text-align: initial;\r\n inset: 0;\r\n overflow: clip;\r\n opacity: 1;\r\n line-height: 1;\r\n text-size-adjust: none;\r\n forced-color-adjust: none;\r\n transform-origin: 0 0;\r\n caret-color: CanvasText;\r\n z-index: 0;\r\n\r\n &.highlighting {\r\n touch-action: none;\r\n }\r\n\r\n :is(span, br) {\r\n color: transparent;\r\n position: absolute;\r\n white-space: pre;\r\n cursor: text;\r\n transform-origin: 0% 0%;\r\n }\r\n\r\n /* We multiply the font size by --min-font-size, and then scale the text\r\n * elements by 1/--min-font-size. This allows us to effectively ignore the\r\n * minimum font size enforced by the browser, so that the text layer <span>s\r\n * can always match the size of the text in the canvas. */\r\n --min-font-size: 1;\r\n --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size));\r\n --min-font-size-inv: calc(1 / var(--min-font-size));\r\n\r\n > :not(.markedContent),\r\n .markedContent span:not(.markedContent) {\r\n z-index: 1;\r\n\r\n --font-height: 0; /* set by text_layer.js */\r\n font-size: calc(var(--text-scale-factor) * var(--font-height));\r\n\r\n --scale-x: 1;\r\n --rotate: 0deg;\r\n transform: rotate(var(--rotate)) scaleX(var(--scale-x))\r\n scale(var(--min-font-size-inv));\r\n }\r\n\r\n .markedContent {\r\n display: contents;\r\n }\r\n\r\n span[role="img"] {\r\n user-select: none;\r\n cursor: default;\r\n }\r\n\r\n .highlight {\r\n --highlight-bg-color: rgb(180 0 170 / 0.25);\r\n --highlight-selected-bg-color: rgb(0 100 0 / 0.25);\r\n --highlight-backdrop-filter: none;\r\n --highlight-selected-backdrop-filter: none;\r\n\r\n @media screen and (forced-colors: active) {\r\n --highlight-bg-color: transparent;\r\n --highlight-selected-bg-color: transparent;\r\n --highlight-backdrop-filter: var(--hcm-highlight-filter);\r\n --highlight-selected-backdrop-filter: var(\r\n --hcm-highlight-selected-filter\r\n );\r\n }\r\n\r\n margin: -1px;\r\n padding: 1px;\r\n background-color: var(--highlight-bg-color);\r\n backdrop-filter: var(--highlight-backdrop-filter);\r\n border-radius: 4px;\r\n\r\n &.appended {\r\n position: initial;\r\n }\r\n\r\n &.begin {\r\n border-radius: 4px 0 0 4px;\r\n }\r\n\r\n &.end {\r\n border-radius: 0 4px 4px 0;\r\n }\r\n\r\n &.middle {\r\n border-radius: 0;\r\n }\r\n\r\n &.selected {\r\n background-color: var(--highlight-selected-bg-color);\r\n backdrop-filter: var(--highlight-selected-backdrop-filter);\r\n }\r\n }\r\n\r\n ::selection {\r\n /* stylelint-disable declaration-block-no-duplicate-properties */\r\n /*#if !MOZCENTRAL*/\r\n background: rgba(0 0 255 / 0.25);\r\n /*#endif*/\r\n /* stylelint-enable declaration-block-no-duplicate-properties */\r\n background: color-mix(in srgb, AccentColor, transparent 75%);\r\n }\r\n\r\n /* Avoids https://github.com/mozilla/pdf.js/issues/13840 in Chrome */\r\n /*#if !MOZCENTRAL*/\r\n br::selection {\r\n background: transparent;\r\n }\r\n /*#endif*/\r\n\r\n .endOfContent {\r\n display: block;\r\n position: absolute;\r\n inset: 100% 0 0;\r\n z-index: 0;\r\n cursor: default;\r\n user-select: none;\r\n }\r\n\r\n &.selecting .endOfContent {\r\n top: 0;\r\n }\r\n}\r\n';
|
|
5593
|
+
const annotationLayerBuilderCSS = `/* Copyright 2014 Mozilla Foundation\r
|
|
5594
|
+
*\r
|
|
5595
|
+
* Licensed under the Apache License, Version 2.0 (the "License");\r
|
|
5596
|
+
* you may not use this file except in compliance with the License.\r
|
|
5597
|
+
* You may obtain a copy of the License at\r
|
|
5598
|
+
*\r
|
|
5599
|
+
* http://www.apache.org/licenses/LICENSE-2.0\r
|
|
5600
|
+
*\r
|
|
5601
|
+
* Unless required by applicable law or agreed to in writing, software\r
|
|
5602
|
+
* distributed under the License is distributed on an "AS IS" BASIS,\r
|
|
5603
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
|
|
5604
|
+
* See the License for the specific language governing permissions and\r
|
|
5605
|
+
* limitations under the License.\r
|
|
5606
|
+
*/\r
|
|
5607
|
+
\r
|
|
5608
|
+
.annotationLayer {\r
|
|
5609
|
+
color-scheme: only light;\r
|
|
5610
|
+
\r
|
|
5611
|
+
--annotation-unfocused-field-background: url("data:image/svg+xml;charset=UTF-8,<svg width='1px' height='1px' xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' style='fill:rgba(0, 54, 255, 0.13);'/></svg>");\r
|
|
5612
|
+
--input-focus-border-color: Highlight;\r
|
|
5613
|
+
--input-focus-outline: 1px solid Canvas;\r
|
|
5614
|
+
--input-unfocused-border-color: transparent;\r
|
|
5615
|
+
--input-disabled-border-color: transparent;\r
|
|
5616
|
+
--input-hover-border-color: black;\r
|
|
5617
|
+
--link-outline: none;\r
|
|
5618
|
+
\r
|
|
5619
|
+
@media screen and (forced-colors: active) {\r
|
|
5620
|
+
--input-focus-border-color: CanvasText;\r
|
|
5621
|
+
--input-unfocused-border-color: ActiveText;\r
|
|
5622
|
+
--input-disabled-border-color: GrayText;\r
|
|
5623
|
+
--input-hover-border-color: Highlight;\r
|
|
5624
|
+
--link-outline: 1.5px solid LinkText;\r
|
|
5625
|
+
\r
|
|
5626
|
+
.textWidgetAnnotation :is(input, textarea):required,\r
|
|
5627
|
+
.choiceWidgetAnnotation select:required,\r
|
|
5628
|
+
.buttonWidgetAnnotation:is(.checkBox, .radioButton) input:required {\r
|
|
5629
|
+
outline: 1.5px solid selectedItem;\r
|
|
5630
|
+
}\r
|
|
5631
|
+
\r
|
|
5632
|
+
.linkAnnotation {\r
|
|
5633
|
+
outline: var(--link-outline);\r
|
|
5634
|
+
\r
|
|
5635
|
+
&:hover {\r
|
|
5636
|
+
backdrop-filter: var(--hcm-highlight-filter);\r
|
|
5637
|
+
}\r
|
|
5638
|
+
\r
|
|
5639
|
+
& > a:hover {\r
|
|
5640
|
+
opacity: 0 !important;\r
|
|
5641
|
+
background: none !important;\r
|
|
5642
|
+
box-shadow: none;\r
|
|
5643
|
+
}\r
|
|
5644
|
+
}\r
|
|
5645
|
+
\r
|
|
5646
|
+
.popupAnnotation .popup {\r
|
|
5647
|
+
outline: calc(1.5px * var(--total-scale-factor)) solid CanvasText !important;\r
|
|
5648
|
+
background-color: ButtonFace !important;\r
|
|
5649
|
+
color: ButtonText !important;\r
|
|
5650
|
+
}\r
|
|
5651
|
+
\r
|
|
5652
|
+
.highlightArea:hover::after {\r
|
|
5653
|
+
position: absolute;\r
|
|
5654
|
+
top: 0;\r
|
|
5655
|
+
left: 0;\r
|
|
5656
|
+
width: 100%;\r
|
|
5657
|
+
height: 100%;\r
|
|
5658
|
+
backdrop-filter: var(--hcm-highlight-filter);\r
|
|
5659
|
+
content: "";\r
|
|
5660
|
+
pointer-events: none;\r
|
|
5661
|
+
}\r
|
|
5662
|
+
\r
|
|
5663
|
+
.popupAnnotation.focused .popup {\r
|
|
5664
|
+
outline: calc(3px * var(--total-scale-factor)) solid Highlight !important;\r
|
|
5665
|
+
}\r
|
|
5666
|
+
}\r
|
|
5667
|
+
\r
|
|
5668
|
+
position: absolute;\r
|
|
5669
|
+
top: 0;\r
|
|
5670
|
+
left: 0;\r
|
|
5671
|
+
pointer-events: none;\r
|
|
5672
|
+
transform-origin: 0 0;\r
|
|
5673
|
+
\r
|
|
5674
|
+
&[data-main-rotation="90"] .norotate {\r
|
|
5675
|
+
transform: rotate(270deg) translateX(-100%);\r
|
|
5676
|
+
}\r
|
|
5677
|
+
&[data-main-rotation="180"] .norotate {\r
|
|
5678
|
+
transform: rotate(180deg) translate(-100%, -100%);\r
|
|
5679
|
+
}\r
|
|
5680
|
+
&[data-main-rotation="270"] .norotate {\r
|
|
5681
|
+
transform: rotate(90deg) translateY(-100%);\r
|
|
5682
|
+
}\r
|
|
5683
|
+
\r
|
|
5684
|
+
&.disabled {\r
|
|
5685
|
+
section,\r
|
|
5686
|
+
.popup {\r
|
|
5687
|
+
pointer-events: none;\r
|
|
5688
|
+
}\r
|
|
5689
|
+
}\r
|
|
5690
|
+
\r
|
|
5691
|
+
.annotationContent {\r
|
|
5692
|
+
position: absolute;\r
|
|
5693
|
+
width: 100%;\r
|
|
5694
|
+
height: 100%;\r
|
|
5695
|
+
pointer-events: none;\r
|
|
5696
|
+
\r
|
|
5697
|
+
&.freetext {\r
|
|
5698
|
+
background: transparent;\r
|
|
5699
|
+
border: none;\r
|
|
5700
|
+
inset: 0;\r
|
|
5701
|
+
overflow: visible;\r
|
|
5702
|
+
white-space: nowrap;\r
|
|
5703
|
+
font: 10px sans-serif;\r
|
|
5704
|
+
line-height: 1.35;\r
|
|
5705
|
+
}\r
|
|
5706
|
+
}\r
|
|
5707
|
+
\r
|
|
5708
|
+
section {\r
|
|
5709
|
+
position: absolute;\r
|
|
5710
|
+
text-align: initial;\r
|
|
5711
|
+
pointer-events: auto;\r
|
|
5712
|
+
box-sizing: border-box;\r
|
|
5713
|
+
transform-origin: 0 0;\r
|
|
5714
|
+
user-select: none;\r
|
|
5715
|
+
\r
|
|
5716
|
+
&:has(div.annotationContent) {\r
|
|
5717
|
+
canvas.annotationContent {\r
|
|
5718
|
+
display: none;\r
|
|
5719
|
+
}\r
|
|
5720
|
+
}\r
|
|
5721
|
+
\r
|
|
5722
|
+
.overlaidText {\r
|
|
5723
|
+
position: absolute;\r
|
|
5724
|
+
top: 0;\r
|
|
5725
|
+
left: 0;\r
|
|
5726
|
+
width: 0;\r
|
|
5727
|
+
height: 0;\r
|
|
5728
|
+
display: inline-block;\r
|
|
5729
|
+
overflow: hidden;\r
|
|
5730
|
+
}\r
|
|
5731
|
+
}\r
|
|
5732
|
+
\r
|
|
5733
|
+
.textLayer.selecting ~ & section {\r
|
|
5734
|
+
pointer-events: none;\r
|
|
5735
|
+
}\r
|
|
5736
|
+
\r
|
|
5737
|
+
:is(.linkAnnotation, .buttonWidgetAnnotation.pushButton) > a {\r
|
|
5738
|
+
position: absolute;\r
|
|
5739
|
+
font-size: 1em;\r
|
|
5740
|
+
top: 0;\r
|
|
5741
|
+
left: 0;\r
|
|
5742
|
+
width: 100%;\r
|
|
5743
|
+
height: 100%;\r
|
|
5744
|
+
}\r
|
|
5745
|
+
\r
|
|
5746
|
+
:is(.linkAnnotation, .buttonWidgetAnnotation.pushButton):not(.hasBorder)\r
|
|
5747
|
+
> a:hover {\r
|
|
5748
|
+
opacity: 0.2;\r
|
|
5749
|
+
background-color: rgb(255 255 0);\r
|
|
5750
|
+
}\r
|
|
5751
|
+
\r
|
|
5752
|
+
.linkAnnotation.hasBorder:hover {\r
|
|
5753
|
+
background-color: rgb(255 255 0 / 0.2);\r
|
|
5754
|
+
}\r
|
|
5755
|
+
\r
|
|
5756
|
+
.hasBorder {\r
|
|
5757
|
+
background-size: 100% 100%;\r
|
|
5758
|
+
}\r
|
|
5759
|
+
\r
|
|
5760
|
+
.textAnnotation img {\r
|
|
5761
|
+
position: absolute;\r
|
|
5762
|
+
cursor: pointer;\r
|
|
5763
|
+
width: 100%;\r
|
|
5764
|
+
height: 100%;\r
|
|
5765
|
+
top: 0;\r
|
|
5766
|
+
left: 0;\r
|
|
5767
|
+
}\r
|
|
5768
|
+
\r
|
|
5769
|
+
.textWidgetAnnotation :is(input, textarea),\r
|
|
5770
|
+
.choiceWidgetAnnotation select,\r
|
|
5771
|
+
.buttonWidgetAnnotation:is(.checkBox, .radioButton) input {\r
|
|
5772
|
+
background-image: var(--annotation-unfocused-field-background);\r
|
|
5773
|
+
border: 2px solid var(--input-unfocused-border-color);\r
|
|
5774
|
+
box-sizing: border-box;\r
|
|
5775
|
+
font: calc(9px * var(--total-scale-factor)) sans-serif;\r
|
|
5776
|
+
height: 100%;\r
|
|
5777
|
+
margin: 0;\r
|
|
5778
|
+
vertical-align: top;\r
|
|
5779
|
+
width: 100%;\r
|
|
5780
|
+
}\r
|
|
5781
|
+
\r
|
|
5782
|
+
.textWidgetAnnotation :is(input, textarea):required,\r
|
|
5783
|
+
.choiceWidgetAnnotation select:required,\r
|
|
5784
|
+
.buttonWidgetAnnotation:is(.checkBox, .radioButton) input:required {\r
|
|
5785
|
+
outline: 1.5px solid red;\r
|
|
5786
|
+
}\r
|
|
5787
|
+
\r
|
|
5788
|
+
.choiceWidgetAnnotation select option {\r
|
|
5789
|
+
padding: 0;\r
|
|
5790
|
+
}\r
|
|
5791
|
+
\r
|
|
5792
|
+
.buttonWidgetAnnotation.radioButton input {\r
|
|
5793
|
+
border-radius: 50%;\r
|
|
5794
|
+
}\r
|
|
5795
|
+
\r
|
|
5796
|
+
.textWidgetAnnotation textarea {\r
|
|
5797
|
+
resize: none;\r
|
|
5798
|
+
}\r
|
|
5799
|
+
\r
|
|
5800
|
+
.textWidgetAnnotation :is(input, textarea)[disabled],\r
|
|
5801
|
+
.choiceWidgetAnnotation select[disabled],\r
|
|
5802
|
+
.buttonWidgetAnnotation:is(.checkBox, .radioButton) input[disabled] {\r
|
|
5803
|
+
background: none;\r
|
|
5804
|
+
border: 2px solid var(--input-disabled-border-color);\r
|
|
5805
|
+
cursor: not-allowed;\r
|
|
5806
|
+
}\r
|
|
5807
|
+
\r
|
|
5808
|
+
.textWidgetAnnotation :is(input, textarea):hover,\r
|
|
5809
|
+
.choiceWidgetAnnotation select:hover,\r
|
|
5810
|
+
.buttonWidgetAnnotation:is(.checkBox, .radioButton) input:hover {\r
|
|
5811
|
+
border: 2px solid var(--input-hover-border-color);\r
|
|
5812
|
+
}\r
|
|
5813
|
+
.textWidgetAnnotation :is(input, textarea):hover,\r
|
|
5814
|
+
.choiceWidgetAnnotation select:hover,\r
|
|
5815
|
+
.buttonWidgetAnnotation.checkBox input:hover {\r
|
|
5816
|
+
border-radius: 2px;\r
|
|
5817
|
+
}\r
|
|
5818
|
+
\r
|
|
5819
|
+
.textWidgetAnnotation :is(input, textarea):focus,\r
|
|
5820
|
+
.choiceWidgetAnnotation select:focus {\r
|
|
5821
|
+
background: none;\r
|
|
5822
|
+
border: 2px solid var(--input-focus-border-color);\r
|
|
5823
|
+
border-radius: 2px;\r
|
|
5824
|
+
outline: var(--input-focus-outline);\r
|
|
5825
|
+
}\r
|
|
5826
|
+
\r
|
|
5827
|
+
.buttonWidgetAnnotation:is(.checkBox, .radioButton) :focus {\r
|
|
5828
|
+
background-image: none;\r
|
|
5829
|
+
background-color: transparent;\r
|
|
5830
|
+
}\r
|
|
5831
|
+
\r
|
|
5832
|
+
.buttonWidgetAnnotation.checkBox :focus {\r
|
|
5833
|
+
border: 2px solid var(--input-focus-border-color);\r
|
|
5834
|
+
border-radius: 2px;\r
|
|
5835
|
+
outline: var(--input-focus-outline);\r
|
|
5836
|
+
}\r
|
|
5837
|
+
\r
|
|
5838
|
+
.buttonWidgetAnnotation.radioButton :focus {\r
|
|
5839
|
+
border: 2px solid var(--input-focus-border-color);\r
|
|
5840
|
+
outline: var(--input-focus-outline);\r
|
|
5841
|
+
}\r
|
|
5842
|
+
\r
|
|
5843
|
+
.buttonWidgetAnnotation.checkBox input:checked::before,\r
|
|
5844
|
+
.buttonWidgetAnnotation.checkBox input:checked::after,\r
|
|
5845
|
+
.buttonWidgetAnnotation.radioButton input:checked::before {\r
|
|
5846
|
+
background-color: CanvasText;\r
|
|
5847
|
+
content: "";\r
|
|
5848
|
+
display: block;\r
|
|
5849
|
+
position: absolute;\r
|
|
5850
|
+
}\r
|
|
5851
|
+
\r
|
|
5852
|
+
.buttonWidgetAnnotation.checkBox input:checked::before,\r
|
|
5853
|
+
.buttonWidgetAnnotation.checkBox input:checked::after {\r
|
|
5854
|
+
height: 80%;\r
|
|
5855
|
+
left: 45%;\r
|
|
5856
|
+
width: 1px;\r
|
|
5857
|
+
}\r
|
|
5858
|
+
\r
|
|
5859
|
+
.buttonWidgetAnnotation.checkBox input:checked::before {\r
|
|
5860
|
+
transform: rotate(45deg);\r
|
|
5861
|
+
}\r
|
|
5862
|
+
\r
|
|
5863
|
+
.buttonWidgetAnnotation.checkBox input:checked::after {\r
|
|
5864
|
+
transform: rotate(-45deg);\r
|
|
5865
|
+
}\r
|
|
5866
|
+
\r
|
|
5867
|
+
.buttonWidgetAnnotation.radioButton input:checked::before {\r
|
|
5868
|
+
border-radius: 50%;\r
|
|
5869
|
+
height: 50%;\r
|
|
5870
|
+
left: 25%;\r
|
|
5871
|
+
top: 25%;\r
|
|
5872
|
+
width: 50%;\r
|
|
5873
|
+
}\r
|
|
5874
|
+
\r
|
|
5875
|
+
.textWidgetAnnotation input.comb {\r
|
|
5876
|
+
font-family: monospace;\r
|
|
5877
|
+
padding-left: 2px;\r
|
|
5878
|
+
padding-right: 0;\r
|
|
5879
|
+
}\r
|
|
5880
|
+
\r
|
|
5881
|
+
.textWidgetAnnotation input.comb:focus {\r
|
|
5882
|
+
/*\r
|
|
5883
|
+
* Letter spacing is placed on the right side of each character. Hence, the\r
|
|
5884
|
+
* letter spacing of the last character may be placed outside the visible\r
|
|
5885
|
+
* area, causing horizontal scrolling. We avoid this by extending the width\r
|
|
5886
|
+
* when the element has focus and revert this when it loses focus.\r
|
|
5887
|
+
*/\r
|
|
5888
|
+
width: 103%;\r
|
|
5889
|
+
}\r
|
|
5890
|
+
\r
|
|
5891
|
+
.buttonWidgetAnnotation:is(.checkBox, .radioButton) input {\r
|
|
5892
|
+
appearance: none;\r
|
|
5893
|
+
}\r
|
|
5894
|
+
\r
|
|
5895
|
+
.fileAttachmentAnnotation .popupTriggerArea {\r
|
|
5896
|
+
height: 100%;\r
|
|
5897
|
+
width: 100%;\r
|
|
5898
|
+
}\r
|
|
5899
|
+
\r
|
|
5900
|
+
.popupAnnotation {\r
|
|
5901
|
+
position: absolute;\r
|
|
5902
|
+
font-size: calc(9px * var(--total-scale-factor));\r
|
|
5903
|
+
pointer-events: none;\r
|
|
5904
|
+
width: max-content;\r
|
|
5905
|
+
max-width: 45%;\r
|
|
5906
|
+
height: auto;\r
|
|
5907
|
+
}\r
|
|
5908
|
+
\r
|
|
5909
|
+
.popup {\r
|
|
5910
|
+
background-color: rgb(255 255 153);\r
|
|
5911
|
+
color: black;\r
|
|
5912
|
+
box-shadow: 0 calc(2px * var(--total-scale-factor))\r
|
|
5913
|
+
calc(5px * var(--total-scale-factor)) rgb(136 136 136);\r
|
|
5914
|
+
border-radius: calc(2px * var(--total-scale-factor));\r
|
|
5915
|
+
outline: 1.5px solid rgb(255 255 74);\r
|
|
5916
|
+
padding: calc(6px * var(--total-scale-factor));\r
|
|
5917
|
+
cursor: pointer;\r
|
|
5918
|
+
font: message-box;\r
|
|
5919
|
+
white-space: normal;\r
|
|
5920
|
+
word-wrap: break-word;\r
|
|
5921
|
+
pointer-events: auto;\r
|
|
5922
|
+
user-select: text;\r
|
|
5923
|
+
}\r
|
|
5924
|
+
\r
|
|
5925
|
+
.popupAnnotation.focused .popup {\r
|
|
5926
|
+
outline-width: 3px;\r
|
|
5927
|
+
}\r
|
|
5928
|
+
\r
|
|
5929
|
+
.popup * {\r
|
|
5930
|
+
font-size: calc(9px * var(--total-scale-factor));\r
|
|
5931
|
+
}\r
|
|
5932
|
+
\r
|
|
5933
|
+
.popup > .header {\r
|
|
5934
|
+
display: inline-block;\r
|
|
5935
|
+
}\r
|
|
5936
|
+
\r
|
|
5937
|
+
.popup > .header > .title {\r
|
|
5938
|
+
display: inline;\r
|
|
5939
|
+
font-weight: bold;\r
|
|
5940
|
+
}\r
|
|
5941
|
+
\r
|
|
5942
|
+
.popup > .header .popupDate {\r
|
|
5943
|
+
display: inline-block;\r
|
|
5944
|
+
margin-left: calc(5px * var(--total-scale-factor));\r
|
|
5945
|
+
width: fit-content;\r
|
|
5946
|
+
}\r
|
|
5947
|
+
\r
|
|
5948
|
+
.popupContent {\r
|
|
5949
|
+
border-top: 1px solid rgb(51 51 51);\r
|
|
5950
|
+
margin-top: calc(2px * var(--total-scale-factor));\r
|
|
5951
|
+
padding-top: calc(2px * var(--total-scale-factor));\r
|
|
5952
|
+
}\r
|
|
5953
|
+
\r
|
|
5954
|
+
.richText > * {\r
|
|
5955
|
+
white-space: pre-wrap;\r
|
|
5956
|
+
font-size: calc(9px * var(--total-scale-factor));\r
|
|
5957
|
+
}\r
|
|
5958
|
+
\r
|
|
5959
|
+
.popupTriggerArea {\r
|
|
5960
|
+
cursor: pointer;\r
|
|
5961
|
+
\r
|
|
5962
|
+
&:hover {\r
|
|
5963
|
+
backdrop-filter: var(--hcm-highlight-filter);\r
|
|
5964
|
+
}\r
|
|
5965
|
+
}\r
|
|
5966
|
+
\r
|
|
5967
|
+
section svg {\r
|
|
5968
|
+
position: absolute;\r
|
|
5969
|
+
width: 100%;\r
|
|
5970
|
+
height: 100%;\r
|
|
5971
|
+
top: 0;\r
|
|
5972
|
+
left: 0;\r
|
|
5973
|
+
}\r
|
|
5974
|
+
\r
|
|
5975
|
+
.annotationTextContent {\r
|
|
5976
|
+
position: absolute;\r
|
|
5977
|
+
width: 100%;\r
|
|
5978
|
+
height: 100%;\r
|
|
5979
|
+
opacity: 0;\r
|
|
5980
|
+
color: transparent;\r
|
|
5981
|
+
user-select: none;\r
|
|
5982
|
+
pointer-events: none;\r
|
|
5983
|
+
\r
|
|
5984
|
+
span {\r
|
|
5985
|
+
width: 100%;\r
|
|
5986
|
+
display: inline-block;\r
|
|
5987
|
+
}\r
|
|
5988
|
+
}\r
|
|
5989
|
+
\r
|
|
5990
|
+
svg.quadrilateralsContainer {\r
|
|
5991
|
+
contain: strict;\r
|
|
5992
|
+
width: 0;\r
|
|
5993
|
+
height: 0;\r
|
|
5994
|
+
position: absolute;\r
|
|
5995
|
+
top: 0;\r
|
|
5996
|
+
left: 0;\r
|
|
5997
|
+
z-index: -1;\r
|
|
5998
|
+
}\r
|
|
5999
|
+
}\r
|
|
6000
|
+
`;
|
|
5921
6001
|
const render = async (page, doc, zoom) => {
|
|
5922
6002
|
const scale = zoom * devicePixelRatio;
|
|
5923
6003
|
doc.documentElement.style.transform = `scale(${1 / devicePixelRatio})`;
|
|
@@ -5952,15 +6032,13 @@ const render = async (page, doc, zoom) => {
|
|
|
5952
6032
|
container.onpointerdown = () => container.classList.add("selecting");
|
|
5953
6033
|
container.onpointerup = () => container.classList.remove("selecting");
|
|
5954
6034
|
const div = doc.querySelector(".annotationLayer");
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
|
|
5958
|
-
|
|
5959
|
-
|
|
5960
|
-
|
|
5961
|
-
|
|
5962
|
-
}
|
|
5963
|
-
});
|
|
6035
|
+
const linkService = {
|
|
6036
|
+
goToDestination: () => {
|
|
6037
|
+
},
|
|
6038
|
+
getDestinationHash: (dest) => JSON.stringify(dest),
|
|
6039
|
+
addLinkAttributes: (link, url) => link.href = url
|
|
6040
|
+
};
|
|
6041
|
+
await new pdfjsLib.AnnotationLayer({ page, viewport, div, linkService }).render({ annotations: await page.getAnnotations() });
|
|
5964
6042
|
};
|
|
5965
6043
|
const renderPage = async (page, getImageBlob) => {
|
|
5966
6044
|
const viewport = page.getViewport({ scale: 1 });
|
|
@@ -5982,6 +6060,17 @@ const renderPage = async (page, getImageBlob) => {
|
|
|
5982
6060
|
margin: 0;
|
|
5983
6061
|
padding: 0;
|
|
5984
6062
|
}
|
|
6063
|
+
/*
|
|
6064
|
+
https://github.com/mozilla/pdf.js/commit/bd05b255fabfc313b194bfe9a17ccded4d90fb5a
|
|
6065
|
+
*/
|
|
6066
|
+
:root {
|
|
6067
|
+
--user-unit: 1;
|
|
6068
|
+
--total-scale-factor: calc(var(--scale-factor) * var(--user-unit));
|
|
6069
|
+
--scale-round-x: 1px;
|
|
6070
|
+
--scale-round-y: 1px;
|
|
6071
|
+
}
|
|
6072
|
+
${textLayerBuilderCSS}
|
|
6073
|
+
${annotationLayerBuilderCSS}
|
|
5985
6074
|
</style>
|
|
5986
6075
|
<div id="canvas"></div>
|
|
5987
6076
|
<div class="textLayer"></div>
|
|
@@ -6004,8 +6093,8 @@ const makePDF = async (file) => {
|
|
|
6004
6093
|
};
|
|
6005
6094
|
const pdf2 = await pdfjsLib.getDocument({
|
|
6006
6095
|
range: transport,
|
|
6007
|
-
|
|
6008
|
-
|
|
6096
|
+
cMapUrl: pdfjsPath("cmaps/"),
|
|
6097
|
+
standardFontDataUrl: pdfjsPath("standard_fonts/"),
|
|
6009
6098
|
isEvalSupported: false
|
|
6010
6099
|
}).promise;
|
|
6011
6100
|
const book = { rendition: { layout: "pre-paginated" } };
|
|
@@ -6319,17 +6408,17 @@ const MOBI_LANG = {
|
|
|
6319
6408
|
97: ["ne"],
|
|
6320
6409
|
98: ["fy"]
|
|
6321
6410
|
};
|
|
6322
|
-
const concatTypedArray = (a2,
|
|
6323
|
-
const result = new a2.constructor(a2.length +
|
|
6411
|
+
const concatTypedArray = (a2, b3) => {
|
|
6412
|
+
const result = new a2.constructor(a2.length + b3.length);
|
|
6324
6413
|
result.set(a2);
|
|
6325
|
-
result.set(
|
|
6414
|
+
result.set(b3, a2.length);
|
|
6326
6415
|
return result;
|
|
6327
6416
|
};
|
|
6328
|
-
const concatTypedArray3 = (a2,
|
|
6329
|
-
const result = new a2.constructor(a2.length +
|
|
6417
|
+
const concatTypedArray3 = (a2, b3, c) => {
|
|
6418
|
+
const result = new a2.constructor(a2.length + b3.length + c.length);
|
|
6330
6419
|
result.set(a2);
|
|
6331
|
-
result.set(
|
|
6332
|
-
result.set(c, a2.length +
|
|
6420
|
+
result.set(b3, a2.length);
|
|
6421
|
+
result.set(c, a2.length + b3.length);
|
|
6333
6422
|
return result;
|
|
6334
6423
|
};
|
|
6335
6424
|
const decoder = new TextDecoder();
|
|
@@ -6801,6 +6890,9 @@ class MOBI6 {
|
|
|
6801
6890
|
createDocument: () => this.createDocument(section),
|
|
6802
6891
|
size: section.end - section.start
|
|
6803
6892
|
}));
|
|
6893
|
+
this.#fileposList = [...new Set(
|
|
6894
|
+
Array.from(str.matchAll(fileposRegex), (m2) => m2[1])
|
|
6895
|
+
)].map((filepos) => ({ filepos, number: Number(filepos) })).sort((a2, b3) => a2.number - b3.number);
|
|
6804
6896
|
try {
|
|
6805
6897
|
this.landmarks = await this.getGuide();
|
|
6806
6898
|
const tocHref = (_a = this.landmarks.find(({ type }) => type == null ? void 0 : type.includes("toc"))) == null ? void 0 : _a.href;
|
|
@@ -6841,9 +6933,6 @@ class MOBI6 {
|
|
|
6841
6933
|
} catch (e2) {
|
|
6842
6934
|
console.warn(e2);
|
|
6843
6935
|
}
|
|
6844
|
-
this.#fileposList = [...new Set(
|
|
6845
|
-
Array.from(str.matchAll(fileposRegex), (m2) => m2[1])
|
|
6846
|
-
)].map((filepos) => ({ filepos, number: Number(filepos) })).sort((a2, b2) => a2.number - b2.number);
|
|
6847
6936
|
this.metadata = this.mobi.getMetadata();
|
|
6848
6937
|
this.getCover = this.mobi.getCover.bind(this.mobi);
|
|
6849
6938
|
return this;
|
|
@@ -7047,7 +7136,7 @@ class KF8 {
|
|
|
7047
7136
|
const last = arr[arr.length - 1];
|
|
7048
7137
|
const fragStart = (last == null ? void 0 : last.fragEnd) ?? 0, fragEnd = fragStart + skel.numFrag;
|
|
7049
7138
|
const frags = fragTable.slice(fragStart, fragEnd);
|
|
7050
|
-
const length = skel.length + frags.map((f2) => f2.length).reduce((a2,
|
|
7139
|
+
const length = skel.length + frags.map((f2) => f2.length).reduce((a2, b3) => a2 + b3, 0);
|
|
7051
7140
|
const totalLength = ((last == null ? void 0 : last.totalLength) ?? 0) + length;
|
|
7052
7141
|
return arr.concat({ skel, frags, fragEnd, length, totalLength });
|
|
7053
7142
|
}, []);
|
|
@@ -7281,25 +7370,25 @@ const mobi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
|
|
|
7281
7370
|
MOBI,
|
|
7282
7371
|
isMOBI
|
|
7283
7372
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7284
|
-
var r = Uint8Array,
|
|
7285
|
-
for (var i2 = new
|
|
7286
|
-
var f2 = new
|
|
7373
|
+
var r = Uint8Array, n = Uint16Array, a = Int32Array, e = new r([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, 0, 0, 0]), i = new r([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, 0, 0]), t = new r([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), f = function(r2, e2) {
|
|
7374
|
+
for (var i2 = new n(31), t2 = 0; t2 < 31; ++t2) i2[t2] = e2 += 1 << r2[t2 - 1];
|
|
7375
|
+
var f2 = new a(i2[30]);
|
|
7287
7376
|
for (t2 = 1; t2 < 30; ++t2) for (var o2 = i2[t2]; o2 < i2[t2 + 1]; ++o2) f2[o2] = o2 - i2[t2] << 5 | t2;
|
|
7288
7377
|
return { b: i2, r: f2 };
|
|
7289
|
-
}, o = f(
|
|
7378
|
+
}, o = f(e, 2), v = o.b, l = o.r;
|
|
7290
7379
|
v[28] = 258, l[258] = 28;
|
|
7291
|
-
for (var u = f(i, 0).b, c = new
|
|
7380
|
+
for (var u = f(i, 0).b, c = new n(32768), d = 0; d < 32768; ++d) {
|
|
7292
7381
|
var w = (43690 & d) >> 1 | (21845 & d) << 1;
|
|
7293
7382
|
w = (61680 & (w = (52428 & w) >> 2 | (13107 & w) << 2)) >> 4 | (3855 & w) << 4, c[d] = ((65280 & w) >> 8 | (255 & w) << 8) >> 1;
|
|
7294
7383
|
}
|
|
7295
|
-
var
|
|
7296
|
-
for (var i2 = r2.length, t2 = 0, f2 = new
|
|
7297
|
-
var o2, v2 = new
|
|
7298
|
-
for (t2 = 1; t2 <
|
|
7384
|
+
var b2 = function(r2, a2, e2) {
|
|
7385
|
+
for (var i2 = r2.length, t2 = 0, f2 = new n(a2); t2 < i2; ++t2) r2[t2] && ++f2[r2[t2] - 1];
|
|
7386
|
+
var o2, v2 = new n(a2);
|
|
7387
|
+
for (t2 = 1; t2 < a2; ++t2) v2[t2] = v2[t2 - 1] + f2[t2 - 1] << 1;
|
|
7299
7388
|
{
|
|
7300
|
-
o2 = new
|
|
7301
|
-
var l2 = 15 -
|
|
7302
|
-
for (t2 = 0; t2 < i2; ++t2) if (r2[t2]) for (var u = t2 << 4 | r2[t2], d =
|
|
7389
|
+
o2 = new n(1 << a2);
|
|
7390
|
+
var l2 = 15 - a2;
|
|
7391
|
+
for (t2 = 0; t2 < i2; ++t2) if (r2[t2]) for (var u = t2 << 4 | r2[t2], d = a2 - r2[t2], w = v2[r2[t2] - 1]++ << d, b3 = w | (1 << d) - 1; w <= b3; ++w) o2[c[w] >> l2] = u;
|
|
7303
7392
|
}
|
|
7304
7393
|
return o2;
|
|
7305
7394
|
}, s = new r(288);
|
|
@@ -7309,123 +7398,125 @@ for (d = 256; d < 280; ++d) s[d] = 7;
|
|
|
7309
7398
|
for (d = 280; d < 288; ++d) s[d] = 8;
|
|
7310
7399
|
var h = new r(32);
|
|
7311
7400
|
for (d = 0; d < 32; ++d) h[d] = 5;
|
|
7312
|
-
var
|
|
7313
|
-
for (var
|
|
7314
|
-
return a2;
|
|
7315
|
-
}, k = function(r2, a2, e2) {
|
|
7316
|
-
var n2 = a2 / 8 | 0;
|
|
7317
|
-
return (r2[n2] | r2[n2 + 1] << 8) >> (7 & a2) & e2;
|
|
7318
|
-
}, m = function(r2, a2) {
|
|
7319
|
-
var e2 = a2 / 8 | 0;
|
|
7320
|
-
return (r2[e2] | r2[e2 + 1] << 8 | r2[e2 + 2] << 16) >> (7 & a2);
|
|
7321
|
-
}, x = ["unexpected EOF", "invalid block type", "invalid length/literal", "invalid distance", "stream finished", "no stream handler", , "no callback", "invalid UTF-8 data", "extra field too long", "date not in range 1980-2099", "filename too long", "stream finishing", "invalid zip data"], T = function(r2, a2, e2) {
|
|
7322
|
-
var n2 = new Error(a2 || x[r2]);
|
|
7323
|
-
if (n2.code = r2, Error.captureStackTrace && Error.captureStackTrace(n2, T), !e2) throw n2;
|
|
7401
|
+
var y2 = b2(s, 9), g = b2(h, 5), p = function(r2) {
|
|
7402
|
+
for (var n2 = r2[0], a2 = 1; a2 < r2.length; ++a2) r2[a2] > n2 && (n2 = r2[a2]);
|
|
7324
7403
|
return n2;
|
|
7325
|
-
},
|
|
7326
|
-
var
|
|
7327
|
-
|
|
7328
|
-
|
|
7404
|
+
}, k = function(r2, n2, a2) {
|
|
7405
|
+
var e2 = n2 / 8 | 0;
|
|
7406
|
+
return (r2[e2] | r2[e2 + 1] << 8) >> (7 & n2) & a2;
|
|
7407
|
+
}, m = function(r2, n2) {
|
|
7408
|
+
var a2 = n2 / 8 | 0;
|
|
7409
|
+
return (r2[a2] | r2[a2 + 1] << 8 | r2[a2 + 2] << 16) >> (7 & n2);
|
|
7410
|
+
}, x = function(r2) {
|
|
7411
|
+
return (r2 + 7) / 8 | 0;
|
|
7412
|
+
}, T = ["unexpected EOF", "invalid block type", "invalid length/literal", "invalid distance", "stream finished", "no stream handler", , "no callback", "invalid UTF-8 data", "extra field too long", "date not in range 1980-2099", "filename too long", "stream finishing", "invalid zip data"], E = function(r2, n2, a2) {
|
|
7413
|
+
var e2 = new Error(n2 || T[r2]);
|
|
7414
|
+
if (e2.code = r2, Error.captureStackTrace && Error.captureStackTrace(e2, E), !a2) throw e2;
|
|
7415
|
+
return e2;
|
|
7416
|
+
}, z = function(n2, a2, f2, o2) {
|
|
7417
|
+
var l2 = n2.length, c = o2 ? o2.length : 0;
|
|
7418
|
+
if (!l2 || a2.f && !a2.l) return f2 || new r(0);
|
|
7419
|
+
var d = !f2, w = d || 2 != a2.i, s2 = a2.i;
|
|
7329
7420
|
d && (f2 = new r(3 * l2));
|
|
7330
|
-
var h2 = function(
|
|
7331
|
-
var
|
|
7332
|
-
if (
|
|
7333
|
-
var
|
|
7334
|
-
|
|
7421
|
+
var h2 = function(n3) {
|
|
7422
|
+
var a3 = f2.length;
|
|
7423
|
+
if (n3 > a3) {
|
|
7424
|
+
var e2 = new r(Math.max(2 * a3, n3));
|
|
7425
|
+
e2.set(f2), f2 = e2;
|
|
7335
7426
|
}
|
|
7336
|
-
},
|
|
7427
|
+
}, T2 = a2.f || 0, z2 = a2.p || 0, A2 = a2.b || 0, U2 = a2.l, D2 = a2.d, F2 = a2.m, M2 = a2.n, S2 = 8 * l2;
|
|
7337
7428
|
do {
|
|
7338
|
-
if (!
|
|
7339
|
-
|
|
7340
|
-
var
|
|
7341
|
-
if (
|
|
7342
|
-
var
|
|
7343
|
-
if (
|
|
7344
|
-
s2 &&
|
|
7429
|
+
if (!U2) {
|
|
7430
|
+
T2 = k(n2, z2, 1);
|
|
7431
|
+
var I2 = k(n2, z2 + 1, 3);
|
|
7432
|
+
if (z2 += 3, !I2) {
|
|
7433
|
+
var O2 = n2[(P2 = x(z2) + 4) - 4] | n2[P2 - 3] << 8, j2 = P2 + O2;
|
|
7434
|
+
if (j2 > l2) {
|
|
7435
|
+
s2 && E(0);
|
|
7345
7436
|
break;
|
|
7346
7437
|
}
|
|
7347
|
-
w && h2(
|
|
7438
|
+
w && h2(A2 + O2), f2.set(n2.subarray(P2, j2), A2), a2.b = A2 += O2, a2.p = z2 = 8 * j2, a2.f = T2;
|
|
7348
7439
|
continue;
|
|
7349
7440
|
}
|
|
7350
|
-
if (1 ==
|
|
7351
|
-
else if (2 ==
|
|
7352
|
-
var
|
|
7353
|
-
|
|
7354
|
-
for (var
|
|
7355
|
-
|
|
7356
|
-
var
|
|
7357
|
-
for (
|
|
7358
|
-
var
|
|
7359
|
-
if (
|
|
7441
|
+
if (1 == I2) U2 = y2, D2 = g, F2 = 9, M2 = 5;
|
|
7442
|
+
else if (2 == I2) {
|
|
7443
|
+
var q2 = k(n2, z2, 31) + 257, B2 = k(n2, z2 + 10, 15) + 4, C2 = q2 + k(n2, z2 + 5, 31) + 1;
|
|
7444
|
+
z2 += 14;
|
|
7445
|
+
for (var G2 = new r(C2), H2 = new r(19), J2 = 0; J2 < B2; ++J2) H2[t[J2]] = k(n2, z2 + 3 * J2, 7);
|
|
7446
|
+
z2 += 3 * B2;
|
|
7447
|
+
var K2 = p(H2), L2 = (1 << K2) - 1, N2 = b2(H2, K2);
|
|
7448
|
+
for (J2 = 0; J2 < C2; ) {
|
|
7449
|
+
var P2, Q2 = N2[k(n2, z2, L2)];
|
|
7450
|
+
if (z2 += 15 & Q2, (P2 = Q2 >> 4) < 16) G2[J2++] = P2;
|
|
7360
7451
|
else {
|
|
7361
|
-
var
|
|
7362
|
-
for (16 ==
|
|
7452
|
+
var R2 = 0, V2 = 0;
|
|
7453
|
+
for (16 == P2 ? (V2 = 3 + k(n2, z2, 3), z2 += 2, R2 = G2[J2 - 1]) : 17 == P2 ? (V2 = 3 + k(n2, z2, 7), z2 += 3) : 18 == P2 && (V2 = 11 + k(n2, z2, 127), z2 += 7); V2--; ) G2[J2++] = R2;
|
|
7363
7454
|
}
|
|
7364
7455
|
}
|
|
7365
|
-
var
|
|
7366
|
-
|
|
7367
|
-
} else
|
|
7368
|
-
if (
|
|
7369
|
-
s2 &&
|
|
7456
|
+
var W2 = G2.subarray(0, q2), X2 = G2.subarray(q2);
|
|
7457
|
+
F2 = p(W2), M2 = p(X2), U2 = b2(W2, F2), D2 = b2(X2, M2);
|
|
7458
|
+
} else E(1);
|
|
7459
|
+
if (z2 > S2) {
|
|
7460
|
+
s2 && E(0);
|
|
7370
7461
|
break;
|
|
7371
7462
|
}
|
|
7372
7463
|
}
|
|
7373
|
-
w && h2(
|
|
7374
|
-
for (var
|
|
7375
|
-
var
|
|
7376
|
-
if ((
|
|
7377
|
-
s2 &&
|
|
7464
|
+
w && h2(A2 + 131072);
|
|
7465
|
+
for (var Y2 = (1 << F2) - 1, Z2 = (1 << M2) - 1, $2 = z2; ; $2 = z2) {
|
|
7466
|
+
var _2 = (R2 = U2[m(n2, z2) & Y2]) >> 4;
|
|
7467
|
+
if ((z2 += 15 & R2) > S2) {
|
|
7468
|
+
s2 && E(0);
|
|
7378
7469
|
break;
|
|
7379
7470
|
}
|
|
7380
|
-
if (
|
|
7471
|
+
if (R2 || E(2), _2 < 256) f2[A2++] = _2;
|
|
7381
7472
|
else {
|
|
7382
|
-
if (256 ==
|
|
7383
|
-
|
|
7473
|
+
if (256 == _2) {
|
|
7474
|
+
$2 = z2, U2 = null;
|
|
7384
7475
|
break;
|
|
7385
7476
|
}
|
|
7386
|
-
var
|
|
7387
|
-
if (
|
|
7388
|
-
var
|
|
7389
|
-
|
|
7477
|
+
var rr = _2 - 254;
|
|
7478
|
+
if (_2 > 264) {
|
|
7479
|
+
var nr = e[J2 = _2 - 257];
|
|
7480
|
+
rr = k(n2, z2, (1 << nr) - 1) + v[J2], z2 += nr;
|
|
7390
7481
|
}
|
|
7391
|
-
var ar =
|
|
7392
|
-
ar ||
|
|
7393
|
-
|
|
7482
|
+
var ar = D2[m(n2, z2) & Z2], er = ar >> 4;
|
|
7483
|
+
ar || E(3), z2 += 15 & ar;
|
|
7484
|
+
X2 = u[er];
|
|
7394
7485
|
if (er > 3) {
|
|
7395
|
-
|
|
7396
|
-
|
|
7486
|
+
nr = i[er];
|
|
7487
|
+
X2 += m(n2, z2) & (1 << nr) - 1, z2 += nr;
|
|
7397
7488
|
}
|
|
7398
|
-
if (
|
|
7399
|
-
s2 &&
|
|
7489
|
+
if (z2 > S2) {
|
|
7490
|
+
s2 && E(0);
|
|
7400
7491
|
break;
|
|
7401
7492
|
}
|
|
7402
|
-
w && h2(
|
|
7403
|
-
var
|
|
7404
|
-
if (
|
|
7405
|
-
var
|
|
7406
|
-
for (
|
|
7493
|
+
w && h2(A2 + 131072);
|
|
7494
|
+
var ir = A2 + rr;
|
|
7495
|
+
if (A2 < X2) {
|
|
7496
|
+
var tr = c - X2, fr = Math.min(X2, ir);
|
|
7497
|
+
for (tr + A2 < 0 && E(3); A2 < fr; ++A2) f2[A2] = o2[tr + A2];
|
|
7407
7498
|
}
|
|
7408
|
-
for (;
|
|
7499
|
+
for (; A2 < ir; ++A2) f2[A2] = f2[A2 - X2];
|
|
7409
7500
|
}
|
|
7410
7501
|
}
|
|
7411
|
-
|
|
7412
|
-
} while (!
|
|
7413
|
-
return
|
|
7414
|
-
return (null ==
|
|
7415
|
-
})(f2, 0,
|
|
7416
|
-
},
|
|
7417
|
-
function
|
|
7418
|
-
return
|
|
7419
|
-
var
|
|
7420
|
-
}
|
|
7421
|
-
var
|
|
7502
|
+
a2.l = U2, a2.p = $2, a2.b = A2, a2.f = T2, U2 && (T2 = 1, a2.m = F2, a2.d = D2, a2.n = M2);
|
|
7503
|
+
} while (!T2);
|
|
7504
|
+
return A2 != f2.length && d ? (function(n3, a3, e2) {
|
|
7505
|
+
return (null == e2 || e2 > n3.length) && (e2 = n3.length), new r(n3.subarray(a3, e2));
|
|
7506
|
+
})(f2, 0, A2) : f2.subarray(0, A2);
|
|
7507
|
+
}, A = new r(0);
|
|
7508
|
+
function U(r2, n2) {
|
|
7509
|
+
return z(r2.subarray((a2 = r2, e2 = n2 && n2.dictionary, (8 != (15 & a2[0]) || a2[0] >> 4 > 7 || (a2[0] << 8 | a2[1]) % 31) && E(6, "invalid zlib data"), (a2[1] >> 5 & 1) == +!e2 && E(6, "invalid zlib data: " + (32 & a2[1] ? "need" : "unexpected") + " dictionary"), 2 + (a2[1] >> 3 & 4)), -4), { i: 2 }, n2 && n2.out, n2 && n2.dictionary);
|
|
7510
|
+
var a2, e2;
|
|
7511
|
+
}
|
|
7512
|
+
var D = "undefined" != typeof TextDecoder && new TextDecoder();
|
|
7422
7513
|
try {
|
|
7423
|
-
|
|
7514
|
+
D.decode(A, { stream: true });
|
|
7424
7515
|
} catch (r2) {
|
|
7425
7516
|
}
|
|
7426
7517
|
const fflate = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7427
7518
|
__proto__: null,
|
|
7428
|
-
unzlibSync:
|
|
7519
|
+
unzlibSync: U
|
|
7429
7520
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7430
7521
|
const parseViewport = (str) => {
|
|
7431
7522
|
var _a, _b;
|
|
@@ -7731,21 +7822,21 @@ const debounce = (f2, wait2, immediate) => {
|
|
|
7731
7822
|
};
|
|
7732
7823
|
const lerp = (min, max, x2) => x2 * (max - min) + min;
|
|
7733
7824
|
const easeOutQuad = (x2) => 1 - (1 - x2) * (1 - x2);
|
|
7734
|
-
const animate = (a2,
|
|
7825
|
+
const animate = (a2, b3, duration, ease, render2) => new Promise((resolve) => {
|
|
7735
7826
|
let start;
|
|
7736
7827
|
const step = (now) => {
|
|
7737
7828
|
if (document.hidden) {
|
|
7738
|
-
render2(lerp(a2,
|
|
7829
|
+
render2(lerp(a2, b3, 1));
|
|
7739
7830
|
return resolve();
|
|
7740
7831
|
}
|
|
7741
7832
|
start ??= now;
|
|
7742
7833
|
const fraction = Math.min(1, (now - start) / duration);
|
|
7743
|
-
render2(lerp(a2,
|
|
7834
|
+
render2(lerp(a2, b3, ease(fraction)));
|
|
7744
7835
|
if (fraction < 1) requestAnimationFrame(step);
|
|
7745
7836
|
else resolve();
|
|
7746
7837
|
};
|
|
7747
7838
|
if (document.hidden) {
|
|
7748
|
-
render2(lerp(a2,
|
|
7839
|
+
render2(lerp(a2, b3, 1));
|
|
7749
7840
|
return resolve();
|
|
7750
7841
|
}
|
|
7751
7842
|
requestAnimationFrame(step);
|
|
@@ -7821,15 +7912,15 @@ const getVisibleRange = (doc, start, end, mapRect) => {
|
|
|
7821
7912
|
nodes.push(node);
|
|
7822
7913
|
const from = nodes[0] ?? doc.body;
|
|
7823
7914
|
const to = nodes[nodes.length - 1] ?? from;
|
|
7824
|
-
const startOffset = from.nodeType === 1 ? 0 : bisectNode(doc, from, (a2,
|
|
7915
|
+
const startOffset = from.nodeType === 1 ? 0 : bisectNode(doc, from, (a2, b3) => {
|
|
7825
7916
|
const p2 = mapRect(getBoundingClientRect(a2));
|
|
7826
|
-
const q2 = mapRect(getBoundingClientRect(
|
|
7917
|
+
const q2 = mapRect(getBoundingClientRect(b3));
|
|
7827
7918
|
if (p2.right < start && q2.left > start) return 0;
|
|
7828
7919
|
return q2.left > start ? -1 : 1;
|
|
7829
7920
|
});
|
|
7830
|
-
const endOffset = to.nodeType === 1 ? 0 : bisectNode(doc, to, (a2,
|
|
7921
|
+
const endOffset = to.nodeType === 1 ? 0 : bisectNode(doc, to, (a2, b3) => {
|
|
7831
7922
|
const p2 = mapRect(getBoundingClientRect(a2));
|
|
7832
|
-
const q2 = mapRect(getBoundingClientRect(
|
|
7923
|
+
const q2 = mapRect(getBoundingClientRect(b3));
|
|
7833
7924
|
if (p2.right < end && q2.left > end) return 0;
|
|
7834
7925
|
return q2.left > end ? -1 : 1;
|
|
7835
7926
|
});
|
|
@@ -8310,7 +8401,7 @@ class Paginator extends HTMLElement {
|
|
|
8310
8401
|
if (detail.type !== "text/css") return;
|
|
8311
8402
|
const w = innerWidth;
|
|
8312
8403
|
const h2 = innerHeight;
|
|
8313
|
-
detail.data = Promise.resolve(detail.data).then((data) => data.replace(new RegExp("(?<=[{\\s;])-epub-", "gi"), "").replace(/(\d*\.?\d+)vw/gi, (_2, d) => parseFloat(d) * w / 100 + "px").replace(/(\d*\.?\d+)vh/gi, (_2, d) => parseFloat(d) * h2 / 100 + "px").replace(/page-break-(after|before|inside)\s*:/gi, (_2, x2) => `-webkit-column-break-${x2}:`).replace(/break-(after|before|inside)\s*:\s*(avoid-)?page/gi, (_2, x2,
|
|
8404
|
+
detail.data = Promise.resolve(detail.data).then((data) => data.replace(new RegExp("(?<=[{\\s;])-epub-", "gi"), "").replace(/(\d*\.?\d+)vw/gi, (_2, d) => parseFloat(d) * w / 100 + "px").replace(/(\d*\.?\d+)vh/gi, (_2, d) => parseFloat(d) * h2 / 100 + "px").replace(/page-break-(after|before|inside)\s*:/gi, (_2, x2) => `-webkit-column-break-${x2}:`).replace(/break-(after|before|inside)\s*:\s*(avoid-)?page/gi, (_2, x2, y3) => `break-${x2}: ${y3 ?? ""}column`));
|
|
8314
8405
|
});
|
|
8315
8406
|
}
|
|
8316
8407
|
#createView() {
|
|
@@ -8410,10 +8501,10 @@ class Paginator extends HTMLElement {
|
|
|
8410
8501
|
const delta = this.#vertical ? dy : dx;
|
|
8411
8502
|
const element = this.#container;
|
|
8412
8503
|
const { scrollProp } = this;
|
|
8413
|
-
const [offset, a2,
|
|
8504
|
+
const [offset, a2, b3] = this.#scrollBounds;
|
|
8414
8505
|
const rtl = this.#rtl;
|
|
8415
|
-
const min = rtl ? offset -
|
|
8416
|
-
const max = rtl ? offset + a2 : offset +
|
|
8506
|
+
const min = rtl ? offset - b3 : offset - a2;
|
|
8507
|
+
const max = rtl ? offset + a2 : offset + b3;
|
|
8417
8508
|
element[scrollProp] = Math.max(min, Math.min(
|
|
8418
8509
|
max,
|
|
8419
8510
|
element[scrollProp] + delta
|
|
@@ -8421,10 +8512,10 @@ class Paginator extends HTMLElement {
|
|
|
8421
8512
|
}
|
|
8422
8513
|
snap(vx, vy) {
|
|
8423
8514
|
const velocity = this.#vertical ? vy : vx;
|
|
8424
|
-
const [offset, a2,
|
|
8515
|
+
const [offset, a2, b3] = this.#scrollBounds;
|
|
8425
8516
|
const { start, end, pages, size } = this;
|
|
8426
8517
|
const min = Math.abs(offset) - a2;
|
|
8427
|
-
const max = Math.abs(offset) +
|
|
8518
|
+
const max = Math.abs(offset) + b3;
|
|
8428
8519
|
const d = velocity * (this.#rtl ? -size : size);
|
|
8429
8520
|
const page = Math.floor(
|
|
8430
8521
|
Math.max(min, Math.min(max, (start + end) / 2 + (isNaN(d) ? 0 : d))) / size
|
|
@@ -8458,11 +8549,11 @@ class Paginator extends HTMLElement {
|
|
|
8458
8549
|
}
|
|
8459
8550
|
e2.preventDefault();
|
|
8460
8551
|
const touch = e2.changedTouches[0];
|
|
8461
|
-
const x2 = touch.screenX,
|
|
8462
|
-
const dx = state.x - x2, dy = state.y -
|
|
8552
|
+
const x2 = touch.screenX, y3 = touch.screenY;
|
|
8553
|
+
const dx = state.x - x2, dy = state.y - y3;
|
|
8463
8554
|
const dt2 = e2.timeStamp - state.t;
|
|
8464
8555
|
state.x = x2;
|
|
8465
|
-
state.y =
|
|
8556
|
+
state.y = y3;
|
|
8466
8557
|
state.t = e2.timeStamp;
|
|
8467
8558
|
state.vx = dx / dt2;
|
|
8468
8559
|
state.vy = dy / dt2;
|
|
@@ -8940,10 +9031,11 @@ const fragmentToSSML = (fragment, inherited) => {
|
|
|
8940
9031
|
const { lang } = inherited;
|
|
8941
9032
|
if (lang) ssml.documentElement.setAttributeNS(NS.XML, "lang", lang);
|
|
8942
9033
|
const convert = (node, parent, inheritedAlphabet) => {
|
|
9034
|
+
var _a, _b, _c;
|
|
8943
9035
|
if (!node) return;
|
|
8944
9036
|
if (node.nodeType === 3) return ssml.createTextNode(node.textContent);
|
|
8945
9037
|
if (node.nodeType === 4) return ssml.createCDATASection(node.textContent);
|
|
8946
|
-
if (node.nodeType !== 1) return;
|
|
9038
|
+
if (node.nodeType !== 1 && node.nodeType !== 11) return;
|
|
8947
9039
|
let el;
|
|
8948
9040
|
const nodeName = node.nodeName.toLowerCase();
|
|
8949
9041
|
if (nodeName === "foliate-mark") {
|
|
@@ -8953,14 +9045,14 @@ const fragmentToSSML = (fragment, inherited) => {
|
|
|
8953
9045
|
el = ssml.createElementNS(NS.SSML, "break");
|
|
8954
9046
|
else if (nodeName === "em" || nodeName === "strong")
|
|
8955
9047
|
el = ssml.createElementNS(NS.SSML, "emphasis");
|
|
8956
|
-
const lang2 = node.lang || node.getAttributeNS(NS.XML, "lang");
|
|
9048
|
+
const lang2 = node.lang || ((_a = node.getAttributeNS) == null ? void 0 : _a.call(node, NS.XML, "lang"));
|
|
8957
9049
|
if (lang2) {
|
|
8958
9050
|
if (!el) el = ssml.createElementNS(NS.SSML, "lang");
|
|
8959
9051
|
el.setAttributeNS(NS.XML, "lang", lang2);
|
|
8960
9052
|
}
|
|
8961
|
-
const alphabet = node.getAttributeNS(NS.SSML, "alphabet") || inheritedAlphabet;
|
|
9053
|
+
const alphabet = ((_b = node.getAttributeNS) == null ? void 0 : _b.call(node, NS.SSML, "alphabet")) || inheritedAlphabet;
|
|
8962
9054
|
if (!el) {
|
|
8963
|
-
const ph = node.getAttributeNS(NS.SSML, "ph");
|
|
9055
|
+
const ph = (_c = node.getAttributeNS) == null ? void 0 : _c.call(node, NS.SSML, "ph");
|
|
8964
9056
|
if (ph) {
|
|
8965
9057
|
el = ssml.createElementNS(NS.SSML, "phoneme");
|
|
8966
9058
|
if (alphabet) el.setAttribute("alphabet", alphabet);
|
|
@@ -8976,7 +9068,7 @@ const fragmentToSSML = (fragment, inherited) => {
|
|
|
8976
9068
|
}
|
|
8977
9069
|
return el;
|
|
8978
9070
|
};
|
|
8979
|
-
convert(fragment
|
|
9071
|
+
convert(fragment, ssml.documentElement, inherited.alphabet);
|
|
8980
9072
|
return ssml;
|
|
8981
9073
|
};
|
|
8982
9074
|
const getFragmentWithMarks = (range, textWalker2, granularity) => {
|