@component-hook/pdf-canvas 1.3.0-alpha.2 → 1.3.0-alpha.4
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.
|
@@ -2081,9 +2081,9 @@ let Te = class Ki extends Oc {
|
|
|
2081
2081
|
toObject() {
|
|
2082
2082
|
const t = (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []).concat(Ki.customProperties, this.constructor.customProperties || []);
|
|
2083
2083
|
let e;
|
|
2084
|
-
const s = q.NUM_FRACTION_DIGITS, { clipPath: i, fill: n, stroke: r, shadow: o, strokeDashArray: h, left: l, top: c, originX: u, originY: d, width: f, height: g, strokeWidth: p, strokeLineCap: b, strokeDashOffset: m, strokeLineJoin: v, strokeUniform: y, strokeMiterLimit: _, scaleX: S, scaleY: A, angle: T, flipX: E, flipY:
|
|
2084
|
+
const s = q.NUM_FRACTION_DIGITS, { clipPath: i, fill: n, stroke: r, shadow: o, strokeDashArray: h, left: l, top: c, originX: u, originY: d, width: f, height: g, strokeWidth: p, strokeLineCap: b, strokeDashOffset: m, strokeLineJoin: v, strokeUniform: y, strokeMiterLimit: _, scaleX: S, scaleY: A, angle: T, flipX: E, flipY: O, opacity: N, visible: D, backgroundColor: L, fillRule: k, paintFirst: P, globalCompositeOperation: j, skewX: M, skewY: R } = this;
|
|
2085
2085
|
i && !i.excludeFromExport && (e = i.toObject(t.concat("inverted", "absolutePositioned")));
|
|
2086
|
-
const G = (at) => Q(at, s), it = w(w({}, fs(this, t)), {}, { type: this.constructor.type, version: mr, originX: u, originY: d, left: G(l), top: G(c), width: G(f), height: G(g), fill: Do(n) ? n.toObject() : n, stroke: Do(r) ? r.toObject() : r, strokeWidth: G(p), strokeDashArray: h && h.concat(), strokeLineCap: b, strokeDashOffset: m, strokeLineJoin: v, strokeUniform: y, strokeMiterLimit: G(_), scaleX: G(S), scaleY: G(A), angle: G(T), flipX: E, flipY:
|
|
2086
|
+
const G = (at) => Q(at, s), it = w(w({}, fs(this, t)), {}, { type: this.constructor.type, version: mr, originX: u, originY: d, left: G(l), top: G(c), width: G(f), height: G(g), fill: Do(n) ? n.toObject() : n, stroke: Do(r) ? r.toObject() : r, strokeWidth: G(p), strokeDashArray: h && h.concat(), strokeLineCap: b, strokeDashOffset: m, strokeLineJoin: v, strokeUniform: y, strokeMiterLimit: G(_), scaleX: G(S), scaleY: G(A), angle: G(T), flipX: E, flipY: O, opacity: G(N), shadow: o && o.toObject(), visible: D, backgroundColor: L, fillRule: k, paintFirst: P, globalCompositeOperation: j, skewX: G(M), skewY: G(R) }, e ? { clipPath: e } : null);
|
|
2087
2087
|
return this.includeDefaultValues ? it : this._removeDefaultValues(it);
|
|
2088
2088
|
}
|
|
2089
2089
|
toDatalessObject(t) {
|
|
@@ -2239,8 +2239,8 @@ function Sh(a, t, e, s, i) {
|
|
|
2239
2239
|
if (le(n, h)) return !1;
|
|
2240
2240
|
const { origin: u, flip: d } = tr[r], f = mt(e[u]) * (n[d] ? -1 : 1), g = -Math.sign(f) * (n[c] ? -1 : 1), p = 0.5 * -((n[l] === 0 && Jr(e, X, X, s, i)[a] > 0 || n[l] > 0 ? 1 : -1) * g) + 0.5;
|
|
2241
2241
|
return Bs(Xa, Hs(((m, v, y, _) => (function(S, A, T) {
|
|
2242
|
-
let { target: E, ex:
|
|
2243
|
-
const { skew: k } = tr[S],
|
|
2242
|
+
let { target: E, ex: O, ey: N, skewingSide: D } = A, L = st(A, zc);
|
|
2243
|
+
const { skew: k } = tr[S], P = T.subtract(new C(O, N)).divide(new C(E.scaleX, E.scaleY))[S], j = E[k], M = L[k], R = Math.tan(lt(M)), G = S === "y" ? E._getTransformedDimensions({ scaleX: 1, scaleY: 1, skewX: 0 }).x : E._getTransformedDimensions({ scaleX: 1, scaleY: 1 }).y, it = 2 * P * D / Math.max(G, 1) + R, at = Ce(Math.atan(it));
|
|
2244
2244
|
E.set(k, at);
|
|
2245
2245
|
const xt = j !== E[k];
|
|
2246
2246
|
if (xt && S === "y") {
|
|
@@ -3106,8 +3106,8 @@ function Tr(a, t, e, s, i, n, r, o) {
|
|
|
3106
3106
|
for (let _ = 0; _ < 2; ++_) {
|
|
3107
3107
|
if (_ > 0 && (f = 6 * t - 12 * s + 6 * n, g = -3 * t + 9 * s - 9 * n + 3 * o, p = 3 * s - 3 * t), c(g) < 1e-12) {
|
|
3108
3108
|
if (c(f) < 1e-12) continue;
|
|
3109
|
-
const
|
|
3110
|
-
0 <
|
|
3109
|
+
const O = -p / f;
|
|
3110
|
+
0 < O && O < 1 && u.push(O);
|
|
3111
3111
|
continue;
|
|
3112
3112
|
}
|
|
3113
3113
|
const S = f * f - 4 * p * g;
|
|
@@ -3132,18 +3132,18 @@ const Au = (a, t, e) => {
|
|
|
3132
3132
|
const u = ((d, f, g, p, b, m, v) => {
|
|
3133
3133
|
if (g === 0 || p === 0) return [];
|
|
3134
3134
|
let y = 0, _ = 0, S = 0;
|
|
3135
|
-
const A = Math.PI, T = v * Hr, E = ue(T),
|
|
3135
|
+
const A = Math.PI, T = v * Hr, E = ue(T), O = ce(T), N = 0.5 * (-O * d - E * f), D = 0.5 * (-O * f + E * d), L = g ** 2, k = p ** 2, P = D ** 2, j = N ** 2, M = L * k - L * P - k * j;
|
|
3136
3136
|
let R = Math.abs(g), G = Math.abs(p);
|
|
3137
3137
|
if (M < 0) {
|
|
3138
3138
|
const ge = Math.sqrt(1 - M / (L * k));
|
|
3139
3139
|
R *= ge, G *= ge;
|
|
3140
|
-
} else S = (b === m ? -1 : 1) * Math.sqrt(M / (L *
|
|
3141
|
-
const it = S * R * D / G, at = -S * G * N / R, xt =
|
|
3140
|
+
} else S = (b === m ? -1 : 1) * Math.sqrt(M / (L * P + k * j));
|
|
3141
|
+
const it = S * R * D / G, at = -S * G * N / R, xt = O * it - E * at + 0.5 * d, gt = E * it + O * at + 0.5 * f;
|
|
3142
3142
|
let et = ha(1, 0, (N - it) / R, (D - at) / G), Pt = ha((N - it) / R, (D - at) / G, (-N - it) / R, (-D - at) / G);
|
|
3143
3143
|
m === 0 && Pt > 0 ? Pt -= 2 * A : m === 1 && Pt < 0 && (Pt += 2 * A);
|
|
3144
3144
|
const fe = Math.ceil(Math.abs(Pt / A * 2)), ht = [], K = Pt / fe, je = 8 / 3 * Math.sin(K / 4) * Math.sin(K / 4) / Math.sin(K / 2);
|
|
3145
3145
|
let ms = et + K;
|
|
3146
|
-
for (let ge = 0; ge < fe; ge++) ht[ge] = Cu(et, ms,
|
|
3146
|
+
for (let ge = 0; ge < fe; ge++) ht[ge] = Cu(et, ms, O, E, R, G, xt, gt, je, y, _), y = ht[ge][5], _ = ht[ge][6], et = ms, ms += K;
|
|
3147
3147
|
return ht;
|
|
3148
3148
|
})(l - a, c - t, i, n, o, h, r);
|
|
3149
3149
|
for (let d = 0, f = u.length; d < f; d++) u[d][1] += a, u[d][2] += t, u[d][3] += a, u[d][4] += t, u[d][5] += a, u[d][6] += t;
|
|
@@ -4931,24 +4931,24 @@ class Ct extends tl {
|
|
|
4931
4931
|
const d = this._textLines[l], f = u / this.lineHeight, g = this._getLineLeftOffset(l);
|
|
4932
4932
|
let p = 0, b = 0, m = this.getValueOfPropertyAt(l, 0, e), v = this.getValueOfPropertyAt(l, 0, vt), y = this.getValueOfPropertyAt(l, 0, hs), _ = m, S = v, A = y;
|
|
4933
4933
|
const T = s + f * (1 - this._fontSizeFraction);
|
|
4934
|
-
let E = this.getHeightOfChar(l, 0),
|
|
4934
|
+
let E = this.getHeightOfChar(l, 0), O = this.getValueOfPropertyAt(l, 0, "deltaY");
|
|
4935
4935
|
for (let L = 0, k = d.length; L < k; L++) {
|
|
4936
|
-
const
|
|
4936
|
+
const P = this.__charBounds[l][L];
|
|
4937
4937
|
_ = this.getValueOfPropertyAt(l, L, e), S = this.getValueOfPropertyAt(l, L, vt), A = this.getValueOfPropertyAt(l, L, hs);
|
|
4938
4938
|
const j = this.getHeightOfChar(l, L), M = this.getValueOfPropertyAt(l, L, "deltaY");
|
|
4939
4939
|
if (n && _ && S) {
|
|
4940
4940
|
const R = this.fontSize * A / 1e3;
|
|
4941
|
-
t.save(), t.fillStyle = v, t.translate(
|
|
4942
|
-
} else if ((_ !== m || S !== v || j !== E || A !== y || M !==
|
|
4941
|
+
t.save(), t.fillStyle = v, t.translate(P.renderLeft, P.renderTop), t.rotate(P.angle), t.fillRect(-P.kernedWidth / 2, h * j + M - o * R, P.kernedWidth, R), t.restore();
|
|
4942
|
+
} else if ((_ !== m || S !== v || j !== E || A !== y || M !== O) && b > 0) {
|
|
4943
4943
|
const R = this.fontSize * y / 1e3;
|
|
4944
4944
|
let G = i + g + p;
|
|
4945
|
-
this.direction === "rtl" && (G = this.width - G - b), m && v && y && (t.fillStyle = v, t.fillRect(G, T + h * E +
|
|
4946
|
-
} else b +=
|
|
4945
|
+
this.direction === "rtl" && (G = this.width - G - b), m && v && y && (t.fillStyle = v, t.fillRect(G, T + h * E + O - o * R, b, R)), p = P.left, b = P.width, m = _, y = A, v = S, E = j, O = M;
|
|
4946
|
+
} else b += P.kernedWidth;
|
|
4947
4947
|
}
|
|
4948
4948
|
let N = i + g + p;
|
|
4949
4949
|
this.direction === "rtl" && (N = this.width - N - b), t.fillStyle = S;
|
|
4950
4950
|
const D = this.fontSize * A / 1e3;
|
|
4951
|
-
_ && S && A && t.fillRect(N, T + h * E +
|
|
4951
|
+
_ && S && A && t.fillRect(N, T + h * E + O - o * D, b - r, D), s += u;
|
|
4952
4952
|
}
|
|
4953
4953
|
this._removeShadow(t);
|
|
4954
4954
|
}
|
|
@@ -6389,32 +6389,32 @@ async function bd(a, t) {
|
|
|
6389
6389
|
const u = il(c, ["use", "svg:use"]), d = ["x", "y", "xlink:href", "href", "transform"];
|
|
6390
6390
|
for (const f of u) {
|
|
6391
6391
|
const g = f.attributes, p = {};
|
|
6392
|
-
for (const
|
|
6392
|
+
for (const O of g) O.value && (p[O.name] = O.value);
|
|
6393
6393
|
const b = (p["xlink:href"] || p.href || "").slice(1);
|
|
6394
6394
|
if (b === "") return;
|
|
6395
6395
|
const m = c.getElementById(b);
|
|
6396
6396
|
if (m === null) return;
|
|
6397
6397
|
let v = m.cloneNode(!0);
|
|
6398
6398
|
const y = v.attributes, _ = {};
|
|
6399
|
-
for (const
|
|
6399
|
+
for (const O of y) O.value && (_[O.name] = O.value);
|
|
6400
6400
|
const { x: S = 0, y: A = 0, transform: T = "" } = p, E = "".concat(T, " ").concat(_.transform || "", " translate(").concat(S, ", ").concat(A, ")");
|
|
6401
6401
|
if (or(v), /^svg$/i.test(v.nodeName)) {
|
|
6402
|
-
const
|
|
6402
|
+
const O = v.ownerDocument.createElementNS(_r, "g");
|
|
6403
6403
|
Object.entries(_).forEach(((N) => {
|
|
6404
6404
|
let [D, L] = N;
|
|
6405
|
-
return
|
|
6406
|
-
})),
|
|
6405
|
+
return O.setAttributeNS(_r, D, L);
|
|
6406
|
+
})), O.append(...v.childNodes), v = O;
|
|
6407
6407
|
}
|
|
6408
|
-
for (const
|
|
6409
|
-
if (!
|
|
6410
|
-
const { name: N, value: D } =
|
|
6408
|
+
for (const O of g) {
|
|
6409
|
+
if (!O) continue;
|
|
6410
|
+
const { name: N, value: D } = O;
|
|
6411
6411
|
if (!d.includes(N)) if (N === "style") {
|
|
6412
6412
|
const L = {};
|
|
6413
|
-
Sr(D, L), Object.entries(_).forEach(((
|
|
6414
|
-
let [j, M] =
|
|
6413
|
+
Sr(D, L), Object.entries(_).forEach(((P) => {
|
|
6414
|
+
let [j, M] = P;
|
|
6415
6415
|
L[j] = M;
|
|
6416
6416
|
})), Sr(_.style || "", L);
|
|
6417
|
-
const k = Object.entries(L).map(((
|
|
6417
|
+
const k = Object.entries(L).map(((P) => P.join(":"))).join(";");
|
|
6418
6418
|
v.setAttribute(N, k);
|
|
6419
6419
|
} else !_[N] && v.setAttribute(N, D);
|
|
6420
6420
|
}
|
|
@@ -7457,21 +7457,21 @@ class Gi extends wt {
|
|
|
7457
7457
|
lanczosResize(t, e, s, i, n) {
|
|
7458
7458
|
const r = t.imageData.data, o = t.ctx.createImageData(i, n), h = o.data, l = this.lanczosCreate(this.lanczosLobes), c = this.rcpScaleX, u = this.rcpScaleY, d = 2 / this.rcpScaleX, f = 2 / this.rcpScaleY, g = Math.ceil(c * this.lanczosLobes / 2), p = Math.ceil(u * this.lanczosLobes / 2), b = {}, m = { x: 0, y: 0 }, v = { x: 0, y: 0 };
|
|
7459
7459
|
return (function y(_) {
|
|
7460
|
-
let S, A, T, E,
|
|
7460
|
+
let S, A, T, E, O, N, D, L, k, P, j;
|
|
7461
7461
|
for (m.x = (_ + 0.5) * c, v.x = Math.floor(m.x), S = 0; S < n; S++) {
|
|
7462
|
-
for (m.y = (S + 0.5) * u, v.y = Math.floor(m.y),
|
|
7463
|
-
|
|
7464
|
-
for (let M = v.y - p; M <= v.y + p; M++) M < 0 || M >= s || (j = Math.floor(1e3 * Math.abs(M - m.y)), b[
|
|
7462
|
+
for (m.y = (S + 0.5) * u, v.y = Math.floor(m.y), O = 0, N = 0, D = 0, L = 0, k = 0, A = v.x - g; A <= v.x + g; A++) if (!(A < 0 || A >= e)) {
|
|
7463
|
+
P = Math.floor(1e3 * Math.abs(A - m.x)), b[P] || (b[P] = {});
|
|
7464
|
+
for (let M = v.y - p; M <= v.y + p; M++) M < 0 || M >= s || (j = Math.floor(1e3 * Math.abs(M - m.y)), b[P][j] || (b[P][j] = l(Math.sqrt(Math.pow(P * d, 2) + Math.pow(j * f, 2)) / 1e3)), T = b[P][j], T > 0 && (E = 4 * (M * e + A), O += T, N += T * r[E], D += T * r[E + 1], L += T * r[E + 2], k += T * r[E + 3]));
|
|
7465
7465
|
}
|
|
7466
|
-
E = 4 * (S * i + _), h[E] = N /
|
|
7466
|
+
E = 4 * (S * i + _), h[E] = N / O, h[E + 1] = D / O, h[E + 2] = L / O, h[E + 3] = k / O;
|
|
7467
7467
|
}
|
|
7468
7468
|
return ++_ < i ? y(_) : o;
|
|
7469
7469
|
})(0);
|
|
7470
7470
|
}
|
|
7471
7471
|
bilinearFiltering(t, e, s, i, n) {
|
|
7472
7472
|
let r, o, h, l, c, u, d, f, g, p, b, m, v, y = 0;
|
|
7473
|
-
const _ = this.rcpScaleX, S = this.rcpScaleY, A = 4 * (e - 1), T = t.imageData.data, E = t.ctx.createImageData(i, n),
|
|
7474
|
-
for (d = 0; d < n; d++) for (f = 0; f < i; f++) for (c = Math.floor(_ * f), u = Math.floor(S * d), g = _ * f - c, p = S * d - u, v = 4 * (u * e + c), b = 0; b < 4; b++) r = T[v + b], o = T[v + 4 + b], h = T[v + A + b], l = T[v + A + 4 + b], m = r * (1 - g) * (1 - p) + o * g * (1 - p) + h * p * (1 - g) + l * g * p,
|
|
7473
|
+
const _ = this.rcpScaleX, S = this.rcpScaleY, A = 4 * (e - 1), T = t.imageData.data, E = t.ctx.createImageData(i, n), O = E.data;
|
|
7474
|
+
for (d = 0; d < n; d++) for (f = 0; f < i; f++) for (c = Math.floor(_ * f), u = Math.floor(S * d), g = _ * f - c, p = S * d - u, v = 4 * (u * e + c), b = 0; b < 4; b++) r = T[v + b], o = T[v + 4 + b], h = T[v + A + b], l = T[v + A + 4 + b], m = r * (1 - g) * (1 - p) + o * g * (1 - p) + h * p * (1 - g) + l * g * p, O[y++] = m;
|
|
7475
7475
|
return E;
|
|
7476
7476
|
}
|
|
7477
7477
|
hermiteFastResize(t, e, s, i, n) {
|
|
@@ -7481,11 +7481,11 @@ class Gi extends wt {
|
|
|
7481
7481
|
let b = 0, m = 0, v = 0, y = 0, _ = 0, S = 0, A = 0;
|
|
7482
7482
|
const T = (f + 0.5) * o;
|
|
7483
7483
|
for (let E = Math.floor(f * o); E < (f + 1) * o; E++) {
|
|
7484
|
-
const
|
|
7484
|
+
const O = Math.abs(T - (E + 0.5)) / l, N = (g + 0.5) * r, D = O * O;
|
|
7485
7485
|
for (let L = Math.floor(g * r); L < (g + 1) * r; L++) {
|
|
7486
7486
|
let k = Math.abs(N - (L + 0.5)) / h;
|
|
7487
|
-
const
|
|
7488
|
-
|
|
7487
|
+
const P = Math.sqrt(D + k * k);
|
|
7488
|
+
P > 1 && P < -1 || (b = 2 * P * P * P - 3 * P * P + 1, b > 0 && (k = 4 * (L + E * e), A += b * c[k + 3], v += b, c[k + 3] < 255 && (b = b * c[k + 3] / 250), y += b * c[k], _ += b * c[k + 1], S += b * c[k + 2], m += b));
|
|
7489
7489
|
}
|
|
7490
7490
|
}
|
|
7491
7491
|
d[p] = y / m, d[p + 1] = _ / m, d[p + 2] = S / m, d[p + 3] = A / v;
|
|
@@ -10591,7 +10591,7 @@ class z {
|
|
|
10591
10591
|
const y = p(o, h), _ = b(o, h);
|
|
10592
10592
|
let S = d(..._);
|
|
10593
10593
|
const A = z._round(n + S[0]), T = z._round(r + S[1]);
|
|
10594
|
-
let E = 1,
|
|
10594
|
+
let E = 1, O = 1, N, D;
|
|
10595
10595
|
if (e.fromKeyboard)
|
|
10596
10596
|
({
|
|
10597
10597
|
deltaX: N,
|
|
@@ -10606,12 +10606,12 @@ class z {
|
|
|
10606
10606
|
}
|
|
10607
10607
|
if ([N, D] = g(N / s, D / i), m) {
|
|
10608
10608
|
const M = Math.hypot(o, h);
|
|
10609
|
-
E =
|
|
10610
|
-
} else v ? E = Math.max(l, Math.min(1, Math.abs(_[0] - y[0] - N))) / o :
|
|
10611
|
-
const L = z._round(o * E), k = z._round(h *
|
|
10609
|
+
E = O = Math.max(Math.min(Math.hypot(_[0] - y[0] - N, _[1] - y[1] - D) / M, 1 / o, 1 / h), l / o, c / h);
|
|
10610
|
+
} else v ? E = Math.max(l, Math.min(1, Math.abs(_[0] - y[0] - N))) / o : O = Math.max(c, Math.min(1, Math.abs(_[1] - y[1] - D))) / h;
|
|
10611
|
+
const L = z._round(o * E), k = z._round(h * O);
|
|
10612
10612
|
S = d(...b(L, k));
|
|
10613
|
-
const
|
|
10614
|
-
this.#o ||= [this.x, this.y, this.width, this.height], this.width = L, this.height = k, this.x =
|
|
10613
|
+
const P = A - S[0], j = T - S[1];
|
|
10614
|
+
this.#o ||= [this.x, this.y, this.width, this.height], this.width = L, this.height = k, this.x = P, this.y = j, this.setDims(s * L, i * k), this.fixAndSetPosition(), this._onResizing();
|
|
10615
10615
|
}
|
|
10616
10616
|
_onResizing() {
|
|
10617
10617
|
}
|
|
@@ -11370,8 +11370,8 @@ class Qd {
|
|
|
11370
11370
|
return _.charCodeAt(S) << 24 | _.charCodeAt(S + 1) << 16 | _.charCodeAt(S + 2) << 8 | _.charCodeAt(S + 3) & 255;
|
|
11371
11371
|
}
|
|
11372
11372
|
function i(_, S, A, T) {
|
|
11373
|
-
const E = _.substring(0, S),
|
|
11374
|
-
return E + T +
|
|
11373
|
+
const E = _.substring(0, S), O = _.substring(S + A);
|
|
11374
|
+
return E + T + O;
|
|
11375
11375
|
}
|
|
11376
11376
|
let n, r;
|
|
11377
11377
|
const o = this._document.createElement("canvas");
|
|
@@ -12003,14 +12003,14 @@ class sf extends pl {
|
|
|
12003
12003
|
const g = (m, v, y) => {
|
|
12004
12004
|
const _ = new Array(256), S = (u - c) / y, A = m / 255, T = (v - m) / (255 * y);
|
|
12005
12005
|
let E = 0;
|
|
12006
|
-
for (let
|
|
12007
|
-
const N = Math.round(c +
|
|
12006
|
+
for (let O = 0; O <= y; O++) {
|
|
12007
|
+
const N = Math.round(c + O * S), D = A + O * T;
|
|
12008
12008
|
for (let L = E; L <= N; L++)
|
|
12009
12009
|
_[L] = D;
|
|
12010
12010
|
E = N + 1;
|
|
12011
12011
|
}
|
|
12012
|
-
for (let
|
|
12013
|
-
_[
|
|
12012
|
+
for (let O = E; O < 256; O++)
|
|
12013
|
+
_[O] = _[E - 1];
|
|
12014
12014
|
return _.join(",");
|
|
12015
12015
|
}, p = `g_${this.#i}_hcm_${t}_filter`, b = o.filter = this.#g(p);
|
|
12016
12016
|
return this.#o(b), this.#p(g(d[0], f[0], 5), g(d[1], f[1], 5), g(d[2], f[2], 5), b), o.url = this.#u(p), o.url;
|
|
@@ -12142,22 +12142,22 @@ function fr(a, t, e, s, i, n, r, o) {
|
|
|
12142
12142
|
const f = (h[e] + t.offsetX) * t.scaleX, g = (h[e + 1] + t.offsetY) * t.scaleY, p = (h[s] + t.offsetX) * t.scaleX, b = (h[s + 1] + t.offsetY) * t.scaleY, m = (h[i] + t.offsetX) * t.scaleX, v = (h[i + 1] + t.offsetY) * t.scaleY;
|
|
12143
12143
|
if (g >= v)
|
|
12144
12144
|
return;
|
|
12145
|
-
const y = l[n], _ = l[n + 1], S = l[n + 2], A = l[r], T = l[r + 1], E = l[r + 2],
|
|
12146
|
-
let
|
|
12145
|
+
const y = l[n], _ = l[n + 1], S = l[n + 2], A = l[r], T = l[r + 1], E = l[r + 2], O = l[o], N = l[o + 1], D = l[o + 2], L = Math.round(g), k = Math.round(v);
|
|
12146
|
+
let P, j, M, R, G, it, at, xt;
|
|
12147
12147
|
for (let gt = L; gt <= k; gt++) {
|
|
12148
12148
|
if (gt < b) {
|
|
12149
12149
|
const K = gt < g ? 0 : (g - gt) / (g - b);
|
|
12150
|
-
|
|
12150
|
+
P = f - (f - p) * K, j = y - (y - A) * K, M = _ - (_ - T) * K, R = S - (S - E) * K;
|
|
12151
12151
|
} else {
|
|
12152
12152
|
let K;
|
|
12153
|
-
gt > v ? K = 1 : b === v ? K = 0 : K = (b - gt) / (b - v),
|
|
12153
|
+
gt > v ? K = 1 : b === v ? K = 0 : K = (b - gt) / (b - v), P = p - (p - m) * K, j = A - (A - O) * K, M = T - (T - N) * K, R = E - (E - D) * K;
|
|
12154
12154
|
}
|
|
12155
12155
|
let et;
|
|
12156
|
-
gt < g ? et = 0 : gt > v ? et = 1 : et = (g - gt) / (g - v), G = f - (f - m) * et, it = y - (y -
|
|
12157
|
-
const Pt = Math.round(Math.min(
|
|
12156
|
+
gt < g ? et = 0 : gt > v ? et = 1 : et = (g - gt) / (g - v), G = f - (f - m) * et, it = y - (y - O) * et, at = _ - (_ - N) * et, xt = S - (S - D) * et;
|
|
12157
|
+
const Pt = Math.round(Math.min(P, G)), fe = Math.round(Math.max(P, G));
|
|
12158
12158
|
let ht = u * gt + Pt * 4;
|
|
12159
12159
|
for (let K = Pt; K <= fe; K++)
|
|
12160
|
-
et = (
|
|
12160
|
+
et = (P - K) / (P - G), et < 0 ? et = 0 : et > 1 && (et = 1), c[ht++] = j - (j - it) * et | 0, c[ht++] = M - (M - at) * et | 0, c[ht++] = R - (R - xt) * et | 0, c[ht++] = 255;
|
|
12161
12161
|
}
|
|
12162
12162
|
}
|
|
12163
12163
|
function lf(a, t, e) {
|
|
@@ -12262,11 +12262,11 @@ class yo {
|
|
|
12262
12262
|
h = Math.abs(h), l = Math.abs(l), In("TilingType: " + n);
|
|
12263
12263
|
const c = e[0], u = e[1], d = e[2], f = e[3], g = d - c, p = f - u, b = B.singularValueDecompose2dScale(this.matrix), m = B.singularValueDecompose2dScale(this.baseTransform), v = b[0] * m[0], y = b[1] * m[1];
|
|
12264
12264
|
let _ = g, S = p, A = !1, T = !1;
|
|
12265
|
-
const E = Math.ceil(h * v),
|
|
12266
|
-
E >= N ? _ = h : A = !0,
|
|
12267
|
-
const L = this.getSizeAndScale(_, this.ctx.canvas.width, v), k = this.getSizeAndScale(S, this.ctx.canvas.height, y),
|
|
12265
|
+
const E = Math.ceil(h * v), O = Math.ceil(l * y), N = Math.ceil(g * v), D = Math.ceil(p * y);
|
|
12266
|
+
E >= N ? _ = h : A = !0, O >= D ? S = l : T = !0;
|
|
12267
|
+
const L = this.getSizeAndScale(_, this.ctx.canvas.width, v), k = this.getSizeAndScale(S, this.ctx.canvas.height, y), P = t.cachedCanvases.getCanvas("pattern", L.size, k.size), j = P.context, M = o.createCanvasGraphics(j);
|
|
12268
12268
|
if (M.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext(M, i, r), j.translate(-L.scale * c, -k.scale * u), M.transform(L.scale, 0, 0, k.scale, 0, 0), j.save(), this.clipBbox(M, c, u, d, f), M.baseTransform = rt(M.ctx), M.executeOperatorList(s), M.endDrawing(), j.restore(), A || T) {
|
|
12269
|
-
const R =
|
|
12269
|
+
const R = P.canvas;
|
|
12270
12270
|
A && (_ = h), T && (S = l);
|
|
12271
12271
|
const G = this.getSizeAndScale(_, this.ctx.canvas.width, v), it = this.getSizeAndScale(S, this.ctx.canvas.height, y), at = G.size, xt = it.size, gt = t.cachedCanvases.getCanvas("pattern-workaround", at, xt), et = gt.context, Pt = A ? Math.floor(g / h) : 0, fe = T ? Math.floor(p / l) : 0;
|
|
12272
12272
|
for (let ht = 0; ht <= Pt; ht++)
|
|
@@ -12281,7 +12281,7 @@ class yo {
|
|
|
12281
12281
|
};
|
|
12282
12282
|
}
|
|
12283
12283
|
return {
|
|
12284
|
-
canvas:
|
|
12284
|
+
canvas: P.canvas,
|
|
12285
12285
|
scaleX: L.scale,
|
|
12286
12286
|
scaleY: k.scale,
|
|
12287
12287
|
offsetX: c,
|
|
@@ -12412,12 +12412,12 @@ class mf {
|
|
|
12412
12412
|
function Ui(a, t, e, s, i, n, r, o, h, l) {
|
|
12413
12413
|
const [c, u, d, f, g, p] = rt(a);
|
|
12414
12414
|
if (u === 0 && d === 0) {
|
|
12415
|
-
const v = r * c + g, y = Math.round(v), _ = o * f + p, S = Math.round(_), A = (r + h) * c + g, T = Math.abs(Math.round(A) - y) || 1, E = (o + l) * f + p,
|
|
12416
|
-
return a.setTransform(Math.sign(c), 0, 0, Math.sign(f), y, S), a.drawImage(t, e, s, i, n, 0, 0, T,
|
|
12415
|
+
const v = r * c + g, y = Math.round(v), _ = o * f + p, S = Math.round(_), A = (r + h) * c + g, T = Math.abs(Math.round(A) - y) || 1, E = (o + l) * f + p, O = Math.abs(Math.round(E) - S) || 1;
|
|
12416
|
+
return a.setTransform(Math.sign(c), 0, 0, Math.sign(f), y, S), a.drawImage(t, e, s, i, n, 0, 0, T, O), a.setTransform(c, u, d, f, g, p), [T, O];
|
|
12417
12417
|
}
|
|
12418
12418
|
if (c === 0 && f === 0) {
|
|
12419
|
-
const v = o * d + g, y = Math.round(v), _ = r * u + p, S = Math.round(_), A = (o + l) * d + g, T = Math.abs(Math.round(A) - y) || 1, E = (r + h) * u + p,
|
|
12420
|
-
return a.setTransform(0, Math.sign(u), Math.sign(d), 0, y, S), a.drawImage(t, e, s, i, n, 0, 0,
|
|
12419
|
+
const v = o * d + g, y = Math.round(v), _ = r * u + p, S = Math.round(_), A = (o + l) * d + g, T = Math.abs(Math.round(A) - y) || 1, E = (r + h) * u + p, O = Math.abs(Math.round(E) - S) || 1;
|
|
12420
|
+
return a.setTransform(0, Math.sign(u), Math.sign(d), 0, y, S), a.drawImage(t, e, s, i, n, 0, 0, O, T), a.setTransform(c, u, d, f, g, p), [O, T];
|
|
12421
12421
|
}
|
|
12422
12422
|
a.drawImage(t, e, s, i, n, r, o, h, l);
|
|
12423
12423
|
const b = Math.hypot(c, u), m = Math.hypot(d, f);
|
|
@@ -12542,9 +12542,9 @@ function Pa(a, t) {
|
|
|
12542
12542
|
for (g = d < n ? Vt : i, l = 0, f = 0; f < g; f++) {
|
|
12543
12543
|
const A = b - h;
|
|
12544
12544
|
let T = 0;
|
|
12545
|
-
const E = A > y ? s : A * 8 - 7,
|
|
12545
|
+
const E = A > y ? s : A * 8 - 7, O = E & -8;
|
|
12546
12546
|
let N = 0, D = 0;
|
|
12547
|
-
for (; T <
|
|
12547
|
+
for (; T < O; T += 8)
|
|
12548
12548
|
D = c[h++], m[l++] = D & 128 ? _ : S, m[l++] = D & 64 ? _ : S, m[l++] = D & 32 ? _ : S, m[l++] = D & 16 ? _ : S, m[l++] = D & 8 ? _ : S, m[l++] = D & 4 ? _ : S, m[l++] = D & 2 ? _ : S, m[l++] = D & 1 ? _ : S;
|
|
12549
12549
|
for (; T < E; T++)
|
|
12550
12550
|
N === 0 && (D = c[h++], N = 128), m[l++] = D & N ? _ : S, N >>= 1;
|
|
@@ -12709,16 +12709,16 @@ class Es {
|
|
|
12709
12709
|
if ((t.bitmap || t.data) && t.count > 1) {
|
|
12710
12710
|
const E = t.bitmap || t.data.buffer;
|
|
12711
12711
|
l = JSON.stringify(r ? o : [o.slice(0, 4), n]), h = this._cachedBitmapsMap.get(E), h || (h = /* @__PURE__ */ new Map(), this._cachedBitmapsMap.set(E, h));
|
|
12712
|
-
const
|
|
12713
|
-
if (
|
|
12712
|
+
const O = h.get(l);
|
|
12713
|
+
if (O && !r) {
|
|
12714
12714
|
const N = Math.round(Math.min(o[0], o[2]) + o[4]), D = Math.round(Math.min(o[1], o[3]) + o[5]);
|
|
12715
12715
|
return {
|
|
12716
|
-
canvas:
|
|
12716
|
+
canvas: O,
|
|
12717
12717
|
offsetX: N,
|
|
12718
12718
|
offsetY: D
|
|
12719
12719
|
};
|
|
12720
12720
|
}
|
|
12721
|
-
c =
|
|
12721
|
+
c = O;
|
|
12722
12722
|
}
|
|
12723
12723
|
c || (u = this.cachedCanvases.getCanvas("maskCanvas", s, i), Oa(u.context, t));
|
|
12724
12724
|
let d = B.transform(o, [1 / s, 0, 0, -1 / i, 0, 0]);
|
|
@@ -13066,8 +13066,8 @@ class Es {
|
|
|
13066
13066
|
if (r !== 1 && (n.scale(r, r), y /= r), n.lineWidth = y, s.isInvalidPDFjsFont) {
|
|
13067
13067
|
const T = [];
|
|
13068
13068
|
let E = 0;
|
|
13069
|
-
for (const
|
|
13070
|
-
T.push(
|
|
13069
|
+
for (const O of t)
|
|
13070
|
+
T.push(O.unicode), E += O.width;
|
|
13071
13071
|
n.fillText(T.join(""), 0, 0), e.x += E * p * c, n.restore(), this.compose();
|
|
13072
13072
|
return;
|
|
13073
13073
|
}
|
|
@@ -13079,19 +13079,19 @@ class Es {
|
|
|
13079
13079
|
continue;
|
|
13080
13080
|
}
|
|
13081
13081
|
let E = !1;
|
|
13082
|
-
const
|
|
13083
|
-
let L, k,
|
|
13082
|
+
const O = (T.isSpace ? h : 0) + o, N = T.fontChar, D = T.accent;
|
|
13083
|
+
let L, k, P = T.width;
|
|
13084
13084
|
if (d) {
|
|
13085
|
-
const M = T.vmetric || g, R = -(T.vmetric ? M[1] :
|
|
13086
|
-
|
|
13085
|
+
const M = T.vmetric || g, R = -(T.vmetric ? M[1] : P * 0.5) * p, G = M[2] * p;
|
|
13086
|
+
P = M ? -M[0] : P, L = R / r, k = (S + G) / r;
|
|
13087
13087
|
} else
|
|
13088
13088
|
L = S / r, k = 0;
|
|
13089
|
-
if (s.remeasure &&
|
|
13089
|
+
if (s.remeasure && P > 0) {
|
|
13090
13090
|
const M = n.measureText(N).width * 1e3 / i * r;
|
|
13091
|
-
if (
|
|
13092
|
-
const R =
|
|
13091
|
+
if (P < M && this.isFontSubpixelAAEnabled) {
|
|
13092
|
+
const R = P / M;
|
|
13093
13093
|
E = !0, n.save(), n.scale(R, 1), L /= R;
|
|
13094
|
-
} else
|
|
13094
|
+
} else P !== M && (L += (P - M) / 2e3 * i / r);
|
|
13095
13095
|
}
|
|
13096
13096
|
if (this.contentVisible && (T.isInFont || s.missingFile)) {
|
|
13097
13097
|
if (b && !D)
|
|
@@ -13101,7 +13101,7 @@ class Es {
|
|
|
13101
13101
|
this.paintChar(D.fontChar, M, R, m, v);
|
|
13102
13102
|
}
|
|
13103
13103
|
}
|
|
13104
|
-
const j = d ?
|
|
13104
|
+
const j = d ? P * p - O * l : P * p + O * l;
|
|
13105
13105
|
S += j, E && n.restore();
|
|
13106
13106
|
}
|
|
13107
13107
|
d ? e.y -= S : e.x += S * c, n.restore(), this.compose();
|
|
@@ -14877,7 +14877,7 @@ function qf(a = {}) {
|
|
|
14877
14877
|
docId: e
|
|
14878
14878
|
} = t, s = a.url ? Kf(a.url) : null, i = a.data ? Jf(a.data) : null, n = a.httpHeaders || null, r = a.withCredentials === !0, o = a.password ?? null, h = a.range instanceof Al ? a.range : null, l = Number.isInteger(a.rangeChunkSize) && a.rangeChunkSize > 0 ? a.rangeChunkSize : Gf;
|
|
14879
14879
|
let c = a.worker instanceof ks ? a.worker : null;
|
|
14880
|
-
const u = a.verbosity, d = typeof a.docBaseUrl == "string" && !Bn(a.docBaseUrl) ? a.docBaseUrl : null, f = typeof a.cMapUrl == "string" ? a.cMapUrl : null, g = a.cMapPacked !== !1, p = a.CMapReaderFactory || Uf, b = typeof a.standardFontDataUrl == "string" ? a.standardFontDataUrl : null, m = a.StandardFontDataFactory || $f, v = a.stopAtErrors !== !0, y = Number.isInteger(a.maxImageSize) && a.maxImageSize > -1 ? a.maxImageSize : -1, _ = a.isEvalSupported !== !1, S = typeof a.isOffscreenCanvasSupported == "boolean" ? a.isOffscreenCanvasSupported : !kt, A = typeof a.isImageDecoderSupported == "boolean" ? a.isImageDecoderSupported : !kt && (jt.platform.isFirefox || !globalThis.chrome), T = Number.isInteger(a.canvasMaxAreaInBytes) ? a.canvasMaxAreaInBytes : -1, E = typeof a.disableFontFace == "boolean" ? a.disableFontFace : kt,
|
|
14880
|
+
const u = a.verbosity, d = typeof a.docBaseUrl == "string" && !Bn(a.docBaseUrl) ? a.docBaseUrl : null, f = typeof a.cMapUrl == "string" ? a.cMapUrl : null, g = a.cMapPacked !== !1, p = a.CMapReaderFactory || Uf, b = typeof a.standardFontDataUrl == "string" ? a.standardFontDataUrl : null, m = a.StandardFontDataFactory || $f, v = a.stopAtErrors !== !0, y = Number.isInteger(a.maxImageSize) && a.maxImageSize > -1 ? a.maxImageSize : -1, _ = a.isEvalSupported !== !1, S = typeof a.isOffscreenCanvasSupported == "boolean" ? a.isOffscreenCanvasSupported : !kt, A = typeof a.isImageDecoderSupported == "boolean" ? a.isImageDecoderSupported : !kt && (jt.platform.isFirefox || !globalThis.chrome), T = Number.isInteger(a.canvasMaxAreaInBytes) ? a.canvasMaxAreaInBytes : -1, E = typeof a.disableFontFace == "boolean" ? a.disableFontFace : kt, O = a.fontExtraProperties === !0, N = a.enableXfa === !0, D = a.ownerDocument || globalThis.document, L = a.disableRange === !0, k = a.disableStream === !0, P = a.disableAutoFetch === !0, j = a.pdfBug === !0, M = a.CanvasFactory || Wf, R = a.FilterFactory || Yf, G = a.enableHWA === !0, it = h ? h.length : a.length ?? NaN, at = typeof a.useSystemFonts == "boolean" ? a.useSystemFonts : !kt && !E, xt = typeof a.useWorkerFetch == "boolean" ? a.useWorkerFetch : p === gl && m === bl && f && b && Ks(f, document.baseURI) && Ks(b, document.baseURI), gt = null;
|
|
14881
14881
|
Rd(u);
|
|
14882
14882
|
const et = {
|
|
14883
14883
|
canvasFactory: new M({
|
|
@@ -14908,7 +14908,7 @@ function qf(a = {}) {
|
|
|
14908
14908
|
apiVersion: "4.10.38",
|
|
14909
14909
|
data: i,
|
|
14910
14910
|
password: o,
|
|
14911
|
-
disableAutoFetch:
|
|
14911
|
+
disableAutoFetch: P,
|
|
14912
14912
|
rangeChunkSize: l,
|
|
14913
14913
|
length: it,
|
|
14914
14914
|
docBaseUrl: d,
|
|
@@ -14921,19 +14921,19 @@ function qf(a = {}) {
|
|
|
14921
14921
|
isOffscreenCanvasSupported: S,
|
|
14922
14922
|
isImageDecoderSupported: A,
|
|
14923
14923
|
canvasMaxAreaInBytes: T,
|
|
14924
|
-
fontExtraProperties:
|
|
14924
|
+
fontExtraProperties: O,
|
|
14925
14925
|
useSystemFonts: at,
|
|
14926
14926
|
cMapUrl: xt ? f : null,
|
|
14927
14927
|
standardFontDataUrl: xt ? b : null
|
|
14928
14928
|
}
|
|
14929
14929
|
}, fe = {
|
|
14930
14930
|
disableFontFace: E,
|
|
14931
|
-
fontExtraProperties:
|
|
14931
|
+
fontExtraProperties: O,
|
|
14932
14932
|
ownerDocument: D,
|
|
14933
14933
|
pdfBug: j,
|
|
14934
14934
|
styleElement: gt,
|
|
14935
14935
|
loadingParams: {
|
|
14936
|
-
disableAutoFetch:
|
|
14936
|
+
disableAutoFetch: P,
|
|
14937
14937
|
enableXfa: N
|
|
14938
14938
|
}
|
|
14939
14939
|
};
|
|
@@ -16783,8 +16783,8 @@ class ft {
|
|
|
16783
16783
|
const f = c.createElement("clipPath"), g = `clippath_${this.data.id}`;
|
|
16784
16784
|
f.setAttribute("id", g), f.setAttribute("clipPathUnits", "objectBoundingBox"), d.append(f);
|
|
16785
16785
|
for (let p = 2, b = t.length; p < b; p += 8) {
|
|
16786
|
-
const m = t[p], v = t[p + 1], y = t[p + 2], _ = t[p + 3], S = c.createElement("rect"), A = (y - e) / h, T = (n - v) / l, E = (m - y) / h,
|
|
16787
|
-
S.setAttribute("x", A), S.setAttribute("y", T), S.setAttribute("width", E), S.setAttribute("height",
|
|
16786
|
+
const m = t[p], v = t[p + 1], y = t[p + 2], _ = t[p + 3], S = c.createElement("rect"), A = (y - e) / h, T = (n - v) / l, E = (m - y) / h, O = (v - _) / l;
|
|
16787
|
+
S.setAttribute("x", A), S.setAttribute("y", T), S.setAttribute("width", E), S.setAttribute("height", O), f.append(S), o?.push(`<rect vector-effect="non-scaling-stroke" x="${A}" y="${T}" width="${E}" height="${O}"/>`);
|
|
16788
16788
|
}
|
|
16789
16789
|
this.#e && (o.push("</g></svg>')"), r.backgroundImage = o.join("")), this.container.append(u), this.container.style.clipPath = `url(#${g})`;
|
|
16790
16790
|
}
|
|
@@ -18924,8 +18924,8 @@ class Ir {
|
|
|
18924
18924
|
width: v,
|
|
18925
18925
|
height: y
|
|
18926
18926
|
} of t) {
|
|
18927
|
-
const _ = Math.floor((b - e) / l) * l, S = Math.ceil((b + v + e) / l) * l, A = Math.floor((m - e) / l) * l, T = Math.ceil((m + y + e) / l) * l, E = [_, A, T, !0],
|
|
18928
|
-
this.#s.push(E,
|
|
18927
|
+
const _ = Math.floor((b - e) / l) * l, S = Math.ceil((b + v + e) / l) * l, A = Math.floor((m - e) / l) * l, T = Math.ceil((m + y + e) / l) * l, E = [_, A, T, !0], O = [S, A, T, !1];
|
|
18928
|
+
this.#s.push(E, O), n = Math.min(n, _), r = Math.max(r, S), o = Math.min(o, A), h = Math.max(h, T);
|
|
18929
18929
|
}
|
|
18930
18930
|
const c = r - n + 2 * s, u = h - o + 2 * s, d = n - s, f = o - s, g = this.#s.at(i ? -1 : -2), p = [g[0], g[2]];
|
|
18931
18931
|
for (const b of this.#s) {
|
|
@@ -20543,8 +20543,8 @@ class Vn extends I {
|
|
|
20543
20543
|
let [_, S, A, T] = m.subarray(0, 4);
|
|
20544
20544
|
y.set([NaN, NaN, NaN, NaN, _, S], 0);
|
|
20545
20545
|
for (let E = 4; E < v; E += 2) {
|
|
20546
|
-
const
|
|
20547
|
-
y.set(I.createBezierPoints(_, S, A, T,
|
|
20546
|
+
const O = m[E], N = m[E + 1];
|
|
20547
|
+
y.set(I.createBezierPoints(_, S, A, T, O, N), (E - 2) * 3), [_, S, A, T] = [A, T, O, N];
|
|
20548
20548
|
}
|
|
20549
20549
|
}
|
|
20550
20550
|
}
|
|
@@ -22004,13 +22004,14 @@ async function Ig({ page: a, data: t, scale: e, password: s }, i) {
|
|
|
22004
22004
|
import.meta.url
|
|
22005
22005
|
), { type: "module" });
|
|
22006
22006
|
return o.postMessage({ data: r, password: s, id: i, page: a, units: n, scale: e }), await new Promise((l) => {
|
|
22007
|
-
o.addEventListener("message", (
|
|
22008
|
-
if (c.status
|
|
22009
|
-
|
|
22010
|
-
|
|
22011
|
-
|
|
22012
|
-
}
|
|
22013
|
-
|
|
22007
|
+
o.addEventListener("message", (c) => {
|
|
22008
|
+
if (c.data.status !== "success") return;
|
|
22009
|
+
const { bitmap: u, width: d, height: f, pages: g } = c.data;
|
|
22010
|
+
if (u) {
|
|
22011
|
+
const p = document.createElement("canvas"), b = p.getContext("bitmaprenderer");
|
|
22012
|
+
p.width = d, p.height = f, b?.transferFromImageBitmap(u), l({ pages: g, canvas: p });
|
|
22013
|
+
} else
|
|
22014
|
+
l({ pages: g, canvas: null });
|
|
22014
22015
|
});
|
|
22015
22016
|
});
|
|
22016
22017
|
} else {
|
|
@@ -22157,74 +22158,74 @@ function Qg(a) {
|
|
|
22157
22158
|
function d() {
|
|
22158
22159
|
if (!t || Ft.has(t)) return;
|
|
22159
22160
|
const k = Ng(t);
|
|
22160
|
-
return k.on("selection:created", (
|
|
22161
|
-
if (r?.(
|
|
22161
|
+
return k.on("selection:created", (P) => {
|
|
22162
|
+
if (r?.(P), P.selected.length <= 1) return;
|
|
22162
22163
|
const j = k.getActiveObject();
|
|
22163
22164
|
j && (l = j, e?.value && l.set(e.value), l._cornerSize = l.cornerSize, S(c));
|
|
22164
|
-
}), k.on("selection:cleared", (
|
|
22165
|
-
o?.(
|
|
22165
|
+
}), k.on("selection:cleared", (P) => {
|
|
22166
|
+
o?.(P), T(k);
|
|
22166
22167
|
}), s && k.on("mouse:down", s), i && k.on("mouse:move", i), n && k.on("mouse:up", n), k;
|
|
22167
22168
|
}
|
|
22168
|
-
function f(k,
|
|
22169
|
-
return $g(k,
|
|
22169
|
+
function f(k, P) {
|
|
22170
|
+
return $g(k, P, t);
|
|
22170
22171
|
}
|
|
22171
22172
|
function g(k) {
|
|
22172
22173
|
return jl(k, t);
|
|
22173
22174
|
}
|
|
22174
|
-
function p({ data: k, scale:
|
|
22175
|
-
return Il(t, { data: k, scale:
|
|
22175
|
+
function p({ data: k, scale: P = 0.5 }) {
|
|
22176
|
+
return Il(t, { data: k, scale: P });
|
|
22176
22177
|
}
|
|
22177
|
-
async function b(k,
|
|
22178
|
+
async function b(k, P, j) {
|
|
22178
22179
|
const M = Ft.get(t);
|
|
22179
22180
|
if (!M) return;
|
|
22180
|
-
const R = await Tt.fromURL(k, {}, { ...ql, ...
|
|
22181
|
+
const R = await Tt.fromURL(k, {}, { ...ql, ...P });
|
|
22181
22182
|
jr(R, j), M.add(R), v(M, R), M.setActiveObject(R);
|
|
22182
22183
|
}
|
|
22183
|
-
function m(k,
|
|
22184
|
+
function m(k, P, j) {
|
|
22184
22185
|
const M = Ft.get(t);
|
|
22185
22186
|
if (!M) return;
|
|
22186
22187
|
const R = new Ct(k, {
|
|
22187
22188
|
...Kl,
|
|
22188
|
-
...
|
|
22189
|
+
...P
|
|
22189
22190
|
});
|
|
22190
22191
|
jr(R, j), M.add(R), v(M, R), M.setActiveObject(R);
|
|
22191
22192
|
}
|
|
22192
|
-
function v(k,
|
|
22193
|
-
|
|
22193
|
+
function v(k, P) {
|
|
22194
|
+
P.on("selected", (j) => y({ canvas: k, target: j.target })), P.on("modified", (j) => y({ canvas: k, target: j.target })), P.on("scaling", () => T(k)), P.on("moving", () => T(k)), P.on("rotating", () => T(k)), P._cornerSize = P._cornerSize ?? P.cornerSize;
|
|
22194
22195
|
}
|
|
22195
22196
|
async function y({
|
|
22196
22197
|
canvas: k,
|
|
22197
|
-
target:
|
|
22198
|
+
target: P,
|
|
22198
22199
|
stroke: j = u.stroke,
|
|
22199
22200
|
uuid: M = Date.now()
|
|
22200
22201
|
}) {
|
|
22201
22202
|
if (k.getActiveObjects().length > 1 || h?.stroke === `${j}-${M}`) return;
|
|
22202
22203
|
const G = await Bg(u, M, j);
|
|
22203
|
-
T(k), h = G, l =
|
|
22204
|
+
T(k), h = G, l = P, _(k, P, M), S(c, !0), G && k.add(G);
|
|
22204
22205
|
}
|
|
22205
|
-
function _(k,
|
|
22206
|
+
function _(k, P, j) {
|
|
22206
22207
|
h && (h.on("selected", () => {
|
|
22207
|
-
k.remove(
|
|
22208
|
+
k.remove(P), T(k);
|
|
22208
22209
|
}), h.on("mouseover", () => {
|
|
22209
22210
|
y({
|
|
22210
22211
|
canvas: k,
|
|
22211
|
-
target:
|
|
22212
|
+
target: P,
|
|
22212
22213
|
stroke: u.hoverStroke,
|
|
22213
22214
|
uuid: j
|
|
22214
22215
|
});
|
|
22215
22216
|
}), h.on("mouseout", () => {
|
|
22216
|
-
y({ canvas: k, target:
|
|
22217
|
+
y({ canvas: k, target: P, stroke: u.stroke, uuid: j });
|
|
22217
22218
|
}));
|
|
22218
22219
|
}
|
|
22219
|
-
function S(k,
|
|
22220
|
+
function S(k, P = !1) {
|
|
22220
22221
|
const j = Ft.get(t);
|
|
22221
|
-
c = k, j && (Xg(l, k), Vg(l, k, h), !
|
|
22222
|
+
c = k, j && (Xg(l, k), Vg(l, k, h), !P && j.renderAll());
|
|
22222
22223
|
}
|
|
22223
22224
|
function A(k) {
|
|
22224
22225
|
if (!k) return;
|
|
22225
22226
|
u = { ...u, ...k };
|
|
22226
|
-
const
|
|
22227
|
-
!h || !l || !
|
|
22227
|
+
const P = Ft.get(t);
|
|
22228
|
+
!h || !l || !P || y({ target: l, canvas: P });
|
|
22228
22229
|
}
|
|
22229
22230
|
function T(k) {
|
|
22230
22231
|
l = null, h && (k.remove(h), h = null);
|
|
@@ -22232,7 +22233,7 @@ function Qg(a) {
|
|
|
22232
22233
|
function E() {
|
|
22233
22234
|
Wg(t);
|
|
22234
22235
|
}
|
|
22235
|
-
function
|
|
22236
|
+
function O() {
|
|
22236
22237
|
Ug(t);
|
|
22237
22238
|
}
|
|
22238
22239
|
function N(k) {
|
|
@@ -22252,7 +22253,7 @@ function Qg(a) {
|
|
|
22252
22253
|
addFabric: b,
|
|
22253
22254
|
addTextFabric: m,
|
|
22254
22255
|
clearActive: E,
|
|
22255
|
-
deleteCanvas:
|
|
22256
|
+
deleteCanvas: O,
|
|
22256
22257
|
scaleFabric: S,
|
|
22257
22258
|
setCloseSvgOptions: A,
|
|
22258
22259
|
setActiveFabric: N,
|
|
@@ -22318,13 +22319,14 @@ const ip = /* @__PURE__ */ Hl({
|
|
|
22318
22319
|
async function A() {
|
|
22319
22320
|
const { file: D, page: L, fileScale: k } = s;
|
|
22320
22321
|
globalThis.requestAnimationFrame(async () => {
|
|
22321
|
-
if (await Gl(), c(), D.data
|
|
22322
|
+
if (await Gl(), c(), D.data?.type.startsWith("image/")) {
|
|
22322
22323
|
g({ data: D.data, scale: k / 3 }), i("loaded");
|
|
22323
22324
|
return;
|
|
22324
22325
|
}
|
|
22325
|
-
|
|
22326
|
+
const P = D.canvas?.[L - 1] ?? D.data;
|
|
22327
|
+
P && await u({
|
|
22326
22328
|
page: L,
|
|
22327
|
-
data:
|
|
22329
|
+
data: P,
|
|
22328
22330
|
scale: k,
|
|
22329
22331
|
password: s.password
|
|
22330
22332
|
}), i("loaded");
|
|
@@ -22332,13 +22334,13 @@ const ip = /* @__PURE__ */ Hl({
|
|
|
22332
22334
|
}
|
|
22333
22335
|
function T(D) {
|
|
22334
22336
|
if (!s.isDrop || !D.dataTransfer) return;
|
|
22335
|
-
const { dataTransfer: L, offsetX: k, offsetY:
|
|
22336
|
-
M ? E(M, it, at) : j &&
|
|
22337
|
+
const { dataTransfer: L, offsetX: k, offsetY: P } = D, j = L.getData("text/plain"), M = L.getData("text/uri-list"), R = L.getData("custom/offset"), G = R ? JSON.parse(R) : null, it = { top: P, left: k }, at = { x: G?.offsetX ?? 0, y: G?.offsetY ?? 0 };
|
|
22338
|
+
M ? E(M, it, at) : j && O(j, it, at);
|
|
22337
22339
|
}
|
|
22338
22340
|
function E(D, L, k) {
|
|
22339
22341
|
d(D, { ...s.dropImageOptions, ...L }, k);
|
|
22340
22342
|
}
|
|
22341
|
-
function
|
|
22343
|
+
function O(D, L, k) {
|
|
22342
22344
|
f(D, { ...s.dropTextOptions, ...L }, k);
|
|
22343
22345
|
}
|
|
22344
22346
|
function N() {
|
|
@@ -22347,7 +22349,7 @@ const ip = /* @__PURE__ */ Hl({
|
|
|
22347
22349
|
return Wn([() => s.fileScale, () => s.page, () => s.file, () => s.password], N), Wn(h, (D) => m(D), { immediate: !0 }), Wn(() => s.closeSvgOptions, y, { immediate: !0 }), n(b), t({
|
|
22348
22350
|
reload: A,
|
|
22349
22351
|
addImage: E,
|
|
22350
|
-
addText:
|
|
22352
|
+
addText: O,
|
|
22351
22353
|
clearActive: p,
|
|
22352
22354
|
deleteCanvas: b,
|
|
22353
22355
|
setActiveFabric: v,
|