@shznet/pdf-sign-react 0.2.3 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/index.js +341 -341
- package/dist/lib/pdf-sign-react.d.ts +1 -1
- package/dist/lib/pdf-sign-react.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -121,7 +121,7 @@ const dt = typeof process == "object" && process + "" == "[object process]" && !
|
|
|
121
121
|
ENABLE: 1,
|
|
122
122
|
ENABLE_FORMS: 2,
|
|
123
123
|
ENABLE_STORAGE: 3
|
|
124
|
-
},
|
|
124
|
+
}, Ee = "pdfjs_internal_editor_", F = {
|
|
125
125
|
DISABLE: -1,
|
|
126
126
|
NONE: 0,
|
|
127
127
|
FREETEXT: 3,
|
|
@@ -205,7 +205,7 @@ const dt = typeof process == "object" && process + "" == "[object process]" && !
|
|
|
205
205
|
ERRORS: 0,
|
|
206
206
|
WARNINGS: 1,
|
|
207
207
|
INFOS: 5
|
|
208
|
-
},
|
|
208
|
+
}, Se = {
|
|
209
209
|
dependency: 1,
|
|
210
210
|
setLineWidth: 2,
|
|
211
211
|
setLineCap: 3,
|
|
@@ -409,7 +409,7 @@ function _i(c) {
|
|
|
409
409
|
}
|
|
410
410
|
return s.join("");
|
|
411
411
|
}
|
|
412
|
-
function
|
|
412
|
+
function Pe(c) {
|
|
413
413
|
typeof c != "string" && j("Invalid argument for stringToBytes");
|
|
414
414
|
const t = c.length, e = new Uint8Array(t);
|
|
415
415
|
for (let s = 0; s < t; ++s)
|
|
@@ -503,8 +503,8 @@ class T {
|
|
|
503
503
|
const i = e[0], n = e[1], r = e[2], a = e[3], o = e[4], h = e[5], l = t[0], d = t[1], u = t[2], p = t[3];
|
|
504
504
|
let f = i * l + o, g = f, b = i * u + o, m = b, w = a * d + h, y = w, v = a * p + h, A = v;
|
|
505
505
|
if (n !== 0 || r !== 0) {
|
|
506
|
-
const x = n * l, _ = n * u,
|
|
507
|
-
f +=
|
|
506
|
+
const x = n * l, _ = n * u, E = r * d, S = r * p;
|
|
507
|
+
f += E, m += E, b += S, g += S, w += x, A += x, v += _, y += _;
|
|
508
508
|
}
|
|
509
509
|
s[0] = Math.min(s[0], f, b, g, m), s[1] = Math.min(s[1], w, v, y, A), s[2] = Math.max(s[2], f, b, g, m), s[3] = Math.max(s[3], w, v, y, A);
|
|
510
510
|
}
|
|
@@ -561,7 +561,7 @@ let ls = null, Ys = null;
|
|
|
561
561
|
function xn(c) {
|
|
562
562
|
return ls || (ls = /([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu, Ys = /* @__PURE__ */ new Map([["ſt", "ſt"]])), c.replaceAll(ls, (t, e, s) => e ? e.normalize("NFKC") : Ys.get(s));
|
|
563
563
|
}
|
|
564
|
-
function
|
|
564
|
+
function Ei() {
|
|
565
565
|
if (typeof crypto.randomUUID == "function")
|
|
566
566
|
return crypto.randomUUID();
|
|
567
567
|
const c = new Uint8Array(32);
|
|
@@ -607,11 +607,11 @@ function _n(c, t, e) {
|
|
|
607
607
|
function ut(c, t, e) {
|
|
608
608
|
return Math.min(Math.max(c, t), e);
|
|
609
609
|
}
|
|
610
|
-
function
|
|
610
|
+
function Si(c) {
|
|
611
611
|
return Uint8Array.prototype.toBase64 ? c.toBase64() : btoa(_i(c));
|
|
612
612
|
}
|
|
613
|
-
function
|
|
614
|
-
return Uint8Array.fromBase64 ? Uint8Array.fromBase64(c) :
|
|
613
|
+
function En(c) {
|
|
614
|
+
return Uint8Array.fromBase64 ? Uint8Array.fromBase64(c) : Pe(atob(c));
|
|
615
615
|
}
|
|
616
616
|
typeof Promise.try != "function" && (Promise.try = function(c, ...t) {
|
|
617
617
|
return new Promise((e) => {
|
|
@@ -804,7 +804,7 @@ class ce {
|
|
|
804
804
|
static PDF = 72;
|
|
805
805
|
static PDF_TO_CSS_UNITS = this.CSS / this.PDF;
|
|
806
806
|
}
|
|
807
|
-
async function
|
|
807
|
+
async function Me(c, t = "text") {
|
|
808
808
|
if (we(c, document.baseURI)) {
|
|
809
809
|
const e = await fetch(c);
|
|
810
810
|
if (!e.ok)
|
|
@@ -928,7 +928,7 @@ function Ze(c) {
|
|
|
928
928
|
function Is(c) {
|
|
929
929
|
return typeof c == "string" && /\.pdf$/i.test(c);
|
|
930
930
|
}
|
|
931
|
-
function
|
|
931
|
+
function Sn(c) {
|
|
932
932
|
return [c] = c.split(/[#?]/, 1), c.substring(c.lastIndexOf("/") + 1);
|
|
933
933
|
}
|
|
934
934
|
function Cn(c, t = "document.pdf") {
|
|
@@ -1056,7 +1056,7 @@ class ws {
|
|
|
1056
1056
|
return d = d >= 0 && d <= 59 ? d : 0, h === "-" ? (r += l, a += d) : h === "+" && (r -= l, a -= d), new Date(Date.UTC(s, i, n, r, a, o));
|
|
1057
1057
|
}
|
|
1058
1058
|
}
|
|
1059
|
-
function
|
|
1059
|
+
function Pn(c, {
|
|
1060
1060
|
scale: t = 1,
|
|
1061
1061
|
rotation: e = 0
|
|
1062
1062
|
}) {
|
|
@@ -1078,7 +1078,7 @@ function De(c) {
|
|
|
1078
1078
|
}
|
|
1079
1079
|
return c.startsWith("rgb(") ? c.slice(4, -1).split(",").map((t) => parseInt(t)) : c.startsWith("rgba(") ? c.slice(5, -1).split(",").map((t) => parseInt(t)).slice(0, 3) : (I(`Not a valid color format: "${c}"`), [0, 0, 0]);
|
|
1080
1080
|
}
|
|
1081
|
-
function
|
|
1081
|
+
function Mn(c) {
|
|
1082
1082
|
const t = document.createElement("span");
|
|
1083
1083
|
t.style.visibility = "hidden", t.style.colorScheme = "only light", document.body.append(t);
|
|
1084
1084
|
for (const e of c.keys()) {
|
|
@@ -1099,7 +1099,7 @@ function X(c) {
|
|
|
1099
1099
|
} = c.getTransform();
|
|
1100
1100
|
return [t, e, s, i, n, r];
|
|
1101
1101
|
}
|
|
1102
|
-
function
|
|
1102
|
+
function St(c) {
|
|
1103
1103
|
const {
|
|
1104
1104
|
a: t,
|
|
1105
1105
|
b: e,
|
|
@@ -1277,7 +1277,7 @@ function Ti({
|
|
|
1277
1277
|
});
|
|
1278
1278
|
i.firstElementChild.classList.add("richText", e), s.append(i);
|
|
1279
1279
|
}
|
|
1280
|
-
function
|
|
1280
|
+
function Pi(c) {
|
|
1281
1281
|
const t = new Path2D();
|
|
1282
1282
|
if (!c)
|
|
1283
1283
|
return t;
|
|
@@ -1506,7 +1506,7 @@ class Ln {
|
|
|
1506
1506
|
})), this.#t.append(n);
|
|
1507
1507
|
}
|
|
1508
1508
|
}
|
|
1509
|
-
function
|
|
1509
|
+
function Mi(c, t, e) {
|
|
1510
1510
|
for (const s of e)
|
|
1511
1511
|
t.addEventListener(s, c[s].bind(c));
|
|
1512
1512
|
}
|
|
@@ -1555,11 +1555,11 @@ class z {
|
|
|
1555
1555
|
class Fn {
|
|
1556
1556
|
#t = 0;
|
|
1557
1557
|
get id() {
|
|
1558
|
-
return `${
|
|
1558
|
+
return `${Ee}${this.#t++}`;
|
|
1559
1559
|
}
|
|
1560
1560
|
}
|
|
1561
1561
|
class Ls {
|
|
1562
|
-
#t =
|
|
1562
|
+
#t = Ei();
|
|
1563
1563
|
#e = 0;
|
|
1564
1564
|
#i = null;
|
|
1565
1565
|
static get _isSVGFittingCanvas() {
|
|
@@ -1585,7 +1585,7 @@ class Ls {
|
|
|
1585
1585
|
isSvg: !1
|
|
1586
1586
|
};
|
|
1587
1587
|
let i;
|
|
1588
|
-
if (typeof e == "string" ? (s.url = e, i = await
|
|
1588
|
+
if (typeof e == "string" ? (s.url = e, i = await Me(e, "blob")) : e instanceof File ? i = s.file = e : e instanceof Blob && (i = e), i.type === "image/svg+xml") {
|
|
1589
1589
|
const n = Ls._isSVGFittingCanvas, r = new FileReader(), a = new Image(), o = new Promise((h, l) => {
|
|
1590
1590
|
a.onload = () => {
|
|
1591
1591
|
s.bitmap = a, s.isSvg = !0, h();
|
|
@@ -1791,7 +1791,7 @@ class Fs {
|
|
|
1791
1791
|
static _colorsMapping = /* @__PURE__ */ new Map([["CanvasText", [0, 0, 0]], ["Canvas", [255, 255, 255]]]);
|
|
1792
1792
|
get _colors() {
|
|
1793
1793
|
const t = /* @__PURE__ */ new Map([["CanvasText", null], ["Canvas", null]]);
|
|
1794
|
-
return
|
|
1794
|
+
return Mn(t), L(this, "_colors", t);
|
|
1795
1795
|
}
|
|
1796
1796
|
convert(t) {
|
|
1797
1797
|
const e = De(t);
|
|
@@ -1829,15 +1829,15 @@ class zt {
|
|
|
1829
1829
|
#b = !1;
|
|
1830
1830
|
#w = !1;
|
|
1831
1831
|
#y = !1;
|
|
1832
|
-
#
|
|
1832
|
+
#S = null;
|
|
1833
1833
|
#_ = null;
|
|
1834
1834
|
#A = null;
|
|
1835
1835
|
#T = null;
|
|
1836
1836
|
#v = !1;
|
|
1837
|
-
#
|
|
1837
|
+
#E = null;
|
|
1838
1838
|
#k = new Fn();
|
|
1839
|
-
#M = !1;
|
|
1840
1839
|
#P = !1;
|
|
1840
|
+
#M = !1;
|
|
1841
1841
|
#O = !1;
|
|
1842
1842
|
#R = null;
|
|
1843
1843
|
#L = null;
|
|
@@ -1936,16 +1936,16 @@ class zt {
|
|
|
1936
1936
|
}), a._on("switchannotationeditorparams", (w) => this.updateParams(w.type, w.value), {
|
|
1937
1937
|
signal: m
|
|
1938
1938
|
}), window.addEventListener("pointerdown", () => {
|
|
1939
|
-
this.#
|
|
1939
|
+
this.#M = !0;
|
|
1940
1940
|
}, {
|
|
1941
1941
|
capture: !0,
|
|
1942
1942
|
signal: m
|
|
1943
1943
|
}), window.addEventListener("pointerup", () => {
|
|
1944
|
-
this.#
|
|
1944
|
+
this.#M = !1;
|
|
1945
1945
|
}, {
|
|
1946
1946
|
capture: !0,
|
|
1947
1947
|
signal: m
|
|
1948
|
-
}), this.#at(), this.#ut(), this.#et(), this.#n = o.annotationStorage, this.#
|
|
1948
|
+
}), this.#at(), this.#ut(), this.#et(), this.#n = o.annotationStorage, this.#S = o.filterFactory, this.#z = h, this.#T = l || null, this.#b = d, this.#w = u, this.#y = p, this.#G = f || null, this.viewParameters = {
|
|
1949
1949
|
realScale: ce.PDF_TO_CSS_UNITS,
|
|
1950
1950
|
rotation: 0
|
|
1951
1951
|
}, this.isShiftKeyDown = !1, this._editorUndoBar = g || null, this._supportsPinchToZoom = b !== !1, n?.setSidebarUiManager(this);
|
|
@@ -1954,7 +1954,7 @@ class zt {
|
|
|
1954
1954
|
this.#$?.resolve(), this.#$ = null, this.#t?.abort(), this.#t = null, this._signal = null;
|
|
1955
1955
|
for (const t of this.#a.values())
|
|
1956
1956
|
t.destroy();
|
|
1957
|
-
this.#a.clear(), this.#s.clear(), this.#g.clear(), this.#F?.clear(), this.#e = null, this.#x.clear(), this.#l.destroy(), this.#r?.destroy(), this.#h?.destroy(), this.#H?.destroy(), this.#
|
|
1957
|
+
this.#a.clear(), this.#s.clear(), this.#g.clear(), this.#F?.clear(), this.#e = null, this.#x.clear(), this.#l.destroy(), this.#r?.destroy(), this.#h?.destroy(), this.#H?.destroy(), this.#E?.hide(), this.#E = null, this.#B?.destroy(), this.#B = null, this.#i = null, this.#_ && (clearTimeout(this.#_), this.#_ = null), this.#N && (clearTimeout(this.#N), this.#N = null), this._editorUndoBar?.destroy(), this.#W = null;
|
|
1958
1958
|
}
|
|
1959
1959
|
combinedSignal(t) {
|
|
1960
1960
|
return AbortSignal.any([this._signal, t.signal]);
|
|
@@ -1969,7 +1969,7 @@ class zt {
|
|
|
1969
1969
|
return this.#y;
|
|
1970
1970
|
}
|
|
1971
1971
|
get hcmFilter() {
|
|
1972
|
-
return L(this, "hcmFilter", this.#z ? this.#
|
|
1972
|
+
return L(this, "hcmFilter", this.#z ? this.#S.addHCMFilter(this.#z.foreground, this.#z.background) : "none");
|
|
1973
1973
|
}
|
|
1974
1974
|
get direction() {
|
|
1975
1975
|
return L(this, "direction", getComputedStyle(this.#j).direction);
|
|
@@ -2185,12 +2185,12 @@ class zt {
|
|
|
2185
2185
|
if (!t || t.isCollapsed)
|
|
2186
2186
|
return;
|
|
2187
2187
|
const e = this.#Q(t).closest(".textLayer"), s = this.getSelectionBoxes(e);
|
|
2188
|
-
s && (this.#
|
|
2188
|
+
s && (this.#E ||= new Ln(this), this.#E.show(e, s, this.direction === "ltr"));
|
|
2189
2189
|
}
|
|
2190
2190
|
getAndRemoveDataFromAnnotationStorage(t) {
|
|
2191
2191
|
if (!this.#n)
|
|
2192
2192
|
return null;
|
|
2193
|
-
const e = `${
|
|
2193
|
+
const e = `${Ee}${t}`, s = this.#n.getRawValue(e);
|
|
2194
2194
|
return s && this.#n.remove(e), s;
|
|
2195
2195
|
}
|
|
2196
2196
|
addToAnnotationStorage(t) {
|
|
@@ -2203,7 +2203,7 @@ class zt {
|
|
|
2203
2203
|
#rt() {
|
|
2204
2204
|
const t = document.getSelection();
|
|
2205
2205
|
if (!t || t.isCollapsed) {
|
|
2206
|
-
this.#I && (this.#
|
|
2206
|
+
this.#I && (this.#E?.hide(), this.#I = null, this.#D({
|
|
2207
2207
|
hasSelectedText: !1
|
|
2208
2208
|
}));
|
|
2209
2209
|
return;
|
|
@@ -2215,16 +2215,16 @@ class zt {
|
|
|
2215
2215
|
return;
|
|
2216
2216
|
const s = this.#Q(t).closest(".textLayer");
|
|
2217
2217
|
if (!s) {
|
|
2218
|
-
this.#I && (this.#
|
|
2218
|
+
this.#I && (this.#E?.hide(), this.#I = null, this.#D({
|
|
2219
2219
|
hasSelectedText: !1
|
|
2220
2220
|
}));
|
|
2221
2221
|
return;
|
|
2222
2222
|
}
|
|
2223
|
-
if (this.#
|
|
2223
|
+
if (this.#E?.hide(), this.#I = e, this.#D({
|
|
2224
2224
|
hasSelectedText: !0
|
|
2225
2225
|
}), !(this.#C !== F.HIGHLIGHT && this.#C !== F.NONE) && (this.#C === F.HIGHLIGHT && this.showAllEditors("highlight", !0, !0), this.#v = this.isShiftKeyDown, !this.isShiftKeyDown)) {
|
|
2226
2226
|
const i = this.#C === F.HIGHLIGHT ? this.#tt(s) : null;
|
|
2227
|
-
if (i?.toggleDrawing(), this.#
|
|
2227
|
+
if (i?.toggleDrawing(), this.#M) {
|
|
2228
2228
|
const n = new AbortController(), r = this.combinedSignal(n), a = (o) => {
|
|
2229
2229
|
o.type === "pointerup" && o.button !== 0 || (n.abort(), i?.toggleDrawing(!0), o.type === "pointerup" && this.#Y("main_toolbar"));
|
|
2230
2230
|
};
|
|
@@ -2473,7 +2473,7 @@ class zt {
|
|
|
2473
2473
|
return this.#p;
|
|
2474
2474
|
}
|
|
2475
2475
|
addLayer(t) {
|
|
2476
|
-
this.#a.set(t.pageIndex, t), this.#
|
|
2476
|
+
this.#a.set(t.pageIndex, t), this.#P ? t.enable() : t.disable();
|
|
2477
2477
|
}
|
|
2478
2478
|
removeLayer(t) {
|
|
2479
2479
|
this.#a.delete(t.pageIndex);
|
|
@@ -2571,8 +2571,8 @@ class zt {
|
|
|
2571
2571
|
}
|
|
2572
2572
|
}
|
|
2573
2573
|
async #pt() {
|
|
2574
|
-
if (!this.#
|
|
2575
|
-
this.#
|
|
2574
|
+
if (!this.#P) {
|
|
2575
|
+
this.#P = !0;
|
|
2576
2576
|
const t = [];
|
|
2577
2577
|
for (const e of this.#a.values())
|
|
2578
2578
|
t.push(e.enable());
|
|
@@ -2582,8 +2582,8 @@ class zt {
|
|
|
2582
2582
|
}
|
|
2583
2583
|
}
|
|
2584
2584
|
#gt() {
|
|
2585
|
-
if (this.unselectAll(), this.#
|
|
2586
|
-
this.#
|
|
2585
|
+
if (this.unselectAll(), this.#P) {
|
|
2586
|
+
this.#P = !1;
|
|
2587
2587
|
for (const t of this.#a.values())
|
|
2588
2588
|
t.disable();
|
|
2589
2589
|
for (const t of this.#s.values())
|
|
@@ -2947,7 +2947,7 @@ class zt {
|
|
|
2947
2947
|
(this.#F ||= /* @__PURE__ */ new Map()).set(t, e);
|
|
2948
2948
|
}
|
|
2949
2949
|
}
|
|
2950
|
-
class
|
|
2950
|
+
class Pt {
|
|
2951
2951
|
#t = null;
|
|
2952
2952
|
#e = !1;
|
|
2953
2953
|
#i = null;
|
|
@@ -2963,7 +2963,7 @@ class Mt {
|
|
|
2963
2963
|
static #p = null;
|
|
2964
2964
|
static _l10n = null;
|
|
2965
2965
|
constructor(t) {
|
|
2966
|
-
this.#l = t, this.#d = t._uiManager.useNewAltTextFlow,
|
|
2966
|
+
this.#l = t, this.#d = t._uiManager.useNewAltTextFlow, Pt.#p ||= Object.freeze({
|
|
2967
2967
|
added: "pdfjs-editor-new-alt-text-added-button",
|
|
2968
2968
|
"added-label": "pdfjs-editor-new-alt-text-added-button-label",
|
|
2969
2969
|
missing: "pdfjs-editor-new-alt-text-missing-button",
|
|
@@ -2973,13 +2973,13 @@ class Mt {
|
|
|
2973
2973
|
});
|
|
2974
2974
|
}
|
|
2975
2975
|
static initialize(t) {
|
|
2976
|
-
|
|
2976
|
+
Pt._l10n ??= t;
|
|
2977
2977
|
}
|
|
2978
2978
|
async render() {
|
|
2979
2979
|
const t = this.#i = document.createElement("button");
|
|
2980
2980
|
t.className = "altText", t.tabIndex = "0";
|
|
2981
2981
|
const e = this.#s = document.createElement("span");
|
|
2982
|
-
t.append(e), this.#d ? (t.classList.add("new"), t.setAttribute("data-l10n-id",
|
|
2982
|
+
t.append(e), this.#d ? (t.classList.add("new"), t.setAttribute("data-l10n-id", Pt.#p.missing), e.setAttribute("data-l10n-id", Pt.#p["missing-label"])) : (t.setAttribute("data-l10n-id", "pdfjs-editor-alt-text-button"), e.setAttribute("data-l10n-id", "pdfjs-editor-alt-text-button-label"));
|
|
2983
2983
|
const s = this.#l._uiManager._signal;
|
|
2984
2984
|
t.addEventListener("contextmenu", _t, {
|
|
2985
2985
|
signal: s
|
|
@@ -3021,7 +3021,7 @@ class Mt {
|
|
|
3021
3021
|
return this.#h;
|
|
3022
3022
|
}
|
|
3023
3023
|
async setGuessedText(t) {
|
|
3024
|
-
this.#t === null && (this.#h = t, this.#u = await
|
|
3024
|
+
this.#t === null && (this.#h = t, this.#u = await Pt._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer", {
|
|
3025
3025
|
generatedAltText: t
|
|
3026
3026
|
}), this.#f());
|
|
3027
3027
|
}
|
|
@@ -3079,7 +3079,7 @@ class Mt {
|
|
|
3079
3079
|
if (!t)
|
|
3080
3080
|
return;
|
|
3081
3081
|
if (this.#d) {
|
|
3082
|
-
if (t.classList.toggle("done", !!this.#t), t.setAttribute("data-l10n-id",
|
|
3082
|
+
if (t.classList.toggle("done", !!this.#t), t.setAttribute("data-l10n-id", Pt.#p[this.#m]), this.#s?.setAttribute("data-l10n-id", Pt.#p[`${this.#m}-label`]), !this.#t) {
|
|
3083
3083
|
this.#a?.remove();
|
|
3084
3084
|
return;
|
|
3085
3085
|
}
|
|
@@ -3431,7 +3431,7 @@ class D {
|
|
|
3431
3431
|
#b = !1;
|
|
3432
3432
|
#w = !1;
|
|
3433
3433
|
#y = null;
|
|
3434
|
-
#
|
|
3434
|
+
#S = 0;
|
|
3435
3435
|
#_ = 0;
|
|
3436
3436
|
#A = null;
|
|
3437
3437
|
#T = null;
|
|
@@ -3446,7 +3446,7 @@ class D {
|
|
|
3446
3446
|
static _l10n = null;
|
|
3447
3447
|
static _l10nResizer = null;
|
|
3448
3448
|
#v = !1;
|
|
3449
|
-
#
|
|
3449
|
+
#E = D._zIndex++;
|
|
3450
3450
|
static _borderLineWidth = -1;
|
|
3451
3451
|
static _colorManager = new Fs();
|
|
3452
3452
|
static _zIndex = 1;
|
|
@@ -3575,7 +3575,7 @@ class D {
|
|
|
3575
3575
|
this.div.style.zIndex = 0;
|
|
3576
3576
|
}
|
|
3577
3577
|
setInForeground() {
|
|
3578
|
-
this.div.style.zIndex = this.#
|
|
3578
|
+
this.div.style.zIndex = this.#E;
|
|
3579
3579
|
}
|
|
3580
3580
|
setParent(t) {
|
|
3581
3581
|
t !== null ? (this.pageIndex = t.pageIndex, this.pageDimensions = t.pageDimensions) : (this.#N(), this.#d?.remove(), this.#d = null), this.parent = t;
|
|
@@ -3703,7 +3703,7 @@ class D {
|
|
|
3703
3703
|
const [h, l] = this.getBaseTranslation();
|
|
3704
3704
|
n += h, r += l, e.left = `${(100 * n).toFixed(2)}%`, e.top = `${(100 * r).toFixed(2)}%`, this.moveInDOM();
|
|
3705
3705
|
}
|
|
3706
|
-
static #
|
|
3706
|
+
static #P(t, e, s) {
|
|
3707
3707
|
switch (s) {
|
|
3708
3708
|
case 90:
|
|
3709
3709
|
return [e, -t];
|
|
@@ -3716,12 +3716,12 @@ class D {
|
|
|
3716
3716
|
}
|
|
3717
3717
|
}
|
|
3718
3718
|
screenToPageTranslation(t, e) {
|
|
3719
|
-
return D.#
|
|
3719
|
+
return D.#P(t, e, this.parentRotation);
|
|
3720
3720
|
}
|
|
3721
3721
|
pageTranslationToScreen(t, e) {
|
|
3722
|
-
return D.#
|
|
3722
|
+
return D.#P(t, e, 360 - this.parentRotation);
|
|
3723
3723
|
}
|
|
3724
|
-
#
|
|
3724
|
+
#M(t) {
|
|
3725
3725
|
switch (t) {
|
|
3726
3726
|
case 90: {
|
|
3727
3727
|
const [e, s] = this.pageDimensions;
|
|
@@ -3841,7 +3841,7 @@ class D {
|
|
|
3841
3841
|
return Math.round(t * 1e4) / 1e4;
|
|
3842
3842
|
}
|
|
3843
3843
|
#F(t, e) {
|
|
3844
|
-
const [s, i] = this.parentDimensions, n = this.x, r = this.y, a = this.width, o = this.height, h = D.MIN_SIZE / s, l = D.MIN_SIZE / i, d = this.#
|
|
3844
|
+
const [s, i] = this.parentDimensions, n = this.x, r = this.y, a = this.width, o = this.height, h = D.MIN_SIZE / s, l = D.MIN_SIZE / i, d = this.#M(this.rotation), u = (k, R) => [d[0] * k + d[2] * R, d[1] * k + d[3] * R], p = this.#M(360 - this.rotation), f = (k, R) => [p[0] * k + p[2] * R, p[1] * k + p[3] * R];
|
|
3845
3845
|
let g, b, m = !1, w = !1;
|
|
3846
3846
|
switch (t) {
|
|
3847
3847
|
case "topLeft":
|
|
@@ -3872,10 +3872,10 @@ class D {
|
|
|
3872
3872
|
const y = g(a, o), v = b(a, o);
|
|
3873
3873
|
let A = u(...v);
|
|
3874
3874
|
const x = D._round(n + A[0]), _ = D._round(r + A[1]);
|
|
3875
|
-
let
|
|
3875
|
+
let E = 1, S = 1, M, C;
|
|
3876
3876
|
if (e.fromKeyboard)
|
|
3877
3877
|
({
|
|
3878
|
-
deltaX:
|
|
3878
|
+
deltaX: M,
|
|
3879
3879
|
deltaY: C
|
|
3880
3880
|
} = e);
|
|
3881
3881
|
else {
|
|
@@ -3883,13 +3883,13 @@ class D {
|
|
|
3883
3883
|
screenX: k,
|
|
3884
3884
|
screenY: R
|
|
3885
3885
|
} = e, [U, ft] = this.#h;
|
|
3886
|
-
[
|
|
3886
|
+
[M, C] = this.screenToPageTranslation(k - U, R - ft), this.#h[0] = k, this.#h[1] = R;
|
|
3887
3887
|
}
|
|
3888
|
-
if ([
|
|
3888
|
+
if ([M, C] = f(M / s, C / i), m) {
|
|
3889
3889
|
const k = Math.hypot(a, o);
|
|
3890
|
-
|
|
3891
|
-
} else w ?
|
|
3892
|
-
const H = D._round(a *
|
|
3890
|
+
E = S = Math.max(Math.min(Math.hypot(v[0] - y[0] - M, v[1] - y[1] - C) / k, 1 / a, 1 / o), h / a, l / o);
|
|
3891
|
+
} else w ? E = ut(Math.abs(v[0] - y[0] - M), h, 1) / a : S = ut(Math.abs(v[1] - y[1] - C), l, 1) / o;
|
|
3892
|
+
const H = D._round(a * E), V = D._round(o * S);
|
|
3893
3893
|
A = u(...b(H, V));
|
|
3894
3894
|
const N = x - A[0], Z = _ - A[1];
|
|
3895
3895
|
this.#c ||= [this.x, this.y, this.width, this.height], this.width = H, this.height = V, this.x = N, this.y = Z, this.setDims(), this.fixAndSetPosition(), this._onResizing();
|
|
@@ -3931,7 +3931,7 @@ class D {
|
|
|
3931
3931
|
return this.div.getBoundingClientRect();
|
|
3932
3932
|
}
|
|
3933
3933
|
createAltText() {
|
|
3934
|
-
return this.#i || (
|
|
3934
|
+
return this.#i || (Pt.initialize(D._l10n), this.#i = new Pt(this), this.#t && (this.#i.data = this.#t, this.#t = null)), this.#i;
|
|
3935
3935
|
}
|
|
3936
3936
|
get altTextData() {
|
|
3937
3937
|
return this.#i?.data;
|
|
@@ -4051,7 +4051,7 @@ class D {
|
|
|
4051
4051
|
const [e, s] = this.parentDimensions;
|
|
4052
4052
|
this.parentRotation % 180 !== 0 && (t.style.maxWidth = `${(100 * s / e).toFixed(2)}%`, t.style.maxHeight = `${(100 * e / s).toFixed(2)}%`);
|
|
4053
4053
|
const [i, n] = this.getInitialTranslation();
|
|
4054
|
-
return this.translate(i, n),
|
|
4054
|
+
return this.translate(i, n), Mi(this, t, ["keydown", "pointerdown", "dblclick"]), this.isResizable && this._uiManager._supportsPinchToZoom && (this.#T ||= new ts({
|
|
4055
4055
|
container: t,
|
|
4056
4056
|
isPinchingDisabled: () => !this.isSelected,
|
|
4057
4057
|
onPinchStart: this.#G.bind(this),
|
|
@@ -4072,7 +4072,7 @@ class D {
|
|
|
4072
4072
|
let i = 0.7 * (s / e) + 1 - 0.7;
|
|
4073
4073
|
if (i === 1)
|
|
4074
4074
|
return;
|
|
4075
|
-
const n = this.#
|
|
4075
|
+
const n = this.#M(this.rotation), r = (A, x) => [n[0] * A + n[2] * x, n[1] * A + n[3] * x], [a, o] = this.parentDimensions, h = this.x, l = this.y, d = this.width, u = this.height, p = D.MIN_SIZE / a, f = D.MIN_SIZE / o;
|
|
4076
4076
|
i = Math.max(Math.min(i, 1 / d, 1 / u), p / d, f / u);
|
|
4077
4077
|
const g = D._round(d * i), b = D._round(u * i);
|
|
4078
4078
|
if (g === d && b === u)
|
|
@@ -4117,7 +4117,7 @@ class D {
|
|
|
4117
4117
|
}, a = (h) => {
|
|
4118
4118
|
i.abort(), this.#n = null, this.#f = !1, this._uiManager.endDragSession() || this.#I(h), s && this._onStopDragging();
|
|
4119
4119
|
};
|
|
4120
|
-
e && (this.#
|
|
4120
|
+
e && (this.#S = t.clientX, this.#_ = t.clientY, this.#n = t.pointerId, this.#o = t.pointerType, window.addEventListener("pointermove", (h) => {
|
|
4121
4121
|
s || (s = !0, this._uiManager.toggleComment(this, !0, !1), this._onStartDragging());
|
|
4122
4122
|
const {
|
|
4123
4123
|
clientX: l,
|
|
@@ -4128,8 +4128,8 @@ class D {
|
|
|
4128
4128
|
Q(h);
|
|
4129
4129
|
return;
|
|
4130
4130
|
}
|
|
4131
|
-
const [p, f] = this.screenToPageTranslation(l - this.#
|
|
4132
|
-
this.#
|
|
4131
|
+
const [p, f] = this.screenToPageTranslation(l - this.#S, d - this.#_);
|
|
4132
|
+
this.#S = l, this.#_ = d, this._uiManager.dragSelectedEditors(p, f);
|
|
4133
4133
|
}, r), window.addEventListener("touchmove", Q, r), window.addEventListener("pointerdown", (h) => {
|
|
4134
4134
|
h.pointerType === this.#o && (this.#T || h.isPrimary) && a(h), Q(h);
|
|
4135
4135
|
}, r));
|
|
@@ -4883,8 +4883,8 @@ class Bn {
|
|
|
4883
4883
|
return y.charCodeAt(v) << 24 | y.charCodeAt(v + 1) << 16 | y.charCodeAt(v + 2) << 8 | y.charCodeAt(v + 3) & 255;
|
|
4884
4884
|
}
|
|
4885
4885
|
function i(y, v, A, x) {
|
|
4886
|
-
const _ = y.substring(0, v),
|
|
4887
|
-
return _ + x +
|
|
4886
|
+
const _ = y.substring(0, v), E = y.substring(v + A);
|
|
4887
|
+
return _ + x + E;
|
|
4888
4888
|
}
|
|
4889
4889
|
let n, r;
|
|
4890
4890
|
const a = this._document.createElement("canvas");
|
|
@@ -4945,7 +4945,7 @@ class Hn {
|
|
|
4945
4945
|
createFontFaceRule() {
|
|
4946
4946
|
if (!this.data || this.disableFontFace)
|
|
4947
4947
|
return null;
|
|
4948
|
-
const t = `url(data:${this.mimetype};base64,${
|
|
4948
|
+
const t = `url(data:${this.mimetype};base64,${Si(this.data)});`;
|
|
4949
4949
|
let e;
|
|
4950
4950
|
if (!this.cssFontInfo)
|
|
4951
4951
|
e = `@font-face {font-family:"${this.loadedName}";src:${t}}`;
|
|
@@ -4965,7 +4965,7 @@ class Hn {
|
|
|
4965
4965
|
} catch (r) {
|
|
4966
4966
|
I(`getPathGenerator - ignoring character: "${r}".`);
|
|
4967
4967
|
}
|
|
4968
|
-
const n =
|
|
4968
|
+
const n = Pi(i?.path);
|
|
4969
4969
|
return this.fontExtraProperties || t.delete(s), this.compiledGlyphs[e] = n;
|
|
4970
4970
|
}
|
|
4971
4971
|
get black() {
|
|
@@ -5459,8 +5459,8 @@ class ot {
|
|
|
5459
5459
|
if (l.length > 0) {
|
|
5460
5460
|
let w = l[0], y = l[0], v = l[1], A = l[1];
|
|
5461
5461
|
for (let x = 0; x < l.length; x += 2) {
|
|
5462
|
-
const _ = l[x],
|
|
5463
|
-
w = w > _ ? _ : w, v = v >
|
|
5462
|
+
const _ = l[x], E = l[x + 1];
|
|
5463
|
+
w = w > _ ? _ : w, v = v > E ? E : v, y = y < _ ? _ : y, A = A < E ? E : A;
|
|
5464
5464
|
}
|
|
5465
5465
|
m = [w, v, y, A];
|
|
5466
5466
|
}
|
|
@@ -5500,7 +5500,7 @@ function Un(c) {
|
|
|
5500
5500
|
if (c instanceof Uint8Array && c.byteLength === c.buffer.byteLength)
|
|
5501
5501
|
return c;
|
|
5502
5502
|
if (typeof c == "string")
|
|
5503
|
-
return
|
|
5503
|
+
return Pe(c);
|
|
5504
5504
|
if (c instanceof ArrayBuffer || ArrayBuffer.isView(c) || typeof c == "object" && !isNaN(c?.length))
|
|
5505
5505
|
return new Uint8Array(c);
|
|
5506
5506
|
throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.");
|
|
@@ -5933,8 +5933,8 @@ class Ii {
|
|
|
5933
5933
|
}
|
|
5934
5934
|
class ii extends Ii {
|
|
5935
5935
|
async _fetch(t) {
|
|
5936
|
-
const e = await
|
|
5937
|
-
return e instanceof ArrayBuffer ? new Uint8Array(e) :
|
|
5936
|
+
const e = await Me(t, this.isCompressed ? "arraybuffer" : "text");
|
|
5937
|
+
return e instanceof ArrayBuffer ? new Uint8Array(e) : Pe(e);
|
|
5938
5938
|
}
|
|
5939
5939
|
}
|
|
5940
5940
|
class Li {
|
|
@@ -6089,15 +6089,15 @@ class qn extends Li {
|
|
|
6089
6089
|
d < l && ([l, d, u, p] = [d, l, p, u]), this.#h.style.color = "";
|
|
6090
6090
|
const f = (m, w, y) => {
|
|
6091
6091
|
const v = new Array(256), A = (d - l) / y, x = m / 255, _ = (w - m) / (255 * y);
|
|
6092
|
-
let
|
|
6093
|
-
for (let
|
|
6094
|
-
const
|
|
6095
|
-
for (let H =
|
|
6092
|
+
let E = 0;
|
|
6093
|
+
for (let S = 0; S <= y; S++) {
|
|
6094
|
+
const M = Math.round(l + S * A), C = x + S * _;
|
|
6095
|
+
for (let H = E; H <= M; H++)
|
|
6096
6096
|
v[H] = C;
|
|
6097
|
-
|
|
6097
|
+
E = M + 1;
|
|
6098
6098
|
}
|
|
6099
|
-
for (let
|
|
6100
|
-
v[
|
|
6099
|
+
for (let S = E; S < 256; S++)
|
|
6100
|
+
v[S] = v[E - 1];
|
|
6101
6101
|
return v.join(",");
|
|
6102
6102
|
}, g = `g_${this.#s}_hcm_${t}_filter`, b = a.filter = this.#f(g);
|
|
6103
6103
|
return this.#m(b), this.#g(f(u[0], p[0], 5), f(u[1], p[1], 5), f(u[2], p[2], 5), b), a.url = this.#d(g), a.url;
|
|
@@ -6157,7 +6157,7 @@ class Fi {
|
|
|
6157
6157
|
}
|
|
6158
6158
|
class ni extends Fi {
|
|
6159
6159
|
async _fetch(t) {
|
|
6160
|
-
const e = await
|
|
6160
|
+
const e = await Me(t, "arraybuffer");
|
|
6161
6161
|
return new Uint8Array(e);
|
|
6162
6162
|
}
|
|
6163
6163
|
}
|
|
@@ -6185,7 +6185,7 @@ class Ni {
|
|
|
6185
6185
|
}
|
|
6186
6186
|
class ri extends Ni {
|
|
6187
6187
|
async _fetch(t) {
|
|
6188
|
-
const e = await
|
|
6188
|
+
const e = await Me(t, "arraybuffer");
|
|
6189
6189
|
return new Uint8Array(e);
|
|
6190
6190
|
}
|
|
6191
6191
|
}
|
|
@@ -6223,7 +6223,7 @@ const Qt = "__forcedDependency", {
|
|
|
6223
6223
|
function Be(c, t, e, s, i, n) {
|
|
6224
6224
|
c[t * 4 + 0] = Math.min(c[t * 4 + 0], e), c[t * 4 + 1] = Math.min(c[t * 4 + 1], s), c[t * 4 + 2] = Math.max(c[t * 4 + 2], i), c[t * 4 + 3] = Math.max(c[t * 4 + 3], n);
|
|
6225
6225
|
}
|
|
6226
|
-
const
|
|
6226
|
+
const Es = new Uint32Array(new Uint8Array([255, 255, 0, 0]).buffer)[0];
|
|
6227
6227
|
class Zn {
|
|
6228
6228
|
#t;
|
|
6229
6229
|
#e;
|
|
@@ -6234,7 +6234,7 @@ class Zn {
|
|
|
6234
6234
|
return this.#t.length;
|
|
6235
6235
|
}
|
|
6236
6236
|
isEmpty(t) {
|
|
6237
|
-
return this.#t[t] ===
|
|
6237
|
+
return this.#t[t] === Es;
|
|
6238
6238
|
}
|
|
6239
6239
|
minX(t) {
|
|
6240
6240
|
return this.#e[t * 4 + 0] / 256;
|
|
@@ -6292,7 +6292,7 @@ class tr {
|
|
|
6292
6292
|
}
|
|
6293
6293
|
#b(t, e) {
|
|
6294
6294
|
const s = new ArrayBuffer(t * 4);
|
|
6295
|
-
this.#f = new Uint8ClampedArray(s), this.#c = new Uint32Array(s), e && e.length > 0 ? (this.#c.set(e), this.#c.fill(
|
|
6295
|
+
this.#f = new Uint8ClampedArray(s), this.#c = new Uint32Array(s), e && e.length > 0 ? (this.#c.set(e), this.#c.fill(Es, e.length)) : this.#c.fill(Es);
|
|
6296
6296
|
}
|
|
6297
6297
|
save(t) {
|
|
6298
6298
|
return this.#t = {
|
|
@@ -6585,7 +6585,7 @@ const At = {
|
|
|
6585
6585
|
STROKE: "Stroke",
|
|
6586
6586
|
SHADING: "Shading"
|
|
6587
6587
|
};
|
|
6588
|
-
function
|
|
6588
|
+
function Ss(c, t) {
|
|
6589
6589
|
if (!t)
|
|
6590
6590
|
return;
|
|
6591
6591
|
const e = t[2] - t[0], s = t[3] - t[1], i = new Path2D();
|
|
@@ -6640,11 +6640,11 @@ class er extends Bs {
|
|
|
6640
6640
|
return this._createGradient(t, u);
|
|
6641
6641
|
}
|
|
6642
6642
|
const r = e.current.getClippedPathBoundingBox(i, X(t)) || [0, 0, 0, 0], a = Math.ceil(r[2] - r[0]) || 1, o = Math.ceil(r[3] - r[1]) || 1, h = e.cachedCanvases.getCanvas("pattern", a, o), l = h.context;
|
|
6643
|
-
l.clearRect(0, 0, l.canvas.width, l.canvas.height), l.beginPath(), l.rect(0, 0, l.canvas.width, l.canvas.height), l.translate(-r[0], -r[1]), s = T.transform(s, [1, 0, 0, 1, r[0], r[1]]), l.transform(...e.baseTransform), this.matrix && l.transform(...this.matrix),
|
|
6643
|
+
l.clearRect(0, 0, l.canvas.width, l.canvas.height), l.beginPath(), l.rect(0, 0, l.canvas.width, l.canvas.height), l.translate(-r[0], -r[1]), s = T.transform(s, [1, 0, 0, 1, r[0], r[1]]), l.transform(...e.baseTransform), this.matrix && l.transform(...this.matrix), Ss(l, this._bbox), l.fillStyle = this._createGradient(l), l.fill(), n = t.createPattern(h.canvas, "no-repeat");
|
|
6644
6644
|
const d = new DOMMatrix(s);
|
|
6645
6645
|
n.setTransform(d);
|
|
6646
6646
|
} else
|
|
6647
|
-
|
|
6647
|
+
Ss(t, this._bbox), n = this._createGradient(t);
|
|
6648
6648
|
return n;
|
|
6649
6649
|
}
|
|
6650
6650
|
}
|
|
@@ -6655,18 +6655,18 @@ function cs(c, t, e, s, i, n, r, a) {
|
|
|
6655
6655
|
const p = (o[e] + t.offsetX) * t.scaleX, f = (o[e + 1] + t.offsetY) * t.scaleY, g = (o[s] + t.offsetX) * t.scaleX, b = (o[s + 1] + t.offsetY) * t.scaleY, m = (o[i] + t.offsetX) * t.scaleX, w = (o[i + 1] + t.offsetY) * t.scaleY;
|
|
6656
6656
|
if (f >= w)
|
|
6657
6657
|
return;
|
|
6658
|
-
const y = h[n], v = h[n + 1], A = h[n + 2], x = h[r], _ = h[r + 1],
|
|
6658
|
+
const y = h[n], v = h[n + 1], A = h[n + 2], x = h[r], _ = h[r + 1], E = h[r + 2], S = h[a], M = h[a + 1], C = h[a + 2], H = Math.round(f), V = Math.round(w);
|
|
6659
6659
|
let N, Z, k, R, U, ft, Dt, tt;
|
|
6660
6660
|
for (let W = H; W <= V; W++) {
|
|
6661
6661
|
if (W < b) {
|
|
6662
6662
|
const et = W < f ? 0 : (f - W) / (f - b);
|
|
6663
|
-
N = p - (p - g) * et, Z = y - (y - x) * et, k = v - (v - _) * et, R = A - (A -
|
|
6663
|
+
N = p - (p - g) * et, Z = y - (y - x) * et, k = v - (v - _) * et, R = A - (A - E) * et;
|
|
6664
6664
|
} else {
|
|
6665
6665
|
let et;
|
|
6666
|
-
W > w ? et = 1 : b === w ? et = 0 : et = (b - W) / (b - w), N = g - (g - m) * et, Z = x - (x -
|
|
6666
|
+
W > w ? et = 1 : b === w ? et = 0 : et = (b - W) / (b - w), N = g - (g - m) * et, Z = x - (x - S) * et, k = _ - (_ - M) * et, R = E - (E - C) * et;
|
|
6667
6667
|
}
|
|
6668
6668
|
let q;
|
|
6669
|
-
W < f ? q = 0 : W > w ? q = 1 : q = (f - W) / (f - w), U = p - (p - m) * q, ft = y - (y -
|
|
6669
|
+
W < f ? q = 0 : W > w ? q = 1 : q = (f - W) / (f - w), U = p - (p - m) * q, ft = y - (y - S) * q, Dt = v - (v - M) * q, tt = A - (A - C) * q;
|
|
6670
6670
|
const Ut = Math.round(Math.min(N, U)), Nt = Math.round(Math.max(N, U));
|
|
6671
6671
|
let Ot = d * W + Ut * 4;
|
|
6672
6672
|
for (let et = Ut; et <= Nt; et++)
|
|
@@ -6725,7 +6725,7 @@ class ir extends Bs {
|
|
|
6725
6725
|
return !0;
|
|
6726
6726
|
}
|
|
6727
6727
|
getPattern(t, e, s, i) {
|
|
6728
|
-
|
|
6728
|
+
Ss(t, this._bbox);
|
|
6729
6729
|
const n = new Float32Array(2);
|
|
6730
6730
|
if (i === ct.SHADING)
|
|
6731
6731
|
T.singularValueDecompose2dScale(X(t), n);
|
|
@@ -6783,14 +6783,14 @@ class Hs {
|
|
|
6783
6783
|
const [w, y] = m;
|
|
6784
6784
|
T.singularValueDecompose2dScale(this.baseTransform, m);
|
|
6785
6785
|
const v = w * m[0], A = y * m[1];
|
|
6786
|
-
let x = g, _ = b,
|
|
6787
|
-
const
|
|
6788
|
-
|
|
6786
|
+
let x = g, _ = b, E = !1, S = !1;
|
|
6787
|
+
const M = Math.ceil(h * v), C = Math.ceil(l * A), H = Math.ceil(g * v), V = Math.ceil(b * A);
|
|
6788
|
+
M >= H ? x = h : E = !0, C >= V ? _ = l : S = !0;
|
|
6789
6789
|
const N = this.getSizeAndScale(x, this.ctx.canvas.width, v), Z = this.getSizeAndScale(_, this.ctx.canvas.height, A), k = t.cachedCanvases.getCanvas("pattern", N.size, Z.size), R = k.context, U = o.createCanvasGraphics(R, e);
|
|
6790
|
-
if (U.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext(U, n, a), R.translate(-N.scale * d, -Z.scale * u), U.transform(0, N.scale, 0, 0, Z.scale, 0, 0), R.save(), U.dependencyTracker?.save(), this.clipBbox(U, d, u, p, f), U.baseTransform = X(U.ctx), U.executeOperatorList(i), U.endDrawing(), U.dependencyTracker?.restore(), R.restore(),
|
|
6790
|
+
if (U.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext(U, n, a), R.translate(-N.scale * d, -Z.scale * u), U.transform(0, N.scale, 0, 0, Z.scale, 0, 0), R.save(), U.dependencyTracker?.save(), this.clipBbox(U, d, u, p, f), U.baseTransform = X(U.ctx), U.executeOperatorList(i), U.endDrawing(), U.dependencyTracker?.restore(), R.restore(), E || S) {
|
|
6791
6791
|
const ft = k.canvas;
|
|
6792
|
-
|
|
6793
|
-
const Dt = this.getSizeAndScale(x, this.ctx.canvas.width, v), tt = this.getSizeAndScale(_, this.ctx.canvas.height, A), W = Dt.size, q = tt.size, Ut = t.cachedCanvases.getCanvas("pattern-workaround", W, q), Nt = Ut.context, Ot =
|
|
6792
|
+
E && (x = h), S && (_ = l);
|
|
6793
|
+
const Dt = this.getSizeAndScale(x, this.ctx.canvas.width, v), tt = this.getSizeAndScale(_, this.ctx.canvas.height, A), W = Dt.size, q = tt.size, Ut = t.cachedCanvases.getCanvas("pattern-workaround", W, q), Nt = Ut.context, Ot = E ? Math.floor(g / h) : 0, et = S ? Math.floor(b / l) : 0;
|
|
6794
6794
|
for (let de = 0; de <= Ot; de++)
|
|
6795
6795
|
for (let ue = 0; ue <= et; ue++)
|
|
6796
6796
|
Nt.drawImage(ft, W * de, q * ue, W, q, 0, 0, W, q);
|
|
@@ -6939,12 +6939,12 @@ class lr {
|
|
|
6939
6939
|
function $e(c, t, e, s, i, n, r, a, o, h) {
|
|
6940
6940
|
const [l, d, u, p, f, g] = X(c);
|
|
6941
6941
|
if (d === 0 && u === 0) {
|
|
6942
|
-
const w = r * l + f, y = Math.round(w), v = a * p + g, A = Math.round(v), x = (r + o) * l + f, _ = Math.abs(Math.round(x) - y) || 1,
|
|
6943
|
-
return c.setTransform(Math.sign(l), 0, 0, Math.sign(p), y, A), c.drawImage(t, e, s, i, n, 0, 0, _,
|
|
6942
|
+
const w = r * l + f, y = Math.round(w), v = a * p + g, A = Math.round(v), x = (r + o) * l + f, _ = Math.abs(Math.round(x) - y) || 1, E = (a + h) * p + g, S = Math.abs(Math.round(E) - A) || 1;
|
|
6943
|
+
return c.setTransform(Math.sign(l), 0, 0, Math.sign(p), y, A), c.drawImage(t, e, s, i, n, 0, 0, _, S), c.setTransform(l, d, u, p, f, g), [_, S];
|
|
6944
6944
|
}
|
|
6945
6945
|
if (l === 0 && p === 0) {
|
|
6946
|
-
const w = a * u + f, y = Math.round(w), v = r * d + g, A = Math.round(v), x = (a + h) * u + f, _ = Math.abs(Math.round(x) - y) || 1,
|
|
6947
|
-
return c.setTransform(0, Math.sign(d), Math.sign(u), 0, y, A), c.drawImage(t, e, s, i, n, 0, 0,
|
|
6946
|
+
const w = a * u + f, y = Math.round(w), v = r * d + g, A = Math.round(v), x = (a + h) * u + f, _ = Math.abs(Math.round(x) - y) || 1, E = (r + o) * d + g, S = Math.abs(Math.round(E) - A) || 1;
|
|
6947
|
+
return c.setTransform(0, Math.sign(d), Math.sign(u), 0, y, A), c.drawImage(t, e, s, i, n, 0, 0, S, _), c.setTransform(l, d, u, p, f, g), [S, _];
|
|
6948
6948
|
}
|
|
6949
6949
|
c.drawImage(t, e, s, i, n, r, a, o, h);
|
|
6950
6950
|
const b = Math.hypot(l, d), m = Math.hypot(u, p);
|
|
@@ -7021,12 +7021,12 @@ function pi(c, t) {
|
|
|
7021
7021
|
for (f = u < n ? gt : i, h = 0, p = 0; p < f; p++) {
|
|
7022
7022
|
const x = b - o;
|
|
7023
7023
|
let _ = 0;
|
|
7024
|
-
const
|
|
7025
|
-
let
|
|
7026
|
-
for (; _ <
|
|
7024
|
+
const E = x > y ? s : x * 8 - 7, S = E & -8;
|
|
7025
|
+
let M = 0, C = 0;
|
|
7026
|
+
for (; _ < S; _ += 8)
|
|
7027
7027
|
C = l[o++], m[h++] = C & 128 ? v : A, m[h++] = C & 64 ? v : A, m[h++] = C & 32 ? v : A, m[h++] = C & 16 ? v : A, m[h++] = C & 8 ? v : A, m[h++] = C & 4 ? v : A, m[h++] = C & 2 ? v : A, m[h++] = C & 1 ? v : A;
|
|
7028
|
-
for (; _ <
|
|
7029
|
-
|
|
7028
|
+
for (; _ < E; _++)
|
|
7029
|
+
M === 0 && (C = l[o++], M = 128), m[h++] = C & M ? v : A, M >>= 1;
|
|
7030
7030
|
}
|
|
7031
7031
|
for (; h < w; )
|
|
7032
7032
|
m[h++] = 0;
|
|
@@ -7125,7 +7125,7 @@ class he {
|
|
|
7125
7125
|
if (i !== void 0 && o === i.nextBreakPoint)
|
|
7126
7126
|
return i.breakIt(o, s), o;
|
|
7127
7127
|
if (!n || n(o))
|
|
7128
|
-
if (g = a[o], b = r[o] ?? null, g !==
|
|
7128
|
+
if (g = a[o], b = r[o] ?? null, g !== Se.dependency)
|
|
7129
7129
|
b === null ? this[g](o) : this[g](o, ...b);
|
|
7130
7130
|
else
|
|
7131
7131
|
for (const m of b) {
|
|
@@ -7186,8 +7186,8 @@ class he {
|
|
|
7186
7186
|
} = e, r = this.current.fillColor, a = this.current.patternFill, o = X(s);
|
|
7187
7187
|
let h, l, d, u;
|
|
7188
7188
|
if ((e.bitmap || e.data) && e.count > 1) {
|
|
7189
|
-
const
|
|
7190
|
-
l = JSON.stringify(a ? o : [o.slice(0, 4), r]), h = this._cachedBitmapsMap.get(
|
|
7189
|
+
const M = e.bitmap || e.data.buffer;
|
|
7190
|
+
l = JSON.stringify(a ? o : [o.slice(0, 4), r]), h = this._cachedBitmapsMap.get(M), h || (h = /* @__PURE__ */ new Map(), this._cachedBitmapsMap.set(M, h));
|
|
7191
7191
|
const C = h.get(l);
|
|
7192
7192
|
if (C && !a) {
|
|
7193
7193
|
const H = Math.round(Math.min(o[0], o[2]) + o[4]), V = Math.round(Math.min(o[1], o[3]) + o[5]);
|
|
@@ -7204,13 +7204,13 @@ class he {
|
|
|
7204
7204
|
p = T.transform(p, [1, 0, 0, 1, 0, -n]);
|
|
7205
7205
|
const f = ie.slice();
|
|
7206
7206
|
T.axialAlignedBoundingBox([0, 0, i, n], p, f);
|
|
7207
|
-
const [g, b, m, w] = f, y = Math.round(m - g) || 1, v = Math.round(w - b) || 1, A = this.cachedCanvases.getCanvas("fillCanvas", y, v), x = A.context, _ = g,
|
|
7208
|
-
x.translate(-_, -
|
|
7209
|
-
const
|
|
7210
|
-
return x.fillStyle = a ? r.getPattern(s, this,
|
|
7207
|
+
const [g, b, m, w] = f, y = Math.round(m - g) || 1, v = Math.round(w - b) || 1, A = this.cachedCanvases.getCanvas("fillCanvas", y, v), x = A.context, _ = g, E = b;
|
|
7208
|
+
x.translate(-_, -E), x.transform(...p), d || (d = this._scaleImage(u.canvas, St(x)), d = d.img, h && a && h.set(l, d)), x.imageSmoothingEnabled = fi(X(x), e.interpolate), $e(x, d, 0, 0, d.width, d.height, 0, 0, i, n), x.globalCompositeOperation = "source-in";
|
|
7209
|
+
const S = T.transform(St(x), [1, 0, 0, 1, -_, -E]);
|
|
7210
|
+
return x.fillStyle = a ? r.getPattern(s, this, S, ct.FILL, t) : r, x.fillRect(0, 0, i, n), h && !a && (this.cachedCanvases.delete("fillCanvas"), h.set(l, A.canvas)), this.dependencyTracker?.recordDependencies(t, At.transformAndFill), {
|
|
7211
7211
|
canvas: A.canvas,
|
|
7212
7212
|
offsetX: Math.round(_),
|
|
7213
|
-
offsetY: Math.round(
|
|
7213
|
+
offsetY: Math.round(E)
|
|
7214
7214
|
};
|
|
7215
7215
|
}
|
|
7216
7216
|
setLineWidth(t, e) {
|
|
@@ -7346,10 +7346,10 @@ class he {
|
|
|
7346
7346
|
return;
|
|
7347
7347
|
}
|
|
7348
7348
|
if (this.dependencyTracker !== null) {
|
|
7349
|
-
const r = e ===
|
|
7349
|
+
const r = e === Se.stroke ? this.current.lineWidth / 2 : 0;
|
|
7350
7350
|
this.dependencyTracker.resetBBox(t).recordBBox(t, this.ctx, i[0] - r, i[2] + r, i[1] - r, i[3] + r).recordDependencies(t, ["transform"]);
|
|
7351
7351
|
}
|
|
7352
|
-
n instanceof Path2D || (n = s[0] =
|
|
7352
|
+
n instanceof Path2D || (n = s[0] = Pi(n)), T.axialAlignedBoundingBox(i, X(this.ctx), this.current.minMax), this[e](t, n), this._pathStartIdx = t;
|
|
7353
7353
|
}
|
|
7354
7354
|
closePath(t) {
|
|
7355
7355
|
this.ctx.closePath();
|
|
@@ -7359,7 +7359,7 @@ class he {
|
|
|
7359
7359
|
if (i.globalAlpha = this.current.strokeAlpha, this.contentVisible)
|
|
7360
7360
|
if (typeof n == "object" && n?.getPattern) {
|
|
7361
7361
|
const r = n.isModifyingCurrentTransform() ? i.getTransform() : null;
|
|
7362
|
-
if (i.save(), i.strokeStyle = n.getPattern(i, this,
|
|
7362
|
+
if (i.save(), i.strokeStyle = n.getPattern(i, this, St(i), ct.STROKE, t), r) {
|
|
7363
7363
|
const a = new Path2D();
|
|
7364
7364
|
a.addPath(e, i.getTransform().invertSelf().multiplySelf(r)), e = a;
|
|
7365
7365
|
}
|
|
@@ -7376,7 +7376,7 @@ class he {
|
|
|
7376
7376
|
let a = !1;
|
|
7377
7377
|
if (r) {
|
|
7378
7378
|
const h = n.isModifyingCurrentTransform() ? i.getTransform() : null;
|
|
7379
|
-
if (this.dependencyTracker?.save(t), i.save(), i.fillStyle = n.getPattern(i, this,
|
|
7379
|
+
if (this.dependencyTracker?.save(t), i.save(), i.fillStyle = n.getPattern(i, this, St(i), ct.FILL, t), h) {
|
|
7380
7380
|
const l = new Path2D();
|
|
7381
7381
|
l.addPath(e, i.getTransform().invertSelf().multiplySelf(h)), e = l;
|
|
7382
7382
|
}
|
|
@@ -7557,17 +7557,17 @@ class he {
|
|
|
7557
7557
|
const v = s.textRenderingMode & nt.FILL_STROKE_MASK, A = v === nt.FILL || v === nt.FILL_STROKE, x = v === nt.STROKE || v === nt.FILL_STROKE;
|
|
7558
7558
|
if (A && s.patternFill) {
|
|
7559
7559
|
r.save();
|
|
7560
|
-
const C = s.fillColor.getPattern(r, this,
|
|
7560
|
+
const C = s.fillColor.getPattern(r, this, St(r), ct.FILL, t);
|
|
7561
7561
|
w = X(r), r.restore(), r.fillStyle = C;
|
|
7562
7562
|
}
|
|
7563
7563
|
if (x && s.patternStroke) {
|
|
7564
7564
|
r.save();
|
|
7565
|
-
const C = s.strokeColor.getPattern(r, this,
|
|
7565
|
+
const C = s.strokeColor.getPattern(r, this, St(r), ct.STROKE, t);
|
|
7566
7566
|
y = X(r), r.restore(), r.strokeStyle = C;
|
|
7567
7567
|
}
|
|
7568
7568
|
let _ = s.lineWidth;
|
|
7569
|
-
const
|
|
7570
|
-
if (
|
|
7569
|
+
const E = s.textMatrixScale;
|
|
7570
|
+
if (E === 0 || _ === 0 ? x && (_ = this.getSinglePixelWidth()) : _ /= E, a !== 1 && (r.scale(a, a), _ /= a), r.lineWidth = _, i.isInvalidPDFjsFont) {
|
|
7571
7571
|
const C = [];
|
|
7572
7572
|
let H = 0;
|
|
7573
7573
|
for (const N of e)
|
|
@@ -7580,11 +7580,11 @@ class he {
|
|
|
7580
7580
|
s.x += H * b * d, r.restore(), this.compose();
|
|
7581
7581
|
return;
|
|
7582
7582
|
}
|
|
7583
|
-
let
|
|
7584
|
-
for (
|
|
7585
|
-
const C = e[
|
|
7583
|
+
let S = 0, M;
|
|
7584
|
+
for (M = 0; M < u; ++M) {
|
|
7585
|
+
const C = e[M];
|
|
7586
7586
|
if (typeof C == "number") {
|
|
7587
|
-
|
|
7587
|
+
S += f * C * n / 1e3;
|
|
7588
7588
|
continue;
|
|
7589
7589
|
}
|
|
7590
7590
|
let H = !1;
|
|
@@ -7592,9 +7592,9 @@ class he {
|
|
|
7592
7592
|
let k, R, U = C.width;
|
|
7593
7593
|
if (p) {
|
|
7594
7594
|
const tt = C.vmetric || g, W = -(C.vmetric ? tt[1] : U * 0.5) * b, q = tt[2] * b;
|
|
7595
|
-
U = tt ? -tt[0] : U, k = W / a, R = (
|
|
7595
|
+
U = tt ? -tt[0] : U, k = W / a, R = (S + q) / a;
|
|
7596
7596
|
} else
|
|
7597
|
-
k =
|
|
7597
|
+
k = S / a, R = 0;
|
|
7598
7598
|
let ft;
|
|
7599
7599
|
if (i.remeasure && U > 0) {
|
|
7600
7600
|
ft = r.measureText(N);
|
|
@@ -7615,9 +7615,9 @@ class he {
|
|
|
7615
7615
|
}
|
|
7616
7616
|
}
|
|
7617
7617
|
const Dt = p ? U * b - V * l : U * b + V * l;
|
|
7618
|
-
|
|
7618
|
+
S += Dt, H && r.restore();
|
|
7619
7619
|
}
|
|
7620
|
-
p ? s.y -=
|
|
7620
|
+
p ? s.y -= S : s.x += S * d, r.restore(), this.compose(), this.dependencyTracker?.recordShowTextOperation(t);
|
|
7621
7621
|
}
|
|
7622
7622
|
showType3Text(t, e) {
|
|
7623
7623
|
const s = this.ctx, i = this.current, n = i.font, r = i.fontSize, a = i.fontDirection, o = n.vertical ? 1 : -1, h = i.charSpacing, l = i.wordSpacing, d = i.textHScale * a, u = i.fontMatrix || ms, p = e.length, f = i.textRenderingMode === nt.INVISIBLE;
|
|
@@ -7686,8 +7686,8 @@ class he {
|
|
|
7686
7686
|
const s = this.ctx;
|
|
7687
7687
|
this.save(t);
|
|
7688
7688
|
const i = this._getPattern(t, e);
|
|
7689
|
-
s.fillStyle = i.getPattern(s, this,
|
|
7690
|
-
const n =
|
|
7689
|
+
s.fillStyle = i.getPattern(s, this, St(s), ct.SHADING, t);
|
|
7690
|
+
const n = St(s);
|
|
7691
7691
|
if (n) {
|
|
7692
7692
|
const {
|
|
7693
7693
|
width: r,
|
|
@@ -7830,7 +7830,7 @@ class he {
|
|
|
7830
7830
|
} = r, d = this.cachedCanvases.getCanvas("maskCanvas", o, h), u = d.context;
|
|
7831
7831
|
u.save();
|
|
7832
7832
|
const p = this.getObject(t, a, r);
|
|
7833
|
-
gi(u, p), u.globalCompositeOperation = "source-in", u.fillStyle = n ? i.getPattern(u, this,
|
|
7833
|
+
gi(u, p), u.globalCompositeOperation = "source-in", u.fillStyle = n ? i.getPattern(u, this, St(s), ct.FILL, t) : i, u.fillRect(0, 0, o, h), u.restore(), s.save(), s.transform(...l), s.scale(1, -1), $e(s, d.canvas, 0, 0, o, h, 0, -1, 1, 1), this.dependencyTracker?.recordBBox(t, s, 0, o, 0, h), s.restore();
|
|
7834
7834
|
}
|
|
7835
7835
|
this.compose(), this.dependencyTracker?.recordOperation(t);
|
|
7836
7836
|
}
|
|
@@ -7894,7 +7894,7 @@ class he {
|
|
|
7894
7894
|
const h = this.cachedCanvases.getCanvas("inlineImage", s, i).context;
|
|
7895
7895
|
pi(h, e), a = this.applyTransferMapsToCanvas(h);
|
|
7896
7896
|
}
|
|
7897
|
-
const o = this._scaleImage(a,
|
|
7897
|
+
const o = this._scaleImage(a, St(n));
|
|
7898
7898
|
n.imageSmoothingEnabled = fi(X(n), e.interpolate), this.dependencyTracker?.resetBBox(t).recordBBox(t, n, 0, s, -i, 0).recordDependencies(t, At.imageXObject).recordOperation(t), $e(n, o.img, 0, 0, o.paintWidth, o.paintHeight, 0, -i, s, i), this.compose(), this.restore(t);
|
|
7899
7899
|
}
|
|
7900
7900
|
paintInlineImageXObjectGroup(t, e, s) {
|
|
@@ -8023,8 +8023,8 @@ class he {
|
|
|
8023
8023
|
return !0;
|
|
8024
8024
|
}
|
|
8025
8025
|
}
|
|
8026
|
-
for (const c in
|
|
8027
|
-
he.prototype[c] !== void 0 && (he.prototype[
|
|
8026
|
+
for (const c in Se)
|
|
8027
|
+
he.prototype[c] !== void 0 && (he.prototype[Se[c]] = he.prototype[c]);
|
|
8028
8028
|
class qt {
|
|
8029
8029
|
static #t = null;
|
|
8030
8030
|
static #e = "";
|
|
@@ -8470,7 +8470,7 @@ function wr(c) {
|
|
|
8470
8470
|
try {
|
|
8471
8471
|
const u = new TextDecoder(l, {
|
|
8472
8472
|
fatal: !0
|
|
8473
|
-
}), p =
|
|
8473
|
+
}), p = Pe(d);
|
|
8474
8474
|
d = u.decode(p), t = !1;
|
|
8475
8475
|
} catch {
|
|
8476
8476
|
}
|
|
@@ -8715,9 +8715,9 @@ class xr {
|
|
|
8715
8715
|
const us = 200, ps = 206;
|
|
8716
8716
|
function _r(c) {
|
|
8717
8717
|
const t = c.response;
|
|
8718
|
-
return typeof t != "string" ? t :
|
|
8718
|
+
return typeof t != "string" ? t : Pe(t).buffer;
|
|
8719
8719
|
}
|
|
8720
|
-
class
|
|
8720
|
+
class Er {
|
|
8721
8721
|
_responseOrigin = null;
|
|
8722
8722
|
constructor({
|
|
8723
8723
|
url: t,
|
|
@@ -8780,9 +8780,9 @@ class Sr {
|
|
|
8780
8780
|
delete this.pendingRequests[t], e.abort();
|
|
8781
8781
|
}
|
|
8782
8782
|
}
|
|
8783
|
-
class
|
|
8783
|
+
class Sr {
|
|
8784
8784
|
constructor(t) {
|
|
8785
|
-
this._source = t, this._manager = new
|
|
8785
|
+
this._source = t, this._manager = new Er(t), this._rangeChunkSize = t.rangeChunkSize, this._fullRequestReader = null, this._rangeRequestReaders = [];
|
|
8786
8786
|
}
|
|
8787
8787
|
_onRangeRequestReaderClosed(t) {
|
|
8788
8788
|
const e = this._rangeRequestReaders.indexOf(t);
|
|
@@ -8966,16 +8966,16 @@ class Tr {
|
|
|
8966
8966
|
this._requests.length = 0, this._manager.isPendingRequest(this._requestId) && this._manager.abortRequest(this._requestId), this._close();
|
|
8967
8967
|
}
|
|
8968
8968
|
}
|
|
8969
|
-
const
|
|
8970
|
-
function
|
|
8971
|
-
if (
|
|
8969
|
+
const Pr = /^[a-z][a-z0-9\-+.]+:/i;
|
|
8970
|
+
function Mr(c) {
|
|
8971
|
+
if (Pr.test(c))
|
|
8972
8972
|
return new URL(c);
|
|
8973
8973
|
const t = process.getBuiltinModule("url");
|
|
8974
8974
|
return new URL(t.pathToFileURL(c));
|
|
8975
8975
|
}
|
|
8976
8976
|
class kr {
|
|
8977
8977
|
constructor(t) {
|
|
8978
|
-
this.source = t, this.url =
|
|
8978
|
+
this.source = t, this.url = Mr(t.url), B(this.url.protocol === "file:", "PDFNodeStream only supports file:// URLs."), this._fullRequestReader = null, this._rangeRequestReaders = [];
|
|
8979
8979
|
}
|
|
8980
8980
|
get _progressiveDataLength() {
|
|
8981
8981
|
return this._fullRequestReader?._loaded ?? 0;
|
|
@@ -9180,7 +9180,7 @@ class yt {
|
|
|
9180
9180
|
#b = null;
|
|
9181
9181
|
static #w = /* @__PURE__ */ new Map();
|
|
9182
9182
|
static #y = /* @__PURE__ */ new Map();
|
|
9183
|
-
static #
|
|
9183
|
+
static #S = /* @__PURE__ */ new WeakMap();
|
|
9184
9184
|
static #_ = null;
|
|
9185
9185
|
static #A = /* @__PURE__ */ new Set();
|
|
9186
9186
|
constructor({
|
|
@@ -9209,7 +9209,7 @@ class yt {
|
|
|
9209
9209
|
pageX: r,
|
|
9210
9210
|
pageY: a
|
|
9211
9211
|
} = s.rawDims;
|
|
9212
|
-
this.#b = [1, 0, 0, -1, -r, a + n], this.#o = i, this.#n = n, yt.#
|
|
9212
|
+
this.#b = [1, 0, 0, -1, -r, a + n], this.#o = i, this.#n = n, yt.#M(), e.style.setProperty("--min-font-size", yt.#_), Wt(e, s), this.#t.promise.finally(() => {
|
|
9213
9213
|
yt.#A.delete(this), this.#r = null, this.#p = null;
|
|
9214
9214
|
}).catch(() => {
|
|
9215
9215
|
});
|
|
@@ -9251,7 +9251,7 @@ class yt {
|
|
|
9251
9251
|
ctx: yt.#k(this.#a)
|
|
9252
9252
|
};
|
|
9253
9253
|
for (const r of this.#c)
|
|
9254
|
-
n.properties = this.#g.get(r), n.div = r, this.#
|
|
9254
|
+
n.properties = this.#g.get(r), n.div = r, this.#E(n);
|
|
9255
9255
|
}
|
|
9256
9256
|
}
|
|
9257
9257
|
cancel() {
|
|
@@ -9312,12 +9312,12 @@ class yt {
|
|
|
9312
9312
|
const f = Math.abs(t.transform[0]), g = Math.abs(t.transform[3]);
|
|
9313
9313
|
f !== g && Math.max(f, g) / Math.min(f, g) > 1.5 && (p = !0);
|
|
9314
9314
|
}
|
|
9315
|
-
if (p && (s.canvasWidth = r.vertical ? t.height : t.width), this.#g.set(e, s), this.#r.div = e, this.#r.properties = s, this.#
|
|
9315
|
+
if (p && (s.canvasWidth = r.vertical ? t.height : t.width), this.#g.set(e, s), this.#r.div = e, this.#r.properties = s, this.#E(this.#r), s.hasText && this.#e.append(e), s.hasEOL) {
|
|
9316
9316
|
const f = document.createElement("br");
|
|
9317
9317
|
f.setAttribute("role", "presentation"), this.#e.append(f);
|
|
9318
9318
|
}
|
|
9319
9319
|
}
|
|
9320
|
-
#
|
|
9320
|
+
#E(t) {
|
|
9321
9321
|
const {
|
|
9322
9322
|
div: e,
|
|
9323
9323
|
properties: s,
|
|
@@ -9332,7 +9332,7 @@ class yt {
|
|
|
9332
9332
|
canvasWidth: a,
|
|
9333
9333
|
fontSize: o
|
|
9334
9334
|
} = s;
|
|
9335
|
-
yt.#
|
|
9335
|
+
yt.#P(i, o * this.#d, r);
|
|
9336
9336
|
const {
|
|
9337
9337
|
width: h
|
|
9338
9338
|
} = i.measureText(e.textContent);
|
|
@@ -9357,18 +9357,18 @@ class yt {
|
|
|
9357
9357
|
s.className = "hiddenCanvasElement", s.lang = t, document.body.append(s), e = s.getContext("2d", {
|
|
9358
9358
|
alpha: !1,
|
|
9359
9359
|
willReadFrequently: !0
|
|
9360
|
-
}), this.#y.set(t, e), this.#
|
|
9360
|
+
}), this.#y.set(t, e), this.#S.set(e, {
|
|
9361
9361
|
size: 0,
|
|
9362
9362
|
family: ""
|
|
9363
9363
|
});
|
|
9364
9364
|
}
|
|
9365
9365
|
return e;
|
|
9366
9366
|
}
|
|
9367
|
-
static #
|
|
9368
|
-
const i = this.#
|
|
9367
|
+
static #P(t, e, s) {
|
|
9368
|
+
const i = this.#S.get(t);
|
|
9369
9369
|
e === i.size && s === i.family || (t.font = `${e}px ${s}`, i.size = e, i.family = s);
|
|
9370
9370
|
}
|
|
9371
|
-
static #
|
|
9371
|
+
static #M() {
|
|
9372
9372
|
if (this.#_ !== null)
|
|
9373
9373
|
return;
|
|
9374
9374
|
const t = document.createElement("div");
|
|
@@ -9379,7 +9379,7 @@ class yt {
|
|
|
9379
9379
|
if (i)
|
|
9380
9380
|
return i;
|
|
9381
9381
|
const n = this.#k(s);
|
|
9382
|
-
n.canvas.width = n.canvas.height = bi, this.#
|
|
9382
|
+
n.canvas.width = n.canvas.height = bi, this.#P(n, bi, t);
|
|
9383
9383
|
const r = n.measureText(""), a = r.fontBoundingBoxAscent, o = Math.abs(r.fontBoundingBoxDescent);
|
|
9384
9384
|
n.canvas.width = n.canvas.height = 0;
|
|
9385
9385
|
let h = 0.8;
|
|
@@ -9397,7 +9397,7 @@ function Gi(c = {}) {
|
|
|
9397
9397
|
docId: e
|
|
9398
9398
|
} = t, s = c.url ? zn(c.url) : null, i = c.data ? Un(c.data) : null, n = c.httpHeaders || null, r = c.withCredentials === !0, a = c.password ?? null, o = c.range instanceof ji ? c.range : null, h = Number.isInteger(c.rangeChunkSize) && c.rangeChunkSize > 0 ? c.rangeChunkSize : 2 ** 16;
|
|
9399
9399
|
let l = c.worker instanceof Cs ? c.worker : null;
|
|
9400
|
-
const d = c.verbosity, u = typeof c.docBaseUrl == "string" && !Ze(c.docBaseUrl) ? c.docBaseUrl : null, p = Ne(c.cMapUrl), f = c.cMapPacked !== !1, g = c.CMapReaderFactory || (dt ? Kn : ii), b = Ne(c.iccUrl), m = Ne(c.standardFontDataUrl), w = c.StandardFontDataFactory || (dt ? Qn : ni), y = Ne(c.wasmUrl), v = c.WasmFactory || (dt ? Jn : ri), A = c.stopAtErrors !== !0, x = Number.isInteger(c.maxImageSize) && c.maxImageSize > -1 ? c.maxImageSize : -1, _ = c.isEvalSupported !== !1,
|
|
9400
|
+
const d = c.verbosity, u = typeof c.docBaseUrl == "string" && !Ze(c.docBaseUrl) ? c.docBaseUrl : null, p = Ne(c.cMapUrl), f = c.cMapPacked !== !1, g = c.CMapReaderFactory || (dt ? Kn : ii), b = Ne(c.iccUrl), m = Ne(c.standardFontDataUrl), w = c.StandardFontDataFactory || (dt ? Qn : ni), y = Ne(c.wasmUrl), v = c.WasmFactory || (dt ? Jn : ri), A = c.stopAtErrors !== !0, x = Number.isInteger(c.maxImageSize) && c.maxImageSize > -1 ? c.maxImageSize : -1, _ = c.isEvalSupported !== !1, E = typeof c.isOffscreenCanvasSupported == "boolean" ? c.isOffscreenCanvasSupported : !dt, S = typeof c.isImageDecoderSupported == "boolean" ? c.isImageDecoderSupported : !dt && (at.platform.isFirefox || !globalThis.chrome), M = Number.isInteger(c.canvasMaxAreaInBytes) ? c.canvasMaxAreaInBytes : -1, C = typeof c.disableFontFace == "boolean" ? c.disableFontFace : dt, H = c.fontExtraProperties === !0, V = c.enableXfa === !0, N = c.ownerDocument || globalThis.document, Z = c.disableRange === !0, k = c.disableStream === !0, R = c.disableAutoFetch === !0, U = c.pdfBug === !0, ft = c.CanvasFactory || (dt ? Yn : Wn), Dt = c.FilterFactory || (dt ? Xn : qn), tt = c.enableHWA === !0, W = c.useWasm !== !1, q = o ? o.length : c.length ?? NaN, Ut = typeof c.useSystemFonts == "boolean" ? c.useSystemFonts : !dt && !C, Nt = typeof c.useWorkerFetch == "boolean" ? c.useWorkerFetch : !!(g === ii && w === ni && v === ri && p && m && y && we(p, document.baseURI) && we(m, document.baseURI) && we(y, document.baseURI)), Ot = null;
|
|
9401
9401
|
gn(d);
|
|
9402
9402
|
const et = {
|
|
9403
9403
|
canvasFactory: new ft({
|
|
@@ -9438,9 +9438,9 @@ function Gi(c = {}) {
|
|
|
9438
9438
|
disableFontFace: C,
|
|
9439
9439
|
ignoreErrors: A,
|
|
9440
9440
|
isEvalSupported: _,
|
|
9441
|
-
isOffscreenCanvasSupported:
|
|
9442
|
-
isImageDecoderSupported:
|
|
9443
|
-
canvasMaxAreaInBytes:
|
|
9441
|
+
isOffscreenCanvasSupported: E,
|
|
9442
|
+
isImageDecoderSupported: S,
|
|
9443
|
+
canvasMaxAreaInBytes: M,
|
|
9444
9444
|
fontExtraProperties: H,
|
|
9445
9445
|
useSystemFonts: Ut,
|
|
9446
9446
|
useWasm: W,
|
|
@@ -9474,7 +9474,7 @@ function Gi(c = {}) {
|
|
|
9474
9474
|
else if (!i) {
|
|
9475
9475
|
if (!s)
|
|
9476
9476
|
throw new Error("getDocument - no `url` parameter provided.");
|
|
9477
|
-
const ns = we(s) ? vr : dt ? kr :
|
|
9477
|
+
const ns = we(s) ? vr : dt ? kr : Sr;
|
|
9478
9478
|
is = new ns({
|
|
9479
9479
|
url: s,
|
|
9480
9480
|
length: q,
|
|
@@ -9778,14 +9778,14 @@ class Nr {
|
|
|
9778
9778
|
lastChunk: !1,
|
|
9779
9779
|
separateAnnots: null
|
|
9780
9780
|
}, this._stats?.time("Page Request"), this._pumpOperatorList(g));
|
|
9781
|
-
const v = !!(this._pdfBug && globalThis.StepperManager?.enabled), A = !this.recordedBBoxes && (p || v), x = (
|
|
9781
|
+
const v = !!(this._pdfBug && globalThis.StepperManager?.enabled), A = !this.recordedBBoxes && (p || v), x = (S) => {
|
|
9782
9782
|
if (w.renderTasks.delete(_), A) {
|
|
9783
|
-
const
|
|
9784
|
-
|
|
9783
|
+
const M = _.gfx?.dependencyTracker.take();
|
|
9784
|
+
M && (_.stepper && _.stepper.setOperatorBBoxes(M, _.gfx.dependencyTracker.takeDebugMetadata()), p && (this.recordedBBoxes = M));
|
|
9785
9785
|
}
|
|
9786
|
-
y && (this.#t = !0), this.#e(),
|
|
9786
|
+
y && (this.#t = !0), this.#e(), S ? (_.capability.reject(S), this._abortOperatorList({
|
|
9787
9787
|
intentState: w,
|
|
9788
|
-
reason:
|
|
9788
|
+
reason: S instanceof Error ? S : new Error(S)
|
|
9789
9789
|
})) : _.capability.resolve(), this._stats && (this._stats.timeEnd("Rendering"), this._stats.timeEnd("Overall"), globalThis.Stats?.enabled && globalThis.Stats.add(this.pageNumber, this._stats));
|
|
9790
9790
|
}, _ = new re({
|
|
9791
9791
|
callback: x,
|
|
@@ -9811,19 +9811,19 @@ class Nr {
|
|
|
9811
9811
|
operationsFilter: f
|
|
9812
9812
|
});
|
|
9813
9813
|
(w.renderTasks ||= /* @__PURE__ */ new Set()).add(_);
|
|
9814
|
-
const
|
|
9815
|
-
return Promise.all([w.displayReadyCapability.promise, o]).then(([
|
|
9814
|
+
const E = _.task;
|
|
9815
|
+
return Promise.all([w.displayReadyCapability.promise, o]).then(([S, M]) => {
|
|
9816
9816
|
if (this.destroyed) {
|
|
9817
9817
|
x();
|
|
9818
9818
|
return;
|
|
9819
9819
|
}
|
|
9820
|
-
if (this._stats?.time("Rendering"), !(
|
|
9820
|
+
if (this._stats?.time("Rendering"), !(M.renderingIntent & b))
|
|
9821
9821
|
throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");
|
|
9822
9822
|
_.initializeGraphics({
|
|
9823
|
-
transparency:
|
|
9824
|
-
optionalContentConfig:
|
|
9823
|
+
transparency: S,
|
|
9824
|
+
optionalContentConfig: M
|
|
9825
9825
|
}), _.operatorListChanged();
|
|
9826
|
-
}).catch(x),
|
|
9826
|
+
}).catch(x), E;
|
|
9827
9827
|
}
|
|
9828
9828
|
getOperatorList({
|
|
9829
9829
|
intent: t = "display",
|
|
@@ -10011,19 +10011,19 @@ class Nr {
|
|
|
10011
10011
|
return this._stats;
|
|
10012
10012
|
}
|
|
10013
10013
|
}
|
|
10014
|
-
var Gt,
|
|
10014
|
+
var Gt, Mt, Ht, le, gs, Jt, ne, Et, Ue, Wi, qi, me, _e, Xe;
|
|
10015
10015
|
const rt = class Ae {
|
|
10016
10016
|
constructor({
|
|
10017
10017
|
name: t = null,
|
|
10018
10018
|
port: e = null,
|
|
10019
10019
|
verbosity: s = fn()
|
|
10020
10020
|
} = {}) {
|
|
10021
|
-
if (Ft(this,
|
|
10021
|
+
if (Ft(this, Et), Ft(this, Gt, Promise.withResolvers()), Ft(this, Mt, null), Ft(this, Ht, null), Ft(this, le, null), this.name = t, this.destroyed = !1, this.verbosity = s, e) {
|
|
10022
10022
|
if (Y(Ae, ne).has(e))
|
|
10023
10023
|
throw new Error("Cannot use more than one PDFWorker per port.");
|
|
10024
|
-
Y(Ae, ne).set(e, this), It(this,
|
|
10024
|
+
Y(Ae, ne).set(e, this), It(this, Et, Wi).call(this, e);
|
|
10025
10025
|
} else
|
|
10026
|
-
It(this,
|
|
10026
|
+
It(this, Et, qi).call(this);
|
|
10027
10027
|
}
|
|
10028
10028
|
get promise() {
|
|
10029
10029
|
return Y(this, Gt).promise;
|
|
@@ -10032,10 +10032,10 @@ const rt = class Ae {
|
|
|
10032
10032
|
return Y(this, Ht);
|
|
10033
10033
|
}
|
|
10034
10034
|
get messageHandler() {
|
|
10035
|
-
return Y(this,
|
|
10035
|
+
return Y(this, Mt);
|
|
10036
10036
|
}
|
|
10037
10037
|
destroy() {
|
|
10038
|
-
this.destroyed = !0, Y(this, le)?.terminate(), mt(this, le, null), Y(Ae, ne).delete(Y(this, Ht)), mt(this, Ht, null), Y(this,
|
|
10038
|
+
this.destroyed = !0, Y(this, le)?.terminate(), mt(this, le, null), Y(Ae, ne).delete(Y(this, Ht)), mt(this, Ht, null), Y(this, Mt)?.destroy(), mt(this, Mt, null);
|
|
10039
10039
|
}
|
|
10040
10040
|
static create(t) {
|
|
10041
10041
|
const e = Y(this, ne).get(t?.port);
|
|
@@ -10059,16 +10059,16 @@ const rt = class Ae {
|
|
|
10059
10059
|
)).WorkerMessageHandler)());
|
|
10060
10060
|
}
|
|
10061
10061
|
};
|
|
10062
|
-
Gt = /* @__PURE__ */ new WeakMap(),
|
|
10063
|
-
Y(this, Gt).resolve(), Y(this,
|
|
10062
|
+
Gt = /* @__PURE__ */ new WeakMap(), Mt = /* @__PURE__ */ new WeakMap(), Ht = /* @__PURE__ */ new WeakMap(), le = /* @__PURE__ */ new WeakMap(), gs = /* @__PURE__ */ new WeakMap(), Jt = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), Et = /* @__PURE__ */ new WeakSet(), Ue = function() {
|
|
10063
|
+
Y(this, Gt).resolve(), Y(this, Mt).send("configure", {
|
|
10064
10064
|
verbosity: this.verbosity
|
|
10065
10065
|
});
|
|
10066
10066
|
}, Wi = function(c) {
|
|
10067
|
-
mt(this, Ht, c), mt(this,
|
|
10068
|
-
}), It(this,
|
|
10067
|
+
mt(this, Ht, c), mt(this, Mt, new ve("main", "worker", c)), Y(this, Mt).on("ready", () => {
|
|
10068
|
+
}), It(this, Et, Ue).call(this);
|
|
10069
10069
|
}, qi = function() {
|
|
10070
10070
|
if (Y(rt, Jt) || Y(rt, _e, Xe)) {
|
|
10071
|
-
It(this,
|
|
10071
|
+
It(this, Et, me).call(this);
|
|
10072
10072
|
return;
|
|
10073
10073
|
}
|
|
10074
10074
|
let {
|
|
@@ -10079,7 +10079,7 @@ Gt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
|
|
|
10079
10079
|
const t = new Worker(c, {
|
|
10080
10080
|
type: "module"
|
|
10081
10081
|
}), e = new ve("main", "worker", t), s = () => {
|
|
10082
|
-
i.abort(), e.destroy(), t.terminate(), this.destroyed ? Y(this, Gt).reject(new Error("Worker was destroyed")) : It(this,
|
|
10082
|
+
i.abort(), e.destroy(), t.terminate(), this.destroyed ? Y(this, Gt).reject(new Error("Worker was destroyed")) : It(this, Et, me).call(this);
|
|
10083
10083
|
}, i = new AbortController();
|
|
10084
10084
|
t.addEventListener("error", () => {
|
|
10085
10085
|
Y(this, le) || s();
|
|
@@ -10090,7 +10090,7 @@ Gt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
|
|
|
10090
10090
|
s();
|
|
10091
10091
|
return;
|
|
10092
10092
|
}
|
|
10093
|
-
mt(this,
|
|
10093
|
+
mt(this, Mt, e), mt(this, Ht, t), mt(this, le, t), It(this, Et, Ue).call(this);
|
|
10094
10094
|
}), e.on("ready", (r) => {
|
|
10095
10095
|
if (i.abort(), this.destroyed) {
|
|
10096
10096
|
s();
|
|
@@ -10099,7 +10099,7 @@ Gt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
|
|
|
10099
10099
|
try {
|
|
10100
10100
|
n();
|
|
10101
10101
|
} catch {
|
|
10102
|
-
It(this,
|
|
10102
|
+
It(this, Et, me).call(this);
|
|
10103
10103
|
}
|
|
10104
10104
|
});
|
|
10105
10105
|
const n = () => {
|
|
@@ -10111,7 +10111,7 @@ Gt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
|
|
|
10111
10111
|
} catch {
|
|
10112
10112
|
Je("The worker has been disabled.");
|
|
10113
10113
|
}
|
|
10114
|
-
It(this,
|
|
10114
|
+
It(this, Et, me).call(this);
|
|
10115
10115
|
}, me = function() {
|
|
10116
10116
|
Y(rt, Jt) || (I("Setting up fake worker."), mt(rt, Jt, !0)), rt._setupFakeWorkerGlobal.then((c) => {
|
|
10117
10117
|
if (this.destroyed) {
|
|
@@ -10121,7 +10121,7 @@ Gt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
|
|
|
10121
10121
|
const t = new jn();
|
|
10122
10122
|
mt(this, Ht, t);
|
|
10123
10123
|
const e = `fake${ln(rt, gs)._++}`, s = new ve(e + "_worker", e, t);
|
|
10124
|
-
c.setup(s, t), mt(this,
|
|
10124
|
+
c.setup(s, t), mt(this, Mt, new ve(e, e + "_worker", t)), It(this, Et, Ue).call(this);
|
|
10125
10125
|
}).catch((c) => {
|
|
10126
10126
|
Y(this, Gt).reject(new Error(`Setting up fake worker failed: "${c.message}".`));
|
|
10127
10127
|
});
|
|
@@ -11044,7 +11044,7 @@ class K {
|
|
|
11044
11044
|
const {
|
|
11045
11045
|
data: t
|
|
11046
11046
|
} = this;
|
|
11047
|
-
return this.annotationStorage.getRawValue(`${
|
|
11047
|
+
return this.annotationStorage.getRawValue(`${Ee}${t.id}`)?.popup?.contents || t.contentsObj?.str || "";
|
|
11048
11048
|
}
|
|
11049
11049
|
set commentText(t) {
|
|
11050
11050
|
const {
|
|
@@ -11055,7 +11055,7 @@ class K {
|
|
|
11055
11055
|
};
|
|
11056
11056
|
this.annotationStorage.updateEditor(e.id, {
|
|
11057
11057
|
popup: s
|
|
11058
|
-
}) || this.annotationStorage.setValue(`${
|
|
11058
|
+
}) || this.annotationStorage.setValue(`${Ee}${e.id}`, {
|
|
11059
11059
|
id: e.id,
|
|
11060
11060
|
annotationType: e.annotationType,
|
|
11061
11061
|
pageIndex: this.parent.page._pageIndex,
|
|
@@ -11313,8 +11313,8 @@ class K {
|
|
|
11313
11313
|
const p = l.createElement("clipPath"), f = `clippath_${this.data.id}`;
|
|
11314
11314
|
p.setAttribute("id", f), p.setAttribute("clipPathUnits", "objectBoundingBox"), u.append(p);
|
|
11315
11315
|
for (let g = 2, b = t.length; g < b; g += 8) {
|
|
11316
|
-
const m = t[g], w = t[g + 1], y = t[g + 2], v = t[g + 3], A = l.createElement("rect"), x = (y - e) / o, _ = (n - w) / h,
|
|
11317
|
-
A.setAttribute("x", x), A.setAttribute("y", _), A.setAttribute("width",
|
|
11316
|
+
const m = t[g], w = t[g + 1], y = t[g + 2], v = t[g + 3], A = l.createElement("rect"), x = (y - e) / o, _ = (n - w) / h, E = (m - y) / o, S = (w - v) / h;
|
|
11317
|
+
A.setAttribute("x", x), A.setAttribute("y", _), A.setAttribute("width", E), A.setAttribute("height", S), p.append(A), a?.push(`<rect vector-effect="non-scaling-stroke" x="${x}" y="${_}" width="${E}" height="${S}"/>`);
|
|
11318
11318
|
}
|
|
11319
11319
|
this.#e && (a.push("</g></svg>')"), r.backgroundImage = a.join("")), this.container.append(d), this.container.style.clipPath = `url(#${f})`;
|
|
11320
11320
|
}
|
|
@@ -12232,12 +12232,12 @@ class Kr {
|
|
|
12232
12232
|
#b = null;
|
|
12233
12233
|
#w = null;
|
|
12234
12234
|
#y = null;
|
|
12235
|
-
#
|
|
12235
|
+
#S = null;
|
|
12236
12236
|
#_ = null;
|
|
12237
12237
|
#A = null;
|
|
12238
12238
|
#T = !1;
|
|
12239
12239
|
#v = null;
|
|
12240
|
-
#
|
|
12240
|
+
#E = null;
|
|
12241
12241
|
constructor({
|
|
12242
12242
|
container: t,
|
|
12243
12243
|
color: e,
|
|
@@ -12252,7 +12252,7 @@ class Kr {
|
|
|
12252
12252
|
open: d,
|
|
12253
12253
|
commentManager: u = null
|
|
12254
12254
|
}) {
|
|
12255
|
-
this.#n = t, this.#_ = i, this.#o = r, this.#
|
|
12255
|
+
this.#n = t, this.#_ = i, this.#o = r, this.#S = a, this.#u = o, this.#r = e, this.#y = h, this.#d = l, this.#h = s, this.#t = u, this.#v = s[0], this.#l = ws.toDateObject(n), this.trigger = s.flatMap((p) => p.getElementsToTriggerPopup()), u || (this.#k(), this.#n.hidden = !0, d && this.#x());
|
|
12256
12256
|
}
|
|
12257
12257
|
#k() {
|
|
12258
12258
|
if (this.#f)
|
|
@@ -12274,7 +12274,7 @@ class Kr {
|
|
|
12274
12274
|
signal: t
|
|
12275
12275
|
});
|
|
12276
12276
|
}
|
|
12277
|
-
#
|
|
12277
|
+
#P() {
|
|
12278
12278
|
const t = this.#h.find((e) => e.hasCommentButton);
|
|
12279
12279
|
t && (this.#b = t._normalizePoint(t.commentButtonPosition));
|
|
12280
12280
|
}
|
|
@@ -12283,7 +12283,7 @@ class Kr {
|
|
|
12283
12283
|
this.#g.parentNode || this.#v.container.after(this.#g);
|
|
12284
12284
|
return;
|
|
12285
12285
|
}
|
|
12286
|
-
if (this.#b || this.#
|
|
12286
|
+
if (this.#b || this.#P(), !this.#b)
|
|
12287
12287
|
return;
|
|
12288
12288
|
const {
|
|
12289
12289
|
signal: t
|
|
@@ -12310,7 +12310,7 @@ class Kr {
|
|
|
12310
12310
|
const r = this.#g = document.createElement("button");
|
|
12311
12311
|
r.className = "annotationCommentButton";
|
|
12312
12312
|
const a = this.#v.container;
|
|
12313
|
-
r.style.zIndex = a.style.zIndex + 1, r.tabIndex = 0, r.ariaHasPopup = "dialog", r.ariaControls = "commentPopup", r.setAttribute("data-l10n-id", "pdfjs-show-comment-button"), this.#O(), this.#
|
|
12313
|
+
r.style.zIndex = a.style.zIndex + 1, r.tabIndex = 0, r.ariaHasPopup = "dialog", r.ariaControls = "commentPopup", r.setAttribute("data-l10n-id", "pdfjs-show-comment-button"), this.#O(), this.#M(), r.addEventListener("keydown", this.#e, {
|
|
12314
12314
|
signal: t
|
|
12315
12315
|
}), r.addEventListener("click", s, {
|
|
12316
12316
|
signal: t
|
|
@@ -12321,7 +12321,7 @@ class Kr {
|
|
|
12321
12321
|
}), a.after(r);
|
|
12322
12322
|
}
|
|
12323
12323
|
}
|
|
12324
|
-
#
|
|
12324
|
+
#M() {
|
|
12325
12325
|
if (this.#v.extraPopupElement && !this.#v.editor)
|
|
12326
12326
|
return;
|
|
12327
12327
|
this.#g || this.renderCommentButton();
|
|
@@ -12368,10 +12368,10 @@ class Kr {
|
|
|
12368
12368
|
return this.#g;
|
|
12369
12369
|
}
|
|
12370
12370
|
get comment() {
|
|
12371
|
-
return this.#
|
|
12371
|
+
return this.#E ||= this.#v.commentText, this.#E;
|
|
12372
12372
|
}
|
|
12373
12373
|
set comment(t) {
|
|
12374
|
-
t !== this.comment && (this.#v.commentText = this.#
|
|
12374
|
+
t !== this.comment && (this.#v.commentText = this.#E = t);
|
|
12375
12375
|
}
|
|
12376
12376
|
focus() {
|
|
12377
12377
|
this.#v.container?.focus();
|
|
@@ -12456,8 +12456,8 @@ class Kr {
|
|
|
12456
12456
|
}, t), this.#n.append(t);
|
|
12457
12457
|
}
|
|
12458
12458
|
get #R() {
|
|
12459
|
-
const t = this.#
|
|
12460
|
-
return t?.str && (!e?.str || e.str === t.str) && this.#
|
|
12459
|
+
const t = this.#S, e = this.#o;
|
|
12460
|
+
return t?.str && (!e?.str || e.str === t.str) && this.#S.html || null;
|
|
12461
12461
|
}
|
|
12462
12462
|
get #L() {
|
|
12463
12463
|
return this.#R?.attributes?.style?.fontSize || 0;
|
|
@@ -12502,7 +12502,7 @@ class Kr {
|
|
|
12502
12502
|
deleted: s
|
|
12503
12503
|
}) {
|
|
12504
12504
|
if (this.#t) {
|
|
12505
|
-
s ? (this.remove(), this.#
|
|
12505
|
+
s ? (this.remove(), this.#E = null) : e && (e.deleted ? this.remove() : (this.#O(), this.#E = e.text)), t && (this.#b = null, this.#P(), this.#M());
|
|
12506
12506
|
return;
|
|
12507
12507
|
}
|
|
12508
12508
|
if (s || e?.deleted) {
|
|
@@ -12511,13 +12511,13 @@ class Kr {
|
|
|
12511
12511
|
}
|
|
12512
12512
|
this.#k(), this.#A ||= {
|
|
12513
12513
|
contentsObj: this.#o,
|
|
12514
|
-
richText: this.#
|
|
12515
|
-
}, t && (this.#c = null), e && e.text && (this.#
|
|
12514
|
+
richText: this.#S
|
|
12515
|
+
}, t && (this.#c = null), e && e.text && (this.#S = this.#F(e.text), this.#l = ws.toDateObject(e.date), this.#o = null), this.#m?.remove(), this.#m = null;
|
|
12516
12516
|
}
|
|
12517
12517
|
resetEdited() {
|
|
12518
12518
|
this.#A && ({
|
|
12519
12519
|
contentsObj: this.#o,
|
|
12520
|
-
richText: this.#
|
|
12520
|
+
richText: this.#S
|
|
12521
12521
|
} = this.#A, this.#A = null, this.#m?.remove(), this.#m = null, this.#c = null);
|
|
12522
12522
|
}
|
|
12523
12523
|
remove() {
|
|
@@ -13636,7 +13636,7 @@ class ht extends D {
|
|
|
13636
13636
|
super.resetAnnotationElement(t), t.resetEdited();
|
|
13637
13637
|
}
|
|
13638
13638
|
}
|
|
13639
|
-
class
|
|
13639
|
+
class P {
|
|
13640
13640
|
static PRECISION = 1e-4;
|
|
13641
13641
|
toSVGPath() {
|
|
13642
13642
|
j("Abstract method `toSVGPath` must be implemented.");
|
|
@@ -13777,7 +13777,7 @@ class jt {
|
|
|
13777
13777
|
for (let d = 0, u = o.length - 2; d < u; d += 2)
|
|
13778
13778
|
o[d] = (this.#p[d] - i) / r, o[d + 1] = (this.#p[d + 1] - n) / a;
|
|
13779
13779
|
if (o[o.length - 2] = (this.#n - i) / r, o[o.length - 1] = (this.#o - n) / a, isNaN(s[6]) && !this.isEmpty())
|
|
13780
|
-
return this.#
|
|
13780
|
+
return this.#S(o);
|
|
13781
13781
|
const h = new Float32Array(this.#a.length + 24 + this.#e.length);
|
|
13782
13782
|
let l = t.length;
|
|
13783
13783
|
for (let d = 0; d < l; d += 2) {
|
|
@@ -13798,7 +13798,7 @@ class jt {
|
|
|
13798
13798
|
}
|
|
13799
13799
|
return this.#_(h, l), this.newFreeDrawOutline(h, o, this.#t, this.#u, this.#i, this.#s);
|
|
13800
13800
|
}
|
|
13801
|
-
#
|
|
13801
|
+
#S(t) {
|
|
13802
13802
|
const e = this.#r, [s, i, n, r] = this.#t, [a, o, h, l] = this.#g(), d = new Float32Array(36);
|
|
13803
13803
|
return d.set([NaN, NaN, NaN, NaN, (e[2] - s) / n, (e[3] - i) / r, NaN, NaN, NaN, NaN, (e[4] - s) / n, (e[5] - i) / r, NaN, NaN, NaN, NaN, a, o, NaN, NaN, NaN, NaN, h, l, NaN, NaN, NaN, NaN, (e[16] - s) / n, (e[17] - i) / r, NaN, NaN, NaN, NaN, (e[14] - s) / n, (e[15] - i) / r], 0), this.newFreeDrawOutline(d, t, this.#t, this.#u, this.#i, this.#s);
|
|
13804
13804
|
}
|
|
@@ -13811,7 +13811,7 @@ class jt {
|
|
|
13811
13811
|
return t.set([NaN, NaN, NaN, NaN, (s[0] - n) / a, (s[1] - r) / o, NaN, NaN, NaN, NaN, h, l, NaN, NaN, NaN, NaN, d, u, NaN, NaN, NaN, NaN, (i[0] - n) / a, (i[1] - r) / o], e), e += 24;
|
|
13812
13812
|
}
|
|
13813
13813
|
}
|
|
13814
|
-
class tn extends
|
|
13814
|
+
class tn extends P {
|
|
13815
13815
|
#t;
|
|
13816
13816
|
#e = new Float32Array(4);
|
|
13817
13817
|
#i;
|
|
@@ -13843,16 +13843,16 @@ class tn extends M {
|
|
|
13843
13843
|
let o, h;
|
|
13844
13844
|
switch (n) {
|
|
13845
13845
|
case 0:
|
|
13846
|
-
o =
|
|
13846
|
+
o = P._rescale(this.#n, t, i, r, -a), h = P._rescale(this.#a, t, i, r, -a);
|
|
13847
13847
|
break;
|
|
13848
13848
|
case 90:
|
|
13849
|
-
o =
|
|
13849
|
+
o = P._rescaleAndSwap(this.#n, t, e, r, a), h = P._rescaleAndSwap(this.#a, t, e, r, a);
|
|
13850
13850
|
break;
|
|
13851
13851
|
case 180:
|
|
13852
|
-
o =
|
|
13852
|
+
o = P._rescale(this.#n, s, e, -r, a), h = P._rescale(this.#a, s, e, -r, a);
|
|
13853
13853
|
break;
|
|
13854
13854
|
case 270:
|
|
13855
|
-
o =
|
|
13855
|
+
o = P._rescaleAndSwap(this.#n, s, i, -r, -a), h = P._rescaleAndSwap(this.#a, s, i, -r, -a);
|
|
13856
13856
|
break;
|
|
13857
13857
|
}
|
|
13858
13858
|
return {
|
|
@@ -13892,7 +13892,7 @@ class tn extends M {
|
|
|
13892
13892
|
return g.getOutlines();
|
|
13893
13893
|
}
|
|
13894
13894
|
}
|
|
13895
|
-
class
|
|
13895
|
+
class Ps {
|
|
13896
13896
|
#t;
|
|
13897
13897
|
#e;
|
|
13898
13898
|
#i;
|
|
@@ -13906,8 +13906,8 @@ class Ms {
|
|
|
13906
13906
|
width: m,
|
|
13907
13907
|
height: w
|
|
13908
13908
|
} of t) {
|
|
13909
|
-
const y = Math.floor((g - e) / r) * r, v = Math.ceil((g + m + e) / r) * r, A = Math.floor((b - e) / r) * r, x = Math.ceil((b + w + e) / r) * r, _ = [y, A, x, !0],
|
|
13910
|
-
this.#s.push(_,
|
|
13909
|
+
const y = Math.floor((g - e) / r) * r, v = Math.ceil((g + m + e) / r) * r, A = Math.floor((b - e) / r) * r, x = Math.ceil((b + w + e) / r) * r, _ = [y, A, x, !0], E = [v, A, x, !1];
|
|
13910
|
+
this.#s.push(_, E), T.rectBoundingBox(y, A, v, x, n);
|
|
13911
13911
|
}
|
|
13912
13912
|
const a = n[2] - n[0] + 2 * s, o = n[3] - n[1] + 2 * s, h = n[0] - s, l = n[1] - s;
|
|
13913
13913
|
let d = i ? -1 / 0 : 1 / 0, u = 1 / 0;
|
|
@@ -14017,7 +14017,7 @@ class Ms {
|
|
|
14017
14017
|
return n;
|
|
14018
14018
|
}
|
|
14019
14019
|
}
|
|
14020
|
-
class aa extends
|
|
14020
|
+
class aa extends P {
|
|
14021
14021
|
#t;
|
|
14022
14022
|
#e;
|
|
14023
14023
|
constructor(t, e, s, i) {
|
|
@@ -14053,14 +14053,14 @@ class aa extends M {
|
|
|
14053
14053
|
return ["highlightOutline"];
|
|
14054
14054
|
}
|
|
14055
14055
|
}
|
|
14056
|
-
class
|
|
14056
|
+
class Ms extends jt {
|
|
14057
14057
|
newFreeDrawOutline(t, e, s, i, n, r) {
|
|
14058
14058
|
return new oa(t, e, s, i, n, r);
|
|
14059
14059
|
}
|
|
14060
14060
|
}
|
|
14061
14061
|
class oa extends tn {
|
|
14062
14062
|
newOutliner(t, e, s, i, n, r = 0) {
|
|
14063
|
-
return new
|
|
14063
|
+
return new Ms(t, e, s, i, n, r);
|
|
14064
14064
|
}
|
|
14065
14065
|
}
|
|
14066
14066
|
class J extends D {
|
|
@@ -14129,9 +14129,9 @@ class J extends D {
|
|
|
14129
14129
|
};
|
|
14130
14130
|
}
|
|
14131
14131
|
#w() {
|
|
14132
|
-
const t = new
|
|
14132
|
+
const t = new Ps(this.#i, 1e-3);
|
|
14133
14133
|
this.#h = t.getOutlines(), [this.x, this.y, this.width, this.height] = this.#h.box;
|
|
14134
|
-
const e = new
|
|
14134
|
+
const e = new Ps(this.#i, 25e-4, 1e-3, this._uiManager.direction === "ltr");
|
|
14135
14135
|
this.#r = e.getOutlines();
|
|
14136
14136
|
const {
|
|
14137
14137
|
firstPoint: s
|
|
@@ -14168,12 +14168,12 @@ class J extends D {
|
|
|
14168
14168
|
else if (this.parent) {
|
|
14169
14169
|
const d = this.parent.viewport.rotation;
|
|
14170
14170
|
this.parent.drawLayer.updateProperties(this.#u, {
|
|
14171
|
-
bbox: J.#
|
|
14171
|
+
bbox: J.#E(this.#h.box, (d - this.rotation + 360) % 360),
|
|
14172
14172
|
path: {
|
|
14173
14173
|
d: t.toSVGPath()
|
|
14174
14174
|
}
|
|
14175
14175
|
}), this.parent.drawLayer.updateProperties(this.#f, {
|
|
14176
|
-
bbox: J.#
|
|
14176
|
+
bbox: J.#E(this.#r.box, d),
|
|
14177
14177
|
path: {
|
|
14178
14178
|
d: this.#r.toSVGPath()
|
|
14179
14179
|
}
|
|
@@ -14231,7 +14231,7 @@ class J extends D {
|
|
|
14231
14231
|
updateParams(t, e) {
|
|
14232
14232
|
switch (t) {
|
|
14233
14233
|
case O.HIGHLIGHT_COLOR:
|
|
14234
|
-
this.#
|
|
14234
|
+
this.#S(e);
|
|
14235
14235
|
break;
|
|
14236
14236
|
case O.HIGHLIGHT_THICKNESS:
|
|
14237
14237
|
this.#_(e);
|
|
@@ -14252,7 +14252,7 @@ class J extends D {
|
|
|
14252
14252
|
}
|
|
14253
14253
|
}), this.#a?.updateColor(this.color), super.onUpdatedColor();
|
|
14254
14254
|
}
|
|
14255
|
-
#
|
|
14255
|
+
#S(t) {
|
|
14256
14256
|
const e = (n, r) => {
|
|
14257
14257
|
this.color = n, this.opacity = r, this.onUpdatedColor();
|
|
14258
14258
|
}, s = this.color, i = this.opacity;
|
|
@@ -14298,13 +14298,13 @@ class J extends D {
|
|
|
14298
14298
|
super.enableEditing(), this.div.classList.toggle("disabled", !1);
|
|
14299
14299
|
}
|
|
14300
14300
|
fixAndSetPosition() {
|
|
14301
|
-
return super.fixAndSetPosition(this.#
|
|
14301
|
+
return super.fixAndSetPosition(this.#M());
|
|
14302
14302
|
}
|
|
14303
14303
|
getBaseTranslation() {
|
|
14304
14304
|
return [0, 0];
|
|
14305
14305
|
}
|
|
14306
14306
|
getRect(t, e) {
|
|
14307
|
-
return super.getRect(t, e, this.#
|
|
14307
|
+
return super.getRect(t, e, this.#M());
|
|
14308
14308
|
}
|
|
14309
14309
|
onceAdded(t) {
|
|
14310
14310
|
this.annotationElementId || this.parent.addUndoableEditor(this), t && this.div.focus();
|
|
@@ -14358,7 +14358,7 @@ class J extends D {
|
|
|
14358
14358
|
}
|
|
14359
14359
|
}, this.#d), this.#l && (this.#l.style.clipPath = this.#s));
|
|
14360
14360
|
}
|
|
14361
|
-
static #
|
|
14361
|
+
static #E([t, e, s, i], n) {
|
|
14362
14362
|
switch (n) {
|
|
14363
14363
|
case 90:
|
|
14364
14364
|
return [1 - e - i, t, i, s];
|
|
@@ -14374,13 +14374,13 @@ class J extends D {
|
|
|
14374
14374
|
drawLayer: e
|
|
14375
14375
|
} = this.parent;
|
|
14376
14376
|
let s;
|
|
14377
|
-
this.#d ? (t = (t - this.rotation + 360) % 360, s = J.#
|
|
14377
|
+
this.#d ? (t = (t - this.rotation + 360) % 360, s = J.#E(this.#h.box, t)) : s = J.#E([this.x, this.y, this.width, this.height], t), e.updateProperties(this.#u, {
|
|
14378
14378
|
bbox: s,
|
|
14379
14379
|
root: {
|
|
14380
14380
|
"data-main-rotation": t
|
|
14381
14381
|
}
|
|
14382
14382
|
}), e.updateProperties(this.#f, {
|
|
14383
|
-
bbox: J.#
|
|
14383
|
+
bbox: J.#E(this.#r.box, t),
|
|
14384
14384
|
root: {
|
|
14385
14385
|
"data-main-rotation": t
|
|
14386
14386
|
}
|
|
@@ -14394,7 +14394,7 @@ class J extends D {
|
|
|
14394
14394
|
signal: this._uiManager._signal
|
|
14395
14395
|
});
|
|
14396
14396
|
const e = this.#l = document.createElement("div");
|
|
14397
|
-
return t.append(e), e.setAttribute("aria-hidden", "true"), e.className = "internal", e.style.clipPath = this.#s, this.setDims(),
|
|
14397
|
+
return t.append(e), e.setAttribute("aria-hidden", "true"), e.className = "internal", e.style.clipPath = this.#s, this.setDims(), Mi(this, this.#l, ["pointerover", "pointerleave"]), this.enableEditing(), t;
|
|
14398
14398
|
}
|
|
14399
14399
|
pointerover() {
|
|
14400
14400
|
this.isSelected || this.parent?.drawLayer.updateProperties(this.#f, {
|
|
@@ -14417,15 +14417,15 @@ class J extends D {
|
|
|
14417
14417
|
switch (this.parent.unselect(this), t) {
|
|
14418
14418
|
case 0:
|
|
14419
14419
|
case 2:
|
|
14420
|
-
this.#
|
|
14420
|
+
this.#P(!0);
|
|
14421
14421
|
break;
|
|
14422
14422
|
case 1:
|
|
14423
14423
|
case 3:
|
|
14424
|
-
this.#
|
|
14424
|
+
this.#P(!1);
|
|
14425
14425
|
break;
|
|
14426
14426
|
}
|
|
14427
14427
|
}
|
|
14428
|
-
#
|
|
14428
|
+
#P(t) {
|
|
14429
14429
|
if (!this.#t)
|
|
14430
14430
|
return;
|
|
14431
14431
|
const e = window.getSelection();
|
|
@@ -14444,7 +14444,7 @@ class J extends D {
|
|
|
14444
14444
|
rootClass: {
|
|
14445
14445
|
selected: !1
|
|
14446
14446
|
}
|
|
14447
|
-
}), this.#d || this.#
|
|
14447
|
+
}), this.#d || this.#P(!1));
|
|
14448
14448
|
}
|
|
14449
14449
|
get _mustFixPosition() {
|
|
14450
14450
|
return !this.#d;
|
|
@@ -14460,7 +14460,7 @@ class J extends D {
|
|
|
14460
14460
|
}
|
|
14461
14461
|
}));
|
|
14462
14462
|
}
|
|
14463
|
-
#
|
|
14463
|
+
#M() {
|
|
14464
14464
|
return this.#d ? this.rotation : 0;
|
|
14465
14465
|
}
|
|
14466
14466
|
#O() {
|
|
@@ -14480,7 +14480,7 @@ class J extends D {
|
|
|
14480
14480
|
return r;
|
|
14481
14481
|
}
|
|
14482
14482
|
#R(t) {
|
|
14483
|
-
return this.#h.serialize(t, this.#
|
|
14483
|
+
return this.#h.serialize(t, this.#M());
|
|
14484
14484
|
}
|
|
14485
14485
|
static startHighlighting(t, e, {
|
|
14486
14486
|
target: s,
|
|
@@ -14507,7 +14507,7 @@ class J extends D {
|
|
|
14507
14507
|
signal: d
|
|
14508
14508
|
}), s.addEventListener("pointermove", this.#L.bind(this, t), {
|
|
14509
14509
|
signal: d
|
|
14510
|
-
}), this._freeHighlight = new
|
|
14510
|
+
}), this._freeHighlight = new Ms({
|
|
14511
14511
|
x: i,
|
|
14512
14512
|
y: n
|
|
14513
14513
|
}, [r, a, o, h], t.scale, this._defaultThickness / 2, e, 1e-3), {
|
|
@@ -14559,11 +14559,11 @@ class J extends D {
|
|
|
14559
14559
|
richText: A,
|
|
14560
14560
|
contentsObj: x,
|
|
14561
14561
|
creationDate: _,
|
|
14562
|
-
modificationDate:
|
|
14562
|
+
modificationDate: E
|
|
14563
14563
|
},
|
|
14564
14564
|
parent: {
|
|
14565
14565
|
page: {
|
|
14566
|
-
pageNumber:
|
|
14566
|
+
pageNumber: S
|
|
14567
14567
|
}
|
|
14568
14568
|
}
|
|
14569
14569
|
} = t;
|
|
@@ -14573,7 +14573,7 @@ class J extends D {
|
|
|
14573
14573
|
opacity: y,
|
|
14574
14574
|
quadPoints: f,
|
|
14575
14575
|
boxes: null,
|
|
14576
|
-
pageIndex:
|
|
14576
|
+
pageIndex: S - 1,
|
|
14577
14577
|
rect: g.slice(0),
|
|
14578
14578
|
rotation: b,
|
|
14579
14579
|
annotationElementId: m,
|
|
@@ -14583,7 +14583,7 @@ class J extends D {
|
|
|
14583
14583
|
richText: A,
|
|
14584
14584
|
comment: x?.str || null,
|
|
14585
14585
|
creationDate: _,
|
|
14586
|
-
modificationDate:
|
|
14586
|
+
modificationDate: E
|
|
14587
14587
|
};
|
|
14588
14588
|
} else if (t instanceof Us) {
|
|
14589
14589
|
const {
|
|
@@ -14600,11 +14600,11 @@ class J extends D {
|
|
|
14600
14600
|
richText: A,
|
|
14601
14601
|
contentsObj: x,
|
|
14602
14602
|
creationDate: _,
|
|
14603
|
-
modificationDate:
|
|
14603
|
+
modificationDate: E
|
|
14604
14604
|
},
|
|
14605
14605
|
parent: {
|
|
14606
14606
|
page: {
|
|
14607
|
-
pageNumber:
|
|
14607
|
+
pageNumber: S
|
|
14608
14608
|
}
|
|
14609
14609
|
}
|
|
14610
14610
|
} = t;
|
|
@@ -14614,7 +14614,7 @@ class J extends D {
|
|
|
14614
14614
|
thickness: y,
|
|
14615
14615
|
inkLists: f,
|
|
14616
14616
|
boxes: null,
|
|
14617
|
-
pageIndex:
|
|
14617
|
+
pageIndex: S - 1,
|
|
14618
14618
|
rect: g.slice(0),
|
|
14619
14619
|
rotation: b,
|
|
14620
14620
|
annotationElementId: m,
|
|
@@ -14624,7 +14624,7 @@ class J extends D {
|
|
|
14624
14624
|
richText: A,
|
|
14625
14625
|
comment: x?.str || null,
|
|
14626
14626
|
creationDate: _,
|
|
14627
|
-
modificationDate:
|
|
14627
|
+
modificationDate: E
|
|
14628
14628
|
};
|
|
14629
14629
|
}
|
|
14630
14630
|
const {
|
|
@@ -14650,7 +14650,7 @@ class J extends D {
|
|
|
14650
14650
|
const f = a[0], g = {
|
|
14651
14651
|
x: f[0] - u,
|
|
14652
14652
|
y: d - (f[1] - p)
|
|
14653
|
-
}, b = new
|
|
14653
|
+
}, b = new Ms(g, [0, 0, l, d], 1, h.#g / 2, !0, 1e-3);
|
|
14654
14654
|
for (let y = 0, v = f.length; y < v; y += 2)
|
|
14655
14655
|
g.x = f[y] - u, g.y = d - (f[y + 1] - p), b.add(g);
|
|
14656
14656
|
const {
|
|
@@ -15171,7 +15171,7 @@ class ha {
|
|
|
15171
15171
|
t === "stroke-width" && (this.#a = e);
|
|
15172
15172
|
}
|
|
15173
15173
|
#d(t, e) {
|
|
15174
|
-
return
|
|
15174
|
+
return P._normalizePoint(t, e, this.#h, this.#u, this.#s);
|
|
15175
15175
|
}
|
|
15176
15176
|
isEmpty() {
|
|
15177
15177
|
return !this.#i || this.#i.length === 0;
|
|
@@ -15186,7 +15186,7 @@ class ha {
|
|
|
15186
15186
|
path: {
|
|
15187
15187
|
d: this.toSVGPath()
|
|
15188
15188
|
}
|
|
15189
|
-
}) : (isNaN(this.#t[0]) && this.#e.splice(6, 6), this.#t.set([s, i, n, r, t, e], 0), this.#e.push(...
|
|
15189
|
+
}) : (isNaN(this.#t[0]) && this.#e.splice(6, 6), this.#t.set([s, i, n, r, t, e], 0), this.#e.push(...P.createBezierPoints(s, i, n, r, t, e)), {
|
|
15190
15190
|
path: {
|
|
15191
15191
|
d: this.toSVGPath()
|
|
15192
15192
|
}
|
|
@@ -15237,7 +15237,7 @@ class ha {
|
|
|
15237
15237
|
};
|
|
15238
15238
|
}
|
|
15239
15239
|
toSVGPath() {
|
|
15240
|
-
const t =
|
|
15240
|
+
const t = P.svgRound(this.#e[4]), e = P.svgRound(this.#e[5]);
|
|
15241
15241
|
if (this.#r.length === 2)
|
|
15242
15242
|
return this.#n = `${this.#n} M ${t} ${e} Z`, this.#n;
|
|
15243
15243
|
if (this.#r.length <= 6) {
|
|
@@ -15245,13 +15245,13 @@ class ha {
|
|
|
15245
15245
|
this.#n = `${this.#n.slice(0, i)} M ${t} ${e}`, this.#o = 6;
|
|
15246
15246
|
}
|
|
15247
15247
|
if (this.#r.length === 4) {
|
|
15248
|
-
const i =
|
|
15248
|
+
const i = P.svgRound(this.#e[10]), n = P.svgRound(this.#e[11]);
|
|
15249
15249
|
return this.#n = `${this.#n} L ${i} ${n}`, this.#o = 12, this.#n;
|
|
15250
15250
|
}
|
|
15251
15251
|
const s = [];
|
|
15252
15252
|
this.#o === 0 && (s.push(`M ${t} ${e}`), this.#o = 6);
|
|
15253
15253
|
for (let i = this.#o, n = this.#e.length; i < n; i += 6) {
|
|
15254
|
-
const [r, a, o, h, l, d] = this.#e.slice(i, i + 6).map(
|
|
15254
|
+
const [r, a, o, h, l, d] = this.#e.slice(i, i + 6).map(P.svgRound);
|
|
15255
15255
|
s.push(`C${r} ${a} ${o} ${h} ${l} ${d}`);
|
|
15256
15256
|
}
|
|
15257
15257
|
return this.#n += s.join(" "), this.#o = this.#e.length, this.#n;
|
|
@@ -15272,7 +15272,7 @@ class ha {
|
|
|
15272
15272
|
};
|
|
15273
15273
|
}
|
|
15274
15274
|
}
|
|
15275
|
-
class Le extends
|
|
15275
|
+
class Le extends P {
|
|
15276
15276
|
#t;
|
|
15277
15277
|
#e = 0;
|
|
15278
15278
|
#i;
|
|
@@ -15307,16 +15307,16 @@ class Le extends M {
|
|
|
15307
15307
|
for (const {
|
|
15308
15308
|
line: e
|
|
15309
15309
|
} of this.#s) {
|
|
15310
|
-
if (t.push(`M${
|
|
15310
|
+
if (t.push(`M${P.svgRound(e[4])} ${P.svgRound(e[5])}`), e.length === 6) {
|
|
15311
15311
|
t.push("Z");
|
|
15312
15312
|
continue;
|
|
15313
15313
|
}
|
|
15314
15314
|
if (e.length === 12 && isNaN(e[6])) {
|
|
15315
|
-
t.push(`L${
|
|
15315
|
+
t.push(`L${P.svgRound(e[10])} ${P.svgRound(e[11])}`);
|
|
15316
15316
|
continue;
|
|
15317
15317
|
}
|
|
15318
15318
|
for (let s = 6, i = e.length; s < i; s += 6) {
|
|
15319
|
-
const [n, r, a, o, h, l] = e.subarray(s, s + 6).map(
|
|
15319
|
+
const [n, r, a, o, h, l] = e.subarray(s, s + 6).map(P.svgRound);
|
|
15320
15320
|
t.push(`C${n} ${r} ${a} ${o} ${h} ${l}`);
|
|
15321
15321
|
}
|
|
15322
15322
|
}
|
|
@@ -15327,16 +15327,16 @@ class Le extends M {
|
|
|
15327
15327
|
let u, p, f, g, b, m, w, y, v;
|
|
15328
15328
|
switch (this.#o) {
|
|
15329
15329
|
case 0:
|
|
15330
|
-
v =
|
|
15330
|
+
v = P._rescale, u = t, p = e + i, f = s, g = -i, b = t + o * s, m = e + (1 - h - d) * i, w = t + (o + l) * s, y = e + (1 - h) * i;
|
|
15331
15331
|
break;
|
|
15332
15332
|
case 90:
|
|
15333
|
-
v =
|
|
15333
|
+
v = P._rescaleAndSwap, u = t, p = e, f = s, g = i, b = t + h * s, m = e + o * i, w = t + (h + d) * s, y = e + (o + l) * i;
|
|
15334
15334
|
break;
|
|
15335
15335
|
case 180:
|
|
15336
|
-
v =
|
|
15336
|
+
v = P._rescale, u = t + s, p = e, f = -s, g = i, b = t + (1 - o - l) * s, m = e + h * i, w = t + (1 - o) * s, y = e + (h + d) * i;
|
|
15337
15337
|
break;
|
|
15338
15338
|
case 270:
|
|
15339
|
-
v =
|
|
15339
|
+
v = P._rescaleAndSwap, u = t + s, p = e + i, f = -s, g = -i, b = t + (1 - h - d) * s, m = e + (1 - o - l) * i, w = t + (1 - h) * s, y = e + (1 - o) * i;
|
|
15340
15340
|
break;
|
|
15341
15341
|
}
|
|
15342
15342
|
for (const {
|
|
@@ -15362,16 +15362,16 @@ class Le extends M {
|
|
|
15362
15362
|
let d, u, p, f, g;
|
|
15363
15363
|
switch (o) {
|
|
15364
15364
|
case 0:
|
|
15365
|
-
g =
|
|
15365
|
+
g = P._rescale, d = -t / s, u = e / i + 1, p = 1 / s, f = -1 / i;
|
|
15366
15366
|
break;
|
|
15367
15367
|
case 90:
|
|
15368
|
-
g =
|
|
15368
|
+
g = P._rescaleAndSwap, d = -e / i, u = -t / s, p = 1 / i, f = 1 / s;
|
|
15369
15369
|
break;
|
|
15370
15370
|
case 180:
|
|
15371
|
-
g =
|
|
15371
|
+
g = P._rescale, d = t / s + 1, u = -e / i, p = -1 / s, f = 1 / i;
|
|
15372
15372
|
break;
|
|
15373
15373
|
case 270:
|
|
15374
|
-
g =
|
|
15374
|
+
g = P._rescaleAndSwap, d = e / i + 1, u = t / s + 1, p = -1 / i, f = -1 / s;
|
|
15375
15375
|
break;
|
|
15376
15376
|
}
|
|
15377
15377
|
if (!r) {
|
|
@@ -15390,9 +15390,9 @@ class Le extends M {
|
|
|
15390
15390
|
r.push(y);
|
|
15391
15391
|
let [v, A, x, _] = m.subarray(0, 4);
|
|
15392
15392
|
y.set([NaN, NaN, NaN, NaN, v, A], 0);
|
|
15393
|
-
for (let
|
|
15394
|
-
const
|
|
15395
|
-
y.set(
|
|
15393
|
+
for (let E = 4; E < w; E += 2) {
|
|
15394
|
+
const S = m[E], M = m[E + 1];
|
|
15395
|
+
y.set(P.createBezierPoints(v, A, x, _, S, M), (E - 2) * 3), [v, A, x, _] = [x, _, S, M];
|
|
15396
15396
|
}
|
|
15397
15397
|
}
|
|
15398
15398
|
}
|
|
@@ -15457,7 +15457,7 @@ class Le extends M {
|
|
|
15457
15457
|
};
|
|
15458
15458
|
}
|
|
15459
15459
|
get viewBox() {
|
|
15460
|
-
return this.#t.map(
|
|
15460
|
+
return this.#t.map(P.svgRound).join(" ");
|
|
15461
15461
|
}
|
|
15462
15462
|
get defaultProperties() {
|
|
15463
15463
|
const [t, e] = this.#t;
|
|
@@ -15466,7 +15466,7 @@ class Le extends M {
|
|
|
15466
15466
|
viewBox: this.viewBox
|
|
15467
15467
|
},
|
|
15468
15468
|
path: {
|
|
15469
|
-
"transform-origin": `${
|
|
15469
|
+
"transform-origin": `${P.svgRound(t)} ${P.svgRound(e)}`
|
|
15470
15470
|
}
|
|
15471
15471
|
};
|
|
15472
15472
|
}
|
|
@@ -15486,15 +15486,15 @@ class Le extends M {
|
|
|
15486
15486
|
default:
|
|
15487
15487
|
return "";
|
|
15488
15488
|
}
|
|
15489
|
-
return `matrix(${s} ${i} ${n} ${r} ${
|
|
15489
|
+
return `matrix(${s} ${i} ${n} ${r} ${P.svgRound(a)} ${P.svgRound(o)})`;
|
|
15490
15490
|
}
|
|
15491
15491
|
getPathResizingSVGProperties([t, e, s, i]) {
|
|
15492
15492
|
const [n, r] = this.#h(), [a, o, h, l] = this.#t;
|
|
15493
|
-
if (Math.abs(h - n) <=
|
|
15493
|
+
if (Math.abs(h - n) <= P.PRECISION || Math.abs(l - r) <= P.PRECISION) {
|
|
15494
15494
|
const g = t + s / 2 - (a + h / 2), b = e + i / 2 - (o + l / 2);
|
|
15495
15495
|
return {
|
|
15496
15496
|
path: {
|
|
15497
|
-
"transform-origin": `${
|
|
15497
|
+
"transform-origin": `${P.svgRound(t)} ${P.svgRound(e)}`,
|
|
15498
15498
|
transform: `${this.rotationTransform} translate(${g} ${b})`
|
|
15499
15499
|
}
|
|
15500
15500
|
};
|
|
@@ -15502,26 +15502,26 @@ class Le extends M {
|
|
|
15502
15502
|
const d = (s - 2 * n) / (h - 2 * n), u = (i - 2 * r) / (l - 2 * r), p = h / s, f = l / i;
|
|
15503
15503
|
return {
|
|
15504
15504
|
path: {
|
|
15505
|
-
"transform-origin": `${
|
|
15506
|
-
transform: `${this.rotationTransform} scale(${p} ${f}) translate(${
|
|
15505
|
+
"transform-origin": `${P.svgRound(a)} ${P.svgRound(o)}`,
|
|
15506
|
+
transform: `${this.rotationTransform} scale(${p} ${f}) translate(${P.svgRound(n)} ${P.svgRound(r)}) scale(${d} ${u}) translate(${P.svgRound(-n)} ${P.svgRound(-r)})`
|
|
15507
15507
|
}
|
|
15508
15508
|
};
|
|
15509
15509
|
}
|
|
15510
15510
|
getPathResizedSVGProperties([t, e, s, i]) {
|
|
15511
15511
|
const [n, r] = this.#h(), a = this.#t, [o, h, l, d] = a;
|
|
15512
|
-
if (a[0] = t, a[1] = e, a[2] = s, a[3] = i, Math.abs(l - n) <=
|
|
15512
|
+
if (a[0] = t, a[1] = e, a[2] = s, a[3] = i, Math.abs(l - n) <= P.PRECISION || Math.abs(d - r) <= P.PRECISION) {
|
|
15513
15513
|
const b = t + s / 2 - (o + l / 2), m = e + i / 2 - (h + d / 2);
|
|
15514
15514
|
for (const {
|
|
15515
15515
|
line: w,
|
|
15516
15516
|
points: y
|
|
15517
15517
|
} of this.#s)
|
|
15518
|
-
|
|
15518
|
+
P._translate(w, b, m, w), P._translate(y, b, m, y);
|
|
15519
15519
|
return {
|
|
15520
15520
|
root: {
|
|
15521
15521
|
viewBox: this.viewBox
|
|
15522
15522
|
},
|
|
15523
15523
|
path: {
|
|
15524
|
-
"transform-origin": `${
|
|
15524
|
+
"transform-origin": `${P.svgRound(t)} ${P.svgRound(e)}`,
|
|
15525
15525
|
transform: this.rotationTransform || null,
|
|
15526
15526
|
d: this.toSVGPath()
|
|
15527
15527
|
}
|
|
@@ -15533,13 +15533,13 @@ class Le extends M {
|
|
|
15533
15533
|
line: b,
|
|
15534
15534
|
points: m
|
|
15535
15535
|
} of this.#s)
|
|
15536
|
-
|
|
15536
|
+
P._rescale(b, f, g, u, p, b), P._rescale(m, f, g, u, p, m);
|
|
15537
15537
|
return {
|
|
15538
15538
|
root: {
|
|
15539
15539
|
viewBox: this.viewBox
|
|
15540
15540
|
},
|
|
15541
15541
|
path: {
|
|
15542
|
-
"transform-origin": `${
|
|
15542
|
+
"transform-origin": `${P.svgRound(t)} ${P.svgRound(e)}`,
|
|
15543
15543
|
transform: this.rotationTransform || null,
|
|
15544
15544
|
d: this.toSVGPath()
|
|
15545
15545
|
}
|
|
@@ -15552,7 +15552,7 @@ class Le extends M {
|
|
|
15552
15552
|
line: h,
|
|
15553
15553
|
points: l
|
|
15554
15554
|
} of this.#s)
|
|
15555
|
-
|
|
15555
|
+
P._translate(h, a, o, h), P._translate(l, a, o, l);
|
|
15556
15556
|
else {
|
|
15557
15557
|
const h = this.#a / i, l = this.#r / n;
|
|
15558
15558
|
this.#a = i, this.#r = n;
|
|
@@ -15560,7 +15560,7 @@ class Le extends M {
|
|
|
15560
15560
|
line: d,
|
|
15561
15561
|
points: u
|
|
15562
15562
|
} of this.#s)
|
|
15563
|
-
|
|
15563
|
+
P._rescale(d, a, o, h, l, d), P._rescale(u, a, o, h, l, u);
|
|
15564
15564
|
r[2] *= h, r[3] *= l;
|
|
15565
15565
|
}
|
|
15566
15566
|
return r[0] = t, r[1] = e, {
|
|
@@ -15569,7 +15569,7 @@ class Le extends M {
|
|
|
15569
15569
|
},
|
|
15570
15570
|
path: {
|
|
15571
15571
|
d: this.toSVGPath(),
|
|
15572
|
-
"transform-origin": `${
|
|
15572
|
+
"transform-origin": `${P.svgRound(t)} ${P.svgRound(e)}`
|
|
15573
15573
|
}
|
|
15574
15574
|
};
|
|
15575
15575
|
}
|
|
@@ -15584,7 +15584,7 @@ class Le extends M {
|
|
|
15584
15584
|
},
|
|
15585
15585
|
path: {
|
|
15586
15586
|
d: this.toSVGPath(),
|
|
15587
|
-
"transform-origin": `${
|
|
15587
|
+
"transform-origin": `${P.svgRound(t[0])} ${P.svgRound(t[1])}`,
|
|
15588
15588
|
transform: this.rotationTransform || null
|
|
15589
15589
|
},
|
|
15590
15590
|
bbox: t
|
|
@@ -15859,20 +15859,20 @@ class ee {
|
|
|
15859
15859
|
continue;
|
|
15860
15860
|
}
|
|
15861
15861
|
let A = this.#i[2 * v], x = this.#i[2 * v + 1];
|
|
15862
|
-
const _ = l + A,
|
|
15863
|
-
f = _, g =
|
|
15864
|
-
let
|
|
15862
|
+
const _ = l + A, E = d + x;
|
|
15863
|
+
f = _, g = E;
|
|
15864
|
+
let S = l, M = d;
|
|
15865
15865
|
for (; ; ) {
|
|
15866
|
-
const C = this.#a(r, e,
|
|
15866
|
+
const C = this.#a(r, e, S, M, f, g, 1);
|
|
15867
15867
|
A = this.#i[2 * C], x = this.#i[2 * C + 1];
|
|
15868
|
-
const H =
|
|
15868
|
+
const H = S + A, V = M + x;
|
|
15869
15869
|
b.push(V, H);
|
|
15870
|
-
const N =
|
|
15871
|
-
if (r[N + 1] === 0 ? r[N] = -a : r[N] === 1 && (r[N] = a), H === l && V === d &&
|
|
15870
|
+
const N = S * e + M;
|
|
15871
|
+
if (r[N + 1] === 0 ? r[N] = -a : r[N] === 1 && (r[N] = a), H === l && V === d && S === _ && M === E) {
|
|
15872
15872
|
r[u] !== 1 && (o = Math.abs(r[u]));
|
|
15873
15873
|
break;
|
|
15874
15874
|
} else
|
|
15875
|
-
f =
|
|
15875
|
+
f = S, g = M, S = H, M = V;
|
|
15876
15876
|
}
|
|
15877
15877
|
}
|
|
15878
15878
|
}
|
|
@@ -15887,8 +15887,8 @@ class ee {
|
|
|
15887
15887
|
const n = t[e], r = t[e + 1], a = t[s - 4] - n, o = t[s - 3] - r, h = Math.hypot(a, o), l = a / h, d = o / h, u = l * r - d * n, p = o / a, f = 1 / h, g = Math.atan(p), b = Math.cos(g), m = Math.sin(g), w = f * (Math.abs(b) + Math.abs(m)), y = f * (1 - w + w ** 2), v = Math.max(Math.atan(Math.abs(m + b) * y), Math.atan(Math.abs(m - b) * y));
|
|
15888
15888
|
let A = 0, x = e;
|
|
15889
15889
|
for (let _ = e + 2; _ < s - 2; _ += 2) {
|
|
15890
|
-
const
|
|
15891
|
-
|
|
15890
|
+
const E = Math.abs(u - l * t[_ + 1] + d * t[_]);
|
|
15891
|
+
E > A && (x = _, A = E);
|
|
15892
15892
|
}
|
|
15893
15893
|
A > (h * v) ** 2 ? (this.#n(t, e, x + 2, i), this.#n(t, x, s, i)) : i.push(n, r);
|
|
15894
15894
|
}
|
|
@@ -15914,12 +15914,12 @@ class ee {
|
|
|
15914
15914
|
for (let x = 0; x < r; x++) {
|
|
15915
15915
|
const _ = g + x - h;
|
|
15916
15916
|
if (!(_ < 0 || _ >= s))
|
|
15917
|
-
for (let
|
|
15918
|
-
const
|
|
15919
|
-
if (
|
|
15917
|
+
for (let E = 0; E < r; E++) {
|
|
15918
|
+
const S = b + E - h;
|
|
15919
|
+
if (S < 0 || S >= e)
|
|
15920
15920
|
continue;
|
|
15921
|
-
const
|
|
15922
|
-
y +=
|
|
15921
|
+
const M = t[_ * e + S], C = a[x * r + E] * l[Math.abs(M - w)];
|
|
15922
|
+
y += M * C, v += C;
|
|
15923
15923
|
}
|
|
15924
15924
|
}
|
|
15925
15925
|
const A = p[m] = Math.round(y / v);
|
|
@@ -16005,10 +16005,10 @@ class ee {
|
|
|
16005
16005
|
alpha: !0,
|
|
16006
16006
|
willReadFrequently: !0
|
|
16007
16007
|
}), l.font = u, l.filter = "grayscale(1)", l.fillStyle = "white", l.fillRect(0, 0, A, x), l.fillStyle = "black", l.fillText(t, A * (v - 1) / 2, x * (3 - v) / 2);
|
|
16008
|
-
const _ = this.#u(l.getImageData(0, 0, A, x).data),
|
|
16008
|
+
const _ = this.#u(l.getImageData(0, 0, A, x).data), E = this.#h(_), S = this.#d(E), M = this.#r(_, A, x, S);
|
|
16009
16009
|
return this.processDrawnLines({
|
|
16010
16010
|
lines: {
|
|
16011
|
-
curves:
|
|
16011
|
+
curves: M,
|
|
16012
16012
|
width: A,
|
|
16013
16013
|
height: x
|
|
16014
16014
|
},
|
|
@@ -16066,11 +16066,11 @@ class ee {
|
|
|
16066
16066
|
A[0] = y[0] * f, A[1] = y[1] * g, x.set([NaN, NaN, NaN, NaN, A[0], A[1]], 0);
|
|
16067
16067
|
continue;
|
|
16068
16068
|
}
|
|
16069
|
-
let [_,
|
|
16070
|
-
_ *= f,
|
|
16069
|
+
let [_, E, S, M] = y;
|
|
16070
|
+
_ *= f, E *= g, S *= f, M *= g, A.set([_, E, S, M], 0), x.set([NaN, NaN, NaN, NaN, _, E], 0);
|
|
16071
16071
|
for (let C = 4; C < v; C += 2) {
|
|
16072
16072
|
const H = A[C] = y[C] * f, V = A[C + 1] = y[C + 1] * g;
|
|
16073
|
-
x.set(
|
|
16073
|
+
x.set(P.createBezierPoints(_, E, S, M, H, V), (C - 2) * 3), [_, E, S, M] = [S, M, H, V];
|
|
16074
16074
|
}
|
|
16075
16075
|
}
|
|
16076
16076
|
if (u.length === 0)
|
|
@@ -16118,11 +16118,11 @@ class ee {
|
|
|
16118
16118
|
}
|
|
16119
16119
|
g.close();
|
|
16120
16120
|
const m = await new Response(f.readable).arrayBuffer(), w = new Uint8Array(m);
|
|
16121
|
-
return
|
|
16121
|
+
return Si(w);
|
|
16122
16122
|
}
|
|
16123
16123
|
static async decompressSignature(t) {
|
|
16124
16124
|
try {
|
|
16125
|
-
const e =
|
|
16125
|
+
const e = En(t), {
|
|
16126
16126
|
readable: s,
|
|
16127
16127
|
writable: i
|
|
16128
16128
|
} = new DecompressionStream("deflate-raw"), n = i.getWriter();
|
|
@@ -16769,25 +16769,25 @@ class la extends D {
|
|
|
16769
16769
|
creationDate: x,
|
|
16770
16770
|
modificationDate: _
|
|
16771
16771
|
},
|
|
16772
|
-
container:
|
|
16772
|
+
container: E,
|
|
16773
16773
|
parent: {
|
|
16774
16774
|
page: {
|
|
16775
|
-
pageNumber:
|
|
16775
|
+
pageNumber: S
|
|
16776
16776
|
}
|
|
16777
16777
|
},
|
|
16778
|
-
canvas:
|
|
16778
|
+
canvas: M
|
|
16779
16779
|
} = t;
|
|
16780
16780
|
let C, H;
|
|
16781
|
-
|
|
16781
|
+
M ? (delete t.canvas, {
|
|
16782
16782
|
id: C,
|
|
16783
16783
|
bitmap: H
|
|
16784
|
-
} = s.imageManager.getFromCanvas(
|
|
16784
|
+
} = s.imageManager.getFromCanvas(E.id, M), M.remove()) : (n = !0, t._hasNoCanvas = !0);
|
|
16785
16785
|
const V = (await e._structTree.getAriaAttributes(`${se}${m}`))?.get("aria-label") || "";
|
|
16786
16786
|
i = t = {
|
|
16787
16787
|
annotationType: F.STAMP,
|
|
16788
16788
|
bitmapId: C,
|
|
16789
16789
|
bitmap: H,
|
|
16790
|
-
pageIndex:
|
|
16790
|
+
pageIndex: S - 1,
|
|
16791
16791
|
rect: g.slice(0),
|
|
16792
16792
|
rotation: b,
|
|
16793
16793
|
annotationElementId: m,
|
|
@@ -17014,7 +17014,7 @@ class Lt {
|
|
|
17014
17014
|
if (l.toggle("getElements", !1), !this.div.contains(d[0]))
|
|
17015
17015
|
return;
|
|
17016
17016
|
let u;
|
|
17017
|
-
const p = new RegExp(`^${
|
|
17017
|
+
const p = new RegExp(`^${Ee}[0-9]+$`);
|
|
17018
17018
|
for (const g of d)
|
|
17019
17019
|
if (p.test(g.id)) {
|
|
17020
17020
|
u = g.id;
|
|
@@ -17198,7 +17198,7 @@ class Lt {
|
|
|
17198
17198
|
combinedSignal(t) {
|
|
17199
17199
|
return this.#c.combinedSignal(t);
|
|
17200
17200
|
}
|
|
17201
|
-
#
|
|
17201
|
+
#S(t) {
|
|
17202
17202
|
const e = this.#y;
|
|
17203
17203
|
return e ? new e.prototype.constructor(t) : null;
|
|
17204
17204
|
}
|
|
@@ -17210,7 +17210,7 @@ class Lt {
|
|
|
17210
17210
|
const {
|
|
17211
17211
|
offsetX: s,
|
|
17212
17212
|
offsetY: i
|
|
17213
|
-
} = this.#_(), n = this.getNextId(), r = this.#
|
|
17213
|
+
} = this.#_(), n = this.getNextId(), r = this.#S({
|
|
17214
17214
|
parent: this,
|
|
17215
17215
|
id: n,
|
|
17216
17216
|
x: s,
|
|
@@ -17225,7 +17225,7 @@ class Lt {
|
|
|
17225
17225
|
return await Lt.#g.get(t.annotationType ?? t.annotationEditorType)?.deserialize(t, this, this.#c) || null;
|
|
17226
17226
|
}
|
|
17227
17227
|
createAndAddNewEditor(t, e, s = {}) {
|
|
17228
|
-
const i = this.getNextId(), n = this.#
|
|
17228
|
+
const i = this.getNextId(), n = this.#S({
|
|
17229
17229
|
parent: this,
|
|
17230
17230
|
id: i,
|
|
17231
17231
|
x: t.offsetX,
|
|
@@ -17503,7 +17503,7 @@ class lt {
|
|
|
17503
17503
|
}
|
|
17504
17504
|
}
|
|
17505
17505
|
globalThis._pdfjsTestingUtils = {
|
|
17506
|
-
HighlightOutliner:
|
|
17506
|
+
HighlightOutliner: Ps
|
|
17507
17507
|
};
|
|
17508
17508
|
globalThis.pdfjsLib = {
|
|
17509
17509
|
AbortException: $t,
|
|
@@ -17522,14 +17522,14 @@ globalThis.pdfjsLib = {
|
|
|
17522
17522
|
DOMSVGFactory: Ye,
|
|
17523
17523
|
DrawLayer: lt,
|
|
17524
17524
|
FeatureTest: at,
|
|
17525
|
-
fetchData:
|
|
17525
|
+
fetchData: Me,
|
|
17526
17526
|
findContrastColor: In,
|
|
17527
17527
|
getDocument: Gi,
|
|
17528
|
-
getFilenameFromUrl:
|
|
17528
|
+
getFilenameFromUrl: Sn,
|
|
17529
17529
|
getPdfFilenameFromUrl: Cn,
|
|
17530
17530
|
getRGB: De,
|
|
17531
|
-
getUuid:
|
|
17532
|
-
getXfaPageViewport:
|
|
17531
|
+
getUuid: Ei,
|
|
17532
|
+
getXfaPageViewport: Pn,
|
|
17533
17533
|
GlobalWorkerOptions: qt,
|
|
17534
17534
|
ImageKind: je,
|
|
17535
17535
|
InvalidPDFException: ys,
|
|
@@ -17539,7 +17539,7 @@ globalThis.pdfjsLib = {
|
|
|
17539
17539
|
MathClamp: ut,
|
|
17540
17540
|
noContextMenu: _t,
|
|
17541
17541
|
normalizeUnicode: xn,
|
|
17542
|
-
OPS:
|
|
17542
|
+
OPS: Se,
|
|
17543
17543
|
OutputScale: kt,
|
|
17544
17544
|
PasswordResponses: pn,
|
|
17545
17545
|
PDFDataRangeTransport: ji,
|
|
@@ -18061,7 +18061,7 @@ class ma {
|
|
|
18061
18061
|
eventBus: this.eventBus,
|
|
18062
18062
|
pageDimensions: e
|
|
18063
18063
|
});
|
|
18064
|
-
const s = this.fields.filter((i) => i.
|
|
18064
|
+
const s = this.fields.filter((i) => i.pageNumber === t + 1);
|
|
18065
18065
|
this.pageView.setFields(s), this.pdfDocument.getPage(this.currentPage).then((i) => {
|
|
18066
18066
|
this.pageView && this.pageView.pageIndex === i.pageNumber - 1 && this.pageView.setPdfPage(i);
|
|
18067
18067
|
}).catch((i) => {
|
|
@@ -18096,7 +18096,7 @@ class ma {
|
|
|
18096
18096
|
}
|
|
18097
18097
|
setFields(t) {
|
|
18098
18098
|
if (this.fields = t, this.pageView) {
|
|
18099
|
-
const e = this.fields.filter((s) => s.
|
|
18099
|
+
const e = this.fields.filter((s) => s.pageNumber === this.currentPage);
|
|
18100
18100
|
this.pageView.setFields(e);
|
|
18101
18101
|
}
|
|
18102
18102
|
}
|
|
@@ -18133,7 +18133,7 @@ class ba {
|
|
|
18133
18133
|
eventBus: this.eventBus,
|
|
18134
18134
|
pageDimensions: e
|
|
18135
18135
|
// Pass dimensions immediately
|
|
18136
|
-
}), i = this.fields.filter((n) => n.
|
|
18136
|
+
}), i = this.fields.filter((n) => n.pageNumber === t);
|
|
18137
18137
|
s.setFields(i), this.pageViews.push(s);
|
|
18138
18138
|
}
|
|
18139
18139
|
this.pageViews.forEach(async (t, e) => {
|
|
@@ -18206,7 +18206,7 @@ class ba {
|
|
|
18206
18206
|
}
|
|
18207
18207
|
setFields(t) {
|
|
18208
18208
|
this.fields = t, this.pageViews.forEach((e) => {
|
|
18209
|
-
const s = this.fields.filter((i) => i.
|
|
18209
|
+
const s = this.fields.filter((i) => i.pageNumber === e.pageIndex + 1);
|
|
18210
18210
|
e.setFields(s);
|
|
18211
18211
|
});
|
|
18212
18212
|
}
|
|
@@ -18332,15 +18332,15 @@ class ya {
|
|
|
18332
18332
|
throw new Error("PDF document not loaded");
|
|
18333
18333
|
if (!this.strategy)
|
|
18334
18334
|
throw new Error("PDF viewer not ready. Please wait for PDF to fully load.");
|
|
18335
|
-
if (this.readyPromise && await this.readyPromise, t.
|
|
18336
|
-
throw new Error(`Invalid page
|
|
18335
|
+
if (this.readyPromise && await this.readyPromise, t.pageNumber < 1 || t.pageNumber > this.pdfDocument.numPages)
|
|
18336
|
+
throw new Error(`Invalid page number: ${t.pageNumber}. Document has ${this.pdfDocument.numPages} pages.`);
|
|
18337
18337
|
if (t.rect.width <= 0 || t.rect.height <= 0)
|
|
18338
18338
|
throw new Error("Field width and height must be greater than 0");
|
|
18339
18339
|
try {
|
|
18340
|
-
let e = this.pageInfo.get(t.
|
|
18340
|
+
let e = this.pageInfo.get(t.pageNumber - 1);
|
|
18341
18341
|
if (!e) {
|
|
18342
|
-
const s = (await this.pdfDocument.getPage(t.
|
|
18343
|
-
this.pageInfo.set(t.
|
|
18342
|
+
const s = (await this.pdfDocument.getPage(t.pageNumber)).getViewport({ scale: 1 });
|
|
18343
|
+
this.pageInfo.set(t.pageNumber - 1, { width: s.width, height: s.height }), e = { width: s.width, height: s.height };
|
|
18344
18344
|
}
|
|
18345
18345
|
if (t.rect.x < 0 || t.rect.y < 0)
|
|
18346
18346
|
throw new Error("Field position out of bounds (negative coordinates).");
|
|
@@ -18368,7 +18368,7 @@ class ya {
|
|
|
18368
18368
|
const v = Array.from(this.container.querySelectorAll(".page-view"));
|
|
18369
18369
|
let A = 1 / 0, x = null;
|
|
18370
18370
|
if (v.forEach((_) => {
|
|
18371
|
-
const
|
|
18371
|
+
const E = _.getBoundingClientRect(), S = Math.max(E.left, Math.min(i, E.right)), M = Math.max(E.top, Math.min(n, E.bottom)), C = i - S, H = n - M, V = Math.sqrt(C * C + H * H);
|
|
18372
18372
|
V < A && (A = V, x = _);
|
|
18373
18373
|
}), x)
|
|
18374
18374
|
a = x;
|
|
@@ -18382,10 +18382,10 @@ class ya {
|
|
|
18382
18382
|
this.strategy?.setFields(this.fields);
|
|
18383
18383
|
return;
|
|
18384
18384
|
}
|
|
18385
|
-
const h = parseInt(o, 10), l = a.getBoundingClientRect(), d = this.currentScale, u = i - l.left, p = n - l.top, f = l.height / d, g = l.width / d, b = r.rect.width, m = r.rect.height;
|
|
18385
|
+
const h = parseInt(o, 10) + 1, l = a.getBoundingClientRect(), d = this.currentScale, u = i - l.left, p = n - l.top, f = l.height / d, g = l.width / d, b = r.rect.width, m = r.rect.height;
|
|
18386
18386
|
let w = u / d, y = f - p / d - m;
|
|
18387
18387
|
w = Math.max(0, Math.min(w, g - b)), y = Math.max(0, Math.min(y, f - m)), this.updateField(t, {
|
|
18388
|
-
|
|
18388
|
+
pageNumber: h,
|
|
18389
18389
|
rect: {
|
|
18390
18390
|
...r.rect,
|
|
18391
18391
|
x: w,
|
|
@@ -18469,7 +18469,7 @@ class ya {
|
|
|
18469
18469
|
const u = document.createElement("div");
|
|
18470
18470
|
u.className = "print-page";
|
|
18471
18471
|
const p = document.createElement("img");
|
|
18472
|
-
p.src = l.toDataURL("image/jpeg", 0.8), u.appendChild(p), t?.withSignatures && this.fields.filter((f) => f.
|
|
18472
|
+
p.src = l.toDataURL("image/jpeg", 0.8), u.appendChild(p), t?.withSignatures && this.fields.filter((f) => f.pageNumber === a).forEach((f) => {
|
|
18473
18473
|
const g = document.createElement("div");
|
|
18474
18474
|
g.className = "print-field select-none";
|
|
18475
18475
|
const b = o.getViewport({ scale: 1 }), m = f.rect.x / b.width * 100, w = (b.height - f.rect.y - f.rect.height) / b.height * 100, y = f.rect.width / b.width * 100, v = f.rect.height / b.height * 100;
|
|
@@ -18540,7 +18540,7 @@ class wa {
|
|
|
18540
18540
|
return this.viewer.getScale();
|
|
18541
18541
|
}
|
|
18542
18542
|
async getPageDimensions(t) {
|
|
18543
|
-
return this.viewer.getPageDimensions(t);
|
|
18543
|
+
return this.viewer.getPageDimensions(t - 1);
|
|
18544
18544
|
}
|
|
18545
18545
|
// Event handling
|
|
18546
18546
|
on(t, e) {
|