html-flip-book-react 0.0.0-alpha.72 → 0.0.0-alpha.73

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 a, jsxs as L } from "react/jsx-runtime";
2
- import { createContext as Ce, useContext as Te, useRef as Q, useReducer as je, useMemo as Ie, useCallback as I, useEffect as U, useState as D, useLayoutEffect as Be } from "react";
3
- let Se = 4;
4
- function we() {
5
- return Se;
1
+ import { jsx as a, jsxs as M } from "react/jsx-runtime";
2
+ import { createContext as Te, useContext as Ie, useRef as Q, useReducer as Be, useMemo as De, useCallback as T, useEffect as z, useState as I, useLayoutEffect as Se } from "react";
3
+ let $e = 4;
4
+ function xe() {
5
+ return $e;
6
6
  }
7
- const $e = {
7
+ const Ae = {
8
8
  id: "download",
9
9
  enName: "Download",
10
10
  enDescription: "Download entire book or page range",
@@ -17,51 +17,51 @@ const $e = {
17
17
  );
18
18
  },
19
19
  canExecute: (e) => typeof e.data?.onDownload == "function"
20
- }, Ae = [
20
+ }, Re = [
21
21
  { key: "ArrowRight" },
22
22
  { key: "PageDown" },
23
23
  { key: " " }
24
24
  // Space
25
- ], le = {
25
+ ], se = {
26
26
  id: "flipNext",
27
27
  navKind: "flip",
28
28
  enName: "Next Page",
29
29
  enDescription: "Flip to the next page",
30
30
  nameKey: "command.jumpToNextPage",
31
- hotkeys: Ae,
31
+ hotkeys: Re,
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
- }, Re = [{ key: "ArrowLeft" }, { key: "PageUp" }], se = {
36
+ }, Ke = [{ key: "ArrowLeft" }, { key: "PageUp" }], ie = {
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: Re,
42
+ hotkeys: Ke,
43
43
  execute: (e) => {
44
44
  e.handle?.flipPrev();
45
45
  },
46
46
  canExecute: (e) => (e.handle?.getCurrentPageIndex() ?? 0) > 0
47
- }, Ke = [{ key: "Home" }, { key: "ArrowLeft", modifiers: { ctrl: !0 } }], ie = {
47
+ }, He = [{ key: "Home" }, { key: "ArrowLeft", modifiers: { ctrl: !0 } }], ce = {
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: Ke,
53
+ hotkeys: He,
54
54
  execute: (e) => {
55
55
  e.handle?.jumpToPage(0);
56
56
  },
57
57
  canExecute: (e) => e.handle?.getCurrentPageIndex() !== 0
58
- }, He = [{ key: "End" }, { key: "ArrowRight", modifiers: { ctrl: !0 } }], ce = {
58
+ }, Oe = [{ key: "End" }, { key: "ArrowRight", modifiers: { ctrl: !0 } }], de = {
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: He,
64
+ hotkeys: Oe,
65
65
  execute: (e) => {
66
66
  const t = e.handle?.getTotalPages() ?? 0;
67
67
  e.handle?.jumpToPage(t - 1);
@@ -70,46 +70,46 @@ const $e = {
70
70
  const t = e.handle?.getCurrentPageIndex() ?? 0, o = e.handle?.getTotalPages() ?? 0;
71
71
  return t !== o - 1;
72
72
  }
73
- }, Oe = [{ key: "t" }], de = {
73
+ }, Ue = [{ key: "t" }], ue = {
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: Oe,
79
+ hotkeys: Ue,
80
80
  execute: (e) => {
81
- const t = e.handle?.getTocPageIndex?.() ?? we();
81
+ const t = e.handle?.getTocPageIndex?.() ?? xe();
82
82
  e.handle?.jumpToPage(t);
83
83
  },
84
84
  canExecute: (e) => {
85
- const t = e.handle?.getTocPageIndex?.() ?? we();
85
+ const t = e.handle?.getTocPageIndex?.() ?? xe();
86
86
  return e.handle?.getCurrentPageIndex() !== t;
87
87
  }
88
- }, Ue = [{ key: "d", modifiers: { ctrl: !0, alt: !0 } }], ze = {
88
+ }, ze = [{ key: "d", modifiers: { ctrl: !0, alt: !0 } }], qe = {
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: Ue,
94
+ hotkeys: ze,
95
95
  execute: (e) => {
96
96
  e.handle?.toggleDebugBar?.();
97
97
  }
98
- }, ee = () => document, xe = [
98
+ }, te = () => document, ke = [
99
99
  "fullscreenchange",
100
100
  "webkitfullscreenchange",
101
101
  "fullscreenerror",
102
102
  "webkitfullscreenerror"
103
103
  ];
104
- function ue() {
105
- return typeof document > "u" ? null : ee().fullscreenElement ?? ee().webkitFullscreenElement ?? null;
104
+ function me() {
105
+ return typeof document > "u" ? null : te().fullscreenElement ?? te().webkitFullscreenElement ?? null;
106
106
  }
107
- function me(e) {
107
+ function ge(e) {
108
108
  if (typeof document > "u") return !1;
109
- const t = e ?? ee().documentElement;
110
- return typeof (t.requestFullscreen ?? t.webkitRequestFullscreen) != "function" ? !1 : (ee().fullscreenEnabled ?? ee().webkitFullscreenEnabled) !== !1;
109
+ const t = e ?? te().documentElement;
110
+ return typeof (t.requestFullscreen ?? t.webkitRequestFullscreen) != "function" ? !1 : (te().fullscreenEnabled ?? te().webkitFullscreenEnabled) !== !1;
111
111
  }
112
- async function qe(e) {
112
+ async function We(e) {
113
113
  const t = e;
114
114
  if (t.requestFullscreen) {
115
115
  await t.requestFullscreen();
@@ -121,37 +121,37 @@ async function qe(e) {
121
121
  }
122
122
  throw new Error("Fullscreen API is not available");
123
123
  }
124
- async function We() {
125
- const e = ee();
124
+ async function Ve() {
125
+ const e = te();
126
126
  if (e.exitFullscreen) {
127
127
  await e.exitFullscreen();
128
128
  return;
129
129
  }
130
130
  e.webkitExitFullscreen && e.webkitExitFullscreen();
131
131
  }
132
- const Ve = [{ key: "F11" }], te = {
132
+ const Je = [{ key: "F11" }], oe = {
133
133
  id: "toggleFullscreen",
134
134
  kind: "toggle",
135
135
  enName: "Toggle Fullscreen",
136
136
  enDescription: "Enter or exit fullscreen mode",
137
137
  nameKey: "command.toggleFullscreen",
138
138
  descriptionKey: "command.toggleFullscreenDesc",
139
- hotkeys: Ve,
140
- canExecute: (e) => me(e.data?.getFullscreenTarget?.()),
141
- isActive: () => ue() !== null,
139
+ hotkeys: Je,
140
+ canExecute: (e) => ge(e.data?.getFullscreenTarget?.()),
141
+ isActive: () => me() !== null,
142
142
  setActive: (e, t) => {
143
- const o = ue();
143
+ const o = me();
144
144
  if (t) {
145
145
  if (o) return;
146
146
  const n = e.data?.getFullscreenTarget?.() ?? document.documentElement;
147
- if (!me(n)) return !1;
148
- qe(n).catch(console.warn);
147
+ if (!ge(n)) return !1;
148
+ We(n).catch(console.warn);
149
149
  return;
150
150
  }
151
- o && We().catch(console.warn);
151
+ o && Ve().catch(console.warn);
152
152
  },
153
- execute: (e) => te.setActive(e, !te.isActive(e))
154
- }, ne = {
153
+ execute: (e) => oe.setActive(e, !oe.isActive(e))
154
+ }, re = {
155
155
  id: "toggleTextSelection",
156
156
  kind: "toggle",
157
157
  enName: "Select Text",
@@ -165,32 +165,32 @@ const Ve = [{ key: "F11" }], te = {
165
165
  e.transient ? e.handle.setMouseMode(o, { persist: !1 }) : e.handle.setMouseMode(o);
166
166
  },
167
167
  execute: (e) => {
168
- const t = ne.setActive(
168
+ const t = re.setActive(
169
169
  e,
170
- !ne.isActive(e)
170
+ !re.isActive(e)
171
171
  );
172
172
  return t !== !1 && window.getSelection()?.removeAllRanges(), t;
173
173
  }
174
- }, Je = [
175
- le,
174
+ }, Ge = [
176
175
  se,
177
176
  ie,
178
177
  ce,
179
178
  de,
180
- te,
181
- ze,
182
- ne,
183
- $e
179
+ ue,
180
+ oe,
181
+ qe,
182
+ re,
183
+ Ae
184
184
  ];
185
- function De(e, t) {
185
+ function Ee(e, t) {
186
186
  return t !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
187
187
  }
188
- function Ge(e, t, o) {
189
- if (De(t.key, o) !== e.key) return !1;
188
+ function _e(e, t, o) {
189
+ if (Ee(t.key, o) !== e.key) return !1;
190
190
  const n = e.modifiers ?? {};
191
191
  return !(e.key !== "Control" && !!n.ctrl !== t.ctrlKey || e.key !== "Shift" && !!n.shift !== t.shiftKey || e.key !== "Alt" && !!n.alt !== t.altKey || e.key !== "Meta" && !!n.meta !== t.metaKey);
192
192
  }
193
- function _e(e, t) {
193
+ function Qe(e, t) {
194
194
  const o = e.modifiers ?? {};
195
195
  return [
196
196
  o.ctrl && !t.ctrlKey,
@@ -199,11 +199,11 @@ function _e(e, t) {
199
199
  o.meta && !t.metaKey
200
200
  ].some(Boolean);
201
201
  }
202
- function Qe(e, t, o) {
203
- const n = De(t.key, o);
204
- return n === e.key || n.length === 1 && n.toLowerCase() === e.key.toLowerCase() ? !0 : _e(e, t);
202
+ function Xe(e, t, o) {
203
+ const n = Ee(t.key, o);
204
+ return n === e.key || n.length === 1 && n.toLowerCase() === e.key.toLowerCase() ? !0 : Qe(e, t);
205
205
  }
206
- function Xe(e, t) {
206
+ function Ye(e, t) {
207
207
  const o = e.modifiers ?? {}, n = t.modifiers ?? {};
208
208
  return [
209
209
  !!o.ctrl == !!n.ctrl,
@@ -212,27 +212,27 @@ function Xe(e, t) {
212
212
  !!o.meta == !!n.meta
213
213
  ].every(Boolean);
214
214
  }
215
- function ke(e, t) {
216
- return e.key === t.key && e.mode === t.mode && (e.active ?? !0) === (t.active ?? !0) && Xe(e, t);
215
+ function ve(e, t) {
216
+ return e.key === t.key && e.mode === t.mode && (e.active ?? !0) === (t.active ?? !0) && Ye(e, t);
217
217
  }
218
- class Ye {
218
+ class Ze {
219
219
  held = /* @__PURE__ */ new Map();
220
220
  has(t) {
221
221
  return this.held.has(t);
222
222
  }
223
223
  press(t, o, n) {
224
224
  const r = this.held.get(t.id);
225
- if (r?.bindings.some((i) => ke(i, o))) return !1;
226
- const s = r ?? {
225
+ if (r?.bindings.some((i) => ve(i, o))) return !1;
226
+ const l = r ?? {
227
227
  command: t,
228
228
  context: { ...n, transient: !0 },
229
229
  initial: t.isActive(n),
230
230
  bindings: []
231
231
  };
232
- return t.setActive(s.context, o.active ?? !0) === !1 ? !1 : (s.bindings.push(o), this.held.set(t.id, s), !0);
232
+ return t.setActive(l.context, o.active ?? !0) === !1 ? !1 : (l.bindings.push(o), this.held.set(t.id, l), !0);
233
233
  }
234
234
  release(t, o) {
235
- return this.removeBindings((n) => Qe(n, t, o));
235
+ return this.removeBindings((n) => Xe(n, t, o));
236
236
  }
237
237
  /** Restore removed/disabled bindings without interrupting holds on ordinary rerenders. */
238
238
  reconcile(t, o) {
@@ -240,7 +240,7 @@ class Ye {
240
240
  }
241
241
  isRegistered(t, o, n) {
242
242
  const r = n[o.command.id];
243
- return !r || r.options.disableHotkeys || r.command !== o.command ? !1 : (r.options.hotkeys ?? r.command.hotkeys ?? []).some((s) => ke(s, t));
243
+ return !r || r.options.disableHotkeys || r.command !== o.command ? !1 : (r.options.hotkeys ?? r.command.hotkeys ?? []).some((l) => ve(l, t));
244
244
  }
245
245
  clear() {
246
246
  return this.removeBindings(() => !0);
@@ -248,144 +248,144 @@ class Ye {
248
248
  removeBindings(t) {
249
249
  let o = !1;
250
250
  for (const [n, r] of this.held) {
251
- const s = r.bindings.filter((c) => !t(c, r));
252
- if (s.length === r.bindings.length) continue;
253
- o = !0, r.bindings = s;
254
- const i = s.length ? s[s.length - 1].active ?? !0 : r.initial;
255
- r.command.setActive(r.context, i), s.length || this.held.delete(n);
251
+ const l = r.bindings.filter((d) => !t(d, r));
252
+ if (l.length === r.bindings.length) continue;
253
+ o = !0, r.bindings = l;
254
+ const i = l.length ? l[l.length - 1].active ?? !0 : r.initial;
255
+ r.command.setActive(r.context, i), l.length || this.held.delete(n);
256
256
  }
257
257
  return o;
258
258
  }
259
259
  }
260
- const Ee = Ce(null);
261
- function Ze(e) {
260
+ const Ne = Te(null);
261
+ function et(e) {
262
262
  return e instanceof HTMLElement ? !!(e.isContentEditable || e.closest('input, textarea, select, [contenteditable="true"], [contenteditable=""]')) : !1;
263
263
  }
264
- function et(e) {
264
+ function tt(e) {
265
265
  return e.options.disableHotkeys ? [] : e.options.hotkeys ?? e.command.hotkeys ?? [];
266
266
  }
267
- function tt(e, t, o) {
267
+ function ot(e, t, o) {
268
268
  return t.mode !== "hold" ? !0 : e.kind !== "toggle" ? !1 : !e.canExecute || e.canExecute(o(e));
269
269
  }
270
- function ot(e, t, o, n) {
270
+ function nt(e, t, o, n) {
271
271
  for (const r of Object.values(e)) {
272
- const s = et(r).find(
273
- (i) => Ge(i, t, o) && tt(r.command, i, n)
272
+ const l = tt(r).find(
273
+ (i) => _e(i, t, o) && ot(r.command, i, n)
274
274
  );
275
- if (s) return { command: r.command, binding: s };
275
+ if (l) return { command: r.command, binding: l };
276
276
  }
277
277
  }
278
- const nt = ({
278
+ const rt = ({
279
279
  flipBookRef: e,
280
280
  currentPage: t,
281
281
  totalPages: o,
282
282
  direction: n = "ltr",
283
283
  commands: r = [],
284
- commandOptions: s = {},
284
+ commandOptions: l = {},
285
285
  disableHotkeys: i = !1,
286
- children: c
286
+ children: d
287
287
  }) => {
288
- const g = Q(new Ye()).current, [, w] = je((d) => d + 1, 0), f = Ie(() => {
289
- const d = {};
290
- for (const m of Je)
291
- d[m.id] = {
292
- command: m,
293
- options: s[m.id] ?? {}
288
+ const u = Q(new Ze()).current, [, D] = Be((c) => c + 1, 0), m = De(() => {
289
+ const c = {};
290
+ for (const g of Ge)
291
+ c[g.id] = {
292
+ command: g,
293
+ options: l[g.id] ?? {}
294
294
  };
295
- for (const m of r)
296
- d[m.id] = {
297
- command: m,
298
- options: s[m.id] ?? {}
295
+ for (const g of r)
296
+ c[g.id] = {
297
+ command: g,
298
+ options: l[g.id] ?? {}
299
299
  };
300
- return d;
301
- }, [r, s]), p = I(
302
- (d, m) => {
303
- const y = f[d.id]?.options ?? {}, $ = m ? { ...y.data, ...m } : y.data;
300
+ return c;
301
+ }, [r, l]), p = T(
302
+ (c, g) => {
303
+ const L = m[c.id]?.options ?? {}, S = g ? { ...L.data, ...g } : L.data;
304
304
  return {
305
305
  handle: e.current,
306
- data: $
306
+ data: S
307
307
  };
308
308
  },
309
- [e, f]
310
- ), N = I(
311
- (d, m) => {
312
- if (g.has(d.id)) return;
313
- const y = p(d, m);
314
- d.canExecute && !d.canExecute(y) || (d.execute(y), w());
309
+ [e, m]
310
+ ), E = T(
311
+ (c, g) => {
312
+ if (u.has(c.id)) return;
313
+ const L = p(c, g);
314
+ c.canExecute && !c.canExecute(L) || (c.execute(L), D());
315
315
  },
316
- [p, g]
317
- ), E = I(
318
- (d) => {
319
- if (g.has(d.id)) return !1;
320
- const m = p(d);
321
- return d.canExecute ? d.canExecute(m) : !0;
316
+ [p, u]
317
+ ), N = T(
318
+ (c) => {
319
+ if (u.has(c.id)) return !1;
320
+ const g = p(c);
321
+ return c.canExecute ? c.canExecute(g) : !0;
322
322
  },
323
- [p, g]
324
- ), M = I(
325
- (d) => d.isActive(p(d)),
323
+ [p, u]
324
+ ), j = T(
325
+ (c) => c.isActive(p(c)),
326
326
  [p]
327
- ), j = I(
328
- () => Object.values(f).map((d) => d.command),
329
- [f]
330
- ), v = Q({ registry: f, execute: N, createCommandContext: p, direction: n, disableHotkeys: i });
331
- v.current = { registry: f, execute: N, createCommandContext: p, direction: n, disableHotkeys: i }, U(() => {
332
- g.reconcile(f, i) && w();
333
- }, [g, f, i]), U(() => {
334
- const d = (b, F, k) => {
335
- if (b.kind !== "toggle") return;
336
- const S = v.current.createCommandContext(b);
337
- !k.repeat && g.press(b, F, S) && w(), ["Control", "Shift", "Alt", "Meta"].includes(F.key) || k.preventDefault();
338
- }, m = (b) => {
339
- const { registry: F, execute: k, direction: S, disableHotkeys: K, createCommandContext: V } = v.current;
340
- if (K || b.defaultPrevented || Ze(b.target)) return;
341
- const P = ot(F, b, S, V);
342
- P && (P.binding.mode === "hold" ? d(P.command, P.binding, b) : (b.preventDefault(), k(P.command)));
343
- }, y = (b) => {
344
- g.release(b, v.current.direction) && w();
345
- }, $ = () => {
346
- g.clear() && w();
327
+ ), $ = T(
328
+ () => Object.values(m).map((c) => c.command),
329
+ [m]
330
+ ), x = Q({ registry: m, execute: E, createCommandContext: p, direction: n, disableHotkeys: i });
331
+ x.current = { registry: m, execute: E, createCommandContext: p, direction: n, disableHotkeys: i }, z(() => {
332
+ u.reconcile(m, i) && D();
333
+ }, [u, m, i]), z(() => {
334
+ const c = (k, v, B) => {
335
+ if (k.kind !== "toggle") return;
336
+ const F = x.current.createCommandContext(k);
337
+ !B.repeat && u.press(k, v, F) && D(), ["Control", "Shift", "Alt", "Meta"].includes(v.key) || B.preventDefault();
338
+ }, g = (k) => {
339
+ const { registry: v, execute: B, direction: F, disableHotkeys: R, createCommandContext: U } = x.current;
340
+ if (R || k.defaultPrevented || et(k.target)) return;
341
+ const P = nt(v, k, F, U);
342
+ P && (P.binding.mode === "hold" ? c(P.command, P.binding, k) : (k.preventDefault(), B(P.command)));
343
+ }, L = (k) => {
344
+ u.release(k, x.current.direction) && D();
345
+ }, S = () => {
346
+ u.clear() && D();
347
347
  }, O = () => {
348
- document.hidden && $();
348
+ document.hidden && S();
349
349
  };
350
- return document.addEventListener("keydown", m), document.addEventListener("keyup", y), window.addEventListener("blur", $), document.addEventListener("visibilitychange", O), () => {
351
- document.removeEventListener("keydown", m), document.removeEventListener("keyup", y), window.removeEventListener("blur", $), document.removeEventListener("visibilitychange", O), g.clear();
350
+ return document.addEventListener("keydown", g), document.addEventListener("keyup", L), window.addEventListener("blur", S), document.addEventListener("visibilitychange", O), () => {
351
+ document.removeEventListener("keydown", g), document.removeEventListener("keyup", L), window.removeEventListener("blur", S), document.removeEventListener("visibilitychange", O), u.clear();
352
352
  };
353
- }, [g]);
354
- const B = { execute: N, canExecute: E, isActive: M, getAllCommands: j };
355
- return /* @__PURE__ */ a(Ee.Provider, { value: B, children: c });
353
+ }, [u]);
354
+ const A = { execute: E, canExecute: N, isActive: j, getAllCommands: $ };
355
+ return /* @__PURE__ */ a(Ne.Provider, { value: A, children: d });
356
356
  }, X = () => {
357
- const e = Te(Ee);
357
+ const e = Ie(Ne);
358
358
  if (!e)
359
359
  throw new Error("useCommands must be used within a CommandProvider");
360
360
  return e;
361
361
  };
362
- function rt(e) {
362
+ function at(e) {
363
363
  let t = "";
364
364
  for (const o of new TextEncoder().encode(e))
365
365
  t += String.fromCharCode(o);
366
366
  return btoa(t);
367
367
  }
368
- function ve(e) {
369
- return { ext: "json", data: rt(JSON.stringify(e, null, " ")) };
368
+ function ye(e) {
369
+ return { ext: "json", data: at(JSON.stringify(e, null, " ")) };
370
370
  }
371
- function yt(e) {
371
+ function Pt(e) {
372
372
  const { pagesCount: t, pageSemantics: o } = e, n = (r) => {
373
- const s = o?.indexToSemanticName(r) ?? "", i = o?.indexToTitle(r) ?? "";
374
- return o ? { pageIndex: r, semanticName: s, title: i } : { pageIndex: r, semanticName: String(r + 1), title: `Page ${r + 1}` };
373
+ const l = o?.indexToSemanticName(r) ?? "", i = o?.indexToTitle(r) ?? "";
374
+ return o ? { pageIndex: r, semanticName: l, title: i } : { pageIndex: r, semanticName: String(r + 1), title: `Page ${r + 1}` };
375
375
  };
376
376
  return {
377
377
  onDownloadSefer: () => {
378
378
  const r = [];
379
- for (let s = 0; s < t; s++) {
380
- const i = n(s);
379
+ for (let l = 0; l < t; l++) {
380
+ const i = n(l);
381
381
  (i.semanticName || i.title) && r.push(i);
382
382
  }
383
- return Promise.resolve(ve(r));
383
+ return Promise.resolve(ye(r));
384
384
  },
385
- onDownloadPageRange: (r) => Promise.resolve(ve(r.map(n)))
385
+ onDownloadPageRange: (r) => Promise.resolve(ye(r.map(n)))
386
386
  };
387
387
  }
388
- const z = { size: 24 }, at = ({ size: e = z.size, className: t }) => /* @__PURE__ */ a(
388
+ const q = { size: 24 }, lt = ({ size: e = q.size, className: t }) => /* @__PURE__ */ a(
389
389
  "svg",
390
390
  {
391
391
  xmlns: "http://www.w3.org/2000/svg",
@@ -401,7 +401,7 @@ const z = { size: 24 }, at = ({ size: e = z.size, className: t }) => /* @__PURE_
401
401
  "aria-hidden": "true",
402
402
  children: /* @__PURE__ */ a("path", { d: "m15 18-6-6 6-6" })
403
403
  }
404
- ), lt = ({ size: e = z.size, className: t }) => /* @__PURE__ */ a(
404
+ ), st = ({ size: e = q.size, className: t }) => /* @__PURE__ */ a(
405
405
  "svg",
406
406
  {
407
407
  xmlns: "http://www.w3.org/2000/svg",
@@ -417,7 +417,7 @@ const z = { size: 24 }, at = ({ size: e = z.size, className: t }) => /* @__PURE_
417
417
  "aria-hidden": "true",
418
418
  children: /* @__PURE__ */ a("path", { d: "m9 18 6-6-6-6" })
419
419
  }
420
- ), st = ({ size: e = z.size, className: t }) => /* @__PURE__ */ L(
420
+ ), it = ({ size: e = q.size, className: t }) => /* @__PURE__ */ M(
421
421
  "svg",
422
422
  {
423
423
  xmlns: "http://www.w3.org/2000/svg",
@@ -436,7 +436,7 @@ const z = { size: 24 }, at = ({ size: e = z.size, className: t }) => /* @__PURE_
436
436
  /* @__PURE__ */ a("path", { d: "M7 6v12" })
437
437
  ]
438
438
  }
439
- ), it = ({ size: e = z.size, className: t }) => /* @__PURE__ */ L(
439
+ ), ct = ({ size: e = q.size, className: t }) => /* @__PURE__ */ M(
440
440
  "svg",
441
441
  {
442
442
  xmlns: "http://www.w3.org/2000/svg",
@@ -455,7 +455,7 @@ const z = { size: 24 }, at = ({ size: e = z.size, className: t }) => /* @__PURE_
455
455
  /* @__PURE__ */ a("path", { d: "M17 6v12" })
456
456
  ]
457
457
  }
458
- ), ct = ({ size: e = z.size, className: t }) => /* @__PURE__ */ L(
458
+ ), dt = ({ size: e = q.size, className: t }) => /* @__PURE__ */ M(
459
459
  "svg",
460
460
  {
461
461
  xmlns: "http://www.w3.org/2000/svg",
@@ -476,7 +476,7 @@ const z = { size: 24 }, at = ({ size: e = z.size, className: t }) => /* @__PURE_
476
476
  /* @__PURE__ */ a("path", { d: "M16 21h3a2 2 0 0 0 2-2v-3" })
477
477
  ]
478
478
  }
479
- ), dt = ({ size: e = z.size, className: t }) => /* @__PURE__ */ L(
479
+ ), ut = ({ size: e = q.size, className: t }) => /* @__PURE__ */ M(
480
480
  "svg",
481
481
  {
482
482
  xmlns: "http://www.w3.org/2000/svg",
@@ -497,10 +497,10 @@ const z = { size: 24 }, at = ({ size: e = z.size, className: t }) => /* @__PURE_
497
497
  /* @__PURE__ */ a("path", { d: "M16 21v-3a2 2 0 0 1 2-2h3" })
498
498
  ]
499
499
  }
500
- ), ut = ({
501
- size: e = z.size,
500
+ ), mt = ({
501
+ size: e = q.size,
502
502
  className: t
503
- }) => /* @__PURE__ */ L(
503
+ }) => /* @__PURE__ */ M(
504
504
  "svg",
505
505
  {
506
506
  xmlns: "http://www.w3.org/2000/svg",
@@ -523,7 +523,7 @@ const z = { size: 24 }, at = ({ size: e = z.size, className: t }) => /* @__PURE_
523
523
  /* @__PURE__ */ a("path", { d: "M21 19h.01" })
524
524
  ]
525
525
  }
526
- ), Pt = ({ size: e = z.size, className: t }) => /* @__PURE__ */ L(
526
+ ), Ct = ({ size: e = q.size, className: t }) => /* @__PURE__ */ M(
527
527
  "svg",
528
528
  {
529
529
  xmlns: "http://www.w3.org/2000/svg",
@@ -545,7 +545,7 @@ const z = { size: 24 }, at = ({ size: e = z.size, className: t }) => /* @__PURE_
545
545
  /* @__PURE__ */ a("rect", { x: "16", y: "6", width: "4", height: "15", rx: "0.5" })
546
546
  ]
547
547
  }
548
- ), mt = ({ size: e = z.size, className: t }) => /* @__PURE__ */ L(
548
+ ), gt = ({ size: e = q.size, className: t }) => /* @__PURE__ */ M(
549
549
  "svg",
550
550
  {
551
551
  xmlns: "http://www.w3.org/2000/svg",
@@ -565,13 +565,13 @@ const z = { size: 24 }, at = ({ size: e = z.size, className: t }) => /* @__PURE_
565
565
  /* @__PURE__ */ a("line", { x1: "12", x2: "12", y1: "15", y2: "3" })
566
566
  ]
567
567
  }
568
- ), q = ({
568
+ ), W = ({
569
569
  onClick: e,
570
570
  ariaLabel: t,
571
571
  ariaPressed: o,
572
572
  disabled: n = !1,
573
573
  children: r,
574
- className: s = "",
574
+ className: l = "",
575
575
  title: i
576
576
  }) => /* @__PURE__ */ a(
577
577
  "button",
@@ -582,17 +582,17 @@ const z = { size: 24 }, at = ({ size: e = z.size, className: t }) => /* @__PURE_
582
582
  "aria-pressed": o,
583
583
  disabled: n,
584
584
  title: i ?? t,
585
- className: `flipbook-toolbar-button ${s}`.trim(),
585
+ className: `flipbook-toolbar-button ${l}`.trim(),
586
586
  children: r
587
587
  }
588
- ), Ct = ({
588
+ ), Tt = ({
589
589
  onClick: e,
590
590
  ariaLabel: t,
591
591
  children: o,
592
592
  disabled: n = !1,
593
593
  className: r
594
594
  }) => /* @__PURE__ */ a(
595
- q,
595
+ W,
596
596
  {
597
597
  onClick: e,
598
598
  ariaLabel: t,
@@ -600,13 +600,13 @@ const z = { size: 24 }, at = ({ size: e = z.size, className: t }) => /* @__PURE_
600
600
  className: `flipbook-toolbar-action ${r ?? ""}`.trim(),
601
601
  children: o
602
602
  }
603
- ), Tt = ({
603
+ ), It = ({
604
604
  enabled: e,
605
605
  onChange: t,
606
606
  ariaLabel: o,
607
607
  className: n
608
608
  }) => /* @__PURE__ */ a(
609
- q,
609
+ W,
610
610
  {
611
611
  onClick: () => t(!e),
612
612
  ariaLabel: o ?? (e ? "Hide bookmarks" : "Show bookmarks"),
@@ -623,7 +623,7 @@ const z = { size: 24 }, at = ({ size: e = z.size, className: t }) => /* @__PURE_
623
623
  }
624
624
  ) })
625
625
  }
626
- ), gt = {
626
+ ), ft = {
627
627
  align: "left",
628
628
  direction: "ltr",
629
629
  translations: {
@@ -650,7 +650,7 @@ const z = { size: 24 }, at = ({ size: e = z.size, className: t }) => /* @__PURE_
650
650
  "toolbarItem.exitFullscreen": "Exit fullscreen",
651
651
  "toolbarItem.fullscreenUnsupported": "Fullscreen is not supported by this browser"
652
652
  }
653
- }, ft = {
653
+ }, ht = {
654
654
  align: "right",
655
655
  direction: "rtl",
656
656
  translations: {
@@ -677,10 +677,10 @@ const z = { size: 24 }, at = ({ size: e = z.size, className: t }) => /* @__PURE_
677
677
  "toolbarItem.exitFullscreen": "יציאה ממסך מלא",
678
678
  "toolbarItem.fullscreenUnsupported": "מסך מלא אינו נתמך בדפדפן זה"
679
679
  }
680
- }, ge = {
681
- "en-US": gt,
682
- "he-IL": ft
683
- }, he = "en-US", ht = {
680
+ }, fe = {
681
+ "en-US": ft,
682
+ "he-IL": ht
683
+ }, pe = "en-US", pt = {
684
684
  "toolbarItem.download": "Download",
685
685
  "toolbarItem.downloadPageRange": "Download page range…",
686
686
  "toolbarItem.download.from": "From",
@@ -702,245 +702,246 @@ const z = { size: 24 }, at = ({ size: e = z.size, className: t }) => /* @__PURE_
702
702
  "toolbarItem.fullscreenUnsupported": "Fullscreen is not supported by this browser"
703
703
  };
704
704
  function Le(e) {
705
- return ge[e] ?? ge[he];
705
+ return fe[e] ?? fe[pe];
706
706
  }
707
- function fe(e) {
707
+ function he(e) {
708
708
  return Le(e).direction === "rtl";
709
709
  }
710
- function pt(e) {
711
- return fe(e) ? "rtl" : "ltr";
710
+ function bt(e) {
711
+ return he(e) ? "rtl" : "ltr";
712
712
  }
713
- function C(e, t) {
713
+ function y(e, t) {
714
714
  const o = Le(t).translations[e];
715
715
  if (o !== void 0 && o !== "") return o;
716
- const n = ge[he].translations[e];
717
- return n !== void 0 && n !== "" ? n : ht[e] ?? e;
716
+ const n = fe[pe].translations[e];
717
+ return n !== void 0 && n !== "" ? n : pt[e] ?? e;
718
718
  }
719
- const Ne = Ce(null);
720
- function W() {
721
- const e = Te(Ne);
719
+ const Fe = Te(null);
720
+ function V() {
721
+ const e = Ie(Fe);
722
722
  if (!e)
723
723
  throw new Error("Toolbar components must be used within a Toolbar");
724
724
  return e;
725
725
  }
726
- function ye(e) {
726
+ function Pe(e) {
727
727
  return e.replace(/[׳'״"]/g, "");
728
728
  }
729
- function Pe(e, t) {
729
+ function Ce(e, t) {
730
730
  const o = atob(e.data), n = new Uint8Array(o.length);
731
- for (let c = 0; c < o.length; c++)
732
- n[c] = o.charCodeAt(c);
733
- const r = new Blob([n]), s = URL.createObjectURL(r), i = document.createElement("a");
734
- i.href = s, i.download = `${t}.${e.ext}`, i.click(), URL.revokeObjectURL(s);
731
+ for (let d = 0; d < o.length; d++)
732
+ n[d] = o.charCodeAt(d);
733
+ const r = new Blob([n]), l = URL.createObjectURL(r), i = document.createElement("a");
734
+ i.href = l, i.download = `${t}.${e.ext}`, i.click(), URL.revokeObjectURL(l);
735
735
  }
736
- function bt(e, t) {
736
+ function wt(e, t) {
737
737
  const o = [];
738
738
  for (let n = 0; n < e; n++) {
739
- const r = t?.indexToSemanticName(n) ?? "", s = t?.indexToTitle(n) ?? "";
740
- if (!r && !s) {
739
+ const r = t?.indexToSemanticName(n) ?? "", l = t?.indexToTitle(n) ?? "";
740
+ if (!r && !l) {
741
741
  t || o.push({ pageIndex: n, semanticName: String(n + 1), title: `Page ${n + 1}` });
742
742
  continue;
743
743
  }
744
744
  o.push({
745
745
  pageIndex: n,
746
746
  semanticName: r || String(n + 1),
747
- title: s || r
747
+ title: l || r
748
748
  });
749
749
  }
750
750
  return o;
751
751
  }
752
- const It = ({
752
+ const Dt = ({
753
753
  ariaLabel: e = "Download",
754
- className: t
754
+ className: t,
755
+ children: o
755
756
  }) => {
756
757
  const {
757
- totalPages: o,
758
- pageSemantics: n,
759
- locale: r,
760
- openDownloadMenuRef: s,
761
- downloadExecutorRef: i,
762
- flipBookRef: c
763
- } = W(), g = c.current?.getDownloadConfig?.() ?? void 0, [w, f] = D(!1);
764
- U(() => (s.current = () => f(!0), () => {
765
- s.current = null;
766
- }), [s]);
767
- const [p, N] = D("entire"), [E, M] = D(0), [j, v] = D(0), [B, d] = D(null), [m, y] = D(null), [$, O] = D(!1), b = Q(null), F = Q(null), k = Ie(
768
- () => bt(o, n),
769
- [o, n]
770
- ), S = !!g?.onDownloadSefer, K = !!g?.onDownloadPageRange, V = S || K, P = k[0]?.pageIndex ?? 0, Y = k[k.length - 1]?.pageIndex ?? 0;
771
- U(() => {
772
- w && (N(S ? "entire" : "range"), M(P), v(Y));
773
- }, [w, S, P, Y]);
774
- const H = I(() => {
775
- f(!1), y(null);
776
- }, []), x = I(
777
- (l) => {
778
- const h = c.current?.getDownloadConfig?.()?.onDownloadError?.(l);
779
- y(
780
- typeof h == "string" && h ? h : C("toolbarItem.download.error", r)
758
+ totalPages: n,
759
+ pageSemantics: r,
760
+ locale: l,
761
+ openDownloadMenuRef: i,
762
+ downloadExecutorRef: d,
763
+ flipBookRef: u
764
+ } = V(), D = u.current?.getDownloadConfig?.() ?? void 0, [m, p] = I(!1);
765
+ z(() => (i.current = () => p(!0), () => {
766
+ i.current = null;
767
+ }), [i]);
768
+ const [E, N] = I("entire"), [j, $] = I(0), [x, A] = I(0), [c, g] = I(null), [L, S] = I(null), [O, k] = I(!1), v = Q(null), B = Q(null), F = De(
769
+ () => wt(n, r),
770
+ [n, r]
771
+ ), R = !!D?.onDownloadSefer, U = !!D?.onDownloadPageRange, P = R || U, Y = F[0]?.pageIndex ?? 0, Z = F[F.length - 1]?.pageIndex ?? 0;
772
+ z(() => {
773
+ m && (N(R ? "entire" : "range"), $(Y), A(Z));
774
+ }, [m, R, Y, Z]);
775
+ const b = T(() => {
776
+ p(!1), S(null);
777
+ }, []), K = T(
778
+ (s) => {
779
+ const w = u.current?.getDownloadConfig?.()?.onDownloadError?.(s);
780
+ S(
781
+ typeof w == "string" && w ? w : y("toolbarItem.download.error", l)
781
782
  );
782
783
  },
783
- [c, r]
784
+ [u, l]
784
785
  );
785
- Be(() => {
786
- if (!w || !F.current || !b.current) return;
787
- const l = F.current, u = b.current.querySelector(".flipbook-toolbar-download-trigger"), h = () => {
788
- const T = u?.getBoundingClientRect();
789
- if (!T) return;
790
- const R = 8, _ = 6, re = window.innerHeight - T.bottom - _ - R, pe = T.top - _ - R, be = Math.min(l.scrollHeight, window.innerHeight * 0.7, 480), ae = re < be && pe > re;
791
- l.style.maxHeight = `${Math.max(0, Math.min(be, ae ? pe : re))}px`;
792
- const oe = l.getBoundingClientRect(), Fe = fe(r) ? T.left : T.right - oe.width;
793
- l.style.left = `${Math.max(R, Math.min(Fe, window.innerWidth - oe.width - R))}px`;
794
- const Me = ae ? T.top - _ - oe.height : T.bottom + _;
795
- l.style.top = `${Math.max(R, Math.min(Me, window.innerHeight - oe.height - R))}px`, O(ae);
786
+ Se(() => {
787
+ if (!m || !B.current || !v.current) return;
788
+ const s = B.current, f = v.current.querySelector(".flipbook-toolbar-download-trigger"), w = () => {
789
+ const C = f?.getBoundingClientRect();
790
+ if (!C) return;
791
+ const H = 8, _ = 6, ae = window.innerHeight - C.bottom - _ - H, be = C.top - _ - H, we = Math.min(s.scrollHeight, window.innerHeight * 0.7, 480), le = ae < we && be > ae;
792
+ s.style.maxHeight = `${Math.max(0, Math.min(we, le ? be : ae))}px`;
793
+ const ne = s.getBoundingClientRect(), Me = he(l) ? C.left : C.right - ne.width;
794
+ s.style.left = `${Math.max(H, Math.min(Me, window.innerWidth - ne.width - H))}px`;
795
+ const je = le ? C.top - _ - ne.height : C.bottom + _;
796
+ s.style.top = `${Math.max(H, Math.min(je, window.innerHeight - ne.height - H))}px`, k(le);
796
797
  };
797
- h();
798
- const Z = new ResizeObserver(h);
799
- Z.observe(l);
800
- const G = b.current.closest('[role="toolbar"]');
801
- return G && Z.observe(G), window.addEventListener("resize", h), window.addEventListener("scroll", h, !0), () => {
802
- Z.disconnect(), window.removeEventListener("resize", h), window.removeEventListener("scroll", h, !0);
798
+ w();
799
+ const ee = new ResizeObserver(w);
800
+ ee.observe(s);
801
+ const G = v.current.closest('[role="toolbar"]');
802
+ return G && ee.observe(G), window.addEventListener("resize", w), window.addEventListener("scroll", w, !0), () => {
803
+ ee.disconnect(), window.removeEventListener("resize", w), window.removeEventListener("scroll", w, !0);
803
804
  };
804
- }, [w, r]), U(() => {
805
- if (!w) return;
806
- const l = (u) => {
807
- b.current && !b.current.contains(u.target) && H();
805
+ }, [m, l]), z(() => {
806
+ if (!m) return;
807
+ const s = (f) => {
808
+ v.current && !v.current.contains(f.target) && b();
808
809
  };
809
- return document.addEventListener("mousedown", l), () => document.removeEventListener("mousedown", l);
810
- }, [w, H]);
811
- const A = I(async () => {
812
- const l = c.current?.getDownloadConfig?.();
813
- if (l?.onDownloadSefer) {
814
- d("sefer"), y(null);
810
+ return document.addEventListener("mousedown", s), () => document.removeEventListener("mousedown", s);
811
+ }, [m, b]);
812
+ const J = T(async () => {
813
+ const s = u.current?.getDownloadConfig?.();
814
+ if (s?.onDownloadSefer) {
815
+ g("sefer"), S(null);
815
816
  try {
816
- const u = await l.onDownloadSefer();
817
- u && Pe(u, l.entireBookFilename ?? "book"), H();
818
- } catch (u) {
819
- x(u);
817
+ const f = await s.onDownloadSefer();
818
+ f && Ce(f, s.entireBookFilename ?? "book"), b();
819
+ } catch (f) {
820
+ K(f);
820
821
  } finally {
821
- d(null);
822
+ g(null);
822
823
  }
823
824
  }
824
- }, [c, H, x]), J = I(
825
- async (l, u) => {
826
- const h = c.current?.getDownloadConfig?.();
827
- if (!h?.onDownloadPageRange) return;
828
- const Z = [], G = [];
829
- for (let T = l; T <= u; T++) {
830
- Z.push(T);
831
- const R = k.find((_) => _.pageIndex === T);
832
- R && G.push(R);
825
+ }, [u, b, K]), h = T(
826
+ async (s, f) => {
827
+ const w = u.current?.getDownloadConfig?.();
828
+ if (!w?.onDownloadPageRange) return;
829
+ const ee = [], G = [];
830
+ for (let C = s; C <= f; C++) {
831
+ ee.push(C);
832
+ const H = F.find((_) => _.pageIndex === C);
833
+ H && G.push(H);
833
834
  }
834
- d("range"), y(null);
835
+ g("range"), S(null);
835
836
  try {
836
- const T = await h.onDownloadPageRange(
837
- Z,
837
+ const C = await w.onDownloadPageRange(
838
+ ee,
838
839
  G,
839
- h.downloadContext
840
+ w.downloadContext
840
841
  );
841
- if (T) {
842
- const R = ye(G[0]?.semanticName ?? String(l)), _ = ye(
843
- G[G.length - 1]?.semanticName ?? String(u)
842
+ if (C) {
843
+ const H = Pe(G[0]?.semanticName ?? String(s)), _ = Pe(
844
+ G[G.length - 1]?.semanticName ?? String(f)
844
845
  );
845
- Pe(T, `${h.rangeFilename ?? "pages"}-${R}-${_}`);
846
+ Ce(C, `${w.rangeFilename ?? "pages"}-${H}-${_}`);
846
847
  }
847
- H();
848
- } catch (T) {
849
- x(T);
848
+ b();
849
+ } catch (C) {
850
+ K(C);
850
851
  } finally {
851
- d(null);
852
+ g(null);
852
853
  }
853
854
  },
854
- [c, k, H, x]
855
+ [u, F, b, K]
855
856
  );
856
- return U(() => (i.current = (l, u) => {
857
- l === void 0 && u === void 0 ? A() : l !== void 0 && u !== void 0 && J(l, u);
857
+ return z(() => (d.current = (s, f) => {
858
+ s === void 0 && f === void 0 ? J() : s !== void 0 && f !== void 0 && h(s, f);
858
859
  }, () => {
859
- i.current = null;
860
- }), [i, A, J]), V ? /* @__PURE__ */ L("div", { className: `flipbook-toolbar-download-wrap ${t ?? ""}`.trim(), ref: b, children: [
860
+ d.current = null;
861
+ }), [d, J, h]), P ? /* @__PURE__ */ M("div", { className: `flipbook-toolbar-download-wrap ${t ?? ""}`.trim(), ref: v, children: [
861
862
  /* @__PURE__ */ a(
862
863
  "button",
863
864
  {
864
865
  type: "button",
865
866
  className: "flipbook-toolbar-button flipbook-toolbar-download-trigger",
866
- onClick: () => f((l) => !l),
867
- "aria-label": e ?? C("toolbarItem.download", r),
868
- "aria-expanded": w,
867
+ onClick: () => p((s) => !s),
868
+ "aria-label": e ?? y("toolbarItem.download", l),
869
+ "aria-expanded": m,
869
870
  "aria-haspopup": "true",
870
- disabled: B !== null,
871
- children: /* @__PURE__ */ a(mt, { size: 18 })
871
+ disabled: c !== null,
872
+ children: /* @__PURE__ */ a(gt, { size: 18 })
872
873
  }
873
874
  ),
874
- w && /* @__PURE__ */ L(
875
+ m && /* @__PURE__ */ M(
875
876
  "div",
876
877
  {
877
- ref: F,
878
- className: `flipbook-toolbar-download-menu ${$ ? "flipbook-toolbar-download-menu--open-up" : ""}`.trim(),
878
+ ref: B,
879
+ className: `flipbook-toolbar-download-menu ${O ? "flipbook-toolbar-download-menu--open-up" : ""}`.trim(),
879
880
  role: "menu",
880
- dir: fe(r) ? "rtl" : "ltr",
881
+ dir: he(l) ? "rtl" : "ltr",
881
882
  children: [
882
- /* @__PURE__ */ L(
883
+ /* @__PURE__ */ M(
883
884
  "fieldset",
884
885
  {
885
886
  className: "flipbook-toolbar-download-mode",
886
- "aria-label": C("toolbarItem.download", r),
887
+ "aria-label": y("toolbarItem.download", l),
887
888
  children: [
888
- S && /* @__PURE__ */ L("label", { className: "flipbook-toolbar-download-radio-label", children: [
889
+ R && /* @__PURE__ */ M("label", { className: "flipbook-toolbar-download-radio-label", children: [
889
890
  /* @__PURE__ */ a(
890
891
  "input",
891
892
  {
892
893
  type: "radio",
893
894
  name: "download-mode",
894
895
  className: "flipbook-toolbar-download-radio",
895
- checked: p === "entire",
896
+ checked: E === "entire",
896
897
  onChange: () => N("entire")
897
898
  }
898
899
  ),
899
- /* @__PURE__ */ a("span", { children: C("command.downloadEntireBook", r) })
900
+ /* @__PURE__ */ a("span", { children: y("command.downloadEntireBook", l) })
900
901
  ] }),
901
- K && /* @__PURE__ */ L("label", { className: "flipbook-toolbar-download-radio-label", children: [
902
+ U && /* @__PURE__ */ M("label", { className: "flipbook-toolbar-download-radio-label", children: [
902
903
  /* @__PURE__ */ a(
903
904
  "input",
904
905
  {
905
906
  type: "radio",
906
907
  name: "download-mode",
907
908
  className: "flipbook-toolbar-download-radio",
908
- checked: p === "range",
909
+ checked: E === "range",
909
910
  onChange: () => N("range")
910
911
  }
911
912
  ),
912
- /* @__PURE__ */ a("span", { children: C("toolbarItem.downloadPageRange", r) })
913
+ /* @__PURE__ */ a("span", { children: y("toolbarItem.downloadPageRange", l) })
913
914
  ] })
914
915
  ]
915
916
  }
916
917
  ),
917
- p === "range" && /* @__PURE__ */ L("div", { className: "flipbook-toolbar-download-range", children: [
918
- /* @__PURE__ */ L("label", { className: "flipbook-toolbar-download-range-label", children: [
919
- C("toolbarItem.download.from", r),
918
+ E === "range" && /* @__PURE__ */ M("div", { className: "flipbook-toolbar-download-range", children: [
919
+ /* @__PURE__ */ M("label", { className: "flipbook-toolbar-download-range-label", children: [
920
+ y("toolbarItem.download.from", l),
920
921
  /* @__PURE__ */ a(
921
922
  "select",
922
923
  {
923
- value: E,
924
- onChange: (l) => M(Number(l.target.value)),
924
+ value: j,
925
+ onChange: (s) => $(Number(s.target.value)),
925
926
  className: "flipbook-toolbar-download-range-select",
926
- children: k.map((l) => /* @__PURE__ */ a("option", { value: l.pageIndex, children: l.semanticName || l.title || `Page ${l.pageIndex + 1}` }, l.pageIndex))
927
+ children: F.map((s) => /* @__PURE__ */ a("option", { value: s.pageIndex, children: s.semanticName || s.title || `Page ${s.pageIndex + 1}` }, s.pageIndex))
927
928
  }
928
929
  )
929
930
  ] }),
930
- /* @__PURE__ */ L("label", { className: "flipbook-toolbar-download-range-label", children: [
931
- C("toolbarItem.download.to", r),
931
+ /* @__PURE__ */ M("label", { className: "flipbook-toolbar-download-range-label", children: [
932
+ y("toolbarItem.download.to", l),
932
933
  /* @__PURE__ */ a(
933
934
  "select",
934
935
  {
935
- value: j,
936
- onChange: (l) => v(Number(l.target.value)),
936
+ value: x,
937
+ onChange: (s) => A(Number(s.target.value)),
937
938
  className: "flipbook-toolbar-download-range-select",
938
- children: k.map((l) => /* @__PURE__ */ a("option", { value: l.pageIndex, children: l.semanticName || l.title || `Page ${l.pageIndex + 1}` }, l.pageIndex))
939
+ children: F.map((s) => /* @__PURE__ */ a("option", { value: s.pageIndex, children: s.semanticName || s.title || `Page ${s.pageIndex + 1}` }, s.pageIndex))
939
940
  }
940
941
  )
941
942
  ] })
942
943
  ] }),
943
- m && /* @__PURE__ */ a("div", { role: "alert", className: "flipbook-toolbar-download-error", children: m }),
944
+ L && /* @__PURE__ */ a("div", { role: "alert", className: "flipbook-toolbar-download-error", children: L }),
944
945
  /* @__PURE__ */ a(
945
946
  "button",
946
947
  {
@@ -948,207 +949,208 @@ const It = ({
948
949
  role: "menuitem",
949
950
  className: "flipbook-toolbar-download-menuitem flipbook-toolbar-download-primary",
950
951
  onClick: () => {
951
- if (p === "entire")
952
- A();
952
+ if (E === "entire")
953
+ J();
953
954
  else {
954
- const l = c.current?.getTotalPages?.() ?? o, u = Math.min(E, j);
955
- let h = Math.max(E, j);
956
- if (l > 0 && h >= l && (h = l - 1), h < u) return;
957
- J(u, h);
955
+ const s = u.current?.getTotalPages?.() ?? n, f = Math.min(j, x);
956
+ let w = Math.max(j, x);
957
+ if (s > 0 && w >= s && (w = s - 1), w < f) return;
958
+ h(f, w);
958
959
  }
959
960
  },
960
- disabled: B !== null,
961
- children: B === "sefer" || B === "range" ? "…" : C("toolbarItem.download.download", r)
961
+ disabled: c !== null,
962
+ children: c === "sefer" || c === "range" ? "…" : y("toolbarItem.download.download", l)
962
963
  }
963
- )
964
+ ),
965
+ o && /* @__PURE__ */ a("div", { className: "flipbook-toolbar-download-extra", children: o })
964
966
  ]
965
967
  }
966
968
  )
967
969
  ] }) : null;
968
- }, Dt = ({ children: e, className: t }) => {
969
- const { locale: o } = W(), { execute: n, canExecute: r } = X(), s = () => {
970
- n(ie);
971
- }, i = /* @__PURE__ */ a(st, { size: 18 }), c = C("command.jumpToFirstPage", o);
970
+ }, Et = ({ children: e, className: t }) => {
971
+ const { locale: o } = V(), { execute: n, canExecute: r } = X(), l = () => {
972
+ n(ce);
973
+ }, i = /* @__PURE__ */ a(it, { size: 18 }), d = y("command.jumpToFirstPage", o);
972
974
  return /* @__PURE__ */ a(
973
- q,
975
+ W,
974
976
  {
975
- onClick: s,
976
- ariaLabel: c,
977
- title: c,
978
- disabled: !r(ie),
977
+ onClick: l,
978
+ ariaLabel: d,
979
+ title: d,
980
+ disabled: !r(ce),
979
981
  className: `flipbook-toolbar-first ${t ?? ""}`.trim(),
980
982
  children: e ?? i
981
983
  }
982
984
  );
983
- }, Et = ({
985
+ }, Nt = ({
984
986
  targetRef: e,
985
987
  enterIcon: t,
986
988
  exitIcon: o,
987
989
  ariaLabelEnter: n,
988
990
  ariaLabelExit: r,
989
- unsupportedBehavior: s = "hide",
991
+ unsupportedBehavior: l = "hide",
990
992
  className: i
991
993
  }) => {
992
- const c = W(), { execute: g, canExecute: w } = X(), f = e ?? c.fullscreenTargetRef, [p, N] = D(!1), [E, M] = D(!1);
993
- U(() => {
994
- const d = () => {
995
- N(ue() !== null), M(me(f?.current));
994
+ const d = V(), { execute: u, canExecute: D } = X(), m = e ?? d.fullscreenTargetRef, [p, E] = I(!1), [N, j] = I(!1);
995
+ z(() => {
996
+ const c = () => {
997
+ E(me() !== null), j(ge(m?.current));
996
998
  };
997
- d();
998
- for (const m of xe)
999
- document.addEventListener(m, d);
999
+ c();
1000
+ for (const g of ke)
1001
+ document.addEventListener(g, c);
1000
1002
  return () => {
1001
- for (const m of xe)
1002
- document.removeEventListener(m, d);
1003
+ for (const g of ke)
1004
+ document.removeEventListener(g, c);
1003
1005
  };
1004
- }, [f]);
1005
- const j = () => {
1006
- e ? g(te, {
1006
+ }, [m]);
1007
+ const $ = () => {
1008
+ e ? u(oe, {
1007
1009
  getFullscreenTarget: () => e.current ?? null
1008
- }) : g(te);
1010
+ }) : u(oe);
1009
1011
  };
1010
- if (!E && s === "hide") return null;
1011
- const v = p ? r ?? C("toolbarItem.exitFullscreen", c.locale) : n ?? C("toolbarItem.enterFullscreen", c.locale), B = p ? o ?? /* @__PURE__ */ a(dt, { size: 18 }) : t ?? /* @__PURE__ */ a(ct, { size: 18 });
1012
+ if (!N && l === "hide") return null;
1013
+ const x = p ? r ?? y("toolbarItem.exitFullscreen", d.locale) : n ?? y("toolbarItem.enterFullscreen", d.locale), A = p ? o ?? /* @__PURE__ */ a(ut, { size: 18 }) : t ?? /* @__PURE__ */ a(dt, { size: 18 });
1012
1014
  return /* @__PURE__ */ a(
1013
- q,
1015
+ W,
1014
1016
  {
1015
- onClick: j,
1016
- ariaLabel: v,
1017
+ onClick: $,
1018
+ ariaLabel: x,
1017
1019
  ariaPressed: p,
1018
- disabled: !E || !w(te),
1019
- title: E ? v : C("toolbarItem.fullscreenUnsupported", c.locale),
1020
+ disabled: !N || !D(oe),
1021
+ title: N ? x : y("toolbarItem.fullscreenUnsupported", d.locale),
1020
1022
  className: `flipbook-toolbar-fullscreen ${p ? "flipbook-toolbar-fullscreen--active" : ""} ${i ?? ""}`.trim(),
1021
- children: B
1023
+ children: A
1022
1024
  }
1023
1025
  );
1024
1026
  }, Lt = ({ children: e, className: t }) => {
1025
- const { locale: o } = W(), { execute: n, canExecute: r } = X(), s = () => {
1026
- n(ce);
1027
- }, i = /* @__PURE__ */ a(it, { size: 18 }), c = C("command.jumpToLastPage", o);
1027
+ const { locale: o } = V(), { execute: n, canExecute: r } = X(), l = () => {
1028
+ n(de);
1029
+ }, i = /* @__PURE__ */ a(ct, { size: 18 }), d = y("command.jumpToLastPage", o);
1028
1030
  return /* @__PURE__ */ a(
1029
- q,
1031
+ W,
1030
1032
  {
1031
- onClick: s,
1032
- ariaLabel: c,
1033
- title: c,
1034
- disabled: !r(ce),
1033
+ onClick: l,
1034
+ ariaLabel: d,
1035
+ title: d,
1036
+ disabled: !r(de),
1035
1037
  className: `flipbook-toolbar-last ${t ?? ""}`.trim(),
1036
1038
  children: e ?? i
1037
1039
  }
1038
1040
  );
1039
- }, wt = ({
1041
+ }, xt = ({
1040
1042
  command: e,
1041
1043
  ariaLabel: t,
1042
1044
  children: o,
1043
1045
  disabled: n = !1,
1044
1046
  className: r
1045
1047
  }) => {
1046
- const { execute: s, canExecute: i, isActive: c } = X();
1048
+ const { execute: l, canExecute: i, isActive: d } = X();
1047
1049
  return /* @__PURE__ */ a(
1048
- q,
1050
+ W,
1049
1051
  {
1050
- onClick: () => s(e),
1052
+ onClick: () => l(e),
1051
1053
  ariaLabel: t,
1052
- ariaPressed: c(e),
1054
+ ariaPressed: d(e),
1053
1055
  disabled: n || !i(e),
1054
1056
  className: r,
1055
1057
  children: o
1056
1058
  }
1057
1059
  );
1058
- }, Nt = ({
1060
+ }, Ft = ({
1059
1061
  letters: e,
1060
1062
  ariaLabel: t,
1061
1063
  className: o
1062
1064
  }) => {
1063
- const { locale: n } = W(), r = t ?? C("toolbarItem.selectText", n);
1065
+ const { locale: n } = V(), r = t ?? y("toolbarItem.selectText", n);
1064
1066
  return /* @__PURE__ */ a(
1065
- wt,
1067
+ xt,
1066
1068
  {
1067
- command: ne,
1069
+ command: re,
1068
1070
  ariaLabel: r,
1069
1071
  className: `flipbook-toolbar-mouse-mode ${o ?? ""}`.trim(),
1070
- children: /* @__PURE__ */ L("span", { className: "flipbook-toolbar-mouse-mode-icon", "aria-hidden": "true", children: [
1072
+ children: /* @__PURE__ */ M("span", { className: "flipbook-toolbar-mouse-mode-icon", "aria-hidden": "true", children: [
1071
1073
  /* @__PURE__ */ a("span", { className: "flipbook-toolbar-mouse-mode-caret" }),
1072
- /* @__PURE__ */ a("span", { children: e ?? C("toolbarItem.selectionLetters", n) })
1074
+ /* @__PURE__ */ a("span", { children: e ?? y("toolbarItem.selectionLetters", n) })
1073
1075
  ] })
1074
1076
  }
1075
1077
  );
1076
- }, Ft = ({ children: e, className: t }) => {
1077
- const { locale: o } = W(), { execute: n, canExecute: r } = X(), s = () => {
1078
- n(le);
1079
- }, i = C("command.jumpToNextPage", o), c = /* @__PURE__ */ a(lt, { size: 20 });
1078
+ }, Mt = ({ children: e, className: t }) => {
1079
+ const { locale: o } = V(), { execute: n, canExecute: r } = X(), l = () => {
1080
+ n(se);
1081
+ }, i = y("command.jumpToNextPage", o), d = /* @__PURE__ */ a(st, { size: 20 });
1080
1082
  return /* @__PURE__ */ a(
1081
- q,
1083
+ W,
1082
1084
  {
1083
- onClick: s,
1085
+ onClick: l,
1084
1086
  ariaLabel: i,
1085
1087
  title: i,
1086
- disabled: !r(le),
1088
+ disabled: !r(se),
1087
1089
  className: `flipbook-toolbar-next ${t ?? ""}`.trim(),
1088
- children: e ?? c
1090
+ children: e ?? d
1089
1091
  }
1090
1092
  );
1091
- }, Mt = ({
1093
+ }, jt = ({
1092
1094
  mode: e,
1093
1095
  showTotal: t = !0,
1094
1096
  placeholder: o = "—",
1095
1097
  editable: n,
1096
1098
  className: r,
1097
- ariaLabel: s = "Go to page",
1099
+ ariaLabel: l = "Go to page",
1098
1100
  maxLength: i = 10
1099
1101
  }) => {
1100
- const { flipBookRef: c, pageSemantics: g, direction: w, currentPage: f, totalPages: p, of: N } = W(), E = e ?? (g ? "semantic" : "index"), M = n ?? (E === "semantic" && !!g), [j, v] = D(""), [B, d] = D(!1), m = Q(!1), y = Q(f), $ = f, O = f + 1 < p ? f + 1 : null, b = I(
1101
- (l) => E === "semantic" && g ? g.indexToSemanticName(l) || "" : String(l + 1),
1102
- [E, g]
1103
- ), F = b($), k = O != null ? b(O) : "", S = I(() => String(N), [N]), K = I(() => {
1104
- const l = F, u = k;
1105
- let h;
1106
- return !l && !u ? h = o : l ? u ? l === u ? h = l : h = `${l} - ${u}` : h = l : h = u, t ? `${h} / ${S()}` : h;
1107
- }, [F, k, o, t, S]), V = w === "rtl" ? k || F : F || k, P = K();
1108
- U(() => {
1109
- const l = f !== y.current;
1110
- y.current = f, l && (m.current = !1), !B && !m.current && v(P);
1111
- }, [P, B, f]);
1112
- const Y = I(
1113
- (l) => {
1114
- if (M) {
1115
- d(!0), v(V), m.current = !1;
1116
- const u = () => l.target.select();
1117
- typeof requestAnimationFrame < "u" ? requestAnimationFrame(u) : u();
1102
+ const { flipBookRef: d, pageSemantics: u, direction: D, currentPage: m, totalPages: p, of: E } = V(), N = e ?? (u ? "semantic" : "index"), j = n ?? (N === "semantic" && !!u), [$, x] = I(""), [A, c] = I(!1), g = Q(!1), L = Q(m), S = m, O = m + 1 < p ? m + 1 : null, k = T(
1103
+ (h) => N === "semantic" && u ? u.indexToSemanticName(h) || "" : String(h + 1),
1104
+ [N, u]
1105
+ ), v = k(S), B = O != null ? k(O) : "", F = T(() => String(E), [E]), R = T(() => {
1106
+ const h = v, s = B;
1107
+ let f;
1108
+ return !h && !s ? f = o : h ? s ? h === s ? f = h : f = `${h} - ${s}` : f = h : f = s, t ? `${f} / ${F()}` : f;
1109
+ }, [v, B, o, t, F]), U = D === "rtl" ? B || v : v || B, P = R();
1110
+ z(() => {
1111
+ const h = m !== L.current;
1112
+ L.current = m, h && (g.current = !1), !A && !g.current && x(P);
1113
+ }, [P, A, m]);
1114
+ const Y = T(
1115
+ (h) => {
1116
+ if (j) {
1117
+ c(!0), x(U), g.current = !1;
1118
+ const s = () => h.target.select();
1119
+ typeof requestAnimationFrame < "u" ? requestAnimationFrame(s) : s();
1118
1120
  }
1119
1121
  },
1120
- [M, V]
1121
- ), H = I(() => {
1122
- d(!1), m.current || v(P);
1123
- }, [P]), x = I(
1124
- (l) => {
1125
- if (l.key === "Enter") {
1126
- if (g && j.trim()) {
1127
- const u = g.semanticNameToIndex(j.trim());
1128
- u != null && u >= 0 && u < p && (c.current?.jumpToPage(u), m.current = !0);
1122
+ [j, U]
1123
+ ), Z = T(() => {
1124
+ c(!1), g.current || x(P);
1125
+ }, [P]), b = T(
1126
+ (h) => {
1127
+ if (h.key === "Enter") {
1128
+ if (u && $.trim()) {
1129
+ const s = u.semanticNameToIndex($.trim());
1130
+ s != null && s >= 0 && s < p && (d.current?.jumpToPage(s), g.current = !0);
1129
1131
  }
1130
- l.currentTarget.blur();
1131
- } else l.key === "Escape" && l.currentTarget.blur();
1132
+ h.currentTarget.blur();
1133
+ } else h.key === "Escape" && h.currentTarget.blur();
1132
1134
  },
1133
- [j, g, p, c]
1134
- ), A = I((l) => {
1135
- v(l.target.value);
1135
+ [$, u, p, d]
1136
+ ), K = T((h) => {
1137
+ x(h.target.value);
1136
1138
  }, []);
1137
- return M ? /* @__PURE__ */ a(
1139
+ return j ? /* @__PURE__ */ a(
1138
1140
  "input",
1139
1141
  {
1140
1142
  type: "text",
1141
- className: `flipbook-toolbar-indicator ${B ? "flipbook-toolbar-indicator--editing" : ""} ${r ?? ""}`.trim(),
1142
- value: j,
1143
+ className: `flipbook-toolbar-indicator ${A ? "flipbook-toolbar-indicator--editing" : ""} ${r ?? ""}`.trim(),
1144
+ value: $,
1143
1145
  onFocus: Y,
1144
- onBlur: H,
1145
- onKeyDown: x,
1146
- onChange: A,
1147
- "aria-label": s,
1146
+ onBlur: Z,
1147
+ onKeyDown: b,
1148
+ onChange: K,
1149
+ "aria-label": l,
1148
1150
  "aria-live": "polite",
1149
1151
  "aria-atomic": "true",
1150
1152
  maxLength: i,
1151
- readOnly: !M
1153
+ readOnly: !j
1152
1154
  }
1153
1155
  ) : /* @__PURE__ */ a(
1154
1156
  "span",
@@ -1159,36 +1161,36 @@ const It = ({
1159
1161
  children: P
1160
1162
  }
1161
1163
  );
1162
- }, jt = ({ children: e, className: t }) => {
1163
- const { locale: o } = W(), { execute: n, canExecute: r } = X(), s = () => {
1164
- n(se);
1165
- }, i = C("command.jumpToPrevPage", o), c = /* @__PURE__ */ a(at, { size: 20 });
1164
+ }, Bt = ({ children: e, className: t }) => {
1165
+ const { locale: o } = V(), { execute: n, canExecute: r } = X(), l = () => {
1166
+ n(ie);
1167
+ }, i = y("command.jumpToPrevPage", o), d = /* @__PURE__ */ a(lt, { size: 20 });
1166
1168
  return /* @__PURE__ */ a(
1167
- q,
1169
+ W,
1168
1170
  {
1169
- onClick: s,
1171
+ onClick: l,
1170
1172
  ariaLabel: i,
1171
1173
  title: i,
1172
- disabled: !r(se),
1174
+ disabled: !r(ie),
1173
1175
  className: `flipbook-toolbar-prev ${t ?? ""}`.trim(),
1174
- children: e ?? c
1176
+ children: e ?? d
1175
1177
  }
1176
1178
  );
1177
- }, Bt = ({ children: e, ariaLabel: t, className: o }) => {
1178
- const { locale: n } = W(), { execute: r, canExecute: s } = X(), i = t ?? C("command.jumpToToc", n), c = () => {
1179
- r(de);
1180
- }, g = !s(de);
1179
+ }, St = ({ children: e, ariaLabel: t, className: o }) => {
1180
+ const { locale: n } = V(), { execute: r, canExecute: l } = X(), i = t ?? y("command.jumpToToc", n), d = () => {
1181
+ r(ue);
1182
+ }, u = !l(ue);
1181
1183
  return /* @__PURE__ */ a(
1182
- q,
1184
+ W,
1183
1185
  {
1184
- onClick: c,
1186
+ onClick: d,
1185
1187
  ariaLabel: i,
1186
- disabled: g,
1188
+ disabled: u,
1187
1189
  className: `flipbook-toolbar-toc ${o ?? ""}`.trim(),
1188
- children: e ?? /* @__PURE__ */ a(ut, { size: 18 })
1190
+ children: e ?? /* @__PURE__ */ a(mt, { size: 18 })
1189
1191
  }
1190
1192
  );
1191
- }, xt = {
1193
+ }, kt = {
1192
1194
  id: "openDownloadMenu",
1193
1195
  enName: "Open download menu",
1194
1196
  enDescription: "Open the download menu",
@@ -1198,137 +1200,137 @@ const It = ({
1198
1200
  e.data?.open?.();
1199
1201
  },
1200
1202
  canExecute: (e) => typeof e.data?.open == "function"
1201
- }, St = ({
1203
+ }, $t = ({
1202
1204
  flipBookRef: e,
1203
1205
  direction: t,
1204
1206
  locale: o,
1205
1207
  pageSemantics: n,
1206
1208
  className: r = "",
1207
- children: s,
1209
+ children: l,
1208
1210
  enableHotkeys: i = !0,
1209
- commands: c,
1210
- commandOptions: g,
1211
- fullscreenTargetRef: w
1211
+ commands: d,
1212
+ commandOptions: u,
1213
+ fullscreenTargetRef: D
1212
1214
  }) => {
1213
- const f = t ?? pt(o ?? he), p = o ?? (f === "rtl" ? "he-IL" : "en-US"), N = Q(null), E = Q(null), [M, j] = D(0), [v, B] = D(0), [d, m] = D(0), [y, $] = D(!0), [O, b] = D(!1), [F, k] = D("turn"), S = {
1214
- ...w ? {
1215
+ const m = t ?? bt(o ?? pe), p = o ?? (m === "rtl" ? "he-IL" : "en-US"), E = Q(null), N = Q(null), [j, $] = I(0), [x, A] = I(0), [c, g] = I(0), [L, S] = I(!0), [O, k] = I(!1), [v, B] = I("turn"), F = {
1216
+ ...D ? {
1215
1217
  toggleFullscreen: {
1216
1218
  data: {
1217
- getFullscreenTarget: () => w.current ?? null
1219
+ getFullscreenTarget: () => D.current ?? null
1218
1220
  }
1219
1221
  }
1220
1222
  } : {},
1221
1223
  openDownloadMenu: {
1222
- data: { open: () => N.current?.() }
1224
+ data: { open: () => E.current?.() }
1223
1225
  },
1224
1226
  download: {
1225
1227
  data: {
1226
- onDownload: (x, A) => E.current?.(x, A)
1228
+ onDownload: (b, K) => N.current?.(b, K)
1227
1229
  }
1228
1230
  }
1229
- }, K = new Map(Object.entries(g ?? {}));
1230
- for (const [x, A] of Object.entries(S)) {
1231
- const J = K.get(x);
1232
- K.set(
1233
- x,
1234
- J ? { ...A, ...J, data: { ...A.data, ...J.data } } : A
1231
+ }, R = new Map(Object.entries(u ?? {}));
1232
+ for (const [b, K] of Object.entries(F)) {
1233
+ const J = R.get(b);
1234
+ R.set(
1235
+ b,
1236
+ J ? { ...K, ...J, data: { ...K.data, ...J.data } } : K
1235
1237
  );
1236
1238
  }
1237
- const V = Object.fromEntries(K), P = I(() => {
1238
- const x = e.current;
1239
- x && (j(x.getCurrentPageIndex()), B(x.getTotalPages()), m(x.getOf()), $(x.isFirstPage()), b(x.isLastPage()), k(x.getMouseMode?.() ?? "turn"));
1239
+ const U = Object.fromEntries(R), P = T(() => {
1240
+ const b = e.current;
1241
+ b && ($(b.getCurrentPageIndex()), A(b.getTotalPages()), g(b.getOf()), S(b.isFirstPage()), k(b.isLastPage()), B(b.getMouseMode?.() ?? "turn"));
1240
1242
  }, [e]);
1241
- U(() => {
1243
+ z(() => {
1242
1244
  P();
1243
- const x = setInterval(P, 200);
1244
- return () => clearInterval(x);
1245
+ const b = setInterval(P, 200);
1246
+ return () => clearInterval(b);
1245
1247
  }, [P]);
1246
1248
  const Y = /* @__PURE__ */ a(
1247
- Ne.Provider,
1249
+ Fe.Provider,
1248
1250
  {
1249
1251
  value: {
1250
1252
  flipBookRef: e,
1251
- direction: f,
1253
+ direction: m,
1252
1254
  locale: p,
1253
1255
  pageSemantics: n,
1254
- currentPage: M,
1255
- totalPages: v,
1256
- of: d,
1257
- isFirstPage: y,
1256
+ currentPage: j,
1257
+ totalPages: x,
1258
+ of: c,
1259
+ isFirstPage: L,
1258
1260
  isLastPage: O,
1259
- mouseMode: F,
1260
- openDownloadMenuRef: N,
1261
- downloadExecutorRef: E,
1262
- fullscreenTargetRef: w
1261
+ mouseMode: v,
1262
+ openDownloadMenuRef: E,
1263
+ downloadExecutorRef: N,
1264
+ fullscreenTargetRef: D
1263
1265
  },
1264
1266
  children: /* @__PURE__ */ a(
1265
1267
  "div",
1266
1268
  {
1267
- className: `flipbook-toolbar ${f === "rtl" ? "flipbook-toolbar--rtl" : ""} ${r}`.trim(),
1269
+ className: `flipbook-toolbar ${m === "rtl" ? "flipbook-toolbar--rtl" : ""} ${r}`.trim(),
1268
1270
  role: "toolbar",
1269
1271
  "aria-label": "FlipBook navigation",
1270
- dir: f,
1271
- children: s
1272
+ dir: m,
1273
+ children: l
1272
1274
  }
1273
1275
  )
1274
1276
  }
1275
- ), H = [xt, ...c ?? []];
1277
+ ), Z = [kt, ...d ?? []];
1276
1278
  return /* @__PURE__ */ a(
1277
- nt,
1279
+ rt,
1278
1280
  {
1279
1281
  flipBookRef: e,
1280
- currentPage: M,
1281
- totalPages: v,
1282
- direction: f,
1283
- commands: H,
1284
- commandOptions: V,
1282
+ currentPage: j,
1283
+ totalPages: x,
1284
+ direction: m,
1285
+ commands: Z,
1286
+ commandOptions: U,
1285
1287
  disableHotkeys: !i,
1286
1288
  children: Y
1287
1289
  }
1288
1290
  );
1289
1291
  };
1290
1292
  export {
1291
- Ct as ActionButton,
1292
- Tt as BookmarkToggleButton,
1293
- Pt as BookshelfIcon,
1294
- st as ChevronFirstIcon,
1295
- it as ChevronLastIcon,
1296
- at as ChevronLeftIcon,
1297
- lt as ChevronRightIcon,
1298
- It as DownloadDropdown,
1299
- mt as DownloadIcon,
1300
- Dt as FirstPageButton,
1301
- Et as FullscreenButton,
1293
+ Tt as ActionButton,
1294
+ It as BookmarkToggleButton,
1295
+ Ct as BookshelfIcon,
1296
+ it as ChevronFirstIcon,
1297
+ ct as ChevronLastIcon,
1298
+ lt as ChevronLeftIcon,
1299
+ st as ChevronRightIcon,
1300
+ Dt as DownloadDropdown,
1301
+ gt as DownloadIcon,
1302
+ Et as FirstPageButton,
1303
+ Nt as FullscreenButton,
1302
1304
  Lt as LastPageButton,
1303
- ct as MaximizeIcon,
1304
- dt as MinimizeIcon,
1305
- Nt as MouseModeButton,
1306
- Ft as NextButton,
1307
- Mt as PageIndicator,
1308
- jt as PrevButton,
1309
- Mt as SemanticPageIndicator,
1310
- ut as TableOfContentsIcon,
1311
- Bt as TocButton,
1312
- wt as ToggleButton,
1313
- St as Toolbar,
1314
- q as ToolbarButton,
1315
- me as canUseFullscreen,
1316
- yt as createDefaultDownloadConfig,
1317
- Je as defaultCommands,
1318
- $e as downloadCommand,
1319
- We as exitFullscreen,
1320
- le as flipNextCommand,
1321
- se as flipPrevCommand,
1322
- xe as fullscreenStateEvents,
1323
- ue as getFullscreenElement,
1324
- ie as goToFirstCommand,
1325
- ce as goToLastCommand,
1326
- de as goToTocCommand,
1327
- qe as requestFullscreen,
1328
- ze as toggleDebugCommand,
1329
- te as toggleFullscreenCommand,
1330
- ne as toggleTextSelectionCommand,
1305
+ dt as MaximizeIcon,
1306
+ ut as MinimizeIcon,
1307
+ Ft as MouseModeButton,
1308
+ Mt as NextButton,
1309
+ jt as PageIndicator,
1310
+ Bt as PrevButton,
1311
+ jt as SemanticPageIndicator,
1312
+ mt as TableOfContentsIcon,
1313
+ St as TocButton,
1314
+ xt as ToggleButton,
1315
+ $t as Toolbar,
1316
+ W as ToolbarButton,
1317
+ ge as canUseFullscreen,
1318
+ Pt as createDefaultDownloadConfig,
1319
+ Ge as defaultCommands,
1320
+ Ae as downloadCommand,
1321
+ Ve as exitFullscreen,
1322
+ se as flipNextCommand,
1323
+ ie as flipPrevCommand,
1324
+ ke as fullscreenStateEvents,
1325
+ me as getFullscreenElement,
1326
+ ce as goToFirstCommand,
1327
+ de as goToLastCommand,
1328
+ ue as goToTocCommand,
1329
+ We as requestFullscreen,
1330
+ qe as toggleDebugCommand,
1331
+ oe as toggleFullscreenCommand,
1332
+ re as toggleTextSelectionCommand,
1331
1333
  X as useCommands,
1332
- W as useToolbar
1334
+ V as useToolbar
1333
1335
  };
1334
1336
  //# sourceMappingURL=index.js.map