html-flip-book-react 0.0.0-alpha.35 → 0.0.0-alpha.37

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.
@@ -1,10 +1,10 @@
1
- import { jsx as t, jsxs as C } from "react/jsx-runtime";
2
- import { createContext as ce, useContext as ie, useMemo as Q, useCallback as k, useEffect as A, useState as N, useRef as V, useLayoutEffect as ge } from "react";
3
- let he = 4;
1
+ import { jsx as t, jsxs as T } from "react/jsx-runtime";
2
+ import { createContext as ce, useContext as ie, useMemo as Q, useCallback as v, useEffect as z, useState as I, useRef as J, useLayoutEffect as he } from "react";
3
+ let pe = 4;
4
4
  function re() {
5
- return he;
5
+ return pe;
6
6
  }
7
- const pe = {
7
+ const fe = {
8
8
  id: "download",
9
9
  enName: "Download",
10
10
  enDescription: "Download entire book or page range",
@@ -17,7 +17,7 @@ const pe = {
17
17
  );
18
18
  },
19
19
  canExecute: (e) => typeof e.data?.onDownload == "function"
20
- }, fe = [
20
+ }, be = [
21
21
  { key: "ArrowRight" },
22
22
  { key: "PageDown" },
23
23
  { key: " " }
@@ -28,40 +28,40 @@ const pe = {
28
28
  enName: "Next Page",
29
29
  enDescription: "Flip to the next page",
30
30
  nameKey: "command.jumpToNextPage",
31
- hotkeys: fe,
31
+ hotkeys: be,
32
32
  execute: (e) => {
33
33
  e.handle?.flipNext();
34
34
  },
35
35
  canExecute: (e) => (e.handle?.getCurrentPageIndex() ?? 0) < (e.handle?.getTotalPages() ?? 0) - 1
36
- }, be = [{ key: "ArrowLeft" }, { key: "PageUp" }], Z = {
36
+ }, we = [{ key: "ArrowLeft" }, { key: "PageUp" }], Z = {
37
37
  id: "flipPrev",
38
38
  navKind: "flip",
39
39
  enName: "Previous Page",
40
40
  enDescription: "Flip to the previous page",
41
41
  nameKey: "command.jumpToPrevPage",
42
- hotkeys: be,
42
+ hotkeys: we,
43
43
  execute: (e) => {
44
44
  e.handle?.flipPrev();
45
45
  },
46
46
  canExecute: (e) => (e.handle?.getCurrentPageIndex() ?? 0) > 0
47
- }, we = [{ key: "Home" }, { key: "ArrowLeft", modifiers: { ctrl: !0 } }], ee = {
47
+ }, xe = [{ key: "Home" }, { key: "ArrowLeft", modifiers: { ctrl: !0 } }], ee = {
48
48
  id: "goToFirst",
49
49
  navKind: "jump",
50
50
  enName: "First Page",
51
51
  enDescription: "Jump to the first page",
52
52
  nameKey: "command.jumpToFirstPage",
53
- hotkeys: we,
53
+ hotkeys: xe,
54
54
  execute: (e) => {
55
55
  e.handle?.jumpToPage(0);
56
56
  },
57
57
  canExecute: (e) => e.handle?.getCurrentPageIndex() !== 0
58
- }, xe = [{ key: "End" }, { key: "ArrowRight", modifiers: { ctrl: !0 } }], oe = {
58
+ }, ke = [{ key: "End" }, { key: "ArrowRight", modifiers: { ctrl: !0 } }], oe = {
59
59
  id: "goToLast",
60
60
  navKind: "jump",
61
61
  enName: "Last Page",
62
62
  enDescription: "Jump to the last page",
63
63
  nameKey: "command.jumpToLastPage",
64
- hotkeys: xe,
64
+ hotkeys: ke,
65
65
  execute: (e) => {
66
66
  const o = e.handle?.getTotalPages() ?? 0;
67
67
  e.handle?.jumpToPage(o - 1);
@@ -70,13 +70,13 @@ const pe = {
70
70
  const o = e.handle?.getCurrentPageIndex() ?? 0, a = e.handle?.getTotalPages() ?? 0;
71
71
  return o !== a - 1;
72
72
  }
73
- }, ke = [{ key: "t" }], te = {
73
+ }, ve = [{ key: "t" }], te = {
74
74
  id: "goToToc",
75
75
  navKind: "jump",
76
76
  enName: "Table of Contents",
77
77
  enDescription: "Jump to the table of contents",
78
78
  nameKey: "command.jumpToToc",
79
- hotkeys: ke,
79
+ hotkeys: ve,
80
80
  execute: (e) => {
81
81
  const o = e.handle?.getTocPageIndex?.() ?? re();
82
82
  e.handle?.jumpToPage(o);
@@ -85,17 +85,17 @@ const pe = {
85
85
  const o = e.handle?.getTocPageIndex?.() ?? re();
86
86
  return e.handle?.getCurrentPageIndex() !== o;
87
87
  }
88
- }, ve = [{ key: "d", modifiers: { ctrl: !0, alt: !0 } }], Pe = {
88
+ }, Pe = [{ key: "d", modifiers: { ctrl: !0, alt: !0 } }], Te = {
89
89
  id: "toggleDebug",
90
90
  enName: "Toggle Debug Toolbar",
91
91
  enDescription: "Show or hide the debug toolbar (Ctrl+Alt+D)",
92
92
  nameKey: "command.toggleDebug",
93
93
  descriptionKey: "command.toggleDebugDesc",
94
- hotkeys: ve,
94
+ hotkeys: Pe,
95
95
  execute: (e) => {
96
96
  e.handle?.toggleDebugBar?.();
97
97
  }
98
- }, ye = [{ key: "F11" }], Te = {
98
+ }, ye = [{ key: "F11" }], Ce = {
99
99
  id: "toggleFullscreen",
100
100
  enName: "Toggle Fullscreen",
101
101
  enDescription: "Enter or exit fullscreen mode",
@@ -106,80 +106,80 @@ const pe = {
106
106
  const o = e.data;
107
107
  document.fullscreenElement ? document.exitFullscreen().catch(console.warn) : (o?.getFullscreenTarget?.() ?? document.documentElement).requestFullscreen().catch(console.warn);
108
108
  }
109
- }, Ce = [
109
+ }, Ie = [
110
110
  Y,
111
111
  Z,
112
112
  ee,
113
113
  oe,
114
114
  te,
115
+ Ce,
115
116
  Te,
116
- Pe,
117
- pe
117
+ fe
118
118
  ];
119
- function Ie(e, o) {
119
+ function De(e, o) {
120
120
  return o !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
121
121
  }
122
- function De(e, o, a) {
123
- if (Ie(o.key, a) !== e.key) return !1;
122
+ function Ne(e, o, a) {
123
+ if (De(o.key, a) !== e.key) return !1;
124
124
  const n = e.modifiers ?? {};
125
125
  return !(!!n.ctrl !== o.ctrlKey || !!n.shift !== o.shiftKey || !!n.alt !== o.altKey || !!n.meta !== o.metaKey);
126
126
  }
127
- const se = ce(null), Ne = ({
127
+ const de = ce(null), Le = ({
128
128
  flipBookRef: e,
129
129
  currentPage: o,
130
130
  totalPages: a,
131
131
  direction: n = "ltr",
132
- commands: l = [],
133
- commandOptions: i = {},
132
+ commands: r = [],
133
+ commandOptions: c = {},
134
134
  disableHotkeys: s = !1,
135
- children: c
135
+ children: i
136
136
  }) => {
137
137
  const h = Q(() => {
138
138
  const d = {};
139
- for (const u of Ce)
139
+ for (const u of Ie)
140
140
  d[u.id] = {
141
141
  command: u,
142
- options: i[u.id] ?? {}
142
+ options: c[u.id] ?? {}
143
143
  };
144
- for (const u of l)
144
+ for (const u of r)
145
145
  d[u.id] = {
146
146
  command: u,
147
- options: i[u.id] ?? {}
147
+ options: c[u.id] ?? {}
148
148
  };
149
149
  return d;
150
- }, [l, i]), f = k(
150
+ }, [r, c]), f = v(
151
151
  (d, u) => {
152
- const b = h[d.id]?.options ?? {}, L = u ? { ...b.data, ...u } : b.data;
152
+ const b = h[d.id]?.options ?? {}, F = u ? { ...b.data, ...u } : b.data;
153
153
  return {
154
154
  handle: e.current,
155
- data: L
155
+ data: F
156
156
  };
157
157
  },
158
158
  [e, h]
159
- ), m = k(
159
+ ), m = v(
160
160
  (d, u) => {
161
161
  const b = f(d, u);
162
162
  d.canExecute && !d.canExecute(b) || d.execute(b);
163
163
  },
164
164
  [f]
165
- ), y = k(
165
+ ), y = v(
166
166
  (d) => {
167
167
  const u = f(d);
168
168
  return d.canExecute ? d.canExecute(u) : !0;
169
169
  },
170
170
  [f]
171
- ), I = k(
171
+ ), D = v(
172
172
  () => Object.values(h).map((d) => d.command),
173
173
  [h]
174
- ), v = k(
174
+ ), P = v(
175
175
  (d) => {
176
176
  const u = d.target;
177
177
  if (!(u.tagName === "INPUT" || u.tagName === "TEXTAREA" || u.isContentEditable))
178
178
  for (const b of Object.values(h)) {
179
179
  if (b.options.disableHotkeys) continue;
180
- const L = b.options.hotkeys ?? b.command.hotkeys ?? [];
181
- for (const $ of L)
182
- if (De($, d, n)) {
180
+ const F = b.options.hotkeys ?? b.command.hotkeys ?? [];
181
+ for (const M of F)
182
+ if (Ne(M, d, n)) {
183
183
  d.preventDefault(), m(b.command);
184
184
  return;
185
185
  }
@@ -187,25 +187,25 @@ const se = ce(null), Ne = ({
187
187
  },
188
188
  [h, m, n]
189
189
  );
190
- A(() => {
190
+ z(() => {
191
191
  if (!s)
192
- return document.addEventListener("keydown", v), () => document.removeEventListener("keydown", v);
193
- }, [s, v]);
194
- const T = Q(
192
+ return document.addEventListener("keydown", P), () => document.removeEventListener("keydown", P);
193
+ }, [s, P]);
194
+ const C = Q(
195
195
  () => ({
196
196
  execute: m,
197
197
  canExecute: y,
198
- getAllCommands: I
198
+ getAllCommands: D
199
199
  }),
200
- [m, y, I]
200
+ [m, y, D]
201
201
  );
202
- return /* @__PURE__ */ t(se.Provider, { value: T, children: c });
202
+ return /* @__PURE__ */ t(de.Provider, { value: C, children: i });
203
203
  }, _ = () => {
204
- const e = ie(se);
204
+ const e = ie(de);
205
205
  if (!e)
206
206
  throw new Error("useCommands must be used within a CommandProvider");
207
207
  return e;
208
- }, S = { size: 24 }, Le = ({ size: e = S.size, className: o }) => /* @__PURE__ */ t(
208
+ }, S = { size: 24 }, Fe = ({ size: e = S.size, className: o }) => /* @__PURE__ */ t(
209
209
  "svg",
210
210
  {
211
211
  xmlns: "http://www.w3.org/2000/svg",
@@ -237,7 +237,7 @@ const se = ce(null), Ne = ({
237
237
  "aria-hidden": "true",
238
238
  children: /* @__PURE__ */ t("path", { d: "m9 18 6-6-6-6" })
239
239
  }
240
- ), Fe = ({ size: e = S.size, className: o }) => /* @__PURE__ */ C(
240
+ ), je = ({ size: e = S.size, className: o }) => /* @__PURE__ */ T(
241
241
  "svg",
242
242
  {
243
243
  xmlns: "http://www.w3.org/2000/svg",
@@ -256,7 +256,7 @@ const se = ce(null), Ne = ({
256
256
  /* @__PURE__ */ t("path", { d: "M7 6v12" })
257
257
  ]
258
258
  }
259
- ), je = ({ size: e = S.size, className: o }) => /* @__PURE__ */ C(
259
+ ), Me = ({ size: e = S.size, className: o }) => /* @__PURE__ */ T(
260
260
  "svg",
261
261
  {
262
262
  xmlns: "http://www.w3.org/2000/svg",
@@ -275,7 +275,7 @@ const se = ce(null), Ne = ({
275
275
  /* @__PURE__ */ t("path", { d: "M17 6v12" })
276
276
  ]
277
277
  }
278
- ), $e = ({ size: e = S.size, className: o }) => /* @__PURE__ */ C(
278
+ ), $e = ({ size: e = S.size, className: o }) => /* @__PURE__ */ T(
279
279
  "svg",
280
280
  {
281
281
  xmlns: "http://www.w3.org/2000/svg",
@@ -296,7 +296,7 @@ const se = ce(null), Ne = ({
296
296
  /* @__PURE__ */ t("path", { d: "M16 21h3a2 2 0 0 0 2-2v-3" })
297
297
  ]
298
298
  }
299
- ), Be = ({ size: e = S.size, className: o }) => /* @__PURE__ */ C(
299
+ ), Be = ({ size: e = S.size, className: o }) => /* @__PURE__ */ T(
300
300
  "svg",
301
301
  {
302
302
  xmlns: "http://www.w3.org/2000/svg",
@@ -320,7 +320,7 @@ const se = ce(null), Ne = ({
320
320
  ), Re = ({
321
321
  size: e = S.size,
322
322
  className: o
323
- }) => /* @__PURE__ */ C(
323
+ }) => /* @__PURE__ */ T(
324
324
  "svg",
325
325
  {
326
326
  xmlns: "http://www.w3.org/2000/svg",
@@ -343,7 +343,7 @@ const se = ce(null), Ne = ({
343
343
  /* @__PURE__ */ t("path", { d: "M21 19h.01" })
344
344
  ]
345
345
  }
346
- ), qe = ({ size: e = S.size, className: o }) => /* @__PURE__ */ C(
346
+ ), Ve = ({ size: e = S.size, className: o }) => /* @__PURE__ */ T(
347
347
  "svg",
348
348
  {
349
349
  xmlns: "http://www.w3.org/2000/svg",
@@ -365,7 +365,7 @@ const se = ce(null), Ne = ({
365
365
  /* @__PURE__ */ t("rect", { x: "16", y: "6", width: "4", height: "15", rx: "0.5" })
366
366
  ]
367
367
  }
368
- ), Me = ({ size: e = S.size, className: o }) => /* @__PURE__ */ C(
368
+ ), Se = ({ size: e = S.size, className: o }) => /* @__PURE__ */ T(
369
369
  "svg",
370
370
  {
371
371
  xmlns: "http://www.w3.org/2000/svg",
@@ -388,37 +388,39 @@ const se = ce(null), Ne = ({
388
388
  ), U = ({
389
389
  onClick: e,
390
390
  ariaLabel: o,
391
- disabled: a = !1,
392
- children: n,
393
- className: l = "",
394
- title: i
391
+ ariaPressed: a,
392
+ disabled: n = !1,
393
+ children: r,
394
+ className: c = "",
395
+ title: s
395
396
  }) => /* @__PURE__ */ t(
396
397
  "button",
397
398
  {
398
399
  type: "button",
399
400
  onClick: e,
400
401
  "aria-label": o,
401
- disabled: a,
402
- title: i ?? o,
403
- className: `flipbook-toolbar-button ${l}`.trim(),
404
- children: n
402
+ "aria-pressed": a,
403
+ disabled: n,
404
+ title: s ?? o,
405
+ className: `flipbook-toolbar-button ${c}`.trim(),
406
+ children: r
405
407
  }
406
- ), Ve = ({
408
+ ), Ge = ({
407
409
  onClick: e,
408
410
  ariaLabel: o,
409
411
  children: a,
410
412
  disabled: n = !1,
411
- className: l
413
+ className: r
412
414
  }) => /* @__PURE__ */ t(
413
415
  U,
414
416
  {
415
417
  onClick: e,
416
418
  ariaLabel: o,
417
419
  disabled: n,
418
- className: `flipbook-toolbar-action ${l ?? ""}`.trim(),
420
+ className: `flipbook-toolbar-action ${r ?? ""}`.trim(),
419
421
  children: a
420
422
  }
421
- ), Se = {
423
+ ), Ke = {
422
424
  align: "left",
423
425
  direction: "ltr",
424
426
  translations: {
@@ -437,9 +439,11 @@ const se = ce(null), Ne = ({
437
439
  "command.toggleFullscreenDesc": "Enter or exit fullscreen mode",
438
440
  "command.toggleDebug": "Toggle debug toolbar",
439
441
  "command.toggleDebugDesc": "Show or hide the debug toolbar (Ctrl+Alt+D)",
440
- "toolbarItem.goToPage": "Go to page"
442
+ "toolbarItem.goToPage": "Go to page",
443
+ "toolbarItem.selectText": "Select text with mouse",
444
+ "toolbarItem.selectionLetters": "Aa"
441
445
  }
442
- }, Ke = {
446
+ }, Ae = {
443
447
  align: "right",
444
448
  direction: "rtl",
445
449
  translations: {
@@ -458,12 +462,14 @@ const se = ce(null), Ne = ({
458
462
  "command.toggleFullscreenDesc": "כניסה או יציאה ממסך מלא",
459
463
  "command.toggleDebug": "סרגל כלים לדיבוג",
460
464
  "command.toggleDebugDesc": "הצג או הסתר סרגל הדיבוג (Ctrl+Alt+D)",
461
- "toolbarItem.goToPage": "מעבר לעמוד"
465
+ "toolbarItem.goToPage": "מעבר לעמוד",
466
+ "toolbarItem.selectText": "בחירת טקסט עם העכבר",
467
+ "toolbarItem.selectionLetters": "אב"
462
468
  }
463
469
  }, ne = {
464
- "en-US": Se,
465
- "he-IL": Ke
466
- }, ae = "en-US", Ae = {
470
+ "en-US": Ke,
471
+ "he-IL": Ae
472
+ }, ae = "en-US", Oe = {
467
473
  "toolbarItem.download": "Download",
468
474
  "toolbarItem.downloadPageRange": "Download page range…",
469
475
  "toolbarItem.download.from": "From",
@@ -481,35 +487,38 @@ const se = ce(null), Ne = ({
481
487
  "command.toggleDebugDesc": "Show or hide the debug toolbar (Ctrl+Alt+D)",
482
488
  "toolbarItem.goToPage": "Go to page"
483
489
  };
484
- function de(e) {
490
+ function ue(e) {
485
491
  return ne[e] ?? ne[ae];
486
492
  }
487
- function ue(e) {
488
- return de(e).direction === "rtl";
493
+ function me(e) {
494
+ return ue(e).direction === "rtl";
489
495
  }
490
- function Oe(e) {
491
- return ue(e) ? "rtl" : "ltr";
496
+ function ze(e) {
497
+ return me(e) ? "rtl" : "ltr";
492
498
  }
493
- function j(e, o) {
494
- const a = de(o).translations[e];
499
+ function L(e, o) {
500
+ const a = ue(o).translations[e];
495
501
  if (a !== void 0 && a !== "") return a;
496
502
  const n = ne[ae].translations[e];
497
- return n !== void 0 && n !== "" ? n : Ae[e] ?? e;
503
+ return n !== void 0 && n !== "" ? n : Oe[e] ?? e;
498
504
  }
499
- const me = ce(null);
500
- function O() {
501
- const e = ie(me);
505
+ const ge = ce(null);
506
+ function K() {
507
+ const e = ie(ge);
502
508
  if (!e)
503
509
  throw new Error("Toolbar components must be used within a Toolbar");
504
510
  return e;
505
511
  }
506
- function le(e, o) {
512
+ function le(e) {
513
+ return e.replace(/[׳'״"]/g, "");
514
+ }
515
+ function se(e, o) {
507
516
  try {
508
517
  const a = atob(e.data), n = new Uint8Array(a.length);
509
- for (let c = 0; c < a.length; c++)
510
- n[c] = a.charCodeAt(c);
511
- const l = new Blob([n]), i = URL.createObjectURL(l), s = document.createElement("a");
512
- s.href = i, s.download = `${o}.${e.ext}`, s.click(), URL.revokeObjectURL(i);
518
+ for (let i = 0; i < a.length; i++)
519
+ n[i] = a.charCodeAt(i);
520
+ const r = new Blob([n]), c = URL.createObjectURL(r), s = document.createElement("a");
521
+ s.href = c, s.download = `${o}.${e.ext}`, s.click(), URL.revokeObjectURL(c);
513
522
  } catch (a) {
514
523
  console.error("Download failed:", a);
515
524
  }
@@ -517,134 +526,136 @@ function le(e, o) {
517
526
  function Ue(e, o) {
518
527
  const a = [];
519
528
  for (let n = 0; n < e; n++) {
520
- const l = o?.indexToSemanticName(n) ?? "", i = o?.indexToTitle(n) ?? "";
521
- if (!l && !i) {
529
+ const r = o?.indexToSemanticName(n) ?? "", c = o?.indexToTitle(n) ?? "";
530
+ if (!r && !c) {
522
531
  o || a.push({ pageIndex: n, semanticName: String(n + 1), title: `Page ${n + 1}` });
523
532
  continue;
524
533
  }
525
534
  a.push({
526
535
  pageIndex: n,
527
- semanticName: l || String(n + 1),
528
- title: i || l
536
+ semanticName: r || String(n + 1),
537
+ title: c || r
529
538
  });
530
539
  }
531
540
  return a;
532
541
  }
533
- const Ge = ({
542
+ const Je = ({
534
543
  ariaLabel: e = "Download",
535
544
  className: o
536
545
  }) => {
537
546
  const {
538
547
  totalPages: a,
539
548
  pageSemantics: n,
540
- locale: l,
541
- openDownloadMenuRef: i,
549
+ locale: r,
550
+ openDownloadMenuRef: c,
542
551
  downloadExecutorRef: s,
543
- flipBookRef: c
544
- } = O(), h = c.current?.getDownloadConfig?.() ?? void 0, [f, m] = N(!1);
545
- A(() => (i.current = () => m(!0), () => {
546
- i.current = null;
547
- }), [i]);
548
- const [y, I] = N("entire"), [v, T] = N(0), [d, u] = N(0), [b, L] = N(null), [$, z] = N(!1), M = V(null), K = V(null), F = Q(
552
+ flipBookRef: i
553
+ } = K(), h = i.current?.getDownloadConfig?.() ?? void 0, [f, m] = I(!1);
554
+ z(() => (c.current = () => m(!0), () => {
555
+ c.current = null;
556
+ }), [c]);
557
+ const [y, D] = I("entire"), [P, C] = I(0), [d, u] = I(0), [b, F] = I(null), [M, q] = I(!1), B = J(null), A = J(null), j = Q(
549
558
  () => Ue(a, n),
550
559
  [a, n]
551
- ), B = !!h?.onDownloadSefer, R = !!h?.onDownloadPageRange, H = B || R, W = F[0]?.pageIndex ?? 0, P = F[F.length - 1]?.pageIndex ?? 0;
552
- A(() => {
553
- f && (I(B ? "entire" : "range"), T(W), u(P));
554
- }, [f, B, W, P]);
555
- const D = k(() => {
560
+ ), $ = !!h?.onDownloadSefer, R = !!h?.onDownloadPageRange, V = $ || R, O = j[0]?.pageIndex ?? 0, H = j[j.length - 1]?.pageIndex ?? 0;
561
+ z(() => {
562
+ f && (D($ ? "entire" : "range"), C(O), u(H));
563
+ }, [f, $, O, H]);
564
+ const N = v(() => {
556
565
  m(!1);
557
566
  }, []);
558
- ge(() => {
559
- if (!f || !K.current || !M.current) return;
560
- const r = K.current, w = M.current.querySelector(".flipbook-toolbar-download-trigger"), E = () => {
567
+ he(() => {
568
+ if (!f || !A.current || !B.current) return;
569
+ const l = A.current, w = B.current.querySelector(".flipbook-toolbar-download-trigger"), E = () => {
561
570
  const p = w?.getBoundingClientRect();
562
571
  if (!p) return;
563
- const x = r.getBoundingClientRect().height, q = window.innerHeight - p.bottom;
564
- z(q < x + 8);
572
+ const k = l.getBoundingClientRect().height, G = window.innerHeight - p.bottom;
573
+ q(G < k + 8);
565
574
  };
566
575
  E();
567
576
  const g = new ResizeObserver(E);
568
- return g.observe(r), () => g.disconnect();
569
- }, [f]), A(() => {
577
+ return g.observe(l), () => g.disconnect();
578
+ }, [f]), z(() => {
570
579
  if (!f) return;
571
- const r = (w) => {
572
- M.current && !M.current.contains(w.target) && D();
580
+ const l = (w) => {
581
+ B.current && !B.current.contains(w.target) && N();
573
582
  };
574
- return document.addEventListener("mousedown", r), () => document.removeEventListener("mousedown", r);
575
- }, [f, D]);
576
- const G = k(async () => {
577
- const r = c.current?.getDownloadConfig?.();
578
- if (r?.onDownloadSefer) {
579
- L("sefer");
583
+ return document.addEventListener("mousedown", l), () => document.removeEventListener("mousedown", l);
584
+ }, [f, N]);
585
+ const x = v(async () => {
586
+ const l = i.current?.getDownloadConfig?.();
587
+ if (l?.onDownloadSefer) {
588
+ F("sefer");
580
589
  try {
581
- const w = await r.onDownloadSefer();
582
- w && le(w, r.entireBookFilename ?? "book"), D();
590
+ const w = await l.onDownloadSefer();
591
+ w && se(w, l.entireBookFilename ?? "book"), N();
583
592
  } finally {
584
- L(null);
593
+ F(null);
585
594
  }
586
595
  }
587
- }, [c, D]), J = k(
588
- async (r, w) => {
589
- const E = c.current?.getDownloadConfig?.();
596
+ }, [i, N]), W = v(
597
+ async (l, w) => {
598
+ const E = i.current?.getDownloadConfig?.();
590
599
  if (!E?.onDownloadPageRange) return;
591
600
  const g = [], p = [];
592
- for (let x = r; x <= w; x++) {
593
- g.push(x);
594
- const q = F.find((X) => X.pageIndex === x);
595
- q && p.push(q);
601
+ for (let k = l; k <= w; k++) {
602
+ g.push(k);
603
+ const G = j.find((X) => X.pageIndex === k);
604
+ G && p.push(G);
596
605
  }
597
- L("range");
606
+ F("range");
598
607
  try {
599
- const x = await E.onDownloadPageRange(
608
+ const k = await E.onDownloadPageRange(
600
609
  g,
601
610
  p,
602
611
  E.downloadContext
603
612
  );
604
- if (x) {
605
- const q = p[0]?.semanticName ?? String(r), X = p[p.length - 1]?.semanticName ?? String(w);
606
- le(x, `${E.rangeFilename ?? "pages"}-${q}-${X}`);
613
+ if (k) {
614
+ const G = le(p[0]?.semanticName ?? String(l)), X = le(
615
+ p[p.length - 1]?.semanticName ?? String(w)
616
+ );
617
+ se(k, `${E.rangeFilename ?? "pages"}-${G}-${X}`);
607
618
  }
608
- D();
619
+ N();
609
620
  } finally {
610
- L(null);
621
+ F(null);
611
622
  }
612
623
  },
613
- [c, F, D]
624
+ [i, j, N]
614
625
  );
615
- return A(() => (s.current = (r, w) => {
616
- r === void 0 && w === void 0 ? G() : r !== void 0 && w !== void 0 && J(r, w);
626
+ return z(() => (s.current = (l, w) => {
627
+ l === void 0 && w === void 0 ? x() : l !== void 0 && w !== void 0 && W(l, w);
617
628
  }, () => {
618
629
  s.current = null;
619
- }), [s, G, J]), H ? /* @__PURE__ */ C("div", { className: `flipbook-toolbar-download-wrap ${o ?? ""}`.trim(), ref: M, children: [
630
+ }), [s, x, W]), V ? /* @__PURE__ */ T("div", { className: `flipbook-toolbar-download-wrap ${o ?? ""}`.trim(), ref: B, children: [
620
631
  /* @__PURE__ */ t(
621
632
  "button",
622
633
  {
623
634
  type: "button",
624
635
  className: "flipbook-toolbar-button flipbook-toolbar-download-trigger",
625
- onClick: () => m((r) => !r),
626
- "aria-label": e ?? j("toolbarItem.download", l),
636
+ onClick: () => m((l) => !l),
637
+ "aria-label": e ?? L("toolbarItem.download", r),
627
638
  "aria-expanded": f,
628
639
  "aria-haspopup": "true",
629
640
  disabled: b !== null,
630
- children: /* @__PURE__ */ t(Me, { size: 18 })
641
+ children: /* @__PURE__ */ t(Se, { size: 18 })
631
642
  }
632
643
  ),
633
- f && /* @__PURE__ */ C(
644
+ f && /* @__PURE__ */ T(
634
645
  "div",
635
646
  {
636
- ref: K,
637
- className: `flipbook-toolbar-download-menu ${$ ? "flipbook-toolbar-download-menu--open-up" : ""}`.trim(),
647
+ ref: A,
648
+ className: `flipbook-toolbar-download-menu ${M ? "flipbook-toolbar-download-menu--open-up" : ""}`.trim(),
638
649
  role: "menu",
639
- dir: ue(l) ? "rtl" : "ltr",
650
+ dir: me(r) ? "rtl" : "ltr",
640
651
  children: [
641
- /* @__PURE__ */ C(
652
+ /* @__PURE__ */ T(
642
653
  "fieldset",
643
654
  {
644
655
  className: "flipbook-toolbar-download-mode",
645
- "aria-label": j("toolbarItem.download", l),
656
+ "aria-label": L("toolbarItem.download", r),
646
657
  children: [
647
- B && /* @__PURE__ */ C("label", { className: "flipbook-toolbar-download-radio-label", children: [
658
+ $ && /* @__PURE__ */ T("label", { className: "flipbook-toolbar-download-radio-label", children: [
648
659
  /* @__PURE__ */ t(
649
660
  "input",
650
661
  {
@@ -652,12 +663,12 @@ const Ge = ({
652
663
  name: "download-mode",
653
664
  className: "flipbook-toolbar-download-radio",
654
665
  checked: y === "entire",
655
- onChange: () => I("entire")
666
+ onChange: () => D("entire")
656
667
  }
657
668
  ),
658
- /* @__PURE__ */ t("span", { children: j("command.downloadEntireBook", l) })
669
+ /* @__PURE__ */ t("span", { children: L("command.downloadEntireBook", r) })
659
670
  ] }),
660
- R && /* @__PURE__ */ C("label", { className: "flipbook-toolbar-download-radio-label", children: [
671
+ R && /* @__PURE__ */ T("label", { className: "flipbook-toolbar-download-radio-label", children: [
661
672
  /* @__PURE__ */ t(
662
673
  "input",
663
674
  {
@@ -665,36 +676,36 @@ const Ge = ({
665
676
  name: "download-mode",
666
677
  className: "flipbook-toolbar-download-radio",
667
678
  checked: y === "range",
668
- onChange: () => I("range")
679
+ onChange: () => D("range")
669
680
  }
670
681
  ),
671
- /* @__PURE__ */ t("span", { children: j("toolbarItem.downloadPageRange", l) })
682
+ /* @__PURE__ */ t("span", { children: L("toolbarItem.downloadPageRange", r) })
672
683
  ] })
673
684
  ]
674
685
  }
675
686
  ),
676
- y === "range" && /* @__PURE__ */ C("div", { className: "flipbook-toolbar-download-range", children: [
677
- /* @__PURE__ */ C("label", { className: "flipbook-toolbar-download-range-label", children: [
678
- j("toolbarItem.download.from", l),
687
+ y === "range" && /* @__PURE__ */ T("div", { className: "flipbook-toolbar-download-range", children: [
688
+ /* @__PURE__ */ T("label", { className: "flipbook-toolbar-download-range-label", children: [
689
+ L("toolbarItem.download.from", r),
679
690
  /* @__PURE__ */ t(
680
691
  "select",
681
692
  {
682
- value: v,
683
- onChange: (r) => T(Number(r.target.value)),
693
+ value: P,
694
+ onChange: (l) => C(Number(l.target.value)),
684
695
  className: "flipbook-toolbar-download-range-select",
685
- children: F.map((r) => /* @__PURE__ */ t("option", { value: r.pageIndex, children: r.semanticName || r.title || `Page ${r.pageIndex + 1}` }, r.pageIndex))
696
+ children: j.map((l) => /* @__PURE__ */ t("option", { value: l.pageIndex, children: l.semanticName || l.title || `Page ${l.pageIndex + 1}` }, l.pageIndex))
686
697
  }
687
698
  )
688
699
  ] }),
689
- /* @__PURE__ */ C("label", { className: "flipbook-toolbar-download-range-label", children: [
690
- j("toolbarItem.download.to", l),
700
+ /* @__PURE__ */ T("label", { className: "flipbook-toolbar-download-range-label", children: [
701
+ L("toolbarItem.download.to", r),
691
702
  /* @__PURE__ */ t(
692
703
  "select",
693
704
  {
694
705
  value: d,
695
- onChange: (r) => u(Number(r.target.value)),
706
+ onChange: (l) => u(Number(l.target.value)),
696
707
  className: "flipbook-toolbar-download-range-select",
697
- children: F.map((r) => /* @__PURE__ */ t("option", { value: r.pageIndex, children: r.semanticName || r.title || `Page ${r.pageIndex + 1}` }, r.pageIndex))
708
+ children: j.map((l) => /* @__PURE__ */ t("option", { value: l.pageIndex, children: l.semanticName || l.title || `Page ${l.pageIndex + 1}` }, l.pageIndex))
698
709
  }
699
710
  )
700
711
  ] })
@@ -707,198 +718,219 @@ const Ge = ({
707
718
  className: "flipbook-toolbar-download-menuitem flipbook-toolbar-download-primary",
708
719
  onClick: () => {
709
720
  if (y === "entire")
710
- G();
721
+ x();
711
722
  else {
712
- const r = c.current?.getTotalPages?.() ?? a, w = Math.min(v, d);
713
- let E = Math.max(v, d);
714
- if (r > 0 && E >= r && (E = r - 1), E < w) return;
715
- J(w, E);
723
+ const l = i.current?.getTotalPages?.() ?? a, w = Math.min(P, d);
724
+ let E = Math.max(P, d);
725
+ if (l > 0 && E >= l && (E = l - 1), E < w) return;
726
+ W(w, E);
716
727
  }
717
728
  },
718
729
  disabled: b !== null,
719
- children: b === "sefer" || b === "range" ? "…" : j("toolbarItem.download.download", l)
730
+ children: b === "sefer" || b === "range" ? "…" : L("toolbarItem.download.download", r)
720
731
  }
721
732
  )
722
733
  ]
723
734
  }
724
735
  )
725
736
  ] }) : null;
726
- }, Je = ({ children: e, className: o }) => {
727
- const { locale: a } = O(), { execute: n, canExecute: l } = _(), i = () => {
737
+ }, _e = ({ children: e, className: o }) => {
738
+ const { locale: a } = K(), { execute: n, canExecute: r } = _(), c = () => {
728
739
  n(ee);
729
- }, s = /* @__PURE__ */ t(Fe, { size: 18 }), c = j("command.jumpToFirstPage", a);
740
+ }, s = /* @__PURE__ */ t(je, { size: 18 }), i = L("command.jumpToFirstPage", a);
730
741
  return /* @__PURE__ */ t(
731
742
  U,
732
743
  {
733
- onClick: i,
734
- ariaLabel: c,
735
- title: c,
736
- disabled: !l(ee),
744
+ onClick: c,
745
+ ariaLabel: i,
746
+ title: i,
747
+ disabled: !r(ee),
737
748
  className: `flipbook-toolbar-first ${o ?? ""}`.trim(),
738
749
  children: e ?? s
739
750
  }
740
751
  );
741
- }, _e = ({
752
+ }, Xe = ({
742
753
  targetRef: e,
743
754
  enterIcon: o,
744
755
  exitIcon: a,
745
756
  ariaLabelEnter: n = "Enter fullscreen",
746
- ariaLabelExit: l = "Exit fullscreen",
747
- className: i
757
+ ariaLabelExit: r = "Exit fullscreen",
758
+ className: c
748
759
  }) => {
749
- const [s, c] = N(!1), h = O(), f = e ?? h.fullscreenTargetRef, m = k(() => {
750
- c(!!document.fullscreenElement);
760
+ const [s, i] = I(!1), h = K(), f = e ?? h.fullscreenTargetRef, m = v(() => {
761
+ i(!!document.fullscreenElement);
751
762
  }, []);
752
- A(() => (document.addEventListener("fullscreenchange", m), () => {
763
+ z(() => (document.addEventListener("fullscreenchange", m), () => {
753
764
  document.removeEventListener("fullscreenchange", m);
754
765
  }), [m]);
755
766
  const y = async () => {
756
767
  try {
757
768
  s ? await document.exitFullscreen() : await (f?.current ?? document.documentElement).requestFullscreen();
758
- } catch (T) {
759
- console.warn("Fullscreen request failed:", T);
769
+ } catch (C) {
770
+ console.warn("Fullscreen request failed:", C);
760
771
  }
761
- }, I = s ? l : n, v = s ? a ?? /* @__PURE__ */ t(Be, { size: 18 }) : o ?? /* @__PURE__ */ t($e, { size: 18 });
772
+ }, D = s ? r : n, P = s ? a ?? /* @__PURE__ */ t(Be, { size: 18 }) : o ?? /* @__PURE__ */ t($e, { size: 18 });
762
773
  return /* @__PURE__ */ t(
763
774
  U,
764
775
  {
765
776
  onClick: y,
766
- ariaLabel: I,
767
- className: `flipbook-toolbar-fullscreen ${s ? "flipbook-toolbar-fullscreen--active" : ""} ${i ?? ""}`.trim(),
768
- children: v
777
+ ariaLabel: D,
778
+ className: `flipbook-toolbar-fullscreen ${s ? "flipbook-toolbar-fullscreen--active" : ""} ${c ?? ""}`.trim(),
779
+ children: P
769
780
  }
770
781
  );
771
- }, Xe = ({ children: e, className: o }) => {
772
- const { locale: a } = O(), { execute: n, canExecute: l } = _(), i = () => {
782
+ }, Qe = ({ children: e, className: o }) => {
783
+ const { locale: a } = K(), { execute: n, canExecute: r } = _(), c = () => {
773
784
  n(oe);
774
- }, s = /* @__PURE__ */ t(je, { size: 18 }), c = j("command.jumpToLastPage", a);
785
+ }, s = /* @__PURE__ */ t(Me, { size: 18 }), i = L("command.jumpToLastPage", a);
775
786
  return /* @__PURE__ */ t(
776
787
  U,
777
788
  {
778
- onClick: i,
779
- ariaLabel: c,
780
- title: c,
781
- disabled: !l(oe),
789
+ onClick: c,
790
+ ariaLabel: i,
791
+ title: i,
792
+ disabled: !r(oe),
782
793
  className: `flipbook-toolbar-last ${o ?? ""}`.trim(),
783
794
  children: e ?? s
784
795
  }
785
796
  );
786
- }, Qe = ({ children: e, className: o }) => {
787
- const { locale: a } = O(), { execute: n, canExecute: l } = _(), i = () => {
797
+ }, Ye = ({
798
+ letters: e,
799
+ ariaLabel: o,
800
+ className: a
801
+ }) => {
802
+ const { flipBookRef: n, locale: r, mouseMode: c } = K(), s = o ?? L("toolbarItem.selectText", r);
803
+ return /* @__PURE__ */ t(
804
+ U,
805
+ {
806
+ onClick: () => {
807
+ n.current?.setMouseMode(c === "turn" ? "select" : "turn"), window.getSelection()?.removeAllRanges();
808
+ },
809
+ ariaLabel: s,
810
+ ariaPressed: c === "select",
811
+ className: `flipbook-toolbar-mouse-mode ${a ?? ""}`.trim(),
812
+ children: /* @__PURE__ */ T("span", { className: "flipbook-toolbar-mouse-mode-icon", "aria-hidden": "true", children: [
813
+ /* @__PURE__ */ t("span", { className: "flipbook-toolbar-mouse-mode-caret" }),
814
+ /* @__PURE__ */ t("span", { children: e ?? L("toolbarItem.selectionLetters", r) })
815
+ ] })
816
+ }
817
+ );
818
+ }, Ze = ({ children: e, className: o }) => {
819
+ const { locale: a } = K(), { execute: n, canExecute: r } = _(), c = () => {
788
820
  n(Y);
789
- }, s = j("command.jumpToNextPage", a), c = /* @__PURE__ */ t(Ee, { size: 20 });
821
+ }, s = L("command.jumpToNextPage", a), i = /* @__PURE__ */ t(Ee, { size: 20 });
790
822
  return /* @__PURE__ */ t(
791
823
  U,
792
824
  {
793
- onClick: i,
825
+ onClick: c,
794
826
  ariaLabel: s,
795
827
  title: s,
796
- disabled: !l(Y),
828
+ disabled: !r(Y),
797
829
  className: `flipbook-toolbar-next ${o ?? ""}`.trim(),
798
- children: e ?? c
830
+ children: e ?? i
799
831
  }
800
832
  );
801
- }, Ye = ({
833
+ }, eo = ({
802
834
  mode: e,
803
835
  showTotal: o = !0,
804
836
  placeholder: a = "—",
805
837
  editable: n,
806
- className: l,
807
- ariaLabel: i = "Go to page",
838
+ className: r,
839
+ ariaLabel: c = "Go to page",
808
840
  maxLength: s = 10
809
841
  }) => {
810
- const { flipBookRef: c, pageSemantics: h, direction: f, currentPage: m, totalPages: y, of: I } = O(), v = e ?? (h ? "semantic" : "index"), T = n ?? (v === "semantic" && !!h), [d, u] = N(""), [b, L] = N(!1), $ = V(!1), z = V(m), M = m, K = m + 1 < y ? m + 1 : null, F = k(
811
- (g) => v === "semantic" && h ? h.indexToSemanticName(g) || "" : String(g + 1),
812
- [v, h]
813
- ), B = F(M), R = K != null ? F(K) : "", H = k(() => String(I), [I]), W = k(() => {
814
- const g = B, p = R;
815
- let x;
816
- return !g && !p ? x = a : g ? p ? g === p ? x = g : x = `${g} - ${p}` : x = g : x = p, o ? `${x} / ${H()}` : x;
817
- }, [B, R, a, o, H]), P = f === "rtl" ? R || B : B || R, D = W();
818
- A(() => {
819
- const g = m !== z.current;
820
- z.current = m, g && ($.current = !1), !b && !$.current && u(D);
821
- }, [D, b, m]);
822
- const G = k(
842
+ const { flipBookRef: i, pageSemantics: h, direction: f, currentPage: m, totalPages: y, of: D } = K(), P = e ?? (h ? "semantic" : "index"), C = n ?? (P === "semantic" && !!h), [d, u] = I(""), [b, F] = I(!1), M = J(!1), q = J(m), B = m, A = m + 1 < y ? m + 1 : null, j = v(
843
+ (g) => P === "semantic" && h ? h.indexToSemanticName(g) || "" : String(g + 1),
844
+ [P, h]
845
+ ), $ = j(B), R = A != null ? j(A) : "", V = v(() => String(D), [D]), O = v(() => {
846
+ const g = $, p = R;
847
+ let k;
848
+ return !g && !p ? k = a : g ? p ? g === p ? k = g : k = `${g} - ${p}` : k = g : k = p, o ? `${k} / ${V()}` : k;
849
+ }, [$, R, a, o, V]), H = f === "rtl" ? R || $ : $ || R, N = O();
850
+ z(() => {
851
+ const g = m !== q.current;
852
+ q.current = m, g && (M.current = !1), !b && !M.current && u(N);
853
+ }, [N, b, m]);
854
+ const x = v(
823
855
  (g) => {
824
- if (T) {
825
- L(!0), u(P), $.current = !1;
856
+ if (C) {
857
+ F(!0), u(H), M.current = !1;
826
858
  const p = () => g.target.select();
827
859
  typeof requestAnimationFrame < "u" ? requestAnimationFrame(p) : p();
828
860
  }
829
861
  },
830
- [T, P]
831
- ), J = k(() => {
832
- L(!1), $.current || u(D);
833
- }, [D]), r = k(
862
+ [C, H]
863
+ ), W = v(() => {
864
+ F(!1), M.current || u(N);
865
+ }, [N]), l = v(
834
866
  (g) => {
835
867
  if (g.key === "Enter") {
836
868
  if (h && d.trim()) {
837
869
  const p = h.semanticNameToIndex(d.trim());
838
- p != null && p >= 0 && p < y && (c.current?.jumpToPage(p), $.current = !0);
870
+ p != null && p >= 0 && p < y && (i.current?.jumpToPage(p), M.current = !0);
839
871
  }
840
872
  g.currentTarget.blur();
841
873
  } else g.key === "Escape" && g.currentTarget.blur();
842
874
  },
843
- [d, h, y, c]
844
- ), w = k((g) => {
875
+ [d, h, y, i]
876
+ ), w = v((g) => {
845
877
  u(g.target.value);
846
878
  }, []);
847
- return T ? /* @__PURE__ */ t(
879
+ return C ? /* @__PURE__ */ t(
848
880
  "input",
849
881
  {
850
882
  type: "text",
851
- className: `flipbook-toolbar-indicator ${b ? "flipbook-toolbar-indicator--editing" : ""} ${l ?? ""}`.trim(),
883
+ className: `flipbook-toolbar-indicator ${b ? "flipbook-toolbar-indicator--editing" : ""} ${r ?? ""}`.trim(),
852
884
  value: d,
853
- onFocus: G,
854
- onBlur: J,
855
- onKeyDown: r,
885
+ onFocus: x,
886
+ onBlur: W,
887
+ onKeyDown: l,
856
888
  onChange: w,
857
- "aria-label": i,
889
+ "aria-label": c,
858
890
  "aria-live": "polite",
859
891
  "aria-atomic": "true",
860
892
  maxLength: s,
861
- readOnly: !T
893
+ readOnly: !C
862
894
  }
863
895
  ) : /* @__PURE__ */ t(
864
896
  "span",
865
897
  {
866
- className: `flipbook-toolbar-indicator ${l ?? ""}`.trim(),
898
+ className: `flipbook-toolbar-indicator ${r ?? ""}`.trim(),
867
899
  "aria-live": "polite",
868
900
  "aria-atomic": "true",
869
- children: D
901
+ children: N
870
902
  }
871
903
  );
872
- }, Ze = ({ children: e, className: o }) => {
873
- const { locale: a } = O(), { execute: n, canExecute: l } = _(), i = () => {
904
+ }, oo = ({ children: e, className: o }) => {
905
+ const { locale: a } = K(), { execute: n, canExecute: r } = _(), c = () => {
874
906
  n(Z);
875
- }, s = j("command.jumpToPrevPage", a), c = /* @__PURE__ */ t(Le, { size: 20 });
907
+ }, s = L("command.jumpToPrevPage", a), i = /* @__PURE__ */ t(Fe, { size: 20 });
876
908
  return /* @__PURE__ */ t(
877
909
  U,
878
910
  {
879
- onClick: i,
911
+ onClick: c,
880
912
  ariaLabel: s,
881
913
  title: s,
882
- disabled: !l(Z),
914
+ disabled: !r(Z),
883
915
  className: `flipbook-toolbar-prev ${o ?? ""}`.trim(),
884
- children: e ?? c
916
+ children: e ?? i
885
917
  }
886
918
  );
887
- }, eo = ({ children: e, ariaLabel: o, className: a }) => {
888
- const { locale: n } = O(), { execute: l, canExecute: i } = _(), s = o ?? j("command.jumpToToc", n), c = () => {
889
- l(te);
890
- }, h = !i(te);
919
+ }, to = ({ children: e, ariaLabel: o, className: a }) => {
920
+ const { locale: n } = K(), { execute: r, canExecute: c } = _(), s = o ?? L("command.jumpToToc", n), i = () => {
921
+ r(te);
922
+ }, h = !c(te);
891
923
  return /* @__PURE__ */ t(
892
924
  U,
893
925
  {
894
- onClick: c,
926
+ onClick: i,
895
927
  ariaLabel: s,
896
928
  disabled: h,
897
929
  className: `flipbook-toolbar-toc ${a ?? ""}`.trim(),
898
930
  children: e ?? /* @__PURE__ */ t(Re, { size: 18 })
899
931
  }
900
932
  );
901
- }, ze = {
933
+ }, He = {
902
934
  id: "openDownloadMenu",
903
935
  enName: "Open download menu",
904
936
  enDescription: "Open the download menu",
@@ -908,19 +940,19 @@ const Ge = ({
908
940
  e.data?.open?.();
909
941
  },
910
942
  canExecute: (e) => typeof e.data?.open == "function"
911
- }, oo = ({
943
+ }, no = ({
912
944
  flipBookRef: e,
913
945
  direction: o,
914
946
  locale: a,
915
947
  pageSemantics: n,
916
- className: l = "",
917
- children: i,
948
+ className: r = "",
949
+ children: c,
918
950
  enableHotkeys: s = !0,
919
- commands: c,
951
+ commands: i,
920
952
  commandOptions: h,
921
953
  fullscreenTargetRef: f
922
954
  }) => {
923
- const m = o ?? Oe(a ?? ae), y = a ?? (m === "rtl" ? "he-IL" : "en-US"), I = V(null), v = V(null), [T, d] = N(0), [u, b] = N(0), [L, $] = N(0), [z, M] = N(!0), [K, F] = N(!1), B = {
955
+ const m = o ?? ze(a ?? ae), y = a ?? (m === "rtl" ? "he-IL" : "en-US"), D = J(null), P = J(null), [C, d] = I(0), [u, b] = I(0), [F, M] = I(0), [q, B] = I(!0), [A, j] = I(!1), [$, R] = I("turn"), V = {
924
956
  ...f ? {
925
957
  toggleFullscreen: {
926
958
  data: {
@@ -929,98 +961,100 @@ const Ge = ({
929
961
  }
930
962
  } : {},
931
963
  openDownloadMenu: {
932
- data: { open: () => I.current?.() }
964
+ data: { open: () => D.current?.() }
933
965
  },
934
966
  download: {
935
967
  data: {
936
- onDownload: (P, D) => v.current?.(P, D)
968
+ onDownload: (x, W) => P.current?.(x, W)
937
969
  }
938
970
  },
939
971
  ...h
940
- }, R = k(() => {
941
- const P = e.current;
942
- P && (d(P.getCurrentPageIndex()), b(P.getTotalPages()), $(P.getOf()), M(P.isFirstPage()), F(P.isLastPage()));
972
+ }, O = v(() => {
973
+ const x = e.current;
974
+ x && (d(x.getCurrentPageIndex()), b(x.getTotalPages()), M(x.getOf()), B(x.isFirstPage()), j(x.isLastPage()), R(x.getMouseMode?.() ?? "turn"));
943
975
  }, [e]);
944
- A(() => {
945
- R();
946
- const P = setInterval(R, 200);
947
- return () => clearInterval(P);
948
- }, [R]);
976
+ z(() => {
977
+ O();
978
+ const x = setInterval(O, 200);
979
+ return () => clearInterval(x);
980
+ }, [O]);
949
981
  const H = /* @__PURE__ */ t(
950
- me.Provider,
982
+ ge.Provider,
951
983
  {
952
984
  value: {
953
985
  flipBookRef: e,
954
986
  direction: m,
955
987
  locale: y,
956
988
  pageSemantics: n,
957
- currentPage: T,
989
+ currentPage: C,
958
990
  totalPages: u,
959
- of: L,
960
- isFirstPage: z,
961
- isLastPage: K,
962
- openDownloadMenuRef: I,
963
- downloadExecutorRef: v,
991
+ of: F,
992
+ isFirstPage: q,
993
+ isLastPage: A,
994
+ mouseMode: $,
995
+ openDownloadMenuRef: D,
996
+ downloadExecutorRef: P,
964
997
  fullscreenTargetRef: f
965
998
  },
966
999
  children: /* @__PURE__ */ t(
967
1000
  "div",
968
1001
  {
969
- className: `flipbook-toolbar ${m === "rtl" ? "flipbook-toolbar--rtl" : ""} ${l}`.trim(),
1002
+ className: `flipbook-toolbar ${m === "rtl" ? "flipbook-toolbar--rtl" : ""} ${r}`.trim(),
970
1003
  role: "toolbar",
971
1004
  "aria-label": "FlipBook navigation",
972
1005
  dir: m,
973
- children: i
1006
+ children: c
974
1007
  }
975
1008
  )
976
1009
  }
977
- ), W = [ze, ...c ?? []];
1010
+ ), N = [He, ...i ?? []];
978
1011
  return /* @__PURE__ */ t(
979
- Ne,
1012
+ Le,
980
1013
  {
981
1014
  flipBookRef: e,
982
- currentPage: T,
1015
+ currentPage: C,
983
1016
  totalPages: u,
984
1017
  direction: m,
985
- commands: W,
986
- commandOptions: B,
1018
+ commands: N,
1019
+ commandOptions: V,
987
1020
  disableHotkeys: !s,
988
1021
  children: H
989
1022
  }
990
1023
  );
991
1024
  };
992
1025
  export {
993
- Ve as ActionButton,
994
- qe as BookshelfIcon,
995
- Fe as ChevronFirstIcon,
996
- je as ChevronLastIcon,
997
- Le as ChevronLeftIcon,
1026
+ Ge as ActionButton,
1027
+ Ve as BookshelfIcon,
1028
+ je as ChevronFirstIcon,
1029
+ Me as ChevronLastIcon,
1030
+ Fe as ChevronLeftIcon,
998
1031
  Ee as ChevronRightIcon,
999
- Ge as DownloadDropdown,
1000
- Me as DownloadIcon,
1001
- Je as FirstPageButton,
1002
- _e as FullscreenButton,
1003
- Xe as LastPageButton,
1032
+ Je as DownloadDropdown,
1033
+ Se as DownloadIcon,
1034
+ _e as FirstPageButton,
1035
+ Xe as FullscreenButton,
1036
+ Qe as LastPageButton,
1004
1037
  $e as MaximizeIcon,
1005
1038
  Be as MinimizeIcon,
1006
- Qe as NextButton,
1007
- Ye as PageIndicator,
1008
- Ze as PrevButton,
1009
- Ye as SemanticPageIndicator,
1039
+ Ye as MouseModeButton,
1040
+ Ze as NextButton,
1041
+ eo as PageIndicator,
1042
+ oo as PrevButton,
1043
+ eo as SemanticPageIndicator,
1010
1044
  Re as TableOfContentsIcon,
1011
- eo as TocButton,
1012
- oo as Toolbar,
1045
+ to as TocButton,
1046
+ no as Toolbar,
1013
1047
  U as ToolbarButton,
1014
- Ce as defaultCommands,
1015
- pe as downloadCommand,
1048
+ Ie as defaultCommands,
1049
+ fe as downloadCommand,
1016
1050
  Y as flipNextCommand,
1017
1051
  Z as flipPrevCommand,
1018
1052
  ee as goToFirstCommand,
1019
1053
  oe as goToLastCommand,
1020
1054
  te as goToTocCommand,
1021
- Pe as toggleDebugCommand,
1022
- Te as toggleFullscreenCommand,
1055
+ Te as toggleDebugCommand,
1056
+ Ce as toggleFullscreenCommand,
1023
1057
  _ as useCommands,
1024
- O as useToolbar
1058
+ K as useToolbar
1025
1059
  };
1026
1060
  //# sourceMappingURL=index.js.map