@factorialco/f0-react 4.45.0 → 4.46.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ChatDocxThumbnail-B3DMs45n.js +48 -0
- package/dist/ChatPdfThumbnail-DkOc631R.js +38 -0
- package/dist/ChatSheetThumbnail-BvnxT-4A.js +38 -0
- package/dist/ChatTextThumbnail-yVt_iYi7.js +33 -0
- package/dist/{DocumentToolbar-CW3DaM_j.js → DocumentToolbar-B6xmzLGZ.js} +5 -5
- package/dist/DocxViewer-bxd7ENFb.js +68 -0
- package/dist/{F0AiProcessingOverlay-rViVqtAb.js → F0AiProcessingOverlay-BZka5wSN.js} +713 -761
- package/dist/{F0CanvasPanel-VGTPb68G.js → F0CanvasPanel-BDwye32b.js} +10679 -10600
- package/dist/{LocationMap-CdKO0X5V.js → LocationMap-NloaE37G.js} +1 -1
- package/dist/Printer-B7iDPx2r.js +54 -0
- package/dist/SheetViewer-BJty2x0C.js +108 -0
- package/dist/{TextViewer-DXDZcvag.js → TextViewer-BHQe1ATo.js} +2 -2
- package/dist/_commonjs-dynamic-modules-BpilXLfW.js +6 -0
- package/dist/ai.d.ts +30 -1
- package/dist/ai.js +2 -2
- package/dist/component-status.js +1 -1
- package/dist/{DocxViewer-Dpj4i6ig.js → docx-preview-CSg41tKY.js} +971 -1034
- package/dist/experimental.d.ts +20 -3
- package/dist/experimental.js +10210 -6404
- package/dist/f0.css +1 -1
- package/dist/f0.d.ts +30 -1
- package/dist/f0.js +65853 -299
- package/dist/index-DFKYhqVR.js +545 -0
- package/dist/{index-CNi_8WQC.js → index-Db_fatEK.js} +3327 -3320
- package/dist/index.css +1 -1
- package/dist/index2.css +1 -0
- package/dist/pdfWorker-BjeFQxHW.js +13118 -0
- package/dist/pdfWorker.css +1 -0
- package/dist/sheetPreview-5qeAOp0W.js +35 -0
- package/dist/styles.css +1 -1
- package/package.json +2 -1
- package/tailwind.config.ts +8 -0
- package/dist/SheetViewer-huUU5vFM.js +0 -137
- package/dist/f0-C3TJ0moH.js +0 -79279
|
@@ -0,0 +1,545 @@
|
|
|
1
|
+
import { S as L, o as ye, u as Z, q as ne, r as Se, s as Re, i as ke, j as _e, k as Ne, t as Ce, l as Le, w as Fe, v as Ve, x as Te } from "./F0CanvasPanel-BDwye32b.js";
|
|
2
|
+
import { jsx as t, jsxs as y } from "react/jsx-runtime";
|
|
3
|
+
import { lazy as J, forwardRef as ae, Suspense as He, useState as V, useRef as A, useMemo as te, useCallback as w, useEffect as T } from "react";
|
|
4
|
+
import { e as Ee, D as Ue, P as je, c as De } from "./pdfWorker-BjeFQxHW.js";
|
|
5
|
+
import { F as We } from "./Printer-B7iDPx2r.js";
|
|
6
|
+
import './index.css';const Oe = ({
|
|
7
|
+
label: o,
|
|
8
|
+
width: a,
|
|
9
|
+
height: e
|
|
10
|
+
}) => /* @__PURE__ */ t(
|
|
11
|
+
"div",
|
|
12
|
+
{
|
|
13
|
+
role: "status",
|
|
14
|
+
"aria-label": o,
|
|
15
|
+
"aria-live": "polite",
|
|
16
|
+
"aria-busy": !0,
|
|
17
|
+
className: "F0PdfViewer__page mx-auto w-fit px-4 pt-4 last:pb-4",
|
|
18
|
+
children: /* @__PURE__ */ t(
|
|
19
|
+
L,
|
|
20
|
+
{
|
|
21
|
+
style: { width: a, height: e },
|
|
22
|
+
className: "rounded-lg border border-solid border-f1-border-secondary shadow-md"
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
), R = ({
|
|
27
|
+
label: o,
|
|
28
|
+
icon: a,
|
|
29
|
+
onClick: e,
|
|
30
|
+
size: i = "md"
|
|
31
|
+
}) => /* @__PURE__ */ t(
|
|
32
|
+
ye,
|
|
33
|
+
{
|
|
34
|
+
label: o,
|
|
35
|
+
icon: a,
|
|
36
|
+
onClick: e,
|
|
37
|
+
hideLabel: !0,
|
|
38
|
+
variant: "outline",
|
|
39
|
+
size: i
|
|
40
|
+
}
|
|
41
|
+
), q = "flex flex-row items-center gap-2", $e = ({
|
|
42
|
+
toolbarRef: o,
|
|
43
|
+
currentPage: a,
|
|
44
|
+
totalPages: e,
|
|
45
|
+
hasDocument: i,
|
|
46
|
+
selectedScale: l,
|
|
47
|
+
scaleOptions: s,
|
|
48
|
+
onPreviousPage: d,
|
|
49
|
+
onNextPage: m,
|
|
50
|
+
onZoomIn: g,
|
|
51
|
+
onZoomOut: v,
|
|
52
|
+
onScaleChange: k,
|
|
53
|
+
rotatable: P,
|
|
54
|
+
onRotate: p,
|
|
55
|
+
onPrint: H,
|
|
56
|
+
onDownload: x,
|
|
57
|
+
actions: h
|
|
58
|
+
}) => {
|
|
59
|
+
const { pdfViewer: c } = Z();
|
|
60
|
+
return /* @__PURE__ */ y(
|
|
61
|
+
"div",
|
|
62
|
+
{
|
|
63
|
+
ref: o,
|
|
64
|
+
role: "toolbar",
|
|
65
|
+
"aria-label": c.toolbar,
|
|
66
|
+
className: ne(
|
|
67
|
+
"F0PdfViewer__surface sticky top-0 z-10 flex flex-row items-center justify-between gap-2",
|
|
68
|
+
"px-6 py-4"
|
|
69
|
+
),
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ y("div", { className: q, children: [
|
|
72
|
+
i && /* @__PURE__ */ y(
|
|
73
|
+
"span",
|
|
74
|
+
{
|
|
75
|
+
"aria-live": "polite",
|
|
76
|
+
className: "whitespace-nowrap text-sm font-medium text-f1-foreground-secondary",
|
|
77
|
+
children: [
|
|
78
|
+
a,
|
|
79
|
+
" / ",
|
|
80
|
+
e
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
/* @__PURE__ */ t(
|
|
85
|
+
R,
|
|
86
|
+
{
|
|
87
|
+
label: c.previousPage,
|
|
88
|
+
onClick: d,
|
|
89
|
+
icon: Se,
|
|
90
|
+
size: "sm"
|
|
91
|
+
}
|
|
92
|
+
),
|
|
93
|
+
/* @__PURE__ */ t(
|
|
94
|
+
R,
|
|
95
|
+
{
|
|
96
|
+
label: c.nextPage,
|
|
97
|
+
onClick: m,
|
|
98
|
+
icon: Re,
|
|
99
|
+
size: "sm"
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
] }),
|
|
103
|
+
/* @__PURE__ */ y("div", { className: q, children: [
|
|
104
|
+
/* @__PURE__ */ t(
|
|
105
|
+
R,
|
|
106
|
+
{
|
|
107
|
+
label: c.zoomOut,
|
|
108
|
+
onClick: v,
|
|
109
|
+
icon: ke
|
|
110
|
+
}
|
|
111
|
+
),
|
|
112
|
+
/* @__PURE__ */ t(
|
|
113
|
+
R,
|
|
114
|
+
{
|
|
115
|
+
label: c.zoomIn,
|
|
116
|
+
onClick: g,
|
|
117
|
+
icon: _e
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
/* @__PURE__ */ t(
|
|
121
|
+
Ne,
|
|
122
|
+
{
|
|
123
|
+
hideLabel: !0,
|
|
124
|
+
label: c.scaleSelector,
|
|
125
|
+
options: s,
|
|
126
|
+
value: l,
|
|
127
|
+
onChange: (b) => k(b)
|
|
128
|
+
}
|
|
129
|
+
)
|
|
130
|
+
] }),
|
|
131
|
+
/* @__PURE__ */ y("div", { className: q, children: [
|
|
132
|
+
P && /* @__PURE__ */ t(
|
|
133
|
+
R,
|
|
134
|
+
{
|
|
135
|
+
label: c.rotate,
|
|
136
|
+
onClick: p,
|
|
137
|
+
icon: Ce
|
|
138
|
+
}
|
|
139
|
+
),
|
|
140
|
+
/* @__PURE__ */ t(
|
|
141
|
+
R,
|
|
142
|
+
{
|
|
143
|
+
label: c.print,
|
|
144
|
+
onClick: H,
|
|
145
|
+
icon: We
|
|
146
|
+
}
|
|
147
|
+
),
|
|
148
|
+
/* @__PURE__ */ t(
|
|
149
|
+
R,
|
|
150
|
+
{
|
|
151
|
+
label: c.download,
|
|
152
|
+
onClick: x,
|
|
153
|
+
icon: Le
|
|
154
|
+
}
|
|
155
|
+
),
|
|
156
|
+
h?.map((b, _) => /* @__PURE__ */ t(
|
|
157
|
+
R,
|
|
158
|
+
{
|
|
159
|
+
label: b.label,
|
|
160
|
+
onClick: b.onClick,
|
|
161
|
+
icon: b.icon
|
|
162
|
+
},
|
|
163
|
+
`${b.label}-${_}`
|
|
164
|
+
))
|
|
165
|
+
] })
|
|
166
|
+
]
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
}, re = async (o) => {
|
|
170
|
+
const a = await o.saveDocument();
|
|
171
|
+
return new Blob([new Uint8Array(a)], { type: "application/pdf" });
|
|
172
|
+
}, Be = async (o) => {
|
|
173
|
+
if (!o) return;
|
|
174
|
+
const a = URL.createObjectURL(await re(o)), e = document.createElement("iframe");
|
|
175
|
+
e.style.display = "none", e.src = a, e.onload = () => {
|
|
176
|
+
e.focus(), e.contentWindow?.print();
|
|
177
|
+
const i = () => {
|
|
178
|
+
URL.revokeObjectURL(a), e.remove();
|
|
179
|
+
};
|
|
180
|
+
e.contentWindow?.addEventListener("afterprint", i), setTimeout(i, 6e4);
|
|
181
|
+
}, document.body.appendChild(e);
|
|
182
|
+
}, ze = async (o, a) => {
|
|
183
|
+
if (!o) return;
|
|
184
|
+
const e = URL.createObjectURL(await re(o)), i = document.createElement("a");
|
|
185
|
+
i.href = e, i.download = a.length > 0 ? a : "document.pdf", document.body.appendChild(i), i.click(), i.remove(), URL.revokeObjectURL(e);
|
|
186
|
+
}, nt = async (o, a, e = !0) => {
|
|
187
|
+
let i = o, l;
|
|
188
|
+
try {
|
|
189
|
+
const d = await fetch(o, {
|
|
190
|
+
credentials: e ? "include" : "same-origin"
|
|
191
|
+
});
|
|
192
|
+
if (!d.ok) throw new Error(`${d.status}`);
|
|
193
|
+
l = URL.createObjectURL(await d.blob()), i = l;
|
|
194
|
+
} catch {
|
|
195
|
+
}
|
|
196
|
+
const s = document.createElement("a");
|
|
197
|
+
s.href = i, s.download = a ?? "", s.rel = "noreferrer", l || (s.target = "_blank"), document.body.appendChild(s), s.click(), s.remove(), l && URL.revokeObjectURL(l);
|
|
198
|
+
}, G = [
|
|
199
|
+
"0.5",
|
|
200
|
+
"0.75",
|
|
201
|
+
"1",
|
|
202
|
+
"1.25",
|
|
203
|
+
"1.5",
|
|
204
|
+
"2",
|
|
205
|
+
"3",
|
|
206
|
+
"4"
|
|
207
|
+
], ie = G.map(Number), Me = (o) => ie.find((a) => a > o), Ie = (o) => [...ie].reverse().find((a) => a < o), Ae = (o, a, e) => {
|
|
208
|
+
let i = null, l = 0;
|
|
209
|
+
return a.forEach((s, d) => {
|
|
210
|
+
if (!s) return;
|
|
211
|
+
const m = s.offsetHeight, g = s.offsetTop, v = g + m, k = o.offsetHeight - e, P = o.scrollTop + e, p = P + k;
|
|
212
|
+
if (!(P < v && p > g)) return;
|
|
213
|
+
let x;
|
|
214
|
+
if (P <= g)
|
|
215
|
+
x = p > v ? m : p - g;
|
|
216
|
+
else {
|
|
217
|
+
let h = P - g;
|
|
218
|
+
p < v && (h += v - p), x = m - h;
|
|
219
|
+
}
|
|
220
|
+
x > l && (l = x, i = d + 1);
|
|
221
|
+
}), i;
|
|
222
|
+
};
|
|
223
|
+
Ee();
|
|
224
|
+
const qe = J(() => import("./SheetViewer-BJty2x0C.js")), Ge = J(() => import("./DocxViewer-bxd7ENFb.js")), Ze = J(() => import("./TextViewer-BHQe1ATo.js")), oe = 48, se = ae(
|
|
225
|
+
(o, a) => {
|
|
226
|
+
const { kind: e = "pdf", mimeType: i, ...l } = o;
|
|
227
|
+
if (e === "pdf") return /* @__PURE__ */ t(le, { ref: a, ...l });
|
|
228
|
+
const {
|
|
229
|
+
url: s,
|
|
230
|
+
filename: d,
|
|
231
|
+
actions: m,
|
|
232
|
+
withCredentials: g = !0,
|
|
233
|
+
page: v,
|
|
234
|
+
pagesToDisplay: k,
|
|
235
|
+
initialScale: P,
|
|
236
|
+
rotatable: p,
|
|
237
|
+
initialRotation: H,
|
|
238
|
+
onRotationChange: x,
|
|
239
|
+
onPdfLoaded: h,
|
|
240
|
+
onPageChange: c,
|
|
241
|
+
...b
|
|
242
|
+
} = l;
|
|
243
|
+
return /* @__PURE__ */ t(
|
|
244
|
+
"div",
|
|
245
|
+
{
|
|
246
|
+
ref: a,
|
|
247
|
+
...b,
|
|
248
|
+
className: "F0PdfViewer__surface relative flex h-full w-full flex-col overflow-hidden border border-solid border-f1-border-secondary",
|
|
249
|
+
children: /* @__PURE__ */ y(
|
|
250
|
+
He,
|
|
251
|
+
{
|
|
252
|
+
fallback: /* @__PURE__ */ t(L, { className: "h-full w-full rounded-none" }),
|
|
253
|
+
children: [
|
|
254
|
+
e === "sheet" && /* @__PURE__ */ t(
|
|
255
|
+
qe,
|
|
256
|
+
{
|
|
257
|
+
url: s,
|
|
258
|
+
filename: d,
|
|
259
|
+
withCredentials: g,
|
|
260
|
+
actions: m
|
|
261
|
+
}
|
|
262
|
+
),
|
|
263
|
+
e === "docx" && /* @__PURE__ */ t(
|
|
264
|
+
Ge,
|
|
265
|
+
{
|
|
266
|
+
url: s,
|
|
267
|
+
filename: d,
|
|
268
|
+
withCredentials: g,
|
|
269
|
+
actions: m
|
|
270
|
+
}
|
|
271
|
+
),
|
|
272
|
+
e === "text" && /* @__PURE__ */ t(
|
|
273
|
+
Ze,
|
|
274
|
+
{
|
|
275
|
+
url: s,
|
|
276
|
+
name: d ?? "",
|
|
277
|
+
mimeType: i,
|
|
278
|
+
withCredentials: g,
|
|
279
|
+
actions: m
|
|
280
|
+
}
|
|
281
|
+
)
|
|
282
|
+
]
|
|
283
|
+
}
|
|
284
|
+
)
|
|
285
|
+
}
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
);
|
|
289
|
+
se.displayName = "F0PdfViewer";
|
|
290
|
+
const le = ae((o, a) => {
|
|
291
|
+
const {
|
|
292
|
+
url: e,
|
|
293
|
+
filename: i = "document.pdf",
|
|
294
|
+
page: l = 0,
|
|
295
|
+
pagesToDisplay: s = [],
|
|
296
|
+
initialScale: d = "page-width",
|
|
297
|
+
withCredentials: m = !0,
|
|
298
|
+
rotatable: g = !1,
|
|
299
|
+
initialRotation: v = 0,
|
|
300
|
+
onRotationChange: k,
|
|
301
|
+
onPdfLoaded: P,
|
|
302
|
+
onPageChange: p,
|
|
303
|
+
actions: H,
|
|
304
|
+
...x
|
|
305
|
+
} = o, { pdfViewer: h } = Z(), [c, b] = V(null), [_, K] = V([]), [N, z] = V(1), [S, Q] = V(0), [U, M] = V(d), [E, ce] = V(v), I = A(null), j = A(null), D = A([]), W = s.length > 0 ? s.length : c?.numPages, X = _.find(Boolean), Y = (X?.originalWidth ?? 595) * N, ee = (X?.originalHeight ?? 842) * N, de = te(
|
|
306
|
+
() => [
|
|
307
|
+
{ value: "page-width", label: h.pageWidth },
|
|
308
|
+
{ value: "page-fit", label: h.pageFit },
|
|
309
|
+
...G.map((n) => ({
|
|
310
|
+
value: n,
|
|
311
|
+
label: `${Number(n) * 100}%`
|
|
312
|
+
}))
|
|
313
|
+
],
|
|
314
|
+
[h.pageWidth, h.pageFit]
|
|
315
|
+
), fe = te(() => ({ url: e, withCredentials: m }), [e, m]), F = w(
|
|
316
|
+
(n) => {
|
|
317
|
+
const r = (W ?? 1) - 1, f = Math.min(Math.max(n, 0), r), u = D.current[f], C = u?.offsetParent;
|
|
318
|
+
u && C instanceof HTMLElement && (C.scrollTop = u.offsetTop - (j.current?.offsetHeight ?? 0) - 10);
|
|
319
|
+
},
|
|
320
|
+
[W]
|
|
321
|
+
), O = w(
|
|
322
|
+
(n) => {
|
|
323
|
+
const r = _[S - 1], f = I.current;
|
|
324
|
+
if (!r || !f) return;
|
|
325
|
+
const u = j.current?.offsetHeight ?? 0, C = E === 90 || E === 270, B = C ? r.originalHeight : r.originalWidth, ve = C ? r.originalWidth : r.originalHeight, xe = n === "page-width" ? (f.clientWidth - oe) / B : (f.clientHeight - u - oe) / ve;
|
|
326
|
+
z(xe), M(n);
|
|
327
|
+
},
|
|
328
|
+
[_, S, E]
|
|
329
|
+
), ue = w(
|
|
330
|
+
(n) => {
|
|
331
|
+
if (n === "page-width" || n === "page-fit") {
|
|
332
|
+
O(n);
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
z(Number(n)), M(n);
|
|
336
|
+
},
|
|
337
|
+
[O]
|
|
338
|
+
), $ = w((n) => {
|
|
339
|
+
if (n === void 0) return;
|
|
340
|
+
z(n);
|
|
341
|
+
const r = G.find((f) => Number(f) === n);
|
|
342
|
+
r && M(r);
|
|
343
|
+
}, []), ge = w(
|
|
344
|
+
() => $(Me(N)),
|
|
345
|
+
[N, $]
|
|
346
|
+
), me = w(
|
|
347
|
+
() => $(Ie(N)),
|
|
348
|
+
[N, $]
|
|
349
|
+
), pe = w(() => {
|
|
350
|
+
ce((n) => {
|
|
351
|
+
const r = (n + 90) % 360;
|
|
352
|
+
return k?.(r), r;
|
|
353
|
+
});
|
|
354
|
+
}, [k]), he = w(
|
|
355
|
+
(n) => {
|
|
356
|
+
b(n), P?.(n), setTimeout(() => {
|
|
357
|
+
Q(l + 1), F(l);
|
|
358
|
+
}, 0);
|
|
359
|
+
},
|
|
360
|
+
[P, l, F]
|
|
361
|
+
), be = w((n) => {
|
|
362
|
+
const r = n.target;
|
|
363
|
+
if (!(r instanceof HTMLElement)) return;
|
|
364
|
+
const f = Ae(
|
|
365
|
+
r,
|
|
366
|
+
D.current,
|
|
367
|
+
j.current?.offsetHeight ?? 0
|
|
368
|
+
);
|
|
369
|
+
f && Q(f);
|
|
370
|
+
}, []), we = w(() => {
|
|
371
|
+
Be(c);
|
|
372
|
+
}, [c]), Pe = w(() => {
|
|
373
|
+
ze(c, i);
|
|
374
|
+
}, [c, i]);
|
|
375
|
+
return T(() => {
|
|
376
|
+
b(null), K([]), D.current = [];
|
|
377
|
+
}, [e]), T(() => {
|
|
378
|
+
F(l);
|
|
379
|
+
}, [l, F]), T(() => {
|
|
380
|
+
S > 0 && p?.(S);
|
|
381
|
+
}, [S, p]), T(() => {
|
|
382
|
+
_.length > 0 && (d === "page-width" || d === "page-fit") && O(d);
|
|
383
|
+
}, [_.length, d]), T(() => {
|
|
384
|
+
(U === "page-width" || U === "page-fit") && O(U);
|
|
385
|
+
}, [E]), T(() => {
|
|
386
|
+
const n = I.current;
|
|
387
|
+
if (!n) return;
|
|
388
|
+
const r = (f) => {
|
|
389
|
+
const u = f.target;
|
|
390
|
+
u instanceof HTMLAnchorElement && (u.target = "_blank", u.rel = "noopener noreferrer");
|
|
391
|
+
};
|
|
392
|
+
return n.addEventListener("click", r, !0), () => n.removeEventListener("click", r, !0);
|
|
393
|
+
}, []), /* @__PURE__ */ t(
|
|
394
|
+
"div",
|
|
395
|
+
{
|
|
396
|
+
ref: a,
|
|
397
|
+
...x,
|
|
398
|
+
className: "F0PdfViewer__surface relative flex h-full w-full flex-col overflow-hidden border border-solid border-f1-border-secondary",
|
|
399
|
+
children: /* @__PURE__ */ y(
|
|
400
|
+
"div",
|
|
401
|
+
{
|
|
402
|
+
ref: I,
|
|
403
|
+
onScroll: be,
|
|
404
|
+
className: "F0PdfViewer__surface relative flex h-full flex-col overflow-auto [scrollbar-gutter:stable_both-edges]",
|
|
405
|
+
children: [
|
|
406
|
+
/* @__PURE__ */ t(
|
|
407
|
+
$e,
|
|
408
|
+
{
|
|
409
|
+
toolbarRef: j,
|
|
410
|
+
currentPage: S,
|
|
411
|
+
totalPages: W,
|
|
412
|
+
hasDocument: !!c?.numPages,
|
|
413
|
+
selectedScale: U,
|
|
414
|
+
scaleOptions: de,
|
|
415
|
+
onPreviousPage: () => F(S - 2),
|
|
416
|
+
onNextPage: () => F(S),
|
|
417
|
+
onZoomIn: ge,
|
|
418
|
+
onZoomOut: me,
|
|
419
|
+
onScaleChange: ue,
|
|
420
|
+
rotatable: g,
|
|
421
|
+
onRotate: pe,
|
|
422
|
+
onPrint: we,
|
|
423
|
+
onDownload: Pe,
|
|
424
|
+
actions: H
|
|
425
|
+
}
|
|
426
|
+
),
|
|
427
|
+
e && /* @__PURE__ */ t(
|
|
428
|
+
Ue,
|
|
429
|
+
{
|
|
430
|
+
file: fe,
|
|
431
|
+
onLoadSuccess: he,
|
|
432
|
+
loading: /* @__PURE__ */ t(
|
|
433
|
+
Oe,
|
|
434
|
+
{
|
|
435
|
+
label: h.loading,
|
|
436
|
+
width: Y,
|
|
437
|
+
height: ee
|
|
438
|
+
}
|
|
439
|
+
),
|
|
440
|
+
children: c && Array.from({ length: W ?? 0 }).map((n, r) => {
|
|
441
|
+
const f = (s.length > 0 ? s[r] : r) + 1;
|
|
442
|
+
return /* @__PURE__ */ t(
|
|
443
|
+
"div",
|
|
444
|
+
{
|
|
445
|
+
className: "F0PdfViewer__page mx-auto w-fit px-4 pt-4 last:pb-4",
|
|
446
|
+
children: /* @__PURE__ */ t(
|
|
447
|
+
je,
|
|
448
|
+
{
|
|
449
|
+
className: "overflow-hidden rounded-lg border border-solid border-f1-border-secondary shadow-md",
|
|
450
|
+
pageNumber: f,
|
|
451
|
+
scale: N,
|
|
452
|
+
rotate: E,
|
|
453
|
+
loading: /* @__PURE__ */ t(
|
|
454
|
+
L,
|
|
455
|
+
{
|
|
456
|
+
style: {
|
|
457
|
+
width: Y,
|
|
458
|
+
height: ee
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
),
|
|
462
|
+
renderForms: !0,
|
|
463
|
+
renderTextLayer: !0,
|
|
464
|
+
inputRef: (u) => {
|
|
465
|
+
D.current[r] = u;
|
|
466
|
+
},
|
|
467
|
+
onLoadSuccess: (u) => {
|
|
468
|
+
K((C) => {
|
|
469
|
+
const B = [...C];
|
|
470
|
+
return B[r] = {
|
|
471
|
+
originalWidth: u.originalWidth,
|
|
472
|
+
originalHeight: u.originalHeight
|
|
473
|
+
}, B;
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
)
|
|
478
|
+
},
|
|
479
|
+
r
|
|
480
|
+
);
|
|
481
|
+
})
|
|
482
|
+
}
|
|
483
|
+
)
|
|
484
|
+
]
|
|
485
|
+
}
|
|
486
|
+
)
|
|
487
|
+
}
|
|
488
|
+
);
|
|
489
|
+
});
|
|
490
|
+
le.displayName = "PdfViewerBase";
|
|
491
|
+
const Je = () => {
|
|
492
|
+
const { pdfViewer: o } = Z();
|
|
493
|
+
return /* @__PURE__ */ y(
|
|
494
|
+
"div",
|
|
495
|
+
{
|
|
496
|
+
role: "status",
|
|
497
|
+
"aria-busy": "true",
|
|
498
|
+
"aria-live": "polite",
|
|
499
|
+
"aria-label": o.loading,
|
|
500
|
+
className: ne(
|
|
501
|
+
"F0PdfViewer__surface flex h-full w-full flex-col overflow-hidden",
|
|
502
|
+
"border border-solid border-f1-border-secondary"
|
|
503
|
+
),
|
|
504
|
+
children: [
|
|
505
|
+
/* @__PURE__ */ y("div", { className: "flex flex-row items-center justify-between gap-2 px-6 py-4", children: [
|
|
506
|
+
/* @__PURE__ */ t(L, { className: "h-8 w-24 rounded-md" }),
|
|
507
|
+
/* @__PURE__ */ t(L, { className: "h-8 w-40 rounded-md" }),
|
|
508
|
+
/* @__PURE__ */ t(L, { className: "h-8 w-20 rounded-md" })
|
|
509
|
+
] }),
|
|
510
|
+
/* @__PURE__ */ t("div", { className: "flex flex-1 justify-center p-4", children: /* @__PURE__ */ t(L, { className: "h-full w-full max-w-[600px] rounded-md" }) })
|
|
511
|
+
]
|
|
512
|
+
}
|
|
513
|
+
);
|
|
514
|
+
}, Ke = [
|
|
515
|
+
"page-width",
|
|
516
|
+
"page-fit",
|
|
517
|
+
"0.5",
|
|
518
|
+
"0.75",
|
|
519
|
+
"1",
|
|
520
|
+
"1.25",
|
|
521
|
+
"1.5",
|
|
522
|
+
"2",
|
|
523
|
+
"3",
|
|
524
|
+
"4"
|
|
525
|
+
], Qe = Fe(
|
|
526
|
+
Ve(
|
|
527
|
+
"F0PdfViewer",
|
|
528
|
+
Te(se, Je)
|
|
529
|
+
)
|
|
530
|
+
), at = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
531
|
+
__proto__: null,
|
|
532
|
+
F0PdfViewer: Qe,
|
|
533
|
+
configurePdfWorker: De,
|
|
534
|
+
pdfScales: Ke
|
|
535
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
536
|
+
export {
|
|
537
|
+
Qe as F,
|
|
538
|
+
R as T,
|
|
539
|
+
Ie as a,
|
|
540
|
+
nt as d,
|
|
541
|
+
G as f,
|
|
542
|
+
at as i,
|
|
543
|
+
Me as n,
|
|
544
|
+
Ke as p
|
|
545
|
+
};
|