@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.
|
@@ -55,7 +55,7 @@ function sc() {
|
|
|
55
55
|
return "Suspense";
|
|
56
56
|
case T:
|
|
57
57
|
return "SuspenseList";
|
|
58
|
-
case
|
|
58
|
+
case j:
|
|
59
59
|
return "Activity";
|
|
60
60
|
}
|
|
61
61
|
if (typeof E == "object")
|
|
@@ -146,14 +146,14 @@ function sc() {
|
|
|
146
146
|
)), E = this.props.ref, E !== void 0 ? E : null;
|
|
147
147
|
}
|
|
148
148
|
function l(E, H, V, J, At, st) {
|
|
149
|
-
var
|
|
149
|
+
var N = V.ref;
|
|
150
150
|
return E = {
|
|
151
151
|
$$typeof: g,
|
|
152
152
|
type: E,
|
|
153
153
|
key: H,
|
|
154
154
|
props: V,
|
|
155
155
|
_owner: J
|
|
156
|
-
}, (
|
|
156
|
+
}, (N !== void 0 ? N : null) !== null ? Object.defineProperty(E, "ref", {
|
|
157
157
|
enumerable: !1,
|
|
158
158
|
get: h
|
|
159
159
|
}) : Object.defineProperty(E, "ref", { enumerable: !1, value: null }), E._store = {}, Object.defineProperty(E._store, "validated", {
|
|
@@ -179,24 +179,24 @@ function sc() {
|
|
|
179
179
|
}), Object.freeze && (Object.freeze(E.props), Object.freeze(E)), E;
|
|
180
180
|
}
|
|
181
181
|
function c(E, H, V, J, At, st) {
|
|
182
|
-
var
|
|
183
|
-
if (
|
|
182
|
+
var N = H.children;
|
|
183
|
+
if (N !== void 0)
|
|
184
184
|
if (J)
|
|
185
|
-
if (D(
|
|
186
|
-
for (J = 0; J <
|
|
187
|
-
u(
|
|
188
|
-
Object.freeze && Object.freeze(
|
|
185
|
+
if (D(N)) {
|
|
186
|
+
for (J = 0; J < N.length; J++)
|
|
187
|
+
u(N[J]);
|
|
188
|
+
Object.freeze && Object.freeze(N);
|
|
189
189
|
} else
|
|
190
190
|
console.error(
|
|
191
191
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
192
192
|
);
|
|
193
|
-
else u(
|
|
193
|
+
else u(N);
|
|
194
194
|
if (O.call(H, "key")) {
|
|
195
|
-
|
|
196
|
-
var
|
|
195
|
+
N = a(E);
|
|
196
|
+
var lt = Object.keys(H).filter(function(Wt) {
|
|
197
197
|
return Wt !== "key";
|
|
198
198
|
});
|
|
199
|
-
J = 0 <
|
|
199
|
+
J = 0 < lt.length ? "{key: someKey, " + lt.join(": ..., ") + ": ...}" : "{key: someKey}", ht[N + J] || (lt = 0 < lt.length ? "{" + lt.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
200
200
|
`A props object containing a "key" prop is being spread into JSX:
|
|
201
201
|
let props = %s;
|
|
202
202
|
<%s {...props} />
|
|
@@ -204,22 +204,22 @@ React keys must be passed directly to JSX without using spread:
|
|
|
204
204
|
let props = %s;
|
|
205
205
|
<%s key={someKey} {...props} />`,
|
|
206
206
|
J,
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
), ht[
|
|
207
|
+
N,
|
|
208
|
+
lt,
|
|
209
|
+
N
|
|
210
|
+
), ht[N + J] = !0);
|
|
211
211
|
}
|
|
212
|
-
if (
|
|
212
|
+
if (N = null, V !== void 0 && (e(V), N = "" + V), r(H) && (e(H.key), N = "" + H.key), "key" in H) {
|
|
213
213
|
V = {};
|
|
214
214
|
for (var Tt in H)
|
|
215
215
|
Tt !== "key" && (V[Tt] = H[Tt]);
|
|
216
216
|
} else V = H;
|
|
217
|
-
return
|
|
217
|
+
return N && o(
|
|
218
218
|
V,
|
|
219
219
|
typeof E == "function" ? E.displayName || E.name || "Unknown" : E
|
|
220
220
|
), l(
|
|
221
221
|
E,
|
|
222
|
-
|
|
222
|
+
N,
|
|
223
223
|
V,
|
|
224
224
|
i(),
|
|
225
225
|
At,
|
|
@@ -232,7 +232,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
232
232
|
function d(E) {
|
|
233
233
|
return typeof E == "object" && E !== null && E.$$typeof === g;
|
|
234
234
|
}
|
|
235
|
-
var f = Zl, g = Symbol.for("react.transitional.element"), p = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), y = Symbol.for("react.consumer"), _ = Symbol.for("react.context"), S = Symbol.for("react.forward_ref"), A = Symbol.for("react.suspense"), T = Symbol.for("react.suspense_list"), k = Symbol.for("react.memo"), P = Symbol.for("react.lazy"),
|
|
235
|
+
var f = Zl, g = Symbol.for("react.transitional.element"), p = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), y = Symbol.for("react.consumer"), _ = Symbol.for("react.context"), S = Symbol.for("react.forward_ref"), A = Symbol.for("react.suspense"), T = Symbol.for("react.suspense_list"), k = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), j = Symbol.for("react.activity"), F = Symbol.for("react.client.reference"), I = f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, O = Object.prototype.hasOwnProperty, D = Array.isArray, z = console.createTask ? console.createTask : function() {
|
|
236
236
|
return null;
|
|
237
237
|
};
|
|
238
238
|
f = {
|
|
@@ -2341,9 +2341,9 @@ let ke = class en extends zc {
|
|
|
2341
2341
|
toObject() {
|
|
2342
2342
|
const t = (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []).concat(en.customProperties, this.constructor.customProperties || []);
|
|
2343
2343
|
let e;
|
|
2344
|
-
const s = tt.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: k, flipY: P, opacity:
|
|
2344
|
+
const s = tt.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: k, flipY: P, opacity: j, visible: F, backgroundColor: I, fillRule: O, paintFirst: D, globalCompositeOperation: z, skewX: M, skewY: R } = this;
|
|
2345
2345
|
i && !i.excludeFromExport && (e = i.toObject(t.concat("inverted", "absolutePositioned")));
|
|
2346
|
-
const W = (ht) => nt(ht, s), ot = w(w({}, gs(this, t)), {}, { type: this.constructor.type, version: yr, originX: u, originY: d, left: W(l), top: W(c), width: W(f), height: W(g), fill: Xo(n) ? n.toObject() : n, stroke: Xo(r) ? r.toObject() : r, strokeWidth: W(p), strokeDashArray: h && h.concat(), strokeLineCap: b, strokeDashOffset: m, strokeLineJoin: v, strokeUniform: y, strokeMiterLimit: W(_), scaleX: W(S), scaleY: W(A), angle: W(T), flipX: k, flipY: P, opacity: W(
|
|
2346
|
+
const W = (ht) => nt(ht, s), ot = w(w({}, gs(this, t)), {}, { type: this.constructor.type, version: yr, originX: u, originY: d, left: W(l), top: W(c), width: W(f), height: W(g), fill: Xo(n) ? n.toObject() : n, stroke: Xo(r) ? r.toObject() : r, strokeWidth: W(p), strokeDashArray: h && h.concat(), strokeLineCap: b, strokeDashOffset: m, strokeLineJoin: v, strokeUniform: y, strokeMiterLimit: W(_), scaleX: W(S), scaleY: W(A), angle: W(T), flipX: k, flipY: P, opacity: W(j), shadow: o && o.toObject(), visible: F, backgroundColor: I, fillRule: O, paintFirst: D, globalCompositeOperation: z, skewX: W(M), skewY: W(R) }, e ? { clipPath: e } : null);
|
|
2347
2347
|
return this.includeDefaultValues ? ot : this._removeDefaultValues(ot);
|
|
2348
2348
|
}
|
|
2349
2349
|
toDatalessObject(t) {
|
|
@@ -2499,8 +2499,8 @@ function Fh(a, t, e, s, i) {
|
|
|
2499
2499
|
if (fe(n, h)) return !1;
|
|
2500
2500
|
const { origin: u, flip: d } = ir[r], f = yt(e[u]) * (n[d] ? -1 : 1), g = -Math.sign(f) * (n[c] ? -1 : 1), p = 0.5 * -((n[l] === 0 && to(e, $, $, s, i)[a] > 0 || n[l] > 0 ? 1 : -1) * g) + 0.5;
|
|
2501
2501
|
return Hs(sh, zs(((m, v, y, _) => (function(S, A, T) {
|
|
2502
|
-
let { target: k, ex: P, ey:
|
|
2503
|
-
const { skew: O } = ir[S], D = T.subtract(new C(P,
|
|
2502
|
+
let { target: k, ex: P, ey: j, skewingSide: F } = A, I = at(A, Jc);
|
|
2503
|
+
const { skew: O } = ir[S], D = T.subtract(new C(P, j)).divide(new C(k.scaleX, k.scaleY))[S], z = k[O], M = I[O], R = Math.tan(ft(M)), W = S === "y" ? k._getTransformedDimensions({ scaleX: 1, scaleY: 1, skewX: 0 }).x : k._getTransformedDimensions({ scaleX: 1, scaleY: 1 }).y, ot = 2 * D * F / Math.max(W, 1) + R, ht = Te(Math.atan(ot));
|
|
2504
2504
|
k.set(O, ht);
|
|
2505
2505
|
const E = z !== k[O];
|
|
2506
2506
|
if (E && S === "y") {
|
|
@@ -3392,18 +3392,18 @@ const Fu = (a, t, e) => {
|
|
|
3392
3392
|
const u = ((d, f, g, p, b, m, v) => {
|
|
3393
3393
|
if (g === 0 || p === 0) return [];
|
|
3394
3394
|
let y = 0, _ = 0, S = 0;
|
|
3395
|
-
const A = Math.PI, T = v * Vr, k = pe(T), P = ge(T),
|
|
3395
|
+
const A = Math.PI, T = v * Vr, k = pe(T), P = ge(T), j = 0.5 * (-P * d - k * f), F = 0.5 * (-P * f + k * d), I = g ** 2, O = p ** 2, D = F ** 2, z = j ** 2, M = I * O - I * D - O * z;
|
|
3396
3396
|
let R = Math.abs(g), W = Math.abs(p);
|
|
3397
3397
|
if (M < 0) {
|
|
3398
3398
|
const Wt = Math.sqrt(1 - M / (I * O));
|
|
3399
3399
|
R *= Wt, W *= Wt;
|
|
3400
3400
|
} else S = (b === m ? -1 : 1) * Math.sqrt(M / (I * D + O * z));
|
|
3401
|
-
const ot = S * R * F / W, ht = -S * W *
|
|
3402
|
-
let V = wa(1, 0, (
|
|
3401
|
+
const ot = S * R * F / W, ht = -S * W * j / R, E = P * ot - k * ht + 0.5 * d, H = k * ot + P * ht + 0.5 * f;
|
|
3402
|
+
let V = wa(1, 0, (j - ot) / R, (F - ht) / W), J = wa((j - ot) / R, (F - ht) / W, (-j - ot) / R, (-F - ht) / W);
|
|
3403
3403
|
m === 0 && J > 0 ? J -= 2 * A : m === 1 && J < 0 && (J += 2 * A);
|
|
3404
|
-
const At = Math.ceil(Math.abs(J / A * 2)), st = [],
|
|
3405
|
-
let Tt = V +
|
|
3406
|
-
for (let Wt = 0; Wt < At; Wt++) st[Wt] = Lu(V, Tt, P, k, R, W, E, H,
|
|
3404
|
+
const At = Math.ceil(Math.abs(J / A * 2)), st = [], N = J / At, lt = 8 / 3 * Math.sin(N / 4) * Math.sin(N / 4) / Math.sin(N / 2);
|
|
3405
|
+
let Tt = V + N;
|
|
3406
|
+
for (let Wt = 0; Wt < At; Wt++) st[Wt] = Lu(V, Tt, P, k, R, W, E, H, lt, y, _), y = st[Wt][5], _ = st[Wt][6], V = Tt, Tt += N;
|
|
3407
3407
|
return st;
|
|
3408
3408
|
})(l - a, c - t, i, n, o, h, r);
|
|
3409
3409
|
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;
|
|
@@ -5205,10 +5205,10 @@ class kt extends dl {
|
|
|
5205
5205
|
this.direction === "rtl" && (W = this.width - W - b), m && v && y && (t.fillStyle = v, t.fillRect(W, T + h * k + P - o * R, b, R)), p = D.left, b = D.width, m = _, y = A, v = S, k = z, P = M;
|
|
5206
5206
|
} else b += D.kernedWidth;
|
|
5207
5207
|
}
|
|
5208
|
-
let
|
|
5209
|
-
this.direction === "rtl" && (
|
|
5208
|
+
let j = i + g + p;
|
|
5209
|
+
this.direction === "rtl" && (j = this.width - j - b), t.fillStyle = S;
|
|
5210
5210
|
const F = this.fontSize * A / 1e3;
|
|
5211
|
-
_ && S && A && t.fillRect(
|
|
5211
|
+
_ && S && A && t.fillRect(j, T + h * k + P - o * F, b - r, F), s += u;
|
|
5212
5212
|
}
|
|
5213
5213
|
this._removeShadow(t);
|
|
5214
5214
|
}
|
|
@@ -6660,23 +6660,23 @@ async function Ed(a, t) {
|
|
|
6660
6660
|
const { x: S = 0, y: A = 0, transform: T = "" } = p, k = "".concat(T, " ").concat(_.transform || "", " translate(").concat(S, ", ").concat(A, ")");
|
|
6661
6661
|
if (lr(v), /^svg$/i.test(v.nodeName)) {
|
|
6662
6662
|
const P = v.ownerDocument.createElementNS(Sr, "g");
|
|
6663
|
-
Object.entries(_).forEach(((
|
|
6664
|
-
let [F, I] =
|
|
6663
|
+
Object.entries(_).forEach(((j) => {
|
|
6664
|
+
let [F, I] = j;
|
|
6665
6665
|
return P.setAttributeNS(Sr, F, I);
|
|
6666
6666
|
})), P.append(...v.childNodes), v = P;
|
|
6667
6667
|
}
|
|
6668
6668
|
for (const P of g) {
|
|
6669
6669
|
if (!P) continue;
|
|
6670
|
-
const { name:
|
|
6671
|
-
if (!d.includes(
|
|
6670
|
+
const { name: j, value: F } = P;
|
|
6671
|
+
if (!d.includes(j)) if (j === "style") {
|
|
6672
6672
|
const I = {};
|
|
6673
6673
|
Tr(F, I), Object.entries(_).forEach(((D) => {
|
|
6674
6674
|
let [z, M] = D;
|
|
6675
6675
|
I[z] = M;
|
|
6676
6676
|
})), Tr(_.style || "", I);
|
|
6677
6677
|
const O = Object.entries(I).map(((D) => D.join(":"))).join(";");
|
|
6678
|
-
v.setAttribute(
|
|
6679
|
-
} else !_[
|
|
6678
|
+
v.setAttribute(j, O);
|
|
6679
|
+
} else !_[j] && v.setAttribute(j, F);
|
|
6680
6680
|
}
|
|
6681
6681
|
v.setAttribute("transform", k), v.setAttribute("instantiated_by_use", "1"), v.removeAttribute("id"), f.parentNode.replaceChild(v, f);
|
|
6682
6682
|
}
|
|
@@ -7717,13 +7717,13 @@ class Yi extends Ct {
|
|
|
7717
7717
|
lanczosResize(t, e, s, i, n) {
|
|
7718
7718
|
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 };
|
|
7719
7719
|
return (function y(_) {
|
|
7720
|
-
let S, A, T, k, P,
|
|
7720
|
+
let S, A, T, k, P, j, F, I, O, D, z;
|
|
7721
7721
|
for (m.x = (_ + 0.5) * c, v.x = Math.floor(m.x), S = 0; S < n; S++) {
|
|
7722
|
-
for (m.y = (S + 0.5) * u, v.y = Math.floor(m.y), P = 0,
|
|
7722
|
+
for (m.y = (S + 0.5) * u, v.y = Math.floor(m.y), P = 0, j = 0, F = 0, I = 0, O = 0, A = v.x - g; A <= v.x + g; A++) if (!(A < 0 || A >= e)) {
|
|
7723
7723
|
D = Math.floor(1e3 * Math.abs(A - m.x)), b[D] || (b[D] = {});
|
|
7724
|
-
for (let M = v.y - p; M <= v.y + p; M++) M < 0 || M >= s || (z = Math.floor(1e3 * Math.abs(M - m.y)), b[D][z] || (b[D][z] = l(Math.sqrt(Math.pow(D * d, 2) + Math.pow(z * f, 2)) / 1e3)), T = b[D][z], T > 0 && (k = 4 * (M * e + A), P += T,
|
|
7724
|
+
for (let M = v.y - p; M <= v.y + p; M++) M < 0 || M >= s || (z = Math.floor(1e3 * Math.abs(M - m.y)), b[D][z] || (b[D][z] = l(Math.sqrt(Math.pow(D * d, 2) + Math.pow(z * f, 2)) / 1e3)), T = b[D][z], T > 0 && (k = 4 * (M * e + A), P += T, j += T * r[k], F += T * r[k + 1], I += T * r[k + 2], O += T * r[k + 3]));
|
|
7725
7725
|
}
|
|
7726
|
-
k = 4 * (S * i + _), h[k] =
|
|
7726
|
+
k = 4 * (S * i + _), h[k] = j / P, h[k + 1] = F / P, h[k + 2] = I / P, h[k + 3] = O / P;
|
|
7727
7727
|
}
|
|
7728
7728
|
return ++_ < i ? y(_) : o;
|
|
7729
7729
|
})(0);
|
|
@@ -7741,9 +7741,9 @@ class Yi extends Ct {
|
|
|
7741
7741
|
let b = 0, m = 0, v = 0, y = 0, _ = 0, S = 0, A = 0;
|
|
7742
7742
|
const T = (f + 0.5) * o;
|
|
7743
7743
|
for (let k = Math.floor(f * o); k < (f + 1) * o; k++) {
|
|
7744
|
-
const P = Math.abs(T - (k + 0.5)) / l,
|
|
7744
|
+
const P = Math.abs(T - (k + 0.5)) / l, j = (g + 0.5) * r, F = P * P;
|
|
7745
7745
|
for (let I = Math.floor(g * r); I < (g + 1) * r; I++) {
|
|
7746
|
-
let O = Math.abs(
|
|
7746
|
+
let O = Math.abs(j - (I + 0.5)) / h;
|
|
7747
7747
|
const D = Math.sqrt(F + O * O);
|
|
7748
7748
|
D > 1 && D < -1 || (b = 2 * D * D * D - 3 * D * D + 1, b > 0 && (O = 4 * (I + k * e), A += b * c[O + 3], v += b, c[O + 3] < 255 && (b = b * c[O + 3] / 250), y += b * c[O], _ += b * c[O + 1], S += b * c[O + 2], m += b));
|
|
7749
7749
|
}
|
|
@@ -8692,7 +8692,7 @@ function rf(a) {
|
|
|
8692
8692
|
}
|
|
8693
8693
|
t.remove();
|
|
8694
8694
|
}
|
|
8695
|
-
function
|
|
8695
|
+
function ut(a) {
|
|
8696
8696
|
const {
|
|
8697
8697
|
a: t,
|
|
8698
8698
|
b: e,
|
|
@@ -10851,10 +10851,10 @@ class U {
|
|
|
10851
10851
|
const y = p(o, h), _ = b(o, h);
|
|
10852
10852
|
let S = d(..._);
|
|
10853
10853
|
const A = U._round(n + S[0]), T = U._round(r + S[1]);
|
|
10854
|
-
let k = 1, P = 1,
|
|
10854
|
+
let k = 1, P = 1, j, F;
|
|
10855
10855
|
if (e.fromKeyboard)
|
|
10856
10856
|
({
|
|
10857
|
-
deltaX:
|
|
10857
|
+
deltaX: j,
|
|
10858
10858
|
deltaY: F
|
|
10859
10859
|
} = e);
|
|
10860
10860
|
else {
|
|
@@ -10862,12 +10862,12 @@ class U {
|
|
|
10862
10862
|
screenX: M,
|
|
10863
10863
|
screenY: R
|
|
10864
10864
|
} = e, [W, ot] = this.#c;
|
|
10865
|
-
[
|
|
10865
|
+
[j, F] = this.screenToPageTranslation(M - W, R - ot), this.#c[0] = M, this.#c[1] = R;
|
|
10866
10866
|
}
|
|
10867
|
-
if ([
|
|
10867
|
+
if ([j, F] = g(j / s, F / i), m) {
|
|
10868
10868
|
const M = Math.hypot(o, h);
|
|
10869
|
-
k = P = Math.max(Math.min(Math.hypot(_[0] - y[0] -
|
|
10870
|
-
} else v ? k = Math.max(l, Math.min(1, Math.abs(_[0] - y[0] -
|
|
10869
|
+
k = P = Math.max(Math.min(Math.hypot(_[0] - y[0] - j, _[1] - y[1] - F) / M, 1 / o, 1 / h), l / o, c / h);
|
|
10870
|
+
} else v ? k = Math.max(l, Math.min(1, Math.abs(_[0] - y[0] - j))) / o : P = Math.max(c, Math.min(1, Math.abs(_[1] - y[1] - F))) / h;
|
|
10871
10871
|
const I = U._round(o * k), O = U._round(h * P);
|
|
10872
10872
|
S = d(...b(I, O));
|
|
10873
10873
|
const D = A - S[0], z = T - S[1];
|
|
@@ -12264,10 +12264,10 @@ class ff extends El {
|
|
|
12264
12264
|
const _ = new Array(256), S = (u - c) / y, A = m / 255, T = (v - m) / (255 * y);
|
|
12265
12265
|
let k = 0;
|
|
12266
12266
|
for (let P = 0; P <= y; P++) {
|
|
12267
|
-
const
|
|
12268
|
-
for (let I = k; I <=
|
|
12267
|
+
const j = Math.round(c + P * S), F = A + P * T;
|
|
12268
|
+
for (let I = k; I <= j; I++)
|
|
12269
12269
|
_[I] = F;
|
|
12270
|
-
k =
|
|
12270
|
+
k = j + 1;
|
|
12271
12271
|
}
|
|
12272
12272
|
for (let P = k; P < 256; P++)
|
|
12273
12273
|
_[P] = _[k - 1];
|
|
@@ -12386,7 +12386,7 @@ class vf extends wo {
|
|
|
12386
12386
|
getPattern(t, e, s, i) {
|
|
12387
12387
|
let n;
|
|
12388
12388
|
if (i === Ot.STROKE || i === Ot.FILL) {
|
|
12389
|
-
const r = e.current.getClippedPathBoundingBox(i,
|
|
12389
|
+
const r = e.current.getClippedPathBoundingBox(i, ut(t)) || [0, 0, 0, 0], o = Math.ceil(r[2] - r[0]) || 1, h = Math.ceil(r[3] - r[1]) || 1, l = e.cachedCanvases.getCanvas("pattern", o, h), c = l.context;
|
|
12390
12390
|
c.clearRect(0, 0, c.canvas.width, c.canvas.height), c.beginPath(), c.rect(0, 0, c.canvas.width, c.canvas.height), c.translate(-r[0], -r[1]), s = G.transform(s, [1, 0, 0, 1, r[0], r[1]]), c.transform(...e.baseTransform), this.matrix && c.transform(...this.matrix), Nr(c, this._bbox), c.fillStyle = this._createGradient(c), c.fill(), n = t.createPattern(l.canvas, "no-repeat");
|
|
12391
12391
|
const u = new DOMMatrix(s);
|
|
12392
12392
|
n.setTransform(u);
|
|
@@ -12402,22 +12402,22 @@ function mr(a, t, e, s, i, n, r, o) {
|
|
|
12402
12402
|
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;
|
|
12403
12403
|
if (g >= v)
|
|
12404
12404
|
return;
|
|
12405
|
-
const y = l[n], _ = l[n + 1], S = l[n + 2], A = l[r], T = l[r + 1], k = l[r + 2], P = l[o],
|
|
12405
|
+
const y = l[n], _ = l[n + 1], S = l[n + 2], A = l[r], T = l[r + 1], k = l[r + 2], P = l[o], j = l[o + 1], F = l[o + 2], I = Math.round(g), O = Math.round(v);
|
|
12406
12406
|
let D, z, M, R, W, ot, ht, E;
|
|
12407
12407
|
for (let H = I; H <= O; H++) {
|
|
12408
12408
|
if (H < b) {
|
|
12409
|
-
const
|
|
12410
|
-
D = f - (f - p) *
|
|
12409
|
+
const N = H < g ? 0 : (g - H) / (g - b);
|
|
12410
|
+
D = f - (f - p) * N, z = y - (y - A) * N, M = _ - (_ - T) * N, R = S - (S - k) * N;
|
|
12411
12411
|
} else {
|
|
12412
|
-
let
|
|
12413
|
-
H > v ?
|
|
12412
|
+
let N;
|
|
12413
|
+
H > v ? N = 1 : b === v ? N = 0 : N = (b - H) / (b - v), D = p - (p - m) * N, z = A - (A - P) * N, M = T - (T - j) * N, R = k - (k - F) * N;
|
|
12414
12414
|
}
|
|
12415
12415
|
let V;
|
|
12416
|
-
H < g ? V = 0 : H > v ? V = 1 : V = (g - H) / (g - v), W = f - (f - m) * V, ot = y - (y - P) * V, ht = _ - (_ -
|
|
12416
|
+
H < g ? V = 0 : H > v ? V = 1 : V = (g - H) / (g - v), W = f - (f - m) * V, ot = y - (y - P) * V, ht = _ - (_ - j) * V, E = S - (S - F) * V;
|
|
12417
12417
|
const J = Math.round(Math.min(D, W)), At = Math.round(Math.max(D, W));
|
|
12418
12418
|
let st = u * H + J * 4;
|
|
12419
|
-
for (let
|
|
12420
|
-
V = (D -
|
|
12419
|
+
for (let N = J; N <= At; N++)
|
|
12420
|
+
V = (D - N) / (D - W), V < 0 ? V = 0 : V > 1 && (V = 1), c[st++] = z - (z - ot) * V | 0, c[st++] = M - (M - ht) * V | 0, c[st++] = R - (R - E) * V | 0, c[st++] = 255;
|
|
12421
12421
|
}
|
|
12422
12422
|
}
|
|
12423
12423
|
function yf(a, t, e) {
|
|
@@ -12472,7 +12472,7 @@ class _f extends wo {
|
|
|
12472
12472
|
Nr(t, this._bbox);
|
|
12473
12473
|
let n;
|
|
12474
12474
|
if (i === Ot.SHADING)
|
|
12475
|
-
n = G.singularValueDecompose2dScale(
|
|
12475
|
+
n = G.singularValueDecompose2dScale(ut(t));
|
|
12476
12476
|
else if (n = G.singularValueDecompose2dScale(e.baseTransform), this.matrix) {
|
|
12477
12477
|
const o = G.singularValueDecompose2dScale(this.matrix);
|
|
12478
12478
|
n = [n[0] * o[0], n[1] * o[1]];
|
|
@@ -12522,16 +12522,16 @@ class xo {
|
|
|
12522
12522
|
h = Math.abs(h), l = Math.abs(l), zn("TilingType: " + n);
|
|
12523
12523
|
const c = e[0], u = e[1], d = e[2], f = e[3], g = d - c, p = f - u, b = G.singularValueDecompose2dScale(this.matrix), m = G.singularValueDecompose2dScale(this.baseTransform), v = b[0] * m[0], y = b[1] * m[1];
|
|
12524
12524
|
let _ = g, S = p, A = !1, T = !1;
|
|
12525
|
-
const k = Math.ceil(h * v), P = Math.ceil(l * y),
|
|
12526
|
-
k >=
|
|
12525
|
+
const k = Math.ceil(h * v), P = Math.ceil(l * y), j = Math.ceil(g * v), F = Math.ceil(p * y);
|
|
12526
|
+
k >= j ? _ = h : A = !0, P >= F ? S = l : T = !0;
|
|
12527
12527
|
const I = this.getSizeAndScale(_, this.ctx.canvas.width, v), O = this.getSizeAndScale(S, this.ctx.canvas.height, y), D = t.cachedCanvases.getCanvas("pattern", I.size, O.size), z = D.context, M = o.createCanvasGraphics(z);
|
|
12528
|
-
if (M.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext(M, i, r), z.translate(-I.scale * c, -O.scale * u), M.transform(I.scale, 0, 0, O.scale, 0, 0), z.save(), this.clipBbox(M, c, u, d, f), M.baseTransform =
|
|
12528
|
+
if (M.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext(M, i, r), z.translate(-I.scale * c, -O.scale * u), M.transform(I.scale, 0, 0, O.scale, 0, 0), z.save(), this.clipBbox(M, c, u, d, f), M.baseTransform = ut(M.ctx), M.executeOperatorList(s), M.endDrawing(), z.restore(), A || T) {
|
|
12529
12529
|
const R = D.canvas;
|
|
12530
12530
|
A && (_ = h), T && (S = l);
|
|
12531
12531
|
const W = this.getSizeAndScale(_, this.ctx.canvas.width, v), ot = this.getSizeAndScale(S, this.ctx.canvas.height, y), ht = W.size, E = ot.size, H = t.cachedCanvases.getCanvas("pattern-workaround", ht, E), V = H.context, J = A ? Math.floor(g / h) : 0, At = T ? Math.floor(p / l) : 0;
|
|
12532
12532
|
for (let st = 0; st <= J; st++)
|
|
12533
|
-
for (let
|
|
12534
|
-
V.drawImage(R, ht * st, E *
|
|
12533
|
+
for (let N = 0; N <= At; N++)
|
|
12534
|
+
V.drawImage(R, ht * st, E * N, ht, E, 0, 0, ht, E);
|
|
12535
12535
|
return {
|
|
12536
12536
|
canvas: H.canvas,
|
|
12537
12537
|
scaleX: W.scale,
|
|
@@ -12558,7 +12558,7 @@ class xo {
|
|
|
12558
12558
|
}
|
|
12559
12559
|
clipBbox(t, e, s, i, n) {
|
|
12560
12560
|
const r = i - e, o = n - s;
|
|
12561
|
-
t.ctx.rect(e, s, r, o), t.current.updateRectMinMax(
|
|
12561
|
+
t.ctx.rect(e, s, r, o), t.current.updateRectMinMax(ut(t.ctx), [e, s, i, n]), t.clip(), t.endPath();
|
|
12562
12562
|
}
|
|
12563
12563
|
setFillAndStrokeStyleToContext(t, e, s) {
|
|
12564
12564
|
const i = t.ctx, n = t.current;
|
|
@@ -12670,7 +12670,7 @@ class Tf {
|
|
|
12670
12670
|
}
|
|
12671
12671
|
}
|
|
12672
12672
|
function Ji(a, t, e, s, i, n, r, o, h, l) {
|
|
12673
|
-
const [c, u, d, f, g, p] =
|
|
12673
|
+
const [c, u, d, f, g, p] = ut(a);
|
|
12674
12674
|
if (u === 0 && d === 0) {
|
|
12675
12675
|
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, k = (o + l) * f + p, P = Math.abs(Math.round(k) - S) || 1;
|
|
12676
12676
|
return a.setTransform(Math.sign(c), 0, 0, Math.sign(f), y, S), a.drawImage(t, e, s, i, n, 0, 0, T, P), a.setTransform(c, u, d, f, g, p), [T, P];
|
|
@@ -12803,11 +12803,11 @@ function Va(a, t) {
|
|
|
12803
12803
|
const A = b - h;
|
|
12804
12804
|
let T = 0;
|
|
12805
12805
|
const k = A > y ? s : A * 8 - 7, P = k & -8;
|
|
12806
|
-
let
|
|
12806
|
+
let j = 0, F = 0;
|
|
12807
12807
|
for (; T < P; T += 8)
|
|
12808
12808
|
F = c[h++], m[l++] = F & 128 ? _ : S, m[l++] = F & 64 ? _ : S, m[l++] = F & 32 ? _ : S, m[l++] = F & 16 ? _ : S, m[l++] = F & 8 ? _ : S, m[l++] = F & 4 ? _ : S, m[l++] = F & 2 ? _ : S, m[l++] = F & 1 ? _ : S;
|
|
12809
12809
|
for (; T < k; T++)
|
|
12810
|
-
|
|
12810
|
+
j === 0 && (F = c[h++], j = 128), m[l++] = F & j ? _ : S, j >>= 1;
|
|
12811
12811
|
}
|
|
12812
12812
|
for (; l < v; )
|
|
12813
12813
|
m[l++] = 0;
|
|
@@ -12890,9 +12890,9 @@ class ks {
|
|
|
12890
12890
|
const n = this.ctx.canvas.width, r = this.ctx.canvas.height, o = this.ctx.fillStyle;
|
|
12891
12891
|
if (this.ctx.fillStyle = i || "#ffffff", this.ctx.fillRect(0, 0, n, r), this.ctx.fillStyle = o, s) {
|
|
12892
12892
|
const h = this.cachedCanvases.getCanvas("transparent", n, r);
|
|
12893
|
-
this.compositeCtx = this.ctx, this.transparentCanvas = h.canvas, this.ctx = h.context, this.ctx.save(), this.ctx.transform(...
|
|
12893
|
+
this.compositeCtx = this.ctx, this.transparentCanvas = h.canvas, this.ctx = h.context, this.ctx.save(), this.ctx.transform(...ut(this.compositeCtx));
|
|
12894
12894
|
}
|
|
12895
|
-
this.ctx.save(), Zi(this.ctx), t && (this.ctx.transform(...t), this.outputScaleX = t[0], this.outputScaleY = t[0]), this.ctx.transform(...e.transform), this.viewportScale = e.scale, this.baseTransform =
|
|
12895
|
+
this.ctx.save(), Zi(this.ctx), t && (this.ctx.transform(...t), this.outputScaleX = t[0], this.outputScaleY = t[0]), this.ctx.transform(...e.transform), this.viewportScale = e.scale, this.baseTransform = ut(this.ctx);
|
|
12896
12896
|
}
|
|
12897
12897
|
executeOperatorList(t, e, s, i) {
|
|
12898
12898
|
const n = t.argsArray, r = t.fnArray;
|
|
@@ -12964,17 +12964,17 @@ class ks {
|
|
|
12964
12964
|
const e = this.ctx, {
|
|
12965
12965
|
width: s,
|
|
12966
12966
|
height: i
|
|
12967
|
-
} = t, n = this.current.fillColor, r = this.current.patternFill, o =
|
|
12967
|
+
} = t, n = this.current.fillColor, r = this.current.patternFill, o = ut(e);
|
|
12968
12968
|
let h, l, c, u;
|
|
12969
12969
|
if ((t.bitmap || t.data) && t.count > 1) {
|
|
12970
12970
|
const k = t.bitmap || t.data.buffer;
|
|
12971
12971
|
l = JSON.stringify(r ? o : [o.slice(0, 4), n]), h = this._cachedBitmapsMap.get(k), h || (h = /* @__PURE__ */ new Map(), this._cachedBitmapsMap.set(k, h));
|
|
12972
12972
|
const P = h.get(l);
|
|
12973
12973
|
if (P && !r) {
|
|
12974
|
-
const
|
|
12974
|
+
const j = Math.round(Math.min(o[0], o[2]) + o[4]), F = Math.round(Math.min(o[1], o[3]) + o[5]);
|
|
12975
12975
|
return {
|
|
12976
12976
|
canvas: P,
|
|
12977
|
-
offsetX:
|
|
12977
|
+
offsetX: j,
|
|
12978
12978
|
offsetY: F
|
|
12979
12979
|
};
|
|
12980
12980
|
}
|
|
@@ -12984,7 +12984,7 @@ class ks {
|
|
|
12984
12984
|
let d = G.transform(o, [1 / s, 0, 0, -1 / i, 0, 0]);
|
|
12985
12985
|
d = G.transform(d, [1, 0, 0, 1, 0, -i]);
|
|
12986
12986
|
const [f, g, p, b] = G.getAxialAlignedBoundingBox([0, 0, s, i], d), m = Math.round(p - f) || 1, v = Math.round(b - g) || 1, y = this.cachedCanvases.getCanvas("fillCanvas", m, v), _ = y.context, S = f, A = g;
|
|
12987
|
-
_.translate(-S, -A), _.transform(...d), c || (c = this._scaleImage(u.canvas, be(_)), c = c.img, h && r && h.set(l, c)), _.imageSmoothingEnabled = Xa(
|
|
12987
|
+
_.translate(-S, -A), _.transform(...d), c || (c = this._scaleImage(u.canvas, be(_)), c = c.img, h && r && h.set(l, c)), _.imageSmoothingEnabled = Xa(ut(_), t.interpolate), Ji(_, c, 0, 0, c.width, c.height, 0, 0, s, i), _.globalCompositeOperation = "source-in";
|
|
12988
12988
|
const T = G.transform(be(_), [1, 0, 0, 1, -S, -A]);
|
|
12989
12989
|
return _.fillStyle = r ? n.getPattern(e, this, T, Ot.FILL) : n, _.fillRect(0, 0, s, i), h && !r && (this.cachedCanvases.delete("fillCanvas"), h.set(l, y.canvas)), {
|
|
12990
12990
|
canvas: y.canvas,
|
|
@@ -13069,7 +13069,7 @@ class ks {
|
|
|
13069
13069
|
const t = this.ctx.canvas.width, e = this.ctx.canvas.height, s = "smaskGroupAt" + this.groupLevel, i = this.cachedCanvases.getCanvas(s, t, e);
|
|
13070
13070
|
this.suspendedCtx = this.ctx, this.ctx = i.context;
|
|
13071
13071
|
const n = this.ctx;
|
|
13072
|
-
n.setTransform(...
|
|
13072
|
+
n.setTransform(...ut(this.suspendedCtx)), $s(this.suspendedCtx, n), Af(n, this.suspendedCtx), this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]);
|
|
13073
13073
|
}
|
|
13074
13074
|
endSMaskMode() {
|
|
13075
13075
|
if (!this.inSMaskMode)
|
|
@@ -13118,7 +13118,7 @@ class ks {
|
|
|
13118
13118
|
constructPath(t, e, s) {
|
|
13119
13119
|
const i = this.ctx, n = this.current;
|
|
13120
13120
|
let r = n.x, o = n.y, h, l;
|
|
13121
|
-
const c =
|
|
13121
|
+
const c = ut(i), u = c[0] === 0 && c[3] === 0 || c[1] === 0 && c[2] === 0, d = u ? s.slice(0) : null;
|
|
13122
13122
|
for (let f = 0, g = 0, p = t.length; f < p; f++)
|
|
13123
13123
|
switch (t[f] | 0) {
|
|
13124
13124
|
case le.rectangle:
|
|
@@ -13275,7 +13275,7 @@ class ks {
|
|
|
13275
13275
|
} else
|
|
13276
13276
|
(u === Et.FILL || u === Et.FILL_STROKE) && r.fillText(t, e, s), (u === Et.STROKE || u === Et.FILL_STROKE) && r.strokeText(t, e, s);
|
|
13277
13277
|
d && (this.pendingTextPaths ||= []).push({
|
|
13278
|
-
transform:
|
|
13278
|
+
transform: ut(r),
|
|
13279
13279
|
x: e,
|
|
13280
13280
|
y: s,
|
|
13281
13281
|
fontSize: c,
|
|
@@ -13309,12 +13309,12 @@ class ks {
|
|
|
13309
13309
|
if (e.patternFill) {
|
|
13310
13310
|
n.save();
|
|
13311
13311
|
const T = e.fillColor.getPattern(n, this, be(n), Ot.FILL);
|
|
13312
|
-
m =
|
|
13312
|
+
m = ut(n), n.restore(), n.fillStyle = T;
|
|
13313
13313
|
}
|
|
13314
13314
|
if (e.patternStroke) {
|
|
13315
13315
|
n.save();
|
|
13316
13316
|
const T = e.strokeColor.getPattern(n, this, be(n), Ot.STROKE);
|
|
13317
|
-
v =
|
|
13317
|
+
v = ut(n), n.restore(), n.strokeStyle = T;
|
|
13318
13318
|
}
|
|
13319
13319
|
let y = e.lineWidth;
|
|
13320
13320
|
const _ = e.textMatrixScale;
|
|
@@ -13339,7 +13339,7 @@ class ks {
|
|
|
13339
13339
|
continue;
|
|
13340
13340
|
}
|
|
13341
13341
|
let k = !1;
|
|
13342
|
-
const P = (T.isSpace ? h : 0) + o,
|
|
13342
|
+
const P = (T.isSpace ? h : 0) + o, j = T.fontChar, F = T.accent;
|
|
13343
13343
|
let I, O, D = T.width;
|
|
13344
13344
|
if (d) {
|
|
13345
13345
|
const M = T.vmetric || g, R = -(T.vmetric ? M[1] : D * 0.5) * p, W = M[2] * p;
|
|
@@ -13347,7 +13347,7 @@ class ks {
|
|
|
13347
13347
|
} else
|
|
13348
13348
|
I = S / r, O = 0;
|
|
13349
13349
|
if (s.remeasure && D > 0) {
|
|
13350
|
-
const M = n.measureText(
|
|
13350
|
+
const M = n.measureText(j).width * 1e3 / i * r;
|
|
13351
13351
|
if (D < M && this.isFontSubpixelAAEnabled) {
|
|
13352
13352
|
const R = D / M;
|
|
13353
13353
|
k = !0, n.save(), n.scale(R, 1), I /= R;
|
|
@@ -13355,8 +13355,8 @@ class ks {
|
|
|
13355
13355
|
}
|
|
13356
13356
|
if (this.contentVisible && (T.isInFont || s.missingFile)) {
|
|
13357
13357
|
if (b && !F)
|
|
13358
|
-
n.fillText(
|
|
13359
|
-
else if (this.paintChar(
|
|
13358
|
+
n.fillText(j, I, O);
|
|
13359
|
+
else if (this.paintChar(j, I, O, m, v), F) {
|
|
13360
13360
|
const M = I + i * F.offset.x / r, R = O - i * F.offset.y / r;
|
|
13361
13361
|
this.paintChar(F.fontChar, M, R, m, v);
|
|
13362
13362
|
}
|
|
@@ -13393,7 +13393,7 @@ class ks {
|
|
|
13393
13393
|
getColorN_Pattern(t) {
|
|
13394
13394
|
let e;
|
|
13395
13395
|
if (t[0] === "TilingPattern") {
|
|
13396
|
-
const s = t[1], i = this.baseTransform ||
|
|
13396
|
+
const s = t[1], i = this.baseTransform || ut(this.ctx), n = {
|
|
13397
13397
|
createCanvasGraphics: (r) => new ks(r, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, {
|
|
13398
13398
|
optionalContentConfig: this.optionalContentConfig,
|
|
13399
13399
|
markedContentStack: this.markedContentStack
|
|
@@ -13451,9 +13451,9 @@ class ks {
|
|
|
13451
13451
|
rt("Should not call beginImageData");
|
|
13452
13452
|
}
|
|
13453
13453
|
paintFormXObjectBegin(t, e) {
|
|
13454
|
-
if (this.contentVisible && (this.save(), this.baseTransformStack.push(this.baseTransform), t && this.transform(...t), this.baseTransform =
|
|
13454
|
+
if (this.contentVisible && (this.save(), this.baseTransformStack.push(this.baseTransform), t && this.transform(...t), this.baseTransform = ut(this.ctx), e)) {
|
|
13455
13455
|
const s = e[2] - e[0], i = e[3] - e[1];
|
|
13456
|
-
this.ctx.rect(e[0], e[1], s, i), this.current.updateRectMinMax(
|
|
13456
|
+
this.ctx.rect(e[0], e[1], s, i), this.current.updateRectMinMax(ut(this.ctx), e), this.clip(), this.endPath();
|
|
13457
13457
|
}
|
|
13458
13458
|
}
|
|
13459
13459
|
paintFormXObjectEnd() {
|
|
@@ -13465,10 +13465,10 @@ class ks {
|
|
|
13465
13465
|
this.save(), this.inSMaskMode && (this.endSMaskMode(), this.current.activeSMask = null);
|
|
13466
13466
|
const e = this.ctx;
|
|
13467
13467
|
t.isolated || zn("TODO: Support non-isolated groups."), t.knockout && K("Knockout groups not supported.");
|
|
13468
|
-
const s =
|
|
13468
|
+
const s = ut(e);
|
|
13469
13469
|
if (t.matrix && e.transform(...t.matrix), !t.bbox)
|
|
13470
13470
|
throw new Error("Bounding box is required.");
|
|
13471
|
-
let i = G.getAxialAlignedBoundingBox(t.bbox,
|
|
13471
|
+
let i = G.getAxialAlignedBoundingBox(t.bbox, ut(e));
|
|
13472
13472
|
const n = [0, 0, e.canvas.width, e.canvas.height];
|
|
13473
13473
|
i = G.intersect(i, n) || [0, 0, 0, 0];
|
|
13474
13474
|
const r = Math.floor(i[0]), o = Math.floor(i[1]), h = Math.max(Math.ceil(i[2]) - r, 1), l = Math.max(Math.ceil(i[3]) - o, 1);
|
|
@@ -13496,7 +13496,7 @@ class ks {
|
|
|
13496
13496
|
this.tempSMask = this.smaskStack.pop(), this.restore();
|
|
13497
13497
|
else {
|
|
13498
13498
|
this.ctx.restore();
|
|
13499
|
-
const i =
|
|
13499
|
+
const i = ut(this.ctx);
|
|
13500
13500
|
this.restore(), this.ctx.save(), this.ctx.setTransform(...i);
|
|
13501
13501
|
const n = G.getAxialAlignedBoundingBox([0, 0, e.canvas.width, e.canvas.height], i);
|
|
13502
13502
|
this.ctx.drawImage(e.canvas, 0, 0), this.ctx.restore(), this.compose(n);
|
|
@@ -13507,7 +13507,7 @@ class ks {
|
|
|
13507
13507
|
const r = e[2] - e[0], o = e[3] - e[1];
|
|
13508
13508
|
if (n && this.annotationCanvasMap) {
|
|
13509
13509
|
s = s.slice(), s[4] -= e[0], s[5] -= e[1], e = e.slice(), e[0] = e[1] = 0, e[2] = r, e[3] = o;
|
|
13510
|
-
const [h, l] = G.singularValueDecompose2dScale(
|
|
13510
|
+
const [h, l] = G.singularValueDecompose2dScale(ut(this.ctx)), {
|
|
13511
13511
|
viewportScale: c
|
|
13512
13512
|
} = this, u = Math.ceil(r * this.outputScaleX * c), d = Math.ceil(o * this.outputScaleY * c);
|
|
13513
13513
|
this.annotationCanvas = this.canvasFactory.create(u, d);
|
|
@@ -13543,7 +13543,7 @@ class ks {
|
|
|
13543
13543
|
t = this.getObject(t.data, t);
|
|
13544
13544
|
const o = this.ctx;
|
|
13545
13545
|
o.save();
|
|
13546
|
-
const h =
|
|
13546
|
+
const h = ut(o);
|
|
13547
13547
|
o.transform(e, s, i, n, 0, 0);
|
|
13548
13548
|
const l = this._createMaskCanvas(t);
|
|
13549
13549
|
o.setTransform(1, 0, 0, 1, l.offsetX - h[4], l.offsetY - h[5]);
|
|
@@ -13633,7 +13633,7 @@ class ks {
|
|
|
13633
13633
|
Va(h, t), n = this.applyTransferMapsToCanvas(h);
|
|
13634
13634
|
}
|
|
13635
13635
|
const r = this._scaleImage(n, be(i));
|
|
13636
|
-
i.imageSmoothingEnabled = Xa(
|
|
13636
|
+
i.imageSmoothingEnabled = Xa(ut(i), t.interpolate), Ji(i, r.img, 0, 0, r.paintWidth, r.paintHeight, 0, -s, e, s), this.compose(), this.restore();
|
|
13637
13637
|
}
|
|
13638
13638
|
paintInlineImageXObjectGroup(t, e) {
|
|
13639
13639
|
if (!this.contentVisible)
|
|
@@ -13684,7 +13684,7 @@ class ks {
|
|
|
13684
13684
|
}
|
|
13685
13685
|
getSinglePixelWidth() {
|
|
13686
13686
|
if (!this._cachedGetSinglePixelWidth) {
|
|
13687
|
-
const t =
|
|
13687
|
+
const t = ut(this.ctx);
|
|
13688
13688
|
if (t[1] === 0 && t[2] === 0)
|
|
13689
13689
|
this._cachedGetSinglePixelWidth = 1 / Math.min(Math.abs(t[0]), Math.abs(t[3]));
|
|
13690
13690
|
else {
|
|
@@ -15137,7 +15137,7 @@ function rg(a = {}) {
|
|
|
15137
15137
|
docId: e
|
|
15138
15138
|
} = t, s = a.url ? og(a.url) : null, i = a.data ? ag(a.data) : null, n = a.httpHeaders || null, r = a.withCredentials === !0, o = a.password ?? null, h = a.range instanceof Nl ? a.range : null, l = Number.isInteger(a.rangeChunkSize) && a.rangeChunkSize > 0 ? a.rangeChunkSize : Zf;
|
|
15139
15139
|
let c = a.worker instanceof Ms ? a.worker : null;
|
|
15140
|
-
const u = a.verbosity, d = typeof a.docBaseUrl == "string" && !Wn(a.docBaseUrl) ? a.docBaseUrl : null, f = typeof a.cMapUrl == "string" ? a.cMapUrl : null, g = a.cMapPacked !== !1, p = a.CMapReaderFactory || sg, b = typeof a.standardFontDataUrl == "string" ? a.standardFontDataUrl : null, m = a.StandardFontDataFactory || ng, 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 : !Dt, A = typeof a.isImageDecoderSupported == "boolean" ? a.isImageDecoderSupported : !Dt && (zt.platform.isFirefox || !globalThis.chrome), T = Number.isInteger(a.canvasMaxAreaInBytes) ? a.canvasMaxAreaInBytes : -1, k = typeof a.disableFontFace == "boolean" ? a.disableFontFace : Dt, P = a.fontExtraProperties === !0,
|
|
15140
|
+
const u = a.verbosity, d = typeof a.docBaseUrl == "string" && !Wn(a.docBaseUrl) ? a.docBaseUrl : null, f = typeof a.cMapUrl == "string" ? a.cMapUrl : null, g = a.cMapPacked !== !1, p = a.CMapReaderFactory || sg, b = typeof a.standardFontDataUrl == "string" ? a.standardFontDataUrl : null, m = a.StandardFontDataFactory || ng, 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 : !Dt, A = typeof a.isImageDecoderSupported == "boolean" ? a.isImageDecoderSupported : !Dt && (zt.platform.isFirefox || !globalThis.chrome), T = Number.isInteger(a.canvasMaxAreaInBytes) ? a.canvasMaxAreaInBytes : -1, k = typeof a.disableFontFace == "boolean" ? a.disableFontFace : Dt, P = a.fontExtraProperties === !0, j = a.enableXfa === !0, F = a.ownerDocument || globalThis.document, I = a.disableRange === !0, O = a.disableStream === !0, D = a.disableAutoFetch === !0, z = a.pdfBug === !0, M = a.CanvasFactory || eg, R = a.FilterFactory || ig, W = a.enableHWA === !0, ot = h ? h.length : a.length ?? NaN, ht = typeof a.useSystemFonts == "boolean" ? a.useSystemFonts : !Dt && !k, E = typeof a.useWorkerFetch == "boolean" ? a.useWorkerFetch : p === Tl && m === Ml && f && b && ti(f, document.baseURI) && ti(b, document.baseURI), H = null;
|
|
15141
15141
|
Vd(u);
|
|
15142
15142
|
const V = {
|
|
15143
15143
|
canvasFactory: new M({
|
|
@@ -15172,7 +15172,7 @@ function rg(a = {}) {
|
|
|
15172
15172
|
rangeChunkSize: l,
|
|
15173
15173
|
length: ot,
|
|
15174
15174
|
docBaseUrl: d,
|
|
15175
|
-
enableXfa:
|
|
15175
|
+
enableXfa: j,
|
|
15176
15176
|
evaluatorOptions: {
|
|
15177
15177
|
maxImageSize: y,
|
|
15178
15178
|
disableFontFace: k,
|
|
@@ -15194,7 +15194,7 @@ function rg(a = {}) {
|
|
|
15194
15194
|
styleElement: H,
|
|
15195
15195
|
loadingParams: {
|
|
15196
15196
|
disableAutoFetch: D,
|
|
15197
|
-
enableXfa:
|
|
15197
|
+
enableXfa: j
|
|
15198
15198
|
}
|
|
15199
15199
|
};
|
|
15200
15200
|
return c.promise.then(function() {
|
|
@@ -15203,26 +15203,26 @@ function rg(a = {}) {
|
|
|
15203
15203
|
if (c.destroyed)
|
|
15204
15204
|
throw new Error("Worker was destroyed");
|
|
15205
15205
|
const st = c.messageHandler.sendWithPromise("GetDocRequest", J, i ? [i.buffer] : null);
|
|
15206
|
-
let
|
|
15206
|
+
let N;
|
|
15207
15207
|
if (h)
|
|
15208
|
-
|
|
15208
|
+
N = new Lf(h, {
|
|
15209
15209
|
disableRange: I,
|
|
15210
15210
|
disableStream: O
|
|
15211
15211
|
});
|
|
15212
15212
|
else if (!i) {
|
|
15213
15213
|
if (!s)
|
|
15214
15214
|
throw new Error("getDocument - no `url` parameter provided.");
|
|
15215
|
-
let
|
|
15215
|
+
let lt;
|
|
15216
15216
|
if (Dt)
|
|
15217
15217
|
if (ti(s)) {
|
|
15218
15218
|
if (typeof fetch > "u" || typeof Response > "u" || !("body" in Response.prototype))
|
|
15219
15219
|
throw new Error("getDocument - the Fetch API was disabled in Node.js, see `--no-experimental-fetch`.");
|
|
15220
|
-
|
|
15220
|
+
lt = Ya;
|
|
15221
15221
|
} else
|
|
15222
|
-
|
|
15222
|
+
lt = Yf;
|
|
15223
15223
|
else
|
|
15224
|
-
|
|
15225
|
-
|
|
15224
|
+
lt = ti(s) ? Ya : Gf;
|
|
15225
|
+
N = new lt({
|
|
15226
15226
|
url: s,
|
|
15227
15227
|
length: ot,
|
|
15228
15228
|
httpHeaders: n,
|
|
@@ -15232,12 +15232,12 @@ function rg(a = {}) {
|
|
|
15232
15232
|
disableStream: O
|
|
15233
15233
|
});
|
|
15234
15234
|
}
|
|
15235
|
-
return st.then((
|
|
15235
|
+
return st.then((lt) => {
|
|
15236
15236
|
if (t.destroyed)
|
|
15237
15237
|
throw new Error("Loading aborted");
|
|
15238
15238
|
if (c.destroyed)
|
|
15239
15239
|
throw new Error("Worker was destroyed");
|
|
15240
|
-
const Tt = new ei(e,
|
|
15240
|
+
const Tt = new ei(e, lt, c.port), Wt = new ug(Tt, t, N, At, V);
|
|
15241
15241
|
t._transport = Wt, Tt.send("Ready", null);
|
|
15242
15242
|
});
|
|
15243
15243
|
}).catch(t._capability.reject), t;
|
|
@@ -15801,7 +15801,7 @@ class cg {
|
|
|
15801
15801
|
}
|
|
15802
15802
|
}
|
|
15803
15803
|
var An, ns, rs, Ps, rn, Os, on;
|
|
15804
|
-
const
|
|
15804
|
+
const ct = class ct {
|
|
15805
15805
|
constructor({
|
|
15806
15806
|
name: t = null,
|
|
15807
15807
|
port: e = null,
|
|
@@ -15809,9 +15809,9 @@ const lt = class lt {
|
|
|
15809
15809
|
} = {}) {
|
|
15810
15810
|
bs(this, Ps);
|
|
15811
15811
|
if (this.name = t, this.destroyed = !1, this.verbosity = s, this._readyCapability = Promise.withResolvers(), this._port = null, this._webWorker = null, this._messageHandler = null, e) {
|
|
15812
|
-
if (oe(
|
|
15812
|
+
if (oe(ct, rs)?.has(e))
|
|
15813
15813
|
throw new Error("Cannot use more than one PDFWorker per port.");
|
|
15814
|
-
(oe(
|
|
15814
|
+
(oe(ct, rs) || Gs(ct, rs, /* @__PURE__ */ new WeakMap())).set(e, this), this._initializeFromPort(e);
|
|
15815
15815
|
return;
|
|
15816
15816
|
}
|
|
15817
15817
|
this._initialize();
|
|
@@ -15830,15 +15830,15 @@ const lt = class lt {
|
|
|
15830
15830
|
}), Ci(this, Ps, rn).call(this);
|
|
15831
15831
|
}
|
|
15832
15832
|
_initialize() {
|
|
15833
|
-
if (oe(
|
|
15833
|
+
if (oe(ct, ns) || oe(ct, Os, on)) {
|
|
15834
15834
|
this._setupFakeWorker();
|
|
15835
15835
|
return;
|
|
15836
15836
|
}
|
|
15837
15837
|
let {
|
|
15838
15838
|
workerSrc: t
|
|
15839
|
-
} =
|
|
15839
|
+
} = ct;
|
|
15840
15840
|
try {
|
|
15841
|
-
|
|
15841
|
+
ct._isSameOrigin(window.location.href, t) || (t = ct._createCDNWrapper(new URL(t, window.location).href));
|
|
15842
15842
|
const e = new Worker(t, {
|
|
15843
15843
|
type: "module"
|
|
15844
15844
|
}), s = new ei("main", "worker", e), i = () => {
|
|
@@ -15877,21 +15877,21 @@ const lt = class lt {
|
|
|
15877
15877
|
this._setupFakeWorker();
|
|
15878
15878
|
}
|
|
15879
15879
|
_setupFakeWorker() {
|
|
15880
|
-
oe(
|
|
15880
|
+
oe(ct, ns) || (K("Setting up fake worker."), Gs(ct, ns, !0)), ct._setupFakeWorkerGlobal.then((t) => {
|
|
15881
15881
|
if (this.destroyed) {
|
|
15882
15882
|
this._readyCapability.reject(new Error("Worker was destroyed"));
|
|
15883
15883
|
return;
|
|
15884
15884
|
}
|
|
15885
15885
|
const e = new cg();
|
|
15886
15886
|
this._port = e;
|
|
15887
|
-
const s = `fake${Io(
|
|
15887
|
+
const s = `fake${Io(ct, An)._++}`, i = new ei(s + "_worker", s, e);
|
|
15888
15888
|
t.setup(i, e), this._messageHandler = new ei(s, s + "_worker", e), Ci(this, Ps, rn).call(this);
|
|
15889
15889
|
}).catch((t) => {
|
|
15890
15890
|
this._readyCapability.reject(new Error(`Setting up fake worker failed: "${t.message}".`));
|
|
15891
15891
|
});
|
|
15892
15892
|
}
|
|
15893
15893
|
destroy() {
|
|
15894
|
-
this.destroyed = !0, this._webWorker?.terminate(), this._webWorker = null, oe(
|
|
15894
|
+
this.destroyed = !0, this._webWorker?.terminate(), this._webWorker = null, oe(ct, rs)?.delete(this._port), this._port = null, this._messageHandler?.destroy(), this._messageHandler = null;
|
|
15895
15895
|
}
|
|
15896
15896
|
static fromPort(t) {
|
|
15897
15897
|
if (!t?.port)
|
|
@@ -15902,7 +15902,7 @@ const lt = class lt {
|
|
|
15902
15902
|
throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");
|
|
15903
15903
|
return e;
|
|
15904
15904
|
}
|
|
15905
|
-
return new
|
|
15905
|
+
return new ct(t);
|
|
15906
15906
|
}
|
|
15907
15907
|
static get workerSrc() {
|
|
15908
15908
|
if (li.workerSrc)
|
|
@@ -15926,7 +15926,7 @@ An = new WeakMap(), ns = new WeakMap(), rs = new WeakMap(), Ps = new WeakSet(),
|
|
|
15926
15926
|
} catch {
|
|
15927
15927
|
return null;
|
|
15928
15928
|
}
|
|
15929
|
-
}, bs(
|
|
15929
|
+
}, bs(ct, Os), bs(ct, An, 0), bs(ct, ns, !1), bs(ct, rs), Dt && (Gs(ct, ns, !0), li.workerSrc ||= "./pdf.worker.mjs"), ct._isSameOrigin = (t, e) => {
|
|
15930
15930
|
let s;
|
|
15931
15931
|
try {
|
|
15932
15932
|
if (s = new URL(t), !s.origin || s.origin === "null")
|
|
@@ -15936,13 +15936,13 @@ An = new WeakMap(), ns = new WeakMap(), rs = new WeakMap(), Ps = new WeakSet(),
|
|
|
15936
15936
|
}
|
|
15937
15937
|
const i = new URL(e, s);
|
|
15938
15938
|
return s.origin === i.origin;
|
|
15939
|
-
},
|
|
15939
|
+
}, ct._createCDNWrapper = (t) => {
|
|
15940
15940
|
const e = `await import("${t}");`;
|
|
15941
15941
|
return URL.createObjectURL(new Blob([e], {
|
|
15942
15942
|
type: "text/javascript"
|
|
15943
15943
|
}));
|
|
15944
15944
|
};
|
|
15945
|
-
let Ms =
|
|
15945
|
+
let Ms = ct;
|
|
15946
15946
|
class ug {
|
|
15947
15947
|
#t = /* @__PURE__ */ new Map();
|
|
15948
15948
|
#e = /* @__PURE__ */ new Map();
|
|
@@ -18911,7 +18911,7 @@ class St extends U {
|
|
|
18911
18911
|
super.resetAnnotationElement(t), t.resetEdited();
|
|
18912
18912
|
}
|
|
18913
18913
|
}
|
|
18914
|
-
class
|
|
18914
|
+
class B {
|
|
18915
18915
|
static PRECISION = 1e-4;
|
|
18916
18916
|
toSVGPath() {
|
|
18917
18917
|
rt("Abstract method `toSVGPath` must be implemented.");
|
|
@@ -19086,7 +19086,7 @@ class is {
|
|
|
19086
19086
|
return t.set([NaN, NaN, NaN, NaN, (s[0] - n) / o, (s[1] - r) / h, NaN, NaN, NaN, NaN, l, c, NaN, NaN, NaN, NaN, u, d, NaN, NaN, NaN, NaN, (i[0] - n) / o, (i[1] - r) / h], e), e += 24;
|
|
19087
19087
|
}
|
|
19088
19088
|
}
|
|
19089
|
-
class Ul extends
|
|
19089
|
+
class Ul extends B {
|
|
19090
19090
|
#t;
|
|
19091
19091
|
#e = new Float32Array(4);
|
|
19092
19092
|
#s;
|
|
@@ -19118,16 +19118,16 @@ class Ul extends j {
|
|
|
19118
19118
|
let h, l;
|
|
19119
19119
|
switch (n) {
|
|
19120
19120
|
case 0:
|
|
19121
|
-
h =
|
|
19121
|
+
h = B._rescale(this.#h, t, i, r, -o), l = B._rescale(this.#r, t, i, r, -o);
|
|
19122
19122
|
break;
|
|
19123
19123
|
case 90:
|
|
19124
|
-
h =
|
|
19124
|
+
h = B._rescaleAndSwap(this.#h, t, e, r, o), l = B._rescaleAndSwap(this.#r, t, e, r, o);
|
|
19125
19125
|
break;
|
|
19126
19126
|
case 180:
|
|
19127
|
-
h =
|
|
19127
|
+
h = B._rescale(this.#h, s, e, -r, o), l = B._rescale(this.#r, s, e, -r, o);
|
|
19128
19128
|
break;
|
|
19129
19129
|
case 270:
|
|
19130
|
-
h =
|
|
19130
|
+
h = B._rescaleAndSwap(this.#h, s, i, -r, -o), l = B._rescaleAndSwap(this.#r, s, i, -r, -o);
|
|
19131
19131
|
break;
|
|
19132
19132
|
}
|
|
19133
19133
|
return {
|
|
@@ -19293,7 +19293,7 @@ class Br {
|
|
|
19293
19293
|
return n;
|
|
19294
19294
|
}
|
|
19295
19295
|
}
|
|
19296
|
-
class Fg extends
|
|
19296
|
+
class Fg extends B {
|
|
19297
19297
|
#t;
|
|
19298
19298
|
#e;
|
|
19299
19299
|
constructor(t, e, s) {
|
|
@@ -20585,7 +20585,7 @@ class jg {
|
|
|
20585
20585
|
t === "stroke-width" && (this.#r = e);
|
|
20586
20586
|
}
|
|
20587
20587
|
#u(t, e) {
|
|
20588
|
-
return
|
|
20588
|
+
return B._normalizePoint(t, e, this.#l, this.#d, this.#i);
|
|
20589
20589
|
}
|
|
20590
20590
|
isEmpty() {
|
|
20591
20591
|
return !this.#s || this.#s.length === 0;
|
|
@@ -20600,7 +20600,7 @@ class jg {
|
|
|
20600
20600
|
path: {
|
|
20601
20601
|
d: this.toSVGPath()
|
|
20602
20602
|
}
|
|
20603
|
-
}) : (isNaN(this.#t[0]) && this.#e.splice(6, 6), this.#t.set([s, i, n, r, t, e], 0), this.#e.push(...
|
|
20603
|
+
}) : (isNaN(this.#t[0]) && this.#e.splice(6, 6), this.#t.set([s, i, n, r, t, e], 0), this.#e.push(...B.createBezierPoints(s, i, n, r, t, e)), {
|
|
20604
20604
|
path: {
|
|
20605
20605
|
d: this.toSVGPath()
|
|
20606
20606
|
}
|
|
@@ -20652,7 +20652,7 @@ class jg {
|
|
|
20652
20652
|
};
|
|
20653
20653
|
}
|
|
20654
20654
|
toSVGPath() {
|
|
20655
|
-
const t =
|
|
20655
|
+
const t = B.svgRound(this.#e[4]), e = B.svgRound(this.#e[5]);
|
|
20656
20656
|
if (this.#n.length === 2)
|
|
20657
20657
|
return this.#h = `${this.#h} M ${t} ${e} Z`, this.#h;
|
|
20658
20658
|
if (this.#n.length <= 6) {
|
|
@@ -20660,13 +20660,13 @@ class jg {
|
|
|
20660
20660
|
this.#h = `${this.#h.slice(0, i)} M ${t} ${e}`, this.#a = 6;
|
|
20661
20661
|
}
|
|
20662
20662
|
if (this.#n.length === 4) {
|
|
20663
|
-
const i =
|
|
20663
|
+
const i = B.svgRound(this.#e[10]), n = B.svgRound(this.#e[11]);
|
|
20664
20664
|
return this.#h = `${this.#h} L ${i} ${n}`, this.#a = 12, this.#h;
|
|
20665
20665
|
}
|
|
20666
20666
|
const s = [];
|
|
20667
20667
|
this.#a === 0 && (s.push(`M ${t} ${e}`), this.#a = 6);
|
|
20668
20668
|
for (let i = this.#a, n = this.#e.length; i < n; i += 6) {
|
|
20669
|
-
const [r, o, h, l, c, u] = this.#e.slice(i, i + 6).map(
|
|
20669
|
+
const [r, o, h, l, c, u] = this.#e.slice(i, i + 6).map(B.svgRound);
|
|
20670
20670
|
s.push(`C${r} ${o} ${h} ${l} ${c} ${u}`);
|
|
20671
20671
|
}
|
|
20672
20672
|
return this.#h += s.join(" "), this.#a = this.#e.length, this.#h;
|
|
@@ -20687,7 +20687,7 @@ class jg {
|
|
|
20687
20687
|
};
|
|
20688
20688
|
}
|
|
20689
20689
|
}
|
|
20690
|
-
class $n extends
|
|
20690
|
+
class $n extends B {
|
|
20691
20691
|
#t;
|
|
20692
20692
|
#e = 0;
|
|
20693
20693
|
#s;
|
|
@@ -20719,16 +20719,16 @@ class $n extends j {
|
|
|
20719
20719
|
for (const {
|
|
20720
20720
|
line: e
|
|
20721
20721
|
} of this.#i) {
|
|
20722
|
-
if (t.push(`M${
|
|
20722
|
+
if (t.push(`M${B.svgRound(e[4])} ${B.svgRound(e[5])}`), e.length === 6) {
|
|
20723
20723
|
t.push("Z");
|
|
20724
20724
|
continue;
|
|
20725
20725
|
}
|
|
20726
20726
|
if (e.length === 12) {
|
|
20727
|
-
t.push(`L${
|
|
20727
|
+
t.push(`L${B.svgRound(e[10])} ${B.svgRound(e[11])}`);
|
|
20728
20728
|
continue;
|
|
20729
20729
|
}
|
|
20730
20730
|
for (let s = 6, i = e.length; s < i; s += 6) {
|
|
20731
|
-
const [n, r, o, h, l, c] = e.subarray(s, s + 6).map(
|
|
20731
|
+
const [n, r, o, h, l, c] = e.subarray(s, s + 6).map(B.svgRound);
|
|
20732
20732
|
t.push(`C${n} ${r} ${o} ${h} ${l} ${c}`);
|
|
20733
20733
|
}
|
|
20734
20734
|
}
|
|
@@ -20739,16 +20739,16 @@ class $n extends j {
|
|
|
20739
20739
|
let d, f, g, p, b, m, v, y, _;
|
|
20740
20740
|
switch (this.#a) {
|
|
20741
20741
|
case 0:
|
|
20742
|
-
_ =
|
|
20742
|
+
_ = B._rescale, d = t, f = e + i, g = s, p = -i, b = t + h * s, m = e + (1 - l - u) * i, v = t + (h + c) * s, y = e + (1 - l) * i;
|
|
20743
20743
|
break;
|
|
20744
20744
|
case 90:
|
|
20745
|
-
_ =
|
|
20745
|
+
_ = B._rescaleAndSwap, d = t, f = e, g = s, p = i, b = t + l * s, m = e + h * i, v = t + (l + u) * s, y = e + (h + c) * i;
|
|
20746
20746
|
break;
|
|
20747
20747
|
case 180:
|
|
20748
|
-
_ =
|
|
20748
|
+
_ = B._rescale, d = t + s, f = e, g = -s, p = i, b = t + (1 - h - c) * s, m = e + l * i, v = t + (1 - h) * s, y = e + (l + u) * i;
|
|
20749
20749
|
break;
|
|
20750
20750
|
case 270:
|
|
20751
|
-
_ =
|
|
20751
|
+
_ = B._rescaleAndSwap, d = t + s, f = e + i, g = -s, p = -i, b = t + (1 - l - u) * s, m = e + (1 - h - c) * i, v = t + (1 - l) * s, y = e + (1 - h) * i;
|
|
20752
20752
|
break;
|
|
20753
20753
|
}
|
|
20754
20754
|
for (const {
|
|
@@ -20774,16 +20774,16 @@ class $n extends j {
|
|
|
20774
20774
|
let u, d, f, g, p;
|
|
20775
20775
|
switch (h) {
|
|
20776
20776
|
case 0:
|
|
20777
|
-
p =
|
|
20777
|
+
p = B._rescale, u = -t / s, d = e / i + 1, f = 1 / s, g = -1 / i;
|
|
20778
20778
|
break;
|
|
20779
20779
|
case 90:
|
|
20780
|
-
p =
|
|
20780
|
+
p = B._rescaleAndSwap, u = -e / i, d = -t / s, f = 1 / i, g = 1 / s;
|
|
20781
20781
|
break;
|
|
20782
20782
|
case 180:
|
|
20783
|
-
p =
|
|
20783
|
+
p = B._rescale, u = t / s + 1, d = -e / i, f = -1 / s, g = 1 / i;
|
|
20784
20784
|
break;
|
|
20785
20785
|
case 270:
|
|
20786
|
-
p =
|
|
20786
|
+
p = B._rescaleAndSwap, u = e / i + 1, d = t / s + 1, f = -1 / i, g = -1 / s;
|
|
20787
20787
|
break;
|
|
20788
20788
|
}
|
|
20789
20789
|
if (!r) {
|
|
@@ -20803,8 +20803,8 @@ class $n extends j {
|
|
|
20803
20803
|
let [_, S, A, T] = m.subarray(0, 4);
|
|
20804
20804
|
y.set([NaN, NaN, NaN, NaN, _, S], 0);
|
|
20805
20805
|
for (let k = 4; k < v; k += 2) {
|
|
20806
|
-
const P = m[k],
|
|
20807
|
-
y.set(
|
|
20806
|
+
const P = m[k], j = m[k + 1];
|
|
20807
|
+
y.set(B.createBezierPoints(_, S, A, T, P, j), (k - 2) * 3), [_, S, A, T] = [A, T, P, j];
|
|
20808
20808
|
}
|
|
20809
20809
|
}
|
|
20810
20810
|
}
|
|
@@ -20871,7 +20871,7 @@ class $n extends j {
|
|
|
20871
20871
|
};
|
|
20872
20872
|
}
|
|
20873
20873
|
get viewBox() {
|
|
20874
|
-
return this.#t.map(
|
|
20874
|
+
return this.#t.map(B.svgRound).join(" ");
|
|
20875
20875
|
}
|
|
20876
20876
|
get defaultProperties() {
|
|
20877
20877
|
const [t, e] = this.#t;
|
|
@@ -20880,7 +20880,7 @@ class $n extends j {
|
|
|
20880
20880
|
viewBox: this.viewBox
|
|
20881
20881
|
},
|
|
20882
20882
|
path: {
|
|
20883
|
-
"transform-origin": `${
|
|
20883
|
+
"transform-origin": `${B.svgRound(t)} ${B.svgRound(e)}`
|
|
20884
20884
|
}
|
|
20885
20885
|
};
|
|
20886
20886
|
}
|
|
@@ -20900,15 +20900,15 @@ class $n extends j {
|
|
|
20900
20900
|
default:
|
|
20901
20901
|
return "";
|
|
20902
20902
|
}
|
|
20903
|
-
return `matrix(${s} ${i} ${n} ${r} ${
|
|
20903
|
+
return `matrix(${s} ${i} ${n} ${r} ${B.svgRound(o)} ${B.svgRound(h)})`;
|
|
20904
20904
|
}
|
|
20905
20905
|
getPathResizingSVGProperties([t, e, s, i]) {
|
|
20906
20906
|
const [n, r] = this.#l(), [o, h, l, c] = this.#t;
|
|
20907
|
-
if (Math.abs(l - n) <=
|
|
20907
|
+
if (Math.abs(l - n) <= B.PRECISION || Math.abs(c - r) <= B.PRECISION) {
|
|
20908
20908
|
const p = t + s / 2 - (o + l / 2), b = e + i / 2 - (h + c / 2);
|
|
20909
20909
|
return {
|
|
20910
20910
|
path: {
|
|
20911
|
-
"transform-origin": `${
|
|
20911
|
+
"transform-origin": `${B.svgRound(t)} ${B.svgRound(e)}`,
|
|
20912
20912
|
transform: `${this.rotationTransform} translate(${p} ${b})`
|
|
20913
20913
|
}
|
|
20914
20914
|
};
|
|
@@ -20916,26 +20916,26 @@ class $n extends j {
|
|
|
20916
20916
|
const u = (s - 2 * n) / (l - 2 * n), d = (i - 2 * r) / (c - 2 * r), f = l / s, g = c / i;
|
|
20917
20917
|
return {
|
|
20918
20918
|
path: {
|
|
20919
|
-
"transform-origin": `${
|
|
20920
|
-
transform: `${this.rotationTransform} scale(${f} ${g}) translate(${
|
|
20919
|
+
"transform-origin": `${B.svgRound(o)} ${B.svgRound(h)}`,
|
|
20920
|
+
transform: `${this.rotationTransform} scale(${f} ${g}) translate(${B.svgRound(n)} ${B.svgRound(r)}) scale(${u} ${d}) translate(${B.svgRound(-n)} ${B.svgRound(-r)})`
|
|
20921
20921
|
}
|
|
20922
20922
|
};
|
|
20923
20923
|
}
|
|
20924
20924
|
getPathResizedSVGProperties([t, e, s, i]) {
|
|
20925
20925
|
const [n, r] = this.#l(), o = this.#t, [h, l, c, u] = o;
|
|
20926
|
-
if (o[0] = t, o[1] = e, o[2] = s, o[3] = i, Math.abs(c - n) <=
|
|
20926
|
+
if (o[0] = t, o[1] = e, o[2] = s, o[3] = i, Math.abs(c - n) <= B.PRECISION || Math.abs(u - r) <= B.PRECISION) {
|
|
20927
20927
|
const b = t + s / 2 - (h + c / 2), m = e + i / 2 - (l + u / 2);
|
|
20928
20928
|
for (const {
|
|
20929
20929
|
line: v,
|
|
20930
20930
|
points: y
|
|
20931
20931
|
} of this.#i)
|
|
20932
|
-
|
|
20932
|
+
B._translate(v, b, m, v), B._translate(y, b, m, y);
|
|
20933
20933
|
return {
|
|
20934
20934
|
root: {
|
|
20935
20935
|
viewBox: this.viewBox
|
|
20936
20936
|
},
|
|
20937
20937
|
path: {
|
|
20938
|
-
"transform-origin": `${
|
|
20938
|
+
"transform-origin": `${B.svgRound(t)} ${B.svgRound(e)}`,
|
|
20939
20939
|
transform: this.rotationTransform || null,
|
|
20940
20940
|
d: this.toSVGPath()
|
|
20941
20941
|
}
|
|
@@ -20947,13 +20947,13 @@ class $n extends j {
|
|
|
20947
20947
|
line: b,
|
|
20948
20948
|
points: m
|
|
20949
20949
|
} of this.#i)
|
|
20950
|
-
|
|
20950
|
+
B._rescale(b, g, p, d, f, b), B._rescale(m, g, p, d, f, m);
|
|
20951
20951
|
return {
|
|
20952
20952
|
root: {
|
|
20953
20953
|
viewBox: this.viewBox
|
|
20954
20954
|
},
|
|
20955
20955
|
path: {
|
|
20956
|
-
"transform-origin": `${
|
|
20956
|
+
"transform-origin": `${B.svgRound(t)} ${B.svgRound(e)}`,
|
|
20957
20957
|
transform: this.rotationTransform || null,
|
|
20958
20958
|
d: this.toSVGPath()
|
|
20959
20959
|
}
|
|
@@ -20966,7 +20966,7 @@ class $n extends j {
|
|
|
20966
20966
|
line: l,
|
|
20967
20967
|
points: c
|
|
20968
20968
|
} of this.#i)
|
|
20969
|
-
|
|
20969
|
+
B._translate(l, o, h, l), B._translate(c, o, h, c);
|
|
20970
20970
|
else {
|
|
20971
20971
|
const l = this.#r / i, c = this.#n / n;
|
|
20972
20972
|
this.#r = i, this.#n = n;
|
|
@@ -20974,7 +20974,7 @@ class $n extends j {
|
|
|
20974
20974
|
line: u,
|
|
20975
20975
|
points: d
|
|
20976
20976
|
} of this.#i)
|
|
20977
|
-
|
|
20977
|
+
B._rescale(u, o, h, l, c, u), B._rescale(d, o, h, l, c, d);
|
|
20978
20978
|
r[2] *= l, r[3] *= c;
|
|
20979
20979
|
}
|
|
20980
20980
|
return r[0] = t, r[1] = e, {
|
|
@@ -20983,7 +20983,7 @@ class $n extends j {
|
|
|
20983
20983
|
},
|
|
20984
20984
|
path: {
|
|
20985
20985
|
d: this.toSVGPath(),
|
|
20986
|
-
"transform-origin": `${
|
|
20986
|
+
"transform-origin": `${B.svgRound(t)} ${B.svgRound(e)}`
|
|
20987
20987
|
}
|
|
20988
20988
|
};
|
|
20989
20989
|
}
|
|
@@ -20998,7 +20998,7 @@ class $n extends j {
|
|
|
20998
20998
|
},
|
|
20999
20999
|
path: {
|
|
21000
21000
|
d: this.toSVGPath(),
|
|
21001
|
-
"transform-origin": `${
|
|
21001
|
+
"transform-origin": `${B.svgRound(t[0])} ${B.svgRound(t[1])}`,
|
|
21002
21002
|
transform: this.rotationTransform || null
|
|
21003
21003
|
},
|
|
21004
21004
|
bbox: t
|
|
@@ -22264,13 +22264,14 @@ async function Ug({ page: a, data: t, scale: e, password: s }, i) {
|
|
|
22264
22264
|
import.meta.url
|
|
22265
22265
|
), { type: "module" });
|
|
22266
22266
|
return o.postMessage({ data: r, password: s, id: i, page: a, units: n, scale: e }), await new Promise((l) => {
|
|
22267
|
-
o.addEventListener("message", (
|
|
22268
|
-
if (c.status
|
|
22269
|
-
|
|
22270
|
-
|
|
22271
|
-
|
|
22272
|
-
}
|
|
22273
|
-
|
|
22267
|
+
o.addEventListener("message", (c) => {
|
|
22268
|
+
if (c.data.status !== "success") return;
|
|
22269
|
+
const { bitmap: u, width: d, height: f, pages: g } = c.data;
|
|
22270
|
+
if (u) {
|
|
22271
|
+
const p = document.createElement("canvas"), b = p.getContext("bitmaprenderer");
|
|
22272
|
+
p.width = d, p.height = f, b?.transferFromImageBitmap(u), l({ pages: g, canvas: p });
|
|
22273
|
+
} else
|
|
22274
|
+
l({ pages: g, canvas: null });
|
|
22274
22275
|
});
|
|
22275
22276
|
});
|
|
22276
22277
|
} else {
|
|
@@ -22494,7 +22495,7 @@ function lp(a) {
|
|
|
22494
22495
|
function P() {
|
|
22495
22496
|
sp(t);
|
|
22496
22497
|
}
|
|
22497
|
-
function
|
|
22498
|
+
function j(O) {
|
|
22498
22499
|
op(t, O);
|
|
22499
22500
|
}
|
|
22500
22501
|
function F() {
|
|
@@ -22514,7 +22515,7 @@ function lp(a) {
|
|
|
22514
22515
|
deleteCanvas: P,
|
|
22515
22516
|
scaleFabric: S,
|
|
22516
22517
|
setCloseSvgOptions: A,
|
|
22517
|
-
setActiveFabric:
|
|
22518
|
+
setActiveFabric: j,
|
|
22518
22519
|
copyActiveFabric: F,
|
|
22519
22520
|
deleteActiveFabric: I
|
|
22520
22521
|
};
|
|
@@ -22550,7 +22551,7 @@ function up({
|
|
|
22550
22551
|
onSelectionCleared: _
|
|
22551
22552
|
}, S) {
|
|
22552
22553
|
const A = ws(null), T = `${e}-${t - 1}`, k = No(() => s * n, [s, n]), P = No(() => ({ ...ac, ...d }), [d]), {
|
|
22553
|
-
createCanvas:
|
|
22554
|
+
createCanvas: j,
|
|
22554
22555
|
specifyPage: F,
|
|
22555
22556
|
addFabric: I,
|
|
22556
22557
|
addTextFabric: O,
|
|
@@ -22574,28 +22575,29 @@ function up({
|
|
|
22574
22575
|
cp(st);
|
|
22575
22576
|
async function H() {
|
|
22576
22577
|
globalThis.requestAnimationFrame(async () => {
|
|
22577
|
-
if (
|
|
22578
|
+
if (j(), a.data?.type.startsWith("image/")) {
|
|
22578
22579
|
D({ data: a.data, scale: i / 3 }), g?.();
|
|
22579
22580
|
return;
|
|
22580
22581
|
}
|
|
22581
|
-
|
|
22582
|
+
const N = a.canvas?.[t - 1] ?? a.data;
|
|
22583
|
+
N && await F({
|
|
22582
22584
|
page: t,
|
|
22583
|
-
data:
|
|
22585
|
+
data: N,
|
|
22584
22586
|
scale: i,
|
|
22585
22587
|
password: h
|
|
22586
22588
|
}), g?.();
|
|
22587
22589
|
});
|
|
22588
22590
|
}
|
|
22589
|
-
function V(
|
|
22590
|
-
if (
|
|
22591
|
-
const { dataTransfer:
|
|
22591
|
+
function V(N) {
|
|
22592
|
+
if (N.preventDefault(), N.stopPropagation(), !o || !N.dataTransfer) return;
|
|
22593
|
+
const { dataTransfer: lt, nativeEvent: Tt } = N, { offsetX: Wt, offsetY: Jl } = Tt, Mo = lt.getData("text/plain"), Po = lt.getData("text/uri-list"), Oo = lt.getData("custom/offset"), Do = Oo ? JSON.parse(Oo) : null, Ro = { top: Jl, left: Wt }, Lo = { x: Do?.offsetX ?? 0, y: Do?.offsetY ?? 0 };
|
|
22592
22594
|
Po ? J(Po, Ro, Lo) : Mo && At(Mo, Ro, Lo);
|
|
22593
22595
|
}
|
|
22594
|
-
function J(
|
|
22595
|
-
I(
|
|
22596
|
+
function J(N, lt, Tt) {
|
|
22597
|
+
I(N, { ...c, ...lt }, Tt);
|
|
22596
22598
|
}
|
|
22597
|
-
function At(
|
|
22598
|
-
O(
|
|
22599
|
+
function At(N, lt, Tt) {
|
|
22600
|
+
O(N, { ...l, ...lt }, Tt);
|
|
22599
22601
|
}
|
|
22600
22602
|
function st() {
|
|
22601
22603
|
f || H(), p?.();
|
|
@@ -22620,8 +22622,8 @@ function up({
|
|
|
22620
22622
|
"div",
|
|
22621
22623
|
{
|
|
22622
22624
|
style: { transform: `scale(${k})` },
|
|
22623
|
-
onDragOver: (
|
|
22624
|
-
onDragEnter: (
|
|
22625
|
+
onDragOver: (N) => N.preventDefault(),
|
|
22626
|
+
onDragEnter: (N) => N.preventDefault(),
|
|
22625
22627
|
onDrop: V,
|
|
22626
22628
|
children: /* @__PURE__ */ zo.jsx(
|
|
22627
22629
|
"canvas",
|