react-edit-to-html 1.2.10 → 1.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/index.cjs +15 -15
- package/dist/index.js +752 -703
- package/dist/react-edit-to-html.css +1 -1
- package/dist/src/App.d.ts +1 -1
- package/dist/src/types.d.ts +4 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -182,32 +182,32 @@ function k(e, t, n) {
|
|
|
182
182
|
}
|
|
183
183
|
//#endregion
|
|
184
184
|
//#region node_modules/pdfjs-dist/build/pdf.mjs
|
|
185
|
-
var
|
|
185
|
+
var A = /* @__PURE__ */ p({
|
|
186
186
|
AbortException: () => Qe,
|
|
187
187
|
AnnotationEditorLayer: () => Sy,
|
|
188
|
-
AnnotationEditorParamsType: () =>
|
|
189
|
-
AnnotationEditorType: () =>
|
|
188
|
+
AnnotationEditorParamsType: () => P,
|
|
189
|
+
AnnotationEditorType: () => N,
|
|
190
190
|
AnnotationEditorUIManager: () => Br,
|
|
191
191
|
AnnotationLayer: () => Ch,
|
|
192
|
-
AnnotationMode: () =>
|
|
193
|
-
AnnotationType: () =>
|
|
192
|
+
AnnotationMode: () => Te,
|
|
193
|
+
AnnotationType: () => je,
|
|
194
194
|
CSSConstants: () => zt,
|
|
195
195
|
ColorPicker: () => ip,
|
|
196
196
|
DOMSVGFactory: () => Sp,
|
|
197
197
|
DrawLayer: () => Hy,
|
|
198
198
|
FeatureTest: () => R,
|
|
199
199
|
GlobalWorkerOptions: () => Hu,
|
|
200
|
-
ImageKind: () =>
|
|
200
|
+
ImageKind: () => Ae,
|
|
201
201
|
InvalidPDFException: () => Ye,
|
|
202
202
|
MathClamp: () => B,
|
|
203
|
-
OPS: () =>
|
|
203
|
+
OPS: () => Pe,
|
|
204
204
|
OutputScale: () => It,
|
|
205
205
|
PDFDataRangeTransport: () => lf,
|
|
206
206
|
PDFDateString: () => Ot,
|
|
207
207
|
PDFWorker: () => xf,
|
|
208
208
|
PasswordException: () => qe,
|
|
209
209
|
PasswordResponses: () => Ie,
|
|
210
|
-
PermissionFlag: () =>
|
|
210
|
+
PermissionFlag: () => Oe,
|
|
211
211
|
PixelsPerInch: () => ht,
|
|
212
212
|
RenderingCancelledException: () => vt,
|
|
213
213
|
ResponseException: () => Xe,
|
|
@@ -217,7 +217,7 @@ var te = /* @__PURE__ */ p({
|
|
|
217
217
|
TextLayerImages: () => fb,
|
|
218
218
|
TouchManager: () => Qi,
|
|
219
219
|
Util: () => z,
|
|
220
|
-
VerbosityLevel: () =>
|
|
220
|
+
VerbosityLevel: () => Ne,
|
|
221
221
|
XfaLayer: () => mt,
|
|
222
222
|
applyOpacity: () => Bt,
|
|
223
223
|
build: () => Kf,
|
|
@@ -244,19 +244,19 @@ var te = /* @__PURE__ */ p({
|
|
|
244
244
|
stopEvent: () => Dt,
|
|
245
245
|
updateUrlHash: () => We,
|
|
246
246
|
version: () => Gf
|
|
247
|
-
}),
|
|
247
|
+
}), j, te, ne, re, ie, ae, M, oe, se, ce, le, ue, de, fe, pe, me, he, ge, _e, ve = typeof process == "object" && process + "" == "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser"), ye = [
|
|
248
248
|
Infinity,
|
|
249
249
|
Infinity,
|
|
250
250
|
-Infinity,
|
|
251
251
|
-Infinity
|
|
252
|
-
],
|
|
252
|
+
], be = new Float32Array(ye), xe = [
|
|
253
253
|
.001,
|
|
254
254
|
0,
|
|
255
255
|
0,
|
|
256
256
|
.001,
|
|
257
257
|
0,
|
|
258
258
|
0
|
|
259
|
-
],
|
|
259
|
+
], Se = 1.35, Ce = "http://www.w3.org/2000/svg", we = {
|
|
260
260
|
ANY: 1,
|
|
261
261
|
DISPLAY: 2,
|
|
262
262
|
PRINT: 4,
|
|
@@ -266,12 +266,12 @@ var te = /* @__PURE__ */ p({
|
|
|
266
266
|
ANNOTATIONS_DISABLE: 64,
|
|
267
267
|
IS_EDITING: 128,
|
|
268
268
|
OPLIST: 256
|
|
269
|
-
},
|
|
269
|
+
}, Te = {
|
|
270
270
|
DISABLE: 0,
|
|
271
271
|
ENABLE: 1,
|
|
272
272
|
ENABLE_FORMS: 2,
|
|
273
273
|
ENABLE_STORAGE: 3
|
|
274
|
-
},
|
|
274
|
+
}, Ee = "pdfjs_internal_id_", De = "pdfjs_internal_editor_", N = {
|
|
275
275
|
DISABLE: -1,
|
|
276
276
|
NONE: 0,
|
|
277
277
|
FREETEXT: 3,
|
|
@@ -281,7 +281,7 @@ var te = /* @__PURE__ */ p({
|
|
|
281
281
|
POPUP: 16,
|
|
282
282
|
SIGNATURE: 101,
|
|
283
283
|
COMMENT: 102
|
|
284
|
-
},
|
|
284
|
+
}, P = {
|
|
285
285
|
RESIZE: 1,
|
|
286
286
|
CREATE: 2,
|
|
287
287
|
FREETEXT_SIZE: 11,
|
|
@@ -296,7 +296,7 @@ var te = /* @__PURE__ */ p({
|
|
|
296
296
|
HIGHLIGHT_FREE: 33,
|
|
297
297
|
HIGHLIGHT_SHOW_ALL: 34,
|
|
298
298
|
DRAW_STEP: 41
|
|
299
|
-
},
|
|
299
|
+
}, Oe = {
|
|
300
300
|
PRINT: 4,
|
|
301
301
|
MODIFY_CONTENTS: 8,
|
|
302
302
|
COPY: 16,
|
|
@@ -305,7 +305,7 @@ var te = /* @__PURE__ */ p({
|
|
|
305
305
|
COPY_FOR_ACCESSIBILITY: 512,
|
|
306
306
|
ASSEMBLE: 1024,
|
|
307
307
|
PRINT_HIGH_QUALITY: 2048
|
|
308
|
-
},
|
|
308
|
+
}, ke = {
|
|
309
309
|
FILL: 0,
|
|
310
310
|
STROKE: 1,
|
|
311
311
|
FILL_STROKE: 2,
|
|
@@ -316,11 +316,11 @@ var te = /* @__PURE__ */ p({
|
|
|
316
316
|
ADD_TO_PATH: 7,
|
|
317
317
|
FILL_STROKE_MASK: 3,
|
|
318
318
|
ADD_TO_PATH_FLAG: 4
|
|
319
|
-
},
|
|
319
|
+
}, Ae = {
|
|
320
320
|
GRAYSCALE_1BPP: 1,
|
|
321
321
|
RGB_24BPP: 2,
|
|
322
322
|
RGBA_32BPP: 3
|
|
323
|
-
},
|
|
323
|
+
}, je = {
|
|
324
324
|
TEXT: 1,
|
|
325
325
|
LINK: 2,
|
|
326
326
|
FREETEXT: 3,
|
|
@@ -348,17 +348,17 @@ var te = /* @__PURE__ */ p({
|
|
|
348
348
|
THREED: 25,
|
|
349
349
|
REDACT: 26,
|
|
350
350
|
RICHMEDIA: 27
|
|
351
|
-
},
|
|
351
|
+
}, Me = {
|
|
352
352
|
SOLID: 1,
|
|
353
353
|
DASHED: 2,
|
|
354
354
|
BEVELED: 3,
|
|
355
355
|
INSET: 4,
|
|
356
356
|
UNDERLINE: 5
|
|
357
|
-
},
|
|
357
|
+
}, Ne = {
|
|
358
358
|
ERRORS: 0,
|
|
359
359
|
WARNINGS: 1,
|
|
360
360
|
INFOS: 5
|
|
361
|
-
},
|
|
361
|
+
}, Pe = {
|
|
362
362
|
dependency: 1,
|
|
363
363
|
setLineWidth: 2,
|
|
364
364
|
setLineCap: 3,
|
|
@@ -459,7 +459,7 @@ var te = /* @__PURE__ */ p({
|
|
|
459
459
|
}, Ie = {
|
|
460
460
|
NEED_PASSWORD: 1,
|
|
461
461
|
INCORRECT_PASSWORD: 2
|
|
462
|
-
}, Le =
|
|
462
|
+
}, Le = Ne.WARNINGS;
|
|
463
463
|
function Re(e) {
|
|
464
464
|
Number.isInteger(e) && (Le = e);
|
|
465
465
|
}
|
|
@@ -467,10 +467,10 @@ function ze() {
|
|
|
467
467
|
return Le;
|
|
468
468
|
}
|
|
469
469
|
function Be(e) {
|
|
470
|
-
Le >=
|
|
470
|
+
Le >= Ne.INFOS && console.info(`Info: ${e}`);
|
|
471
471
|
}
|
|
472
472
|
function F(e) {
|
|
473
|
-
Le >=
|
|
473
|
+
Le >= Ne.WARNINGS && console.warn(`Warning: ${e}`);
|
|
474
474
|
}
|
|
475
475
|
function I(e) {
|
|
476
476
|
throw Error(e);
|
|
@@ -695,7 +695,7 @@ var R = class {
|
|
|
695
695
|
l[0] = Math.min(l[0], t, s), l[1] = Math.min(l[1], n, c), l[2] = Math.max(l[2], t, s), l[3] = Math.max(l[3], n, c), m(e, this, nt).call(this, t, r, a, s, n, i, o, c, 3 * (-t + 3 * (r - a) + s), 6 * (t - 2 * r + a), 3 * (r - t), l), m(e, this, nt).call(this, t, r, a, s, n, i, o, c, 3 * (-n + 3 * (i - o) + c), 6 * (n - 2 * i + o), 3 * (i - n), l);
|
|
696
696
|
}
|
|
697
697
|
};
|
|
698
|
-
|
|
698
|
+
j = z;
|
|
699
699
|
function tt(e, t, n, r, i, a, o, s, c, l) {
|
|
700
700
|
if (c <= 0 || c >= 1) return;
|
|
701
701
|
let u = 1 - c, d = c * c, f = d * c, p = u * (u * (u * e + 3 * c * t) + 3 * d * n) + f * r, m = u * (u * (u * i + 3 * c * a) + 3 * d * o) + f * s;
|
|
@@ -703,13 +703,13 @@ function tt(e, t, n, r, i, a, o, s, c, l) {
|
|
|
703
703
|
}
|
|
704
704
|
function nt(e, t, n, r, i, a, o, s, c, l, u, d) {
|
|
705
705
|
if (Math.abs(c) < 1e-12) {
|
|
706
|
-
Math.abs(l) >= 1e-12 && m(
|
|
706
|
+
Math.abs(l) >= 1e-12 && m(j, this, tt).call(this, e, t, n, r, i, a, o, s, -u / l, d);
|
|
707
707
|
return;
|
|
708
708
|
}
|
|
709
709
|
let f = Math.pow(l, 2) - 4 * u * c;
|
|
710
710
|
if (f < 0) return;
|
|
711
711
|
let p = Math.sqrt(f), h = 2 * c;
|
|
712
|
-
m(
|
|
712
|
+
m(j, this, tt).call(this, e, t, n, r, i, a, o, s, (-l + p) / h, d), m(j, this, tt).call(this, e, t, n, r, i, a, o, s, (-l - p) / h, d);
|
|
713
713
|
}
|
|
714
714
|
function rt(e) {
|
|
715
715
|
return decodeURIComponent(escape(e));
|
|
@@ -968,7 +968,7 @@ var ft = class e {
|
|
|
968
968
|
});
|
|
969
969
|
}
|
|
970
970
|
}, ht = class {};
|
|
971
|
-
|
|
971
|
+
te = ht, v(ht, "CSS", 96), v(ht, "PDF", 72), v(ht, "PDF_TO_CSS_UNITS", te.CSS / te.PDF);
|
|
972
972
|
function gt(e) {
|
|
973
973
|
return _t.apply(this, arguments);
|
|
974
974
|
}
|
|
@@ -1604,14 +1604,14 @@ var Sn = class e {
|
|
|
1604
1604
|
}
|
|
1605
1605
|
get id() {
|
|
1606
1606
|
var e, t;
|
|
1607
|
-
return `${
|
|
1607
|
+
return `${De}${T(Dn, this, (e = C(Dn, this), t = e++, e)), t}`;
|
|
1608
1608
|
}
|
|
1609
1609
|
}, kn = /* @__PURE__ */ new WeakMap(), An = /* @__PURE__ */ new WeakMap(), jn = /* @__PURE__ */ new WeakMap(), Mn = /* @__PURE__ */ new WeakSet(), Nn = class {
|
|
1610
1610
|
constructor() {
|
|
1611
1611
|
w(this, Mn), S(this, kn, st()), S(this, An, 0), S(this, jn, null);
|
|
1612
1612
|
}
|
|
1613
1613
|
static get _isSVGFittingCanvas() {
|
|
1614
|
-
let e = `data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="${
|
|
1614
|
+
let e = `data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="${Ce}"><rect width="1" height="1" style="fill:red;"/></svg>`, t = new OffscreenCanvas(1, 3).getContext("2d", { willReadFrequently: !0 }), n = new Image();
|
|
1615
1615
|
n.src = e;
|
|
1616
1616
|
let r = n.decode().then(() => (t.drawImage(n, 0, 0, 1, 1, 0, 0, 1, 3), new Uint32Array(t.getImageData(0, 0, 1, 1).data.buffer)[0] === 0));
|
|
1617
1617
|
return L(this, "_isSVGFittingCanvas", r);
|
|
@@ -1684,7 +1684,7 @@ var Sn = class e {
|
|
|
1684
1684
|
return e.startsWith(`image_${C(kn, this)}_`);
|
|
1685
1685
|
}
|
|
1686
1686
|
};
|
|
1687
|
-
|
|
1687
|
+
ne = Nn;
|
|
1688
1688
|
function Pn(e, t) {
|
|
1689
1689
|
var n = this;
|
|
1690
1690
|
return b(function* () {
|
|
@@ -1702,7 +1702,7 @@ function Pn(e, t) {
|
|
|
1702
1702
|
});
|
|
1703
1703
|
let e;
|
|
1704
1704
|
if (typeof t == "string" ? (r.url = t, e = yield gt(t, "blob")) : t instanceof File ? e = r.file = t : t instanceof Blob && (e = t), e.type === "image/svg+xml") {
|
|
1705
|
-
let t =
|
|
1705
|
+
let t = ne._isSVGFittingCanvas, n = new FileReader(), i = new Image(), a = new Promise((e, a) => {
|
|
1706
1706
|
i.onload = () => {
|
|
1707
1707
|
r.bitmap = i, r.isSvg = !0, e();
|
|
1708
1708
|
}, n.onload = b(function* () {
|
|
@@ -1808,12 +1808,12 @@ var Fn = /* @__PURE__ */ new WeakMap(), In = /* @__PURE__ */ new WeakMap(), Ln =
|
|
|
1808
1808
|
l && !l(t, n) || (o.bind(t, ...c, n)(), s || Dt(n));
|
|
1809
1809
|
}
|
|
1810
1810
|
};
|
|
1811
|
-
|
|
1811
|
+
re = Bn;
|
|
1812
1812
|
function Vn(e) {
|
|
1813
1813
|
let t = null, n = 0;
|
|
1814
1814
|
for (let r of e.split("+")) {
|
|
1815
1815
|
if (r = r.trim(), !r) continue;
|
|
1816
|
-
let i = r.toUpperCase(), a =
|
|
1816
|
+
let i = r.toUpperCase(), a = re[i];
|
|
1817
1817
|
if (a) {
|
|
1818
1818
|
n |= a;
|
|
1819
1819
|
continue;
|
|
@@ -1983,7 +1983,7 @@ var Wn = /* @__PURE__ */ new WeakMap(), Gn = /* @__PURE__ */ new WeakMap(), Kn =
|
|
|
1983
1983
|
]));
|
|
1984
1984
|
}
|
|
1985
1985
|
constructor(e, t, n, r, i, a, o, s, c, l, u, d, f, p, h, g) {
|
|
1986
|
-
w(this, V), S(this, Wn, new AbortController()), S(this, Gn, null), S(this, Kn, null), S(this, qn, /* @__PURE__ */ new Map()), S(this, Jn, /* @__PURE__ */ new Map()), S(this, Yn, null), S(this, Xn, null), S(this, Zn, null), S(this, Qn, null), S(this, $n, new zn()), S(this, er, null), S(this, tr, null), S(this, nr, null), S(this, rr, 0), S(this, ir, /* @__PURE__ */ new Set()), S(this, ar, null), S(this, or, null), S(this, sr, /* @__PURE__ */ new Set()), v(this, "_editorUndoBar", null), S(this, cr, !1), S(this, lr, !1), S(this, ur, !1), S(this, dr, null), S(this, fr, null), S(this, pr, null), S(this, mr, null), S(this, hr, !1), S(this, gr, null), S(this, _r, new On()), S(this, vr, !1), S(this, yr, !1), S(this, br, !1), S(this, xr, null), S(this, Sr, null), S(this, Cr, null), S(this, wr, null), S(this, Tr, null), S(this, Er,
|
|
1986
|
+
w(this, V), S(this, Wn, new AbortController()), S(this, Gn, null), S(this, Kn, null), S(this, qn, /* @__PURE__ */ new Map()), S(this, Jn, /* @__PURE__ */ new Map()), S(this, Yn, null), S(this, Xn, null), S(this, Zn, null), S(this, Qn, null), S(this, $n, new zn()), S(this, er, null), S(this, tr, null), S(this, nr, null), S(this, rr, 0), S(this, ir, /* @__PURE__ */ new Set()), S(this, ar, null), S(this, or, null), S(this, sr, /* @__PURE__ */ new Set()), v(this, "_editorUndoBar", null), S(this, cr, !1), S(this, lr, !1), S(this, ur, !1), S(this, dr, null), S(this, fr, null), S(this, pr, null), S(this, mr, null), S(this, hr, !1), S(this, gr, null), S(this, _r, new On()), S(this, vr, !1), S(this, yr, !1), S(this, br, !1), S(this, xr, null), S(this, Sr, null), S(this, Cr, null), S(this, wr, null), S(this, Tr, null), S(this, Er, N.NONE), S(this, Dr, /* @__PURE__ */ new Set()), S(this, Or, null), S(this, kr, null), S(this, Ar, null), S(this, jr, null), S(this, Mr, null), S(this, Nr, {
|
|
1987
1987
|
isEditing: !1,
|
|
1988
1988
|
isEmpty: !0,
|
|
1989
1989
|
hasSomethingToUndo: !1,
|
|
@@ -2206,7 +2206,7 @@ var Wn = /* @__PURE__ */ new WeakMap(), Gn = /* @__PURE__ */ new WeakMap(), Kn =
|
|
|
2206
2206
|
let { anchorNode: r, anchorOffset: i, focusNode: a, focusOffset: o } = n, s = n.toString(), c = m(V, this, Vr).call(this, n).closest(".textLayer"), l = this.getSelectionBoxes(c);
|
|
2207
2207
|
if (!l) return;
|
|
2208
2208
|
n.empty();
|
|
2209
|
-
let u = m(V, this, Hr).call(this, c), d = C(Er, this) ===
|
|
2209
|
+
let u = m(V, this, Hr).call(this, c), d = C(Er, this) === N.NONE, f = () => {
|
|
2210
2210
|
let n = u == null ? void 0 : u.createAndAddNewEditor({
|
|
2211
2211
|
x: 0,
|
|
2212
2212
|
y: 0
|
|
@@ -2222,7 +2222,7 @@ var Wn = /* @__PURE__ */ new WeakMap(), Gn = /* @__PURE__ */ new WeakMap(), Kn =
|
|
|
2222
2222
|
d && this.showAllEditors("highlight", !0, !0), t && (n == null || n.editComment());
|
|
2223
2223
|
};
|
|
2224
2224
|
if (d) {
|
|
2225
|
-
this.switchToMode(
|
|
2225
|
+
this.switchToMode(N.HIGHLIGHT, f);
|
|
2226
2226
|
return;
|
|
2227
2227
|
}
|
|
2228
2228
|
f();
|
|
@@ -2232,7 +2232,7 @@ var Wn = /* @__PURE__ */ new WeakMap(), Gn = /* @__PURE__ */ new WeakMap(), Kn =
|
|
|
2232
2232
|
}
|
|
2233
2233
|
getAndRemoveDataFromAnnotationStorage(e) {
|
|
2234
2234
|
if (!C(Zn, this)) return null;
|
|
2235
|
-
let t = `${
|
|
2235
|
+
let t = `${De}${e}`, n = C(Zn, this).getRawValue(t);
|
|
2236
2236
|
return n && C(Zn, this).remove(t), n;
|
|
2237
2237
|
}
|
|
2238
2238
|
addToAnnotationStorage(e) {
|
|
@@ -2334,7 +2334,7 @@ var Wn = /* @__PURE__ */ new WeakMap(), Gn = /* @__PURE__ */ new WeakMap(), Kn =
|
|
|
2334
2334
|
})();
|
|
2335
2335
|
}
|
|
2336
2336
|
keydown(t) {
|
|
2337
|
-
!this.isShiftKeyDown && t.key === "Shift" && (this.isShiftKeyDown = !0), C(Er, this) !==
|
|
2337
|
+
!this.isShiftKeyDown && t.key === "Shift" && (this.isShiftKeyDown = !0), C(Er, this) !== N.NONE && !this.isEditorHandlingKeyboard && e._keyboardManager.exec(this, t);
|
|
2338
2338
|
}
|
|
2339
2339
|
keyup(e) {
|
|
2340
2340
|
this.isShiftKeyDown && e.key === "Shift" && (this.isShiftKeyDown = !1, C(hr, this) && (T(hr, this, !1), m(V, this, Kr).call(this, "main_toolbar")));
|
|
@@ -2368,7 +2368,7 @@ var Wn = /* @__PURE__ */ new WeakMap(), Gn = /* @__PURE__ */ new WeakMap(), Kn =
|
|
|
2368
2368
|
}
|
|
2369
2369
|
clonePage(e, t) {
|
|
2370
2370
|
for (let n of this.getEditors(e)) {
|
|
2371
|
-
let e = n.serialize(n.mode !==
|
|
2371
|
+
let e = n.serialize(n.mode !== N.HIGHLIGHT);
|
|
2372
2372
|
e && (e.pageIndex = t, e.id = this.getId(), e.isClone = !0, delete e.popupRef, C(Zn, this).setValue(e.id, e));
|
|
2373
2373
|
}
|
|
2374
2374
|
}
|
|
@@ -2381,7 +2381,7 @@ var Wn = /* @__PURE__ */ new WeakMap(), Gn = /* @__PURE__ */ new WeakMap(), Kn =
|
|
|
2381
2381
|
}
|
|
2382
2382
|
setEditingState(e) {
|
|
2383
2383
|
e ? (m(V, this, Jr).call(this), m(V, this, Qr).call(this), m(V, this, ti).call(this, {
|
|
2384
|
-
isEditing: C(Er, this) !==
|
|
2384
|
+
isEditing: C(Er, this) !== N.NONE,
|
|
2385
2385
|
isEmpty: m(V, this, si).call(this),
|
|
2386
2386
|
hasSomethingToUndo: C($n, this).hasSomethingToUndo(),
|
|
2387
2387
|
hasSomethingToRedo: C($n, this).hasSomethingToRedo(),
|
|
@@ -2417,11 +2417,11 @@ var Wn = /* @__PURE__ */ new WeakMap(), Gn = /* @__PURE__ */ new WeakMap(), Kn =
|
|
|
2417
2417
|
return b(function* () {
|
|
2418
2418
|
var s, c;
|
|
2419
2419
|
if (C(Er, o) !== e && !(C(zr, o) && (yield C(zr, o).promise, !C(zr, o)))) {
|
|
2420
|
-
if (T(zr, o, Promise.withResolvers()), (s = C(nr, o)) == null || s.commitOrRemove(), C(Er, o) ===
|
|
2420
|
+
if (T(zr, o, Promise.withResolvers()), (s = C(nr, o)) == null || s.commitOrRemove(), C(Er, o) === N.POPUP) {
|
|
2421
2421
|
var l;
|
|
2422
2422
|
(l = C(er, o)) == null || l.hideSidebar();
|
|
2423
2423
|
}
|
|
2424
|
-
if ((c = C(er, o)) == null || c.destroyPopup(), T(Er, o, e), e ===
|
|
2424
|
+
if ((c = C(er, o)) == null || c.destroyPopup(), T(Er, o, e), e === N.NONE) {
|
|
2425
2425
|
var u;
|
|
2426
2426
|
o.setEditingState(!1), m(V, o, ii).call(o);
|
|
2427
2427
|
for (let e of C(qn, o).values()) e.hideStandaloneCommentButton();
|
|
@@ -2429,13 +2429,13 @@ var Wn = /* @__PURE__ */ new WeakMap(), Gn = /* @__PURE__ */ new WeakMap(), Kn =
|
|
|
2429
2429
|
return;
|
|
2430
2430
|
}
|
|
2431
2431
|
for (let e of C(qn, o).values()) e.addStandaloneCommentButton();
|
|
2432
|
-
if (e ===
|
|
2432
|
+
if (e === N.SIGNATURE) {
|
|
2433
2433
|
var d;
|
|
2434
2434
|
yield (d = C(kr, o)) == null ? void 0 : d.loadSignatures();
|
|
2435
2435
|
}
|
|
2436
2436
|
n && Sn.clearPointerType(), o.setEditingState(!0), yield m(V, o, ri).call(o), o.unselectAll();
|
|
2437
2437
|
for (let t of C(Jn, o).values()) t.updateMode(e);
|
|
2438
|
-
if (e ===
|
|
2438
|
+
if (e === N.POPUP) {
|
|
2439
2439
|
var f;
|
|
2440
2440
|
C(Kn, o) || T(Kn, o, yield C(Mr, o).getAnnotationsByType(new Set(C(or, o).map((e) => e._editorType))));
|
|
2441
2441
|
let e = /* @__PURE__ */ new Set(), t = [];
|
|
@@ -2467,10 +2467,10 @@ var Wn = /* @__PURE__ */ new WeakMap(), Gn = /* @__PURE__ */ new WeakMap(), Kn =
|
|
|
2467
2467
|
updateParams(e, t) {
|
|
2468
2468
|
if (C(or, this)) {
|
|
2469
2469
|
switch (e) {
|
|
2470
|
-
case
|
|
2470
|
+
case P.CREATE:
|
|
2471
2471
|
this.currentLayer.addNewEditor(t);
|
|
2472
2472
|
return;
|
|
2473
|
-
case
|
|
2473
|
+
case P.HIGHLIGHT_SHOW_ALL:
|
|
2474
2474
|
this._eventBus.dispatch("reporttelemetry", {
|
|
2475
2475
|
source: this,
|
|
2476
2476
|
details: {
|
|
@@ -2490,7 +2490,7 @@ var Wn = /* @__PURE__ */ new WeakMap(), Gn = /* @__PURE__ */ new WeakMap(), Kn =
|
|
|
2490
2490
|
showAllEditors(e, t, n = !1) {
|
|
2491
2491
|
var r, i;
|
|
2492
2492
|
for (let n of C(qn, this).values()) n.editorType === e && n.show(t);
|
|
2493
|
-
((r = (i = C(jr, this)) == null ? void 0 : i.get(
|
|
2493
|
+
((r = (i = C(jr, this)) == null ? void 0 : i.get(P.HIGHLIGHT_SHOW_ALL)) == null || r) !== t && m(V, this, ni).call(this, [[P.HIGHLIGHT_SHOW_ALL, t]]);
|
|
2494
2494
|
}
|
|
2495
2495
|
enableWaiting(e = !1) {
|
|
2496
2496
|
if (C(br, this) !== e) {
|
|
@@ -2621,7 +2621,7 @@ var Wn = /* @__PURE__ */ new WeakMap(), Gn = /* @__PURE__ */ new WeakMap(), Kn =
|
|
|
2621
2621
|
}
|
|
2622
2622
|
unselectAll() {
|
|
2623
2623
|
var e, t;
|
|
2624
|
-
if (!(C(Gn, this) && (C(Gn, this).commitOrRemove(), C(Er, this) !==
|
|
2624
|
+
if (!(C(Gn, this) && (C(Gn, this).commitOrRemove(), C(Er, this) !== N.NONE)) && !((e = C(nr, this)) != null && e.commitOrRemove()) && ((t = C(er, this)) == null || t.destroyPopup(), this.hasSelection)) {
|
|
2625
2625
|
for (let e of C(Dr, this)) e.unselect();
|
|
2626
2626
|
C(Dr, this).clear(), m(V, this, ti).call(this, { hasSelectedEditor: !1 });
|
|
2627
2627
|
}
|
|
@@ -2703,7 +2703,7 @@ var Wn = /* @__PURE__ */ new WeakMap(), Gn = /* @__PURE__ */ new WeakMap(), Kn =
|
|
|
2703
2703
|
return C(Er, this);
|
|
2704
2704
|
}
|
|
2705
2705
|
isEditingMode() {
|
|
2706
|
-
return C(Er, this) !==
|
|
2706
|
+
return C(Er, this) !== N.NONE;
|
|
2707
2707
|
}
|
|
2708
2708
|
get imageManager() {
|
|
2709
2709
|
return L(this, "imageManager", new Nn());
|
|
@@ -2766,7 +2766,7 @@ var Wn = /* @__PURE__ */ new WeakMap(), Gn = /* @__PURE__ */ new WeakMap(), Kn =
|
|
|
2766
2766
|
let n = (t = C(Qn, this)) == null ? void 0 : t.get(e.data.id);
|
|
2767
2767
|
if (!n) return;
|
|
2768
2768
|
let r = C(Zn, this).getRawValue(n);
|
|
2769
|
-
r && (C(Er, this) ===
|
|
2769
|
+
r && (C(Er, this) === N.NONE && !r.hasBeenModified || r.renderAnnotationElement(e));
|
|
2770
2770
|
}
|
|
2771
2771
|
setMissingCanvas(e, t, n) {
|
|
2772
2772
|
var r;
|
|
@@ -2816,8 +2816,8 @@ function Gr() {
|
|
|
2816
2816
|
}
|
|
2817
2817
|
return;
|
|
2818
2818
|
}
|
|
2819
|
-
if ((e = C(gr, this)) == null || e.hide(), T(Or, this, r), m(V, this, ti).call(this, { hasSelectedText: !0 }), !(C(Er, this) !==
|
|
2820
|
-
let e = C(Er, this) ===
|
|
2819
|
+
if ((e = C(gr, this)) == null || e.hide(), T(Or, this, r), m(V, this, ti).call(this, { hasSelectedText: !0 }), !(C(Er, this) !== N.HIGHLIGHT && C(Er, this) !== N.NONE) && (C(Er, this) === N.HIGHLIGHT && this.showAllEditors("highlight", !0, !0), T(hr, this, this.isShiftKeyDown), !this.isShiftKeyDown)) {
|
|
2820
|
+
let e = C(Er, this) === N.HIGHLIGHT ? m(V, this, Hr).call(this, i) : null;
|
|
2821
2821
|
if (e == null || e.toggleDrawing(), C(yr, this)) {
|
|
2822
2822
|
let t = new AbortController(), n = this.combinedSignal(t), r = (n) => {
|
|
2823
2823
|
n.type === "pointerup" && n.button !== 0 || (t.abort(), e == null || e.toggleDrawing(!0), n.type === "pointerup" && m(V, this, Kr).call(this, "main_toolbar"));
|
|
@@ -2827,7 +2827,7 @@ function Gr() {
|
|
|
2827
2827
|
}
|
|
2828
2828
|
}
|
|
2829
2829
|
function Kr(e = "") {
|
|
2830
|
-
C(Er, this) ===
|
|
2830
|
+
C(Er, this) === N.HIGHLIGHT ? this.highlightSelection(e) : C(cr, this) && m(V, this, Wr).call(this);
|
|
2831
2831
|
}
|
|
2832
2832
|
function qr() {
|
|
2833
2833
|
document.addEventListener("selectionchange", m(V, this, Gr).bind(this), { signal: this._signal });
|
|
@@ -2870,7 +2870,7 @@ function ti(e) {
|
|
|
2870
2870
|
Object.entries(e).some(([e, t]) => C(Nr, this)[e] !== t) && (this._eventBus.dispatch("editingstateschanged", {
|
|
2871
2871
|
source: this,
|
|
2872
2872
|
details: Object.assign(C(Nr, this), e)
|
|
2873
|
-
}), C(Er, this) ===
|
|
2873
|
+
}), C(Er, this) === N.HIGHLIGHT && e.hasSelectedEditor === !1 && m(V, this, ni).call(this, [[P.HIGHLIGHT_FREE, !0]]));
|
|
2874
2874
|
}
|
|
2875
2875
|
function ni(e) {
|
|
2876
2876
|
this._eventBus.dispatch("annotationeditorparamschanged", {
|
|
@@ -3218,7 +3218,7 @@ var zi = /* @__PURE__ */ new WeakMap(), Bi = /* @__PURE__ */ new WeakMap(), Vi =
|
|
|
3218
3218
|
(e = C(Yi, this)) == null || e.abort(), T(Yi, this, null), (t = C(Ki, this)) == null || t.abort(), T(Ki, this, null);
|
|
3219
3219
|
}
|
|
3220
3220
|
};
|
|
3221
|
-
|
|
3221
|
+
ie = Qi;
|
|
3222
3222
|
function $i(e) {
|
|
3223
3223
|
var t, n;
|
|
3224
3224
|
if ((t = C(Hi, this)) != null && t.call(this)) return;
|
|
@@ -3270,7 +3270,7 @@ function ea(e) {
|
|
|
3270
3270
|
let [n, r] = e.touches;
|
|
3271
3271
|
n.identifier > r.identifier && ([n, r] = [r, n]);
|
|
3272
3272
|
let { screenX: i, screenY: a } = n, { screenX: o, screenY: s } = r, c = C(Ji, this), { touch0X: l, touch0Y: u, touch1X: d, touch1Y: f } = c, p = d - l, m = f - u, h = o - i, g = s - a, _ = Math.hypot(h, g) || 1, v = Math.hypot(p, m) || 1;
|
|
3273
|
-
if (!C(Bi, this) && Math.abs(v - _) <=
|
|
3273
|
+
if (!C(Bi, this) && Math.abs(v - _) <= ie.MIN_TOUCH_DISTANCE_TO_PINCH) return;
|
|
3274
3274
|
if (c.touch0X = i, c.touch0Y = a, c.touch1X = o, c.touch1Y = s, !C(Bi, this)) {
|
|
3275
3275
|
T(Bi, this, !0);
|
|
3276
3276
|
return;
|
|
@@ -4144,7 +4144,7 @@ var na = /* @__PURE__ */ new WeakMap(), ra = /* @__PURE__ */ new WeakMap(), ia =
|
|
|
4144
4144
|
(t == null ? void 0 : t.nodeName) === "DIV" && t.classList.contains("annotationContent") && t.remove();
|
|
4145
4145
|
}
|
|
4146
4146
|
};
|
|
4147
|
-
|
|
4147
|
+
ae = W;
|
|
4148
4148
|
function Da([e, t], n, r) {
|
|
4149
4149
|
[n, r] = this.screenToPageTranslation(n, r), this.x += n / e, this.y += r / t, this._onTranslating(this.x, this.y), this.fixAndSetPosition();
|
|
4150
4150
|
}
|
|
@@ -4259,7 +4259,7 @@ function Na() {
|
|
|
4259
4259
|
});
|
|
4260
4260
|
}
|
|
4261
4261
|
function Pa(e, t) {
|
|
4262
|
-
let [n, r] = this.parentDimensions, i = this.x, a = this.y, o = this.width, s = this.height, c =
|
|
4262
|
+
let [n, r] = this.parentDimensions, i = this.x, a = this.y, o = this.width, s = this.height, c = ae.MIN_SIZE / n, l = ae.MIN_SIZE / r, u = m(U, this, ka).call(this, this.rotation), d = (e, t) => [u[0] * e + u[2] * t, u[1] * e + u[3] * t], f = m(U, this, ka).call(this, 360 - this.rotation), p = (e, t) => [f[0] * e + f[2] * t, f[1] * e + f[3] * t], h, g, _ = !1, v = !1;
|
|
4263
4263
|
switch (e) {
|
|
4264
4264
|
case "topLeft":
|
|
4265
4265
|
_ = !0, h = (e, t) => [0, 0], g = (e, t) => [e, t];
|
|
@@ -4286,7 +4286,7 @@ function Pa(e, t) {
|
|
|
4286
4286
|
v = !0, h = (e, t) => [0, t / 2], g = (e, t) => [e, t / 2];
|
|
4287
4287
|
break;
|
|
4288
4288
|
}
|
|
4289
|
-
let y = h(o, s), b = g(o, s), x = d(...b), S =
|
|
4289
|
+
let y = h(o, s), b = g(o, s), x = d(...b), S = ae._round(i + x[0]), w = ae._round(a + x[1]), E = 1, D = 1, ee, O;
|
|
4290
4290
|
if (t.fromKeyboard) ({deltaX: ee, deltaY: O} = t);
|
|
4291
4291
|
else {
|
|
4292
4292
|
let { screenX: e, screenY: n } = t, [r, i] = C(ua, this);
|
|
@@ -4296,15 +4296,15 @@ function Pa(e, t) {
|
|
|
4296
4296
|
let e = Math.hypot(o, s);
|
|
4297
4297
|
E = D = Math.max(Math.min(Math.hypot(b[0] - y[0] - ee, b[1] - y[1] - O) / e, 1 / o, 1 / s), c / o, l / s);
|
|
4298
4298
|
} else v ? E = B(Math.abs(b[0] - y[0] - ee), c, 1) / o : D = B(Math.abs(b[1] - y[1] - O), l, 1) / s;
|
|
4299
|
-
let k =
|
|
4300
|
-
x = d(...g(k,
|
|
4301
|
-
let
|
|
4299
|
+
let k = ae._round(o * E), A = ae._round(s * D);
|
|
4300
|
+
x = d(...g(k, A));
|
|
4301
|
+
let j = S - x[0], te = w - x[1];
|
|
4302
4302
|
C(ga, this) || T(ga, this, [
|
|
4303
4303
|
this.x,
|
|
4304
4304
|
this.y,
|
|
4305
4305
|
this.width,
|
|
4306
4306
|
this.height
|
|
4307
|
-
]), this.width = k, this.height =
|
|
4307
|
+
]), this.width = k, this.height = A, this.x = j, this.y = te, this.setDims(), this.fixAndSetPosition(), this._onResizing();
|
|
4308
4308
|
}
|
|
4309
4309
|
function Fa() {
|
|
4310
4310
|
var e;
|
|
@@ -4318,9 +4318,9 @@ function Fa() {
|
|
|
4318
4318
|
function Ia(e, t, n) {
|
|
4319
4319
|
let r = .7, i = n / t * r + 1 - r;
|
|
4320
4320
|
if (i === 1) return;
|
|
4321
|
-
let a = m(U, this, ka).call(this, this.rotation), o = (e, t) => [a[0] * e + a[2] * t, a[1] * e + a[3] * t], [s, c] = this.parentDimensions, l = this.x, u = this.y, d = this.width, f = this.height, p =
|
|
4321
|
+
let a = m(U, this, ka).call(this, this.rotation), o = (e, t) => [a[0] * e + a[2] * t, a[1] * e + a[3] * t], [s, c] = this.parentDimensions, l = this.x, u = this.y, d = this.width, f = this.height, p = ae.MIN_SIZE / s, h = ae.MIN_SIZE / c;
|
|
4322
4322
|
i = Math.max(Math.min(i, 1 / d, 1 / f), p / d, h / f);
|
|
4323
|
-
let g =
|
|
4323
|
+
let g = ae._round(d * i), _ = ae._round(f * i);
|
|
4324
4324
|
if (g === d && _ === f) return;
|
|
4325
4325
|
C(ga, this) || T(ga, this, [
|
|
4326
4326
|
l,
|
|
@@ -4328,7 +4328,7 @@ function Ia(e, t, n) {
|
|
|
4328
4328
|
d,
|
|
4329
4329
|
f
|
|
4330
4330
|
]);
|
|
4331
|
-
let v = o(d / 2, f / 2), y =
|
|
4331
|
+
let v = o(d / 2, f / 2), y = ae._round(l + v[0]), b = ae._round(u + v[1]), x = o(g / 2, _ / 2);
|
|
4332
4332
|
this.x = y - x[0], this.y = b - x[1], this.width = g, this.height = _, this.setDims(), this.fixAndSetPosition(), this._onResizing();
|
|
4333
4333
|
}
|
|
4334
4334
|
function La() {
|
|
@@ -4377,7 +4377,7 @@ function Ba() {
|
|
|
4377
4377
|
this.div.addEventListener("focusin", this.focusin.bind(this), { signal: e }), this.div.addEventListener("focusout", this.focusout.bind(this), { signal: e });
|
|
4378
4378
|
}
|
|
4379
4379
|
function Va(e) {
|
|
4380
|
-
|
|
4380
|
+
ae._resizerKeyboardManager.exec(this, e);
|
|
4381
4381
|
}
|
|
4382
4382
|
function Ha(e) {
|
|
4383
4383
|
var t;
|
|
@@ -4432,7 +4432,7 @@ var Ka = class extends W {
|
|
|
4432
4432
|
hash: "",
|
|
4433
4433
|
transfer: void 0
|
|
4434
4434
|
}), Qa = /* @__PURE__ */ new WeakMap(), $a = /* @__PURE__ */ new WeakMap(), eo = /* @__PURE__ */ new WeakMap(), to = /* @__PURE__ */ new WeakMap(), no = /* @__PURE__ */ new WeakSet();
|
|
4435
|
-
|
|
4435
|
+
me = Symbol.iterator;
|
|
4436
4436
|
var ro = class {
|
|
4437
4437
|
constructor() {
|
|
4438
4438
|
w(this, no), S(this, Qa, !1), S(this, $a, null), S(this, eo, null), S(this, to, /* @__PURE__ */ new Map()), v(this, "onSetModified", null), v(this, "onResetModified", null), v(this, "onAnnotationEditor", null);
|
|
@@ -4541,7 +4541,7 @@ var ro = class {
|
|
|
4541
4541
|
hash: t
|
|
4542
4542
|
});
|
|
4543
4543
|
}
|
|
4544
|
-
[
|
|
4544
|
+
[me]() {
|
|
4545
4545
|
return C(to, this).entries();
|
|
4546
4546
|
}
|
|
4547
4547
|
};
|
|
@@ -4627,7 +4627,7 @@ var po = new Uint32Array(new Uint8Array([
|
|
|
4627
4627
|
-Infinity,
|
|
4628
4628
|
Infinity,
|
|
4629
4629
|
Infinity
|
|
4630
|
-
]), S(this, yo, new Float64Array(
|
|
4630
|
+
]), S(this, yo, new Float64Array(ye)), v(this, "_pendingBBoxIdx", -1), S(this, bo, void 0), S(this, xo, void 0), S(this, So, void 0), S(this, Co, void 0), v(this, "_savesStack", []), v(this, "_markedContentStack", []), T(bo, this, e.width), T(xo, this, e.height), m(wo, this, Eo).call(this, t);
|
|
4631
4631
|
}
|
|
4632
4632
|
growOperationsCount(e) {
|
|
4633
4633
|
e >= C(Co, this).length && m(wo, this, Eo).call(this, e, C(Co, this));
|
|
@@ -4669,10 +4669,10 @@ var po = new Uint32Array(new Uint8Array([
|
|
|
4669
4669
|
return C(vo, this).length > 1 && C(vo, this).pop(), this;
|
|
4670
4670
|
}
|
|
4671
4671
|
resetBBox(e) {
|
|
4672
|
-
return this._pendingBBoxIdx !== e && (this._pendingBBoxIdx = e, C(yo, this).set(
|
|
4672
|
+
return this._pendingBBoxIdx !== e && (this._pendingBBoxIdx = e, C(yo, this).set(ye, 0)), this;
|
|
4673
4673
|
}
|
|
4674
4674
|
recordClipBox(e, t, n, r, i, a) {
|
|
4675
|
-
let o = z.multiplyByDOMMatrix(C(vo, this).at(-1), t.getTransform()), s =
|
|
4675
|
+
let o = z.multiplyByDOMMatrix(C(vo, this).at(-1), t.getTransform()), s = ye.slice();
|
|
4676
4676
|
z.axialAlignedBoundingBox([
|
|
4677
4677
|
n,
|
|
4678
4678
|
i,
|
|
@@ -4692,7 +4692,7 @@ var po = new Uint32Array(new Uint8Array([
|
|
|
4692
4692
|
r,
|
|
4693
4693
|
a
|
|
4694
4694
|
], s, C(yo, this)), this;
|
|
4695
|
-
let c =
|
|
4695
|
+
let c = ye.slice();
|
|
4696
4696
|
return z.axialAlignedBoundingBox([
|
|
4697
4697
|
n,
|
|
4698
4698
|
i,
|
|
@@ -5081,7 +5081,7 @@ var Do = /* @__PURE__ */ new WeakMap(), Oo = /* @__PURE__ */ new WeakMap(), ko =
|
|
|
5081
5081
|
}
|
|
5082
5082
|
let a = Nt(e), o;
|
|
5083
5083
|
if (r[0] !== Infinity) {
|
|
5084
|
-
let e =
|
|
5084
|
+
let e = ye.slice();
|
|
5085
5085
|
z.axialAlignedBoundingBox([
|
|
5086
5086
|
0,
|
|
5087
5087
|
-n,
|
|
@@ -5202,7 +5202,7 @@ var Do = /* @__PURE__ */ new WeakMap(), Oo = /* @__PURE__ */ new WeakMap(), ko =
|
|
|
5202
5202
|
return L(this, "isFontLoadingAPISupported", t);
|
|
5203
5203
|
}
|
|
5204
5204
|
get isSyncFontLoadingSupported() {
|
|
5205
|
-
return L(this, "isSyncFontLoadingSupported",
|
|
5205
|
+
return L(this, "isSyncFontLoadingSupported", ve || R.platform.isFirefox);
|
|
5206
5206
|
}
|
|
5207
5207
|
_queueLoadingCallback(e) {
|
|
5208
5208
|
function t() {
|
|
@@ -5404,7 +5404,7 @@ v(is, "strings", [
|
|
|
5404
5404
|
"src"
|
|
5405
5405
|
]);
|
|
5406
5406
|
var as = class {};
|
|
5407
|
-
|
|
5407
|
+
M = as, v(as, "bools", [
|
|
5408
5408
|
"black",
|
|
5409
5409
|
"bold",
|
|
5410
5410
|
"disableFontFace",
|
|
@@ -5424,7 +5424,7 @@ oe = as, v(as, "bools", [
|
|
|
5424
5424
|
"loadedName",
|
|
5425
5425
|
"mimetype",
|
|
5426
5426
|
"name"
|
|
5427
|
-
]), v(as, "OFFSET_NUMBERS", Math.ceil(
|
|
5427
|
+
]), v(as, "OFFSET_NUMBERS", Math.ceil(M.bools.length * 2 / 8)), v(as, "OFFSET_BBOX", M.OFFSET_NUMBERS + M.numbers.length * 8), v(as, "OFFSET_FONT_MATRIX", M.OFFSET_BBOX + 1 + 8), v(as, "OFFSET_DEFAULT_VMETRICS", M.OFFSET_FONT_MATRIX + 1 + 48), v(as, "OFFSET_STRINGS", M.OFFSET_DEFAULT_VMETRICS + 1 + 6);
|
|
5428
5428
|
var os = class {};
|
|
5429
5429
|
v(os, "KIND", 0), v(os, "HAS_BBOX", 1), v(os, "HAS_BACKGROUND", 2), v(os, "SHADING_TYPE", 3), v(os, "N_COORD", 4), v(os, "N_COLOR", 8), v(os, "N_STOP", 12), v(os, "N_FIGURES", 16);
|
|
5430
5430
|
var ss = /* @__PURE__ */ new WeakMap(), cs = /* @__PURE__ */ new WeakMap(), ls = /* @__PURE__ */ new WeakMap(), us = /* @__PURE__ */ new WeakSet(), ds = class {
|
|
@@ -5658,7 +5658,7 @@ var ks = class {
|
|
|
5658
5658
|
if (t === 3) {
|
|
5659
5659
|
let e = this.data[os.SHADING_TYPE], t = null;
|
|
5660
5660
|
if (c.length > 0) {
|
|
5661
|
-
t =
|
|
5661
|
+
t = ye.slice();
|
|
5662
5662
|
for (let e = 0, n = c.length; e < n; e += 2) z.pointBoundingBox(c[e], c[e + 1], t);
|
|
5663
5663
|
}
|
|
5664
5664
|
return [
|
|
@@ -5685,7 +5685,7 @@ var ks = class {
|
|
|
5685
5685
|
function Ms(e) {
|
|
5686
5686
|
if (e instanceof URL) return e;
|
|
5687
5687
|
if (typeof e == "string") {
|
|
5688
|
-
if (
|
|
5688
|
+
if (ve) {
|
|
5689
5689
|
if (/^[a-z][a-z0-9\-+.]+:/i.test(e)) return new URL(e);
|
|
5690
5690
|
let t = process.getBuiltinModule("url");
|
|
5691
5691
|
return new URL(t.pathToFileURL(e));
|
|
@@ -5696,7 +5696,7 @@ function Ms(e) {
|
|
|
5696
5696
|
throw Error("Invalid PDF url data: either string or URL-object is expected in the url property.");
|
|
5697
5697
|
}
|
|
5698
5698
|
function Ns(e) {
|
|
5699
|
-
if (
|
|
5699
|
+
if (ve && typeof Buffer < "u" && e instanceof Buffer) throw Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");
|
|
5700
5700
|
if (e instanceof Uint8Array && e.byteLength === e.buffer.byteLength) return e;
|
|
5701
5701
|
if (typeof e == "string") return et(e);
|
|
5702
5702
|
if (e instanceof ArrayBuffer || ArrayBuffer.isView(e) || typeof e == "object" && !isNaN(e == null ? void 0 : e.length)) return new Uint8Array(e);
|
|
@@ -6215,9 +6215,9 @@ var Zs = /* @__PURE__ */ new WeakMap(), Qs = class {
|
|
|
6215
6215
|
if (a) return a;
|
|
6216
6216
|
let o = `g_${C(sc, this)}_knockout_filter_${T(uc, this, (t = C(uc, this), n = t++, t)), n}`, s = m(K, this, gc).call(this, o);
|
|
6217
6217
|
fc.call(m(K, this)).set(i, s);
|
|
6218
|
-
let c = m(K, this, yc).call(this, o), l = C(cc, this).createElementNS(
|
|
6218
|
+
let c = m(K, this, yc).call(this, o), l = C(cc, this).createElementNS(Ce, "feComponentTransfer");
|
|
6219
6219
|
c.append(l);
|
|
6220
|
-
let u = C(cc, this).createElementNS(
|
|
6220
|
+
let u = C(cc, this).createElementNS(Ce, "feFuncA");
|
|
6221
6221
|
return u.setAttribute("type", "linear"), u.setAttribute("slope", `${r}`), u.setAttribute("intercept", "0"), l.append(u), s;
|
|
6222
6222
|
}
|
|
6223
6223
|
addHighlightHCMFilter(e, t, n, r, i) {
|
|
@@ -6266,8 +6266,8 @@ function mc() {
|
|
|
6266
6266
|
if (!C(oc, this)) {
|
|
6267
6267
|
let e = C(cc, this).createElement("div"), { style: t } = e;
|
|
6268
6268
|
t.colorScheme = "only light", t.visibility = "hidden", t.contain = "strict", t.width = t.height = 0, t.position = "absolute", t.top = t.left = 0, t.zIndex = -1;
|
|
6269
|
-
let n = C(cc, this).createElementNS(
|
|
6270
|
-
n.setAttribute("width", 0), n.setAttribute("height", 0), T(oc, this, C(cc, this).createElementNS(
|
|
6269
|
+
let n = C(cc, this).createElementNS(Ce, "svg");
|
|
6270
|
+
n.setAttribute("width", 0), n.setAttribute("height", 0), T(oc, this, C(cc, this).createElementNS(Ce, "defs")), e.append(n), n.append(C(oc, this)), C(cc, this).body.append(e);
|
|
6271
6271
|
}
|
|
6272
6272
|
return C(oc, this);
|
|
6273
6273
|
}
|
|
@@ -6299,27 +6299,27 @@ function gc(e) {
|
|
|
6299
6299
|
return `url(${C(ic, this)}#${e})`;
|
|
6300
6300
|
}
|
|
6301
6301
|
function _c(e) {
|
|
6302
|
-
let t = C(cc, this).createElementNS(
|
|
6302
|
+
let t = C(cc, this).createElementNS(Ce, "feColorMatrix");
|
|
6303
6303
|
t.setAttribute("type", "matrix"), t.setAttribute("values", "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"), e.append(t);
|
|
6304
6304
|
}
|
|
6305
6305
|
function vc(e) {
|
|
6306
|
-
let t = C(cc, this).createElementNS(
|
|
6306
|
+
let t = C(cc, this).createElementNS(Ce, "feColorMatrix");
|
|
6307
6307
|
t.setAttribute("type", "matrix"), t.setAttribute("values", "0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"), e.append(t);
|
|
6308
6308
|
}
|
|
6309
6309
|
function yc(e) {
|
|
6310
|
-
let t = C(cc, this).createElementNS(
|
|
6310
|
+
let t = C(cc, this).createElementNS(Ce, "filter");
|
|
6311
6311
|
return t.setAttribute("color-interpolation-filters", "sRGB"), t.setAttribute("id", e), mc.call(m(K, this)).append(t), t;
|
|
6312
6312
|
}
|
|
6313
6313
|
function bc(e, t, n) {
|
|
6314
|
-
let r = C(cc, this).createElementNS(
|
|
6314
|
+
let r = C(cc, this).createElementNS(Ce, t);
|
|
6315
6315
|
r.setAttribute("type", "discrete"), r.setAttribute("tableValues", n), e.append(r);
|
|
6316
6316
|
}
|
|
6317
6317
|
function xc(e, t, n, r) {
|
|
6318
|
-
let i = C(cc, this).createElementNS(
|
|
6318
|
+
let i = C(cc, this).createElementNS(Ce, "feComponentTransfer");
|
|
6319
6319
|
r.append(i), m(K, this, bc).call(this, i, "feFuncR", e), m(K, this, bc).call(this, i, "feFuncG", t), m(K, this, bc).call(this, i, "feFuncB", n);
|
|
6320
6320
|
}
|
|
6321
6321
|
function Sc(e, t) {
|
|
6322
|
-
let n = C(cc, this).createElementNS(
|
|
6322
|
+
let n = C(cc, this).createElementNS(Ce, "feComponentTransfer");
|
|
6323
6323
|
t.append(n), m(K, this, bc).call(this, n, "feFuncA", e);
|
|
6324
6324
|
}
|
|
6325
6325
|
function Cc(e) {
|
|
@@ -6345,7 +6345,7 @@ function Tc(e) {
|
|
|
6345
6345
|
function Ec(e, t, n) {
|
|
6346
6346
|
return Math.round(n * e + (1 - n) * t);
|
|
6347
6347
|
}
|
|
6348
|
-
|
|
6348
|
+
ve && F("Please use the `legacy` build in Node.js environments.");
|
|
6349
6349
|
function Dc(e) {
|
|
6350
6350
|
return Oc.apply(this, arguments);
|
|
6351
6351
|
}
|
|
@@ -6623,19 +6623,19 @@ function Zc(e, t, n, r, i, a, o, s) {
|
|
|
6623
6623
|
c[n * 2 + 1] > c[r * 2 + 1] && (f = n, n = r, r = f, f = a, a = o, o = f), c[r * 2 + 1] > c[i * 2 + 1] && (f = r, r = i, i = f, f = o, o = s, s = f), c[n * 2 + 1] > c[r * 2 + 1] && (f = n, n = r, r = f, f = a, a = o, o = f);
|
|
6624
6624
|
let p = (c[n * 2] + t.offsetX) * t.scaleX, m = (c[n * 2 + 1] + t.offsetY) * t.scaleY, h = (c[r * 2] + t.offsetX) * t.scaleX, g = (c[r * 2 + 1] + t.offsetY) * t.scaleY, _ = (c[i * 2] + t.offsetX) * t.scaleX, v = (c[i * 2 + 1] + t.offsetY) * t.scaleY;
|
|
6625
6625
|
if (m >= v) return;
|
|
6626
|
-
let y = l[a * 4], b = l[a * 4 + 1], x = l[a * 4 + 2], S = l[o * 4], C = l[o * 4 + 1], w = l[o * 4 + 2], T = l[s * 4], E = l[s * 4 + 1], D = l[s * 4 + 2], ee = Math.round(m), O = Math.round(v), k,
|
|
6626
|
+
let y = l[a * 4], b = l[a * 4 + 1], x = l[a * 4 + 2], S = l[o * 4], C = l[o * 4 + 1], w = l[o * 4 + 2], T = l[s * 4], E = l[s * 4 + 1], D = l[s * 4 + 2], ee = Math.round(m), O = Math.round(v), k, A, j, te, ne, re, ie, ae;
|
|
6627
6627
|
for (let e = ee; e <= O; e++) {
|
|
6628
6628
|
if (e < g) {
|
|
6629
6629
|
let t = e < m ? 0 : (m - e) / (m - g);
|
|
6630
|
-
k = p - (p - h) * t,
|
|
6630
|
+
k = p - (p - h) * t, A = y - (y - S) * t, j = b - (b - C) * t, te = x - (x - w) * t;
|
|
6631
6631
|
} else {
|
|
6632
6632
|
let t;
|
|
6633
|
-
t = e > v ? 1 : g === v ? 0 : (g - e) / (g - v), k = h - (h - _) * t,
|
|
6633
|
+
t = e > v ? 1 : g === v ? 0 : (g - e) / (g - v), k = h - (h - _) * t, A = S - (S - T) * t, j = C - (C - E) * t, te = w - (w - D) * t;
|
|
6634
6634
|
}
|
|
6635
6635
|
let t;
|
|
6636
|
-
t = e < m ? 0 : e > v ? 1 : (m - e) / (m - v),
|
|
6637
|
-
let n = Math.round(Math.min(k,
|
|
6638
|
-
for (let e = n; e <= r; e++) t = (k - e) / (k -
|
|
6636
|
+
t = e < m ? 0 : e > v ? 1 : (m - e) / (m - v), ne = p - (p - _) * t, re = y - (y - T) * t, ie = b - (b - E) * t, ae = x - (x - D) * t;
|
|
6637
|
+
let n = Math.round(Math.min(k, ne)), r = Math.round(Math.max(k, ne)), i = d * e + n * 4;
|
|
6638
|
+
for (let e = n; e <= r; e++) t = (k - e) / (k - ne), t < 0 ? t = 0 : t > 1 && (t = 1), u[i++] = A - (A - re) * t | 0, u[i++] = j - (j - ie) * t | 0, u[i++] = te - (te - ae) * t | 0, u[i++] = 255;
|
|
6639
6639
|
}
|
|
6640
6640
|
}
|
|
6641
6641
|
var Qc = class extends Yc {
|
|
@@ -6857,7 +6857,7 @@ function dl(e, t, n, r, i, a, o, s, c, l) {
|
|
|
6857
6857
|
}
|
|
6858
6858
|
var fl = class {
|
|
6859
6859
|
constructor(e, t) {
|
|
6860
|
-
v(this, "alphaIsShape", !1), v(this, "fontSize", 0), v(this, "fontSizeScale", 1), v(this, "textMatrix", null), v(this, "textMatrixScale", 1), v(this, "fontMatrix",
|
|
6860
|
+
v(this, "alphaIsShape", !1), v(this, "fontSize", 0), v(this, "fontSizeScale", 1), v(this, "textMatrix", null), v(this, "textMatrixScale", 1), v(this, "fontMatrix", xe), v(this, "leading", 0), v(this, "x", 0), v(this, "y", 0), v(this, "lineX", 0), v(this, "lineY", 0), v(this, "charSpacing", 0), v(this, "wordSpacing", 0), v(this, "textHScale", 1), v(this, "textRenderingMode", ke.FILL), v(this, "textRise", 0), v(this, "fillColor", "#000000"), v(this, "strokeColor", "#000000"), v(this, "tilingPatternDims", null), v(this, "patternFill", !1), v(this, "patternStroke", !1), v(this, "fillAlpha", 1), v(this, "strokeAlpha", 1), v(this, "lineWidth", 1), v(this, "activeSMask", null), v(this, "transferMaps", "none"), v(this, "minMax", be.slice()), this.clipBox = new Float32Array([
|
|
6861
6861
|
0,
|
|
6862
6862
|
0,
|
|
6863
6863
|
e,
|
|
@@ -6891,7 +6891,7 @@ var fl = class {
|
|
|
6891
6891
|
return this.minMax[0] === Infinity;
|
|
6892
6892
|
}
|
|
6893
6893
|
startNewPathAndClipBox(e) {
|
|
6894
|
-
this.clipBox.set(e, 0), this.minMax.set(
|
|
6894
|
+
this.clipBox.set(e, 0), this.minMax.set(be, 0);
|
|
6895
6895
|
}
|
|
6896
6896
|
getClippedPathBoundingBox(e = qc.FILL, t = null) {
|
|
6897
6897
|
return z.intersect(this.clipBox, this.getPathBoundingBox(e, t));
|
|
@@ -6899,18 +6899,18 @@ var fl = class {
|
|
|
6899
6899
|
};
|
|
6900
6900
|
function pl(e, t) {
|
|
6901
6901
|
let { width: n, height: r, kind: i } = t, a = r % sl, o = (r - a) / sl, s = a === 0 ? o : o + 1, c = e.createImageData(n, sl), l = 0, u = t.data, d = c.data, f;
|
|
6902
|
-
if (i ===
|
|
6902
|
+
if (i === Ae.GRAYSCALE_1BPP) for (f = 0; f < s; f++) ({srcPos: l} = Mc({
|
|
6903
6903
|
src: u,
|
|
6904
6904
|
srcPos: l,
|
|
6905
6905
|
dest: d,
|
|
6906
6906
|
width: n,
|
|
6907
6907
|
height: f < o ? sl : a
|
|
6908
6908
|
})), e.putImageData(c, 0, f * sl);
|
|
6909
|
-
else if (i ===
|
|
6909
|
+
else if (i === Ae.RGBA_32BPP) {
|
|
6910
6910
|
let t = 0, r = n * sl * 4;
|
|
6911
6911
|
for (f = 0; f < o; f++) d.set(u.subarray(l, l + r)), l += r, e.putImageData(c, 0, t), t += sl;
|
|
6912
6912
|
f < s && (r = n * a * 4, d.set(u.subarray(l, l + r)), e.putImageData(c, 0, t));
|
|
6913
|
-
} else if (i ===
|
|
6913
|
+
} else if (i === Ae.RGB_24BPP) for (f = 0; f < s; f++) ({srcPos: l} = Nc({
|
|
6914
6914
|
src: u,
|
|
6915
6915
|
srcPos: l,
|
|
6916
6916
|
dest: new Uint32Array(d.buffer),
|
|
@@ -7002,7 +7002,7 @@ var vl = [
|
|
|
7002
7002
|
}
|
|
7003
7003
|
if (!i || i(s)) {
|
|
7004
7004
|
var g;
|
|
7005
|
-
if (m = o[s], h = (g = a[s]) == null ? null : g, m !==
|
|
7005
|
+
if (m = o[s], h = (g = a[s]) == null ? null : g, m !== Pe.dependency) h === null ? this[m](s) : this[m](s, ...h);
|
|
7006
7006
|
else for (let e of h) {
|
|
7007
7007
|
var _;
|
|
7008
7008
|
(_ = this.dependencyTracker) == null || _.recordNamedData(e, s);
|
|
@@ -7098,7 +7098,7 @@ var vl = [
|
|
|
7098
7098
|
0,
|
|
7099
7099
|
-a
|
|
7100
7100
|
]);
|
|
7101
|
-
let h =
|
|
7101
|
+
let h = be.slice();
|
|
7102
7102
|
z.axialAlignedBoundingBox([
|
|
7103
7103
|
0,
|
|
7104
7104
|
0,
|
|
@@ -7335,16 +7335,16 @@ var vl = [
|
|
|
7335
7335
|
constructPath(e, t, n, r) {
|
|
7336
7336
|
let [i] = n;
|
|
7337
7337
|
if (!r) {
|
|
7338
|
-
i || (i = n[0] = new Path2D()), t !==
|
|
7338
|
+
i || (i = n[0] = new Path2D()), t !== Pe.stroke && t !== Pe.closeStroke && (this.current.tilingPatternDims = null), this[t](e, i);
|
|
7339
7339
|
return;
|
|
7340
7340
|
}
|
|
7341
7341
|
if (this.dependencyTracker !== null) {
|
|
7342
|
-
let n = t ===
|
|
7342
|
+
let n = t === Pe.stroke ? this.current.lineWidth / 2 : 0;
|
|
7343
7343
|
this.dependencyTracker.resetBBox(e).recordBBox(e, this.ctx, r[0] - n, r[2] + n, r[1] - n, r[3] + n).recordDependencies(e, ["transform"]);
|
|
7344
7344
|
}
|
|
7345
7345
|
i instanceof Path2D || (i = n[0] = Jt(i)), z.axialAlignedBoundingBox(r, Nt(this.ctx), this.current.minMax);
|
|
7346
7346
|
let a = this.current.tilingPatternDims;
|
|
7347
|
-
if (a && t !==
|
|
7347
|
+
if (a && t !== Pe.stroke && t !== Pe.closeStroke && this.current.fillColor instanceof nl) {
|
|
7348
7348
|
let e = z.intersect(this.current.clipBox, this.current.minMax);
|
|
7349
7349
|
e ? this.current.fillColor.updatePatternDims(e, a) : this.current.tilingPatternDims = null;
|
|
7350
7350
|
}
|
|
@@ -7462,7 +7462,7 @@ var vl = [
|
|
|
7462
7462
|
(r = this.dependencyTracker) == null || r.recordSimpleData("font", e).recordSimpleDataFromNamed("fontObj", t, e);
|
|
7463
7463
|
let a = this.commonObjs.get(t), o = this.current;
|
|
7464
7464
|
if (!a) throw Error(`Can't find font for ${t}`);
|
|
7465
|
-
if (o.fontMatrix = a.fontMatrix ||
|
|
7465
|
+
if (o.fontMatrix = a.fontMatrix || xe, (o.fontMatrix[0] === 0 || o.fontMatrix[3] === 0) && F("Invalid font matrix for font " + t), n < 0 ? (n = -n, o.fontDirection = -1) : o.fontDirection = 1, this.current.font = a, this.current.fontSize = n, a.isType3Font) return;
|
|
7466
7466
|
let s = a.loadedName || "sans-serif", c = ((i = a.systemFontInfo) == null ? void 0 : i.css) || `"${s}", ${a.fallbackName}`, l = "normal";
|
|
7467
7467
|
a.black ? l = "900" : a.bold && (l = "bold");
|
|
7468
7468
|
let u = a.italic ? "italic" : "normal", d = B(n, rl, il);
|
|
@@ -7494,17 +7494,17 @@ var vl = [
|
|
|
7494
7494
|
this.moveText(e, 0, this.current.leading), (t = this.dependencyTracker) == null || t.recordIncrementalData("moveText", (n = this.dependencyTracker.getSimpleIndex("leading")) == null ? e : n);
|
|
7495
7495
|
}
|
|
7496
7496
|
paintChar(e, t, n, r, i, a) {
|
|
7497
|
-
let o = this.ctx, s = this.current, c = s.font, l = s.textRenderingMode, u = s.fontSize / s.fontSizeScale, d = l &
|
|
7497
|
+
let o = this.ctx, s = this.current, c = s.font, l = s.textRenderingMode, u = s.fontSize / s.fontSizeScale, d = l & ke.FILL_STROKE_MASK, f = !!(l & ke.ADD_TO_PATH_FLAG), p = s.patternFill && !c.missingFile, h = s.patternStroke && !c.missingFile, g;
|
|
7498
7498
|
if ((c.disableFontFace || f || p || h) && !c.missingFile && (g = c.getPathGenerator(this.commonObjs, t)), g && (c.disableFontFace || p || h)) {
|
|
7499
7499
|
var _;
|
|
7500
7500
|
o.save(), o.translate(n, r), o.scale(u, -u), (_ = this.dependencyTracker) == null || _.recordCharacterBBox(e, o, c);
|
|
7501
7501
|
let t;
|
|
7502
|
-
if (d ===
|
|
7502
|
+
if (d === ke.FILL || d === ke.FILL_STROKE) if (i) {
|
|
7503
7503
|
t = o.getTransform(), o.setTransform(...i);
|
|
7504
7504
|
let e = m(q, this, Bl).call(this, g, t, i);
|
|
7505
7505
|
o.fill(e);
|
|
7506
7506
|
} else o.fill(g);
|
|
7507
|
-
if (d ===
|
|
7507
|
+
if (d === ke.STROKE || d === ke.FILL_STROKE) if (a) {
|
|
7508
7508
|
t || (t = o.getTransform()), o.setTransform(...a);
|
|
7509
7509
|
let { a: e, b: n, c: r, d: i } = t, s = z.inverseTransform(a), c = z.transform([
|
|
7510
7510
|
e,
|
|
@@ -7518,11 +7518,11 @@ var vl = [
|
|
|
7518
7518
|
} else o.lineWidth /= u, o.stroke(g);
|
|
7519
7519
|
o.restore();
|
|
7520
7520
|
} else {
|
|
7521
|
-
if (d ===
|
|
7521
|
+
if (d === ke.FILL || d === ke.FILL_STROKE) {
|
|
7522
7522
|
var v;
|
|
7523
7523
|
o.fillText(t, n, r), (v = this.dependencyTracker) == null || v.recordCharacterBBox(e, o, c, u, n, r, () => o.measureText(t));
|
|
7524
7524
|
}
|
|
7525
|
-
if (d ===
|
|
7525
|
+
if (d === ke.STROKE || d === ke.FILL_STROKE) {
|
|
7526
7526
|
if (this.dependencyTracker) {
|
|
7527
7527
|
var y;
|
|
7528
7528
|
(y = this.dependencyTracker) == null || y.recordCharacterBBox(e, o, c, u, n, r, () => o.measureText(t)).recordDependencies(e, Ho.stroke);
|
|
@@ -7555,7 +7555,7 @@ var vl = [
|
|
|
7555
7555
|
}
|
|
7556
7556
|
showText(e, t) {
|
|
7557
7557
|
var n;
|
|
7558
|
-
this.dependencyTracker && (this.dependencyTracker.recordDependencies(e, Ho.showText).resetBBox(e), this.current.textRenderingMode &
|
|
7558
|
+
this.dependencyTracker && (this.dependencyTracker.recordDependencies(e, Ho.showText).resetBBox(e), this.current.textRenderingMode & ke.ADD_TO_PATH_FLAG && this.dependencyTracker.recordFutureForcedDependency("textClip", e).inheritPendingDependenciesAsFutureForcedDependencies());
|
|
7559
7559
|
let r = this.current, i = r.font;
|
|
7560
7560
|
if (i.isType3Font) {
|
|
7561
7561
|
var a;
|
|
@@ -7569,9 +7569,9 @@ var vl = [
|
|
|
7569
7569
|
(s = this.dependencyTracker) == null || s.recordOperation(e);
|
|
7570
7570
|
return;
|
|
7571
7571
|
}
|
|
7572
|
-
let c = m(q, this, Rl).call(this, r.fillAlpha), l = this.ctx, u = r.fontSizeScale, d = r.charSpacing, f = r.wordSpacing, p = r.fontDirection, h = r.textHScale * p, g = t.length, _ = i.vertical, v = _ ? 1 : -1, y = i.defaultVMetrics, b = o * r.fontMatrix[0], x = r.textRenderingMode ===
|
|
7572
|
+
let c = m(q, this, Rl).call(this, r.fillAlpha), l = this.ctx, u = r.fontSizeScale, d = r.charSpacing, f = r.wordSpacing, p = r.fontDirection, h = r.textHScale * p, g = t.length, _ = i.vertical, v = _ ? 1 : -1, y = i.defaultVMetrics, b = o * r.fontMatrix[0], x = r.textRenderingMode === ke.FILL && !i.disableFontFace && !r.patternFill;
|
|
7573
7573
|
l.save(), r.textMatrix && l.transform(...r.textMatrix), l.translate(r.x, r.y + r.textRise), p > 0 ? l.scale(h, -1) : l.scale(h, 1);
|
|
7574
|
-
let S, C, w = r.textRenderingMode &
|
|
7574
|
+
let S, C, w = r.textRenderingMode & ke.FILL_STROKE_MASK, T = w === ke.FILL || w === ke.FILL_STROKE, E = w === ke.STROKE || w === ke.FILL_STROKE, D = r.lineWidth, ee = r.textMatrixScale;
|
|
7575
7575
|
if (ee === 0 || D === 0 ? E && (D = this.getSinglePixelWidth()) : D /= ee, u !== 1 && (l.scale(u, u), D /= u), l.lineWidth = D, T && r.patternFill) {
|
|
7576
7576
|
l.save();
|
|
7577
7577
|
let t = r.fillColor.getPattern(l, this, Pt(l), qc.FILL, e);
|
|
@@ -7616,8 +7616,8 @@ var vl = [
|
|
|
7616
7616
|
}
|
|
7617
7617
|
if (this.contentVisible && (n.isInFont || i.missingFile)) {
|
|
7618
7618
|
if (x && !c) {
|
|
7619
|
-
var
|
|
7620
|
-
l.fillText(s, m, h), (
|
|
7619
|
+
var A;
|
|
7620
|
+
l.fillText(s, m, h), (A = this.dependencyTracker) == null || A.recordCharacterBBox(e, l, w ? { bbox: null } : i, o / u, m, h, () => {
|
|
7621
7621
|
var e;
|
|
7622
7622
|
return (e = w) == null ? l.measureText(s) : e;
|
|
7623
7623
|
});
|
|
@@ -7632,7 +7632,7 @@ var vl = [
|
|
|
7632
7632
|
_ ? r.y -= O : r.x += O * h, l.restore(), this.compose(), (n = this.dependencyTracker) == null || n.recordShowTextOperation(e), m(q, this, zl).call(this, c);
|
|
7633
7633
|
}
|
|
7634
7634
|
showType3Text(e, t) {
|
|
7635
|
-
let n = this.ctx, r = this.current, i = r.font, a = r.fontSize, o = r.fontDirection, s = i.vertical ? 1 : -1, c = r.charSpacing, l = r.wordSpacing, u = r.textHScale * o, d = r.fontMatrix ||
|
|
7635
|
+
let n = this.ctx, r = this.current, i = r.font, a = r.fontSize, o = r.fontDirection, s = i.vertical ? 1 : -1, c = r.charSpacing, l = r.wordSpacing, u = r.textHScale * o, d = r.fontMatrix || xe, f = t.length, p = r.textRenderingMode === ke.INVISIBLE, m, h, g, _;
|
|
7636
7636
|
if (p || a === 0) return;
|
|
7637
7637
|
this._cachedScaleForStroking[0] = -1, this._cachedGetSinglePixelWidth = null, n.save(), r.textMatrix && n.transform(...r.textMatrix), n.translate(r.x, r.y + r.textRise), n.scale(u, o);
|
|
7638
7638
|
let v = this.dependencyTracker;
|
|
@@ -7642,7 +7642,7 @@ var vl = [
|
|
|
7642
7642
|
continue;
|
|
7643
7643
|
}
|
|
7644
7644
|
let e = (h.isSpace ? l : 0) + c, o = i.charProcOperatorList[h.operatorListId];
|
|
7645
|
-
o ? this.contentVisible && (this.save(), o.fnArray[0] ===
|
|
7645
|
+
o ? this.contentVisible && (this.save(), o.fnArray[0] === Pe.setCharWidth && (r.fillAlpha = r.strokeAlpha = 1, n.globalAlpha = 1), n.scale(a, a), n.transform(...d), this.executeOperatorList(o), this.restore()) : F(`Type3 character "${h.operatorListId}" is not available.`);
|
|
7646
7646
|
let f = [h.width, 0];
|
|
7647
7647
|
z.applyTransform(f, d), g = f[0] * a + e, n.translate(g, 0), r.x += g * u;
|
|
7648
7648
|
}
|
|
@@ -7707,7 +7707,7 @@ var vl = [
|
|
|
7707
7707
|
this.save(e), i.fillStyle = this._getPattern(e, t).getPattern(i, this, Pt(i), qc.SHADING, e);
|
|
7708
7708
|
let a = Pt(i);
|
|
7709
7709
|
if (a) {
|
|
7710
|
-
let { width: e, height: t } = i.canvas, n =
|
|
7710
|
+
let { width: e, height: t } = i.canvas, n = be.slice();
|
|
7711
7711
|
z.axialAlignedBoundingBox([
|
|
7712
7712
|
0,
|
|
7713
7713
|
0,
|
|
@@ -7764,7 +7764,7 @@ var vl = [
|
|
|
7764
7764
|
i.canvas.width,
|
|
7765
7765
|
i.canvas.height
|
|
7766
7766
|
], s;
|
|
7767
|
-
t.bbox ? (s =
|
|
7767
|
+
t.bbox ? (s = be.slice(), z.axialAlignedBoundingBox(t.bbox, Nt(i), s), s = z.intersect(s, o) || [
|
|
7768
7768
|
0,
|
|
7769
7769
|
0,
|
|
7770
7770
|
0,
|
|
@@ -7834,7 +7834,7 @@ var vl = [
|
|
|
7834
7834
|
this.ctx.restore();
|
|
7835
7835
|
let t = Nt(this.ctx);
|
|
7836
7836
|
this.restore(e), this.ctx.save(), this.ctx.setTransform(...t);
|
|
7837
|
-
let n =
|
|
7837
|
+
let n = be.slice();
|
|
7838
7838
|
z.axialAlignedBoundingBox([
|
|
7839
7839
|
0,
|
|
7840
7840
|
0,
|
|
@@ -8211,7 +8211,7 @@ function Vl(e) {
|
|
|
8211
8211
|
function Hl(e) {
|
|
8212
8212
|
e && (e.knockoutMaskEntry && (this.canvasFactory.destroy(e.knockoutMaskEntry), e.knockoutMaskEntry = null), e.knockoutTempEntry && (this.canvasFactory.destroy(e.knockoutTempEntry), e.knockoutTempEntry = null), e.knockoutBackdropEntry && (this.canvasFactory.destroy(e.knockoutBackdropEntry), e.knockoutBackdropEntry = null));
|
|
8213
8213
|
}
|
|
8214
|
-
for (let e in
|
|
8214
|
+
for (let e in Pe) Ml.prototype[e] !== void 0 && (Ml.prototype[Pe[e]] = Ml.prototype[e]);
|
|
8215
8215
|
var Ul = /* @__PURE__ */ new WeakMap(), Wl = /* @__PURE__ */ new WeakMap(), Gl = class {
|
|
8216
8216
|
constructor(e, t, n) {
|
|
8217
8217
|
S(this, Ul, null), S(this, Wl, null), v(this, "_fullReader", null), v(this, "_rangeReaders", /* @__PURE__ */ new Set()), v(this, "_source", null), this._source = e, T(Ul, this, t), T(Wl, this, n);
|
|
@@ -8843,7 +8843,7 @@ var Ru = class extends Gl {
|
|
|
8843
8843
|
}
|
|
8844
8844
|
};
|
|
8845
8845
|
function Vu(e) {
|
|
8846
|
-
return Tt(e) ? iu :
|
|
8846
|
+
return Tt(e) ? iu : ve ? Ru : xu;
|
|
8847
8847
|
}
|
|
8848
8848
|
var Hu = class e {
|
|
8849
8849
|
static get workerPort() {
|
|
@@ -8861,7 +8861,7 @@ var Hu = class e {
|
|
|
8861
8861
|
Wu._ = m(e, this, t);
|
|
8862
8862
|
}
|
|
8863
8863
|
}, Uu = { _: null }, Wu = { _: "" }, Gu = /* @__PURE__ */ new WeakMap(), Ku = /* @__PURE__ */ new WeakMap();
|
|
8864
|
-
|
|
8864
|
+
he = Symbol.iterator;
|
|
8865
8865
|
var qu = class {
|
|
8866
8866
|
constructor({ parsedData: e, rawData: t }) {
|
|
8867
8867
|
S(this, Gu, void 0), S(this, Ku, void 0), T(Gu, this, e), T(Ku, this, t);
|
|
@@ -8873,12 +8873,12 @@ var qu = class {
|
|
|
8873
8873
|
var t;
|
|
8874
8874
|
return (t = C(Gu, this).get(e)) == null ? null : t;
|
|
8875
8875
|
}
|
|
8876
|
-
[
|
|
8876
|
+
[he]() {
|
|
8877
8877
|
return C(Gu, this).entries();
|
|
8878
8878
|
}
|
|
8879
8879
|
}, Ju = Symbol("INTERNAL"), Yu = /* @__PURE__ */ new WeakMap(), Xu = /* @__PURE__ */ new WeakMap(), Zu = /* @__PURE__ */ new WeakMap(), Qu = /* @__PURE__ */ new WeakMap(), $u = class {
|
|
8880
8880
|
constructor(e, { name: t, intent: n, usage: r, rbGroups: i }) {
|
|
8881
|
-
S(this, Yu, !1), S(this, Xu, !1), S(this, Zu, !1), S(this, Qu, !0), T(Yu, this, !!(e &
|
|
8881
|
+
S(this, Yu, !1), S(this, Xu, !1), S(this, Zu, !1), S(this, Qu, !0), T(Yu, this, !!(e & we.DISPLAY)), T(Xu, this, !!(e & we.PRINT)), this.name = t, this.intent = n, this.usage = r, this.rbGroups = i;
|
|
8882
8882
|
}
|
|
8883
8883
|
get visible() {
|
|
8884
8884
|
if (C(Zu, this)) return C(Qu, this);
|
|
@@ -8896,9 +8896,9 @@ var qu = class {
|
|
|
8896
8896
|
};
|
|
8897
8897
|
}
|
|
8898
8898
|
}, ed = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakMap(), td = /* @__PURE__ */ new WeakMap(), nd = /* @__PURE__ */ new WeakMap(), rd = /* @__PURE__ */ new WeakMap(), id = /* @__PURE__ */ new WeakSet();
|
|
8899
|
-
|
|
8899
|
+
ge = Symbol.iterator;
|
|
8900
8900
|
var ad = class e {
|
|
8901
|
-
constructor(e, t =
|
|
8901
|
+
constructor(e, t = we.DISPLAY, n = null) {
|
|
8902
8902
|
if (w(this, id), S(this, ed, null), S(this, J, /* @__PURE__ */ new Map()), S(this, td, null), S(this, nd, null), S(this, rd, void 0), v(this, "creator", null), v(this, "name", null), T(rd, this, e), this.renderingIntent = t, e !== null) {
|
|
8903
8903
|
this.name = e.name, this.creator = e.creator, T(nd, this, e.order);
|
|
8904
8904
|
for (let n of e.groups) C(J, this).set(n.id, new $u(t, n));
|
|
@@ -9002,7 +9002,7 @@ var ad = class e {
|
|
|
9002
9002
|
for (let [t, n] of C(J, this)) e.update(`${t}:${n.visible}`);
|
|
9003
9003
|
return T(ed, this, e.hexdigest());
|
|
9004
9004
|
}
|
|
9005
|
-
[
|
|
9005
|
+
[ge]() {
|
|
9006
9006
|
return C(J, this).entries();
|
|
9007
9007
|
}
|
|
9008
9008
|
get serializable() {
|
|
@@ -9178,7 +9178,7 @@ function gd(e, t = null, n = -1, r = null) {
|
|
|
9178
9178
|
}
|
|
9179
9179
|
}
|
|
9180
9180
|
var _d = Symbol("INITIAL_DATA"), vd = () => D(D({}, Promise.withResolvers()), {}, { data: _d }), yd = /* @__PURE__ */ new WeakMap();
|
|
9181
|
-
|
|
9181
|
+
_e = Symbol.iterator;
|
|
9182
9182
|
var bd = class {
|
|
9183
9183
|
constructor() {
|
|
9184
9184
|
S(this, yd, /* @__PURE__ */ new Map());
|
|
@@ -9212,7 +9212,7 @@ var bd = class {
|
|
|
9212
9212
|
}
|
|
9213
9213
|
C(yd, this).clear();
|
|
9214
9214
|
}
|
|
9215
|
-
*[
|
|
9215
|
+
*[_e]() {
|
|
9216
9216
|
for (let [e, { data: t }] of C(yd, this)) t !== _d && (yield [e, t]);
|
|
9217
9217
|
}
|
|
9218
9218
|
}, xd = 1e5, Sd = 30, Cd = /* @__PURE__ */ new WeakMap(), wd = /* @__PURE__ */ new WeakMap(), Td = /* @__PURE__ */ new WeakMap(), Ed = /* @__PURE__ */ new WeakMap(), Dd = /* @__PURE__ */ new WeakMap(), Od = /* @__PURE__ */ new WeakMap(), kd = /* @__PURE__ */ new WeakMap(), Ad = /* @__PURE__ */ new WeakMap(), jd = /* @__PURE__ */ new WeakMap(), Md = /* @__PURE__ */ new WeakMap(), Nd = /* @__PURE__ */ new WeakMap(), Pd = /* @__PURE__ */ new WeakMap(), Fd = /* @__PURE__ */ new WeakMap(), Id = /* @__PURE__ */ new WeakMap(), Ld = /* @__PURE__ */ new WeakMap(), Rd = /* @__PURE__ */ new WeakMap(), zd = /* @__PURE__ */ new WeakMap(), Bd = /* @__PURE__ */ new WeakMap(), Vd = /* @__PURE__ */ new WeakMap(), Hd = /* @__PURE__ */ new WeakSet(), Ud = class e {
|
|
@@ -9288,11 +9288,11 @@ var bd = class {
|
|
|
9288
9288
|
}
|
|
9289
9289
|
}
|
|
9290
9290
|
};
|
|
9291
|
-
|
|
9291
|
+
oe = Ud;
|
|
9292
9292
|
function Wd(e) {
|
|
9293
9293
|
var t;
|
|
9294
9294
|
if (C(Td, this)) return;
|
|
9295
|
-
(t = C(kd, this)).ctx != null || (t.ctx = qd.call(
|
|
9295
|
+
(t = C(kd, this)).ctx != null || (t.ctx = qd.call(oe, C(Od, this)));
|
|
9296
9296
|
let n = C(zd, this), r = C(Ld, this);
|
|
9297
9297
|
for (let t of e) {
|
|
9298
9298
|
if (n.length > xd) {
|
|
@@ -9321,8 +9321,8 @@ function Gd(e) {
|
|
|
9321
9321
|
let r = z.transform(C(Vd, this), e.transform), i = Math.atan2(r[1], r[0]), a = C(Id, this)[e.fontName];
|
|
9322
9322
|
a.vertical && (i += Math.PI / 2);
|
|
9323
9323
|
let o = C(Ed, this) && a.fontSubstitution || a.fontFamily;
|
|
9324
|
-
o =
|
|
9325
|
-
let s = Math.hypot(r[2], r[3]), c = s * Xd.call(
|
|
9324
|
+
o = oe.fontFamilyMap.get(o) || o;
|
|
9325
|
+
let s = Math.hypot(r[2], r[3]), c = s * Xd.call(oe, o, a, C(Od, this)), l, u;
|
|
9326
9326
|
i === 0 ? (l = r[4], u = r[5] - c) : (l = r[4] + c * Math.sin(i), u = r[5] - c * Math.cos(i));
|
|
9327
9327
|
let d = t.style;
|
|
9328
9328
|
d.left = `${(100 * l / C(jd, this)).toFixed(2)}%`, d.top = `${(100 * u / C(Ad, this)).toFixed(2)}%`, d.setProperty("--font-height", `${s.toFixed(2)}px`), d.fontFamily = o, n.fontSize = s, t.setAttribute("role", "presentation"), t.textContent = e.str, t.dir = e.dir, C(Ed, this) && (t.dataset.fontName = a.fontSubstitutionLoadedName || e.fontName), i !== 0 && (n.angle = 180 / Math.PI * i);
|
|
@@ -9341,20 +9341,20 @@ function Kd(e) {
|
|
|
9341
9341
|
let { div: t, properties: n, ctx: r } = e, { style: i } = t;
|
|
9342
9342
|
if (n.canvasWidth !== 0 && n.hasText) {
|
|
9343
9343
|
let { fontFamily: e } = i, { canvasWidth: a, fontSize: o } = n;
|
|
9344
|
-
Jd.call(
|
|
9344
|
+
Jd.call(oe, r, o * C(Fd, this), e);
|
|
9345
9345
|
let { width: s } = r.measureText(t.textContent);
|
|
9346
9346
|
s > 0 && i.setProperty("--scale-x", a * C(Fd, this) / s);
|
|
9347
9347
|
}
|
|
9348
9348
|
n.angle !== 0 && i.setProperty("--rotate", `${n.angle}deg`);
|
|
9349
9349
|
}
|
|
9350
9350
|
function qd(e = null) {
|
|
9351
|
-
let t = m(
|
|
9351
|
+
let t = m(oe, this, Qd)._.get(e || (e = ""));
|
|
9352
9352
|
if (!t) {
|
|
9353
9353
|
let n = document.createElement("canvas");
|
|
9354
9354
|
n.style.cssText = "position:absolute;top:0;left:0;width:0;height:0;display:none;letter-spacing:normal;word-spacing:normal", n.lang = e, document.body.append(n), t = n.getContext("2d", {
|
|
9355
9355
|
alpha: !1,
|
|
9356
9356
|
willReadFrequently: !0
|
|
9357
|
-
}), m(
|
|
9357
|
+
}), m(oe, this, Qd)._.set(e, t), m(oe, this, $d)._.set(t, {
|
|
9358
9358
|
size: 0,
|
|
9359
9359
|
family: ""
|
|
9360
9360
|
});
|
|
@@ -9362,39 +9362,39 @@ function qd(e = null) {
|
|
|
9362
9362
|
return t;
|
|
9363
9363
|
}
|
|
9364
9364
|
function Jd(e, t, n) {
|
|
9365
|
-
let r = m(
|
|
9365
|
+
let r = m(oe, this, $d)._.get(e);
|
|
9366
9366
|
t === r.size && n === r.family || (e.font = `${t}px ${n}`, r.size = t, r.family = n);
|
|
9367
9367
|
}
|
|
9368
9368
|
function Yd() {
|
|
9369
|
-
if (m(
|
|
9369
|
+
if (m(oe, this, ef)._ !== null) return;
|
|
9370
9370
|
let e = document.createElement("div");
|
|
9371
|
-
e.style.opacity = 0, e.style.lineHeight = 1, e.style.fontSize = "1px", e.style.position = "absolute", e.textContent = "X", document.body.append(e), ef._ = m(
|
|
9371
|
+
e.style.opacity = 0, e.style.lineHeight = 1, e.style.fontSize = "1px", e.style.position = "absolute", e.textContent = "X", document.body.append(e), ef._ = m(oe, this, e.getBoundingClientRect().height), e.remove();
|
|
9372
9372
|
}
|
|
9373
9373
|
function Xd(e, t, n) {
|
|
9374
|
-
let r = m(
|
|
9374
|
+
let r = m(oe, this, Zd)._.get(e);
|
|
9375
9375
|
if (r) return r;
|
|
9376
|
-
let i = m(
|
|
9377
|
-
i.canvas.width = i.canvas.height = Sd, m(
|
|
9376
|
+
let i = m(oe, this, qd).call(this, n);
|
|
9377
|
+
i.canvas.width = i.canvas.height = Sd, m(oe, this, Jd).call(this, i, Sd, e);
|
|
9378
9378
|
let a = i.measureText(""), o = a.fontBoundingBoxAscent, s = Math.abs(a.fontBoundingBoxDescent);
|
|
9379
9379
|
i.canvas.width = i.canvas.height = 0;
|
|
9380
9380
|
let c = .8;
|
|
9381
|
-
return o ? c = o / (o + s) : (R.platform.isFirefox && F("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."), t.ascent ? c = t.ascent : t.descent && (c = 1 + t.descent)), m(
|
|
9381
|
+
return o ? c = o / (o + s) : (R.platform.isFirefox && F("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."), t.ascent ? c = t.ascent : t.descent && (c = 1 + t.descent)), m(oe, this, Zd)._.set(e, c), c;
|
|
9382
9382
|
}
|
|
9383
9383
|
var Zd = { _: /* @__PURE__ */ new Map() }, Qd = { _: /* @__PURE__ */ new Map() }, $d = { _: /* @__PURE__ */ new WeakMap() }, ef = { _: null }, tf = { _: /* @__PURE__ */ new Set() }, nf = 100;
|
|
9384
9384
|
function rf(e = {}) {
|
|
9385
9385
|
var t;
|
|
9386
|
-
let n = new af(), { docId: r } = n, i = e.url ? Ms(e.url) : null, a = e.data ? Ns(e.data) : null, o = e.httpHeaders || null, s = e.withCredentials === !0, c = (t = e.password) == null ? null : t, l = e.range instanceof lf ? e.range : null, u = Number.isInteger(e.rangeChunkSize) && e.rangeChunkSize > 0 ? e.rangeChunkSize : Math.pow(2, 16), d = e.worker instanceof xf ? e.worker : null, f = e.verbosity, p = typeof e.docBaseUrl == "string" && !yt(e.docBaseUrl) ? e.docBaseUrl : null, m = Ps(e.cMapUrl), h = e.cMapPacked !== !1, g = Ps(e.iccUrl), _ = Ps(e.standardFontDataUrl), v = Ps(e.wasmUrl), y = e.stopAtErrors !== !0, b = Number.isInteger(e.maxImageSize) && e.maxImageSize > -1 ? e.maxImageSize : -1, x = typeof e.isOffscreenCanvasSupported == "boolean" ? e.isOffscreenCanvasSupported : !
|
|
9386
|
+
let n = new af(), { docId: r } = n, i = e.url ? Ms(e.url) : null, a = e.data ? Ns(e.data) : null, o = e.httpHeaders || null, s = e.withCredentials === !0, c = (t = e.password) == null ? null : t, l = e.range instanceof lf ? e.range : null, u = Number.isInteger(e.rangeChunkSize) && e.rangeChunkSize > 0 ? e.rangeChunkSize : Math.pow(2, 16), d = e.worker instanceof xf ? e.worker : null, f = e.verbosity, p = typeof e.docBaseUrl == "string" && !yt(e.docBaseUrl) ? e.docBaseUrl : null, m = Ps(e.cMapUrl), h = e.cMapPacked !== !1, g = Ps(e.iccUrl), _ = Ps(e.standardFontDataUrl), v = Ps(e.wasmUrl), y = e.stopAtErrors !== !0, b = Number.isInteger(e.maxImageSize) && e.maxImageSize > -1 ? e.maxImageSize : -1, x = typeof e.isOffscreenCanvasSupported == "boolean" ? e.isOffscreenCanvasSupported : !ve, S = typeof e.isImageDecoderSupported == "boolean" ? e.isImageDecoderSupported : !ve, C = Number.isInteger(e.canvasMaxAreaInBytes) ? e.canvasMaxAreaInBytes : -1, w = typeof e.disableFontFace == "boolean" ? e.disableFontFace : ve, T = e.fontExtraProperties === !0, E = e.enableXfa === !0, D = e.ownerDocument || globalThis.document, ee = e.disableRange === !0, O = e.disableStream === !0, k = e.disableAutoFetch === !0, A = e.pdfBug === !0, j = e.CanvasFactory || (ve ? Ac : nc), te = e.FilterFactory || (ve ? kc : dc), ne = e.BinaryDataFactory || (ve ? jc : $s), re = e.enableHWA === !0, ie = e.enableWebGPU === !0 ? Uc() : Promise.resolve(!1), ae = e.useWasm !== !1, M = e.pagesMapper || new pd(), oe = typeof e.useSystemFonts == "boolean" ? e.useSystemFonts : !ve && !w, se = typeof e.useWorkerFetch == "boolean" ? e.useWorkerFetch : !!(ne === $s && m && h && _ && v && Tt(m, document.baseURI) && Tt(_, document.baseURI) && Tt(v, document.baseURI));
|
|
9387
9387
|
Re(f);
|
|
9388
|
-
let
|
|
9389
|
-
canvasFactory: new
|
|
9388
|
+
let ce = {
|
|
9389
|
+
canvasFactory: new j({
|
|
9390
9390
|
ownerDocument: D,
|
|
9391
|
-
enableHWA:
|
|
9391
|
+
enableHWA: re
|
|
9392
9392
|
}),
|
|
9393
|
-
filterFactory: new
|
|
9393
|
+
filterFactory: new te({
|
|
9394
9394
|
docId: r,
|
|
9395
9395
|
ownerDocument: D
|
|
9396
9396
|
}),
|
|
9397
|
-
binaryDataFactory:
|
|
9397
|
+
binaryDataFactory: se ? null : new ne({
|
|
9398
9398
|
cMapUrl: m,
|
|
9399
9399
|
standardFontDataUrl: _,
|
|
9400
9400
|
wasmUrl: v
|
|
@@ -9404,7 +9404,7 @@ function rf(e = {}) {
|
|
|
9404
9404
|
verbosity: f,
|
|
9405
9405
|
port: Hu.workerPort
|
|
9406
9406
|
}), n._worker = d);
|
|
9407
|
-
let
|
|
9407
|
+
let le = {
|
|
9408
9408
|
docId: r,
|
|
9409
9409
|
apiVersion: "6.1.200",
|
|
9410
9410
|
data: a,
|
|
@@ -9421,9 +9421,9 @@ function rf(e = {}) {
|
|
|
9421
9421
|
isImageDecoderSupported: S,
|
|
9422
9422
|
canvasMaxAreaInBytes: C,
|
|
9423
9423
|
fontExtraProperties: T,
|
|
9424
|
-
useSystemFonts:
|
|
9425
|
-
useWasm:
|
|
9426
|
-
useWorkerFetch:
|
|
9424
|
+
useSystemFonts: oe,
|
|
9425
|
+
useWasm: ae,
|
|
9426
|
+
useWorkerFetch: se,
|
|
9427
9427
|
cMapUrl: m,
|
|
9428
9428
|
cMapPacked: h,
|
|
9429
9429
|
iccUrl: g,
|
|
@@ -9431,20 +9431,20 @@ function rf(e = {}) {
|
|
|
9431
9431
|
wasmUrl: v,
|
|
9432
9432
|
hasGPU: !1
|
|
9433
9433
|
}
|
|
9434
|
-
},
|
|
9434
|
+
}, ue = {
|
|
9435
9435
|
ownerDocument: D,
|
|
9436
|
-
pdfBug:
|
|
9436
|
+
pdfBug: A,
|
|
9437
9437
|
styleElement: null,
|
|
9438
|
-
enableHWA:
|
|
9438
|
+
enableHWA: re,
|
|
9439
9439
|
loadingParams: {
|
|
9440
9440
|
disableAutoFetch: k,
|
|
9441
9441
|
enableXfa: E
|
|
9442
9442
|
}
|
|
9443
9443
|
};
|
|
9444
|
-
return Promise.all([d.promise,
|
|
9444
|
+
return Promise.all([d.promise, ie]).then(function([, e]) {
|
|
9445
9445
|
if (d.destroyed) throw Error("Worker was destroyed");
|
|
9446
|
-
|
|
9447
|
-
let t = d.messageHandler.sendWithPromise("GetDocRequest",
|
|
9446
|
+
le.evaluatorOptions.hasGPU = e;
|
|
9447
|
+
let t = d.messageHandler.sendWithPromise("GetDocRequest", le, a ? [a.buffer] : null), c;
|
|
9448
9448
|
if (!a) if (l) c = new uu({
|
|
9449
9449
|
pdfDataRangeTransport: l,
|
|
9450
9450
|
disableRange: ee,
|
|
@@ -9461,7 +9461,7 @@ function rf(e = {}) {
|
|
|
9461
9461
|
else throw Error("getDocument - expected either `data`, `range`, or `url` parameter.");
|
|
9462
9462
|
return t.then((e) => {
|
|
9463
9463
|
if (d.destroyed) throw Error("Worker was destroyed");
|
|
9464
|
-
let t = new Ks(r, e, d.port), i = new Rf(t, n, c,
|
|
9464
|
+
let t = new Ks(r, e, d.port), i = new Rf(t, n, c, ue, ce, M);
|
|
9465
9465
|
if (n._transport = i, n.destroyed) throw Error("Loading aborted");
|
|
9466
9466
|
t.send("Ready", null);
|
|
9467
9467
|
});
|
|
@@ -9704,14 +9704,14 @@ var af = class {
|
|
|
9704
9704
|
return ((t = e._transport._htmlForXfa) == null ? void 0 : t.children[e._pageIndex]) || null;
|
|
9705
9705
|
})();
|
|
9706
9706
|
}
|
|
9707
|
-
render({ canvasContext: e, canvas: t = e.canvas, viewport: n, intent: r = "display", annotationMode: i =
|
|
9707
|
+
render({ canvasContext: e, canvas: t = e.canvas, viewport: n, intent: r = "display", annotationMode: i = Te.ENABLE, transform: a = null, background: o = null, optionalContentConfigPromise: s = null, annotationCanvasMap: c = null, pageColors: l = null, printAnnotationStorage: u = null, isEditing: d = !1, recordImages: f = !1, recordOperations: p = !1, operationsFilter: h = null }) {
|
|
9708
9708
|
var g, _, v;
|
|
9709
9709
|
(g = this._stats) == null || g.time("Overall");
|
|
9710
9710
|
let y = this._transport.getRenderingIntent(r, i, u, d), { renderingIntent: b, cacheKey: x } = y;
|
|
9711
9711
|
T(df, this, !1), s || (s = this._transport.getOptionalContentConfig(b));
|
|
9712
9712
|
let S = this._intentStates.getOrInsertComputed(x, dt);
|
|
9713
9713
|
S.streamReaderCancelTimeout && (clearTimeout(S.streamReaderCancelTimeout), S.streamReaderCancelTimeout = null);
|
|
9714
|
-
let C = !!(b &
|
|
9714
|
+
let C = !!(b & we.PRINT);
|
|
9715
9715
|
if (!S.displayReadyCapability) {
|
|
9716
9716
|
var w;
|
|
9717
9717
|
S.displayReadyCapability = Promise.withResolvers(), S.operatorList = {
|
|
@@ -9722,33 +9722,33 @@ var af = class {
|
|
|
9722
9722
|
}, (w = this._stats) == null || w.time("Page Request"), this._pumpOperatorList(y);
|
|
9723
9723
|
}
|
|
9724
9724
|
let E = !!(this._pdfBug && (_ = globalThis.StepperManager) != null && _.enabled), D = !!t && !this.recordedBBoxes && (p || E), ee = !!t && !this.imageCoordinates && f, O = (e) => {
|
|
9725
|
-
if (S.renderTasks.delete(
|
|
9725
|
+
if (S.renderTasks.delete(j), D) {
|
|
9726
9726
|
var t;
|
|
9727
|
-
let e = (t =
|
|
9727
|
+
let e = (t = j.gfx) == null ? void 0 : t.dependencyTracker.take();
|
|
9728
9728
|
if (e) {
|
|
9729
9729
|
var n;
|
|
9730
|
-
(n =
|
|
9730
|
+
(n = j.stepper) == null || n.setOperatorBBoxes(e, j.gfx.dependencyTracker.takeDebugMetadata()), p && (this.recordedBBoxes = e);
|
|
9731
9731
|
}
|
|
9732
9732
|
}
|
|
9733
9733
|
if (ee && !e) {
|
|
9734
9734
|
var r;
|
|
9735
|
-
this.imageCoordinates = (r =
|
|
9735
|
+
this.imageCoordinates = (r = j.gfx) == null ? void 0 : r.imagesTracker.take();
|
|
9736
9736
|
}
|
|
9737
|
-
if (C && T(df, this, !0), m(pf, this, hf).call(this), e ? (
|
|
9737
|
+
if (C && T(df, this, !0), m(pf, this, hf).call(this), e ? (j.capability.reject(e), this._abortOperatorList({
|
|
9738
9738
|
intentState: S,
|
|
9739
9739
|
reason: e instanceof Error ? e : Error(e)
|
|
9740
|
-
})) :
|
|
9740
|
+
})) : j.capability.resolve(), this._stats) {
|
|
9741
9741
|
var i;
|
|
9742
9742
|
this._stats.timeEnd("Rendering"), this._stats.timeEnd("Overall"), (i = globalThis.Stats) != null && i.enabled && globalThis.Stats.add(this.pageNumber, this._stats);
|
|
9743
9743
|
}
|
|
9744
|
-
}, k = null,
|
|
9745
|
-
(D || ee) && (
|
|
9746
|
-
let
|
|
9744
|
+
}, k = null, A = null;
|
|
9745
|
+
(D || ee) && (A = new To(t, S.operatorList.length)), D && (k = new Fo(A, E));
|
|
9746
|
+
let j = new Uf({
|
|
9747
9747
|
callback: O,
|
|
9748
9748
|
params: {
|
|
9749
9749
|
canvas: t,
|
|
9750
9750
|
canvasContext: e,
|
|
9751
|
-
dependencyTracker: (v = k) == null ?
|
|
9751
|
+
dependencyTracker: (v = k) == null ? A : v,
|
|
9752
9752
|
imagesTracker: ee ? new Jo(t) : null,
|
|
9753
9753
|
viewport: n,
|
|
9754
9754
|
transform: a,
|
|
@@ -9767,8 +9767,8 @@ var af = class {
|
|
|
9767
9767
|
enableHWA: this._transport.enableHWA,
|
|
9768
9768
|
operationsFilter: h
|
|
9769
9769
|
});
|
|
9770
|
-
(S.renderTasks || (S.renderTasks = /* @__PURE__ */ new Set())).add(
|
|
9771
|
-
let
|
|
9770
|
+
(S.renderTasks || (S.renderTasks = /* @__PURE__ */ new Set())).add(j);
|
|
9771
|
+
let te = j.task;
|
|
9772
9772
|
return Promise.all([S.displayReadyCapability.promise, s]).then(([e, t]) => {
|
|
9773
9773
|
var n;
|
|
9774
9774
|
if (this.destroyed) {
|
|
@@ -9776,13 +9776,13 @@ var af = class {
|
|
|
9776
9776
|
return;
|
|
9777
9777
|
}
|
|
9778
9778
|
if ((n = this._stats) == null || n.time("Rendering"), !(t.renderingIntent & b)) throw Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");
|
|
9779
|
-
|
|
9779
|
+
j.initializeGraphics({
|
|
9780
9780
|
transparency: e,
|
|
9781
9781
|
optionalContentConfig: t
|
|
9782
|
-
}),
|
|
9783
|
-
}).catch(O),
|
|
9782
|
+
}), j.operatorListChanged();
|
|
9783
|
+
}).catch(O), te;
|
|
9784
9784
|
}
|
|
9785
|
-
getOperatorList({ intent: e = "display", annotationMode: t =
|
|
9785
|
+
getOperatorList({ intent: e = "display", annotationMode: t = Te.ENABLE, printAnnotationStorage: n = null, isEditing: r = !1 } = {}) {
|
|
9786
9786
|
function i() {
|
|
9787
9787
|
o.operatorList.lastChunk && (o.opListReadCapability.resolve(o.operatorList), o.renderTasks.delete(s));
|
|
9788
9788
|
}
|
|
@@ -9982,7 +9982,7 @@ var gf = /* @__PURE__ */ new WeakMap(), _f = /* @__PURE__ */ new WeakMap(), vf =
|
|
|
9982
9982
|
return L(this, "_setupFakeWorkerGlobal", n());
|
|
9983
9983
|
}
|
|
9984
9984
|
};
|
|
9985
|
-
|
|
9985
|
+
se = xf;
|
|
9986
9986
|
function Sf() {
|
|
9987
9987
|
C(gf, this).resolve(), C(_f, this).send("configure", { verbosity: this.verbosity });
|
|
9988
9988
|
}
|
|
@@ -9990,13 +9990,13 @@ function Cf(e) {
|
|
|
9990
9990
|
T(vf, this, e), T(_f, this, new Ks("main", "worker", e)), C(_f, this).on("ready", () => {}), m(bf, this, Sf).call(this);
|
|
9991
9991
|
}
|
|
9992
9992
|
function wf() {
|
|
9993
|
-
if (Of._ || Ef.call(
|
|
9993
|
+
if (Of._ || Ef.call(se)) {
|
|
9994
9994
|
m(bf, this, Tf).call(this);
|
|
9995
9995
|
return;
|
|
9996
9996
|
}
|
|
9997
|
-
let { workerSrc: e } =
|
|
9997
|
+
let { workerSrc: e } = se;
|
|
9998
9998
|
try {
|
|
9999
|
-
|
|
9999
|
+
se._isSameOrigin(window.location, e) || (e = se._createCDNWrapper(new URL(e, window.location).href));
|
|
10000
10000
|
let t = new Worker(e, { type: "module" }), n = new Ks("main", "worker", t), r = () => {
|
|
10001
10001
|
i.abort(), n.destroy(), t.terminate(), this.destroyed ? C(gf, this).reject(/* @__PURE__ */ Error("Worker was destroyed")) : m(bf, this, Tf).call(this);
|
|
10002
10002
|
}, i = new AbortController();
|
|
@@ -10031,7 +10031,7 @@ function wf() {
|
|
|
10031
10031
|
m(bf, this, Tf).call(this);
|
|
10032
10032
|
}
|
|
10033
10033
|
function Tf() {
|
|
10034
|
-
Of._ || (F("Setting up fake worker."), Of._ = !0),
|
|
10034
|
+
Of._ || (F("Setting up fake worker."), Of._ = !0), se._setupFakeWorkerGlobal.then((e) => {
|
|
10035
10035
|
var t, n;
|
|
10036
10036
|
if (this.destroyed) {
|
|
10037
10037
|
C(gf, this).reject(/* @__PURE__ */ Error("Worker was destroyed"));
|
|
@@ -10054,12 +10054,12 @@ function Ef() {
|
|
|
10054
10054
|
}
|
|
10055
10055
|
}
|
|
10056
10056
|
var Df = { _: 0 }, Of = { _: !1 }, kf = { _: /* @__PURE__ */ new WeakMap() };
|
|
10057
|
-
|
|
10057
|
+
ve && (Of._ = m(se, se, !0), Hu.workerSrc || (Hu.workerSrc = "./pdf.worker.mjs")), se._isSameOrigin = (e, t) => {
|
|
10058
10058
|
let n = URL.parse(e);
|
|
10059
10059
|
if (!(n != null && n.origin) || n.origin === "null") return !1;
|
|
10060
10060
|
let r = new URL(t, n);
|
|
10061
10061
|
return n.origin === r.origin;
|
|
10062
|
-
},
|
|
10062
|
+
}, se._createCDNWrapper = (e) => {
|
|
10063
10063
|
let t = `await import("${e}");`;
|
|
10064
10064
|
return URL.createObjectURL(new Blob([t], { type: "text/javascript" }));
|
|
10065
10065
|
};
|
|
@@ -10077,33 +10077,33 @@ var Af = /* @__PURE__ */ new WeakMap(), jf = /* @__PURE__ */ new WeakMap(), Mf =
|
|
|
10077
10077
|
get annotationStorage() {
|
|
10078
10078
|
return L(this, "annotationStorage", new ro());
|
|
10079
10079
|
}
|
|
10080
|
-
getRenderingIntent(e, t =
|
|
10081
|
-
let a =
|
|
10080
|
+
getRenderingIntent(e, t = Te.ENABLE, n = null, r = !1, i = !1) {
|
|
10081
|
+
let a = we.DISPLAY, o = Za;
|
|
10082
10082
|
switch (e) {
|
|
10083
10083
|
case "any":
|
|
10084
|
-
a =
|
|
10084
|
+
a = we.ANY;
|
|
10085
10085
|
break;
|
|
10086
10086
|
case "display": break;
|
|
10087
10087
|
case "print":
|
|
10088
|
-
a =
|
|
10088
|
+
a = we.PRINT;
|
|
10089
10089
|
break;
|
|
10090
10090
|
default: F(`getRenderingIntent - invalid intent: ${e}`);
|
|
10091
10091
|
}
|
|
10092
|
-
let s = a &
|
|
10092
|
+
let s = a & we.PRINT && n instanceof oo ? n : this.annotationStorage;
|
|
10093
10093
|
switch (t) {
|
|
10094
|
-
case
|
|
10095
|
-
a +=
|
|
10094
|
+
case Te.DISABLE:
|
|
10095
|
+
a += we.ANNOTATIONS_DISABLE;
|
|
10096
10096
|
break;
|
|
10097
|
-
case
|
|
10098
|
-
case
|
|
10099
|
-
a +=
|
|
10097
|
+
case Te.ENABLE: break;
|
|
10098
|
+
case Te.ENABLE_FORMS:
|
|
10099
|
+
a += we.ANNOTATIONS_FORMS;
|
|
10100
10100
|
break;
|
|
10101
|
-
case
|
|
10102
|
-
a +=
|
|
10101
|
+
case Te.ENABLE_STORAGE:
|
|
10102
|
+
a += we.ANNOTATIONS_STORAGE, o = s.serializable;
|
|
10103
10103
|
break;
|
|
10104
10104
|
default: F(`getRenderingIntent - invalid annotationMode: ${t}`);
|
|
10105
10105
|
}
|
|
10106
|
-
r && (a +=
|
|
10106
|
+
r && (a += we.IS_EDITING), i && (a += we.OPLIST);
|
|
10107
10107
|
let { ids: c, hash: l } = s.modifiedIds, u = [
|
|
10108
10108
|
a,
|
|
10109
10109
|
o.hash,
|
|
@@ -10636,7 +10636,7 @@ var Vf = class {
|
|
|
10636
10636
|
(e = C(qf, this)) == null || e.remove(), T(qf, this, null), T(Jf, this, null), (t = C(Xf, this)) == null || t.remove(), T(Xf, this, null);
|
|
10637
10637
|
}
|
|
10638
10638
|
};
|
|
10639
|
-
|
|
10639
|
+
ce = ip;
|
|
10640
10640
|
function ap() {
|
|
10641
10641
|
let e = document.createElement("div"), t = C(np, this)._signal;
|
|
10642
10642
|
e.addEventListener("contextmenu", Et, { signal: t }), e.className = "dropdown", e.role = "listbox", e.ariaMultiSelectable = "false", e.ariaOrientation = "vertical", e.setAttribute("data-l10n-id", "pdfjs-editor-colorpicker-dropdown"), C($f, this) && (e.id = `${C($f, this).id}_colorpicker_dropdown`);
|
|
@@ -10651,12 +10651,12 @@ function ap() {
|
|
|
10651
10651
|
function op(e, t) {
|
|
10652
10652
|
t.stopPropagation(), C(ep, this).dispatch("switchannotationeditorparams", {
|
|
10653
10653
|
source: this,
|
|
10654
|
-
type:
|
|
10654
|
+
type: P.HIGHLIGHT_COLOR,
|
|
10655
10655
|
value: e
|
|
10656
10656
|
}), this.updateColor(e);
|
|
10657
10657
|
}
|
|
10658
10658
|
function sp(e) {
|
|
10659
|
-
|
|
10659
|
+
ce._keyboardManager.exec(this, e);
|
|
10660
10660
|
}
|
|
10661
10661
|
function cp(e) {
|
|
10662
10662
|
if (up.call(m(rp, this))) {
|
|
@@ -10818,14 +10818,14 @@ var bp = class {
|
|
|
10818
10818
|
}
|
|
10819
10819
|
}, Sp = class extends xp {
|
|
10820
10820
|
_createSVG(e) {
|
|
10821
|
-
return document.createElementNS(
|
|
10821
|
+
return document.createElementNS(Ce, e);
|
|
10822
10822
|
}
|
|
10823
10823
|
}, Cp = 9, wp = /* @__PURE__ */ new WeakSet(), Tp = (/* @__PURE__ */ new Date()).getTimezoneOffset() * 60 * 1e3, Ep = class {
|
|
10824
10824
|
static create(e) {
|
|
10825
10825
|
switch (e.data.annotationType) {
|
|
10826
|
-
case
|
|
10827
|
-
case
|
|
10828
|
-
case
|
|
10826
|
+
case je.LINK: return new Fp(e);
|
|
10827
|
+
case je.TEXT: return new zp(e);
|
|
10828
|
+
case je.WIDGET:
|
|
10829
10829
|
switch (e.data.fieldType) {
|
|
10830
10830
|
case "Tx": return new Vp(e);
|
|
10831
10831
|
case "Btn": return e.data.radioButton ? new Wp(e) : e.data.checkBox ? new Up(e) : new Gp(e);
|
|
@@ -10833,23 +10833,23 @@ var bp = class {
|
|
|
10833
10833
|
case "Sig": return new Hp(e);
|
|
10834
10834
|
}
|
|
10835
10835
|
return new Bp(e);
|
|
10836
|
-
case
|
|
10837
|
-
case
|
|
10838
|
-
case
|
|
10839
|
-
case
|
|
10840
|
-
case
|
|
10841
|
-
case
|
|
10842
|
-
case
|
|
10843
|
-
case
|
|
10844
|
-
case
|
|
10845
|
-
case
|
|
10846
|
-
case
|
|
10847
|
-
case
|
|
10848
|
-
case
|
|
10849
|
-
case
|
|
10850
|
-
case
|
|
10851
|
-
case
|
|
10852
|
-
case
|
|
10836
|
+
case je.POPUP: return new Jp(e);
|
|
10837
|
+
case je.FREETEXT: return new Im(e);
|
|
10838
|
+
case je.LINE: return new Rm(e);
|
|
10839
|
+
case je.SQUARE: return new Bm(e);
|
|
10840
|
+
case je.CIRCLE: return new Hm(e);
|
|
10841
|
+
case je.POLYLINE: return new Wm(e);
|
|
10842
|
+
case je.CARET: return new Km(e);
|
|
10843
|
+
case je.INK: return new Xm(e);
|
|
10844
|
+
case je.POLYGON: return new Gm(e);
|
|
10845
|
+
case je.HIGHLIGHT: return new Qm(e);
|
|
10846
|
+
case je.UNDERLINE: return new $m(e);
|
|
10847
|
+
case je.SQUIGGLY: return new eh(e);
|
|
10848
|
+
case je.STRIKEOUT: return new th(e);
|
|
10849
|
+
case je.STAMP: return new nh(e);
|
|
10850
|
+
case je.FILEATTACHMENT: return new ah(e);
|
|
10851
|
+
case je.RICHMEDIA:
|
|
10852
|
+
case je.SCREEN: return new dh(e);
|
|
10853
10853
|
default: return new jp(e);
|
|
10854
10854
|
}
|
|
10855
10855
|
}
|
|
@@ -10896,14 +10896,14 @@ var bp = class {
|
|
|
10896
10896
|
get commentText() {
|
|
10897
10897
|
var e, t;
|
|
10898
10898
|
let { data: n } = this;
|
|
10899
|
-
return ((e = this.annotationStorage.getRawValue(`${
|
|
10899
|
+
return ((e = this.annotationStorage.getRawValue(`${De}${n.id}`)) == null || (e = e.popup) == null ? void 0 : e.contents) || ((t = n.contentsObj) == null ? void 0 : t.str) || "";
|
|
10900
10900
|
}
|
|
10901
10901
|
set commentText(e) {
|
|
10902
10902
|
let { data: t } = this, n = {
|
|
10903
10903
|
deleted: !e,
|
|
10904
10904
|
contents: e || ""
|
|
10905
10905
|
};
|
|
10906
|
-
this.annotationStorage.updateEditor(t.id, { popup: n }) || this.annotationStorage.setValue(`${
|
|
10906
|
+
this.annotationStorage.updateEditor(t.id, { popup: n }) || this.annotationStorage.setValue(`${De}${t.id}`, {
|
|
10907
10907
|
id: t.id,
|
|
10908
10908
|
annotationType: t.annotationType,
|
|
10909
10909
|
page: this.parent.page,
|
|
@@ -10942,19 +10942,19 @@ var bp = class {
|
|
|
10942
10942
|
a.borderWidth = `${t.borderStyle.width}px`;
|
|
10943
10943
|
let e = t.borderStyle.horizontalCornerRadius, n = t.borderStyle.verticalCornerRadius;
|
|
10944
10944
|
switch ((e > 0 || n > 0) && (a.borderRadius = `calc(${e}px * var(--total-scale-factor)) / calc(${n}px * var(--total-scale-factor))`), t.borderStyle.style) {
|
|
10945
|
-
case
|
|
10945
|
+
case Me.SOLID:
|
|
10946
10946
|
a.borderStyle = "solid";
|
|
10947
10947
|
break;
|
|
10948
|
-
case
|
|
10948
|
+
case Me.DASHED:
|
|
10949
10949
|
a.borderStyle = "dashed";
|
|
10950
10950
|
break;
|
|
10951
|
-
case
|
|
10951
|
+
case Me.BEVELED:
|
|
10952
10952
|
F("Unimplemented border style: beveled");
|
|
10953
10953
|
break;
|
|
10954
|
-
case
|
|
10954
|
+
case Me.INSET:
|
|
10955
10955
|
F("Unimplemented border style: inset");
|
|
10956
10956
|
break;
|
|
10957
|
-
case
|
|
10957
|
+
case Me.UNDERLINE:
|
|
10958
10958
|
a.borderBottomStyle = "solid";
|
|
10959
10959
|
break;
|
|
10960
10960
|
default: break;
|
|
@@ -11070,7 +11070,7 @@ var bp = class {
|
|
|
11070
11070
|
let { borderColor: e, borderWidth: t } = a;
|
|
11071
11071
|
a.borderWidth = 0, o = [
|
|
11072
11072
|
"url('data:image/svg+xml;utf8,",
|
|
11073
|
-
`<svg xmlns="${
|
|
11073
|
+
`<svg xmlns="${Ce}" preserveAspectRatio="none" viewBox="0 0 1 1">`,
|
|
11074
11074
|
`<g fill="transparent" stroke="${e}" stroke-width="${t}">`
|
|
11075
11075
|
], this.container.classList.add("hasBorder");
|
|
11076
11076
|
}
|
|
@@ -11416,11 +11416,11 @@ var zp = class extends jp {
|
|
|
11416
11416
|
"right"
|
|
11417
11417
|
], { fontColor: n } = this.data.defaultAppearanceData, r = this.data.defaultAppearanceData.fontSize || Cp, i = e.style, a, o = (e) => Math.round(10 * e) / 10;
|
|
11418
11418
|
if (this.data.multiLine) {
|
|
11419
|
-
let e = Math.abs(this.data.rect[3] - this.data.rect[1] - 2), t = e / (Math.round(e / (
|
|
11420
|
-
a = Math.min(r, o(t /
|
|
11419
|
+
let e = Math.abs(this.data.rect[3] - this.data.rect[1] - 2), t = e / (Math.round(e / (Se * r)) || 1);
|
|
11420
|
+
a = Math.min(r, o(t / Se));
|
|
11421
11421
|
} else {
|
|
11422
11422
|
let e = Math.abs(this.data.rect[3] - this.data.rect[1] - 2);
|
|
11423
|
-
a = Math.min(r, o(e /
|
|
11423
|
+
a = Math.min(r, o(e / Se));
|
|
11424
11424
|
}
|
|
11425
11425
|
i.fontSize = `calc(${a}px * var(--total-scale-factor))`, i.color = z.makeHexColor(...n), this.data.textAlignment !== null && !this.data.comb && (i.textAlign = t[this.data.textAlignment]);
|
|
11426
11426
|
}
|
|
@@ -11863,7 +11863,7 @@ var zp = class extends jp {
|
|
|
11863
11863
|
e.classList.add("popupAnnotation"), e.role = "comment";
|
|
11864
11864
|
let t = this.popup = m(qp, this, Yp).call(this), n = [];
|
|
11865
11865
|
for (let e of this.elements) e.popup = t, e.container.ariaHasPopup = "dialog", n.push(e.data.id), e.addHighlightArea();
|
|
11866
|
-
return this.container.setAttribute("aria-controls", n.map((e) => `${
|
|
11866
|
+
return this.container.setAttribute("aria-controls", n.map((e) => `${Ee}${e}`).join(",")), this.container;
|
|
11867
11867
|
}
|
|
11868
11868
|
};
|
|
11869
11869
|
function Yp() {
|
|
@@ -12124,7 +12124,7 @@ var Im = class extends jp {
|
|
|
12124
12124
|
super(e, {
|
|
12125
12125
|
isRenderable: !0,
|
|
12126
12126
|
ignoreBorder: !0
|
|
12127
|
-
}), this.textContent = e.data.textContent, this.textPosition = e.data.textPosition, this.annotationEditorType =
|
|
12127
|
+
}), this.textContent = e.data.textContent, this.textPosition = e.data.textPosition, this.annotationEditorType = N.FREETEXT;
|
|
12128
12128
|
}
|
|
12129
12129
|
render() {
|
|
12130
12130
|
if (this.container.classList.add("freeTextAnnotation"), this.textContent) {
|
|
@@ -12237,7 +12237,7 @@ var Im = class extends jp {
|
|
|
12237
12237
|
super(e, {
|
|
12238
12238
|
isRenderable: !0,
|
|
12239
12239
|
ignoreBorder: !0
|
|
12240
|
-
}), w(this, Ym), S(this, qm, null), S(this, Jm, []), this.containerClassName = "inkAnnotation", this.svgElementName = "svg:polyline", this.annotationEditorType = this.data.it === "InkHighlight" ?
|
|
12240
|
+
}), w(this, Ym), S(this, qm, null), S(this, Jm, []), this.containerClassName = "inkAnnotation", this.svgElementName = "svg:polyline", this.annotationEditorType = this.data.it === "InkHighlight" ? N.HIGHLIGHT : N.INK;
|
|
12241
12241
|
}
|
|
12242
12242
|
render() {
|
|
12243
12243
|
this.container.classList.add(this.containerClassName);
|
|
@@ -12295,7 +12295,7 @@ var Qm = class extends jp {
|
|
|
12295
12295
|
isRenderable: !0,
|
|
12296
12296
|
ignoreBorder: !0,
|
|
12297
12297
|
createQuadrilaterals: !0
|
|
12298
|
-
}), this.annotationEditorType =
|
|
12298
|
+
}), this.annotationEditorType = N.HIGHLIGHT;
|
|
12299
12299
|
}
|
|
12300
12300
|
render() {
|
|
12301
12301
|
let { data: { overlaidText: e, popupRef: t } } = this;
|
|
@@ -12358,7 +12358,7 @@ var Qm = class extends jp {
|
|
|
12358
12358
|
super(e, {
|
|
12359
12359
|
isRenderable: !0,
|
|
12360
12360
|
ignoreBorder: !0
|
|
12361
|
-
}), this.annotationEditorType =
|
|
12361
|
+
}), this.annotationEditorType = N.STAMP;
|
|
12362
12362
|
}
|
|
12363
12363
|
render() {
|
|
12364
12364
|
return this.container.classList.add("stampAnnotation"), this.container.setAttribute("role", "img"), !this.data.popupRef && this.hasPopupData && (this.hasOwnCommentButton = !0, this._createPopup()), this._editOnDoubleClick(), this.container;
|
|
@@ -12482,7 +12482,7 @@ var mh = /* @__PURE__ */ new WeakMap(), hh = /* @__PURE__ */ new WeakMap(), gh =
|
|
|
12482
12482
|
};
|
|
12483
12483
|
for (let e of n) {
|
|
12484
12484
|
if (e.noHTML) continue;
|
|
12485
|
-
let n = e.annotationType ===
|
|
12485
|
+
let n = e.annotationType === je.POPUP;
|
|
12486
12486
|
if (n) {
|
|
12487
12487
|
let n = a.get(e.id);
|
|
12488
12488
|
if (!n) continue;
|
|
@@ -12509,7 +12509,7 @@ var mh = /* @__PURE__ */ new WeakMap(), hh = /* @__PURE__ */ new WeakMap(), gh =
|
|
|
12509
12509
|
let n = Ep.create(s);
|
|
12510
12510
|
if (!n.isRenderable) continue;
|
|
12511
12511
|
let r = n.render();
|
|
12512
|
-
n.contentElement.id = `${
|
|
12512
|
+
n.contentElement.id = `${Ee}${e.id}`, e.hidden && (r.style.visibility = "hidden"), t.at(-1).container.after(r);
|
|
12513
12513
|
}
|
|
12514
12514
|
m(Sh, t, Th).call(t);
|
|
12515
12515
|
})();
|
|
@@ -12527,7 +12527,7 @@ var mh = /* @__PURE__ */ new WeakMap(), hh = /* @__PURE__ */ new WeakMap(), gh =
|
|
|
12527
12527
|
for (let i of t) {
|
|
12528
12528
|
i.borderStyle || (i.borderStyle = e._defaultBorderStyle), r.data = i;
|
|
12529
12529
|
let t = Ep.create(r);
|
|
12530
|
-
t.isRenderable && (t.render(), t.contentElement.id = `${
|
|
12530
|
+
t.isRenderable && (t.render(), t.contentElement.id = `${Ee}${i.id}`, C(bh, n).push(t));
|
|
12531
12531
|
}
|
|
12532
12532
|
yield m(Sh, n, wh).call(n);
|
|
12533
12533
|
})();
|
|
@@ -12568,7 +12568,7 @@ var mh = /* @__PURE__ */ new WeakMap(), hh = /* @__PURE__ */ new WeakMap(), gh =
|
|
|
12568
12568
|
linkService: C(yh, this),
|
|
12569
12569
|
annotationStorage: C(gh, this)
|
|
12570
12570
|
});
|
|
12571
|
-
return i.render(), i.contentElement.id = `${
|
|
12571
|
+
return i.render(), i.contentElement.id = `${Ee}${n}`, i.createOrUpdatePopup(), C(bh, this).push(i), i;
|
|
12572
12572
|
}
|
|
12573
12573
|
removeAnnotation(e) {
|
|
12574
12574
|
var t;
|
|
@@ -12590,7 +12590,7 @@ var mh = /* @__PURE__ */ new WeakMap(), hh = /* @__PURE__ */ new WeakMap(), gh =
|
|
|
12590
12590
|
return L(this, "_defaultBorderStyle", Object.freeze({
|
|
12591
12591
|
width: 1,
|
|
12592
12592
|
rawWidth: 1,
|
|
12593
|
-
style:
|
|
12593
|
+
style: Me.SOLID,
|
|
12594
12594
|
dashArray: [3],
|
|
12595
12595
|
horizontalCornerRadius: 0,
|
|
12596
12596
|
verticalCornerRadius: 0
|
|
@@ -12607,7 +12607,7 @@ function wh() {
|
|
|
12607
12607
|
T(xh, e, !0);
|
|
12608
12608
|
for (let { contentElement: r, data: { id: i } } of C(bh, e)) {
|
|
12609
12609
|
var n;
|
|
12610
|
-
let a = r.id = `${
|
|
12610
|
+
let a = r.id = `${Ee}${i}`;
|
|
12611
12611
|
t.push((n = C(vh, e)) == null ? void 0 : n.getAriaAttributes(a).then((e) => {
|
|
12612
12612
|
if (e) for (let [t, n] of e) r.setAttribute(t, n);
|
|
12613
12613
|
}));
|
|
@@ -12743,35 +12743,35 @@ var Eh = /\r\n?|\n/g, Dh = /* @__PURE__ */ new WeakMap(), Oh = /* @__PURE__ */ n
|
|
|
12743
12743
|
}
|
|
12744
12744
|
static updateDefaultParams(t, n) {
|
|
12745
12745
|
switch (t) {
|
|
12746
|
-
case
|
|
12746
|
+
case P.FREETEXT_SIZE:
|
|
12747
12747
|
e._defaultFontSize = n;
|
|
12748
12748
|
break;
|
|
12749
|
-
case
|
|
12749
|
+
case P.FREETEXT_COLOR:
|
|
12750
12750
|
e._defaultColor = n;
|
|
12751
12751
|
break;
|
|
12752
12752
|
}
|
|
12753
12753
|
}
|
|
12754
12754
|
updateParams(e, t) {
|
|
12755
12755
|
switch (e) {
|
|
12756
|
-
case
|
|
12756
|
+
case P.FREETEXT_SIZE:
|
|
12757
12757
|
m(jh, this, Nh).call(this, t);
|
|
12758
12758
|
break;
|
|
12759
|
-
case
|
|
12759
|
+
case P.FREETEXT_COLOR:
|
|
12760
12760
|
m(jh, this, Ph).call(this, t);
|
|
12761
12761
|
break;
|
|
12762
12762
|
}
|
|
12763
12763
|
}
|
|
12764
12764
|
static get defaultPropertiesToUpdate() {
|
|
12765
|
-
return [[
|
|
12765
|
+
return [[P.FREETEXT_SIZE, e._defaultFontSize], [P.FREETEXT_COLOR, e._defaultColor || W._defaultLineColor]];
|
|
12766
12766
|
}
|
|
12767
12767
|
get propertiesToUpdate() {
|
|
12768
|
-
return [[
|
|
12768
|
+
return [[P.FREETEXT_SIZE, C(Ah, this)], [P.FREETEXT_COLOR, this.color]];
|
|
12769
12769
|
}
|
|
12770
12770
|
get toolbarButtons() {
|
|
12771
12771
|
return this._colorPicker || (this._colorPicker = new gp(this)), [["colorPicker", this._colorPicker]];
|
|
12772
12772
|
}
|
|
12773
12773
|
get colorType() {
|
|
12774
|
-
return
|
|
12774
|
+
return P.FREETEXT_COLOR;
|
|
12775
12775
|
}
|
|
12776
12776
|
onUpdatedColor() {
|
|
12777
12777
|
var e;
|
|
@@ -12952,7 +12952,7 @@ var Eh = /\r\n?|\n/g, Dh = /* @__PURE__ */ new WeakMap(), Oh = /* @__PURE__ */ n
|
|
|
12952
12952
|
let { data: { defaultAppearanceData: { fontSize: e, fontColor: n }, rect: r, rotation: i, id: a, popupRef: s, richText: c, contentsObj: l, creationDate: u, modificationDate: d }, textContent: f, textPosition: p, parent: { page: { pageNumber: m } } } = t;
|
|
12953
12953
|
if (!(f != null && f.length)) return null;
|
|
12954
12954
|
o = t = {
|
|
12955
|
-
annotationType:
|
|
12955
|
+
annotationType: N.FREETEXT,
|
|
12956
12956
|
color: Array.from(n),
|
|
12957
12957
|
fontSize: e,
|
|
12958
12958
|
value: f.join("\n"),
|
|
@@ -13002,7 +13002,7 @@ var Eh = /\r\n?|\n/g, Dh = /* @__PURE__ */ new WeakMap(), Oh = /* @__PURE__ */ n
|
|
|
13002
13002
|
super.resetAnnotationElement(e), e.resetEdited();
|
|
13003
13003
|
}
|
|
13004
13004
|
};
|
|
13005
|
-
|
|
13005
|
+
le = Mh;
|
|
13006
13006
|
function Nh(e) {
|
|
13007
13007
|
let t = (e) => {
|
|
13008
13008
|
this.editorDiv.style.fontSize = `calc(${e}px * var(--total-scale-factor))`, this.translate(0, -(e - C(Ah, this)) * this.parentScale), T(Ah, this, e), m(jh, this, Ih).call(this);
|
|
@@ -13012,7 +13012,7 @@ function Nh(e) {
|
|
|
13012
13012
|
undo: t.bind(this, n),
|
|
13013
13013
|
post: this._uiManager.updateUI.bind(this._uiManager, this),
|
|
13014
13014
|
mustExec: !0,
|
|
13015
|
-
type:
|
|
13015
|
+
type: P.FREETEXT_SIZE,
|
|
13016
13016
|
overwriteIfSameType: !0,
|
|
13017
13017
|
keepUndo: !0
|
|
13018
13018
|
});
|
|
@@ -13026,7 +13026,7 @@ function Ph(e) {
|
|
|
13026
13026
|
undo: t.bind(this, n),
|
|
13027
13027
|
post: this._uiManager.updateUI.bind(this._uiManager, this),
|
|
13028
13028
|
mustExec: !0,
|
|
13029
|
-
type:
|
|
13029
|
+
type: P.FREETEXT_COLOR,
|
|
13030
13030
|
overwriteIfSameType: !0,
|
|
13031
13031
|
keepUndo: !0
|
|
13032
13032
|
});
|
|
@@ -13035,7 +13035,7 @@ function Fh() {
|
|
|
13035
13035
|
let e = [];
|
|
13036
13036
|
this.editorDiv.normalize();
|
|
13037
13037
|
let t = null;
|
|
13038
|
-
for (let n of this.editorDiv.childNodes) (t == null ? void 0 : t.nodeType) === Node.TEXT_NODE && n.nodeName === "BR" || (e.push(Lh.call(
|
|
13038
|
+
for (let n of this.editorDiv.childNodes) (t == null ? void 0 : t.nodeType) === Node.TEXT_NODE && n.nodeName === "BR" || (e.push(Lh.call(le, n)), t = n);
|
|
13039
13039
|
return e.join("\n");
|
|
13040
13040
|
}
|
|
13041
13041
|
function Ih() {
|
|
@@ -13066,7 +13066,7 @@ function Vh(e) {
|
|
|
13066
13066
|
let { value: t, fontSize: n, color: r, pageIndex: i } = this._initialData;
|
|
13067
13067
|
return this.hasEditedComment || this._hasBeenMoved || e.value !== t || e.fontSize !== n || e.color.some((e, t) => e !== r[t]) || e.pageIndex !== i;
|
|
13068
13068
|
}
|
|
13069
|
-
v(Mh, "_freeTextDefaultContent", ""), v(Mh, "_internalPadding", 0), v(Mh, "_defaultColor", null), v(Mh, "_defaultFontSize", 10), v(Mh, "_type", "freetext"), v(Mh, "_editorType",
|
|
13069
|
+
v(Mh, "_freeTextDefaultContent", ""), v(Mh, "_internalPadding", 0), v(Mh, "_defaultColor", null), v(Mh, "_defaultFontSize", 10), v(Mh, "_type", "freetext"), v(Mh, "_editorType", N.FREETEXT);
|
|
13070
13070
|
var X = class {
|
|
13071
13071
|
toSVGPath() {
|
|
13072
13072
|
I("Abstract method `toSVGPath` must be implemented.");
|
|
@@ -13359,7 +13359,7 @@ function bg(e) {
|
|
|
13359
13359
|
], a = n, o = r, s = n, c = r, l = e ? Math.max : Math.min, u = /* @__PURE__ */ new Float32Array(4);
|
|
13360
13360
|
for (let e = 6, d = t.length; e < d; e += 6) {
|
|
13361
13361
|
let d = t[e + 4], f = t[e + 5];
|
|
13362
|
-
isNaN(t[e]) ? (z.pointBoundingBox(d, f, i), o > f ? (a = d, o = f) : o === f && (a = l(a, d)), c < f ? (s = d, c = f) : c === f && (s = l(s, d))) : (u.set(
|
|
13362
|
+
isNaN(t[e]) ? (z.pointBoundingBox(d, f, i), o > f ? (a = d, o = f) : o === f && (a = l(a, d)), c < f ? (s = d, c = f) : c === f && (s = l(s, d))) : (u.set(ye, 0), z.bezierBoundingBox(n, r, ...t.slice(e, e + 6), u), z.rectBoundingBox(...u, i), o > u[1] ? (a = u[0], o = u[1]) : o === u[1] && (a = l(a, u[0])), c < u[3] ? (s = u[2], c = u[3]) : c === u[3] && (s = l(s, u[2]))), n = d, r = f;
|
|
13363
13363
|
}
|
|
13364
13364
|
let d = C(fg, this);
|
|
13365
13365
|
d[0] = i[0] - C(pg, this), d[1] = i[1] - C(pg, this), d[2] = i[2] - i[0] + 2 * C(pg, this), d[3] = i[3] - i[1] + 2 * C(pg, this), this.firstPoint = [a, o], this.lastPoint = [s, c];
|
|
@@ -13367,7 +13367,7 @@ function bg(e) {
|
|
|
13367
13367
|
var xg = /* @__PURE__ */ new WeakMap(), Sg = /* @__PURE__ */ new WeakMap(), Cg = /* @__PURE__ */ new WeakMap(), wg = /* @__PURE__ */ new WeakMap(), Tg = /* @__PURE__ */ new WeakMap(), Eg = /* @__PURE__ */ new WeakSet(), Dg = class {
|
|
13368
13368
|
constructor(e, t = 0, n = 0, r = !0) {
|
|
13369
13369
|
w(this, Eg), S(this, xg, void 0), S(this, Sg, void 0), S(this, Cg, void 0), S(this, wg, []), S(this, Tg, []);
|
|
13370
|
-
let i =
|
|
13370
|
+
let i = ye.slice(), a = Math.pow(10, -4);
|
|
13371
13371
|
for (let { x: n, y: r, width: o, height: s } of e) {
|
|
13372
13372
|
let e = Math.floor((n - t) / a) * a, c = Math.ceil((n + o + t) / a) * a, l = Math.floor((r - t) / a) * a, u = Math.ceil((r + s + t) / a) * a, d = [
|
|
13373
13373
|
e,
|
|
@@ -13587,10 +13587,10 @@ var Ng = /* @__PURE__ */ new WeakMap(), Pg = /* @__PURE__ */ new WeakMap(), Fg =
|
|
|
13587
13587
|
}
|
|
13588
13588
|
static updateDefaultParams(t, n) {
|
|
13589
13589
|
switch (t) {
|
|
13590
|
-
case
|
|
13590
|
+
case P.HIGHLIGHT_COLOR:
|
|
13591
13591
|
e._defaultColor = n;
|
|
13592
13592
|
break;
|
|
13593
|
-
case
|
|
13593
|
+
case P.HIGHLIGHT_THICKNESS:
|
|
13594
13594
|
e._defaultThickness = n;
|
|
13595
13595
|
break;
|
|
13596
13596
|
}
|
|
@@ -13604,22 +13604,22 @@ var Ng = /* @__PURE__ */ new WeakMap(), Pg = /* @__PURE__ */ new WeakMap(), Fg =
|
|
|
13604
13604
|
}
|
|
13605
13605
|
updateParams(e, t) {
|
|
13606
13606
|
switch (e) {
|
|
13607
|
-
case
|
|
13607
|
+
case P.HIGHLIGHT_COLOR:
|
|
13608
13608
|
m(Q, this, a_).call(this, t);
|
|
13609
13609
|
break;
|
|
13610
|
-
case
|
|
13610
|
+
case P.HIGHLIGHT_THICKNESS:
|
|
13611
13611
|
m(Q, this, o_).call(this, t);
|
|
13612
13612
|
break;
|
|
13613
13613
|
}
|
|
13614
13614
|
}
|
|
13615
13615
|
static get defaultPropertiesToUpdate() {
|
|
13616
|
-
return [[
|
|
13616
|
+
return [[P.HIGHLIGHT_COLOR, e._defaultColor], [P.HIGHLIGHT_THICKNESS, e._defaultThickness]];
|
|
13617
13617
|
}
|
|
13618
13618
|
get propertiesToUpdate() {
|
|
13619
13619
|
return [
|
|
13620
|
-
[
|
|
13621
|
-
[
|
|
13622
|
-
[
|
|
13620
|
+
[P.HIGHLIGHT_COLOR, this.color || e._defaultColor],
|
|
13621
|
+
[P.HIGHLIGHT_THICKNESS, C(e_, this) || e._defaultThickness],
|
|
13622
|
+
[P.HIGHLIGHT_FREE, C(Yg, this)]
|
|
13623
13623
|
];
|
|
13624
13624
|
}
|
|
13625
13625
|
onUpdatedColor() {
|
|
@@ -13770,7 +13770,7 @@ var Ng = /* @__PURE__ */ new WeakMap(), Pg = /* @__PURE__ */ new WeakMap(), Fg =
|
|
|
13770
13770
|
if (e instanceof Qm) {
|
|
13771
13771
|
let { data: { quadPoints: t, rect: n, rotation: r, id: i, color: o, opacity: s, popupRef: c, richText: l, contentsObj: u, creationDate: d, modificationDate: f }, parent: { page: { pageNumber: p } } } = e;
|
|
13772
13772
|
a = e = {
|
|
13773
|
-
annotationType:
|
|
13773
|
+
annotationType: N.HIGHLIGHT,
|
|
13774
13774
|
color: Array.from(o),
|
|
13775
13775
|
opacity: s,
|
|
13776
13776
|
quadPoints: t,
|
|
@@ -13790,7 +13790,7 @@ var Ng = /* @__PURE__ */ new WeakMap(), Pg = /* @__PURE__ */ new WeakMap(), Fg =
|
|
|
13790
13790
|
} else if (e instanceof Xm) {
|
|
13791
13791
|
let { data: { inkLists: t, rect: n, rotation: r, id: i, color: o, borderStyle: { rawWidth: s }, popupRef: c, richText: l, contentsObj: u, creationDate: d, modificationDate: f }, parent: { page: { pageNumber: p } } } = e;
|
|
13792
13792
|
a = e = {
|
|
13793
|
-
annotationType:
|
|
13793
|
+
annotationType: N.HIGHLIGHT,
|
|
13794
13794
|
color: Array.from(o),
|
|
13795
13795
|
thickness: s,
|
|
13796
13796
|
inkLists: t,
|
|
@@ -13881,7 +13881,7 @@ var Ng = /* @__PURE__ */ new WeakMap(), Pg = /* @__PURE__ */ new WeakMap(), Fg =
|
|
|
13881
13881
|
return !1;
|
|
13882
13882
|
}
|
|
13883
13883
|
};
|
|
13884
|
-
|
|
13884
|
+
ue = n_;
|
|
13885
13885
|
function r_() {
|
|
13886
13886
|
let e = new Dg(C(Bg, this), .001);
|
|
13887
13887
|
T(qg, this, e.getOutlines()), [this.x, this.y, this.width, this.height] = C(qg, this).box;
|
|
@@ -13907,10 +13907,10 @@ function i_({ highlightOutlines: e, highlightId: t, clipPathId: n }) {
|
|
|
13907
13907
|
else if (this.parent) {
|
|
13908
13908
|
let t = this.parent.viewport.rotation;
|
|
13909
13909
|
this.parent.drawLayer.updateProperties(C(Jg, this), {
|
|
13910
|
-
bbox: u_.call(
|
|
13910
|
+
bbox: u_.call(ue, C(qg, this).box, (t - this.rotation + 360) % 360),
|
|
13911
13911
|
path: { d: e.toSVGPath() }
|
|
13912
13912
|
}), this.parent.drawLayer.updateProperties(C(Qg, this), {
|
|
13913
|
-
bbox: u_.call(
|
|
13913
|
+
bbox: u_.call(ue, C(Ug, this).box, t),
|
|
13914
13914
|
path: { d: C(Ug, this).toSVGPath() }
|
|
13915
13915
|
});
|
|
13916
13916
|
}
|
|
@@ -13943,11 +13943,11 @@ function a_(e) {
|
|
|
13943
13943
|
this.color = e, this.opacity = t, this.onUpdatedColor();
|
|
13944
13944
|
}, n = this.color, r = this.opacity;
|
|
13945
13945
|
this.addCommands({
|
|
13946
|
-
cmd: t.bind(this, e,
|
|
13946
|
+
cmd: t.bind(this, e, ue._defaultOpacity),
|
|
13947
13947
|
undo: t.bind(this, n, r),
|
|
13948
13948
|
post: this._uiManager.updateUI.bind(this._uiManager, this),
|
|
13949
13949
|
mustExec: !0,
|
|
13950
|
-
type:
|
|
13950
|
+
type: P.HIGHLIGHT_COLOR,
|
|
13951
13951
|
overwriteIfSameType: !0,
|
|
13952
13952
|
keepUndo: !0
|
|
13953
13953
|
}), this._reportTelemetry({
|
|
@@ -13964,7 +13964,7 @@ function o_(e) {
|
|
|
13964
13964
|
undo: n.bind(this, t),
|
|
13965
13965
|
post: this._uiManager.updateUI.bind(this._uiManager, this),
|
|
13966
13966
|
mustExec: !0,
|
|
13967
|
-
type:
|
|
13967
|
+
type: P.INK_THICKNESS,
|
|
13968
13968
|
overwriteIfSameType: !0,
|
|
13969
13969
|
keepUndo: !0
|
|
13970
13970
|
}), this._reportTelemetry({
|
|
@@ -14029,7 +14029,7 @@ function u_([e, t, n, r], i) {
|
|
|
14029
14029
|
];
|
|
14030
14030
|
}
|
|
14031
14031
|
function d_(e) {
|
|
14032
|
-
|
|
14032
|
+
ue._keyboardManager.exec(this, e);
|
|
14033
14033
|
}
|
|
14034
14034
|
function f_(e) {
|
|
14035
14035
|
if (!C(Rg, this)) return;
|
|
@@ -14066,7 +14066,7 @@ function v_(e) {
|
|
|
14066
14066
|
let { color: t } = this._initialData;
|
|
14067
14067
|
return this.hasEditedComment || e.color.some((e, n) => e !== t[n]);
|
|
14068
14068
|
}
|
|
14069
|
-
v(n_, "_defaultColor", null), v(n_, "_defaultOpacity", 1), v(n_, "_defaultThickness", 12), v(n_, "_type", "highlight"), v(n_, "_editorType",
|
|
14069
|
+
v(n_, "_defaultColor", null), v(n_, "_defaultOpacity", 1), v(n_, "_defaultThickness", 12), v(n_, "_type", "highlight"), v(n_, "_editorType", N.HIGHLIGHT), v(n_, "_freeHighlightId", -1), v(n_, "_freeHighlight", null), v(n_, "_freeHighlightClipId", "");
|
|
14070
14070
|
var y_ = /* @__PURE__ */ new WeakMap(), b_ = class {
|
|
14071
14071
|
constructor() {
|
|
14072
14072
|
S(this, y_, Object.create(null));
|
|
@@ -14170,7 +14170,7 @@ var y_ = /* @__PURE__ */ new WeakMap(), b_ = class {
|
|
|
14170
14170
|
undo: s.bind(this, a, o),
|
|
14171
14171
|
post: this._uiManager.updateUI.bind(this._uiManager, this),
|
|
14172
14172
|
mustExec: !0,
|
|
14173
|
-
type:
|
|
14173
|
+
type: P.INK_COLOR_AND_OPACITY,
|
|
14174
14174
|
overwriteIfSameType: !0,
|
|
14175
14175
|
keepUndo: !0
|
|
14176
14176
|
});
|
|
@@ -14301,7 +14301,7 @@ var y_ = /* @__PURE__ */ new WeakMap(), b_ = class {
|
|
|
14301
14301
|
t.drawLayer.updateProperties(n, e.removeLastElement());
|
|
14302
14302
|
},
|
|
14303
14303
|
mustExec: !1,
|
|
14304
|
-
type:
|
|
14304
|
+
type: P.DRAW_STEP
|
|
14305
14305
|
});
|
|
14306
14306
|
return;
|
|
14307
14307
|
}
|
|
@@ -14311,7 +14311,7 @@ var y_ = /* @__PURE__ */ new WeakMap(), b_ = class {
|
|
|
14311
14311
|
static endDrawing(e) {
|
|
14312
14312
|
let t = this._currentParent;
|
|
14313
14313
|
if (!t) return null;
|
|
14314
|
-
if (t.toggleDrawing(!0), t.cleanUndoStack(
|
|
14314
|
+
if (t.toggleDrawing(!0), t.cleanUndoStack(P.DRAW_STEP), !N_._.isEmpty()) {
|
|
14315
14315
|
let { pageDimensions: [n, r], scale: i } = t, a = t.createAndAddNewEditor({
|
|
14316
14316
|
offsetX: 0,
|
|
14317
14317
|
offsetY: 0
|
|
@@ -14352,12 +14352,12 @@ var y_ = /* @__PURE__ */ new WeakMap(), b_ = class {
|
|
|
14352
14352
|
return !1;
|
|
14353
14353
|
}
|
|
14354
14354
|
};
|
|
14355
|
-
|
|
14355
|
+
de = w_;
|
|
14356
14356
|
function T_({ drawOutlines: e, drawId: t, drawingOptions: n }) {
|
|
14357
14357
|
T(x_, this, e), this._drawingOptions || (this._drawingOptions = n), this.annotationElementId || this._uiManager.a11yAlert(W._l10nAlert[this.editorType]), t >= 0 ? (this._drawId = t, this.parent.drawLayer.finalizeDraw(t, e.defaultProperties)) : this._drawId = m(C_, this, E_).call(this, e, this.parent), m(C_, this, j_).call(this, e.box);
|
|
14358
14358
|
}
|
|
14359
14359
|
function E_(e, t) {
|
|
14360
|
-
let { id: n } = t.drawLayer.draw(
|
|
14360
|
+
let { id: n } = t.drawLayer.draw(de._mergeSVGProperties(this._drawingOptions.toSVGProperties(), e.defaultSVGProperties), !1, !1);
|
|
14361
14361
|
return n;
|
|
14362
14362
|
}
|
|
14363
14363
|
function D_() {
|
|
@@ -14919,7 +14919,7 @@ function cv() {
|
|
|
14919
14919
|
];
|
|
14920
14920
|
}
|
|
14921
14921
|
function lv() {
|
|
14922
|
-
let e = T(X_, this,
|
|
14922
|
+
let e = T(X_, this, be.slice());
|
|
14923
14923
|
for (let { line: t } of C($_, this)) {
|
|
14924
14924
|
if (t.length <= 12) {
|
|
14925
14925
|
for (let n = 4, r = t.length; n < r; n += 6) z.pointBoundingBox(t[n], t[n + 1], e);
|
|
@@ -14975,9 +14975,9 @@ var dv = class e extends b_ {
|
|
|
14975
14975
|
}
|
|
14976
14976
|
static get typesMap() {
|
|
14977
14977
|
return L(this, "typesMap", /* @__PURE__ */ new Map([
|
|
14978
|
-
[
|
|
14979
|
-
[
|
|
14980
|
-
[
|
|
14978
|
+
[P.INK_THICKNESS, "stroke-width"],
|
|
14979
|
+
[P.INK_COLOR, "stroke"],
|
|
14980
|
+
[P.INK_OPACITY, "stroke-opacity"]
|
|
14981
14981
|
]));
|
|
14982
14982
|
}
|
|
14983
14983
|
static createDrawerInstance(e, t, n, r, i) {
|
|
@@ -14993,7 +14993,7 @@ var dv = class e extends b_ {
|
|
|
14993
14993
|
if (e instanceof Xm) {
|
|
14994
14994
|
let { data: { inkLists: t, rect: n, rotation: r, id: i, color: o, opacity: s, borderStyle: { rawWidth: c }, popupRef: l, richText: u, contentsObj: d, creationDate: f, modificationDate: p }, parent: { page: { pageNumber: m } } } = e;
|
|
14995
14995
|
a = e = {
|
|
14996
|
-
annotationType:
|
|
14996
|
+
annotationType: N.INK,
|
|
14997
14997
|
color: Array.from(o),
|
|
14998
14998
|
thickness: c,
|
|
14999
14999
|
opacity: s,
|
|
@@ -15020,24 +15020,24 @@ var dv = class e extends b_ {
|
|
|
15020
15020
|
return this._colorPicker || (this._colorPicker = new gp(this)), [["colorPicker", this._colorPicker]];
|
|
15021
15021
|
}
|
|
15022
15022
|
get colorType() {
|
|
15023
|
-
return
|
|
15023
|
+
return P.INK_COLOR;
|
|
15024
15024
|
}
|
|
15025
15025
|
get colorAndOpacityType() {
|
|
15026
|
-
return
|
|
15026
|
+
return P.INK_COLOR_AND_OPACITY;
|
|
15027
15027
|
}
|
|
15028
15028
|
get opacityType() {
|
|
15029
|
-
return
|
|
15029
|
+
return P.INK_OPACITY;
|
|
15030
15030
|
}
|
|
15031
15031
|
updateParams(e, t) {
|
|
15032
|
-
if (e ===
|
|
15032
|
+
if (e === P.INK_COLOR_AND_OPACITY) {
|
|
15033
15033
|
this._updateColorAndOpacity(t.color, t.opacity);
|
|
15034
15034
|
return;
|
|
15035
15035
|
}
|
|
15036
15036
|
super.updateParams(e, t);
|
|
15037
15037
|
}
|
|
15038
15038
|
static updateDefaultParams(e, t) {
|
|
15039
|
-
if (e ===
|
|
15040
|
-
super.updateDefaultParams(
|
|
15039
|
+
if (e === P.INK_COLOR_AND_OPACITY) {
|
|
15040
|
+
super.updateDefaultParams(P.INK_COLOR, t.color), super.updateDefaultParams(P.INK_OPACITY, t.opacity);
|
|
15041
15041
|
return;
|
|
15042
15042
|
}
|
|
15043
15043
|
super.updateDefaultParams(e, t);
|
|
@@ -15094,7 +15094,7 @@ function mv(e) {
|
|
|
15094
15094
|
let { color: t, thickness: n, opacity: r, pageIndex: i } = this._initialData;
|
|
15095
15095
|
return this.hasEditedComment || this._hasBeenMoved || this._hasBeenResized || e.color.some((e, n) => e !== t[n]) || e.thickness !== n || e.opacity !== r || e.pageIndex !== i;
|
|
15096
15096
|
}
|
|
15097
|
-
v(pv, "_type", "ink"), v(pv, "_editorType",
|
|
15097
|
+
v(pv, "_type", "ink"), v(pv, "_editorType", N.INK), v(pv, "_defaultDrawingOptions", null);
|
|
15098
15098
|
var hv = class extends ov {
|
|
15099
15099
|
toSVGPath() {
|
|
15100
15100
|
let e = super.toSVGPath();
|
|
@@ -15279,22 +15279,22 @@ var hv = class extends ov {
|
|
|
15279
15279
|
})();
|
|
15280
15280
|
}
|
|
15281
15281
|
};
|
|
15282
|
-
|
|
15282
|
+
fe = vv;
|
|
15283
15283
|
function yv(e, t, n, r) {
|
|
15284
15284
|
return n -= e, r -= t, n === 0 ? r > 0 ? 0 : 4 : n === 1 ? r + 6 : 2 - r;
|
|
15285
15285
|
}
|
|
15286
15286
|
function bv(e, t, n, r, i, a, o) {
|
|
15287
|
-
let s = m(
|
|
15287
|
+
let s = m(fe, this, yv).call(this, n, r, i, a);
|
|
15288
15288
|
for (let i = 0; i < 8; i++) {
|
|
15289
|
-
let a = (-i + s - o + 16) % 8, c = m(
|
|
15289
|
+
let a = (-i + s - o + 16) % 8, c = m(fe, this, jv)._[2 * a], l = m(fe, this, jv)._[2 * a + 1];
|
|
15290
15290
|
if (e[(n + c) * t + (r + l)] !== 0) return a;
|
|
15291
15291
|
}
|
|
15292
15292
|
return -1;
|
|
15293
15293
|
}
|
|
15294
15294
|
function xv(e, t, n, r, i, a, o) {
|
|
15295
|
-
let s = m(
|
|
15295
|
+
let s = m(fe, this, yv).call(this, n, r, i, a);
|
|
15296
15296
|
for (let i = 0; i < 8; i++) {
|
|
15297
|
-
let a = (i + s + o + 16) % 8, c = m(
|
|
15297
|
+
let a = (i + s + o + 16) % 8, c = m(fe, this, jv)._[2 * a], l = m(fe, this, jv)._[2 * a + 1];
|
|
15298
15298
|
if (e[(n + c) * t + (r + l)] !== 0) return a;
|
|
15299
15299
|
}
|
|
15300
15300
|
return -1;
|
|
@@ -15330,17 +15330,17 @@ function Sv(e, t, n, r) {
|
|
|
15330
15330
|
break;
|
|
15331
15331
|
}
|
|
15332
15332
|
h ? h.isHole ? p.parent = f ? h.parent : s : p.parent = f ? s : h.parent : p.parent = f ? s : 0;
|
|
15333
|
-
let g = m(
|
|
15333
|
+
let g = m(fe, this, bv).call(this, a, t, e, n, l, u, 0);
|
|
15334
15334
|
if (g === -1) {
|
|
15335
15335
|
a[r] = -o, a[r] !== 1 && (s = Math.abs(a[r]));
|
|
15336
15336
|
continue;
|
|
15337
15337
|
}
|
|
15338
|
-
let _ = m(
|
|
15338
|
+
let _ = m(fe, this, jv)._[2 * g], v = m(fe, this, jv)._[2 * g + 1], y = e + _, b = n + v;
|
|
15339
15339
|
l = y, u = b;
|
|
15340
15340
|
let x = e, S = n;
|
|
15341
15341
|
for (;;) {
|
|
15342
|
-
let i = m(
|
|
15343
|
-
_ = m(
|
|
15342
|
+
let i = m(fe, this, xv).call(this, a, t, x, S, l, u, 1);
|
|
15343
|
+
_ = m(fe, this, jv)._[2 * i], v = m(fe, this, jv)._[2 * i + 1];
|
|
15344
15344
|
let c = x + _, f = S + v;
|
|
15345
15345
|
d.push(f, c);
|
|
15346
15346
|
let p = x * t + S;
|
|
@@ -15363,11 +15363,11 @@ function Cv(e, t, n, r) {
|
|
|
15363
15363
|
let t = Math.abs(d - l * e[r + 1] + u * e[r]);
|
|
15364
15364
|
t > x && (S = r, x = t);
|
|
15365
15365
|
}
|
|
15366
|
-
x > Math.pow(c * b, 2) ? (m(
|
|
15366
|
+
x > Math.pow(c * b, 2) ? (m(fe, this, Cv).call(this, e, t, S + 2, r), m(fe, this, Cv).call(this, e, S, n, r)) : r.push(i, a);
|
|
15367
15367
|
}
|
|
15368
15368
|
function wv(e) {
|
|
15369
15369
|
let t = [], n = e.length;
|
|
15370
|
-
return m(
|
|
15370
|
+
return m(fe, this, Cv).call(this, e, 0, n, t), t.push(e[n - 2], e[n - 1]), t.length <= 4 ? null : t;
|
|
15371
15371
|
}
|
|
15372
15372
|
function Tv(e, t, n, r, i, a) {
|
|
15373
15373
|
let o = new Float32Array(Math.pow(a, 2)), s = -2 * Math.pow(r, 2), c = a >> 1;
|
|
@@ -15419,7 +15419,7 @@ function Ov(e) {
|
|
|
15419
15419
|
return t;
|
|
15420
15420
|
}
|
|
15421
15421
|
function kv(e) {
|
|
15422
|
-
let t = e, { width: n, height: r } = e, { maxDim: i } = m(
|
|
15422
|
+
let t = e, { width: n, height: r } = e, { maxDim: i } = m(fe, this, Av)._, a = n, o = r;
|
|
15423
15423
|
if (n > i || r > i) {
|
|
15424
15424
|
let s = n, c = r, l = Math.log2(Math.max(n, r) / i), u = Math.floor(l);
|
|
15425
15425
|
l = l === u ? u - 1 : u;
|
|
@@ -15435,7 +15435,7 @@ function kv(e) {
|
|
|
15435
15435
|
s.fillStyle = "white", s.fillRect(0, 0, a, o), s.filter = "grayscale(1)", s.drawImage(e, 0, 0, e.width, e.height, 0, 0, a, o);
|
|
15436
15436
|
let c = s.getImageData(0, 0, a, o).data;
|
|
15437
15437
|
return [
|
|
15438
|
-
m(
|
|
15438
|
+
m(fe, this, Dv).call(this, c),
|
|
15439
15439
|
a,
|
|
15440
15440
|
o
|
|
15441
15441
|
];
|
|
@@ -15654,7 +15654,7 @@ var Av = { _: {
|
|
|
15654
15654
|
})();
|
|
15655
15655
|
}
|
|
15656
15656
|
};
|
|
15657
|
-
v(Rv, "_type", "signature"), v(Rv, "_editorType",
|
|
15657
|
+
v(Rv, "_type", "signature"), v(Rv, "_editorType", N.SIGNATURE), v(Rv, "_defaultDrawingOptions", null);
|
|
15658
15658
|
var zv = /* @__PURE__ */ new WeakMap(), Bv = /* @__PURE__ */ new WeakMap(), Vv = /* @__PURE__ */ new WeakMap(), Hv = /* @__PURE__ */ new WeakMap(), Uv = /* @__PURE__ */ new WeakMap(), Wv = /* @__PURE__ */ new WeakMap(), Gv = /* @__PURE__ */ new WeakMap(), Kv = /* @__PURE__ */ new WeakMap(), qv = /* @__PURE__ */ new WeakMap(), Jv = /* @__PURE__ */ new WeakMap(), Yv = /* @__PURE__ */ new WeakMap(), Xv = /* @__PURE__ */ new WeakSet(), Zv = class extends W {
|
|
15659
15659
|
constructor(e) {
|
|
15660
15660
|
super(D(D({}, e), {}, { name: "stampEditor" })), w(this, Xv), S(this, zv, null), S(this, Bv, null), S(this, Vv, null), S(this, Hv, null), S(this, Uv, null), S(this, Wv, ""), S(this, Gv, null), S(this, Kv, !1), S(this, qv, null), S(this, Jv, !1), S(this, Yv, !1), T(Hv, this, e.bitmapUrl), T(Uv, this, e.bitmapFile), this.defaultL10nId = "pdfjs-editor-stamp-editor";
|
|
@@ -15666,7 +15666,7 @@ var zv = /* @__PURE__ */ new WeakMap(), Bv = /* @__PURE__ */ new WeakMap(), Vv =
|
|
|
15666
15666
|
return Lt.includes(e);
|
|
15667
15667
|
}
|
|
15668
15668
|
static paste(e, t) {
|
|
15669
|
-
t.pasteEditor({ mode:
|
|
15669
|
+
t.pasteEditor({ mode: N.STAMP }, { bitmapFile: e.getAsFile() });
|
|
15670
15670
|
}
|
|
15671
15671
|
altTextFinish() {
|
|
15672
15672
|
this._uiManager.useNewAltTextFlow && (this.div.hidden = !1), super.altTextFinish();
|
|
@@ -15804,9 +15804,9 @@ var zv = /* @__PURE__ */ new WeakMap(), Bv = /* @__PURE__ */ new WeakMap(), Vv =
|
|
|
15804
15804
|
var s;
|
|
15805
15805
|
let { data: { rect: r, rotation: i, id: c, structParent: l, popupRef: u, richText: d, contentsObj: f, creationDate: p, modificationDate: m }, container: h, parent: { page: { pageNumber: g } }, canvas: _ } = e, v, y;
|
|
15806
15806
|
_ ? (delete e.canvas, {id: v, bitmap: y} = n.imageManager.getFromCanvas(h.id, _), _.remove()) : (o = !0, e._hasNoCanvas = !0);
|
|
15807
|
-
let b = ((s = yield t._structTree.getAriaAttributes(`${
|
|
15807
|
+
let b = ((s = yield t._structTree.getAriaAttributes(`${Ee}${c}`)) == null ? void 0 : s.get("aria-label")) || "";
|
|
15808
15808
|
a = e = {
|
|
15809
|
-
annotationType:
|
|
15809
|
+
annotationType: N.STAMP,
|
|
15810
15810
|
bitmapId: v,
|
|
15811
15811
|
bitmap: y,
|
|
15812
15812
|
pageIndex: g - 1,
|
|
@@ -15994,7 +15994,7 @@ function ay(e) {
|
|
|
15994
15994
|
isSameAltText: a
|
|
15995
15995
|
};
|
|
15996
15996
|
}
|
|
15997
|
-
v(Zv, "_type", "stamp"), v(Zv, "_editorType",
|
|
15997
|
+
v(Zv, "_type", "stamp"), v(Zv, "_editorType", N.STAMP);
|
|
15998
15998
|
var oy = /* @__PURE__ */ new WeakMap(), sy = /* @__PURE__ */ new WeakMap(), cy = /* @__PURE__ */ new WeakMap(), ly = /* @__PURE__ */ new WeakMap(), uy = /* @__PURE__ */ new WeakMap(), dy = /* @__PURE__ */ new WeakMap(), fy = /* @__PURE__ */ new WeakMap(), py = /* @__PURE__ */ new WeakMap(), my = /* @__PURE__ */ new WeakMap(), hy = /* @__PURE__ */ new WeakMap(), gy = /* @__PURE__ */ new WeakMap(), _y = /* @__PURE__ */ new WeakMap(), vy = /* @__PURE__ */ new WeakMap(), yy = /* @__PURE__ */ new WeakMap(), by = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap(), xy = /* @__PURE__ */ new WeakSet(), Sy = class e {
|
|
15999
15999
|
constructor({ uiManager: t, pageIndex: n, div: r, structTreeLayer: i, accessibilityManager: a, annotationLayer: o, drawLayer: s, textLayer: c, viewport: l, l10n: u }) {
|
|
16000
16000
|
w(this, xy), S(this, oy, void 0), S(this, sy, !1), S(this, cy, null), S(this, ly, null), S(this, uy, null), S(this, dy, /* @__PURE__ */ new Map()), S(this, fy, !1), S(this, py, !1), S(this, my, !1), S(this, hy, null), S(this, gy, null), S(this, _y, null), S(this, vy, null), S(this, yy, null), S(this, by, -1), S(this, $, void 0);
|
|
@@ -16009,27 +16009,27 @@ var oy = /* @__PURE__ */ new WeakMap(), sy = /* @__PURE__ */ new WeakMap(), cy =
|
|
|
16009
16009
|
return C(dy, this).size === 0;
|
|
16010
16010
|
}
|
|
16011
16011
|
get isInvisible() {
|
|
16012
|
-
return this.isEmpty && C($, this).getMode() ===
|
|
16012
|
+
return this.isEmpty && C($, this).getMode() === N.NONE;
|
|
16013
16013
|
}
|
|
16014
16014
|
updateToolbar(e) {
|
|
16015
16015
|
C($, this).updateToolbar(e);
|
|
16016
16016
|
}
|
|
16017
16017
|
updateMode(e = C($, this).getMode()) {
|
|
16018
16018
|
switch (m(xy, this, Oy).call(this), e) {
|
|
16019
|
-
case
|
|
16019
|
+
case N.NONE:
|
|
16020
16020
|
this.div.classList.toggle("nonEditing", !0), this.disableTextSelection(), this.togglePointerEvents(!1), this.toggleAnnotationLayerPointerEvents(!0), this.disableClick();
|
|
16021
16021
|
return;
|
|
16022
|
-
case
|
|
16022
|
+
case N.INK:
|
|
16023
16023
|
this.disableTextSelection(), this.togglePointerEvents(!0), this.enableClick();
|
|
16024
16024
|
break;
|
|
16025
|
-
case
|
|
16025
|
+
case N.HIGHLIGHT:
|
|
16026
16026
|
this.enableTextSelection(), this.togglePointerEvents(!1), this.disableClick();
|
|
16027
16027
|
break;
|
|
16028
16028
|
default: this.disableTextSelection(), this.togglePointerEvents(!0), this.enableClick();
|
|
16029
16029
|
}
|
|
16030
16030
|
this.toggleAnnotationLayerPointerEvents(!1);
|
|
16031
16031
|
let { classList: t } = this.div;
|
|
16032
|
-
if (t.toggle("nonEditing", !1), e ===
|
|
16032
|
+
if (t.toggle("nonEditing", !1), e === N.POPUP) t.toggle("commentEditing", !0);
|
|
16033
16033
|
else {
|
|
16034
16034
|
t.toggle("commentEditing", !1);
|
|
16035
16035
|
for (let n of ky._.values()) t.toggle(`${n._type}Editing`, e === n._editorType);
|
|
@@ -16093,7 +16093,7 @@ var oy = /* @__PURE__ */ new WeakMap(), sy = /* @__PURE__ */ new WeakMap(), cy =
|
|
|
16093
16093
|
i.toggle("getElements", !0);
|
|
16094
16094
|
let a = document.elementsFromPoint(t, n);
|
|
16095
16095
|
if (i.toggle("getElements", !1), !this.div.contains(a[0])) return;
|
|
16096
|
-
let o, s = RegExp(`^${
|
|
16096
|
+
let o, s = RegExp(`^${De}[0-9]+$`);
|
|
16097
16097
|
for (let e of a) if (s.test(e.id)) {
|
|
16098
16098
|
o = e.id;
|
|
16099
16099
|
break;
|
|
@@ -16289,7 +16289,7 @@ var oy = /* @__PURE__ */ new WeakMap(), sy = /* @__PURE__ */ new WeakMap(), cy =
|
|
|
16289
16289
|
return;
|
|
16290
16290
|
}
|
|
16291
16291
|
let r = C($, this).getMode();
|
|
16292
|
-
if (r ===
|
|
16292
|
+
if (r === N.STAMP || r === N.POPUP || r === N.SIGNATURE) {
|
|
16293
16293
|
C($, this).unselectAll();
|
|
16294
16294
|
return;
|
|
16295
16295
|
}
|
|
@@ -16297,7 +16297,7 @@ var oy = /* @__PURE__ */ new WeakMap(), sy = /* @__PURE__ */ new WeakMap(), cy =
|
|
|
16297
16297
|
}
|
|
16298
16298
|
pointerdown(e) {
|
|
16299
16299
|
var t;
|
|
16300
|
-
if (C($, this).getMode() ===
|
|
16300
|
+
if (C($, this).getMode() === N.HIGHLIGHT && this.enableTextSelection(), C(fy, this)) {
|
|
16301
16301
|
T(fy, this, !1);
|
|
16302
16302
|
return;
|
|
16303
16303
|
}
|
|
@@ -16561,31 +16561,31 @@ var Py = /* @__PURE__ */ new WeakMap(), Fy = /* @__PURE__ */ new WeakMap(), Iy =
|
|
|
16561
16561
|
}
|
|
16562
16562
|
}
|
|
16563
16563
|
};
|
|
16564
|
-
|
|
16564
|
+
pe = Hy;
|
|
16565
16565
|
function Uy(e) {
|
|
16566
|
-
let t = m(
|
|
16567
|
-
t != null && t.selectionDiv && (t.selectionDiv.remove(), m(
|
|
16566
|
+
let t = m(pe, this, rb)._.get(e);
|
|
16567
|
+
t != null && t.selectionDiv && (t.selectionDiv.remove(), m(pe, this, eb)._.delete(t.selectionDiv), t.selectionDiv = null, t.path = null);
|
|
16568
16568
|
}
|
|
16569
16569
|
function Wy() {
|
|
16570
16570
|
let e = document.getSelection();
|
|
16571
16571
|
return !!e && !e.isCollapsed;
|
|
16572
16572
|
}
|
|
16573
16573
|
function Gy() {
|
|
16574
|
-
return [...m(
|
|
16574
|
+
return [...m(pe, this, nb)._].filter((e) => e.isConnected).sort(Ay);
|
|
16575
16575
|
}
|
|
16576
16576
|
function Ky() {
|
|
16577
16577
|
let e = document.getSelection();
|
|
16578
16578
|
if (!e || e.isCollapsed) {
|
|
16579
|
-
for (let e of m(
|
|
16580
|
-
m(
|
|
16579
|
+
for (let e of m(pe, this, eb)._) e.remove();
|
|
16580
|
+
m(pe, this, eb)._.clear();
|
|
16581
16581
|
return;
|
|
16582
16582
|
}
|
|
16583
|
-
let t = /* @__PURE__ */ new WeakMap(), n = m(
|
|
16583
|
+
let t = /* @__PURE__ */ new WeakMap(), n = m(pe, this, Gy).call(this), r = [];
|
|
16584
16584
|
for (let t = 0, i = e.rangeCount; t < i; t++) {
|
|
16585
16585
|
let i = e.getRangeAt(t);
|
|
16586
16586
|
if (i.collapsed) continue;
|
|
16587
16587
|
let { startContainer: a, startOffset: o, endContainer: s, endOffset: c } = i, l = jy(a), u = jy(s), d = l === null, f = u === null;
|
|
16588
|
-
if (m(
|
|
16588
|
+
if (m(pe, this, tb)._ && d !== f) return;
|
|
16589
16589
|
if (e.rangeCount === 1) {
|
|
16590
16590
|
let { anchorNode: t, anchorOffset: n, focusNode: r, focusOffset: i } = e, d = jy(t), f = jy(r), p = My(t, n, r, i);
|
|
16591
16591
|
d && f && p !== null && (p ? (a = t, o = n, l = d, s = r, c = i, u = f) : (a = r, o = i, l = f, s = t, c = n, u = d));
|
|
@@ -16631,7 +16631,7 @@ function Ky() {
|
|
|
16631
16631
|
}
|
|
16632
16632
|
}
|
|
16633
16633
|
let i = new Set(r.map((e) => e[1]));
|
|
16634
|
-
for (let e of m(
|
|
16634
|
+
for (let e of m(pe, this, nb)._) i.has(e) || m(pe, this, Uy).call(this, e);
|
|
16635
16635
|
for (let [e, n] of r) {
|
|
16636
16636
|
let r = rb._.get(n);
|
|
16637
16637
|
if (!r) continue;
|
|
@@ -16655,12 +16655,12 @@ function Ky() {
|
|
|
16655
16655
|
u = document.createElement("div"), u.className = "selection", u.style.clipPath = `url(#${e})`;
|
|
16656
16656
|
let t = (s = C(Ly, l)) == null ? void 0 : s.createSelectionStyle(C(Ry, l));
|
|
16657
16657
|
if (t) for (let [e, n] of Object.entries(t)) u.style.setProperty(e, n);
|
|
16658
|
-
let n =
|
|
16658
|
+
let n = pe._svgFactory.create(1, 1, !0);
|
|
16659
16659
|
n.setAttribute("aria-hidden", "true"), n.setAttribute("width", "100%"), n.setAttribute("height", "100%");
|
|
16660
|
-
let i =
|
|
16661
|
-
i.setAttribute("id", e), i.setAttribute("clipPathUnits", "objectBoundingBox"), d =
|
|
16660
|
+
let i = pe._svgFactory.createElement("clipPath");
|
|
16661
|
+
i.setAttribute("id", e), i.setAttribute("clipPathUnits", "objectBoundingBox"), d = pe._svgFactory.createElement("path"), i.append(d), n.append(i), u.append(n), r.path = d, r.selectionDiv = u;
|
|
16662
16662
|
}
|
|
16663
|
-
!u.parentNode && C(Py, l) && (C(Py, l).append(u), m(
|
|
16663
|
+
!u.parentNode && C(Py, l) && (C(Py, l).append(u), m(pe, this, eb)._.add(u)), d.setAttribute("d", c.join(" "));
|
|
16664
16664
|
}
|
|
16665
16665
|
}
|
|
16666
16666
|
function qy(e, [t, n, r, i]) {
|
|
@@ -16668,15 +16668,15 @@ function qy(e, [t, n, r, i]) {
|
|
|
16668
16668
|
a.top = `${100 * n}%`, a.left = `${100 * t}%`, a.width = `${100 * r}%`, a.height = `${100 * i}%`;
|
|
16669
16669
|
}
|
|
16670
16670
|
function Jy() {
|
|
16671
|
-
let e =
|
|
16671
|
+
let e = pe._svgFactory.create(1, 1, !0);
|
|
16672
16672
|
return C(Py, this).append(e), e.setAttribute("aria-hidden", "true"), e;
|
|
16673
16673
|
}
|
|
16674
16674
|
function Yy(e, t) {
|
|
16675
|
-
let n =
|
|
16675
|
+
let n = pe._svgFactory.createElement("clipPath");
|
|
16676
16676
|
e.append(n);
|
|
16677
16677
|
let r = `clip_${t}`;
|
|
16678
16678
|
n.setAttribute("id", r), n.setAttribute("clipPathUnits", "objectBoundingBox");
|
|
16679
|
-
let i =
|
|
16679
|
+
let i = pe._svgFactory.createElement("use");
|
|
16680
16680
|
return n.append(i), i.setAttribute("href", `#${t}`), i.classList.add("clip"), r;
|
|
16681
16681
|
}
|
|
16682
16682
|
function Xy(e, t) {
|
|
@@ -16744,12 +16744,12 @@ var mb = { _: null };
|
|
|
16744
16744
|
globalThis._pdfjsTestingUtils = { HighlightOutliner: Dg }, globalThis.pdfjsLib = {
|
|
16745
16745
|
AbortException: Qe,
|
|
16746
16746
|
AnnotationEditorLayer: Sy,
|
|
16747
|
-
AnnotationEditorParamsType:
|
|
16748
|
-
AnnotationEditorType:
|
|
16747
|
+
AnnotationEditorParamsType: P,
|
|
16748
|
+
AnnotationEditorType: N,
|
|
16749
16749
|
AnnotationEditorUIManager: Br,
|
|
16750
16750
|
AnnotationLayer: Ch,
|
|
16751
|
-
AnnotationMode:
|
|
16752
|
-
AnnotationType:
|
|
16751
|
+
AnnotationMode: Te,
|
|
16752
|
+
AnnotationType: je,
|
|
16753
16753
|
applyOpacity: Bt,
|
|
16754
16754
|
build: Kf,
|
|
16755
16755
|
ColorPicker: ip,
|
|
@@ -16767,7 +16767,7 @@ globalThis._pdfjsTestingUtils = { HighlightOutliner: Dg }, globalThis.pdfjsLib =
|
|
|
16767
16767
|
getRGBA: At,
|
|
16768
16768
|
getUuid: st,
|
|
16769
16769
|
GlobalWorkerOptions: Hu,
|
|
16770
|
-
ImageKind:
|
|
16770
|
+
ImageKind: Ae,
|
|
16771
16771
|
InvalidPDFException: Ye,
|
|
16772
16772
|
isDataScheme: yt,
|
|
16773
16773
|
isPdfFile: bt,
|
|
@@ -16778,14 +16778,14 @@ globalThis._pdfjsTestingUtils = { HighlightOutliner: Dg }, globalThis.pdfjsLib =
|
|
|
16778
16778
|
MathClamp: B,
|
|
16779
16779
|
noContextMenu: Et,
|
|
16780
16780
|
normalizeUnicode: ot,
|
|
16781
|
-
OPS:
|
|
16781
|
+
OPS: Pe,
|
|
16782
16782
|
OutputScale: It,
|
|
16783
16783
|
PasswordException: qe,
|
|
16784
16784
|
PasswordResponses: Ie,
|
|
16785
16785
|
PDFDataRangeTransport: lf,
|
|
16786
16786
|
PDFDateString: Ot,
|
|
16787
16787
|
PDFWorker: xf,
|
|
16788
|
-
PermissionFlag:
|
|
16788
|
+
PermissionFlag: Oe,
|
|
16789
16789
|
PixelsPerInch: ht,
|
|
16790
16790
|
RenderingCancelledException: vt,
|
|
16791
16791
|
renderRichText: qt,
|
|
@@ -16800,7 +16800,7 @@ globalThis._pdfjsTestingUtils = { HighlightOutliner: Dg }, globalThis.pdfjsLib =
|
|
|
16800
16800
|
TouchManager: Qi,
|
|
16801
16801
|
updateUrlHash: We,
|
|
16802
16802
|
Util: z,
|
|
16803
|
-
VerbosityLevel:
|
|
16803
|
+
VerbosityLevel: Ne,
|
|
16804
16804
|
version: Gf,
|
|
16805
16805
|
XfaLayer: mt
|
|
16806
16806
|
};
|
|
@@ -17462,17 +17462,17 @@ function Tb() {
|
|
|
17462
17462
|
//#endregion
|
|
17463
17463
|
//#region src/hooks/useSidebarState.ts
|
|
17464
17464
|
function Eb({ tableSchemas: e } = {}) {
|
|
17465
|
-
let [t, n] = s("invoice_items"), [r, i] = s("{% for item in invoice.items %}"), [o, c] = s("{% endfor %}"), [l, u] = s(""), [d, f] = s(""), [p, m] = s(null), [h, g] = s([]), [_, v] = s(!1), [y, b] = s(""), [x, S] = s(null), [C, w] = s(""), [T, E] = s(null), [ee, O] = s(null), [k,
|
|
17465
|
+
let [t, n] = s("invoice_items"), [r, i] = s("{% for item in invoice.items %}"), [o, c] = s("{% endfor %}"), [l, u] = s(""), [d, f] = s(""), [p, m] = s(null), [h, g] = s([]), [_, v] = s(!1), [y, b] = s(""), [x, S] = s(null), [C, w] = s(""), [T, E] = s(null), [ee, O] = s(null), [k, A] = s(""), [j, te] = s([]), ne = (e) => ({
|
|
17466
17466
|
columnName: e.columnName || e.columnNameEn || e.columnNameDe || "",
|
|
17467
17467
|
placeholder: e.placeholder || "",
|
|
17468
17468
|
enabled: e.enabled !== !1,
|
|
17469
17469
|
loop: !!e.loop,
|
|
17470
|
-
columns: Array.isArray(e.columns) ? e.columns.map(
|
|
17470
|
+
columns: Array.isArray(e.columns) ? e.columns.map(ne) : void 0
|
|
17471
17471
|
});
|
|
17472
17472
|
a(() => {
|
|
17473
|
-
e && e.length > 0 ? g(e.map((e) => D(D({}, e), {}, { columns: e.columns.map(
|
|
17473
|
+
e && e.length > 0 ? g(e.map((e) => D(D({}, e), {}, { columns: e.columns.map(ne) }))) : g([]);
|
|
17474
17474
|
}, [e]);
|
|
17475
|
-
let
|
|
17475
|
+
let re = () => {
|
|
17476
17476
|
if (!t.trim()) return;
|
|
17477
17477
|
let e = {
|
|
17478
17478
|
tableName: t.trim().replace(/\s+/g, "_").toLowerCase(),
|
|
@@ -17503,19 +17503,19 @@ function Eb({ tableSchemas: e } = {}) {
|
|
|
17503
17503
|
loopEndTag: o
|
|
17504
17504
|
};
|
|
17505
17505
|
g((t) => [...t, e]), n("");
|
|
17506
|
-
},
|
|
17506
|
+
}, ie = () => {
|
|
17507
17507
|
if (!k.trim()) return;
|
|
17508
17508
|
let e = k.trim().toLowerCase().replace(/\s+/g, "_");
|
|
17509
|
-
if (
|
|
17510
|
-
|
|
17509
|
+
if (j.some((t) => t.imageType === e)) {
|
|
17510
|
+
A("");
|
|
17511
17511
|
return;
|
|
17512
17512
|
}
|
|
17513
|
-
|
|
17513
|
+
te((t) => [...t, {
|
|
17514
17514
|
label: k.trim(),
|
|
17515
17515
|
imageType: e,
|
|
17516
17516
|
description: `Placeholder container for ${k.trim()}`
|
|
17517
|
-
}]),
|
|
17518
|
-
},
|
|
17517
|
+
}]), A("");
|
|
17518
|
+
}, ae = (e, t, n) => {
|
|
17519
17519
|
g((r) => r.map((r, i) => {
|
|
17520
17520
|
if (i === e) {
|
|
17521
17521
|
var a;
|
|
@@ -17528,7 +17528,7 @@ function Eb({ tableSchemas: e } = {}) {
|
|
|
17528
17528
|
}
|
|
17529
17529
|
return r;
|
|
17530
17530
|
}));
|
|
17531
|
-
}, [
|
|
17531
|
+
}, [M, oe] = s(null);
|
|
17532
17532
|
return {
|
|
17533
17533
|
customTableName: t,
|
|
17534
17534
|
setCustomTableName: n,
|
|
@@ -17555,22 +17555,22 @@ function Eb({ tableSchemas: e } = {}) {
|
|
|
17555
17555
|
dragOverIndex: ee,
|
|
17556
17556
|
setDragOverIndex: O,
|
|
17557
17557
|
newImgTypeName: k,
|
|
17558
|
-
setNewImgTypeName:
|
|
17559
|
-
customImageTypes:
|
|
17560
|
-
setCustomImageTypes:
|
|
17558
|
+
setNewImgTypeName: A,
|
|
17559
|
+
customImageTypes: j,
|
|
17560
|
+
setCustomImageTypes: te,
|
|
17561
17561
|
searchPlaceholder: C,
|
|
17562
17562
|
setSearchPlaceholder: w,
|
|
17563
|
-
handleAddCustomTable:
|
|
17564
|
-
handleAddCustomImageType:
|
|
17565
|
-
toggleSchemaColumn:
|
|
17563
|
+
handleAddCustomTable: re,
|
|
17564
|
+
handleAddCustomImageType: ie,
|
|
17565
|
+
toggleSchemaColumn: ae,
|
|
17566
17566
|
applySelectionFormat: (e, t = "") => {
|
|
17567
|
-
if (
|
|
17567
|
+
if (M) {
|
|
17568
17568
|
let e = window.getSelection();
|
|
17569
|
-
e == null || e.removeAllRanges(), e == null || e.addRange(
|
|
17569
|
+
e == null || e.removeAllRanges(), e == null || e.addRange(M);
|
|
17570
17570
|
}
|
|
17571
17571
|
document.execCommand(e, !1, t), m(null);
|
|
17572
17572
|
},
|
|
17573
|
-
setSavedRange:
|
|
17573
|
+
setSavedRange: oe
|
|
17574
17574
|
};
|
|
17575
17575
|
}
|
|
17576
17576
|
//#endregion
|
|
@@ -17988,13 +17988,14 @@ var Lb = [
|
|
|
17988
17988
|
}]]);
|
|
17989
17989
|
//#endregion
|
|
17990
17990
|
//#region src/components/WorkspaceHeader.tsx
|
|
17991
|
-
function px({ headerLogo: e, headerTitle: t, headerSubtitle: n, parseError: r, isParsing: i, parseStatusText: a }) {
|
|
17991
|
+
function px({ headerLogo: e, headerTitle: t, headerSubtitle: n, parseError: r, isParsing: i, parseStatusText: a, themeColor: o = "#ea580c" }) {
|
|
17992
17992
|
return /* @__PURE__ */ d("header", {
|
|
17993
17993
|
className: "bg-white border-b border-gray-200 px-6 py-3.5 flex items-center justify-between sticky top-0 z-10 shadow-xs gap-4",
|
|
17994
17994
|
children: [/* @__PURE__ */ d("div", {
|
|
17995
17995
|
className: "flex items-center space-x-3",
|
|
17996
17996
|
children: [e || /* @__PURE__ */ u("div", {
|
|
17997
|
-
|
|
17997
|
+
style: { backgroundColor: o },
|
|
17998
|
+
className: "h-9 w-9 rounded-xl flex items-center justify-center text-white shadow-md",
|
|
17998
17999
|
children: /* @__PURE__ */ u(tx, { className: "h-5 w-5" })
|
|
17999
18000
|
}), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("h1", {
|
|
18000
18001
|
className: "text-lg font-bold tracking-tight text-slate-800",
|
|
@@ -18009,7 +18010,12 @@ function px({ headerLogo: e, headerTitle: t, headerSubtitle: n, parseError: r, i
|
|
|
18009
18010
|
className: "text-[10px] text-red-500 font-bold bg-red-50 px-2 py-0.5 rounded inline-block border border-red-100",
|
|
18010
18011
|
children: ["Error: ", r]
|
|
18011
18012
|
}), i && /* @__PURE__ */ u("span", {
|
|
18012
|
-
|
|
18013
|
+
style: {
|
|
18014
|
+
color: o,
|
|
18015
|
+
borderColor: `${o}40`,
|
|
18016
|
+
backgroundColor: `${o}15`
|
|
18017
|
+
},
|
|
18018
|
+
className: "text-[10px] font-bold px-2 py-0.5 rounded inline-block border animate-pulse",
|
|
18013
18019
|
children: a || "Parsing..."
|
|
18014
18020
|
})]
|
|
18015
18021
|
})]
|
|
@@ -18092,7 +18098,7 @@ function mx({ handleSidebarDragStart: e, createTextBlock: t, setBlocks: n, setSe
|
|
|
18092
18098
|
}
|
|
18093
18099
|
//#endregion
|
|
18094
18100
|
//#region src/components/sidebar/TablesTab.tsx
|
|
18095
|
-
function hx({ schemas: e, toggleSchemaColumn: t, customTableName: n, setCustomTableName: r, customLoopStart: i, setCustomLoopStart: a, customLoopEnd: o, setCustomLoopEnd: s, handleAddCustomTable: c, handleSidebarDragStart: l, setBlocks: f, setSelectedBlockId: p, setActiveTab: m, defaultStyles: h, isTablesLoading: g, tablesLoading: _ }) {
|
|
18101
|
+
function hx({ schemas: e, toggleSchemaColumn: t, customTableName: n, setCustomTableName: r, customLoopStart: i, setCustomLoopStart: a, customLoopEnd: o, setCustomLoopEnd: s, handleAddCustomTable: c, handleSidebarDragStart: l, setBlocks: f, setSelectedBlockId: p, setActiveTab: m, defaultStyles: h, isTablesLoading: g, tablesLoading: _, themeColor: v = "#ea580c" }) {
|
|
18096
18102
|
return g || _ ? /* @__PURE__ */ d("div", {
|
|
18097
18103
|
className: "space-y-6",
|
|
18098
18104
|
children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("h3", {
|
|
@@ -18290,7 +18296,8 @@ function hx({ schemas: e, toggleSchemaColumn: t, customTableName: n, setCustomTa
|
|
|
18290
18296
|
})] }),
|
|
18291
18297
|
/* @__PURE__ */ d("button", {
|
|
18292
18298
|
onClick: c,
|
|
18293
|
-
|
|
18299
|
+
style: { backgroundColor: v },
|
|
18300
|
+
className: "w-full py-2 text-white rounded-xl text-xs font-bold transition-all shadow-sm flex items-center justify-center space-x-1.5",
|
|
18294
18301
|
children: [/* @__PURE__ */ u(Zb, { className: "h-4 w-4" }), /* @__PURE__ */ u("span", { children: "Add Custom Loop Table" })]
|
|
18295
18302
|
})
|
|
18296
18303
|
]
|
|
@@ -18301,8 +18308,8 @@ function hx({ schemas: e, toggleSchemaColumn: t, customTableName: n, setCustomTa
|
|
|
18301
18308
|
}
|
|
18302
18309
|
//#endregion
|
|
18303
18310
|
//#region src/components/sidebar/ImagesTab.tsx
|
|
18304
|
-
function gx({ customImageTypes: e, newImgTypeName: t, setNewImgTypeName: n, handleAddCustomImageType: r, handleSidebarDragStart: i, createImageBlock: a, setBlocks: o, setSelectedBlockId: s, setActiveTab: c }) {
|
|
18305
|
-
let
|
|
18311
|
+
function gx({ customImageTypes: e, newImgTypeName: t, setNewImgTypeName: n, handleAddCustomImageType: r, handleSidebarDragStart: i, createImageBlock: a, setBlocks: o, setSelectedBlockId: s, setActiveTab: c, themeColor: l = "#ea580c" }) {
|
|
18312
|
+
let f = [
|
|
18306
18313
|
{
|
|
18307
18314
|
label: "Brand Logo",
|
|
18308
18315
|
imageType: "logo",
|
|
@@ -18346,7 +18353,7 @@ function gx({ customImageTypes: e, newImgTypeName: t, setNewImgTypeName: n, hand
|
|
|
18346
18353
|
})] }),
|
|
18347
18354
|
/* @__PURE__ */ u("div", {
|
|
18348
18355
|
className: "space-y-3",
|
|
18349
|
-
children:
|
|
18356
|
+
children: f.map((e) => /* @__PURE__ */ d("div", {
|
|
18350
18357
|
className: "border border-gray-200 rounded-xl p-3 bg-white space-y-3 shadow-xs",
|
|
18351
18358
|
children: [
|
|
18352
18359
|
/* @__PURE__ */ u("div", {
|
|
@@ -18407,7 +18414,8 @@ function gx({ customImageTypes: e, newImgTypeName: t, setNewImgTypeName: n, hand
|
|
|
18407
18414
|
}),
|
|
18408
18415
|
/* @__PURE__ */ d("button", {
|
|
18409
18416
|
onClick: r,
|
|
18410
|
-
|
|
18417
|
+
style: { backgroundColor: l },
|
|
18418
|
+
className: "w-full py-1.5 text-white rounded-lg text-xs font-bold transition-all flex items-center justify-center space-x-1",
|
|
18411
18419
|
children: [/* @__PURE__ */ u(Zb, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ u("span", { children: "Add Custom Category" })]
|
|
18412
18420
|
})
|
|
18413
18421
|
]
|
|
@@ -18522,10 +18530,10 @@ var vx = (e) => {
|
|
|
18522
18530
|
}
|
|
18523
18531
|
return 100;
|
|
18524
18532
|
};
|
|
18525
|
-
function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, updateSelectedImageInfo: r, fontSizesState: i, fontFamiliesState: a, fontWeightsState: o, handleDeleteBlock: c, newColName: f, setNewColName: p, newColPlaceholder: m, setNewColPlaceholder: h, handleAddTableColumn: g, handleRemoveTableColumn: _, handleUpdateTableColumn: v, handleReorderTableColumn: y, handleAddTableRow: b, handleRemoveTableRow: x, setBlocks: S }) {
|
|
18526
|
-
var
|
|
18527
|
-
let [
|
|
18528
|
-
if (!e || !
|
|
18533
|
+
function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, updateSelectedImageInfo: r, fontSizesState: i, fontFamiliesState: a, fontWeightsState: o, handleDeleteBlock: c, newColName: f, setNewColName: p, newColPlaceholder: m, setNewColPlaceholder: h, handleAddTableColumn: g, handleRemoveTableColumn: _, handleUpdateTableColumn: v, handleReorderTableColumn: y, handleAddTableRow: b, handleRemoveTableRow: x, setBlocks: S, themeColor: C = "#ea580c" }) {
|
|
18534
|
+
var w;
|
|
18535
|
+
let [T, E] = s(null), [ee, O] = s(""), [k, A] = s(""), [j, te] = s(null), [ne, re] = s(""), [ie, ae] = s(""), M = t();
|
|
18536
|
+
if (!e || !M) return /* @__PURE__ */ d("div", {
|
|
18529
18537
|
className: "space-y-5",
|
|
18530
18538
|
children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("h3", {
|
|
18531
18539
|
className: "text-sm font-bold text-slate-800",
|
|
@@ -18548,11 +18556,11 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
18548
18556
|
]
|
|
18549
18557
|
})]
|
|
18550
18558
|
});
|
|
18551
|
-
let oe =
|
|
18559
|
+
let oe = M.type === "table", se = () => {
|
|
18552
18560
|
f.trim() && (g(f, m), p(""), h(""));
|
|
18553
18561
|
};
|
|
18554
|
-
if (
|
|
18555
|
-
let e =
|
|
18562
|
+
if (M.type === "image") {
|
|
18563
|
+
let e = M.imageInfo || { imageType: "logo" };
|
|
18556
18564
|
return /* @__PURE__ */ d("div", {
|
|
18557
18565
|
className: "space-y-5",
|
|
18558
18566
|
children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("h3", {
|
|
@@ -18587,13 +18595,14 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
18587
18595
|
})]
|
|
18588
18596
|
}), /* @__PURE__ */ u("button", {
|
|
18589
18597
|
onClick: () => {
|
|
18590
|
-
let e = !
|
|
18598
|
+
let e = !M.style.sameRow;
|
|
18591
18599
|
n("sameRow", e), e ? (n("width", "48%"), S((e) => {
|
|
18592
|
-
let t = e.findIndex((e) => e.id ===
|
|
18600
|
+
let t = e.findIndex((e) => e.id === M.id);
|
|
18593
18601
|
return t > 0 ? e.map((e, n) => n === t - 1 && (!e.style.width || e.style.width === "100%") ? D(D({}, e), {}, { style: D(D({}, e.style), {}, { width: "48%" }) }) : e) : e;
|
|
18594
18602
|
})) : n("width", "100%");
|
|
18595
18603
|
},
|
|
18596
|
-
|
|
18604
|
+
style: { backgroundColor: M.style.sameRow ? C : "#cbd5e1" },
|
|
18605
|
+
className: "w-10 h-6 flex items-center rounded-full p-1 transition-colors duration-150 cursor-pointer",
|
|
18597
18606
|
children: /* @__PURE__ */ u("span", { className: "bg-white w-4 h-4 rounded-full shadow-md" })
|
|
18598
18607
|
})]
|
|
18599
18608
|
}),
|
|
@@ -18639,7 +18648,7 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
18639
18648
|
].map((e) => /* @__PURE__ */ u("button", {
|
|
18640
18649
|
onClick: () => n("textAlign", e.value),
|
|
18641
18650
|
type: "button",
|
|
18642
|
-
className: `p-1.5 rounded transition-all ${
|
|
18651
|
+
className: `p-1.5 rounded transition-all ${M.style.textAlign === e.value ? "bg-white text-slate-800 shadow-xs border border-gray-200" : "text-slate-500 hover:text-slate-800"}`,
|
|
18643
18652
|
children: e.icon
|
|
18644
18653
|
}, e.value))
|
|
18645
18654
|
})]
|
|
@@ -18653,7 +18662,7 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
18653
18662
|
children: "Block Width (%)"
|
|
18654
18663
|
}), /* @__PURE__ */ d("span", {
|
|
18655
18664
|
className: "text-[10px] font-mono text-slate-500 font-bold bg-slate-100 px-1.5 py-0.5 rounded",
|
|
18656
|
-
children: [vx(
|
|
18665
|
+
children: [vx(M.style.width), "%"]
|
|
18657
18666
|
})]
|
|
18658
18667
|
}), /* @__PURE__ */ d("div", {
|
|
18659
18668
|
className: "flex items-center space-x-2",
|
|
@@ -18662,12 +18671,13 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
18662
18671
|
min: "10",
|
|
18663
18672
|
max: "100",
|
|
18664
18673
|
step: "5",
|
|
18665
|
-
value: vx(
|
|
18674
|
+
value: vx(M.style.width),
|
|
18666
18675
|
onChange: (e) => n("width", `${Math.min(100, Math.max(10, parseInt(e.target.value, 10)))}%`),
|
|
18667
|
-
|
|
18676
|
+
style: { accentColor: C },
|
|
18677
|
+
className: "w-full h-1 bg-gray-200 rounded-lg appearance-none cursor-pointer"
|
|
18668
18678
|
}), /* @__PURE__ */ d("span", {
|
|
18669
18679
|
className: "text-[10px] font-mono text-slate-500 w-10 text-right",
|
|
18670
|
-
children: [vx(
|
|
18680
|
+
children: [vx(M.style.width), "%"]
|
|
18671
18681
|
})]
|
|
18672
18682
|
})]
|
|
18673
18683
|
}),
|
|
@@ -18680,7 +18690,7 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
18680
18690
|
children: "Image Element Width (px)"
|
|
18681
18691
|
}), /* @__PURE__ */ u("span", {
|
|
18682
18692
|
className: "text-[10px] font-mono text-slate-500 font-bold bg-slate-100 px-1.5 py-0.5 rounded",
|
|
18683
|
-
children:
|
|
18693
|
+
children: M.style.imageWidth || (M.style.width && M.style.width.endsWith("px") ? M.style.width : "100%")
|
|
18684
18694
|
})]
|
|
18685
18695
|
}), /* @__PURE__ */ d("div", {
|
|
18686
18696
|
className: "flex items-center space-x-2",
|
|
@@ -18689,12 +18699,13 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
18689
18699
|
min: "10",
|
|
18690
18700
|
max: "1000",
|
|
18691
18701
|
step: "5",
|
|
18692
|
-
value: parseInt(
|
|
18702
|
+
value: parseInt(M.style.imageWidth || (M.style.width && M.style.width.endsWith("px") ? M.style.width : "100")) || 100,
|
|
18693
18703
|
onChange: (e) => n("imageWidth", `${e.target.value}px`),
|
|
18694
|
-
|
|
18704
|
+
style: { accentColor: C },
|
|
18705
|
+
className: "w-full h-1 bg-gray-200 rounded-lg appearance-none cursor-pointer"
|
|
18695
18706
|
}), /* @__PURE__ */ d("span", {
|
|
18696
18707
|
className: "text-[10px] font-mono text-slate-500 w-10 text-right",
|
|
18697
|
-
children: [parseInt(
|
|
18708
|
+
children: [parseInt(M.style.imageWidth || (M.style.width && M.style.width.endsWith("px") ? M.style.width : "100")) || 100, "px"]
|
|
18698
18709
|
})]
|
|
18699
18710
|
})]
|
|
18700
18711
|
}),
|
|
@@ -18704,7 +18715,7 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
18704
18715
|
className: "text-[10px] font-bold text-slate-400 uppercase tracking-wider block mb-1",
|
|
18705
18716
|
children: "Object Fit"
|
|
18706
18717
|
}), /* @__PURE__ */ d("select", {
|
|
18707
|
-
value:
|
|
18718
|
+
value: M.style.objectFit || "contain",
|
|
18708
18719
|
onChange: (e) => n("objectFit", e.target.value),
|
|
18709
18720
|
className: "w-full px-2 py-1.5 border border-gray-200 rounded-lg text-xs focus:outline-none focus:border-slate-500 bg-white font-medium",
|
|
18710
18721
|
children: [
|
|
@@ -18736,7 +18747,7 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
18736
18747
|
children: "Image Height"
|
|
18737
18748
|
}), /* @__PURE__ */ u("span", {
|
|
18738
18749
|
className: "text-[10px] font-mono text-slate-500 font-bold bg-slate-100 px-1.5 py-0.5 rounded",
|
|
18739
|
-
children:
|
|
18750
|
+
children: M.style.height || M.style.minHeight || "auto"
|
|
18740
18751
|
})]
|
|
18741
18752
|
}), /* @__PURE__ */ u("div", {
|
|
18742
18753
|
className: "flex items-center space-x-2",
|
|
@@ -18745,11 +18756,12 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
18745
18756
|
min: "20",
|
|
18746
18757
|
max: "400",
|
|
18747
18758
|
step: "10",
|
|
18748
|
-
value: parseInt(
|
|
18759
|
+
value: parseInt(M.style.height || M.style.minHeight || "100") || 100,
|
|
18749
18760
|
onChange: (e) => {
|
|
18750
18761
|
n("height", `${e.target.value}px`), n("minHeight", `${e.target.value}px`);
|
|
18751
18762
|
},
|
|
18752
|
-
|
|
18763
|
+
style: { accentColor: C },
|
|
18764
|
+
className: "w-full h-1 bg-gray-200 rounded-lg appearance-none cursor-pointer"
|
|
18753
18765
|
})
|
|
18754
18766
|
})]
|
|
18755
18767
|
}),
|
|
@@ -18830,9 +18842,10 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
18830
18842
|
min: "0",
|
|
18831
18843
|
max: "40",
|
|
18832
18844
|
step: "2",
|
|
18833
|
-
value: parseInt(
|
|
18845
|
+
value: parseInt(M.style.marginBottom || "0px"),
|
|
18834
18846
|
onChange: (e) => n("marginBottom", `${e.target.value}px`),
|
|
18835
|
-
|
|
18847
|
+
style: { accentColor: C },
|
|
18848
|
+
className: "w-full h-1 bg-gray-200 rounded-lg appearance-none cursor-pointer"
|
|
18836
18849
|
})]
|
|
18837
18850
|
}), /* @__PURE__ */ d("div", {
|
|
18838
18851
|
className: "space-y-1",
|
|
@@ -18844,9 +18857,10 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
18844
18857
|
min: "0",
|
|
18845
18858
|
max: "40",
|
|
18846
18859
|
step: "2",
|
|
18847
|
-
value: parseInt(
|
|
18860
|
+
value: parseInt(M.style.padding || "0px"),
|
|
18848
18861
|
onChange: (e) => n("padding", `${e.target.value}px`),
|
|
18849
|
-
|
|
18862
|
+
style: { accentColor: C },
|
|
18863
|
+
className: "w-full h-1 bg-gray-200 rounded-lg appearance-none cursor-pointer"
|
|
18850
18864
|
})]
|
|
18851
18865
|
})]
|
|
18852
18866
|
})
|
|
@@ -18854,7 +18868,7 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
18854
18868
|
/* @__PURE__ */ u("div", {
|
|
18855
18869
|
className: "pt-4 border-t border-red-100 flex items-center justify-between",
|
|
18856
18870
|
children: /* @__PURE__ */ d("button", {
|
|
18857
|
-
onClick: () => c(
|
|
18871
|
+
onClick: () => c(M.id),
|
|
18858
18872
|
className: "w-full py-2 bg-red-50 hover:bg-red-100 border border-red-200 text-red-650 rounded-xl text-xs font-bold transition-all flex items-center justify-center space-x-1 shadow-xs cursor-pointer",
|
|
18859
18873
|
children: [/* @__PURE__ */ u(lx, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ u("span", { children: "Delete Element" })]
|
|
18860
18874
|
})
|
|
@@ -18878,10 +18892,10 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
18878
18892
|
className: "flex items-center space-x-2 pb-3 border-b border-gray-100",
|
|
18879
18893
|
children: [/* @__PURE__ */ u("div", {
|
|
18880
18894
|
className: "h-6 px-3 bg-slate-100 rounded flex items-center justify-center text-slate-700 font-bold text-[10px] uppercase",
|
|
18881
|
-
children:
|
|
18895
|
+
children: M.type
|
|
18882
18896
|
}), /* @__PURE__ */ d("span", {
|
|
18883
18897
|
className: "text-xs font-bold text-slate-700 capitalize",
|
|
18884
|
-
children: ["Editing ",
|
|
18898
|
+
children: ["Editing ", M.type === "table" ? "Table Block" : "Typography Element"]
|
|
18885
18899
|
})]
|
|
18886
18900
|
}),
|
|
18887
18901
|
/* @__PURE__ */ d("div", {
|
|
@@ -18897,17 +18911,18 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
18897
18911
|
})]
|
|
18898
18912
|
}), /* @__PURE__ */ u("button", {
|
|
18899
18913
|
onClick: () => {
|
|
18900
|
-
let e = !
|
|
18914
|
+
let e = !M.style.sameRow;
|
|
18901
18915
|
n("sameRow", e), e ? (n("width", "48%"), S((e) => {
|
|
18902
|
-
let t = e.findIndex((e) => e.id ===
|
|
18916
|
+
let t = e.findIndex((e) => e.id === M.id);
|
|
18903
18917
|
return t > 0 ? e.map((e, n) => n === t - 1 && (!e.style.width || e.style.width === "100%") ? D(D({}, e), {}, { style: D(D({}, e.style), {}, { width: "48%" }) }) : e) : e;
|
|
18904
18918
|
})) : n("width", "100%");
|
|
18905
18919
|
},
|
|
18906
|
-
|
|
18920
|
+
style: { backgroundColor: M.style.sameRow ? C : "#cbd5e1" },
|
|
18921
|
+
className: "w-10 h-6 flex items-center rounded-full p-1 transition-colors duration-150 cursor-pointer",
|
|
18907
18922
|
children: /* @__PURE__ */ u("span", { className: "bg-white w-4 h-4 rounded-full shadow-md" })
|
|
18908
18923
|
})]
|
|
18909
18924
|
}),
|
|
18910
|
-
|
|
18925
|
+
M.style.sameRow && /* @__PURE__ */ d("div", {
|
|
18911
18926
|
className: "flex items-center justify-between p-3 bg-slate-50 border border-gray-200 rounded-xl select-none",
|
|
18912
18927
|
children: [/* @__PURE__ */ d("div", {
|
|
18913
18928
|
className: "space-y-0.5",
|
|
@@ -18924,7 +18939,7 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
18924
18939
|
type: "button",
|
|
18925
18940
|
onClick: () => {
|
|
18926
18941
|
n("flexDirection", e), S((t) => {
|
|
18927
|
-
let n = t.findIndex((e) => e.id ===
|
|
18942
|
+
let n = t.findIndex((e) => e.id === M.id);
|
|
18928
18943
|
if (n === -1) return t;
|
|
18929
18944
|
let r = n;
|
|
18930
18945
|
for (; r > 0 && t[r].style.sameRow;) r--;
|
|
@@ -18933,7 +18948,7 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
18933
18948
|
return t.map((t, n) => i.includes(n) ? D(D({}, t), {}, { style: D(D({}, t.style), {}, { flexDirection: e }) }) : t);
|
|
18934
18949
|
});
|
|
18935
18950
|
},
|
|
18936
|
-
className: `px-2 py-1 text-[9px] font-bold rounded capitalize transition-all text-center ${
|
|
18951
|
+
className: `px-2 py-1 text-[9px] font-bold rounded capitalize transition-all text-center ${M.style.flexDirection === e || e === "row" && !M.style.flexDirection ? "bg-white text-slate-800 shadow-xs border border-gray-200" : "text-slate-500 hover:text-slate-800"}`,
|
|
18937
18952
|
children: e === "row" ? "Side-by-side" : "Stacked"
|
|
18938
18953
|
}, e))
|
|
18939
18954
|
})]
|
|
@@ -18946,7 +18961,7 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
18946
18961
|
className: "text-[10px] font-bold text-slate-400 uppercase tracking-wider",
|
|
18947
18962
|
children: "Font Size"
|
|
18948
18963
|
}), /* @__PURE__ */ u("select", {
|
|
18949
|
-
value:
|
|
18964
|
+
value: M.style.fontSize,
|
|
18950
18965
|
onChange: (e) => n("fontSize", e.target.value),
|
|
18951
18966
|
className: "w-full px-2 py-1.5 border border-gray-200 rounded-lg text-xs focus:outline-none focus:border-slate-500 bg-white font-medium",
|
|
18952
18967
|
children: i.map((e) => /* @__PURE__ */ u("option", {
|
|
@@ -18960,7 +18975,7 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
18960
18975
|
className: "text-[10px] font-bold text-slate-400 uppercase tracking-wider",
|
|
18961
18976
|
children: "Weight"
|
|
18962
18977
|
}), /* @__PURE__ */ u("select", {
|
|
18963
|
-
value:
|
|
18978
|
+
value: M.style.fontWeight,
|
|
18964
18979
|
onChange: (e) => n("fontWeight", e.target.value),
|
|
18965
18980
|
className: "w-full px-2 py-1.5 border border-gray-200 rounded-lg text-xs focus:outline-none focus:border-slate-500 bg-white font-medium",
|
|
18966
18981
|
children: o.map((e) => /* @__PURE__ */ u("option", {
|
|
@@ -18976,7 +18991,7 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
18976
18991
|
className: "text-[10px] font-bold text-slate-400 uppercase tracking-wider block",
|
|
18977
18992
|
children: "Font Family"
|
|
18978
18993
|
}), /* @__PURE__ */ d("select", {
|
|
18979
|
-
value:
|
|
18994
|
+
value: M.style.fontFamily || "",
|
|
18980
18995
|
onChange: (e) => n("fontFamily", e.target.value),
|
|
18981
18996
|
className: "w-full px-2 py-1.5 border border-gray-200 rounded-lg text-xs focus:outline-none focus:border-slate-500 bg-white font-medium",
|
|
18982
18997
|
children: [/* @__PURE__ */ u("option", {
|
|
@@ -19017,7 +19032,7 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19017
19032
|
}
|
|
19018
19033
|
].map((e) => /* @__PURE__ */ u("button", {
|
|
19019
19034
|
onClick: () => n("textAlign", e.value),
|
|
19020
|
-
className: `p-1.5 rounded transition-all ${
|
|
19035
|
+
className: `p-1.5 rounded transition-all ${M.style.textAlign === e.value ? "bg-white text-slate-800 shadow-xs border border-gray-200" : "text-slate-500 hover:text-slate-800"}`,
|
|
19021
19036
|
children: e.icon
|
|
19022
19037
|
}, e.value))
|
|
19023
19038
|
}),
|
|
@@ -19046,7 +19061,7 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19046
19061
|
className: "line-through"
|
|
19047
19062
|
}
|
|
19048
19063
|
].map((e) => {
|
|
19049
|
-
let t =
|
|
19064
|
+
let t = M.style[e.key] === !0;
|
|
19050
19065
|
return /* @__PURE__ */ u("button", {
|
|
19051
19066
|
onClick: () => n(e.key, !t),
|
|
19052
19067
|
className: `h-7 w-7 rounded text-xs transition-all ${t ? "bg-white text-slate-800 shadow-xs border border-gray-200 font-bold" : "text-slate-500 hover:text-slate-800"}`,
|
|
@@ -19071,11 +19086,11 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19071
19086
|
className: "flex flex-wrap gap-1.5",
|
|
19072
19087
|
children: [gb.map((e) => /* @__PURE__ */ u("button", {
|
|
19073
19088
|
onClick: () => n("color", e),
|
|
19074
|
-
className: `h-5 w-5 rounded-full border border-gray-200 shadow-xs transition-transform ${
|
|
19089
|
+
className: `h-5 w-5 rounded-full border border-gray-200 shadow-xs transition-transform ${M.style.color === e ? "scale-120 ring-2 ring-slate-800" : "hover:scale-110"}`,
|
|
19075
19090
|
style: { backgroundColor: e }
|
|
19076
19091
|
}, e)), /* @__PURE__ */ u("input", {
|
|
19077
19092
|
type: "color",
|
|
19078
|
-
value:
|
|
19093
|
+
value: M.style.color,
|
|
19079
19094
|
onChange: (e) => n("color", e.target.value),
|
|
19080
19095
|
className: "h-5 w-5 rounded-full border border-gray-200 cursor-pointer overflow-hidden p-0"
|
|
19081
19096
|
})]
|
|
@@ -19089,7 +19104,7 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19089
19104
|
className: "flex flex-wrap gap-1.5",
|
|
19090
19105
|
children: [_b.map((e) => /* @__PURE__ */ u("button", {
|
|
19091
19106
|
onClick: () => n("backgroundColor", e),
|
|
19092
|
-
className: `h-5 w-5 rounded-full border border-gray-200 shadow-xs transition-transform ${
|
|
19107
|
+
className: `h-5 w-5 rounded-full border border-gray-200 shadow-xs transition-transform ${M.style.backgroundColor === e ? "scale-120 ring-2 ring-slate-800" : "hover:scale-110"}`,
|
|
19093
19108
|
style: { backgroundColor: e === "transparent" ? "#ffffff" : e },
|
|
19094
19109
|
children: e === "transparent" && /* @__PURE__ */ u("span", {
|
|
19095
19110
|
className: "text-[8px] text-slate-400 font-bold block leading-5 text-center",
|
|
@@ -19097,7 +19112,7 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19097
19112
|
})
|
|
19098
19113
|
}, e)), /* @__PURE__ */ u("input", {
|
|
19099
19114
|
type: "color",
|
|
19100
|
-
value:
|
|
19115
|
+
value: M.style.backgroundColor === "transparent" ? "#ffffff" : M.style.backgroundColor,
|
|
19101
19116
|
onChange: (e) => n("backgroundColor", e.target.value),
|
|
19102
19117
|
className: "h-5 w-5 rounded-full border border-gray-200 cursor-pointer overflow-hidden p-0"
|
|
19103
19118
|
})]
|
|
@@ -19116,7 +19131,7 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19116
19131
|
children: "Block Width (%)"
|
|
19117
19132
|
}), /* @__PURE__ */ d("span", {
|
|
19118
19133
|
className: "text-[10px] font-mono text-slate-500 font-bold bg-slate-100 px-1.5 py-0.5 rounded",
|
|
19119
|
-
children: [vx(
|
|
19134
|
+
children: [vx(M.style.width), "%"]
|
|
19120
19135
|
})]
|
|
19121
19136
|
}), /* @__PURE__ */ d("div", {
|
|
19122
19137
|
className: "flex items-center space-x-2",
|
|
@@ -19125,12 +19140,13 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19125
19140
|
min: "10",
|
|
19126
19141
|
max: "100",
|
|
19127
19142
|
step: "5",
|
|
19128
|
-
value: vx(
|
|
19143
|
+
value: vx(M.style.width),
|
|
19129
19144
|
onChange: (e) => n("width", `${Math.min(100, Math.max(10, parseInt(e.target.value, 10)))}%`),
|
|
19130
|
-
|
|
19145
|
+
style: { accentColor: C },
|
|
19146
|
+
className: "w-full h-1 bg-gray-200 rounded-lg appearance-none cursor-pointer"
|
|
19131
19147
|
}), /* @__PURE__ */ d("span", {
|
|
19132
19148
|
className: "text-[10px] font-mono text-slate-500 w-10 text-right",
|
|
19133
|
-
children: [vx(
|
|
19149
|
+
children: [vx(M.style.width), "%"]
|
|
19134
19150
|
})]
|
|
19135
19151
|
})]
|
|
19136
19152
|
}),
|
|
@@ -19146,9 +19162,10 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19146
19162
|
min: "0",
|
|
19147
19163
|
max: "40",
|
|
19148
19164
|
step: "2",
|
|
19149
|
-
value: parseInt(
|
|
19165
|
+
value: parseInt(M.style.marginBottom || "0px"),
|
|
19150
19166
|
onChange: (e) => n("marginBottom", `${e.target.value}px`),
|
|
19151
|
-
|
|
19167
|
+
style: { accentColor: C },
|
|
19168
|
+
className: "w-full h-1 bg-gray-200 rounded-lg appearance-none cursor-pointer"
|
|
19152
19169
|
})]
|
|
19153
19170
|
}), /* @__PURE__ */ d("div", {
|
|
19154
19171
|
className: "space-y-1",
|
|
@@ -19160,9 +19177,10 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19160
19177
|
min: "0",
|
|
19161
19178
|
max: "40",
|
|
19162
19179
|
step: "2",
|
|
19163
|
-
value: parseInt(
|
|
19180
|
+
value: parseInt(M.style.padding || "0px"),
|
|
19164
19181
|
onChange: (e) => n("padding", `${e.target.value}px`),
|
|
19165
|
-
|
|
19182
|
+
style: { accentColor: C },
|
|
19183
|
+
className: "w-full h-1 bg-gray-200 rounded-lg appearance-none cursor-pointer"
|
|
19166
19184
|
})]
|
|
19167
19185
|
})]
|
|
19168
19186
|
}),
|
|
@@ -19180,15 +19198,16 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19180
19198
|
}), /* @__PURE__ */ u("button", {
|
|
19181
19199
|
type: "button",
|
|
19182
19200
|
onClick: () => {
|
|
19183
|
-
n("pageBreakBefore",
|
|
19201
|
+
n("pageBreakBefore", M.style.pageBreakBefore === "always" || M.style.pageBreakBefore === !0 ? "auto" : "always");
|
|
19184
19202
|
},
|
|
19185
|
-
|
|
19203
|
+
style: { backgroundColor: M.style.pageBreakBefore === "always" || M.style.pageBreakBefore === !0 ? C : "#cbd5e1" },
|
|
19204
|
+
className: "w-10 h-6 flex items-center rounded-full p-1 transition-colors duration-150 cursor-pointer",
|
|
19186
19205
|
children: /* @__PURE__ */ u("span", { className: "bg-white w-4 h-4 rounded-full shadow-md" })
|
|
19187
19206
|
})]
|
|
19188
19207
|
})
|
|
19189
19208
|
]
|
|
19190
19209
|
}),
|
|
19191
|
-
oe &&
|
|
19210
|
+
oe && M.tableInfo && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d("div", {
|
|
19192
19211
|
className: "space-y-3 pt-3 border-t border-gray-100",
|
|
19193
19212
|
children: [/* @__PURE__ */ d("div", {
|
|
19194
19213
|
className: "flex items-center justify-between",
|
|
@@ -19197,17 +19216,18 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19197
19216
|
children: "Table Rows"
|
|
19198
19217
|
}), /* @__PURE__ */ d("span", {
|
|
19199
19218
|
className: "text-[10px] text-slate-400 font-medium",
|
|
19200
|
-
children: [((
|
|
19219
|
+
children: [((w = M.tableInfo.mockRows) == null ? void 0 : w.length) || 1, " row(s) configured"]
|
|
19201
19220
|
})] }), /* @__PURE__ */ d("button", {
|
|
19202
19221
|
type: "button",
|
|
19203
|
-
onClick: () => b && b(
|
|
19204
|
-
|
|
19222
|
+
onClick: () => b && b(M.id),
|
|
19223
|
+
style: { backgroundColor: C },
|
|
19224
|
+
className: "px-3 py-1.5 text-white rounded-lg text-xs font-bold transition-all flex items-center space-x-1 shadow-xs cursor-pointer",
|
|
19205
19225
|
title: "Add a new row to table",
|
|
19206
19226
|
children: [/* @__PURE__ */ u(Zb, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ u("span", { children: "Add Row" })]
|
|
19207
19227
|
})]
|
|
19208
19228
|
}), /* @__PURE__ */ u("div", {
|
|
19209
19229
|
className: "space-y-1.5 max-h-[140px] overflow-y-auto pr-1",
|
|
19210
|
-
children: (
|
|
19230
|
+
children: (M.tableInfo.mockRows && M.tableInfo.mockRows.length > 0 ? M.tableInfo.mockRows : [{}]).map((e, t) => {
|
|
19211
19231
|
var n;
|
|
19212
19232
|
return /* @__PURE__ */ d("div", {
|
|
19213
19233
|
className: "flex items-center justify-between bg-slate-50 border border-gray-200 rounded-lg p-2 text-xs",
|
|
@@ -19216,8 +19236,8 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19216
19236
|
children: ["Row #", t + 1]
|
|
19217
19237
|
}), /* @__PURE__ */ u("button", {
|
|
19218
19238
|
type: "button",
|
|
19219
|
-
onClick: () => x && x(t,
|
|
19220
|
-
disabled: (((n =
|
|
19239
|
+
onClick: () => x && x(t, M.id),
|
|
19240
|
+
disabled: (((n = M.tableInfo) == null || (n = n.mockRows) == null ? void 0 : n.length) || 1) <= 1,
|
|
19221
19241
|
className: "p-1 text-slate-400 hover:text-red-600 hover:bg-red-50 disabled:opacity-30 disabled:hover:bg-transparent rounded transition-colors",
|
|
19222
19242
|
title: "Remove row",
|
|
19223
19243
|
children: /* @__PURE__ */ u(lx, { className: "h-3.5 w-3.5" })
|
|
@@ -19234,12 +19254,12 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19234
19254
|
}),
|
|
19235
19255
|
/* @__PURE__ */ u("div", {
|
|
19236
19256
|
className: "space-y-2 max-h-[300px] overflow-y-auto pr-1",
|
|
19237
|
-
children:
|
|
19257
|
+
children: M.tableInfo.columns.map((e, t) => {
|
|
19238
19258
|
var n, r;
|
|
19239
19259
|
let i = e.loop && e.columns && e.columns.length > 0;
|
|
19240
19260
|
return /* @__PURE__ */ d("div", {
|
|
19241
19261
|
className: "bg-slate-50 border border-gray-200 rounded-lg p-2 space-y-1.5 text-xs",
|
|
19242
|
-
children: [
|
|
19262
|
+
children: [T === String(t) ? /* @__PURE__ */ d("div", {
|
|
19243
19263
|
className: "space-y-1.5 p-1 bg-white border border-orange-300 rounded",
|
|
19244
19264
|
children: [
|
|
19245
19265
|
/* @__PURE__ */ u("div", {
|
|
@@ -19248,15 +19268,15 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19248
19268
|
}),
|
|
19249
19269
|
/* @__PURE__ */ u("input", {
|
|
19250
19270
|
type: "text",
|
|
19251
|
-
value:
|
|
19252
|
-
onChange: (e) =>
|
|
19271
|
+
value: ee,
|
|
19272
|
+
onChange: (e) => O(e.target.value),
|
|
19253
19273
|
placeholder: "Header Name",
|
|
19254
19274
|
className: "w-full px-2 py-0.5 border border-gray-200 rounded text-xs bg-white"
|
|
19255
19275
|
}),
|
|
19256
19276
|
/* @__PURE__ */ u("input", {
|
|
19257
19277
|
type: "text",
|
|
19258
|
-
value:
|
|
19259
|
-
onChange: (e) =>
|
|
19278
|
+
value: k,
|
|
19279
|
+
onChange: (e) => A(e.target.value),
|
|
19260
19280
|
placeholder: "Value (e.g. {{item.sku}})",
|
|
19261
19281
|
className: "w-full px-2 py-0.5 border border-gray-200 rounded text-xs font-mono bg-white"
|
|
19262
19282
|
}),
|
|
@@ -19264,12 +19284,13 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19264
19284
|
className: "flex justify-end gap-1",
|
|
19265
19285
|
children: [/* @__PURE__ */ d("button", {
|
|
19266
19286
|
onClick: () => {
|
|
19267
|
-
v && v(t,
|
|
19287
|
+
v && v(t, ee, k), E(null);
|
|
19268
19288
|
},
|
|
19269
|
-
|
|
19289
|
+
style: { backgroundColor: C },
|
|
19290
|
+
className: "p-1 px-2 text-white rounded text-[10px] flex items-center gap-1 font-bold cursor-pointer",
|
|
19270
19291
|
children: [/* @__PURE__ */ u(Wb, { className: "h-3 w-3" }), /* @__PURE__ */ u("span", { children: "Save" })]
|
|
19271
19292
|
}), /* @__PURE__ */ d("button", {
|
|
19272
|
-
onClick: () =>
|
|
19293
|
+
onClick: () => E(null),
|
|
19273
19294
|
className: "p-1 px-2 bg-gray-200 text-slate-700 hover:bg-gray-300 rounded text-[10px] flex items-center gap-1",
|
|
19274
19295
|
children: [/* @__PURE__ */ u(fx, { className: "h-3 w-3" }), /* @__PURE__ */ u("span", { children: "Cancel" })]
|
|
19275
19296
|
})]
|
|
@@ -19301,14 +19322,14 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19301
19322
|
}),
|
|
19302
19323
|
/* @__PURE__ */ u("button", {
|
|
19303
19324
|
onClick: () => y && y(t, "down"),
|
|
19304
|
-
disabled: t === (((n =
|
|
19325
|
+
disabled: t === (((n = M.tableInfo) == null ? void 0 : n.columns.length) || 0) - 1,
|
|
19305
19326
|
className: "p-1 text-slate-400 hover:text-slate-700 hover:bg-slate-200 disabled:opacity-30 disabled:hover:bg-transparent rounded transition-colors",
|
|
19306
19327
|
title: "Move Down",
|
|
19307
19328
|
children: /* @__PURE__ */ u(Vb, { className: "h-3.5 w-3.5" })
|
|
19308
19329
|
}),
|
|
19309
19330
|
/* @__PURE__ */ u("button", {
|
|
19310
19331
|
onClick: () => {
|
|
19311
|
-
|
|
19332
|
+
E(String(t)), O(e.columnName), A(e.placeholder);
|
|
19312
19333
|
},
|
|
19313
19334
|
className: "p-1 text-slate-400 hover:text-slate-700 hover:bg-slate-200 rounded transition-colors",
|
|
19314
19335
|
title: "Edit column",
|
|
@@ -19317,7 +19338,7 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19317
19338
|
/* @__PURE__ */ u("button", {
|
|
19318
19339
|
onClick: () => _(t),
|
|
19319
19340
|
className: "p-1 text-slate-400 hover:text-red-600 hover:bg-red-50 rounded transition-colors border border-transparent",
|
|
19320
|
-
disabled: !
|
|
19341
|
+
disabled: !M.tableInfo || M.tableInfo.columns.length <= 1,
|
|
19321
19342
|
title: "Delete column",
|
|
19322
19343
|
children: /* @__PURE__ */ u(lx, { className: "h-3.5 w-3.5" })
|
|
19323
19344
|
})
|
|
@@ -19339,7 +19360,7 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19339
19360
|
}),
|
|
19340
19361
|
e.columns.map((n, r) => {
|
|
19341
19362
|
let i = `${t}-${r}`;
|
|
19342
|
-
return
|
|
19363
|
+
return T === i ? /* @__PURE__ */ d("div", {
|
|
19343
19364
|
className: "space-y-1 p-1.5 bg-white border border-blue-300 rounded",
|
|
19344
19365
|
children: [
|
|
19345
19366
|
/* @__PURE__ */ u("div", {
|
|
@@ -19348,15 +19369,15 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19348
19369
|
}),
|
|
19349
19370
|
/* @__PURE__ */ u("input", {
|
|
19350
19371
|
type: "text",
|
|
19351
|
-
value:
|
|
19352
|
-
onChange: (e) =>
|
|
19372
|
+
value: ee,
|
|
19373
|
+
onChange: (e) => O(e.target.value),
|
|
19353
19374
|
placeholder: "Header Name",
|
|
19354
19375
|
className: "w-full px-2 py-0.5 border border-gray-200 rounded text-[11px] bg-white"
|
|
19355
19376
|
}),
|
|
19356
19377
|
/* @__PURE__ */ u("input", {
|
|
19357
19378
|
type: "text",
|
|
19358
|
-
value:
|
|
19359
|
-
onChange: (e) =>
|
|
19379
|
+
value: k,
|
|
19380
|
+
onChange: (e) => A(e.target.value),
|
|
19360
19381
|
placeholder: "Value",
|
|
19361
19382
|
className: "w-full px-2 py-0.5 border border-gray-200 rounded text-[11px] font-mono bg-white"
|
|
19362
19383
|
}),
|
|
@@ -19364,12 +19385,12 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19364
19385
|
className: "flex justify-end gap-1 pt-0.5",
|
|
19365
19386
|
children: [/* @__PURE__ */ d("button", {
|
|
19366
19387
|
onClick: () => {
|
|
19367
|
-
v && v(t,
|
|
19388
|
+
v && v(t, ee, k, r), E(null);
|
|
19368
19389
|
},
|
|
19369
19390
|
className: "p-0.5 px-1.5 bg-blue-600 text-white hover:bg-blue-700 rounded text-[9px] flex items-center gap-1 font-bold",
|
|
19370
19391
|
children: [/* @__PURE__ */ u(Wb, { className: "h-2.5 w-2.5" }), /* @__PURE__ */ u("span", { children: "Save" })]
|
|
19371
19392
|
}), /* @__PURE__ */ d("button", {
|
|
19372
|
-
onClick: () =>
|
|
19393
|
+
onClick: () => E(null),
|
|
19373
19394
|
className: "p-0.5 px-1.5 bg-gray-200 text-slate-700 hover:bg-gray-300 rounded text-[9px] flex items-center gap-1",
|
|
19374
19395
|
children: [/* @__PURE__ */ u(fx, { className: "h-2.5 w-2.5" }), /* @__PURE__ */ u("span", { children: "Cancel" })]
|
|
19375
19396
|
})]
|
|
@@ -19405,7 +19426,7 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19405
19426
|
}),
|
|
19406
19427
|
/* @__PURE__ */ u("button", {
|
|
19407
19428
|
onClick: () => {
|
|
19408
|
-
|
|
19429
|
+
E(i), O(n.columnName), A(n.placeholder);
|
|
19409
19430
|
},
|
|
19410
19431
|
className: "p-0.5 text-slate-400 hover:text-slate-700 hover:bg-slate-100 rounded",
|
|
19411
19432
|
title: "Edit sub-column",
|
|
@@ -19421,7 +19442,7 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19421
19442
|
})]
|
|
19422
19443
|
}, r);
|
|
19423
19444
|
}),
|
|
19424
|
-
|
|
19445
|
+
j === t ? /* @__PURE__ */ d("div", {
|
|
19425
19446
|
className: "bg-white border border-blue-200 rounded p-2 space-y-1.5 mt-1",
|
|
19426
19447
|
children: [
|
|
19427
19448
|
/* @__PURE__ */ u("span", {
|
|
@@ -19446,13 +19467,13 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19446
19467
|
className: "flex gap-1 pt-1",
|
|
19447
19468
|
children: [/* @__PURE__ */ u("button", {
|
|
19448
19469
|
onClick: () => {
|
|
19449
|
-
ne.trim() && (g(ne, ie || "{{item.value}}", !1, t), re(""), ae(""),
|
|
19470
|
+
ne.trim() && (g(ne, ie || "{{item.value}}", !1, t), re(""), ae(""), te(null));
|
|
19450
19471
|
},
|
|
19451
19472
|
className: "flex-1 py-1 bg-blue-600 hover:bg-blue-700 text-white rounded text-[10px] font-bold",
|
|
19452
19473
|
children: "Add"
|
|
19453
19474
|
}), /* @__PURE__ */ u("button", {
|
|
19454
19475
|
onClick: () => {
|
|
19455
|
-
|
|
19476
|
+
te(null), re(""), ae("");
|
|
19456
19477
|
},
|
|
19457
19478
|
className: "py-1 px-2 bg-gray-100 hover:bg-gray-200 text-slate-600 rounded text-[10px]",
|
|
19458
19479
|
children: "Cancel"
|
|
@@ -19460,7 +19481,7 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19460
19481
|
})
|
|
19461
19482
|
]
|
|
19462
19483
|
}) : /* @__PURE__ */ d("button", {
|
|
19463
|
-
onClick: () =>
|
|
19484
|
+
onClick: () => te(t),
|
|
19464
19485
|
className: "w-full py-1 text-[10px] font-bold text-blue-600 hover:bg-blue-50 border border-dashed border-blue-200 rounded flex items-center justify-center space-x-1 transition-colors mt-1",
|
|
19465
19486
|
children: [/* @__PURE__ */ u(Zb, { className: "h-3 w-3" }), /* @__PURE__ */ u("span", { children: "Add Sub-Column" })]
|
|
19466
19487
|
})
|
|
@@ -19494,7 +19515,8 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19494
19515
|
className: "flex gap-2",
|
|
19495
19516
|
children: [/* @__PURE__ */ d("button", {
|
|
19496
19517
|
onClick: se,
|
|
19497
|
-
|
|
19518
|
+
style: { backgroundColor: C },
|
|
19519
|
+
className: "flex-1 py-1.5 text-white rounded-lg text-xs font-bold transition-all flex items-center justify-center space-x-1 cursor-pointer",
|
|
19498
19520
|
children: [/* @__PURE__ */ u(Zb, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ u("span", { children: "Column" })]
|
|
19499
19521
|
}), /* @__PURE__ */ d("button", {
|
|
19500
19522
|
onClick: () => {
|
|
@@ -19512,7 +19534,7 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19512
19534
|
/* @__PURE__ */ u("div", {
|
|
19513
19535
|
className: "pt-4 border-t border-red-100 flex items-center justify-between",
|
|
19514
19536
|
children: /* @__PURE__ */ d("button", {
|
|
19515
|
-
onClick: () => c(
|
|
19537
|
+
onClick: () => c(M.id),
|
|
19516
19538
|
className: "w-full py-2 bg-red-50 hover:bg-red-100 border border-red-200 text-red-650 rounded-xl text-xs font-bold transition-all flex items-center justify-center space-x-1 shadow-xs cursor-pointer",
|
|
19517
19539
|
children: [/* @__PURE__ */ u(lx, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ u("span", { children: "Delete Element" })]
|
|
19518
19540
|
})
|
|
@@ -19523,7 +19545,7 @@ function yx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
|
|
|
19523
19545
|
}
|
|
19524
19546
|
//#endregion
|
|
19525
19547
|
//#region src/components/SidebarPanel.tsx
|
|
19526
|
-
function bx({ activeTab: e, setActiveTab: t,
|
|
19548
|
+
function bx({ activeTab: e, setActiveTab: t, themeColor: n = "#ea580c", setBlocks: r, selectedBlockId: i, setSelectedBlockId: a, getSelectedBlock: o, defaultStyles: s, createTextBlock: c, createImageBlock: l, updateSelectedStyle: f, updateSelectedImageInfo: p, handleDeleteBlock: m, handleRemoveTableColumn: h, handleAddTableColumn: g, handleUpdateTableColumn: _, handleReorderTableColumn: v, handleAddTableRow: y, handleRemoveTableRow: b, schemas: x, toggleSchemaColumn: S, customTableName: C, setCustomTableName: w, customLoopStart: T, setCustomLoopStart: E, customLoopEnd: D, setCustomLoopEnd: ee, handleAddCustomTable: O, newColName: k, setNewColName: A, newColPlaceholder: j, setNewColPlaceholder: te, customImageTypes: ne, newImgTypeName: re, setNewImgTypeName: ie, handleAddCustomImageType: ae, placeholders: M, searchPlaceholder: oe, setSearchPlaceholder: se, handleSidebarDragStart: ce, isTablesLoading: le, tablesLoading: ue, isPlaceholdersLoading: de, placeholdersLoading: fe, fontSizesState: pe, fontFamiliesState: me, fontWeightsState: he, sidebarPosition: ge = "left" }) {
|
|
19527
19549
|
return /* @__PURE__ */ d("aside", {
|
|
19528
19550
|
className: `w-full lg:w-[30%] flex flex-col bg-white border-t lg:border-t-0 ${ge === "left" ? "lg:border-r" : "lg:border-l"} border-gray-200 overflow-y-auto shrink-0`,
|
|
19529
19551
|
children: [/* @__PURE__ */ u("div", {
|
|
@@ -19549,39 +19571,44 @@ function bx({ activeTab: e, setActiveTab: t, setBlocks: n, selectedBlockId: r, s
|
|
|
19549
19571
|
value: "styles",
|
|
19550
19572
|
icon: /* @__PURE__ */ u(ex, { className: "h-4 w-4" })
|
|
19551
19573
|
}
|
|
19552
|
-
].map((
|
|
19553
|
-
onClick: () => t(
|
|
19554
|
-
|
|
19555
|
-
|
|
19556
|
-
|
|
19574
|
+
].map((r) => /* @__PURE__ */ d("button", {
|
|
19575
|
+
onClick: () => t(r.value),
|
|
19576
|
+
style: {
|
|
19577
|
+
backgroundColor: e === r.value ? n : "transparent",
|
|
19578
|
+
color: e === r.value ? "#ffffff" : void 0
|
|
19579
|
+
},
|
|
19580
|
+
className: `py-2 px-0.5 flex flex-col items-center justify-center gap-1 font-bold text-[9px] rounded-lg uppercase tracking-wider transition-all duration-150 ${e === r.value ? "shadow-sm" : "text-slate-500 hover:text-slate-800 hover:bg-slate-100"}`,
|
|
19581
|
+
children: [r.icon, /* @__PURE__ */ u("span", { children: r.value })]
|
|
19582
|
+
}, r.value))
|
|
19557
19583
|
}), /* @__PURE__ */ d("div", {
|
|
19558
19584
|
className: "p-4 flex-1 flex flex-col min-h-0 overflow-y-auto",
|
|
19559
19585
|
children: [
|
|
19560
19586
|
e === "text" && /* @__PURE__ */ u(mx, {
|
|
19561
19587
|
handleSidebarDragStart: ce,
|
|
19562
|
-
createTextBlock:
|
|
19563
|
-
setBlocks:
|
|
19564
|
-
setSelectedBlockId:
|
|
19588
|
+
createTextBlock: c,
|
|
19589
|
+
setBlocks: r,
|
|
19590
|
+
setSelectedBlockId: a,
|
|
19565
19591
|
setActiveTab: t,
|
|
19566
|
-
defaultStyles:
|
|
19592
|
+
defaultStyles: s
|
|
19567
19593
|
}),
|
|
19568
19594
|
e === "tables" && /* @__PURE__ */ u(hx, {
|
|
19569
|
-
schemas:
|
|
19570
|
-
toggleSchemaColumn:
|
|
19571
|
-
customTableName:
|
|
19572
|
-
setCustomTableName:
|
|
19573
|
-
customLoopStart:
|
|
19574
|
-
setCustomLoopStart:
|
|
19575
|
-
customLoopEnd:
|
|
19576
|
-
setCustomLoopEnd:
|
|
19577
|
-
handleAddCustomTable:
|
|
19595
|
+
schemas: x,
|
|
19596
|
+
toggleSchemaColumn: S,
|
|
19597
|
+
customTableName: C,
|
|
19598
|
+
setCustomTableName: w,
|
|
19599
|
+
customLoopStart: T,
|
|
19600
|
+
setCustomLoopStart: E,
|
|
19601
|
+
customLoopEnd: D,
|
|
19602
|
+
setCustomLoopEnd: ee,
|
|
19603
|
+
handleAddCustomTable: O,
|
|
19578
19604
|
handleSidebarDragStart: ce,
|
|
19579
|
-
setBlocks:
|
|
19580
|
-
setSelectedBlockId:
|
|
19605
|
+
setBlocks: r,
|
|
19606
|
+
setSelectedBlockId: a,
|
|
19581
19607
|
setActiveTab: t,
|
|
19582
|
-
defaultStyles:
|
|
19608
|
+
defaultStyles: s,
|
|
19583
19609
|
isTablesLoading: le,
|
|
19584
|
-
tablesLoading: ue
|
|
19610
|
+
tablesLoading: ue,
|
|
19611
|
+
themeColor: n
|
|
19585
19612
|
}),
|
|
19586
19613
|
e === "images" && /* @__PURE__ */ u(gx, {
|
|
19587
19614
|
customImageTypes: ne,
|
|
@@ -19589,41 +19616,43 @@ function bx({ activeTab: e, setActiveTab: t, setBlocks: n, selectedBlockId: r, s
|
|
|
19589
19616
|
setNewImgTypeName: ie,
|
|
19590
19617
|
handleAddCustomImageType: ae,
|
|
19591
19618
|
handleSidebarDragStart: ce,
|
|
19592
|
-
createImageBlock:
|
|
19593
|
-
setBlocks:
|
|
19594
|
-
setSelectedBlockId:
|
|
19595
|
-
setActiveTab: t
|
|
19619
|
+
createImageBlock: l,
|
|
19620
|
+
setBlocks: r,
|
|
19621
|
+
setSelectedBlockId: a,
|
|
19622
|
+
setActiveTab: t,
|
|
19623
|
+
themeColor: n
|
|
19596
19624
|
}),
|
|
19597
19625
|
e === "placeholders" && /* @__PURE__ */ u(_x, {
|
|
19598
|
-
placeholders:
|
|
19599
|
-
schemas:
|
|
19626
|
+
placeholders: M,
|
|
19627
|
+
schemas: x,
|
|
19600
19628
|
searchPlaceholder: oe,
|
|
19601
19629
|
setSearchPlaceholder: se,
|
|
19602
|
-
selectedBlockId:
|
|
19603
|
-
setBlocks:
|
|
19630
|
+
selectedBlockId: i,
|
|
19631
|
+
setBlocks: r,
|
|
19604
19632
|
isPlaceholdersLoading: de,
|
|
19605
19633
|
placeholdersLoading: fe
|
|
19606
19634
|
}),
|
|
19607
19635
|
e === "styles" && /* @__PURE__ */ u(yx, {
|
|
19608
|
-
selectedBlockId:
|
|
19609
|
-
getSelectedBlock:
|
|
19610
|
-
updateSelectedStyle:
|
|
19611
|
-
updateSelectedImageInfo:
|
|
19636
|
+
selectedBlockId: i,
|
|
19637
|
+
getSelectedBlock: o,
|
|
19638
|
+
updateSelectedStyle: f,
|
|
19639
|
+
updateSelectedImageInfo: p,
|
|
19612
19640
|
fontSizesState: pe,
|
|
19613
19641
|
fontFamiliesState: me,
|
|
19614
19642
|
fontWeightsState: he,
|
|
19615
|
-
handleDeleteBlock:
|
|
19616
|
-
newColName:
|
|
19617
|
-
setNewColName:
|
|
19618
|
-
newColPlaceholder:
|
|
19619
|
-
setNewColPlaceholder:
|
|
19620
|
-
handleAddTableColumn:
|
|
19621
|
-
handleRemoveTableColumn:
|
|
19622
|
-
handleUpdateTableColumn:
|
|
19623
|
-
handleReorderTableColumn:
|
|
19624
|
-
handleAddTableRow:
|
|
19625
|
-
handleRemoveTableRow:
|
|
19626
|
-
setBlocks:
|
|
19643
|
+
handleDeleteBlock: m,
|
|
19644
|
+
newColName: k,
|
|
19645
|
+
setNewColName: A,
|
|
19646
|
+
newColPlaceholder: j,
|
|
19647
|
+
setNewColPlaceholder: te,
|
|
19648
|
+
handleAddTableColumn: g,
|
|
19649
|
+
handleRemoveTableColumn: h,
|
|
19650
|
+
handleUpdateTableColumn: _,
|
|
19651
|
+
handleReorderTableColumn: v,
|
|
19652
|
+
handleAddTableRow: y,
|
|
19653
|
+
handleRemoveTableRow: b,
|
|
19654
|
+
setBlocks: r,
|
|
19655
|
+
themeColor: n
|
|
19627
19656
|
})
|
|
19628
19657
|
]
|
|
19629
19658
|
})]
|
|
@@ -19684,18 +19713,22 @@ var xx = [
|
|
|
19684
19713
|
});
|
|
19685
19714
|
}), t;
|
|
19686
19715
|
};
|
|
19687
|
-
function Tx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r, setActiveTab: i, showMockData: a, placeholderMockData: o, dragOverIndex: s, setDragOverIndex: c, draggedSidebarItem: l, defaultStyles: f, zoom: p, panOffset: m, spacePressed: h, canvasHeight: g, viewportRef: _, canvasContainerRef: v, handleMouseDown: y, handleMouseMove: b, handleMouseUp: x, createTextBlock: S, duplicateBlock: C, reorderBlock: w, handleDeleteBlock: T, handleSidebarDrop: E, handleTableCellDrop: ee, updateTableCell: O, handleTextDrop: k }) {
|
|
19688
|
-
let
|
|
19689
|
-
e.dataTransfer.setData("blockIndex", t
|
|
19690
|
-
},
|
|
19691
|
-
|
|
19692
|
-
let
|
|
19693
|
-
if (
|
|
19694
|
-
else if (
|
|
19695
|
-
let
|
|
19696
|
-
if (
|
|
19697
|
-
|
|
19698
|
-
|
|
19716
|
+
function Tx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r, setActiveTab: i, showMockData: a, placeholderMockData: o, dragOverIndex: s, setDragOverIndex: c, draggedSidebarItem: l, defaultStyles: f, zoom: p, panOffset: m, spacePressed: h, canvasHeight: g, viewportRef: _, canvasContainerRef: v, handleMouseDown: y, handleMouseMove: b, handleMouseUp: x, createTextBlock: S, duplicateBlock: C, reorderBlock: w, handleDeleteBlock: T, handleSidebarDrop: E, handleTableCellDrop: ee, updateTableCell: O, handleTextDrop: k, themeColor: A = "#ea580c" }) {
|
|
19717
|
+
let j = (e, t) => {
|
|
19718
|
+
e.dataTransfer.setData("blockIndex", String(t)), e.dataTransfer.setData("source", "canvas"), e.dataTransfer.effectAllowed = "move";
|
|
19719
|
+
}, te = (e, n) => {
|
|
19720
|
+
e.preventDefault(), e.stopPropagation();
|
|
19721
|
+
let r = e.dataTransfer.getData("source");
|
|
19722
|
+
if (r === "sidebar") E(n);
|
|
19723
|
+
else if (r === "canvas") {
|
|
19724
|
+
let r = e.dataTransfer.getData("blockIndex");
|
|
19725
|
+
if (r !== "") {
|
|
19726
|
+
let e = parseInt(r, 10);
|
|
19727
|
+
!isNaN(e) && e !== n && t((t) => {
|
|
19728
|
+
let r = [...t], [i] = r.splice(e, 1);
|
|
19729
|
+
return r.splice(n, 0, i), r;
|
|
19730
|
+
});
|
|
19731
|
+
}
|
|
19699
19732
|
}
|
|
19700
19733
|
c(null);
|
|
19701
19734
|
}, ne = 1123, re = Math.max(1, Math.ceil(g / ne));
|
|
@@ -19733,9 +19766,14 @@ function Tx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
|
|
|
19733
19766
|
let n = t + 2, r = (t + 1) * ne;
|
|
19734
19767
|
return /* @__PURE__ */ u("div", {
|
|
19735
19768
|
style: { top: `${r}px` },
|
|
19736
|
-
className: "absolute left-0 right-0 z-30 pointer-events-none flex items-center justify-center border-b-2 border-dashed border-
|
|
19769
|
+
className: "absolute left-0 right-0 z-30 pointer-events-none flex items-center justify-center border-b-2 border-dashed border-gray-300 py-1 select-none",
|
|
19737
19770
|
children: /* @__PURE__ */ u("span", {
|
|
19738
|
-
|
|
19771
|
+
style: {
|
|
19772
|
+
color: A,
|
|
19773
|
+
borderColor: `${A}60`,
|
|
19774
|
+
backgroundColor: `${A}15`
|
|
19775
|
+
},
|
|
19776
|
+
className: "border px-2.5 py-0.5 rounded-full shadow-xs flex items-center space-x-1 font-mono text-[10px] font-bold",
|
|
19739
19777
|
children: /* @__PURE__ */ d("span", { children: [
|
|
19740
19778
|
"📄 Page ",
|
|
19741
19779
|
n,
|
|
@@ -19778,14 +19816,14 @@ function Tx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
|
|
|
19778
19816
|
draggable: !0,
|
|
19779
19817
|
onDragStart: (t) => {
|
|
19780
19818
|
let n = e.findIndex((e) => e.id === a.id);
|
|
19781
|
-
|
|
19819
|
+
j(t, n);
|
|
19782
19820
|
},
|
|
19783
19821
|
onDragOver: (t) => {
|
|
19784
19822
|
t.preventDefault(), c(e.findIndex((e) => e.id === a.id));
|
|
19785
19823
|
},
|
|
19786
19824
|
onDrop: (t) => {
|
|
19787
19825
|
let n = e.findIndex((e) => e.id === a.id);
|
|
19788
|
-
|
|
19826
|
+
te(t, n);
|
|
19789
19827
|
},
|
|
19790
19828
|
onClick: (e) => {
|
|
19791
19829
|
e.stopPropagation(), r(a.id), i("styles");
|
|
@@ -19798,14 +19836,17 @@ function Tx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
|
|
|
19798
19836
|
position: a.style.position,
|
|
19799
19837
|
top: a.style.top,
|
|
19800
19838
|
left: a.style.left,
|
|
19801
|
-
zIndex: a.style.zIndex ? parseInt(a.style.zIndex) : void 0
|
|
19839
|
+
zIndex: a.style.zIndex ? parseInt(a.style.zIndex) : void 0,
|
|
19840
|
+
borderColor: m ? A : void 0,
|
|
19841
|
+
backgroundColor: m ? `${A}08` : void 0
|
|
19802
19842
|
}, a.style.pageBreakBefore === "always" || a.style.pageBreakBefore === !0 ? {
|
|
19803
19843
|
pageBreakBefore: "always",
|
|
19804
19844
|
breakBefore: "page"
|
|
19805
19845
|
} : {}),
|
|
19806
|
-
className: `group/block relative p-0.5 rounded-xl border
|
|
19846
|
+
className: `group/block relative p-0.5 rounded-xl border transition-all duration-150 cursor-pointer ${m ? "shadow-sm ring-2 ring-orange-500/10" : "border-transparent hover:bg-slate-50/30 hover:border-gray-200"} ${a.style.position === "absolute" ? "!absolute !inset-0 !m-auto" : ""}`,
|
|
19807
19847
|
children: [m && /* @__PURE__ */ d("div", {
|
|
19808
|
-
|
|
19848
|
+
style: { backgroundColor: A },
|
|
19849
|
+
className: "absolute -top-3.5 right-3 text-white rounded-lg px-2 py-0.5 text-[10px] font-bold flex items-center space-x-1.5 shadow-md z-30 select-none",
|
|
19809
19850
|
children: [
|
|
19810
19851
|
/* @__PURE__ */ u("button", {
|
|
19811
19852
|
onClick: () => {
|
|
@@ -19944,7 +19985,10 @@ function Tx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
|
|
|
19944
19985
|
})
|
|
19945
19986
|
}, a.id);
|
|
19946
19987
|
}),
|
|
19947
|
-
s !== null && /* @__PURE__ */ u("div", {
|
|
19988
|
+
s !== null && /* @__PURE__ */ u("div", {
|
|
19989
|
+
style: { backgroundColor: A },
|
|
19990
|
+
className: "h-[2px] rounded my-1 shadow-md animate-pulse"
|
|
19991
|
+
})
|
|
19948
19992
|
]
|
|
19949
19993
|
})
|
|
19950
19994
|
})
|
|
@@ -19952,8 +19996,8 @@ function Tx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
|
|
|
19952
19996
|
}
|
|
19953
19997
|
//#endregion
|
|
19954
19998
|
//#region src/components/CanvasToolbar.tsx
|
|
19955
|
-
function Ex({ showImportHtml: e = !0, showImportPdf: t = !0, showPreview: n = !0, showExport: r = !0, showExportPdf: i = !0, showClearCanvas: a, customButtonStyles: s, customButtonClassNames: c, customActionComponents: f, handleHtmlImport: p, handlePdfImport: m, setPreviewOpen: h, handleExport: g, handleExportPdf: _, handleClearCanvas: v, zoom: y, setZoom: b, setPanOffset: x }) {
|
|
19956
|
-
let
|
|
19999
|
+
function Ex({ showImportHtml: e = !0, showImportPdf: t = !0, showPreview: n = !0, showExport: r = !0, showExportPdf: i = !0, showClearCanvas: a, customButtonStyles: s, customButtonClassNames: c, customActionComponents: f, handleHtmlImport: p, handlePdfImport: m, setPreviewOpen: h, handleExport: g, handleExportPdf: _, handleClearCanvas: v, zoom: y, setZoom: b, setPanOffset: x, themeColor: S = "#ea580c" }) {
|
|
20000
|
+
let C = o(null), w = o(null);
|
|
19957
20001
|
return /* @__PURE__ */ d("div", {
|
|
19958
20002
|
className: "bg-white border-b border-gray-200 px-4 py-2 flex flex-wrap items-center justify-between shadow-xs sticky top-0 z-20 gap-2",
|
|
19959
20003
|
children: [/* @__PURE__ */ d("div", {
|
|
@@ -19961,11 +20005,11 @@ function Ex({ showImportHtml: e = !0, showImportPdf: t = !0, showPreview: n = !0
|
|
|
19961
20005
|
children: [
|
|
19962
20006
|
e && /* @__PURE__ */ d(l, { children: [f != null && f.importHtml ? f.importHtml({ onClick: () => {
|
|
19963
20007
|
var e;
|
|
19964
|
-
return (e =
|
|
20008
|
+
return (e = C.current) == null ? void 0 : e.click();
|
|
19965
20009
|
} }) : /* @__PURE__ */ d("button", {
|
|
19966
20010
|
onClick: () => {
|
|
19967
20011
|
var e;
|
|
19968
|
-
return (e =
|
|
20012
|
+
return (e = C.current) == null ? void 0 : e.click();
|
|
19969
20013
|
},
|
|
19970
20014
|
style: s == null ? void 0 : s.importHtml,
|
|
19971
20015
|
className: (c == null ? void 0 : c.importHtml) || "inline-flex items-center space-x-1 px-2.5 py-1 border border-gray-200 rounded-lg text-xs font-semibold bg-white hover:bg-slate-50 text-slate-700 transition-colors shadow-2xs cursor-pointer",
|
|
@@ -19973,18 +20017,18 @@ function Ex({ showImportHtml: e = !0, showImportPdf: t = !0, showPreview: n = !0
|
|
|
19973
20017
|
children: [/* @__PURE__ */ u(dx, { className: "h-3.5 w-3.5 text-slate-500" }), /* @__PURE__ */ u("span", { children: "Import HTML" })]
|
|
19974
20018
|
}), /* @__PURE__ */ u("input", {
|
|
19975
20019
|
type: "file",
|
|
19976
|
-
ref:
|
|
20020
|
+
ref: C,
|
|
19977
20021
|
onChange: p,
|
|
19978
20022
|
accept: ".html",
|
|
19979
20023
|
className: "hidden"
|
|
19980
20024
|
})] }),
|
|
19981
20025
|
t && /* @__PURE__ */ d(l, { children: [f != null && f.importPdf ? f.importPdf({ onClick: () => {
|
|
19982
20026
|
var e;
|
|
19983
|
-
return (e =
|
|
20027
|
+
return (e = w.current) == null ? void 0 : e.click();
|
|
19984
20028
|
} }) : /* @__PURE__ */ d("button", {
|
|
19985
20029
|
onClick: () => {
|
|
19986
20030
|
var e;
|
|
19987
|
-
return (e =
|
|
20031
|
+
return (e = w.current) == null ? void 0 : e.click();
|
|
19988
20032
|
},
|
|
19989
20033
|
style: s == null ? void 0 : s.importPdf,
|
|
19990
20034
|
className: (c == null ? void 0 : c.importPdf) || "inline-flex items-center space-x-1 px-2.5 py-1 border border-gray-200 rounded-lg text-xs font-semibold bg-white hover:bg-slate-50 text-slate-700 transition-colors shadow-2xs cursor-pointer",
|
|
@@ -19992,7 +20036,7 @@ function Ex({ showImportHtml: e = !0, showImportPdf: t = !0, showPreview: n = !0
|
|
|
19992
20036
|
children: [/* @__PURE__ */ u(Jb, { className: "h-3.5 w-3.5 text-slate-500" }), /* @__PURE__ */ u("span", { children: "Import PDF" })]
|
|
19993
20037
|
}), /* @__PURE__ */ u("input", {
|
|
19994
20038
|
type: "file",
|
|
19995
|
-
ref:
|
|
20039
|
+
ref: w,
|
|
19996
20040
|
onChange: m,
|
|
19997
20041
|
accept: ".pdf",
|
|
19998
20042
|
className: "hidden"
|
|
@@ -20011,8 +20055,8 @@ function Ex({ showImportHtml: e = !0, showImportPdf: t = !0, showPreview: n = !0
|
|
|
20011
20055
|
})),
|
|
20012
20056
|
r && (f != null && f.export ? f.export({ onClick: g }) : /* @__PURE__ */ d("button", {
|
|
20013
20057
|
onClick: g,
|
|
20014
|
-
style: s == null ? void 0 : s.export,
|
|
20015
|
-
className: (c == null ? void 0 : c.export) || "inline-flex items-center space-x-1 px-2.5 py-1
|
|
20058
|
+
style: D({ backgroundColor: S }, s == null ? void 0 : s.export),
|
|
20059
|
+
className: (c == null ? void 0 : c.export) || "inline-flex items-center space-x-1 px-2.5 py-1 text-white rounded-lg text-xs font-semibold transition-colors shadow-2xs cursor-pointer",
|
|
20016
20060
|
children: [/* @__PURE__ */ u(Kb, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ u("span", { children: "Export Template" })]
|
|
20017
20061
|
})),
|
|
20018
20062
|
a && /* @__PURE__ */ d("button", {
|
|
@@ -20055,7 +20099,8 @@ function Ex({ showImportHtml: e = !0, showImportPdf: t = !0, showPreview: n = !0
|
|
|
20055
20099
|
step: "0.05",
|
|
20056
20100
|
value: y,
|
|
20057
20101
|
onChange: (e) => b(parseFloat(e.target.value)),
|
|
20058
|
-
|
|
20102
|
+
style: { accentColor: S },
|
|
20103
|
+
className: "w-16 h-1 bg-gray-200 rounded-lg appearance-none cursor-pointer"
|
|
20059
20104
|
}),
|
|
20060
20105
|
/* @__PURE__ */ u("button", {
|
|
20061
20106
|
onClick: () => {
|
|
@@ -20244,14 +20289,14 @@ var kx = (e) => {
|
|
|
20244
20289
|
});
|
|
20245
20290
|
}), t;
|
|
20246
20291
|
}, Ax = (e) => e ? e.replace(/contenteditable="[^"]*"/g, "").replace(/class="[^"]*"/g, "").replace(/data-placeholder="[^"]*"/g, "").replace(/ /g, " ").trim() : "";
|
|
20247
|
-
function jx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r, headerTitle: i = "HTML Template Builder", headerSubtitle: o = "Design and export templates dynamically", headerLogo: c, typographySizes: l, typographyWeights: f, typographyFonts: p, templatingLanguage: m = "csharp", loopSyntax: h = "foreach", onChange: g, onExport: _, onExportPdf: v, initialBlocks: y, defaultStyles: x, showImportHtml: S = !0, showImportPdf: C = !0, showClearCanvas: w = !0, showPreview: T = !0, showExport: E = !0, showExportPdf: ee = !0, showHeader: O = !0, sidebarPosition: k = "left", isTablesLoading:
|
|
20248
|
-
let { zoom:
|
|
20292
|
+
function jx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r, headerTitle: i = "HTML Template Builder", headerSubtitle: o = "Design and export templates dynamically", headerLogo: c, typographySizes: l, typographyWeights: f, typographyFonts: p, templatingLanguage: m = "csharp", loopSyntax: h = "foreach", onChange: g, onExport: _, onExportPdf: v, initialBlocks: y, defaultStyles: x, showImportHtml: S = !0, showImportPdf: C = !0, showClearCanvas: w = !0, showPreview: T = !0, showExport: E = !0, showExportPdf: ee = !0, showHeader: O = !0, sidebarPosition: k = "left", themeColor: j, primaryColor: te, isTablesLoading: ne, tablesLoading: re, isPlaceholdersLoading: ie, placeholdersLoading: ae, customButtonStyles: M, customButtonClassNames: oe, customActionComponents: se } = {}) {
|
|
20293
|
+
let ce = j || te || "#ea580c", { zoom: le, setZoom: ue, panOffset: de, setPanOffset: fe, spacePressed: pe, canvasHeight: me, viewportRef: he, canvasContainerRef: ge, handleMouseDown: _e, handleMouseMove: ve, handleMouseUp: ye } = Tb(), { customTableName: be, setCustomTableName: xe, customLoopStart: Se, setCustomLoopStart: Ce, customLoopEnd: we, setCustomLoopEnd: Te, newColName: Ee, setNewColName: De, newColPlaceholder: N, setNewColPlaceholder: P, bubbleCoords: Oe, setBubbleCoords: ke, schemas: Ae, isParsing: je, setIsParsing: Me, parseStatusText: Ne, setParseStatusText: Pe, parseError: Fe, setParseError: Ie, draggedSidebarItem: Le, setDraggedSidebarItem: Re, dragOverIndex: ze, setDragOverIndex: Be, newImgTypeName: F, setNewImgTypeName: I, customImageTypes: Ve, searchPlaceholder: He, setSearchPlaceholder: Ue, handleAddCustomTable: We, handleAddCustomImageType: Ge, toggleSchemaColumn: L, applySelectionFormat: Ke, setSavedRange: qe } = Eb({ tableSchemas: e }), { blocks: Je, setBlocks: Ye, selectedBlockId: Xe, setSelectedBlockId: Ze, getSelectedBlock: Qe, createTextBlock: $e, createTableBlock: et, createImageBlock: R, handleDeleteBlock: z, handleDuplicateBlock: tt, handleMoveBlockUp: nt, handleMoveBlockDown: rt, updateSelectedStyle: it, updateSelectedImageInfo: at, handleRemoveTableColumn: ot, handleAddTableColumn: st, handleUpdateTableColumn: ct, handleReorderTableColumn: lt, handleAddTableRow: ut, handleRemoveTableRow: dt } = wb({
|
|
20249
20294
|
initialBlocks: y,
|
|
20250
20295
|
defaultStyles: x,
|
|
20251
20296
|
defaultLogo: n,
|
|
20252
20297
|
defaultBanner: r,
|
|
20253
20298
|
onChange: g
|
|
20254
|
-
}), [
|
|
20299
|
+
}), [B, ft] = s("text"), [pt, mt] = s(!1), [ht] = s(!0), [gt] = s(l || [
|
|
20255
20300
|
{
|
|
20256
20301
|
label: "8px",
|
|
20257
20302
|
value: "8px"
|
|
@@ -20304,7 +20349,7 @@ function jx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
|
|
|
20304
20349
|
label: "36px",
|
|
20305
20350
|
value: "36px"
|
|
20306
20351
|
}
|
|
20307
|
-
]), [
|
|
20352
|
+
]), [_t] = s(p || [
|
|
20308
20353
|
{
|
|
20309
20354
|
label: "Outfit (Default)",
|
|
20310
20355
|
value: "'Outfit', 'Inter', sans-serif"
|
|
@@ -20329,7 +20374,7 @@ function jx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
|
|
|
20329
20374
|
label: "Courier New (Mono)",
|
|
20330
20375
|
value: "'Courier New', monospace"
|
|
20331
20376
|
}
|
|
20332
|
-
]), [
|
|
20377
|
+
]), [vt] = s(f || [
|
|
20333
20378
|
{
|
|
20334
20379
|
label: "Light",
|
|
20335
20380
|
value: "300"
|
|
@@ -20354,105 +20399,105 @@ function jx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
|
|
|
20354
20399
|
label: "Extra Bold",
|
|
20355
20400
|
value: "800"
|
|
20356
20401
|
}
|
|
20357
|
-
]), [
|
|
20402
|
+
]), [yt] = s(m), [bt] = s(h), [xt] = s(!0), St = {};
|
|
20358
20403
|
a(() => {
|
|
20359
20404
|
let e = () => {
|
|
20360
20405
|
let e = window.getSelection();
|
|
20361
20406
|
if (!e || e.isCollapsed || e.toString().trim() === "") {
|
|
20362
|
-
|
|
20407
|
+
ke(null), qe(null);
|
|
20363
20408
|
return;
|
|
20364
20409
|
}
|
|
20365
20410
|
let t = document.activeElement;
|
|
20366
20411
|
if (!(t && t.getAttribute("contenteditable") === "true" && (t.closest(".canvas-editor-area") || t.closest("td")))) {
|
|
20367
|
-
|
|
20412
|
+
ke(null), qe(null);
|
|
20368
20413
|
return;
|
|
20369
20414
|
}
|
|
20370
20415
|
try {
|
|
20371
20416
|
let t = e.getRangeAt(0), n = t.getBoundingClientRect(), r = document.queryCommandValue("formatBlock") || "";
|
|
20372
|
-
r = r.toUpperCase(),
|
|
20417
|
+
r = r.toUpperCase(), ke({
|
|
20373
20418
|
x: n.left + n.width / 2,
|
|
20374
20419
|
y: n.top - 38,
|
|
20375
20420
|
format: r
|
|
20376
|
-
}),
|
|
20421
|
+
}), qe(t);
|
|
20377
20422
|
} catch (e) {
|
|
20378
|
-
|
|
20423
|
+
ke(null), qe(null);
|
|
20379
20424
|
}
|
|
20380
20425
|
};
|
|
20381
20426
|
return document.addEventListener("selectionchange", e), () => document.removeEventListener("selectionchange", e);
|
|
20382
|
-
}, [
|
|
20383
|
-
let e =
|
|
20427
|
+
}, [ke, qe]), a(() => {
|
|
20428
|
+
let e = he.current;
|
|
20384
20429
|
if (!e) return;
|
|
20385
20430
|
let t = (e) => {
|
|
20386
20431
|
if (e.ctrlKey) {
|
|
20387
20432
|
e.preventDefault();
|
|
20388
20433
|
let t = e.deltaY < 0 ? 1 : -1;
|
|
20389
|
-
|
|
20434
|
+
ue((e) => Math.min(2, Math.max(.5, e + t * .05)));
|
|
20390
20435
|
}
|
|
20391
20436
|
};
|
|
20392
20437
|
return e.addEventListener("wheel", t, { passive: !1 }), () => e.removeEventListener("wheel", t);
|
|
20393
|
-
}, [
|
|
20438
|
+
}, [he, ue]), a(() => {
|
|
20394
20439
|
window.updateContentFromRawDelete = (e, t) => {
|
|
20395
|
-
|
|
20440
|
+
Ye((n) => n.map((n) => n.id === e ? D(D({}, n), {}, { content: t }) : n));
|
|
20396
20441
|
};
|
|
20397
|
-
}, [
|
|
20398
|
-
let
|
|
20442
|
+
}, [Ye]);
|
|
20443
|
+
let Ct = (e) => {
|
|
20399
20444
|
var t;
|
|
20400
20445
|
let n = (t = e.target.files) == null ? void 0 : t[0];
|
|
20401
20446
|
if (!n) return;
|
|
20402
|
-
|
|
20447
|
+
Me(!0), Pe("Parsing HTML..."), Ie(null);
|
|
20403
20448
|
let r = new FileReader();
|
|
20404
20449
|
r.onload = (t) => {
|
|
20405
20450
|
try {
|
|
20406
20451
|
var n;
|
|
20407
20452
|
let e = Sb((n = t.target) == null ? void 0 : n.result);
|
|
20408
|
-
e.length > 0 &&
|
|
20453
|
+
e.length > 0 && Ye(e);
|
|
20409
20454
|
} catch (e) {
|
|
20410
|
-
console.error(e),
|
|
20455
|
+
console.error(e), Ie(e.message || "Failed to parse HTML");
|
|
20411
20456
|
} finally {
|
|
20412
|
-
|
|
20457
|
+
Me(!1), e.target && (e.target.value = "");
|
|
20413
20458
|
}
|
|
20414
20459
|
}, r.readAsText(n);
|
|
20415
|
-
},
|
|
20460
|
+
}, wt = (e) => {
|
|
20416
20461
|
var t;
|
|
20417
20462
|
let n = (t = e.target.files) == null ? void 0 : t[0];
|
|
20418
20463
|
if (!n) return;
|
|
20419
|
-
|
|
20464
|
+
Me(!0), Pe("Reading PDF text layers..."), Ie(null);
|
|
20420
20465
|
let r = new FileReader();
|
|
20421
20466
|
r.onload = b(function* () {
|
|
20422
20467
|
try {
|
|
20423
|
-
let e = r.result, t = yield Cb(e,
|
|
20424
|
-
t.length > 0 &&
|
|
20468
|
+
let e = r.result, t = yield Cb(e, A);
|
|
20469
|
+
t.length > 0 && Ye((e) => [...e, ...t]);
|
|
20425
20470
|
} catch (e) {
|
|
20426
|
-
console.error(e),
|
|
20471
|
+
console.error(e), Ie(e.message || "Failed to read PDF");
|
|
20427
20472
|
} finally {
|
|
20428
|
-
|
|
20473
|
+
Me(!1), e.target && (e.target.value = "");
|
|
20429
20474
|
}
|
|
20430
20475
|
}), r.readAsArrayBuffer(n);
|
|
20431
|
-
},
|
|
20476
|
+
}, Tt = (e) => {
|
|
20432
20477
|
let t = e || "items";
|
|
20433
|
-
if (
|
|
20434
|
-
let e =
|
|
20478
|
+
if (yt === "handlebars" || yt === "mustache") {
|
|
20479
|
+
let e = bt === "foreach" ? "foreach" : "each";
|
|
20435
20480
|
return {
|
|
20436
20481
|
start: `{{#${e} ${t}}}`,
|
|
20437
20482
|
end: `{{/${e}}}`
|
|
20438
20483
|
};
|
|
20439
20484
|
}
|
|
20440
|
-
return
|
|
20485
|
+
return yt === "liquid" || yt === "scriban" || yt === "dotnet" ? {
|
|
20441
20486
|
start: `{% for ${t.endsWith("s") ? t.slice(0, -1) : "item"} in ${t} %}`,
|
|
20442
20487
|
end: "{% endfor %}"
|
|
20443
|
-
} :
|
|
20488
|
+
} : yt === "js" || yt === "ts" ? {
|
|
20444
20489
|
start: `\${${t}.map(${t.endsWith("s") ? t.slice(0, -1) : "item"} => \``,
|
|
20445
20490
|
end: "`).join('')}"
|
|
20446
|
-
} :
|
|
20491
|
+
} : yt === "csharp" || yt === "razor" ? {
|
|
20447
20492
|
start: `@foreach (var ${t.endsWith("s") ? t.slice(0, -1) : "item"} in ${t}) {`,
|
|
20448
20493
|
end: "}"
|
|
20449
20494
|
} : {
|
|
20450
|
-
start:
|
|
20451
|
-
end:
|
|
20495
|
+
start: Se.replace("items", t),
|
|
20496
|
+
end: we
|
|
20452
20497
|
};
|
|
20453
|
-
},
|
|
20498
|
+
}, Et = (e = !1) => {
|
|
20454
20499
|
let t = "<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"utf-8\">\n <title>Exported HTML Template</title>\n <style>\n @page {\n size: A4 portrait;\n margin: 0;\n }\n * {\n box-sizing: border-box;\n }\n html, body {\n margin: 0;\n padding: 0;\n background-color: #f8fafc;\n font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n color: #1e293b;\n -webkit-print-color-adjust: exact;\n print-color-adjust: exact;\n }\n .paper-sheet {\n width: 794px;\n min-height: 1123px;\n margin: 20px auto;\n padding: 60px;\n background-color: #ffffff;\n box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);\n box-sizing: border-box;\n position: relative;\n }\n .row-container {\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n align-items: stretch;\n margin-bottom: 8px;\n }\n .row-container:not(.has-table) {\n page-break-inside: avoid;\n break-inside: avoid;\n }\n .block-container {\n box-sizing: border-box;\n }\n .block-container:not(.table-container) {\n page-break-inside: avoid;\n break-inside: avoid;\n }\n .block-container.table-container {\n page-break-inside: auto;\n break-inside: auto;\n }\n h1, h2, h3, h4, h5, h6, p {\n margin: 0;\n padding: 0;\n }\n table {\n width: 100%;\n border-collapse: collapse;\n page-break-inside: auto;\n }\n thead {\n display: table-header-group;\n }\n tr {\n page-break-inside: avoid !important;\n break-inside: avoid !important;\n break-inside: avoid-page !important;\n }\n th {\n background-color: #f1f5f9;\n color: #334155;\n border: 1px solid #e2e8f0;\n padding: 6px 8px;\n font-weight: 600;\n text-align: left;\n }\n td {\n border: 1px solid #e2e8f0;\n padding: 6px 8px;\n color: #475569;\n }\n tr:nth-child(even) {\n background-color: #f8fafc;\n }\n img, svg {\n page-break-inside: avoid !important;\n break-inside: avoid !important;\n break-inside: avoid-page !important;\n }\n .page-break-before {\n page-break-before: always !important;\n break-before: page !important;\n }\n span[data-placeholder] {\n background-color: #f1f5f9;\n color: #1e293b;\n border: 1px solid #e2e8f0;\n padding: 1px 4px;\n border-radius: 3px;\n font-weight: 600;\n display: inline-flex;\n font-size: inherit;\n }\n @media print {\n html, body {\n background-color: #ffffff !important;\n }\n .paper-sheet {\n width: 100% !important;\n max-width: 100% !important;\n min-height: 100% !important;\n margin: 0 !important;\n padding: 60px !important;\n box-shadow: none !important;\n border: none !important;\n background-color: #ffffff !important;\n }\n }\n </style>\n</head>\n<body>\n <div class=\"paper-sheet\">\n";
|
|
20455
|
-
return kx(
|
|
20500
|
+
return kx(Je).forEach((n) => {
|
|
20456
20501
|
let r = n.blocks.length > 1, i = n.blocks.some((e) => e.type === "table");
|
|
20457
20502
|
if (r) {
|
|
20458
20503
|
var a;
|
|
@@ -20483,17 +20528,17 @@ function jx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
|
|
|
20483
20528
|
typeof e == "object" && e && Object.keys(e).forEach((t) => {
|
|
20484
20529
|
let r = RegExp(`\\{\\{(item\\.|package\\.)?${t}\\}\\}`, "g");
|
|
20485
20530
|
n = n.replace(r, e[t]);
|
|
20486
|
-
}), Object.keys(
|
|
20487
|
-
let t =
|
|
20531
|
+
}), Object.keys(St).forEach((e) => {
|
|
20532
|
+
let t = St[e];
|
|
20488
20533
|
n.includes(`{{${e}}}`) && (n = n.replace(RegExp(`\\{\\{${e}\\}\\}`, "g"), t));
|
|
20489
20534
|
}), n = n.replace(/\{\{[^}]+\}\}/g, ""), i += ` <td>${n}</td>\n`;
|
|
20490
20535
|
}), i += " </tr>\n";
|
|
20491
20536
|
});
|
|
20492
20537
|
else {
|
|
20493
|
-
let e = t.columnName || "items", n =
|
|
20494
|
-
|
|
20538
|
+
let e = t.columnName || "items", n = Tt(e);
|
|
20539
|
+
xt ? i += ` <!-- ${n.start} --><tr>\n` : i += ` ${n.start}<tr>\n`, r.forEach((e) => {
|
|
20495
20540
|
i += ` <td>${e.placeholder}</td>\n`;
|
|
20496
|
-
}),
|
|
20541
|
+
}), xt ? i += ` </tr><!-- ${n.end} -->\n` : i += ` </tr>${n.end}\n`;
|
|
20497
20542
|
}
|
|
20498
20543
|
return i += " </tbody>\n", i += " </table>", i;
|
|
20499
20544
|
}, c = (t) => {
|
|
@@ -20504,8 +20549,8 @@ function jx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
|
|
|
20504
20549
|
let a = Ax(i.placeholder);
|
|
20505
20550
|
(e || r.mockRows && r.mockRows.length > 1) && (t && typeof t == "object" && Object.keys(t).forEach((e) => {
|
|
20506
20551
|
a.includes(`{{${e}}}`) && (a = a.replace(RegExp(`\\{\\{${e}\\}\\}`, "g"), t[e])), a.includes(`{{item.${e}}}`) && (a = a.replace(RegExp(`\\{\\{item\\.${e}\\}\\}`, "g"), t[e])), a.includes(`{{package.${e}}}`) && (a = a.replace(RegExp(`\\{\\{package\\.${e}\\}\\}`, "g"), t[e]));
|
|
20507
|
-
}), Object.keys(
|
|
20508
|
-
let t =
|
|
20552
|
+
}), Object.keys(St).forEach((e) => {
|
|
20553
|
+
let t = St[e];
|
|
20509
20554
|
a.includes(`{{${e}}}`) && (a = a.replace(RegExp(`\\{\\{${e}\\}\\}`, "g"), t));
|
|
20510
20555
|
}), e && (a = a.replace(/\{\{[^}]+\}\}/g, ""))), n += ` <td>${a}</td>\n`;
|
|
20511
20556
|
}
|
|
@@ -20515,15 +20560,15 @@ function jx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
|
|
|
20515
20560
|
t += c(e);
|
|
20516
20561
|
});
|
|
20517
20562
|
else {
|
|
20518
|
-
let e = r.tableName === "package" ? "shipment.packages" : r.tableName === "article" ? "package.articles" : r.tableName, n =
|
|
20519
|
-
|
|
20563
|
+
let e = r.tableName === "package" ? "shipment.packages" : r.tableName === "article" ? "package.articles" : r.tableName, n = Tt(e);
|
|
20564
|
+
xt ? t += ` <!-- ${n.start} --><tr>\n` : t += ` ${n.start}<tr>\n`, a.forEach((e) => {
|
|
20520
20565
|
e.loop && e.columns && e.columns.length > 0 ? t += ` <td>\n${s(e)}\n </td>\n` : t += ` <td>${e.placeholder}</td>\n`;
|
|
20521
|
-
}),
|
|
20566
|
+
}), xt ? t += ` </tr><!-- ${n.end} -->\n` : t += ` </tr>${n.end}\n`;
|
|
20522
20567
|
}
|
|
20523
20568
|
t += " </tbody>\n", t += " </table>\n", t += " </div>\n";
|
|
20524
20569
|
} else if (n.type === "image") {
|
|
20525
20570
|
let i = n.imageInfo || { imageType: "logo" }, a = "", s = n.style.height || n.style.minHeight || "auto", c = n.style.imageWidth || (n.style.width && n.style.width.endsWith("px") ? n.style.width : "100%"), l = n.style.textAlign || "left", u = l === "center" ? "margin-left: auto; margin-right: auto;" : l === "right" ? "margin-left: auto; margin-right: 0;" : "margin-left: 0; margin-right: auto;";
|
|
20526
|
-
a = i.imageType === "barcode" ? e ||
|
|
20571
|
+
a = i.imageType === "barcode" ? e || ht ? `<div style="width: ${c}; height: ${s}; display: block; ${u}">${bb(i.barcodeValue || "SHIP-99201")}</div>` : `<img src="${i.barcodePlaceholder || "{{barcode}}"}" style="width: ${c}; height: ${s}; display: block; ${u}" alt="Barcode" />` : `<img src="${i.url || "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4MDAiIGhlaWdodD0iNDAwIiB2aWV3Qm94PSIwIDAgODAwIDQwMCI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0iI2YxZjVmOSIvPjxyZWN0IHg9IjEwIiB5PSIxMCIgd2lkdGg9Ijc4MCIgaGVpZ2h0PSIzODAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2RiZTJmNiIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtZGFzaGFycmF5PSI2Ii8+PHRleHQgeD0iNTAlIiB5PSI1MCUiIGZvbnQtZmFtaWx5PSInT3V0Zml0JywgJ0ludGVyJywgc2Fucy1zZXJpZiIgZm9udC1zaXplPSIyNCIgZm9udC13ZWlnaHQ9IjYwMCIgZmlsbD0iIzk0YTNiOCIgZG9taW5hbnQtYmFzZWxpbmU9Im1pZGRsZSIgdGV4dC1hbmNob3I9Im1pZGRsZSI+U2VsZWN0IEltYWdlPC90ZXh0Pjwvc3ZnPg=="}" style="width: ${c}; height: auto; max-height: ${s === "auto" ? "300px" : s}; object-fit: ${n.style.objectFit || "contain"}; ${n.style.opacity ? `opacity: ${n.style.opacity};` : ""} display: block; ${u}" alt="${i.imageType}" />`;
|
|
20527
20572
|
let d = r ? "100%" : n.style.width && n.style.width.endsWith("%") ? n.style.width : "100%";
|
|
20528
20573
|
t += ` <div class="block-container" style="display: block; width: ${o}; text-align: ${l}; border: none; background-color: transparent; ${n.style.marginBottom ? `margin-bottom: ${n.style.marginBottom};` : ""}">\n`, t += ` <div style="width: ${d}; text-align: ${l}; display: block;">\n`, t += ` ${a}\n`, t += " </div>\n", t += " </div>\n";
|
|
20529
20574
|
} else {
|
|
@@ -20537,22 +20582,22 @@ function jx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
|
|
|
20537
20582
|
"h6"
|
|
20538
20583
|
].includes(n.type) ? r = n.type : n.type === "title" ? r = "h1" : n.type === "subtitle" ? r = "h2" : n.type === "caption" && (r = "span");
|
|
20539
20584
|
let a = Ax(n.content);
|
|
20540
|
-
(e ||
|
|
20541
|
-
let t =
|
|
20585
|
+
(e || ht) && (Object.keys(St).forEach((e) => {
|
|
20586
|
+
let t = St[e];
|
|
20542
20587
|
a = a.replace(RegExp(`\\{\\{${e}\\}\\}`, "g"), t);
|
|
20543
20588
|
}), e && (a = a.replace(/\{\{[^}]+\}\}/g, ""))), t += ` <div class="block-container" style="${l} text-align: ${n.style.textAlign};">\n`, t += ` <${r} style="${i}">${a}</${r}>\n`, t += " </div>\n";
|
|
20544
20589
|
}
|
|
20545
20590
|
}), r && (t += " </div>\n");
|
|
20546
20591
|
}), t += " </div>\n", t += "</body>\n</html>", t;
|
|
20547
|
-
},
|
|
20548
|
-
let e =
|
|
20592
|
+
}, Dt = () => {
|
|
20593
|
+
let e = Et(!1);
|
|
20549
20594
|
if (_) _(e);
|
|
20550
20595
|
else {
|
|
20551
20596
|
let t = new Blob([e], { type: "text/html;charset=utf-8;" }), n = document.createElement("a");
|
|
20552
20597
|
n.href = URL.createObjectURL(t), n.download = "exported_template.html", n.click();
|
|
20553
20598
|
}
|
|
20554
|
-
},
|
|
20555
|
-
let e =
|
|
20599
|
+
}, Ot = () => {
|
|
20600
|
+
let e = Et(!0);
|
|
20556
20601
|
if (v) v(e);
|
|
20557
20602
|
else {
|
|
20558
20603
|
let t = window.open("", "_blank");
|
|
@@ -20560,22 +20605,22 @@ function jx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
|
|
|
20560
20605
|
t.print(), t.close();
|
|
20561
20606
|
}, 500));
|
|
20562
20607
|
}
|
|
20563
|
-
},
|
|
20564
|
-
|
|
20565
|
-
},
|
|
20608
|
+
}, kt = () => {
|
|
20609
|
+
Ye([]), Ze(null);
|
|
20610
|
+
}, At = (e, t) => {
|
|
20566
20611
|
let n = e.dataTransfer.getData("placeholder");
|
|
20567
20612
|
if (!n) return;
|
|
20568
20613
|
e.preventDefault(), e.stopPropagation();
|
|
20569
20614
|
let r = `{{${n.replace(/[{}]/g, "")}}}`;
|
|
20570
|
-
|
|
20571
|
-
},
|
|
20615
|
+
Ye((e) => e.map((e) => e.id === t ? D(D({}, e), {}, { content: e.content + r }) : e));
|
|
20616
|
+
}, jt = (e, t, n, r) => {
|
|
20572
20617
|
let i = e.dataTransfer.getData("placeholder");
|
|
20573
20618
|
if (!i) return;
|
|
20574
20619
|
e.preventDefault(), e.stopPropagation();
|
|
20575
20620
|
let a = i.startsWith("{{") ? i : `{{${i}}}`;
|
|
20576
|
-
|
|
20577
|
-
},
|
|
20578
|
-
|
|
20621
|
+
Mt(t, n, a, r);
|
|
20622
|
+
}, Mt = (e, t, n, r) => {
|
|
20623
|
+
Ye((i) => i.map((i) => {
|
|
20579
20624
|
if (i.id === e && i.type === "table" && i.tableInfo) {
|
|
20580
20625
|
var a;
|
|
20581
20626
|
let e = [...i.tableInfo.columns];
|
|
@@ -20595,9 +20640,10 @@ function jx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
|
|
|
20595
20640
|
headerLogo: c,
|
|
20596
20641
|
headerTitle: i,
|
|
20597
20642
|
headerSubtitle: o,
|
|
20598
|
-
parseError:
|
|
20599
|
-
isParsing:
|
|
20600
|
-
parseStatusText:
|
|
20643
|
+
parseError: Fe,
|
|
20644
|
+
isParsing: je,
|
|
20645
|
+
parseStatusText: Ne,
|
|
20646
|
+
themeColor: ce
|
|
20601
20647
|
}),
|
|
20602
20648
|
/* @__PURE__ */ d("div", {
|
|
20603
20649
|
className: `flex-1 flex flex-col ${k === "left" ? "lg:flex-row-reverse" : "lg:flex-row"} overflow-hidden`,
|
|
@@ -20610,127 +20656,130 @@ function jx({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
|
|
|
20610
20656
|
showExport: E,
|
|
20611
20657
|
showExportPdf: ee,
|
|
20612
20658
|
showClearCanvas: w,
|
|
20613
|
-
customButtonStyles:
|
|
20614
|
-
customButtonClassNames:
|
|
20615
|
-
customActionComponents:
|
|
20616
|
-
handleHtmlImport:
|
|
20617
|
-
handlePdfImport:
|
|
20618
|
-
setPreviewOpen:
|
|
20619
|
-
handleExport:
|
|
20620
|
-
handleExportPdf:
|
|
20621
|
-
handleClearCanvas:
|
|
20622
|
-
zoom:
|
|
20623
|
-
setZoom:
|
|
20624
|
-
setPanOffset:
|
|
20659
|
+
customButtonStyles: M,
|
|
20660
|
+
customButtonClassNames: oe,
|
|
20661
|
+
customActionComponents: se,
|
|
20662
|
+
handleHtmlImport: Ct,
|
|
20663
|
+
handlePdfImport: wt,
|
|
20664
|
+
setPreviewOpen: mt,
|
|
20665
|
+
handleExport: Dt,
|
|
20666
|
+
handleExportPdf: Ot,
|
|
20667
|
+
handleClearCanvas: kt,
|
|
20668
|
+
zoom: le,
|
|
20669
|
+
setZoom: ue,
|
|
20670
|
+
setPanOffset: fe,
|
|
20671
|
+
themeColor: ce
|
|
20625
20672
|
}), /* @__PURE__ */ u(Tx, {
|
|
20626
|
-
blocks:
|
|
20627
|
-
setBlocks:
|
|
20628
|
-
selectedBlockId:
|
|
20629
|
-
setSelectedBlockId:
|
|
20630
|
-
setActiveTab:
|
|
20631
|
-
showMockData:
|
|
20632
|
-
placeholderMockData:
|
|
20633
|
-
dragOverIndex:
|
|
20634
|
-
setDragOverIndex:
|
|
20635
|
-
draggedSidebarItem:
|
|
20673
|
+
blocks: Je,
|
|
20674
|
+
setBlocks: Ye,
|
|
20675
|
+
selectedBlockId: Xe,
|
|
20676
|
+
setSelectedBlockId: Ze,
|
|
20677
|
+
setActiveTab: ft,
|
|
20678
|
+
showMockData: ht,
|
|
20679
|
+
placeholderMockData: St,
|
|
20680
|
+
dragOverIndex: ze,
|
|
20681
|
+
setDragOverIndex: Be,
|
|
20682
|
+
draggedSidebarItem: Le,
|
|
20636
20683
|
defaultStyles: x,
|
|
20637
|
-
zoom:
|
|
20638
|
-
panOffset:
|
|
20639
|
-
spacePressed:
|
|
20640
|
-
canvasHeight:
|
|
20641
|
-
viewportRef:
|
|
20642
|
-
canvasContainerRef:
|
|
20643
|
-
handleMouseDown:
|
|
20644
|
-
handleMouseMove:
|
|
20645
|
-
handleMouseUp:
|
|
20646
|
-
createTextBlock:
|
|
20647
|
-
duplicateBlock:
|
|
20684
|
+
zoom: le,
|
|
20685
|
+
panOffset: de,
|
|
20686
|
+
spacePressed: pe,
|
|
20687
|
+
canvasHeight: me,
|
|
20688
|
+
viewportRef: he,
|
|
20689
|
+
canvasContainerRef: ge,
|
|
20690
|
+
handleMouseDown: _e,
|
|
20691
|
+
handleMouseMove: ve,
|
|
20692
|
+
handleMouseUp: ye,
|
|
20693
|
+
createTextBlock: $e,
|
|
20694
|
+
duplicateBlock: tt,
|
|
20648
20695
|
reorderBlock: (e, t) => {
|
|
20649
|
-
t === "up" ?
|
|
20696
|
+
t === "up" ? nt(e) : rt(e);
|
|
20650
20697
|
},
|
|
20651
|
-
handleDeleteBlock:
|
|
20698
|
+
handleDeleteBlock: z,
|
|
20652
20699
|
handleSidebarDrop: (e) => {
|
|
20653
|
-
if (!
|
|
20700
|
+
if (!Le) return;
|
|
20654
20701
|
let t;
|
|
20655
|
-
if (
|
|
20656
|
-
else if (
|
|
20702
|
+
if (Le.type === "table" && Le.tableSchema) t = et(Le.tableSchema);
|
|
20703
|
+
else if (Le.type === "image" && Le.imageType) t = R(Le.imageType);
|
|
20657
20704
|
else {
|
|
20658
20705
|
let e = "Enter text here...";
|
|
20659
|
-
|
|
20706
|
+
Le.type === "h1" ? e = "Heading 1" : Le.type === "h2" ? e = "Heading 2" : Le.type === "h3" ? e = "Heading 3" : Le.type === "title" ? e = "Document Title" : Le.type === "subtitle" ? e = "Document Subtitle" : Le.type === "caption" && (e = "Caption text..."), t = $e(Le.type, e, x == null ? void 0 : x[Le.type]);
|
|
20660
20707
|
}
|
|
20661
|
-
|
|
20708
|
+
Ye((n) => {
|
|
20662
20709
|
let r = [...n];
|
|
20663
20710
|
return r.splice(e, 0, t), r;
|
|
20664
|
-
}),
|
|
20711
|
+
}), Ze(t.id), ft("styles");
|
|
20665
20712
|
},
|
|
20666
|
-
handleTableCellDrop:
|
|
20667
|
-
updateTableCell:
|
|
20668
|
-
handleTextDrop:
|
|
20713
|
+
handleTableCellDrop: jt,
|
|
20714
|
+
updateTableCell: Mt,
|
|
20715
|
+
handleTextDrop: At,
|
|
20716
|
+
themeColor: ce
|
|
20669
20717
|
})]
|
|
20670
20718
|
}), /* @__PURE__ */ u(bx, {
|
|
20671
|
-
activeTab:
|
|
20672
|
-
setActiveTab:
|
|
20673
|
-
|
|
20674
|
-
|
|
20675
|
-
|
|
20676
|
-
|
|
20719
|
+
activeTab: B,
|
|
20720
|
+
setActiveTab: ft,
|
|
20721
|
+
themeColor: ce,
|
|
20722
|
+
setBlocks: Ye,
|
|
20723
|
+
selectedBlockId: Xe,
|
|
20724
|
+
setSelectedBlockId: Ze,
|
|
20725
|
+
getSelectedBlock: Qe,
|
|
20677
20726
|
defaultStyles: x,
|
|
20678
|
-
createTextBlock:
|
|
20679
|
-
createImageBlock:
|
|
20680
|
-
updateSelectedStyle:
|
|
20681
|
-
updateSelectedImageInfo:
|
|
20682
|
-
handleDeleteBlock:
|
|
20683
|
-
handleRemoveTableColumn:
|
|
20684
|
-
handleAddTableColumn:
|
|
20685
|
-
handleUpdateTableColumn:
|
|
20686
|
-
handleReorderTableColumn:
|
|
20687
|
-
handleAddTableRow:
|
|
20688
|
-
handleRemoveTableRow:
|
|
20689
|
-
schemas:
|
|
20690
|
-
toggleSchemaColumn:
|
|
20691
|
-
customTableName:
|
|
20692
|
-
setCustomTableName:
|
|
20693
|
-
customLoopStart:
|
|
20694
|
-
setCustomLoopStart:
|
|
20695
|
-
customLoopEnd:
|
|
20696
|
-
setCustomLoopEnd:
|
|
20697
|
-
handleAddCustomTable:
|
|
20698
|
-
newColName:
|
|
20699
|
-
setNewColName:
|
|
20700
|
-
newColPlaceholder:
|
|
20701
|
-
setNewColPlaceholder:
|
|
20702
|
-
customImageTypes:
|
|
20703
|
-
newImgTypeName:
|
|
20704
|
-
setNewImgTypeName:
|
|
20705
|
-
handleAddCustomImageType:
|
|
20727
|
+
createTextBlock: $e,
|
|
20728
|
+
createImageBlock: R,
|
|
20729
|
+
updateSelectedStyle: it,
|
|
20730
|
+
updateSelectedImageInfo: at,
|
|
20731
|
+
handleDeleteBlock: z,
|
|
20732
|
+
handleRemoveTableColumn: ot,
|
|
20733
|
+
handleAddTableColumn: st,
|
|
20734
|
+
handleUpdateTableColumn: ct,
|
|
20735
|
+
handleReorderTableColumn: lt,
|
|
20736
|
+
handleAddTableRow: ut,
|
|
20737
|
+
handleRemoveTableRow: dt,
|
|
20738
|
+
schemas: Ae,
|
|
20739
|
+
toggleSchemaColumn: L,
|
|
20740
|
+
customTableName: be,
|
|
20741
|
+
setCustomTableName: xe,
|
|
20742
|
+
customLoopStart: Se,
|
|
20743
|
+
setCustomLoopStart: Ce,
|
|
20744
|
+
customLoopEnd: we,
|
|
20745
|
+
setCustomLoopEnd: Te,
|
|
20746
|
+
handleAddCustomTable: We,
|
|
20747
|
+
newColName: Ee,
|
|
20748
|
+
setNewColName: De,
|
|
20749
|
+
newColPlaceholder: N,
|
|
20750
|
+
setNewColPlaceholder: P,
|
|
20751
|
+
customImageTypes: Ve,
|
|
20752
|
+
newImgTypeName: F,
|
|
20753
|
+
setNewImgTypeName: I,
|
|
20754
|
+
handleAddCustomImageType: Ge,
|
|
20706
20755
|
placeholders: t,
|
|
20707
|
-
searchPlaceholder:
|
|
20708
|
-
setSearchPlaceholder:
|
|
20756
|
+
searchPlaceholder: He,
|
|
20757
|
+
setSearchPlaceholder: Ue,
|
|
20709
20758
|
handleSidebarDragStart: (e, t, n, r) => {
|
|
20710
|
-
|
|
20759
|
+
Re({
|
|
20711
20760
|
type: t,
|
|
20712
20761
|
tableSchema: n,
|
|
20713
20762
|
imageType: r
|
|
20714
20763
|
}), e.dataTransfer.setData("source", "sidebar"), e.dataTransfer.effectAllowed = "copy";
|
|
20715
20764
|
},
|
|
20716
|
-
isTablesLoading:
|
|
20717
|
-
tablesLoading:
|
|
20718
|
-
isPlaceholdersLoading:
|
|
20719
|
-
placeholdersLoading:
|
|
20720
|
-
fontSizesState:
|
|
20721
|
-
fontFamiliesState:
|
|
20722
|
-
fontWeightsState:
|
|
20765
|
+
isTablesLoading: ne,
|
|
20766
|
+
tablesLoading: re,
|
|
20767
|
+
isPlaceholdersLoading: ie,
|
|
20768
|
+
placeholdersLoading: ae,
|
|
20769
|
+
fontSizesState: gt,
|
|
20770
|
+
fontFamiliesState: _t,
|
|
20771
|
+
fontWeightsState: vt,
|
|
20723
20772
|
sidebarPosition: k
|
|
20724
20773
|
})]
|
|
20725
20774
|
}),
|
|
20726
20775
|
/* @__PURE__ */ u(Ox, {
|
|
20727
20776
|
bubbleCoords: Oe,
|
|
20728
|
-
applySelectionFormat:
|
|
20777
|
+
applySelectionFormat: Ke
|
|
20729
20778
|
}),
|
|
20730
20779
|
/* @__PURE__ */ u(Dx, {
|
|
20731
|
-
previewOpen:
|
|
20732
|
-
setPreviewOpen:
|
|
20733
|
-
generateExportHtml:
|
|
20780
|
+
previewOpen: pt,
|
|
20781
|
+
setPreviewOpen: mt,
|
|
20782
|
+
generateExportHtml: Et
|
|
20734
20783
|
})
|
|
20735
20784
|
]
|
|
20736
20785
|
});
|