@factorialco/f0-react 8.16.0 → 8.16.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.
Files changed (24) hide show
  1. package/dist/{ChatPdfThumbnail-C1SJmtGu.js → ChatPdfThumbnail-DOuDKXKf.js} +1 -1
  2. package/dist/{ChatPostComposerDialog-CWQjLNj_.js → ChatPostComposerDialog-D2ymoWVD.js} +3 -3
  3. package/dist/{DocumentToolbar-c6fYhage.js → DocumentToolbar-97n2nXUO.js} +2 -2
  4. package/dist/{DocxViewer-BuFtxAm5.js → DocxViewer-B3fLc2DK.js} +2 -2
  5. package/dist/{F0AiProcessingOverlay-C8BRJj9F.js → F0AiProcessingOverlay-CF4m9csf.js} +1 -1
  6. package/dist/{F0CanvasPanel-CqHQYY7O.js → F0CanvasPanel-CqwBZSlw.js} +309 -309
  7. package/dist/{F0Map-zPEzpa7c.js → F0Map-F7WNYPHU.js} +4 -4
  8. package/dist/{F0VideoPlayer-DTAJodv_.js → F0VideoPlayer-XnjKEpzT.js} +2 -2
  9. package/dist/{MapProvider-C0Pm68Nz.js → MapProvider--aDfTV7Z.js} +2 -2
  10. package/dist/{SheetViewer-DS9G1QPI.js → SheetViewer-CzYl8GLG.js} +2 -2
  11. package/dist/{TextViewer-BN5Dsxmb.js → TextViewer-B2jfln7v.js} +2 -2
  12. package/dist/ai.js +2 -2
  13. package/dist/component-status.js +1 -1
  14. package/dist/{experimental-CdsK3mLK.js → experimental-CzLTiYkz.js} +7 -7
  15. package/dist/experimental.js +71 -71
  16. package/dist/f0.js +10 -10
  17. package/dist/{index-DXJ4Y_fZ.js → index-BTZVSZUV.js} +2 -2
  18. package/dist/{index-D9SNDC4b.js → index-C6DiQWUC.js} +228 -217
  19. package/dist/index-Cywo9_7S.js +4 -0
  20. package/dist/{index-Bj9LskuL.js → index-DagDcfjo.js} +3 -3
  21. package/dist/{index-N4xGSF1m.js → index-QrmVaDiy.js} +1 -1
  22. package/dist/{pdfWorker-D4oJ8ZbR.js → pdfWorker-D58h5D59.js} +2 -2
  23. package/package.json +1 -1
  24. package/dist/index-BTASKoTh.js +0 -4
@@ -1,14 +1,14 @@
1
- import { S as V, y as _e, u as Q, z as Ce, w as Fe, i as Le, j as De, k as Ve, A as Te, l as He, B as Ee, E as Ue, G as We } from "./F0CanvasPanel-CqHQYY7O.js";
2
- import { jsx as n, jsxs as P } from "react/jsx-runtime";
3
- import { lazy as X, forwardRef as se, Suspense as je, useState as H, useRef as J, useCallback as w, useMemo as re, useEffect as E } from "react";
4
- import { e as Oe, D as $e, P as Be, c as Me } from "./pdfWorker-D4oJ8ZbR.js";
5
- import { F as ze } from "./Printer-BD-FEi_2.js";
6
- import { d as I } from "./tooltip-CrXp1Uaz.js";
7
- import './index2.css';const Ie = ({
1
+ import { S as E, y as Ce, u as X, z as Te, w as Le, i as Fe, j as De, k as Ve, A as Ee, l as He, B as Ue, E as Oe, G as We, H as je } from "./F0CanvasPanel-CqwBZSlw.js";
2
+ import { jsx as r, jsxs as P } from "react/jsx-runtime";
3
+ import { lazy as Y, forwardRef as ce, Suspense as $e, useState as U, useRef as A, useCallback as w, useMemo as ie, useEffect as V } from "react";
4
+ import { e as ze, D as Me, P as Be, c as Ie } from "./pdfWorker-D58h5D59.js";
5
+ import { F as Ae } from "./Printer-BD-FEi_2.js";
6
+ import { d as G } from "./tooltip-CrXp1Uaz.js";
7
+ import './index2.css';const Ge = ({
8
8
  label: e,
9
9
  width: t,
10
10
  height: o
11
- }) => /* @__PURE__ */ n(
11
+ }) => /* @__PURE__ */ r(
12
12
  "div",
13
13
  {
14
14
  role: "status",
@@ -16,21 +16,21 @@ import './index2.css';const Ie = ({
16
16
  "aria-live": "polite",
17
17
  "aria-busy": !0,
18
18
  className: "F0DocumentViewer__page mx-auto w-fit px-4 pt-4 last:pb-4",
19
- children: /* @__PURE__ */ n(
20
- V,
19
+ children: /* @__PURE__ */ r(
20
+ E,
21
21
  {
22
22
  style: { width: t, height: o },
23
23
  className: "rounded-lg border border-solid border-f1-border-secondary shadow-md"
24
24
  }
25
25
  )
26
26
  }
27
- ), N = ({
27
+ ), _ = ({
28
28
  label: e,
29
29
  icon: t,
30
30
  onClick: o,
31
31
  size: i = "md"
32
- }) => /* @__PURE__ */ n(
33
- _e,
32
+ }) => /* @__PURE__ */ r(
33
+ Ce,
34
34
  {
35
35
  label: e,
36
36
  icon: t,
@@ -39,14 +39,14 @@ import './index2.css';const Ie = ({
39
39
  variant: "outline",
40
40
  size: i
41
41
  }
42
- ), Ae = (e) => I(
42
+ ), Ze = (e) => G(
43
43
  "z-10 flex flex-row items-center gap-2",
44
44
  e === "top" ? "F0DocumentViewer__surface sticky top-0 justify-between px-6 py-4" : "absolute bottom-4 left-1/2 w-max max-w-[calc(100%-2rem)] -translate-x-1/2 gap-4 rounded-xl bg-f1-background-inverse p-2 text-f1-foreground-inverse shadow-lg backdrop-blur-sm"
45
- ), Ge = (e, t) => I(
45
+ ), qe = (e, t) => G(
46
46
  "flex flex-row items-center gap-2",
47
47
  e === "floating" && "dark",
48
48
  t
49
- ), ie = ({
49
+ ), le = ({
50
50
  toolbarRef: e,
51
51
  currentPage: t,
52
52
  totalPages: o,
@@ -57,15 +57,15 @@ import './index2.css';const Ie = ({
57
57
  onNextPage: h,
58
58
  onZoomIn: u,
59
59
  onZoomOut: b,
60
- onScaleChange: _,
60
+ onScaleChange: N,
61
61
  rotatable: v,
62
62
  onRotate: x,
63
- onPrint: U,
63
+ onPrint: O,
64
64
  onDownload: m,
65
65
  actions: C,
66
66
  placement: y
67
67
  }) => {
68
- const { pdfViewer: p } = Q(), g = Ge(y);
68
+ const { pdfViewer: p } = X(), g = qe(y);
69
69
  return /* @__PURE__ */ P(
70
70
  "div",
71
71
  {
@@ -73,13 +73,13 @@ import './index2.css';const Ie = ({
73
73
  role: "toolbar",
74
74
  "aria-label": p.toolbar,
75
75
  "data-placement": y,
76
- className: Ae(y),
76
+ className: Ze(y),
77
77
  children: [
78
78
  i ? /* @__PURE__ */ P(
79
79
  "span",
80
80
  {
81
81
  "aria-live": "polite",
82
- className: I(
82
+ className: G(
83
83
  "whitespace-nowrap text-sm font-medium",
84
84
  y === "top" ? "text-f1-foreground-secondary" : "pl-2 text-f1-foreground-inverse"
85
85
  ),
@@ -91,80 +91,80 @@ import './index2.css';const Ie = ({
91
91
  }
92
92
  ) : null,
93
93
  /* @__PURE__ */ P("div", { className: g, children: [
94
- /* @__PURE__ */ n(
95
- N,
94
+ /* @__PURE__ */ r(
95
+ _,
96
96
  {
97
97
  label: p.previousPage,
98
98
  onClick: c,
99
- icon: Ce,
99
+ icon: Te,
100
100
  size: "sm"
101
101
  }
102
102
  ),
103
- /* @__PURE__ */ n(
104
- N,
103
+ /* @__PURE__ */ r(
104
+ _,
105
105
  {
106
106
  label: p.nextPage,
107
107
  onClick: h,
108
- icon: Fe,
108
+ icon: Le,
109
109
  size: "sm"
110
110
  }
111
111
  )
112
112
  ] }),
113
113
  /* @__PURE__ */ P("div", { className: g, children: [
114
- /* @__PURE__ */ n(
115
- N,
114
+ /* @__PURE__ */ r(
115
+ _,
116
116
  {
117
117
  label: p.zoomOut,
118
118
  onClick: b,
119
- icon: Le
119
+ icon: Fe
120
120
  }
121
121
  ),
122
- /* @__PURE__ */ n(
123
- N,
122
+ /* @__PURE__ */ r(
123
+ _,
124
124
  {
125
125
  label: p.zoomIn,
126
126
  onClick: u,
127
127
  icon: De
128
128
  }
129
129
  ),
130
- /* @__PURE__ */ n(
130
+ /* @__PURE__ */ r(
131
131
  Ve,
132
132
  {
133
133
  hideLabel: !0,
134
134
  label: p.scaleSelector,
135
135
  options: s,
136
136
  value: l,
137
- onChange: (R) => _(R)
137
+ onChange: (R) => N(R)
138
138
  }
139
139
  )
140
140
  ] }),
141
141
  /* @__PURE__ */ P("div", { className: g, children: [
142
- v ? /* @__PURE__ */ n(
143
- N,
142
+ v ? /* @__PURE__ */ r(
143
+ _,
144
144
  {
145
145
  label: p.rotate,
146
146
  onClick: x,
147
- icon: Te
147
+ icon: Ee
148
148
  }
149
149
  ) : null,
150
- /* @__PURE__ */ n(
151
- N,
150
+ /* @__PURE__ */ r(
151
+ _,
152
152
  {
153
153
  label: p.print,
154
- onClick: U,
155
- icon: ze
154
+ onClick: O,
155
+ icon: Ae
156
156
  }
157
157
  ),
158
- /* @__PURE__ */ n(
159
- N,
158
+ /* @__PURE__ */ r(
159
+ _,
160
160
  {
161
161
  label: p.download,
162
162
  onClick: m,
163
163
  icon: He
164
164
  }
165
165
  ),
166
- C?.map((R, S) => /* @__PURE__ */ n(
167
- N,
166
+ C?.map((R, S) => /* @__PURE__ */ r(
167
+ _,
168
168
  {
169
169
  label: R.label,
170
170
  onClick: R.onClick,
@@ -176,15 +176,15 @@ import './index2.css';const Ie = ({
176
176
  ]
177
177
  }
178
178
  );
179
- }, qe = (e, t) => t ? (Math.round(t * e) + 1e-3) / t : e, Ze = (e, t = window.devicePixelRatio || 1) => {
179
+ }, Je = (e, t) => t ? (Math.round(t * e) + 1e-3) / t : e, Ke = (e, t = window.devicePixelRatio || 1) => {
180
180
  !e || e.width === 0 || e.height === 0 || (e.style.width = `${e.width / t}px`, e.style.height = `${e.height / t}px`);
181
- }, ce = async (e) => {
181
+ }, de = async (e) => {
182
182
  const t = await e.saveDocument();
183
183
  return new Blob([new Uint8Array(t)], { type: "application/pdf" });
184
- }, Je = async (e) => {
184
+ }, Qe = async (e) => {
185
185
  if (!e)
186
186
  return;
187
- const t = URL.createObjectURL(await ce(e)), o = document.createElement("iframe");
187
+ const t = URL.createObjectURL(await de(e)), o = document.createElement("iframe");
188
188
  o.style.display = "none", o.src = t, o.onload = () => {
189
189
  o.focus(), o.contentWindow?.print();
190
190
  const i = () => {
@@ -192,12 +192,12 @@ import './index2.css';const Ie = ({
192
192
  };
193
193
  o.contentWindow?.addEventListener("afterprint", i), setTimeout(i, 6e4);
194
194
  }, document.body.appendChild(o);
195
- }, Ke = async (e, t) => {
195
+ }, Xe = async (e, t) => {
196
196
  if (!e)
197
197
  return;
198
- const o = URL.createObjectURL(await ce(e)), i = document.createElement("a");
198
+ const o = URL.createObjectURL(await de(e)), i = document.createElement("a");
199
199
  i.href = o, i.download = t.length > 0 ? t : "document.pdf", document.body.appendChild(i), i.click(), i.remove(), URL.revokeObjectURL(o);
200
- }, ut = async (e, t, o = !0) => {
200
+ }, gt = async (e, t, o = !0) => {
201
201
  let i = e, l;
202
202
  try {
203
203
  const c = await fetch(e, {
@@ -210,7 +210,7 @@ import './index2.css';const Ie = ({
210
210
  }
211
211
  const s = document.createElement("a");
212
212
  s.href = i, s.download = t ?? "", s.rel = "noreferrer", l || (s.target = "_blank"), document.body.appendChild(s), s.click(), s.remove(), l && URL.revokeObjectURL(l);
213
- }, K = [
213
+ }, Q = [
214
214
  "0.5",
215
215
  "0.75",
216
216
  "1",
@@ -219,12 +219,12 @@ import './index2.css';const Ie = ({
219
219
  "2",
220
220
  "3",
221
221
  "4"
222
- ], de = K.map(Number), Qe = (e) => de.find((t) => t > e), Xe = (e) => [...de].reverse().find((t) => t < e), Ye = (e, t, o) => {
222
+ ], fe = Q.map(Number), Ye = (e) => fe.find((t) => t > e), et = (e) => [...fe].reverse().find((t) => t < e), tt = (e, t, o) => {
223
223
  let i = null, l = 0;
224
224
  return t.forEach((s, c) => {
225
225
  if (!s)
226
226
  return;
227
- const h = s.offsetHeight, u = s.offsetTop, b = u + h, _ = e.offsetHeight - o, v = e.scrollTop + o, x = v + _;
227
+ const h = s.offsetHeight, u = s.offsetTop, b = u + h, N = e.offsetHeight - o, v = e.scrollTop + o, x = v + N;
228
228
  if (!(v < b && x > u))
229
229
  return;
230
230
  let m;
@@ -237,35 +237,35 @@ import './index2.css';const Ie = ({
237
237
  m > l && (l = m, i = c + 1);
238
238
  }), i;
239
239
  };
240
- Oe();
241
- const et = X(() => import("./SheetViewer-DS9G1QPI.js")), tt = X(() => import("./DocxViewer-BuFtxAm5.js")), ot = X(() => import("./TextViewer-BN5Dsxmb.js")), le = 48, fe = se((e, t) => {
240
+ ze();
241
+ const ot = Y(() => import("./SheetViewer-CzYl8GLG.js")), nt = Y(() => import("./DocxViewer-B3fLc2DK.js")), rt = Y(() => import("./TextViewer-B2jfln7v.js")), se = 48, at = 150, ue = ce((e, t) => {
242
242
  const { kind: o = "pdf", mimeType: i, toolbar: l = "top", ...s } = e;
243
243
  if (o === "pdf")
244
- return /* @__PURE__ */ n(ue, { ref: t, toolbar: l, ...s });
244
+ return /* @__PURE__ */ r(me, { ref: t, toolbar: l, ...s });
245
245
  const {
246
246
  url: c,
247
247
  filename: h,
248
248
  actions: u,
249
249
  withCredentials: b = !0,
250
- page: _,
250
+ page: N,
251
251
  pagesToDisplay: v,
252
252
  initialScale: x,
253
- rotatable: U,
253
+ rotatable: O,
254
254
  initialRotation: m,
255
255
  onRotationChange: C,
256
256
  onPdfLoaded: y,
257
257
  onPageChange: p,
258
258
  ...g
259
259
  } = s;
260
- return /* @__PURE__ */ n(
260
+ return /* @__PURE__ */ r(
261
261
  "div",
262
262
  {
263
263
  ref: t,
264
264
  ...g,
265
265
  className: "F0DocumentViewer__surface relative flex h-full w-full flex-col overflow-hidden border border-solid border-f1-border-secondary",
266
- children: /* @__PURE__ */ P(je, { fallback: /* @__PURE__ */ n(V, { className: "h-full w-full rounded-none" }), children: [
267
- o === "sheet" ? /* @__PURE__ */ n(
268
- et,
266
+ children: /* @__PURE__ */ P($e, { fallback: /* @__PURE__ */ r(E, { className: "h-full w-full rounded-none" }), children: [
267
+ o === "sheet" ? /* @__PURE__ */ r(
268
+ ot,
269
269
  {
270
270
  url: c,
271
271
  filename: h,
@@ -274,8 +274,8 @@ const et = X(() => import("./SheetViewer-DS9G1QPI.js")), tt = X(() => import("./
274
274
  toolbar: l
275
275
  }
276
276
  ) : null,
277
- o === "docx" ? /* @__PURE__ */ n(
278
- tt,
277
+ o === "docx" ? /* @__PURE__ */ r(
278
+ nt,
279
279
  {
280
280
  url: c,
281
281
  filename: h,
@@ -284,8 +284,8 @@ const et = X(() => import("./SheetViewer-DS9G1QPI.js")), tt = X(() => import("./
284
284
  toolbar: l
285
285
  }
286
286
  ) : null,
287
- o === "text" ? /* @__PURE__ */ n(
288
- ot,
287
+ o === "text" ? /* @__PURE__ */ r(
288
+ rt,
289
289
  {
290
290
  url: c,
291
291
  name: h ?? "",
@@ -299,8 +299,8 @@ const et = X(() => import("./SheetViewer-DS9G1QPI.js")), tt = X(() => import("./
299
299
  }
300
300
  );
301
301
  });
302
- fe.displayName = "F0DocumentViewer";
303
- const ue = se((e, t) => {
302
+ ue.displayName = "F0DocumentViewer";
303
+ const me = ce((e, t) => {
304
304
  const {
305
305
  url: o,
306
306
  filename: i = "document.pdf",
@@ -310,132 +310,143 @@ const ue = se((e, t) => {
310
310
  withCredentials: h = !0,
311
311
  rotatable: u = !1,
312
312
  initialRotation: b = 0,
313
- onRotationChange: _,
313
+ onRotationChange: N,
314
314
  onPdfLoaded: v,
315
315
  onPageChange: x,
316
- actions: U,
316
+ actions: O,
317
317
  toolbar: m = "top",
318
318
  ...C
319
- } = e, { pdfViewer: y } = Q(), p = Math.max(
319
+ } = e, { pdfViewer: y } = X(), p = Math.max(
320
320
  2,
321
321
  typeof window > "u" ? 1 : window.devicePixelRatio || 1
322
- ), [g, R] = H(null), [S, Y] = H([]), [F, A] = H(1), [k, ee] = H(0), [j, G] = H(c), [L, pe] = H(b), q = J(null), Z = J(null), W = J([]), O = s.length > 0 ? s.length : g?.numPages, $ = w(
323
- () => m === "top" ? Z.current?.offsetHeight ?? 0 : 0,
322
+ ), [g, R] = U(null), [S, ee] = U([]), [T, Z] = U(1), [k, te] = U(0), [L, q] = U(c), [F, ge] = U(b), $ = A(null), J = A(null), W = A([]), z = s.length > 0 ? s.length : g?.numPages, M = w(
323
+ () => m === "top" ? J.current?.offsetHeight ?? 0 : 0,
324
324
  [m]
325
- ), te = S.find(Boolean), oe = (te?.originalWidth ?? 595) * F, ne = (te?.originalHeight ?? 842) * F, ge = re(
325
+ ), oe = S.find(Boolean), ne = (oe?.originalWidth ?? 595) * T, re = (oe?.originalHeight ?? 842) * T, he = ie(
326
326
  () => [
327
327
  { value: "page-width", label: y.pageWidth },
328
328
  { value: "page-fit", label: y.pageFit },
329
- ...K.map((a) => ({
330
- value: a,
331
- label: `${Number(a) * 100}%`
329
+ ...Q.map((n) => ({
330
+ value: n,
331
+ label: `${Number(n) * 100}%`
332
332
  }))
333
333
  ],
334
334
  [y.pageWidth, y.pageFit]
335
- ), he = re(() => ({ url: o, withCredentials: h }), [o, h]), T = w(
336
- (a) => {
337
- const r = (O ?? 1) - 1, d = Math.min(Math.max(a, 0), r), f = W.current[d], D = f?.offsetParent;
338
- f && D instanceof HTMLElement && (D.scrollTop = f.offsetTop - $() - 10);
335
+ ), be = ie(() => ({ url: o, withCredentials: h }), [o, h]), H = w(
336
+ (n) => {
337
+ const a = (z ?? 1) - 1, d = Math.min(Math.max(n, 0), a), f = W.current[d], D = f?.offsetParent;
338
+ f && D instanceof HTMLElement && (D.scrollTop = f.offsetTop - M() - 10);
339
339
  },
340
- [O, $]
341
- ), B = w(
342
- (a) => {
343
- const r = S[k - 1], d = q.current;
344
- if (!r || !d)
340
+ [z, M]
341
+ ), j = w(
342
+ (n) => {
343
+ const a = S[k - 1], d = $.current;
344
+ if (!a || !d)
345
345
  return;
346
- const f = Z.current?.offsetHeight ?? 0, D = L === 90 || L === 270, z = D ? r.originalHeight : r.originalWidth, ke = D ? r.originalWidth : r.originalHeight, Ne = a === "page-width" ? (d.clientWidth - le) / z : (d.clientHeight - f - le) / ke;
347
- A(Ne), G(a);
346
+ const f = J.current?.offsetHeight ?? 0, D = F === 90 || F === 270, I = D ? a.originalHeight : a.originalWidth, _e = D ? a.originalWidth : a.originalHeight, Ne = n === "page-width" ? (d.clientWidth - se) / I : (d.clientHeight - f - se) / _e;
347
+ Z(Ne), q(n);
348
348
  },
349
- [S, k, L]
350
- ), be = w(
351
- (a) => {
352
- if (a === "page-width" || a === "page-fit") {
353
- B(a);
349
+ [S, k, F]
350
+ ), we = w(
351
+ (n) => {
352
+ if (n === "page-width" || n === "page-fit") {
353
+ j(n);
354
354
  return;
355
355
  }
356
- A(Number(a)), G(a);
356
+ Z(Number(n)), q(n);
357
357
  },
358
- [B]
359
- ), M = w((a) => {
360
- if (a === void 0)
358
+ [j]
359
+ ), B = w((n) => {
360
+ if (n === void 0)
361
361
  return;
362
- A(a);
363
- const r = K.find((d) => Number(d) === a);
364
- r && G(r);
365
- }, []), we = w(
366
- () => M(Qe(F)),
367
- [F, M]
368
- ), xe = w(
369
- () => M(Xe(F)),
370
- [F, M]
371
- ), ye = w(() => {
372
- pe((a) => {
373
- const r = (a + 90) % 360;
374
- return _?.(r), r;
362
+ Z(n);
363
+ const a = Q.find((d) => Number(d) === n);
364
+ a && q(a);
365
+ }, []), xe = w(
366
+ () => B(Ye(T)),
367
+ [T, B]
368
+ ), ye = w(
369
+ () => B(et(T)),
370
+ [T, B]
371
+ ), ve = w(() => {
372
+ ge((n) => {
373
+ const a = (n + 90) % 360;
374
+ return N?.(a), a;
375
375
  });
376
- }, [_]), ve = w(
377
- (a) => {
378
- R(a), v?.(a), setTimeout(() => {
379
- ee(l + 1), T(l);
376
+ }, [N]), Pe = w(
377
+ (n) => {
378
+ R(n), v?.(n), setTimeout(() => {
379
+ te(l + 1), H(l);
380
380
  }, 0);
381
381
  },
382
- [v, l, T]
383
- ), Pe = w(
384
- (a) => {
385
- const r = a.target;
386
- if (!(r instanceof HTMLElement))
382
+ [v, l, H]
383
+ ), Re = w(
384
+ (n) => {
385
+ const a = n.target;
386
+ if (!(a instanceof HTMLElement))
387
387
  return;
388
- const d = Ye(
389
- r,
388
+ const d = tt(
389
+ a,
390
390
  W.current,
391
- $()
391
+ M()
392
392
  );
393
- d && ee(d);
393
+ d && te(d);
394
394
  },
395
- [$]
396
- ), Re = w(() => {
397
- Je(g);
398
- }, [g]), Se = w(() => {
399
- Ke(g, i);
395
+ [M]
396
+ ), Se = w(() => {
397
+ Qe(g);
398
+ }, [g]), ke = w(() => {
399
+ Xe(g, i);
400
400
  }, [g, i]);
401
- E(() => {
402
- R(null), Y([]), W.current = [];
403
- }, [o]), E(() => {
404
- T(l);
405
- }, [l, T]), E(() => {
401
+ V(() => {
402
+ R(null), ee([]), W.current = [];
403
+ }, [o]), V(() => {
404
+ H(l);
405
+ }, [l, H]), V(() => {
406
406
  k > 0 && x?.(k);
407
- }, [k, x]), E(() => {
408
- S.length > 0 && (c === "page-width" || c === "page-fit") && B(c);
409
- }, [S.length, c]), E(() => {
410
- (j === "page-width" || j === "page-fit") && B(j);
411
- }, [L]), E(() => {
412
- const a = q.current;
413
- if (!a)
407
+ }, [k, x]), V(() => {
408
+ S.length > 0 && (c === "page-width" || c === "page-fit") && j(c);
409
+ }, [S.length, c]), V(() => {
410
+ (L === "page-width" || L === "page-fit") && j(L);
411
+ }, [F]);
412
+ const K = A();
413
+ Ue({
414
+ ref: $,
415
+ onResize: () => {
416
+ clearTimeout(K.current), K.current = setTimeout(() => {
417
+ (L === "page-width" || L === "page-fit") && j(L);
418
+ }, at);
419
+ }
420
+ }), V(function() {
421
+ return () => clearTimeout(K.current);
422
+ }, []), V(() => {
423
+ const n = $.current;
424
+ if (!n)
414
425
  return;
415
- const r = (d) => {
426
+ const a = (d) => {
416
427
  const f = d.target;
417
428
  f instanceof HTMLAnchorElement && (f.target = "_blank", f.rel = "noopener noreferrer");
418
429
  };
419
- return a.addEventListener("click", r, !0), () => a.removeEventListener("click", r, !0);
430
+ return n.addEventListener("click", a, !0), () => n.removeEventListener("click", a, !0);
420
431
  }, []);
421
432
  const ae = {
422
- toolbarRef: Z,
433
+ toolbarRef: J,
423
434
  placement: m,
424
435
  currentPage: k,
425
- totalPages: O,
436
+ totalPages: z,
426
437
  hasDocument: !!g?.numPages,
427
- selectedScale: j,
428
- scaleOptions: ge,
429
- onPreviousPage: () => T(k - 2),
430
- onNextPage: () => T(k),
431
- onZoomIn: we,
432
- onZoomOut: xe,
433
- onScaleChange: be,
438
+ selectedScale: L,
439
+ scaleOptions: he,
440
+ onPreviousPage: () => H(k - 2),
441
+ onNextPage: () => H(k),
442
+ onZoomIn: xe,
443
+ onZoomOut: ye,
444
+ onScaleChange: we,
434
445
  rotatable: u,
435
- onRotate: ye,
436
- onPrint: Re,
437
- onDownload: Se,
438
- actions: U
446
+ onRotate: ve,
447
+ onPrint: Se,
448
+ onDownload: ke,
449
+ actions: O
439
450
  };
440
451
  return /* @__PURE__ */ P(
441
452
  "div",
@@ -447,74 +458,74 @@ const ue = se((e, t) => {
447
458
  /* @__PURE__ */ P(
448
459
  "div",
449
460
  {
450
- ref: q,
451
- onScroll: Pe,
461
+ ref: $,
462
+ onScroll: Re,
452
463
  className: "F0DocumentViewer__surface relative flex h-full flex-col overflow-auto [scrollbar-gutter:stable_both-edges]",
453
464
  children: [
454
- m === "top" ? /* @__PURE__ */ n(ie, { ...ae }) : null,
455
- o ? /* @__PURE__ */ n(
456
- $e,
465
+ m === "top" ? /* @__PURE__ */ r(le, { ...ae }) : null,
466
+ o ? /* @__PURE__ */ r(
467
+ Me,
457
468
  {
458
- file: he,
459
- onLoadSuccess: ve,
460
- loading: /* @__PURE__ */ n(
461
- Ie,
469
+ file: be,
470
+ onLoadSuccess: Pe,
471
+ loading: /* @__PURE__ */ r(
472
+ Ge,
462
473
  {
463
474
  label: y.loading,
464
- width: oe,
465
- height: ne
475
+ width: ne,
476
+ height: re
466
477
  }
467
478
  ),
468
- children: g ? Array.from({ length: O ?? 0 }).map((a, r) => {
469
- const d = (s.length > 0 ? s[r] : r) + 1;
470
- return /* @__PURE__ */ n(
479
+ children: g ? Array.from({ length: z ?? 0 }).map((n, a) => {
480
+ const d = (s.length > 0 ? s[a] : a) + 1;
481
+ return /* @__PURE__ */ r(
471
482
  "div",
472
483
  {
473
484
  className: "F0DocumentViewer__page mx-auto w-fit px-4 pt-4 last:pb-4",
474
- children: /* @__PURE__ */ n(
485
+ children: /* @__PURE__ */ r(
475
486
  Be,
476
487
  {
477
488
  className: "overflow-hidden rounded-lg border border-solid border-f1-border-secondary shadow-md",
478
489
  pageNumber: d,
479
- scale: qe(
480
- F,
481
- L === 90 || L === 270 ? S[r]?.originalHeight : S[r]?.originalWidth
490
+ scale: Je(
491
+ T,
492
+ F === 90 || F === 270 ? S[a]?.originalHeight : S[a]?.originalWidth
482
493
  ),
483
- rotate: L,
494
+ rotate: F,
484
495
  devicePixelRatio: p,
485
- loading: /* @__PURE__ */ n(
486
- V,
496
+ loading: /* @__PURE__ */ r(
497
+ E,
487
498
  {
488
499
  style: {
489
- width: oe,
490
- height: ne
500
+ width: ne,
501
+ height: re
491
502
  }
492
503
  }
493
504
  ),
494
505
  renderForms: !0,
495
506
  renderTextLayer: !0,
496
507
  inputRef: (f) => {
497
- W.current[r] = f;
508
+ W.current[a] = f;
498
509
  },
499
- onRenderSuccess: () => Ze(
500
- W.current[r]?.querySelector(
510
+ onRenderSuccess: () => Ke(
511
+ W.current[a]?.querySelector(
501
512
  "canvas"
502
513
  ),
503
514
  p
504
515
  ),
505
516
  onLoadSuccess: (f) => {
506
- Y((D) => {
507
- const z = [...D];
508
- return z[r] = {
517
+ ee((D) => {
518
+ const I = [...D];
519
+ return I[a] = {
509
520
  originalWidth: f.originalWidth,
510
521
  originalHeight: f.originalHeight
511
- }, z;
522
+ }, I;
512
523
  });
513
524
  }
514
525
  }
515
526
  )
516
527
  },
517
- r
528
+ a
518
529
  );
519
530
  }) : null
520
531
  }
@@ -522,14 +533,14 @@ const ue = se((e, t) => {
522
533
  ]
523
534
  }
524
535
  ),
525
- m === "floating" ? /* @__PURE__ */ n(ie, { ...ae }) : null
536
+ m === "floating" ? /* @__PURE__ */ r(le, { ...ae }) : null
526
537
  ]
527
538
  }
528
539
  );
529
540
  });
530
- ue.displayName = "PdfViewerBase";
531
- const nt = () => {
532
- const { pdfViewer: e } = Q();
541
+ me.displayName = "PdfViewerBase";
542
+ const it = () => {
543
+ const { pdfViewer: e } = X();
533
544
  return /* @__PURE__ */ P(
534
545
  "div",
535
546
  {
@@ -537,21 +548,21 @@ const nt = () => {
537
548
  "aria-busy": "true",
538
549
  "aria-live": "polite",
539
550
  "aria-label": e.loading,
540
- className: I(
551
+ className: G(
541
552
  "F0DocumentViewer__surface flex h-full w-full flex-col overflow-hidden",
542
553
  "border border-solid border-f1-border-secondary"
543
554
  ),
544
555
  children: [
545
556
  /* @__PURE__ */ P("div", { className: "flex flex-row items-center justify-between gap-2 px-6 py-4", children: [
546
- /* @__PURE__ */ n(V, { className: "h-8 w-24 rounded-md" }),
547
- /* @__PURE__ */ n(V, { className: "h-8 w-40 rounded-md" }),
548
- /* @__PURE__ */ n(V, { className: "h-8 w-20 rounded-md" })
557
+ /* @__PURE__ */ r(E, { className: "h-8 w-24 rounded-md" }),
558
+ /* @__PURE__ */ r(E, { className: "h-8 w-40 rounded-md" }),
559
+ /* @__PURE__ */ r(E, { className: "h-8 w-20 rounded-md" })
549
560
  ] }),
550
- /* @__PURE__ */ n("div", { className: "flex flex-1 justify-center p-4", children: /* @__PURE__ */ n(V, { className: "h-full w-full max-w-[600px] rounded-md" }) })
561
+ /* @__PURE__ */ r("div", { className: "flex flex-1 justify-center p-4", children: /* @__PURE__ */ r(E, { className: "h-full w-full max-w-[600px] rounded-md" }) })
551
562
  ]
552
563
  }
553
564
  );
554
- }, at = [
565
+ }, lt = [
555
566
  "page-width",
556
567
  "page-fit",
557
568
  "0.5",
@@ -562,28 +573,28 @@ const nt = () => {
562
573
  "2",
563
574
  "3",
564
575
  "4"
565
- ], me = Ee(
566
- Ue(
576
+ ], pe = Oe(
577
+ We(
567
578
  "F0DocumentViewer",
568
- We(fe, nt)
579
+ je(ue, it)
569
580
  )
570
- ), rt = me, mt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
581
+ ), st = pe, ht = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
571
582
  __proto__: null,
572
- F0DocumentViewer: me,
573
- F0PdfViewer: rt,
574
- configurePdfWorker: Me,
575
- pdfScales: at
583
+ F0DocumentViewer: pe,
584
+ F0PdfViewer: st,
585
+ configurePdfWorker: Ie,
586
+ pdfScales: lt
576
587
  }, Symbol.toStringTag, { value: "Module" }));
577
588
  export {
578
- me as F,
579
- N as T,
580
- Xe as a,
581
- Ge as b,
582
- rt as c,
583
- ut as d,
584
- K as f,
585
- mt as i,
586
- Qe as n,
587
- at as p,
588
- Ae as t
589
+ pe as F,
590
+ _ as T,
591
+ et as a,
592
+ qe as b,
593
+ st as c,
594
+ gt as d,
595
+ Q as f,
596
+ ht as i,
597
+ Ye as n,
598
+ lt as p,
599
+ Ze as t
589
600
  };