@silurus/ooxml 0.89.4 → 0.89.5
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/dist/assets/{render-worker-CyUrUidp.js → render-worker-B5HWxkbU.js} +7 -7
- package/dist/assets/render-worker-CeSlHUkL.js +15 -0
- package/dist/assets/{render-worker-Bye3wDV9.js → render-worker-ph4iY7VS.js} +28 -28
- package/dist/{bounded-raw-part-cache-Bi_VqXmg.js → bounded-raw-part-cache-B8t03tSP.js} +740 -731
- package/dist/{canvas-viewer-mechanics-ycCX6v-z.js → canvas-viewer-mechanics-DI38gHNV.js} +1 -1
- package/dist/{comment-overlay-controller-CR5ySvki.js → comment-overlay-controller-Crm5Syhx.js} +2 -2
- package/dist/{comment-ui-runtime-CwTOCwA8.js → comment-ui-runtime-BfEPgl5r.js} +2 -2
- package/dist/{comment-ui-runtime-BWhLz4gq.js → comment-ui-runtime-u7zk49cg.js} +3 -3
- package/dist/{document-model-source-Csow9uxO.js → document-model-source-qsnWuGuH.js} +6 -6
- package/dist/{document-pull-client-CHpz0Q1p.js → document-pull-client-Ckq8THk6.js} +54 -53
- package/dist/{document-pull-worker-1ZJv9f9W.js → document-pull-worker-Bkewz-So.js} +2 -2
- package/dist/{docx-GXxH0AwW.js → docx-ChGrdRyp.js} +16 -16
- package/dist/{docx-D9E0vCq-.js → docx-DRojqjH-.js} +9 -9
- package/dist/{docx-model-source-aKx2gZH9.js → docx-model-source-D0dmXDOs.js} +6 -6
- package/dist/docx.mjs +3 -3
- package/dist/{drawingml-shape-BwELUfNW.js → drawingml-shape-BcXkRayC.js} +1 -1
- package/dist/{font-preload-demand-BuMy4iJ1.js → font-preload-demand-B6HPFxDp.js} +1 -1
- package/dist/{host-layout-measure-GU0oJ4Me.js → host-layout-measure-DP918TOq.js} +1 -1
- package/dist/index.mjs +3 -3
- package/dist/internal-companion.mjs +2 -2
- package/dist/{line-distribute-C_CJisnJ.js → line-distribute-DR9Qwd3u.js} +1 -1
- package/dist/{model-source-DLXFe4_2.js → model-source-DcI3vC00.js} +1 -1
- package/dist/{model-source-session-B3WVQCM5.js → model-source-session-BCteVilS.js} +2 -2
- package/dist/{model-source-session-BVZBHZ04.js → model-source-session-BlQWNyj2.js} +2 -2
- package/dist/{model-source-session-DfUgVpr1.js → model-source-session-D0LF49Ve.js} +2 -2
- package/dist/node.mjs +4 -4
- package/dist/{pptx-CLyebeF_.js → pptx-CfCiVlNB.js} +15 -15
- package/dist/{pptx-BD0jwWs6.js → pptx-SmjDGyub.js} +8 -8
- package/dist/{pptx-model-source-D_2mnSxI.js → pptx-model-source-B2Irk68a.js} +5 -5
- package/dist/pptx.mjs +4 -4
- package/dist/{presentation-model-source-rWZ3Y-S_.js → presentation-model-source-DL6duh5l.js} +5 -5
- package/dist/{render-Cs1bgbEm.js → render-CMUEAeHp.js} +2 -2
- package/dist/{render-worker-host-BR7n4xKy.js → render-worker-host-CtlBbau5.js} +1 -1
- package/dist/{render-worker-host-BxsA-yJo.js → render-worker-host-DSrgUCkT.js} +1 -1
- package/dist/{render-worker-host-CZC0WOn8.js → render-worker-host-DYUY1TuP.js} +1 -1
- package/dist/{renderer-DFDF48zw.js → renderer-BYt3nsdR.js} +4 -4
- package/dist/{resource-measurement-CTGrNAsD.js → resource-measurement-D2bu0Qfx.js} +1 -1
- package/dist/{session-B5CgMc2N.js → session-KIWcCCP2.js} +4 -4
- package/dist/{slide-pull-client-43mS9T70.js → slide-pull-client-BUuJQQVE.js} +48 -48
- package/dist/{wasm-runtime-generation-BsWKRY7U.js → wasm-runtime-generation-BLweKv8r.js} +1 -1
- package/dist/{workbook-model-source-CZtKSWad.js → workbook-model-source-CbEnWvU-.js} +6 -6
- package/dist/{worksheet-pull-client-D5zAevQv.js → worksheet-pull-client-Du0MuIro.js} +2 -2
- package/dist/{xlsx-lvftmF1U.js → xlsx-CVVWeouT.js} +267 -267
- package/dist/{xlsx-S6orTmKI.js → xlsx-Deg8dBy8.js} +4 -4
- package/dist/{xlsx-model-source-Cm9ocDgT.js → xlsx-model-source-D2rRp5-N.js} +6 -6
- package/dist/xlsx.mjs +4 -4
- package/package.json +1 -1
- package/dist/assets/render-worker-BUa1gyCE.js +0 -15
|
@@ -23247,36 +23247,36 @@ var Tn = {
|
|
|
23247
23247
|
sm: 1.25,
|
|
23248
23248
|
med: 1.75,
|
|
23249
23249
|
lg: 2.5
|
|
23250
|
-
}, kn = 2,
|
|
23251
|
-
function
|
|
23250
|
+
}, kn = 2, M = (e) => e === "sm" || e === "lg" ? e : "med";
|
|
23251
|
+
function An(e, t, n, r) {
|
|
23252
23252
|
let i = Math.max(.5, t.width * n), a = Math.max(t.width, kn * r) * n;
|
|
23253
23253
|
return {
|
|
23254
23254
|
lw: i,
|
|
23255
23255
|
e: a,
|
|
23256
|
-
width: Tn[
|
|
23257
|
-
length: Tn[
|
|
23256
|
+
width: Tn[M(e.w)] * a,
|
|
23257
|
+
length: Tn[M(e.len)] * a
|
|
23258
23258
|
};
|
|
23259
23259
|
}
|
|
23260
|
-
function
|
|
23261
|
-
let n = Dn[
|
|
23260
|
+
function jn(e, t) {
|
|
23261
|
+
let n = Dn[M(e.len)] * t.e, r = On[M(e.w)] * t.e, i = r / Math.hypot(n, r);
|
|
23262
23262
|
return {
|
|
23263
23263
|
vertex: -(t.lw / 2) / i,
|
|
23264
23264
|
along: n,
|
|
23265
23265
|
across: r
|
|
23266
23266
|
};
|
|
23267
23267
|
}
|
|
23268
|
-
function
|
|
23269
|
-
let i =
|
|
23268
|
+
function Mn(e, t, n, r) {
|
|
23269
|
+
let i = An(e, t, n, r);
|
|
23270
23270
|
switch (e.type) {
|
|
23271
23271
|
case "triangle": return i.length - i.e / 2;
|
|
23272
|
-
case "stealth": return En[
|
|
23273
|
-
case "arrow": return -
|
|
23272
|
+
case "stealth": return En[M(e.len)] * i.e;
|
|
23273
|
+
case "arrow": return -jn(e, i).vertex;
|
|
23274
23274
|
default: return 0;
|
|
23275
23275
|
}
|
|
23276
23276
|
}
|
|
23277
|
-
function
|
|
23277
|
+
function Nn(e, t, n, r) {
|
|
23278
23278
|
if (e.type === "none") return null;
|
|
23279
|
-
let i =
|
|
23279
|
+
let i = An(e, t, n, r);
|
|
23280
23280
|
switch (e.type) {
|
|
23281
23281
|
case "diamond":
|
|
23282
23282
|
case "oval": return {
|
|
@@ -23285,7 +23285,7 @@ function Pn(e, t, n, r) {
|
|
|
23285
23285
|
halfY: i.width / 2
|
|
23286
23286
|
};
|
|
23287
23287
|
case "arrow": {
|
|
23288
|
-
let t =
|
|
23288
|
+
let t = jn(e, i);
|
|
23289
23289
|
return {
|
|
23290
23290
|
x0: t.vertex - t.along - i.lw / 2,
|
|
23291
23291
|
x1: 0,
|
|
@@ -23299,24 +23299,24 @@ function Pn(e, t, n, r) {
|
|
|
23299
23299
|
};
|
|
23300
23300
|
}
|
|
23301
23301
|
}
|
|
23302
|
-
function
|
|
23303
|
-
let i =
|
|
23302
|
+
function Pn(e, t, n, r) {
|
|
23303
|
+
let i = Nn(e, t, n, r);
|
|
23304
23304
|
return i ? Math.hypot(Math.max(-i.x0, i.x1), i.halfY) : 0;
|
|
23305
23305
|
}
|
|
23306
|
-
function
|
|
23306
|
+
function Fn(e, t, n, r, i = () => {}) {
|
|
23307
23307
|
if (e.type === "none") return null;
|
|
23308
|
-
let a =
|
|
23308
|
+
let a = An(e, t, n, r), { lw: o, length: s } = a, c = a.width / 2, l = $t(i), u = l.sink;
|
|
23309
23309
|
switch (e.type) {
|
|
23310
23310
|
case "triangle":
|
|
23311
23311
|
u.moveTo(0, 0), u.lineTo(-s, -c), u.lineTo(-s, c), u.closePath();
|
|
23312
23312
|
break;
|
|
23313
23313
|
case "stealth": {
|
|
23314
|
-
let t = -En[
|
|
23314
|
+
let t = -En[M(e.len)] * a.e;
|
|
23315
23315
|
u.moveTo(0, 0), u.lineTo(-s, -c), u.lineTo(t, 0), u.lineTo(-s, c), u.closePath();
|
|
23316
23316
|
break;
|
|
23317
23317
|
}
|
|
23318
23318
|
case "arrow": {
|
|
23319
|
-
let t =
|
|
23319
|
+
let t = jn(e, a);
|
|
23320
23320
|
u.moveTo(t.vertex - t.along, -t.across), u.lineTo(t.vertex, 0), u.lineTo(t.vertex - t.along, t.across);
|
|
23321
23321
|
break;
|
|
23322
23322
|
}
|
|
@@ -23341,24 +23341,24 @@ function In(e, t, n, r, i = () => {}) {
|
|
|
23341
23341
|
})
|
|
23342
23342
|
});
|
|
23343
23343
|
}
|
|
23344
|
-
var
|
|
23344
|
+
var In = (e, t, n) => ({
|
|
23345
23345
|
x: e.x + (t.x - e.x) * n,
|
|
23346
23346
|
y: e.y + (t.y - e.y) * n
|
|
23347
23347
|
});
|
|
23348
|
-
function
|
|
23348
|
+
function Ln(e, t) {
|
|
23349
23349
|
let n = [], r = [], i = e.slice();
|
|
23350
|
-
for (; i.length > 0;) n.push(i[0]), r.unshift(i[i.length - 1]), i = i.slice(1).map((e, n) =>
|
|
23350
|
+
for (; i.length > 0;) n.push(i[0]), r.unshift(i[i.length - 1]), i = i.slice(1).map((e, n) => In(i[n], e, t));
|
|
23351
23351
|
return [n, r];
|
|
23352
23352
|
}
|
|
23353
|
-
var
|
|
23353
|
+
var Rn = (e, t) => ({
|
|
23354
23354
|
op: e,
|
|
23355
23355
|
args: t.slice(1).flatMap((e) => [e.x, e.y])
|
|
23356
|
-
}),
|
|
23357
|
-
function
|
|
23358
|
-
let r = n ? e - t : t - e, i = r >=
|
|
23356
|
+
}), zn = Math.PI * 2;
|
|
23357
|
+
function Bn(e, t, n) {
|
|
23358
|
+
let r = n ? e - t : t - e, i = r >= zn ? zn : (r % zn + zn) % zn;
|
|
23359
23359
|
return n ? -i : i;
|
|
23360
23360
|
}
|
|
23361
|
-
function
|
|
23361
|
+
function Vn(e) {
|
|
23362
23362
|
let t = [], n = null, r = null, i = () => (r = {
|
|
23363
23363
|
segments: [],
|
|
23364
23364
|
closed: !1
|
|
@@ -23394,15 +23394,15 @@ function Hn(e) {
|
|
|
23394
23394
|
});
|
|
23395
23395
|
n = s[s.length - 1], o.segments.push({
|
|
23396
23396
|
index: a,
|
|
23397
|
-
at: (e) =>
|
|
23398
|
-
left: (t) => [
|
|
23399
|
-
right: (t) => [
|
|
23397
|
+
at: (e) => Ln(s, e)[0].at(-1),
|
|
23398
|
+
left: (t) => [Rn(e, Ln(s, t)[0])],
|
|
23399
|
+
right: (t) => [Rn(e, Ln(s, t)[1])]
|
|
23400
23400
|
});
|
|
23401
23401
|
return;
|
|
23402
23402
|
}
|
|
23403
23403
|
case "arc":
|
|
23404
23404
|
case "ellipse": {
|
|
23405
|
-
let o = r ?? i(), s = e === "ellipse", [c, l] = t, u = t[2], d = s ? t[3] : t[2], f = s ? t[4] : 0, p = s ? t[5] : t[3], m = s ? t[6] : t[4], h = !!(s ? t[7] : t[5]), g =
|
|
23405
|
+
let o = r ?? i(), s = e === "ellipse", [c, l] = t, u = t[2], d = s ? t[3] : t[2], f = s ? t[4] : 0, p = s ? t[5] : t[3], m = s ? t[6] : t[4], h = !!(s ? t[7] : t[5]), g = Bn(p, m, h), _ = Math.cos(f), v = Math.sin(f), y = (e) => {
|
|
23406
23406
|
let t = u * Math.cos(e), n = d * Math.sin(e);
|
|
23407
23407
|
return {
|
|
23408
23408
|
x: c + t * _ - n * v,
|
|
@@ -23432,10 +23432,10 @@ function Hn(e) {
|
|
|
23432
23432
|
let e = n;
|
|
23433
23433
|
o.segments.push({
|
|
23434
23434
|
index: a,
|
|
23435
|
-
at: (t) =>
|
|
23435
|
+
at: (t) => In(e, x, t),
|
|
23436
23436
|
left: (t) => [{
|
|
23437
23437
|
op: "lineTo",
|
|
23438
|
-
args: [
|
|
23438
|
+
args: [In(e, x, t).x, In(e, x, t).y]
|
|
23439
23439
|
}],
|
|
23440
23440
|
right: () => [b(p, m)]
|
|
23441
23441
|
});
|
|
@@ -23451,7 +23451,7 @@ function Hn(e) {
|
|
|
23451
23451
|
}
|
|
23452
23452
|
}), t;
|
|
23453
23453
|
}
|
|
23454
|
-
function
|
|
23454
|
+
function Hn(e, t, n, r) {
|
|
23455
23455
|
let i = (t) => {
|
|
23456
23456
|
let r = e.at(t);
|
|
23457
23457
|
return Math.hypot(r.x - n.x, r.y - n.y);
|
|
@@ -23471,25 +23471,25 @@ function Un(e, t, n, r) {
|
|
|
23471
23471
|
}
|
|
23472
23472
|
return null;
|
|
23473
23473
|
}
|
|
23474
|
-
function
|
|
23475
|
-
let n =
|
|
23474
|
+
function Un(e, t) {
|
|
23475
|
+
let n = Vn(e).at(-1);
|
|
23476
23476
|
if (!n || n.closed || n.segments.length === 0) return e;
|
|
23477
23477
|
let r = n.segments.at(-1).at(1);
|
|
23478
23478
|
for (let i = n.segments.length - 1; i >= 0; i--) {
|
|
23479
|
-
let a = n.segments[i], o =
|
|
23479
|
+
let a = n.segments[i], o = Hn(a, 1, r, t);
|
|
23480
23480
|
if (o !== null) return [...e.slice(0, a.index), ...a.left(o)];
|
|
23481
23481
|
}
|
|
23482
23482
|
return e.slice(0, n.segments[0].index);
|
|
23483
23483
|
}
|
|
23484
|
-
function
|
|
23485
|
-
let n =
|
|
23484
|
+
function Wn(e, t) {
|
|
23485
|
+
let n = Vn(e)[0];
|
|
23486
23486
|
if (!n || n.closed || n.segments.length === 0 || e[0]?.op !== "moveTo") return e;
|
|
23487
23487
|
let r = {
|
|
23488
23488
|
x: e[0].args[0],
|
|
23489
23489
|
y: e[0].args[1]
|
|
23490
23490
|
};
|
|
23491
23491
|
for (let i of n.segments) {
|
|
23492
|
-
let n =
|
|
23492
|
+
let n = Hn(i, 0, r, t);
|
|
23493
23493
|
if (n !== null) {
|
|
23494
23494
|
let t = i.at(n);
|
|
23495
23495
|
return [
|
|
@@ -23504,37 +23504,37 @@ function Gn(e, t) {
|
|
|
23504
23504
|
}
|
|
23505
23505
|
return e.slice(n.segments.at(-1).index + 1);
|
|
23506
23506
|
}
|
|
23507
|
-
function
|
|
23507
|
+
function Gn(e, t, n) {
|
|
23508
23508
|
if (!(t > 0) && !(n > 0)) return e;
|
|
23509
23509
|
let r = e.map((e) => ({
|
|
23510
23510
|
op: e.op,
|
|
23511
23511
|
args: [...e.args]
|
|
23512
23512
|
}));
|
|
23513
|
-
return n > 0 && (r =
|
|
23513
|
+
return n > 0 && (r = Un(r, n)), t > 0 && (r = Wn(r, t)), Object.freeze(r.map((e) => Object.freeze({
|
|
23514
23514
|
op: e.op,
|
|
23515
23515
|
args: Object.freeze(e.args)
|
|
23516
23516
|
})));
|
|
23517
23517
|
}
|
|
23518
|
-
function
|
|
23518
|
+
function Kn(e, t, n, r) {
|
|
23519
23519
|
let i = $t();
|
|
23520
|
-
t(i.sink), tn(e,
|
|
23520
|
+
t(i.sink), tn(e, Gn(i.commands, n, r));
|
|
23521
23521
|
}
|
|
23522
|
-
function
|
|
23522
|
+
function qn(e, t, n, r, i, a, o, s, c) {
|
|
23523
23523
|
let l = bn(t, i, a, o, void 0, n, r), u = l?.[l.length - 1];
|
|
23524
|
-
return !u || !u.stroke || !(u.fill === "none" || u.fill == null) ? !1 : (tn(e,
|
|
23524
|
+
return !u || !u.stroke || !(u.fill === "none" || u.fill == null) ? !1 : (tn(e, Gn(u.path, s, c)), !0);
|
|
23525
23525
|
}
|
|
23526
|
-
function
|
|
23527
|
-
let l =
|
|
23528
|
-
l &&
|
|
23526
|
+
function Jn(e, t, n, r, i, a, o, s, c) {
|
|
23527
|
+
let l = Fn(i, a, o, s);
|
|
23528
|
+
l && Yn(e, t, n, r, l, a, c);
|
|
23529
23529
|
}
|
|
23530
|
-
function
|
|
23530
|
+
function Yn(e, t, n, r, i, a, o) {
|
|
23531
23531
|
let s = o ?? l(a.color), c = u(a.fill) && typeof e.getTransform == "function" ? e.getTransform() : void 0;
|
|
23532
23532
|
e.save(), e.translate(t, n), e.rotate(r), e.fillStyle = s, e.strokeStyle = s, e.lineWidth = i.stroke.lineWidth, e.setLineDash([]), e.beginPath(), tn(e, i.path), i.paint === "stroke" && (e.lineCap = i.stroke.lineCap, e.lineJoin = i.stroke.lineJoin, e.miterLimit = i.stroke.miterLimit), c && typeof s == "object" && "setTransform" in s && e.setTransform(c), i.paint === "fill" ? e.fill() : e.stroke(), e.restore();
|
|
23533
23533
|
}
|
|
23534
|
-
function
|
|
23534
|
+
function Xn(e, t, n, r, i, a, o, s, c, l, d) {
|
|
23535
23535
|
if (!t.fill || s.type === "none") return;
|
|
23536
23536
|
if (!u(t.fill) || typeof e.getTransform != "function") return m(t.fill, e, c.x, c.y, c.w, c.h, l, d) ?? void 0;
|
|
23537
|
-
let f =
|
|
23537
|
+
let f = Nn(s, t, n, r);
|
|
23538
23538
|
if (!f) return;
|
|
23539
23539
|
let p = e.getTransform(), h = Math.cos(o), g = Math.sin(o), _ = p.a * h + p.c * g, v = p.b * h + p.d * g, y = -p.a * g + p.c * h, b = -p.b * g + p.d * h, x = (f.x0 + f.x1) / 2, S = (f.x1 - f.x0) / 2, C = p.a * i + p.c * a + p.e + _ * x, w = p.b * i + p.d * a + p.f + v * x, T = s.type === "oval", ee = T ? Math.hypot(_ * S, y * f.halfY) : Math.abs(_) * S + Math.abs(y) * f.halfY, E = T ? Math.hypot(v * S, b * f.halfY) : Math.abs(v) * S + Math.abs(b) * f.halfY;
|
|
23540
23540
|
return m(t.fill, e, c.x, c.y, c.w, c.h, l, d, void 0, void 0, {
|
|
@@ -23544,7 +23544,7 @@ function Zn(e, t, n, r, i, a, o, s, c, l, d) {
|
|
|
23544
23544
|
h: 2 * E
|
|
23545
23545
|
}) ?? void 0;
|
|
23546
23546
|
}
|
|
23547
|
-
function
|
|
23547
|
+
function Zn(e, t, n, r, i, a, o, s, c, l, u) {
|
|
23548
23548
|
let d = bn(t, i, a, o, void 0, n, r);
|
|
23549
23549
|
if (!d) return !1;
|
|
23550
23550
|
let f = !1, p = d.length - 1;
|
|
@@ -23576,21 +23576,21 @@ function Qn(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
23576
23576
|
}
|
|
23577
23577
|
return !0;
|
|
23578
23578
|
}
|
|
23579
|
-
var
|
|
23580
|
-
async function
|
|
23581
|
-
let n =
|
|
23579
|
+
var Qn = /* @__PURE__ */ new WeakMap();
|
|
23580
|
+
async function $n(e, t) {
|
|
23581
|
+
let n = Qn.get(e);
|
|
23582
23582
|
n || (n = {
|
|
23583
23583
|
active: 0,
|
|
23584
23584
|
waiters: []
|
|
23585
|
-
},
|
|
23585
|
+
}, Qn.set(e, n)), n.active >= 2 || n.waiters.length > 0 ? await new Promise((e) => n.waiters.push(e)) : n.active++;
|
|
23586
23586
|
try {
|
|
23587
23587
|
return await Promise.resolve(), await t();
|
|
23588
23588
|
} finally {
|
|
23589
23589
|
let t = n.waiters.shift();
|
|
23590
|
-
t ? t() : (n.active--, n.active === 0 &&
|
|
23590
|
+
t ? t() : (n.active--, n.active === 0 && Qn.delete(e));
|
|
23591
23591
|
}
|
|
23592
23592
|
}
|
|
23593
|
-
function
|
|
23593
|
+
function er(e = void 0) {
|
|
23594
23594
|
if (e !== void 0 && (typeof e != "object" || !e || Array.isArray(e))) throw TypeError("imageResources must be an object when provided");
|
|
23595
23595
|
let t = e?.decodedByteBudget ?? 134217728;
|
|
23596
23596
|
if (!Number.isSafeInteger(t) || t < 4 || t > 536870912) throw RangeError(`imageResources.decodedByteBudget must be a safe integer from 4 to ${ee} bytes`);
|
|
@@ -23604,13 +23604,13 @@ function tr(e = void 0) {
|
|
|
23604
23604
|
resolution: r
|
|
23605
23605
|
});
|
|
23606
23606
|
}
|
|
23607
|
-
function
|
|
23607
|
+
function tr(e) {
|
|
23608
23608
|
return Number.isFinite(e) && e > 0 ? Math.max(1, Math.ceil(e)) : 1;
|
|
23609
23609
|
}
|
|
23610
|
-
function
|
|
23610
|
+
function nr(e) {
|
|
23611
23611
|
return Number.isSafeInteger(e) && (e ?? 0) > 0 ? e : 1;
|
|
23612
23612
|
}
|
|
23613
|
-
function
|
|
23613
|
+
function rr(e, t) {
|
|
23614
23614
|
let n = 0;
|
|
23615
23615
|
for (let r of e.values()) {
|
|
23616
23616
|
let e = t(r), i = e.width * e.height * r.surfaces * 4;
|
|
@@ -23618,10 +23618,10 @@ function ir(e, t) {
|
|
|
23618
23618
|
}
|
|
23619
23619
|
return n;
|
|
23620
23620
|
}
|
|
23621
|
-
function
|
|
23621
|
+
function ir(e, t) {
|
|
23622
23622
|
let n = /* @__PURE__ */ new Map();
|
|
23623
23623
|
for (let t of e) {
|
|
23624
|
-
let e =
|
|
23624
|
+
let e = tr(t.targetWidthPx), r = tr(t.targetHeightPx), i = t.sourceWidthPx !== void 0 && t.sourceHeightPx !== void 0, a = i ? tr(t.sourceWidthPx) : void 0, o = i ? tr(t.sourceHeightPx) : void 0, s = nr(t.retainedSurfaceCount), c = n.get(t.key);
|
|
23625
23625
|
c ? (c.targetWidth = Math.max(c.targetWidth, e), c.targetHeight = Math.max(c.targetHeight, r), a !== void 0 && o !== void 0 && (c.sourceWidth = Math.max(c.sourceWidth ?? 0, a), c.sourceHeight = Math.max(c.sourceHeight ?? 0, o)), c.surfaces = Math.max(c.surfaces, s)) : n.set(t.key, {
|
|
23626
23626
|
targetWidth: e,
|
|
23627
23627
|
targetHeight: r,
|
|
@@ -23654,10 +23654,10 @@ function ar(e, t) {
|
|
|
23654
23654
|
retainedPixels: s,
|
|
23655
23655
|
maxRetainedPixels: n ?? s
|
|
23656
23656
|
});
|
|
23657
|
-
}, s =
|
|
23657
|
+
}, s = rr(n, r), c = [...n.values()].every((e) => {
|
|
23658
23658
|
let t = r(e);
|
|
23659
23659
|
return t.width * t.height <= T;
|
|
23660
|
-
}), l = [...n.values()].some((e) => e.sourceWidth === void 0 || e.sourceHeight === void 0), u = t.resolution === "native-if-fit" && !l && c && s <= t.decodedByteBudget, d =
|
|
23660
|
+
}), l = [...n.values()].some((e) => e.sourceWidth === void 0 || e.sourceHeight === void 0), u = t.resolution === "native-if-fit" && !l && c && s <= t.decodedByteBudget, d = rr(n, (e) => a(e, 1));
|
|
23661
23661
|
if (u) {
|
|
23662
23662
|
let e = /* @__PURE__ */ new Map();
|
|
23663
23663
|
for (let [t, i] of n) {
|
|
@@ -23702,7 +23702,7 @@ function ar(e, t) {
|
|
|
23702
23702
|
}
|
|
23703
23703
|
if (t.strategy === "strict" && d > t.decodedByteBudget) throw new E("active-decoded-bytes", t.decodedByteBudget, d);
|
|
23704
23704
|
if (t.strategy === "adaptive") {
|
|
23705
|
-
let e =
|
|
23705
|
+
let e = rr(n, (e) => a(e, 0));
|
|
23706
23706
|
if (e > t.decodedByteBudget) throw new E("active-decoded-bytes", t.decodedByteBudget, e);
|
|
23707
23707
|
}
|
|
23708
23708
|
let f = 1;
|
|
@@ -23710,13 +23710,13 @@ function ar(e, t) {
|
|
|
23710
23710
|
let e = 0, r = 1;
|
|
23711
23711
|
for (let i = 0; i < 40; i++) {
|
|
23712
23712
|
let i = (e + r) / 2;
|
|
23713
|
-
|
|
23713
|
+
rr(n, (e) => a(e, i)) <= t.decodedByteBudget ? e = i : r = i;
|
|
23714
23714
|
}
|
|
23715
23715
|
f = e;
|
|
23716
23716
|
}
|
|
23717
23717
|
let p = /* @__PURE__ */ new Map();
|
|
23718
23718
|
for (let [e, t] of n) p.set(e, o(t, f));
|
|
23719
|
-
let m =
|
|
23719
|
+
let m = rr(n, (e) => a(e, f)), h = f < 1 && n.size > 0 ? Math.min(...[...n.entries()].flatMap(([e, t]) => {
|
|
23720
23720
|
let n = p.get(e);
|
|
23721
23721
|
return [n.width / t.targetWidth, n.height / t.targetHeight];
|
|
23722
23722
|
})) : f;
|
|
@@ -23728,45 +23728,98 @@ function ar(e, t) {
|
|
|
23728
23728
|
degraded: f < 1
|
|
23729
23729
|
});
|
|
23730
23730
|
}
|
|
23731
|
-
function
|
|
23731
|
+
function ar(e) {
|
|
23732
|
+
return typeof e == "number" && Number.isFinite(e) && e > 0 ? Math.ceil(e) : void 0;
|
|
23733
|
+
}
|
|
23734
|
+
function or(e, t) {
|
|
23735
|
+
if (!Number.isFinite(e) || !Number.isFinite(t) || !(e > 0) || !(t > 0)) throw Error(`invalid SVG raster size: ${e}x${t}`);
|
|
23736
|
+
let n = Math.sqrt(T) / Math.sqrt(e) / Math.sqrt(t), r = Math.min(1, C / e, C / t, n);
|
|
23737
|
+
return {
|
|
23738
|
+
width: Math.min(C, Math.max(1, Math.floor(e * r))),
|
|
23739
|
+
height: Math.min(C, Math.max(1, Math.floor(t * r)))
|
|
23740
|
+
};
|
|
23741
|
+
}
|
|
23742
|
+
function sr(e, t, n, r) {
|
|
23743
|
+
let i = n === void 0 ? 0 : n / e, a = r === void 0 ? 0 : r / t, o = n === void 0 && r === void 0 ? 1 : Math.max(i, a), s = Math.min(C / e, C / t, Math.sqrt(T) / Math.sqrt(e) / Math.sqrt(t));
|
|
23744
|
+
if (!Number.isFinite(o) || !(o > 0) || !Number.isFinite(s) || !(s > 0)) throw Error(`invalid SVG raster scale: ${Math.min(o, s)}`);
|
|
23745
|
+
return s < o ? or(Math.max(1, Math.floor(e * s)), Math.max(1, Math.floor(t * s))) : n !== void 0 && i >= a ? or(n, Math.max(1, Math.ceil(t * n / e))) : r === void 0 ? or(Math.ceil(e), Math.ceil(t)) : or(Math.max(1, Math.ceil(e * r / t)), r);
|
|
23746
|
+
}
|
|
23747
|
+
function cr(e, t, n) {
|
|
23748
|
+
let r = ar(n.targetWidthPx), i = ar(n.targetHeightPx);
|
|
23749
|
+
if (r === void 0 && i === void 0 || !(e > 0) || !(t > 0) || !(r === void 0 || e > r) || !(i === void 0 || t > i)) return;
|
|
23750
|
+
let a = sr(e, t, r, i);
|
|
23751
|
+
throw new E("image-pixels", a.width * a.height, e * t);
|
|
23752
|
+
}
|
|
23753
|
+
async function lr(e, t = {}) {
|
|
23754
|
+
if (typeof Image > "u") throw Error("SVG host decode requires HTMLImageElement");
|
|
23755
|
+
let n = URL.createObjectURL(e);
|
|
23756
|
+
try {
|
|
23757
|
+
let e = new Image(), r = ar(t.targetWidthPx), i = ar(t.targetHeightPx);
|
|
23758
|
+
await new Promise((t, r) => {
|
|
23759
|
+
e.onload = () => {
|
|
23760
|
+
typeof e.decode == "function" ? e.decode().then(t).catch(t) : t();
|
|
23761
|
+
}, e.onerror = () => r(/* @__PURE__ */ Error("SVG host decode failed")), e.src = n;
|
|
23762
|
+
});
|
|
23763
|
+
let a = Number.isFinite(e.naturalWidth) && e.naturalWidth > 0 && Number.isFinite(e.naturalHeight) && e.naturalHeight > 0, o = sr(a ? e.naturalWidth : 300, a ? e.naturalHeight : 150, r, i);
|
|
23764
|
+
e.width = o.width, e.height = o.height;
|
|
23765
|
+
let s;
|
|
23766
|
+
if (typeof OffscreenCanvas < "u") {
|
|
23767
|
+
let t = new OffscreenCanvas(o.width, o.height), n = t.getContext("2d");
|
|
23768
|
+
if (!n) throw Error("SVG host raster target has no 2-D context");
|
|
23769
|
+
n.drawImage(e, 0, 0, o.width, o.height), s = t.transferToImageBitmap();
|
|
23770
|
+
} else {
|
|
23771
|
+
let t = document.createElement("canvas");
|
|
23772
|
+
t.width = o.width, t.height = o.height;
|
|
23773
|
+
let n = t.getContext("2d");
|
|
23774
|
+
if (!n) throw Error("SVG host raster target has no 2-D context");
|
|
23775
|
+
n.drawImage(e, 0, 0, o.width, o.height), s = await createImageBitmap(t);
|
|
23776
|
+
}
|
|
23777
|
+
let c = s.width * s.height;
|
|
23778
|
+
if (s.width > 32767 || s.height > 32767 || c > 33554432) throw te(s), new E("image-pixels", T, c);
|
|
23779
|
+
return s;
|
|
23780
|
+
} finally {
|
|
23781
|
+
URL.revokeObjectURL(n);
|
|
23782
|
+
}
|
|
23783
|
+
}
|
|
23784
|
+
function ur(e) {
|
|
23732
23785
|
return typeof e == "object" && !!e || typeof e == "function";
|
|
23733
23786
|
}
|
|
23734
|
-
var
|
|
23735
|
-
function
|
|
23736
|
-
return
|
|
23787
|
+
var dr = 256, N = /* @__PURE__ */ new WeakMap(), fr = /* @__PURE__ */ new WeakMap(), pr = /* @__PURE__ */ new WeakMap(), mr = /* @__PURE__ */ new WeakMap();
|
|
23788
|
+
function P(e) {
|
|
23789
|
+
return pr.get(e) ?? 0;
|
|
23737
23790
|
}
|
|
23738
|
-
function
|
|
23739
|
-
return
|
|
23791
|
+
function hr(e, t) {
|
|
23792
|
+
return mr.get(e)?.get(t) ?? 0;
|
|
23740
23793
|
}
|
|
23741
|
-
function
|
|
23742
|
-
if (
|
|
23794
|
+
function gr(e, t) {
|
|
23795
|
+
if (P(e) !== t) throw Error("Decoded bitmap cache was dropped during raster inspection");
|
|
23743
23796
|
}
|
|
23744
|
-
function
|
|
23797
|
+
function _r(e, t) {
|
|
23745
23798
|
return {
|
|
23746
23799
|
owner: e,
|
|
23747
|
-
ownerGeneration:
|
|
23800
|
+
ownerGeneration: P(e),
|
|
23748
23801
|
namespace: t,
|
|
23749
|
-
namespaceGeneration:
|
|
23802
|
+
namespaceGeneration: hr(e, t)
|
|
23750
23803
|
};
|
|
23751
23804
|
}
|
|
23752
|
-
function
|
|
23753
|
-
if (t.owner !== e ||
|
|
23805
|
+
function vr(e, t) {
|
|
23806
|
+
if (t.owner !== e || P(e) !== t.ownerGeneration) throw Error("Decoded bitmap cache was dropped during a derived image operation");
|
|
23754
23807
|
}
|
|
23755
|
-
function
|
|
23756
|
-
if (
|
|
23808
|
+
function yr(e, t, n) {
|
|
23809
|
+
if (vr(e, n), n.namespace !== t || hr(e, t) !== n.namespaceGeneration) throw Error("Decoded bitmap cache namespace was dropped during a derived image operation");
|
|
23757
23810
|
}
|
|
23758
|
-
function
|
|
23759
|
-
let t =
|
|
23811
|
+
function br(e) {
|
|
23812
|
+
let t = fr.get(e);
|
|
23760
23813
|
if (t) for (let e of t.values()) e.then((e) => {
|
|
23761
23814
|
e.initialBlob = void 0;
|
|
23762
23815
|
}).catch(() => {});
|
|
23763
23816
|
}
|
|
23764
|
-
function
|
|
23765
|
-
let i =
|
|
23766
|
-
i || (i = /* @__PURE__ */ new Map(),
|
|
23817
|
+
function xr(e, t, n, r) {
|
|
23818
|
+
let i = fr.get(e);
|
|
23819
|
+
i || (i = /* @__PURE__ */ new Map(), fr.set(e, i));
|
|
23767
23820
|
let a = i.get(t);
|
|
23768
23821
|
if (a) return a;
|
|
23769
|
-
let o =
|
|
23822
|
+
let o = $n(e, async () => {
|
|
23770
23823
|
let e = await r(t, n);
|
|
23771
23824
|
return {
|
|
23772
23825
|
inspection: await re(e),
|
|
@@ -23777,20 +23830,20 @@ function _r(e, t, n, r) {
|
|
|
23777
23830
|
});
|
|
23778
23831
|
return i.set(t, o), o;
|
|
23779
23832
|
}
|
|
23780
|
-
async function
|
|
23781
|
-
return (await
|
|
23833
|
+
async function Sr(e, t, n, r = n) {
|
|
23834
|
+
return (await xr(r, e, t, n)).inspection;
|
|
23782
23835
|
}
|
|
23783
|
-
function
|
|
23784
|
-
let t =
|
|
23836
|
+
function Cr(e) {
|
|
23837
|
+
let t = N.get(e);
|
|
23785
23838
|
return t || (t = {
|
|
23786
23839
|
entries: /* @__PURE__ */ new Map(),
|
|
23787
23840
|
retainedBytes: 0,
|
|
23788
23841
|
retainedLimit: S
|
|
23789
|
-
},
|
|
23842
|
+
}, N.set(e, t)), t;
|
|
23790
23843
|
}
|
|
23791
|
-
var
|
|
23792
|
-
async function
|
|
23793
|
-
let r =
|
|
23844
|
+
var wr = /* @__PURE__ */ new WeakMap(), Tr = /* @__PURE__ */ new WeakMap();
|
|
23845
|
+
async function Er(e, t, n) {
|
|
23846
|
+
let r = Tr.get(e);
|
|
23794
23847
|
if (!r) {
|
|
23795
23848
|
let i;
|
|
23796
23849
|
r = {
|
|
@@ -23798,12 +23851,12 @@ async function Sr(e, t, n) {
|
|
|
23798
23851
|
i = e;
|
|
23799
23852
|
}),
|
|
23800
23853
|
pending: 1
|
|
23801
|
-
},
|
|
23854
|
+
}, Tr.set(e, r);
|
|
23802
23855
|
let a;
|
|
23803
23856
|
try {
|
|
23804
|
-
return a =
|
|
23857
|
+
return a = jr(e, t), await n();
|
|
23805
23858
|
} finally {
|
|
23806
|
-
|
|
23859
|
+
br(e), a?.(), i(), r.pending--, r.pending === 0 && Tr.delete(e);
|
|
23807
23860
|
}
|
|
23808
23861
|
}
|
|
23809
23862
|
let i = r, a = i.tail.catch(() => {}), o, s = new Promise((e) => {
|
|
@@ -23812,25 +23865,25 @@ async function Sr(e, t, n) {
|
|
|
23812
23865
|
i.pending++, i.tail = a.then(() => s), await a;
|
|
23813
23866
|
let c;
|
|
23814
23867
|
try {
|
|
23815
|
-
return c =
|
|
23868
|
+
return c = jr(e, t), await n();
|
|
23816
23869
|
} finally {
|
|
23817
|
-
|
|
23870
|
+
br(e), c?.(), o(), i.pending--, i.pending === 0 && Tr.delete(e);
|
|
23818
23871
|
}
|
|
23819
23872
|
}
|
|
23820
|
-
var
|
|
23821
|
-
function
|
|
23822
|
-
!e ||
|
|
23873
|
+
var Dr = /* @__PURE__ */ new WeakSet();
|
|
23874
|
+
function Or(e) {
|
|
23875
|
+
!e || Dr.has(e) || (Dr.add(e), te(e));
|
|
23823
23876
|
}
|
|
23824
|
-
function
|
|
23877
|
+
function kr(e) {
|
|
23825
23878
|
try {
|
|
23826
|
-
|
|
23879
|
+
Or(e);
|
|
23827
23880
|
} catch {}
|
|
23828
23881
|
}
|
|
23829
|
-
function
|
|
23830
|
-
return
|
|
23882
|
+
function Ar(e) {
|
|
23883
|
+
return jr(e, { decodedByteBudget: Cr(e).retainedLimit });
|
|
23831
23884
|
}
|
|
23832
|
-
function
|
|
23833
|
-
let n =
|
|
23885
|
+
function jr(e, t) {
|
|
23886
|
+
let n = er(t), r = wr.get(e);
|
|
23834
23887
|
r || (r = {
|
|
23835
23888
|
count: 0,
|
|
23836
23889
|
deferred: [],
|
|
@@ -23838,106 +23891,106 @@ function Dr(e, t) {
|
|
|
23838
23891
|
activeBitmaps: /* @__PURE__ */ new WeakSet(),
|
|
23839
23892
|
limits: /* @__PURE__ */ new Map(),
|
|
23840
23893
|
activeLimit: n.decodedByteBudget
|
|
23841
|
-
},
|
|
23894
|
+
}, wr.set(e, r));
|
|
23842
23895
|
let i = r, a = Symbol("decoded-image-lease");
|
|
23843
23896
|
i.limits.set(a, n.decodedByteBudget), i.activeLimit = Math.min(...i.limits.values());
|
|
23844
|
-
let o =
|
|
23845
|
-
for (o.retainedLimit = i.activeLimit; o.retainedBytes > o.retainedLimit &&
|
|
23897
|
+
let o = Cr(e);
|
|
23898
|
+
for (o.retainedLimit = i.activeLimit; o.retainedBytes > o.retainedLimit && Pr(e, o););
|
|
23846
23899
|
i.count++;
|
|
23847
23900
|
let s = !1;
|
|
23848
23901
|
return () => {
|
|
23849
23902
|
if (s) return;
|
|
23850
23903
|
if (s = !0, i.count--, i.limits.delete(a), i.count > 0) {
|
|
23851
23904
|
i.activeLimit = Math.min(...i.limits.values());
|
|
23852
|
-
let t =
|
|
23905
|
+
let t = N.get(e);
|
|
23853
23906
|
t && (t.retainedLimit = i.activeLimit);
|
|
23854
23907
|
return;
|
|
23855
23908
|
}
|
|
23856
|
-
for (let e of i.deferred) e.then((e) =>
|
|
23857
|
-
i.deferred = [], i.activeBytes = 0, i.activeBitmaps = /* @__PURE__ */ new WeakSet(),
|
|
23858
|
-
let t =
|
|
23909
|
+
for (let e of i.deferred) e.then((e) => Or(e)).catch(() => {});
|
|
23910
|
+
i.deferred = [], i.activeBytes = 0, i.activeBitmaps = /* @__PURE__ */ new WeakSet(), wr.delete(e);
|
|
23911
|
+
let t = N.get(e);
|
|
23859
23912
|
t && (t.retainedLimit = S);
|
|
23860
23913
|
};
|
|
23861
23914
|
}
|
|
23862
|
-
function
|
|
23915
|
+
function Mr(e) {
|
|
23863
23916
|
if (!e) return 0;
|
|
23864
23917
|
let t = Number(e.width), n = Number(e.height);
|
|
23865
23918
|
return Number.isSafeInteger(t) && t > 0 && Number.isSafeInteger(n) && n > 0 ? t * n * 4 : 0;
|
|
23866
23919
|
}
|
|
23867
|
-
function
|
|
23920
|
+
function Nr(e, t) {
|
|
23868
23921
|
if (!t) return;
|
|
23869
|
-
let n =
|
|
23922
|
+
let n = wr.get(e);
|
|
23870
23923
|
if (!n || n.count === 0 || n.activeBitmaps.has(t)) return;
|
|
23871
|
-
let r = n.activeBytes +
|
|
23924
|
+
let r = n.activeBytes + Mr(t);
|
|
23872
23925
|
if (r > n.activeLimit) throw new E("active-decoded-bytes", n.activeLimit, r);
|
|
23873
23926
|
n.activeBitmaps.add(t), n.activeBytes = r;
|
|
23874
23927
|
}
|
|
23875
|
-
function
|
|
23928
|
+
function Pr(e, t, n) {
|
|
23876
23929
|
let r = [...t.entries].find(([e]) => e !== n);
|
|
23877
23930
|
if (!r) return !1;
|
|
23878
23931
|
let [i, a] = r;
|
|
23879
|
-
return t.entries.delete(i), t.retainedBytes -= a.weight,
|
|
23932
|
+
return t.entries.delete(i), t.retainedBytes -= a.weight, Fr(e, a.ownedPromise), !0;
|
|
23880
23933
|
}
|
|
23881
|
-
function
|
|
23882
|
-
let n =
|
|
23934
|
+
function Fr(e, t) {
|
|
23935
|
+
let n = wr.get(e);
|
|
23883
23936
|
if (n && n.count > 0) {
|
|
23884
23937
|
n.deferred.push(t);
|
|
23885
23938
|
return;
|
|
23886
23939
|
}
|
|
23887
|
-
t.then((e) =>
|
|
23940
|
+
t.then((e) => Or(e)).catch(() => {});
|
|
23888
23941
|
}
|
|
23889
|
-
function
|
|
23942
|
+
function F(e) {
|
|
23890
23943
|
if (!(typeof e != "number" || !Number.isFinite(e) || !(e > 0))) return Math.ceil(e);
|
|
23891
23944
|
}
|
|
23892
|
-
function
|
|
23945
|
+
function Ir(e) {
|
|
23893
23946
|
return {
|
|
23894
23947
|
...e,
|
|
23895
|
-
targetWidthPx:
|
|
23896
|
-
targetHeightPx:
|
|
23948
|
+
targetWidthPx: F(e.targetWidthPx),
|
|
23949
|
+
targetHeightPx: F(e.targetHeightPx)
|
|
23897
23950
|
};
|
|
23898
23951
|
}
|
|
23899
|
-
function
|
|
23952
|
+
function Lr(e) {
|
|
23900
23953
|
let t = e.maxRetainedPixels;
|
|
23901
23954
|
return typeof t == "number" && Number.isSafeInteger(t) && t > 0 ? Math.min(t, S / 4) : S / 4;
|
|
23902
23955
|
}
|
|
23903
|
-
function
|
|
23904
|
-
return
|
|
23956
|
+
function Rr(e) {
|
|
23957
|
+
return Lr(e) < S / 4;
|
|
23905
23958
|
}
|
|
23906
|
-
function
|
|
23959
|
+
function zr(e, t) {
|
|
23907
23960
|
if (!e) return null;
|
|
23908
|
-
let n =
|
|
23961
|
+
let n = Lr(t), r = Number(e.width), i = Number(e.height), a = Math.max(r, i);
|
|
23909
23962
|
if (!Number.isFinite(a) || a > 32767) throw new E("image-dimension", C, Number.isFinite(a) ? a : 2 ** 53 - 1);
|
|
23910
23963
|
let o = r * i;
|
|
23911
23964
|
if (!(r > 0) || !(i > 0) || o > n) throw new E("image-pixels", n, Number.isSafeInteger(o) && o >= 0 ? o : 2 ** 53 - 1);
|
|
23912
23965
|
return e;
|
|
23913
23966
|
}
|
|
23914
23967
|
function I(e, t = {}) {
|
|
23915
|
-
let n =
|
|
23968
|
+
let n = F(t.targetWidthPx), r = F(t.targetHeightPx), i = `${e.length}:${e}`, a = Lr(t);
|
|
23916
23969
|
return n || r ? `raster:${i}:${n ?? 0}x${r ?? 0}:p${a}` : `native:${i}`;
|
|
23917
23970
|
}
|
|
23918
|
-
function
|
|
23971
|
+
function Br(e) {
|
|
23919
23972
|
return e.inspection.format === "wmf" || e.inspection.format === "emf";
|
|
23920
23973
|
}
|
|
23921
|
-
function
|
|
23974
|
+
function Vr(e) {
|
|
23922
23975
|
let t = r(e.widthPt ?? 0, e.heightPt ?? 0);
|
|
23923
23976
|
return {
|
|
23924
23977
|
width: t.w,
|
|
23925
23978
|
height: t.h,
|
|
23926
|
-
pixelLimit:
|
|
23979
|
+
pixelLimit: Lr(e),
|
|
23927
23980
|
rejectIncomplete: e.incompleteMetafile === "reject"
|
|
23928
23981
|
};
|
|
23929
23982
|
}
|
|
23930
|
-
function
|
|
23983
|
+
function Hr(e, t) {
|
|
23931
23984
|
let n = `${e.length}:${e}`, r = t.rejectIncomplete ? "r1:" : "";
|
|
23932
23985
|
return `metafile:${n}:p${t.pixelLimit}:${r}`;
|
|
23933
23986
|
}
|
|
23934
|
-
function
|
|
23935
|
-
let r =
|
|
23936
|
-
return `${
|
|
23987
|
+
function Ur(e, t, n) {
|
|
23988
|
+
let r = Vr(t), i = F(n?.width) ?? r.width, a = F(n?.height) ?? r.height;
|
|
23989
|
+
return `${Hr(e, r)}${i}x${a}`;
|
|
23937
23990
|
}
|
|
23938
|
-
function
|
|
23939
|
-
let r =
|
|
23940
|
-
for (let t of
|
|
23991
|
+
function Wr(e, t, n) {
|
|
23992
|
+
let r = Vr(n), i = `${L}${Hr(t, r)}`, a;
|
|
23993
|
+
for (let t of N.get(e)?.entries.keys() ?? []) {
|
|
23941
23994
|
if (!t.startsWith(i)) continue;
|
|
23942
23995
|
let e = /^(\d+)x(\d+)$/.exec(t.slice(i.length));
|
|
23943
23996
|
if (!e) continue;
|
|
@@ -23951,11 +24004,11 @@ function zr(e, t, n) {
|
|
|
23951
24004
|
}
|
|
23952
24005
|
return a?.key;
|
|
23953
24006
|
}
|
|
23954
|
-
function
|
|
23955
|
-
let i =
|
|
24007
|
+
function Gr(e, t, n, r) {
|
|
24008
|
+
let i = F(n.targetWidthPx), a = F(n.targetHeightPx);
|
|
23956
24009
|
if (!i && !a) return;
|
|
23957
|
-
let o =
|
|
23958
|
-
for (let [t, n] of
|
|
24010
|
+
let o = Lr(n), s = `${L}raster:${`${t.length}:${t}`}:`, c;
|
|
24011
|
+
for (let [t, n] of N.get(e)?.entries ?? []) {
|
|
23959
24012
|
if (!t.startsWith(s)) continue;
|
|
23960
24013
|
let e = /^(\d+)x(\d+):p(\d+)$/.exec(t.slice(s.length));
|
|
23961
24014
|
if (!e) continue;
|
|
@@ -23969,20 +24022,20 @@ function Br(e, t, n, r) {
|
|
|
23969
24022
|
}
|
|
23970
24023
|
return c?.key;
|
|
23971
24024
|
}
|
|
23972
|
-
function
|
|
23973
|
-
let n =
|
|
24025
|
+
function Kr(e, t = {}) {
|
|
24026
|
+
let n = Lr(t), r = e.inspection.dimensions;
|
|
23974
24027
|
if (!r) return !1;
|
|
23975
24028
|
let i = r.width * r.height;
|
|
23976
24029
|
if (t.maxRetainedPixels !== void 0 && !se(r) && i <= n) return !1;
|
|
23977
|
-
let a =
|
|
24030
|
+
let a = F(t.targetWidthPx), o = F(t.targetHeightPx);
|
|
23978
24031
|
return (e.inspection.format === "tiff" ? (a !== void 0 || o !== void 0) && (a === void 0 || a < r.width) && (o === void 0 || o < r.height) : a !== void 0 && o !== void 0 && (a < r.width || o < r.height)) || se(r) || i > n;
|
|
23979
24032
|
}
|
|
23980
|
-
async function
|
|
23981
|
-
i &&
|
|
23982
|
-
let o =
|
|
23983
|
-
i ?
|
|
23984
|
-
let l =
|
|
23985
|
-
if (a) return l ?
|
|
24033
|
+
async function qr(e, t, n, r = {}, i, a) {
|
|
24034
|
+
i && vr(n, i);
|
|
24035
|
+
let o = Ir(r), s = i?.ownerGeneration ?? P(n), c = await xr(n, e, t, n);
|
|
24036
|
+
i ? vr(n, i) : gr(n, s);
|
|
24037
|
+
let l = Br(c);
|
|
24038
|
+
if (a) return l ? Ur(e, o, {
|
|
23986
24039
|
width: Number(a.width),
|
|
23987
24040
|
height: Number(a.height)
|
|
23988
24041
|
}) : I(e, {
|
|
@@ -23990,19 +24043,19 @@ async function Hr(e, t, n, r = {}, i, a) {
|
|
|
23990
24043
|
targetHeightPx: Number(a.height),
|
|
23991
24044
|
maxRetainedPixels: o.maxRetainedPixels
|
|
23992
24045
|
});
|
|
23993
|
-
if (l) return
|
|
24046
|
+
if (l) return Wr(n, e, o) ?? Ur(e, o);
|
|
23994
24047
|
if (!o.targetWidthPx && !o.targetHeightPx) return I(e);
|
|
23995
24048
|
let u = `${L}${I(e)}`;
|
|
23996
|
-
return !
|
|
24049
|
+
return !Rr(o) && N.get(n)?.entries.has(u) ? I(e) : Kr(c, o) ? Gr(n, e, o, c.inspection.dimensions) ?? I(e, o) : I(e);
|
|
23997
24050
|
}
|
|
23998
|
-
function
|
|
23999
|
-
let i =
|
|
24000
|
-
if (o) return a.delete(e), a.set(e, o), o.promise.then((e) => (
|
|
24001
|
-
let s = r ? Promise.resolve().then(r).then(() =>
|
|
24051
|
+
function Jr(e, t, n, r) {
|
|
24052
|
+
let i = Cr(t), a = i.entries, o = a.get(e);
|
|
24053
|
+
if (o) return a.delete(e), a.set(e, o), o.promise.then((e) => (Nr(t, e), e));
|
|
24054
|
+
let s = r ? Promise.resolve().then(r).then(() => $n(t, n)) : $n(t, n), c = s.then(({ bitmap: e, owned: t }) => t ? e : null).catch(() => null), l = s.then(({ bitmap: e, owned: n }) => {
|
|
24002
24055
|
try {
|
|
24003
|
-
return
|
|
24056
|
+
return Nr(t, e), e;
|
|
24004
24057
|
} catch (t) {
|
|
24005
|
-
throw n &&
|
|
24058
|
+
throw n && Or(e), t;
|
|
24006
24059
|
}
|
|
24007
24060
|
}), u = {
|
|
24008
24061
|
promise: l,
|
|
@@ -24015,42 +24068,45 @@ function Ur(e, t, n, r) {
|
|
|
24015
24068
|
a.delete(e);
|
|
24016
24069
|
return;
|
|
24017
24070
|
}
|
|
24018
|
-
for (u.weight =
|
|
24071
|
+
for (u.weight = Mr(n), i.retainedBytes += u.weight; i.retainedBytes > i.retainedLimit && Pr(t, i, e););
|
|
24019
24072
|
}
|
|
24020
24073
|
}).catch(() => {}), l.catch(() => {
|
|
24021
|
-
a.get(e) === u && (a.delete(e), i.retainedBytes -= u.weight,
|
|
24022
|
-
}), a.set(e, u); a.size >
|
|
24074
|
+
a.get(e) === u && (a.delete(e), i.retainedBytes -= u.weight, Fr(t, c));
|
|
24075
|
+
}), a.set(e, u); a.size > dr && Pr(t, i, e););
|
|
24023
24076
|
return l;
|
|
24024
24077
|
}
|
|
24025
|
-
var
|
|
24026
|
-
function
|
|
24027
|
-
return
|
|
24078
|
+
var Yr = "base", L = `${Yr}:`, Xr = "derived:";
|
|
24079
|
+
function Zr(e, t, n, r) {
|
|
24080
|
+
return Jr(`${e}:${t}`, n, r);
|
|
24028
24081
|
}
|
|
24029
|
-
function
|
|
24030
|
-
return i &&
|
|
24031
|
-
i &&
|
|
24082
|
+
function Qr(e, t, n, r, i, a) {
|
|
24083
|
+
return i && yr(n, e, i), Jr(`${Xr}${e}:${t}`, n, () => (i && yr(n, e, i), r()), a ? async () => {
|
|
24084
|
+
i && yr(n, e, i), await a(), i && yr(n, e, i);
|
|
24032
24085
|
} : void 0);
|
|
24033
24086
|
}
|
|
24034
|
-
function
|
|
24035
|
-
let a =
|
|
24036
|
-
if (t === "image/svg+xml" && f) return
|
|
24087
|
+
function $r(e, t, n, r = {}, i = n) {
|
|
24088
|
+
let a = Ir(r), { widthPt: o = 0, heightPt: s = 0, tiff: c, targetWidthPx: l, targetHeightPx: u, maxRetainedPixels: d, svgDecoder: f, incompleteMetafile: p } = a;
|
|
24089
|
+
if (t === "image/svg+xml" && f) return Zr(Yr, I(e, a), i, async () => {
|
|
24037
24090
|
let r = await f(await n(e, t), {
|
|
24038
24091
|
targetWidthPx: l,
|
|
24039
24092
|
targetHeightPx: u
|
|
24040
24093
|
});
|
|
24041
24094
|
try {
|
|
24042
|
-
|
|
24095
|
+
zr(r, a), r && cr(r.width, r.height, {
|
|
24096
|
+
targetWidthPx: l,
|
|
24097
|
+
targetHeightPx: u
|
|
24098
|
+
});
|
|
24043
24099
|
} catch (e) {
|
|
24044
|
-
throw
|
|
24100
|
+
throw Or(r), e;
|
|
24045
24101
|
}
|
|
24046
24102
|
return {
|
|
24047
24103
|
bitmap: r,
|
|
24048
24104
|
owned: !0
|
|
24049
24105
|
};
|
|
24050
|
-
}).then((e) =>
|
|
24106
|
+
}).then((e) => zr(e, a));
|
|
24051
24107
|
let m = (r, f, m = !0) => {
|
|
24052
24108
|
let h = f?.initialBlob;
|
|
24053
|
-
return f && (f.initialBlob = void 0),
|
|
24109
|
+
return f && (f.initialBlob = void 0), Zr(Yr, r, i, async () => {
|
|
24054
24110
|
let r = h ?? await n(e, t), i = {
|
|
24055
24111
|
widthPt: o,
|
|
24056
24112
|
heightPt: s,
|
|
@@ -24064,36 +24120,36 @@ function Jr(e, t, n, r = {}, i = n) {
|
|
|
24064
24120
|
bitmap: f ? await ne(r, i, f.inspection) : await oe(r, i),
|
|
24065
24121
|
owned: !0
|
|
24066
24122
|
};
|
|
24067
|
-
}).then((e) =>
|
|
24068
|
-
}, h =
|
|
24069
|
-
return
|
|
24070
|
-
if (
|
|
24123
|
+
}).then((e) => zr(e, a));
|
|
24124
|
+
}, h = P(i);
|
|
24125
|
+
return xr(i, e, t, n).then((t) => {
|
|
24126
|
+
if (gr(i, h), Br(t)) return m(Wr(i, e, a) ?? Ur(e, a), t);
|
|
24071
24127
|
if (!l && !u) return m(I(e), t, !1);
|
|
24072
24128
|
let n = `${L}${I(e)}`;
|
|
24073
|
-
if (!
|
|
24074
|
-
let r =
|
|
24075
|
-
return m(r ?
|
|
24129
|
+
if (!Rr(a) && N.get(i)?.entries.has(n)) return m(I(e), t, !1);
|
|
24130
|
+
let r = Kr(t, a);
|
|
24131
|
+
return m(r ? Gr(i, e, a, t.inspection.dimensions) ?? I(e, a) : I(e), t, r);
|
|
24076
24132
|
});
|
|
24077
24133
|
}
|
|
24078
|
-
function
|
|
24079
|
-
return
|
|
24134
|
+
function ei(e, t) {
|
|
24135
|
+
return N.get(t)?.entries.get(`${L}${I(e)}`)?.bitmap;
|
|
24080
24136
|
}
|
|
24081
|
-
function
|
|
24082
|
-
if (!
|
|
24083
|
-
|
|
24084
|
-
let t =
|
|
24137
|
+
function ti(e) {
|
|
24138
|
+
if (!ur(e)) return;
|
|
24139
|
+
pr.set(e, P(e) + 1), mr.delete(e), fr.delete(e);
|
|
24140
|
+
let t = N.get(e);
|
|
24085
24141
|
if (t) {
|
|
24086
|
-
for (let n of t.entries.values())
|
|
24087
|
-
t.entries.clear(), t.retainedBytes = 0,
|
|
24142
|
+
for (let n of t.entries.values()) Fr(e, n.ownedPromise);
|
|
24143
|
+
t.entries.clear(), t.retainedBytes = 0, N.delete(e);
|
|
24088
24144
|
}
|
|
24089
24145
|
}
|
|
24090
|
-
var
|
|
24091
|
-
function
|
|
24092
|
-
let t =
|
|
24093
|
-
return t || (t = { imgs: /* @__PURE__ */ new Map() },
|
|
24146
|
+
var ni = /* @__PURE__ */ new WeakMap(), ri = 256;
|
|
24147
|
+
function ii(e) {
|
|
24148
|
+
let t = ni.get(e);
|
|
24149
|
+
return t || (t = { imgs: /* @__PURE__ */ new Map() }, ni.set(e, t)), t;
|
|
24094
24150
|
}
|
|
24095
|
-
function
|
|
24096
|
-
if (typeof Image > "u") return
|
|
24151
|
+
function ai(e, t, n = {}) {
|
|
24152
|
+
if (typeof Image > "u") return $r(e, "image/svg+xml", t, {
|
|
24097
24153
|
targetWidthPx: n.targetWidthPx,
|
|
24098
24154
|
targetHeightPx: n.targetHeightPx,
|
|
24099
24155
|
maxRetainedPixels: n.maxRetainedPixels,
|
|
@@ -24102,10 +24158,10 @@ function ei(e, t, n = {}) {
|
|
|
24102
24158
|
if (!t) throw Error(`svg decode failed: ${e}`);
|
|
24103
24159
|
return t;
|
|
24104
24160
|
});
|
|
24105
|
-
let r =
|
|
24161
|
+
let r = ii(t), i = r.imgs.get(e);
|
|
24106
24162
|
if (i) return r.imgs.delete(e), r.imgs.set(e, i), i.promise;
|
|
24107
24163
|
let a = {};
|
|
24108
|
-
if (a.promise =
|
|
24164
|
+
if (a.promise = $n(t, async () => {
|
|
24109
24165
|
if (r.imgs.get(e) !== a) throw Error("SVG decode was superseded before it started");
|
|
24110
24166
|
let n = await t(e, "image/svg+xml"), i = URL.createObjectURL(n);
|
|
24111
24167
|
try {
|
|
@@ -24120,64 +24176,17 @@ function ei(e, t, n = {}) {
|
|
|
24120
24176
|
}
|
|
24121
24177
|
}), a.promise.catch(() => {
|
|
24122
24178
|
r.imgs.get(e) === a && r.imgs.delete(e);
|
|
24123
|
-
}), r.imgs.set(e, a), r.imgs.size >
|
|
24179
|
+
}), r.imgs.set(e, a), r.imgs.size > ri) {
|
|
24124
24180
|
let e = r.imgs.keys().next().value;
|
|
24125
24181
|
r.imgs.delete(e);
|
|
24126
24182
|
}
|
|
24127
24183
|
return a.promise;
|
|
24128
24184
|
}
|
|
24129
|
-
function
|
|
24130
|
-
let t =
|
|
24131
|
-
t && (t.imgs.clear(),
|
|
24132
|
-
}
|
|
24133
|
-
function ni(e) {
|
|
24134
|
-
return typeof e == "number" && Number.isFinite(e) && e > 0 ? Math.ceil(e) : void 0;
|
|
24135
|
-
}
|
|
24136
|
-
function ri(e, t) {
|
|
24137
|
-
if (!Number.isFinite(e) || !Number.isFinite(t) || !(e > 0) || !(t > 0)) throw Error(`invalid SVG raster size: ${e}x${t}`);
|
|
24138
|
-
let n = Math.sqrt(T) / Math.sqrt(e) / Math.sqrt(t), r = Math.min(1, C / e, C / t, n);
|
|
24139
|
-
return {
|
|
24140
|
-
width: Math.min(C, Math.max(1, Math.floor(e * r))),
|
|
24141
|
-
height: Math.min(C, Math.max(1, Math.floor(t * r)))
|
|
24142
|
-
};
|
|
24143
|
-
}
|
|
24144
|
-
function ii(e, t, n, r) {
|
|
24145
|
-
let i = n === void 0 ? 0 : n / e, a = r === void 0 ? 0 : r / t, o = n === void 0 && r === void 0 ? 1 : Math.max(i, a), s = Math.min(C / e, C / t, Math.sqrt(T) / Math.sqrt(e) / Math.sqrt(t));
|
|
24146
|
-
if (!Number.isFinite(o) || !(o > 0) || !Number.isFinite(s) || !(s > 0)) throw Error(`invalid SVG raster scale: ${Math.min(o, s)}`);
|
|
24147
|
-
return s < o ? ri(Math.max(1, Math.floor(e * s)), Math.max(1, Math.floor(t * s))) : n !== void 0 && i >= a ? ri(n, Math.max(1, Math.ceil(t * n / e))) : r === void 0 ? ri(Math.ceil(e), Math.ceil(t)) : ri(Math.max(1, Math.ceil(e * r / t)), r);
|
|
24148
|
-
}
|
|
24149
|
-
async function ai(e, t = {}) {
|
|
24150
|
-
if (typeof Image > "u") throw Error("SVG host decode requires HTMLImageElement");
|
|
24151
|
-
let n = URL.createObjectURL(e);
|
|
24152
|
-
try {
|
|
24153
|
-
let e = new Image(), r = ni(t.targetWidthPx), i = ni(t.targetHeightPx);
|
|
24154
|
-
await new Promise((t, r) => {
|
|
24155
|
-
e.onload = () => {
|
|
24156
|
-
typeof e.decode == "function" ? e.decode().then(t).catch(t) : t();
|
|
24157
|
-
}, e.onerror = () => r(/* @__PURE__ */ Error("SVG host decode failed")), e.src = n;
|
|
24158
|
-
});
|
|
24159
|
-
let a = Number.isFinite(e.naturalWidth) && e.naturalWidth > 0 && Number.isFinite(e.naturalHeight) && e.naturalHeight > 0, o = ii(a ? e.naturalWidth : 300, a ? e.naturalHeight : 150, r, i);
|
|
24160
|
-
e.width = o.width, e.height = o.height;
|
|
24161
|
-
let s;
|
|
24162
|
-
if (typeof OffscreenCanvas < "u") {
|
|
24163
|
-
let t = new OffscreenCanvas(o.width, o.height), n = t.getContext("2d");
|
|
24164
|
-
if (!n) throw Error("SVG host raster target has no 2-D context");
|
|
24165
|
-
n.drawImage(e, 0, 0, o.width, o.height), s = t.transferToImageBitmap();
|
|
24166
|
-
} else {
|
|
24167
|
-
let t = document.createElement("canvas");
|
|
24168
|
-
t.width = o.width, t.height = o.height;
|
|
24169
|
-
let n = t.getContext("2d");
|
|
24170
|
-
if (!n) throw Error("SVG host raster target has no 2-D context");
|
|
24171
|
-
n.drawImage(e, 0, 0, o.width, o.height), s = await createImageBitmap(t);
|
|
24172
|
-
}
|
|
24173
|
-
let c = s.width * s.height;
|
|
24174
|
-
if (s.width > 32767 || s.height > 32767 || c > 33554432) throw te(s), new E("image-pixels", T, c);
|
|
24175
|
-
return s;
|
|
24176
|
-
} finally {
|
|
24177
|
-
URL.revokeObjectURL(n);
|
|
24178
|
-
}
|
|
24185
|
+
function oi(e) {
|
|
24186
|
+
let t = ni.get(e);
|
|
24187
|
+
t && (t.imgs.clear(), ni.delete(e));
|
|
24179
24188
|
}
|
|
24180
|
-
var
|
|
24189
|
+
var si = class {
|
|
24181
24190
|
limit;
|
|
24182
24191
|
used = 0;
|
|
24183
24192
|
constructor(e = y) {
|
|
@@ -24192,7 +24201,7 @@ var oi = class {
|
|
|
24192
24201
|
function R() {
|
|
24193
24202
|
throw new g("unsupported-image-effect", "Malformed image effect parameters");
|
|
24194
24203
|
}
|
|
24195
|
-
var z = (e) => typeof e == "string" && /^(?:[0-9a-f]{6}|[0-9a-f]{8})$/i.test(e),
|
|
24204
|
+
var z = (e) => typeof e == "string" && /^(?:[0-9a-f]{6}|[0-9a-f]{8})$/i.test(e), ci = (e) => typeof e == "string" && /^[0-9a-f]{6}$/i.test(e), li = (e) => [
|
|
24196
24205
|
"over",
|
|
24197
24206
|
"mult",
|
|
24198
24207
|
"screen",
|
|
@@ -24205,8 +24214,8 @@ function B(e, t, n = -Infinity, r = Infinity) {
|
|
|
24205
24214
|
(typeof t != "number" || !Number.isFinite(t) || t < n || t > r) && R();
|
|
24206
24215
|
}
|
|
24207
24216
|
}
|
|
24208
|
-
function
|
|
24209
|
-
(!e || !
|
|
24217
|
+
function ui(e) {
|
|
24218
|
+
(!e || !ci(e.color)) && R(), B(e, ["alpha"], 0, 1), B(e, ["blur", "dist"], 0), B(e, ["dir"]);
|
|
24210
24219
|
for (let t of [
|
|
24211
24220
|
"sx",
|
|
24212
24221
|
"sy",
|
|
@@ -24225,7 +24234,7 @@ function li(e) {
|
|
|
24225
24234
|
"br"
|
|
24226
24235
|
].includes(e.algn) && R(), e.rotWithShape !== void 0 && typeof e.rotWithShape != "boolean" && R();
|
|
24227
24236
|
}
|
|
24228
|
-
function
|
|
24237
|
+
function di(e) {
|
|
24229
24238
|
switch (e || R(), e.fillType) {
|
|
24230
24239
|
case "none": return;
|
|
24231
24240
|
case "solid":
|
|
@@ -24270,7 +24279,7 @@ function ui(e) {
|
|
|
24270
24279
|
default: R();
|
|
24271
24280
|
}
|
|
24272
24281
|
}
|
|
24273
|
-
function
|
|
24282
|
+
function fi(e, t) {
|
|
24274
24283
|
switch ((!e || typeof e != "object") && R(), e.type) {
|
|
24275
24284
|
case "grayscale":
|
|
24276
24285
|
case "alphaCeiling":
|
|
@@ -24289,10 +24298,10 @@ function di(e, t) {
|
|
|
24289
24298
|
e.color !== void 0 && !z(e.color) && R();
|
|
24290
24299
|
return;
|
|
24291
24300
|
case "colorReplace":
|
|
24292
|
-
|
|
24301
|
+
ci(e.color) || R();
|
|
24293
24302
|
return;
|
|
24294
24303
|
case "colorChange":
|
|
24295
|
-
(!
|
|
24304
|
+
(!ci(e.from) || !ci(e.to) || typeof e.useAlpha != "boolean") && R(), B(e, ["fromAlpha", "toAlpha"], 0, 1);
|
|
24296
24305
|
return;
|
|
24297
24306
|
case "duotone": {
|
|
24298
24307
|
let n = e.clr1 ?? t.duotone?.clr1, r = e.clr2 ?? t.duotone?.clr2;
|
|
@@ -24331,13 +24340,13 @@ function di(e, t) {
|
|
|
24331
24340
|
]);
|
|
24332
24341
|
return;
|
|
24333
24342
|
case "glow":
|
|
24334
|
-
(!e.glow || !
|
|
24343
|
+
(!e.glow || !ci(e.glow.color)) && R(), B(e.glow, ["radius"], 0), B(e.glow, ["alpha"], 0, 1);
|
|
24335
24344
|
return;
|
|
24336
24345
|
case "shadow":
|
|
24337
|
-
|
|
24346
|
+
ui(e.shadow), e.inner && e.shadow.rotWithShape === !1 && R();
|
|
24338
24347
|
return;
|
|
24339
24348
|
case "presetShadow":
|
|
24340
|
-
(!Array.isArray(e.shadows) || e.shadows.length < 1 || e.shadows.length > 2) && R(), e.shadows.forEach(
|
|
24349
|
+
(!Array.isArray(e.shadows) || e.shadows.length < 1 || e.shadows.length > 2) && R(), e.shadows.forEach(ui);
|
|
24341
24350
|
return;
|
|
24342
24351
|
case "reflection":
|
|
24343
24352
|
e.reflection || R(), e.reflection.rotWithShape !== void 0 && typeof e.reflection.rotWithShape != "boolean" && R(), e.reflection.algn !== void 0 && ![
|
|
@@ -24367,13 +24376,13 @@ function di(e, t) {
|
|
|
24367
24376
|
]) t in e.reflection && B(e.reflection, [t]);
|
|
24368
24377
|
return;
|
|
24369
24378
|
case "fill":
|
|
24370
|
-
|
|
24379
|
+
di(e.fill);
|
|
24371
24380
|
return;
|
|
24372
24381
|
case "fillOverlay":
|
|
24373
|
-
|
|
24382
|
+
di(e.fill), li(e.blend) || R();
|
|
24374
24383
|
return;
|
|
24375
24384
|
case "blend":
|
|
24376
|
-
|
|
24385
|
+
li(e.blend) || R();
|
|
24377
24386
|
return;
|
|
24378
24387
|
case "alphaMod":
|
|
24379
24388
|
case "container": return;
|
|
@@ -24388,7 +24397,7 @@ function di(e, t) {
|
|
|
24388
24397
|
default: R();
|
|
24389
24398
|
}
|
|
24390
24399
|
}
|
|
24391
|
-
function
|
|
24400
|
+
function pi(e, t) {
|
|
24392
24401
|
let n = e.frame ?? {
|
|
24393
24402
|
x: 0,
|
|
24394
24403
|
y: 0,
|
|
@@ -24420,8 +24429,8 @@ function fi(e, t) {
|
|
|
24420
24429
|
}
|
|
24421
24430
|
};
|
|
24422
24431
|
}
|
|
24423
|
-
function
|
|
24424
|
-
let n =
|
|
24432
|
+
function mi(e, t) {
|
|
24433
|
+
let n = pi(e, t), r = new Uint8ClampedArray(n.width * n.height * 4), [i, a, o, s, c, l] = t, u = i * s - a * o;
|
|
24425
24434
|
if (u === 0) return {
|
|
24426
24435
|
...n,
|
|
24427
24436
|
data: r
|
|
@@ -24446,7 +24455,7 @@ function pi(e, t) {
|
|
|
24446
24455
|
data: r
|
|
24447
24456
|
};
|
|
24448
24457
|
}
|
|
24449
|
-
function
|
|
24458
|
+
function hi(e, t) {
|
|
24450
24459
|
let n = e.frame ?? {
|
|
24451
24460
|
x: 0,
|
|
24452
24461
|
y: 0,
|
|
@@ -24470,7 +24479,7 @@ function mi(e, t) {
|
|
|
24470
24479
|
}
|
|
24471
24480
|
};
|
|
24472
24481
|
}
|
|
24473
|
-
function
|
|
24482
|
+
function gi(e, t, n) {
|
|
24474
24483
|
let r = t.frame ?? {
|
|
24475
24484
|
x: 0,
|
|
24476
24485
|
y: 0,
|
|
@@ -24493,9 +24502,9 @@ function hi(e, t, n) {
|
|
|
24493
24502
|
"l",
|
|
24494
24503
|
"ctr",
|
|
24495
24504
|
"r"
|
|
24496
|
-
].includes(t) ? r.height / 2 : 0, l = e.sx ?? 1, u = Math.tan((e.ky ?? 0) * Math.PI / 180), d = Math.tan((e.kx ?? 0) * Math.PI / 180), f = e.sy ?? 1, [p, m] =
|
|
24505
|
+
].includes(t) ? r.height / 2 : 0, l = e.sx ?? 1, u = Math.tan((e.ky ?? 0) * Math.PI / 180), d = Math.tan((e.kx ?? 0) * Math.PI / 180), f = e.sy ?? 1, [p, m] = vi(e.dir, !1, n).map((t) => t * e.dist);
|
|
24497
24506
|
if (e.rotWithShape === !1) {
|
|
24498
|
-
let [e, t] =
|
|
24507
|
+
let [e, t] = vi(n.hostRotation ?? 0, !1, { effects: [] }), r = n.hostFlipH ? -1 : 1, i = n.hostFlipV ? -1 : 1, a = e * (l * e + d * t) + t * (u * e + f * t), o = r * i * (-t * (l * e + d * t) + e * (u * e + f * t)), s = r * i * (e * (-l * t + d * e) + t * (-u * t + f * e)), c = -t * (-l * t + d * e) + e * (-u * t + f * e);
|
|
24499
24508
|
[l, u, d, f] = [
|
|
24500
24509
|
a,
|
|
24501
24510
|
o,
|
|
@@ -24566,7 +24575,7 @@ function hi(e, t, n) {
|
|
|
24566
24575
|
default: return;
|
|
24567
24576
|
}
|
|
24568
24577
|
}
|
|
24569
|
-
function
|
|
24578
|
+
function _i(e, t, n) {
|
|
24570
24579
|
if (e.type === "alphaOutset") return [
|
|
24571
24580
|
{ type: "alphaCeiling" },
|
|
24572
24581
|
{
|
|
@@ -24577,7 +24586,7 @@ function gi(e, t, n) {
|
|
|
24577
24586
|
{ type: e.radius >= 0 ? "alphaCeiling" : "alphaFloor" }
|
|
24578
24587
|
];
|
|
24579
24588
|
if (e.type === "shadow" && e.inner) {
|
|
24580
|
-
let [t, r] =
|
|
24589
|
+
let [t, r] = vi(e.shadow.dir, !1, n);
|
|
24581
24590
|
return [{
|
|
24582
24591
|
type: "blur",
|
|
24583
24592
|
radius: e.shadow.blur,
|
|
@@ -24594,7 +24603,7 @@ function gi(e, t, n) {
|
|
|
24594
24603
|
}
|
|
24595
24604
|
if (e.type === "reflection") {
|
|
24596
24605
|
let r = e.reflection;
|
|
24597
|
-
return
|
|
24606
|
+
return gi({
|
|
24598
24607
|
type: "shadow",
|
|
24599
24608
|
inner: !1,
|
|
24600
24609
|
shadow: {
|
|
@@ -24605,7 +24614,7 @@ function gi(e, t, n) {
|
|
|
24605
24614
|
}, t, n).slice(2);
|
|
24606
24615
|
}
|
|
24607
24616
|
}
|
|
24608
|
-
function
|
|
24617
|
+
function vi(e, t, n) {
|
|
24609
24618
|
let r = t ? e - (n.hostRotation ?? 0) : e, i = (r / 90 % 4 + 4) % 4, [a, o] = Number.isInteger(i) ? [
|
|
24610
24619
|
[1, 0],
|
|
24611
24620
|
[0, 1],
|
|
@@ -24614,7 +24623,7 @@ function _i(e, t, n) {
|
|
|
24614
24623
|
][i] : [Math.cos(r * Math.PI / 180), Math.sin(r * Math.PI / 180)];
|
|
24615
24624
|
return t && (n.hostFlipH && (a = -a), n.hostFlipV && (o = -o)), [a, o];
|
|
24616
24625
|
}
|
|
24617
|
-
function
|
|
24626
|
+
function yi(e, t, n, r, i, a, o) {
|
|
24618
24627
|
let s = t < 0 ? 0 : e[t + 3] / 255, c = r < 0 ? 0 : n[r + 3] / 255, l = c + s * (1 - c);
|
|
24619
24628
|
for (let u = 0; u < 3; u++) {
|
|
24620
24629
|
let d = t < 0 ? 0 : e[t + u] / 255, f = r < 0 ? 0 : n[r + u] / 255, p = o === "darken" ? Math.min(d, f) : o === "lighten" ? Math.max(d, f) : o === "mult" ? d * f : o === "screen" ? d + f - d * f : f;
|
|
@@ -24622,13 +24631,13 @@ function vi(e, t, n, r, i, a, o) {
|
|
|
24622
24631
|
}
|
|
24623
24632
|
i[a + 3] = Math.round(l * 255);
|
|
24624
24633
|
}
|
|
24625
|
-
function
|
|
24634
|
+
function bi() {
|
|
24626
24635
|
throw new E("image-effect-work", y, 2 ** 53 - 1);
|
|
24627
24636
|
}
|
|
24628
24637
|
function V(...e) {
|
|
24629
|
-
e.every((e) => Number.isFinite(e) && Math.abs(e) <= 2 ** 53 - 1) ||
|
|
24638
|
+
e.every((e) => Number.isFinite(e) && Math.abs(e) <= 2 ** 53 - 1) || bi();
|
|
24630
24639
|
}
|
|
24631
|
-
function
|
|
24640
|
+
function xi(e, t, n, r, a = 0) {
|
|
24632
24641
|
let o = e.tile, s = i(t);
|
|
24633
24642
|
V(e.dpi ?? 96);
|
|
24634
24643
|
let c = d(t) ?? {
|
|
@@ -24639,7 +24648,7 @@ function bi(e, t, n, r, a = 0) {
|
|
|
24639
24648
|
}, l = e.srcRect, u = 1 - (l?.l ?? 0) - (l?.r ?? 0), f = 1 - (l?.t ?? 0) - (l?.b ?? 0);
|
|
24640
24649
|
if (V(u, f), !(u > 0 && f > 0)) return null;
|
|
24641
24650
|
let p = c.width * u, m = c.height * f, h = p * 72 / (e.dpi || 96) * (o.sx ?? 1), g = m * 72 / (e.dpi || 96) * (o.sy ?? 1);
|
|
24642
|
-
V(h, g), h > 0 && g > 0 ||
|
|
24651
|
+
V(h, g), h > 0 && g > 0 || bi();
|
|
24643
24652
|
let _ = 0, v = 0;
|
|
24644
24653
|
if (e.rotWithShape === !1 && a !== 0) {
|
|
24645
24654
|
V(a);
|
|
@@ -24659,7 +24668,7 @@ function bi(e, t, n, r, a = 0) {
|
|
|
24659
24668
|
].includes(T) ? (r - g) / 2 : 0, ne = ee + (o.tx ?? 0) / 12700, re = te + (o.ty ?? 0) / 12700;
|
|
24660
24669
|
V(ne, re);
|
|
24661
24670
|
let ie = Math.floor(-ne / h) - b, ae = Math.floor(-re / g) - x;
|
|
24662
|
-
[ie, ae].every(Number.isSafeInteger) ||
|
|
24671
|
+
[ie, ae].every(Number.isSafeInteger) || bi();
|
|
24663
24672
|
let oe = (e, t) => {
|
|
24664
24673
|
let n = e % t;
|
|
24665
24674
|
return n > 0 ? n - t : n;
|
|
@@ -24677,7 +24686,7 @@ function bi(e, t, n, r, a = 0) {
|
|
|
24677
24686
|
th: g
|
|
24678
24687
|
};
|
|
24679
24688
|
}
|
|
24680
|
-
function
|
|
24689
|
+
function Si(e, t, n, r, i, a = 0) {
|
|
24681
24690
|
let o = t.width * t.height;
|
|
24682
24691
|
if (e.fillType === "none") return 0;
|
|
24683
24692
|
if (e.fillType === "solid") return o;
|
|
@@ -24690,12 +24699,12 @@ function xi(e, t, n, r, i, a = 0) {
|
|
|
24690
24699
|
y: 0,
|
|
24691
24700
|
width: t.width,
|
|
24692
24701
|
height: t.height
|
|
24693
|
-
}, u =
|
|
24702
|
+
}, u = xi(e, c, l.width / (12700 / n), l.height / (12700 / r), a);
|
|
24694
24703
|
u && (s += u.work + o * u.overlap);
|
|
24695
24704
|
}
|
|
24696
24705
|
return s;
|
|
24697
24706
|
}
|
|
24698
|
-
function
|
|
24707
|
+
function Ci(e, t, n, r, i, a = 0) {
|
|
24699
24708
|
if (e.fillType === "solid" || e.fillType === "none") {
|
|
24700
24709
|
let n = new Uint8ClampedArray(t.width * t.height * 4);
|
|
24701
24710
|
if (e.fillType === "solid") {
|
|
@@ -24728,11 +24737,11 @@ function Si(e, t, n, r, i, a = 0) {
|
|
|
24728
24737
|
height: t.height
|
|
24729
24738
|
}, u = 12700 / n, d = 12700 / r, f = l.width / u, p = l.height / d;
|
|
24730
24739
|
try {
|
|
24731
|
-
if (V(l.x, l.y, u, d, f, p), u > 0 && d > 0 && f >= 0 && p >= 0 ||
|
|
24740
|
+
if (V(l.x, l.y, u, d, f, p), u > 0 && d > 0 && f >= 0 && p >= 0 || bi(), s.translate(l.x, l.y), s.scale(u, d), e.fillType === "image") {
|
|
24732
24741
|
let t = i.images?.get(e);
|
|
24733
24742
|
if (!t) throw new g("unsupported-image-effect", "Image fill source unavailable");
|
|
24734
24743
|
if (s.save(), s.beginPath(), s.rect(0, 0, f, p), s.clip(), e.rotWithShape === !1 && a !== 0 && (s.translate(f / 2, p / 2), s.rotate(-a * Math.PI / 180), s.translate(-f / 2, -p / 2)), e.alpha != null && (s.globalAlpha *= e.alpha), e.tile) {
|
|
24735
|
-
let n = e.tile, { cols: r, rows: i, x0: o, y0: c, px: l, py: u, tw: d, th: m } =
|
|
24744
|
+
let n = e.tile, { cols: r, rows: i, x0: o, y0: c, px: l, py: u, tw: d, th: m } = xi(e, t, f, p, a) ?? {
|
|
24736
24745
|
cols: 0,
|
|
24737
24746
|
rows: 0,
|
|
24738
24747
|
x0: 0,
|
|
@@ -24764,7 +24773,7 @@ function Si(e, t, n, r, i, a = 0) {
|
|
|
24764
24773
|
o.width = 0;
|
|
24765
24774
|
}
|
|
24766
24775
|
}
|
|
24767
|
-
function
|
|
24776
|
+
function wi(e, t, n, r, i) {
|
|
24768
24777
|
let a = Math.ceil(n), o = Math.ceil(r), s = e + (i ? 2 * a : 0), c = t + (i ? 2 * o : 0), l = 2 * a + 2 * o + 2, u = s * c * (l + 2) + 2 * l, d = (l + 4) * Float64Array.BYTES_PER_ELEMENT, f = s * c;
|
|
24769
24778
|
if (![
|
|
24770
24779
|
s,
|
|
@@ -24784,7 +24793,7 @@ function Ci(e, t, n, r, i) {
|
|
|
24784
24793
|
kernelBytes: d
|
|
24785
24794
|
};
|
|
24786
24795
|
}
|
|
24787
|
-
function
|
|
24796
|
+
function Ti(e, t) {
|
|
24788
24797
|
let n = new Float64Array(2 * t + 1);
|
|
24789
24798
|
if (e === 0) return n[0] = 1, n;
|
|
24790
24799
|
let r = 0;
|
|
@@ -24795,9 +24804,9 @@ function wi(e, t) {
|
|
|
24795
24804
|
for (let e = 0; e < n.length; e++) n[e] /= r;
|
|
24796
24805
|
return n;
|
|
24797
24806
|
}
|
|
24798
|
-
function
|
|
24807
|
+
function Ei(e, t, n, r) {
|
|
24799
24808
|
if (t === 0 && n === 0) return e;
|
|
24800
|
-
let { rx: i, ry: a, width: o, height: s } =
|
|
24809
|
+
let { rx: i, ry: a, width: o, height: s } = wi(e.width, e.height, t, n, r), c = r ? i : 0, l = r ? a : 0, u = Ti(t, i), d = Ti(n, a), f = new Uint8ClampedArray(o * s * 4), p = new Uint8ClampedArray(f.length), m = new Float64Array(4);
|
|
24801
24810
|
for (let t = 0; t < s; t++) for (let n = 0; n < o; n++) {
|
|
24802
24811
|
let r = t - l;
|
|
24803
24812
|
if (r < 0 || r >= e.height) continue;
|
|
@@ -24841,21 +24850,21 @@ function Ti(e, t, n, r) {
|
|
|
24841
24850
|
}
|
|
24842
24851
|
};
|
|
24843
24852
|
}
|
|
24844
|
-
function
|
|
24853
|
+
function Di(e) {
|
|
24845
24854
|
return typeof e == "object" && !!e && Array.isArray(e.effects);
|
|
24846
24855
|
}
|
|
24847
|
-
function
|
|
24856
|
+
function Oi(e) {
|
|
24848
24857
|
let t = [];
|
|
24849
|
-
for (let n of
|
|
24858
|
+
for (let n of ji(e, !1)) (n.type === "fillOverlay" || n.type === "fill") && n.fill.fillType === "image" && t.push(n.fill);
|
|
24850
24859
|
return t;
|
|
24851
24860
|
}
|
|
24852
|
-
function
|
|
24853
|
-
let t =
|
|
24861
|
+
function ki(e) {
|
|
24862
|
+
let t = Ai(e, 1, 1);
|
|
24854
24863
|
return t === null || t.x > 0 || t.y > 0;
|
|
24855
24864
|
}
|
|
24856
|
-
function
|
|
24865
|
+
function Ai(e, t, n) {
|
|
24857
24866
|
let r = 0, i = 0, a = (e) => Number.isFinite(e) ? Math.abs(e) : Infinity;
|
|
24858
|
-
for (let o of
|
|
24867
|
+
for (let o of ji(e, !1)) switch (o.type) {
|
|
24859
24868
|
case "blur":
|
|
24860
24869
|
o.grow && (r += a(o.radius), i += a(o.radius));
|
|
24861
24870
|
break;
|
|
@@ -24897,7 +24906,7 @@ function ki(e, t, n) {
|
|
|
24897
24906
|
}
|
|
24898
24907
|
if (r > 0 || i > 0) {
|
|
24899
24908
|
let a = 0;
|
|
24900
|
-
for (let t of
|
|
24909
|
+
for (let t of ji(e, !1)) [
|
|
24901
24910
|
"blur",
|
|
24902
24911
|
"alphaOutset",
|
|
24903
24912
|
"glow",
|
|
@@ -24913,7 +24922,7 @@ function ki(e, t, n) {
|
|
|
24913
24922
|
y: o
|
|
24914
24923
|
} : null;
|
|
24915
24924
|
}
|
|
24916
|
-
function*
|
|
24925
|
+
function* ji(e, t = !0) {
|
|
24917
24926
|
let n = [{
|
|
24918
24927
|
list: e,
|
|
24919
24928
|
index: 0
|
|
@@ -24952,8 +24961,8 @@ function* Ai(e, t = !0) {
|
|
|
24952
24961
|
yield a;
|
|
24953
24962
|
}
|
|
24954
24963
|
}
|
|
24955
|
-
function
|
|
24956
|
-
|
|
24964
|
+
function Mi(e) {
|
|
24965
|
+
zi(e, 0);
|
|
24957
24966
|
try {
|
|
24958
24967
|
return JSON.stringify([
|
|
24959
24968
|
e.effects,
|
|
@@ -24971,15 +24980,15 @@ function ji(e) {
|
|
|
24971
24980
|
throw e instanceof g ? e : new g("unsupported-image-effect", "Image effect recipe is not serializable");
|
|
24972
24981
|
}
|
|
24973
24982
|
}
|
|
24974
|
-
function
|
|
24983
|
+
function Ni(e, t, n) {
|
|
24975
24984
|
return (.2126 * e + .7152 * t + .0722 * n) / 255;
|
|
24976
24985
|
}
|
|
24977
|
-
function
|
|
24978
|
-
return Math.floor(
|
|
24986
|
+
function Pi(e, t, n) {
|
|
24987
|
+
return Math.floor(Ni(e, t, n) * 255 + 1e-6);
|
|
24979
24988
|
}
|
|
24980
|
-
function
|
|
24981
|
-
e.duotone &&
|
|
24982
|
-
let i =
|
|
24989
|
+
function Fi(e, t, n, r) {
|
|
24990
|
+
e.duotone && fi({ type: "duotone" }, e);
|
|
24991
|
+
let i = Ii(e.effects, e), a = {
|
|
24983
24992
|
width: n?.width ?? t,
|
|
24984
24993
|
height: n?.height ?? 1,
|
|
24985
24994
|
frame: n?.frame,
|
|
@@ -25001,7 +25010,7 @@ function Pi(e, t, n, r) {
|
|
|
25001
25010
|
}
|
|
25002
25011
|
if (d.type === "unsupported") throw new g("unsupported-image-effect", `Malformed CT_Blip effect: ${d.effect}`);
|
|
25003
25012
|
c += h, d.type === "luminance" && (c += 256);
|
|
25004
|
-
let t =
|
|
25013
|
+
let t = gi(d, {
|
|
25005
25014
|
width: p,
|
|
25006
25015
|
height: m,
|
|
25007
25016
|
frame: _
|
|
@@ -25015,18 +25024,18 @@ function Pi(e, t, n, r) {
|
|
|
25015
25024
|
});
|
|
25016
25025
|
v = Math.max(v, e.peak), p = e.width, m = e.height, h = e.pixels, _ = e.frame;
|
|
25017
25026
|
} else if (d.type === "transform" && h > 0) {
|
|
25018
|
-
let t =
|
|
25027
|
+
let t = pi({
|
|
25019
25028
|
width: p,
|
|
25020
25029
|
height: m,
|
|
25021
25030
|
frame: _
|
|
25022
|
-
},
|
|
25031
|
+
}, Ui(d, e));
|
|
25023
25032
|
v = Math.max(v, h + t.width * t.height), p = t.width, m = t.height, _ = t.frame, h = p * m, c += h * 5;
|
|
25024
|
-
} else if (
|
|
25033
|
+
} else if (_i(d, {
|
|
25025
25034
|
width: p,
|
|
25026
25035
|
height: m,
|
|
25027
25036
|
frame: _
|
|
25028
25037
|
}, e) && h > 0) {
|
|
25029
|
-
let t = u(
|
|
25038
|
+
let t = u(_i(d, {
|
|
25030
25039
|
width: p,
|
|
25031
25040
|
height: m,
|
|
25032
25041
|
frame: _
|
|
@@ -25038,7 +25047,7 @@ function Pi(e, t, n, r) {
|
|
|
25038
25047
|
});
|
|
25039
25048
|
v = Math.max(v, h + t.peak), c += h * 3 + t.pixels, d.type !== "shadow" && (p = t.width, m = t.height, _ = t.frame, h = t.pixels);
|
|
25040
25049
|
} else if (d.type === "blur" && d.radius !== 0 && h > 0) {
|
|
25041
|
-
let t = h, n =
|
|
25050
|
+
let t = h, n = wi(p, m, d.radius / (e.emuPerPixelX ?? 9525), d.radius / (e.emuPerPixelY ?? 9525), d.grow), r = _ ?? {
|
|
25042
25051
|
x: 0,
|
|
25043
25052
|
y: 0,
|
|
25044
25053
|
width: p,
|
|
@@ -25080,7 +25089,7 @@ function Pi(e, t, n, r) {
|
|
|
25080
25089
|
frame: _
|
|
25081
25090
|
};
|
|
25082
25091
|
for (let n of t) {
|
|
25083
|
-
let t = r.width * r.height, i = e.kind === "tree" ? n :
|
|
25092
|
+
let t = r.width * r.height, i = e.kind === "tree" ? n : hi(r, n), a = i.width * i.height, o = i.width !== r.width || i.height !== r.height || (i.frame?.x ?? 0) !== (r.frame?.x ?? 0) || (i.frame?.y ?? 0) !== (r.frame?.y ?? 0);
|
|
25084
25093
|
v = Math.max(v, h + n.peak + (e.kind === "sib" ? t : 0)), e.kind === "sib" && (c += a, v = Math.max(v, h + t + n.pixels + (o ? a : 0))), r = {
|
|
25085
25094
|
width: i.width,
|
|
25086
25095
|
height: i.height,
|
|
@@ -25089,7 +25098,7 @@ function Pi(e, t, n, r) {
|
|
|
25089
25098
|
}
|
|
25090
25099
|
if (d.type !== "alphaMod") {
|
|
25091
25100
|
if (d.type === "blend") {
|
|
25092
|
-
let e =
|
|
25101
|
+
let e = hi({
|
|
25093
25102
|
width: p,
|
|
25094
25103
|
height: m,
|
|
25095
25104
|
frame: _
|
|
@@ -25099,7 +25108,7 @@ function Pi(e, t, n, r) {
|
|
|
25099
25108
|
p = r.width, m = r.height, _ = r.frame, h = n ? p * m : h;
|
|
25100
25109
|
}
|
|
25101
25110
|
o.delete(e);
|
|
25102
|
-
} else (d.type === "fillOverlay" || d.type === "fill") && (v = Math.max(v, h * 3 + f(d.fill) / 4), c +=
|
|
25111
|
+
} else (d.type === "fillOverlay" || d.type === "fill") && (v = Math.max(v, h * 3 + f(d.fill) / 4), c += Hi(d.fill, {
|
|
25103
25112
|
width: p,
|
|
25104
25113
|
height: m,
|
|
25105
25114
|
frame: _
|
|
@@ -25117,9 +25126,9 @@ function Pi(e, t, n, r) {
|
|
|
25117
25126
|
}, d = u(e.effects, a);
|
|
25118
25127
|
e.duotone && !e.effects.some((e) => e.type === "duotone") && (d.count++, d.work += d.pixels);
|
|
25119
25128
|
let p = d.peak > t || d.pixels !== t;
|
|
25120
|
-
return
|
|
25129
|
+
return Ri(e.effects) && (d.peak += t, d.work += t), d.peak = Math.max(d.peak, d.pixels * 3), d.peak += t * (p ? 2 : 1), d;
|
|
25121
25130
|
}
|
|
25122
|
-
function
|
|
25131
|
+
function Ii(e, t) {
|
|
25123
25132
|
for (let e of [t.emuPerPixelX ?? 9525, t.emuPerPixelY ?? 9525]) if (!Number.isFinite(e) || e <= 0) throw new g("unsupported-image-effect", "Invalid effect sampling");
|
|
25124
25133
|
if (!Number.isFinite(t.hostRotation ?? 0) || [t.hostFlipH, t.hostFlipV].some((e) => e !== void 0 && typeof e != "boolean")) throw new g("unsupported-image-effect", "Invalid host orientation");
|
|
25125
25134
|
let n = /* @__PURE__ */ new Map(), r = (e) => {
|
|
@@ -25129,54 +25138,54 @@ function Fi(e, t) {
|
|
|
25129
25138
|
n.set(e.name, e);
|
|
25130
25139
|
}
|
|
25131
25140
|
};
|
|
25132
|
-
for (let n of
|
|
25133
|
-
if (
|
|
25141
|
+
for (let n of ji(e)) {
|
|
25142
|
+
if (fi(n, t), n.type === "unsupported") throw new g("unsupported-image-effect", `Malformed CT_Blip effect: ${n.effect}`);
|
|
25134
25143
|
if (n.type === "effectCountLimit") throw Number.isSafeInteger(n.observed) && n.observed > x ? new E("image-effect-count", x, n.observed) : new g("unsupported-image-effect", "Invalid effect-count record");
|
|
25135
25144
|
}
|
|
25136
|
-
for (let t of
|
|
25145
|
+
for (let t of ji(e, !1)) if (t.type === "definitions") for (let e of t.containers) r(e);
|
|
25137
25146
|
else (t.type === "alphaMod" || t.type === "container" || t.type === "blend") && r(t.container);
|
|
25138
25147
|
return n;
|
|
25139
25148
|
}
|
|
25140
|
-
function
|
|
25141
|
-
return
|
|
25149
|
+
function Li(e, t, n, r = {}) {
|
|
25150
|
+
return Fi(e, t * n, {
|
|
25142
25151
|
width: t,
|
|
25143
25152
|
height: n
|
|
25144
25153
|
}, r).work;
|
|
25145
25154
|
}
|
|
25146
|
-
function
|
|
25155
|
+
function Ri(e, t = /* @__PURE__ */ new Set()) {
|
|
25147
25156
|
for (let n of e) {
|
|
25148
25157
|
if (n.type === "definitions") {
|
|
25149
|
-
for (let e of n.containers) if (!t.has(e) && (t.add(e),
|
|
25158
|
+
for (let e of n.containers) if (!t.has(e) && (t.add(e), Ri(e.effects, t))) return !0;
|
|
25150
25159
|
}
|
|
25151
|
-
if (n.type === "reference" && ["fill", "fillLine"].includes(n.reference) || (n.type === "alphaMod" || n.type === "container" || n.type === "blend") && !t.has(n.container) && (t.add(n.container),
|
|
25160
|
+
if (n.type === "reference" && ["fill", "fillLine"].includes(n.reference) || (n.type === "alphaMod" || n.type === "container" || n.type === "blend") && !t.has(n.container) && (t.add(n.container), Ri(n.container.effects, t))) return !0;
|
|
25152
25161
|
}
|
|
25153
25162
|
return !1;
|
|
25154
25163
|
}
|
|
25155
|
-
function
|
|
25156
|
-
let i =
|
|
25164
|
+
function zi(e, t, n, r = 0) {
|
|
25165
|
+
let i = Fi(e, t, n);
|
|
25157
25166
|
if (i.count > x) throw new E("image-effect-count", x, i.count);
|
|
25158
25167
|
if (!Number.isSafeInteger(i.work) || i.work > 134217728) throw new E("image-effect-work", y, Number.isSafeInteger(i.work) ? i.work : 2 ** 53 - 1);
|
|
25159
25168
|
if (n && i.peak + r > 33554432) throw new E("active-decoded-bytes", T * 4, Math.ceil((i.peak + r) * 4));
|
|
25160
25169
|
}
|
|
25161
|
-
function
|
|
25170
|
+
function Bi(e, t, n = {}) {
|
|
25162
25171
|
let r = e.data, i = 0;
|
|
25163
25172
|
for (let e of new Set(n.images?.values())) {
|
|
25164
25173
|
if (e === n.baseImage) continue;
|
|
25165
25174
|
let t = e;
|
|
25166
25175
|
i += t.width * t.height;
|
|
25167
25176
|
}
|
|
25168
|
-
|
|
25169
|
-
let a =
|
|
25177
|
+
zi(t, r.length / 4, e, i);
|
|
25178
|
+
let a = Fi(t, e.width * e.height, e, n).work;
|
|
25170
25179
|
if (!Number.isSafeInteger(a) || a > 134217728) throw new E("image-effect-work", y, Number.isSafeInteger(a) ? a : 2 ** 53 - 1);
|
|
25171
|
-
let o = new
|
|
25172
|
-
names:
|
|
25180
|
+
let o = new si(Math.min(a, y)), s = {
|
|
25181
|
+
names: Ii(t.effects, t),
|
|
25173
25182
|
chargedDefinitions: /* @__PURE__ */ new Set(),
|
|
25174
25183
|
charge: (e) => {
|
|
25175
25184
|
o.charge(e), n.workLedger?.charge(e);
|
|
25176
25185
|
}
|
|
25177
25186
|
};
|
|
25178
25187
|
try {
|
|
25179
|
-
return
|
|
25188
|
+
return Ri(t.effects) && (s.original = U(e, s)), H(e, t, n, s);
|
|
25180
25189
|
} catch (e) {
|
|
25181
25190
|
throw ie(e);
|
|
25182
25191
|
}
|
|
@@ -25189,7 +25198,7 @@ function H(e, t, n, r) {
|
|
|
25189
25198
|
continue;
|
|
25190
25199
|
}
|
|
25191
25200
|
r.charge(e.width * e.height);
|
|
25192
|
-
let s =
|
|
25201
|
+
let s = gi(o, e, t);
|
|
25193
25202
|
if (s) {
|
|
25194
25203
|
e = H(e, {
|
|
25195
25204
|
...t,
|
|
@@ -25201,19 +25210,19 @@ function H(e, t, n, r) {
|
|
|
25201
25210
|
switch (o.type) {
|
|
25202
25211
|
case "effectCountLimit": break;
|
|
25203
25212
|
case "transform": {
|
|
25204
|
-
let n =
|
|
25205
|
-
r.charge(n.width * n.height * 5), e =
|
|
25213
|
+
let n = pi(e, Ui(o, t));
|
|
25214
|
+
r.charge(n.width * n.height * 5), e = mi(e, Ui(o, t)), i = e.data;
|
|
25206
25215
|
break;
|
|
25207
25216
|
}
|
|
25208
25217
|
case "alphaOutset": {
|
|
25209
25218
|
let a = H(U(e, r), {
|
|
25210
25219
|
...t,
|
|
25211
25220
|
duotone: void 0,
|
|
25212
|
-
effects:
|
|
25221
|
+
effects: _i(o, e, t)
|
|
25213
25222
|
}, n, r);
|
|
25214
25223
|
r.charge(e.width * e.height * 2 + a.width * a.height);
|
|
25215
25224
|
for (let t = 0; t < a.height; t++) for (let n = 0; n < a.width; n++) {
|
|
25216
|
-
let r = (t * a.width + n) * 4, i =
|
|
25225
|
+
let r = (t * a.width + n) * 4, i = qi(e, a, n, t);
|
|
25217
25226
|
for (let e = 0; e < 3; e++) a.data[r + e] = i[e];
|
|
25218
25227
|
}
|
|
25219
25228
|
e = a, i = e.data;
|
|
@@ -25222,7 +25231,7 @@ function H(e, t, n, r) {
|
|
|
25222
25231
|
case "reflection": {
|
|
25223
25232
|
let a = o.reflection, s = U(e, r);
|
|
25224
25233
|
r.charge(e.width * e.height * 2);
|
|
25225
|
-
let [c, l] =
|
|
25234
|
+
let [c, l] = vi(a.fadeDir ?? 90, a.rotWithShape === !1, t), u = s.width * (t.emuPerPixelX ?? 9525), d = s.height * (t.emuPerPixelY ?? 9525), f = Math.min(0, c * u) + Math.min(0, l * d), p = Math.abs(c * u) + Math.abs(l * d);
|
|
25226
25235
|
for (let e = 0; e < s.height; e++) for (let t = 0; t < s.width; t++) {
|
|
25227
25236
|
let n = ((t + .5) / s.width * u * c + (e + .5) / s.height * d * l - f) / p, r = a.endPos === a.stPos ? +(n >= a.endPos) : Math.max(0, Math.min(1, (n - a.stPos) / (a.endPos - a.stPos))), i = (e * s.width + t) * 4 + 3;
|
|
25228
25237
|
s.data[i] = Math.round(s.data[i] * (a.stA + (a.endA - a.stA) * r));
|
|
@@ -25230,7 +25239,7 @@ function H(e, t, n, r) {
|
|
|
25230
25239
|
e = H(s, {
|
|
25231
25240
|
...t,
|
|
25232
25241
|
duotone: void 0,
|
|
25233
|
-
effects:
|
|
25242
|
+
effects: _i(o, e, t)
|
|
25234
25243
|
}, n, r), r.charge(e.width * e.height), i = e.data;
|
|
25235
25244
|
break;
|
|
25236
25245
|
}
|
|
@@ -25238,7 +25247,7 @@ function H(e, t, n, r) {
|
|
|
25238
25247
|
let a = o.shadow, s = H(U(e, r), {
|
|
25239
25248
|
...t,
|
|
25240
25249
|
duotone: void 0,
|
|
25241
|
-
effects:
|
|
25250
|
+
effects: _i(o, e, t)
|
|
25242
25251
|
}, n, r);
|
|
25243
25252
|
r.charge(e.width * e.height * 2 + s.width * s.height);
|
|
25244
25253
|
let c = fe(a.color) ?? [
|
|
@@ -25247,16 +25256,16 @@ function H(e, t, n, r) {
|
|
|
25247
25256
|
0
|
|
25248
25257
|
];
|
|
25249
25258
|
for (let t = 0; t < e.height; t++) for (let n = 0; n < e.width; n++) {
|
|
25250
|
-
let r = (t * e.width + n) * 4, o =
|
|
25259
|
+
let r = (t * e.width + n) * 4, o = Gi(s, e, n, t);
|
|
25251
25260
|
i[r + 3] = Math.round(i[r + 3] * a.alpha * (1 - (o < 0 ? 0 : s.data[o + 3]) / 255));
|
|
25252
25261
|
for (let e = 0; e < 3; e++) i[r + e] = c[e];
|
|
25253
25262
|
}
|
|
25254
25263
|
break;
|
|
25255
25264
|
}
|
|
25256
25265
|
case "fill":
|
|
25257
|
-
r.charge(
|
|
25266
|
+
r.charge(Hi(o.fill, e, t, n));
|
|
25258
25267
|
{
|
|
25259
|
-
let r =
|
|
25268
|
+
let r = Ci(o.fill, e, t.emuPerPixelX ?? 9525, t.emuPerPixelY ?? 9525, n, Vi(t));
|
|
25260
25269
|
e = {
|
|
25261
25270
|
data: r.data,
|
|
25262
25271
|
width: r.width,
|
|
@@ -25270,20 +25279,20 @@ function H(e, t, n, r) {
|
|
|
25270
25279
|
case "softEdge":
|
|
25271
25280
|
case "presetShadow": break;
|
|
25272
25281
|
case "alphaMod": {
|
|
25273
|
-
let a =
|
|
25282
|
+
let a = Ji(e, o.container, t, n, r);
|
|
25274
25283
|
for (let t = 0; t < e.height; t++) for (let n = 0; n < e.width; n++) {
|
|
25275
|
-
let r =
|
|
25284
|
+
let r = Gi(a, e, n, t), o = r < 0 ? 0 : a.data[r + 3], s = (t * e.width + n) * 4 + 3;
|
|
25276
25285
|
i[s] = Math.round(i[s] * o / 255);
|
|
25277
25286
|
}
|
|
25278
25287
|
break;
|
|
25279
25288
|
}
|
|
25280
25289
|
case "blend":
|
|
25281
25290
|
case "container":
|
|
25282
|
-
e = o.type === "blend" ?
|
|
25291
|
+
e = o.type === "blend" ? Wi(e, Ji(e, o.container, t, n, r), o.blend, r) : Ji(e, o.container, t, n, r), i = e.data;
|
|
25283
25292
|
break;
|
|
25284
25293
|
case "reference": {
|
|
25285
25294
|
let a = r.names.get(o.reference);
|
|
25286
|
-
e = a ?
|
|
25295
|
+
e = a ? Ji(e, a, t, n, r) : ["fill", "fillLine"].includes(o.reference) ? U(r.original ?? e, r) : {
|
|
25287
25296
|
width: e.width,
|
|
25288
25297
|
height: e.height,
|
|
25289
25298
|
frame: e.frame,
|
|
@@ -25292,23 +25301,23 @@ function H(e, t, n, r) {
|
|
|
25292
25301
|
break;
|
|
25293
25302
|
}
|
|
25294
25303
|
case "fillOverlay": {
|
|
25295
|
-
r.charge(
|
|
25296
|
-
let a =
|
|
25297
|
-
for (let e = 0; e < i.length; e += 4)
|
|
25304
|
+
r.charge(Hi(o.fill, e, t, n));
|
|
25305
|
+
let a = Ci(o.fill, e, t.emuPerPixelX ?? 9525, t.emuPerPixelY ?? 9525, n, Vi(t));
|
|
25306
|
+
for (let e = 0; e < i.length; e += 4) yi(i, e, a.data, e, i, e, o.blend);
|
|
25298
25307
|
break;
|
|
25299
25308
|
}
|
|
25300
25309
|
case "blur":
|
|
25301
|
-
o.radius !== 0 && r.charge(
|
|
25310
|
+
o.radius !== 0 && r.charge(wi(e.width, e.height, o.radius / (t.emuPerPixelX ?? 9525), o.radius / (t.emuPerPixelY ?? 9525), o.grow).work), e = Ei(e, o.radius / (t.emuPerPixelX ?? 9525), o.radius / (t.emuPerPixelY ?? 9525), o.grow), i = e.data;
|
|
25302
25311
|
break;
|
|
25303
25312
|
case "grayscale":
|
|
25304
25313
|
for (let e = 0; e < i.length; e += 4) {
|
|
25305
|
-
let t =
|
|
25314
|
+
let t = Pi(i[e], i[e + 1], i[e + 2]);
|
|
25306
25315
|
i[e] = t, i[e + 1] = t, i[e + 2] = t;
|
|
25307
25316
|
}
|
|
25308
25317
|
break;
|
|
25309
25318
|
case "biLevel":
|
|
25310
25319
|
for (let e = 0; e < i.length; e += 4) {
|
|
25311
|
-
let t =
|
|
25320
|
+
let t = Ni(i[e], i[e + 1], i[e + 2]) >= o.thresh ? 255 : 0;
|
|
25312
25321
|
i[e] = t, i[e + 1] = t, i[e + 2] = t;
|
|
25313
25322
|
}
|
|
25314
25323
|
break;
|
|
@@ -25321,7 +25330,7 @@ function H(e, t, n, r) {
|
|
|
25321
25330
|
}
|
|
25322
25331
|
case "luminance": {
|
|
25323
25332
|
r.charge(256);
|
|
25324
|
-
let e =
|
|
25333
|
+
let e = Yi(o.bright, o.contrast);
|
|
25325
25334
|
for (let t = 0; t < i.length; t += 4) i[t] = e[i[t]], i[t + 1] = e[i[t + 1]], i[t + 2] = e[i[t + 2]];
|
|
25326
25335
|
break;
|
|
25327
25336
|
}
|
|
@@ -25392,15 +25401,15 @@ function H(e, t, n, r) {
|
|
|
25392
25401
|
}
|
|
25393
25402
|
return !a && t.duotone && (r.charge(e.width * e.height), me(e, t.duotone.clr1, t.duotone.clr2)), e;
|
|
25394
25403
|
}
|
|
25395
|
-
function
|
|
25404
|
+
function Vi(e) {
|
|
25396
25405
|
let t = e.hostRotation ?? 0;
|
|
25397
25406
|
return (e.hostFlipH ?? !1) === (e.hostFlipV ?? !1) ? t : -t;
|
|
25398
25407
|
}
|
|
25399
|
-
function
|
|
25400
|
-
let i = t.width * t.height > 0 ?
|
|
25408
|
+
function Hi(e, t, n, r) {
|
|
25409
|
+
let i = t.width * t.height > 0 ? Si(e, t, n.emuPerPixelX ?? 9525, n.emuPerPixelY ?? 9525, r, Vi(n)) + f(e) : 0;
|
|
25401
25410
|
return e.fillType === "gradient" && (i += 2 * e.stops.length * (1 + Math.max(1, Math.ceil(Math.log2(e.stops.length))))), i;
|
|
25402
25411
|
}
|
|
25403
|
-
function
|
|
25412
|
+
function Ui(e, t) {
|
|
25404
25413
|
let n = t.emuPerPixelX ?? 9525, r = t.emuPerPixelY ?? 9525;
|
|
25405
25414
|
return [
|
|
25406
25415
|
e.sx,
|
|
@@ -25411,14 +25420,14 @@ function Hi(e, t) {
|
|
|
25411
25420
|
e.ty / r
|
|
25412
25421
|
];
|
|
25413
25422
|
}
|
|
25414
|
-
function
|
|
25415
|
-
let i =
|
|
25423
|
+
function Wi(e, t, n, r) {
|
|
25424
|
+
let i = hi(e, t);
|
|
25416
25425
|
r.charge(i.width * i.height);
|
|
25417
25426
|
let a = e.frame, o = i.width === e.width && i.height === e.height && i.frame.x === (a?.x ?? 0) && i.frame.y === (a?.y ?? 0) ? e.data : new Uint8ClampedArray(i.width * i.height * 4), s = {
|
|
25418
25427
|
...i,
|
|
25419
25428
|
data: o
|
|
25420
25429
|
};
|
|
25421
|
-
for (let r = 0; r < i.height; r++) for (let a = 0; a < i.width; a++)
|
|
25430
|
+
for (let r = 0; r < i.height; r++) for (let a = 0; a < i.width; a++) yi(e.data, Gi(e, s, a, r), t.data, Gi(t, s, a, r), o, (r * i.width + a) * 4, n);
|
|
25422
25431
|
return s;
|
|
25423
25432
|
}
|
|
25424
25433
|
function U(e, t) {
|
|
@@ -25429,7 +25438,7 @@ function U(e, t) {
|
|
|
25429
25438
|
data: new Uint8ClampedArray(e.data)
|
|
25430
25439
|
};
|
|
25431
25440
|
}
|
|
25432
|
-
function
|
|
25441
|
+
function Gi(e, t, n, r) {
|
|
25433
25442
|
let i = e.frame ?? {
|
|
25434
25443
|
x: 0,
|
|
25435
25444
|
y: 0
|
|
@@ -25439,17 +25448,17 @@ function Wi(e, t, n, r) {
|
|
|
25439
25448
|
}, o = n + i.x - a.x, s = r + i.y - a.y;
|
|
25440
25449
|
return o < 0 || s < 0 || o >= e.width || s >= e.height ? -1 : (s * e.width + o) * 4;
|
|
25441
25450
|
}
|
|
25442
|
-
var
|
|
25451
|
+
var Ki = [
|
|
25443
25452
|
0,
|
|
25444
25453
|
0,
|
|
25445
25454
|
0,
|
|
25446
25455
|
0
|
|
25447
25456
|
];
|
|
25448
|
-
function
|
|
25449
|
-
let i =
|
|
25450
|
-
return i < 0 ?
|
|
25457
|
+
function qi(e, t, n, r) {
|
|
25458
|
+
let i = Gi(e, t, n, r);
|
|
25459
|
+
return i < 0 ? Ki : e.data.subarray(i, i + 4);
|
|
25451
25460
|
}
|
|
25452
|
-
function
|
|
25461
|
+
function Ji(e, t, n, r, i) {
|
|
25453
25462
|
if (t.kind === "tree") return H(U(e, i), {
|
|
25454
25463
|
...n,
|
|
25455
25464
|
duotone: void 0,
|
|
@@ -25467,11 +25476,11 @@ function qi(e, t, n, r, i) {
|
|
|
25467
25476
|
duotone: void 0,
|
|
25468
25477
|
effects: [o]
|
|
25469
25478
|
}, r, i);
|
|
25470
|
-
a =
|
|
25479
|
+
a = Wi(a, t, "over", i);
|
|
25471
25480
|
}
|
|
25472
25481
|
return a;
|
|
25473
25482
|
}
|
|
25474
|
-
function
|
|
25483
|
+
function Yi(e, t) {
|
|
25475
25484
|
let n = new Uint8ClampedArray(256), r = Math.max(-1, Math.min(1, e)), i = Math.max(-1, Math.min(1, t));
|
|
25476
25485
|
for (let e = 0; e < 256; e++) {
|
|
25477
25486
|
let t = e / 255 + r / 2 - .5, a;
|
|
@@ -25479,11 +25488,11 @@ function Ji(e, t) {
|
|
|
25479
25488
|
}
|
|
25480
25489
|
return n;
|
|
25481
25490
|
}
|
|
25482
|
-
function
|
|
25491
|
+
function Xi(e) {
|
|
25483
25492
|
return e.svgImagePath != null && e.srcRect == null;
|
|
25484
25493
|
}
|
|
25485
|
-
var
|
|
25486
|
-
async function
|
|
25494
|
+
var Zi = "duotone";
|
|
25495
|
+
async function Qi(e, t, n, r, a = {}) {
|
|
25487
25496
|
try {
|
|
25488
25497
|
let { offscreenFactory: o, failClosedOnDuotoneFailure: s = !1, ...c } = a, l = n ? {
|
|
25489
25498
|
...c,
|
|
@@ -25494,11 +25503,11 @@ async function Zi(e, t, n, r, a = {}) {
|
|
|
25494
25503
|
targetHeightPx: void 0
|
|
25495
25504
|
} : l;
|
|
25496
25505
|
n?.preflight(0);
|
|
25497
|
-
let d = n ?
|
|
25506
|
+
let d = n ? _r(r, Zi) : void 0, f = await $r(e, t, r, u);
|
|
25498
25507
|
if (!n || !f) return f;
|
|
25499
25508
|
n.preflight(f.width * f.height, f.width, f.height);
|
|
25500
|
-
let p = await
|
|
25501
|
-
return await
|
|
25509
|
+
let p = await qr(e, t, r, u, d, f), m = de(Number(f.width), Number(f.height), c.targetWidthPx, c.targetHeightPx), h = m ? `|resize:${m.resizeWidth}x${m.resizeHeight}` : "";
|
|
25510
|
+
return await Qr(Zi, JSON.stringify([
|
|
25502
25511
|
p,
|
|
25503
25512
|
n.key,
|
|
25504
25513
|
h,
|
|
@@ -25548,34 +25557,34 @@ async function Zi(e, t, n, r, a = {}) {
|
|
|
25548
25557
|
throw n?.strict ? ie(e) : e;
|
|
25549
25558
|
}
|
|
25550
25559
|
}
|
|
25551
|
-
function
|
|
25560
|
+
function $i(e, t) {
|
|
25552
25561
|
return t ? `${e}|duo:${t.clr1}:${t.clr2}` : e;
|
|
25553
25562
|
}
|
|
25554
|
-
function
|
|
25555
|
-
return
|
|
25563
|
+
function ea(e, t, n, r, i = {}) {
|
|
25564
|
+
return Qi(e, t, n ? {
|
|
25556
25565
|
key: `duo:${n.clr1}:${n.clr2}`,
|
|
25557
25566
|
strict: !1,
|
|
25558
25567
|
preflight() {},
|
|
25559
25568
|
apply: (e, t) => ye(e, n, t)
|
|
25560
25569
|
} : void 0, r, i);
|
|
25561
25570
|
}
|
|
25562
|
-
function
|
|
25563
|
-
return
|
|
25571
|
+
function ta(e, t) {
|
|
25572
|
+
return Di(t) ? `${e}|fx:${Mi(t)}` : $i(e, t);
|
|
25564
25573
|
}
|
|
25565
|
-
async function
|
|
25566
|
-
if (!
|
|
25574
|
+
async function na(e, t, n, r, i = {}) {
|
|
25575
|
+
if (!Di(n)) return ea(e, t, n, r, i);
|
|
25567
25576
|
try {
|
|
25568
|
-
|
|
25569
|
-
let a =
|
|
25570
|
-
return await
|
|
25577
|
+
zi(n, 0);
|
|
25578
|
+
let a = Oi(n.effects).length ? Ar(r) : void 0;
|
|
25579
|
+
return await ra(e, t, n, r, i, {
|
|
25571
25580
|
work: 0,
|
|
25572
|
-
execution: new
|
|
25581
|
+
execution: new si()
|
|
25573
25582
|
}).finally(() => a?.());
|
|
25574
25583
|
} catch (e) {
|
|
25575
25584
|
throw ie(e);
|
|
25576
25585
|
}
|
|
25577
25586
|
}
|
|
25578
|
-
async function
|
|
25587
|
+
async function ra(e, t, n, r, i, a) {
|
|
25579
25588
|
if (![i.widthPt ?? 0, i.heightPt ?? 0].every((e) => Number.isFinite(e) && e >= 0)) throw new g("unsupported-image-effect", "Invalid physical image effect dimensions");
|
|
25580
25589
|
let o = (e, t) => {
|
|
25581
25590
|
let r = {
|
|
@@ -25586,19 +25595,19 @@ async function na(e, t, n, r, i, a) {
|
|
|
25586
25595
|
if (![r.emuPerPixelX ?? 9525, r.emuPerPixelY ?? 9525].every((e) => Number.isFinite(e) && e > 0)) throw new g("unsupported-image-effect", "Unrepresentable physical image effect sampling");
|
|
25587
25596
|
return r;
|
|
25588
25597
|
}, s = /* @__PURE__ */ new Map();
|
|
25589
|
-
return
|
|
25590
|
-
key: `fx:${
|
|
25598
|
+
return Qi(e, t, {
|
|
25599
|
+
key: `fx:${Mi(n)}|physical:${JSON.stringify([i.widthPt ?? 0, i.heightPt ?? 0])}`,
|
|
25591
25600
|
strict: !0,
|
|
25592
25601
|
preflight: (e, t, n) => {
|
|
25593
|
-
|
|
25602
|
+
zi(o(t, n), e, t && n ? {
|
|
25594
25603
|
width: t,
|
|
25595
25604
|
height: n
|
|
25596
25605
|
} : void 0);
|
|
25597
25606
|
},
|
|
25598
25607
|
prepare: async (e) => {
|
|
25599
25608
|
let t = o(e.width, e.height);
|
|
25600
|
-
for (let n of
|
|
25601
|
-
let o = !n.blipEffects?.length &&
|
|
25609
|
+
for (let n of Oi(t.effects)) {
|
|
25610
|
+
let o = !n.blipEffects?.length && Xi(n), c = o ? n.svgImagePath : n.imagePath, l = o ? "image/svg+xml" : n.mimeType, u = {
|
|
25602
25611
|
...t,
|
|
25603
25612
|
effects: n.blipEffects ?? [],
|
|
25604
25613
|
duotone: n.duotone,
|
|
@@ -25615,7 +25624,7 @@ async function na(e, t, n, r, i, a) {
|
|
|
25615
25624
|
let r = n.srcRect, i = n.fillRect, a = 1 - (r?.l ?? 0) - (r?.r ?? 0), o = 1 - (r?.t ?? 0) - (r?.b ?? 0);
|
|
25616
25625
|
d.widthPt = e.width * (t.emuPerPixelX ?? 9525) / 12700 * (1 - (i?.l ?? 0) - (i?.r ?? 0)) / (a > 0 ? a : 1), d.heightPt = e.height * (t.emuPerPixelY ?? 9525) / 12700 * (1 - (i?.t ?? 0) - (i?.b ?? 0)) / (o > 0 ? o : 1);
|
|
25617
25626
|
}
|
|
25618
|
-
let f = n.blipEffects?.length || n.duotone ? await
|
|
25627
|
+
let f = n.blipEffects?.length || n.duotone ? await ra(c, l, u, r, d, a) : await ea(c, l, n.duotone, r, d);
|
|
25619
25628
|
if (!f) throw new g("unsupported-image-effect", "Image fill decode unavailable");
|
|
25620
25629
|
s.set(n, f);
|
|
25621
25630
|
}
|
|
@@ -25625,9 +25634,9 @@ async function na(e, t, n, r, i, a) {
|
|
|
25625
25634
|
let r = t;
|
|
25626
25635
|
n += r.width * r.height;
|
|
25627
25636
|
}
|
|
25628
|
-
if (
|
|
25637
|
+
if (zi(t, e.width * e.height, e, n), a.work += Li(t, e.width, e.height, { images: s }), a.work > 134217728) throw new E("image-effect-work", y, a.work);
|
|
25629
25638
|
},
|
|
25630
|
-
apply: (e, t) => ge(e, (t) =>
|
|
25639
|
+
apply: (e, t) => ge(e, (t) => Bi(t, o(e.width, e.height), {
|
|
25631
25640
|
offscreenFactory: i.offscreenFactory,
|
|
25632
25641
|
images: s,
|
|
25633
25642
|
baseImage: e,
|
|
@@ -25635,13 +25644,13 @@ async function na(e, t, n, r, i, a) {
|
|
|
25635
25644
|
}), t)
|
|
25636
25645
|
}, r, i);
|
|
25637
25646
|
}
|
|
25638
|
-
var
|
|
25647
|
+
var ia = {
|
|
25639
25648
|
"&": "&",
|
|
25640
25649
|
"<": "<",
|
|
25641
25650
|
">": ">",
|
|
25642
25651
|
"\"": """
|
|
25643
|
-
}, W = (e) => e.replace(/[&<>"]/g, (e) =>
|
|
25644
|
-
function
|
|
25652
|
+
}, W = (e) => e.replace(/[&<>"]/g, (e) => ia[e]);
|
|
25653
|
+
function aa(e, t = "roman") {
|
|
25645
25654
|
if (t === "double-struck" || t === "monospace") return t;
|
|
25646
25655
|
if (t === "fraktur") return e === "bold" || e === "boldItalic" ? "bold-fraktur" : "fraktur";
|
|
25647
25656
|
if (t === "script") return e === "bold" || e === "boldItalic" ? "bold-script" : "script";
|
|
@@ -25658,9 +25667,9 @@ function ia(e, t = "roman") {
|
|
|
25658
25667
|
case "italic": return null;
|
|
25659
25668
|
}
|
|
25660
25669
|
}
|
|
25661
|
-
var
|
|
25662
|
-
function
|
|
25663
|
-
let r =
|
|
25670
|
+
var oa = new Set([..."⏞⏟⎴⎵︷︸⏜⏝{}[]()¯_‾"]), sa = "+−±∓×÷·∗⋅∘∙*/", ca = "=≠<>≤≥≈≡∼≅≃→←↔⇒∈∉⊂⊆⊃⊇∝≪≫⊥≔", la = "([{⟨⌈⌊", ua = ")]}⟩⌉⌋", da = ",;";
|
|
25671
|
+
function fa(e, t, n) {
|
|
25672
|
+
let r = aa(t, n), i = r ? ` mathvariant="${r}"` : "", a = "", o = "", s = () => {
|
|
25664
25673
|
o &&= (a += `<mn${i}>${W(o)}</mn>`, "");
|
|
25665
25674
|
};
|
|
25666
25675
|
for (let t of e) {
|
|
@@ -25672,56 +25681,56 @@ function da(e, t, n) {
|
|
|
25672
25681
|
o += t;
|
|
25673
25682
|
continue;
|
|
25674
25683
|
}
|
|
25675
|
-
s(),
|
|
25684
|
+
s(), sa.includes(t) || ca.includes(t) || da.includes(t) ? a += `<mo>${W(t)}</mo>` : la.includes(t) || ua.includes(t) ? a += `<mo fence="true" stretchy="false">${W(t)}</mo>` : a += `<mi${i}>${W(t)}</mi>`;
|
|
25676
25685
|
}
|
|
25677
25686
|
return s(), a;
|
|
25678
25687
|
}
|
|
25679
25688
|
function G(e) {
|
|
25680
|
-
return e.map(
|
|
25689
|
+
return e.map(pa).join("");
|
|
25681
25690
|
}
|
|
25682
25691
|
function K(e) {
|
|
25683
25692
|
return `<mrow>${G(e)}</mrow>`;
|
|
25684
25693
|
}
|
|
25685
|
-
function
|
|
25694
|
+
function pa(e) {
|
|
25686
25695
|
switch (e.kind) {
|
|
25687
|
-
case "run": return
|
|
25696
|
+
case "run": return fa(e.text, e.style, e.__script);
|
|
25688
25697
|
case "group": return K(e.items);
|
|
25689
25698
|
case "fraction": return `<mfrac${e.bar === !1 ? " linethickness=\"0\"" : ""}>${K(e.num)}${K(e.den)}</mfrac>`;
|
|
25690
25699
|
case "sup": return `<msup>${K(e.base)}${K(e.sup ?? [])}</msup>`;
|
|
25691
25700
|
case "sub": return `<msub>${K(e.base)}${K(e.sub ?? [])}</msub>`;
|
|
25692
25701
|
case "subSup": return `<msubsup>${K(e.base)}${K(e.sub ?? [])}${K(e.sup ?? [])}</msubsup>`;
|
|
25693
|
-
case "nary": return
|
|
25694
|
-
case "delimiter": return
|
|
25702
|
+
case "nary": return Sa(e);
|
|
25703
|
+
case "delimiter": return Ca(e);
|
|
25695
25704
|
case "radical": return e.index && e.index.length ? `<mroot>${K(e.radicand)}${K(e.index)}</mroot>` : `<msqrt>${G(e.radicand)}</msqrt>`;
|
|
25696
|
-
case "limit": return
|
|
25697
|
-
case "array": return
|
|
25705
|
+
case "limit": return ya(e);
|
|
25706
|
+
case "array": return ba(e);
|
|
25698
25707
|
case "groupChr": {
|
|
25699
|
-
let t = K(e.base), n =
|
|
25708
|
+
let t = K(e.base), n = oa.has(e.char), r = e.pos === "top" ? "mover" : "munder", i = `<mo stretchy="${n}">${W(e.char)}</mo>`;
|
|
25700
25709
|
return n ? `<${r}>${t}${i}</${r}>` : `<${r} accent="true">${t}${i}</${r}>`;
|
|
25701
25710
|
}
|
|
25702
25711
|
case "bar": {
|
|
25703
25712
|
let t = K(e.base), n = "<mo stretchy=\"true\">―</mo>";
|
|
25704
25713
|
return e.pos === "bot" ? `<munder>${t}${n}</munder>` : `<mover>${t}${n}</mover>`;
|
|
25705
25714
|
}
|
|
25706
|
-
case "accent": return
|
|
25715
|
+
case "accent": return va(e);
|
|
25707
25716
|
case "func": return `<mrow>${K(e.name)}<mo>⁡</mo>${K(e.arg)}</mrow>`;
|
|
25708
|
-
case "phant": return
|
|
25717
|
+
case "phant": return ma(e);
|
|
25709
25718
|
case "sPre": return `<mmultiscripts>${K(e.base)}<mprescripts/>${K(e.sub)}${K(e.sup)}</mmultiscripts>`;
|
|
25710
25719
|
case "box": return K(e.base);
|
|
25711
|
-
case "borderBox": return
|
|
25720
|
+
case "borderBox": return ha(e);
|
|
25712
25721
|
}
|
|
25713
25722
|
}
|
|
25714
|
-
function
|
|
25723
|
+
function ma(e) {
|
|
25715
25724
|
let t = e.show ? G(e.base) : `<mphantom>${G(e.base)}</mphantom>`, n = [];
|
|
25716
25725
|
return e.zeroWid && n.push("width=\"0\""), e.zeroAsc && n.push("height=\"0\""), e.zeroDesc && n.push("depth=\"0\""), n.length ? `<mpadded ${n.join(" ")}>${t}</mpadded>` : `<mrow>${t}</mrow>`;
|
|
25717
25726
|
}
|
|
25718
|
-
function
|
|
25727
|
+
function ha(e) {
|
|
25719
25728
|
let t = [], n = !e.hideTop, r = !e.hideBot, i = !e.hideLeft, a = !e.hideRight;
|
|
25720
25729
|
n && r && i && a ? t.push("box") : (n && t.push("top"), r && t.push("bottom"), i && t.push("left"), a && t.push("right")), e.strikeH && t.push("horizontalstrike"), e.strikeV && t.push("verticalstrike"), e.strikeBltr && t.push("updiagonalstrike"), e.strikeTlbr && t.push("downdiagonalstrike");
|
|
25721
25730
|
let o = G(e.base);
|
|
25722
25731
|
return t.length ? `<menclose notation="${t.join(" ")}">${o}</menclose>` : `<mrow>${o}</mrow>`;
|
|
25723
25732
|
}
|
|
25724
|
-
var
|
|
25733
|
+
var ga = {
|
|
25725
25734
|
"̀": "`",
|
|
25726
25735
|
"́": "´",
|
|
25727
25736
|
"̂": "^",
|
|
@@ -25732,7 +25741,7 @@ var ha = {
|
|
|
25732
25741
|
"̌": "ˇ",
|
|
25733
25742
|
"⃗": "→",
|
|
25734
25743
|
"⃖": "←"
|
|
25735
|
-
},
|
|
25744
|
+
}, _a = new Set([
|
|
25736
25745
|
"̅",
|
|
25737
25746
|
"̄",
|
|
25738
25747
|
"¯",
|
|
@@ -25740,37 +25749,37 @@ var ha = {
|
|
|
25740
25749
|
"̲",
|
|
25741
25750
|
"̳"
|
|
25742
25751
|
]);
|
|
25743
|
-
function
|
|
25752
|
+
function va(t) {
|
|
25744
25753
|
let n = K(t.base);
|
|
25745
|
-
if (
|
|
25746
|
-
let r = e(
|
|
25754
|
+
if (_a.has(t.char)) return `<mover>${n}<mo stretchy="true">―</mo></mover>`;
|
|
25755
|
+
let r = e(ga, t.char) ?? t.char;
|
|
25747
25756
|
return `<mover accent="true">${n}<mo stretchy="${r === "→" || r === "←" ? "true" : "false"}">${W(r)}</mo></mover>`;
|
|
25748
25757
|
}
|
|
25749
|
-
function
|
|
25758
|
+
function ya(e) {
|
|
25750
25759
|
let t = K(e.base), n = e.lower && e.lower.length ? K(e.lower) : null, r = e.upper && e.upper.length ? K(e.upper) : null;
|
|
25751
25760
|
return n && r ? `<munderover>${t}${n}${r}</munderover>` : n ? `<munder>${t}${n}</munder>` : r ? `<mover>${t}${r}</mover>` : t;
|
|
25752
25761
|
}
|
|
25753
|
-
function
|
|
25762
|
+
function ba(e) {
|
|
25754
25763
|
let t = Math.max(1, ...e.rows.map((e) => e.length)), n;
|
|
25755
25764
|
n = e.align === "eq" ? Array.from({ length: t }, (e, t) => t % 2 == 0 ? "right" : "left").join(" ") : e.align === "left" ? "left" : "center";
|
|
25756
25765
|
let r = e.rows.map((e) => `<mtr>${e.map((e) => `<mtd>${G(e)}</mtd>`).join("")}</mtr>`).join("");
|
|
25757
25766
|
return `<mtable columnalign="${n}" rowspacing="0.2em" columnspacing="0.3em">${r}</mtable>`;
|
|
25758
25767
|
}
|
|
25759
|
-
var
|
|
25760
|
-
function
|
|
25761
|
-
let t = e.limLoc === "subSup" ? !0 : e.limLoc === "undOvr" ? !1 :
|
|
25768
|
+
var xa = new Set([..."∫∬∭∮∯∰∱∲∳⨌⨍⨎⨏⨐⨑⨒⨓⨔⨕⨖⨗"]);
|
|
25769
|
+
function Sa(e) {
|
|
25770
|
+
let t = e.limLoc === "subSup" ? !0 : e.limLoc === "undOvr" ? !1 : xa.has(e.op), n = `<mo largeop="true">${W(e.op)}</mo>`, r = e.sub ?? [], i = e.sup ?? [], a;
|
|
25762
25771
|
return a = t ? r.length && i.length ? `<msubsup>${n}${K(r)}${K(i)}</msubsup>` : r.length ? `<msub>${n}${K(r)}</msub>` : i.length ? `<msup>${n}${K(i)}</msup>` : n : r.length && i.length ? `<munderover>${n}${K(r)}${K(i)}</munderover>` : r.length ? `<munder>${n}${K(r)}</munder>` : i.length ? `<mover>${n}${K(i)}</mover>` : n, `<mrow>${a}${G(e.body)}</mrow>`;
|
|
25763
25772
|
}
|
|
25764
|
-
function
|
|
25773
|
+
function Ca(e) {
|
|
25765
25774
|
let t = (e) => `<mo fence="true" stretchy="true">${W(e)}</mo>`, n = e.items.map((e) => K(e)).join("<mo separator=\"true\">,</mo>");
|
|
25766
25775
|
return `<mrow>${t(e.begChar)}${n}${t(e.endChar)}</mrow>`;
|
|
25767
25776
|
}
|
|
25768
|
-
function
|
|
25777
|
+
function wa(e, t) {
|
|
25769
25778
|
return `<math xmlns="http://www.w3.org/1998/Math/MathML" display="${t ? "block" : "inline"}">${G(e)}</math>`;
|
|
25770
25779
|
}
|
|
25771
|
-
var
|
|
25772
|
-
function
|
|
25773
|
-
let r = Math.max(1, Math.round(t *
|
|
25780
|
+
var Ta = 256, Ea = 64;
|
|
25781
|
+
function Da(e, t, n) {
|
|
25782
|
+
let r = Math.max(1, Math.round(t * Ta)), i = Math.max(1, Math.round(n * Ta));
|
|
25774
25783
|
return e.replace(/<svg([^>]*?)>/, (e, t) => `<svg${t.replace(/\s(?:width|height)="[^"]*"/g, "")} width="${r}" height="${i}">`);
|
|
25775
25784
|
}
|
|
25776
25785
|
function q(e, t) {
|
|
@@ -25780,7 +25789,7 @@ function J(e, t, n = 0) {
|
|
|
25780
25789
|
let r = Number.parseFloat(q(e, t) ?? "");
|
|
25781
25790
|
return Number.isFinite(r) ? r : n;
|
|
25782
25791
|
}
|
|
25783
|
-
function
|
|
25792
|
+
function Oa(e) {
|
|
25784
25793
|
return e.replace(/&(#(?:x[\da-fA-F]+|\d+)|amp|lt|gt|quot|apos);/g, (e, t) => {
|
|
25785
25794
|
if (t[0] === "#") {
|
|
25786
25795
|
let n = t[1] === "x" ? Number.parseInt(t.slice(2), 16) : Number.parseInt(t.slice(1), 10);
|
|
@@ -25795,7 +25804,7 @@ function Da(e) {
|
|
|
25795
25804
|
}[t];
|
|
25796
25805
|
});
|
|
25797
25806
|
}
|
|
25798
|
-
function
|
|
25807
|
+
function ka(e) {
|
|
25799
25808
|
let t = /* @__PURE__ */ new Map();
|
|
25800
25809
|
for (let n of [
|
|
25801
25810
|
"fill",
|
|
@@ -25818,8 +25827,8 @@ function Oa(e) {
|
|
|
25818
25827
|
}
|
|
25819
25828
|
return t;
|
|
25820
25829
|
}
|
|
25821
|
-
function
|
|
25822
|
-
let r =
|
|
25830
|
+
function Aa(e, t, n) {
|
|
25831
|
+
let r = ka(t), i = { ...n }, a = r.get("fill");
|
|
25823
25832
|
a === "none" ? i.fill = !1 : a && (i.fill = !0, e.fillStyle = a);
|
|
25824
25833
|
let o = r.get("stroke");
|
|
25825
25834
|
o === "none" ? i.stroke = !1 : o && (i.stroke = !0, e.strokeStyle = o);
|
|
@@ -25834,7 +25843,7 @@ function ka(e, t, n) {
|
|
|
25834
25843
|
let d = Number.parseFloat(r.get("opacity") ?? "");
|
|
25835
25844
|
return Number.isFinite(d) && (e.globalAlpha *= Math.max(0, Math.min(1, d))), i;
|
|
25836
25845
|
}
|
|
25837
|
-
function
|
|
25846
|
+
function ja(e, t) {
|
|
25838
25847
|
if (!t) return;
|
|
25839
25848
|
let n = /([a-zA-Z]+)\(([^)]*)\)/g;
|
|
25840
25849
|
for (let r = n.exec(t); r; r = n.exec(t)) {
|
|
@@ -25859,10 +25868,10 @@ function Aa(e, t) {
|
|
|
25859
25868
|
}
|
|
25860
25869
|
}
|
|
25861
25870
|
}
|
|
25862
|
-
function
|
|
25871
|
+
function Ma(e, t, n) {
|
|
25863
25872
|
n.fill && e.fill(t, n.fillRule), n.stroke && e.lineWidth > 0 && e.stroke(t);
|
|
25864
25873
|
}
|
|
25865
|
-
function
|
|
25874
|
+
function Na(e, t, n, r) {
|
|
25866
25875
|
let i = q(t.slice(0, t.indexOf(">") + 1), "viewBox")?.trim().split(/[\s,]+/).map(Number);
|
|
25867
25876
|
if (!i || i.length !== 4 || i.some((e) => !Number.isFinite(e))) throw TypeError("MathJax SVG must contain a finite viewBox");
|
|
25868
25877
|
let [a, o, s, c] = i;
|
|
@@ -25882,33 +25891,33 @@ function Ma(e, t, n, r) {
|
|
|
25882
25891
|
continue;
|
|
25883
25892
|
}
|
|
25884
25893
|
if (o === "g") {
|
|
25885
|
-
f.push(d), e.save(), d =
|
|
25894
|
+
f.push(d), e.save(), d = Aa(e, a, d), ja(e, q(a, "transform"));
|
|
25886
25895
|
continue;
|
|
25887
25896
|
}
|
|
25888
25897
|
if (o === "text") {
|
|
25889
25898
|
let n = t.indexOf("</text>", p.lastIndex);
|
|
25890
25899
|
if (n < 0) throw TypeError("MathJax SVG text must have a closing tag");
|
|
25891
25900
|
e.save();
|
|
25892
|
-
let r =
|
|
25893
|
-
|
|
25894
|
-
let i =
|
|
25901
|
+
let r = Aa(e, a, d);
|
|
25902
|
+
ja(e, q(a, "transform")), e.font = `${q(a, "font-style") === "italic" ? "italic " : ""}${q(a, "font-weight") === "bold" ? "bold " : ""}${J(a, "font-size", 1e3)}px ${q(a, "font-family") ?? "serif"}`, e.textBaseline = "alphabetic";
|
|
25903
|
+
let i = Oa(t.slice(p.lastIndex, n)), o = J(a, "x"), s = J(a, "y");
|
|
25895
25904
|
r.fill && e.fillText(i, o, s), r.stroke && e.lineWidth > 0 && e.strokeText(i, o, s), e.restore(), p.lastIndex = n + 7;
|
|
25896
25905
|
continue;
|
|
25897
25906
|
}
|
|
25898
25907
|
if (o !== "path" && o !== "rect" && o !== "line") continue;
|
|
25899
25908
|
e.save();
|
|
25900
|
-
let c =
|
|
25901
|
-
|
|
25909
|
+
let c = Aa(e, a, d);
|
|
25910
|
+
ja(e, q(a, "transform"));
|
|
25902
25911
|
let l = o === "path" ? new Path2D(q(a, "d") ?? "") : new Path2D();
|
|
25903
|
-
o === "rect" ? l.rect(J(a, "x"), J(a, "y"), J(a, "width"), J(a, "height")) : o === "line" && (l.moveTo(J(a, "x1"), J(a, "y1")), l.lineTo(J(a, "x2"), J(a, "y2"))),
|
|
25912
|
+
o === "rect" ? l.rect(J(a, "x"), J(a, "y"), J(a, "width"), J(a, "height")) : o === "line" && (l.moveTo(J(a, "x1"), J(a, "y1")), l.lineTo(J(a, "x2"), J(a, "y2"))), Ma(e, l, c), e.restore();
|
|
25904
25913
|
}
|
|
25905
25914
|
e.restore();
|
|
25906
25915
|
}
|
|
25907
|
-
async function
|
|
25908
|
-
let { width: n, height: r } = a(e.widthEm *
|
|
25916
|
+
async function Pa(e, t) {
|
|
25917
|
+
let { width: n, height: r } = a(e.widthEm * Ta, (e.ascentEm + e.descentEm) * Ta), i = o(n, r), s = i?.getContext("2d");
|
|
25909
25918
|
if (!i || !s || typeof Path2D > "u") throw Error("Math SVG rasterization requires Canvas 2D and Path2D support");
|
|
25910
|
-
|
|
25911
|
-
let c = i, l = n, u = r, d =
|
|
25919
|
+
Na(s, Da(be(e.svg, t), e.widthEm, e.ascentEm + e.descentEm), n, r);
|
|
25920
|
+
let c = i, l = n, u = r, d = Ea / Ta, f = Math.max(1, Math.round(n * d)), p = Math.max(1, Math.round(r * d));
|
|
25912
25921
|
for (; l > f || u > p;) {
|
|
25913
25922
|
let e = Math.max(f, Math.ceil(l / 2)), t = Math.max(p, Math.ceil(u / 2)), n = o(e, t), r = n?.getContext("2d");
|
|
25914
25923
|
if (!n || !r) break;
|
|
@@ -25920,19 +25929,19 @@ async function Na(e, t) {
|
|
|
25920
25929
|
heightPx: u
|
|
25921
25930
|
};
|
|
25922
25931
|
}
|
|
25923
|
-
function
|
|
25932
|
+
function Fa(e, t) {
|
|
25924
25933
|
let n = o(e.widthPx, e.heightPx);
|
|
25925
25934
|
if (!n) return e.source;
|
|
25926
25935
|
let r = n.getContext("2d");
|
|
25927
25936
|
return r ? (r.drawImage(e.source, 0, 0, e.widthPx, e.heightPx), r.globalCompositeOperation = "source-in", r.fillStyle = t, r.fillRect(0, 0, e.widthPx, e.heightPx), n) : e.source;
|
|
25928
25937
|
}
|
|
25929
|
-
function
|
|
25938
|
+
function Ia(e, t) {
|
|
25930
25939
|
let n = e.tinted.get(t);
|
|
25931
25940
|
if (n) return n;
|
|
25932
|
-
let r =
|
|
25941
|
+
let r = Fa(e.raster, t);
|
|
25933
25942
|
return e.tinted.set(t, r), r;
|
|
25934
25943
|
}
|
|
25935
|
-
function
|
|
25944
|
+
function La(e) {
|
|
25936
25945
|
if (typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement) return !0;
|
|
25937
25946
|
if (typeof e != "object" || !e) return !1;
|
|
25938
25947
|
let t = e;
|
|
@@ -25940,30 +25949,30 @@ function Ia(e) {
|
|
|
25940
25949
|
let n = t.ownerDocument?.defaultView?.HTMLCanvasElement;
|
|
25941
25950
|
return typeof n == "function" && e instanceof n;
|
|
25942
25951
|
}
|
|
25943
|
-
function
|
|
25952
|
+
function Ra(e = 1) {
|
|
25944
25953
|
return typeof window < "u" && window.devicePixelRatio || e;
|
|
25945
25954
|
}
|
|
25946
|
-
var
|
|
25947
|
-
function
|
|
25955
|
+
var za = "ooxml-insufficient-credit", Ba = "OOXML_INSUFFICIENT_CREDIT:";
|
|
25956
|
+
function Va(e) {
|
|
25948
25957
|
return typeof e == "number" && Number.isSafeInteger(e) && e > 0;
|
|
25949
25958
|
}
|
|
25950
|
-
function
|
|
25959
|
+
function Ha(e) {
|
|
25951
25960
|
if (!e || typeof e != "object" || Array.isArray(e)) return !1;
|
|
25952
25961
|
let t = e;
|
|
25953
|
-
return
|
|
25962
|
+
return Va(t.requiredBytes) && Va(t.offeredBytes) && t.requiredBytes > t.offeredBytes;
|
|
25954
25963
|
}
|
|
25955
|
-
var
|
|
25956
|
-
code =
|
|
25964
|
+
var Ua = class e extends RangeError {
|
|
25965
|
+
code = za;
|
|
25957
25966
|
requiredBytes;
|
|
25958
25967
|
offeredBytes;
|
|
25959
25968
|
constructor(t) {
|
|
25960
25969
|
super(`Pull unit requires ${t.requiredBytes} bytes but credit is ${t.offeredBytes}`), this.name = "PullSessionInsufficientCreditError", this.requiredBytes = t.requiredBytes, this.offeredBytes = t.offeredBytes, Object.setPrototypeOf(this, e.prototype);
|
|
25961
25970
|
}
|
|
25962
25971
|
};
|
|
25963
|
-
function
|
|
25964
|
-
if (e instanceof
|
|
25972
|
+
function Wa(e) {
|
|
25973
|
+
if (e instanceof Ua) return e;
|
|
25965
25974
|
let t = e instanceof Error ? e.message : String(e);
|
|
25966
|
-
if (!t.startsWith(
|
|
25975
|
+
if (!t.startsWith(Ba)) return;
|
|
25967
25976
|
let n;
|
|
25968
25977
|
try {
|
|
25969
25978
|
n = JSON.parse(t.slice(26));
|
|
@@ -25972,62 +25981,62 @@ function Ua(e) {
|
|
|
25972
25981
|
}
|
|
25973
25982
|
if (!n || typeof n != "object" || Array.isArray(n)) return;
|
|
25974
25983
|
let r = n;
|
|
25975
|
-
if (!(r.code !== "ooxml-insufficient-credit" || !
|
|
25984
|
+
if (!(r.code !== "ooxml-insufficient-credit" || !Ha(r))) return new Ua(r);
|
|
25976
25985
|
}
|
|
25977
|
-
function
|
|
25978
|
-
let r =
|
|
25986
|
+
function Ga(e, t, n) {
|
|
25987
|
+
let r = Wa(e);
|
|
25979
25988
|
if (!(!r || r.offeredBytes !== t || r.requiredBytes > n)) return r;
|
|
25980
25989
|
}
|
|
25981
|
-
function
|
|
25982
|
-
if (
|
|
25990
|
+
function Ka(e, t, n) {
|
|
25991
|
+
if (Ja(e)) return e.offeredBytes === t && e.requiredBytes <= n ? e.requiredBytes : void 0;
|
|
25983
25992
|
}
|
|
25984
|
-
async function
|
|
25993
|
+
async function qa(e, t, n, r) {
|
|
25985
25994
|
try {
|
|
25986
25995
|
return await e.pull(t, { signal: r });
|
|
25987
25996
|
} catch (i) {
|
|
25988
|
-
let a =
|
|
25997
|
+
let a = Ka(i, t, n);
|
|
25989
25998
|
if (a === void 0) throw i;
|
|
25990
25999
|
return e.pull(a, { signal: r });
|
|
25991
26000
|
}
|
|
25992
26001
|
}
|
|
25993
|
-
function
|
|
25994
|
-
return e instanceof
|
|
26002
|
+
function Ja(e) {
|
|
26003
|
+
return e instanceof Ua || !!e && typeof e == "object" && e.code === "ooxml-insufficient-credit" && Ha(e);
|
|
25995
26004
|
}
|
|
25996
|
-
var
|
|
26005
|
+
var Ya = "OOXML_RESOURCE_LIMIT:", Xa = "OOXML_NOT_OOXML:", Za = 128, Qa = 256, $a = 4096;
|
|
25997
26006
|
function Y(e) {
|
|
25998
26007
|
return typeof e == "number" && Number.isSafeInteger(e) && e >= 0;
|
|
25999
26008
|
}
|
|
26000
|
-
function
|
|
26009
|
+
function eo(e) {
|
|
26001
26010
|
if (!e || typeof e != "object" || Array.isArray(e)) return !1;
|
|
26002
26011
|
let t = e;
|
|
26003
26012
|
return Y(t.archiveEntryCount) && Y(t.declaredInflatedBytes) && (t.largestInflatedEntryBytes === void 0 || Y(t.largestInflatedEntryBytes)) && Y(t.distinctInflatedBytes) && Y(t.operationInflatedBytes);
|
|
26004
26013
|
}
|
|
26005
|
-
function
|
|
26014
|
+
function to(e) {
|
|
26006
26015
|
let t;
|
|
26007
26016
|
try {
|
|
26008
26017
|
t = JSON.parse(new TextDecoder().decode(e));
|
|
26009
26018
|
} catch {
|
|
26010
26019
|
throw TypeError("OOXML resource usage checkpoint is not valid JSON");
|
|
26011
26020
|
}
|
|
26012
|
-
if (
|
|
26021
|
+
if (!eo(t)) throw TypeError("OOXML resource usage checkpoint is invalid");
|
|
26013
26022
|
return t;
|
|
26014
26023
|
}
|
|
26015
|
-
function
|
|
26024
|
+
function no(e) {
|
|
26016
26025
|
return e === "docx" || e === "xlsx" || e === "pptx";
|
|
26017
26026
|
}
|
|
26018
|
-
function
|
|
26027
|
+
function ro(e) {
|
|
26019
26028
|
return e === "container" || e === "decompression" || e === "parsing" || e === "serialization" || e === "layout" || e === "rendering" || e === "worker";
|
|
26020
26029
|
}
|
|
26021
26030
|
function X(e, t) {
|
|
26022
26031
|
return typeof e == "string" && e.length > 0 && e.length <= t && !/[\u0000-\u001f\u007f]/u.test(e);
|
|
26023
26032
|
}
|
|
26024
|
-
function ro(e) {
|
|
26025
|
-
return X(e, Xa) && /^[a-z0-9][a-z0-9-]*$/u.test(e);
|
|
26026
|
-
}
|
|
26027
26033
|
function io(e) {
|
|
26028
|
-
return
|
|
26034
|
+
return X(e, Za) && /^[a-z0-9][a-z0-9-]*$/u.test(e);
|
|
26029
26035
|
}
|
|
26030
|
-
|
|
26036
|
+
function ao(e) {
|
|
26037
|
+
return !X(e, $a) || e.startsWith("/") || e.startsWith("\\") || e.includes("\\") || e.includes("?") || e.includes("#") || e.includes("://") || /^[a-z]:/iu.test(e) ? !1 : e.split("/").every((e) => e !== "" && e !== "." && e !== "..");
|
|
26038
|
+
}
|
|
26039
|
+
var oo = new Map([
|
|
26031
26040
|
["archive-entry:declared-inflated-bytes", {
|
|
26032
26041
|
stage: "container",
|
|
26033
26042
|
part: "required"
|
|
@@ -26129,20 +26138,20 @@ var ao = new Map([
|
|
|
26129
26138
|
part: "forbidden",
|
|
26130
26139
|
configurable: !1
|
|
26131
26140
|
}]
|
|
26132
|
-
]),
|
|
26133
|
-
function
|
|
26141
|
+
]), so = new Set([...oo.keys()].map((e) => e.slice(0, e.indexOf(":")))), co = new Set([...oo.keys()].map((e) => e.slice(e.indexOf(":") + 1)));
|
|
26142
|
+
function lo(e) {
|
|
26134
26143
|
if (!e || typeof e != "object" || Array.isArray(e)) return !1;
|
|
26135
26144
|
let t = e;
|
|
26136
|
-
return !
|
|
26145
|
+
return !no(t.format) || !X(t.operation, Qa) || !io(t.resource) || !io(t.metric) || !Y(t.limit) || !Y(t.observed) || typeof t.configurable != "boolean" || !eo(t.usage) ? !1 : !("part" in t) || ao(t.part);
|
|
26137
26146
|
}
|
|
26138
|
-
function
|
|
26147
|
+
function uo(e) {
|
|
26139
26148
|
if (!e || typeof e != "object" || Array.isArray(e)) return !1;
|
|
26140
26149
|
let t = e;
|
|
26141
|
-
if (!
|
|
26142
|
-
let n = t.violation, r =
|
|
26143
|
-
return r ? t.stage !== r.stage || r.configurable === !1 && n.configurable !== !1 ? !1 : r.part === "required" ? n.part !== void 0 : r.part === "forbidden" ? n.part === void 0 : !0 : !(
|
|
26150
|
+
if (!ro(t.stage) || !lo(t.violation)) return !1;
|
|
26151
|
+
let n = t.violation, r = oo.get(`${n.resource}:${n.metric}`);
|
|
26152
|
+
return r ? t.stage !== r.stage || r.configurable === !1 && n.configurable !== !1 ? !1 : r.part === "required" ? n.part !== void 0 : r.part === "forbidden" ? n.part === void 0 : !0 : !(so.has(n.resource) && co.has(n.metric));
|
|
26144
26153
|
}
|
|
26145
|
-
function
|
|
26154
|
+
function fo(e) {
|
|
26146
26155
|
return {
|
|
26147
26156
|
archiveEntryCount: e.archiveEntryCount,
|
|
26148
26157
|
declaredInflatedBytes: e.declaredInflatedBytes,
|
|
@@ -26151,8 +26160,8 @@ function uo(e) {
|
|
|
26151
26160
|
operationInflatedBytes: e.operationInflatedBytes
|
|
26152
26161
|
};
|
|
26153
26162
|
}
|
|
26154
|
-
function
|
|
26155
|
-
if (!
|
|
26163
|
+
function po(e) {
|
|
26164
|
+
if (!uo(e)) return;
|
|
26156
26165
|
let t = e.violation, n = {
|
|
26157
26166
|
stage: e.stage,
|
|
26158
26167
|
violation: {
|
|
@@ -26164,18 +26173,18 @@ function fo(e) {
|
|
|
26164
26173
|
limit: t.limit,
|
|
26165
26174
|
observed: t.observed,
|
|
26166
26175
|
configurable: t.configurable,
|
|
26167
|
-
usage:
|
|
26176
|
+
usage: fo(t.usage)
|
|
26168
26177
|
}
|
|
26169
26178
|
};
|
|
26170
|
-
return
|
|
26179
|
+
return uo(n) ? n : void 0;
|
|
26171
26180
|
}
|
|
26172
|
-
function
|
|
26181
|
+
function mo(e) {
|
|
26173
26182
|
let t = e.violation;
|
|
26174
26183
|
return `OOXML resource limit exceeded${t.part ? ` for ${t.part}` : ""} (${t.resource}, ${e.stage}): ${t.metric} ${t.observed} > ${t.limit}`;
|
|
26175
26184
|
}
|
|
26176
|
-
function
|
|
26185
|
+
function ho(e) {
|
|
26177
26186
|
let t = e instanceof Error ? e.message : String(e);
|
|
26178
|
-
if (!t.startsWith(
|
|
26187
|
+
if (!t.startsWith(Ya)) return;
|
|
26179
26188
|
let n;
|
|
26180
26189
|
try {
|
|
26181
26190
|
n = JSON.parse(t.slice(21));
|
|
@@ -26184,43 +26193,43 @@ function mo(e) {
|
|
|
26184
26193
|
}
|
|
26185
26194
|
if (!n || typeof n != "object") return;
|
|
26186
26195
|
let r = n;
|
|
26187
|
-
if (!(r.code !== "ooxml-resource-limit" || !
|
|
26196
|
+
if (!(r.code !== "ooxml-resource-limit" || !uo(r.details))) return new v(mo(r.details), r.details);
|
|
26188
26197
|
}
|
|
26189
|
-
function
|
|
26198
|
+
function go(e) {
|
|
26190
26199
|
try {
|
|
26191
26200
|
return e();
|
|
26192
26201
|
} catch (e) {
|
|
26193
|
-
throw e instanceof v || typeof e != "string" && !(e instanceof Error) ? e :
|
|
26202
|
+
throw e instanceof v || typeof e != "string" && !(e instanceof Error) ? e : ho(e) ?? e;
|
|
26194
26203
|
}
|
|
26195
26204
|
}
|
|
26196
|
-
function
|
|
26205
|
+
function _o(e) {
|
|
26197
26206
|
let t = e instanceof Error ? e.message : String(e);
|
|
26198
|
-
if (t.startsWith(
|
|
26207
|
+
if (t.startsWith(Xa)) return new g("not-ooxml", `This file is not an Office Open XML document: ${t.slice(16)}`);
|
|
26199
26208
|
}
|
|
26200
|
-
function
|
|
26209
|
+
function vo(e) {
|
|
26201
26210
|
if (!e || typeof e != "object" || Array.isArray(e)) return;
|
|
26202
26211
|
let t = e, n = t.format, r = t.reason;
|
|
26203
|
-
if (!(!
|
|
26212
|
+
if (!(!io(n) || r !== "source-subset")) return {
|
|
26204
26213
|
format: n,
|
|
26205
26214
|
reason: r
|
|
26206
26215
|
};
|
|
26207
26216
|
}
|
|
26208
|
-
function
|
|
26217
|
+
function yo(e) {
|
|
26209
26218
|
return new g("unsupported-content", "Input is outside the source’s supported subset.", e);
|
|
26210
26219
|
}
|
|
26211
|
-
function
|
|
26220
|
+
function bo(e) {
|
|
26212
26221
|
let t = typeof e == "string" ? e : e instanceof Error ? e.message : "";
|
|
26213
26222
|
if (!(!t.startsWith("MODEL_SOURCE_UNSUPPORTED:") || t.length > 1024)) try {
|
|
26214
|
-
let e =
|
|
26215
|
-
return e ?
|
|
26223
|
+
let e = vo(JSON.parse(t.slice(25)));
|
|
26224
|
+
return e ? yo(e) : void 0;
|
|
26216
26225
|
} catch {
|
|
26217
26226
|
return;
|
|
26218
26227
|
}
|
|
26219
26228
|
}
|
|
26220
|
-
function bo(e) {
|
|
26221
|
-
return e === "OOXML_SOURCE_UNSUPPORTED_ENCRYPTION" || e instanceof Error && e.message === "OOXML_SOURCE_UNSUPPORTED_ENCRYPTION" ? new g("unsupported-encryption", "The configured source cannot decrypt this input.") : yo(e) ?? mo(e) ?? go(e);
|
|
26222
|
-
}
|
|
26223
26229
|
function xo(e) {
|
|
26230
|
+
return e === "OOXML_SOURCE_UNSUPPORTED_ENCRYPTION" || e instanceof Error && e.message === "OOXML_SOURCE_UNSUPPORTED_ENCRYPTION" ? new g("unsupported-encryption", "The configured source cannot decrypt this input.") : bo(e) ?? ho(e) ?? _o(e);
|
|
26231
|
+
}
|
|
26232
|
+
function So(e) {
|
|
26224
26233
|
let t = b(e);
|
|
26225
26234
|
if (t) {
|
|
26226
26235
|
let e = new E(t.metric, t.limit, t.observed);
|
|
@@ -26237,7 +26246,7 @@ function xo(e) {
|
|
|
26237
26246
|
errorName: "TiffDecodeError",
|
|
26238
26247
|
code: "ooxml-tiff-decode"
|
|
26239
26248
|
};
|
|
26240
|
-
let r =
|
|
26249
|
+
let r = Wa(e);
|
|
26241
26250
|
if (r) return {
|
|
26242
26251
|
message: r.message,
|
|
26243
26252
|
errorName: r.name,
|
|
@@ -26247,11 +26256,11 @@ function xo(e) {
|
|
|
26247
26256
|
offeredBytes: r.offeredBytes
|
|
26248
26257
|
}
|
|
26249
26258
|
};
|
|
26250
|
-
let i = e instanceof g || e instanceof v ? e :
|
|
26259
|
+
let i = e instanceof g || e instanceof v ? e : xo(e), a = i ?? e;
|
|
26251
26260
|
if (i instanceof v || a && typeof a == "object" && a.code === "ooxml-resource-limit") {
|
|
26252
|
-
let e = a, t =
|
|
26261
|
+
let e = a, t = po(e.details);
|
|
26253
26262
|
return t ? {
|
|
26254
|
-
message: typeof e.message == "string" ? e.message :
|
|
26263
|
+
message: typeof e.message == "string" ? e.message : mo(t),
|
|
26255
26264
|
errorName: "OoxmlResourceLimitError",
|
|
26256
26265
|
code: "ooxml-resource-limit",
|
|
26257
26266
|
resourceLimit: t
|
|
@@ -26261,9 +26270,9 @@ function xo(e) {
|
|
|
26261
26270
|
};
|
|
26262
26271
|
}
|
|
26263
26272
|
if (a && typeof a == "object" && a.code === "unsupported-content") {
|
|
26264
|
-
let e =
|
|
26273
|
+
let e = vo(a.details);
|
|
26265
26274
|
return e ? {
|
|
26266
|
-
message:
|
|
26275
|
+
message: yo(e).message,
|
|
26267
26276
|
code: "unsupported-content",
|
|
26268
26277
|
unsupportedContent: e
|
|
26269
26278
|
} : {
|
|
@@ -26273,24 +26282,24 @@ function xo(e) {
|
|
|
26273
26282
|
}
|
|
26274
26283
|
if (i instanceof g) return {
|
|
26275
26284
|
message: typeof i.message == "string" ? i.message : String(i.message),
|
|
26276
|
-
errorName: X(i.name,
|
|
26277
|
-
...
|
|
26285
|
+
errorName: X(i.name, Za) ? i.name : "OoxmlError",
|
|
26286
|
+
...io(i.code) ? { code: i.code } : {}
|
|
26278
26287
|
};
|
|
26279
26288
|
let o = e instanceof Error ? e.message : String(e);
|
|
26280
|
-
if (typeof o == "string" && o.startsWith(
|
|
26289
|
+
if (typeof o == "string" && o.startsWith(Ya)) return {
|
|
26281
26290
|
message: "Invalid OOXML resource-limit payload",
|
|
26282
26291
|
errorName: "Error"
|
|
26283
26292
|
};
|
|
26284
26293
|
let s = e instanceof Error ? e : Error(o), c = s;
|
|
26285
26294
|
return {
|
|
26286
26295
|
message: typeof s.message == "string" ? s.message : String(s.message),
|
|
26287
|
-
errorName: X(s.name,
|
|
26296
|
+
errorName: X(s.name, Za) ? s.name : "Error",
|
|
26288
26297
|
...typeof c.code == "string" ? { code: c.code } : {}
|
|
26289
26298
|
};
|
|
26290
26299
|
}
|
|
26291
|
-
function
|
|
26300
|
+
function Co(e) {
|
|
26292
26301
|
try {
|
|
26293
|
-
return
|
|
26302
|
+
return So(e);
|
|
26294
26303
|
} catch {
|
|
26295
26304
|
return {
|
|
26296
26305
|
message: "Worker operation failed with an unreadable error",
|
|
@@ -26298,7 +26307,7 @@ function So(e) {
|
|
|
26298
26307
|
};
|
|
26299
26308
|
}
|
|
26300
26309
|
}
|
|
26301
|
-
var
|
|
26310
|
+
var wo = new Set([
|
|
26302
26311
|
"encrypted",
|
|
26303
26312
|
"invalid-password",
|
|
26304
26313
|
"unsupported-encryption",
|
|
@@ -26306,7 +26315,7 @@ var Co = new Set([
|
|
|
26306
26315
|
"not-ooxml",
|
|
26307
26316
|
"invalid-numbering",
|
|
26308
26317
|
"unsupported-image-effect"
|
|
26309
|
-
]),
|
|
26318
|
+
]), To = {
|
|
26310
26319
|
"image-dimension": !0,
|
|
26311
26320
|
"image-pixels": !0,
|
|
26312
26321
|
"active-decoded-bytes": !0,
|
|
@@ -26319,41 +26328,41 @@ var Co = new Set([
|
|
|
26319
26328
|
"metafile-record-rectangles": !0,
|
|
26320
26329
|
"metafile-record-text-units": !0
|
|
26321
26330
|
};
|
|
26322
|
-
function
|
|
26323
|
-
return typeof e == "string" && Object.prototype.hasOwnProperty.call(
|
|
26331
|
+
function Eo(e) {
|
|
26332
|
+
return typeof e == "string" && Object.prototype.hasOwnProperty.call(To, e);
|
|
26324
26333
|
}
|
|
26325
|
-
function
|
|
26334
|
+
function Do(e, t) {
|
|
26326
26335
|
if (e !== "ooxml-decoded-image-limit" || !t || typeof t != "object") return;
|
|
26327
26336
|
let n = t, r = n.metric, i = n.limit, a = n.observed;
|
|
26328
|
-
if (!(!
|
|
26337
|
+
if (!(!Eo(r) || !Y(i) || !Y(a) || a <= i)) return {
|
|
26329
26338
|
metric: r,
|
|
26330
26339
|
limit: i,
|
|
26331
26340
|
observed: a
|
|
26332
26341
|
};
|
|
26333
26342
|
}
|
|
26334
|
-
function
|
|
26335
|
-
let t = e.message, n = e.errorName, r = e.code, i = e.decodedImage, a = e.insufficientCredit, o = e.resourceLimit, s = e.unsupportedContent, c = typeof t == "string" ? t : "Worker operation failed with an invalid error payload", l = X(n,
|
|
26343
|
+
function Oo(e) {
|
|
26344
|
+
let t = e.message, n = e.errorName, r = e.code, i = e.decodedImage, a = e.insufficientCredit, o = e.resourceLimit, s = e.unsupportedContent, c = typeof t == "string" ? t : "Worker operation failed with an invalid error payload", l = X(n, Za) ? n : void 0, u = typeof r == "string" ? r : void 0;
|
|
26336
26345
|
if (u === "unsupported-content") {
|
|
26337
|
-
let e =
|
|
26338
|
-
return e ?
|
|
26346
|
+
let e = vo(s);
|
|
26347
|
+
return e ? yo(e) : /* @__PURE__ */ Error("Invalid unsupported-content error payload");
|
|
26339
26348
|
}
|
|
26340
|
-
let d =
|
|
26349
|
+
let d = Do(u, i);
|
|
26341
26350
|
if (d) return new E(d.metric, d.limit, d.observed);
|
|
26342
26351
|
if (u === "ooxml-tiff-decode") return new le(c);
|
|
26343
|
-
if (u === "ooxml-insufficient-credit" &&
|
|
26344
|
-
if (u === "ooxml-resource-limit" &&
|
|
26345
|
-
if (u &&
|
|
26352
|
+
if (u === "ooxml-insufficient-credit" && Ha(a)) return new Ua(a);
|
|
26353
|
+
if (u === "ooxml-resource-limit" && uo(o)) return new v(c, o);
|
|
26354
|
+
if (u && wo.has(u)) return new g(u, c);
|
|
26346
26355
|
let f = l === "TypeError" ? TypeError(c) : l === "RangeError" ? RangeError(c) : Error(c);
|
|
26347
26356
|
return l && (f.name = l), u !== void 0 && Object.assign(f, { code: u }), f;
|
|
26348
26357
|
}
|
|
26349
|
-
function
|
|
26358
|
+
function ko(e) {
|
|
26350
26359
|
try {
|
|
26351
|
-
return
|
|
26360
|
+
return Oo(e);
|
|
26352
26361
|
} catch {
|
|
26353
26362
|
return /* @__PURE__ */ Error("Worker operation failed with an unreadable error payload");
|
|
26354
26363
|
}
|
|
26355
26364
|
}
|
|
26356
|
-
var
|
|
26365
|
+
var Ao = class {
|
|
26357
26366
|
initialize;
|
|
26358
26367
|
reinitialize;
|
|
26359
26368
|
normalizeFailure;
|
|
@@ -26410,75 +26419,75 @@ var ko = class {
|
|
|
26410
26419
|
assertCurrent(e) {
|
|
26411
26420
|
if (this.state !== "ready" || e !== this.generationValue) throw Error("WASM archive session belongs to a discarded runtime generation");
|
|
26412
26421
|
}
|
|
26413
|
-
},
|
|
26422
|
+
}, jo = class e extends Error {
|
|
26414
26423
|
code = "parser-crashed";
|
|
26415
26424
|
constructor(t) {
|
|
26416
26425
|
super(t), this.name = "WasmTrapError", Object.setPrototypeOf(this, e.prototype);
|
|
26417
26426
|
}
|
|
26418
26427
|
};
|
|
26419
|
-
function
|
|
26428
|
+
function Mo(e) {
|
|
26420
26429
|
let t = globalThis.WebAssembly?.RuntimeError;
|
|
26421
26430
|
return t && e instanceof t || e instanceof RangeError ? !0 : e instanceof Error ? e.name === "RuntimeError" || e.name === "CompileError" || e.name === "LinkError" || e.name === "InternalError" || e.name === "OOMError" : !1;
|
|
26422
26431
|
}
|
|
26423
|
-
function
|
|
26432
|
+
function No(e) {
|
|
26424
26433
|
try {
|
|
26425
26434
|
if ((typeof e != "object" || !e) && typeof e != "function") return;
|
|
26426
26435
|
let t = Reflect.get(e, "__destroy_into_raw");
|
|
26427
26436
|
typeof t == "function" && Reflect.apply(t, e, []);
|
|
26428
26437
|
} catch {}
|
|
26429
26438
|
}
|
|
26430
|
-
var
|
|
26439
|
+
var Po = Object.freeze({
|
|
26431
26440
|
maxArchiveEntryBytes: Fe,
|
|
26432
26441
|
maxTotalInflatedBytes: Ie,
|
|
26433
26442
|
maxArchiveEntries: Le
|
|
26434
26443
|
});
|
|
26435
|
-
function
|
|
26444
|
+
function Fo(e, t, n) {
|
|
26436
26445
|
if (t === void 0) return n;
|
|
26437
26446
|
if (t === null) return null;
|
|
26438
26447
|
if (!Number.isSafeInteger(t) || t <= 0) throw RangeError(`resourceLimits.${e} must be null or a positive safe integer number of bytes`);
|
|
26439
26448
|
return t;
|
|
26440
26449
|
}
|
|
26441
|
-
function
|
|
26442
|
-
if (e === void 0) return
|
|
26450
|
+
function Io(e) {
|
|
26451
|
+
if (e === void 0) return Po.maxArchiveEntries;
|
|
26443
26452
|
if (e === null) return null;
|
|
26444
26453
|
if (!Number.isSafeInteger(e) || e <= 0) throw RangeError("resourceLimits.maxArchiveEntries must be null or a positive safe integer");
|
|
26445
26454
|
if (e > 2e4) throw RangeError(`resourceLimits.maxArchiveEntries must not exceed the internal hard ceiling of ${Re}`);
|
|
26446
26455
|
return e;
|
|
26447
26456
|
}
|
|
26448
|
-
function
|
|
26457
|
+
function Lo(e) {
|
|
26449
26458
|
if (!(e === void 0 || !(e > 0))) {
|
|
26450
26459
|
if (!Number.isSafeInteger(e)) throw RangeError("maxZipEntryBytes must be a positive safe integer number of bytes");
|
|
26451
26460
|
return e;
|
|
26452
26461
|
}
|
|
26453
26462
|
}
|
|
26454
|
-
function
|
|
26463
|
+
function Ro(e) {
|
|
26455
26464
|
let t = e.resourceLimits;
|
|
26456
26465
|
if (t !== void 0 && (typeof t != "object" || !t || Array.isArray(t))) throw TypeError("resourceLimits must be an object when provided");
|
|
26457
|
-
let n =
|
|
26466
|
+
let n = Lo(e.maxZipEntryBytes), r = t?.maxArchiveEntryBytes;
|
|
26458
26467
|
if (n !== void 0 && r !== void 0 && n !== r) throw RangeError("maxZipEntryBytes conflicts with resourceLimits.maxArchiveEntryBytes");
|
|
26459
26468
|
return Object.freeze({
|
|
26460
|
-
maxArchiveEntryBytes:
|
|
26461
|
-
maxTotalInflatedBytes:
|
|
26462
|
-
maxArchiveEntries:
|
|
26469
|
+
maxArchiveEntryBytes: Fo("maxArchiveEntryBytes", r === void 0 ? n : r, Po.maxArchiveEntryBytes),
|
|
26470
|
+
maxTotalInflatedBytes: Fo("maxTotalInflatedBytes", t?.maxTotalInflatedBytes, Po.maxTotalInflatedBytes),
|
|
26471
|
+
maxArchiveEntries: Io(t?.maxArchiveEntries)
|
|
26463
26472
|
});
|
|
26464
26473
|
}
|
|
26465
|
-
function
|
|
26474
|
+
function zo(e) {
|
|
26466
26475
|
if (e.debug !== void 0 && typeof e.debug != "boolean") throw TypeError("debug must be a boolean when provided");
|
|
26467
26476
|
if (e.onResourceMetrics !== void 0 && typeof e.onResourceMetrics != "function") throw TypeError("onResourceMetrics must be a function when provided");
|
|
26468
26477
|
return Object.freeze({
|
|
26469
|
-
policy:
|
|
26478
|
+
policy: Ro(e),
|
|
26470
26479
|
debug: e.debug ?? !1,
|
|
26471
26480
|
...e.onResourceMetrics ? { onResourceMetrics: e.onResourceMetrics } : {}
|
|
26472
26481
|
});
|
|
26473
26482
|
}
|
|
26474
|
-
function
|
|
26483
|
+
function Bo(e) {
|
|
26475
26484
|
return [
|
|
26476
26485
|
e.maxArchiveEntryBytes === null ? 0n : BigInt(e.maxArchiveEntryBytes),
|
|
26477
26486
|
e.maxTotalInflatedBytes === null ? 0n : BigInt(e.maxTotalInflatedBytes),
|
|
26478
26487
|
e.maxArchiveEntries === null ? 0n : BigInt(e.maxArchiveEntries)
|
|
26479
26488
|
];
|
|
26480
26489
|
}
|
|
26481
|
-
var
|
|
26490
|
+
var Vo = [
|
|
26482
26491
|
"font-family: \"SFMono-Regular\", Menlo, Monaco, Consolas, monospace",
|
|
26483
26492
|
"font-size: 12px",
|
|
26484
26493
|
"line-height: 1.35",
|
|
@@ -26486,27 +26495,27 @@ var Bo = [
|
|
|
26486
26495
|
"letter-spacing: 0",
|
|
26487
26496
|
"white-space: pre"
|
|
26488
26497
|
].join(";");
|
|
26489
|
-
function
|
|
26490
|
-
if (
|
|
26491
|
-
console.log(`%c${e}`,
|
|
26498
|
+
function Ho(e) {
|
|
26499
|
+
if (Uo()) {
|
|
26500
|
+
console.log(`%c${e}`, Vo);
|
|
26492
26501
|
return;
|
|
26493
26502
|
}
|
|
26494
26503
|
console.log(e);
|
|
26495
26504
|
}
|
|
26496
|
-
function
|
|
26505
|
+
function Uo() {
|
|
26497
26506
|
return typeof window < "u" && globalThis.process?.release?.name !== "node";
|
|
26498
26507
|
}
|
|
26499
|
-
function
|
|
26500
|
-
let t = e.scope === "session" ? "SESSION" : "LOAD", n = e.status === "ok" ? e.scope === "session" ? "COMPLETE" : "READY" : "FAILED", r = [
|
|
26501
|
-
if (r.push(Z(`mode ${e.mode.padEnd(8)} elapsed ${
|
|
26502
|
-
r.push(
|
|
26508
|
+
function Wo(e) {
|
|
26509
|
+
let t = e.scope === "session" ? "SESSION" : "LOAD", n = e.status === "ok" ? e.scope === "session" ? "COMPLETE" : "READY" : "FAILED", r = [Yo(` OOXML ${t} ${e.format.toUpperCase()} ${n} `, 68)];
|
|
26510
|
+
if (r.push(Z(`mode ${e.mode.padEnd(8)} elapsed ${qo(e.elapsedMs)}`, 68)), e.sourceBytes !== void 0 && r.push(Z(`source ${Ko(e.sourceBytes)}`, 68)), r.push(Xo(" admission ", 68)), r.push(Zo("largest entry", e.usage?.largestInflatedEntryBytes, e.policy.maxArchiveEntryBytes, 68)), r.push(Zo("total inflated", e.usage?.distinctInflatedBytes, e.policy.maxTotalInflatedBytes, 68)), r.push(Z(`entry count ${e.usage ? Jo(e.usage.archiveEntryCount) : "—"} / ${e.policy.maxArchiveEntries === null ? "public off" : Jo(e.policy.maxArchiveEntries)}`, 68)), e.usage ? r.push(Z(`declared inflated ${Ko(e.usage.declaredInflatedBytes)}`, 68)) : r.push(Z("usage unavailable for this report", 68)), e.checkpoints.length > 0) {
|
|
26511
|
+
r.push(Xo(" checkpoints ", 68));
|
|
26503
26512
|
for (let t of e.checkpoints) {
|
|
26504
|
-
let e = t.usage ?
|
|
26505
|
-
r.push(Z(`${
|
|
26513
|
+
let e = t.usage ? Ko(t.usage.distinctInflatedBytes) : "—";
|
|
26514
|
+
r.push(Z(`${qo(t.elapsedMs).padStart(8)} ${t.name.padEnd(25)} ${e.padStart(12)}`, 68));
|
|
26506
26515
|
}
|
|
26507
26516
|
}
|
|
26508
|
-
if (e.outcome && Object.keys(e.outcome).length > 0 && (r.push(
|
|
26509
|
-
r.push(
|
|
26517
|
+
if (e.outcome && Object.keys(e.outcome).length > 0 && (r.push(Xo(" result ", 68)), r.push(Z(Object.entries(e.outcome).map(([e, t]) => `${e} ${Jo(t)}`).join(" "), 68))), e.error) {
|
|
26518
|
+
r.push(Xo(" failure ", 68));
|
|
26510
26519
|
let t = [
|
|
26511
26520
|
e.error.code,
|
|
26512
26521
|
e.error.stage,
|
|
@@ -26517,10 +26526,10 @@ function Uo(e) {
|
|
|
26517
26526
|
}
|
|
26518
26527
|
return r.push(`└${"─".repeat(68)}┘`), r.join("\n");
|
|
26519
26528
|
}
|
|
26520
|
-
function Wo(e) {
|
|
26521
|
-
Vo(Uo(e));
|
|
26522
|
-
}
|
|
26523
26529
|
function Go(e) {
|
|
26530
|
+
Ho(Wo(e));
|
|
26531
|
+
}
|
|
26532
|
+
function Ko(e) {
|
|
26524
26533
|
if (!Number.isFinite(e) || e < 0) return "—";
|
|
26525
26534
|
let t = [
|
|
26526
26535
|
"B",
|
|
@@ -26533,17 +26542,17 @@ function Go(e) {
|
|
|
26533
26542
|
let i = r === 0 || n >= 100 ? 0 : n >= 10 ? 1 : 2;
|
|
26534
26543
|
return `${n.toFixed(i)} ${t[r]}`;
|
|
26535
26544
|
}
|
|
26536
|
-
function
|
|
26545
|
+
function qo(e) {
|
|
26537
26546
|
return e < 1e3 ? `${Math.round(e)} ms` : `${(e / 1e3).toFixed(2)} s`;
|
|
26538
26547
|
}
|
|
26539
|
-
function
|
|
26548
|
+
function Jo(e) {
|
|
26540
26549
|
return Number.isSafeInteger(e) ? e.toLocaleString("en-US") : "—";
|
|
26541
26550
|
}
|
|
26542
|
-
function
|
|
26551
|
+
function Yo(e, t) {
|
|
26543
26552
|
let n = e.slice(0, t);
|
|
26544
26553
|
return `┌${n}${"─".repeat(t - n.length)}┐`;
|
|
26545
26554
|
}
|
|
26546
|
-
function
|
|
26555
|
+
function Xo(e, t) {
|
|
26547
26556
|
let n = e.slice(0, t);
|
|
26548
26557
|
return `├${n}${"─".repeat(t - n.length)}┤`;
|
|
26549
26558
|
}
|
|
@@ -26551,18 +26560,18 @@ function Z(e, t) {
|
|
|
26551
26560
|
let n = e.slice(0, t - 2);
|
|
26552
26561
|
return `│ ${n}${" ".repeat(t - n.length - 2)} │`;
|
|
26553
26562
|
}
|
|
26554
|
-
function
|
|
26555
|
-
let i = t === void 0 || n === null || n <= 0 ? 0 : Math.min(1, t / n), a = Math.round(i * 16), o = `${"█".repeat(a)}${"░".repeat(16 - a)}`, s = `${t === void 0 ? "—" :
|
|
26563
|
+
function Zo(e, t, n, r) {
|
|
26564
|
+
let i = t === void 0 || n === null || n <= 0 ? 0 : Math.min(1, t / n), a = Math.round(i * 16), o = `${"█".repeat(a)}${"░".repeat(16 - a)}`, s = `${t === void 0 ? "—" : Ko(t)} / ${n === null ? "public off" : Ko(n)}`;
|
|
26556
26565
|
return Z(`${e.padEnd(14)} ${o} ${s}`, r);
|
|
26557
26566
|
}
|
|
26558
|
-
var
|
|
26559
|
-
async function
|
|
26560
|
-
e.observeUsage(await t(
|
|
26567
|
+
var Qo = 1e3;
|
|
26568
|
+
async function $o(e, t) {
|
|
26569
|
+
e.observeUsage(await t(Qo));
|
|
26561
26570
|
let n = e.current();
|
|
26562
26571
|
if (!n) throw Error("OOXML resource metrics are not ready");
|
|
26563
26572
|
return n;
|
|
26564
26573
|
}
|
|
26565
|
-
var
|
|
26574
|
+
var es = class {
|
|
26566
26575
|
options;
|
|
26567
26576
|
now;
|
|
26568
26577
|
startedAt;
|
|
@@ -26577,7 +26586,7 @@ var $o = class {
|
|
|
26577
26586
|
terminalOutcome;
|
|
26578
26587
|
terminalElapsedMs;
|
|
26579
26588
|
constructor(e) {
|
|
26580
|
-
this.options = e, this.now = e.now ??
|
|
26589
|
+
this.options = e, this.now = e.now ?? rs, this.startedAt = this.now(), this.policy = Object.freeze({
|
|
26581
26590
|
maxArchiveEntryBytes: e.policy.maxArchiveEntryBytes,
|
|
26582
26591
|
maxTotalInflatedBytes: e.policy.maxTotalInflatedBytes,
|
|
26583
26592
|
maxArchiveEntries: e.policy.maxArchiveEntries,
|
|
@@ -26592,16 +26601,16 @@ var $o = class {
|
|
|
26592
26601
|
}
|
|
26593
26602
|
checkpoint(e, t) {
|
|
26594
26603
|
if (!this.options.enabled || this.finished) return;
|
|
26595
|
-
t && (this.lastUsage =
|
|
26604
|
+
t && (this.lastUsage = is(t));
|
|
26596
26605
|
let n = this.lastUsage;
|
|
26597
26606
|
this.checkpoints.push(Object.freeze({
|
|
26598
|
-
name:
|
|
26599
|
-
elapsedMs:
|
|
26607
|
+
name: ss(e),
|
|
26608
|
+
elapsedMs: os(this.startedAt, this.now()),
|
|
26600
26609
|
...n ? { usage: n } : {}
|
|
26601
26610
|
}));
|
|
26602
26611
|
}
|
|
26603
26612
|
observeUsage(e) {
|
|
26604
|
-
!this.options.enabled || !e || (this.lastUsage =
|
|
26613
|
+
!this.options.enabled || !e || (this.lastUsage = is(e));
|
|
26605
26614
|
}
|
|
26606
26615
|
current() {
|
|
26607
26616
|
if (!(!this.options.enabled || !this.terminalStatus)) return this.report(this.terminalStatus, this.terminalError, this.terminalOutcome);
|
|
@@ -26614,12 +26623,12 @@ var $o = class {
|
|
|
26614
26623
|
}
|
|
26615
26624
|
finish(e, t, n) {
|
|
26616
26625
|
if (!this.options.enabled || this.finished) return;
|
|
26617
|
-
this.finished = !0, this.terminalStatus = e, this.terminalError = t, this.terminalOutcome = n, this.terminalElapsedMs =
|
|
26626
|
+
this.finished = !0, this.terminalStatus = e, this.terminalError = t, this.terminalOutcome = n, this.terminalElapsedMs = os(this.startedAt, this.now());
|
|
26618
26627
|
let r = this.report(e, t, n);
|
|
26619
|
-
return this.options.onMetrics &&
|
|
26628
|
+
return this.options.onMetrics && ts(this.options.onMetrics, r), (this.options.emitToConsole ?? this.options.onMetrics === void 0) && ts(Go, r), r;
|
|
26620
26629
|
}
|
|
26621
26630
|
report(e, t, n) {
|
|
26622
|
-
let r =
|
|
26631
|
+
let r = as(t) ?? this.lastUsage;
|
|
26623
26632
|
return Object.freeze({
|
|
26624
26633
|
schemaVersion: 1,
|
|
26625
26634
|
scope: this.options.scope ?? "load",
|
|
@@ -26627,28 +26636,28 @@ var $o = class {
|
|
|
26627
26636
|
mode: this.mode,
|
|
26628
26637
|
status: e,
|
|
26629
26638
|
...this.sourceBytes === void 0 ? {} : { sourceBytes: this.sourceBytes },
|
|
26630
|
-
elapsedMs: this.terminalElapsedMs ??
|
|
26639
|
+
elapsedMs: this.terminalElapsedMs ?? os(this.startedAt, this.now()),
|
|
26631
26640
|
policy: this.policy,
|
|
26632
26641
|
...r ? { usage: r } : {},
|
|
26633
26642
|
checkpoints: Object.freeze([...this.checkpoints]),
|
|
26634
|
-
...n ? { outcome:
|
|
26635
|
-
...e === "error" ? { error:
|
|
26643
|
+
...n ? { outcome: cs(n) } : {},
|
|
26644
|
+
...e === "error" ? { error: ls(t) } : {}
|
|
26636
26645
|
});
|
|
26637
26646
|
}
|
|
26638
26647
|
};
|
|
26639
|
-
function
|
|
26648
|
+
function ts(e, t) {
|
|
26640
26649
|
try {
|
|
26641
26650
|
let n = e(t);
|
|
26642
|
-
|
|
26651
|
+
ns(n) && Promise.resolve(n).catch(() => void 0);
|
|
26643
26652
|
} catch {}
|
|
26644
26653
|
}
|
|
26645
|
-
function
|
|
26654
|
+
function ns(e) {
|
|
26646
26655
|
return (typeof e == "object" && !!e || typeof e == "function") && typeof e.then == "function";
|
|
26647
26656
|
}
|
|
26648
|
-
function
|
|
26657
|
+
function rs() {
|
|
26649
26658
|
return typeof performance > "u" ? Date.now() : performance.now();
|
|
26650
26659
|
}
|
|
26651
|
-
function
|
|
26660
|
+
function is(e) {
|
|
26652
26661
|
return Object.freeze({
|
|
26653
26662
|
archiveEntryCount: e.archiveEntryCount,
|
|
26654
26663
|
declaredInflatedBytes: e.declaredInflatedBytes,
|
|
@@ -26657,23 +26666,23 @@ function rs(e) {
|
|
|
26657
26666
|
operationInflatedBytes: e.operationInflatedBytes
|
|
26658
26667
|
});
|
|
26659
26668
|
}
|
|
26660
|
-
function
|
|
26669
|
+
function as(e) {
|
|
26661
26670
|
try {
|
|
26662
|
-
return e instanceof v ?
|
|
26671
|
+
return e instanceof v ? is(e.details.violation.usage) : void 0;
|
|
26663
26672
|
} catch {
|
|
26664
26673
|
return;
|
|
26665
26674
|
}
|
|
26666
26675
|
}
|
|
26667
|
-
function
|
|
26676
|
+
function os(e, t) {
|
|
26668
26677
|
return Math.max(0, Math.round((t - e) * 10) / 10);
|
|
26669
26678
|
}
|
|
26670
|
-
function
|
|
26679
|
+
function ss(e) {
|
|
26671
26680
|
return e.replace(/[^a-z0-9 -]/giu, "").trim().slice(0, 32) || "checkpoint";
|
|
26672
26681
|
}
|
|
26673
|
-
function
|
|
26682
|
+
function cs(e) {
|
|
26674
26683
|
return Object.freeze(Object.fromEntries(Object.entries(e).filter(([e, t]) => /^[a-z][a-z0-9-]{0,31}$/u.test(e) && Number.isSafeInteger(t) && t >= 0)));
|
|
26675
26684
|
}
|
|
26676
|
-
function
|
|
26685
|
+
function ls(e) {
|
|
26677
26686
|
try {
|
|
26678
26687
|
if (e instanceof v) {
|
|
26679
26688
|
let t = e.details.violation;
|
|
@@ -26685,18 +26694,18 @@ function cs(e) {
|
|
|
26685
26694
|
});
|
|
26686
26695
|
}
|
|
26687
26696
|
if (e instanceof g || e instanceof E) return Object.freeze({ code: e.code });
|
|
26688
|
-
if (e instanceof
|
|
26697
|
+
if (e instanceof jo || typeof e == "object" && e && e.code === "parser-crashed") return Object.freeze({ code: "parser-crashed" });
|
|
26689
26698
|
} catch {}
|
|
26690
26699
|
return Object.freeze({});
|
|
26691
26700
|
}
|
|
26692
|
-
var
|
|
26701
|
+
var us = 1e3, Q = "ooxml-pull-v1";
|
|
26693
26702
|
function $(e, t) {
|
|
26694
26703
|
if (!Number.isSafeInteger(e) || e <= 0) throw RangeError(`${t} must be a positive safe integer`);
|
|
26695
26704
|
}
|
|
26696
|
-
function
|
|
26705
|
+
function ds(e) {
|
|
26697
26706
|
if (!(typeof e == "string" && e.length > 0 || typeof e == "number" && Number.isSafeInteger(e) && e > 0)) throw RangeError("session id must be a non-empty string or positive safe integer");
|
|
26698
26707
|
}
|
|
26699
|
-
var
|
|
26708
|
+
var fs = class {
|
|
26700
26709
|
bridge;
|
|
26701
26710
|
options;
|
|
26702
26711
|
sequence = 0;
|
|
@@ -26709,7 +26718,7 @@ var ds = class {
|
|
|
26709
26718
|
orphanedRequestIds = /* @__PURE__ */ new Set();
|
|
26710
26719
|
transferDisposers = /* @__PURE__ */ new Set();
|
|
26711
26720
|
constructor(e, t) {
|
|
26712
|
-
|
|
26721
|
+
ds(t.sessionId), $(t.operationId, "operation id"), $(t.generation, "generation"), $(t.maxByteCredit, "max byte credit"), t.cancelGraceMs !== void 0 && $(t.cancelGraceMs, "cancel grace"), this.bridge = e, this.options = t;
|
|
26713
26722
|
}
|
|
26714
26723
|
async pull(e, t) {
|
|
26715
26724
|
if (this.validateCredit(e), this.ending || this.completed) throw Error("pull session is closed");
|
|
@@ -26726,7 +26735,7 @@ var ds = class {
|
|
|
26726
26735
|
sequence: n,
|
|
26727
26736
|
byteCredit: e
|
|
26728
26737
|
}), t);
|
|
26729
|
-
if (this.validateResponseIdentity(r), r.usage && (this.usage = r.usage), r.kind === "error") throw
|
|
26738
|
+
if (this.validateResponseIdentity(r), r.usage && (this.usage = r.usage), r.kind === "error") throw ko(r.error);
|
|
26730
26739
|
if (r.kind !== "chunk") throw Error(`expected chunk response, received ${r.kind}`);
|
|
26731
26740
|
if (this.ending) throw this.disposePayload(r.payload), Error("pull session is closed");
|
|
26732
26741
|
try {
|
|
@@ -26736,7 +26745,7 @@ var ds = class {
|
|
|
26736
26745
|
}
|
|
26737
26746
|
return this.outstanding = !0, this.makeChunk(r);
|
|
26738
26747
|
} catch (e) {
|
|
26739
|
-
throw !
|
|
26748
|
+
throw !Ja(e) && !this.ending && !this.completed && this.cancel("protocol-error").catch(() => void 0), e;
|
|
26740
26749
|
} finally {
|
|
26741
26750
|
this.pulling = !1;
|
|
26742
26751
|
}
|
|
@@ -26802,7 +26811,7 @@ var ds = class {
|
|
|
26802
26811
|
this.forgetLifecycleOrphans();
|
|
26803
26812
|
return;
|
|
26804
26813
|
}
|
|
26805
|
-
throw
|
|
26814
|
+
throw ko(r.error);
|
|
26806
26815
|
}
|
|
26807
26816
|
if (r.kind !== "accepted" || r.command !== e) throw Error(`expected ${e} acceptance`);
|
|
26808
26817
|
(e === "cancel" || e === "close") && this.forgetLifecycleOrphans();
|
|
@@ -26847,7 +26856,7 @@ var ds = class {
|
|
|
26847
26856
|
for (let e of [...this.transferDisposers]) e();
|
|
26848
26857
|
}
|
|
26849
26858
|
lifecycleControl(e) {
|
|
26850
|
-
let t = this.options.cancelGraceMs ??
|
|
26859
|
+
let t = this.options.cancelGraceMs ?? us, n, r = new Promise((e, r) => {
|
|
26851
26860
|
n = setTimeout(() => {
|
|
26852
26861
|
this.bridge.terminate(), r(/* @__PURE__ */ Error(`worker did not accept lifecycle command within ${t}ms`));
|
|
26853
26862
|
}, t);
|
|
@@ -26866,7 +26875,7 @@ var ds = class {
|
|
|
26866
26875
|
this.options.disposeTransferred?.(e);
|
|
26867
26876
|
} catch {}
|
|
26868
26877
|
}
|
|
26869
|
-
},
|
|
26878
|
+
}, ps = class {
|
|
26870
26879
|
owner;
|
|
26871
26880
|
queue = Promise.resolve();
|
|
26872
26881
|
leases = /* @__PURE__ */ new Map();
|
|
@@ -26923,7 +26932,7 @@ var ds = class {
|
|
|
26923
26932
|
}
|
|
26924
26933
|
return this.fatal;
|
|
26925
26934
|
}
|
|
26926
|
-
},
|
|
26935
|
+
}, ms = class {
|
|
26927
26936
|
options;
|
|
26928
26937
|
coordinator;
|
|
26929
26938
|
coordinatorOwner = Symbol("pull-session-host");
|
|
@@ -26941,7 +26950,7 @@ var ds = class {
|
|
|
26941
26950
|
driverCloseComplete = !1;
|
|
26942
26951
|
completed = !1;
|
|
26943
26952
|
constructor(e) {
|
|
26944
|
-
|
|
26953
|
+
ds(e.sessionId), $(e.operationId, "operation id"), $(e.generation, "generation"), $(e.maxByteCredit, "max byte credit"), e.wireLeaseIdStart !== void 0 && $(e.wireLeaseIdStart, "wire lease id start"), this.options = e, this.coordinator = e.coordinator, this.nextWireLeaseId = e.wireLeaseIdStart ?? 1, this.unregisterCleanup = this.coordinator.registerCleanup(() => this.forceFatalCleanup());
|
|
26945
26954
|
}
|
|
26946
26955
|
dispatch(e, t) {
|
|
26947
26956
|
return this.coordinator.enqueue(async () => {
|
|
@@ -27000,7 +27009,7 @@ var ds = class {
|
|
|
27000
27009
|
case "close": return await this.close(), { response: this.accepted(e, "close") };
|
|
27001
27010
|
}
|
|
27002
27011
|
} catch (t) {
|
|
27003
|
-
let n =
|
|
27012
|
+
let n = Co(t);
|
|
27004
27013
|
return n.code === "ooxml-resource-limit" && (n = await this.coordinator.poison(n)), { response: this.errorResponse(e, n) };
|
|
27005
27014
|
}
|
|
27006
27015
|
}
|
|
@@ -27210,27 +27219,27 @@ var ds = class {
|
|
|
27210
27219
|
return;
|
|
27211
27220
|
}
|
|
27212
27221
|
}
|
|
27213
|
-
},
|
|
27214
|
-
function
|
|
27222
|
+
}, hs = "”’)〕]}〉》」』】〙〗〟⦆»、。,.・:;/?!‐ー゠–〜~ぁぃぅぇぉっゃゅょゎゕゖァィゥェォッャュョヮヵヶㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ゝゞヽヾ゛゜%‰℃°′″。」、・ー゙゚!),.:;?]}⦆", gs = "“‘(〔[{〈《「『【〘〖〝⦅«$¥#£¢([{⦅";
|
|
27223
|
+
function _s(e) {
|
|
27215
27224
|
let t = /* @__PURE__ */ new Set();
|
|
27216
27225
|
for (let n of e) t.add(n.codePointAt(0));
|
|
27217
27226
|
return t;
|
|
27218
27227
|
}
|
|
27219
|
-
function
|
|
27228
|
+
function vs(e) {
|
|
27220
27229
|
return {
|
|
27221
27230
|
enabled: e?.kinsoku !== !1,
|
|
27222
|
-
lineStartForbidden:
|
|
27223
|
-
lineEndForbidden:
|
|
27231
|
+
lineStartForbidden: _s(e?.noLineBreaksBefore ?? hs),
|
|
27232
|
+
lineEndForbidden: _s(e?.noLineBreaksAfter ?? gs)
|
|
27224
27233
|
};
|
|
27225
27234
|
}
|
|
27226
|
-
var
|
|
27227
|
-
function
|
|
27235
|
+
var ys = vs();
|
|
27236
|
+
function bs(e, t, n, r = 1) {
|
|
27228
27237
|
if (!n.enabled || t <= 0 || t >= e.length) return t;
|
|
27229
27238
|
let i = (t) => t < e.length && n.lineStartForbidden.has(e[t].codePointAt(0)), a = (t) => t >= 0 && n.lineEndForbidden.has(e[t].codePointAt(0)), o = t;
|
|
27230
27239
|
for (; o > r && (i(o) || a(o - 1));) o--;
|
|
27231
27240
|
return o <= r && (i(o) || a(o - 1)) ? t : o;
|
|
27232
27241
|
}
|
|
27233
|
-
function
|
|
27242
|
+
function xs(e, t, n) {
|
|
27234
27243
|
if (!t.enabled) return 0;
|
|
27235
27244
|
let r = e.length - n;
|
|
27236
27245
|
for (let n = 1; n <= r; n++) {
|
|
@@ -27241,7 +27250,7 @@ function bs(e, t, n) {
|
|
|
27241
27250
|
}
|
|
27242
27251
|
return 0;
|
|
27243
27252
|
}
|
|
27244
|
-
var
|
|
27253
|
+
var Ss = /* @__PURE__ */ "BK.CM.CR.GL.LF.NL.SP.WJ.ZW.ZWJ.AK.AL.AP.AS.B2.BA.BB.CB.CL.CP.EB.EM.EX.H2.H3.HL.HH.HY.ID.IN.IS.JL.JT.JV.NS.NU.OP.PO.PR.QU.RI.SY.VF.VI".split("."), Cs = [
|
|
27245
27254
|
0,
|
|
27246
27255
|
9,
|
|
27247
27256
|
10,
|
|
@@ -29864,7 +29873,7 @@ var xs = /* @__PURE__ */ "BK.CM.CR.GL.LF.NL.SP.WJ.ZW.ZWJ.AK.AL.AP.AS.B2.BA.BB.CB
|
|
|
29864
29873
|
917632,
|
|
29865
29874
|
917760,
|
|
29866
29875
|
918e3
|
|
29867
|
-
],
|
|
29876
|
+
], ws = [
|
|
29868
29877
|
1,
|
|
29869
29878
|
15,
|
|
29870
29879
|
4,
|
|
@@ -32487,7 +32496,7 @@ var xs = /* @__PURE__ */ "BK.CM.CR.GL.LF.NL.SP.WJ.ZW.ZWJ.AK.AL.AP.AS.B2.BA.BB.CB
|
|
|
32487
32496
|
11,
|
|
32488
32497
|
1,
|
|
32489
32498
|
11
|
|
32490
|
-
],
|
|
32499
|
+
], Ts = [
|
|
32491
32500
|
4352,
|
|
32492
32501
|
8361,
|
|
32493
32502
|
8986,
|
|
@@ -32617,7 +32626,7 @@ var xs = /* @__PURE__ */ "BK.CM.CR.GL.LF.NL.SP.WJ.ZW.ZWJ.AK.AL.AP.AS.B2.BA.BB.CB
|
|
|
32617
32626
|
129775,
|
|
32618
32627
|
131072,
|
|
32619
32628
|
196608
|
|
32620
|
-
],
|
|
32629
|
+
], Es = [
|
|
32621
32630
|
4448,
|
|
32622
32631
|
8362,
|
|
32623
32632
|
8988,
|
|
@@ -32748,35 +32757,35 @@ var xs = /* @__PURE__ */ "BK.CM.CR.GL.LF.NL.SP.WJ.ZW.ZWJ.AK.AL.AP.AS.B2.BA.BB.CB
|
|
|
32748
32757
|
196606,
|
|
32749
32758
|
262142
|
|
32750
32759
|
];
|
|
32751
|
-
function
|
|
32752
|
-
let t = 0, n =
|
|
32760
|
+
function Ds(e) {
|
|
32761
|
+
let t = 0, n = Cs.length - 1;
|
|
32753
32762
|
for (; t < n;) {
|
|
32754
32763
|
let r = t + n + 1 >> 1;
|
|
32755
|
-
|
|
32764
|
+
Cs[r] <= e ? t = r : n = r - 1;
|
|
32756
32765
|
}
|
|
32757
|
-
return
|
|
32766
|
+
return Ss[ws[t]];
|
|
32758
32767
|
}
|
|
32759
|
-
function
|
|
32760
|
-
let t = 0, n =
|
|
32761
|
-
if (n < 0 || e <
|
|
32768
|
+
function Os(e) {
|
|
32769
|
+
let t = 0, n = Ts.length - 1;
|
|
32770
|
+
if (n < 0 || e < Ts[0]) return !1;
|
|
32762
32771
|
for (; t < n;) {
|
|
32763
32772
|
let r = t + n + 1 >> 1;
|
|
32764
|
-
|
|
32773
|
+
Ts[r] <= e ? t = r : n = r - 1;
|
|
32765
32774
|
}
|
|
32766
|
-
return e <
|
|
32775
|
+
return e < Es[t];
|
|
32767
32776
|
}
|
|
32768
|
-
function
|
|
32769
|
-
let n =
|
|
32777
|
+
function ks(e, t) {
|
|
32778
|
+
let n = Ds(e);
|
|
32770
32779
|
if (n === "OP") return !0;
|
|
32771
|
-
let r =
|
|
32772
|
-
return !!(i && (a || r === "NU" || r === "PR" || r === "PO") || a && (n === "NU" || n === "PR" || n === "PO") || n === "PR" && (r === "ID" || r === "EB" || r === "EM") || (n === "ID" || n === "EB" || n === "EM") && r === "PO" || n === "NU" && (r === "NU" || r === "PO" || r === "PR") || r === "NU" && (n === "PO" || n === "PR" || n === "HY" || n === "IS") || (i || n === "NU") && r === "OP" && !
|
|
32780
|
+
let r = Ds(t), i = n === "AL" || n === "HL", a = r === "AL" || r === "HL";
|
|
32781
|
+
return !!(i && (a || r === "NU" || r === "PR" || r === "PO") || a && (n === "NU" || n === "PR" || n === "PO") || n === "PR" && (r === "ID" || r === "EB" || r === "EM") || (n === "ID" || n === "EB" || n === "EM") && r === "PO" || n === "NU" && (r === "NU" || r === "PO" || r === "PR") || r === "NU" && (n === "PO" || n === "PR" || n === "HY" || n === "IS") || (i || n === "NU") && r === "OP" && !Os(t) || n === "CP" && !Os(e) && (a || r === "NU"));
|
|
32773
32782
|
}
|
|
32774
|
-
var
|
|
32783
|
+
var As = [
|
|
32775
32784
|
"U",
|
|
32776
32785
|
"R",
|
|
32777
32786
|
"Tu",
|
|
32778
32787
|
"Tr"
|
|
32779
|
-
],
|
|
32788
|
+
], js = [
|
|
32780
32789
|
0,
|
|
32781
32790
|
167,
|
|
32782
32791
|
168,
|
|
@@ -33057,7 +33066,7 @@ var ks = [
|
|
|
33057
33066
|
1048574,
|
|
33058
33067
|
1048576,
|
|
33059
33068
|
1114110
|
|
33060
|
-
],
|
|
33069
|
+
], Ms = [
|
|
33061
33070
|
1,
|
|
33062
33071
|
0,
|
|
33063
33072
|
1,
|
|
@@ -33339,29 +33348,29 @@ var ks = [
|
|
|
33339
33348
|
0,
|
|
33340
33349
|
1
|
|
33341
33350
|
];
|
|
33342
|
-
function
|
|
33343
|
-
let t = 0, n =
|
|
33351
|
+
function Ns(e) {
|
|
33352
|
+
let t = 0, n = js.length - 1;
|
|
33344
33353
|
for (; t < n;) {
|
|
33345
33354
|
let r = t + n + 1 >> 1;
|
|
33346
|
-
|
|
33355
|
+
js[r] <= e ? t = r : n = r - 1;
|
|
33347
33356
|
}
|
|
33348
|
-
return
|
|
33349
|
-
}
|
|
33350
|
-
function Ns(e) {
|
|
33351
|
-
return ks[Ms(e)];
|
|
33357
|
+
return Ms[t];
|
|
33352
33358
|
}
|
|
33353
33359
|
function Ps(e) {
|
|
33354
|
-
return
|
|
33360
|
+
return As[Ns(e)];
|
|
33361
|
+
}
|
|
33362
|
+
function Fs(e) {
|
|
33363
|
+
return Is.get(e) ?? null;
|
|
33355
33364
|
}
|
|
33356
|
-
var
|
|
33365
|
+
var Is = new Map([
|
|
33357
33366
|
[65292, 65040],
|
|
33358
33367
|
[12289, 65041],
|
|
33359
33368
|
[12290, 65042]
|
|
33360
33369
|
]);
|
|
33361
|
-
function
|
|
33362
|
-
return
|
|
33370
|
+
function Ls(e) {
|
|
33371
|
+
return Rs.get(e) ?? null;
|
|
33363
33372
|
}
|
|
33364
|
-
var
|
|
33373
|
+
var Rs = new Map([
|
|
33365
33374
|
[65288, 65077],
|
|
33366
33375
|
[65289, 65078],
|
|
33367
33376
|
[65371, 65079],
|
|
@@ -33380,38 +33389,38 @@ var Ls = new Map([
|
|
|
33380
33389
|
[12303, 65092],
|
|
33381
33390
|
[12310, 65047],
|
|
33382
33391
|
[12311, 65048]
|
|
33383
|
-
]),
|
|
33384
|
-
function
|
|
33385
|
-
return
|
|
33392
|
+
]), zs = new Set([65307]);
|
|
33393
|
+
function Bs(e) {
|
|
33394
|
+
return zs.has(e);
|
|
33386
33395
|
}
|
|
33387
|
-
var
|
|
33396
|
+
var Vs = new Set([
|
|
33388
33397
|
12540,
|
|
33389
33398
|
12316,
|
|
33390
33399
|
65374
|
|
33391
33400
|
]);
|
|
33392
|
-
function
|
|
33393
|
-
return
|
|
33401
|
+
function Hs(e) {
|
|
33402
|
+
return Vs.has(e);
|
|
33394
33403
|
}
|
|
33395
|
-
var
|
|
33396
|
-
function
|
|
33404
|
+
var Us = 256, Ws = 200, Gs = /* @__PURE__ */ new WeakMap();
|
|
33405
|
+
function Ks(e) {
|
|
33397
33406
|
let t = e.canvas, n = t?.ownerDocument?.defaultView?.HTMLCanvasElement;
|
|
33398
33407
|
return typeof n == "function" && t instanceof n || typeof HTMLCanvasElement < "u" && t instanceof HTMLCanvasElement ? t : null;
|
|
33399
33408
|
}
|
|
33400
|
-
function
|
|
33409
|
+
function qs(e, t) {
|
|
33401
33410
|
return e.replace(/(^|\s)\d*\.?\d+(?:px|pt|pc|in|cm|mm|q|em|rem|%)(?:\/[^\s]+)?(?=\s)/i, `$1${t}`);
|
|
33402
33411
|
}
|
|
33403
|
-
function
|
|
33412
|
+
function Js(e, t = !0) {
|
|
33404
33413
|
let n = e.trim();
|
|
33405
33414
|
return [...n === "" || n.toLowerCase() === "normal" ? [] : n.split(",").map((e) => e.trim()).filter((e) => !/^(["'])vert\1(?:\s+(?:on|off|\d+))?$/i.test(e)), `"vert" ${+!!t}`].join(", ");
|
|
33406
33415
|
}
|
|
33407
|
-
function
|
|
33416
|
+
function Ys(e) {
|
|
33408
33417
|
try {
|
|
33409
33418
|
let t = e.ownerDocument?.defaultView, n = t?.getComputedStyle ? t.getComputedStyle(e) : typeof getComputedStyle == "function" ? getComputedStyle(e) : null;
|
|
33410
33419
|
if (n?.fontFeatureSettings) return n.fontFeatureSettings;
|
|
33411
33420
|
} catch {}
|
|
33412
33421
|
return e.style.fontFeatureSettings;
|
|
33413
33422
|
}
|
|
33414
|
-
function
|
|
33423
|
+
function Xs(e, t) {
|
|
33415
33424
|
if (e.isConnected) return t();
|
|
33416
33425
|
let n = e.ownerDocument ?? (typeof document > "u" ? null : document), r = n?.body ?? n?.documentElement;
|
|
33417
33426
|
if (!r) return t();
|
|
@@ -33452,15 +33461,15 @@ function Ys(e, t) {
|
|
|
33452
33461
|
if (t !== void 0 && !c) throw t;
|
|
33453
33462
|
}
|
|
33454
33463
|
}
|
|
33455
|
-
function
|
|
33456
|
-
let n =
|
|
33457
|
-
return n === null ? t() :
|
|
33464
|
+
function Zs(e, t) {
|
|
33465
|
+
let n = Ks(e);
|
|
33466
|
+
return n === null ? t() : Xs(n, t);
|
|
33458
33467
|
}
|
|
33459
|
-
function
|
|
33460
|
-
let t =
|
|
33468
|
+
function Qs(e) {
|
|
33469
|
+
let t = Gs.get(e);
|
|
33461
33470
|
if (t) return t;
|
|
33462
33471
|
let n = e.createElement("canvas");
|
|
33463
|
-
n.width =
|
|
33472
|
+
n.width = Us, n.height = Us, n.setAttribute("aria-hidden", "true"), Object.assign(n.style, {
|
|
33464
33473
|
position: "fixed",
|
|
33465
33474
|
left: "-99999px",
|
|
33466
33475
|
top: "0",
|
|
@@ -33474,9 +33483,9 @@ function Zs(e) {
|
|
|
33474
33483
|
}, i = () => {
|
|
33475
33484
|
r.epoch += 1, r.cache.clear();
|
|
33476
33485
|
};
|
|
33477
|
-
return e.fonts?.addEventListener?.("loadingdone", i), e.fonts?.addEventListener?.("loadingerror", i),
|
|
33486
|
+
return e.fonts?.addEventListener?.("loadingdone", i), e.fonts?.addEventListener?.("loadingerror", i), Gs.set(e, r), r;
|
|
33478
33487
|
}
|
|
33479
|
-
function
|
|
33488
|
+
function $s(e, t) {
|
|
33480
33489
|
let { width: n, height: r } = e.canvas, i = e.getImageData(0, 0, n, r).data, a = new Uint8ClampedArray(n * r), o = n, s = r, c = -1, l = -1, u = 0, d = 0, f = 0;
|
|
33481
33490
|
for (let e = 0; e < r; e += 1) for (let t = 0; t < n; t += 1) {
|
|
33482
33491
|
let r = i[(e * n + t) * 4 + 3];
|
|
@@ -33503,28 +33512,28 @@ function Qs(e, t) {
|
|
|
33503
33512
|
]
|
|
33504
33513
|
};
|
|
33505
33514
|
}
|
|
33506
|
-
function
|
|
33515
|
+
function ec(e, t, n) {
|
|
33507
33516
|
let r = e.canvas;
|
|
33508
33517
|
r.style.fontFeatureSettings = n, e.font = e.font, e.clearRect(0, 0, r.width, r.height);
|
|
33509
33518
|
let i = String.fromCodePoint(t);
|
|
33510
|
-
return e.fillText(i, r.width / 2, r.height / 2),
|
|
33519
|
+
return e.fillText(i, r.width / 2, r.height / 2), $s(e, i);
|
|
33511
33520
|
}
|
|
33512
|
-
function
|
|
33521
|
+
function tc(e, t) {
|
|
33513
33522
|
let n = 0, r = Math.min(e.length, t.length);
|
|
33514
33523
|
for (let i = 0; i < r; i += 1) n += Math.abs(e[i] - t[i]);
|
|
33515
33524
|
return n;
|
|
33516
33525
|
}
|
|
33517
|
-
function
|
|
33526
|
+
function nc(e, t, n, r) {
|
|
33518
33527
|
let i = (e, t, n, r) => {
|
|
33519
|
-
let i = Math.max(
|
|
33520
|
-
return Math.min(
|
|
33528
|
+
let i = Math.max(tc(e, t), tc(n, r));
|
|
33529
|
+
return Math.min(tc(e, n), tc(e, r), tc(t, n), tc(t, r)) > i;
|
|
33521
33530
|
};
|
|
33522
33531
|
return i(e.alpha, t.alpha, n.alpha, r.alpha) || i(e.geometry, t.geometry, n.geometry, r.geometry) || i(e.metrics, t.metrics, n.metrics, r.metrics);
|
|
33523
33532
|
}
|
|
33524
|
-
function
|
|
33525
|
-
let n =
|
|
33533
|
+
function rc(e, t) {
|
|
33534
|
+
let n = Ks(e);
|
|
33526
33535
|
if (n === null || typeof document > "u") return !1;
|
|
33527
|
-
let r = n.ownerDocument ?? document, i =
|
|
33536
|
+
let r = n.ownerDocument ?? document, i = Qs(r), a = Ys(n), o = `${i.epoch}:${qs(e.font, "<size>")}:${a}:${t}`, s = i.cache.get(o);
|
|
33528
33537
|
if (s !== void 0) return s;
|
|
33529
33538
|
let c = !1, l = r.body ?? r.documentElement;
|
|
33530
33539
|
if (!l) return !1;
|
|
@@ -33534,9 +33543,9 @@ function nc(e, t) {
|
|
|
33534
33543
|
if (d !== null) {
|
|
33535
33544
|
let n = i.canvas.style.fontFeatureSettings;
|
|
33536
33545
|
try {
|
|
33537
|
-
d.font =
|
|
33538
|
-
let n =
|
|
33539
|
-
c = i !== null && o !== null && s !== null && l !== null &&
|
|
33546
|
+
d.font = qs(e.font, `${Ws}px`), d.fillStyle = "#000", d.textAlign = "center", d.textBaseline = "middle";
|
|
33547
|
+
let n = Js(a, !1), r = Js(a, !0), i = ec(d, t, n), o = ec(d, t, n), s = ec(d, t, r), l = ec(d, t, r);
|
|
33548
|
+
c = i !== null && o !== null && s !== null && l !== null && nc(i, o, s, l);
|
|
33540
33549
|
} catch {
|
|
33541
33550
|
c = !1;
|
|
33542
33551
|
} finally {
|
|
@@ -33545,11 +33554,11 @@ function nc(e, t) {
|
|
|
33545
33554
|
}
|
|
33546
33555
|
return i.cache.set(o, c), c;
|
|
33547
33556
|
}
|
|
33548
|
-
function
|
|
33557
|
+
function ic(e, t) {
|
|
33549
33558
|
let n = e.canvas;
|
|
33550
|
-
return n?.style ?
|
|
33559
|
+
return n?.style ? Zs(e, () => {
|
|
33551
33560
|
let r = n.style, i = r.fontFeatureSettings;
|
|
33552
|
-
r.fontFeatureSettings =
|
|
33561
|
+
r.fontFeatureSettings = Js(Ys(n)), e.font = e.font;
|
|
33553
33562
|
try {
|
|
33554
33563
|
return t();
|
|
33555
33564
|
} finally {
|
|
@@ -33557,8 +33566,8 @@ function rc(e, t) {
|
|
|
33557
33566
|
}
|
|
33558
33567
|
}) : t();
|
|
33559
33568
|
}
|
|
33560
|
-
function
|
|
33561
|
-
return
|
|
33569
|
+
function ac(e, t) {
|
|
33570
|
+
return ic(e, () => {
|
|
33562
33571
|
let n = e.textAlign, r = e.textBaseline;
|
|
33563
33572
|
e.textAlign = "center", e.textBaseline = "middle";
|
|
33564
33573
|
try {
|
|
@@ -33575,13 +33584,13 @@ function ic(e, t) {
|
|
|
33575
33584
|
}
|
|
33576
33585
|
});
|
|
33577
33586
|
}
|
|
33578
|
-
var
|
|
33587
|
+
var oc = [
|
|
33579
33588
|
"http",
|
|
33580
33589
|
"https",
|
|
33581
33590
|
"mailto",
|
|
33582
33591
|
"tel"
|
|
33583
33592
|
];
|
|
33584
|
-
function
|
|
33593
|
+
function sc(e) {
|
|
33585
33594
|
let t = "";
|
|
33586
33595
|
for (let n of e) {
|
|
33587
33596
|
let e = n.codePointAt(0);
|
|
@@ -33590,28 +33599,28 @@ function oc(e) {
|
|
|
33590
33599
|
let n = /^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(t);
|
|
33591
33600
|
return n ? n[1].toLowerCase() : null;
|
|
33592
33601
|
}
|
|
33593
|
-
function
|
|
33602
|
+
function cc(e, t = oc) {
|
|
33594
33603
|
if (e === "") return null;
|
|
33595
|
-
let n =
|
|
33604
|
+
let n = sc(e);
|
|
33596
33605
|
return n === null || t.includes(n) ? e : null;
|
|
33597
33606
|
}
|
|
33598
|
-
function
|
|
33599
|
-
let r =
|
|
33607
|
+
function lc(e, t = oc, n = typeof window < "u" ? window : void 0) {
|
|
33608
|
+
let r = cc(e, t);
|
|
33600
33609
|
return r === null || !n ? !1 : (n.open(r, "_blank", "noopener,noreferrer"), !0);
|
|
33601
33610
|
}
|
|
33602
|
-
var
|
|
33603
|
-
function
|
|
33611
|
+
var uc = 1.3;
|
|
33612
|
+
function dc(e, t) {
|
|
33604
33613
|
if (e == null || t == null || !Number.isFinite(e) || !Number.isFinite(t) || e < 0 || t < 0 || e + t <= 0) return null;
|
|
33605
|
-
let n = (
|
|
33614
|
+
let n = (uc - 1) / 2 * (e + t);
|
|
33606
33615
|
return {
|
|
33607
33616
|
ascent: e + n,
|
|
33608
33617
|
descent: t + n
|
|
33609
33618
|
};
|
|
33610
33619
|
}
|
|
33611
|
-
function
|
|
33620
|
+
function fc(e) {
|
|
33612
33621
|
let { unitsPerEm: t, hheaAscent: n, hheaDescent: r, hheaLineGap: i, farEastCodePage: a } = e;
|
|
33613
33622
|
if (!(Number.isFinite(t) && t > 0 && Number.isFinite(n) && n >= 0 && Number.isFinite(r) && r <= 0 && Number.isFinite(i)) || !(n - r > 0)) return null;
|
|
33614
|
-
let o = a ?
|
|
33623
|
+
let o = a ? dc(e.winAscent, e.winDescent) : {
|
|
33615
33624
|
ascent: n + i,
|
|
33616
33625
|
descent: -r
|
|
33617
33626
|
};
|
|
@@ -33623,7 +33632,7 @@ function dc(e) {
|
|
|
33623
33632
|
designDescentRatio: c / t
|
|
33624
33633
|
}) : null;
|
|
33625
33634
|
}
|
|
33626
|
-
function
|
|
33635
|
+
function pc(e) {
|
|
33627
33636
|
let { faceSource: t, unitsPerEm: n, hhea: r, win: i, typoMetrics: a, farEastCodePage: o } = e, s = [
|
|
33628
33637
|
n,
|
|
33629
33638
|
...r,
|
|
@@ -33636,7 +33645,7 @@ function fc(e) {
|
|
|
33636
33645
|
if (o) return null;
|
|
33637
33646
|
p = c + Math.max(0, u), m = -l;
|
|
33638
33647
|
} else if (o) {
|
|
33639
|
-
let e =
|
|
33648
|
+
let e = dc(d, f);
|
|
33640
33649
|
if (!e) return null;
|
|
33641
33650
|
({ascent: p, descent: m} = e);
|
|
33642
33651
|
} else if (a) p = a[0] + Math.max(0, a[2]), m = -a[1];
|
|
@@ -33649,14 +33658,14 @@ function fc(e) {
|
|
|
33649
33658
|
descentRatio: m / n
|
|
33650
33659
|
}) : null;
|
|
33651
33660
|
}
|
|
33652
|
-
var
|
|
33661
|
+
var mc = (e) => {
|
|
33653
33662
|
let t = e.text;
|
|
33654
33663
|
return typeof t == "string" ? t : void 0;
|
|
33655
33664
|
};
|
|
33656
|
-
function
|
|
33657
|
-
return e.some((e) => t.isRtlMarked?.(e) || n(
|
|
33665
|
+
function hc(e, t = {}) {
|
|
33666
|
+
return e.some((e) => t.isRtlMarked?.(e) || n(mc(e) ?? ""));
|
|
33658
33667
|
}
|
|
33659
|
-
function
|
|
33668
|
+
function gc(e, n, r = {}) {
|
|
33660
33669
|
let i = e.length;
|
|
33661
33670
|
if (i === 0) return {
|
|
33662
33671
|
order: [],
|
|
@@ -33664,7 +33673,7 @@ function hc(e, n, r = {}) {
|
|
|
33664
33673
|
};
|
|
33665
33674
|
let a = "", o = Array(i), s = Array(i), c;
|
|
33666
33675
|
for (let t = 0; t < i; t++) {
|
|
33667
|
-
let n = e[t], i =
|
|
33676
|
+
let n = e[t], i = mc(n) ?? "", l = r.digitsAsAN?.(n) === !0, u = r.isRtlMarked?.(n) === !0;
|
|
33668
33677
|
if (o[t] = a.length, a += i.length > 0 ? i : "", s[t] = a.length, r.isTab?.(n)) (c ??= [])[o[t]] = "S";
|
|
33669
33678
|
else if (i.length > 0 && (l || u)) {
|
|
33670
33679
|
let e = c ??= [];
|
|
@@ -33698,13 +33707,13 @@ function hc(e, n, r = {}) {
|
|
|
33698
33707
|
rtl: d
|
|
33699
33708
|
};
|
|
33700
33709
|
}
|
|
33701
|
-
function
|
|
33710
|
+
function _c(e, t) {
|
|
33702
33711
|
if (!Number.isSafeInteger(e) || e <= 0) throw TypeError(`${t} must be a positive safe integer`);
|
|
33703
33712
|
}
|
|
33704
|
-
function
|
|
33713
|
+
function vc(e) {
|
|
33705
33714
|
if (!Number.isSafeInteger(e) || e < 0) throw TypeError("cache entry weight must be a non-negative safe integer");
|
|
33706
33715
|
}
|
|
33707
|
-
var
|
|
33716
|
+
var yc = class {
|
|
33708
33717
|
#e;
|
|
33709
33718
|
#t;
|
|
33710
33719
|
#n;
|
|
@@ -33713,7 +33722,7 @@ var vc = class {
|
|
|
33713
33722
|
#a = /* @__PURE__ */ new Map();
|
|
33714
33723
|
#o = 0;
|
|
33715
33724
|
constructor(e) {
|
|
33716
|
-
|
|
33725
|
+
_c(e.maxEntries, "maxEntries"), _c(e.maxWeight, "maxWeight"), this.#e = e.maxEntries, this.#t = e.maxWeight, this.#n = e.measure, this.#r = e.onRemove;
|
|
33717
33726
|
}
|
|
33718
33727
|
get usage() {
|
|
33719
33728
|
return {
|
|
@@ -33759,7 +33768,7 @@ var vc = class {
|
|
|
33759
33768
|
if (this.#a.get(e)?.token !== t) return n;
|
|
33760
33769
|
let r;
|
|
33761
33770
|
try {
|
|
33762
|
-
r = this.#n(n),
|
|
33771
|
+
r = this.#n(n), vc(r);
|
|
33763
33772
|
} catch (n) {
|
|
33764
33773
|
throw this.#s(e, t), n;
|
|
33765
33774
|
}
|
|
@@ -33783,10 +33792,10 @@ var vc = class {
|
|
|
33783
33792
|
this.#r?.(e, t, n);
|
|
33784
33793
|
} catch {}
|
|
33785
33794
|
}
|
|
33786
|
-
},
|
|
33795
|
+
}, bc = class {
|
|
33787
33796
|
#e;
|
|
33788
33797
|
constructor(e) {
|
|
33789
|
-
this.#e = new
|
|
33798
|
+
this.#e = new yc({
|
|
33790
33799
|
maxEntries: e.maxEntries,
|
|
33791
33800
|
maxWeight: e.maxBytes,
|
|
33792
33801
|
measure: (e) => e.size
|
|
@@ -33814,4 +33823,4 @@ var vc = class {
|
|
|
33814
33823
|
this.#e.clear();
|
|
33815
33824
|
}
|
|
33816
33825
|
};
|
|
33817
|
-
export {
|
|
33826
|
+
export { wa as $, _t as $t, Qo as A, Ce as An, wn as At, to as B, tn as Bt, bs as C, Je as Cn, Xn as Ct, Q as D, Ne as Dn, Mn as Dt, fs as E, Oe as En, Pn as Et, Bo as F, Sn as Ft, Co as G, Ht as Gt, ho as H, $t as Ht, jo as I, bn as It, qa as J, Nt as Jt, go as K, Bt as Kt, No as L, an as Lt, $o as M, xn as Mt, zo as N, yn as Nt, ms as O, Pe as On, Fn as Ot, Ro as P, fn as Pt, Pa as Q, ot as Qt, Mo as R, on as Rt, xs as S, qe as Sn, Yn as St, vs as T, Me as Tn, Kn as Tt, xo as U, Zt as Ut, ko as V, en as Vt, mo as W, Ut as Wt, La as X, Lt as Xt, Ra as Y, Ft as Yt, Ia as Z, O as Zt, Ps as _, Xe as _n, lr as _t, uc as a, D as an, Mi as at, ks as b, Ye as bn, Zn as bt, oc as c, nt as cn, _r as ct, ac as d, et as dn, Qr as dt, bt as en, ta as et, rc as f, Ue as fn, Sr as ft, Fs as g, $e as gn, Er as gt, Ls as h, We as hn, qr as ht, hc as i, it as in, ki as it, es as j, Se as jn, mn as jt, ps as k, Te as kn, Gn as kt, sc as l, ze as ln, ti as lt, Zs as m, Ve as mn, kr as mt, yc as n, ct as nn, Xi as nt, pc as o, ht as on, oi as ot, ic as p, He as pn, ei as pt, Ga as q, Vt as qt, gc as r, st as rn, Ai as rt, fc as s, tt as sn, ai as st, bc as t, xt as tn, na as tt, lc as u, Be as un, $r as ut, Hs as v, Ze as vn, er as vt, ys as w, Ge as wn, qn as wt, Ds as x, Ke as xn, Jn as xt, Bs as y, Qe as yn, ir as yt, Ao as z, Qt as zt };
|