@component-hook/pdf-canvas 1.1.0-alpha.5 → 1.1.0-alpha.6
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/vue/pdf-canvas.es.js +108 -108
- package/dist/vue/pdf-canvas.umd.js +41 -41
- package/package.json +1 -1
|
@@ -2045,9 +2045,9 @@ let Mi = class cu extends i_ {
|
|
|
2045
2045
|
toObject() {
|
|
2046
2046
|
const t = (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []).concat(cu.customProperties, this.constructor.customProperties || []);
|
|
2047
2047
|
let e;
|
|
2048
|
-
const s = ot.NUM_FRACTION_DIGITS, { clipPath: i, fill: n, stroke: r, shadow: o, strokeDashArray: h, left: c, top: u, originX: d, originY: g, width: f, height: p, strokeWidth: b, strokeLineCap: y, strokeDashOffset: _, strokeLineJoin: x, strokeUniform: C, strokeMiterLimit: S, scaleX: k, scaleY: D, angle: A, flipX: M, flipY: O, opacity: R, visible: L, backgroundColor:
|
|
2048
|
+
const s = ot.NUM_FRACTION_DIGITS, { clipPath: i, fill: n, stroke: r, shadow: o, strokeDashArray: h, left: c, top: u, originX: d, originY: g, width: f, height: p, strokeWidth: b, strokeLineCap: y, strokeDashOffset: _, strokeLineJoin: x, strokeUniform: C, strokeMiterLimit: S, scaleX: k, scaleY: D, angle: A, flipX: M, flipY: O, opacity: R, visible: L, backgroundColor: V, fillRule: U, paintFirst: G, globalCompositeOperation: rt, skewX: F, skewY: z } = this;
|
|
2049
2049
|
i && !i.excludeFromExport && (e = i.toObject(t.concat("inverted", "absolutePositioned")));
|
|
2050
|
-
const it = (Wt) => Ct(Wt, s), Rt = T(T({}, No(this, t)), {}, { type: this.constructor.type, version: Cg, originX: d, originY: g, left: it(c), top: it(u), width: it(f), height: it(p), fill: $p(n) ? n.toObject() : n, stroke: $p(r) ? r.toObject() : r, strokeWidth: it(b), strokeDashArray: h && h.concat(), strokeLineCap: y, strokeDashOffset: _, strokeLineJoin: x, strokeUniform: C, strokeMiterLimit: it(S), scaleX: it(k), scaleY: it(D), angle: it(A), flipX: M, flipY: O, opacity: it(R), shadow: o && o.toObject(), visible: L, backgroundColor:
|
|
2050
|
+
const it = (Wt) => Ct(Wt, s), Rt = T(T({}, No(this, t)), {}, { type: this.constructor.type, version: Cg, originX: d, originY: g, left: it(c), top: it(u), width: it(f), height: it(p), fill: $p(n) ? n.toObject() : n, stroke: $p(r) ? r.toObject() : r, strokeWidth: it(b), strokeDashArray: h && h.concat(), strokeLineCap: y, strokeDashOffset: _, strokeLineJoin: x, strokeUniform: C, strokeMiterLimit: it(S), scaleX: it(k), scaleY: it(D), angle: it(A), flipX: M, flipY: O, opacity: it(R), shadow: o && o.toObject(), visible: L, backgroundColor: V, fillRule: U, paintFirst: G, globalCompositeOperation: rt, skewX: it(F), skewY: it(z) }, e ? { clipPath: e } : null);
|
|
2051
2051
|
return this.includeDefaultValues ? Rt : this._removeDefaultValues(Rt);
|
|
2052
2052
|
}
|
|
2053
2053
|
toDatalessObject(t) {
|
|
@@ -2203,8 +2203,8 @@ function k0(a, t, e, s, i) {
|
|
|
2203
2203
|
if ($s(n, h)) return !1;
|
|
2204
2204
|
const { origin: d, flip: g } = ag[r], f = Gt(e[d]) * (n[g] ? -1 : 1), p = -Math.sign(f) * (n[u] ? -1 : 1), b = 0.5 * -((n[c] === 0 && gp(e, K, K, s, i)[a] > 0 || n[c] > 0 ? 1 : -1) * p) + 0.5;
|
|
2205
2205
|
return bh(Zm, vh((_, x, C, S) => function(k, D, A) {
|
|
2206
|
-
let { target: M, ex: O, ey: R, skewingSide: L } = D,
|
|
2207
|
-
const { skew: U } = ag[k], G = A.subtract(new P(O, R)).divide(new P(M.scaleX, M.scaleY))[k], rt = M[U], F =
|
|
2206
|
+
let { target: M, ex: O, ey: R, skewingSide: L } = D, V = At(D, g_);
|
|
2207
|
+
const { skew: U } = ag[k], G = A.subtract(new P(O, R)).divide(new P(M.scaleX, M.scaleY))[k], rt = M[U], F = V[U], z = Math.tan(Ot(F)), it = k === "y" ? M._getTransformedDimensions({ scaleX: 1, scaleY: 1, skewX: 0 }).x : M._getTransformedDimensions({ scaleX: 1, scaleY: 1 }).y, Rt = 2 * G * L / Math.max(it, 1) + z, Wt = rr(Math.atan(Rt));
|
|
2208
2208
|
M.set(U, Wt);
|
|
2209
2209
|
const ne = rt !== M[U];
|
|
2210
2210
|
if (ne && k === "y") {
|
|
@@ -3085,12 +3085,12 @@ const K_ = (a, t, e) => {
|
|
|
3085
3085
|
const d = ((g, f, p, b, y, _, x) => {
|
|
3086
3086
|
if (p === 0 || b === 0) return [];
|
|
3087
3087
|
let C = 0, S = 0, k = 0;
|
|
3088
|
-
const D = Math.PI, A = x * ep, M = Ks(A), O = qs(A), R = 0.5 * (-O * g - M * f), L = 0.5 * (-O * f + M * g),
|
|
3088
|
+
const D = Math.PI, A = x * ep, M = Ks(A), O = qs(A), R = 0.5 * (-O * g - M * f), L = 0.5 * (-O * f + M * g), V = p ** 2, U = b ** 2, G = L ** 2, rt = R ** 2, F = V * U - V * G - U * rt;
|
|
3089
3089
|
let z = Math.abs(p), it = Math.abs(b);
|
|
3090
3090
|
if (F < 0) {
|
|
3091
|
-
const ei = Math.sqrt(1 - F / (
|
|
3091
|
+
const ei = Math.sqrt(1 - F / (V * U));
|
|
3092
3092
|
z *= ei, it *= ei;
|
|
3093
|
-
} else k = (y === _ ? -1 : 1) * Math.sqrt(F / (
|
|
3093
|
+
} else k = (y === _ ? -1 : 1) * Math.sqrt(F / (V * G + U * rt));
|
|
3094
3094
|
const Rt = k * z * L / it, Wt = -k * it * R / z, ne = O * Rt - M * Wt + 0.5 * g, Bt = M * Rt + O * Wt + 0.5 * f;
|
|
3095
3095
|
let yt = bm(1, 0, (R - Rt) / z, (L - Wt) / it), Ce = bm((R - Rt) / z, (L - Wt) / it, (-R - Rt) / z, (-L - Wt) / it);
|
|
3096
3096
|
_ === 0 && Ce > 0 ? Ce -= 2 * D : _ === 1 && Ce < 0 && (Ce += 2 * D);
|
|
@@ -4881,11 +4881,11 @@ class ve extends lb {
|
|
|
4881
4881
|
for (let M = 0, O = d.length; M < O; M++) {
|
|
4882
4882
|
const R = this.__charBounds[h][M];
|
|
4883
4883
|
p = this.getValueOfPropertyAt(h, M, e), b = this.getValueOfPropertyAt(h, M, Vt);
|
|
4884
|
-
const L = this.getHeightOfChar(h, M),
|
|
4885
|
-
if (n && p && b) t.save(), t.fillStyle = C, t.translate(R.renderLeft, R.renderTop), t.rotate(R.angle), t.fillRect(-R.kernedWidth / 2, o * L +
|
|
4886
|
-
else if ((p !== x || b !== C || L !== k ||
|
|
4884
|
+
const L = this.getHeightOfChar(h, M), V = this.getValueOfPropertyAt(h, M, "deltaY");
|
|
4885
|
+
if (n && p && b) t.save(), t.fillStyle = C, t.translate(R.renderLeft, R.renderTop), t.rotate(R.angle), t.fillRect(-R.kernedWidth / 2, o * L + V, R.kernedWidth, this.fontSize / 15), t.restore();
|
|
4886
|
+
else if ((p !== x || b !== C || L !== k || V !== D) && _ > 0) {
|
|
4887
4887
|
let U = i + f + y;
|
|
4888
|
-
this.direction === "rtl" && (U = this.width - U - _), x && C && (t.fillStyle = C, t.fillRect(U, S + o * k + D, _, this.fontSize / 15)), y = R.left, _ = R.width, x = p, C = b, k = L, D =
|
|
4888
|
+
this.direction === "rtl" && (U = this.width - U - _), x && C && (t.fillStyle = C, t.fillRect(U, S + o * k + D, _, this.fontSize / 15)), y = R.left, _ = R.width, x = p, C = b, k = L, D = V;
|
|
4889
4889
|
} else _ += R.kernedWidth;
|
|
4890
4890
|
}
|
|
4891
4891
|
let A = i + f + y;
|
|
@@ -6317,20 +6317,20 @@ async function Ww(a, t) {
|
|
|
6317
6317
|
if (fg(x), /^svg$/i.test(x.nodeName)) {
|
|
6318
6318
|
const O = x.ownerDocument.createElementNS(Mg, "g");
|
|
6319
6319
|
Object.entries(S).forEach((R) => {
|
|
6320
|
-
let [L,
|
|
6321
|
-
return O.setAttributeNS(Mg, L,
|
|
6320
|
+
let [L, V] = R;
|
|
6321
|
+
return O.setAttributeNS(Mg, L, V);
|
|
6322
6322
|
}), O.append(...x.childNodes), x = O;
|
|
6323
6323
|
}
|
|
6324
6324
|
for (const O of p) {
|
|
6325
6325
|
if (!O) continue;
|
|
6326
6326
|
const { name: R, value: L } = O;
|
|
6327
6327
|
if (!g.includes(R)) if (R === "style") {
|
|
6328
|
-
const
|
|
6329
|
-
Og(L,
|
|
6328
|
+
const V = {};
|
|
6329
|
+
Og(L, V), Object.entries(S).forEach((G) => {
|
|
6330
6330
|
let [rt, F] = G;
|
|
6331
|
-
|
|
6332
|
-
}), Og(S.style || "",
|
|
6333
|
-
const U = Object.entries(
|
|
6331
|
+
V[rt] = F;
|
|
6332
|
+
}), Og(S.style || "", V);
|
|
6333
|
+
const U = Object.entries(V).map((G) => G.join(":")).join(";");
|
|
6334
6334
|
x.setAttribute(R, U);
|
|
6335
6335
|
} else !S[R] && x.setAttribute(R, L);
|
|
6336
6336
|
}
|
|
@@ -7351,13 +7351,13 @@ class su extends Qt {
|
|
|
7351
7351
|
lanczosResize(t, e, s, i, n) {
|
|
7352
7352
|
const r = t.imageData.data, o = t.ctx.createImageData(i, n), h = o.data, c = this.lanczosCreate(this.lanczosLobes), u = this.rcpScaleX, d = this.rcpScaleY, g = 2 / this.rcpScaleX, f = 2 / this.rcpScaleY, p = Math.ceil(u * this.lanczosLobes / 2), b = Math.ceil(d * this.lanczosLobes / 2), y = {}, _ = { x: 0, y: 0 }, x = { x: 0, y: 0 };
|
|
7353
7353
|
return function C(S) {
|
|
7354
|
-
let k, D, A, M, O, R, L,
|
|
7354
|
+
let k, D, A, M, O, R, L, V, U, G, rt;
|
|
7355
7355
|
for (_.x = (S + 0.5) * u, x.x = Math.floor(_.x), k = 0; k < n; k++) {
|
|
7356
|
-
for (_.y = (k + 0.5) * d, x.y = Math.floor(_.y), O = 0, R = 0, L = 0,
|
|
7356
|
+
for (_.y = (k + 0.5) * d, x.y = Math.floor(_.y), O = 0, R = 0, L = 0, V = 0, U = 0, D = x.x - p; D <= x.x + p; D++) if (!(D < 0 || D >= e)) {
|
|
7357
7357
|
G = Math.floor(1e3 * Math.abs(D - _.x)), y[G] || (y[G] = {});
|
|
7358
|
-
for (let F = x.y - b; F <= x.y + b; F++) F < 0 || F >= s || (rt = Math.floor(1e3 * Math.abs(F - _.y)), y[G][rt] || (y[G][rt] = c(Math.sqrt(Math.pow(G * g, 2) + Math.pow(rt * f, 2)) / 1e3)), A = y[G][rt], A > 0 && (M = 4 * (F * e + D), O += A, R += A * r[M], L += A * r[M + 1],
|
|
7358
|
+
for (let F = x.y - b; F <= x.y + b; F++) F < 0 || F >= s || (rt = Math.floor(1e3 * Math.abs(F - _.y)), y[G][rt] || (y[G][rt] = c(Math.sqrt(Math.pow(G * g, 2) + Math.pow(rt * f, 2)) / 1e3)), A = y[G][rt], A > 0 && (M = 4 * (F * e + D), O += A, R += A * r[M], L += A * r[M + 1], V += A * r[M + 2], U += A * r[M + 3]));
|
|
7359
7359
|
}
|
|
7360
|
-
M = 4 * (k * i + S), h[M] = R / O, h[M + 1] = L / O, h[M + 2] =
|
|
7360
|
+
M = 4 * (k * i + S), h[M] = R / O, h[M + 1] = L / O, h[M + 2] = V / O, h[M + 3] = U / O;
|
|
7361
7361
|
}
|
|
7362
7362
|
return ++S < i ? C(S) : o;
|
|
7363
7363
|
}(0);
|
|
@@ -7376,10 +7376,10 @@ class su extends Qt {
|
|
|
7376
7376
|
const A = (f + 0.5) * o;
|
|
7377
7377
|
for (let M = Math.floor(f * o); M < (f + 1) * o; M++) {
|
|
7378
7378
|
const O = Math.abs(A - (M + 0.5)) / c, R = (p + 0.5) * r, L = O * O;
|
|
7379
|
-
for (let
|
|
7380
|
-
let U = Math.abs(R - (
|
|
7379
|
+
for (let V = Math.floor(p * r); V < (p + 1) * r; V++) {
|
|
7380
|
+
let U = Math.abs(R - (V + 0.5)) / h;
|
|
7381
7381
|
const G = Math.sqrt(L + U * U);
|
|
7382
|
-
G > 1 && G < -1 || (y = 2 * G * G * G - 3 * G * G + 1, y > 0 && (U = 4 * (
|
|
7382
|
+
G > 1 && G < -1 || (y = 2 * G * G * G - 3 * G * G + 1, y > 0 && (U = 4 * (V + M * e), D += y * u[U + 3], x += y, u[U + 3] < 255 && (y = y * u[U + 3] / 250), C += y * u[U], S += y * u[U + 1], k += y * u[U + 2], _ += y));
|
|
7383
7383
|
}
|
|
7384
7384
|
}
|
|
7385
7385
|
g[b] = C / _, g[b + 1] = S / _, g[b + 2] = k / _, g[b + 3] = D / x;
|
|
@@ -10906,10 +10906,10 @@ Ir = new WeakMap(), Fs = new WeakMap(), _t = new WeakMap(), ma = new WeakMap(),
|
|
|
10906
10906
|
const F = Math.hypot(o, h);
|
|
10907
10907
|
M = O = Math.max(Math.min(Math.hypot(S[0] - C[0] - R, S[1] - C[1] - L) / F, 1 / o, 1 / h), c / o, u / h);
|
|
10908
10908
|
} else x ? M = Math.max(c, Math.min(1, Math.abs(S[0] - C[0] - R))) / o : O = Math.max(u, Math.min(1, Math.abs(S[1] - C[1] - L))) / h;
|
|
10909
|
-
const
|
|
10910
|
-
k = g(...y(
|
|
10909
|
+
const V = tt._round(o * M), U = tt._round(h * O);
|
|
10910
|
+
k = g(...y(V, U));
|
|
10911
10911
|
const G = D - k[0], rt = A - k[1];
|
|
10912
|
-
l(this, Je) || m(this, Je, [this.x, this.y, this.width, this.height]), this.width =
|
|
10912
|
+
l(this, Je) || m(this, Je, [this.x, this.y, this.width, this.height]), this.width = V, this.height = U, this.x = G, this.y = rt, this.setDims(s * V, i * U), this.fixAndSetPosition(), this._onResizing();
|
|
10913
10913
|
}, Hb = function() {
|
|
10914
10914
|
var t;
|
|
10915
10915
|
m(this, zi, {
|
|
@@ -11919,10 +11919,10 @@ class Px extends sv {
|
|
|
11919
11919
|
const D = new Array(256), A = (g - d) / k, M = C / 255, O = (S - C) / (255 * k);
|
|
11920
11920
|
let R = 0;
|
|
11921
11921
|
for (let L = 0; L <= k; L++) {
|
|
11922
|
-
const
|
|
11923
|
-
for (let G = R; G <=
|
|
11922
|
+
const V = Math.round(d + L * A), U = M + L * O;
|
|
11923
|
+
for (let G = R; G <= V; G++)
|
|
11924
11924
|
D[G] = U;
|
|
11925
|
-
R =
|
|
11925
|
+
R = V + 1;
|
|
11926
11926
|
}
|
|
11927
11927
|
for (let L = R; L < 256; L++)
|
|
11928
11928
|
D[L] = D[R - 1];
|
|
@@ -12085,9 +12085,9 @@ function wg(a, t, e, s, i, n, r, o) {
|
|
|
12085
12085
|
const f = (h[e] + t.offsetX) * t.scaleX, p = (h[e + 1] + t.offsetY) * t.scaleY, b = (h[s] + t.offsetX) * t.scaleX, y = (h[s + 1] + t.offsetY) * t.scaleY, _ = (h[i] + t.offsetX) * t.scaleX, x = (h[i + 1] + t.offsetY) * t.scaleY;
|
|
12086
12086
|
if (p >= x)
|
|
12087
12087
|
return;
|
|
12088
|
-
const C = c[n], S = c[n + 1], k = c[n + 2], D = c[r], A = c[r + 1], M = c[r + 2], O = c[o], R = c[o + 1], L = c[o + 2],
|
|
12088
|
+
const C = c[n], S = c[n + 1], k = c[n + 2], D = c[r], A = c[r + 1], M = c[r + 2], O = c[o], R = c[o + 1], L = c[o + 2], V = Math.round(p), U = Math.round(x);
|
|
12089
12089
|
let G, rt, F, z, it, Rt, Wt, ne;
|
|
12090
|
-
for (let Bt =
|
|
12090
|
+
for (let Bt = V; Bt <= U; Bt++) {
|
|
12091
12091
|
if (Bt < y) {
|
|
12092
12092
|
const ct = Bt < p ? 0 : (p - Bt) / (p - y);
|
|
12093
12093
|
G = f - (f - b) * ct, rt = C - (C - D) * ct, F = S - (S - A) * ct, z = k - (k - M) * ct;
|
|
@@ -12205,8 +12205,8 @@ const Dm = {
|
|
|
12205
12205
|
let S = p, k = b, D = !1, A = !1;
|
|
12206
12206
|
const M = Math.ceil(h * x), O = Math.ceil(c * C), R = Math.ceil(p * x), L = Math.ceil(b * C);
|
|
12207
12207
|
M >= R ? S = h : D = !0, O >= L ? k = c : A = !0;
|
|
12208
|
-
const
|
|
12209
|
-
if (F.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext(F, i, r), rt.translate(-
|
|
12208
|
+
const V = this.getSizeAndScale(S, this.ctx.canvas.width, x), U = this.getSizeAndScale(k, this.ctx.canvas.height, C), G = t.cachedCanvases.getCanvas("pattern", V.size, U.size), rt = G.context, F = o.createCanvasGraphics(rt);
|
|
12209
|
+
if (F.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext(F, i, r), rt.translate(-V.scale * u, -U.scale * d), F.transform(V.scale, 0, 0, U.scale, 0, 0), rt.save(), this.clipBbox(F, u, d, g, f), F.baseTransform = xt(F.ctx), F.executeOperatorList(s), F.endDrawing(), rt.restore(), D || A) {
|
|
12210
12210
|
const z = G.canvas;
|
|
12211
12211
|
D && (S = h), A && (k = c);
|
|
12212
12212
|
const it = this.getSizeAndScale(S, this.ctx.canvas.width, x), Rt = this.getSizeAndScale(k, this.ctx.canvas.height, C), Wt = it.size, ne = Rt.size, Bt = t.cachedCanvases.getCanvas("pattern-workaround", Wt, ne), yt = Bt.context, Ce = D ? Math.floor(p / h) : 0, ti = A ? Math.floor(b / c) : 0;
|
|
@@ -12223,7 +12223,7 @@ const Dm = {
|
|
|
12223
12223
|
}
|
|
12224
12224
|
return {
|
|
12225
12225
|
canvas: G.canvas,
|
|
12226
|
-
scaleX:
|
|
12226
|
+
scaleX: V.scale,
|
|
12227
12227
|
scaleY: U.scale,
|
|
12228
12228
|
offsetX: u,
|
|
12229
12229
|
offsetY: d
|
|
@@ -13008,24 +13008,24 @@ const Ip = class Ip {
|
|
|
13008
13008
|
}
|
|
13009
13009
|
let M = !1;
|
|
13010
13010
|
const O = (A.isSpace ? h : 0) + o, R = A.fontChar, L = A.accent;
|
|
13011
|
-
let
|
|
13011
|
+
let V, U, G = A.width;
|
|
13012
13012
|
if (g) {
|
|
13013
13013
|
const F = A.vmetric || p, z = -(A.vmetric ? F[1] : G * 0.5) * b, it = F[2] * b;
|
|
13014
|
-
G = F ? -F[0] : G,
|
|
13014
|
+
G = F ? -F[0] : G, V = z / r, U = (k + it) / r;
|
|
13015
13015
|
} else
|
|
13016
|
-
|
|
13016
|
+
V = k / r, U = 0;
|
|
13017
13017
|
if (s.remeasure && G > 0) {
|
|
13018
13018
|
const F = n.measureText(R).width * 1e3 / i * r;
|
|
13019
13019
|
if (G < F && this.isFontSubpixelAAEnabled) {
|
|
13020
13020
|
const z = G / F;
|
|
13021
|
-
M = !0, n.save(), n.scale(z, 1),
|
|
13022
|
-
} else G !== F && (
|
|
13021
|
+
M = !0, n.save(), n.scale(z, 1), V /= z;
|
|
13022
|
+
} else G !== F && (V += (G - F) / 2e3 * i / r);
|
|
13023
13023
|
}
|
|
13024
13024
|
if (this.contentVisible && (A.isInFont || s.missingFile)) {
|
|
13025
13025
|
if (y && !L)
|
|
13026
|
-
n.fillText(R,
|
|
13027
|
-
else if (this.paintChar(R,
|
|
13028
|
-
const F =
|
|
13026
|
+
n.fillText(R, V, U);
|
|
13027
|
+
else if (this.paintChar(R, V, U, _, x), L) {
|
|
13028
|
+
const F = V + i * L.offset.x / r, z = U - i * L.offset.y / r;
|
|
13029
13029
|
this.paintChar(L.fontChar, F, z, _, x);
|
|
13030
13030
|
}
|
|
13031
13031
|
}
|
|
@@ -14848,7 +14848,7 @@ function xS(a = {}) {
|
|
|
14848
14848
|
docId: e
|
|
14849
14849
|
} = t, s = a.url ? SS(a.url) : null, i = a.data ? CS(a.data) : null, n = a.httpHeaders || null, r = a.withCredentials === !0, o = a.password ?? null, h = a.range instanceof bv ? a.range : null, c = Number.isInteger(a.rangeChunkSize) && a.rangeChunkSize > 0 ? a.rangeChunkSize : pS;
|
|
14850
14850
|
let u = a.worker instanceof na ? a.worker : null;
|
|
14851
|
-
const d = a.verbosity, g = typeof a.docBaseUrl == "string" && !qd(a.docBaseUrl) ? a.docBaseUrl : null, f = typeof a.cMapUrl == "string" ? a.cMapUrl : null, p = a.cMapPacked !== !1, b = a.CMapReaderFactory || yS, y = typeof a.standardFontDataUrl == "string" ? a.standardFontDataUrl : null, _ = a.StandardFontDataFactory || wS, x = a.stopAtErrors !== !0, C = Number.isInteger(a.maxImageSize) && a.maxImageSize > -1 ? a.maxImageSize : -1, S = a.isEvalSupported !== !1, k = typeof a.isOffscreenCanvasSupported == "boolean" ? a.isOffscreenCanvasSupported : !xe, D = typeof a.isImageDecoderSupported == "boolean" ? a.isImageDecoderSupported : !xe && (Fe.platform.isFirefox || !globalThis.chrome), A = Number.isInteger(a.canvasMaxAreaInBytes) ? a.canvasMaxAreaInBytes : -1, M = typeof a.disableFontFace == "boolean" ? a.disableFontFace : xe, O = a.fontExtraProperties === !0, R = a.enableXfa === !0, L = a.ownerDocument || globalThis.document,
|
|
14851
|
+
const d = a.verbosity, g = typeof a.docBaseUrl == "string" && !qd(a.docBaseUrl) ? a.docBaseUrl : null, f = typeof a.cMapUrl == "string" ? a.cMapUrl : null, p = a.cMapPacked !== !1, b = a.CMapReaderFactory || yS, y = typeof a.standardFontDataUrl == "string" ? a.standardFontDataUrl : null, _ = a.StandardFontDataFactory || wS, x = a.stopAtErrors !== !0, C = Number.isInteger(a.maxImageSize) && a.maxImageSize > -1 ? a.maxImageSize : -1, S = a.isEvalSupported !== !1, k = typeof a.isOffscreenCanvasSupported == "boolean" ? a.isOffscreenCanvasSupported : !xe, D = typeof a.isImageDecoderSupported == "boolean" ? a.isImageDecoderSupported : !xe && (Fe.platform.isFirefox || !globalThis.chrome), A = Number.isInteger(a.canvasMaxAreaInBytes) ? a.canvasMaxAreaInBytes : -1, M = typeof a.disableFontFace == "boolean" ? a.disableFontFace : xe, O = a.fontExtraProperties === !0, R = a.enableXfa === !0, L = a.ownerDocument || globalThis.document, V = a.disableRange === !0, U = a.disableStream === !0, G = a.disableAutoFetch === !0, rt = a.pdfBug === !0, F = a.CanvasFactory || vS, z = a.FilterFactory || _S, it = a.enableHWA === !0, Rt = h ? h.length : a.length ?? NaN, Wt = typeof a.useSystemFonts == "boolean" ? a.useSystemFonts : !xe && !M, ne = typeof a.useWorkerFetch == "boolean" ? a.useWorkerFetch : b === ev && _ === rv && f && y && Th(f, document.baseURI) && Th(y, document.baseURI), Bt = null;
|
|
14852
14852
|
ax(d);
|
|
14853
14853
|
const yt = {
|
|
14854
14854
|
canvasFactory: new F({
|
|
@@ -14917,7 +14917,7 @@ function xS(a = {}) {
|
|
|
14917
14917
|
let ct;
|
|
14918
14918
|
if (h)
|
|
14919
14919
|
ct = new Qx(h, {
|
|
14920
|
-
disableRange:
|
|
14920
|
+
disableRange: V,
|
|
14921
14921
|
disableStream: U
|
|
14922
14922
|
});
|
|
14923
14923
|
else if (!i) {
|
|
@@ -14939,7 +14939,7 @@ function xS(a = {}) {
|
|
|
14939
14939
|
httpHeaders: n,
|
|
14940
14940
|
withCredentials: r,
|
|
14941
14941
|
rangeChunkSize: c,
|
|
14942
|
-
disableRange:
|
|
14942
|
+
disableRange: V,
|
|
14943
14943
|
disableStream: U
|
|
14944
14944
|
});
|
|
14945
14945
|
}
|
|
@@ -21412,7 +21412,7 @@ Et = new WeakMap(), le = new WeakMap(), Qn = new WeakMap(), rn = new WeakMap(),
|
|
|
21412
21412
|
};
|
|
21413
21413
|
}, Y($h, "_type", "stamp"), Y($h, "_editorType", J.STAMP);
|
|
21414
21414
|
let Wf = $h;
|
|
21415
|
-
var To, hh, wi, Zn, on, ws, tr, lh, Eo, zs, an, be, hn,
|
|
21415
|
+
var To, hh, wi, Zn, on, ws, tr, lh, Eo, zs, an, be, hn, X, er, St, uy, ni, qf, Kf, Gu;
|
|
21416
21416
|
const Ps = class Ps {
|
|
21417
21417
|
constructor({
|
|
21418
21418
|
uiManager: t,
|
|
@@ -21440,25 +21440,25 @@ const Ps = class Ps {
|
|
|
21440
21440
|
v(this, an, null);
|
|
21441
21441
|
v(this, be, null);
|
|
21442
21442
|
v(this, hn, null);
|
|
21443
|
-
v(this,
|
|
21443
|
+
v(this, X);
|
|
21444
21444
|
const d = [...l(Ps, er).values()];
|
|
21445
21445
|
if (!Ps._initialized) {
|
|
21446
21446
|
Ps._initialized = !0;
|
|
21447
21447
|
for (const g of d)
|
|
21448
21448
|
g.initialize(u, t);
|
|
21449
21449
|
}
|
|
21450
|
-
t.registerEditorTypes(d), m(this,
|
|
21450
|
+
t.registerEditorTypes(d), m(this, X, t), this.pageIndex = e, this.div = s, m(this, To, n), m(this, wi, r), this.viewport = c, m(this, be, h), this.drawLayer = o, this._structTree = i, l(this, X).addLayer(this);
|
|
21451
21451
|
}
|
|
21452
21452
|
get isEmpty() {
|
|
21453
21453
|
return l(this, ws).size === 0;
|
|
21454
21454
|
}
|
|
21455
21455
|
get isInvisible() {
|
|
21456
|
-
return this.isEmpty && l(this,
|
|
21456
|
+
return this.isEmpty && l(this, X).getMode() === J.NONE;
|
|
21457
21457
|
}
|
|
21458
21458
|
updateToolbar(t) {
|
|
21459
|
-
l(this,
|
|
21459
|
+
l(this, X).updateToolbar(t);
|
|
21460
21460
|
}
|
|
21461
|
-
updateMode(t = l(this,
|
|
21461
|
+
updateMode(t = l(this, X).getMode()) {
|
|
21462
21462
|
switch (w(this, St, Gu).call(this), t) {
|
|
21463
21463
|
case J.NONE:
|
|
21464
21464
|
this.disableTextSelection(), this.togglePointerEvents(!1), this.toggleAnnotationLayerPointerEvents(!0), this.disableClick();
|
|
@@ -21485,13 +21485,13 @@ const Ps = class Ps {
|
|
|
21485
21485
|
return t === ((e = l(this, be)) == null ? void 0 : e.div);
|
|
21486
21486
|
}
|
|
21487
21487
|
setEditingState(t) {
|
|
21488
|
-
l(this,
|
|
21488
|
+
l(this, X).setEditingState(t);
|
|
21489
21489
|
}
|
|
21490
21490
|
addCommands(t) {
|
|
21491
|
-
l(this,
|
|
21491
|
+
l(this, X).addCommands(t);
|
|
21492
21492
|
}
|
|
21493
21493
|
cleanUndoStack(t) {
|
|
21494
|
-
l(this,
|
|
21494
|
+
l(this, X).cleanUndoStack(t);
|
|
21495
21495
|
}
|
|
21496
21496
|
toggleDrawing(t = !1) {
|
|
21497
21497
|
this.div.classList.toggle("drawing", !t);
|
|
@@ -21507,14 +21507,14 @@ const Ps = class Ps {
|
|
|
21507
21507
|
m(this, Eo, !0), this.div.tabIndex = 0, this.togglePointerEvents(!0);
|
|
21508
21508
|
const t = /* @__PURE__ */ new Set();
|
|
21509
21509
|
for (const s of l(this, ws).values())
|
|
21510
|
-
s.enableEditing(), s.show(!0), s.annotationElementId && (l(this,
|
|
21510
|
+
s.enableEditing(), s.show(!0), s.annotationElementId && (l(this, X).removeChangedExistingAnnotation(s), t.add(s.annotationElementId));
|
|
21511
21511
|
if (!l(this, wi)) {
|
|
21512
21512
|
m(this, Eo, !1);
|
|
21513
21513
|
return;
|
|
21514
21514
|
}
|
|
21515
21515
|
const e = l(this, wi).getEditableAnnotations();
|
|
21516
21516
|
for (const s of e) {
|
|
21517
|
-
if (s.hide(), l(this,
|
|
21517
|
+
if (s.hide(), l(this, X).isDeletedAnnotationElement(s.data.id) || t.has(s.data.id))
|
|
21518
21518
|
continue;
|
|
21519
21519
|
const i = await this.deserialize(s);
|
|
21520
21520
|
i && (this.addOrRebuild(i), i.enableEditing());
|
|
@@ -21540,14 +21540,14 @@ const Ps = class Ps {
|
|
|
21540
21540
|
const {
|
|
21541
21541
|
id: o
|
|
21542
21542
|
} = r.data;
|
|
21543
|
-
if (l(this,
|
|
21543
|
+
if (l(this, X).isDeletedAnnotationElement(o))
|
|
21544
21544
|
continue;
|
|
21545
21545
|
let h = e.get(o);
|
|
21546
21546
|
if (h) {
|
|
21547
21547
|
h.resetAnnotationElement(r), h.show(!1), r.show();
|
|
21548
21548
|
continue;
|
|
21549
21549
|
}
|
|
21550
|
-
h = t.get(o), h && (l(this,
|
|
21550
|
+
h = t.get(o), h && (l(this, X).addChangedExistingAnnotation(h), h.renderAnnotationElement(r) && h.show(!1)), r.show();
|
|
21551
21551
|
}
|
|
21552
21552
|
}
|
|
21553
21553
|
w(this, St, Gu).call(this), this.isEmpty && (this.div.hidden = !0);
|
|
@@ -21563,13 +21563,13 @@ const Ps = class Ps {
|
|
|
21563
21563
|
return ((e = l(this, wi)) == null ? void 0 : e.getEditableAnnotation(t)) || null;
|
|
21564
21564
|
}
|
|
21565
21565
|
setActiveEditor(t) {
|
|
21566
|
-
l(this,
|
|
21566
|
+
l(this, X).getActive() !== t && l(this, X).setActiveEditor(t);
|
|
21567
21567
|
}
|
|
21568
21568
|
enableTextSelection() {
|
|
21569
21569
|
var t;
|
|
21570
21570
|
if (this.div.tabIndex = -1, (t = l(this, be)) != null && t.div && !l(this, hn)) {
|
|
21571
21571
|
m(this, hn, new AbortController());
|
|
21572
|
-
const e = l(this,
|
|
21572
|
+
const e = l(this, X).combinedSignal(l(this, hn));
|
|
21573
21573
|
l(this, be).div.addEventListener("pointerdown", w(this, St, uy).bind(this), {
|
|
21574
21574
|
signal: e
|
|
21575
21575
|
}), l(this, be).div.classList.add("highlighting");
|
|
@@ -21583,7 +21583,7 @@ const Ps = class Ps {
|
|
|
21583
21583
|
if (l(this, Zn))
|
|
21584
21584
|
return;
|
|
21585
21585
|
m(this, Zn, new AbortController());
|
|
21586
|
-
const t = l(this,
|
|
21586
|
+
const t = l(this, X).combinedSignal(l(this, Zn));
|
|
21587
21587
|
this.div.addEventListener("pointerdown", this.pointerdown.bind(this), {
|
|
21588
21588
|
signal: t
|
|
21589
21589
|
});
|
|
@@ -21603,26 +21603,26 @@ const Ps = class Ps {
|
|
|
21603
21603
|
const {
|
|
21604
21604
|
annotationElementId: e
|
|
21605
21605
|
} = t;
|
|
21606
|
-
e && l(this,
|
|
21606
|
+
e && l(this, X).isDeletedAnnotationElement(e) && l(this, X).removeDeletedAnnotationElement(t);
|
|
21607
21607
|
}
|
|
21608
21608
|
detach(t) {
|
|
21609
21609
|
var e;
|
|
21610
|
-
l(this, ws).delete(t.id), (e = l(this, To)) == null || e.removePointerInTextLayer(t.contentDiv), !l(this, lh) && t.annotationElementId && l(this,
|
|
21610
|
+
l(this, ws).delete(t.id), (e = l(this, To)) == null || e.removePointerInTextLayer(t.contentDiv), !l(this, lh) && t.annotationElementId && l(this, X).addDeletedAnnotationElement(t);
|
|
21611
21611
|
}
|
|
21612
21612
|
remove(t) {
|
|
21613
|
-
this.detach(t), l(this,
|
|
21613
|
+
this.detach(t), l(this, X).removeEditor(t), t.div.remove(), t.isAttachedToDOM = !1;
|
|
21614
21614
|
}
|
|
21615
21615
|
changeParent(t) {
|
|
21616
21616
|
var e;
|
|
21617
|
-
t.parent !== this && (t.parent && t.annotationElementId && (l(this,
|
|
21617
|
+
t.parent !== this && (t.parent && t.annotationElementId && (l(this, X).addDeletedAnnotationElement(t.annotationElementId), Mt.deleteAnnotationElement(t), t.annotationElementId = null), this.attach(t), (e = t.parent) == null || e.detach(t), t.setParent(this), t.div && t.isAttachedToDOM && (t.div.remove(), this.div.append(t.div)));
|
|
21618
21618
|
}
|
|
21619
21619
|
add(t) {
|
|
21620
21620
|
if (!(t.parent === this && t.isAttachedToDOM)) {
|
|
21621
|
-
if (this.changeParent(t), l(this,
|
|
21621
|
+
if (this.changeParent(t), l(this, X).addEditor(t), this.attach(t), !t.isAttachedToDOM) {
|
|
21622
21622
|
const e = t.render();
|
|
21623
21623
|
this.div.append(e), t.isAttachedToDOM = !0;
|
|
21624
21624
|
}
|
|
21625
|
-
t.fixAndSetPosition(), t.onceAdded(!l(this, Eo)), l(this,
|
|
21625
|
+
t.fixAndSetPosition(), t.onceAdded(!l(this, Eo)), l(this, X).addToAnnotationStorage(t), t._reportTelemetry(t.telemetryInitialData);
|
|
21626
21626
|
}
|
|
21627
21627
|
}
|
|
21628
21628
|
moveEditorInDOM(t) {
|
|
@@ -21637,7 +21637,7 @@ const Ps = class Ps {
|
|
|
21637
21637
|
t._focusEventsAllowed = !0;
|
|
21638
21638
|
}, {
|
|
21639
21639
|
once: !0,
|
|
21640
|
-
signal: l(this,
|
|
21640
|
+
signal: l(this, X)._signal
|
|
21641
21641
|
}), e.focus());
|
|
21642
21642
|
}, 0))), t._structTreeParentId = (s = l(this, To)) == null ? void 0 : s.moveElementInDOM(this.div, t.div, t.contentDiv, !0);
|
|
21643
21643
|
}
|
|
@@ -21655,17 +21655,17 @@ const Ps = class Ps {
|
|
|
21655
21655
|
});
|
|
21656
21656
|
}
|
|
21657
21657
|
getNextId() {
|
|
21658
|
-
return l(this,
|
|
21658
|
+
return l(this, X).getId();
|
|
21659
21659
|
}
|
|
21660
21660
|
combinedSignal(t) {
|
|
21661
|
-
return l(this,
|
|
21661
|
+
return l(this, X).combinedSignal(t);
|
|
21662
21662
|
}
|
|
21663
21663
|
canCreateNewEmptyEditor() {
|
|
21664
21664
|
var t;
|
|
21665
21665
|
return (t = l(this, St, ni)) == null ? void 0 : t.canCreateNewEmptyEditor();
|
|
21666
21666
|
}
|
|
21667
21667
|
pasteEditor(t, e) {
|
|
21668
|
-
l(this,
|
|
21668
|
+
l(this, X).updateToolbar(t), l(this, X).updateMode(t);
|
|
21669
21669
|
const {
|
|
21670
21670
|
offsetX: s,
|
|
21671
21671
|
offsetY: i
|
|
@@ -21674,7 +21674,7 @@ const Ps = class Ps {
|
|
|
21674
21674
|
id: n,
|
|
21675
21675
|
x: s,
|
|
21676
21676
|
y: i,
|
|
21677
|
-
uiManager: l(this,
|
|
21677
|
+
uiManager: l(this, X),
|
|
21678
21678
|
isCentered: !0,
|
|
21679
21679
|
...e
|
|
21680
21680
|
});
|
|
@@ -21682,7 +21682,7 @@ const Ps = class Ps {
|
|
|
21682
21682
|
}
|
|
21683
21683
|
async deserialize(t) {
|
|
21684
21684
|
var e;
|
|
21685
|
-
return await ((e = l(Ps, er).get(t.annotationType ?? t.annotationEditorType)) == null ? void 0 : e.deserialize(t, this, l(this,
|
|
21685
|
+
return await ((e = l(Ps, er).get(t.annotationType ?? t.annotationEditorType)) == null ? void 0 : e.deserialize(t, this, l(this, X))) || null;
|
|
21686
21686
|
}
|
|
21687
21687
|
createAndAddNewEditor(t, e, s = {}) {
|
|
21688
21688
|
const i = this.getNextId(), n = w(this, St, qf).call(this, {
|
|
@@ -21690,7 +21690,7 @@ const Ps = class Ps {
|
|
|
21690
21690
|
id: i,
|
|
21691
21691
|
x: t.offsetX,
|
|
21692
21692
|
y: t.offsetY,
|
|
21693
|
-
uiManager: l(this,
|
|
21693
|
+
uiManager: l(this, X),
|
|
21694
21694
|
isCentered: e,
|
|
21695
21695
|
...s
|
|
21696
21696
|
});
|
|
@@ -21700,13 +21700,13 @@ const Ps = class Ps {
|
|
|
21700
21700
|
this.createAndAddNewEditor(w(this, St, Kf).call(this), !0);
|
|
21701
21701
|
}
|
|
21702
21702
|
setSelected(t) {
|
|
21703
|
-
l(this,
|
|
21703
|
+
l(this, X).setSelected(t);
|
|
21704
21704
|
}
|
|
21705
21705
|
toggleSelected(t) {
|
|
21706
|
-
l(this,
|
|
21706
|
+
l(this, X).toggleSelected(t);
|
|
21707
21707
|
}
|
|
21708
21708
|
unselect(t) {
|
|
21709
|
-
l(this,
|
|
21709
|
+
l(this, X).unselect(t);
|
|
21710
21710
|
}
|
|
21711
21711
|
pointerup(t) {
|
|
21712
21712
|
var s;
|
|
@@ -21718,8 +21718,8 @@ const Ps = class Ps {
|
|
|
21718
21718
|
m(this, hh, !0);
|
|
21719
21719
|
return;
|
|
21720
21720
|
}
|
|
21721
|
-
if (l(this,
|
|
21722
|
-
l(this,
|
|
21721
|
+
if (l(this, X).getMode() === J.STAMP) {
|
|
21722
|
+
l(this, X).unselectAll();
|
|
21723
21723
|
return;
|
|
21724
21724
|
}
|
|
21725
21725
|
this.createAndAddNewEditor(t, !1);
|
|
@@ -21727,7 +21727,7 @@ const Ps = class Ps {
|
|
|
21727
21727
|
}
|
|
21728
21728
|
pointerdown(t) {
|
|
21729
21729
|
var i;
|
|
21730
|
-
if (l(this,
|
|
21730
|
+
if (l(this, X).getMode() === J.HIGHLIGHT && this.enableTextSelection(), l(this, tr)) {
|
|
21731
21731
|
m(this, tr, !1);
|
|
21732
21732
|
return;
|
|
21733
21733
|
}
|
|
@@ -21740,23 +21740,23 @@ const Ps = class Ps {
|
|
|
21740
21740
|
this.startDrawingSession(t);
|
|
21741
21741
|
return;
|
|
21742
21742
|
}
|
|
21743
|
-
const s = l(this,
|
|
21743
|
+
const s = l(this, X).getActive();
|
|
21744
21744
|
m(this, hh, !s || s.isEmpty());
|
|
21745
21745
|
}
|
|
21746
21746
|
startDrawingSession(t) {
|
|
21747
21747
|
if (this.div.focus(), l(this, zs)) {
|
|
21748
|
-
l(this, St, ni).startDrawing(this, l(this,
|
|
21748
|
+
l(this, St, ni).startDrawing(this, l(this, X), !1, t);
|
|
21749
21749
|
return;
|
|
21750
21750
|
}
|
|
21751
|
-
l(this,
|
|
21752
|
-
const e = l(this,
|
|
21751
|
+
l(this, X).setCurrentDrawingSession(this), m(this, zs, new AbortController());
|
|
21752
|
+
const e = l(this, X).combinedSignal(l(this, zs));
|
|
21753
21753
|
this.div.addEventListener("blur", ({
|
|
21754
21754
|
relatedTarget: s
|
|
21755
21755
|
}) => {
|
|
21756
21756
|
s && !this.div.contains(s) && (m(this, an, null), this.commitOrRemove());
|
|
21757
21757
|
}, {
|
|
21758
21758
|
signal: e
|
|
21759
|
-
}), l(this, St, ni).startDrawing(this, l(this,
|
|
21759
|
+
}), l(this, St, ni).startDrawing(this, l(this, X), !1, t);
|
|
21760
21760
|
}
|
|
21761
21761
|
pause(t) {
|
|
21762
21762
|
if (t) {
|
|
@@ -21772,10 +21772,10 @@ const Ps = class Ps {
|
|
|
21772
21772
|
}, 0);
|
|
21773
21773
|
}
|
|
21774
21774
|
endDrawingSession(t = !1) {
|
|
21775
|
-
return l(this, zs) ? (l(this,
|
|
21775
|
+
return l(this, zs) ? (l(this, X).setCurrentDrawingSession(null), l(this, zs).abort(), m(this, zs, null), m(this, an, null), l(this, St, ni).endDrawing(t)) : null;
|
|
21776
21776
|
}
|
|
21777
21777
|
findNewParent(t, e, s) {
|
|
21778
|
-
const i = l(this,
|
|
21778
|
+
const i = l(this, X).findParent(e, s);
|
|
21779
21779
|
return i === null || i === this ? !1 : (i.changeParent(t), !0);
|
|
21780
21780
|
}
|
|
21781
21781
|
commitOrRemove() {
|
|
@@ -21786,23 +21786,23 @@ const Ps = class Ps {
|
|
|
21786
21786
|
}
|
|
21787
21787
|
destroy() {
|
|
21788
21788
|
var t, e;
|
|
21789
|
-
this.commitOrRemove(), ((t = l(this,
|
|
21789
|
+
this.commitOrRemove(), ((t = l(this, X).getActive()) == null ? void 0 : t.parent) === this && (l(this, X).commitOrRemove(), l(this, X).setActiveEditor(null)), l(this, on) && (clearTimeout(l(this, on)), m(this, on, null));
|
|
21790
21790
|
for (const s of l(this, ws).values())
|
|
21791
21791
|
(e = l(this, To)) == null || e.removePointerInTextLayer(s.contentDiv), s.setParent(null), s.isAttachedToDOM = !1, s.div.remove();
|
|
21792
|
-
this.div = null, l(this, ws).clear(), l(this,
|
|
21792
|
+
this.div = null, l(this, ws).clear(), l(this, X).removeLayer(this);
|
|
21793
21793
|
}
|
|
21794
21794
|
render({
|
|
21795
21795
|
viewport: t
|
|
21796
21796
|
}) {
|
|
21797
21797
|
this.viewport = t, Ro(this.div, t);
|
|
21798
|
-
for (const e of l(this,
|
|
21798
|
+
for (const e of l(this, X).getEditors(this.pageIndex))
|
|
21799
21799
|
this.add(e), e.rebuild();
|
|
21800
21800
|
this.updateMode();
|
|
21801
21801
|
}
|
|
21802
21802
|
update({
|
|
21803
21803
|
viewport: t
|
|
21804
21804
|
}) {
|
|
21805
|
-
l(this,
|
|
21805
|
+
l(this, X).commitOrRemove(), w(this, St, Gu).call(this);
|
|
21806
21806
|
const e = this.viewport.rotation, s = t.rotation;
|
|
21807
21807
|
if (this.viewport = t, Ro(this.div, {
|
|
21808
21808
|
rotation: s
|
|
@@ -21818,11 +21818,11 @@ const Ps = class Ps {
|
|
|
21818
21818
|
return [t, e];
|
|
21819
21819
|
}
|
|
21820
21820
|
get scale() {
|
|
21821
|
-
return l(this,
|
|
21821
|
+
return l(this, X).viewParameters.realScale;
|
|
21822
21822
|
}
|
|
21823
21823
|
};
|
|
21824
|
-
To = new WeakMap(), hh = new WeakMap(), wi = new WeakMap(), Zn = new WeakMap(), on = new WeakMap(), ws = new WeakMap(), tr = new WeakMap(), lh = new WeakMap(), Eo = new WeakMap(), zs = new WeakMap(), an = new WeakMap(), be = new WeakMap(), hn = new WeakMap(),
|
|
21825
|
-
l(this,
|
|
21824
|
+
To = new WeakMap(), hh = new WeakMap(), wi = new WeakMap(), Zn = new WeakMap(), on = new WeakMap(), ws = new WeakMap(), tr = new WeakMap(), lh = new WeakMap(), Eo = new WeakMap(), zs = new WeakMap(), an = new WeakMap(), be = new WeakMap(), hn = new WeakMap(), X = new WeakMap(), er = new WeakMap(), St = new WeakSet(), uy = function(t) {
|
|
21825
|
+
l(this, X).unselectAll();
|
|
21826
21826
|
const {
|
|
21827
21827
|
target: e
|
|
21828
21828
|
} = t;
|
|
@@ -21832,7 +21832,7 @@ To = new WeakMap(), hh = new WeakMap(), wi = new WeakMap(), Zn = new WeakMap(),
|
|
|
21832
21832
|
} = Fe.platform;
|
|
21833
21833
|
if (t.button !== 0 || t.ctrlKey && s)
|
|
21834
21834
|
return;
|
|
21835
|
-
l(this,
|
|
21835
|
+
l(this, X).showAllEditors("highlight", !0, !0), l(this, be).div.classList.add("free"), this.toggleDrawing(), ld.startHighlighting(this, l(this, X).direction === "ltr", {
|
|
21836
21836
|
target: l(this, be).div,
|
|
21837
21837
|
x: t.x,
|
|
21838
21838
|
y: t.y
|
|
@@ -21840,11 +21840,11 @@ To = new WeakMap(), hh = new WeakMap(), wi = new WeakMap(), Zn = new WeakMap(),
|
|
|
21840
21840
|
l(this, be).div.classList.remove("free"), this.toggleDrawing(!0);
|
|
21841
21841
|
}, {
|
|
21842
21842
|
once: !0,
|
|
21843
|
-
signal: l(this,
|
|
21843
|
+
signal: l(this, X)._signal
|
|
21844
21844
|
}), t.preventDefault();
|
|
21845
21845
|
}
|
|
21846
21846
|
}, ni = function() {
|
|
21847
|
-
return l(Ps, er).get(l(this,
|
|
21847
|
+
return l(Ps, er).get(l(this, X).getMode());
|
|
21848
21848
|
}, qf = function(t) {
|
|
21849
21849
|
const e = l(this, St, ni);
|
|
21850
21850
|
return e ? new e.prototype.constructor(t) : null;
|
|
@@ -22274,9 +22274,9 @@ function RC(a) {
|
|
|
22274
22274
|
stroke: O = h.stroke,
|
|
22275
22275
|
uuid: R = Date.now()
|
|
22276
22276
|
}) {
|
|
22277
|
-
if ((n == null ? void 0 : n.stroke) === `${O}-${R}`) return;
|
|
22278
|
-
const
|
|
22279
|
-
S(A), n =
|
|
22277
|
+
if (A.getActiveObjects().length > 1 || (n == null ? void 0 : n.stroke) === `${O}-${R}`) return;
|
|
22278
|
+
const V = await yC(h.src, O, R);
|
|
22279
|
+
S(A), n = V, r = M, _(A, M, R), x(o, !0), A.add(V);
|
|
22280
22280
|
}
|
|
22281
22281
|
function _(A, M, O) {
|
|
22282
22282
|
n && (n.on("selected", () => {
|
|
@@ -22376,8 +22376,8 @@ const NC = /* @__PURE__ */ _y({
|
|
|
22376
22376
|
const { file: A, page: M, fileScale: O } = s;
|
|
22377
22377
|
window.requestAnimationFrame(async () => {
|
|
22378
22378
|
if (await Sy(), c(), A.PDFBase64.startsWith("data:image") || A.canvas) {
|
|
22379
|
-
const { canvas: R } = A, L = R ? 7 : 3,
|
|
22380
|
-
f({ url:
|
|
22379
|
+
const { canvas: R } = A, L = R ? 7 : 3, V = R != null && R.length ? R[M - 1] : A.PDFBase64;
|
|
22380
|
+
f({ url: V, scale: O / L }), i("loaded");
|
|
22381
22381
|
return;
|
|
22382
22382
|
}
|
|
22383
22383
|
await u({
|
|
@@ -22390,8 +22390,8 @@ const NC = /* @__PURE__ */ _y({
|
|
|
22390
22390
|
}
|
|
22391
22391
|
function C(A) {
|
|
22392
22392
|
if (!s.isDrop || !A.dataTransfer) return;
|
|
22393
|
-
const { dataTransfer: M, offsetX: O, offsetY: R } = A, L = M.getData("text/plain"),
|
|
22394
|
-
|
|
22393
|
+
const { dataTransfer: M, offsetX: O, offsetY: R } = A, L = M.getData("text/plain"), V = M.getData("text/uri-list"), U = M.getData("custom/offset"), G = U ? JSON.parse(U) : null, rt = { top: R, left: O }, F = { x: (G == null ? void 0 : G.offsetX) ?? 0, y: (G == null ? void 0 : G.offsetY) ?? 0 };
|
|
22394
|
+
V ? S(V, rt, F) : L && k(L, rt, F);
|
|
22395
22395
|
}
|
|
22396
22396
|
function S(A, M, O) {
|
|
22397
22397
|
d(A, { ...s.dropImageOptions, ...M }, O);
|
|
@@ -22405,9 +22405,9 @@ const NC = /* @__PURE__ */ _y({
|
|
|
22405
22405
|
return Zd([() => s.fileScale, () => s.page, () => s.file, () => s.password], D), Zd(h, (A) => y(A), { immediate: !0 }), Zd(() => s.closeSvgOptions, _, { immediate: !0 }), n(b), t({ reload: x, addImage: S, addText: k, clearActive: p, deleteCanvas: b, canvasRef: r }), (A, M) => (Ay(), Cy("div", {
|
|
22406
22406
|
style: Ty({ transform: `scale(${h.value})` }),
|
|
22407
22407
|
onDragover: M[0] || (M[0] = tg(() => {
|
|
22408
|
-
}, ["
|
|
22408
|
+
}, ["prevent"])),
|
|
22409
22409
|
onDragenter: M[1] || (M[1] = tg(() => {
|
|
22410
|
-
}, ["
|
|
22410
|
+
}, ["prevent"])),
|
|
22411
22411
|
onDrop: tg(C, ["stop", "prevent"])
|
|
22412
22412
|
}, [
|
|
22413
22413
|
Ey("canvas", {
|