@shznet/pdf-sign-standalone 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +421 -294
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -162,7 +162,7 @@ const dt = typeof process == "object" && process + "" == "[object process]" && !
|
|
|
162
162
|
INVISIBLE: 3,
|
|
163
163
|
FILL_STROKE_MASK: 3,
|
|
164
164
|
ADD_TO_PATH_FLAG: 4
|
|
165
|
-
},
|
|
165
|
+
}, Ge = {
|
|
166
166
|
GRAYSCALE_1BPP: 1,
|
|
167
167
|
RGB_24BPP: 2,
|
|
168
168
|
RGBA_32BPP: 3
|
|
@@ -203,7 +203,7 @@ const dt = typeof process == "object" && process + "" == "[object process]" && !
|
|
|
203
203
|
ERRORS: 0,
|
|
204
204
|
WARNINGS: 1,
|
|
205
205
|
INFOS: 5
|
|
206
|
-
},
|
|
206
|
+
}, Ee = {
|
|
207
207
|
dependency: 1,
|
|
208
208
|
setLineWidth: 2,
|
|
209
209
|
setLineCap: 3,
|
|
@@ -318,11 +318,11 @@ function Qe(d) {
|
|
|
318
318
|
function R(d) {
|
|
319
319
|
Ke >= Ye.WARNINGS && console.warn(`Warning: ${d}`);
|
|
320
320
|
}
|
|
321
|
-
function
|
|
321
|
+
function j(d) {
|
|
322
322
|
throw new Error(d);
|
|
323
323
|
}
|
|
324
324
|
function B(d, t) {
|
|
325
|
-
d ||
|
|
325
|
+
d || j(t);
|
|
326
326
|
}
|
|
327
327
|
function dn(d) {
|
|
328
328
|
switch (d?.protocol) {
|
|
@@ -380,7 +380,7 @@ class ms extends Xt {
|
|
|
380
380
|
super(t, "InvalidPDFException");
|
|
381
381
|
}
|
|
382
382
|
}
|
|
383
|
-
class
|
|
383
|
+
class je extends Xt {
|
|
384
384
|
constructor(t, e, s) {
|
|
385
385
|
super(t, "ResponseException"), this.status = e, this.missing = s;
|
|
386
386
|
}
|
|
@@ -396,7 +396,7 @@ class $t extends Xt {
|
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
398
|
function Ai(d) {
|
|
399
|
-
(typeof d != "object" || d?.length === void 0) &&
|
|
399
|
+
(typeof d != "object" || d?.length === void 0) && j("Invalid argument for bytesToString");
|
|
400
400
|
const t = d.length, e = 8192;
|
|
401
401
|
if (t < e)
|
|
402
402
|
return String.fromCharCode.apply(null, d);
|
|
@@ -408,7 +408,7 @@ function Ai(d) {
|
|
|
408
408
|
return s.join("");
|
|
409
409
|
}
|
|
410
410
|
function Te(d) {
|
|
411
|
-
typeof d != "string" &&
|
|
411
|
+
typeof d != "string" && j("Invalid argument for stringToBytes");
|
|
412
412
|
const t = d.length, e = new Uint8Array(t);
|
|
413
413
|
for (let s = 0; s < t; ++s)
|
|
414
414
|
e[s] = d.charCodeAt(s) & 255;
|
|
@@ -501,8 +501,8 @@ class T {
|
|
|
501
501
|
const i = e[0], n = e[1], r = e[2], a = e[3], o = e[4], h = e[5], l = t[0], c = t[1], u = t[2], p = t[3];
|
|
502
502
|
let f = i * l + o, g = f, b = i * u + o, m = b, w = a * c + h, y = w, v = a * p + h, A = v;
|
|
503
503
|
if (n !== 0 || r !== 0) {
|
|
504
|
-
const x = n * l, _ = n * u,
|
|
505
|
-
f +=
|
|
504
|
+
const x = n * l, _ = n * u, E = r * c, S = r * p;
|
|
505
|
+
f += E, m += E, b += S, g += S, w += x, A += x, v += _, y += _;
|
|
506
506
|
}
|
|
507
507
|
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);
|
|
508
508
|
}
|
|
@@ -619,7 +619,7 @@ typeof Promise.try != "function" && (Promise.try = function(d, ...t) {
|
|
|
619
619
|
typeof Math.sumPrecise != "function" && (Math.sumPrecise = function(d) {
|
|
620
620
|
return d.reduce((t, e) => t + e, 0);
|
|
621
621
|
});
|
|
622
|
-
class
|
|
622
|
+
class Se {
|
|
623
623
|
static textContent(t) {
|
|
624
624
|
const e = [], s = {
|
|
625
625
|
items: e,
|
|
@@ -632,7 +632,7 @@ class Ee {
|
|
|
632
632
|
const a = n.name;
|
|
633
633
|
if (a === "#text")
|
|
634
634
|
r = n.value;
|
|
635
|
-
else if (
|
|
635
|
+
else if (Se.shouldBuildText(a))
|
|
636
636
|
n?.attributes?.textContent ? r = n.attributes.textContent : n.value && (r = n.value);
|
|
637
637
|
else return;
|
|
638
638
|
if (r !== null && e.push({
|
|
@@ -647,7 +647,7 @@ class Ee {
|
|
|
647
647
|
return !(t === "textarea" || t === "input" || t === "option" || t === "select");
|
|
648
648
|
}
|
|
649
649
|
}
|
|
650
|
-
class
|
|
650
|
+
class Ei {
|
|
651
651
|
static setupStorage(t, e, s, i, n) {
|
|
652
652
|
const r = i.getValue(e, {
|
|
653
653
|
value: null
|
|
@@ -747,7 +747,7 @@ class Si {
|
|
|
747
747
|
if (i.children.length === 0) {
|
|
748
748
|
if (i.value) {
|
|
749
749
|
const c = document.createTextNode(i.value);
|
|
750
|
-
r.append(c), a &&
|
|
750
|
+
r.append(c), a && Se.shouldBuildText(i.name) && h.push(c);
|
|
751
751
|
}
|
|
752
752
|
return {
|
|
753
753
|
textDivs: h
|
|
@@ -782,7 +782,7 @@ class Si {
|
|
|
782
782
|
l.push([f, -1, b]);
|
|
783
783
|
else if (f.value) {
|
|
784
784
|
const m = document.createTextNode(f.value);
|
|
785
|
-
a &&
|
|
785
|
+
a && Se.shouldBuildText(g) && h.push(m), b.append(m);
|
|
786
786
|
}
|
|
787
787
|
}
|
|
788
788
|
for (const c of o.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))
|
|
@@ -1076,7 +1076,7 @@ function ke(d) {
|
|
|
1076
1076
|
}
|
|
1077
1077
|
return d.startsWith("rgb(") ? d.slice(4, -1).split(",").map((t) => parseInt(t)) : d.startsWith("rgba(") ? d.slice(5, -1).split(",").map((t) => parseInt(t)).slice(0, 3) : (R(`Not a valid color format: "${d}"`), [0, 0, 0]);
|
|
1078
1078
|
}
|
|
1079
|
-
function
|
|
1079
|
+
function En(d) {
|
|
1080
1080
|
const t = document.createElement("span");
|
|
1081
1081
|
t.style.visibility = "hidden", t.style.colorScheme = "only light", document.body.append(t);
|
|
1082
1082
|
for (const e of d.keys()) {
|
|
@@ -1097,7 +1097,7 @@ function X(d) {
|
|
|
1097
1097
|
} = d.getTransform();
|
|
1098
1098
|
return [t, e, s, i, n, r];
|
|
1099
1099
|
}
|
|
1100
|
-
function
|
|
1100
|
+
function St(d) {
|
|
1101
1101
|
const {
|
|
1102
1102
|
a: t,
|
|
1103
1103
|
b: e,
|
|
@@ -1108,7 +1108,7 @@ function Et(d) {
|
|
|
1108
1108
|
} = d.getTransform().invertSelf();
|
|
1109
1109
|
return [t, e, s, i, n, r];
|
|
1110
1110
|
}
|
|
1111
|
-
function
|
|
1111
|
+
function jt(d, t, e = !1, s = !0) {
|
|
1112
1112
|
if (t instanceof Pe) {
|
|
1113
1113
|
const {
|
|
1114
1114
|
pageWidth: i,
|
|
@@ -1151,7 +1151,7 @@ class kt {
|
|
|
1151
1151
|
}
|
|
1152
1152
|
}
|
|
1153
1153
|
const ys = ["image/apng", "image/avif", "image/bmp", "image/gif", "image/jpeg", "image/png", "image/svg+xml", "image/webp", "image/x-icon"];
|
|
1154
|
-
class
|
|
1154
|
+
class Sn {
|
|
1155
1155
|
static get isDarkMode() {
|
|
1156
1156
|
return L(this, "isDarkMode", !!window?.matchMedia?.("(prefers-color-scheme: dark)").matches);
|
|
1157
1157
|
}
|
|
@@ -1252,7 +1252,7 @@ function Mn(d, t) {
|
|
|
1252
1252
|
}
|
|
1253
1253
|
return ws(r, n), s = T.makeHexColor(Math.round(n[0] * 255), Math.round(n[1] * 255), Math.round(n[2] * 255)), Js.set(e, s), s;
|
|
1254
1254
|
}
|
|
1255
|
-
function
|
|
1255
|
+
function Si({
|
|
1256
1256
|
html: d,
|
|
1257
1257
|
dir: t,
|
|
1258
1258
|
className: e
|
|
@@ -1268,7 +1268,7 @@ function Ei({
|
|
|
1268
1268
|
}
|
|
1269
1269
|
i.append(n);
|
|
1270
1270
|
} else
|
|
1271
|
-
|
|
1271
|
+
Ei.render({
|
|
1272
1272
|
xfaHtml: d,
|
|
1273
1273
|
div: i,
|
|
1274
1274
|
intent: "richText"
|
|
@@ -1789,7 +1789,7 @@ class Rs {
|
|
|
1789
1789
|
static _colorsMapping = /* @__PURE__ */ new Map([["CanvasText", [0, 0, 0]], ["Canvas", [255, 255, 255]]]);
|
|
1790
1790
|
get _colors() {
|
|
1791
1791
|
const t = /* @__PURE__ */ new Map([["CanvasText", null], ["Canvas", null]]);
|
|
1792
|
-
return
|
|
1792
|
+
return En(t), L(this, "_colors", t);
|
|
1793
1793
|
}
|
|
1794
1794
|
convert(t) {
|
|
1795
1795
|
const e = ke(t);
|
|
@@ -1827,12 +1827,12 @@ class zt {
|
|
|
1827
1827
|
#b = !1;
|
|
1828
1828
|
#w = !1;
|
|
1829
1829
|
#y = !1;
|
|
1830
|
-
#
|
|
1830
|
+
#S = null;
|
|
1831
1831
|
#_ = null;
|
|
1832
1832
|
#A = null;
|
|
1833
1833
|
#T = null;
|
|
1834
1834
|
#v = !1;
|
|
1835
|
-
#
|
|
1835
|
+
#E = null;
|
|
1836
1836
|
#k = new kn();
|
|
1837
1837
|
#M = !1;
|
|
1838
1838
|
#P = !1;
|
|
@@ -1841,7 +1841,7 @@ class zt {
|
|
|
1841
1841
|
#L = null;
|
|
1842
1842
|
#B = null;
|
|
1843
1843
|
#F = null;
|
|
1844
|
-
#
|
|
1844
|
+
#G = null;
|
|
1845
1845
|
#C = F.NONE;
|
|
1846
1846
|
#x = /* @__PURE__ */ new Set();
|
|
1847
1847
|
#R = null;
|
|
@@ -1859,14 +1859,14 @@ class zt {
|
|
|
1859
1859
|
};
|
|
1860
1860
|
#U = [0, 0];
|
|
1861
1861
|
#N = null;
|
|
1862
|
-
#
|
|
1862
|
+
#j = null;
|
|
1863
1863
|
#J = null;
|
|
1864
1864
|
#Z = null;
|
|
1865
1865
|
#$ = null;
|
|
1866
1866
|
static TRANSLATE_SMALL = 1;
|
|
1867
1867
|
static TRANSLATE_BIG = 10;
|
|
1868
1868
|
static get _keyboardManager() {
|
|
1869
|
-
const t = zt.prototype, e = (r) => r.#
|
|
1869
|
+
const t = zt.prototype, e = (r) => r.#j.contains(document.activeElement) && document.activeElement.tagName !== "BUTTON" && r.hasSomethingToControl(), s = (r, {
|
|
1870
1870
|
target: a
|
|
1871
1871
|
}) => {
|
|
1872
1872
|
if (a instanceof HTMLInputElement) {
|
|
@@ -1888,11 +1888,11 @@ class zt {
|
|
|
1888
1888
|
}], [["Enter", "mac+Enter"], t.addNewEditorFromKeyboard, {
|
|
1889
1889
|
checker: (r, {
|
|
1890
1890
|
target: a
|
|
1891
|
-
}) => !(a instanceof HTMLButtonElement) && r.#
|
|
1891
|
+
}) => !(a instanceof HTMLButtonElement) && r.#j.contains(a) && !r.isEnterHandled
|
|
1892
1892
|
}], [[" ", "mac+ "], t.addNewEditorFromKeyboard, {
|
|
1893
1893
|
checker: (r, {
|
|
1894
1894
|
target: a
|
|
1895
|
-
}) => !(a instanceof HTMLButtonElement) && r.#
|
|
1895
|
+
}) => !(a instanceof HTMLButtonElement) && r.#j.contains(document.activeElement)
|
|
1896
1896
|
}], [["Escape", "mac+Escape"], t.unselectAll], [["ArrowLeft", "mac+ArrowLeft"], t.translateSelectedEditors, {
|
|
1897
1897
|
args: [-i, 0],
|
|
1898
1898
|
checker: e
|
|
@@ -1921,7 +1921,7 @@ class zt {
|
|
|
1921
1921
|
}
|
|
1922
1922
|
constructor(t, e, s, i, n, r, a, o, h, l, c, u, p, f, g, b) {
|
|
1923
1923
|
const m = this._signal = this.#t.signal;
|
|
1924
|
-
this.#
|
|
1924
|
+
this.#j = t, this.#J = e, this.#Z = s, this.#r = i, this.#h = n, this.#H = r, this.#W = o, this._eventBus = a, a._on("editingaction", this.onEditingAction.bind(this), {
|
|
1925
1925
|
signal: m
|
|
1926
1926
|
}), a._on("pagechanging", this.onPageChanging.bind(this), {
|
|
1927
1927
|
signal: m
|
|
@@ -1943,7 +1943,7 @@ class zt {
|
|
|
1943
1943
|
}, {
|
|
1944
1944
|
capture: !0,
|
|
1945
1945
|
signal: m
|
|
1946
|
-
}), this.#at(), this.#ut(), this.#et(), this.#n = o.annotationStorage, this.#
|
|
1946
|
+
}), this.#at(), this.#ut(), this.#et(), this.#n = o.annotationStorage, this.#S = o.filterFactory, this.#z = h, this.#T = l || null, this.#b = c, this.#w = u, this.#y = p, this.#G = f || null, this.viewParameters = {
|
|
1947
1947
|
realScale: le.PDF_TO_CSS_UNITS,
|
|
1948
1948
|
rotation: 0
|
|
1949
1949
|
}, this.isShiftKeyDown = !1, this._editorUndoBar = g || null, this._supportsPinchToZoom = b !== !1, n?.setSidebarUiManager(this);
|
|
@@ -1952,13 +1952,13 @@ class zt {
|
|
|
1952
1952
|
this.#$?.resolve(), this.#$ = null, this.#t?.abort(), this.#t = null, this._signal = null;
|
|
1953
1953
|
for (const t of this.#a.values())
|
|
1954
1954
|
t.destroy();
|
|
1955
|
-
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.#
|
|
1955
|
+
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;
|
|
1956
1956
|
}
|
|
1957
1957
|
combinedSignal(t) {
|
|
1958
1958
|
return AbortSignal.any([this._signal, t.signal]);
|
|
1959
1959
|
}
|
|
1960
1960
|
get mlManager() {
|
|
1961
|
-
return this.#
|
|
1961
|
+
return this.#G;
|
|
1962
1962
|
}
|
|
1963
1963
|
get useNewAltTextFlow() {
|
|
1964
1964
|
return this.#w;
|
|
@@ -1967,10 +1967,10 @@ class zt {
|
|
|
1967
1967
|
return this.#y;
|
|
1968
1968
|
}
|
|
1969
1969
|
get hcmFilter() {
|
|
1970
|
-
return L(this, "hcmFilter", this.#z ? this.#
|
|
1970
|
+
return L(this, "hcmFilter", this.#z ? this.#S.addHCMFilter(this.#z.foreground, this.#z.background) : "none");
|
|
1971
1971
|
}
|
|
1972
1972
|
get direction() {
|
|
1973
|
-
return L(this, "direction", getComputedStyle(this.#
|
|
1973
|
+
return L(this, "direction", getComputedStyle(this.#j).direction);
|
|
1974
1974
|
}
|
|
1975
1975
|
get _highlightColors() {
|
|
1976
1976
|
return L(this, "_highlightColors", this.#T ? new Map(this.#T.split(",").map((t) => (t = t.split("=").map((e) => e.trim()), t[1] = t[1].toUpperCase(), t))) : null);
|
|
@@ -2088,7 +2088,7 @@ class zt {
|
|
|
2088
2088
|
this.#p = t - 1;
|
|
2089
2089
|
}
|
|
2090
2090
|
focusMainContainer() {
|
|
2091
|
-
this.#
|
|
2091
|
+
this.#j.focus();
|
|
2092
2092
|
}
|
|
2093
2093
|
findParent(t, e) {
|
|
2094
2094
|
for (const s of this.#a.values()) {
|
|
@@ -2183,7 +2183,7 @@ class zt {
|
|
|
2183
2183
|
if (!t || t.isCollapsed)
|
|
2184
2184
|
return;
|
|
2185
2185
|
const e = this.#Q(t).closest(".textLayer"), s = this.getSelectionBoxes(e);
|
|
2186
|
-
s && (this.#
|
|
2186
|
+
s && (this.#E ||= new Pn(this), this.#E.show(e, s, this.direction === "ltr"));
|
|
2187
2187
|
}
|
|
2188
2188
|
getAndRemoveDataFromAnnotationStorage(t) {
|
|
2189
2189
|
if (!this.#n)
|
|
@@ -2201,7 +2201,7 @@ class zt {
|
|
|
2201
2201
|
#rt() {
|
|
2202
2202
|
const t = document.getSelection();
|
|
2203
2203
|
if (!t || t.isCollapsed) {
|
|
2204
|
-
this.#R && (this.#
|
|
2204
|
+
this.#R && (this.#E?.hide(), this.#R = null, this.#D({
|
|
2205
2205
|
hasSelectedText: !1
|
|
2206
2206
|
}));
|
|
2207
2207
|
return;
|
|
@@ -2213,12 +2213,12 @@ class zt {
|
|
|
2213
2213
|
return;
|
|
2214
2214
|
const s = this.#Q(t).closest(".textLayer");
|
|
2215
2215
|
if (!s) {
|
|
2216
|
-
this.#R && (this.#
|
|
2216
|
+
this.#R && (this.#E?.hide(), this.#R = null, this.#D({
|
|
2217
2217
|
hasSelectedText: !1
|
|
2218
2218
|
}));
|
|
2219
2219
|
return;
|
|
2220
2220
|
}
|
|
2221
|
-
if (this.#
|
|
2221
|
+
if (this.#E?.hide(), this.#R = e, this.#D({
|
|
2222
2222
|
hasSelectedText: !0
|
|
2223
2223
|
}), !(this.#C !== F.HIGHLIGHT && this.#C !== F.NONE) && (this.#C === F.HIGHLIGHT && this.showAllEditors("highlight", !0, !0), this.#v = this.isShiftKeyDown, !this.isShiftKeyDown)) {
|
|
2224
2224
|
const i = this.#C === F.HIGHLIGHT ? this.#tt(s) : null;
|
|
@@ -3429,7 +3429,7 @@ class D {
|
|
|
3429
3429
|
#b = !1;
|
|
3430
3430
|
#w = !1;
|
|
3431
3431
|
#y = null;
|
|
3432
|
-
#
|
|
3432
|
+
#S = 0;
|
|
3433
3433
|
#_ = 0;
|
|
3434
3434
|
#A = null;
|
|
3435
3435
|
#T = null;
|
|
@@ -3444,7 +3444,7 @@ class D {
|
|
|
3444
3444
|
static _l10n = null;
|
|
3445
3445
|
static _l10nResizer = null;
|
|
3446
3446
|
#v = !1;
|
|
3447
|
-
#
|
|
3447
|
+
#E = D._zIndex++;
|
|
3448
3448
|
static _borderLineWidth = -1;
|
|
3449
3449
|
static _colorManager = new Rs();
|
|
3450
3450
|
static _zIndex = 1;
|
|
@@ -3528,7 +3528,7 @@ class D {
|
|
|
3528
3528
|
return !1;
|
|
3529
3529
|
}
|
|
3530
3530
|
static paste(t, e) {
|
|
3531
|
-
|
|
3531
|
+
j("Not implemented");
|
|
3532
3532
|
}
|
|
3533
3533
|
get propertiesToUpdate() {
|
|
3534
3534
|
return [];
|
|
@@ -3573,7 +3573,7 @@ class D {
|
|
|
3573
3573
|
this.div.style.zIndex = 0;
|
|
3574
3574
|
}
|
|
3575
3575
|
setInForeground() {
|
|
3576
|
-
this.div.style.zIndex = this.#
|
|
3576
|
+
this.div.style.zIndex = this.#E;
|
|
3577
3577
|
}
|
|
3578
3578
|
setParent(t) {
|
|
3579
3579
|
t !== null ? (this.pageIndex = t.pageIndex, this.pageDimensions = t.pageDimensions) : (this.#N(), this.#d?.remove(), this.#d = null), this.parent = t;
|
|
@@ -3870,7 +3870,7 @@ class D {
|
|
|
3870
3870
|
const y = g(a, o), v = b(a, o);
|
|
3871
3871
|
let A = u(...v);
|
|
3872
3872
|
const x = D._round(n + A[0]), _ = D._round(r + A[1]);
|
|
3873
|
-
let
|
|
3873
|
+
let E = 1, S = 1, P, C;
|
|
3874
3874
|
if (e.fromKeyboard)
|
|
3875
3875
|
({
|
|
3876
3876
|
deltaX: P,
|
|
@@ -3885,9 +3885,9 @@ class D {
|
|
|
3885
3885
|
}
|
|
3886
3886
|
if ([P, C] = f(P / s, C / i), m) {
|
|
3887
3887
|
const k = Math.hypot(a, o);
|
|
3888
|
-
|
|
3889
|
-
} else w ?
|
|
3890
|
-
const H = D._round(a *
|
|
3888
|
+
E = S = Math.max(Math.min(Math.hypot(v[0] - y[0] - P, v[1] - y[1] - C) / k, 1 / a, 1 / o), h / a, l / o);
|
|
3889
|
+
} else w ? E = ut(Math.abs(v[0] - y[0] - P), h, 1) / a : S = ut(Math.abs(v[1] - y[1] - C), l, 1) / o;
|
|
3890
|
+
const H = D._round(a * E), V = D._round(o * S);
|
|
3891
3891
|
A = u(...b(H, V));
|
|
3892
3892
|
const N = x - A[0], Z = _ - A[1];
|
|
3893
3893
|
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();
|
|
@@ -4052,13 +4052,13 @@ class D {
|
|
|
4052
4052
|
return this.translate(i, n), Ti(this, t, ["keydown", "pointerdown", "dblclick"]), this.isResizable && this._uiManager._supportsPinchToZoom && (this.#T ||= new Ze({
|
|
4053
4053
|
container: t,
|
|
4054
4054
|
isPinchingDisabled: () => !this.isSelected,
|
|
4055
|
-
onPinchStart: this.#
|
|
4055
|
+
onPinchStart: this.#G.bind(this),
|
|
4056
4056
|
onPinching: this.#C.bind(this),
|
|
4057
4057
|
onPinchEnd: this.#x.bind(this),
|
|
4058
4058
|
signal: this._uiManager._signal
|
|
4059
4059
|
})), this.addStandaloneCommentButton(), this._uiManager._editorUndoBar?.hide(), t;
|
|
4060
4060
|
}
|
|
4061
|
-
#
|
|
4061
|
+
#G() {
|
|
4062
4062
|
this.#u = {
|
|
4063
4063
|
savedX: this.x,
|
|
4064
4064
|
savedY: this.y,
|
|
@@ -4115,7 +4115,7 @@ class D {
|
|
|
4115
4115
|
}, a = (h) => {
|
|
4116
4116
|
i.abort(), this.#n = null, this.#f = !1, this._uiManager.endDragSession() || this.#R(h), s && this._onStopDragging();
|
|
4117
4117
|
};
|
|
4118
|
-
e && (this.#
|
|
4118
|
+
e && (this.#S = t.clientX, this.#_ = t.clientY, this.#n = t.pointerId, this.#o = t.pointerType, window.addEventListener("pointermove", (h) => {
|
|
4119
4119
|
s || (s = !0, this._uiManager.toggleComment(this, !0, !1), this._onStartDragging());
|
|
4120
4120
|
const {
|
|
4121
4121
|
clientX: l,
|
|
@@ -4126,8 +4126,8 @@ class D {
|
|
|
4126
4126
|
Q(h);
|
|
4127
4127
|
return;
|
|
4128
4128
|
}
|
|
4129
|
-
const [p, f] = this.screenToPageTranslation(l - this.#
|
|
4130
|
-
this.#
|
|
4129
|
+
const [p, f] = this.screenToPageTranslation(l - this.#S, c - this.#_);
|
|
4130
|
+
this.#S = l, this.#_ = c, this._uiManager.dragSelectedEditors(p, f);
|
|
4131
4131
|
}, r), window.addEventListener("touchmove", Q, r), window.addEventListener("pointerdown", (h) => {
|
|
4132
4132
|
h.pointerType === this.#o && (this.#T || h.isPrimary) && a(h), Q(h);
|
|
4133
4133
|
}, r));
|
|
@@ -4761,7 +4761,7 @@ class Pi extends Ls {
|
|
|
4761
4761
|
};
|
|
4762
4762
|
}
|
|
4763
4763
|
get print() {
|
|
4764
|
-
|
|
4764
|
+
j("Should not call PrintAnnotationStorage.print");
|
|
4765
4765
|
}
|
|
4766
4766
|
get serializable() {
|
|
4767
4767
|
return this.#t;
|
|
@@ -4817,7 +4817,7 @@ class Rn {
|
|
|
4817
4817
|
}
|
|
4818
4818
|
return;
|
|
4819
4819
|
}
|
|
4820
|
-
|
|
4820
|
+
j("Not implemented: loadSystemFont without the Font Loading API.");
|
|
4821
4821
|
}
|
|
4822
4822
|
}
|
|
4823
4823
|
async bind(t) {
|
|
@@ -4881,8 +4881,8 @@ class Rn {
|
|
|
4881
4881
|
return y.charCodeAt(v) << 24 | y.charCodeAt(v + 1) << 16 | y.charCodeAt(v + 2) << 8 | y.charCodeAt(v + 3) & 255;
|
|
4882
4882
|
}
|
|
4883
4883
|
function i(y, v, A, x) {
|
|
4884
|
-
const _ = y.substring(0, v),
|
|
4885
|
-
return _ + x +
|
|
4884
|
+
const _ = y.substring(0, v), E = y.substring(v + A);
|
|
4885
|
+
return _ + x + E;
|
|
4886
4886
|
}
|
|
4887
4887
|
let n, r;
|
|
4888
4888
|
const a = this._document.createElement("canvas");
|
|
@@ -5148,7 +5148,7 @@ class ae {
|
|
|
5148
5148
|
};
|
|
5149
5149
|
}
|
|
5150
5150
|
}
|
|
5151
|
-
class
|
|
5151
|
+
class G {
|
|
5152
5152
|
static bools = ["black", "bold", "disableFontFace", "fontExtraProperties", "isInvalidPDFjsFont", "isType3Font", "italic", "missingFile", "remeasure", "vertical"];
|
|
5153
5153
|
static numbers = ["ascent", "defaultWidth", "descent"];
|
|
5154
5154
|
static strings = ["fallbackName", "loadedName", "mimetype", "name"];
|
|
@@ -5167,7 +5167,7 @@ class j {
|
|
|
5167
5167
|
this.#r = t, this.#n = new TextDecoder(), this.#o = new DataView(this.#r), e && Object.assign(this, e);
|
|
5168
5168
|
}
|
|
5169
5169
|
#l(t) {
|
|
5170
|
-
B(t <
|
|
5170
|
+
B(t < G.bools.length, "Invalid boolean index");
|
|
5171
5171
|
const e = Math.floor(t / 4), s = t * 2 % 8, i = this.#o.getUint8(e) >> s & 3;
|
|
5172
5172
|
return i === 0 ? void 0 : i === 2;
|
|
5173
5173
|
}
|
|
@@ -5202,7 +5202,7 @@ class j {
|
|
|
5202
5202
|
return this.#l(9);
|
|
5203
5203
|
}
|
|
5204
5204
|
#h(t) {
|
|
5205
|
-
return B(t <
|
|
5205
|
+
return B(t < G.numbers.length, "Invalid number index"), this.#o.getFloat64(G.#t + t * 8);
|
|
5206
5206
|
}
|
|
5207
5207
|
get ascent() {
|
|
5208
5208
|
return this.#h(0);
|
|
@@ -5214,7 +5214,7 @@ class j {
|
|
|
5214
5214
|
return this.#h(2);
|
|
5215
5215
|
}
|
|
5216
5216
|
get bbox() {
|
|
5217
|
-
let t =
|
|
5217
|
+
let t = G.#e;
|
|
5218
5218
|
if (this.#o.getUint8(t) === 0)
|
|
5219
5219
|
return;
|
|
5220
5220
|
t += 1;
|
|
@@ -5224,7 +5224,7 @@ class j {
|
|
|
5224
5224
|
return e;
|
|
5225
5225
|
}
|
|
5226
5226
|
get fontMatrix() {
|
|
5227
|
-
let t =
|
|
5227
|
+
let t = G.#i;
|
|
5228
5228
|
if (this.#o.getUint8(t) === 0)
|
|
5229
5229
|
return;
|
|
5230
5230
|
t += 1;
|
|
@@ -5234,7 +5234,7 @@ class j {
|
|
|
5234
5234
|
return e;
|
|
5235
5235
|
}
|
|
5236
5236
|
get defaultVMetrics() {
|
|
5237
|
-
let t =
|
|
5237
|
+
let t = G.#s;
|
|
5238
5238
|
if (this.#o.getUint8(t) === 0)
|
|
5239
5239
|
return;
|
|
5240
5240
|
t += 1;
|
|
@@ -5244,8 +5244,8 @@ class j {
|
|
|
5244
5244
|
return e;
|
|
5245
5245
|
}
|
|
5246
5246
|
#u(t) {
|
|
5247
|
-
B(t <
|
|
5248
|
-
let e =
|
|
5247
|
+
B(t < G.strings.length, "Invalid string index");
|
|
5248
|
+
let e = G.#a + 4;
|
|
5249
5249
|
for (let n = 0; n < t; n++)
|
|
5250
5250
|
e += this.#o.getUint32(e) + 4;
|
|
5251
5251
|
const s = this.#o.getUint32(e), i = new Uint8Array(s);
|
|
@@ -5264,7 +5264,7 @@ class j {
|
|
|
5264
5264
|
return this.#u(3);
|
|
5265
5265
|
}
|
|
5266
5266
|
get data() {
|
|
5267
|
-
let t =
|
|
5267
|
+
let t = G.#a;
|
|
5268
5268
|
const e = this.#o.getUint32(t);
|
|
5269
5269
|
t += 4 + e;
|
|
5270
5270
|
const s = this.#o.getUint32(t);
|
|
@@ -5276,7 +5276,7 @@ class j {
|
|
|
5276
5276
|
return new Uint8Array(this.#r, t + 4, n);
|
|
5277
5277
|
}
|
|
5278
5278
|
clearData() {
|
|
5279
|
-
let t =
|
|
5279
|
+
let t = G.#a;
|
|
5280
5280
|
const e = this.#o.getUint32(t);
|
|
5281
5281
|
t += 4 + e;
|
|
5282
5282
|
const s = this.#o.getUint32(t);
|
|
@@ -5287,7 +5287,7 @@ class j {
|
|
|
5287
5287
|
new Uint8Array(this.#r, t + 4, n).fill(0), this.#o.setUint32(t, 0);
|
|
5288
5288
|
}
|
|
5289
5289
|
get cssFontInfo() {
|
|
5290
|
-
let t =
|
|
5290
|
+
let t = G.#a;
|
|
5291
5291
|
const e = this.#o.getUint32(t);
|
|
5292
5292
|
t += 4 + e;
|
|
5293
5293
|
const s = this.#o.getUint32(t);
|
|
@@ -5299,7 +5299,7 @@ class j {
|
|
|
5299
5299
|
return n.set(new Uint8Array(this.#r, t + 4, i)), new re(n.buffer);
|
|
5300
5300
|
}
|
|
5301
5301
|
get systemFontInfo() {
|
|
5302
|
-
let t =
|
|
5302
|
+
let t = G.#a;
|
|
5303
5303
|
const e = this.#o.getUint32(t);
|
|
5304
5304
|
t += 4 + e;
|
|
5305
5305
|
const s = this.#o.getUint32(t);
|
|
@@ -5311,43 +5311,43 @@ class j {
|
|
|
5311
5311
|
static write(t) {
|
|
5312
5312
|
const e = t.systemFontInfo ? ae.write(t.systemFontInfo) : null, s = t.cssFontInfo ? re.write(t.cssFontInfo) : null, i = new TextEncoder(), n = {};
|
|
5313
5313
|
let r = 0;
|
|
5314
|
-
for (const g of
|
|
5314
|
+
for (const g of G.strings)
|
|
5315
5315
|
n[g] = i.encode(t[g]), r += 4 + n[g].length;
|
|
5316
|
-
const a =
|
|
5316
|
+
const a = G.#a + 4 + r + 4 + (e ? e.byteLength : 0) + 4 + (s ? s.byteLength : 0) + 4 + (t.data ? t.data.length : 0), o = new ArrayBuffer(a), h = new Uint8Array(o), l = new DataView(o);
|
|
5317
5317
|
let c = 0;
|
|
5318
|
-
const u =
|
|
5318
|
+
const u = G.bools.length;
|
|
5319
5319
|
let p = 0, f = 0;
|
|
5320
5320
|
for (let g = 0; g < u; g++) {
|
|
5321
|
-
const b = t[
|
|
5321
|
+
const b = t[G.bools[g]];
|
|
5322
5322
|
p |= (b === void 0 ? 0 : b ? 2 : 1) << f, f += 2, (f === 8 || g === u - 1) && (l.setUint8(c++, p), p = 0, f = 0);
|
|
5323
5323
|
}
|
|
5324
|
-
B(c ===
|
|
5325
|
-
for (const g of
|
|
5324
|
+
B(c === G.#t, "FontInfo.write: Boolean properties offset mismatch");
|
|
5325
|
+
for (const g of G.numbers)
|
|
5326
5326
|
l.setFloat64(c, t[g]), c += 8;
|
|
5327
|
-
if (B(c ===
|
|
5327
|
+
if (B(c === G.#e, "FontInfo.write: Number properties offset mismatch"), t.bbox) {
|
|
5328
5328
|
l.setUint8(c++, 4);
|
|
5329
5329
|
for (const g of t.bbox)
|
|
5330
5330
|
l.setInt16(c, g, !0), c += 2;
|
|
5331
5331
|
} else
|
|
5332
5332
|
l.setUint8(c++, 0), c += 8;
|
|
5333
|
-
if (B(c ===
|
|
5333
|
+
if (B(c === G.#i, "FontInfo.write: BBox properties offset mismatch"), t.fontMatrix) {
|
|
5334
5334
|
l.setUint8(c++, 6);
|
|
5335
5335
|
for (const g of t.fontMatrix)
|
|
5336
5336
|
l.setFloat64(c, g, !0), c += 8;
|
|
5337
5337
|
} else
|
|
5338
5338
|
l.setUint8(c++, 0), c += 48;
|
|
5339
|
-
if (B(c ===
|
|
5339
|
+
if (B(c === G.#s, "FontInfo.write: FontMatrix properties offset mismatch"), t.defaultVMetrics) {
|
|
5340
5340
|
l.setUint8(c++, 1);
|
|
5341
5341
|
for (const g of t.defaultVMetrics)
|
|
5342
5342
|
l.setInt16(c, g, !0), c += 2;
|
|
5343
5343
|
} else
|
|
5344
5344
|
l.setUint8(c++, 0), c += 6;
|
|
5345
|
-
B(c ===
|
|
5346
|
-
for (const g of
|
|
5345
|
+
B(c === G.#a, "FontInfo.write: DefaultVMetrics properties offset mismatch"), l.setUint32(G.#a, 0), c += 4;
|
|
5346
|
+
for (const g of G.strings) {
|
|
5347
5347
|
const b = n[g], m = b.length;
|
|
5348
5348
|
l.setUint32(c, m), h.set(b, c + 4), c += 4 + m;
|
|
5349
5349
|
}
|
|
5350
|
-
if (l.setUint32(
|
|
5350
|
+
if (l.setUint32(G.#a, c - G.#a - 4), !e)
|
|
5351
5351
|
l.setUint32(c, 0), c += 4;
|
|
5352
5352
|
else {
|
|
5353
5353
|
const g = e.byteLength;
|
|
@@ -5457,8 +5457,8 @@ class ot {
|
|
|
5457
5457
|
if (l.length > 0) {
|
|
5458
5458
|
let w = l[0], y = l[0], v = l[1], A = l[1];
|
|
5459
5459
|
for (let x = 0; x < l.length; x += 2) {
|
|
5460
|
-
const _ = l[x],
|
|
5461
|
-
w = w > _ ? _ : w, v = v >
|
|
5460
|
+
const _ = l[x], E = l[x + 1];
|
|
5461
|
+
w = w > _ ? _ : w, v = v > E ? E : v, y = y < _ ? _ : y, A = A < E ? E : A;
|
|
5462
5462
|
}
|
|
5463
5463
|
m = [w, v, y, A];
|
|
5464
5464
|
}
|
|
@@ -5565,9 +5565,9 @@ const Ne = {
|
|
|
5565
5565
|
function ti() {
|
|
5566
5566
|
}
|
|
5567
5567
|
function pt(d) {
|
|
5568
|
-
if (d instanceof $t || d instanceof ms || d instanceof Ws || d instanceof
|
|
5568
|
+
if (d instanceof $t || d instanceof ms || d instanceof Ws || d instanceof je || d instanceof rs)
|
|
5569
5569
|
return d;
|
|
5570
|
-
switch (d instanceof Error || typeof d == "object" && d !== null ||
|
|
5570
|
+
switch (d instanceof Error || typeof d == "object" && d !== null || j('wrapReason: Expected "reason" to be a (possibly cloned) Error.'), d.name) {
|
|
5571
5571
|
case "AbortException":
|
|
5572
5572
|
return new $t(d.message);
|
|
5573
5573
|
case "InvalidPDFException":
|
|
@@ -5575,7 +5575,7 @@ function pt(d) {
|
|
|
5575
5575
|
case "PasswordException":
|
|
5576
5576
|
return new Ws(d.message, d.code);
|
|
5577
5577
|
case "ResponseException":
|
|
5578
|
-
return new
|
|
5578
|
+
return new je(d.message, d.status, d.missing);
|
|
5579
5579
|
case "UnknownErrorException":
|
|
5580
5580
|
return new rs(d.message, d.details);
|
|
5581
5581
|
}
|
|
@@ -5886,7 +5886,7 @@ class ki {
|
|
|
5886
5886
|
t.canvas.width = 0, t.canvas.height = 0, t.canvas = null, t.context = null;
|
|
5887
5887
|
}
|
|
5888
5888
|
_createCanvas(t, e) {
|
|
5889
|
-
|
|
5889
|
+
j("Abstract method `_createCanvas` called.");
|
|
5890
5890
|
}
|
|
5891
5891
|
}
|
|
5892
5892
|
class zn extends ki {
|
|
@@ -5926,7 +5926,7 @@ class Di {
|
|
|
5926
5926
|
});
|
|
5927
5927
|
}
|
|
5928
5928
|
async _fetch(t) {
|
|
5929
|
-
|
|
5929
|
+
j("Abstract method `_fetch` called.");
|
|
5930
5930
|
}
|
|
5931
5931
|
}
|
|
5932
5932
|
class ei extends Di {
|
|
@@ -6087,15 +6087,15 @@ class Un extends Ii {
|
|
|
6087
6087
|
c < l && ([l, c, u, p] = [c, l, p, u]), this.#h.style.color = "";
|
|
6088
6088
|
const f = (m, w, y) => {
|
|
6089
6089
|
const v = new Array(256), A = (c - l) / y, x = m / 255, _ = (w - m) / (255 * y);
|
|
6090
|
-
let
|
|
6091
|
-
for (let
|
|
6092
|
-
const P = Math.round(l +
|
|
6093
|
-
for (let H =
|
|
6090
|
+
let E = 0;
|
|
6091
|
+
for (let S = 0; S <= y; S++) {
|
|
6092
|
+
const P = Math.round(l + S * A), C = x + S * _;
|
|
6093
|
+
for (let H = E; H <= P; H++)
|
|
6094
6094
|
v[H] = C;
|
|
6095
|
-
|
|
6095
|
+
E = P + 1;
|
|
6096
6096
|
}
|
|
6097
|
-
for (let
|
|
6098
|
-
v[
|
|
6097
|
+
for (let S = E; S < 256; S++)
|
|
6098
|
+
v[S] = v[E - 1];
|
|
6099
6099
|
return v.join(",");
|
|
6100
6100
|
}, g = `g_${this.#s}_hcm_${t}_filter`, b = a.filter = this.#f(g);
|
|
6101
6101
|
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;
|
|
@@ -6150,7 +6150,7 @@ class Ri {
|
|
|
6150
6150
|
});
|
|
6151
6151
|
}
|
|
6152
6152
|
async _fetch(t) {
|
|
6153
|
-
|
|
6153
|
+
j("Abstract method `_fetch` called.");
|
|
6154
6154
|
}
|
|
6155
6155
|
}
|
|
6156
6156
|
class si extends Ri {
|
|
@@ -6178,7 +6178,7 @@ class Li {
|
|
|
6178
6178
|
});
|
|
6179
6179
|
}
|
|
6180
6180
|
async _fetch(t) {
|
|
6181
|
-
|
|
6181
|
+
j("Abstract method `_fetch` called.");
|
|
6182
6182
|
}
|
|
6183
6183
|
}
|
|
6184
6184
|
class ii extends Li {
|
|
@@ -6194,12 +6194,12 @@ async function Fs(d) {
|
|
|
6194
6194
|
}
|
|
6195
6195
|
class Vn extends Ii {
|
|
6196
6196
|
}
|
|
6197
|
-
class
|
|
6197
|
+
class Gn extends ki {
|
|
6198
6198
|
_createCanvas(t, e) {
|
|
6199
6199
|
return process.getBuiltinModule("module").createRequire(import.meta.url)("@napi-rs/canvas").createCanvas(t, e);
|
|
6200
6200
|
}
|
|
6201
6201
|
}
|
|
6202
|
-
class
|
|
6202
|
+
class jn extends Di {
|
|
6203
6203
|
async _fetch(t) {
|
|
6204
6204
|
return Fs(t);
|
|
6205
6205
|
}
|
|
@@ -6594,7 +6594,7 @@ class Ns {
|
|
|
6594
6594
|
return !1;
|
|
6595
6595
|
}
|
|
6596
6596
|
getPattern() {
|
|
6597
|
-
|
|
6597
|
+
j("Abstract method `getPattern` called.");
|
|
6598
6598
|
}
|
|
6599
6599
|
}
|
|
6600
6600
|
class Kn extends Ns {
|
|
@@ -6653,18 +6653,18 @@ function hs(d, t, e, s, i, n, r, a) {
|
|
|
6653
6653
|
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;
|
|
6654
6654
|
if (f >= w)
|
|
6655
6655
|
return;
|
|
6656
|
-
const y = h[n], v = h[n + 1], A = h[n + 2], x = h[r], _ = h[r + 1],
|
|
6656
|
+
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], P = h[a + 1], C = h[a + 2], H = Math.round(f), V = Math.round(w);
|
|
6657
6657
|
let N, Z, k, I, U, ft, Dt, tt;
|
|
6658
6658
|
for (let W = H; W <= V; W++) {
|
|
6659
6659
|
if (W < b) {
|
|
6660
6660
|
const et = W < f ? 0 : (f - W) / (f - b);
|
|
6661
|
-
N = p - (p - g) * et, Z = y - (y - x) * et, k = v - (v - _) * et, I = A - (A -
|
|
6661
|
+
N = p - (p - g) * et, Z = y - (y - x) * et, k = v - (v - _) * et, I = A - (A - E) * et;
|
|
6662
6662
|
} else {
|
|
6663
6663
|
let et;
|
|
6664
|
-
W > w ? et = 1 : b === w ? et = 0 : et = (b - W) / (b - w), N = g - (g - m) * et, Z = x - (x -
|
|
6664
|
+
W > w ? et = 1 : b === w ? et = 0 : et = (b - W) / (b - w), N = g - (g - m) * et, Z = x - (x - S) * et, k = _ - (_ - P) * et, I = E - (E - C) * et;
|
|
6665
6665
|
}
|
|
6666
6666
|
let q;
|
|
6667
|
-
W < f ? q = 0 : W > w ? q = 1 : q = (f - W) / (f - w), U = p - (p - m) * q, ft = y - (y -
|
|
6667
|
+
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 - P) * q, tt = A - (A - C) * q;
|
|
6668
6668
|
const Ut = Math.round(Math.min(N, U)), Nt = Math.round(Math.max(N, U));
|
|
6669
6669
|
let Ot = c * W + Ut * 4;
|
|
6670
6670
|
for (let et = Ut; et <= Nt; et++)
|
|
@@ -6781,14 +6781,14 @@ class Os {
|
|
|
6781
6781
|
const [w, y] = m;
|
|
6782
6782
|
T.singularValueDecompose2dScale(this.baseTransform, m);
|
|
6783
6783
|
const v = w * m[0], A = y * m[1];
|
|
6784
|
-
let x = g, _ = b,
|
|
6784
|
+
let x = g, _ = b, E = !1, S = !1;
|
|
6785
6785
|
const P = Math.ceil(h * v), C = Math.ceil(l * A), H = Math.ceil(g * v), V = Math.ceil(b * A);
|
|
6786
|
-
P >= H ? x = h :
|
|
6786
|
+
P >= H ? x = h : E = !0, C >= V ? _ = l : S = !0;
|
|
6787
6787
|
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), I = k.context, U = o.createCanvasGraphics(I, e);
|
|
6788
|
-
if (U.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext(U, n, a), I.translate(-N.scale * c, -Z.scale * u), U.transform(0, N.scale, 0, 0, Z.scale, 0, 0), I.save(), U.dependencyTracker?.save(), this.clipBbox(U, c, u, p, f), U.baseTransform = X(U.ctx), U.executeOperatorList(i), U.endDrawing(), U.dependencyTracker?.restore(), I.restore(),
|
|
6788
|
+
if (U.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext(U, n, a), I.translate(-N.scale * c, -Z.scale * u), U.transform(0, N.scale, 0, 0, Z.scale, 0, 0), I.save(), U.dependencyTracker?.save(), this.clipBbox(U, c, u, p, f), U.baseTransform = X(U.ctx), U.executeOperatorList(i), U.endDrawing(), U.dependencyTracker?.restore(), I.restore(), E || S) {
|
|
6789
6789
|
const ft = k.canvas;
|
|
6790
|
-
|
|
6791
|
-
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 =
|
|
6790
|
+
E && (x = h), S && (_ = l);
|
|
6791
|
+
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;
|
|
6792
6792
|
for (let ce = 0; ce <= Ot; ce++)
|
|
6793
6793
|
for (let de = 0; de <= et; de++)
|
|
6794
6794
|
Nt.drawImage(ft, W * ce, q * de, W, q, 0, 0, W, q);
|
|
@@ -6937,12 +6937,12 @@ class nr {
|
|
|
6937
6937
|
function He(d, t, e, s, i, n, r, a, o, h) {
|
|
6938
6938
|
const [l, c, u, p, f, g] = X(d);
|
|
6939
6939
|
if (c === 0 && u === 0) {
|
|
6940
|
-
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,
|
|
6941
|
-
return d.setTransform(Math.sign(l), 0, 0, Math.sign(p), y, A), d.drawImage(t, e, s, i, n, 0, 0, _,
|
|
6940
|
+
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;
|
|
6941
|
+
return d.setTransform(Math.sign(l), 0, 0, Math.sign(p), y, A), d.drawImage(t, e, s, i, n, 0, 0, _, S), d.setTransform(l, c, u, p, f, g), [_, S];
|
|
6942
6942
|
}
|
|
6943
6943
|
if (l === 0 && p === 0) {
|
|
6944
|
-
const w = a * u + f, y = Math.round(w), v = r * c + g, A = Math.round(v), x = (a + h) * u + f, _ = Math.abs(Math.round(x) - y) || 1,
|
|
6945
|
-
return d.setTransform(0, Math.sign(c), Math.sign(u), 0, y, A), d.drawImage(t, e, s, i, n, 0, 0,
|
|
6944
|
+
const w = a * u + f, y = Math.round(w), v = r * c + g, A = Math.round(v), x = (a + h) * u + f, _ = Math.abs(Math.round(x) - y) || 1, E = (r + o) * c + g, S = Math.abs(Math.round(E) - A) || 1;
|
|
6945
|
+
return d.setTransform(0, Math.sign(c), Math.sign(u), 0, y, A), d.drawImage(t, e, s, i, n, 0, 0, S, _), d.setTransform(l, c, u, p, f, g), [S, _];
|
|
6946
6946
|
}
|
|
6947
6947
|
d.drawImage(t, e, s, i, n, r, a, o, h);
|
|
6948
6948
|
const b = Math.hypot(l, c), m = Math.hypot(u, p);
|
|
@@ -6984,7 +6984,7 @@ class ci {
|
|
|
6984
6984
|
getPathBoundingBox(t = ct.FILL, e = null) {
|
|
6985
6985
|
const s = this.minMax.slice();
|
|
6986
6986
|
if (t === ct.STROKE) {
|
|
6987
|
-
e ||
|
|
6987
|
+
e || j("Stroke bounding box must include transform."), T.singularValueDecompose2dScale(e, wt);
|
|
6988
6988
|
const i = wt[0] * this.lineWidth / 2, n = wt[1] * this.lineWidth / 2;
|
|
6989
6989
|
s[0] -= i, s[1] -= n, s[2] += i, s[3] += n;
|
|
6990
6990
|
}
|
|
@@ -7013,28 +7013,28 @@ function di(d, t) {
|
|
|
7013
7013
|
let o = 0, h;
|
|
7014
7014
|
const l = t.data, c = a.data;
|
|
7015
7015
|
let u, p, f, g;
|
|
7016
|
-
if (t.kind ===
|
|
7016
|
+
if (t.kind === Ge.GRAYSCALE_1BPP) {
|
|
7017
7017
|
const b = l.byteLength, m = new Uint32Array(c.buffer, 0, c.byteLength >> 2), w = m.length, y = s + 7 >> 3, v = 4294967295, A = at.isLittleEndian ? 4278190080 : 255;
|
|
7018
7018
|
for (u = 0; u < r; u++) {
|
|
7019
7019
|
for (f = u < n ? gt : i, h = 0, p = 0; p < f; p++) {
|
|
7020
7020
|
const x = b - o;
|
|
7021
7021
|
let _ = 0;
|
|
7022
|
-
const
|
|
7022
|
+
const E = x > y ? s : x * 8 - 7, S = E & -8;
|
|
7023
7023
|
let P = 0, C = 0;
|
|
7024
|
-
for (; _ <
|
|
7024
|
+
for (; _ < S; _ += 8)
|
|
7025
7025
|
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;
|
|
7026
|
-
for (; _ <
|
|
7026
|
+
for (; _ < E; _++)
|
|
7027
7027
|
P === 0 && (C = l[o++], P = 128), m[h++] = C & P ? v : A, P >>= 1;
|
|
7028
7028
|
}
|
|
7029
7029
|
for (; h < w; )
|
|
7030
7030
|
m[h++] = 0;
|
|
7031
7031
|
d.putImageData(a, 0, u * gt);
|
|
7032
7032
|
}
|
|
7033
|
-
} else if (t.kind ===
|
|
7033
|
+
} else if (t.kind === Ge.RGBA_32BPP) {
|
|
7034
7034
|
for (p = 0, g = s * gt * 4, u = 0; u < n; u++)
|
|
7035
7035
|
c.set(l.subarray(o, o + g)), o += g, d.putImageData(a, 0, p), p += gt;
|
|
7036
7036
|
u < r && (g = s * i * 4, c.set(l.subarray(o, o + g)), d.putImageData(a, 0, p));
|
|
7037
|
-
} else if (t.kind ===
|
|
7037
|
+
} else if (t.kind === Ge.RGB_24BPP)
|
|
7038
7038
|
for (f = gt, g = s * f, u = 0; u < r; u++) {
|
|
7039
7039
|
for (u >= n && (f = i, g = s * f), h = 0, p = g; p--; )
|
|
7040
7040
|
c[h++] = l[o++], c[h++] = l[o++], c[h++] = l[o++], c[h++] = 255;
|
|
@@ -7123,7 +7123,7 @@ class oe {
|
|
|
7123
7123
|
if (i !== void 0 && o === i.nextBreakPoint)
|
|
7124
7124
|
return i.breakIt(o, s), o;
|
|
7125
7125
|
if (!n || n(o))
|
|
7126
|
-
if (g = a[o], b = r[o] ?? null, g !==
|
|
7126
|
+
if (g = a[o], b = r[o] ?? null, g !== Ee.dependency)
|
|
7127
7127
|
b === null ? this[g](o) : this[g](o, ...b);
|
|
7128
7128
|
else
|
|
7129
7129
|
for (const m of b) {
|
|
@@ -7202,13 +7202,13 @@ class oe {
|
|
|
7202
7202
|
p = T.transform(p, [1, 0, 0, 1, 0, -n]);
|
|
7203
7203
|
const f = se.slice();
|
|
7204
7204
|
T.axialAlignedBoundingBox([0, 0, i, n], p, f);
|
|
7205
|
-
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,
|
|
7206
|
-
x.translate(-_, -
|
|
7207
|
-
const
|
|
7208
|
-
return x.fillStyle = a ? r.getPattern(s, this,
|
|
7205
|
+
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;
|
|
7206
|
+
x.translate(-_, -E), x.transform(...p), c || (c = this._scaleImage(u.canvas, St(x)), c = c.img, h && a && h.set(l, c)), x.imageSmoothingEnabled = pi(X(x), e.interpolate), He(x, c, 0, 0, c.width, c.height, 0, 0, i, n), x.globalCompositeOperation = "source-in";
|
|
7207
|
+
const S = T.transform(St(x), [1, 0, 0, 1, -_, -E]);
|
|
7208
|
+
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), {
|
|
7209
7209
|
canvas: A.canvas,
|
|
7210
7210
|
offsetX: Math.round(_),
|
|
7211
|
-
offsetY: Math.round(
|
|
7211
|
+
offsetY: Math.round(E)
|
|
7212
7212
|
};
|
|
7213
7213
|
}
|
|
7214
7214
|
setLineWidth(t, e) {
|
|
@@ -7344,7 +7344,7 @@ class oe {
|
|
|
7344
7344
|
return;
|
|
7345
7345
|
}
|
|
7346
7346
|
if (this.dependencyTracker !== null) {
|
|
7347
|
-
const r = e ===
|
|
7347
|
+
const r = e === Ee.stroke ? this.current.lineWidth / 2 : 0;
|
|
7348
7348
|
this.dependencyTracker.resetBBox(t).recordBBox(t, this.ctx, i[0] - r, i[2] + r, i[1] - r, i[3] + r).recordDependencies(t, ["transform"]);
|
|
7349
7349
|
}
|
|
7350
7350
|
n instanceof Path2D || (n = s[0] = Ci(n)), T.axialAlignedBoundingBox(i, X(this.ctx), this.current.minMax), this[e](t, n), this._pathStartIdx = t;
|
|
@@ -7357,7 +7357,7 @@ class oe {
|
|
|
7357
7357
|
if (i.globalAlpha = this.current.strokeAlpha, this.contentVisible)
|
|
7358
7358
|
if (typeof n == "object" && n?.getPattern) {
|
|
7359
7359
|
const r = n.isModifyingCurrentTransform() ? i.getTransform() : null;
|
|
7360
|
-
if (i.save(), i.strokeStyle = n.getPattern(i, this,
|
|
7360
|
+
if (i.save(), i.strokeStyle = n.getPattern(i, this, St(i), ct.STROKE, t), r) {
|
|
7361
7361
|
const a = new Path2D();
|
|
7362
7362
|
a.addPath(e, i.getTransform().invertSelf().multiplySelf(r)), e = a;
|
|
7363
7363
|
}
|
|
@@ -7374,7 +7374,7 @@ class oe {
|
|
|
7374
7374
|
let a = !1;
|
|
7375
7375
|
if (r) {
|
|
7376
7376
|
const h = n.isModifyingCurrentTransform() ? i.getTransform() : null;
|
|
7377
|
-
if (this.dependencyTracker?.save(t), i.save(), i.fillStyle = n.getPattern(i, this,
|
|
7377
|
+
if (this.dependencyTracker?.save(t), i.save(), i.fillStyle = n.getPattern(i, this, St(i), ct.FILL, t), h) {
|
|
7378
7378
|
const l = new Path2D();
|
|
7379
7379
|
l.addPath(e, i.getTransform().invertSelf().multiplySelf(h)), e = l;
|
|
7380
7380
|
}
|
|
@@ -7555,17 +7555,17 @@ class oe {
|
|
|
7555
7555
|
const v = s.textRenderingMode & nt.FILL_STROKE_MASK, A = v === nt.FILL || v === nt.FILL_STROKE, x = v === nt.STROKE || v === nt.FILL_STROKE;
|
|
7556
7556
|
if (A && s.patternFill) {
|
|
7557
7557
|
r.save();
|
|
7558
|
-
const C = s.fillColor.getPattern(r, this,
|
|
7558
|
+
const C = s.fillColor.getPattern(r, this, St(r), ct.FILL, t);
|
|
7559
7559
|
w = X(r), r.restore(), r.fillStyle = C;
|
|
7560
7560
|
}
|
|
7561
7561
|
if (x && s.patternStroke) {
|
|
7562
7562
|
r.save();
|
|
7563
|
-
const C = s.strokeColor.getPattern(r, this,
|
|
7563
|
+
const C = s.strokeColor.getPattern(r, this, St(r), ct.STROKE, t);
|
|
7564
7564
|
y = X(r), r.restore(), r.strokeStyle = C;
|
|
7565
7565
|
}
|
|
7566
7566
|
let _ = s.lineWidth;
|
|
7567
|
-
const
|
|
7568
|
-
if (
|
|
7567
|
+
const E = s.textMatrixScale;
|
|
7568
|
+
if (E === 0 || _ === 0 ? x && (_ = this.getSinglePixelWidth()) : _ /= E, a !== 1 && (r.scale(a, a), _ /= a), r.lineWidth = _, i.isInvalidPDFjsFont) {
|
|
7569
7569
|
const C = [];
|
|
7570
7570
|
let H = 0;
|
|
7571
7571
|
for (const N of e)
|
|
@@ -7578,11 +7578,11 @@ class oe {
|
|
|
7578
7578
|
s.x += H * b * c, r.restore(), this.compose();
|
|
7579
7579
|
return;
|
|
7580
7580
|
}
|
|
7581
|
-
let
|
|
7581
|
+
let S = 0, P;
|
|
7582
7582
|
for (P = 0; P < u; ++P) {
|
|
7583
7583
|
const C = e[P];
|
|
7584
7584
|
if (typeof C == "number") {
|
|
7585
|
-
|
|
7585
|
+
S += f * C * n / 1e3;
|
|
7586
7586
|
continue;
|
|
7587
7587
|
}
|
|
7588
7588
|
let H = !1;
|
|
@@ -7590,9 +7590,9 @@ class oe {
|
|
|
7590
7590
|
let k, I, U = C.width;
|
|
7591
7591
|
if (p) {
|
|
7592
7592
|
const tt = C.vmetric || g, W = -(C.vmetric ? tt[1] : U * 0.5) * b, q = tt[2] * b;
|
|
7593
|
-
U = tt ? -tt[0] : U, k = W / a, I = (
|
|
7593
|
+
U = tt ? -tt[0] : U, k = W / a, I = (S + q) / a;
|
|
7594
7594
|
} else
|
|
7595
|
-
k =
|
|
7595
|
+
k = S / a, I = 0;
|
|
7596
7596
|
let ft;
|
|
7597
7597
|
if (i.remeasure && U > 0) {
|
|
7598
7598
|
ft = r.measureText(N);
|
|
@@ -7613,9 +7613,9 @@ class oe {
|
|
|
7613
7613
|
}
|
|
7614
7614
|
}
|
|
7615
7615
|
const Dt = p ? U * b - V * l : U * b + V * l;
|
|
7616
|
-
|
|
7616
|
+
S += Dt, H && r.restore();
|
|
7617
7617
|
}
|
|
7618
|
-
p ? s.y -=
|
|
7618
|
+
p ? s.y -= S : s.x += S * c, r.restore(), this.compose(), this.dependencyTracker?.recordShowTextOperation(t);
|
|
7619
7619
|
}
|
|
7620
7620
|
showType3Text(t, e) {
|
|
7621
7621
|
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, c = i.textHScale * a, u = i.fontMatrix || gs, p = e.length, f = i.textRenderingMode === nt.INVISIBLE;
|
|
@@ -7684,8 +7684,8 @@ class oe {
|
|
|
7684
7684
|
const s = this.ctx;
|
|
7685
7685
|
this.save(t);
|
|
7686
7686
|
const i = this._getPattern(t, e);
|
|
7687
|
-
s.fillStyle = i.getPattern(s, this,
|
|
7688
|
-
const n =
|
|
7687
|
+
s.fillStyle = i.getPattern(s, this, St(s), ct.SHADING, t);
|
|
7688
|
+
const n = St(s);
|
|
7689
7689
|
if (n) {
|
|
7690
7690
|
const {
|
|
7691
7691
|
width: r,
|
|
@@ -7699,10 +7699,10 @@ class oe {
|
|
|
7699
7699
|
this.dependencyTracker?.resetBBox(t).recordFullPageBBox(t).recordDependencies(t, At.transform).recordDependencies(t, At.fill).recordOperation(t), this.compose(this.current.getClippedPathBoundingBox()), this.restore(t);
|
|
7700
7700
|
}
|
|
7701
7701
|
beginInlineImage() {
|
|
7702
|
-
|
|
7702
|
+
j("Should not call beginInlineImage");
|
|
7703
7703
|
}
|
|
7704
7704
|
beginImageData() {
|
|
7705
|
-
|
|
7705
|
+
j("Should not call beginImageData");
|
|
7706
7706
|
}
|
|
7707
7707
|
paintFormXObjectBegin(t, e, s) {
|
|
7708
7708
|
if (this.contentVisible && (this.save(t), this.baseTransformStack.push(this.baseTransform), e && this.transform(t, ...e), this.baseTransform = X(this.ctx), s)) {
|
|
@@ -7828,7 +7828,7 @@ class oe {
|
|
|
7828
7828
|
} = r, c = this.cachedCanvases.getCanvas("maskCanvas", o, h), u = c.context;
|
|
7829
7829
|
u.save();
|
|
7830
7830
|
const p = this.getObject(t, a, r);
|
|
7831
|
-
ui(u, p), u.globalCompositeOperation = "source-in", u.fillStyle = n ? i.getPattern(u, this,
|
|
7831
|
+
ui(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), He(s, c.canvas, 0, 0, o, h, 0, -1, 1, 1), this.dependencyTracker?.recordBBox(t, s, 0, o, 0, h), s.restore();
|
|
7832
7832
|
}
|
|
7833
7833
|
this.compose(), this.dependencyTracker?.recordOperation(t);
|
|
7834
7834
|
}
|
|
@@ -7892,7 +7892,7 @@ class oe {
|
|
|
7892
7892
|
const h = this.cachedCanvases.getCanvas("inlineImage", s, i).context;
|
|
7893
7893
|
di(h, e), a = this.applyTransferMapsToCanvas(h);
|
|
7894
7894
|
}
|
|
7895
|
-
const o = this._scaleImage(a,
|
|
7895
|
+
const o = this._scaleImage(a, St(n));
|
|
7896
7896
|
n.imageSmoothingEnabled = pi(X(n), e.interpolate), this.dependencyTracker?.resetBBox(t).recordBBox(t, n, 0, s, -i, 0).recordDependencies(t, At.imageXObject).recordOperation(t), He(n, o.img, 0, 0, o.paintWidth, o.paintHeight, 0, -i, s, i), this.compose(), this.restore(t);
|
|
7897
7897
|
}
|
|
7898
7898
|
paintInlineImageXObjectGroup(t, e, s) {
|
|
@@ -8021,8 +8021,8 @@ class oe {
|
|
|
8021
8021
|
return !0;
|
|
8022
8022
|
}
|
|
8023
8023
|
}
|
|
8024
|
-
for (const d in
|
|
8025
|
-
oe.prototype[d] !== void 0 && (oe.prototype[
|
|
8024
|
+
for (const d in Ee)
|
|
8025
|
+
oe.prototype[d] !== void 0 && (oe.prototype[Ee[d]] = oe.prototype[d]);
|
|
8026
8026
|
class Wt {
|
|
8027
8027
|
static #t = null;
|
|
8028
8028
|
static #e = "";
|
|
@@ -8088,7 +8088,7 @@ class lr {
|
|
|
8088
8088
|
return this.#t ? e?.viewState !== "OFF" : this.#e ? t?.printState !== "OFF" : !0;
|
|
8089
8089
|
}
|
|
8090
8090
|
_setVisible(t, e, s = !1) {
|
|
8091
|
-
t !== Zt &&
|
|
8091
|
+
t !== Zt && j("Internal method `_setVisible` called."), this.#i = s, this.#s = e;
|
|
8092
8092
|
}
|
|
8093
8093
|
}
|
|
8094
8094
|
class cr {
|
|
@@ -8571,7 +8571,7 @@ function Oi(d) {
|
|
|
8571
8571
|
return null;
|
|
8572
8572
|
}
|
|
8573
8573
|
function Ie(d, t) {
|
|
8574
|
-
return new
|
|
8574
|
+
return new je(`Unexpected server response (${d}) while retrieving PDF "${t}".`, d, d === 404 || d === 0 && t.startsWith("file:"));
|
|
8575
8575
|
}
|
|
8576
8576
|
function Bi(d) {
|
|
8577
8577
|
return d === 200 || d === 206;
|
|
@@ -8965,15 +8965,15 @@ class xr {
|
|
|
8965
8965
|
}
|
|
8966
8966
|
}
|
|
8967
8967
|
const _r = /^[a-z][a-z0-9\-+.]+:/i;
|
|
8968
|
-
function
|
|
8968
|
+
function Er(d) {
|
|
8969
8969
|
if (_r.test(d))
|
|
8970
8970
|
return new URL(d);
|
|
8971
8971
|
const t = process.getBuiltinModule("url");
|
|
8972
8972
|
return new URL(t.pathToFileURL(d));
|
|
8973
8973
|
}
|
|
8974
|
-
class
|
|
8974
|
+
class Sr {
|
|
8975
8975
|
constructor(t) {
|
|
8976
|
-
this.source = t, this.url =
|
|
8976
|
+
this.source = t, this.url = Er(t.url), B(this.url.protocol === "file:", "PDFNodeStream only supports file:// URLs."), this._fullRequestReader = null, this._rangeRequestReaders = [];
|
|
8977
8977
|
}
|
|
8978
8978
|
get _progressiveDataLength() {
|
|
8979
8979
|
return this._fullRequestReader?._loaded ?? 0;
|
|
@@ -9178,7 +9178,7 @@ class yt {
|
|
|
9178
9178
|
#b = null;
|
|
9179
9179
|
static #w = /* @__PURE__ */ new Map();
|
|
9180
9180
|
static #y = /* @__PURE__ */ new Map();
|
|
9181
|
-
static #
|
|
9181
|
+
static #S = /* @__PURE__ */ new WeakMap();
|
|
9182
9182
|
static #_ = null;
|
|
9183
9183
|
static #A = /* @__PURE__ */ new Set();
|
|
9184
9184
|
constructor({
|
|
@@ -9207,7 +9207,7 @@ class yt {
|
|
|
9207
9207
|
pageX: r,
|
|
9208
9208
|
pageY: a
|
|
9209
9209
|
} = s.rawDims;
|
|
9210
|
-
this.#b = [1, 0, 0, -1, -r, a + n], this.#o = i, this.#n = n, yt.#P(), e.style.setProperty("--min-font-size", yt.#_),
|
|
9210
|
+
this.#b = [1, 0, 0, -1, -r, a + n], this.#o = i, this.#n = n, yt.#P(), e.style.setProperty("--min-font-size", yt.#_), jt(e, s), this.#t.promise.finally(() => {
|
|
9211
9211
|
yt.#A.delete(this), this.#r = null, this.#p = null;
|
|
9212
9212
|
}).catch(() => {
|
|
9213
9213
|
});
|
|
@@ -9239,7 +9239,7 @@ class yt {
|
|
|
9239
9239
|
onBefore: e = null
|
|
9240
9240
|
}) {
|
|
9241
9241
|
const s = t.scale * kt.pixelRatio, i = t.rotation;
|
|
9242
|
-
if (i !== this.#u && (e?.(), this.#u = i,
|
|
9242
|
+
if (i !== this.#u && (e?.(), this.#u = i, jt(this.#h, {
|
|
9243
9243
|
rotation: i
|
|
9244
9244
|
})), s !== this.#d) {
|
|
9245
9245
|
e?.(), this.#d = s;
|
|
@@ -9249,7 +9249,7 @@ class yt {
|
|
|
9249
9249
|
ctx: yt.#k(this.#a)
|
|
9250
9250
|
};
|
|
9251
9251
|
for (const r of this.#c)
|
|
9252
|
-
n.properties = this.#g.get(r), n.div = r, this.#
|
|
9252
|
+
n.properties = this.#g.get(r), n.div = r, this.#E(n);
|
|
9253
9253
|
}
|
|
9254
9254
|
}
|
|
9255
9255
|
cancel() {
|
|
@@ -9310,12 +9310,12 @@ class yt {
|
|
|
9310
9310
|
const f = Math.abs(t.transform[0]), g = Math.abs(t.transform[3]);
|
|
9311
9311
|
f !== g && Math.max(f, g) / Math.min(f, g) > 1.5 && (p = !0);
|
|
9312
9312
|
}
|
|
9313
|
-
if (p && (s.canvasWidth = r.vertical ? t.height : t.width), this.#g.set(e, s), this.#r.div = e, this.#r.properties = s, this.#
|
|
9313
|
+
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) {
|
|
9314
9314
|
const f = document.createElement("br");
|
|
9315
9315
|
f.setAttribute("role", "presentation"), this.#e.append(f);
|
|
9316
9316
|
}
|
|
9317
9317
|
}
|
|
9318
|
-
#
|
|
9318
|
+
#E(t) {
|
|
9319
9319
|
const {
|
|
9320
9320
|
div: e,
|
|
9321
9321
|
properties: s,
|
|
@@ -9355,7 +9355,7 @@ class yt {
|
|
|
9355
9355
|
s.className = "hiddenCanvasElement", s.lang = t, document.body.append(s), e = s.getContext("2d", {
|
|
9356
9356
|
alpha: !1,
|
|
9357
9357
|
willReadFrequently: !0
|
|
9358
|
-
}), this.#y.set(t, e), this.#
|
|
9358
|
+
}), this.#y.set(t, e), this.#S.set(e, {
|
|
9359
9359
|
size: 0,
|
|
9360
9360
|
family: ""
|
|
9361
9361
|
});
|
|
@@ -9363,7 +9363,7 @@ class yt {
|
|
|
9363
9363
|
return e;
|
|
9364
9364
|
}
|
|
9365
9365
|
static #M(t, e, s) {
|
|
9366
|
-
const i = this.#
|
|
9366
|
+
const i = this.#S.get(t);
|
|
9367
9367
|
e === i.size && s === i.family || (t.font = `${e}px ${s}`, i.size = e, i.family = s);
|
|
9368
9368
|
}
|
|
9369
9369
|
static #P() {
|
|
@@ -9394,8 +9394,8 @@ function Ui(d = {}) {
|
|
|
9394
9394
|
const t = new Bs(), {
|
|
9395
9395
|
docId: e
|
|
9396
9396
|
} = t, s = d.url ? Nn(d.url) : null, i = d.data ? On(d.data) : null, n = d.httpHeaders || null, r = d.withCredentials === !0, a = d.password ?? null, o = d.range instanceof Vi ? d.range : null, h = Number.isInteger(d.rangeChunkSize) && d.rangeChunkSize > 0 ? d.rangeChunkSize : 2 ** 16;
|
|
9397
|
-
let l = d.worker instanceof
|
|
9398
|
-
const c = d.verbosity, u = typeof d.docBaseUrl == "string" && !Je(d.docBaseUrl) ? d.docBaseUrl : null, p = Fe(d.cMapUrl), f = d.cMapPacked !== !1, g = d.CMapReaderFactory || (dt ?
|
|
9397
|
+
let l = d.worker instanceof Es ? d.worker : null;
|
|
9398
|
+
const c = d.verbosity, u = typeof d.docBaseUrl == "string" && !Je(d.docBaseUrl) ? d.docBaseUrl : null, p = Fe(d.cMapUrl), f = d.cMapPacked !== !1, g = d.CMapReaderFactory || (dt ? jn : ei), b = Fe(d.iccUrl), m = Fe(d.standardFontDataUrl), w = d.StandardFontDataFactory || (dt ? Wn : si), y = Fe(d.wasmUrl), v = d.WasmFactory || (dt ? qn : ii), A = d.stopAtErrors !== !0, x = Number.isInteger(d.maxImageSize) && d.maxImageSize > -1 ? d.maxImageSize : -1, _ = d.isEvalSupported !== !1, E = typeof d.isOffscreenCanvasSupported == "boolean" ? d.isOffscreenCanvasSupported : !dt, S = typeof d.isImageDecoderSupported == "boolean" ? d.isImageDecoderSupported : !dt && (at.platform.isFirefox || !globalThis.chrome), P = Number.isInteger(d.canvasMaxAreaInBytes) ? d.canvasMaxAreaInBytes : -1, C = typeof d.disableFontFace == "boolean" ? d.disableFontFace : dt, H = d.fontExtraProperties === !0, V = d.enableXfa === !0, N = d.ownerDocument || globalThis.document, Z = d.disableRange === !0, k = d.disableStream === !0, I = d.disableAutoFetch === !0, U = d.pdfBug === !0, ft = d.CanvasFactory || (dt ? Gn : zn), Dt = d.FilterFactory || (dt ? Vn : Un), tt = d.enableHWA === !0, W = d.useWasm !== !1, q = o ? o.length : d.length ?? NaN, Ut = typeof d.useSystemFonts == "boolean" ? d.useSystemFonts : !dt && !C, Nt = typeof d.useWorkerFetch == "boolean" ? d.useWorkerFetch : !!(g === ei && w === si && v === ii && p && m && y && ye(p, document.baseURI) && ye(m, document.baseURI) && ye(y, document.baseURI)), Ot = null;
|
|
9399
9399
|
ln(c);
|
|
9400
9400
|
const et = {
|
|
9401
9401
|
canvasFactory: new ft({
|
|
@@ -9417,7 +9417,7 @@ function Ui(d = {}) {
|
|
|
9417
9417
|
baseUrl: y
|
|
9418
9418
|
})
|
|
9419
9419
|
};
|
|
9420
|
-
l || (l =
|
|
9420
|
+
l || (l = Es.create({
|
|
9421
9421
|
verbosity: c,
|
|
9422
9422
|
port: Wt.workerPort
|
|
9423
9423
|
}), t._worker = l);
|
|
@@ -9436,8 +9436,8 @@ function Ui(d = {}) {
|
|
|
9436
9436
|
disableFontFace: C,
|
|
9437
9437
|
ignoreErrors: A,
|
|
9438
9438
|
isEvalSupported: _,
|
|
9439
|
-
isOffscreenCanvasSupported:
|
|
9440
|
-
isImageDecoderSupported:
|
|
9439
|
+
isOffscreenCanvasSupported: E,
|
|
9440
|
+
isImageDecoderSupported: S,
|
|
9441
9441
|
canvasMaxAreaInBytes: P,
|
|
9442
9442
|
fontExtraProperties: H,
|
|
9443
9443
|
useSystemFonts: Ut,
|
|
@@ -9472,7 +9472,7 @@ function Ui(d = {}) {
|
|
|
9472
9472
|
else if (!i) {
|
|
9473
9473
|
if (!s)
|
|
9474
9474
|
throw new Error("getDocument - no `url` parameter provided.");
|
|
9475
|
-
const is = ye(s) ? fr : dt ?
|
|
9475
|
+
const is = ye(s) ? fr : dt ? Sr : vr;
|
|
9476
9476
|
ss = new is({
|
|
9477
9477
|
url: s,
|
|
9478
9478
|
length: q,
|
|
@@ -9488,8 +9488,8 @@ function Ui(d = {}) {
|
|
|
9488
9488
|
throw new Error("Loading aborted");
|
|
9489
9489
|
if (l.destroyed)
|
|
9490
9490
|
throw new Error("Worker was destroyed");
|
|
9491
|
-
const
|
|
9492
|
-
t._transport = sn,
|
|
9491
|
+
const js = new we(e, is, l.port), sn = new Ir(js, t, ss, de, et, tt);
|
|
9492
|
+
t._transport = sn, js.send("Ready", null);
|
|
9493
9493
|
});
|
|
9494
9494
|
}).catch(t._capability.reject), t;
|
|
9495
9495
|
}
|
|
@@ -9565,7 +9565,7 @@ class Vi {
|
|
|
9565
9565
|
this.#t.resolve();
|
|
9566
9566
|
}
|
|
9567
9567
|
requestDataRange(t, e) {
|
|
9568
|
-
|
|
9568
|
+
j("Abstract method PDFDataRangeTransport.requestDataRange");
|
|
9569
9569
|
}
|
|
9570
9570
|
abort() {
|
|
9571
9571
|
}
|
|
@@ -9776,14 +9776,14 @@ class Dr {
|
|
|
9776
9776
|
lastChunk: !1,
|
|
9777
9777
|
separateAnnots: null
|
|
9778
9778
|
}, this._stats?.time("Page Request"), this._pumpOperatorList(g));
|
|
9779
|
-
const v = !!(this._pdfBug && globalThis.StepperManager?.enabled), A = !this.recordedBBoxes && (p || v), x = (
|
|
9779
|
+
const v = !!(this._pdfBug && globalThis.StepperManager?.enabled), A = !this.recordedBBoxes && (p || v), x = (S) => {
|
|
9780
9780
|
if (w.renderTasks.delete(_), A) {
|
|
9781
9781
|
const P = _.gfx?.dependencyTracker.take();
|
|
9782
9782
|
P && (_.stepper && _.stepper.setOperatorBBoxes(P, _.gfx.dependencyTracker.takeDebugMetadata()), p && (this.recordedBBoxes = P));
|
|
9783
9783
|
}
|
|
9784
|
-
y && (this.#t = !0), this.#e(),
|
|
9784
|
+
y && (this.#t = !0), this.#e(), S ? (_.capability.reject(S), this._abortOperatorList({
|
|
9785
9785
|
intentState: w,
|
|
9786
|
-
reason:
|
|
9786
|
+
reason: S instanceof Error ? S : new Error(S)
|
|
9787
9787
|
})) : _.capability.resolve(), this._stats && (this._stats.timeEnd("Rendering"), this._stats.timeEnd("Overall"), globalThis.Stats?.enabled && globalThis.Stats.add(this.pageNumber, this._stats));
|
|
9788
9788
|
}, _ = new ne({
|
|
9789
9789
|
callback: x,
|
|
@@ -9809,8 +9809,8 @@ class Dr {
|
|
|
9809
9809
|
operationsFilter: f
|
|
9810
9810
|
});
|
|
9811
9811
|
(w.renderTasks ||= /* @__PURE__ */ new Set()).add(_);
|
|
9812
|
-
const
|
|
9813
|
-
return Promise.all([w.displayReadyCapability.promise, o]).then(([
|
|
9812
|
+
const E = _.task;
|
|
9813
|
+
return Promise.all([w.displayReadyCapability.promise, o]).then(([S, P]) => {
|
|
9814
9814
|
if (this.destroyed) {
|
|
9815
9815
|
x();
|
|
9816
9816
|
return;
|
|
@@ -9818,10 +9818,10 @@ class Dr {
|
|
|
9818
9818
|
if (this._stats?.time("Rendering"), !(P.renderingIntent & b))
|
|
9819
9819
|
throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");
|
|
9820
9820
|
_.initializeGraphics({
|
|
9821
|
-
transparency:
|
|
9821
|
+
transparency: S,
|
|
9822
9822
|
optionalContentConfig: P
|
|
9823
9823
|
}), _.operatorListChanged();
|
|
9824
|
-
}).catch(x),
|
|
9824
|
+
}).catch(x), E;
|
|
9825
9825
|
}
|
|
9826
9826
|
getOperatorList({
|
|
9827
9827
|
intent: t = "display",
|
|
@@ -9860,7 +9860,7 @@ class Dr {
|
|
|
9860
9860
|
}
|
|
9861
9861
|
getTextContent(t = {}) {
|
|
9862
9862
|
if (this._transport._htmlForXfa)
|
|
9863
|
-
return this.getXfa().then((s) =>
|
|
9863
|
+
return this.getXfa().then((s) => Se.textContent(s));
|
|
9864
9864
|
const e = this.streamTextContent(t);
|
|
9865
9865
|
return new Promise(function(s, i) {
|
|
9866
9866
|
function n() {
|
|
@@ -10009,19 +10009,19 @@ class Dr {
|
|
|
10009
10009
|
return this._stats;
|
|
10010
10010
|
}
|
|
10011
10011
|
}
|
|
10012
|
-
var Vt, Pt, Ht, he, us, Qt, ie,
|
|
10012
|
+
var Vt, Pt, Ht, he, us, Qt, ie, Et, ze, Gi, ji, fe, xe, qe;
|
|
10013
10013
|
const rt = class ve {
|
|
10014
10014
|
constructor({
|
|
10015
10015
|
name: t = null,
|
|
10016
10016
|
port: e = null,
|
|
10017
10017
|
verbosity: s = cn()
|
|
10018
10018
|
} = {}) {
|
|
10019
|
-
if (Ft(this,
|
|
10019
|
+
if (Ft(this, Et), Ft(this, Vt, Promise.withResolvers()), Ft(this, Pt, null), Ft(this, Ht, null), Ft(this, he, null), this.name = t, this.destroyed = !1, this.verbosity = s, e) {
|
|
10020
10020
|
if (Y(ve, ie).has(e))
|
|
10021
10021
|
throw new Error("Cannot use more than one PDFWorker per port.");
|
|
10022
|
-
Y(ve, ie).set(e, this), Rt(this,
|
|
10022
|
+
Y(ve, ie).set(e, this), Rt(this, Et, Gi).call(this, e);
|
|
10023
10023
|
} else
|
|
10024
|
-
Rt(this,
|
|
10024
|
+
Rt(this, Et, ji).call(this);
|
|
10025
10025
|
}
|
|
10026
10026
|
get promise() {
|
|
10027
10027
|
return Y(this, Vt).promise;
|
|
@@ -10057,16 +10057,16 @@ const rt = class ve {
|
|
|
10057
10057
|
)).WorkerMessageHandler)());
|
|
10058
10058
|
}
|
|
10059
10059
|
};
|
|
10060
|
-
Vt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /* @__PURE__ */ new WeakMap(), he = /* @__PURE__ */ new WeakMap(), us = /* @__PURE__ */ new WeakMap(), Qt = /* @__PURE__ */ new WeakMap(), ie = /* @__PURE__ */ new WeakMap(),
|
|
10060
|
+
Vt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /* @__PURE__ */ new WeakMap(), he = /* @__PURE__ */ new WeakMap(), us = /* @__PURE__ */ new WeakMap(), Qt = /* @__PURE__ */ new WeakMap(), ie = /* @__PURE__ */ new WeakMap(), Et = /* @__PURE__ */ new WeakSet(), ze = function() {
|
|
10061
10061
|
Y(this, Vt).resolve(), Y(this, Pt).send("configure", {
|
|
10062
10062
|
verbosity: this.verbosity
|
|
10063
10063
|
});
|
|
10064
|
-
},
|
|
10064
|
+
}, Gi = function(d) {
|
|
10065
10065
|
mt(this, Ht, d), mt(this, Pt, new we("main", "worker", d)), Y(this, Pt).on("ready", () => {
|
|
10066
|
-
}), Rt(this,
|
|
10067
|
-
},
|
|
10066
|
+
}), Rt(this, Et, ze).call(this);
|
|
10067
|
+
}, ji = function() {
|
|
10068
10068
|
if (Y(rt, Qt) || Y(rt, xe, qe)) {
|
|
10069
|
-
Rt(this,
|
|
10069
|
+
Rt(this, Et, fe).call(this);
|
|
10070
10070
|
return;
|
|
10071
10071
|
}
|
|
10072
10072
|
let {
|
|
@@ -10077,7 +10077,7 @@ Vt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
|
|
|
10077
10077
|
const t = new Worker(d, {
|
|
10078
10078
|
type: "module"
|
|
10079
10079
|
}), e = new we("main", "worker", t), s = () => {
|
|
10080
|
-
i.abort(), e.destroy(), t.terminate(), this.destroyed ? Y(this, Vt).reject(new Error("Worker was destroyed")) : Rt(this,
|
|
10080
|
+
i.abort(), e.destroy(), t.terminate(), this.destroyed ? Y(this, Vt).reject(new Error("Worker was destroyed")) : Rt(this, Et, fe).call(this);
|
|
10081
10081
|
}, i = new AbortController();
|
|
10082
10082
|
t.addEventListener("error", () => {
|
|
10083
10083
|
Y(this, he) || s();
|
|
@@ -10088,7 +10088,7 @@ Vt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
|
|
|
10088
10088
|
s();
|
|
10089
10089
|
return;
|
|
10090
10090
|
}
|
|
10091
|
-
mt(this, Pt, e), mt(this, Ht, t), mt(this, he, t), Rt(this,
|
|
10091
|
+
mt(this, Pt, e), mt(this, Ht, t), mt(this, he, t), Rt(this, Et, ze).call(this);
|
|
10092
10092
|
}), e.on("ready", (r) => {
|
|
10093
10093
|
if (i.abort(), this.destroyed) {
|
|
10094
10094
|
s();
|
|
@@ -10097,7 +10097,7 @@ Vt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
|
|
|
10097
10097
|
try {
|
|
10098
10098
|
n();
|
|
10099
10099
|
} catch {
|
|
10100
|
-
Rt(this,
|
|
10100
|
+
Rt(this, Et, fe).call(this);
|
|
10101
10101
|
}
|
|
10102
10102
|
});
|
|
10103
10103
|
const n = () => {
|
|
@@ -10109,7 +10109,7 @@ Vt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
|
|
|
10109
10109
|
} catch {
|
|
10110
10110
|
Qe("The worker has been disabled.");
|
|
10111
10111
|
}
|
|
10112
|
-
Rt(this,
|
|
10112
|
+
Rt(this, Et, fe).call(this);
|
|
10113
10113
|
}, fe = function() {
|
|
10114
10114
|
Y(rt, Qt) || (R("Setting up fake worker."), mt(rt, Qt, !0)), rt._setupFakeWorkerGlobal.then((d) => {
|
|
10115
10115
|
if (this.destroyed) {
|
|
@@ -10119,7 +10119,7 @@ Vt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
|
|
|
10119
10119
|
const t = new $n();
|
|
10120
10120
|
mt(this, Ht, t);
|
|
10121
10121
|
const e = `fake${nn(rt, us)._++}`, s = new we(e + "_worker", e, t);
|
|
10122
|
-
d.setup(s, t), mt(this, Pt, new we(e, e + "_worker", t)), Rt(this,
|
|
10122
|
+
d.setup(s, t), mt(this, Pt, new we(e, e + "_worker", t)), Rt(this, Et, ze).call(this);
|
|
10123
10123
|
}).catch((d) => {
|
|
10124
10124
|
Y(this, Vt).reject(new Error(`Setting up fake worker failed: "${d.message}".`));
|
|
10125
10125
|
});
|
|
@@ -10145,7 +10145,7 @@ Vt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
|
|
|
10145
10145
|
throw new Error("PDFWorker.fromPort - invalid method signature.");
|
|
10146
10146
|
return rt.create(d);
|
|
10147
10147
|
};
|
|
10148
|
-
let
|
|
10148
|
+
let Es = rt;
|
|
10149
10149
|
class Ir {
|
|
10150
10150
|
#t = /* @__PURE__ */ new Map();
|
|
10151
10151
|
#e = /* @__PURE__ */ new Map();
|
|
@@ -10334,7 +10334,7 @@ class Ir {
|
|
|
10334
10334
|
R(`Error during font loading: ${c}`), this.commonObjs.resolve(s, c);
|
|
10335
10335
|
break;
|
|
10336
10336
|
}
|
|
10337
|
-
const r = new
|
|
10337
|
+
const r = new G(n), a = this._params.pdfBug && globalThis.FontInspector?.enabled ? (c, u) => globalThis.FontInspector.fontAdded(c, u) : null, o = new Ln(r, a, n.extra, n.charProcOperatorList);
|
|
10338
10338
|
this.fontLoader.bind(o).catch(() => t.sendWithPromise("FontFallback", {
|
|
10339
10339
|
id: s
|
|
10340
10340
|
})).finally(() => {
|
|
@@ -10903,7 +10903,7 @@ class Fr {
|
|
|
10903
10903
|
return this._createSVG(t);
|
|
10904
10904
|
}
|
|
10905
10905
|
_createSVG(t) {
|
|
10906
|
-
|
|
10906
|
+
j("Abstract method `_createSVG` called.");
|
|
10907
10907
|
}
|
|
10908
10908
|
}
|
|
10909
10909
|
class Xe extends Fr {
|
|
@@ -10926,13 +10926,13 @@ class ps {
|
|
|
10926
10926
|
case "Btn":
|
|
10927
10927
|
return t.data.radioButton ? new qi(t) : t.data.checkBox ? new Ur(t) : new Vr(t);
|
|
10928
10928
|
case "Ch":
|
|
10929
|
-
return new
|
|
10929
|
+
return new Gr(t);
|
|
10930
10930
|
case "Sig":
|
|
10931
10931
|
return new zr(t);
|
|
10932
10932
|
}
|
|
10933
10933
|
return new Yt(t);
|
|
10934
10934
|
case it.POPUP:
|
|
10935
|
-
return new
|
|
10935
|
+
return new Ss(t);
|
|
10936
10936
|
case it.FREETEXT:
|
|
10937
10937
|
return new Xi(t);
|
|
10938
10938
|
case it.LINE:
|
|
@@ -11116,7 +11116,7 @@ class K {
|
|
|
11116
11116
|
const {
|
|
11117
11117
|
style: r
|
|
11118
11118
|
} = n;
|
|
11119
|
-
if (r.zIndex = this.parent.zIndex, this.parent.zIndex += 2, e.alternativeText && (n.title = e.alternativeText), e.noRotate && n.classList.add("norotate"), !e.rect || this instanceof
|
|
11119
|
+
if (r.zIndex = this.parent.zIndex, this.parent.zIndex += 2, e.alternativeText && (n.title = e.alternativeText), e.noRotate && n.classList.add("norotate"), !e.rect || this instanceof Ss) {
|
|
11120
11120
|
const {
|
|
11121
11121
|
rotation: g
|
|
11122
11122
|
} = e;
|
|
@@ -11311,8 +11311,8 @@ class K {
|
|
|
11311
11311
|
const p = l.createElement("clipPath"), f = `clippath_${this.data.id}`;
|
|
11312
11312
|
p.setAttribute("id", f), p.setAttribute("clipPathUnits", "objectBoundingBox"), u.append(p);
|
|
11313
11313
|
for (let g = 2, b = t.length; g < b; g += 8) {
|
|
11314
|
-
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,
|
|
11315
|
-
A.setAttribute("x", x), A.setAttribute("y", _), A.setAttribute("width",
|
|
11314
|
+
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;
|
|
11315
|
+
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}"/>`);
|
|
11316
11316
|
}
|
|
11317
11317
|
this.#e && (a.push("</g></svg>')"), r.backgroundImage = a.join("")), this.container.append(c), this.container.style.clipPath = `url(#${f})`;
|
|
11318
11318
|
}
|
|
@@ -11323,7 +11323,7 @@ class K {
|
|
|
11323
11323
|
let s, i;
|
|
11324
11324
|
t ? (s = {
|
|
11325
11325
|
str: t.text
|
|
11326
|
-
}, i = t.date) : (s = e.contentsObj, i = e.modificationDate), this.#i = new
|
|
11326
|
+
}, i = t.date) : (s = e.contentsObj, i = e.modificationDate), this.#i = new Ss({
|
|
11327
11327
|
data: {
|
|
11328
11328
|
color: e.color,
|
|
11329
11329
|
titleObj: e.titleObj,
|
|
@@ -11348,7 +11348,7 @@ class K {
|
|
|
11348
11348
|
return this.#i;
|
|
11349
11349
|
}
|
|
11350
11350
|
render() {
|
|
11351
|
-
|
|
11351
|
+
j("Abstract method `AnnotationElement.render` called");
|
|
11352
11352
|
}
|
|
11353
11353
|
_getElementsByName(t, e = null) {
|
|
11354
11354
|
const s = [];
|
|
@@ -12027,7 +12027,7 @@ class Vr extends Hs {
|
|
|
12027
12027
|
})), t;
|
|
12028
12028
|
}
|
|
12029
12029
|
}
|
|
12030
|
-
class
|
|
12030
|
+
class Gr extends Yt {
|
|
12031
12031
|
constructor(t) {
|
|
12032
12032
|
super(t, {
|
|
12033
12033
|
isRenderable: t.renderForms
|
|
@@ -12166,7 +12166,7 @@ class jr extends Yt {
|
|
|
12166
12166
|
}), this.data.combo && this._setTextStyle(i), this._setBackgroundColor(i), this._setDefaultPropertiesFromJS(i), this.container.append(i), this.container;
|
|
12167
12167
|
}
|
|
12168
12168
|
}
|
|
12169
|
-
class
|
|
12169
|
+
class Ss extends K {
|
|
12170
12170
|
constructor(t) {
|
|
12171
12171
|
const {
|
|
12172
12172
|
data: e,
|
|
@@ -12183,7 +12183,7 @@ class Es extends K {
|
|
|
12183
12183
|
this.popup = null;
|
|
12184
12184
|
}
|
|
12185
12185
|
#t() {
|
|
12186
|
-
return new
|
|
12186
|
+
return new jr({
|
|
12187
12187
|
container: this.container,
|
|
12188
12188
|
color: this.data.color,
|
|
12189
12189
|
titleObj: this.data.titleObj,
|
|
@@ -12209,9 +12209,9 @@ class Es extends K {
|
|
|
12209
12209
|
return this.container.setAttribute("aria-controls", s.map((i) => `${ee}${i}`).join(",")), this.container;
|
|
12210
12210
|
}
|
|
12211
12211
|
}
|
|
12212
|
-
class
|
|
12212
|
+
class jr {
|
|
12213
12213
|
#t = null;
|
|
12214
|
-
#e = this.#
|
|
12214
|
+
#e = this.#G.bind(this);
|
|
12215
12215
|
#i = this.#H.bind(this);
|
|
12216
12216
|
#s = this.#R.bind(this);
|
|
12217
12217
|
#a = this.#x.bind(this);
|
|
@@ -12230,12 +12230,12 @@ class Gr {
|
|
|
12230
12230
|
#b = null;
|
|
12231
12231
|
#w = null;
|
|
12232
12232
|
#y = null;
|
|
12233
|
-
#
|
|
12233
|
+
#S = null;
|
|
12234
12234
|
#_ = null;
|
|
12235
12235
|
#A = null;
|
|
12236
12236
|
#T = !1;
|
|
12237
12237
|
#v = null;
|
|
12238
|
-
#
|
|
12238
|
+
#E = null;
|
|
12239
12239
|
constructor({
|
|
12240
12240
|
container: t,
|
|
12241
12241
|
color: e,
|
|
@@ -12250,7 +12250,7 @@ class Gr {
|
|
|
12250
12250
|
open: c,
|
|
12251
12251
|
commentManager: u = null
|
|
12252
12252
|
}) {
|
|
12253
|
-
this.#n = t, this.#_ = i, this.#o = r, this.#
|
|
12253
|
+
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 = bs.toDateObject(n), this.trigger = s.flatMap((p) => p.getElementsToTriggerPopup()), u || (this.#k(), this.#n.hidden = !0, c && this.#x());
|
|
12254
12254
|
}
|
|
12255
12255
|
#k() {
|
|
12256
12256
|
if (this.#f)
|
|
@@ -12366,10 +12366,10 @@ class Gr {
|
|
|
12366
12366
|
return this.#g;
|
|
12367
12367
|
}
|
|
12368
12368
|
get comment() {
|
|
12369
|
-
return this.#
|
|
12369
|
+
return this.#E ||= this.#v.commentText, this.#E;
|
|
12370
12370
|
}
|
|
12371
12371
|
set comment(t) {
|
|
12372
|
-
t !== this.comment && (this.#v.commentText = this.#
|
|
12372
|
+
t !== this.comment && (this.#v.commentText = this.#E = t);
|
|
12373
12373
|
}
|
|
12374
12374
|
focus() {
|
|
12375
12375
|
this.#v.container?.focus();
|
|
@@ -12447,15 +12447,15 @@ class Gr {
|
|
|
12447
12447
|
dateObj: this.#l.valueOf()
|
|
12448
12448
|
})), s.dateTime = this.#l.toISOString(), e.append(s);
|
|
12449
12449
|
}
|
|
12450
|
-
|
|
12450
|
+
Si({
|
|
12451
12451
|
html: this.#I || this.#o.str,
|
|
12452
12452
|
dir: this.#o?.dir,
|
|
12453
12453
|
className: "popupContent"
|
|
12454
12454
|
}, t), this.#n.append(t);
|
|
12455
12455
|
}
|
|
12456
12456
|
get #I() {
|
|
12457
|
-
const t = this.#
|
|
12458
|
-
return t?.str && (!e?.str || e.str === t.str) && this.#
|
|
12457
|
+
const t = this.#S, e = this.#o;
|
|
12458
|
+
return t?.str && (!e?.str || e.str === t.str) && this.#S.html || null;
|
|
12459
12459
|
}
|
|
12460
12460
|
get #L() {
|
|
12461
12461
|
return this.#I?.attributes?.style?.fontSize || 0;
|
|
@@ -12491,7 +12491,7 @@ class Gr {
|
|
|
12491
12491
|
});
|
|
12492
12492
|
return s;
|
|
12493
12493
|
}
|
|
12494
|
-
#
|
|
12494
|
+
#G(t) {
|
|
12495
12495
|
t.altKey || t.shiftKey || t.ctrlKey || t.metaKey || (t.key === "Enter" || t.key === "Escape" && this.#p) && this.#x();
|
|
12496
12496
|
}
|
|
12497
12497
|
updateEdited({
|
|
@@ -12500,7 +12500,7 @@ class Gr {
|
|
|
12500
12500
|
deleted: s
|
|
12501
12501
|
}) {
|
|
12502
12502
|
if (this.#t) {
|
|
12503
|
-
s ? (this.remove(), this.#
|
|
12503
|
+
s ? (this.remove(), this.#E = null) : e && (e.deleted ? this.remove() : (this.#O(), this.#E = e.text)), t && (this.#b = null, this.#M(), this.#P());
|
|
12504
12504
|
return;
|
|
12505
12505
|
}
|
|
12506
12506
|
if (s || e?.deleted) {
|
|
@@ -12509,13 +12509,13 @@ class Gr {
|
|
|
12509
12509
|
}
|
|
12510
12510
|
this.#k(), this.#A ||= {
|
|
12511
12511
|
contentsObj: this.#o,
|
|
12512
|
-
richText: this.#
|
|
12513
|
-
}, t && (this.#c = null), e && e.text && (this.#
|
|
12512
|
+
richText: this.#S
|
|
12513
|
+
}, t && (this.#c = null), e && e.text && (this.#S = this.#F(e.text), this.#l = bs.toDateObject(e.date), this.#o = null), this.#m?.remove(), this.#m = null;
|
|
12514
12514
|
}
|
|
12515
12515
|
resetEdited() {
|
|
12516
12516
|
this.#A && ({
|
|
12517
12517
|
contentsObj: this.#o,
|
|
12518
|
-
richText: this.#
|
|
12518
|
+
richText: this.#S
|
|
12519
12519
|
} = this.#A, this.#A = null, this.#m?.remove(), this.#m = null, this.#c = null);
|
|
12520
12520
|
}
|
|
12521
12521
|
remove() {
|
|
@@ -12975,7 +12975,7 @@ class zs {
|
|
|
12975
12975
|
const {
|
|
12976
12976
|
annotations: e
|
|
12977
12977
|
} = t, s = this.div;
|
|
12978
|
-
|
|
12978
|
+
jt(s, this.viewport);
|
|
12979
12979
|
const i = /* @__PURE__ */ new Map(), n = [], r = {
|
|
12980
12980
|
data: null,
|
|
12981
12981
|
layer: s,
|
|
@@ -13098,7 +13098,7 @@ class zs {
|
|
|
13098
13098
|
viewport: t
|
|
13099
13099
|
}) {
|
|
13100
13100
|
const e = this.div;
|
|
13101
|
-
this.viewport = t,
|
|
13101
|
+
this.viewport = t, jt(e, {
|
|
13102
13102
|
rotation: t.rotation
|
|
13103
13103
|
}), this.#h(), e.hidden = !1;
|
|
13104
13104
|
}
|
|
@@ -13637,13 +13637,13 @@ class ht extends D {
|
|
|
13637
13637
|
class M {
|
|
13638
13638
|
static PRECISION = 1e-4;
|
|
13639
13639
|
toSVGPath() {
|
|
13640
|
-
|
|
13640
|
+
j("Abstract method `toSVGPath` must be implemented.");
|
|
13641
13641
|
}
|
|
13642
13642
|
get box() {
|
|
13643
|
-
|
|
13643
|
+
j("Abstract getter `box` must be implemented.");
|
|
13644
13644
|
}
|
|
13645
13645
|
serialize(t, e) {
|
|
13646
|
-
|
|
13646
|
+
j("Abstract method `serialize` must be implemented.");
|
|
13647
13647
|
}
|
|
13648
13648
|
static _rescale(t, e, s, i, n, r) {
|
|
13649
13649
|
r ||= new Float32Array(t.length);
|
|
@@ -13694,7 +13694,7 @@ class M {
|
|
|
13694
13694
|
return [(t + 5 * s) / 6, (e + 5 * i) / 6, (5 * s + n) / 6, (5 * i + r) / 6, (s + n) / 2, (i + r) / 2];
|
|
13695
13695
|
}
|
|
13696
13696
|
}
|
|
13697
|
-
class
|
|
13697
|
+
class Gt {
|
|
13698
13698
|
#t;
|
|
13699
13699
|
#e = [];
|
|
13700
13700
|
#i;
|
|
@@ -13710,12 +13710,12 @@ class jt {
|
|
|
13710
13710
|
#p = [];
|
|
13711
13711
|
static #m = 8;
|
|
13712
13712
|
static #f = 2;
|
|
13713
|
-
static #c =
|
|
13713
|
+
static #c = Gt.#m + Gt.#f;
|
|
13714
13714
|
constructor({
|
|
13715
13715
|
x: t,
|
|
13716
13716
|
y: e
|
|
13717
13717
|
}, s, i, n, r, a = 0) {
|
|
13718
|
-
this.#t = s, this.#d = n * i, this.#s = r, this.#r.set([NaN, NaN, NaN, NaN, t, e], 6), this.#i = a, this.#h =
|
|
13718
|
+
this.#t = s, this.#d = n * i, this.#s = r, this.#r.set([NaN, NaN, NaN, NaN, t, e], 6), this.#i = a, this.#h = Gt.#m * i, this.#l = Gt.#c * i, this.#u = i, this.#p.push(t, e);
|
|
13719
13719
|
}
|
|
13720
13720
|
isEmpty() {
|
|
13721
13721
|
return isNaN(this.#r[8]);
|
|
@@ -13775,7 +13775,7 @@ class jt {
|
|
|
13775
13775
|
for (let c = 0, u = o.length - 2; c < u; c += 2)
|
|
13776
13776
|
o[c] = (this.#p[c] - i) / r, o[c + 1] = (this.#p[c + 1] - n) / a;
|
|
13777
13777
|
if (o[o.length - 2] = (this.#n - i) / r, o[o.length - 1] = (this.#o - n) / a, isNaN(s[6]) && !this.isEmpty())
|
|
13778
|
-
return this.#
|
|
13778
|
+
return this.#S(o);
|
|
13779
13779
|
const h = new Float32Array(this.#a.length + 24 + this.#e.length);
|
|
13780
13780
|
let l = t.length;
|
|
13781
13781
|
for (let c = 0; c < l; c += 2) {
|
|
@@ -13796,7 +13796,7 @@ class jt {
|
|
|
13796
13796
|
}
|
|
13797
13797
|
return this.#_(h, l), this.newFreeDrawOutline(h, o, this.#t, this.#u, this.#i, this.#s);
|
|
13798
13798
|
}
|
|
13799
|
-
#
|
|
13799
|
+
#S(t) {
|
|
13800
13800
|
const e = this.#r, [s, i, n, r] = this.#t, [a, o, h, l] = this.#g(), c = new Float32Array(36);
|
|
13801
13801
|
return c.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(c, t, this.#t, this.#u, this.#i, this.#s);
|
|
13802
13802
|
}
|
|
@@ -13875,7 +13875,7 @@ class Ji extends M {
|
|
|
13875
13875
|
return this.#e;
|
|
13876
13876
|
}
|
|
13877
13877
|
newOutliner(t, e, s, i, n, r = 0) {
|
|
13878
|
-
return new
|
|
13878
|
+
return new Gt(t, e, s, i, n, r);
|
|
13879
13879
|
}
|
|
13880
13880
|
getNewOutline(t, e) {
|
|
13881
13881
|
const [s, i, n, r] = this.#e, [a, o, h, l] = this.#t, c = n * h, u = r * l, p = s * h + a, f = i * l + o, g = this.newOutliner({
|
|
@@ -13904,8 +13904,8 @@ class Cs {
|
|
|
13904
13904
|
width: m,
|
|
13905
13905
|
height: w
|
|
13906
13906
|
} of t) {
|
|
13907
|
-
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],
|
|
13908
|
-
this.#s.push(_,
|
|
13907
|
+
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];
|
|
13908
|
+
this.#s.push(_, E), T.rectBoundingBox(y, A, v, x, n);
|
|
13909
13909
|
}
|
|
13910
13910
|
const a = n[2] - n[0] + 2 * s, o = n[3] - n[1] + 2 * s, h = n[0] - s, l = n[1] - s;
|
|
13911
13911
|
let c = i ? -1 / 0 : 1 / 0, u = 1 / 0;
|
|
@@ -14051,7 +14051,7 @@ class ea extends M {
|
|
|
14051
14051
|
return ["highlightOutline"];
|
|
14052
14052
|
}
|
|
14053
14053
|
}
|
|
14054
|
-
class Ts extends
|
|
14054
|
+
class Ts extends Gt {
|
|
14055
14055
|
newFreeDrawOutline(t, e, s, i, n, r) {
|
|
14056
14056
|
return new sa(t, e, s, i, n, r);
|
|
14057
14057
|
}
|
|
@@ -14166,12 +14166,12 @@ class J extends D {
|
|
|
14166
14166
|
else if (this.parent) {
|
|
14167
14167
|
const c = this.parent.viewport.rotation;
|
|
14168
14168
|
this.parent.drawLayer.updateProperties(this.#u, {
|
|
14169
|
-
bbox: J.#
|
|
14169
|
+
bbox: J.#E(this.#h.box, (c - this.rotation + 360) % 360),
|
|
14170
14170
|
path: {
|
|
14171
14171
|
d: t.toSVGPath()
|
|
14172
14172
|
}
|
|
14173
14173
|
}), this.parent.drawLayer.updateProperties(this.#f, {
|
|
14174
|
-
bbox: J.#
|
|
14174
|
+
bbox: J.#E(this.#r.box, c),
|
|
14175
14175
|
path: {
|
|
14176
14176
|
d: this.#r.toSVGPath()
|
|
14177
14177
|
}
|
|
@@ -14229,7 +14229,7 @@ class J extends D {
|
|
|
14229
14229
|
updateParams(t, e) {
|
|
14230
14230
|
switch (t) {
|
|
14231
14231
|
case O.HIGHLIGHT_COLOR:
|
|
14232
|
-
this.#
|
|
14232
|
+
this.#S(e);
|
|
14233
14233
|
break;
|
|
14234
14234
|
case O.HIGHLIGHT_THICKNESS:
|
|
14235
14235
|
this.#_(e);
|
|
@@ -14250,7 +14250,7 @@ class J extends D {
|
|
|
14250
14250
|
}
|
|
14251
14251
|
}), this.#a?.updateColor(this.color), super.onUpdatedColor();
|
|
14252
14252
|
}
|
|
14253
|
-
#
|
|
14253
|
+
#S(t) {
|
|
14254
14254
|
const e = (n, r) => {
|
|
14255
14255
|
this.color = n, this.opacity = r, this.onUpdatedColor();
|
|
14256
14256
|
}, s = this.color, i = this.opacity;
|
|
@@ -14356,7 +14356,7 @@ class J extends D {
|
|
|
14356
14356
|
}
|
|
14357
14357
|
}, this.#d), this.#l && (this.#l.style.clipPath = this.#s));
|
|
14358
14358
|
}
|
|
14359
|
-
static #
|
|
14359
|
+
static #E([t, e, s, i], n) {
|
|
14360
14360
|
switch (n) {
|
|
14361
14361
|
case 90:
|
|
14362
14362
|
return [1 - e - i, t, i, s];
|
|
@@ -14372,13 +14372,13 @@ class J extends D {
|
|
|
14372
14372
|
drawLayer: e
|
|
14373
14373
|
} = this.parent;
|
|
14374
14374
|
let s;
|
|
14375
|
-
this.#d ? (t = (t - this.rotation + 360) % 360, s = J.#
|
|
14375
|
+
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, {
|
|
14376
14376
|
bbox: s,
|
|
14377
14377
|
root: {
|
|
14378
14378
|
"data-main-rotation": t
|
|
14379
14379
|
}
|
|
14380
14380
|
}), e.updateProperties(this.#f, {
|
|
14381
|
-
bbox: J.#
|
|
14381
|
+
bbox: J.#E(this.#r.box, t),
|
|
14382
14382
|
root: {
|
|
14383
14383
|
"data-main-rotation": t
|
|
14384
14384
|
}
|
|
@@ -14557,11 +14557,11 @@ class J extends D {
|
|
|
14557
14557
|
richText: A,
|
|
14558
14558
|
contentsObj: x,
|
|
14559
14559
|
creationDate: _,
|
|
14560
|
-
modificationDate:
|
|
14560
|
+
modificationDate: E
|
|
14561
14561
|
},
|
|
14562
14562
|
parent: {
|
|
14563
14563
|
page: {
|
|
14564
|
-
pageNumber:
|
|
14564
|
+
pageNumber: S
|
|
14565
14565
|
}
|
|
14566
14566
|
}
|
|
14567
14567
|
} = t;
|
|
@@ -14571,7 +14571,7 @@ class J extends D {
|
|
|
14571
14571
|
opacity: y,
|
|
14572
14572
|
quadPoints: f,
|
|
14573
14573
|
boxes: null,
|
|
14574
|
-
pageIndex:
|
|
14574
|
+
pageIndex: S - 1,
|
|
14575
14575
|
rect: g.slice(0),
|
|
14576
14576
|
rotation: b,
|
|
14577
14577
|
annotationElementId: m,
|
|
@@ -14581,7 +14581,7 @@ class J extends D {
|
|
|
14581
14581
|
richText: A,
|
|
14582
14582
|
comment: x?.str || null,
|
|
14583
14583
|
creationDate: _,
|
|
14584
|
-
modificationDate:
|
|
14584
|
+
modificationDate: E
|
|
14585
14585
|
};
|
|
14586
14586
|
} else if (t instanceof $s) {
|
|
14587
14587
|
const {
|
|
@@ -14598,11 +14598,11 @@ class J extends D {
|
|
|
14598
14598
|
richText: A,
|
|
14599
14599
|
contentsObj: x,
|
|
14600
14600
|
creationDate: _,
|
|
14601
|
-
modificationDate:
|
|
14601
|
+
modificationDate: E
|
|
14602
14602
|
},
|
|
14603
14603
|
parent: {
|
|
14604
14604
|
page: {
|
|
14605
|
-
pageNumber:
|
|
14605
|
+
pageNumber: S
|
|
14606
14606
|
}
|
|
14607
14607
|
}
|
|
14608
14608
|
} = t;
|
|
@@ -14612,7 +14612,7 @@ class J extends D {
|
|
|
14612
14612
|
thickness: y,
|
|
14613
14613
|
inkLists: f,
|
|
14614
14614
|
boxes: null,
|
|
14615
|
-
pageIndex:
|
|
14615
|
+
pageIndex: S - 1,
|
|
14616
14616
|
rect: g.slice(0),
|
|
14617
14617
|
rotation: b,
|
|
14618
14618
|
annotationElementId: m,
|
|
@@ -14622,7 +14622,7 @@ class J extends D {
|
|
|
14622
14622
|
richText: A,
|
|
14623
14623
|
comment: x?.str || null,
|
|
14624
14624
|
creationDate: _,
|
|
14625
|
-
modificationDate:
|
|
14625
|
+
modificationDate: E
|
|
14626
14626
|
};
|
|
14627
14627
|
}
|
|
14628
14628
|
const {
|
|
@@ -14733,7 +14733,7 @@ class Zi {
|
|
|
14733
14733
|
this.updateProperties(t);
|
|
14734
14734
|
}
|
|
14735
14735
|
clone() {
|
|
14736
|
-
|
|
14736
|
+
j("Not implemented");
|
|
14737
14737
|
}
|
|
14738
14738
|
}
|
|
14739
14739
|
class $ extends D {
|
|
@@ -14776,10 +14776,10 @@ class $ extends D {
|
|
|
14776
14776
|
return t;
|
|
14777
14777
|
}
|
|
14778
14778
|
static getDefaultDrawingOptions(t) {
|
|
14779
|
-
|
|
14779
|
+
j("Not implemented");
|
|
14780
14780
|
}
|
|
14781
14781
|
static get typesMap() {
|
|
14782
|
-
|
|
14782
|
+
j("Not implemented");
|
|
14783
14783
|
}
|
|
14784
14784
|
static get isDrawer() {
|
|
14785
14785
|
return !0;
|
|
@@ -15004,7 +15004,7 @@ class $ extends D {
|
|
|
15004
15004
|
return s.append(i), i.setAttribute("aria-hidden", "true"), i.className = "internal", this.setDims(), this._uiManager.addShouldRescale(this), this.disableEditing(), this._isCopy && this._moveAfterPaste(t, e), s;
|
|
15005
15005
|
}
|
|
15006
15006
|
static createDrawerInstance(t, e, s, i, n) {
|
|
15007
|
-
|
|
15007
|
+
j("Not implemented");
|
|
15008
15008
|
}
|
|
15009
15009
|
static startDrawing(t, e, s, i) {
|
|
15010
15010
|
const {
|
|
@@ -15117,7 +15117,7 @@ class $ extends D {
|
|
|
15117
15117
|
createDrawingOptions(t) {
|
|
15118
15118
|
}
|
|
15119
15119
|
static deserializeDraw(t, e, s, i, n, r) {
|
|
15120
|
-
|
|
15120
|
+
j("Not implemented");
|
|
15121
15121
|
}
|
|
15122
15122
|
static async deserialize(t, e, s) {
|
|
15123
15123
|
const {
|
|
@@ -15388,9 +15388,9 @@ class Re extends M {
|
|
|
15388
15388
|
r.push(y);
|
|
15389
15389
|
let [v, A, x, _] = m.subarray(0, 4);
|
|
15390
15390
|
y.set([NaN, NaN, NaN, NaN, v, A], 0);
|
|
15391
|
-
for (let
|
|
15392
|
-
const
|
|
15393
|
-
y.set(M.createBezierPoints(v, A, x, _,
|
|
15391
|
+
for (let E = 4; E < w; E += 2) {
|
|
15392
|
+
const S = m[E], P = m[E + 1];
|
|
15393
|
+
y.set(M.createBezierPoints(v, A, x, _, S, P), (E - 2) * 3), [v, A, x, _] = [x, _, S, P];
|
|
15394
15394
|
}
|
|
15395
15395
|
}
|
|
15396
15396
|
}
|
|
@@ -15857,20 +15857,20 @@ class te {
|
|
|
15857
15857
|
continue;
|
|
15858
15858
|
}
|
|
15859
15859
|
let A = this.#i[2 * v], x = this.#i[2 * v + 1];
|
|
15860
|
-
const _ = l + A,
|
|
15861
|
-
f = _, g =
|
|
15862
|
-
let
|
|
15860
|
+
const _ = l + A, E = c + x;
|
|
15861
|
+
f = _, g = E;
|
|
15862
|
+
let S = l, P = c;
|
|
15863
15863
|
for (; ; ) {
|
|
15864
|
-
const C = this.#a(r, e,
|
|
15864
|
+
const C = this.#a(r, e, S, P, f, g, 1);
|
|
15865
15865
|
A = this.#i[2 * C], x = this.#i[2 * C + 1];
|
|
15866
|
-
const H =
|
|
15866
|
+
const H = S + A, V = P + x;
|
|
15867
15867
|
b.push(V, H);
|
|
15868
|
-
const N =
|
|
15869
|
-
if (r[N + 1] === 0 ? r[N] = -a : r[N] === 1 && (r[N] = a), H === l && V === c &&
|
|
15868
|
+
const N = S * e + P;
|
|
15869
|
+
if (r[N + 1] === 0 ? r[N] = -a : r[N] === 1 && (r[N] = a), H === l && V === c && S === _ && P === E) {
|
|
15870
15870
|
r[u] !== 1 && (o = Math.abs(r[u]));
|
|
15871
15871
|
break;
|
|
15872
15872
|
} else
|
|
15873
|
-
f =
|
|
15873
|
+
f = S, g = P, S = H, P = V;
|
|
15874
15874
|
}
|
|
15875
15875
|
}
|
|
15876
15876
|
}
|
|
@@ -15885,8 +15885,8 @@ class te {
|
|
|
15885
15885
|
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, c = o / h, u = l * r - c * 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));
|
|
15886
15886
|
let A = 0, x = e;
|
|
15887
15887
|
for (let _ = e + 2; _ < s - 2; _ += 2) {
|
|
15888
|
-
const
|
|
15889
|
-
|
|
15888
|
+
const E = Math.abs(u - l * t[_ + 1] + c * t[_]);
|
|
15889
|
+
E > A && (x = _, A = E);
|
|
15890
15890
|
}
|
|
15891
15891
|
A > (h * v) ** 2 ? (this.#n(t, e, x + 2, i), this.#n(t, x, s, i)) : i.push(n, r);
|
|
15892
15892
|
}
|
|
@@ -15912,11 +15912,11 @@ class te {
|
|
|
15912
15912
|
for (let x = 0; x < r; x++) {
|
|
15913
15913
|
const _ = g + x - h;
|
|
15914
15914
|
if (!(_ < 0 || _ >= s))
|
|
15915
|
-
for (let
|
|
15916
|
-
const
|
|
15917
|
-
if (
|
|
15915
|
+
for (let E = 0; E < r; E++) {
|
|
15916
|
+
const S = b + E - h;
|
|
15917
|
+
if (S < 0 || S >= e)
|
|
15918
15918
|
continue;
|
|
15919
|
-
const P = t[_ * e +
|
|
15919
|
+
const P = t[_ * e + S], C = a[x * r + E] * l[Math.abs(P - w)];
|
|
15920
15920
|
y += P * C, v += C;
|
|
15921
15921
|
}
|
|
15922
15922
|
}
|
|
@@ -16003,7 +16003,7 @@ class te {
|
|
|
16003
16003
|
alpha: !0,
|
|
16004
16004
|
willReadFrequently: !0
|
|
16005
16005
|
}), 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);
|
|
16006
|
-
const _ = this.#u(l.getImageData(0, 0, A, x).data),
|
|
16006
|
+
const _ = this.#u(l.getImageData(0, 0, A, x).data), E = this.#h(_), S = this.#d(E), P = this.#r(_, A, x, S);
|
|
16007
16007
|
return this.processDrawnLines({
|
|
16008
16008
|
lines: {
|
|
16009
16009
|
curves: P,
|
|
@@ -16064,11 +16064,11 @@ class te {
|
|
|
16064
16064
|
A[0] = y[0] * f, A[1] = y[1] * g, x.set([NaN, NaN, NaN, NaN, A[0], A[1]], 0);
|
|
16065
16065
|
continue;
|
|
16066
16066
|
}
|
|
16067
|
-
let [_,
|
|
16068
|
-
_ *= f,
|
|
16067
|
+
let [_, E, S, P] = y;
|
|
16068
|
+
_ *= f, E *= g, S *= f, P *= g, A.set([_, E, S, P], 0), x.set([NaN, NaN, NaN, NaN, _, E], 0);
|
|
16069
16069
|
for (let C = 4; C < v; C += 2) {
|
|
16070
16070
|
const H = A[C] = y[C] * f, V = A[C + 1] = y[C + 1] * g;
|
|
16071
|
-
x.set(M.createBezierPoints(_,
|
|
16071
|
+
x.set(M.createBezierPoints(_, E, S, P, H, V), (C - 2) * 3), [_, E, S, P] = [S, P, H, V];
|
|
16072
16072
|
}
|
|
16073
16073
|
}
|
|
16074
16074
|
if (u.length === 0)
|
|
@@ -16180,7 +16180,7 @@ class Vs extends Zi {
|
|
|
16180
16180
|
return t.updateAll(this), t;
|
|
16181
16181
|
}
|
|
16182
16182
|
}
|
|
16183
|
-
class
|
|
16183
|
+
class Gs extends es {
|
|
16184
16184
|
constructor(t) {
|
|
16185
16185
|
super(t), super.updateProperties({
|
|
16186
16186
|
stroke: D._defaultLineColor,
|
|
@@ -16188,7 +16188,7 @@ class js extends es {
|
|
|
16188
16188
|
});
|
|
16189
16189
|
}
|
|
16190
16190
|
clone() {
|
|
16191
|
-
const t = new
|
|
16191
|
+
const t = new Gs(this._viewParameters);
|
|
16192
16192
|
return t.updateAll(this), t;
|
|
16193
16193
|
}
|
|
16194
16194
|
}
|
|
@@ -16208,7 +16208,7 @@ class Tt extends $ {
|
|
|
16208
16208
|
}), this._willKeepAspectRatio = !0, this.#i = t.signatureData || null, this.#e = null, this.defaultL10nId = "pdfjs-editor-signature-editor1";
|
|
16209
16209
|
}
|
|
16210
16210
|
static initialize(t, e) {
|
|
16211
|
-
D.initialize(t, e), this._defaultDrawingOptions = new Vs(), this._defaultDrawnSignatureOptions = new
|
|
16211
|
+
D.initialize(t, e), this._defaultDrawingOptions = new Vs(), this._defaultDrawnSignatureOptions = new Gs(e.viewParameters);
|
|
16212
16212
|
}
|
|
16213
16213
|
static getDefaultDrawingOptions(t) {
|
|
16214
16214
|
const e = this._defaultDrawingOptions.clone();
|
|
@@ -16679,7 +16679,7 @@ class na extends D {
|
|
|
16679
16679
|
const f = l.getContext("2d");
|
|
16680
16680
|
f.filter = this._uiManager.hcmFilter;
|
|
16681
16681
|
let g = "white", b = "#cfcfd8";
|
|
16682
|
-
this._uiManager.hcmFilter !== "none" ? b = "black" :
|
|
16682
|
+
this._uiManager.hcmFilter !== "none" ? b = "black" : Sn.isDarkMode && (g = "#8f8f9d", b = "#42414d");
|
|
16683
16683
|
const m = 15, w = m * r.sx, y = m * r.sy, v = new OffscreenCanvas(w * 2, y * 2), A = v.getContext("2d");
|
|
16684
16684
|
A.fillStyle = g, A.fillRect(0, 0, w * 2, y * 2), A.fillStyle = b, A.fillRect(0, 0, w, y), A.fillRect(w, y, w, y), f.fillStyle = f.createPattern(v, "repeat"), f.fillRect(0, 0, u, p), f.drawImage(a, 0, 0, a.width, a.height, 0, 0, u, p);
|
|
16685
16685
|
}
|
|
@@ -16767,10 +16767,10 @@ class na extends D {
|
|
|
16767
16767
|
creationDate: x,
|
|
16768
16768
|
modificationDate: _
|
|
16769
16769
|
},
|
|
16770
|
-
container:
|
|
16770
|
+
container: E,
|
|
16771
16771
|
parent: {
|
|
16772
16772
|
page: {
|
|
16773
|
-
pageNumber:
|
|
16773
|
+
pageNumber: S
|
|
16774
16774
|
}
|
|
16775
16775
|
},
|
|
16776
16776
|
canvas: P
|
|
@@ -16779,13 +16779,13 @@ class na extends D {
|
|
|
16779
16779
|
P ? (delete t.canvas, {
|
|
16780
16780
|
id: C,
|
|
16781
16781
|
bitmap: H
|
|
16782
|
-
} = s.imageManager.getFromCanvas(
|
|
16782
|
+
} = s.imageManager.getFromCanvas(E.id, P), P.remove()) : (n = !0, t._hasNoCanvas = !0);
|
|
16783
16783
|
const V = (await e._structTree.getAriaAttributes(`${ee}${m}`))?.get("aria-label") || "";
|
|
16784
16784
|
i = t = {
|
|
16785
16785
|
annotationType: F.STAMP,
|
|
16786
16786
|
bitmapId: C,
|
|
16787
16787
|
bitmap: H,
|
|
16788
|
-
pageIndex:
|
|
16788
|
+
pageIndex: S - 1,
|
|
16789
16789
|
rect: g.slice(0),
|
|
16790
16790
|
rotation: b,
|
|
16791
16791
|
annotationElementId: m,
|
|
@@ -17196,7 +17196,7 @@ class Lt {
|
|
|
17196
17196
|
combinedSignal(t) {
|
|
17197
17197
|
return this.#c.combinedSignal(t);
|
|
17198
17198
|
}
|
|
17199
|
-
#
|
|
17199
|
+
#S(t) {
|
|
17200
17200
|
const e = this.#y;
|
|
17201
17201
|
return e ? new e.prototype.constructor(t) : null;
|
|
17202
17202
|
}
|
|
@@ -17208,7 +17208,7 @@ class Lt {
|
|
|
17208
17208
|
const {
|
|
17209
17209
|
offsetX: s,
|
|
17210
17210
|
offsetY: i
|
|
17211
|
-
} = this.#_(), n = this.getNextId(), r = this.#
|
|
17211
|
+
} = this.#_(), n = this.getNextId(), r = this.#S({
|
|
17212
17212
|
parent: this,
|
|
17213
17213
|
id: n,
|
|
17214
17214
|
x: s,
|
|
@@ -17223,7 +17223,7 @@ class Lt {
|
|
|
17223
17223
|
return await Lt.#g.get(t.annotationType ?? t.annotationEditorType)?.deserialize(t, this, this.#c) || null;
|
|
17224
17224
|
}
|
|
17225
17225
|
createAndAddNewEditor(t, e, s = {}) {
|
|
17226
|
-
const i = this.getNextId(), n = this.#
|
|
17226
|
+
const i = this.getNextId(), n = this.#S({
|
|
17227
17227
|
parent: this,
|
|
17228
17228
|
id: i,
|
|
17229
17229
|
x: t.offsetX,
|
|
@@ -17350,7 +17350,7 @@ class Lt {
|
|
|
17350
17350
|
render({
|
|
17351
17351
|
viewport: t
|
|
17352
17352
|
}) {
|
|
17353
|
-
this.viewport = t,
|
|
17353
|
+
this.viewport = t, jt(this.div, t);
|
|
17354
17354
|
for (const e of this.#c.getEditors(this.pageIndex))
|
|
17355
17355
|
this.add(e), e.rebuild();
|
|
17356
17356
|
this.updateMode();
|
|
@@ -17360,7 +17360,7 @@ class Lt {
|
|
|
17360
17360
|
}) {
|
|
17361
17361
|
this.#c.commitOrRemove(), this.#A();
|
|
17362
17362
|
const e = this.viewport.rotation, s = t.rotation;
|
|
17363
|
-
if (this.viewport = t,
|
|
17363
|
+
if (this.viewport = t, jt(this.div, {
|
|
17364
17364
|
rotation: s
|
|
17365
17365
|
}), e !== s)
|
|
17366
17366
|
for (const i of this.#r.values())
|
|
@@ -17529,7 +17529,7 @@ globalThis.pdfjsLib = {
|
|
|
17529
17529
|
getUuid: xi,
|
|
17530
17530
|
getXfaPageViewport: _n,
|
|
17531
17531
|
GlobalWorkerOptions: Wt,
|
|
17532
|
-
ImageKind:
|
|
17532
|
+
ImageKind: Ge,
|
|
17533
17533
|
InvalidPDFException: ms,
|
|
17534
17534
|
isDataScheme: Je,
|
|
17535
17535
|
isPdfFile: Ds,
|
|
@@ -17537,18 +17537,18 @@ globalThis.pdfjsLib = {
|
|
|
17537
17537
|
MathClamp: ut,
|
|
17538
17538
|
noContextMenu: _t,
|
|
17539
17539
|
normalizeUnicode: bn,
|
|
17540
|
-
OPS:
|
|
17540
|
+
OPS: Ee,
|
|
17541
17541
|
OutputScale: kt,
|
|
17542
17542
|
PasswordResponses: hn,
|
|
17543
17543
|
PDFDataRangeTransport: Vi,
|
|
17544
17544
|
PDFDateString: bs,
|
|
17545
|
-
PDFWorker:
|
|
17545
|
+
PDFWorker: Es,
|
|
17546
17546
|
PermissionFlag: on,
|
|
17547
17547
|
PixelsPerInch: le,
|
|
17548
17548
|
RenderingCancelledException: ks,
|
|
17549
|
-
renderRichText:
|
|
17550
|
-
ResponseException:
|
|
17551
|
-
setLayerDimensions:
|
|
17549
|
+
renderRichText: Si,
|
|
17550
|
+
ResponseException: je,
|
|
17551
|
+
setLayerDimensions: jt,
|
|
17552
17552
|
shadow: L,
|
|
17553
17553
|
SignatureExtractor: te,
|
|
17554
17554
|
stopEvent: Q,
|
|
@@ -17559,7 +17559,7 @@ globalThis.pdfjsLib = {
|
|
|
17559
17559
|
Util: T,
|
|
17560
17560
|
VerbosityLevel: Ye,
|
|
17561
17561
|
version: Wi,
|
|
17562
|
-
XfaLayer:
|
|
17562
|
+
XfaLayer: Ei
|
|
17563
17563
|
};
|
|
17564
17564
|
class ra {
|
|
17565
17565
|
document = null;
|
|
@@ -18294,6 +18294,29 @@ class pa {
|
|
|
18294
18294
|
getScale() {
|
|
18295
18295
|
return this.currentScale;
|
|
18296
18296
|
}
|
|
18297
|
+
/**
|
|
18298
|
+
* Get dimensions of a specific page in PDF points
|
|
18299
|
+
* @param pageIndex - Zero-based page index
|
|
18300
|
+
* @returns Page dimensions { width: number, height: number } or null if page doesn't exist
|
|
18301
|
+
*/
|
|
18302
|
+
async getPageDimensions(t) {
|
|
18303
|
+
if (!this.pdfDocument)
|
|
18304
|
+
throw new Error("PDF not loaded");
|
|
18305
|
+
if (t < 0 || t >= this.pdfDocument.numPages)
|
|
18306
|
+
return null;
|
|
18307
|
+
const e = this.pageInfo.get(t);
|
|
18308
|
+
if (e)
|
|
18309
|
+
return { width: e.width, height: e.height };
|
|
18310
|
+
try {
|
|
18311
|
+
const s = (await this.pdfDocument.getPage(t + 1)).getViewport({ scale: 1 }), i = {
|
|
18312
|
+
width: s.width,
|
|
18313
|
+
height: s.height
|
|
18314
|
+
};
|
|
18315
|
+
return this.pageInfo.set(t, i), i;
|
|
18316
|
+
} catch (s) {
|
|
18317
|
+
return console.error(`Failed to get dimensions for page ${t}:`, s), null;
|
|
18318
|
+
}
|
|
18319
|
+
}
|
|
18297
18320
|
// Field Management
|
|
18298
18321
|
fields = [];
|
|
18299
18322
|
setFields(t) {
|
|
@@ -18343,7 +18366,7 @@ class pa {
|
|
|
18343
18366
|
const v = Array.from(this.container.querySelectorAll(".page-view"));
|
|
18344
18367
|
let A = 1 / 0, x = null;
|
|
18345
18368
|
if (v.forEach((_) => {
|
|
18346
|
-
const
|
|
18369
|
+
const E = _.getBoundingClientRect(), S = Math.max(E.left, Math.min(i, E.right)), P = Math.max(E.top, Math.min(n, E.bottom)), C = i - S, H = n - P, V = Math.sqrt(C * C + H * H);
|
|
18347
18370
|
V < A && (A = V, x = _);
|
|
18348
18371
|
}), x)
|
|
18349
18372
|
a = x;
|
|
@@ -18374,6 +18397,104 @@ class pa {
|
|
|
18374
18397
|
off(t, e) {
|
|
18375
18398
|
this.eventBus.off(t, e);
|
|
18376
18399
|
}
|
|
18400
|
+
async print(t) {
|
|
18401
|
+
if (!this.pdfDocument) return;
|
|
18402
|
+
const e = document.createElement("iframe");
|
|
18403
|
+
e.style.position = "fixed", e.style.top = "0", e.style.left = "-10000px", e.style.width = "0", e.style.height = "0", e.style.border = "none", e.style.visibility = "hidden", document.body.appendChild(e);
|
|
18404
|
+
const s = e.contentWindow?.document;
|
|
18405
|
+
if (!s)
|
|
18406
|
+
throw document.body.removeChild(e), new Error("Could not create print iframe");
|
|
18407
|
+
Array.from(document.styleSheets).forEach((r) => {
|
|
18408
|
+
try {
|
|
18409
|
+
if (r.href) {
|
|
18410
|
+
const a = document.createElement("link");
|
|
18411
|
+
a.rel = "stylesheet", a.href = r.href, s.head.appendChild(a);
|
|
18412
|
+
} else if (r.cssRules) {
|
|
18413
|
+
const a = document.createElement("style");
|
|
18414
|
+
Array.from(r.cssRules).forEach((o) => {
|
|
18415
|
+
a.appendChild(document.createTextNode(o.cssText));
|
|
18416
|
+
}), s.head.appendChild(a);
|
|
18417
|
+
}
|
|
18418
|
+
} catch (a) {
|
|
18419
|
+
console.warn("Could not copy stylesheet", a);
|
|
18420
|
+
}
|
|
18421
|
+
});
|
|
18422
|
+
const i = document.createElement("style");
|
|
18423
|
+
i.textContent = `
|
|
18424
|
+
@page { margin: 0; size: auto; }
|
|
18425
|
+
html, body {
|
|
18426
|
+
margin: 0 !important;
|
|
18427
|
+
padding: 0 !important;
|
|
18428
|
+
height: auto !important;
|
|
18429
|
+
overflow: visible !important;
|
|
18430
|
+
background-color: white !important;
|
|
18431
|
+
}
|
|
18432
|
+
/* Hide scrollbars */
|
|
18433
|
+
::-webkit-scrollbar { display: none; }
|
|
18434
|
+
* { -ms-overflow-style: none; scrollbar-width: none; }
|
|
18435
|
+
|
|
18436
|
+
.print-page {
|
|
18437
|
+
position: relative;
|
|
18438
|
+
page-break-after: always;
|
|
18439
|
+
width: 100%;
|
|
18440
|
+
overflow: hidden;
|
|
18441
|
+
margin: 0;
|
|
18442
|
+
padding: 0;
|
|
18443
|
+
}
|
|
18444
|
+
.print-page img {
|
|
18445
|
+
display: block;
|
|
18446
|
+
width: 100%;
|
|
18447
|
+
height: auto;
|
|
18448
|
+
}
|
|
18449
|
+
.print-field {
|
|
18450
|
+
position: absolute;
|
|
18451
|
+
border: 1px solid transparent;
|
|
18452
|
+
}
|
|
18453
|
+
/* Hide UI controls in print */
|
|
18454
|
+
.sc-resize-handle, .sc-delete-btn { display: none !important; }
|
|
18455
|
+
`, s.head.appendChild(i);
|
|
18456
|
+
const n = document.createElement("div");
|
|
18457
|
+
s.body.appendChild(n);
|
|
18458
|
+
try {
|
|
18459
|
+
const r = this.pdfDocument.numPages;
|
|
18460
|
+
for (let a = 1; a <= r; a++) {
|
|
18461
|
+
const o = await this.pdfDocument.getPage(a), h = o.getViewport({ scale: 2 }), l = document.createElement("canvas"), c = l.getContext("2d");
|
|
18462
|
+
if (!c) continue;
|
|
18463
|
+
l.width = h.width, l.height = h.height, await o.render({
|
|
18464
|
+
canvasContext: c,
|
|
18465
|
+
viewport: h
|
|
18466
|
+
}).promise;
|
|
18467
|
+
const u = document.createElement("div");
|
|
18468
|
+
u.className = "print-page";
|
|
18469
|
+
const p = document.createElement("img");
|
|
18470
|
+
p.src = l.toDataURL("image/jpeg", 0.8), u.appendChild(p), t?.withSignatures && this.fields.filter((f) => f.pageIndex === a - 1).forEach((f) => {
|
|
18471
|
+
const g = document.createElement("div");
|
|
18472
|
+
g.className = "print-field select-none";
|
|
18473
|
+
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;
|
|
18474
|
+
if (g.style.left = `${m}%`, g.style.top = `${w}%`, g.style.width = `${y}%`, g.style.height = `${v}%`, g.style.display = "flex", g.style.alignItems = "center", g.style.justifyContent = "center", g.style.overflow = "hidden", f.style && Object.assign(g.style, f.style), f.type === "text")
|
|
18475
|
+
g.textContent = f.content || "", g.style.fontFamily = "sans-serif", g.style.fontSize = "2cqw", g.style.whiteSpace = "pre-wrap", g.style.textAlign = "center";
|
|
18476
|
+
else if (f.type === "image") {
|
|
18477
|
+
const A = document.createElement("img");
|
|
18478
|
+
A.src = f.content || "", A.style.width = "100%", A.style.height = "100%", A.style.objectFit = "contain", g.appendChild(A);
|
|
18479
|
+
} else if (f.type === "signature") {
|
|
18480
|
+
g.innerHTML = f.content || "";
|
|
18481
|
+
const A = g.querySelector("img");
|
|
18482
|
+
A && (A.style.width = "100%", A.style.height = "100%");
|
|
18483
|
+
const x = g.querySelector("svg");
|
|
18484
|
+
x && (x.style.width = "100%", x.style.height = "100%");
|
|
18485
|
+
}
|
|
18486
|
+
u.appendChild(g);
|
|
18487
|
+
}), n.appendChild(u);
|
|
18488
|
+
}
|
|
18489
|
+
await new Promise((a) => setTimeout(a, 500)), e.contentWindow?.focus(), e.contentWindow?.print();
|
|
18490
|
+
} catch (r) {
|
|
18491
|
+
throw console.error("Print failed", r), r;
|
|
18492
|
+
} finally {
|
|
18493
|
+
setTimeout(() => {
|
|
18494
|
+
document.body.contains(e) && document.body.removeChild(e);
|
|
18495
|
+
}, 3e5);
|
|
18496
|
+
}
|
|
18497
|
+
}
|
|
18377
18498
|
destroy() {
|
|
18378
18499
|
this.isDestroyed = !0, this.zoomHandler.destroy(), this.strategy?.destroy(), this.loader.destroy(), this.eventBus.clear(), this.container.innerHTML = "";
|
|
18379
18500
|
}
|
|
@@ -18416,6 +18537,9 @@ class ga {
|
|
|
18416
18537
|
getScale() {
|
|
18417
18538
|
return this.viewer.getScale();
|
|
18418
18539
|
}
|
|
18540
|
+
async getPageDimensions(t) {
|
|
18541
|
+
return this.viewer.getPageDimensions(t);
|
|
18542
|
+
}
|
|
18419
18543
|
// Event handling
|
|
18420
18544
|
on(t, e) {
|
|
18421
18545
|
this.viewer.on(t, e);
|
|
@@ -18439,6 +18563,9 @@ class ga {
|
|
|
18439
18563
|
updateField(t, e) {
|
|
18440
18564
|
this.viewer.updateField(t, e);
|
|
18441
18565
|
}
|
|
18566
|
+
async print(t) {
|
|
18567
|
+
return this.viewer.print(t);
|
|
18568
|
+
}
|
|
18442
18569
|
destroy() {
|
|
18443
18570
|
this.viewer.destroy();
|
|
18444
18571
|
}
|