flipbookengine 0.6.0 → 0.6.5

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,13 +1,13 @@
1
- var Se = Object.defineProperty;
2
- var Nt = (e) => {
1
+ var ke = Object.defineProperty;
2
+ var _t = (e) => {
3
3
  throw TypeError(e);
4
4
  };
5
- var Te = (e, t, s) => t in e ? Se(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
6
- var v = (e, t, s) => Te(e, typeof t != "symbol" ? t + "" : t, s), yt = (e, t, s) => t.has(e) || Nt("Cannot " + s);
7
- var _ = (e, t, s) => (yt(e, t, "read from private field"), s ? s.call(e) : t.get(e)), rt = (e, t, s) => t.has(e) ? Nt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), at = (e, t, s, o) => (yt(e, t, "write to private field"), o ? o.call(e, s) : t.set(e, s), s), J = (e, t, s) => (yt(e, t, "access private method"), s);
8
- import * as Bt from "pdfjs-dist";
9
- var ke = Symbol.for("preact-signals");
10
- function It() {
5
+ var Ce = (e, t, i) => t in e ? ke(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i;
6
+ var v = (e, t, i) => Ce(e, typeof t != "symbol" ? t + "" : t, i), yt = (e, t, i) => t.has(e) || _t("Cannot " + i);
7
+ var B = (e, t, i) => (yt(e, t, "read from private field"), i ? i.call(e) : t.get(e)), rt = (e, t, i) => t.has(e) ? _t("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, i), at = (e, t, i, o) => (yt(e, t, "write to private field"), o ? o.call(e, i) : t.set(e, i), i), J = (e, t, i) => (yt(e, t, "access private method"), i);
8
+ import * as Gt from "pdfjs-dist";
9
+ var Ae = Symbol.for("preact-signals");
10
+ function zt() {
11
11
  if (j > 1)
12
12
  j--;
13
13
  else {
@@ -17,155 +17,155 @@ function It() {
17
17
  for (ct = void 0; r !== void 0; )
18
18
  r.S.v === r.v && (r.S.i = r.i), r = r.o;
19
19
  }(); tt !== void 0; ) {
20
- var s = tt;
21
- for (tt = void 0, lt++; s !== void 0; ) {
22
- var o = s.u;
23
- if (s.u = void 0, s.f &= -3, !(8 & s.f) && ie(s)) try {
24
- s.c();
20
+ var i = tt;
21
+ for (tt = void 0, lt++; i !== void 0; ) {
22
+ var o = i.u;
23
+ if (i.u = void 0, i.f &= -3, !(8 & i.f) && ne(i)) try {
24
+ i.c();
25
25
  } catch (r) {
26
26
  t || (e = r, t = !0);
27
27
  }
28
- s = o;
28
+ i = o;
29
29
  }
30
30
  }
31
31
  if (lt = 0, j--, t) throw e;
32
32
  }
33
33
  }
34
- var A = void 0;
34
+ var M = void 0;
35
35
  function wt(e) {
36
- var t = A;
37
- A = void 0;
36
+ var t = M;
37
+ M = void 0;
38
38
  try {
39
39
  return e();
40
40
  } finally {
41
- A = t;
41
+ M = t;
42
42
  }
43
43
  }
44
- var tt = void 0, j = 0, lt = 0, _t = 0, ct = void 0, dt = 0;
45
- function ee(e) {
46
- if (A !== void 0) {
44
+ var tt = void 0, j = 0, lt = 0, Ut = 0, ct = void 0, dt = 0;
45
+ function se(e) {
46
+ if (M !== void 0) {
47
47
  var t = e.n;
48
- if (t === void 0 || t.t !== A)
49
- return t = { i: 0, S: e, p: A.s, n: void 0, t: A, e: void 0, x: void 0, r: t }, A.s !== void 0 && (A.s.n = t), A.s = t, e.n = t, 32 & A.f && e.S(t), t;
48
+ if (t === void 0 || t.t !== M)
49
+ return t = { i: 0, S: e, p: M.s, n: void 0, t: M, e: void 0, x: void 0, r: t }, M.s !== void 0 && (M.s.n = t), M.s = t, e.n = t, 32 & M.f && e.S(t), t;
50
50
  if (t.i === -1)
51
- return t.i = 0, t.n !== void 0 && (t.n.p = t.p, t.p !== void 0 && (t.p.n = t.n), t.p = A.s, t.n = void 0, A.s.n = t, A.s = t), t;
51
+ return t.i = 0, t.n !== void 0 && (t.n.p = t.p, t.p !== void 0 && (t.p.n = t.n), t.p = M.s, t.n = void 0, M.s.n = t, M.s = t), t;
52
52
  }
53
53
  }
54
- function L(e, t) {
54
+ function z(e, t) {
55
55
  this.v = e, this.i = 0, this.n = void 0, this.t = void 0, this.l = 0, this.W = t == null ? void 0 : t.watched, this.Z = t == null ? void 0 : t.unwatched, this.name = t == null ? void 0 : t.name;
56
56
  }
57
- L.prototype.brand = ke;
58
- L.prototype.h = function() {
57
+ z.prototype.brand = Ae;
58
+ z.prototype.h = function() {
59
59
  return !0;
60
60
  };
61
- L.prototype.S = function(e) {
62
- var t = this, s = this.t;
63
- s !== e && e.e === void 0 && (e.x = s, this.t = e, s !== void 0 ? s.e = e : wt(function() {
61
+ z.prototype.S = function(e) {
62
+ var t = this, i = this.t;
63
+ i !== e && e.e === void 0 && (e.x = i, this.t = e, i !== void 0 ? i.e = e : wt(function() {
64
64
  var o;
65
65
  (o = t.W) == null || o.call(t);
66
66
  }));
67
67
  };
68
- L.prototype.U = function(e) {
68
+ z.prototype.U = function(e) {
69
69
  var t = this;
70
70
  if (this.t !== void 0) {
71
- var s = e.e, o = e.x;
72
- s !== void 0 && (s.x = o, e.e = void 0), o !== void 0 && (o.e = s, e.x = void 0), e === this.t && (this.t = o, o === void 0 && wt(function() {
71
+ var i = e.e, o = e.x;
72
+ i !== void 0 && (i.x = o, e.e = void 0), o !== void 0 && (o.e = i, e.x = void 0), e === this.t && (this.t = o, o === void 0 && wt(function() {
73
73
  var r;
74
74
  (r = t.Z) == null || r.call(t);
75
75
  }));
76
76
  }
77
77
  };
78
- L.prototype.subscribe = function(e) {
78
+ z.prototype.subscribe = function(e) {
79
79
  var t = this;
80
- return G(function() {
81
- var s = t.value;
80
+ return _(function() {
81
+ var i = t.value;
82
82
  wt(function() {
83
- return e(s);
83
+ return e(i);
84
84
  });
85
85
  }, { name: "sub" });
86
86
  };
87
- L.prototype.valueOf = function() {
87
+ z.prototype.valueOf = function() {
88
88
  return this.value;
89
89
  };
90
- L.prototype.toString = function() {
90
+ z.prototype.toString = function() {
91
91
  return this.value + "";
92
92
  };
93
- L.prototype.toJSON = function() {
93
+ z.prototype.toJSON = function() {
94
94
  return this.value;
95
95
  };
96
- L.prototype.peek = function() {
96
+ z.prototype.peek = function() {
97
97
  var e = this;
98
98
  return wt(function() {
99
99
  return e.value;
100
100
  });
101
101
  };
102
- Object.defineProperty(L.prototype, "value", { get: function() {
103
- var e = ee(this);
102
+ Object.defineProperty(z.prototype, "value", { get: function() {
103
+ var e = se(this);
104
104
  return e !== void 0 && (e.i = this.i), this.v;
105
105
  }, set: function(e) {
106
106
  if (e !== this.v) {
107
107
  if (lt > 100) throw new Error("Cycle detected");
108
- (function(s) {
109
- j !== 0 && lt === 0 && s.l !== _t && (s.l = _t, ct = { S: s, v: s.v, i: s.i, o: ct });
108
+ (function(i) {
109
+ j !== 0 && lt === 0 && i.l !== Ut && (i.l = Ut, ct = { S: i, v: i.v, i: i.i, o: ct });
110
110
  })(this), this.v = e, this.i++, dt++, j++;
111
111
  try {
112
112
  for (var t = this.t; t !== void 0; t = t.x) t.t.N();
113
113
  } finally {
114
- It();
114
+ zt();
115
115
  }
116
116
  }
117
117
  } });
118
118
  function D(e, t) {
119
- return new L(e, t);
119
+ return new z(e, t);
120
120
  }
121
- function ie(e) {
121
+ function ne(e) {
122
122
  for (var t = e.s; t !== void 0; t = t.n) if (t.S.i !== t.i || !t.S.h() || t.S.i !== t.i) return !0;
123
123
  return !1;
124
124
  }
125
- function se(e) {
125
+ function oe(e) {
126
126
  for (var t = e.s; t !== void 0; t = t.n) {
127
- var s = t.S.n;
128
- if (s !== void 0 && (t.r = s), t.S.n = t, t.i = -1, t.n === void 0) {
127
+ var i = t.S.n;
128
+ if (i !== void 0 && (t.r = i), t.S.n = t, t.i = -1, t.n === void 0) {
129
129
  e.s = t;
130
130
  break;
131
131
  }
132
132
  }
133
133
  }
134
- function ne(e) {
135
- for (var t = e.s, s = void 0; t !== void 0; ) {
134
+ function re(e) {
135
+ for (var t = e.s, i = void 0; t !== void 0; ) {
136
136
  var o = t.p;
137
- t.i === -1 ? (t.S.U(t), o !== void 0 && (o.n = t.n), t.n !== void 0 && (t.n.p = o)) : s = t, t.S.n = t.r, t.r !== void 0 && (t.r = void 0), t = o;
137
+ t.i === -1 ? (t.S.U(t), o !== void 0 && (o.n = t.n), t.n !== void 0 && (t.n.p = o)) : i = t, t.S.n = t.r, t.r !== void 0 && (t.r = void 0), t = o;
138
138
  }
139
- e.s = s;
139
+ e.s = i;
140
140
  }
141
141
  function q(e, t) {
142
- L.call(this, void 0, t), this.x = e, this.s = void 0, this.g = dt - 1, this.f = 4;
142
+ z.call(this, void 0, t), this.x = e, this.s = void 0, this.g = dt - 1, this.f = 4;
143
143
  }
144
- q.prototype = new L();
144
+ q.prototype = new z();
145
145
  q.prototype.h = function() {
146
146
  if (this.f &= -3, 1 & this.f) return !1;
147
147
  if ((36 & this.f) == 32 || (this.f &= -5, this.g === dt)) return !0;
148
- if (this.g = dt, this.f |= 1, this.i > 0 && !ie(this))
148
+ if (this.g = dt, this.f |= 1, this.i > 0 && !ne(this))
149
149
  return this.f &= -2, !0;
150
- var e = A;
150
+ var e = M;
151
151
  try {
152
- se(this), A = this;
152
+ oe(this), M = this;
153
153
  var t = this.x();
154
154
  (16 & this.f || this.v !== t || this.i === 0) && (this.v = t, this.f &= -17, this.i++);
155
- } catch (s) {
156
- this.v = s, this.f |= 16, this.i++;
155
+ } catch (i) {
156
+ this.v = i, this.f |= 16, this.i++;
157
157
  }
158
- return A = e, ne(this), this.f &= -2, !0;
158
+ return M = e, re(this), this.f &= -2, !0;
159
159
  };
160
160
  q.prototype.S = function(e) {
161
161
  if (this.t === void 0) {
162
162
  this.f |= 36;
163
163
  for (var t = this.s; t !== void 0; t = t.n) t.S.S(t);
164
164
  }
165
- L.prototype.S.call(this, e);
165
+ z.prototype.S.call(this, e);
166
166
  };
167
167
  q.prototype.U = function(e) {
168
- if (this.t !== void 0 && (L.prototype.U.call(this, e), this.t === void 0)) {
168
+ if (this.t !== void 0 && (z.prototype.U.call(this, e), this.t === void 0)) {
169
169
  this.f &= -33;
170
170
  for (var t = this.s; t !== void 0; t = t.n) t.S.U(t);
171
171
  }
@@ -178,35 +178,35 @@ q.prototype.N = function() {
178
178
  };
179
179
  Object.defineProperty(q.prototype, "value", { get: function() {
180
180
  if (1 & this.f) throw new Error("Cycle detected");
181
- var e = ee(this);
181
+ var e = se(this);
182
182
  if (this.h(), e !== void 0 && (e.i = this.i), 16 & this.f) throw this.v;
183
183
  return this.v;
184
184
  } });
185
185
  function w(e, t) {
186
186
  return new q(e, t);
187
187
  }
188
- function oe(e) {
188
+ function ae(e) {
189
189
  var t = e.m;
190
190
  if (e.m = void 0, typeof t == "function") {
191
191
  j++;
192
- var s = A;
193
- A = void 0;
192
+ var i = M;
193
+ M = void 0;
194
194
  try {
195
195
  t();
196
196
  } catch (o) {
197
- throw e.f &= -2, e.f |= 8, Lt(e), o;
197
+ throw e.f &= -2, e.f |= 8, Ft(e), o;
198
198
  } finally {
199
- A = s, It();
199
+ M = i, zt();
200
200
  }
201
201
  }
202
202
  }
203
- function Lt(e) {
203
+ function Ft(e) {
204
204
  for (var t = e.s; t !== void 0; t = t.n) t.S.U(t);
205
- e.x = void 0, e.s = void 0, oe(e);
205
+ e.x = void 0, e.s = void 0, ae(e);
206
206
  }
207
- function Ce(e) {
208
- if (A !== this) throw new Error("Out-of-order effect");
209
- ne(this), A = e, this.f &= -2, 8 & this.f && Lt(this), It();
207
+ function Ee(e) {
208
+ if (M !== this) throw new Error("Out-of-order effect");
209
+ re(this), M = e, this.f &= -2, 8 & this.f && Ft(this), zt();
210
210
  }
211
211
  function X(e, t) {
212
212
  this.x = e, this.m = void 0, this.s = void 0, this.u = void 0, this.f = 32, this.name = t == null ? void 0 : t.name;
@@ -223,69 +223,69 @@ X.prototype.c = function() {
223
223
  };
224
224
  X.prototype.S = function() {
225
225
  if (1 & this.f) throw new Error("Cycle detected");
226
- this.f |= 1, this.f &= -9, oe(this), se(this), j++;
227
- var e = A;
228
- return A = this, Ce.bind(this, e);
226
+ this.f |= 1, this.f &= -9, ae(this), oe(this), j++;
227
+ var e = M;
228
+ return M = this, Ee.bind(this, e);
229
229
  };
230
230
  X.prototype.N = function() {
231
231
  2 & this.f || (this.f |= 2, this.u = tt, tt = this);
232
232
  };
233
233
  X.prototype.d = function() {
234
- this.f |= 8, 1 & this.f || Lt(this);
234
+ this.f |= 8, 1 & this.f || Ft(this);
235
235
  };
236
236
  X.prototype.dispose = function() {
237
237
  this.d();
238
238
  };
239
- function G(e, t) {
240
- var s = new X(e, t);
239
+ function _(e, t) {
240
+ var i = new X(e, t);
241
241
  try {
242
- s.c();
242
+ i.c();
243
243
  } catch (r) {
244
- throw s.d(), r;
244
+ throw i.d(), r;
245
245
  }
246
- var o = s.d.bind(s);
246
+ var o = i.d.bind(i);
247
247
  return o[Symbol.dispose] = o, o;
248
248
  }
249
- var re = /* @__PURE__ */ Symbol.for("Serenity.initPropHook");
250
- function Ae(e) {
249
+ var he = /* @__PURE__ */ Symbol.for("Serenity.initPropHook");
250
+ function Me(e) {
251
251
  return !!(e && typeof e.nodeType == "number");
252
252
  }
253
253
  function vt(e) {
254
254
  return typeof e == "string";
255
255
  }
256
- function ae(e) {
256
+ function le(e) {
257
257
  return typeof e == "number";
258
258
  }
259
- function O(e) {
259
+ function W(e) {
260
260
  return typeof e == "object" && e !== null;
261
261
  }
262
- function Ee(e) {
262
+ function De(e) {
263
263
  return !!(e && e.isComponent);
264
264
  }
265
- function zt(e) {
266
- return O(e) && typeof e.length == "number" && typeof e.nodeType != "number";
265
+ function Ot(e) {
266
+ return W(e) && typeof e.length == "number" && typeof e.nodeType != "number";
267
267
  }
268
- function Me(e) {
269
- return typeof e == "function" && typeof e[re] == "function";
268
+ function Re(e) {
269
+ return typeof e == "function" && typeof e[he] == "function";
270
270
  }
271
271
  function it(e) {
272
272
  return e != null && typeof e != "boolean";
273
273
  }
274
274
  function st(e) {
275
- return Array.isArray(e) ? e.map(st).filter(Boolean).join(" ") : O(e) ? Symbol.iterator in e ? st(Array.from(e)) : Object.keys(e).filter((t) => e[t]).join(" ") : it(e) ? "" + e : "";
275
+ return Array.isArray(e) ? e.map(st).filter(Boolean).join(" ") : W(e) ? Symbol.iterator in e ? st(Array.from(e)) : Object.keys(e).filter((t) => e[t]).join(" ") : it(e) ? "" + e : "";
276
276
  }
277
- function De(e) {
277
+ function Ie(e) {
278
278
  return e != null && typeof e == "object" && "current" in e;
279
279
  }
280
- function Ft(e, t) {
281
- De(e) ? e.current = t : typeof e == "function" && e(t);
280
+ function Wt(e, t) {
281
+ Ie(e) ? e.current = t : typeof e == "function" && e(t);
282
282
  }
283
- function Re(e, t, s) {
284
- t = { ...t, children: s };
283
+ function Le(e, t, i) {
284
+ t = { ...t, children: i };
285
285
  const o = new e(t), r = o.render();
286
- return "ref" in t && Ft(t.ref, o), r;
286
+ return "ref" in t && Wt(t.ref, o), r;
287
287
  }
288
- var Ie = "http://www.w3.org/1998/Math/MathML", Le = /* @__PURE__ */ new Set(["math", "annotation", "annotation-xml", "maction", "merror", "mfrac", "mi", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mprescripts", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msubsup", "msup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "semantics", "menclose", "mfenced"]), ze = /* @__PURE__ */ new Set([
288
+ var ze = "http://www.w3.org/1998/Math/MathML", Fe = /* @__PURE__ */ new Set(["math", "annotation", "annotation-xml", "maction", "merror", "mfrac", "mi", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mprescripts", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msubsup", "msup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "semantics", "menclose", "mfenced"]), Oe = /* @__PURE__ */ new Set([
289
289
  // "a",
290
290
  "animate",
291
291
  "animateMotion",
@@ -350,30 +350,30 @@ var Ie = "http://www.w3.org/1998/Math/MathML", Le = /* @__PURE__ */ new Set(["ma
350
350
  "tspan",
351
351
  "use",
352
352
  "view"
353
- ]), Gt = /^(a(ll|t|u)|base[FP]|c(al|lipPathU|on)|di|ed|ex|filter[RU]|g(lyphR|r)|ke|l(en|im)|ma(rker[HUW]|s)|n|pat|pr|point[^e]|re[^n]|s[puy]|st[^or]|ta|textL|vi|xC|y|z)/, Fe = "http://www.w3.org/2000/svg", Ut = /* @__PURE__ */ Symbol.for("Serenity.jsxNamespaceURI");
354
- function Oe(e) {
355
- const t = globalThis[Ut];
356
- return arguments.length && (globalThis[Ut] = e), t;
353
+ ]), jt = /^(a(ll|t|u)|base[FP]|c(al|lipPathU|on)|di|ed|ex|filter[RU]|g(lyphR|r)|ke|l(en|im)|ma(rker[HUW]|s)|n|pat|pr|point[^e]|re[^n]|s[puy]|st[^or]|ta|textL|vi|xC|y|z)/, We = "http://www.w3.org/2000/svg", Vt = /* @__PURE__ */ Symbol.for("Serenity.jsxNamespaceURI");
354
+ function Ne(e) {
355
+ const t = globalThis[Vt];
356
+ return arguments.length && (globalThis[Vt] = e), t;
357
357
  }
358
- var We = /* @__PURE__ */ Symbol.for("Serenity.jsxTypeKey"), $e = "ShadowRoot";
359
- function He(e) {
360
- return e != null && e[We] === $e;
358
+ var $e = /* @__PURE__ */ Symbol.for("Serenity.jsxTypeKey"), He = "ShadowRoot";
359
+ function Be(e) {
360
+ return e != null && e[$e] === He;
361
361
  }
362
- var bt = /* @__PURE__ */ Symbol.for("Serenity.disposingListeners"), xt = /* @__PURE__ */ Symbol.for("Serenity.lifecycleRoot");
363
- function Ot() {
362
+ var bt = /* @__PURE__ */ Symbol.for("Serenity.disposingListeners"), Pt = /* @__PURE__ */ Symbol.for("Serenity.lifecycleRoot");
363
+ function Nt() {
364
364
  return globalThis[bt] || (globalThis[bt] = /* @__PURE__ */ new WeakMap());
365
365
  }
366
- function Wt(e) {
367
- e && e.target && (!e.currentTarget || e.currentTarget === e.target) && Ne(e == null ? void 0 : e.target);
366
+ function $t(e) {
367
+ e && e.target && (!e.currentTarget || e.currentTarget === e.target) && _e(e == null ? void 0 : e.target);
368
368
  }
369
- function Ne(e, t) {
369
+ function _e(e, t) {
370
370
  if (!e)
371
371
  return;
372
- const s = Ot();
372
+ const i = Nt();
373
373
  function o(r) {
374
- const h = s.get(r);
374
+ const h = i.get(r);
375
375
  if (h) {
376
- s.delete(r), r.removeEventListener("disposing", Wt);
376
+ i.delete(r), r.removeEventListener("disposing", $t);
377
377
  for (const u of h)
378
378
  try {
379
379
  u.callback(r);
@@ -383,70 +383,70 @@ function Ne(e, t) {
383
383
  }
384
384
  o(e);
385
385
  }
386
- function kt(e, t, s) {
386
+ function At(e, t, i) {
387
387
  if (!e || !t)
388
388
  return e;
389
- const o = Ot();
389
+ const o = Nt();
390
390
  let r = o.get(e);
391
391
  if (!r)
392
392
  return typeof e.addEventListener != "function" || (o.set(e, r = [{
393
393
  callback: t,
394
- regKey: s
395
- }]), e.addEventListener("disposing", Wt, { once: !0 })), e;
394
+ regKey: i
395
+ }]), e.addEventListener("disposing", $t, { once: !0 })), e;
396
396
  const h = r.find((u) => u.callback === t);
397
- return h ? (h.regKey, e) : (r.push({ callback: t, regKey: s }), e);
397
+ return h ? (h.regKey, e) : (r.push({ callback: t, regKey: i }), e);
398
398
  }
399
- function jt(e, t, s) {
399
+ function Zt(e, t, i) {
400
400
  if (!e || !t)
401
401
  return e;
402
- const o = Ot(), r = o.get(e);
402
+ const o = Nt(), r = o.get(e);
403
403
  if (r) {
404
404
  for (let h = r.length - 1; h >= 0; h--) {
405
405
  const u = r[h];
406
406
  t && t === u.callback && r.splice(h, 1);
407
407
  }
408
- r.length === 0 && (o.delete(e), typeof e.removeEventListener == "function" && e.removeEventListener("disposing", Wt));
408
+ r.length === 0 && (o.delete(e), typeof e.removeEventListener == "function" && e.removeEventListener("disposing", $t));
409
409
  }
410
410
  return e;
411
411
  }
412
- function Be(...e) {
412
+ function Ge(...e) {
413
413
  if (e.length > 0) {
414
- const t = globalThis[xt] || null;
415
- return globalThis[xt] = e[0] || null, t;
414
+ const t = globalThis[Pt] || null;
415
+ return globalThis[Pt] = e[0] || null, t;
416
416
  }
417
- return globalThis[xt] || null;
417
+ return globalThis[Pt] || null;
418
418
  }
419
419
  function Z(e) {
420
420
  return e != null && typeof e == "object" && typeof e.subscribe == "function" && typeof e.peek == "function" && "value" in e;
421
421
  }
422
- var ot, $, U, Ct, At, te, _e = (te = class {
423
- constructor(e, t, s) {
424
- rt(this, U);
422
+ var ot, $, G, Et, Mt, ie, Ue = (ie = class {
423
+ constructor(e, t, i) {
424
+ rt(this, G);
425
425
  rt(this, ot);
426
426
  rt(this, $);
427
- this.signal = e, this.isInitial = !0, this.hasChanged = !1, this.lifecycleRoot = t, at(this, $, s);
427
+ this.signal = e, this.isInitial = !0, this.hasChanged = !1, this.lifecycleRoot = t, at(this, $, i);
428
428
  }
429
429
  get lifecycleNode() {
430
- return _(this, $);
430
+ return B(this, $);
431
431
  }
432
432
  get effectDisposer() {
433
- return _(this, ot);
433
+ return B(this, ot);
434
434
  }
435
435
  set effectDisposer(e) {
436
- J(this, U, Ct).call(this), at(this, ot, e), J(this, U, At).call(this);
436
+ J(this, G, Et).call(this), at(this, ot, e), J(this, G, Mt).call(this);
437
437
  }
438
438
  set lifecycleNode(e) {
439
- e !== _(this, $) && (J(this, U, Ct).call(this), at(this, $, e), J(this, U, At).call(this));
439
+ e !== B(this, $) && (J(this, G, Et).call(this), at(this, $, e), J(this, G, Mt).call(this));
440
440
  }
441
- }, ot = new WeakMap(), $ = new WeakMap(), U = new WeakSet(), Ct = function() {
441
+ }, ot = new WeakMap(), $ = new WeakMap(), G = new WeakSet(), Et = function() {
442
442
  var e;
443
- jt(_(this, $), this.effectDisposer), jt(_(this, $), (e = this.signal) == null ? void 0 : e.derivedDisposer);
444
- }, At = function() {
443
+ Zt(B(this, $), this.effectDisposer), Zt(B(this, $), (e = this.signal) == null ? void 0 : e.derivedDisposer);
444
+ }, Mt = function() {
445
445
  var e;
446
- kt(_(this, $), this.effectDisposer), kt(_(this, $), (e = this.signal) == null ? void 0 : e.derivedDisposer);
447
- }, te);
448
- function nt(e, t, s) {
449
- const o = s != null && s.useLifecycleRoot ? Be() : void 0, r = new _e(e, o, s == null ? void 0 : s.lifecycleNode), h = r.signal.subscribe(function(u) {
446
+ At(B(this, $), this.effectDisposer), At(B(this, $), (e = this.signal) == null ? void 0 : e.derivedDisposer);
447
+ }, ie);
448
+ function nt(e, t, i) {
449
+ const o = i != null && i.useLifecycleRoot ? Ge() : void 0, r = new Ue(e, o, i == null ? void 0 : i.lifecycleNode), h = r.signal.subscribe(function(u) {
450
450
  r.newValue = u, r.isInitial && (this != null && this.dispose) && (r.effectDisposer = this.dispose.bind(this)), r.hasChanged = !r.isInitial && r.prevValue !== r.newValue;
451
451
  try {
452
452
  t(r);
@@ -456,78 +456,78 @@ function nt(e, t, s) {
456
456
  });
457
457
  return h && !r.effectDisposer && (r.effectDisposer = h), r.effectDisposer;
458
458
  }
459
- function Vt(e, t) {
459
+ function qt(e, t) {
460
460
  e instanceof window.HTMLTemplateElement ? e.content.appendChild(t) : e.appendChild(t);
461
461
  }
462
- var Pt = 0, Et = "__domwisefrag_";
463
- function he(e) {
464
- return e instanceof Comment && e.data.startsWith(Et);
462
+ var xt = 0, Dt = "__domwisefrag_";
463
+ function ce(e) {
464
+ return e instanceof Comment && e.data.startsWith(Dt);
465
465
  }
466
- function Zt(e) {
467
- return e instanceof DocumentFragment && he(e.firstChild);
466
+ function Xt(e) {
467
+ return e instanceof DocumentFragment && ce(e.firstChild);
468
468
  }
469
- function Ge(e, t) {
470
- var s;
471
- typeof e.replaceWith == "function" ? e.replaceWith(t) : (s = e.parentNode) == null || s.replaceChild(t, e);
469
+ function je(e, t) {
470
+ var i;
471
+ typeof e.replaceWith == "function" ? e.replaceWith(t) : (i = e.parentNode) == null || i.replaceChild(t, e);
472
472
  }
473
- function qt(e) {
474
- return e instanceof DocumentFragment ? (++Pt, e.prepend(document.createComment(Et + Pt)), e.append(document.createComment(Et + Pt)), e) : e instanceof Node ? e : it(e) ? document.createTextNode(e) : document.createComment("");
473
+ function Yt(e) {
474
+ return e instanceof DocumentFragment ? (++xt, e.prepend(document.createComment(Dt + xt)), e.append(document.createComment(Dt + xt)), e) : e instanceof Node ? e : it(e) ? document.createTextNode(e) : document.createComment("");
475
475
  }
476
- function Ue(e, t) {
477
- let s;
476
+ function Ve(e, t) {
477
+ let i;
478
478
  nt(t, (o) => {
479
479
  var u;
480
480
  if (o.isInitial) {
481
- s = qt(o.newValue);
482
- let p = Zt(s) ? s.firstChild : s;
483
- ut(e, s), o.lifecycleNode = (s = p) ?? e;
481
+ i = Yt(o.newValue);
482
+ let c = Xt(i) ? i.firstChild : i;
483
+ ut(e, i), o.lifecycleNode = (i = c) ?? e;
484
484
  return;
485
485
  }
486
486
  if (!o.hasChanged)
487
487
  return;
488
- const r = qt(o.newValue);
489
- if (he(s)) {
490
- let p;
491
- for (; (p = s.nextSibling) && ((u = p.parentNode) == null || u.removeChild(p), !(p instanceof Comment && p.data === s.data)); )
488
+ const r = Yt(o.newValue);
489
+ if (ce(i)) {
490
+ let c;
491
+ for (; (c = i.nextSibling) && ((u = c.parentNode) == null || u.removeChild(c), !(c instanceof Comment && c.data === i.data)); )
492
492
  ;
493
493
  }
494
- let h = Zt(r) ? r.firstChild : r;
495
- Ge(s, r), o.lifecycleNode = (s = h) ?? e;
494
+ let h = Xt(r) ? r.firstChild : r;
495
+ je(i, r), o.lifecycleNode = (i = h) ?? e;
496
496
  });
497
497
  }
498
498
  function ut(e, t) {
499
499
  if (it(t))
500
- if (zt(t))
501
- for (const s of [...t])
502
- ut(e, s);
503
- else if (vt(t) || ae(t))
504
- Vt(e, document.createTextNode(t));
505
- else if (Ae(t))
506
- Vt(e, t);
507
- else if (He(t)) {
508
- const s = e.attachShadow(t.attr);
509
- ut(s, t.children), Ft(t.ref, s);
510
- } else Z(t) && Ue(e, t);
500
+ if (Ot(t))
501
+ for (const i of [...t])
502
+ ut(e, i);
503
+ else if (vt(t) || le(t))
504
+ qt(e, document.createTextNode(t));
505
+ else if (Me(t))
506
+ qt(e, t);
507
+ else if (Be(t)) {
508
+ const i = e.attachShadow(t.attr);
509
+ ut(i, t.children), Wt(t.ref, i);
510
+ } else Z(t) && Ve(e, t);
511
511
  }
512
- function le(e) {
513
- return e == null || (zt(e) ? e = Array.from(e).map((t) => Z(t) ? t.peek() : t) : O(e) && (e = { ...e }, Object.entries(e).forEach(([t, s]) => {
514
- Z(s) && (e[t] = s.peek());
512
+ function de(e) {
513
+ return e == null || (Ot(e) ? e = Array.from(e).map((t) => Z(t) ? t.peek() : t) : W(e) && (e = { ...e }, Object.entries(e).forEach(([t, i]) => {
514
+ Z(i) && (e[t] = i.peek());
515
515
  }))), e;
516
516
  }
517
- function je(e, t) {
517
+ function Ze(e, t) {
518
518
  if (t == null || t === !1 || t === !0)
519
519
  return;
520
- t = le(t);
521
- const s = (st(t) ?? "").split(" ");
522
- for (let o of s)
520
+ t = de(t);
521
+ const i = (st(t) ?? "").split(" ");
522
+ for (let o of i)
523
523
  o && e.classList.remove(o);
524
524
  }
525
- function Ve(e, t, s) {
525
+ function qe(e, t, i) {
526
526
  if (t == null || t === !1) {
527
- je(e, s);
527
+ Ze(e, i);
528
528
  return;
529
529
  }
530
- s = le(s), zt(t) ? t = Array.from(t).map((o) => {
530
+ i = de(i), Ot(t) ? t = Array.from(t).map((o) => {
531
531
  let r = o;
532
532
  return Z(o) && nt(o, (h) => {
533
533
  if (h.isInitial) {
@@ -538,7 +538,7 @@ function Ve(e, t, s) {
538
538
  }, {
539
539
  lifecycleNode: e
540
540
  }), r;
541
- }) : O(t) && (t = { ...t }, Object.entries(t).forEach(([o, r]) => {
541
+ }) : W(t) && (t = { ...t }, Object.entries(t).forEach(([o, r]) => {
542
542
  Z(r) && nt(r, (h) => {
543
543
  if (h.isInitial) {
544
544
  t[o] = h.newValue;
@@ -548,22 +548,22 @@ function Ve(e, t, s) {
548
548
  }, {
549
549
  lifecycleNode: e
550
550
  });
551
- })), St(e, t, s);
551
+ })), St(e, t, i);
552
552
  }
553
- function St(e, t, s) {
553
+ function St(e, t, i) {
554
554
  const o = (st(t) ?? "").split(" ");
555
- if (s) {
556
- const r = (st(s) ?? "").split(" ");
555
+ if (i) {
556
+ const r = (st(i) ?? "").split(" ");
557
557
  for (let h of r)
558
558
  h && !o.includes(h) && e.classList.remove(h);
559
559
  }
560
560
  for (let r of o)
561
561
  r && e.classList.add(r);
562
562
  }
563
- function Ze(e, t) {
563
+ function Xe(e, t) {
564
564
  return e + t.charAt(0).toUpperCase() + t.substring(1);
565
565
  }
566
- var qe = /* @__PURE__ */ (() => {
566
+ var Ye = /* @__PURE__ */ (() => {
567
567
  let e = {
568
568
  animationIterationCount: 0,
569
569
  borderImageOutset: 0,
@@ -610,51 +610,51 @@ var qe = /* @__PURE__ */ (() => {
610
610
  strokeWidth: 0
611
611
  };
612
612
  const t = ["Webkit", "ms", "Moz", "O"];
613
- return Object.keys(e).forEach((s) => {
613
+ return Object.keys(e).forEach((i) => {
614
614
  t.forEach((o) => {
615
- e[Ze(o, s)] = 0;
615
+ e[Xe(o, i)] = 0;
616
616
  });
617
617
  }), e;
618
618
  })();
619
- function Mt(e, t, s) {
620
- t.indexOf("-") === 0 ? e.style.setProperty(t, s) : ae(s) && qe[t] !== 0 ? e.style[t] = s + "px" : e.style[t] = s;
619
+ function Rt(e, t, i) {
620
+ t.indexOf("-") === 0 ? e.style.setProperty(t, i) : le(i) && Ye[t] !== 0 ? e.style[t] = i + "px" : e.style[t] = i;
621
621
  }
622
- function Xt(e, t) {
622
+ function Qt(e, t) {
623
623
  if (!(t == null || t === !1 || t === !0)) {
624
624
  if (vt(t)) {
625
625
  e.removeAttribute("style");
626
626
  return;
627
627
  }
628
- O(t) && Object.keys(t).forEach((s) => {
629
- Mt(e, s, "");
628
+ W(t) && Object.keys(t).forEach((i) => {
629
+ Rt(e, i, "");
630
630
  });
631
631
  }
632
632
  }
633
- function Xe(e, t, s) {
633
+ function Qe(e, t, i) {
634
634
  if (t == null || t === !1 || t === !0) {
635
- Xt(e, s);
635
+ Qt(e, i);
636
636
  return;
637
637
  }
638
638
  if (vt(t)) {
639
639
  e.setAttribute("style", t);
640
640
  return;
641
641
  }
642
- if (O(t)) {
643
- O(s) ? (t = { ...t }, Object.keys(s).forEach((o) => {
642
+ if (W(t)) {
643
+ W(i) ? (t = { ...t }, Object.keys(i).forEach((o) => {
644
644
  o in t || (t[o] = "");
645
- })) : Xt(e, s), Object.entries(t).forEach(([o, r]) => {
646
- Z(r) ? nt(r, (h) => Mt(e, o, h.newValue), {
645
+ })) : Qt(e, i), Object.entries(t).forEach(([o, r]) => {
646
+ Z(r) ? nt(r, (h) => Rt(e, o, h.newValue), {
647
647
  lifecycleNode: e
648
- }) : Mt(e, o, r);
648
+ }) : Rt(e, o, r);
649
649
  });
650
650
  return;
651
651
  }
652
652
  }
653
- var Ye = "http://www.w3.org/1999/xlink", Qe = "http://www.w3.org/XML/1998/namespace";
653
+ var Ke = "http://www.w3.org/1999/xlink", Je = "http://www.w3.org/XML/1998/namespace";
654
654
  function ht(e, t) {
655
- return e.replace(/[A-Z]/g, (s) => t + s.toLowerCase());
655
+ return e.replace(/[A-Z]/g, (i) => t + i.toLowerCase());
656
656
  }
657
- var Ke = /* @__PURE__ */ new Map([
657
+ var ti = /* @__PURE__ */ new Map([
658
658
  ["autoComplete", "autocomplete"],
659
659
  ["autoFocus", "autofocus"],
660
660
  ["className", "class"],
@@ -673,58 +673,58 @@ var Ke = /* @__PURE__ */ new Map([
673
673
  ["onDoubleClick", "onDblClick"],
674
674
  ["onDoubleClickCapture", "onDblClickCapture"]
675
675
  ]);
676
- function Yt(e, t, s, o) {
676
+ function Kt(e, t, i, o) {
677
677
  switch (t) {
678
678
  case "dataset":
679
679
  o != null && Object.entries(o).forEach(([h, u]) => {
680
680
  u != null && delete e.dataset[h];
681
- }), Object.entries(s).forEach(([h, u]) => {
681
+ }), Object.entries(i).forEach(([h, u]) => {
682
682
  u != null && (e.dataset[h] = u);
683
683
  });
684
684
  return;
685
685
  case "textContent":
686
- it(s) ? e[t] = s : it(o) && (e[t] = "");
686
+ it(i) ? e[t] = i : it(o) && (e[t] = "");
687
687
  return;
688
688
  case "dangerouslySetInnerHTML":
689
- O(s) ? e.innerHTML = s.__html : O(o) && (e.innerHTML = "");
689
+ W(i) ? e.innerHTML = i.__html : W(o) && (e.innerHTML = "");
690
690
  return;
691
691
  case "value":
692
- if (s == null) {
692
+ if (i == null) {
693
693
  o != null && (e[t] = null);
694
694
  return;
695
695
  } else {
696
696
  if (e instanceof window.HTMLSelectElement)
697
697
  return;
698
698
  if (e instanceof window.HTMLTextAreaElement) {
699
- e.value = s;
699
+ e.value = i;
700
700
  return;
701
701
  }
702
702
  }
703
703
  break;
704
704
  case "class":
705
- Ve(e, s, o);
705
+ qe(e, i, o);
706
706
  return;
707
707
  case "spellcheck":
708
- e.spellcheck = s === "" || s === !0 || s === "true" ? !0 : s === !1 || s === "false" ? !1 : s;
708
+ e.spellcheck = i === "" || i === !0 || i === "true" ? !0 : i === !1 || i === "false" ? !1 : i;
709
709
  return;
710
710
  case "draggable":
711
- s === !1 || s === "false" ? s = "false" : s === "" ? s = null : (s === !0 || s === "true") && (s = "true");
711
+ i === !1 || i === "false" ? i = "false" : i === "" ? i = null : (i === !0 || i === "true") && (i = "true");
712
712
  break;
713
713
  case "contenteditable":
714
- s === !1 ? s = "false" : (s === "" || s === !0) && (s = "true");
714
+ i === !1 ? i = "false" : (i === "" || i === !0) && (i = "true");
715
715
  break;
716
716
  case "ref":
717
717
  case "namespaceURI":
718
718
  return;
719
719
  case "style":
720
- Xe(e, s, o);
720
+ Qe(e, i, o);
721
721
  return;
722
722
  case "on":
723
723
  case "onCapture":
724
724
  const r = t === "onCapture";
725
725
  o != null && Object.entries(o).forEach(([h, u]) => {
726
- (s == null || s[h] !== u) && e.removeEventListener(h, u, r);
727
- }), Object.entries(s).forEach(([h, u]) => {
726
+ (i == null || i[h] !== u) && e.removeEventListener(h, u, r);
727
+ }), Object.entries(i).forEach(([h, u]) => {
728
728
  (o == null || o[h] !== u) && e.addEventListener(h, u, r);
729
729
  });
730
730
  return;
@@ -735,84 +735,84 @@ function Yt(e, t, s, o) {
735
735
  case "xlinkShow":
736
736
  case "xlinkTitle":
737
737
  case "xlinkType":
738
- e.setAttributeNS(Ye, ht(t, ":"), s);
738
+ e.setAttributeNS(Ke, ht(t, ":"), i);
739
739
  return;
740
740
  case "xmlnsXlink":
741
- e.setAttribute("xmlns:xlink", s);
741
+ e.setAttribute("xmlns:xlink", i);
742
742
  return;
743
743
  case "xmlBase":
744
744
  case "xmlLang":
745
745
  case "xmlSpace":
746
- e.setAttributeNS(Qe, ht(t, ":"), s);
746
+ e.setAttributeNS(Je, ht(t, ":"), i);
747
747
  return;
748
748
  }
749
- if (typeof s == "function") {
749
+ if (typeof i == "function") {
750
750
  if (t[0] === "o" && t[1] === "n") {
751
- if (o != null && o === s)
751
+ if (o != null && o === i)
752
752
  return;
753
753
  let r = t.toLowerCase();
754
754
  const h = r.endsWith("capture");
755
755
  let u;
756
- !h && (e[r] === null || o != null && e[r] === o) ? (e[r] = s, kt(e, ti.bind(e, r))) : h ? (u = r.substring(2, r.length - 7), o != null && e.removeEventListener(u, o, !0), e.addEventListener(u, s, !0)) : (r in window ? u = r.substring(2) : u = r[2] + t.slice(3), o != null && e.removeEventListener(u, o), e.addEventListener(u, s));
756
+ !h && (e[r] === null || o != null && e[r] === o) ? (e[r] = i, At(e, ii.bind(e, r))) : h ? (u = r.substring(2, r.length - 7), o != null && e.removeEventListener(u, o, !0), e.addEventListener(u, i, !0)) : (r in window ? u = r.substring(2) : u = r[2] + t.slice(3), o != null && e.removeEventListener(u, o), e.addEventListener(u, i));
757
757
  } else
758
- console.warn(`A function was provided for JSX ${e.tagName} element ${t} which does not start with "on":`, s, e.tagName);
758
+ console.warn(`A function was provided for JSX ${e.tagName} element ${t} which does not start with "on":`, i, e.tagName);
759
759
  return;
760
760
  }
761
- if (O(o)) {
762
- if (o === s)
761
+ if (W(o)) {
762
+ if (o === i)
763
763
  return;
764
764
  delete e[t];
765
765
  }
766
766
  if (o === !0) {
767
- if (o === s)
767
+ if (o === i)
768
768
  return;
769
769
  e.removeAttribute(t);
770
770
  }
771
771
  if (o !== !1 && o != null) {
772
- if (o === s)
772
+ if (o === i)
773
773
  return;
774
- e instanceof SVGElement && !Gt.test(t) ? e.removeAttributeNS(ht(t, "-"), s) : e.removeAttribute(t);
774
+ e instanceof SVGElement && !jt.test(t) ? e.removeAttributeNS(ht(t, "-"), i) : e.removeAttribute(t);
775
775
  }
776
- if (O(s)) {
777
- e[t] = s;
776
+ if (W(i)) {
777
+ e[t] = i;
778
778
  return;
779
779
  }
780
- if (s === !0) {
780
+ if (i === !0) {
781
781
  e.setAttribute(t, "");
782
782
  return;
783
783
  }
784
- s !== !1 && s != null && (e instanceof SVGElement && !Gt.test(t) ? e.setAttribute(ht(t, "-"), s) : e.setAttribute(t, s));
784
+ i !== !1 && i != null && (e instanceof SVGElement && !jt.test(t) ? e.setAttribute(ht(t, "-"), i) : e.setAttribute(t, i));
785
785
  }
786
- function Je(e, t) {
787
- for (let [s, o] of Object.entries(t))
788
- s = Ke.get(s) ?? s, Z(o) ? nt(o, (r) => Yt(e, s, r.newValue, r.prevValue), {
786
+ function ei(e, t) {
787
+ for (let [i, o] of Object.entries(t))
788
+ i = ti.get(i) ?? i, Z(o) ? nt(o, (r) => Kt(e, i, r.newValue, r.prevValue), {
789
789
  lifecycleNode: e
790
- }) : Me(o) ? o[re](e, s) : Yt(e, s, o);
790
+ }) : Re(o) ? o[he](e, i) : Kt(e, i, o);
791
791
  return e;
792
792
  }
793
- function ti(e) {
793
+ function ii(e) {
794
794
  this[e] = null;
795
795
  }
796
- function d(e, t) {
797
- let { children: s, ...o } = t || {}, r = o.namespaceURI;
798
- r || (ze.has(e) ? r = Fe : Le.has(e) ? r = Ie : r = Oe());
796
+ function g(e, t) {
797
+ let { children: i, ...o } = t || {}, r = o.namespaceURI;
798
+ r || (Oe.has(e) ? r = We : Fe.has(e) ? r = ze : r = Ne());
799
799
  let h;
800
800
  if (vt(e)) {
801
- if (h = r ? document.createElementNS(r, e) : document.createElement(e), Je(h, o), ut(h, s), h instanceof window.HTMLSelectElement && o.value != null)
801
+ if (h = r ? document.createElementNS(r, e) : document.createElement(e), ei(h, o), ut(h, i), h instanceof window.HTMLSelectElement && o.value != null)
802
802
  if (o.multiple === !0 && Array.isArray(o.value)) {
803
- const u = o.value.map((p) => String(p));
804
- h.querySelectorAll("option").forEach((p) => p.selected = u.includes(p.value));
803
+ const u = o.value.map((c) => String(c));
804
+ h.querySelectorAll("option").forEach((c) => c.selected = u.includes(c.value));
805
805
  } else
806
806
  h.value = o.value;
807
- Ft(o.ref, h);
807
+ Wt(o.ref, h);
808
808
  } else if (typeof e == "function")
809
- O(e.defaultProps) && (o = { ...e.defaultProps, ...o }), h = Ee(e) ? Re(e, o, s) : e({ ...o, children: s });
809
+ W(e.defaultProps) && (o = { ...e.defaultProps, ...o }), h = De(e) ? Le(e, o, i) : e({ ...o, children: i });
810
810
  else
811
811
  throw new TypeError(`Invalid JSX element type: ${e}`);
812
812
  return h;
813
813
  }
814
- var ei = /* @__PURE__ */ Symbol.for("preact-signals");
815
- function $t() {
814
+ var si = /* @__PURE__ */ Symbol.for("preact-signals");
815
+ function Ht() {
816
816
  if (V > 1)
817
817
  V--;
818
818
  else {
@@ -822,158 +822,158 @@ function $t() {
822
822
  for (pt = void 0; r !== void 0; )
823
823
  r.S.v === r.v && (r.S.i = r.i), r = r.o;
824
824
  }(); et !== void 0; ) {
825
- var s = et;
826
- for (et = void 0, gt++; s !== void 0; ) {
827
- var o = s.u;
828
- if (s.u = void 0, s.f &= -3, !(8 & s.f) && ue(s)) try {
829
- s.c();
825
+ var i = et;
826
+ for (et = void 0, gt++; i !== void 0; ) {
827
+ var o = i.u;
828
+ if (i.u = void 0, i.f &= -3, !(8 & i.f) && pe(i)) try {
829
+ i.c();
830
830
  } catch (r) {
831
831
  t || (e = r, t = !0);
832
832
  }
833
- s = o;
833
+ i = o;
834
834
  }
835
835
  }
836
836
  if (gt = 0, V--, t) throw e;
837
837
  }
838
838
  }
839
- var P = void 0;
840
- function ce(e) {
841
- var t = P;
842
- P = void 0;
839
+ var x = void 0;
840
+ function ue(e) {
841
+ var t = x;
842
+ x = void 0;
843
843
  try {
844
844
  return e();
845
845
  } finally {
846
- P = t;
846
+ x = t;
847
847
  }
848
848
  }
849
- var et = void 0, V = 0, gt = 0, Qt = 0, pt = void 0, ft = 0;
850
- function de(e) {
851
- if (P !== void 0) {
849
+ var et = void 0, V = 0, gt = 0, Jt = 0, pt = void 0, ft = 0;
850
+ function ge(e) {
851
+ if (x !== void 0) {
852
852
  var t = e.n;
853
- if (t === void 0 || t.t !== P)
854
- return t = { i: 0, S: e, p: P.s, n: void 0, t: P, e: void 0, x: void 0, r: t }, P.s !== void 0 && (P.s.n = t), P.s = t, e.n = t, 32 & P.f && e.S(t), t;
853
+ if (t === void 0 || t.t !== x)
854
+ return t = { i: 0, S: e, p: x.s, n: void 0, t: x, e: void 0, x: void 0, r: t }, x.s !== void 0 && (x.s.n = t), x.s = t, e.n = t, 32 & x.f && e.S(t), t;
855
855
  if (t.i === -1)
856
- return t.i = 0, t.n !== void 0 && (t.n.p = t.p, t.p !== void 0 && (t.p.n = t.n), t.p = P.s, t.n = void 0, P.s.n = t, P.s = t), t;
856
+ return t.i = 0, t.n !== void 0 && (t.n.p = t.p, t.p !== void 0 && (t.p.n = t.n), t.p = x.s, t.n = void 0, x.s.n = t, x.s = t), t;
857
857
  }
858
858
  }
859
- function z(e, t) {
859
+ function F(e, t) {
860
860
  this.v = e, this.i = 0, this.n = void 0, this.t = void 0, this.l = 0, this.W = t == null ? void 0 : t.watched, this.Z = t == null ? void 0 : t.unwatched, this.name = t == null ? void 0 : t.name;
861
861
  }
862
- z.prototype.brand = ei;
863
- z.prototype.h = function() {
862
+ F.prototype.brand = si;
863
+ F.prototype.h = function() {
864
864
  return !0;
865
865
  };
866
- z.prototype.S = function(e) {
867
- var t = this, s = this.t;
868
- s !== e && e.e === void 0 && (e.x = s, this.t = e, s !== void 0 ? s.e = e : ce(function() {
866
+ F.prototype.S = function(e) {
867
+ var t = this, i = this.t;
868
+ i !== e && e.e === void 0 && (e.x = i, this.t = e, i !== void 0 ? i.e = e : ue(function() {
869
869
  var o;
870
870
  (o = t.W) == null || o.call(t);
871
871
  }));
872
872
  };
873
- z.prototype.U = function(e) {
873
+ F.prototype.U = function(e) {
874
874
  var t = this;
875
875
  if (this.t !== void 0) {
876
- var s = e.e, o = e.x;
877
- s !== void 0 && (s.x = o, e.e = void 0), o !== void 0 && (o.e = s, e.x = void 0), e === this.t && (this.t = o, o === void 0 && ce(function() {
876
+ var i = e.e, o = e.x;
877
+ i !== void 0 && (i.x = o, e.e = void 0), o !== void 0 && (o.e = i, e.x = void 0), e === this.t && (this.t = o, o === void 0 && ue(function() {
878
878
  var r;
879
879
  (r = t.Z) == null || r.call(t);
880
880
  }));
881
881
  }
882
882
  };
883
- z.prototype.subscribe = function(e) {
883
+ F.prototype.subscribe = function(e) {
884
884
  var t = this;
885
- return si(function() {
886
- var s = t.value, o = P;
887
- P = void 0;
885
+ return oi(function() {
886
+ var i = t.value, o = x;
887
+ x = void 0;
888
888
  try {
889
- e(s);
889
+ e(i);
890
890
  } finally {
891
- P = o;
891
+ x = o;
892
892
  }
893
893
  }, { name: "sub" });
894
894
  };
895
- z.prototype.valueOf = function() {
895
+ F.prototype.valueOf = function() {
896
896
  return this.value;
897
897
  };
898
- z.prototype.toString = function() {
898
+ F.prototype.toString = function() {
899
899
  return this.value + "";
900
900
  };
901
- z.prototype.toJSON = function() {
901
+ F.prototype.toJSON = function() {
902
902
  return this.value;
903
903
  };
904
- z.prototype.peek = function() {
905
- var e = P;
906
- P = void 0;
904
+ F.prototype.peek = function() {
905
+ var e = x;
906
+ x = void 0;
907
907
  try {
908
908
  return this.value;
909
909
  } finally {
910
- P = e;
910
+ x = e;
911
911
  }
912
912
  };
913
- Object.defineProperty(z.prototype, "value", { get: function() {
914
- var e = de(this);
913
+ Object.defineProperty(F.prototype, "value", { get: function() {
914
+ var e = ge(this);
915
915
  return e !== void 0 && (e.i = this.i), this.v;
916
916
  }, set: function(e) {
917
917
  if (e !== this.v) {
918
918
  if (gt > 100) throw new Error("Cycle detected");
919
- (function(s) {
920
- V !== 0 && gt === 0 && s.l !== Qt && (s.l = Qt, pt = { S: s, v: s.v, i: s.i, o: pt });
919
+ (function(i) {
920
+ V !== 0 && gt === 0 && i.l !== Jt && (i.l = Jt, pt = { S: i, v: i.v, i: i.i, o: pt });
921
921
  })(this), this.v = e, this.i++, ft++, V++;
922
922
  try {
923
923
  for (var t = this.t; t !== void 0; t = t.x) t.t.N();
924
924
  } finally {
925
- $t();
925
+ Ht();
926
926
  }
927
927
  }
928
928
  } });
929
- function ue(e) {
929
+ function pe(e) {
930
930
  for (var t = e.s; t !== void 0; t = t.n) if (t.S.i !== t.i || !t.S.h() || t.S.i !== t.i) return !0;
931
931
  return !1;
932
932
  }
933
- function ge(e) {
933
+ function fe(e) {
934
934
  for (var t = e.s; t !== void 0; t = t.n) {
935
- var s = t.S.n;
936
- if (s !== void 0 && (t.r = s), t.S.n = t, t.i = -1, t.n === void 0) {
935
+ var i = t.S.n;
936
+ if (i !== void 0 && (t.r = i), t.S.n = t, t.i = -1, t.n === void 0) {
937
937
  e.s = t;
938
938
  break;
939
939
  }
940
940
  }
941
941
  }
942
- function pe(e) {
943
- for (var t = e.s, s = void 0; t !== void 0; ) {
942
+ function me(e) {
943
+ for (var t = e.s, i = void 0; t !== void 0; ) {
944
944
  var o = t.p;
945
- t.i === -1 ? (t.S.U(t), o !== void 0 && (o.n = t.n), t.n !== void 0 && (t.n.p = o)) : s = t, t.S.n = t.r, t.r !== void 0 && (t.r = void 0), t = o;
945
+ t.i === -1 ? (t.S.U(t), o !== void 0 && (o.n = t.n), t.n !== void 0 && (t.n.p = o)) : i = t, t.S.n = t.r, t.r !== void 0 && (t.r = void 0), t = o;
946
946
  }
947
- e.s = s;
947
+ e.s = i;
948
948
  }
949
949
  function Y(e, t) {
950
- z.call(this, void 0), this.x = e, this.s = void 0, this.g = ft - 1, this.f = 4, this.W = t == null ? void 0 : t.watched, this.Z = t == null ? void 0 : t.unwatched, this.name = t == null ? void 0 : t.name;
950
+ F.call(this, void 0), this.x = e, this.s = void 0, this.g = ft - 1, this.f = 4, this.W = t == null ? void 0 : t.watched, this.Z = t == null ? void 0 : t.unwatched, this.name = t == null ? void 0 : t.name;
951
951
  }
952
- Y.prototype = new z();
952
+ Y.prototype = new F();
953
953
  Y.prototype.h = function() {
954
954
  if (this.f &= -3, 1 & this.f) return !1;
955
955
  if ((36 & this.f) == 32 || (this.f &= -5, this.g === ft)) return !0;
956
- if (this.g = ft, this.f |= 1, this.i > 0 && !ue(this))
956
+ if (this.g = ft, this.f |= 1, this.i > 0 && !pe(this))
957
957
  return this.f &= -2, !0;
958
- var e = P;
958
+ var e = x;
959
959
  try {
960
- ge(this), P = this;
960
+ fe(this), x = this;
961
961
  var t = this.x();
962
962
  (16 & this.f || this.v !== t || this.i === 0) && (this.v = t, this.f &= -17, this.i++);
963
- } catch (s) {
964
- this.v = s, this.f |= 16, this.i++;
963
+ } catch (i) {
964
+ this.v = i, this.f |= 16, this.i++;
965
965
  }
966
- return P = e, pe(this), this.f &= -2, !0;
966
+ return x = e, me(this), this.f &= -2, !0;
967
967
  };
968
968
  Y.prototype.S = function(e) {
969
969
  if (this.t === void 0) {
970
970
  this.f |= 36;
971
971
  for (var t = this.s; t !== void 0; t = t.n) t.S.S(t);
972
972
  }
973
- z.prototype.S.call(this, e);
973
+ F.prototype.S.call(this, e);
974
974
  };
975
975
  Y.prototype.U = function(e) {
976
- if (this.t !== void 0 && (z.prototype.U.call(this, e), this.t === void 0)) {
976
+ if (this.t !== void 0 && (F.prototype.U.call(this, e), this.t === void 0)) {
977
977
  this.f &= -33;
978
978
  for (var t = this.s; t !== void 0; t = t.n) t.S.U(t);
979
979
  }
@@ -986,32 +986,32 @@ Y.prototype.N = function() {
986
986
  };
987
987
  Object.defineProperty(Y.prototype, "value", { get: function() {
988
988
  if (1 & this.f) throw new Error("Cycle detected");
989
- var e = de(this);
989
+ var e = ge(this);
990
990
  if (this.h(), e !== void 0 && (e.i = this.i), 16 & this.f) throw this.v;
991
991
  return this.v;
992
992
  } });
993
- function fe(e) {
993
+ function we(e) {
994
994
  var t = e.m;
995
995
  if (e.m = void 0, typeof t == "function") {
996
996
  V++;
997
- var s = P;
998
- P = void 0;
997
+ var i = x;
998
+ x = void 0;
999
999
  try {
1000
1000
  t();
1001
1001
  } catch (o) {
1002
- throw e.f &= -2, e.f |= 8, Ht(e), o;
1002
+ throw e.f &= -2, e.f |= 8, Bt(e), o;
1003
1003
  } finally {
1004
- P = s, $t();
1004
+ x = i, Ht();
1005
1005
  }
1006
1006
  }
1007
1007
  }
1008
- function Ht(e) {
1008
+ function Bt(e) {
1009
1009
  for (var t = e.s; t !== void 0; t = t.n) t.S.U(t);
1010
- e.x = void 0, e.s = void 0, fe(e);
1010
+ e.x = void 0, e.s = void 0, we(e);
1011
1011
  }
1012
- function ii(e) {
1013
- if (P !== this) throw new Error("Out-of-order effect");
1014
- pe(this), P = e, this.f &= -2, 8 & this.f && Ht(this), $t();
1012
+ function ni(e) {
1013
+ if (x !== this) throw new Error("Out-of-order effect");
1014
+ me(this), x = e, this.f &= -2, 8 & this.f && Bt(this), Ht();
1015
1015
  }
1016
1016
  function Q(e, t) {
1017
1017
  this.x = e, this.m = void 0, this.s = void 0, this.u = void 0, this.f = 32, this.name = t == null ? void 0 : t.name;
@@ -1028,30 +1028,30 @@ Q.prototype.c = function() {
1028
1028
  };
1029
1029
  Q.prototype.S = function() {
1030
1030
  if (1 & this.f) throw new Error("Cycle detected");
1031
- this.f |= 1, this.f &= -9, fe(this), ge(this), V++;
1032
- var e = P;
1033
- return P = this, ii.bind(this, e);
1031
+ this.f |= 1, this.f &= -9, we(this), fe(this), V++;
1032
+ var e = x;
1033
+ return x = this, ni.bind(this, e);
1034
1034
  };
1035
1035
  Q.prototype.N = function() {
1036
1036
  2 & this.f || (this.f |= 2, this.u = et, et = this);
1037
1037
  };
1038
1038
  Q.prototype.d = function() {
1039
- this.f |= 8, 1 & this.f || Ht(this);
1039
+ this.f |= 8, 1 & this.f || Bt(this);
1040
1040
  };
1041
1041
  Q.prototype.dispose = function() {
1042
1042
  this.d();
1043
1043
  };
1044
- function si(e, t) {
1045
- var s = new Q(e, t);
1044
+ function oi(e, t) {
1045
+ var i = new Q(e, t);
1046
1046
  try {
1047
- s.c();
1047
+ i.c();
1048
1048
  } catch (r) {
1049
- throw s.d(), r;
1049
+ throw i.d(), r;
1050
1050
  }
1051
- var o = s.d.bind(s);
1051
+ var o = i.d.bind(i);
1052
1052
  return o[Symbol.dispose] = o, o;
1053
1053
  }
1054
- const ni = {
1054
+ const ri = {
1055
1055
  emptyStateTitle: "No data available.",
1056
1056
  thumbnails: "Thumbnails",
1057
1057
  singlePageMode: "Single Page Mode",
@@ -1066,7 +1066,7 @@ const ni = {
1066
1066
  play: "Play",
1067
1067
  pause: "Pause",
1068
1068
  tableOfContents: "Table of Contents"
1069
- }, oi = {
1069
+ }, ai = {
1070
1070
  emptyStateTitle: "Veri bulunamadi.",
1071
1071
  thumbnails: "Küçük Resimler",
1072
1072
  singlePageMode: "Tek Sayfa Modu",
@@ -1082,23 +1082,23 @@ const ni = {
1082
1082
  pause: "Duraklat",
1083
1083
  tableOfContents: "İçindekiler"
1084
1084
  }, Tt = {
1085
- en: ni,
1086
- tr: oi
1085
+ en: ri,
1086
+ tr: ai
1087
1087
  };
1088
- function me(e = {}) {
1088
+ function ve(e = {}) {
1089
1089
  var r;
1090
- const t = e.locale ?? "en", s = Tt[t] ?? Tt.en, o = ((r = e.messages) == null ? void 0 : r[t]) ?? {};
1090
+ const t = e.locale ?? "en", i = Tt[t] ?? Tt.en, o = ((r = e.messages) == null ? void 0 : r[t]) ?? {};
1091
1091
  return {
1092
1092
  ...Tt.en,
1093
- ...s,
1093
+ ...i,
1094
1094
  ...o
1095
1095
  };
1096
1096
  }
1097
- function ri(e) {
1098
- const t = w(() => me({ locale: e.store.locale.value, messages: e.store.messages.value }));
1099
- return /* @__PURE__ */ d("div", { class: "bk-toolbar", role: "toolbar", "aria-label": "Flipbook controls", children: [
1100
- /* @__PURE__ */ d("div", { class: "bk-btn-group", children: [
1101
- /* @__PURE__ */ d(
1097
+ function hi(e) {
1098
+ const t = w(() => ve({ locale: e.store.locale.value, messages: e.store.messages.value }));
1099
+ return /* @__PURE__ */ g("div", { class: "bk-toolbar", role: "toolbar", "aria-label": "Flipbook controls", children: [
1100
+ /* @__PURE__ */ g("div", { class: "bk-btn-group", children: [
1101
+ /* @__PURE__ */ g(
1102
1102
  "button",
1103
1103
  {
1104
1104
  type: "button",
@@ -1107,15 +1107,15 @@ function ri(e) {
1107
1107
  "aria-label": w(() => t.value.thumbnails || "Thumbnails"),
1108
1108
  "aria-pressed": w(() => e.store.showThumbs.value ? "true" : "false"),
1109
1109
  title: w(() => t.value.thumbnails || "Thumbnails"),
1110
- children: /* @__PURE__ */ d("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1111
- /* @__PURE__ */ d("rect", { x: "3", y: "3", width: "7", height: "7" }),
1112
- /* @__PURE__ */ d("rect", { x: "14", y: "3", width: "7", height: "7" }),
1113
- /* @__PURE__ */ d("rect", { x: "14", y: "14", width: "7", height: "7" }),
1114
- /* @__PURE__ */ d("rect", { x: "3", y: "14", width: "7", height: "7" })
1110
+ children: /* @__PURE__ */ g("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1111
+ /* @__PURE__ */ g("rect", { x: "3", y: "3", width: "7", height: "7" }),
1112
+ /* @__PURE__ */ g("rect", { x: "14", y: "3", width: "7", height: "7" }),
1113
+ /* @__PURE__ */ g("rect", { x: "14", y: "14", width: "7", height: "7" }),
1114
+ /* @__PURE__ */ g("rect", { x: "3", y: "14", width: "7", height: "7" })
1115
1115
  ] })
1116
1116
  }
1117
1117
  ),
1118
- w(() => e.store.toc.value.length ? /* @__PURE__ */ d(
1118
+ w(() => e.store.toc.value.length ? /* @__PURE__ */ g(
1119
1119
  "button",
1120
1120
  {
1121
1121
  type: "button",
@@ -1124,17 +1124,17 @@ function ri(e) {
1124
1124
  "aria-label": w(() => t.value.tableOfContents || "Table of Contents"),
1125
1125
  "aria-pressed": w(() => e.store.showToc.value ? "true" : "false"),
1126
1126
  title: w(() => t.value.tableOfContents || "Table of Contents"),
1127
- children: /* @__PURE__ */ d("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1128
- /* @__PURE__ */ d("line", { x1: "8", y1: "6", x2: "21", y2: "6" }),
1129
- /* @__PURE__ */ d("line", { x1: "8", y1: "12", x2: "21", y2: "12" }),
1130
- /* @__PURE__ */ d("line", { x1: "8", y1: "18", x2: "21", y2: "18" }),
1131
- /* @__PURE__ */ d("line", { x1: "3", y1: "6", x2: "3.01", y2: "6" }),
1132
- /* @__PURE__ */ d("line", { x1: "3", y1: "12", x2: "3.01", y2: "12" }),
1133
- /* @__PURE__ */ d("line", { x1: "3", y1: "18", x2: "3.01", y2: "18" })
1127
+ children: /* @__PURE__ */ g("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1128
+ /* @__PURE__ */ g("line", { x1: "8", y1: "6", x2: "21", y2: "6" }),
1129
+ /* @__PURE__ */ g("line", { x1: "8", y1: "12", x2: "21", y2: "12" }),
1130
+ /* @__PURE__ */ g("line", { x1: "8", y1: "18", x2: "21", y2: "18" }),
1131
+ /* @__PURE__ */ g("line", { x1: "3", y1: "6", x2: "3.01", y2: "6" }),
1132
+ /* @__PURE__ */ g("line", { x1: "3", y1: "12", x2: "3.01", y2: "12" }),
1133
+ /* @__PURE__ */ g("line", { x1: "3", y1: "18", x2: "3.01", y2: "18" })
1134
1134
  ] })
1135
1135
  }
1136
1136
  ) : null),
1137
- /* @__PURE__ */ d(
1137
+ /* @__PURE__ */ g(
1138
1138
  "button",
1139
1139
  {
1140
1140
  type: "button",
@@ -1143,16 +1143,16 @@ function ri(e) {
1143
1143
  "aria-label": w(() => t.value.singlePageMode || "Single Page"),
1144
1144
  "aria-pressed": w(() => e.store.isSingleMode.value ? "true" : "false"),
1145
1145
  title: w(() => t.value.singlePageMode || "Single Page"),
1146
- children: /* @__PURE__ */ d("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1147
- /* @__PURE__ */ d("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
1148
- /* @__PURE__ */ d("polyline", { points: "14 2 14 8 20 8" }),
1149
- /* @__PURE__ */ d("line", { x1: "16", y1: "13", x2: "8", y2: "13" }),
1150
- /* @__PURE__ */ d("line", { x1: "16", y1: "17", x2: "8", y2: "17" }),
1151
- /* @__PURE__ */ d("polyline", { points: "10 9 9 9 8 9" })
1146
+ children: /* @__PURE__ */ g("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1147
+ /* @__PURE__ */ g("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
1148
+ /* @__PURE__ */ g("polyline", { points: "14 2 14 8 20 8" }),
1149
+ /* @__PURE__ */ g("line", { x1: "16", y1: "13", x2: "8", y2: "13" }),
1150
+ /* @__PURE__ */ g("line", { x1: "16", y1: "17", x2: "8", y2: "17" }),
1151
+ /* @__PURE__ */ g("polyline", { points: "10 9 9 9 8 9" })
1152
1152
  ] })
1153
1153
  }
1154
1154
  ),
1155
- /* @__PURE__ */ d(
1155
+ /* @__PURE__ */ g(
1156
1156
  "button",
1157
1157
  {
1158
1158
  type: "button",
@@ -1162,34 +1162,34 @@ function ri(e) {
1162
1162
  "aria-pressed": w(() => e.store.isAutoPlaying.value ? "true" : "false"),
1163
1163
  title: w(() => e.store.isAutoPlaying.value ? t.value.pause || "Pause" : t.value.play || "Play"),
1164
1164
  children: [
1165
- /* @__PURE__ */ d("svg", { style: { display: w(() => e.store.isAutoPlaying.value ? "block" : "none") }, xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1166
- /* @__PURE__ */ d("rect", { x: "6", y: "4", width: "4", height: "16" }),
1167
- /* @__PURE__ */ d("rect", { x: "14", y: "4", width: "4", height: "16" })
1165
+ /* @__PURE__ */ g("svg", { style: { display: w(() => e.store.isAutoPlaying.value ? "block" : "none") }, xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1166
+ /* @__PURE__ */ g("rect", { x: "6", y: "4", width: "4", height: "16" }),
1167
+ /* @__PURE__ */ g("rect", { x: "14", y: "4", width: "4", height: "16" })
1168
1168
  ] }),
1169
- /* @__PURE__ */ d("svg", { style: { display: w(() => e.store.isAutoPlaying.value ? "none" : "block") }, xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: /* @__PURE__ */ d("polygon", { points: "5 3 19 12 5 21 5 3" }) })
1169
+ /* @__PURE__ */ g("svg", { style: { display: w(() => e.store.isAutoPlaying.value ? "none" : "block") }, xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: /* @__PURE__ */ g("polygon", { points: "5 3 19 12 5 21 5 3" }) })
1170
1170
  ]
1171
1171
  }
1172
1172
  )
1173
1173
  ] }),
1174
- /* @__PURE__ */ d("div", { class: "bk-btn-group bk-btn-group--center", children: [
1175
- /* @__PURE__ */ d("button", { type: "button", class: "bk-btn", onClick: e.onPrevPage, "aria-label": w(() => t.value.previous || "Previous"), title: w(() => t.value.previous || "Previous"), children: /* @__PURE__ */ d("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: /* @__PURE__ */ d("polyline", { points: "15 18 9 12 15 6" }) }) }),
1176
- /* @__PURE__ */ d("span", { class: "bz-page-info", "aria-live": "polite", "aria-atomic": "true", children: w(() => {
1177
- const s = e.store.currentPage.value, o = e.store.totalPages.value;
1178
- if (e.store.isSingleMode.value || s === 0 || s >= o - 1)
1179
- return `${s + 1} / ${o}`;
1180
- const r = s % 2 === 1 ? s : s - 1;
1174
+ /* @__PURE__ */ g("div", { class: "bk-btn-group bk-btn-group--center", children: [
1175
+ /* @__PURE__ */ g("button", { type: "button", class: "bk-btn", onClick: e.onPrevPage, "aria-label": w(() => t.value.previous || "Previous"), title: w(() => t.value.previous || "Previous"), children: /* @__PURE__ */ g("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: /* @__PURE__ */ g("polyline", { points: "15 18 9 12 15 6" }) }) }),
1176
+ /* @__PURE__ */ g("span", { class: "bz-page-info", "aria-live": "polite", "aria-atomic": "true", children: w(() => {
1177
+ const i = e.store.currentPage.value, o = e.store.totalPages.value;
1178
+ if (e.store.isSingleMode.value || i === 0 || i >= o - 1)
1179
+ return `${i + 1} / ${o}`;
1180
+ const r = i % 2 === 1 ? i : i - 1;
1181
1181
  return `${r + 1}-${r + 2} / ${o}`;
1182
1182
  }) }),
1183
- /* @__PURE__ */ d("button", { type: "button", class: "bk-btn", onClick: e.onNextPage, "aria-label": w(() => t.value.next || "Next"), title: w(() => t.value.next || "Next"), children: /* @__PURE__ */ d("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: /* @__PURE__ */ d("polyline", { points: "9 18 15 12 9 6" }) }) })
1183
+ /* @__PURE__ */ g("button", { type: "button", class: "bk-btn", onClick: e.onNextPage, "aria-label": w(() => t.value.next || "Next"), title: w(() => t.value.next || "Next"), children: /* @__PURE__ */ g("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: /* @__PURE__ */ g("polyline", { points: "9 18 15 12 9 6" }) }) })
1184
1184
  ] }),
1185
- /* @__PURE__ */ d("div", { class: "bk-btn-group", children: [
1186
- /* @__PURE__ */ d("button", { type: "button", class: "bk-btn", onClick: e.onZoomIn, "aria-label": w(() => t.value.zoomIn || "Zoom In"), title: w(() => t.value.zoomIn || "Zoom In"), children: /* @__PURE__ */ d("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1187
- /* @__PURE__ */ d("circle", { cx: "11", cy: "11", r: "8" }),
1188
- /* @__PURE__ */ d("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" }),
1189
- /* @__PURE__ */ d("line", { x1: "11", y1: "8", x2: "11", y2: "14" }),
1190
- /* @__PURE__ */ d("line", { x1: "8", y1: "11", x2: "14", y2: "11" })
1185
+ /* @__PURE__ */ g("div", { class: "bk-btn-group", children: [
1186
+ /* @__PURE__ */ g("button", { type: "button", class: "bk-btn", onClick: e.onZoomIn, "aria-label": w(() => t.value.zoomIn || "Zoom In"), title: w(() => t.value.zoomIn || "Zoom In"), children: /* @__PURE__ */ g("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1187
+ /* @__PURE__ */ g("circle", { cx: "11", cy: "11", r: "8" }),
1188
+ /* @__PURE__ */ g("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" }),
1189
+ /* @__PURE__ */ g("line", { x1: "11", y1: "8", x2: "11", y2: "14" }),
1190
+ /* @__PURE__ */ g("line", { x1: "8", y1: "11", x2: "14", y2: "11" })
1191
1191
  ] }) }),
1192
- /* @__PURE__ */ d(
1192
+ /* @__PURE__ */ g(
1193
1193
  "button",
1194
1194
  {
1195
1195
  type: "button",
@@ -1197,20 +1197,20 @@ function ri(e) {
1197
1197
  onClick: e.onZoomOut,
1198
1198
  "aria-label": w(() => t.value.zoomOut || "Zoom Out"),
1199
1199
  title: w(() => t.value.zoomOut || "Zoom Out"),
1200
- children: /* @__PURE__ */ d("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1201
- /* @__PURE__ */ d("circle", { cx: "11", cy: "11", r: "8" }),
1202
- /* @__PURE__ */ d("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" }),
1203
- /* @__PURE__ */ d("line", { x1: "8", y1: "11", x2: "14", y2: "11" })
1200
+ children: /* @__PURE__ */ g("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1201
+ /* @__PURE__ */ g("circle", { cx: "11", cy: "11", r: "8" }),
1202
+ /* @__PURE__ */ g("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" }),
1203
+ /* @__PURE__ */ g("line", { x1: "8", y1: "11", x2: "14", y2: "11" })
1204
1204
  ] })
1205
1205
  }
1206
1206
  ),
1207
- /* @__PURE__ */ d("button", { type: "button", class: "bk-btn bk-btn--fullscreen", onClick: e.onToggleFullscreen, "aria-label": w(() => t.value.fullscreen || "Fullscreen"), title: w(() => t.value.fullscreen || "Fullscreen"), children: /* @__PURE__ */ d("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: /* @__PURE__ */ d("path", { d: "M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3" }) }) }),
1208
- w(() => e.store.allowDownload.value && e.store.hasDownloadUrl.value && e.onDownload ? /* @__PURE__ */ d("button", { type: "button", class: "bk-btn bk-btn--download", onClick: e.onDownload, "aria-label": w(() => t.value.downloadCatalog || "Download"), title: w(() => t.value.downloadCatalog || "Download"), children: /* @__PURE__ */ d("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1209
- /* @__PURE__ */ d("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
1210
- /* @__PURE__ */ d("polyline", { points: "7 10 12 15 17 10" }),
1211
- /* @__PURE__ */ d("line", { x1: "12", y1: "15", x2: "12", y2: "3" })
1207
+ /* @__PURE__ */ g("button", { type: "button", class: "bk-btn bk-btn--fullscreen", onClick: e.onToggleFullscreen, "aria-label": w(() => t.value.fullscreen || "Fullscreen"), title: w(() => t.value.fullscreen || "Fullscreen"), children: /* @__PURE__ */ g("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: /* @__PURE__ */ g("path", { d: "M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3" }) }) }),
1208
+ w(() => e.store.allowDownload.value && e.store.hasDownloadUrl.value && e.onDownload ? /* @__PURE__ */ g("button", { type: "button", class: "bk-btn bk-btn--download", onClick: e.onDownload, "aria-label": w(() => t.value.downloadCatalog || "Download"), title: w(() => t.value.downloadCatalog || "Download"), children: /* @__PURE__ */ g("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1209
+ /* @__PURE__ */ g("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
1210
+ /* @__PURE__ */ g("polyline", { points: "7 10 12 15 17 10" }),
1211
+ /* @__PURE__ */ g("line", { x1: "12", y1: "15", x2: "12", y2: "3" })
1212
1212
  ] }) }) : null),
1213
- /* @__PURE__ */ d(
1213
+ /* @__PURE__ */ g(
1214
1214
  "button",
1215
1215
  {
1216
1216
  type: "button",
@@ -1220,15 +1220,15 @@ function ri(e) {
1220
1220
  "aria-pressed": w(() => e.store.soundEnabled.value ? "true" : "false"),
1221
1221
  title: "Sound",
1222
1222
  children: [
1223
- /* @__PURE__ */ d("svg", { style: { display: w(() => e.store.soundEnabled.value ? "block" : "none") }, xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1224
- /* @__PURE__ */ d("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
1225
- /* @__PURE__ */ d("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" }),
1226
- /* @__PURE__ */ d("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" })
1223
+ /* @__PURE__ */ g("svg", { style: { display: w(() => e.store.soundEnabled.value ? "block" : "none") }, xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1224
+ /* @__PURE__ */ g("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
1225
+ /* @__PURE__ */ g("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" }),
1226
+ /* @__PURE__ */ g("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" })
1227
1227
  ] }),
1228
- /* @__PURE__ */ d("svg", { style: { display: w(() => e.store.soundEnabled.value ? "none" : "block") }, xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1229
- /* @__PURE__ */ d("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
1230
- /* @__PURE__ */ d("line", { x1: "23", y1: "9", x2: "17", y2: "15" }),
1231
- /* @__PURE__ */ d("line", { x1: "17", y1: "9", x2: "23", y2: "15" })
1228
+ /* @__PURE__ */ g("svg", { style: { display: w(() => e.store.soundEnabled.value ? "none" : "block") }, xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1229
+ /* @__PURE__ */ g("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
1230
+ /* @__PURE__ */ g("line", { x1: "23", y1: "9", x2: "17", y2: "15" }),
1231
+ /* @__PURE__ */ g("line", { x1: "17", y1: "9", x2: "23", y2: "15" })
1232
1232
  ] })
1233
1233
  ]
1234
1234
  }
@@ -1236,85 +1236,85 @@ function ri(e) {
1236
1236
  ] })
1237
1237
  ] });
1238
1238
  }
1239
- function ai(e) {
1240
- return /* @__PURE__ */ d("div", { class: "bk-thumbs", style: w(() => e.store.showThumbs.value ? "display:flex;" : "display:none;"), children: e.store.pages.value.map((t, s) => {
1239
+ function li(e) {
1240
+ return /* @__PURE__ */ g("div", { class: "bk-thumbs", style: w(() => e.store.showThumbs.value ? "display:flex;" : "display:none;"), children: e.store.pages.value.map((t, i) => {
1241
1241
  const o = () => {
1242
1242
  const r = e.store.currentPage.value;
1243
1243
  if (e.store.isSingleMode.value || r === 0 || r >= e.store.pages.value.length - 1)
1244
- return r === s;
1244
+ return r === i;
1245
1245
  const h = r % 2 === 1 ? r : r - 1;
1246
- return s === h || s === h + 1;
1246
+ return i === h || i === h + 1;
1247
1247
  };
1248
- return /* @__PURE__ */ d(
1248
+ return /* @__PURE__ */ g(
1249
1249
  "div",
1250
1250
  {
1251
1251
  class: w(() => `thumb-item ${o() ? "active" : ""}`),
1252
1252
  role: "button",
1253
1253
  tabindex: "0",
1254
- "aria-label": `Go to page ${s + 1}`,
1254
+ "aria-label": `Go to page ${i + 1}`,
1255
1255
  "aria-current": w(() => o() ? "page" : void 0),
1256
- onClick: () => e.onThumbClick(s),
1256
+ onClick: () => e.onThumbClick(i),
1257
1257
  onKeyDown: (r) => {
1258
- (r.key === "Enter" || r.key === " ") && (r.preventDefault(), e.onThumbClick(s));
1258
+ (r.key === "Enter" || r.key === " ") && (r.preventDefault(), e.onThumbClick(i));
1259
1259
  },
1260
- children: [
1261
- /* @__PURE__ */ d("div", { class: "thumb-img-wrapper", children: /* @__PURE__ */ d(
1260
+ children: /* @__PURE__ */ g("div", { class: "thumb-img-wrapper", children: [
1261
+ /* @__PURE__ */ g(
1262
1262
  "img",
1263
1263
  {
1264
- "data-pdf-page": t.assetId.startsWith("pdf-page-") ? t.pageNumber : void 0,
1265
- class: "thumb-img",
1264
+ "data-pdf-page": t.assetId.startsWith("pdf-page-") ? t.sourcePageNumber ?? t.pageNumber : void 0,
1265
+ class: `thumb-img ${t.cropMode !== "full" ? "thumb-img--split thumb-img--" + t.cropMode : ""}`,
1266
1266
  src: t.thumb || t.low || t.normal,
1267
- alt: `Page ${s + 1}`,
1267
+ alt: `Page ${i + 1}`,
1268
1268
  loading: "lazy",
1269
1269
  onError: (r) => {
1270
1270
  r.currentTarget.style.display = "none";
1271
1271
  }
1272
1272
  }
1273
- ) }),
1274
- /* @__PURE__ */ d("span", { children: s + 1 })
1275
- ]
1273
+ ),
1274
+ /* @__PURE__ */ g("span", { class: "thumb-page-number", children: i + 1 })
1275
+ ] })
1276
1276
  }
1277
1277
  );
1278
1278
  }) });
1279
1279
  }
1280
- function we(e, t, s) {
1281
- return /* @__PURE__ */ d("ol", { class: "bk-toc-list", children: e.map((o) => {
1280
+ function ye(e, t, i) {
1281
+ return /* @__PURE__ */ g("ol", { class: "bk-toc-list", children: e.map((o) => {
1282
1282
  var r;
1283
- return /* @__PURE__ */ d("li", { class: "bk-toc-item", children: [
1284
- /* @__PURE__ */ d(
1283
+ return /* @__PURE__ */ g("li", { class: "bk-toc-item", children: [
1284
+ /* @__PURE__ */ g(
1285
1285
  "button",
1286
1286
  {
1287
1287
  type: "button",
1288
1288
  class: w(() => t.currentPage.value === o.pageIndex ? "bk-toc-entry active" : "bk-toc-entry"),
1289
1289
  "aria-current": w(() => t.currentPage.value === o.pageIndex ? "page" : void 0),
1290
- onClick: () => s(o.pageIndex),
1290
+ onClick: () => i(o.pageIndex),
1291
1291
  children: [
1292
- /* @__PURE__ */ d("span", { class: "bk-toc-title", children: o.title }),
1293
- /* @__PURE__ */ d("span", { class: "bk-toc-page", children: o.pageIndex + 1 })
1292
+ /* @__PURE__ */ g("span", { class: "bk-toc-title", children: o.title }),
1293
+ /* @__PURE__ */ g("span", { class: "bk-toc-page", children: o.pageIndex + 1 })
1294
1294
  ]
1295
1295
  }
1296
1296
  ),
1297
- (r = o.children) != null && r.length ? we(o.children, t, s) : null
1297
+ (r = o.children) != null && r.length ? ye(o.children, t, i) : null
1298
1298
  ] });
1299
1299
  }) });
1300
1300
  }
1301
- function hi(e) {
1302
- const t = w(() => me({ locale: e.store.locale.value, messages: e.store.messages.value }));
1303
- return /* @__PURE__ */ d(
1301
+ function ci(e) {
1302
+ const t = w(() => ve({ locale: e.store.locale.value, messages: e.store.messages.value }));
1303
+ return /* @__PURE__ */ g(
1304
1304
  "nav",
1305
1305
  {
1306
1306
  class: "bk-toc",
1307
1307
  "aria-label": w(() => t.value.tableOfContents || "Table of Contents"),
1308
1308
  style: w(() => e.store.showToc.value && e.store.toc.value.length ? "display:flex;" : "display:none;"),
1309
1309
  children: [
1310
- /* @__PURE__ */ d("div", { class: "bk-toc-heading", children: w(() => t.value.tableOfContents || "Table of Contents") }),
1311
- we(e.store.toc.value, e.store, e.onEntryClick)
1310
+ /* @__PURE__ */ g("div", { class: "bk-toc-heading", children: w(() => t.value.tableOfContents || "Table of Contents") }),
1311
+ ye(e.store.toc.value, e.store, e.onEntryClick)
1312
1312
  ]
1313
1313
  }
1314
1314
  );
1315
1315
  }
1316
- function li(e) {
1317
- return /* @__PURE__ */ d(
1316
+ function di(e) {
1317
+ return /* @__PURE__ */ g(
1318
1318
  "div",
1319
1319
  {
1320
1320
  role: "region",
@@ -1324,56 +1324,56 @@ function li(e) {
1324
1324
  return e.store.isDoublePageLayout.value && (t += "double-mode "), e.store.isFrontCover.value && (t += "bk-is-cover "), e.store.isBackCover.value && (t += "bk-is-back-cover "), e.store.zoomState.value.isActive && (t += "zoomed "), t.trim();
1325
1325
  }),
1326
1326
  ref: e.bookWrapperRef,
1327
- children: /* @__PURE__ */ d(
1327
+ children: /* @__PURE__ */ g(
1328
1328
  "div",
1329
1329
  {
1330
1330
  class: "bk-book-sizer",
1331
1331
  ref: e.bookSizerRef,
1332
1332
  children: [
1333
- /* @__PURE__ */ d(
1333
+ /* @__PURE__ */ g(
1334
1334
  "div",
1335
1335
  {
1336
1336
  ref: e.bookContainerRef,
1337
1337
  class: w(() => "bk-book " + (e.store.flipState.value !== "read" ? "is-flipping" : "")),
1338
1338
  style: w(() => `display: ${e.store.isSingleMode.value ? "none" : "block"};`),
1339
- children: e.store.pages.value.map((t, s) => {
1340
- const o = s === 0 || s === e.store.pages.value.length - 1;
1341
- return /* @__PURE__ */ d(
1339
+ children: e.store.pages.value.map((t, i) => {
1340
+ const o = i === 0 || i === e.store.pages.value.length - 1;
1341
+ return /* @__PURE__ */ g(
1342
1342
  "div",
1343
1343
  {
1344
- class: `bz-page ${s === 0 ? "bz-page--cover" : ""} ${s === e.store.pages.value.length - 1 ? "bz-page--back" : ""}`,
1344
+ class: `bz-page ${i === 0 ? "bz-page--cover" : ""} ${i === e.store.pages.value.length - 1 ? "bz-page--back" : ""}`,
1345
1345
  "data-density": o ? "hard" : "soft",
1346
- "data-idx": s,
1347
- children: /* @__PURE__ */ d("div", { class: "bz-page-content", style: "position:relative; width:100%; height:100%; overflow:hidden;", children: [
1348
- /* @__PURE__ */ d(
1346
+ "data-idx": i,
1347
+ children: /* @__PURE__ */ g("div", { class: "bz-page-content", style: "position:relative; width:100%; height:100%; overflow:hidden;", children: [
1348
+ /* @__PURE__ */ g(
1349
1349
  "img",
1350
1350
  {
1351
- "data-pdf-page": t.assetId.startsWith("pdf-page-") ? t.pageNumber : void 0,
1351
+ "data-pdf-page": t.assetId.startsWith("pdf-page-") ? t.sourcePageNumber ?? t.pageNumber : void 0,
1352
1352
  src: t.low || t.normal,
1353
1353
  "data-src": t.normal,
1354
1354
  class: `page-content ${t.cropMode !== "full" ? "page-content--split page-content--" + t.cropMode : ""}`,
1355
- alt: `Page ${s + 1}`,
1355
+ alt: `Page ${i + 1}`,
1356
1356
  loading: "lazy"
1357
1357
  }
1358
1358
  ),
1359
- /* @__PURE__ */ d("div", { class: "page-shadow" })
1359
+ /* @__PURE__ */ g("div", { class: "page-shadow" })
1360
1360
  ] })
1361
1361
  }
1362
1362
  );
1363
1363
  })
1364
1364
  }
1365
1365
  ),
1366
- /* @__PURE__ */ d(
1366
+ /* @__PURE__ */ g(
1367
1367
  "div",
1368
1368
  {
1369
1369
  class: "bk-single-view",
1370
1370
  style: w(() => `display: ${e.store.isSingleMode.value ? "flex" : "none"}; width: 100%; height: 100%; justify-content: center; align-items: center; position: absolute; top: 0; left: 0; z-index: 10;`),
1371
1371
  children: w(() => {
1372
1372
  const t = e.store.pages.value[e.store.currentPage.value];
1373
- return t ? /* @__PURE__ */ d(
1373
+ return t ? /* @__PURE__ */ g(
1374
1374
  "img",
1375
1375
  {
1376
- "data-pdf-page": t.assetId.startsWith("pdf-page-") ? t.pageNumber : void 0,
1376
+ "data-pdf-page": t.assetId.startsWith("pdf-page-") ? t.sourcePageNumber ?? t.pageNumber : void 0,
1377
1377
  class: `bk-single-img page-content ${t.cropMode !== "full" ? "page-content--split page-content--" + t.cropMode : ""}`,
1378
1378
  src: e.store.zoomState.value.isActive ? t.normal : t.low || t.normal,
1379
1379
  alt: `Page ${e.store.currentPage.value + 1}`,
@@ -1389,10 +1389,10 @@ function li(e) {
1389
1389
  }
1390
1390
  );
1391
1391
  }
1392
- function ci(e) {
1393
- const t = w(() => e.store.showArrows.value && e.store.currentPage.value > 0), s = w(() => !e.store.showArrows.value || e.store.totalPages.value <= 1 ? !1 : e.store.currentPage.value < e.store.totalPages.value - 1);
1394
- return /* @__PURE__ */ d("div", { class: "bk-nav-arrows", style: w(() => e.store.showArrows.value ? "display: flex;" : "display: none;"), children: [
1395
- /* @__PURE__ */ d(
1392
+ function ui(e) {
1393
+ const t = w(() => e.store.showArrows.value && e.store.currentPage.value > 0), i = w(() => !e.store.showArrows.value || e.store.totalPages.value <= 1 ? !1 : e.store.currentPage.value < e.store.totalPages.value - 1);
1394
+ return /* @__PURE__ */ g("div", { class: "bk-nav-arrows", style: w(() => e.store.showArrows.value ? "display: flex;" : "display: none;"), children: [
1395
+ /* @__PURE__ */ g(
1396
1396
  "button",
1397
1397
  {
1398
1398
  type: "button",
@@ -1402,28 +1402,28 @@ function ci(e) {
1402
1402
  o.preventDefault(), e.onPrevPage();
1403
1403
  },
1404
1404
  "aria-label": "Previous Page",
1405
- children: /* @__PURE__ */ d("div", { class: "bk-arrow-icon bk-arrow-left" })
1405
+ children: /* @__PURE__ */ g("div", { class: "bk-arrow-icon bk-arrow-left" })
1406
1406
  }
1407
1407
  ),
1408
- /* @__PURE__ */ d(
1408
+ /* @__PURE__ */ g(
1409
1409
  "button",
1410
1410
  {
1411
1411
  type: "button",
1412
1412
  class: "bk-nav-arrow bk-nav-next",
1413
- style: w(() => s.value ? "visibility: visible;" : "visibility: hidden;"),
1413
+ style: w(() => i.value ? "visibility: visible;" : "visibility: hidden;"),
1414
1414
  onClick: (o) => {
1415
1415
  o.preventDefault(), e.onNextPage();
1416
1416
  },
1417
1417
  "aria-label": "Next Page",
1418
- children: /* @__PURE__ */ d("div", { class: "bk-arrow-icon bk-arrow-right" })
1418
+ children: /* @__PURE__ */ g("div", { class: "bk-arrow-icon bk-arrow-right" })
1419
1419
  }
1420
1420
  )
1421
1421
  ] });
1422
1422
  }
1423
- function di(e) {
1423
+ function gi(e) {
1424
1424
  const t = () => {
1425
1425
  e.store.showThumbs.value = !e.store.showThumbs.value;
1426
- }, s = () => {
1426
+ }, i = () => {
1427
1427
  e.store.showToc.value = !e.store.showToc.value;
1428
1428
  }, o = () => {
1429
1429
  e.store.isSingleMode.value = !e.store.isSingleMode.value;
@@ -1435,26 +1435,26 @@ function di(e) {
1435
1435
  }, u = () => {
1436
1436
  var S;
1437
1437
  (S = e.interactionManagerRef.current) == null || S.zoomOut();
1438
- }, p = () => e.onToggleFullscreen(), b = (S) => {
1438
+ }, c = () => e.onToggleFullscreen(), b = (S) => {
1439
1439
  e.store.currentPage.value = S, e.store.showToc.value = !1;
1440
- }, x = (S) => {
1440
+ }, P = (S) => {
1441
1441
  var T;
1442
1442
  e.store.currentPage.value !== S && (e.store.currentPage.value = S, (T = e.pageFlipAdapterRef.current) == null || T.playSound());
1443
- }, M = () => {
1443
+ }, k = () => {
1444
1444
  var S;
1445
1445
  (S = e.pageFlipAdapterRef.current) == null || S.turnToNextPage();
1446
1446
  }, I = () => {
1447
1447
  var S;
1448
1448
  (S = e.pageFlipAdapterRef.current) == null || S.turnToPrevPage();
1449
1449
  };
1450
- return /* @__PURE__ */ d(
1450
+ return /* @__PURE__ */ g(
1451
1451
  "div",
1452
1452
  {
1453
1453
  class: w(() => `bk-wrapper bk-theme-${e.store.themeMode.value} ${e.className || ""}`),
1454
1454
  children: [
1455
- /* @__PURE__ */ d("div", { class: "bk-main-area", children: [
1456
- /* @__PURE__ */ d(
1457
- li,
1455
+ /* @__PURE__ */ g("div", { class: "bk-main-area", children: [
1456
+ /* @__PURE__ */ g(
1457
+ di,
1458
1458
  {
1459
1459
  store: e.store,
1460
1460
  bookWrapperRef: e.bookWrapperRef,
@@ -1462,80 +1462,80 @@ function di(e) {
1462
1462
  bookContainerRef: e.bookContainerRef
1463
1463
  }
1464
1464
  ),
1465
- /* @__PURE__ */ d(
1466
- ci,
1465
+ /* @__PURE__ */ g(
1466
+ ui,
1467
1467
  {
1468
1468
  store: e.store,
1469
1469
  onPrevPage: I,
1470
- onNextPage: M
1470
+ onNextPage: k
1471
1471
  }
1472
1472
  ),
1473
- e.store.whiteLabel.value ? null : /* @__PURE__ */ d("div", { class: "bk-watermark", children: [
1473
+ e.store.whiteLabel.value ? null : /* @__PURE__ */ g("div", { class: "bk-watermark", children: [
1474
1474
  "Powered by ",
1475
- /* @__PURE__ */ d("a", { href: "https://flipbookengine.com", target: "_blank", rel: "noopener", style: "text-decoration: underline;", children: "FlipbookEngine" })
1475
+ /* @__PURE__ */ g("a", { href: "https://flipbookengine.com", target: "_blank", rel: "noopener", style: "text-decoration: underline;", children: "FlipbookEngine" })
1476
1476
  ] }),
1477
- /* @__PURE__ */ d(hi, { store: e.store, onEntryClick: b })
1477
+ /* @__PURE__ */ g(ci, { store: e.store, onEntryClick: b })
1478
1478
  ] }),
1479
- /* @__PURE__ */ d(
1480
- ri,
1479
+ /* @__PURE__ */ g(
1480
+ hi,
1481
1481
  {
1482
1482
  store: e.store,
1483
1483
  onToggleThumbs: t,
1484
- onToggleToc: s,
1484
+ onToggleToc: i,
1485
1485
  onToggleSingleMode: o,
1486
1486
  onZoomIn: h,
1487
1487
  onZoomOut: u,
1488
1488
  onDownload: e.onDownload,
1489
- onNextPage: M,
1489
+ onNextPage: k,
1490
1490
  onPrevPage: I,
1491
1491
  onSoundToggle: () => e.store.soundEnabled.value = !e.store.soundEnabled.value,
1492
1492
  onToggleAutoPlay: r,
1493
- onToggleFullscreen: p
1493
+ onToggleFullscreen: c
1494
1494
  }
1495
1495
  ),
1496
- /* @__PURE__ */ d(
1497
- ai,
1496
+ /* @__PURE__ */ g(
1497
+ li,
1498
1498
  {
1499
1499
  store: e.store,
1500
- onThumbClick: x
1500
+ onThumbClick: P
1501
1501
  }
1502
1502
  )
1503
1503
  ]
1504
1504
  }
1505
1505
  );
1506
1506
  }
1507
- var ui = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Dt = { exports: {} };
1507
+ var pi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, It = { exports: {} };
1508
1508
  (function(e, t) {
1509
- (function(s, o) {
1509
+ (function(i, o) {
1510
1510
  o(t);
1511
- })(ui, function(s) {
1511
+ })(pi, function(i) {
1512
1512
  class o {
1513
- constructor(i, n) {
1514
- this.state = { angle: 0, area: [], position: { x: 0, y: 0 }, hardAngle: 0, hardDrawingAngle: 0 }, this.createdDensity = n, this.nowDrawingDensity = this.createdDensity, this.render = i;
1513
+ constructor(s, n) {
1514
+ this.state = { angle: 0, area: [], position: { x: 0, y: 0 }, hardAngle: 0, hardDrawingAngle: 0 }, this.createdDensity = n, this.nowDrawingDensity = this.createdDensity, this.render = s;
1515
1515
  }
1516
- setDensity(i) {
1517
- this.createdDensity = i, this.nowDrawingDensity = i;
1516
+ setDensity(s) {
1517
+ this.createdDensity = s, this.nowDrawingDensity = s;
1518
1518
  }
1519
- setDrawingDensity(i) {
1520
- this.nowDrawingDensity = i;
1519
+ setDrawingDensity(s) {
1520
+ this.nowDrawingDensity = s;
1521
1521
  }
1522
- setPosition(i) {
1523
- this.state.position = i;
1522
+ setPosition(s) {
1523
+ this.state.position = s;
1524
1524
  }
1525
- setAngle(i) {
1526
- this.state.angle = i;
1525
+ setAngle(s) {
1526
+ this.state.angle = s;
1527
1527
  }
1528
- setArea(i) {
1529
- this.state.area = i;
1528
+ setArea(s) {
1529
+ this.state.area = s;
1530
1530
  }
1531
- setHardDrawingAngle(i) {
1532
- this.state.hardDrawingAngle = i;
1531
+ setHardDrawingAngle(s) {
1532
+ this.state.hardDrawingAngle = s;
1533
1533
  }
1534
- setHardAngle(i) {
1535
- this.state.hardAngle = i, this.state.hardDrawingAngle = i;
1534
+ setHardAngle(s) {
1535
+ this.state.hardAngle = s, this.state.hardDrawingAngle = s;
1536
1536
  }
1537
- setOrientation(i) {
1538
- this.orientation = i;
1537
+ setOrientation(s) {
1538
+ this.orientation = s;
1539
1539
  }
1540
1540
  getDrawingDensity() {
1541
1541
  return this.nowDrawingDensity;
@@ -1548,23 +1548,23 @@ var ui = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1548
1548
  }
1549
1549
  }
1550
1550
  class r extends o {
1551
- constructor(i, n, a) {
1552
- super(i, a), this.image = null, this.isLoad = !1, this.loadingAngle = 0, this.image = new Image(), this.image.src = n;
1551
+ constructor(s, n, a) {
1552
+ super(s, a), this.image = null, this.isLoad = !1, this.loadingAngle = 0, this.image = new Image(), this.image.src = n;
1553
1553
  }
1554
- draw(i) {
1555
- const n = this.render.getContext(), a = this.render.convertToGlobal(this.state.position), l = this.render.getRect().pageWidth, c = this.render.getRect().height;
1554
+ draw(s) {
1555
+ const n = this.render.getContext(), a = this.render.convertToGlobal(this.state.position), l = this.render.getRect().pageWidth, d = this.render.getRect().height;
1556
1556
  n.save(), n.translate(a.x, a.y), n.beginPath();
1557
- for (let g of this.state.area) g !== null && (g = this.render.convertToGlobal(g), n.lineTo(g.x - a.x, g.y - a.y));
1558
- n.rotate(this.state.angle), n.clip(), this.isLoad ? n.drawImage(this.image, 0, 0, l, c) : this.drawLoader(n, { x: 0, y: 0 }, l, c), n.restore();
1557
+ for (let p of this.state.area) p !== null && (p = this.render.convertToGlobal(p), n.lineTo(p.x - a.x, p.y - a.y));
1558
+ n.rotate(this.state.angle), n.clip(), this.isLoad ? n.drawImage(this.image, 0, 0, l, d) : this.drawLoader(n, { x: 0, y: 0 }, l, d), n.restore();
1559
1559
  }
1560
- simpleDraw(i) {
1561
- const n = this.render.getRect(), a = this.render.getContext(), l = n.pageWidth, c = n.height, g = i === 1 ? n.left + n.pageWidth : n.left, y = n.top;
1562
- this.isLoad ? a.drawImage(this.image, g, y, l, c) : this.drawLoader(a, { x: g, y }, l, c);
1560
+ simpleDraw(s) {
1561
+ const n = this.render.getRect(), a = this.render.getContext(), l = n.pageWidth, d = n.height, p = s === 1 ? n.left + n.pageWidth : n.left, y = n.top;
1562
+ this.isLoad ? a.drawImage(this.image, p, y, l, d) : this.drawLoader(a, { x: p, y }, l, d);
1563
1563
  }
1564
- drawLoader(i, n, a, l) {
1565
- i.beginPath(), i.strokeStyle = "rgb(200, 200, 200)", i.fillStyle = "rgb(255, 255, 255)", i.lineWidth = 1, i.rect(n.x + 1, n.y + 1, a - 1, l - 1), i.stroke(), i.fill();
1566
- const c = { x: n.x + a / 2, y: n.y + l / 2 };
1567
- i.beginPath(), i.lineWidth = 10, i.arc(c.x, c.y, 20, this.loadingAngle, 3 * Math.PI / 2 + this.loadingAngle), i.stroke(), i.closePath(), this.loadingAngle += 0.07, this.loadingAngle >= 2 * Math.PI && (this.loadingAngle = 0);
1564
+ drawLoader(s, n, a, l) {
1565
+ s.beginPath(), s.strokeStyle = "rgb(200, 200, 200)", s.fillStyle = "rgb(255, 255, 255)", s.lineWidth = 1, s.rect(n.x + 1, n.y + 1, a - 1, l - 1), s.stroke(), s.fill();
1566
+ const d = { x: n.x + a / 2, y: n.y + l / 2 };
1567
+ s.beginPath(), s.lineWidth = 10, s.arc(d.x, d.y, 20, this.loadingAngle, 3 * Math.PI / 2 + this.loadingAngle), s.stroke(), s.closePath(), this.loadingAngle += 0.07, this.loadingAngle >= 2 * Math.PI && (this.loadingAngle = 0);
1568
1568
  }
1569
1569
  load() {
1570
1570
  this.isLoad || (this.image.onload = () => {
@@ -1581,8 +1581,8 @@ var ui = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1581
1581
  }
1582
1582
  }
1583
1583
  class h {
1584
- constructor(i, n) {
1585
- this.pages = [], this.currentPageIndex = 0, this.currentSpreadIndex = 0, this.landscapeSpread = [], this.portraitSpread = [], this.render = n, this.app = i, this.currentPageIndex = 0, this.isShowCover = this.app.getSettings().showCover;
1584
+ constructor(s, n) {
1585
+ this.pages = [], this.currentPageIndex = 0, this.currentSpreadIndex = 0, this.landscapeSpread = [], this.portraitSpread = [], this.render = n, this.app = s, this.currentPageIndex = 0, this.isShowCover = this.app.getSettings().showCover;
1586
1586
  }
1587
1587
  destroy() {
1588
1588
  this.pages = [];
@@ -1590,16 +1590,16 @@ var ui = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1590
1590
  createSpread() {
1591
1591
  this.landscapeSpread = [], this.portraitSpread = [];
1592
1592
  for (let n = 0; n < this.pages.length; n++) this.portraitSpread.push([n]);
1593
- let i = 0;
1594
- this.isShowCover && (this.pages[0].setDensity("hard"), this.landscapeSpread.push([i]), i++);
1595
- for (let n = i; n < this.pages.length; n += 2) n < this.pages.length - 1 ? this.landscapeSpread.push([n, n + 1]) : (this.landscapeSpread.push([n]), this.pages[n].setDensity("hard"));
1593
+ let s = 0;
1594
+ this.isShowCover && (this.pages[0].setDensity("hard"), this.landscapeSpread.push([s]), s++);
1595
+ for (let n = s; n < this.pages.length; n += 2) n < this.pages.length - 1 ? this.landscapeSpread.push([n, n + 1]) : (this.landscapeSpread.push([n]), this.pages[n].setDensity("hard"));
1596
1596
  }
1597
1597
  getSpread() {
1598
1598
  return this.render.getOrientation() === "landscape" ? this.landscapeSpread : this.portraitSpread;
1599
1599
  }
1600
- getSpreadIndexByPage(i) {
1600
+ getSpreadIndexByPage(s) {
1601
1601
  const n = this.getSpread();
1602
- for (let a = 0; a < n.length; a++) if (i === n[a][0] || i === n[a][1]) return a;
1602
+ for (let a = 0; a < n.length; a++) if (s === n[a][0] || s === n[a][1]) return a;
1603
1603
  return null;
1604
1604
  }
1605
1605
  getPageCount() {
@@ -1608,32 +1608,32 @@ var ui = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1608
1608
  getPages() {
1609
1609
  return this.pages;
1610
1610
  }
1611
- getPage(i) {
1612
- if (i >= 0 && i < this.pages.length) return this.pages[i];
1611
+ getPage(s) {
1612
+ if (s >= 0 && s < this.pages.length) return this.pages[s];
1613
1613
  throw new Error("Invalid page number");
1614
1614
  }
1615
- nextBy(i) {
1616
- const n = this.pages.indexOf(i);
1615
+ nextBy(s) {
1616
+ const n = this.pages.indexOf(s);
1617
1617
  return n < this.pages.length - 1 ? this.pages[n + 1] : null;
1618
1618
  }
1619
- prevBy(i) {
1620
- const n = this.pages.indexOf(i);
1619
+ prevBy(s) {
1620
+ const n = this.pages.indexOf(s);
1621
1621
  return n > 0 ? this.pages[n - 1] : null;
1622
1622
  }
1623
- getFlippingPage(i) {
1623
+ getFlippingPage(s) {
1624
1624
  const n = this.currentSpreadIndex;
1625
- if (this.render.getOrientation() === "portrait") return i === 0 ? this.pages[n].newTemporaryCopy() : this.pages[n - 1];
1625
+ if (this.render.getOrientation() === "portrait") return s === 0 ? this.pages[n].newTemporaryCopy() : this.pages[n - 1];
1626
1626
  {
1627
- const a = i === 0 ? this.getSpread()[n + 1] : this.getSpread()[n - 1];
1628
- return a.length === 1 || i === 0 ? this.pages[a[0]] : this.pages[a[1]];
1627
+ const a = s === 0 ? this.getSpread()[n + 1] : this.getSpread()[n - 1];
1628
+ return a.length === 1 || s === 0 ? this.pages[a[0]] : this.pages[a[1]];
1629
1629
  }
1630
1630
  }
1631
- getBottomPage(i) {
1631
+ getBottomPage(s) {
1632
1632
  const n = this.currentSpreadIndex;
1633
- if (this.render.getOrientation() === "portrait") return i === 0 ? this.pages[n + 1] : this.pages[n - 1];
1633
+ if (this.render.getOrientation() === "portrait") return s === 0 ? this.pages[n + 1] : this.pages[n - 1];
1634
1634
  {
1635
- const a = i === 0 ? this.getSpread()[n + 1] : this.getSpread()[n - 1];
1636
- return a.length === 1 ? this.pages[a[0]] : i === 0 ? this.pages[a[1]] : this.pages[a[0]];
1635
+ const a = s === 0 ? this.getSpread()[n + 1] : this.getSpread()[n - 1];
1636
+ return a.length === 1 ? this.pages[a[0]] : s === 0 ? this.pages[a[1]] : this.pages[a[0]];
1637
1637
  }
1638
1638
  }
1639
1639
  showNext() {
@@ -1645,81 +1645,81 @@ var ui = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1645
1645
  getCurrentPageIndex() {
1646
1646
  return this.currentPageIndex;
1647
1647
  }
1648
- show(i = null) {
1649
- if (i === null && (i = this.currentPageIndex), i < 0 || i >= this.pages.length) return;
1650
- const n = this.getSpreadIndexByPage(i);
1648
+ show(s = null) {
1649
+ if (s === null && (s = this.currentPageIndex), s < 0 || s >= this.pages.length) return;
1650
+ const n = this.getSpreadIndexByPage(s);
1651
1651
  n !== null && (this.currentSpreadIndex = n, this.showSpread());
1652
1652
  }
1653
1653
  getCurrentSpreadIndex() {
1654
1654
  return this.currentSpreadIndex;
1655
1655
  }
1656
- setCurrentSpreadIndex(i) {
1657
- if (!(i >= 0 && i < this.getSpread().length)) throw new Error("Invalid page");
1658
- this.currentSpreadIndex = i;
1656
+ setCurrentSpreadIndex(s) {
1657
+ if (!(s >= 0 && s < this.getSpread().length)) throw new Error("Invalid page");
1658
+ this.currentSpreadIndex = s;
1659
1659
  }
1660
1660
  showSpread() {
1661
- const i = this.getSpread()[this.currentSpreadIndex];
1662
- i.length === 2 ? (this.render.setLeftPage(this.pages[i[0]]), this.render.setRightPage(this.pages[i[1]])) : this.render.getOrientation() === "landscape" && i[0] === this.pages.length - 1 ? (this.render.setLeftPage(this.pages[i[0]]), this.render.setRightPage(null)) : (this.render.setLeftPage(null), this.render.setRightPage(this.pages[i[0]])), this.currentPageIndex = i[0], this.app.updatePageIndex(this.currentPageIndex);
1661
+ const s = this.getSpread()[this.currentSpreadIndex];
1662
+ s.length === 2 ? (this.render.setLeftPage(this.pages[s[0]]), this.render.setRightPage(this.pages[s[1]])) : this.render.getOrientation() === "landscape" && s[0] === this.pages.length - 1 ? (this.render.setLeftPage(this.pages[s[0]]), this.render.setRightPage(null)) : (this.render.setLeftPage(null), this.render.setRightPage(this.pages[s[0]])), this.currentPageIndex = s[0], this.app.updatePageIndex(this.currentPageIndex);
1663
1663
  }
1664
1664
  }
1665
1665
  class u extends h {
1666
- constructor(i, n, a) {
1667
- super(i, n), this.imagesHref = a;
1666
+ constructor(s, n, a) {
1667
+ super(s, n), this.imagesHref = a;
1668
1668
  }
1669
1669
  load() {
1670
- for (const i of this.imagesHref) {
1671
- const n = new r(this.render, i, "soft");
1670
+ for (const s of this.imagesHref) {
1671
+ const n = new r(this.render, s, "soft");
1672
1672
  n.load(), this.pages.push(n);
1673
1673
  }
1674
1674
  this.createSpread();
1675
1675
  }
1676
1676
  }
1677
- class p {
1678
- static GetDistanceBetweenTwoPoint(i, n) {
1679
- return i === null || n === null ? 1 / 0 : Math.sqrt(Math.pow(n.x - i.x, 2) + Math.pow(n.y - i.y, 2));
1677
+ class c {
1678
+ static GetDistanceBetweenTwoPoint(s, n) {
1679
+ return s === null || n === null ? 1 / 0 : Math.sqrt(Math.pow(n.x - s.x, 2) + Math.pow(n.y - s.y, 2));
1680
1680
  }
1681
- static GetSegmentLength(i) {
1682
- return p.GetDistanceBetweenTwoPoint(i[0], i[1]);
1681
+ static GetSegmentLength(s) {
1682
+ return c.GetDistanceBetweenTwoPoint(s[0], s[1]);
1683
1683
  }
1684
- static GetAngleBetweenTwoLine(i, n) {
1685
- const a = i[0].y - i[1].y, l = n[0].y - n[1].y, c = i[1].x - i[0].x, g = n[1].x - n[0].x;
1686
- return Math.acos((a * l + c * g) / (Math.sqrt(a * a + c * c) * Math.sqrt(l * l + g * g)));
1684
+ static GetAngleBetweenTwoLine(s, n) {
1685
+ const a = s[0].y - s[1].y, l = n[0].y - n[1].y, d = s[1].x - s[0].x, p = n[1].x - n[0].x;
1686
+ return Math.acos((a * l + d * p) / (Math.sqrt(a * a + d * d) * Math.sqrt(l * l + p * p)));
1687
1687
  }
1688
- static PointInRect(i, n) {
1689
- return n === null ? null : n.x >= i.left && n.x <= i.width + i.left && n.y >= i.top && n.y <= i.top + i.height ? n : null;
1688
+ static PointInRect(s, n) {
1689
+ return n === null ? null : n.x >= s.left && n.x <= s.width + s.left && n.y >= s.top && n.y <= s.top + s.height ? n : null;
1690
1690
  }
1691
- static GetRotatedPoint(i, n, a) {
1692
- return { x: i.x * Math.cos(a) + i.y * Math.sin(a) + n.x, y: i.y * Math.cos(a) - i.x * Math.sin(a) + n.y };
1691
+ static GetRotatedPoint(s, n, a) {
1692
+ return { x: s.x * Math.cos(a) + s.y * Math.sin(a) + n.x, y: s.y * Math.cos(a) - s.x * Math.sin(a) + n.y };
1693
1693
  }
1694
- static LimitPointToCircle(i, n, a) {
1695
- if (p.GetDistanceBetweenTwoPoint(i, a) <= n) return a;
1696
- const l = i.x, c = i.y, g = a.x, y = a.y;
1697
- let f = Math.sqrt(Math.pow(n, 2) * Math.pow(l - g, 2) / (Math.pow(l - g, 2) + Math.pow(c - y, 2))) + l;
1694
+ static LimitPointToCircle(s, n, a) {
1695
+ if (c.GetDistanceBetweenTwoPoint(s, a) <= n) return a;
1696
+ const l = s.x, d = s.y, p = a.x, y = a.y;
1697
+ let f = Math.sqrt(Math.pow(n, 2) * Math.pow(l - p, 2) / (Math.pow(l - p, 2) + Math.pow(d - y, 2))) + l;
1698
1698
  a.x < 0 && (f *= -1);
1699
- let C = (f - l) * (c - y) / (l - g) + c;
1700
- return l - g + c === 0 && (C = n), { x: f, y: C };
1699
+ let E = (f - l) * (d - y) / (l - p) + d;
1700
+ return l - p + d === 0 && (E = n), { x: f, y: E };
1701
1701
  }
1702
- static GetIntersectBetweenTwoSegment(i, n, a) {
1703
- return p.PointInRect(i, p.GetIntersectBeetwenTwoLine(n, a));
1702
+ static GetIntersectBetweenTwoSegment(s, n, a) {
1703
+ return c.PointInRect(s, c.GetIntersectBeetwenTwoLine(n, a));
1704
1704
  }
1705
- static GetIntersectBeetwenTwoLine(i, n) {
1706
- const a = i[0].y - i[1].y, l = n[0].y - n[1].y, c = i[1].x - i[0].x, g = n[1].x - n[0].x, y = i[0].x * i[1].y - i[1].x * i[0].y, f = n[0].x * n[1].y - n[1].x * n[0].y, C = a * f - l * y, R = c * f - g * y, F = -(y * g - f * c) / (a * g - l * c), K = -(a * f - l * y) / (a * g - l * c);
1707
- if (isFinite(F) && isFinite(K)) return { x: F, y: K };
1708
- if (Math.abs(C - R) < 0.1) throw new Error("Segment included");
1705
+ static GetIntersectBeetwenTwoLine(s, n) {
1706
+ const a = s[0].y - s[1].y, l = n[0].y - n[1].y, d = s[1].x - s[0].x, p = n[1].x - n[0].x, y = s[0].x * s[1].y - s[1].x * s[0].y, f = n[0].x * n[1].y - n[1].x * n[0].y, E = a * f - l * y, R = d * f - p * y, O = -(y * p - f * d) / (a * p - l * d), K = -(a * f - l * y) / (a * p - l * d);
1707
+ if (isFinite(O) && isFinite(K)) return { x: O, y: K };
1708
+ if (Math.abs(E - R) < 0.1) throw new Error("Segment included");
1709
1709
  return null;
1710
1710
  }
1711
- static GetCordsFromTwoPoint(i, n) {
1712
- const a = Math.abs(i.x - n.x), l = Math.abs(i.y - n.y), c = Math.max(a, l), g = [i];
1713
- function y(f, C, R, F, K) {
1714
- return C > f ? f + K * (R / F) : C < f ? f - K * (R / F) : f;
1711
+ static GetCordsFromTwoPoint(s, n) {
1712
+ const a = Math.abs(s.x - n.x), l = Math.abs(s.y - n.y), d = Math.max(a, l), p = [s];
1713
+ function y(f, E, R, O, K) {
1714
+ return E > f ? f + K * (R / O) : E < f ? f - K * (R / O) : f;
1715
1715
  }
1716
- for (let f = 1; f <= c; f += 1) g.push({ x: y(i.x, n.x, a, c, f), y: y(i.y, n.y, l, c, f) });
1717
- return g;
1716
+ for (let f = 1; f <= d; f += 1) p.push({ x: y(s.x, n.x, a, d, f), y: y(s.y, n.y, l, d, f) });
1717
+ return p;
1718
1718
  }
1719
1719
  }
1720
1720
  class b extends o {
1721
- constructor(i, n, a) {
1722
- super(i, a), this.copiedElement = null, this.temporaryCopy = null, this.isLoad = !1, this.element = n, this.element.classList.add("stf__item"), this.element.classList.add("--" + a);
1721
+ constructor(s, n, a) {
1722
+ super(s, a), this.copiedElement = null, this.temporaryCopy = null, this.isLoad = !1, this.element = n, this.element.classList.add("stf__item"), this.element.classList.add("--" + a);
1723
1723
  }
1724
1724
  newTemporaryCopy() {
1725
1725
  return this.nowDrawingDensity === "hard" ? this : (this.temporaryCopy === null && (this.copiedElement = this.element.cloneNode(!0), this.element.parentElement.appendChild(this.copiedElement), this.temporaryCopy = new b(this.render, this.copiedElement, this.nowDrawingDensity)), this.getTemporaryCopy());
@@ -1730,21 +1730,21 @@ var ui = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1730
1730
  hideTemporaryCopy() {
1731
1731
  this.temporaryCopy !== null && (this.copiedElement.remove(), this.copiedElement = null, this.temporaryCopy = null);
1732
1732
  }
1733
- draw(i) {
1734
- const n = i || this.nowDrawingDensity, a = this.render.convertToGlobal(this.state.position), l = this.render.getRect().pageWidth, c = this.render.getRect().height;
1733
+ draw(s) {
1734
+ const n = s || this.nowDrawingDensity, a = this.render.convertToGlobal(this.state.position), l = this.render.getRect().pageWidth, d = this.render.getRect().height;
1735
1735
  this.element.classList.remove("--simple");
1736
- const g = `
1736
+ const p = `
1737
1737
  display: block;
1738
1738
  z-index: ${this.element.style.zIndex};
1739
1739
  left: 0;
1740
1740
  top: 0;
1741
1741
  width: ${l}px;
1742
- height: ${c}px;
1742
+ height: ${d}px;
1743
1743
  `;
1744
- n === "hard" ? this.drawHard(g) : this.drawSoft(a, g);
1744
+ n === "hard" ? this.drawHard(p) : this.drawSoft(a, p);
1745
1745
  }
1746
- drawHard(i = "") {
1747
- const n = this.render.getRect().left + this.render.getRect().width / 2, a = this.state.hardDrawingAngle, l = i + `
1746
+ drawHard(s = "") {
1747
+ const n = this.render.getRect().left + this.render.getRect().width / 2, a = this.state.hardDrawingAngle, l = s + `
1748
1748
  backface-visibility: hidden;
1749
1749
  -webkit-backface-visibility: hidden;
1750
1750
  clip-path: none;
@@ -1754,24 +1754,24 @@ var ui = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1754
1754
  transform: translate3d(${n}px, 0, 0) rotateY(${a}deg);`);
1755
1755
  this.element.style.cssText = l;
1756
1756
  }
1757
- drawSoft(i, n = "") {
1757
+ drawSoft(s, n = "") {
1758
1758
  let a = "polygon( ";
1759
- for (const c of this.state.area) if (c !== null) {
1760
- let g = this.render.getDirection() === 1 ? { x: -c.x + this.state.position.x, y: c.y - this.state.position.y } : { x: c.x - this.state.position.x, y: c.y - this.state.position.y };
1761
- g = p.GetRotatedPoint(g, { x: 0, y: 0 }, this.state.angle), a += g.x + "px " + g.y + "px, ";
1759
+ for (const d of this.state.area) if (d !== null) {
1760
+ let p = this.render.getDirection() === 1 ? { x: -d.x + this.state.position.x, y: d.y - this.state.position.y } : { x: d.x - this.state.position.x, y: d.y - this.state.position.y };
1761
+ p = c.GetRotatedPoint(p, { x: 0, y: 0 }, this.state.angle), a += p.x + "px " + p.y + "px, ";
1762
1762
  }
1763
1763
  a = a.slice(0, -2), a += ")";
1764
- const l = n + `transform-origin: 0 0; clip-path: ${a}; -webkit-clip-path: ${a};` + (this.render.isSafari() && this.state.angle === 0 ? `transform: translate(${i.x}px, ${i.y}px);` : `transform: translate3d(${i.x}px, ${i.y}px, 0) rotate(${this.state.angle}rad);`);
1764
+ const l = n + `transform-origin: 0 0; clip-path: ${a}; -webkit-clip-path: ${a};` + (this.render.isSafari() && this.state.angle === 0 ? `transform: translate(${s.x}px, ${s.y}px);` : `transform: translate3d(${s.x}px, ${s.y}px, 0) rotate(${this.state.angle}rad);`);
1765
1765
  this.element.style.cssText = l;
1766
1766
  }
1767
- simpleDraw(i) {
1768
- const n = this.render.getRect(), a = n.pageWidth, l = n.height, c = i === 1 ? n.left + n.pageWidth : n.left, g = n.top;
1767
+ simpleDraw(s) {
1768
+ const n = this.render.getRect(), a = n.pageWidth, l = n.height, d = s === 1 ? n.left + n.pageWidth : n.left, p = n.top;
1769
1769
  this.element.classList.add("--simple"), this.element.style.cssText = `
1770
1770
  position: absolute;
1771
1771
  display: block;
1772
1772
  height: ${l}px;
1773
- left: ${c}px;
1774
- top: ${g}px;
1773
+ left: ${d}px;
1774
+ top: ${p}px;
1775
1775
  width: ${a}px;
1776
1776
  z-index: ${this.render.getSettings().startZIndex + 1};`;
1777
1777
  }
@@ -1781,44 +1781,44 @@ var ui = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1781
1781
  load() {
1782
1782
  this.isLoad = !0;
1783
1783
  }
1784
- setOrientation(i) {
1785
- super.setOrientation(i), this.element.classList.remove("--left", "--right"), this.element.classList.add(i === 1 ? "--right" : "--left");
1784
+ setOrientation(s) {
1785
+ super.setOrientation(s), this.element.classList.remove("--left", "--right"), this.element.classList.add(s === 1 ? "--right" : "--left");
1786
1786
  }
1787
- setDrawingDensity(i) {
1788
- this.element.classList.remove("--soft", "--hard"), this.element.classList.add("--" + i), super.setDrawingDensity(i);
1787
+ setDrawingDensity(s) {
1788
+ this.element.classList.remove("--soft", "--hard"), this.element.classList.add("--" + s), super.setDrawingDensity(s);
1789
1789
  }
1790
1790
  }
1791
- class x extends h {
1792
- constructor(i, n, a, l) {
1793
- super(i, n), this.element = a, this.pagesElement = l;
1791
+ class P extends h {
1792
+ constructor(s, n, a, l) {
1793
+ super(s, n), this.element = a, this.pagesElement = l;
1794
1794
  }
1795
1795
  load() {
1796
- for (const i of this.pagesElement) {
1797
- const n = new b(this.render, i, i.dataset.density === "hard" ? "hard" : "soft");
1796
+ for (const s of this.pagesElement) {
1797
+ const n = new b(this.render, s, s.dataset.density === "hard" ? "hard" : "soft");
1798
1798
  n.load(), this.pages.push(n);
1799
1799
  }
1800
1800
  this.createSpread();
1801
1801
  }
1802
1802
  }
1803
- class M {
1804
- constructor(i, n, a, l) {
1805
- this.direction = i, this.corner = n, this.topIntersectPoint = null, this.sideIntersectPoint = null, this.bottomIntersectPoint = null, this.pageWidth = parseInt(a, 10), this.pageHeight = parseInt(l, 10);
1803
+ class k {
1804
+ constructor(s, n, a, l) {
1805
+ this.direction = s, this.corner = n, this.topIntersectPoint = null, this.sideIntersectPoint = null, this.bottomIntersectPoint = null, this.pageWidth = parseInt(a, 10), this.pageHeight = parseInt(l, 10);
1806
1806
  }
1807
- calc(i) {
1807
+ calc(s) {
1808
1808
  try {
1809
- return this.position = this.calcAngleAndPosition(i), this.calculateIntersectPoint(this.position), !0;
1809
+ return this.position = this.calcAngleAndPosition(s), this.calculateIntersectPoint(this.position), !0;
1810
1810
  } catch {
1811
1811
  return !1;
1812
1812
  }
1813
1813
  }
1814
1814
  getFlippingClipArea() {
1815
- const i = [];
1815
+ const s = [];
1816
1816
  let n = !1;
1817
- return i.push(this.rect.topLeft), i.push(this.topIntersectPoint), this.sideIntersectPoint === null ? n = !0 : (i.push(this.sideIntersectPoint), this.bottomIntersectPoint === null && (n = !1)), i.push(this.bottomIntersectPoint), (n || this.corner === "bottom") && i.push(this.rect.bottomLeft), i;
1817
+ return s.push(this.rect.topLeft), s.push(this.topIntersectPoint), this.sideIntersectPoint === null ? n = !0 : (s.push(this.sideIntersectPoint), this.bottomIntersectPoint === null && (n = !1)), s.push(this.bottomIntersectPoint), (n || this.corner === "bottom") && s.push(this.rect.bottomLeft), s;
1818
1818
  }
1819
1819
  getBottomClipArea() {
1820
- const i = [];
1821
- return i.push(this.topIntersectPoint), this.corner === "top" ? i.push({ x: this.pageWidth, y: 0 }) : (this.topIntersectPoint !== null && i.push({ x: this.pageWidth, y: 0 }), i.push({ x: this.pageWidth, y: this.pageHeight })), this.sideIntersectPoint !== null ? p.GetDistanceBetweenTwoPoint(this.sideIntersectPoint, this.topIntersectPoint) >= 10 && i.push(this.sideIntersectPoint) : this.corner === "top" && i.push({ x: this.pageWidth, y: this.pageHeight }), i.push(this.bottomIntersectPoint), i.push(this.topIntersectPoint), i;
1820
+ const s = [];
1821
+ return s.push(this.topIntersectPoint), this.corner === "top" ? s.push({ x: this.pageWidth, y: 0 }) : (this.topIntersectPoint !== null && s.push({ x: this.pageWidth, y: 0 }), s.push({ x: this.pageWidth, y: this.pageHeight })), this.sideIntersectPoint !== null ? c.GetDistanceBetweenTwoPoint(this.sideIntersectPoint, this.topIntersectPoint) >= 10 && s.push(this.sideIntersectPoint) : this.corner === "top" && s.push({ x: this.pageWidth, y: this.pageHeight }), s.push(this.bottomIntersectPoint), s.push(this.topIntersectPoint), s;
1822
1822
  }
1823
1823
  getAngle() {
1824
1824
  return this.direction === 0 ? -this.angle : this.angle;
@@ -1848,126 +1848,126 @@ var ui = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1848
1848
  return this.corner === "top" ? this.topIntersectPoint : this.sideIntersectPoint !== null ? this.sideIntersectPoint : this.topIntersectPoint;
1849
1849
  }
1850
1850
  getShadowAngle() {
1851
- const i = p.GetAngleBetweenTwoLine(this.getSegmentToShadowLine(), [{ x: 0, y: 0 }, { x: this.pageWidth, y: 0 }]);
1852
- return this.direction === 0 ? i : Math.PI - i;
1851
+ const s = c.GetAngleBetweenTwoLine(this.getSegmentToShadowLine(), [{ x: 0, y: 0 }, { x: this.pageWidth, y: 0 }]);
1852
+ return this.direction === 0 ? s : Math.PI - s;
1853
1853
  }
1854
- calcAngleAndPosition(i) {
1855
- let n = i;
1854
+ calcAngleAndPosition(s) {
1855
+ let n = s;
1856
1856
  if (this.updateAngleAndGeometry(n), n = this.corner === "top" ? this.checkPositionAtCenterLine(n, { x: 0, y: 0 }, { x: 0, y: this.pageHeight }) : this.checkPositionAtCenterLine(n, { x: 0, y: this.pageHeight }, { x: 0, y: 0 }), Math.abs(n.x - this.pageWidth) < 1 && Math.abs(n.y) < 1) throw new Error("Point is too small");
1857
1857
  return n;
1858
1858
  }
1859
- updateAngleAndGeometry(i) {
1860
- this.angle = this.calculateAngle(i), this.rect = this.getPageRect(i);
1859
+ updateAngleAndGeometry(s) {
1860
+ this.angle = this.calculateAngle(s), this.rect = this.getPageRect(s);
1861
1861
  }
1862
- calculateAngle(i) {
1863
- const n = this.pageWidth - i.x + 1, a = this.corner === "bottom" ? this.pageHeight - i.y : i.y;
1862
+ calculateAngle(s) {
1863
+ const n = this.pageWidth - s.x + 1, a = this.corner === "bottom" ? this.pageHeight - s.y : s.y;
1864
1864
  let l = 2 * Math.acos(n / Math.sqrt(a * a + n * n));
1865
1865
  a < 0 && (l = -l);
1866
- const c = Math.PI - l;
1867
- if (!isFinite(l) || c >= 0 && c < 3e-3) throw new Error("The G point is too small");
1866
+ const d = Math.PI - l;
1867
+ if (!isFinite(l) || d >= 0 && d < 3e-3) throw new Error("The G point is too small");
1868
1868
  return this.corner === "bottom" && (l = -l), l;
1869
1869
  }
1870
- getPageRect(i) {
1871
- return this.corner === "top" ? this.getRectFromBasePoint([{ x: 0, y: 0 }, { x: this.pageWidth, y: 0 }, { x: 0, y: this.pageHeight }, { x: this.pageWidth, y: this.pageHeight }], i) : this.getRectFromBasePoint([{ x: 0, y: -this.pageHeight }, { x: this.pageWidth, y: -this.pageHeight }, { x: 0, y: 0 }, { x: this.pageWidth, y: 0 }], i);
1870
+ getPageRect(s) {
1871
+ return this.corner === "top" ? this.getRectFromBasePoint([{ x: 0, y: 0 }, { x: this.pageWidth, y: 0 }, { x: 0, y: this.pageHeight }, { x: this.pageWidth, y: this.pageHeight }], s) : this.getRectFromBasePoint([{ x: 0, y: -this.pageHeight }, { x: this.pageWidth, y: -this.pageHeight }, { x: 0, y: 0 }, { x: this.pageWidth, y: 0 }], s);
1872
1872
  }
1873
- getRectFromBasePoint(i, n) {
1874
- return { topLeft: this.getRotatedPoint(i[0], n), topRight: this.getRotatedPoint(i[1], n), bottomLeft: this.getRotatedPoint(i[2], n), bottomRight: this.getRotatedPoint(i[3], n) };
1873
+ getRectFromBasePoint(s, n) {
1874
+ return { topLeft: this.getRotatedPoint(s[0], n), topRight: this.getRotatedPoint(s[1], n), bottomLeft: this.getRotatedPoint(s[2], n), bottomRight: this.getRotatedPoint(s[3], n) };
1875
1875
  }
1876
- getRotatedPoint(i, n) {
1877
- return { x: i.x * Math.cos(this.angle) + i.y * Math.sin(this.angle) + n.x, y: i.y * Math.cos(this.angle) - i.x * Math.sin(this.angle) + n.y };
1876
+ getRotatedPoint(s, n) {
1877
+ return { x: s.x * Math.cos(this.angle) + s.y * Math.sin(this.angle) + n.x, y: s.y * Math.cos(this.angle) - s.x * Math.sin(this.angle) + n.y };
1878
1878
  }
1879
- calculateIntersectPoint(i) {
1879
+ calculateIntersectPoint(s) {
1880
1880
  const n = { left: -1, top: -1, width: this.pageWidth + 2, height: this.pageHeight + 2 };
1881
- this.corner === "top" ? (this.topIntersectPoint = p.GetIntersectBetweenTwoSegment(n, [i, this.rect.topRight], [{ x: 0, y: 0 }, { x: this.pageWidth, y: 0 }]), this.sideIntersectPoint = p.GetIntersectBetweenTwoSegment(n, [i, this.rect.bottomLeft], [{ x: this.pageWidth, y: 0 }, { x: this.pageWidth, y: this.pageHeight }]), this.bottomIntersectPoint = p.GetIntersectBetweenTwoSegment(n, [this.rect.bottomLeft, this.rect.bottomRight], [{ x: 0, y: this.pageHeight }, { x: this.pageWidth, y: this.pageHeight }])) : (this.topIntersectPoint = p.GetIntersectBetweenTwoSegment(n, [this.rect.topLeft, this.rect.topRight], [{ x: 0, y: 0 }, { x: this.pageWidth, y: 0 }]), this.sideIntersectPoint = p.GetIntersectBetweenTwoSegment(n, [i, this.rect.topLeft], [{ x: this.pageWidth, y: 0 }, { x: this.pageWidth, y: this.pageHeight }]), this.bottomIntersectPoint = p.GetIntersectBetweenTwoSegment(n, [this.rect.bottomLeft, this.rect.bottomRight], [{ x: 0, y: this.pageHeight }, { x: this.pageWidth, y: this.pageHeight }]));
1881
+ this.corner === "top" ? (this.topIntersectPoint = c.GetIntersectBetweenTwoSegment(n, [s, this.rect.topRight], [{ x: 0, y: 0 }, { x: this.pageWidth, y: 0 }]), this.sideIntersectPoint = c.GetIntersectBetweenTwoSegment(n, [s, this.rect.bottomLeft], [{ x: this.pageWidth, y: 0 }, { x: this.pageWidth, y: this.pageHeight }]), this.bottomIntersectPoint = c.GetIntersectBetweenTwoSegment(n, [this.rect.bottomLeft, this.rect.bottomRight], [{ x: 0, y: this.pageHeight }, { x: this.pageWidth, y: this.pageHeight }])) : (this.topIntersectPoint = c.GetIntersectBetweenTwoSegment(n, [this.rect.topLeft, this.rect.topRight], [{ x: 0, y: 0 }, { x: this.pageWidth, y: 0 }]), this.sideIntersectPoint = c.GetIntersectBetweenTwoSegment(n, [s, this.rect.topLeft], [{ x: this.pageWidth, y: 0 }, { x: this.pageWidth, y: this.pageHeight }]), this.bottomIntersectPoint = c.GetIntersectBetweenTwoSegment(n, [this.rect.bottomLeft, this.rect.bottomRight], [{ x: 0, y: this.pageHeight }, { x: this.pageWidth, y: this.pageHeight }]));
1882
1882
  }
1883
- checkPositionAtCenterLine(i, n, a) {
1884
- let l = i;
1885
- const c = p.LimitPointToCircle(n, this.pageWidth, l);
1886
- l !== c && (l = c, this.updateAngleAndGeometry(l));
1887
- const g = Math.sqrt(Math.pow(this.pageWidth, 2) + Math.pow(this.pageHeight, 2));
1883
+ checkPositionAtCenterLine(s, n, a) {
1884
+ let l = s;
1885
+ const d = c.LimitPointToCircle(n, this.pageWidth, l);
1886
+ l !== d && (l = d, this.updateAngleAndGeometry(l));
1887
+ const p = Math.sqrt(Math.pow(this.pageWidth, 2) + Math.pow(this.pageHeight, 2));
1888
1888
  let y = this.rect.bottomRight, f = this.rect.topLeft;
1889
1889
  if (this.corner === "bottom" && (y = this.rect.topRight, f = this.rect.bottomLeft), y.x <= 0) {
1890
- const C = p.LimitPointToCircle(a, g, f);
1891
- C !== l && (l = C, this.updateAngleAndGeometry(l));
1890
+ const E = c.LimitPointToCircle(a, p, f);
1891
+ E !== l && (l = E, this.updateAngleAndGeometry(l));
1892
1892
  }
1893
1893
  return l;
1894
1894
  }
1895
1895
  getSegmentToShadowLine() {
1896
- const i = this.getShadowStartPoint();
1897
- return [i, i !== this.sideIntersectPoint && this.sideIntersectPoint !== null ? this.sideIntersectPoint : this.bottomIntersectPoint];
1896
+ const s = this.getShadowStartPoint();
1897
+ return [s, s !== this.sideIntersectPoint && this.sideIntersectPoint !== null ? this.sideIntersectPoint : this.bottomIntersectPoint];
1898
1898
  }
1899
1899
  }
1900
1900
  class I {
1901
- constructor(i, n) {
1902
- this.flippingPage = null, this.bottomPage = null, this.calc = null, this.state = "read", this.render = i, this.app = n;
1901
+ constructor(s, n) {
1902
+ this.flippingPage = null, this.bottomPage = null, this.calc = null, this.state = "read", this.render = s, this.app = n;
1903
1903
  }
1904
- fold(i) {
1905
- this.setState("user_fold"), this.calc === null && this.start(i), this.do(this.render.convertToPage(i));
1904
+ fold(s) {
1905
+ this.setState("user_fold"), this.calc === null && this.start(s), this.do(this.render.convertToPage(s));
1906
1906
  }
1907
- flip(i) {
1908
- if (this.app.getSettings().disableFlipByClick && !this.isPointOnCorners(i) || (this.calc !== null && this.render.finishAnimation(), !this.start(i))) return;
1907
+ flip(s) {
1908
+ if (this.app.getSettings().disableFlipByClick && !this.isPointOnCorners(s) || (this.calc !== null && this.render.finishAnimation(), !this.start(s))) return;
1909
1909
  const n = this.getBoundsRect();
1910
1910
  this.setState("flipping");
1911
- const a = n.height / 10, l = this.calc.getCorner() === "bottom" ? n.height - a : a, c = this.calc.getCorner() === "bottom" ? n.height : 0;
1912
- this.calc.calc({ x: n.pageWidth - a, y: l }), this.animateFlippingTo({ x: n.pageWidth - a, y: l }, { x: -n.pageWidth, y: c }, !0);
1911
+ const a = n.height / 10, l = this.calc.getCorner() === "bottom" ? n.height - a : a, d = this.calc.getCorner() === "bottom" ? n.height : 0;
1912
+ this.calc.calc({ x: n.pageWidth - a, y: l }), this.animateFlippingTo({ x: n.pageWidth - a, y: l }, { x: -n.pageWidth, y: d }, !0);
1913
1913
  }
1914
- start(i) {
1914
+ start(s) {
1915
1915
  this.reset();
1916
- const n = this.render.convertToBook(i), a = this.getBoundsRect(), l = this.getDirectionByPoint(n), c = n.y >= a.height / 2 ? "bottom" : "top";
1916
+ const n = this.render.convertToBook(s), a = this.getBoundsRect(), l = this.getDirectionByPoint(n), d = n.y >= a.height / 2 ? "bottom" : "top";
1917
1917
  if (!this.checkDirection(l)) return !1;
1918
1918
  try {
1919
1919
  if (this.flippingPage = this.app.getPageCollection().getFlippingPage(l), this.bottomPage = this.app.getPageCollection().getBottomPage(l), this.render.getOrientation() === "landscape") if (l === 1) {
1920
- const g = this.app.getPageCollection().nextBy(this.flippingPage);
1921
- g !== null && this.flippingPage.getDensity() !== g.getDensity() && (this.flippingPage.setDrawingDensity("hard"), g.setDrawingDensity("hard"));
1920
+ const p = this.app.getPageCollection().nextBy(this.flippingPage);
1921
+ p !== null && this.flippingPage.getDensity() !== p.getDensity() && (this.flippingPage.setDrawingDensity("hard"), p.setDrawingDensity("hard"));
1922
1922
  } else {
1923
- const g = this.app.getPageCollection().prevBy(this.flippingPage);
1924
- g !== null && this.flippingPage.getDensity() !== g.getDensity() && (this.flippingPage.setDrawingDensity("hard"), g.setDrawingDensity("hard"));
1923
+ const p = this.app.getPageCollection().prevBy(this.flippingPage);
1924
+ p !== null && this.flippingPage.getDensity() !== p.getDensity() && (this.flippingPage.setDrawingDensity("hard"), p.setDrawingDensity("hard"));
1925
1925
  }
1926
- return this.render.setDirection(l), this.calc = new M(l, c, a.pageWidth.toString(10), a.height.toString(10)), !0;
1926
+ return this.render.setDirection(l), this.calc = new k(l, d, a.pageWidth.toString(10), a.height.toString(10)), !0;
1927
1927
  } catch {
1928
1928
  return !1;
1929
1929
  }
1930
1930
  }
1931
- do(i) {
1932
- if (this.calc !== null && this.calc.calc(i)) {
1931
+ do(s) {
1932
+ if (this.calc !== null && this.calc.calc(s)) {
1933
1933
  const n = this.calc.getFlippingProgress();
1934
1934
  this.bottomPage.setArea(this.calc.getBottomClipArea()), this.bottomPage.setPosition(this.calc.getBottomPagePosition()), this.bottomPage.setAngle(0), this.bottomPage.setHardAngle(0), this.flippingPage.setArea(this.calc.getFlippingClipArea()), this.flippingPage.setPosition(this.calc.getActiveCorner()), this.flippingPage.setAngle(this.calc.getAngle()), this.calc.getDirection() === 0 ? this.flippingPage.setHardAngle(90 * (200 - 2 * n) / 100) : this.flippingPage.setHardAngle(-90 * (200 - 2 * n) / 100), this.render.setPageRect(this.calc.getRect()), this.render.setBottomPage(this.bottomPage), this.render.setFlippingPage(this.flippingPage), this.render.setShadowData(this.calc.getShadowStartPoint(), this.calc.getShadowAngle(), n, this.calc.getDirection());
1935
1935
  }
1936
1936
  }
1937
- flipToPage(i, n) {
1938
- const a = this.app.getPageCollection().getCurrentSpreadIndex(), l = this.app.getPageCollection().getSpreadIndexByPage(i);
1937
+ flipToPage(s, n) {
1938
+ const a = this.app.getPageCollection().getCurrentSpreadIndex(), l = this.app.getPageCollection().getSpreadIndexByPage(s);
1939
1939
  try {
1940
1940
  l > a && (this.app.getPageCollection().setCurrentSpreadIndex(l - 1), this.flipNext(n)), l < a && (this.app.getPageCollection().setCurrentSpreadIndex(l + 1), this.flipPrev(n));
1941
1941
  } catch {
1942
1942
  }
1943
1943
  }
1944
- flipNext(i) {
1945
- this.flip({ x: this.render.getRect().left + 2 * this.render.getRect().pageWidth - 10, y: i === "top" ? 1 : this.render.getRect().height - 2 });
1944
+ flipNext(s) {
1945
+ this.flip({ x: this.render.getRect().left + 2 * this.render.getRect().pageWidth - 10, y: s === "top" ? 1 : this.render.getRect().height - 2 });
1946
1946
  }
1947
- flipPrev(i) {
1948
- this.flip({ x: 10, y: i === "top" ? 1 : this.render.getRect().height - 2 });
1947
+ flipPrev(s) {
1948
+ this.flip({ x: 10, y: s === "top" ? 1 : this.render.getRect().height - 2 });
1949
1949
  }
1950
1950
  stopMove() {
1951
1951
  if (this.calc === null) return;
1952
- const i = this.calc.getPosition(), n = this.getBoundsRect(), a = this.calc.getCorner() === "bottom" ? n.height : 0;
1953
- i.x <= 0 ? this.animateFlippingTo(i, { x: -n.pageWidth, y: a }, !0) : this.animateFlippingTo(i, { x: n.pageWidth, y: a }, !1);
1952
+ const s = this.calc.getPosition(), n = this.getBoundsRect(), a = this.calc.getCorner() === "bottom" ? n.height : 0;
1953
+ s.x <= 0 ? this.animateFlippingTo(s, { x: -n.pageWidth, y: a }, !0) : this.animateFlippingTo(s, { x: n.pageWidth, y: a }, !1);
1954
1954
  }
1955
- showCorner(i) {
1955
+ showCorner(s) {
1956
1956
  if (!this.checkState("read", "fold_corner")) return;
1957
1957
  const n = this.getBoundsRect(), a = n.pageWidth;
1958
- if (this.isPointOnCorners(i)) if (this.calc === null) {
1959
- if (!this.start(i)) return;
1958
+ if (this.isPointOnCorners(s)) if (this.calc === null) {
1959
+ if (!this.start(s)) return;
1960
1960
  this.setState("fold_corner"), this.calc.calc({ x: a - 1, y: 1 });
1961
- const l = 50, c = this.calc.getCorner() === "bottom" ? n.height - 1 : 1, g = this.calc.getCorner() === "bottom" ? n.height - l : l;
1962
- this.animateFlippingTo({ x: a - 1, y: c }, { x: a - l, y: g }, !1, !1);
1963
- } else this.do(this.render.convertToPage(i));
1961
+ const l = 50, d = this.calc.getCorner() === "bottom" ? n.height - 1 : 1, p = this.calc.getCorner() === "bottom" ? n.height - l : l;
1962
+ this.animateFlippingTo({ x: a - 1, y: d }, { x: a - l, y: p }, !1, !1);
1963
+ } else this.do(this.render.convertToPage(s));
1964
1964
  else this.setState("read"), this.render.finishAnimation(), this.stopMove();
1965
1965
  }
1966
- animateFlippingTo(i, n, a, l = !0) {
1967
- const c = p.GetCordsFromTwoPoint(i, n), g = [];
1968
- for (const f of c) g.push(() => this.do(f));
1969
- const y = this.getAnimationDuration(c.length);
1970
- this.render.startAnimation(g, y, () => {
1966
+ animateFlippingTo(s, n, a, l = !0) {
1967
+ const d = c.GetCordsFromTwoPoint(s, n), p = [];
1968
+ for (const f of d) p.push(() => this.do(f));
1969
+ const y = this.getAnimationDuration(d.length);
1970
+ this.render.startAnimation(p, y, () => {
1971
1971
  this.calc && (a && (this.calc.getDirection() === 1 ? this.app.turnToPrevPage() : this.app.turnToNextPage()), l && (this.render.setBottomPage(null), this.render.setFlippingPage(null), this.render.clearShadow(), this.setState("read"), this.reset()));
1972
1972
  });
1973
1973
  }
@@ -1977,22 +1977,22 @@ var ui = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1977
1977
  getState() {
1978
1978
  return this.state;
1979
1979
  }
1980
- setState(i) {
1981
- this.state !== i && (this.app.updateState(i), this.state = i);
1980
+ setState(s) {
1981
+ this.state !== s && (this.app.updateState(s), this.state = s);
1982
1982
  }
1983
- getDirectionByPoint(i) {
1983
+ getDirectionByPoint(s) {
1984
1984
  const n = this.getBoundsRect();
1985
1985
  if (this.render.getOrientation() === "portrait") {
1986
- if (i.x - n.pageWidth <= n.width / 5) return 1;
1987
- } else if (i.x < n.width / 2) return 1;
1986
+ if (s.x - n.pageWidth <= n.width / 5) return 1;
1987
+ } else if (s.x < n.width / 2) return 1;
1988
1988
  return 0;
1989
1989
  }
1990
- getAnimationDuration(i) {
1990
+ getAnimationDuration(s) {
1991
1991
  const n = this.app.getSettings().flippingTime;
1992
- return i >= 1e3 ? n : i / 1e3 * n;
1992
+ return s >= 1e3 ? n : s / 1e3 * n;
1993
1993
  }
1994
- checkDirection(i) {
1995
- return i === 0 ? this.app.getCurrentPageIndex() < this.app.getPageCount() - 1 : this.app.getCurrentPageIndex() >= 1;
1994
+ checkDirection(s) {
1995
+ return s === 0 ? this.app.getCurrentPageIndex() < this.app.getPageCount() - 1 : this.app.getCurrentPageIndex() >= 1;
1996
1996
  }
1997
1997
  reset() {
1998
1998
  this.calc = null, this.flippingPage = null, this.bottomPage = null;
@@ -2000,56 +2000,56 @@ var ui = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2000
2000
  getBoundsRect() {
2001
2001
  return this.render.getRect();
2002
2002
  }
2003
- checkState(...i) {
2004
- for (const n of i) if (this.state === n) return !0;
2003
+ checkState(...s) {
2004
+ for (const n of s) if (this.state === n) return !0;
2005
2005
  return !1;
2006
2006
  }
2007
- isPointOnCorners(i) {
2008
- const n = this.getBoundsRect(), a = n.pageWidth, l = Math.sqrt(Math.pow(a, 2) + Math.pow(n.height, 2)) / 5, c = this.render.convertToBook(i);
2009
- return c.x > 0 && c.y > 0 && c.x < n.width && c.y < n.height && (c.x < l || c.x > n.width - l) && (c.y < l || c.y > n.height - l);
2007
+ isPointOnCorners(s) {
2008
+ const n = this.getBoundsRect(), a = n.pageWidth, l = Math.sqrt(Math.pow(a, 2) + Math.pow(n.height, 2)) / 5, d = this.render.convertToBook(s);
2009
+ return d.x > 0 && d.y > 0 && d.x < n.width && d.y < n.height && (d.x < l || d.x > n.width - l) && (d.y < l || d.y > n.height - l);
2010
2010
  }
2011
2011
  }
2012
2012
  class S {
2013
- constructor(i, n) {
2014
- this.leftPage = null, this.rightPage = null, this.flippingPage = null, this.bottomPage = null, this.direction = null, this.orientation = null, this.shadow = null, this.animation = null, this.pageRect = null, this.boundsRect = null, this.timer = 0, this.safari = !1, this.setting = n, this.app = i;
2013
+ constructor(s, n) {
2014
+ this.leftPage = null, this.rightPage = null, this.flippingPage = null, this.bottomPage = null, this.direction = null, this.orientation = null, this.shadow = null, this.animation = null, this.pageRect = null, this.boundsRect = null, this.timer = 0, this.safari = !1, this.setting = n, this.app = s;
2015
2015
  const a = new RegExp("Version\\/[\\d\\.]+.*Safari/");
2016
2016
  this.safari = a.exec(window.navigator.userAgent) !== null;
2017
2017
  }
2018
- render(i) {
2018
+ render(s) {
2019
2019
  if (this.animation !== null) {
2020
- const n = Math.round((i - this.animation.startedAt) / this.animation.durationFrame);
2020
+ const n = Math.round((s - this.animation.startedAt) / this.animation.durationFrame);
2021
2021
  n < this.animation.frames.length ? this.animation.frames[n]() : (this.animation.onAnimateEnd(), this.animation = null);
2022
2022
  }
2023
- this.timer = i, this.drawFrame();
2023
+ this.timer = s, this.drawFrame();
2024
2024
  }
2025
2025
  start() {
2026
2026
  this.update();
2027
- const i = (n) => {
2028
- this.render(n), requestAnimationFrame(i);
2027
+ const s = (n) => {
2028
+ this.render(n), requestAnimationFrame(s);
2029
2029
  };
2030
- requestAnimationFrame(i);
2030
+ requestAnimationFrame(s);
2031
2031
  }
2032
- startAnimation(i, n, a) {
2033
- this.finishAnimation(), this.animation = { frames: i, duration: n, durationFrame: n / i.length, onAnimateEnd: a, startedAt: this.timer };
2032
+ startAnimation(s, n, a) {
2033
+ this.finishAnimation(), this.animation = { frames: s, duration: n, durationFrame: n / s.length, onAnimateEnd: a, startedAt: this.timer };
2034
2034
  }
2035
2035
  finishAnimation() {
2036
2036
  this.animation !== null && (this.animation.frames[this.animation.frames.length - 1](), this.animation.onAnimateEnd !== null && this.animation.onAnimateEnd()), this.animation = null;
2037
2037
  }
2038
2038
  update() {
2039
2039
  this.boundsRect = null;
2040
- const i = this.calculateBoundsRect();
2041
- this.orientation !== i && (this.orientation = i, this.app.updateOrientation(i));
2040
+ const s = this.calculateBoundsRect();
2041
+ this.orientation !== s && (this.orientation = s, this.app.updateOrientation(s));
2042
2042
  }
2043
2043
  calculateBoundsRect() {
2044
- let i = "landscape";
2045
- const n = this.getBlockWidth(), a = n / 2, l = this.getBlockHeight() / 2, c = this.setting.width / this.setting.height;
2046
- let g = this.setting.width, y = this.setting.height, f = a - g;
2047
- return this.setting.size === "stretch" ? (n < 2 * this.setting.minWidth && this.app.getSettings().usePortrait && (i = "portrait"), g = i === "portrait" ? this.getBlockWidth() : this.getBlockWidth() / 2, g > this.setting.maxWidth && (g = this.setting.maxWidth), y = g / c, y > this.getBlockHeight() && (y = this.getBlockHeight(), g = y * c), f = i === "portrait" ? a - g / 2 - g : a - g) : n < 2 * g && this.app.getSettings().usePortrait && (i = "portrait", f = a - g / 2 - g), this.boundsRect = { left: f, top: l - y / 2, width: 2 * g, height: y, pageWidth: g }, i;
2044
+ let s = "landscape";
2045
+ const n = this.getBlockWidth(), a = n / 2, l = this.getBlockHeight() / 2, d = this.setting.width / this.setting.height;
2046
+ let p = this.setting.width, y = this.setting.height, f = a - p;
2047
+ return this.setting.size === "stretch" ? (n < 2 * this.setting.minWidth && this.app.getSettings().usePortrait && (s = "portrait"), p = s === "portrait" ? this.getBlockWidth() : this.getBlockWidth() / 2, p > this.setting.maxWidth && (p = this.setting.maxWidth), y = p / d, y > this.getBlockHeight() && (y = this.getBlockHeight(), p = y * d), f = s === "portrait" ? a - p / 2 - p : a - p) : n < 2 * p && this.app.getSettings().usePortrait && (s = "portrait", f = a - p / 2 - p), this.boundsRect = { left: f, top: l - y / 2, width: 2 * p, height: y, pageWidth: p }, s;
2048
2048
  }
2049
- setShadowData(i, n, a, l) {
2049
+ setShadowData(s, n, a, l) {
2050
2050
  if (!this.app.getSettings().drawShadow) return;
2051
- const c = 100 * this.getSettings().maxShadowOpacity;
2052
- this.shadow = { pos: i, angle: n, width: 3 * this.getRect().pageWidth / 4 * a / 100, opacity: (100 - a) * c / 100 / 100, direction: l, progress: 2 * a };
2051
+ const d = 100 * this.getSettings().maxShadowOpacity;
2052
+ this.shadow = { pos: s, angle: n, width: 3 * this.getRect().pageWidth / 4 * a / 100, opacity: (100 - a) * d / 100 / 100, direction: l, progress: 2 * a };
2053
2053
  }
2054
2054
  clearShadow() {
2055
2055
  this.shadow = null;
@@ -2072,48 +2072,48 @@ var ui = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2072
2072
  getOrientation() {
2073
2073
  return this.orientation;
2074
2074
  }
2075
- setPageRect(i) {
2076
- this.pageRect = i;
2075
+ setPageRect(s) {
2076
+ this.pageRect = s;
2077
2077
  }
2078
- setDirection(i) {
2079
- this.direction = i;
2078
+ setDirection(s) {
2079
+ this.direction = s;
2080
2080
  }
2081
- setRightPage(i) {
2082
- i !== null && i.setOrientation(1), this.rightPage = i;
2081
+ setRightPage(s) {
2082
+ s !== null && s.setOrientation(1), this.rightPage = s;
2083
2083
  }
2084
- setLeftPage(i) {
2085
- i !== null && i.setOrientation(0), this.leftPage = i;
2084
+ setLeftPage(s) {
2085
+ s !== null && s.setOrientation(0), this.leftPage = s;
2086
2086
  }
2087
- setBottomPage(i) {
2088
- i !== null && i.setOrientation(this.direction === 1 ? 0 : 1), this.bottomPage = i;
2087
+ setBottomPage(s) {
2088
+ s !== null && s.setOrientation(this.direction === 1 ? 0 : 1), this.bottomPage = s;
2089
2089
  }
2090
- setFlippingPage(i) {
2091
- i !== null && i.setOrientation(this.direction === 0 && this.orientation !== "portrait" ? 0 : 1), this.flippingPage = i;
2090
+ setFlippingPage(s) {
2091
+ s !== null && s.setOrientation(this.direction === 0 && this.orientation !== "portrait" ? 0 : 1), this.flippingPage = s;
2092
2092
  }
2093
- convertToBook(i) {
2093
+ convertToBook(s) {
2094
2094
  const n = this.getRect();
2095
- return { x: i.x - n.left, y: i.y - n.top };
2095
+ return { x: s.x - n.left, y: s.y - n.top };
2096
2096
  }
2097
2097
  isSafari() {
2098
2098
  return this.safari;
2099
2099
  }
2100
- convertToPage(i, n) {
2100
+ convertToPage(s, n) {
2101
2101
  n || (n = this.direction);
2102
2102
  const a = this.getRect();
2103
- return { x: n === 0 ? i.x - a.left - a.width / 2 : a.width / 2 - i.x + a.left, y: i.y - a.top };
2103
+ return { x: n === 0 ? s.x - a.left - a.width / 2 : a.width / 2 - s.x + a.left, y: s.y - a.top };
2104
2104
  }
2105
- convertToGlobal(i, n) {
2106
- if (n || (n = this.direction), i == null) return null;
2105
+ convertToGlobal(s, n) {
2106
+ if (n || (n = this.direction), s == null) return null;
2107
2107
  const a = this.getRect();
2108
- return { x: n === 0 ? i.x + a.left + a.width / 2 : a.width / 2 - i.x + a.left, y: i.y + a.top };
2108
+ return { x: n === 0 ? s.x + a.left + a.width / 2 : a.width / 2 - s.x + a.left, y: s.y + a.top };
2109
2109
  }
2110
- convertRectToGlobal(i, n) {
2111
- return n || (n = this.direction), { topLeft: this.convertToGlobal(i.topLeft, n), topRight: this.convertToGlobal(i.topRight, n), bottomLeft: this.convertToGlobal(i.bottomLeft, n), bottomRight: this.convertToGlobal(i.bottomRight, n) };
2110
+ convertRectToGlobal(s, n) {
2111
+ return n || (n = this.direction), { topLeft: this.convertToGlobal(s.topLeft, n), topRight: this.convertToGlobal(s.topRight, n), bottomLeft: this.convertToGlobal(s.bottomLeft, n), bottomRight: this.convertToGlobal(s.bottomRight, n) };
2112
2112
  }
2113
2113
  }
2114
2114
  class T extends S {
2115
- constructor(i, n, a) {
2116
- super(i, n), this.canvas = a, this.ctx = a.getContext("2d");
2115
+ constructor(s, n, a) {
2116
+ super(s, n), this.canvas = a, this.ctx = a.getContext("2d");
2117
2117
  }
2118
2118
  getContext() {
2119
2119
  return this.ctx;
@@ -2122,79 +2122,79 @@ var ui = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2122
2122
  }
2123
2123
  drawFrame() {
2124
2124
  this.clear(), this.orientation !== "portrait" && this.leftPage != null && this.leftPage.simpleDraw(0), this.rightPage != null && this.rightPage.simpleDraw(1), this.bottomPage != null && this.bottomPage.draw(), this.drawBookShadow(), this.flippingPage != null && this.flippingPage.draw(), this.shadow != null && (this.drawOuterShadow(), this.drawInnerShadow());
2125
- const i = this.getRect();
2126
- this.orientation === "portrait" && (this.ctx.beginPath(), this.ctx.rect(i.left + i.pageWidth, i.top, i.width, i.height), this.ctx.clip());
2125
+ const s = this.getRect();
2126
+ this.orientation === "portrait" && (this.ctx.beginPath(), this.ctx.rect(s.left + s.pageWidth, s.top, s.width, s.height), this.ctx.clip());
2127
2127
  }
2128
2128
  drawBookShadow() {
2129
- const i = this.getRect();
2129
+ const s = this.getRect();
2130
2130
  this.ctx.save(), this.ctx.beginPath();
2131
- const n = i.width / 20;
2132
- this.ctx.rect(i.left, i.top, i.width, i.height);
2133
- const a = { x: i.left + i.width / 2 - n / 2, y: 0 };
2131
+ const n = s.width / 20;
2132
+ this.ctx.rect(s.left, s.top, s.width, s.height);
2133
+ const a = { x: s.left + s.width / 2 - n / 2, y: 0 };
2134
2134
  this.ctx.translate(a.x, a.y);
2135
2135
  const l = this.ctx.createLinearGradient(0, 0, n, 0);
2136
- l.addColorStop(0, "rgba(0, 0, 0, 0)"), l.addColorStop(0.4, "rgba(0, 0, 0, 0.2)"), l.addColorStop(0.49, "rgba(0, 0, 0, 0.1)"), l.addColorStop(0.5, "rgba(0, 0, 0, 0.5)"), l.addColorStop(0.51, "rgba(0, 0, 0, 0.4)"), l.addColorStop(1, "rgba(0, 0, 0, 0)"), this.ctx.clip(), this.ctx.fillStyle = l, this.ctx.fillRect(0, 0, n, 2 * i.height), this.ctx.restore();
2136
+ l.addColorStop(0, "rgba(0, 0, 0, 0)"), l.addColorStop(0.4, "rgba(0, 0, 0, 0.2)"), l.addColorStop(0.49, "rgba(0, 0, 0, 0.1)"), l.addColorStop(0.5, "rgba(0, 0, 0, 0.5)"), l.addColorStop(0.51, "rgba(0, 0, 0, 0.4)"), l.addColorStop(1, "rgba(0, 0, 0, 0)"), this.ctx.clip(), this.ctx.fillStyle = l, this.ctx.fillRect(0, 0, n, 2 * s.height), this.ctx.restore();
2137
2137
  }
2138
2138
  drawOuterShadow() {
2139
- const i = this.getRect();
2140
- this.ctx.save(), this.ctx.beginPath(), this.ctx.rect(i.left, i.top, i.width, i.height);
2139
+ const s = this.getRect();
2140
+ this.ctx.save(), this.ctx.beginPath(), this.ctx.rect(s.left, s.top, s.width, s.height);
2141
2141
  const n = this.convertToGlobal({ x: this.shadow.pos.x, y: this.shadow.pos.y });
2142
2142
  this.ctx.translate(n.x, n.y), this.ctx.rotate(Math.PI + this.shadow.angle + Math.PI / 2);
2143
2143
  const a = this.ctx.createLinearGradient(0, 0, this.shadow.width, 0);
2144
- this.shadow.direction === 0 ? (this.ctx.translate(0, -100), a.addColorStop(0, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), a.addColorStop(1, "rgba(0, 0, 0, 0)")) : (this.ctx.translate(-this.shadow.width, -100), a.addColorStop(0, "rgba(0, 0, 0, 0)"), a.addColorStop(1, "rgba(0, 0, 0, " + this.shadow.opacity + ")")), this.ctx.clip(), this.ctx.fillStyle = a, this.ctx.fillRect(0, 0, this.shadow.width, 2 * i.height), this.ctx.restore();
2144
+ this.shadow.direction === 0 ? (this.ctx.translate(0, -100), a.addColorStop(0, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), a.addColorStop(1, "rgba(0, 0, 0, 0)")) : (this.ctx.translate(-this.shadow.width, -100), a.addColorStop(0, "rgba(0, 0, 0, 0)"), a.addColorStop(1, "rgba(0, 0, 0, " + this.shadow.opacity + ")")), this.ctx.clip(), this.ctx.fillStyle = a, this.ctx.fillRect(0, 0, this.shadow.width, 2 * s.height), this.ctx.restore();
2145
2145
  }
2146
2146
  drawInnerShadow() {
2147
- const i = this.getRect();
2147
+ const s = this.getRect();
2148
2148
  this.ctx.save(), this.ctx.beginPath();
2149
2149
  const n = this.convertToGlobal({ x: this.shadow.pos.x, y: this.shadow.pos.y }), a = this.convertRectToGlobal(this.pageRect);
2150
2150
  this.ctx.moveTo(a.topLeft.x, a.topLeft.y), this.ctx.lineTo(a.topRight.x, a.topRight.y), this.ctx.lineTo(a.bottomRight.x, a.bottomRight.y), this.ctx.lineTo(a.bottomLeft.x, a.bottomLeft.y), this.ctx.translate(n.x, n.y), this.ctx.rotate(Math.PI + this.shadow.angle + Math.PI / 2);
2151
- const l = 3 * this.shadow.width / 4, c = this.ctx.createLinearGradient(0, 0, l, 0);
2152
- this.shadow.direction === 0 ? (this.ctx.translate(-l, -100), c.addColorStop(1, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), c.addColorStop(0.9, "rgba(0, 0, 0, 0.05)"), c.addColorStop(0.7, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), c.addColorStop(0, "rgba(0, 0, 0, 0)")) : (this.ctx.translate(0, -100), c.addColorStop(0, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), c.addColorStop(0.1, "rgba(0, 0, 0, 0.05)"), c.addColorStop(0.3, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), c.addColorStop(1, "rgba(0, 0, 0, 0)")), this.ctx.clip(), this.ctx.fillStyle = c, this.ctx.fillRect(0, 0, l, 2 * i.height), this.ctx.restore();
2151
+ const l = 3 * this.shadow.width / 4, d = this.ctx.createLinearGradient(0, 0, l, 0);
2152
+ this.shadow.direction === 0 ? (this.ctx.translate(-l, -100), d.addColorStop(1, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), d.addColorStop(0.9, "rgba(0, 0, 0, 0.05)"), d.addColorStop(0.7, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), d.addColorStop(0, "rgba(0, 0, 0, 0)")) : (this.ctx.translate(0, -100), d.addColorStop(0, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), d.addColorStop(0.1, "rgba(0, 0, 0, 0.05)"), d.addColorStop(0.3, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), d.addColorStop(1, "rgba(0, 0, 0, 0)")), this.ctx.clip(), this.ctx.fillStyle = d, this.ctx.fillRect(0, 0, l, 2 * s.height), this.ctx.restore();
2153
2153
  }
2154
2154
  clear() {
2155
2155
  this.ctx.fillStyle = "white", this.ctx.fillRect(0, 0, this.canvas.width, this.canvas.height);
2156
2156
  }
2157
2157
  }
2158
- class E {
2159
- constructor(i, n, a) {
2158
+ class A {
2159
+ constructor(s, n, a) {
2160
2160
  this.touchPoint = null, this.swipeTimeout = 250, this.onResize = () => {
2161
2161
  this.update();
2162
- }, this.onMouseDown = (c) => {
2163
- if (this.checkTarget(c.target)) {
2164
- const g = this.getMousePos(c.clientX, c.clientY);
2165
- this.app.startUserTouch(g), c.preventDefault();
2162
+ }, this.onMouseDown = (d) => {
2163
+ if (this.checkTarget(d.target)) {
2164
+ const p = this.getMousePos(d.clientX, d.clientY);
2165
+ this.app.startUserTouch(p), d.preventDefault();
2166
2166
  }
2167
- }, this.onTouchStart = (c) => {
2168
- if (this.checkTarget(c.target) && c.changedTouches.length > 0) {
2169
- const g = c.changedTouches[0], y = this.getMousePos(g.clientX, g.clientY);
2167
+ }, this.onTouchStart = (d) => {
2168
+ if (this.checkTarget(d.target) && d.changedTouches.length > 0) {
2169
+ const p = d.changedTouches[0], y = this.getMousePos(p.clientX, p.clientY);
2170
2170
  this.touchPoint = { point: y, time: Date.now() }, setTimeout(() => {
2171
2171
  this.touchPoint !== null && this.app.startUserTouch(y);
2172
- }, this.swipeTimeout), this.app.getSettings().mobileScrollSupport || c.preventDefault();
2172
+ }, this.swipeTimeout), this.app.getSettings().mobileScrollSupport || d.preventDefault();
2173
2173
  }
2174
- }, this.onMouseUp = (c) => {
2175
- const g = this.getMousePos(c.clientX, c.clientY);
2176
- this.app.userStop(g);
2177
- }, this.onMouseMove = (c) => {
2178
- const g = this.getMousePos(c.clientX, c.clientY);
2179
- this.app.userMove(g, !1);
2180
- }, this.onTouchMove = (c) => {
2181
- if (c.changedTouches.length > 0) {
2182
- const g = c.changedTouches[0], y = this.getMousePos(g.clientX, g.clientY);
2183
- this.app.getSettings().mobileScrollSupport ? (this.touchPoint !== null && (Math.abs(this.touchPoint.point.x - y.x) > 10 || this.app.getState() !== "read") && c.cancelable && this.app.userMove(y, !0), this.app.getState() !== "read" && c.preventDefault()) : this.app.userMove(y, !0);
2174
+ }, this.onMouseUp = (d) => {
2175
+ const p = this.getMousePos(d.clientX, d.clientY);
2176
+ this.app.userStop(p);
2177
+ }, this.onMouseMove = (d) => {
2178
+ const p = this.getMousePos(d.clientX, d.clientY);
2179
+ this.app.userMove(p, !1);
2180
+ }, this.onTouchMove = (d) => {
2181
+ if (d.changedTouches.length > 0) {
2182
+ const p = d.changedTouches[0], y = this.getMousePos(p.clientX, p.clientY);
2183
+ this.app.getSettings().mobileScrollSupport ? (this.touchPoint !== null && (Math.abs(this.touchPoint.point.x - y.x) > 10 || this.app.getState() !== "read") && d.cancelable && this.app.userMove(y, !0), this.app.getState() !== "read" && d.preventDefault()) : this.app.userMove(y, !0);
2184
2184
  }
2185
- }, this.onTouchEnd = (c) => {
2186
- if (c.changedTouches.length > 0) {
2187
- const g = c.changedTouches[0], y = this.getMousePos(g.clientX, g.clientY);
2185
+ }, this.onTouchEnd = (d) => {
2186
+ if (d.changedTouches.length > 0) {
2187
+ const p = d.changedTouches[0], y = this.getMousePos(p.clientX, p.clientY);
2188
2188
  let f = !1;
2189
2189
  if (this.touchPoint !== null) {
2190
- const C = y.x - this.touchPoint.point.x, R = Math.abs(y.y - this.touchPoint.point.y);
2191
- Math.abs(C) > this.swipeDistance && R < 2 * this.swipeDistance && Date.now() - this.touchPoint.time < this.swipeTimeout && (C > 0 ? this.app.flipPrev(this.touchPoint.point.y < this.app.getRender().getRect().height / 2 ? "top" : "bottom") : this.app.flipNext(this.touchPoint.point.y < this.app.getRender().getRect().height / 2 ? "top" : "bottom"), f = !0), this.touchPoint = null;
2190
+ const E = y.x - this.touchPoint.point.x, R = Math.abs(y.y - this.touchPoint.point.y);
2191
+ Math.abs(E) > this.swipeDistance && R < 2 * this.swipeDistance && Date.now() - this.touchPoint.time < this.swipeTimeout && (E > 0 ? this.app.flipPrev(this.touchPoint.point.y < this.app.getRender().getRect().height / 2 ? "top" : "bottom") : this.app.flipNext(this.touchPoint.point.y < this.app.getRender().getRect().height / 2 ? "top" : "bottom"), f = !0), this.touchPoint = null;
2192
2192
  }
2193
2193
  this.app.userStop(y, f);
2194
2194
  }
2195
- }, this.parentElement = i, i.classList.add("stf__parent"), i.insertAdjacentHTML("afterbegin", '<div class="stf__wrapper"></div>'), this.wrapper = i.querySelector(".stf__wrapper"), this.app = n;
2195
+ }, this.parentElement = s, s.classList.add("stf__parent"), s.insertAdjacentHTML("afterbegin", '<div class="stf__wrapper"></div>'), this.wrapper = s.querySelector(".stf__wrapper"), this.app = n;
2196
2196
  const l = this.app.getSettings().usePortrait ? 1 : 2;
2197
- i.style.minWidth = a.minWidth * l + "px", i.style.minHeight = a.minHeight + "px", a.size === "fixed" && (i.style.minWidth = a.width * l + "px", i.style.minHeight = a.height + "px"), a.autoSize && (i.style.width = "100%", i.style.maxWidth = 2 * a.maxWidth + "px"), i.style.display = "block", window.addEventListener("resize", this.onResize, !1), this.swipeDistance = a.swipeDistance;
2197
+ s.style.minWidth = a.minWidth * l + "px", s.style.minHeight = a.minHeight + "px", a.size === "fixed" && (s.style.minWidth = a.width * l + "px", s.style.minHeight = a.height + "px"), a.autoSize && (s.style.width = "100%", s.style.maxWidth = 2 * a.maxWidth + "px"), s.style.display = "block", window.addEventListener("resize", this.onResize, !1), this.swipeDistance = a.swipeDistance;
2198
2198
  }
2199
2199
  destroy() {
2200
2200
  this.app.getSettings().useMouseEvents && this.removeHandlers(), this.distElement.remove(), this.wrapper.remove();
@@ -2205,8 +2205,8 @@ var ui = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2205
2205
  getWrapper() {
2206
2206
  return this.wrapper;
2207
2207
  }
2208
- setOrientationStyle(i) {
2209
- this.wrapper.classList.remove("--portrait", "--landscape"), i === "portrait" ? (this.app.getSettings().autoSize && (this.wrapper.style.paddingBottom = this.app.getSettings().height / this.app.getSettings().width * 100 + "%"), this.wrapper.classList.add("--portrait")) : (this.app.getSettings().autoSize && (this.wrapper.style.paddingBottom = this.app.getSettings().height / (2 * this.app.getSettings().width) * 100 + "%"), this.wrapper.classList.add("--landscape")), this.update();
2208
+ setOrientationStyle(s) {
2209
+ this.wrapper.classList.remove("--portrait", "--landscape"), s === "portrait" ? (this.app.getSettings().autoSize && (this.wrapper.style.paddingBottom = this.app.getSettings().height / this.app.getSettings().width * 100 + "%"), this.wrapper.classList.add("--portrait")) : (this.app.getSettings().autoSize && (this.wrapper.style.paddingBottom = this.app.getSettings().height / (2 * this.app.getSettings().width) * 100 + "%"), this.wrapper.classList.add("--landscape")), this.update();
2210
2210
  }
2211
2211
  removeHandlers() {
2212
2212
  window.removeEventListener("resize", this.onResize), this.distElement.removeEventListener("mousedown", this.onMouseDown), this.distElement.removeEventListener("touchstart", this.onTouchStart), window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("touchmove", this.onTouchMove), window.removeEventListener("mouseup", this.onMouseUp), window.removeEventListener("touchend", this.onTouchEnd);
@@ -2214,38 +2214,38 @@ var ui = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2214
2214
  setHandlers() {
2215
2215
  window.addEventListener("resize", this.onResize, !1), this.app.getSettings().useMouseEvents && (this.distElement.addEventListener("mousedown", this.onMouseDown), this.distElement.addEventListener("touchstart", this.onTouchStart), window.addEventListener("mousemove", this.onMouseMove), window.addEventListener("touchmove", this.onTouchMove, { passive: !this.app.getSettings().mobileScrollSupport }), window.addEventListener("mouseup", this.onMouseUp), window.addEventListener("touchend", this.onTouchEnd));
2216
2216
  }
2217
- getMousePos(i, n) {
2217
+ getMousePos(s, n) {
2218
2218
  const a = this.distElement.getBoundingClientRect();
2219
- return { x: i - a.left, y: n - a.top };
2219
+ return { x: s - a.left, y: n - a.top };
2220
2220
  }
2221
- checkTarget(i) {
2222
- return !this.app.getSettings().clickEventForward || !["a", "button"].includes(i.tagName.toLowerCase());
2221
+ checkTarget(s) {
2222
+ return !this.app.getSettings().clickEventForward || !["a", "button"].includes(s.tagName.toLowerCase());
2223
2223
  }
2224
2224
  }
2225
- class W extends E {
2226
- constructor(i, n, a, l) {
2227
- super(i, n, a), this.wrapper.insertAdjacentHTML("afterbegin", '<div class="stf__block"></div>'), this.distElement = i.querySelector(".stf__block"), this.items = l;
2228
- for (const c of l) this.distElement.appendChild(c);
2225
+ class L extends A {
2226
+ constructor(s, n, a, l) {
2227
+ super(s, n, a), this.wrapper.insertAdjacentHTML("afterbegin", '<div class="stf__block"></div>'), this.distElement = s.querySelector(".stf__block"), this.items = l;
2228
+ for (const d of l) this.distElement.appendChild(d);
2229
2229
  this.setHandlers();
2230
2230
  }
2231
2231
  clear() {
2232
- for (const i of this.items) this.parentElement.appendChild(i);
2232
+ for (const s of this.items) this.parentElement.appendChild(s);
2233
2233
  }
2234
- updateItems(i) {
2234
+ updateItems(s) {
2235
2235
  this.removeHandlers(), this.distElement.innerHTML = "";
2236
- for (const n of i) this.distElement.appendChild(n);
2237
- this.items = i, this.setHandlers();
2236
+ for (const n of s) this.distElement.appendChild(n);
2237
+ this.items = s, this.setHandlers();
2238
2238
  }
2239
2239
  update() {
2240
2240
  this.app.getRender().update();
2241
2241
  }
2242
2242
  }
2243
- class B extends E {
2244
- constructor(i, n, a) {
2245
- super(i, n, a), this.wrapper.innerHTML = '<canvas class="stf__canvas"></canvas>', this.canvas = i.querySelectorAll("canvas")[0], this.distElement = this.canvas, this.resizeCanvas(), this.setHandlers();
2243
+ class U extends A {
2244
+ constructor(s, n, a) {
2245
+ super(s, n, a), this.wrapper.innerHTML = '<canvas class="stf__canvas"></canvas>', this.canvas = s.querySelectorAll("canvas")[0], this.distElement = this.canvas, this.resizeCanvas(), this.setHandlers();
2246
2246
  }
2247
2247
  resizeCanvas() {
2248
- const i = getComputedStyle(this.canvas), n = parseInt(i.getPropertyValue("width"), 10), a = parseInt(i.getPropertyValue("height"), 10);
2248
+ const s = getComputedStyle(this.canvas), n = parseInt(s.getPropertyValue("width"), 10), a = parseInt(s.getPropertyValue("height"), 10);
2249
2249
  this.canvas.width = n, this.canvas.height = a;
2250
2250
  }
2251
2251
  getCanvas() {
@@ -2256,8 +2256,8 @@ var ui = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2256
2256
  }
2257
2257
  }
2258
2258
  class N extends S {
2259
- constructor(i, n, a) {
2260
- super(i, n), this.outerShadow = null, this.innerShadow = null, this.hardShadow = null, this.hardInnerShadow = null, this.element = a, this.createShadows();
2259
+ constructor(s, n, a) {
2260
+ super(s, n), this.outerShadow = null, this.innerShadow = null, this.hardShadow = null, this.hardInnerShadow = null, this.element = a, this.createShadows();
2261
2261
  }
2262
2262
  createShadows() {
2263
2263
  this.element.insertAdjacentHTML("beforeend", `<div class="stf__outerShadow"></div>
@@ -2272,76 +2272,76 @@ var ui = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2272
2272
  this.element.querySelector(".stf__outerShadow") || this.createShadows();
2273
2273
  }
2274
2274
  drawHardInnerShadow() {
2275
- const i = this.getRect(), n = this.shadow.progress > 100 ? 200 - this.shadow.progress : this.shadow.progress;
2276
- let a = (100 - n) * (2.5 * i.pageWidth) / 100 + 20;
2277
- a > i.pageWidth && (a = i.pageWidth);
2275
+ const s = this.getRect(), n = this.shadow.progress > 100 ? 200 - this.shadow.progress : this.shadow.progress;
2276
+ let a = (100 - n) * (2.5 * s.pageWidth) / 100 + 20;
2277
+ a > s.pageWidth && (a = s.pageWidth);
2278
2278
  let l = `
2279
2279
  display: block;
2280
2280
  z-index: ${(this.getSettings().startZIndex + 5).toString(10)};
2281
2281
  width: ${a}px;
2282
- height: ${i.height}px;
2282
+ height: ${s.height}px;
2283
2283
  background: linear-gradient(to right,
2284
2284
  rgba(0, 0, 0, ${this.shadow.opacity * n / 100}) 5%,
2285
2285
  rgba(0, 0, 0, 0) 100%);
2286
- left: ${i.left + i.width / 2}px;
2286
+ left: ${s.left + s.width / 2}px;
2287
2287
  transform-origin: 0 0;
2288
2288
  `;
2289
2289
  l += this.getDirection() === 0 && this.shadow.progress > 100 || this.getDirection() === 1 && this.shadow.progress <= 100 ? "transform: translate3d(0, 0, 0);" : "transform: translate3d(0, 0, 0) rotateY(180deg);", this.hardInnerShadow.style.cssText = l;
2290
2290
  }
2291
2291
  drawHardOuterShadow() {
2292
- const i = this.getRect();
2293
- let n = (100 - (this.shadow.progress > 100 ? 200 - this.shadow.progress : this.shadow.progress)) * (2.5 * i.pageWidth) / 100 + 20;
2294
- n > i.pageWidth && (n = i.pageWidth);
2292
+ const s = this.getRect();
2293
+ let n = (100 - (this.shadow.progress > 100 ? 200 - this.shadow.progress : this.shadow.progress)) * (2.5 * s.pageWidth) / 100 + 20;
2294
+ n > s.pageWidth && (n = s.pageWidth);
2295
2295
  let a = `
2296
2296
  display: block;
2297
2297
  z-index: ${(this.getSettings().startZIndex + 4).toString(10)};
2298
2298
  width: ${n}px;
2299
- height: ${i.height}px;
2299
+ height: ${s.height}px;
2300
2300
  background: linear-gradient(to left, rgba(0, 0, 0, ${this.shadow.opacity}) 5%, rgba(0, 0, 0, 0) 100%);
2301
- left: ${i.left + i.width / 2}px;
2301
+ left: ${s.left + s.width / 2}px;
2302
2302
  transform-origin: 0 0;
2303
2303
  `;
2304
2304
  a += this.getDirection() === 0 && this.shadow.progress > 100 || this.getDirection() === 1 && this.shadow.progress <= 100 ? "transform: translate3d(0, 0, 0) rotateY(180deg);" : "transform: translate3d(0, 0, 0);", this.hardShadow.style.cssText = a;
2305
2305
  }
2306
2306
  drawInnerShadow() {
2307
- const i = this.getRect(), n = 3 * this.shadow.width / 4, a = this.getDirection() === 0 ? n : 0, l = this.getDirection() === 0 ? "to left" : "to right", c = this.convertToGlobal(this.shadow.pos), g = this.shadow.angle + 3 * Math.PI / 2, y = [this.pageRect.topLeft, this.pageRect.topRight, this.pageRect.bottomRight, this.pageRect.bottomLeft];
2307
+ const s = this.getRect(), n = 3 * this.shadow.width / 4, a = this.getDirection() === 0 ? n : 0, l = this.getDirection() === 0 ? "to left" : "to right", d = this.convertToGlobal(this.shadow.pos), p = this.shadow.angle + 3 * Math.PI / 2, y = [this.pageRect.topLeft, this.pageRect.topRight, this.pageRect.bottomRight, this.pageRect.bottomLeft];
2308
2308
  let f = "polygon( ";
2309
2309
  for (const R of y) {
2310
- let F = this.getDirection() === 1 ? { x: -R.x + this.shadow.pos.x, y: R.y - this.shadow.pos.y } : { x: R.x - this.shadow.pos.x, y: R.y - this.shadow.pos.y };
2311
- F = p.GetRotatedPoint(F, { x: a, y: 100 }, g), f += F.x + "px " + F.y + "px, ";
2310
+ let O = this.getDirection() === 1 ? { x: -R.x + this.shadow.pos.x, y: R.y - this.shadow.pos.y } : { x: R.x - this.shadow.pos.x, y: R.y - this.shadow.pos.y };
2311
+ O = c.GetRotatedPoint(O, { x: a, y: 100 }, p), f += O.x + "px " + O.y + "px, ";
2312
2312
  }
2313
2313
  f = f.slice(0, -2), f += ")";
2314
- const C = `
2314
+ const E = `
2315
2315
  display: block;
2316
2316
  z-index: ${(this.getSettings().startZIndex + 10).toString(10)};
2317
2317
  width: ${n}px;
2318
- height: ${2 * i.height}px;
2318
+ height: ${2 * s.height}px;
2319
2319
  background: linear-gradient(${l},
2320
2320
  rgba(0, 0, 0, ${this.shadow.opacity}) 5%,
2321
2321
  rgba(0, 0, 0, 0.05) 15%,
2322
2322
  rgba(0, 0, 0, ${this.shadow.opacity}) 35%,
2323
2323
  rgba(0, 0, 0, 0) 100%);
2324
2324
  transform-origin: ${a}px 100px;
2325
- transform: translate3d(${c.x - a}px, ${c.y - 100}px, 0) rotate(${g}rad);
2325
+ transform: translate3d(${d.x - a}px, ${d.y - 100}px, 0) rotate(${p}rad);
2326
2326
  clip-path: ${f};
2327
2327
  -webkit-clip-path: ${f};
2328
2328
  `;
2329
- this.innerShadow.style.cssText = C;
2329
+ this.innerShadow.style.cssText = E;
2330
2330
  }
2331
2331
  drawOuterShadow() {
2332
- const i = this.getRect(), n = this.convertToGlobal({ x: this.shadow.pos.x, y: this.shadow.pos.y }), a = this.shadow.angle + 3 * Math.PI / 2, l = this.getDirection() === 1 ? this.shadow.width : 0, c = this.getDirection() === 0 ? "to right" : "to left", g = [{ x: 0, y: 0 }, { x: i.pageWidth, y: 0 }, { x: i.pageWidth, y: i.height }, { x: 0, y: i.height }];
2332
+ const s = this.getRect(), n = this.convertToGlobal({ x: this.shadow.pos.x, y: this.shadow.pos.y }), a = this.shadow.angle + 3 * Math.PI / 2, l = this.getDirection() === 1 ? this.shadow.width : 0, d = this.getDirection() === 0 ? "to right" : "to left", p = [{ x: 0, y: 0 }, { x: s.pageWidth, y: 0 }, { x: s.pageWidth, y: s.height }, { x: 0, y: s.height }];
2333
2333
  let y = "polygon( ";
2334
- for (const C of g) if (C !== null) {
2335
- let R = this.getDirection() === 1 ? { x: -C.x + this.shadow.pos.x, y: C.y - this.shadow.pos.y } : { x: C.x - this.shadow.pos.x, y: C.y - this.shadow.pos.y };
2336
- R = p.GetRotatedPoint(R, { x: l, y: 100 }, a), y += R.x + "px " + R.y + "px, ";
2334
+ for (const E of p) if (E !== null) {
2335
+ let R = this.getDirection() === 1 ? { x: -E.x + this.shadow.pos.x, y: E.y - this.shadow.pos.y } : { x: E.x - this.shadow.pos.x, y: E.y - this.shadow.pos.y };
2336
+ R = c.GetRotatedPoint(R, { x: l, y: 100 }, a), y += R.x + "px " + R.y + "px, ";
2337
2337
  }
2338
2338
  y = y.slice(0, -2), y += ")";
2339
2339
  const f = `
2340
2340
  display: block;
2341
2341
  z-index: ${(this.getSettings().startZIndex + 10).toString(10)};
2342
2342
  width: ${this.shadow.width}px;
2343
- height: ${2 * i.height}px;
2344
- background: linear-gradient(${c}, rgba(0, 0, 0, ${this.shadow.opacity}), rgba(0, 0, 0, 0));
2343
+ height: ${2 * s.height}px;
2344
+ background: linear-gradient(${d}, rgba(0, 0, 0, ${this.shadow.opacity}), rgba(0, 0, 0, 0));
2345
2345
  transform-origin: ${l}px 100px;
2346
2346
  transform: translate3d(${n.x - l}px, ${n.y - 100}px, 0) rotate(${a}rad);
2347
2347
  clip-path: ${y};
@@ -2357,14 +2357,14 @@ var ui = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2357
2357
  }
2358
2358
  drawBottomPage() {
2359
2359
  if (this.bottomPage === null) return;
2360
- const i = this.flippingPage != null ? this.flippingPage.getDrawingDensity() : null;
2361
- this.orientation === "portrait" && this.direction === 1 || (this.bottomPage.getElement().style.zIndex = (this.getSettings().startZIndex + 3).toString(10), this.bottomPage.draw(i));
2360
+ const s = this.flippingPage != null ? this.flippingPage.getDrawingDensity() : null;
2361
+ this.orientation === "portrait" && this.direction === 1 || (this.bottomPage.getElement().style.zIndex = (this.getSettings().startZIndex + 3).toString(10), this.bottomPage.draw(s));
2362
2362
  }
2363
2363
  drawFrame() {
2364
2364
  this.clear(), this.drawLeftPage(), this.drawRightPage(), this.drawBottomPage(), this.flippingPage != null && (this.flippingPage.getElement().style.zIndex = (this.getSettings().startZIndex + 5).toString(10), this.flippingPage.draw()), this.shadow != null && this.flippingPage !== null && (this.flippingPage.getDrawingDensity() === "soft" ? (this.drawOuterShadow(), this.drawInnerShadow()) : (this.drawHardOuterShadow(), this.drawHardInnerShadow()));
2365
2365
  }
2366
2366
  clear() {
2367
- for (const i of this.app.getPageCollection().getPages()) i !== this.leftPage && i !== this.rightPage && i !== this.flippingPage && i !== this.bottomPage && (i.getElement().style.cssText = "display: none"), i.getTemporaryCopy() !== this.flippingPage && i.hideTemporaryCopy();
2367
+ for (const s of this.app.getPageCollection().getPages()) s !== this.leftPage && s !== this.rightPage && s !== this.flippingPage && s !== this.bottomPage && (s.getElement().style.cssText = "display: none"), s.getTemporaryCopy() !== this.flippingPage && s.hideTemporaryCopy();
2368
2368
  }
2369
2369
  update() {
2370
2370
  super.update(), this.rightPage !== null && this.rightPage.setOrientation(1), this.leftPage !== null && this.leftPage.setOrientation(0);
@@ -2374,17 +2374,17 @@ var ui = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2374
2374
  constructor() {
2375
2375
  this._default = { startPage: 0, size: "fixed", width: 0, height: 0, minWidth: 0, maxWidth: 0, minHeight: 0, maxHeight: 0, drawShadow: !0, flippingTime: 1e3, usePortrait: !0, startZIndex: 0, autoSize: !0, maxShadowOpacity: 1, showCover: !1, mobileScrollSupport: !0, swipeDistance: 30, clickEventForward: !0, useMouseEvents: !0, showPageCorners: !0, disableFlipByClick: !1 };
2376
2376
  }
2377
- getSettings(i) {
2377
+ getSettings(s) {
2378
2378
  const n = this._default;
2379
- if (Object.assign(n, i), n.size !== "stretch" && n.size !== "fixed") throw new Error('Invalid size type. Available only "fixed" and "stretch" value');
2379
+ if (Object.assign(n, s), n.size !== "stretch" && n.size !== "fixed") throw new Error('Invalid size type. Available only "fixed" and "stretch" value');
2380
2380
  if (n.width <= 0 || n.height <= 0) throw new Error("Invalid width or height");
2381
2381
  if (n.flippingTime <= 0) throw new Error("Invalid flipping time");
2382
2382
  return n.size === "stretch" ? (n.minWidth <= 0 && (n.minWidth = 100), n.maxWidth < n.minWidth && (n.maxWidth = 2e3), n.minHeight <= 0 && (n.minHeight = 100), n.maxHeight < n.minHeight && (n.maxHeight = 2e3)) : (n.minWidth = n.width, n.maxWidth = n.width, n.minHeight = n.height, n.maxHeight = n.height), n;
2383
2383
  }
2384
2384
  }
2385
- (function(m, i) {
2386
- i === void 0 && (i = {});
2387
- var n = i.insertAt;
2385
+ (function(m, s) {
2386
+ s === void 0 && (s = {});
2387
+ var n = s.insertAt;
2388
2388
  if (typeof document < "u") {
2389
2389
  var a = document.head || document.getElementsByTagName("head")[0], l = document.createElement("style");
2390
2390
  l.type = "text/css", n === "top" && a.firstChild ? a.insertBefore(l, a.firstChild) : a.appendChild(l), l.styleSheet ? l.styleSheet.cssText = m : l.appendChild(document.createTextNode(m));
@@ -2449,22 +2449,22 @@ var ui = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2449
2449
  position: absolute;
2450
2450
  left: 0;
2451
2451
  top: 0;
2452
- }`), s.PageFlip = class extends class {
2452
+ }`), i.PageFlip = class extends class {
2453
2453
  constructor() {
2454
2454
  this.events = /* @__PURE__ */ new Map();
2455
2455
  }
2456
- on(m, i) {
2457
- return this.events.has(m) ? this.events.get(m).push(i) : this.events.set(m, [i]), this;
2456
+ on(m, s) {
2457
+ return this.events.has(m) ? this.events.get(m).push(s) : this.events.set(m, [s]), this;
2458
2458
  }
2459
2459
  off(m) {
2460
2460
  this.events.delete(m);
2461
2461
  }
2462
- trigger(m, i, n = null) {
2463
- if (this.events.has(m)) for (const a of this.events.get(m)) a({ data: n, object: i });
2462
+ trigger(m, s, n = null) {
2463
+ if (this.events.has(m)) for (const a of this.events.get(m)) a({ data: n, object: s });
2464
2464
  }
2465
2465
  } {
2466
- constructor(m, i) {
2467
- super(), this.isUserTouch = !1, this.isUserMove = !1, this.setting = null, this.pages = null, this.setting = new H().getSettings(i), this.block = m;
2466
+ constructor(m, s) {
2467
+ super(), this.isUserTouch = !1, this.isUserMove = !1, this.setting = null, this.pages = null, this.setting = new H().getSettings(s), this.block = m;
2468
2468
  }
2469
2469
  destroy() {
2470
2470
  this.ui.destroy(), this.block.remove();
@@ -2473,24 +2473,24 @@ var ui = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2473
2473
  this.render.update(), this.pages.show();
2474
2474
  }
2475
2475
  loadFromImages(m) {
2476
- this.ui = new B(this.block, this, this.setting);
2477
- const i = this.ui.getCanvas();
2478
- this.render = new T(this, this.setting, i), this.flipController = new I(this.render, this), this.pages = new u(this, this.render, m), this.pages.load(), this.render.start(), this.pages.show(this.setting.startPage), setTimeout(() => {
2476
+ this.ui = new U(this.block, this, this.setting);
2477
+ const s = this.ui.getCanvas();
2478
+ this.render = new T(this, this.setting, s), this.flipController = new I(this.render, this), this.pages = new u(this, this.render, m), this.pages.load(), this.render.start(), this.pages.show(this.setting.startPage), setTimeout(() => {
2479
2479
  this.ui.update(), this.trigger("init", this, { page: this.setting.startPage, mode: this.render.getOrientation() });
2480
2480
  }, 1);
2481
2481
  }
2482
2482
  loadFromHTML(m) {
2483
- this.ui = new W(this.block, this, this.setting, m), this.render = new N(this, this.setting, this.ui.getDistElement()), this.flipController = new I(this.render, this), this.pages = new x(this, this.render, this.ui.getDistElement(), m), this.pages.load(), this.render.start(), this.pages.show(this.setting.startPage), setTimeout(() => {
2483
+ this.ui = new L(this.block, this, this.setting, m), this.render = new N(this, this.setting, this.ui.getDistElement()), this.flipController = new I(this.render, this), this.pages = new P(this, this.render, this.ui.getDistElement(), m), this.pages.load(), this.render.start(), this.pages.show(this.setting.startPage), setTimeout(() => {
2484
2484
  this.ui.update(), this.trigger("init", this, { page: this.setting.startPage, mode: this.render.getOrientation() });
2485
2485
  }, 1);
2486
2486
  }
2487
2487
  updateFromImages(m) {
2488
- const i = this.pages.getCurrentPageIndex();
2489
- this.pages.destroy(), this.pages = new u(this, this.render, m), this.pages.load(), this.pages.show(i), this.trigger("update", this, { page: i, mode: this.render.getOrientation() });
2488
+ const s = this.pages.getCurrentPageIndex();
2489
+ this.pages.destroy(), this.pages = new u(this, this.render, m), this.pages.load(), this.pages.show(s), this.trigger("update", this, { page: s, mode: this.render.getOrientation() });
2490
2490
  }
2491
2491
  updateFromHtml(m) {
2492
- const i = this.pages.getCurrentPageIndex();
2493
- this.pages.destroy(), this.pages = new x(this, this.render, this.ui.getDistElement(), m), this.pages.load(), this.ui.updateItems(m), this.render.reload(), this.pages.show(i), this.trigger("update", this, { page: i, mode: this.render.getOrientation() });
2492
+ const s = this.pages.getCurrentPageIndex();
2493
+ this.pages.destroy(), this.pages = new P(this, this.render, this.ui.getDistElement(), m), this.pages.load(), this.ui.updateItems(m), this.render.reload(), this.pages.show(s), this.trigger("update", this, { page: s, mode: this.render.getOrientation() });
2494
2494
  }
2495
2495
  clear() {
2496
2496
  this.pages.destroy(), this.ui.clear();
@@ -2510,8 +2510,8 @@ var ui = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2510
2510
  flipPrev(m = "top") {
2511
2511
  this.flipController.flipPrev(m);
2512
2512
  }
2513
- flip(m, i = "top") {
2514
- this.flipController.flipToPage(m, i);
2513
+ flip(m, s = "top") {
2514
+ this.flipController.flipToPage(m, s);
2515
2515
  }
2516
2516
  updateState(m) {
2517
2517
  this.trigger("changeState", this, m);
@@ -2558,18 +2558,18 @@ var ui = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2558
2558
  startUserTouch(m) {
2559
2559
  this.mousePosition = m, this.isUserTouch = !0, this.isUserMove = !1;
2560
2560
  }
2561
- userMove(m, i) {
2562
- this.isUserTouch || i || !this.setting.showPageCorners ? this.isUserTouch && p.GetDistanceBetweenTwoPoint(this.mousePosition, m) > 5 && (this.isUserMove = !0, this.flipController.fold(m)) : this.flipController.showCorner(m);
2561
+ userMove(m, s) {
2562
+ this.isUserTouch || s || !this.setting.showPageCorners ? this.isUserTouch && c.GetDistanceBetweenTwoPoint(this.mousePosition, m) > 5 && (this.isUserMove = !0, this.flipController.fold(m)) : this.flipController.showCorner(m);
2563
2563
  }
2564
- userStop(m, i = !1) {
2565
- this.isUserTouch && (this.isUserTouch = !1, i || (this.isUserMove ? this.flipController.stopMove() : this.flipController.flip(m)));
2564
+ userStop(m, s = !1) {
2565
+ this.isUserTouch && (this.isUserTouch = !1, s || (this.isUserMove ? this.flipController.stopMove() : this.flipController.flip(m)));
2566
2566
  }
2567
- }, Object.defineProperty(s, "__esModule", { value: !0 });
2567
+ }, Object.defineProperty(i, "__esModule", { value: !0 });
2568
2568
  });
2569
- })(Dt, Dt.exports);
2570
- var gi = Dt.exports;
2569
+ })(It, It.exports);
2570
+ var fi = It.exports;
2571
2571
  /**
2572
- * @license FlipbookEngine v0.6.0
2572
+ * @license FlipbookEngine v0.6.5
2573
2573
  * Copyright (c) 2026 Murat Dogan
2574
2574
  *
2575
2575
  * This source code is dual-licensed under the AGPLv3 and a Commercial License.
@@ -2582,14 +2582,14 @@ var gi = Dt.exports;
2582
2582
  * you must purchase a Commercial License from:
2583
2583
  * https://flipbookengine.com/pricing
2584
2584
  */
2585
- function pi() {
2585
+ function mi() {
2586
2586
  return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
2587
2587
  }
2588
- function fi(e, t = pi()) {
2588
+ function wi(e, t = mi()) {
2589
2589
  return t ? 0 : typeof e == "number" && e >= 0 ? e : 1e3;
2590
2590
  }
2591
- class mi {
2592
- constructor(t, s, o) {
2591
+ class vi {
2592
+ constructor(t, i, o) {
2593
2593
  v(this, "pageFlip", null);
2594
2594
  v(this, "bookContainer");
2595
2595
  v(this, "options");
@@ -2600,14 +2600,14 @@ class mi {
2600
2600
  v(this, "isLibraryFlipping", !1);
2601
2601
  v(this, "autoPlayTimer", null);
2602
2602
  v(this, "layoutUpdateTimer", null);
2603
- this.bookContainer = t, this.options = s, this.store = o, s.soundUrl && (this.audioEl = new Audio(s.soundUrl), this.unlockAudio());
2603
+ this.bookContainer = t, this.options = i, this.store = o, i.soundUrl && (this.audioEl = new Audio(i.soundUrl), this.unlockAudio());
2604
2604
  }
2605
2605
  unlockAudio() {
2606
2606
  if (!this.audioEl) return;
2607
2607
  const t = () => {
2608
2608
  if (this.audioEl) {
2609
- const s = this.audioEl.play();
2610
- s && typeof s.then == "function" && s.then(() => {
2609
+ const i = this.audioEl.play();
2610
+ i && typeof i.then == "function" && i.then(() => {
2611
2611
  this.audioEl.pause(), this.audioEl.currentTime = 0;
2612
2612
  }).catch(() => {
2613
2613
  });
@@ -2616,10 +2616,10 @@ class mi {
2616
2616
  };
2617
2617
  this.audioUnlockHandler = t, document.addEventListener("touchstart", t, { once: !0 }), document.addEventListener("click", t, { once: !0 });
2618
2618
  }
2619
- init(t, s) {
2620
- this.pageFlip = new gi.PageFlip(this.bookContainer, {
2619
+ init(t, i) {
2620
+ this.pageFlip = new fi.PageFlip(this.bookContainer, {
2621
2621
  width: t,
2622
- height: s,
2622
+ height: i,
2623
2623
  size: "stretch",
2624
2624
  minWidth: 100,
2625
2625
  maxWidth: 3e3,
@@ -2628,9 +2628,10 @@ class mi {
2628
2628
  drawShadow: !0,
2629
2629
  showCover: !0,
2630
2630
  usePortrait: !0,
2631
- mobileScrollSupport: !1,
2631
+ // Keep native mobile scrolling available; this avoids preventDefault on non-cancelable touchstart events.
2632
+ mobileScrollSupport: !0,
2632
2633
  maxShadowOpacity: this.options.maxShadowOpacity || 0.5,
2633
- flippingTime: fi(this.options.flippingTime)
2634
+ flippingTime: wi(this.options.flippingTime)
2634
2635
  });
2635
2636
  const o = this.bookContainer.querySelectorAll(".bz-page");
2636
2637
  this.pageFlip.loadFromHTML(Array.from(o)), this.bindEvents(), this.setupSignalSync();
@@ -2646,24 +2647,24 @@ class mi {
2646
2647
  }
2647
2648
  setupSignalSync() {
2648
2649
  this.unsubs.push(
2649
- G(() => {
2650
- const t = this.store.currentPage.value, s = this.store.flipState.peek();
2651
- if (!this.pageFlip || this.isLibraryFlipping || s !== "read") return;
2650
+ _(() => {
2651
+ const t = this.store.currentPage.value, i = this.store.flipState.peek();
2652
+ if (!this.pageFlip || this.isLibraryFlipping || i !== "read") return;
2652
2653
  const o = this.pageFlip.getCurrentPageIndex();
2653
2654
  if (o !== t && !this.store.isSingleMode.value) {
2654
- const r = (p) => p === 0 ? 0 : Math.ceil(p / 2), h = r(t), u = r(o);
2655
+ const r = (c) => c === 0 ? 0 : Math.ceil(c / 2), h = r(t), u = r(o);
2655
2656
  h === u + 1 ? this.pageFlip.flipNext() : h === u - 1 ? this.pageFlip.flipPrev() : h !== u && this.pageFlip.turnToPage(t);
2656
2657
  }
2657
2658
  })
2658
2659
  ), this.unsubs.push(
2659
- G(() => {
2660
+ _(() => {
2660
2661
  this.store.isSingleMode.value, this.pageFlip && (this.layoutUpdateTimer && clearTimeout(this.layoutUpdateTimer), this.layoutUpdateTimer = setTimeout(() => {
2661
2662
  this.layoutUpdateTimer = null, this.pageFlip && this.pageFlip.update(), window.dispatchEvent(new Event("resize"));
2662
2663
  }, 50));
2663
2664
  })
2664
2665
  ), this.unsubs.push(
2665
- G(() => {
2666
- const t = this.store.isAutoPlaying.value, s = this.store.autoPlayInterval.value || 3e3;
2666
+ _(() => {
2667
+ const t = this.store.isAutoPlaying.value, i = this.store.autoPlayInterval.value || 3e3;
2667
2668
  this.autoPlayTimer && (clearInterval(this.autoPlayTimer), this.autoPlayTimer = null), t && (this.autoPlayTimer = setInterval(() => {
2668
2669
  const o = this.store.pages.value.length - 1;
2669
2670
  if (this.store.currentPage.peek() >= o || this.store.currentPage.peek() >= o - 1 && !this.store.isSingleMode.peek()) {
@@ -2671,7 +2672,7 @@ class mi {
2671
2672
  return;
2672
2673
  }
2673
2674
  this.turnToNextPage();
2674
- }, s));
2675
+ }, i));
2675
2676
  })
2676
2677
  );
2677
2678
  }
@@ -2691,7 +2692,7 @@ class mi {
2691
2692
  if (this.store.soundEnabled.value && this.audioEl) {
2692
2693
  this.audioEl.currentTime = 0;
2693
2694
  const t = this.audioEl.play();
2694
- t && typeof t.catch == "function" && t.catch((s) => console.warn("Flipbook Audio Play Error:", s));
2695
+ t && typeof t.catch == "function" && t.catch((i) => console.warn("Flipbook Audio Play Error:", i));
2695
2696
  }
2696
2697
  }
2697
2698
  update() {
@@ -2702,7 +2703,7 @@ class mi {
2702
2703
  }
2703
2704
  }
2704
2705
  /**
2705
- * @license FlipbookEngine v0.6.0
2706
+ * @license FlipbookEngine v0.6.5
2706
2707
  * Copyright (c) 2026 Murat Dogan
2707
2708
  *
2708
2709
  * This source code is dual-licensed under the AGPLv3 and a Commercial License.
@@ -2715,8 +2716,8 @@ class mi {
2715
2716
  * you must purchase a Commercial License from:
2716
2717
  * https://flipbookengine.com/pricing
2717
2718
  */
2718
- class wi {
2719
- constructor(t, s) {
2719
+ class yi {
2720
+ constructor(t, i) {
2720
2721
  v(this, "wrapperElement", null);
2721
2722
  v(this, "sizerElement", null);
2722
2723
  v(this, "pageViewport");
@@ -2727,14 +2728,14 @@ class wi {
2727
2728
  v(this, "unsubs", []);
2728
2729
  v(this, "updateTimer", null);
2729
2730
  v(this, "onResizeCallback");
2730
- this.pageViewport = t, this.store = s;
2731
+ this.pageViewport = t, this.store = i;
2731
2732
  }
2732
- init(t, s) {
2733
- this.wrapperElement = t, this.sizerElement = s, this.setupResizeObserver(), this.setupOrientationMedia(), this.setupStateSync(), this.updateBookAspectRatio();
2733
+ init(t, i) {
2734
+ this.wrapperElement = t, this.sizerElement = i, this.setupResizeObserver(), this.setupOrientationMedia(), this.setupStateSync(), this.updateBookAspectRatio();
2734
2735
  }
2735
2736
  setupStateSync() {
2736
2737
  this.unsubs.push(
2737
- G(() => {
2738
+ _(() => {
2738
2739
  this.store.isSingleMode.value, this.store.orientation.value, this.scheduleAspectRatioUpdate();
2739
2740
  })
2740
2741
  );
@@ -2747,21 +2748,21 @@ class wi {
2747
2748
  setupOrientationMedia() {
2748
2749
  if (typeof window < "u" && window.matchMedia) {
2749
2750
  this.orientationMediaQuery = window.matchMedia("(orientation: portrait)");
2750
- const t = (s) => {
2751
- s.matches, this.updateBookAspectRatio();
2751
+ const t = (i) => {
2752
+ i.matches, this.updateBookAspectRatio();
2752
2753
  };
2753
2754
  this.orientationChangeHandler = t, this.orientationMediaQuery.addEventListener ? this.orientationMediaQuery.addEventListener("change", t) : this.orientationMediaQuery.addListener(t), t(this.orientationMediaQuery);
2754
2755
  }
2755
2756
  }
2756
2757
  updateBookAspectRatio() {
2757
2758
  if (!this.wrapperElement || !this.sizerElement) return;
2758
- const t = this.wrapperElement.clientWidth, s = this.wrapperElement.clientHeight;
2759
- if (t === 0 || s === 0) return;
2759
+ const t = this.wrapperElement.clientWidth, i = this.wrapperElement.clientHeight;
2760
+ if (t === 0 || i === 0) return;
2760
2761
  const o = this.pageViewport.width, r = this.pageViewport.height, u = this.store.isDoublePageLayout.value ? o * 2 / r : o / r;
2761
- let p = t, b = t / u;
2762
- b > s && (b = s, p = s * u);
2763
- let x = Math.ceil(p);
2764
- x % 2 !== 0 && (x += 1), this.sizerElement.style.width = `${x}px`, this.sizerElement.style.height = `${Math.floor(b)}px`, this.sizerElement.style.aspectRatio = "", this.onResizeCallback && this.onResizeCallback();
2762
+ let c = t, b = t / u;
2763
+ b > i && (b = i, c = i * u);
2764
+ let P = Math.ceil(c);
2765
+ P % 2 !== 0 && (P += 1), this.sizerElement.style.width = `${P}px`, this.sizerElement.style.height = `${Math.floor(b)}px`, this.sizerElement.style.aspectRatio = "", this.onResizeCallback && this.onResizeCallback();
2765
2766
  }
2766
2767
  destroy() {
2767
2768
  this.updateTimer && (clearTimeout(this.updateTimer), this.updateTimer = null), this.unsubs.forEach((t) => t()), this.unsubs = [], this.resizeObserver && this.wrapperElement && (this.resizeObserver.unobserve(this.wrapperElement), this.resizeObserver.disconnect(), this.resizeObserver = null), this.orientationMediaQuery && (this.orientationChangeHandler && (this.orientationMediaQuery.removeEventListener ? this.orientationMediaQuery.removeEventListener("change", this.orientationChangeHandler) : this.orientationMediaQuery.removeListener(this.orientationChangeHandler)), this.orientationChangeHandler = null, this.orientationMediaQuery = null);
@@ -2773,7 +2774,7 @@ class wi {
2773
2774
  }
2774
2775
  }
2775
2776
  /**
2776
- * @license FlipbookEngine v0.6.0
2777
+ * @license FlipbookEngine v0.6.5
2777
2778
  * Copyright (c) 2026 Murat Dogan
2778
2779
  *
2779
2780
  * This source code is dual-licensed under the AGPLv3 and a Commercial License.
@@ -2786,8 +2787,8 @@ class wi {
2786
2787
  * you must purchase a Commercial License from:
2787
2788
  * https://flipbookengine.com/pricing
2788
2789
  */
2789
- class vi {
2790
- constructor(t, s, o) {
2790
+ class bi {
2791
+ constructor(t, i, o) {
2791
2792
  v(this, "container");
2792
2793
  v(this, "pageFlipAdapter");
2793
2794
  v(this, "store");
@@ -2795,7 +2796,7 @@ class vi {
2795
2796
  v(this, "unsubs", []);
2796
2797
  v(this, "listenerAbortController");
2797
2798
  var h;
2798
- this.container = t, this.pageFlipAdapter = s, this.store = o;
2799
+ this.container = t, this.pageFlipAdapter = i, this.store = o;
2799
2800
  const r = ((h = t.ownerDocument.defaultView) == null ? void 0 : h.AbortController) ?? globalThis.AbortController;
2800
2801
  this.listenerAbortController = new r();
2801
2802
  }
@@ -2804,7 +2805,7 @@ class vi {
2804
2805
  }
2805
2806
  setupStateSync() {
2806
2807
  this.unsubs.push(
2807
- G(() => {
2808
+ _(() => {
2808
2809
  this.store.isZoomed.value = this.store.zoomState.value.isActive, this.store.zoomState.value.isActive ? (this.container.style.transform = `translate(${this.store.zoomState.value.translateX}px, ${this.store.zoomState.value.translateY}px) scale(${this.store.zoomState.value.scale})`, this.container.style.transition = "none") : (this.container.style.transform = "", this.container.style.transition = "transform 0.3s ease");
2809
2810
  })
2810
2811
  );
@@ -2818,19 +2819,19 @@ class vi {
2818
2819
  }, { passive: !1, signal: this.listenerAbortController.signal });
2819
2820
  }
2820
2821
  bindMouseDrag() {
2821
- let t = !1, s = 0, o = 0, r = 0, h = 0;
2822
+ let t = !1, i = 0, o = 0, r = 0, h = 0;
2822
2823
  this.container.addEventListener("mousedown", (u) => {
2823
- this.store.zoomState.value.isActive && (t = !0, s = u.clientX, o = u.clientY, r = this.store.zoomState.value.translateX, h = this.store.zoomState.value.translateY, this.container.style.cursor = "grabbing");
2824
+ this.store.zoomState.value.isActive && (t = !0, i = u.clientX, o = u.clientY, r = this.store.zoomState.value.translateX, h = this.store.zoomState.value.translateY, this.container.style.cursor = "grabbing");
2824
2825
  }, { signal: this.listenerAbortController.signal }), window.addEventListener("mousemove", (u) => {
2825
2826
  if (!t || !this.store.zoomState.value.isActive) return;
2826
- const p = u.clientX - s, b = u.clientY - o;
2827
- this.updateZoomPan(r + p, h + b);
2827
+ const c = u.clientX - i, b = u.clientY - o;
2828
+ this.updateZoomPan(r + c, h + b);
2828
2829
  }, { signal: this.listenerAbortController.signal }), window.addEventListener("mouseup", () => {
2829
2830
  t && (t = !1, this.container.style.cursor = this.store.zoomState.value.isActive ? "grab" : "");
2830
2831
  }, { signal: this.listenerAbortController.signal });
2831
2832
  }
2832
2833
  bindTouch() {
2833
- let t = !1, s = 0, o = 0;
2834
+ let t = !1, i = 0, o = 0;
2834
2835
  this.container.addEventListener("touchstart", (r) => {
2835
2836
  if (r.touches.length === 1)
2836
2837
  if (!this.store.zoomState.value.isActive)
@@ -2838,13 +2839,13 @@ class vi {
2838
2839
  else {
2839
2840
  t = !0, this.touchStartX = r.touches[0].clientX;
2840
2841
  const h = r.touches[0].clientY;
2841
- s = this.store.zoomState.value.translateX, o = this.store.zoomState.value.translateY, this.container._touchStartY = h;
2842
+ i = this.store.zoomState.value.translateX, o = this.store.zoomState.value.translateY, this.container._touchStartY = h;
2842
2843
  }
2843
2844
  }, { passive: !0, signal: this.listenerAbortController.signal }), this.container.addEventListener("touchmove", (r) => {
2844
2845
  if (t && this.store.zoomState.value.isActive && r.touches.length === 1 && this.touchStartX !== null) {
2845
2846
  r.preventDefault();
2846
2847
  const h = r.touches[0].clientX - this.touchStartX, u = r.touches[0].clientY - this.container._touchStartY;
2847
- this.updateZoomPan(s + h, o + u);
2848
+ this.updateZoomPan(i + h, o + u);
2848
2849
  }
2849
2850
  }, { passive: !1, signal: this.listenerAbortController.signal }), this.container.addEventListener("touchend", (r) => {
2850
2851
  if (this.touchStartX !== null && !this.store.zoomState.value.isActive && this.store.isSingleMode.value && r.changedTouches.length === 1) {
@@ -2866,123 +2867,141 @@ class vi {
2866
2867
  let t = this.store.zoomState.value.scale - 0.5;
2867
2868
  t <= 1 ? (t = 1, this.store.zoomState.value = { ...this.store.zoomState.value, isActive: !1, translateX: 0, translateY: 0, scale: 1 }, this.container.style.cursor = "") : this.store.zoomState.value = { ...this.store.zoomState.value, isActive: !0, scale: t };
2868
2869
  }
2869
- updateZoomPan(t, s) {
2870
+ updateZoomPan(t, i) {
2870
2871
  this.store.zoomState.value = {
2871
2872
  ...this.store.zoomState.value,
2872
2873
  translateX: t,
2873
- translateY: s
2874
+ translateY: i
2874
2875
  };
2875
2876
  }
2876
2877
  destroy() {
2877
2878
  this.listenerAbortController.abort(), this.unsubs.forEach((t) => t()), this.unsubs = [];
2878
2879
  }
2879
2880
  }
2880
- function ve(e, t, s) {
2881
+ function be(e, t, i) {
2881
2882
  if (!e || typeof e.title != "string" || !e.title.trim() || !Number.isFinite(e.pageIndex)) return null;
2882
- const o = Math.max(0, t - 1), r = Array.isArray(e.children) ? e.children.map((h, u) => ve(h, t, s + "-" + u)).filter((h) => h !== null) : [];
2883
+ const o = Math.max(0, t - 1), r = Array.isArray(e.children) ? e.children.map((h, u) => be(h, t, i + "-" + u)).filter((h) => h !== null) : [];
2883
2884
  return {
2884
- id: e.id ?? s,
2885
+ id: e.id ?? i,
2885
2886
  title: e.title.trim(),
2886
2887
  pageIndex: Math.max(0, Math.min(o, Math.trunc(e.pageIndex))),
2887
2888
  ...r.length ? { children: r } : {}
2888
2889
  };
2889
2890
  }
2890
- function ye(e, t) {
2891
- return Array.isArray(e) ? e.map((s, o) => ve(s, t, "toc-" + o)).filter((s) => s !== null) : [];
2891
+ function Pe(e, t) {
2892
+ return Array.isArray(e) ? e.map((i, o) => be(i, t, "toc-" + o)).filter((i) => i !== null) : [];
2892
2893
  }
2893
2894
  /**
2894
- * @license FlipbookEngine v0.6.0
2895
+ * @license FlipbookEngine v0.6.5
2895
2896
  * Copyright (c) 2026 Murat Dogan
2896
2897
  *
2897
2898
  * This source code is dual-licensed under the AGPLv3 and a Commercial License.
2898
2899
  */
2899
- const Kt = () => ({ isActive: !1, translateX: 0, translateY: 0, isDragging: !1, scale: 1 });
2900
- function be() {
2901
- const e = D(0), t = D(0), s = D(!1), o = D(!0), r = D(!1), h = D(!0), u = D("landscape"), p = D("read"), b = D("auto"), x = D(!0), M = D(!1), I = D("#7367f0"), S = D(!1), T = D(!1), E = D(!1), W = D(3e3), B = D(!0), N = D("en"), H = D({}), m = D(Kt()), i = D([]), n = D([]), a = w(() => !s.value && u.value === "landscape"), l = w(() => a.value && e.value === 0), c = w(() => a.value && e.value >= t.value - 1);
2902
- return { currentPage: e, totalPages: t, isSingleMode: s, showThumbs: o, showToc: r, showArrows: h, orientation: u, flipState: p, themeMode: b, allowDownload: x, hasDownloadUrl: M, primaryColor: I, whiteLabel: S, isZoomed: T, isAutoPlaying: E, autoPlayInterval: W, soundEnabled: B, locale: N, messages: H, zoomState: m, pages: i, toc: n, isDoublePageLayout: a, isFrontCover: l, isBackCover: c, init: (f, C, R, F) => {
2903
- t.value = C, i.value = R, M.value = F, f.theme !== void 0 && (b.value = f.theme), f.primaryColor !== void 0 && (I.value = f.primaryColor), f.showThumbs !== void 0 && (o.value = f.showThumbs), f.showToc !== void 0 && (r.value = f.showToc), n.value = ye(f.toc ?? [], C), f.showArrows !== void 0 && (h.value = f.showArrows), f.allowDownload !== void 0 && (x.value = f.allowDownload), f.whiteLabel !== void 0 && (S.value = f.whiteLabel), f.soundEnabled !== void 0 && (B.value = f.soundEnabled), f.locale !== void 0 && (N.value = f.locale), f.messages !== void 0 && (H.value = f.messages), f.isSingleMode !== void 0 && (s.value = f.isSingleMode), f.singleMode !== void 0 && (s.value = f.singleMode), f.autoPlay !== void 0 && (E.value = f.autoPlay), f.autoPlayInterval !== void 0 && (W.value = f.autoPlayInterval), e.value = 0;
2900
+ const te = () => ({ isActive: !1, translateX: 0, translateY: 0, isDragging: !1, scale: 1 });
2901
+ function xe() {
2902
+ const e = D(0), t = D(0), i = D(!1), o = D(!1), r = D(!1), h = D(!0), u = D("landscape"), c = D("read"), b = D("auto"), P = D(!0), k = D(!1), I = D("#7367f0"), S = D(!1), T = D(!1), A = D(!1), L = D(3e3), U = D(!0), N = D("en"), H = D({}), m = D(te()), s = D([]), n = D([]), a = w(() => !i.value && u.value === "landscape"), l = w(() => a.value && e.value === 0), d = w(() => a.value && e.value >= t.value - 1);
2903
+ return { currentPage: e, totalPages: t, isSingleMode: i, showThumbs: o, showToc: r, showArrows: h, orientation: u, flipState: c, themeMode: b, allowDownload: P, hasDownloadUrl: k, primaryColor: I, whiteLabel: S, isZoomed: T, isAutoPlaying: A, autoPlayInterval: L, soundEnabled: U, locale: N, messages: H, zoomState: m, pages: s, toc: n, isDoublePageLayout: a, isFrontCover: l, isBackCover: d, init: (f, E, R, O) => {
2904
+ t.value = E, s.value = R, k.value = O, f.theme !== void 0 && (b.value = f.theme), f.primaryColor !== void 0 && (I.value = f.primaryColor), f.showThumbs !== void 0 && (o.value = f.showThumbs), f.showToc !== void 0 && (r.value = f.showToc), n.value = Pe(f.toc ?? [], E), f.showArrows !== void 0 && (h.value = f.showArrows), f.allowDownload !== void 0 && (P.value = f.allowDownload), f.whiteLabel !== void 0 && (S.value = f.whiteLabel), f.soundEnabled !== void 0 && (U.value = f.soundEnabled), f.locale !== void 0 && (N.value = f.locale), f.messages !== void 0 && (H.value = f.messages), f.isSingleMode !== void 0 && (i.value = f.isSingleMode), f.singleMode !== void 0 && (i.value = f.singleMode), f.autoPlay !== void 0 && (A.value = f.autoPlay), f.autoPlayInterval !== void 0 && (L.value = f.autoPlayInterval), e.value = 0;
2904
2905
  }, reset: () => {
2905
- e.value = 0, t.value = 0, s.value = !1, o.value = !0, h.value = !0, u.value = "landscape", p.value = "read", b.value = "auto", x.value = !0, M.value = !1, I.value = "#7367f0", S.value = !1, T.value = !1, E.value = !1, W.value = 3e3, B.value = !0, N.value = "en", H.value = {}, m.value = Kt(), i.value = [], n.value = [];
2906
+ e.value = 0, t.value = 0, i.value = !1, o.value = !1, h.value = !0, u.value = "landscape", c.value = "read", b.value = "auto", P.value = !0, k.value = !1, I.value = "#7367f0", S.value = !1, T.value = !1, A.value = !1, L.value = 3e3, U.value = !0, N.value = "en", H.value = {}, m.value = te(), s.value = [], n.value = [];
2906
2907
  } };
2907
2908
  }
2908
- const k = be();
2909
- k.currentPage;
2910
- k.totalPages;
2911
- k.isSingleMode;
2912
- k.showThumbs;
2913
- k.showToc;
2914
- k.showArrows;
2915
- k.orientation;
2916
- k.flipState;
2917
- k.themeMode;
2918
- k.allowDownload;
2919
- k.hasDownloadUrl;
2920
- k.primaryColor;
2921
- k.whiteLabel;
2922
- k.isZoomed;
2923
- k.isAutoPlaying;
2924
- k.autoPlayInterval;
2925
- k.soundEnabled;
2926
- k.locale;
2927
- k.messages;
2928
- k.zoomState;
2929
- k.pages;
2930
- k.toc;
2931
- k.isDoublePageLayout;
2932
- k.isFrontCover;
2933
- k.isBackCover;
2934
- function yi(e) {
2909
+ const C = xe();
2910
+ C.currentPage;
2911
+ C.totalPages;
2912
+ C.isSingleMode;
2913
+ C.showThumbs;
2914
+ C.showToc;
2915
+ C.showArrows;
2916
+ C.orientation;
2917
+ C.flipState;
2918
+ C.themeMode;
2919
+ C.allowDownload;
2920
+ C.hasDownloadUrl;
2921
+ C.primaryColor;
2922
+ C.whiteLabel;
2923
+ C.isZoomed;
2924
+ C.isAutoPlaying;
2925
+ C.autoPlayInterval;
2926
+ C.soundEnabled;
2927
+ C.locale;
2928
+ C.messages;
2929
+ C.zoomState;
2930
+ C.pages;
2931
+ C.toc;
2932
+ C.isDoublePageLayout;
2933
+ C.isFrontCover;
2934
+ C.isBackCover;
2935
+ function Pi(e) {
2935
2936
  if (!e || typeof e != "object") return !1;
2936
2937
  const t = e;
2937
2938
  return typeof t.normal == "string" && typeof t.low == "string" && typeof t.thumb == "string";
2938
2939
  }
2939
- function bi(e) {
2940
+ function xi(e) {
2940
2941
  return Array.isArray(e.pageNumbers) && e.pageNumbers.length > 0 ? e.pageNumbers : typeof e.pageNumber == "number" ? e.kind === "spread" ? [e.pageNumber, e.pageNumber + 1] : [e.pageNumber] : [];
2941
2942
  }
2942
- function xi(e) {
2943
+ function Si(e) {
2943
2944
  return e === "rtl" ? ["right", "left"] : ["left", "right"];
2944
2945
  }
2945
- function Pi(e) {
2946
+ function Ti(e) {
2946
2947
  const t = [];
2947
- let s = 1;
2948
+ let i = 1;
2948
2949
  return e.forEach((o, r) => {
2949
- const h = o.kind ?? "single", u = o.id ?? `asset-${r}`, p = o.splitDirection ?? "ltr", b = bi(o);
2950
+ const h = o.kind ?? "single", u = o.id ?? `asset-${r}`, c = o.splitDirection ?? "ltr", b = xi(o);
2950
2951
  if (h === "spread") {
2951
- const M = b.length >= 2 ? b.slice(0, 2) : [s, s + 1], I = xi(p);
2952
- M.forEach((S, T) => {
2952
+ const k = b.length >= 2 ? b.slice(0, 2) : [i, i + 1], I = Si(c);
2953
+ k.forEach((S, T) => {
2953
2954
  t.push({
2954
2955
  index: t.length,
2955
2956
  assetId: u,
2956
2957
  pageNumber: S,
2958
+ sourcePageNumber: S,
2957
2959
  cropMode: I[T] ?? "full",
2958
2960
  normal: o.normal,
2959
2961
  low: o.low,
2960
2962
  thumb: o.thumb
2961
2963
  });
2962
- }), s = M[M.length - 1] + 1;
2964
+ }), i = k[k.length - 1] + 1;
2963
2965
  return;
2964
2966
  }
2965
- const x = b[0] ?? s;
2967
+ const P = b[0] ?? i;
2966
2968
  t.push({
2967
2969
  index: t.length,
2968
2970
  assetId: u,
2969
- pageNumber: x,
2971
+ pageNumber: P,
2972
+ sourcePageNumber: P,
2970
2973
  cropMode: "full",
2971
2974
  normal: o.normal,
2972
2975
  low: o.low,
2973
2976
  thumb: o.thumb
2974
- }), s = x + 1;
2977
+ }), i = P + 1;
2975
2978
  }), t;
2976
2979
  }
2977
- function Jt(e, t) {
2978
- e.classList.add("bk-container"), e.classList.remove("bk-theme-light", "bk-theme-dark"), t.theme === "light" && e.classList.add("bk-theme-light"), t.theme === "dark" && e.classList.add("bk-theme-dark"), t.primaryColor && e.style.setProperty("--flipbook-accent", t.primaryColor);
2979
- const s = t.cssVariables ?? {};
2980
- Object.entries(s).forEach(([o, r]) => {
2981
- const h = o.startsWith("--") ? o : `--${o}`;
2982
- e.style.setProperty(h, r);
2980
+ function ki(e) {
2981
+ return e ? 'url("' + e.replace(/["\\\r\n]/g, (i) => "\\" + i) + '")' : void 0;
2982
+ }
2983
+ function ee(e, t) {
2984
+ e.classList.add("bk-container"), e.classList.remove("bk-theme-light", "bk-theme-dark"), e.classList.add("bk-theme-" + (t.theme ?? "auto")), t.primaryColor && e.style.setProperty("--flipbook-accent", t.primaryColor);
2985
+ const i = t.background ?? {}, o = t.backgroundColor || t.backgroundImage ? { color: t.backgroundColor, image: t.backgroundImage } : void 0, r = (u, c) => {
2986
+ const b = {
2987
+ ["--flipbook-bg-" + u + "-color"]: c == null ? void 0 : c.color,
2988
+ ["--flipbook-bg-" + u + "-image"]: ki(c == null ? void 0 : c.image),
2989
+ ["--flipbook-bg-" + u + "-size"]: c == null ? void 0 : c.size,
2990
+ ["--flipbook-bg-" + u + "-position"]: c == null ? void 0 : c.position,
2991
+ ["--flipbook-bg-" + u + "-repeat"]: c == null ? void 0 : c.repeat
2992
+ };
2993
+ Object.entries(b).forEach(([P, k]) => {
2994
+ k ? e.style.setProperty(P, k) : e.style.removeProperty(P);
2995
+ });
2996
+ };
2997
+ r("light", i.light ?? o), r("dark", i.dark);
2998
+ const h = t.cssVariables ?? {};
2999
+ Object.entries(h).forEach(([u, c]) => {
3000
+ const b = u.startsWith("--") ? u : "--" + u;
3001
+ e.style.setProperty(b, c);
2983
3002
  });
2984
3003
  }
2985
- class Si {
3004
+ class Ci {
2986
3005
  constructor(t = 32) {
2987
3006
  v(this, "entries", /* @__PURE__ */ new Map());
2988
3007
  v(this, "hits", 0);
@@ -2991,16 +3010,16 @@ class Si {
2991
3010
  throw new RangeError("PDF render cache size must be a non-negative integer.");
2992
3011
  }
2993
3012
  get(t) {
2994
- const s = this.entries.get(t);
2995
- if (s === void 0) {
3013
+ const i = this.entries.get(t);
3014
+ if (i === void 0) {
2996
3015
  this.misses++;
2997
3016
  return;
2998
3017
  }
2999
- return this.hits++, this.entries.delete(t), this.entries.set(t, s), s;
3018
+ return this.hits++, this.entries.delete(t), this.entries.set(t, i), i;
3000
3019
  }
3001
- set(t, s) {
3002
- if (!(this.maxEntries === 0 || !s))
3003
- for (this.entries.delete(t), this.entries.set(t, s); this.entries.size > this.maxEntries; ) {
3020
+ set(t, i) {
3021
+ if (!(this.maxEntries === 0 || !i))
3022
+ for (this.entries.delete(t), this.entries.set(t, i); this.entries.size > this.maxEntries; ) {
3004
3023
  const o = this.entries.keys().next().value;
3005
3024
  if (o === void 0) break;
3006
3025
  this.entries.delete(o);
@@ -3016,101 +3035,116 @@ class Si {
3016
3035
  return { size: this.size, maxEntries: this.maxEntries, hits: this.hits, misses: this.misses };
3017
3036
  }
3018
3037
  }
3019
- class Ti {
3038
+ const kt = 1190.55, Ct = 841.89;
3039
+ function Ai(e, t) {
3040
+ const i = Math.max(e, t), o = Math.min(e, t), r = i / o, h = Math.abs(i - kt) / kt <= 0.08 && Math.abs(o - Ct) / Ct <= 0.08;
3041
+ return e >= t && h && Math.abs(r - kt / Ct) <= 0.04;
3042
+ }
3043
+ class Ei {
3020
3044
  constructor(t = {}) {
3021
3045
  v(this, "pdfDoc", null);
3022
3046
  v(this, "loadingTask", null);
3023
3047
  v(this, "options");
3024
3048
  v(this, "cache");
3025
- const s = Number.isFinite(t.cacheSize) ? Math.max(0, Math.floor(t.cacheSize)) : 32;
3049
+ const i = Number.isFinite(t.cacheSize) ? Math.max(0, Math.floor(t.cacheSize)) : 32;
3026
3050
  this.options = {
3027
3051
  scale: t.scale || 1.5,
3028
3052
  quality: t.quality || 0.85,
3029
3053
  format: t.format || "image/webp",
3030
3054
  workerSrc: t.workerSrc || "",
3031
3055
  concurrency: Math.max(1, Math.floor(t.concurrency || 3)),
3032
- cacheSize: s
3033
- }, this.cache = new Si(this.options.cacheSize), this.options.workerSrc && (Bt.GlobalWorkerOptions.workerSrc = this.options.workerSrc);
3056
+ cacheSize: i
3057
+ }, this.cache = new Ci(this.options.cacheSize), this.options.workerSrc && (Gt.GlobalWorkerOptions.workerSrc = this.options.workerSrc);
3034
3058
  }
3035
3059
  /** Loads a PDF document and cancels PDF.js loading when the signal aborts. */
3036
- async loadDocument(t, s) {
3037
- this.throwIfAborted(s), this.cache.clear();
3038
- const o = Bt.getDocument(t);
3060
+ async loadDocument(t, i) {
3061
+ this.throwIfAborted(i), this.cache.clear();
3062
+ const o = Gt.getDocument(t);
3039
3063
  this.loadingTask = o;
3040
3064
  const r = () => {
3041
3065
  var h;
3042
3066
  return (h = o.destroy) == null ? void 0 : h.call(o);
3043
3067
  };
3044
- s == null || s.addEventListener("abort", r, { once: !0 });
3068
+ i == null || i.addEventListener("abort", r, { once: !0 });
3045
3069
  try {
3046
- return this.pdfDoc = await o.promise, this.throwIfAborted(s), this.pdfDoc.numPages;
3070
+ return this.pdfDoc = await o.promise, this.throwIfAborted(i), this.pdfDoc.numPages;
3047
3071
  } catch (h) {
3048
- throw s != null && s.aborted ? this.createAbortError() : h;
3072
+ throw i != null && i.aborted ? this.createAbortError() : h;
3049
3073
  } finally {
3050
- s == null || s.removeEventListener("abort", r), this.loadingTask === o && (this.loadingTask = null);
3074
+ i == null || i.removeEventListener("abort", r), this.loadingTask === o && (this.loadingTask = null);
3051
3075
  }
3052
3076
  }
3053
3077
  /** Renders a specific page to a Data URL. The page index is 1-based. */
3054
- async renderPageToDataUrl(t, s) {
3078
+ async renderPageToDataUrl(t, i) {
3055
3079
  if (!this.pdfDoc) throw new Error("PDF document is not loaded.");
3056
- this.throwIfAborted(s);
3080
+ this.throwIfAborted(i);
3057
3081
  const o = this.cache.get(t);
3058
3082
  if (o !== void 0) return o;
3059
3083
  try {
3060
3084
  const r = await this.pdfDoc.getPage(t);
3061
- this.throwIfAborted(s);
3085
+ this.throwIfAborted(i);
3062
3086
  const h = r.getViewport({ scale: this.options.scale }), u = document.createElement("canvas");
3063
3087
  u.width = h.width, u.height = h.height;
3064
- const p = u.getContext("2d");
3065
- if (p) {
3066
- const b = r.render({ canvasContext: p, viewport: h }), x = () => {
3088
+ const c = u.getContext("2d");
3089
+ if (c) {
3090
+ const b = r.render({ canvasContext: c, viewport: h }), P = () => {
3067
3091
  var I;
3068
3092
  return (I = b.cancel) == null ? void 0 : I.call(b);
3069
3093
  };
3070
- s == null || s.addEventListener("abort", x, { once: !0 });
3094
+ i == null || i.addEventListener("abort", P, { once: !0 });
3071
3095
  try {
3072
- await b.promise, this.throwIfAborted(s);
3096
+ await b.promise, this.throwIfAborted(i);
3073
3097
  } finally {
3074
- s == null || s.removeEventListener("abort", x);
3098
+ i == null || i.removeEventListener("abort", P);
3075
3099
  }
3076
- const M = u.toDataURL(this.options.format, this.options.quality);
3077
- return this.cache.set(t, M), M;
3100
+ const k = u.toDataURL(this.options.format, this.options.quality);
3101
+ return this.cache.set(t, k), k;
3078
3102
  }
3079
3103
  throw new Error("Unable to create a PDF canvas rendering context.");
3080
3104
  } catch (r) {
3081
- throw s != null && s.aborted ? this.createAbortError() : r;
3105
+ throw i != null && i.aborted ? this.createAbortError() : r;
3106
+ }
3107
+ }
3108
+ /** Returns source page dimensions and whether the page should be split. */
3109
+ async getPageLayouts(t = "auto") {
3110
+ if (!this.pdfDoc) return [];
3111
+ const i = [];
3112
+ for (let o = 1; o <= this.pdfDoc.numPages; o++) {
3113
+ const h = (await this.pdfDoc.getPage(o)).getViewport({ scale: 1 }), u = t === "split" ? h.width >= h.height : t === "auto" && Ai(h.width, h.height);
3114
+ i.push({ width: h.width, height: h.height, split: u });
3082
3115
  }
3116
+ return i;
3083
3117
  }
3084
- /** Calculates the best viewport dimensions based on the first page. */
3085
- async calculateViewportDimensions(t = 420) {
3118
+ /** Calculates the best viewport dimensions based on the first logical page. */
3119
+ async calculateViewportDimensions(t = 420, i) {
3086
3120
  if (!this.pdfDoc) throw new Error("PDF document is not loaded.");
3087
- const o = (await this.pdfDoc.getPage(1)).getViewport({ scale: 1 }), r = o.width / o.height;
3088
- return r >= 1 ? { width: Math.round(t * r), height: t } : { width: t, height: Math.round(t / r) };
3121
+ const o = await this.pdfDoc.getPage(1), r = i ? { width: i.split ? i.width / 2 : i.width, height: i.height } : o.getViewport({ scale: 1 }), h = r.width / r.height;
3122
+ return h >= 1 ? { width: Math.round(t * h), height: t } : { width: t, height: Math.round(t / h) };
3089
3123
  }
3090
3124
  /** Renders pages concurrently with a bounded worker pool and preserves page order. */
3091
- async renderAllPages(t, s) {
3125
+ async renderAllPages(t, i) {
3092
3126
  if (!this.pdfDoc) return [];
3093
3127
  this.throwIfAborted(t);
3094
3128
  const o = this.pdfDoc.numPages, r = new Array(o);
3095
3129
  let h = 1, u = 0;
3096
- const p = async () => {
3130
+ const c = async () => {
3097
3131
  for (; ; ) {
3098
3132
  this.throwIfAborted(t);
3099
- const x = h++;
3100
- if (x > o) return;
3101
- const M = await this.renderPageToDataUrl(x, t);
3102
- r[x - 1] = {
3103
- index: x - 1,
3104
- assetId: `pdf-page-${x}`,
3105
- pageNumber: x,
3133
+ const P = h++;
3134
+ if (P > o) return;
3135
+ const k = await this.renderPageToDataUrl(P, t);
3136
+ r[P - 1] = {
3137
+ index: P - 1,
3138
+ assetId: `pdf-page-${P}`,
3139
+ pageNumber: P,
3106
3140
  cropMode: "full",
3107
- normal: M,
3108
- low: M,
3109
- thumb: M
3110
- }, u++, s == null || s({ completed: u, total: o });
3141
+ normal: k,
3142
+ low: k,
3143
+ thumb: k
3144
+ }, u++, i == null || i({ completed: u, total: o });
3111
3145
  }
3112
3146
  }, b = Math.min(this.options.concurrency, o);
3113
- return await Promise.all(Array.from({ length: b }, () => p())), this.throwIfAborted(t), r;
3147
+ return await Promise.all(Array.from({ length: b }, () => c())), this.throwIfAborted(t), r;
3114
3148
  }
3115
3149
  getCacheStats() {
3116
3150
  return this.cache.getStats();
@@ -3123,12 +3157,12 @@ class Ti {
3123
3157
  return t.name = "AbortError", t;
3124
3158
  }
3125
3159
  destroy() {
3126
- var t, s, o, r;
3127
- (s = (t = this.loadingTask) == null ? void 0 : t.destroy) == null || s.call(t), this.loadingTask = null, this.pdfDoc && ((r = (o = this.pdfDoc).destroy) == null || r.call(o), this.pdfDoc = null), this.cache.clear();
3160
+ var t, i, o, r;
3161
+ (i = (t = this.loadingTask) == null ? void 0 : t.destroy) == null || i.call(t), this.loadingTask = null, this.pdfDoc && ((r = (o = this.pdfDoc).destroy) == null || r.call(o), this.pdfDoc = null), this.cache.clear();
3128
3162
  }
3129
3163
  }
3130
3164
  /**
3131
- * @license FlipbookEngine v0.6.0
3165
+ * @license FlipbookEngine v0.6.5
3132
3166
  * Copyright (c) 2026 Murat Dogan
3133
3167
  *
3134
3168
  * This source code is dual-licensed under the AGPLv3 and a Commercial License.
@@ -3142,10 +3176,10 @@ class Ti {
3142
3176
  * https://flipbookengine.com/pricing
3143
3177
  */
3144
3178
  const mt = class mt {
3145
- constructor(t, s = {}) {
3179
+ constructor(t, i = {}) {
3146
3180
  v(this, "container", null);
3147
3181
  v(this, "options");
3148
- v(this, "store", be());
3182
+ v(this, "store", xe());
3149
3183
  // Core Managers
3150
3184
  v(this, "pageFlipAdapter", null);
3151
3185
  v(this, "layoutManager", null);
@@ -3156,16 +3190,18 @@ const mt = class mt {
3156
3190
  v(this, "initGeneration", 0);
3157
3191
  v(this, "initAbortController", null);
3158
3192
  v(this, "eventsReady", !1);
3159
- v(this, "lastEventState", { currentPage: 0, zoom: 1, zoomActive: !1, showThumbs: !0, showToc: !1, isSingle: !1, orientation: "" });
3193
+ v(this, "lastEventState", { currentPage: 0, zoom: 1, zoomActive: !1, showThumbs: !1, showToc: !1, isSingle: !1, orientation: "" });
3160
3194
  v(this, "eventSyncStop", null);
3161
3195
  v(this, "qualityObserver", null);
3162
3196
  v(this, "pdfLazyStop", null);
3163
3197
  v(this, "hasActiveSession", !1);
3164
3198
  v(this, "pdfPageRequests", /* @__PURE__ */ new Map());
3165
3199
  v(this, "pdfRenderedPages", /* @__PURE__ */ new Set());
3200
+ v(this, "pdfRenderedSources", /* @__PURE__ */ new Map());
3201
+ v(this, "pdfSourcePageCount", 0);
3166
3202
  this.selector = t, this.options = {
3167
3203
  allowDownload: !0,
3168
- showThumbs: !0,
3204
+ showThumbs: !1,
3169
3205
  primaryColor: "#7367f0",
3170
3206
  theme: "auto",
3171
3207
  soundUrl: "https://flipbookengine.com/Content/page-flip.mp3",
@@ -3175,24 +3211,25 @@ const mt = class mt {
3175
3211
  pdfRenderFormat: "image/webp",
3176
3212
  pdfRenderConcurrency: 3,
3177
3213
  pdfRenderCacheSize: 32,
3178
- ...s
3214
+ pdfPageMode: "auto",
3215
+ ...i
3179
3216
  }, this.setupEventSync();
3180
3217
  }
3181
- async init(t, s) {
3218
+ async init(t, i) {
3182
3219
  if (typeof this.selector == "string" ? this.container = document.querySelector(this.selector) : this.container = this.selector, !this.container) return;
3183
3220
  this.eventsReady = !1, this.destroy(!0);
3184
3221
  const o = this.initGeneration, r = new AbortController();
3185
3222
  this.initAbortController = r;
3186
3223
  let h = [], u = { ...mt.DEFAULT_PAGE_VIEWPORT };
3187
- if (s && s.length > 0) {
3224
+ if (i && i.length > 0) {
3188
3225
  if (r.signal.aborted) return;
3189
- const T = s.filter(yi);
3190
- h = Pi(T);
3191
- const E = h[0];
3192
- if (E) {
3193
- const W = await this.loadImageSize(E.low || E.normal);
3194
- if (W) {
3195
- const N = (E.cropMode !== "full" ? W.width / 2 : W.width) / W.height, H = 420;
3226
+ const T = i.filter(Pi);
3227
+ h = Ti(T);
3228
+ const A = h[0];
3229
+ if (A) {
3230
+ const L = await this.loadImageSize(A.low || A.normal);
3231
+ if (L) {
3232
+ const N = (A.cropMode !== "full" ? L.width / 2 : L.width) / L.height, H = 420;
3196
3233
  u = N >= 1 ? { width: Math.round(H * N), height: H } : { width: H, height: Math.round(H / N) };
3197
3234
  }
3198
3235
  }
@@ -3200,7 +3237,7 @@ const mt = class mt {
3200
3237
  if (r.signal.aborted) return;
3201
3238
  let T = "load";
3202
3239
  try {
3203
- this.pdfRenderer = new Ti({
3240
+ this.pdfRenderer = new Ei({
3204
3241
  scale: this.options.pdfRenderScale,
3205
3242
  quality: this.options.pdfRenderQuality,
3206
3243
  format: this.options.pdfRenderFormat,
@@ -3208,26 +3245,28 @@ const mt = class mt {
3208
3245
  cacheSize: this.options.pdfRenderCacheSize,
3209
3246
  workerSrc: this.options.pdfWorkerSrc
3210
3247
  }), this.emit("progress", { phase: "loading", completed: 0, total: 0 });
3211
- const E = await this.pdfRenderer.loadDocument(t, r.signal);
3212
- T = "render", this.emit("progress", { phase: "loading", completed: 1, total: E }), u = await this.pdfRenderer.calculateViewportDimensions(), h = Array.from({ length: E }, (W, B) => this.createPdfPlaceholder(B + 1));
3213
- } catch (E) {
3214
- r.signal.aborted || (console.error("PDF load failed:", E), this.emit("error", {
3248
+ const A = await this.pdfRenderer.loadDocument(t, r.signal);
3249
+ T = "render", this.emit("progress", { phase: "loading", completed: 1, total: A });
3250
+ const L = await this.pdfRenderer.getPageLayouts(this.options.pdfPageMode);
3251
+ u = L.length ? await this.pdfRenderer.calculateViewportDimensions(420, L[0]) : await this.pdfRenderer.calculateViewportDimensions(), h = L.length ? this.createPdfPlaceholders(L) : Array.from({ length: A }, (U, N) => this.createPdfPlaceholder(N + 1)), this.pdfSourcePageCount = A;
3252
+ } catch (A) {
3253
+ r.signal.aborted || (console.error("PDF load failed:", A), this.emit("error", {
3215
3254
  code: T === "load" ? "PDF_LOAD_FAILED" : "PDF_RENDER_FAILED",
3216
- message: E instanceof Error ? E.message : "Unable to load PDF.",
3217
- cause: E
3255
+ message: A instanceof Error ? A.message : "Unable to load PDF.",
3256
+ cause: A
3218
3257
  }));
3219
3258
  return;
3220
3259
  }
3221
3260
  }
3222
3261
  if (r.signal.aborted || o !== this.initGeneration || !h.length) return;
3223
- this.store.init(this.options, h.length, h, !!t), Jt(this.container, this.options), this.container.innerHTML = "";
3224
- let p, b, x;
3225
- const M = { current: null }, I = { current: null }, S = di({
3226
- pageFlipAdapterRef: M,
3262
+ this.store.init(this.options, h.length, h, !!t), ee(this.container, this.options), this.container.innerHTML = "";
3263
+ let c, b, P;
3264
+ const k = { current: null }, I = { current: null }, S = gi({
3265
+ pageFlipAdapterRef: k,
3227
3266
  interactionManagerRef: I,
3228
- bookWrapperRef: (T) => p = T,
3267
+ bookWrapperRef: (T) => c = T,
3229
3268
  bookSizerRef: (T) => b = T,
3230
- bookContainerRef: (T) => x = T,
3269
+ bookContainerRef: (T) => P = T,
3231
3270
  className: this.options.className,
3232
3271
  store: this.store,
3233
3272
  onToggleFullscreen: () => this.toggleFullscreen(),
@@ -3235,18 +3274,18 @@ const mt = class mt {
3235
3274
  t && (this.options.onDownload ? this.options.onDownload(t) : window.open(t, "_blank"));
3236
3275
  }
3237
3276
  });
3238
- this.container.appendChild(S), this.setupQualityLoading(), this.layoutManager = new wi(u, this.store), this.layoutManager.onResizeCallback = () => {
3277
+ this.container.appendChild(S), this.setupQualityLoading(), this.layoutManager = new yi(u, this.store), this.layoutManager.onResizeCallback = () => {
3239
3278
  this.pageFlipAdapter && this.pageFlipAdapter.update();
3240
- }, this.layoutManager.init(p, b), this.pageFlipAdapter = new mi(x, this.options, this.store), M.current = this.pageFlipAdapter, await new Promise((T) => {
3241
- const E = () => {
3242
- r.signal.removeEventListener("abort", E), T();
3279
+ }, this.layoutManager.init(c, b), this.pageFlipAdapter = new vi(P, this.options, this.store), k.current = this.pageFlipAdapter, await new Promise((T) => {
3280
+ const A = () => {
3281
+ r.signal.removeEventListener("abort", A), T();
3243
3282
  };
3244
- r.signal.addEventListener("abort", E, { once: !0 }), this.initializationTimer = setTimeout(async () => {
3245
- if (this.initializationTimer = null, r.signal.removeEventListener("abort", E), r.signal.aborted || o !== this.initGeneration || !this.pageFlipAdapter) {
3283
+ r.signal.addEventListener("abort", A, { once: !0 }), this.initializationTimer = setTimeout(async () => {
3284
+ if (this.initializationTimer = null, r.signal.removeEventListener("abort", A), r.signal.aborted || o !== this.initGeneration || !this.pageFlipAdapter) {
3246
3285
  T();
3247
3286
  return;
3248
3287
  }
3249
- if (this.pageFlipAdapter.init(u.width, u.height), this.interactionManager = new vi(p, this.pageFlipAdapter, this.store), this.interactionManager.init(), I.current = this.interactionManager, this.setupPdfLazyLoading(), this.pdfRenderer && t)
3288
+ if (this.pageFlipAdapter.init(u.width, u.height), this.interactionManager = new bi(c, this.pageFlipAdapter, this.store), this.interactionManager.init(), I.current = this.interactionManager, this.setupPdfLazyLoading(), this.pdfRenderer && t)
3250
3289
  try {
3251
3290
  await this.renderPdfPage(1, r.signal);
3252
3291
  } catch {
@@ -3262,64 +3301,81 @@ const mt = class mt {
3262
3301
  }), this.initAbortController === r && (this.initAbortController = null);
3263
3302
  }
3264
3303
  createPdfPlaceholder(t) {
3265
- const s = "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";
3266
- return {
3267
- index: t - 1,
3268
- assetId: "pdf-page-" + t,
3269
- pageNumber: t,
3270
- cropMode: "full",
3271
- normal: s,
3272
- low: s,
3273
- thumb: s
3274
- };
3304
+ const i = "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";
3305
+ return { index: t - 1, assetId: "pdf-page-" + t + "-full", pageNumber: t, sourcePageNumber: t, cropMode: "full", normal: i, low: i, thumb: i };
3306
+ }
3307
+ createPdfPlaceholders(t) {
3308
+ const i = "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=", o = [];
3309
+ return t.forEach((r, h) => {
3310
+ const u = h + 1;
3311
+ (r.split ? ["left", "right"] : ["full"]).forEach((b) => {
3312
+ const P = o.length + 1;
3313
+ o.push({
3314
+ index: o.length,
3315
+ assetId: `pdf-page-${u}-${b}`,
3316
+ pageNumber: P,
3317
+ sourcePageNumber: u,
3318
+ cropMode: b,
3319
+ normal: i,
3320
+ low: i,
3321
+ thumb: i
3322
+ });
3323
+ });
3324
+ }), o;
3275
3325
  }
3276
- renderPdfPage(t, s) {
3326
+ renderPdfPage(t, i) {
3277
3327
  const o = this.pdfRenderer, r = this.initGeneration;
3278
3328
  if (!o) return Promise.resolve("");
3279
3329
  const h = this.pdfPageRequests.get(t);
3280
3330
  if (h) return h;
3281
- if (this.pdfRenderedPages.has(t)) return Promise.resolve("");
3282
- const u = o.renderPageToDataUrl(t, s).then((p) => {
3283
- var b;
3284
- if (r !== this.initGeneration || s != null && s.aborted) throw this.createAbortError();
3285
- if (!p) throw new Error("PDF page " + t + " produced no image.");
3286
- return this.pdfRenderedPages.add(t), (b = this.container) == null || b.querySelectorAll('img[data-pdf-page="' + t + '"]').forEach((x) => {
3287
- x.src = p, delete x.dataset.pdfPage;
3288
- }), this.emit("progress", {
3331
+ if (this.pdfRenderedPages.has(t)) {
3332
+ const c = this.pdfRenderedSources.get(t);
3333
+ return c && this.hydratePdfImages(t, c), Promise.resolve(c || "");
3334
+ }
3335
+ const u = o.renderPageToDataUrl(t, i).then((c) => {
3336
+ if (r !== this.initGeneration || i != null && i.aborted) throw this.createAbortError();
3337
+ if (!c) throw new Error("PDF page " + t + " produced no image.");
3338
+ return this.pdfRenderedPages.add(t), this.pdfRenderedSources.set(t, c), this.hydratePdfImages(t, c), this.emit("progress", {
3289
3339
  phase: "rendering",
3290
3340
  completed: this.pdfRenderedPages.size,
3291
- total: this.store.totalPages.value
3292
- }), p;
3293
- }).catch((p) => {
3294
- throw r !== this.initGeneration && (p == null ? void 0 : p.name) !== "AbortError" ? this.createAbortError() : ((p == null ? void 0 : p.name) === "AbortError" || this.emit("error", {
3341
+ total: this.pdfSourcePageCount || this.store.totalPages.value
3342
+ }), c;
3343
+ }).catch((c) => {
3344
+ throw r !== this.initGeneration && (c == null ? void 0 : c.name) !== "AbortError" ? this.createAbortError() : ((c == null ? void 0 : c.name) === "AbortError" || this.emit("error", {
3295
3345
  code: "PDF_RENDER_FAILED",
3296
- message: p instanceof Error ? p.message : "Unable to render PDF page.",
3297
- cause: p
3298
- }), p);
3346
+ message: c instanceof Error ? c.message : "Unable to render PDF page.",
3347
+ cause: c
3348
+ }), c);
3299
3349
  }).finally(() => {
3300
3350
  this.pdfPageRequests.get(t) === u && this.pdfPageRequests.delete(t);
3301
3351
  });
3302
3352
  return this.pdfPageRequests.set(t, u), u;
3303
3353
  }
3354
+ hydratePdfImages(t, i) {
3355
+ var o;
3356
+ (o = this.container) == null || o.querySelectorAll("img").forEach((r) => {
3357
+ r.dataset.pdfPage === String(t) && (r.src = i, delete r.dataset.pdfPage);
3358
+ });
3359
+ }
3304
3360
  setupPdfLazyLoading() {
3305
3361
  var t;
3306
- (t = this.pdfLazyStop) == null || t.call(this), this.pdfLazyStop = null, this.pdfRenderer && (this.pdfLazyStop = G(() => {
3307
- const s = this.store.currentPage.value + 1, o = this.store.totalPages.value;
3308
- [s, s + 1].filter((r) => r <= o).forEach((r) => {
3309
- this.renderPdfPage(r).catch(() => {
3362
+ (t = this.pdfLazyStop) == null || t.call(this), this.pdfLazyStop = null, this.pdfRenderer && (this.pdfLazyStop = _(() => {
3363
+ const i = this.store.pages.value[this.store.currentPage.value], o = this.store.pages.value[this.store.currentPage.value + 1];
3364
+ (/* @__PURE__ */ new Set([(i == null ? void 0 : i.sourcePageNumber) ?? (i == null ? void 0 : i.pageNumber), (o == null ? void 0 : o.sourcePageNumber) ?? (o == null ? void 0 : o.pageNumber)])).forEach((h) => {
3365
+ h && this.renderPdfPage(h).catch(() => {
3310
3366
  });
3311
3367
  });
3312
3368
  }));
3313
3369
  }
3314
3370
  loadImageSize(t) {
3315
- return new Promise((s) => {
3371
+ return new Promise((i) => {
3316
3372
  const o = new Image();
3317
- o.onload = () => s({ width: o.naturalWidth || o.width, height: o.naturalHeight || o.height }), o.onerror = () => s(null), o.src = t;
3373
+ o.onload = () => i({ width: o.naturalWidth || o.width, height: o.naturalHeight || o.height }), o.onerror = () => i(null), o.src = t;
3318
3374
  });
3319
3375
  }
3320
3376
  goToPage(t) {
3321
- const s = Math.max(0, this.store.totalPages.value - 1);
3322
- this.store.currentPage.value = Math.max(0, Math.min(s, Math.trunc(t)));
3377
+ const i = Math.max(0, this.store.totalPages.value - 1);
3378
+ this.store.currentPage.value = Math.max(0, Math.min(i, Math.trunc(t)));
3323
3379
  }
3324
3380
  getTotalPages() {
3325
3381
  return this.store.totalPages.value;
@@ -3331,7 +3387,7 @@ const mt = class mt {
3331
3387
  return this.store.zoomState.value.scale;
3332
3388
  }
3333
3389
  setZoom(t) {
3334
- const s = Number.isFinite(t) ? t : 1, o = Math.max(0.5, Math.min(5, s));
3390
+ const i = Number.isFinite(t) ? t : 1, o = Math.max(0.5, Math.min(5, i));
3335
3391
  this.store.zoomState.value = {
3336
3392
  ...this.store.zoomState.value,
3337
3393
  scale: o,
@@ -3343,55 +3399,59 @@ const mt = class mt {
3343
3399
  this.pageFlipAdapter && this.pageFlipAdapter.turnToNextPage();
3344
3400
  }
3345
3401
  toggleFullscreen() {
3346
- var s, o;
3402
+ var i, o;
3347
3403
  const t = this.container;
3348
- t && (document.fullscreenElement ? (o = document.exitFullscreen) == null || o.call(document).catch((r) => console.warn("Exit fullscreen err:", r)) : (s = t.requestFullscreen) == null || s.call(t).catch((r) => console.warn("Fullscreen err:", r)));
3404
+ t && (document.fullscreenElement ? (o = document.exitFullscreen) == null || o.call(document).catch((r) => console.warn("Exit fullscreen err:", r)) : (i = t.requestFullscreen) == null || i.call(t).catch((r) => console.warn("Fullscreen err:", r)));
3349
3405
  }
3350
- setLocale(t, s) {
3351
- const o = s ? { ...this.options.messages, [t]: s[t] ?? s } : this.options.messages;
3406
+ setLocale(t, i) {
3407
+ const o = i ? { ...this.options.messages, [t]: i[t] ?? i } : this.options.messages;
3352
3408
  this.options = { ...this.options, locale: t, messages: o }, this.store.locale.value = t, o && (this.store.messages.value = o);
3353
3409
  }
3354
3410
  prevPage() {
3355
3411
  this.pageFlipAdapter && this.pageFlipAdapter.turnToPrevPage();
3356
3412
  }
3357
3413
  setSingleMode(t) {
3358
- this.store.isSingleMode.value = t;
3414
+ this.store.isSingleMode.value = t, t && this.pdfRenderer && setTimeout(() => {
3415
+ const i = this.store.pages.value[this.store.currentPage.value], o = (i == null ? void 0 : i.sourcePageNumber) ?? (i == null ? void 0 : i.pageNumber);
3416
+ o && this.renderPdfPage(o).catch(() => {
3417
+ });
3418
+ }, 0);
3359
3419
  }
3360
3420
  updateOptions(t) {
3361
- this.options = { ...this.options, ...t }, t.theme !== void 0 && (this.store.themeMode.value = t.theme), t.primaryColor !== void 0 && (this.store.primaryColor.value = t.primaryColor), t.showThumbs !== void 0 && (this.store.showThumbs.value = t.showThumbs), t.showToc !== void 0 && (this.store.showToc.value = t.showToc), t.toc !== void 0 && (this.store.toc.value = ye(t.toc, this.store.totalPages.value)), t.showArrows !== void 0 && (this.store.showArrows.value = t.showArrows), t.allowDownload !== void 0 && (this.store.allowDownload.value = t.allowDownload), t.whiteLabel !== void 0 && (this.store.whiteLabel.value = t.whiteLabel), t.soundEnabled !== void 0 && (this.store.soundEnabled.value = t.soundEnabled), t.locale !== void 0 && (this.store.locale.value = t.locale), t.messages !== void 0 && (this.store.messages.value = t.messages), t.singleMode !== void 0 && (this.store.isSingleMode.value = t.singleMode), t.isSingleMode !== void 0 && (this.store.isSingleMode.value = t.isSingleMode), t.autoPlay !== void 0 && (this.store.isAutoPlaying.value = t.autoPlay), t.autoPlayInterval !== void 0 && (this.store.autoPlayInterval.value = t.autoPlayInterval), this.container && Jt(this.container, this.options);
3421
+ this.options = { ...this.options, ...t }, t.theme !== void 0 && (this.store.themeMode.value = t.theme), t.primaryColor !== void 0 && (this.store.primaryColor.value = t.primaryColor), t.showThumbs !== void 0 && (this.store.showThumbs.value = t.showThumbs), t.showToc !== void 0 && (this.store.showToc.value = t.showToc), t.toc !== void 0 && (this.store.toc.value = Pe(t.toc, this.store.totalPages.value)), t.showArrows !== void 0 && (this.store.showArrows.value = t.showArrows), t.allowDownload !== void 0 && (this.store.allowDownload.value = t.allowDownload), t.whiteLabel !== void 0 && (this.store.whiteLabel.value = t.whiteLabel), t.soundEnabled !== void 0 && (this.store.soundEnabled.value = t.soundEnabled), t.locale !== void 0 && (this.store.locale.value = t.locale), t.messages !== void 0 && (this.store.messages.value = t.messages), t.singleMode !== void 0 && (this.store.isSingleMode.value = t.singleMode), t.isSingleMode !== void 0 && (this.store.isSingleMode.value = t.isSingleMode), t.autoPlay !== void 0 && (this.store.isAutoPlaying.value = t.autoPlay), t.autoPlayInterval !== void 0 && (this.store.autoPlayInterval.value = t.autoPlayInterval), this.container && ee(this.container, this.options);
3362
3422
  }
3363
- async setPages(t, s) {
3423
+ async setPages(t, i) {
3364
3424
  if (!(t != null && t.length)) {
3365
- s && await this.init(s);
3425
+ i && await this.init(i);
3366
3426
  return;
3367
3427
  }
3368
- await this.init(s || "", t);
3428
+ await this.init(i || "", t);
3369
3429
  }
3370
3430
  setupQualityLoading() {
3371
3431
  var r;
3372
3432
  if (this.teardownQualityLoading(), !this.container) return;
3373
- const t = Array.from(this.container.querySelectorAll("img[data-src], img[data-pdf-page]")), s = (h) => {
3433
+ const t = Array.from(this.container.querySelectorAll("img[data-src], img[data-pdf-page]")), i = (h) => {
3374
3434
  const u = Number(h.dataset.pdfPage);
3375
3435
  if (Number.isInteger(u) && u > 0) {
3376
3436
  this.renderPdfPage(u).catch(() => {
3377
3437
  });
3378
3438
  return;
3379
3439
  }
3380
- const p = h.dataset.src;
3381
- p && (h.src = p, delete h.dataset.src);
3440
+ const c = h.dataset.src;
3441
+ c && (h.src = c, delete h.dataset.src);
3382
3442
  }, o = (r = this.container.ownerDocument.defaultView) == null ? void 0 : r.IntersectionObserver;
3383
3443
  if (!o) {
3384
3444
  const h = /* @__PURE__ */ new Set();
3385
3445
  t.forEach((u) => {
3386
- const p = Number(u.dataset.pdfPage);
3387
- Number.isInteger(p) && p > 0 ? h.size < 2 && (h.add(p), s(u)) : s(u);
3446
+ const c = Number(u.dataset.pdfPage);
3447
+ Number.isInteger(c) && c > 0 ? h.size < 2 && (h.add(c), i(u)) : i(u);
3388
3448
  });
3389
3449
  return;
3390
3450
  }
3391
3451
  this.qualityObserver = new o((h) => {
3392
3452
  h.forEach((u) => {
3393
- var p;
3394
- u.isIntersecting && (s(u.target), (p = this.qualityObserver) == null || p.unobserve(u.target));
3453
+ var c;
3454
+ u.isIntersecting && (i(u.target), (c = this.qualityObserver) == null || c.unobserve(u.target));
3395
3455
  });
3396
3456
  }, { root: this.container, rootMargin: "240px" }), t.forEach((h) => {
3397
3457
  var u;
@@ -3403,7 +3463,7 @@ const mt = class mt {
3403
3463
  (t = this.qualityObserver) == null || t.disconnect(), this.qualityObserver = null;
3404
3464
  }
3405
3465
  setupEventSync() {
3406
- this.eventSyncStop = G(() => {
3466
+ this.eventSyncStop = _(() => {
3407
3467
  const t = {
3408
3468
  currentPage: this.store.currentPage.value,
3409
3469
  zoom: this.store.zoomState.value.scale,
@@ -3438,37 +3498,38 @@ const mt = class mt {
3438
3498
  }
3439
3499
  destroy(t = !1) {
3440
3500
  var o, r;
3441
- const s = this.hasActiveSession || !!this.initAbortController || !!this.pageFlipAdapter || !!this.layoutManager || !!this.interactionManager || !!this.pdfRenderer;
3442
- this.initGeneration++, (o = this.initAbortController) == null || o.abort(), this.initAbortController = null, this.initializationTimer && (clearTimeout(this.initializationTimer), this.initializationTimer = null), this.pageFlipAdapter && this.pageFlipAdapter.destroy(), this.layoutManager && this.layoutManager.destroy(), this.interactionManager && this.interactionManager.destroy(), this.teardownQualityLoading(), (r = this.pdfLazyStop) == null || r.call(this), this.pdfLazyStop = null, this.pdfPageRequests.clear(), this.pdfRenderedPages.clear(), this.pdfRenderer && this.pdfRenderer.destroy(), this.pageFlipAdapter = null, this.layoutManager = null, this.interactionManager = null, this.pdfRenderer = null, this.eventsReady = !1, this.hasActiveSession = !1, this.store.reset(), !t && this.container && (this.container.innerHTML = ""), s && this.emit("destroy", void 0);
3501
+ const i = this.hasActiveSession || !!this.initAbortController || !!this.pageFlipAdapter || !!this.layoutManager || !!this.interactionManager || !!this.pdfRenderer;
3502
+ this.initGeneration++, (o = this.initAbortController) == null || o.abort(), this.initAbortController = null, this.initializationTimer && (clearTimeout(this.initializationTimer), this.initializationTimer = null), this.pageFlipAdapter && this.pageFlipAdapter.destroy(), this.layoutManager && this.layoutManager.destroy(), this.interactionManager && this.interactionManager.destroy(), this.teardownQualityLoading(), (r = this.pdfLazyStop) == null || r.call(this), this.pdfLazyStop = null, this.pdfPageRequests.clear(), this.pdfRenderedPages.clear(), this.pdfRenderedSources.clear(), this.pdfSourcePageCount = 0, this.pdfRenderer && this.pdfRenderer.destroy(), this.pageFlipAdapter = null, this.layoutManager = null, this.interactionManager = null, this.pdfRenderer = null, this.eventsReady = !1, this.hasActiveSession = !1, this.store.reset(), !t && this.container && (this.container.innerHTML = ""), i && this.emit("destroy", void 0);
3443
3503
  }
3444
3504
  createAbortError() {
3445
3505
  const t = new Error("Flipbook initialization was aborted.");
3446
3506
  return t.name = "AbortError", t;
3447
3507
  }
3448
- on(t, s) {
3508
+ on(t, i) {
3449
3509
  const o = this.listeners[t] ?? /* @__PURE__ */ new Set();
3450
- return o.add(s), this.listeners[t] = o, () => this.off(t, s);
3510
+ return o.add(i), this.listeners[t] = o, () => this.off(t, i);
3451
3511
  }
3452
- off(t, s) {
3512
+ off(t, i) {
3453
3513
  var o;
3454
- (o = this.listeners[t]) == null || o.delete(s);
3514
+ (o = this.listeners[t]) == null || o.delete(i);
3455
3515
  }
3456
- emit(t, s) {
3516
+ emit(t, i) {
3457
3517
  var o;
3458
3518
  (o = this.listeners[t]) == null || o.forEach((r) => {
3459
- r(s);
3519
+ r(i);
3460
3520
  });
3461
3521
  }
3462
3522
  };
3463
3523
  v(mt, "DEFAULT_PAGE_VIEWPORT", { width: 420, height: 594 });
3464
- let Rt = mt;
3465
- const xe = globalThis, Pe = xe.FlipbookEngine || {};
3466
- Pe.FlipbookEngine = Rt;
3467
- xe.FlipbookEngine = Pe;
3524
+ let Lt = mt;
3525
+ const Se = globalThis, Te = Se.FlipbookEngine || {};
3526
+ Te.FlipbookEngine = Lt;
3527
+ Se.FlipbookEngine = Te;
3468
3528
  export {
3469
- Rt as F,
3470
- ye as a,
3471
- yi as i,
3472
- Pi as n
3529
+ Lt as F,
3530
+ Pi as a,
3531
+ Pe as b,
3532
+ Ai as i,
3533
+ Ti as n
3473
3534
  };
3474
- //# sourceMappingURL=engine-MdZzt6R9.js.map
3535
+ //# sourceMappingURL=engine-DhQ2zxpm.js.map