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.
- package/CHANGELOG.md +14 -1
- package/README.md +18 -7
- package/dist/core/LayoutManager.d.ts +1 -1
- package/dist/core/PdfRenderer.d.ts +12 -2
- package/dist/{engine-MdZzt6R9.js → engine-DhQ2zxpm.js} +1173 -1112
- package/dist/engine-DhQ2zxpm.js.map +1 -0
- package/dist/engine.d.ts +10 -1
- package/dist/flipbook-engine.css +1 -1
- package/dist/flipbook-engine.iife.js +30 -30
- package/dist/flipbook-engine.iife.js.map +1 -1
- package/dist/flipbook-engine.js +6 -5
- package/dist/flipbook-engine.react.js +1 -1
- package/dist/flipbook-engine.vue.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/model/pages.d.ts +2 -0
- package/dist/theme/theme.d.ts +16 -0
- package/package.json +1 -1
- package/dist/engine-MdZzt6R9.js.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var ke = Object.defineProperty;
|
|
2
|
+
var _t = (e) => {
|
|
3
3
|
throw TypeError(e);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var v = (e, t,
|
|
7
|
-
var
|
|
8
|
-
import * as
|
|
9
|
-
var
|
|
10
|
-
function
|
|
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
|
|
21
|
-
for (tt = void 0, lt++;
|
|
22
|
-
var o =
|
|
23
|
-
if (
|
|
24
|
-
|
|
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
|
-
|
|
28
|
+
i = o;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
if (lt = 0, j--, t) throw e;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
var
|
|
34
|
+
var M = void 0;
|
|
35
35
|
function wt(e) {
|
|
36
|
-
var t =
|
|
37
|
-
|
|
36
|
+
var t = M;
|
|
37
|
+
M = void 0;
|
|
38
38
|
try {
|
|
39
39
|
return e();
|
|
40
40
|
} finally {
|
|
41
|
-
|
|
41
|
+
M = t;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
var tt = void 0, j = 0, lt = 0,
|
|
45
|
-
function
|
|
46
|
-
if (
|
|
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 !==
|
|
49
|
-
return t = { i: 0, S: e, p:
|
|
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 =
|
|
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
|
|
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
|
-
|
|
58
|
-
|
|
57
|
+
z.prototype.brand = Ae;
|
|
58
|
+
z.prototype.h = function() {
|
|
59
59
|
return !0;
|
|
60
60
|
};
|
|
61
|
-
|
|
62
|
-
var t = this,
|
|
63
|
-
|
|
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
|
-
|
|
68
|
+
z.prototype.U = function(e) {
|
|
69
69
|
var t = this;
|
|
70
70
|
if (this.t !== void 0) {
|
|
71
|
-
var
|
|
72
|
-
|
|
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
|
-
|
|
78
|
+
z.prototype.subscribe = function(e) {
|
|
79
79
|
var t = this;
|
|
80
|
-
return
|
|
81
|
-
var
|
|
80
|
+
return _(function() {
|
|
81
|
+
var i = t.value;
|
|
82
82
|
wt(function() {
|
|
83
|
-
return e(
|
|
83
|
+
return e(i);
|
|
84
84
|
});
|
|
85
85
|
}, { name: "sub" });
|
|
86
86
|
};
|
|
87
|
-
|
|
87
|
+
z.prototype.valueOf = function() {
|
|
88
88
|
return this.value;
|
|
89
89
|
};
|
|
90
|
-
|
|
90
|
+
z.prototype.toString = function() {
|
|
91
91
|
return this.value + "";
|
|
92
92
|
};
|
|
93
|
-
|
|
93
|
+
z.prototype.toJSON = function() {
|
|
94
94
|
return this.value;
|
|
95
95
|
};
|
|
96
|
-
|
|
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(
|
|
103
|
-
var e =
|
|
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(
|
|
109
|
-
j !== 0 && lt === 0 &&
|
|
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
|
-
|
|
114
|
+
zt();
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
} });
|
|
118
118
|
function D(e, t) {
|
|
119
|
-
return new
|
|
119
|
+
return new z(e, t);
|
|
120
120
|
}
|
|
121
|
-
function
|
|
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
|
|
125
|
+
function oe(e) {
|
|
126
126
|
for (var t = e.s; t !== void 0; t = t.n) {
|
|
127
|
-
var
|
|
128
|
-
if (
|
|
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
|
|
135
|
-
for (var t = e.s,
|
|
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)) :
|
|
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 =
|
|
139
|
+
e.s = i;
|
|
140
140
|
}
|
|
141
141
|
function q(e, t) {
|
|
142
|
-
|
|
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
|
|
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 && !
|
|
148
|
+
if (this.g = dt, this.f |= 1, this.i > 0 && !ne(this))
|
|
149
149
|
return this.f &= -2, !0;
|
|
150
|
-
var e =
|
|
150
|
+
var e = M;
|
|
151
151
|
try {
|
|
152
|
-
|
|
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 (
|
|
156
|
-
this.v =
|
|
155
|
+
} catch (i) {
|
|
156
|
+
this.v = i, this.f |= 16, this.i++;
|
|
157
157
|
}
|
|
158
|
-
return
|
|
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
|
-
|
|
165
|
+
z.prototype.S.call(this, e);
|
|
166
166
|
};
|
|
167
167
|
q.prototype.U = function(e) {
|
|
168
|
-
if (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 =
|
|
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
|
|
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
|
|
193
|
-
|
|
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,
|
|
197
|
+
throw e.f &= -2, e.f |= 8, Ft(e), o;
|
|
198
198
|
} finally {
|
|
199
|
-
|
|
199
|
+
M = i, zt();
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
|
-
function
|
|
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,
|
|
205
|
+
e.x = void 0, e.s = void 0, ae(e);
|
|
206
206
|
}
|
|
207
|
-
function
|
|
208
|
-
if (
|
|
209
|
-
|
|
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,
|
|
227
|
-
var e =
|
|
228
|
-
return
|
|
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 ||
|
|
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
|
|
240
|
-
var
|
|
239
|
+
function _(e, t) {
|
|
240
|
+
var i = new X(e, t);
|
|
241
241
|
try {
|
|
242
|
-
|
|
242
|
+
i.c();
|
|
243
243
|
} catch (r) {
|
|
244
|
-
throw
|
|
244
|
+
throw i.d(), r;
|
|
245
245
|
}
|
|
246
|
-
var o =
|
|
246
|
+
var o = i.d.bind(i);
|
|
247
247
|
return o[Symbol.dispose] = o, o;
|
|
248
248
|
}
|
|
249
|
-
var
|
|
250
|
-
function
|
|
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
|
|
256
|
+
function le(e) {
|
|
257
257
|
return typeof e == "number";
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function W(e) {
|
|
260
260
|
return typeof e == "object" && e !== null;
|
|
261
261
|
}
|
|
262
|
-
function
|
|
262
|
+
function De(e) {
|
|
263
263
|
return !!(e && e.isComponent);
|
|
264
264
|
}
|
|
265
|
-
function
|
|
266
|
-
return
|
|
265
|
+
function Ot(e) {
|
|
266
|
+
return W(e) && typeof e.length == "number" && typeof e.nodeType != "number";
|
|
267
267
|
}
|
|
268
|
-
function
|
|
269
|
-
return typeof e == "function" && typeof e[
|
|
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(" ") :
|
|
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
|
|
277
|
+
function Ie(e) {
|
|
278
278
|
return e != null && typeof e == "object" && "current" in e;
|
|
279
279
|
}
|
|
280
|
-
function
|
|
281
|
-
|
|
280
|
+
function Wt(e, t) {
|
|
281
|
+
Ie(e) ? e.current = t : typeof e == "function" && e(t);
|
|
282
282
|
}
|
|
283
|
-
function
|
|
284
|
-
t = { ...t, children:
|
|
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 &&
|
|
286
|
+
return "ref" in t && Wt(t.ref, o), r;
|
|
287
287
|
}
|
|
288
|
-
var
|
|
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
|
-
]),
|
|
354
|
-
function
|
|
355
|
-
const t = globalThis[
|
|
356
|
-
return arguments.length && (globalThis[
|
|
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
|
|
359
|
-
function
|
|
360
|
-
return e != null && 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"),
|
|
363
|
-
function
|
|
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
|
|
367
|
-
e && e.target && (!e.currentTarget || e.currentTarget === 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
|
|
369
|
+
function _e(e, t) {
|
|
370
370
|
if (!e)
|
|
371
371
|
return;
|
|
372
|
-
const
|
|
372
|
+
const i = Nt();
|
|
373
373
|
function o(r) {
|
|
374
|
-
const h =
|
|
374
|
+
const h = i.get(r);
|
|
375
375
|
if (h) {
|
|
376
|
-
|
|
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
|
|
386
|
+
function At(e, t, i) {
|
|
387
387
|
if (!e || !t)
|
|
388
388
|
return e;
|
|
389
|
-
const o =
|
|
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:
|
|
395
|
-
}]), e.addEventListener("disposing",
|
|
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:
|
|
397
|
+
return h ? (h.regKey, e) : (r.push({ callback: t, regKey: i }), e);
|
|
398
398
|
}
|
|
399
|
-
function
|
|
399
|
+
function Zt(e, t, i) {
|
|
400
400
|
if (!e || !t)
|
|
401
401
|
return e;
|
|
402
|
-
const o =
|
|
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",
|
|
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
|
|
412
|
+
function Ge(...e) {
|
|
413
413
|
if (e.length > 0) {
|
|
414
|
-
const t = globalThis[
|
|
415
|
-
return globalThis[
|
|
414
|
+
const t = globalThis[Pt] || null;
|
|
415
|
+
return globalThis[Pt] = e[0] || null, t;
|
|
416
416
|
}
|
|
417
|
-
return globalThis[
|
|
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, $,
|
|
423
|
-
constructor(e, t,
|
|
424
|
-
rt(this,
|
|
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, $,
|
|
427
|
+
this.signal = e, this.isInitial = !0, this.hasChanged = !1, this.lifecycleRoot = t, at(this, $, i);
|
|
428
428
|
}
|
|
429
429
|
get lifecycleNode() {
|
|
430
|
-
return
|
|
430
|
+
return B(this, $);
|
|
431
431
|
}
|
|
432
432
|
get effectDisposer() {
|
|
433
|
-
return
|
|
433
|
+
return B(this, ot);
|
|
434
434
|
}
|
|
435
435
|
set effectDisposer(e) {
|
|
436
|
-
J(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 !==
|
|
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(),
|
|
441
|
+
}, ot = new WeakMap(), $ = new WeakMap(), G = new WeakSet(), Et = function() {
|
|
442
442
|
var e;
|
|
443
|
-
|
|
444
|
-
},
|
|
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
|
-
|
|
447
|
-
},
|
|
448
|
-
function nt(e, t,
|
|
449
|
-
const o =
|
|
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
|
|
459
|
+
function qt(e, t) {
|
|
460
460
|
e instanceof window.HTMLTemplateElement ? e.content.appendChild(t) : e.appendChild(t);
|
|
461
461
|
}
|
|
462
|
-
var
|
|
463
|
-
function
|
|
464
|
-
return e instanceof Comment && e.data.startsWith(
|
|
462
|
+
var xt = 0, Dt = "__domwisefrag_";
|
|
463
|
+
function ce(e) {
|
|
464
|
+
return e instanceof Comment && e.data.startsWith(Dt);
|
|
465
465
|
}
|
|
466
|
-
function
|
|
467
|
-
return e instanceof DocumentFragment &&
|
|
466
|
+
function Xt(e) {
|
|
467
|
+
return e instanceof DocumentFragment && ce(e.firstChild);
|
|
468
468
|
}
|
|
469
|
-
function
|
|
470
|
-
var
|
|
471
|
-
typeof e.replaceWith == "function" ? e.replaceWith(t) : (
|
|
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
|
|
474
|
-
return e instanceof DocumentFragment ? (++
|
|
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
|
|
477
|
-
let
|
|
476
|
+
function Ve(e, t) {
|
|
477
|
+
let i;
|
|
478
478
|
nt(t, (o) => {
|
|
479
479
|
var u;
|
|
480
480
|
if (o.isInitial) {
|
|
481
|
-
|
|
482
|
-
let
|
|
483
|
-
ut(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 =
|
|
489
|
-
if (
|
|
490
|
-
let
|
|
491
|
-
for (; (
|
|
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 =
|
|
495
|
-
|
|
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 (
|
|
501
|
-
for (const
|
|
502
|
-
ut(e,
|
|
503
|
-
else if (vt(t) ||
|
|
504
|
-
|
|
505
|
-
else if (
|
|
506
|
-
|
|
507
|
-
else if (
|
|
508
|
-
const
|
|
509
|
-
ut(
|
|
510
|
-
} else Z(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
|
|
513
|
-
return e == null || (
|
|
514
|
-
Z(
|
|
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
|
|
517
|
+
function Ze(e, t) {
|
|
518
518
|
if (t == null || t === !1 || t === !0)
|
|
519
519
|
return;
|
|
520
|
-
t =
|
|
521
|
-
const
|
|
522
|
-
for (let o of
|
|
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
|
|
525
|
+
function qe(e, t, i) {
|
|
526
526
|
if (t == null || t === !1) {
|
|
527
|
-
|
|
527
|
+
Ze(e, i);
|
|
528
528
|
return;
|
|
529
529
|
}
|
|
530
|
-
|
|
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
|
-
}) :
|
|
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,
|
|
551
|
+
})), St(e, t, i);
|
|
552
552
|
}
|
|
553
|
-
function St(e, t,
|
|
553
|
+
function St(e, t, i) {
|
|
554
554
|
const o = (st(t) ?? "").split(" ");
|
|
555
|
-
if (
|
|
556
|
-
const r = (st(
|
|
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
|
|
563
|
+
function Xe(e, t) {
|
|
564
564
|
return e + t.charAt(0).toUpperCase() + t.substring(1);
|
|
565
565
|
}
|
|
566
|
-
var
|
|
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((
|
|
613
|
+
return Object.keys(e).forEach((i) => {
|
|
614
614
|
t.forEach((o) => {
|
|
615
|
-
e[
|
|
615
|
+
e[Xe(o, i)] = 0;
|
|
616
616
|
});
|
|
617
617
|
}), e;
|
|
618
618
|
})();
|
|
619
|
-
function
|
|
620
|
-
t.indexOf("-") === 0 ? e.style.setProperty(t,
|
|
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
|
|
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
|
-
|
|
629
|
-
|
|
628
|
+
W(t) && Object.keys(t).forEach((i) => {
|
|
629
|
+
Rt(e, i, "");
|
|
630
630
|
});
|
|
631
631
|
}
|
|
632
632
|
}
|
|
633
|
-
function
|
|
633
|
+
function Qe(e, t, i) {
|
|
634
634
|
if (t == null || t === !1 || t === !0) {
|
|
635
|
-
|
|
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 (
|
|
643
|
-
|
|
642
|
+
if (W(t)) {
|
|
643
|
+
W(i) ? (t = { ...t }, Object.keys(i).forEach((o) => {
|
|
644
644
|
o in t || (t[o] = "");
|
|
645
|
-
})) :
|
|
646
|
-
Z(r) ? nt(r, (h) =>
|
|
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
|
-
}) :
|
|
648
|
+
}) : Rt(e, o, r);
|
|
649
649
|
});
|
|
650
650
|
return;
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
|
-
var
|
|
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, (
|
|
655
|
+
return e.replace(/[A-Z]/g, (i) => t + i.toLowerCase());
|
|
656
656
|
}
|
|
657
|
-
var
|
|
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
|
|
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(
|
|
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(
|
|
686
|
+
it(i) ? e[t] = i : it(o) && (e[t] = "");
|
|
687
687
|
return;
|
|
688
688
|
case "dangerouslySetInnerHTML":
|
|
689
|
-
|
|
689
|
+
W(i) ? e.innerHTML = i.__html : W(o) && (e.innerHTML = "");
|
|
690
690
|
return;
|
|
691
691
|
case "value":
|
|
692
|
-
if (
|
|
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 =
|
|
699
|
+
e.value = i;
|
|
700
700
|
return;
|
|
701
701
|
}
|
|
702
702
|
}
|
|
703
703
|
break;
|
|
704
704
|
case "class":
|
|
705
|
-
|
|
705
|
+
qe(e, i, o);
|
|
706
706
|
return;
|
|
707
707
|
case "spellcheck":
|
|
708
|
-
e.spellcheck =
|
|
708
|
+
e.spellcheck = i === "" || i === !0 || i === "true" ? !0 : i === !1 || i === "false" ? !1 : i;
|
|
709
709
|
return;
|
|
710
710
|
case "draggable":
|
|
711
|
-
|
|
711
|
+
i === !1 || i === "false" ? i = "false" : i === "" ? i = null : (i === !0 || i === "true") && (i = "true");
|
|
712
712
|
break;
|
|
713
713
|
case "contenteditable":
|
|
714
|
-
|
|
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
|
-
|
|
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
|
-
(
|
|
727
|
-
}), Object.entries(
|
|
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(
|
|
738
|
+
e.setAttributeNS(Ke, ht(t, ":"), i);
|
|
739
739
|
return;
|
|
740
740
|
case "xmlnsXlink":
|
|
741
|
-
e.setAttribute("xmlns:xlink",
|
|
741
|
+
e.setAttribute("xmlns:xlink", i);
|
|
742
742
|
return;
|
|
743
743
|
case "xmlBase":
|
|
744
744
|
case "xmlLang":
|
|
745
745
|
case "xmlSpace":
|
|
746
|
-
e.setAttributeNS(
|
|
746
|
+
e.setAttributeNS(Je, ht(t, ":"), i);
|
|
747
747
|
return;
|
|
748
748
|
}
|
|
749
|
-
if (typeof
|
|
749
|
+
if (typeof i == "function") {
|
|
750
750
|
if (t[0] === "o" && t[1] === "n") {
|
|
751
|
-
if (o != null && o ===
|
|
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] =
|
|
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":`,
|
|
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 (
|
|
762
|
-
if (o ===
|
|
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 ===
|
|
767
|
+
if (o === i)
|
|
768
768
|
return;
|
|
769
769
|
e.removeAttribute(t);
|
|
770
770
|
}
|
|
771
771
|
if (o !== !1 && o != null) {
|
|
772
|
-
if (o ===
|
|
772
|
+
if (o === i)
|
|
773
773
|
return;
|
|
774
|
-
e instanceof SVGElement && !
|
|
774
|
+
e instanceof SVGElement && !jt.test(t) ? e.removeAttributeNS(ht(t, "-"), i) : e.removeAttribute(t);
|
|
775
775
|
}
|
|
776
|
-
if (
|
|
777
|
-
e[t] =
|
|
776
|
+
if (W(i)) {
|
|
777
|
+
e[t] = i;
|
|
778
778
|
return;
|
|
779
779
|
}
|
|
780
|
-
if (
|
|
780
|
+
if (i === !0) {
|
|
781
781
|
e.setAttribute(t, "");
|
|
782
782
|
return;
|
|
783
783
|
}
|
|
784
|
-
|
|
784
|
+
i !== !1 && i != null && (e instanceof SVGElement && !jt.test(t) ? e.setAttribute(ht(t, "-"), i) : e.setAttribute(t, i));
|
|
785
785
|
}
|
|
786
|
-
function
|
|
787
|
-
for (let [
|
|
788
|
-
|
|
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
|
-
}) :
|
|
790
|
+
}) : Re(o) ? o[he](e, i) : Kt(e, i, o);
|
|
791
791
|
return e;
|
|
792
792
|
}
|
|
793
|
-
function
|
|
793
|
+
function ii(e) {
|
|
794
794
|
this[e] = null;
|
|
795
795
|
}
|
|
796
|
-
function
|
|
797
|
-
let { children:
|
|
798
|
-
r || (
|
|
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),
|
|
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((
|
|
804
|
-
h.querySelectorAll("option").forEach((
|
|
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
|
-
|
|
807
|
+
Wt(o.ref, h);
|
|
808
808
|
} else if (typeof e == "function")
|
|
809
|
-
|
|
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
|
|
815
|
-
function
|
|
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
|
|
826
|
-
for (et = void 0, gt++;
|
|
827
|
-
var o =
|
|
828
|
-
if (
|
|
829
|
-
|
|
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
|
-
|
|
833
|
+
i = o;
|
|
834
834
|
}
|
|
835
835
|
}
|
|
836
836
|
if (gt = 0, V--, t) throw e;
|
|
837
837
|
}
|
|
838
838
|
}
|
|
839
|
-
var
|
|
840
|
-
function
|
|
841
|
-
var t =
|
|
842
|
-
|
|
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
|
-
|
|
846
|
+
x = t;
|
|
847
847
|
}
|
|
848
848
|
}
|
|
849
|
-
var et = void 0, V = 0, gt = 0,
|
|
850
|
-
function
|
|
851
|
-
if (
|
|
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 !==
|
|
854
|
-
return t = { i: 0, S: e, p:
|
|
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 =
|
|
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
|
|
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
|
-
|
|
863
|
-
|
|
862
|
+
F.prototype.brand = si;
|
|
863
|
+
F.prototype.h = function() {
|
|
864
864
|
return !0;
|
|
865
865
|
};
|
|
866
|
-
|
|
867
|
-
var t = this,
|
|
868
|
-
|
|
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
|
-
|
|
873
|
+
F.prototype.U = function(e) {
|
|
874
874
|
var t = this;
|
|
875
875
|
if (this.t !== void 0) {
|
|
876
|
-
var
|
|
877
|
-
|
|
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
|
-
|
|
883
|
+
F.prototype.subscribe = function(e) {
|
|
884
884
|
var t = this;
|
|
885
|
-
return
|
|
886
|
-
var
|
|
887
|
-
|
|
885
|
+
return oi(function() {
|
|
886
|
+
var i = t.value, o = x;
|
|
887
|
+
x = void 0;
|
|
888
888
|
try {
|
|
889
|
-
e(
|
|
889
|
+
e(i);
|
|
890
890
|
} finally {
|
|
891
|
-
|
|
891
|
+
x = o;
|
|
892
892
|
}
|
|
893
893
|
}, { name: "sub" });
|
|
894
894
|
};
|
|
895
|
-
|
|
895
|
+
F.prototype.valueOf = function() {
|
|
896
896
|
return this.value;
|
|
897
897
|
};
|
|
898
|
-
|
|
898
|
+
F.prototype.toString = function() {
|
|
899
899
|
return this.value + "";
|
|
900
900
|
};
|
|
901
|
-
|
|
901
|
+
F.prototype.toJSON = function() {
|
|
902
902
|
return this.value;
|
|
903
903
|
};
|
|
904
|
-
|
|
905
|
-
var e =
|
|
906
|
-
|
|
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
|
-
|
|
910
|
+
x = e;
|
|
911
911
|
}
|
|
912
912
|
};
|
|
913
|
-
Object.defineProperty(
|
|
914
|
-
var e =
|
|
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(
|
|
920
|
-
V !== 0 && gt === 0 &&
|
|
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
|
-
|
|
925
|
+
Ht();
|
|
926
926
|
}
|
|
927
927
|
}
|
|
928
928
|
} });
|
|
929
|
-
function
|
|
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
|
|
933
|
+
function fe(e) {
|
|
934
934
|
for (var t = e.s; t !== void 0; t = t.n) {
|
|
935
|
-
var
|
|
936
|
-
if (
|
|
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
|
|
943
|
-
for (var t = e.s,
|
|
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)) :
|
|
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 =
|
|
947
|
+
e.s = i;
|
|
948
948
|
}
|
|
949
949
|
function Y(e, t) {
|
|
950
|
-
|
|
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
|
|
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 && !
|
|
956
|
+
if (this.g = ft, this.f |= 1, this.i > 0 && !pe(this))
|
|
957
957
|
return this.f &= -2, !0;
|
|
958
|
-
var e =
|
|
958
|
+
var e = x;
|
|
959
959
|
try {
|
|
960
|
-
|
|
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 (
|
|
964
|
-
this.v =
|
|
963
|
+
} catch (i) {
|
|
964
|
+
this.v = i, this.f |= 16, this.i++;
|
|
965
965
|
}
|
|
966
|
-
return
|
|
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
|
-
|
|
973
|
+
F.prototype.S.call(this, e);
|
|
974
974
|
};
|
|
975
975
|
Y.prototype.U = function(e) {
|
|
976
|
-
if (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 =
|
|
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
|
|
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
|
|
998
|
-
|
|
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,
|
|
1002
|
+
throw e.f &= -2, e.f |= 8, Bt(e), o;
|
|
1003
1003
|
} finally {
|
|
1004
|
-
|
|
1004
|
+
x = i, Ht();
|
|
1005
1005
|
}
|
|
1006
1006
|
}
|
|
1007
1007
|
}
|
|
1008
|
-
function
|
|
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,
|
|
1010
|
+
e.x = void 0, e.s = void 0, we(e);
|
|
1011
1011
|
}
|
|
1012
|
-
function
|
|
1013
|
-
if (
|
|
1014
|
-
|
|
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,
|
|
1032
|
-
var e =
|
|
1033
|
-
return
|
|
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 ||
|
|
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
|
|
1045
|
-
var
|
|
1044
|
+
function oi(e, t) {
|
|
1045
|
+
var i = new Q(e, t);
|
|
1046
1046
|
try {
|
|
1047
|
-
|
|
1047
|
+
i.c();
|
|
1048
1048
|
} catch (r) {
|
|
1049
|
-
throw
|
|
1049
|
+
throw i.d(), r;
|
|
1050
1050
|
}
|
|
1051
|
-
var o =
|
|
1051
|
+
var o = i.d.bind(i);
|
|
1052
1052
|
return o[Symbol.dispose] = o, o;
|
|
1053
1053
|
}
|
|
1054
|
-
const
|
|
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
|
-
},
|
|
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:
|
|
1086
|
-
tr:
|
|
1085
|
+
en: ri,
|
|
1086
|
+
tr: ai
|
|
1087
1087
|
};
|
|
1088
|
-
function
|
|
1088
|
+
function ve(e = {}) {
|
|
1089
1089
|
var r;
|
|
1090
|
-
const t = e.locale ?? "en",
|
|
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
|
-
...
|
|
1093
|
+
...i,
|
|
1094
1094
|
...o
|
|
1095
1095
|
};
|
|
1096
1096
|
}
|
|
1097
|
-
function
|
|
1098
|
-
const t = w(() =>
|
|
1099
|
-
return /* @__PURE__ */
|
|
1100
|
-
/* @__PURE__ */
|
|
1101
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1111
|
-
/* @__PURE__ */
|
|
1112
|
-
/* @__PURE__ */
|
|
1113
|
-
/* @__PURE__ */
|
|
1114
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
1128
|
-
/* @__PURE__ */
|
|
1129
|
-
/* @__PURE__ */
|
|
1130
|
-
/* @__PURE__ */
|
|
1131
|
-
/* @__PURE__ */
|
|
1132
|
-
/* @__PURE__ */
|
|
1133
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
1147
|
-
/* @__PURE__ */
|
|
1148
|
-
/* @__PURE__ */
|
|
1149
|
-
/* @__PURE__ */
|
|
1150
|
-
/* @__PURE__ */
|
|
1151
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
1166
|
-
/* @__PURE__ */
|
|
1167
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
1175
|
-
/* @__PURE__ */
|
|
1176
|
-
/* @__PURE__ */
|
|
1177
|
-
const
|
|
1178
|
-
if (e.store.isSingleMode.value ||
|
|
1179
|
-
return `${
|
|
1180
|
-
const r =
|
|
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__ */
|
|
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__ */
|
|
1186
|
-
/* @__PURE__ */
|
|
1187
|
-
/* @__PURE__ */
|
|
1188
|
-
/* @__PURE__ */
|
|
1189
|
-
/* @__PURE__ */
|
|
1190
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
1201
|
-
/* @__PURE__ */
|
|
1202
|
-
/* @__PURE__ */
|
|
1203
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1208
|
-
w(() => e.store.allowDownload.value && e.store.hasDownloadUrl.value && e.onDownload ? /* @__PURE__ */
|
|
1209
|
-
/* @__PURE__ */
|
|
1210
|
-
/* @__PURE__ */
|
|
1211
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
1224
|
-
/* @__PURE__ */
|
|
1225
|
-
/* @__PURE__ */
|
|
1226
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1229
|
-
/* @__PURE__ */
|
|
1230
|
-
/* @__PURE__ */
|
|
1231
|
-
/* @__PURE__ */
|
|
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
|
|
1240
|
-
return /* @__PURE__ */
|
|
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 ===
|
|
1244
|
+
return r === i;
|
|
1245
1245
|
const h = r % 2 === 1 ? r : r - 1;
|
|
1246
|
-
return
|
|
1246
|
+
return i === h || i === h + 1;
|
|
1247
1247
|
};
|
|
1248
|
-
return /* @__PURE__ */
|
|
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 ${
|
|
1254
|
+
"aria-label": `Go to page ${i + 1}`,
|
|
1255
1255
|
"aria-current": w(() => o() ? "page" : void 0),
|
|
1256
|
-
onClick: () => e.onThumbClick(
|
|
1256
|
+
onClick: () => e.onThumbClick(i),
|
|
1257
1257
|
onKeyDown: (r) => {
|
|
1258
|
-
(r.key === "Enter" || r.key === " ") && (r.preventDefault(), e.onThumbClick(
|
|
1258
|
+
(r.key === "Enter" || r.key === " ") && (r.preventDefault(), e.onThumbClick(i));
|
|
1259
1259
|
},
|
|
1260
|
-
children: [
|
|
1261
|
-
/* @__PURE__ */
|
|
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 ${
|
|
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__ */
|
|
1275
|
-
]
|
|
1273
|
+
),
|
|
1274
|
+
/* @__PURE__ */ g("span", { class: "thumb-page-number", children: i + 1 })
|
|
1275
|
+
] })
|
|
1276
1276
|
}
|
|
1277
1277
|
);
|
|
1278
1278
|
}) });
|
|
1279
1279
|
}
|
|
1280
|
-
function
|
|
1281
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
1284
|
-
/* @__PURE__ */
|
|
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: () =>
|
|
1290
|
+
onClick: () => i(o.pageIndex),
|
|
1291
1291
|
children: [
|
|
1292
|
-
/* @__PURE__ */
|
|
1293
|
-
/* @__PURE__ */
|
|
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 ?
|
|
1297
|
+
(r = o.children) != null && r.length ? ye(o.children, t, i) : null
|
|
1298
1298
|
] });
|
|
1299
1299
|
}) });
|
|
1300
1300
|
}
|
|
1301
|
-
function
|
|
1302
|
-
const t = w(() =>
|
|
1303
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
1311
|
-
|
|
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
|
|
1317
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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,
|
|
1340
|
-
const o =
|
|
1341
|
-
return /* @__PURE__ */
|
|
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 ${
|
|
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":
|
|
1347
|
-
children: /* @__PURE__ */
|
|
1348
|
-
/* @__PURE__ */
|
|
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 ${
|
|
1355
|
+
alt: `Page ${i + 1}`,
|
|
1356
1356
|
loading: "lazy"
|
|
1357
1357
|
}
|
|
1358
1358
|
),
|
|
1359
|
-
/* @__PURE__ */
|
|
1359
|
+
/* @__PURE__ */ g("div", { class: "page-shadow" })
|
|
1360
1360
|
] })
|
|
1361
1361
|
}
|
|
1362
1362
|
);
|
|
1363
1363
|
})
|
|
1364
1364
|
}
|
|
1365
1365
|
),
|
|
1366
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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
|
|
1393
|
-
const t = w(() => e.store.showArrows.value && e.store.currentPage.value > 0),
|
|
1394
|
-
return /* @__PURE__ */
|
|
1395
|
-
/* @__PURE__ */
|
|
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__ */
|
|
1405
|
+
children: /* @__PURE__ */ g("div", { class: "bk-arrow-icon bk-arrow-left" })
|
|
1406
1406
|
}
|
|
1407
1407
|
),
|
|
1408
|
-
/* @__PURE__ */
|
|
1408
|
+
/* @__PURE__ */ g(
|
|
1409
1409
|
"button",
|
|
1410
1410
|
{
|
|
1411
1411
|
type: "button",
|
|
1412
1412
|
class: "bk-nav-arrow bk-nav-next",
|
|
1413
|
-
style: w(() =>
|
|
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__ */
|
|
1418
|
+
children: /* @__PURE__ */ g("div", { class: "bk-arrow-icon bk-arrow-right" })
|
|
1419
1419
|
}
|
|
1420
1420
|
)
|
|
1421
1421
|
] });
|
|
1422
1422
|
}
|
|
1423
|
-
function
|
|
1423
|
+
function gi(e) {
|
|
1424
1424
|
const t = () => {
|
|
1425
1425
|
e.store.showThumbs.value = !e.store.showThumbs.value;
|
|
1426
|
-
},
|
|
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
|
-
},
|
|
1438
|
+
}, c = () => e.onToggleFullscreen(), b = (S) => {
|
|
1439
1439
|
e.store.currentPage.value = S, e.store.showToc.value = !1;
|
|
1440
|
-
},
|
|
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
|
-
},
|
|
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__ */
|
|
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__ */
|
|
1456
|
-
/* @__PURE__ */
|
|
1457
|
-
|
|
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__ */
|
|
1466
|
-
|
|
1465
|
+
/* @__PURE__ */ g(
|
|
1466
|
+
ui,
|
|
1467
1467
|
{
|
|
1468
1468
|
store: e.store,
|
|
1469
1469
|
onPrevPage: I,
|
|
1470
|
-
onNextPage:
|
|
1470
|
+
onNextPage: k
|
|
1471
1471
|
}
|
|
1472
1472
|
),
|
|
1473
|
-
e.store.whiteLabel.value ? null : /* @__PURE__ */
|
|
1473
|
+
e.store.whiteLabel.value ? null : /* @__PURE__ */ g("div", { class: "bk-watermark", children: [
|
|
1474
1474
|
"Powered by ",
|
|
1475
|
-
/* @__PURE__ */
|
|
1475
|
+
/* @__PURE__ */ g("a", { href: "https://flipbookengine.com", target: "_blank", rel: "noopener", style: "text-decoration: underline;", children: "FlipbookEngine" })
|
|
1476
1476
|
] }),
|
|
1477
|
-
/* @__PURE__ */
|
|
1477
|
+
/* @__PURE__ */ g(ci, { store: e.store, onEntryClick: b })
|
|
1478
1478
|
] }),
|
|
1479
|
-
/* @__PURE__ */
|
|
1480
|
-
|
|
1479
|
+
/* @__PURE__ */ g(
|
|
1480
|
+
hi,
|
|
1481
1481
|
{
|
|
1482
1482
|
store: e.store,
|
|
1483
1483
|
onToggleThumbs: t,
|
|
1484
|
-
onToggleToc:
|
|
1484
|
+
onToggleToc: i,
|
|
1485
1485
|
onToggleSingleMode: o,
|
|
1486
1486
|
onZoomIn: h,
|
|
1487
1487
|
onZoomOut: u,
|
|
1488
1488
|
onDownload: e.onDownload,
|
|
1489
|
-
onNextPage:
|
|
1489
|
+
onNextPage: k,
|
|
1490
1490
|
onPrevPage: I,
|
|
1491
1491
|
onSoundToggle: () => e.store.soundEnabled.value = !e.store.soundEnabled.value,
|
|
1492
1492
|
onToggleAutoPlay: r,
|
|
1493
|
-
onToggleFullscreen:
|
|
1493
|
+
onToggleFullscreen: c
|
|
1494
1494
|
}
|
|
1495
1495
|
),
|
|
1496
|
-
/* @__PURE__ */
|
|
1497
|
-
|
|
1496
|
+
/* @__PURE__ */ g(
|
|
1497
|
+
li,
|
|
1498
1498
|
{
|
|
1499
1499
|
store: e.store,
|
|
1500
|
-
onThumbClick:
|
|
1500
|
+
onThumbClick: P
|
|
1501
1501
|
}
|
|
1502
1502
|
)
|
|
1503
1503
|
]
|
|
1504
1504
|
}
|
|
1505
1505
|
);
|
|
1506
1506
|
}
|
|
1507
|
-
var
|
|
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(
|
|
1509
|
+
(function(i, o) {
|
|
1510
1510
|
o(t);
|
|
1511
|
-
})(
|
|
1511
|
+
})(pi, function(i) {
|
|
1512
1512
|
class o {
|
|
1513
|
-
constructor(
|
|
1514
|
-
this.state = { angle: 0, area: [], position: { x: 0, y: 0 }, hardAngle: 0, hardDrawingAngle: 0 }, this.createdDensity = n, this.nowDrawingDensity = this.createdDensity, this.render =
|
|
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(
|
|
1517
|
-
this.createdDensity =
|
|
1516
|
+
setDensity(s) {
|
|
1517
|
+
this.createdDensity = s, this.nowDrawingDensity = s;
|
|
1518
1518
|
}
|
|
1519
|
-
setDrawingDensity(
|
|
1520
|
-
this.nowDrawingDensity =
|
|
1519
|
+
setDrawingDensity(s) {
|
|
1520
|
+
this.nowDrawingDensity = s;
|
|
1521
1521
|
}
|
|
1522
|
-
setPosition(
|
|
1523
|
-
this.state.position =
|
|
1522
|
+
setPosition(s) {
|
|
1523
|
+
this.state.position = s;
|
|
1524
1524
|
}
|
|
1525
|
-
setAngle(
|
|
1526
|
-
this.state.angle =
|
|
1525
|
+
setAngle(s) {
|
|
1526
|
+
this.state.angle = s;
|
|
1527
1527
|
}
|
|
1528
|
-
setArea(
|
|
1529
|
-
this.state.area =
|
|
1528
|
+
setArea(s) {
|
|
1529
|
+
this.state.area = s;
|
|
1530
1530
|
}
|
|
1531
|
-
setHardDrawingAngle(
|
|
1532
|
-
this.state.hardDrawingAngle =
|
|
1531
|
+
setHardDrawingAngle(s) {
|
|
1532
|
+
this.state.hardDrawingAngle = s;
|
|
1533
1533
|
}
|
|
1534
|
-
setHardAngle(
|
|
1535
|
-
this.state.hardAngle =
|
|
1534
|
+
setHardAngle(s) {
|
|
1535
|
+
this.state.hardAngle = s, this.state.hardDrawingAngle = s;
|
|
1536
1536
|
}
|
|
1537
|
-
setOrientation(
|
|
1538
|
-
this.orientation =
|
|
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(
|
|
1552
|
-
super(
|
|
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(
|
|
1555
|
-
const n = this.render.getContext(), a = this.render.convertToGlobal(this.state.position), l = this.render.getRect().pageWidth,
|
|
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
|
|
1558
|
-
n.rotate(this.state.angle), n.clip(), this.isLoad ? n.drawImage(this.image, 0, 0, l,
|
|
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(
|
|
1561
|
-
const n = this.render.getRect(), a = this.render.getContext(), l = n.pageWidth,
|
|
1562
|
-
this.isLoad ? a.drawImage(this.image,
|
|
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(
|
|
1565
|
-
|
|
1566
|
-
const
|
|
1567
|
-
|
|
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(
|
|
1585
|
-
this.pages = [], this.currentPageIndex = 0, this.currentSpreadIndex = 0, this.landscapeSpread = [], this.portraitSpread = [], this.render = n, this.app =
|
|
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
|
|
1594
|
-
this.isShowCover && (this.pages[0].setDensity("hard"), this.landscapeSpread.push([
|
|
1595
|
-
for (let n =
|
|
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(
|
|
1600
|
+
getSpreadIndexByPage(s) {
|
|
1601
1601
|
const n = this.getSpread();
|
|
1602
|
-
for (let a = 0; a < n.length; a++) if (
|
|
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(
|
|
1612
|
-
if (
|
|
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(
|
|
1616
|
-
const n = this.pages.indexOf(
|
|
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(
|
|
1620
|
-
const n = this.pages.indexOf(
|
|
1619
|
+
prevBy(s) {
|
|
1620
|
+
const n = this.pages.indexOf(s);
|
|
1621
1621
|
return n > 0 ? this.pages[n - 1] : null;
|
|
1622
1622
|
}
|
|
1623
|
-
getFlippingPage(
|
|
1623
|
+
getFlippingPage(s) {
|
|
1624
1624
|
const n = this.currentSpreadIndex;
|
|
1625
|
-
if (this.render.getOrientation() === "portrait") return
|
|
1625
|
+
if (this.render.getOrientation() === "portrait") return s === 0 ? this.pages[n].newTemporaryCopy() : this.pages[n - 1];
|
|
1626
1626
|
{
|
|
1627
|
-
const a =
|
|
1628
|
-
return a.length === 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(
|
|
1631
|
+
getBottomPage(s) {
|
|
1632
1632
|
const n = this.currentSpreadIndex;
|
|
1633
|
-
if (this.render.getOrientation() === "portrait") return
|
|
1633
|
+
if (this.render.getOrientation() === "portrait") return s === 0 ? this.pages[n + 1] : this.pages[n - 1];
|
|
1634
1634
|
{
|
|
1635
|
-
const a =
|
|
1636
|
-
return a.length === 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(
|
|
1649
|
-
if (
|
|
1650
|
-
const n = this.getSpreadIndexByPage(
|
|
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(
|
|
1657
|
-
if (!(
|
|
1658
|
-
this.currentSpreadIndex =
|
|
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
|
|
1662
|
-
|
|
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(
|
|
1667
|
-
super(
|
|
1666
|
+
constructor(s, n, a) {
|
|
1667
|
+
super(s, n), this.imagesHref = a;
|
|
1668
1668
|
}
|
|
1669
1669
|
load() {
|
|
1670
|
-
for (const
|
|
1671
|
-
const n = new r(this.render,
|
|
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
|
|
1678
|
-
static GetDistanceBetweenTwoPoint(
|
|
1679
|
-
return
|
|
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(
|
|
1682
|
-
return
|
|
1681
|
+
static GetSegmentLength(s) {
|
|
1682
|
+
return c.GetDistanceBetweenTwoPoint(s[0], s[1]);
|
|
1683
1683
|
}
|
|
1684
|
-
static GetAngleBetweenTwoLine(
|
|
1685
|
-
const a =
|
|
1686
|
-
return Math.acos((a * l +
|
|
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(
|
|
1689
|
-
return n === null ? null : n.x >=
|
|
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(
|
|
1692
|
-
return { x:
|
|
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(
|
|
1695
|
-
if (
|
|
1696
|
-
const l =
|
|
1697
|
-
let f = Math.sqrt(Math.pow(n, 2) * Math.pow(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
|
|
1700
|
-
return l -
|
|
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(
|
|
1703
|
-
return
|
|
1702
|
+
static GetIntersectBetweenTwoSegment(s, n, a) {
|
|
1703
|
+
return c.PointInRect(s, c.GetIntersectBeetwenTwoLine(n, a));
|
|
1704
1704
|
}
|
|
1705
|
-
static GetIntersectBeetwenTwoLine(
|
|
1706
|
-
const a =
|
|
1707
|
-
if (isFinite(
|
|
1708
|
-
if (Math.abs(
|
|
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(
|
|
1712
|
-
const a = Math.abs(
|
|
1713
|
-
function y(f,
|
|
1714
|
-
return
|
|
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 <=
|
|
1717
|
-
return
|
|
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(
|
|
1722
|
-
super(
|
|
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(
|
|
1734
|
-
const n =
|
|
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
|
|
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: ${
|
|
1742
|
+
height: ${d}px;
|
|
1743
1743
|
`;
|
|
1744
|
-
n === "hard" ? this.drawHard(
|
|
1744
|
+
n === "hard" ? this.drawHard(p) : this.drawSoft(a, p);
|
|
1745
1745
|
}
|
|
1746
|
-
drawHard(
|
|
1747
|
-
const n = this.render.getRect().left + this.render.getRect().width / 2, a = this.state.hardDrawingAngle, l =
|
|
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(
|
|
1757
|
+
drawSoft(s, n = "") {
|
|
1758
1758
|
let a = "polygon( ";
|
|
1759
|
-
for (const
|
|
1760
|
-
let
|
|
1761
|
-
|
|
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(${
|
|
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(
|
|
1768
|
-
const n = this.render.getRect(), a = n.pageWidth, l = n.height,
|
|
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: ${
|
|
1774
|
-
top: ${
|
|
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(
|
|
1785
|
-
super.setOrientation(
|
|
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(
|
|
1788
|
-
this.element.classList.remove("--soft", "--hard"), this.element.classList.add("--" +
|
|
1787
|
+
setDrawingDensity(s) {
|
|
1788
|
+
this.element.classList.remove("--soft", "--hard"), this.element.classList.add("--" + s), super.setDrawingDensity(s);
|
|
1789
1789
|
}
|
|
1790
1790
|
}
|
|
1791
|
-
class
|
|
1792
|
-
constructor(
|
|
1793
|
-
super(
|
|
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
|
|
1797
|
-
const n = new b(this.render,
|
|
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
|
|
1804
|
-
constructor(
|
|
1805
|
-
this.direction =
|
|
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(
|
|
1807
|
+
calc(s) {
|
|
1808
1808
|
try {
|
|
1809
|
-
return this.position = this.calcAngleAndPosition(
|
|
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
|
|
1815
|
+
const s = [];
|
|
1816
1816
|
let n = !1;
|
|
1817
|
-
return
|
|
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
|
|
1821
|
-
return
|
|
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
|
|
1852
|
-
return this.direction === 0 ?
|
|
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(
|
|
1855
|
-
let n =
|
|
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(
|
|
1860
|
-
this.angle = this.calculateAngle(
|
|
1859
|
+
updateAngleAndGeometry(s) {
|
|
1860
|
+
this.angle = this.calculateAngle(s), this.rect = this.getPageRect(s);
|
|
1861
1861
|
}
|
|
1862
|
-
calculateAngle(
|
|
1863
|
-
const n = this.pageWidth -
|
|
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
|
|
1867
|
-
if (!isFinite(l) ||
|
|
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(
|
|
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 }],
|
|
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(
|
|
1874
|
-
return { topLeft: this.getRotatedPoint(
|
|
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(
|
|
1877
|
-
return { x:
|
|
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(
|
|
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 =
|
|
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(
|
|
1884
|
-
let l =
|
|
1885
|
-
const
|
|
1886
|
-
l !==
|
|
1887
|
-
const
|
|
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
|
|
1891
|
-
|
|
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
|
|
1897
|
-
return [
|
|
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(
|
|
1902
|
-
this.flippingPage = null, this.bottomPage = null, this.calc = null, this.state = "read", this.render =
|
|
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(
|
|
1905
|
-
this.setState("user_fold"), this.calc === null && this.start(
|
|
1904
|
+
fold(s) {
|
|
1905
|
+
this.setState("user_fold"), this.calc === null && this.start(s), this.do(this.render.convertToPage(s));
|
|
1906
1906
|
}
|
|
1907
|
-
flip(
|
|
1908
|
-
if (this.app.getSettings().disableFlipByClick && !this.isPointOnCorners(
|
|
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,
|
|
1912
|
-
this.calc.calc({ x: n.pageWidth - a, y: l }), this.animateFlippingTo({ x: n.pageWidth - a, y: l }, { x: -n.pageWidth, y:
|
|
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(
|
|
1914
|
+
start(s) {
|
|
1915
1915
|
this.reset();
|
|
1916
|
-
const n = this.render.convertToBook(
|
|
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
|
|
1921
|
-
|
|
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
|
|
1924
|
-
|
|
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
|
|
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(
|
|
1932
|
-
if (this.calc !== null && this.calc.calc(
|
|
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(
|
|
1938
|
-
const a = this.app.getPageCollection().getCurrentSpreadIndex(), l = this.app.getPageCollection().getSpreadIndexByPage(
|
|
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(
|
|
1945
|
-
this.flip({ x: this.render.getRect().left + 2 * this.render.getRect().pageWidth - 10, y:
|
|
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(
|
|
1948
|
-
this.flip({ x: 10, y:
|
|
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
|
|
1953
|
-
|
|
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(
|
|
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(
|
|
1959
|
-
if (!this.start(
|
|
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,
|
|
1962
|
-
this.animateFlippingTo({ x: a - 1, y:
|
|
1963
|
-
} else this.do(this.render.convertToPage(
|
|
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(
|
|
1967
|
-
const
|
|
1968
|
-
for (const f of
|
|
1969
|
-
const y = this.getAnimationDuration(
|
|
1970
|
-
this.render.startAnimation(
|
|
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(
|
|
1981
|
-
this.state !==
|
|
1980
|
+
setState(s) {
|
|
1981
|
+
this.state !== s && (this.app.updateState(s), this.state = s);
|
|
1982
1982
|
}
|
|
1983
|
-
getDirectionByPoint(
|
|
1983
|
+
getDirectionByPoint(s) {
|
|
1984
1984
|
const n = this.getBoundsRect();
|
|
1985
1985
|
if (this.render.getOrientation() === "portrait") {
|
|
1986
|
-
if (
|
|
1987
|
-
} else if (
|
|
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(
|
|
1990
|
+
getAnimationDuration(s) {
|
|
1991
1991
|
const n = this.app.getSettings().flippingTime;
|
|
1992
|
-
return
|
|
1992
|
+
return s >= 1e3 ? n : s / 1e3 * n;
|
|
1993
1993
|
}
|
|
1994
|
-
checkDirection(
|
|
1995
|
-
return
|
|
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(...
|
|
2004
|
-
for (const n of
|
|
2003
|
+
checkState(...s) {
|
|
2004
|
+
for (const n of s) if (this.state === n) return !0;
|
|
2005
2005
|
return !1;
|
|
2006
2006
|
}
|
|
2007
|
-
isPointOnCorners(
|
|
2008
|
-
const n = this.getBoundsRect(), a = n.pageWidth, l = Math.sqrt(Math.pow(a, 2) + Math.pow(n.height, 2)) / 5,
|
|
2009
|
-
return
|
|
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(
|
|
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 =
|
|
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(
|
|
2018
|
+
render(s) {
|
|
2019
2019
|
if (this.animation !== null) {
|
|
2020
|
-
const n = Math.round((
|
|
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 =
|
|
2023
|
+
this.timer = s, this.drawFrame();
|
|
2024
2024
|
}
|
|
2025
2025
|
start() {
|
|
2026
2026
|
this.update();
|
|
2027
|
-
const
|
|
2028
|
-
this.render(n), requestAnimationFrame(
|
|
2027
|
+
const s = (n) => {
|
|
2028
|
+
this.render(n), requestAnimationFrame(s);
|
|
2029
2029
|
};
|
|
2030
|
-
requestAnimationFrame(
|
|
2030
|
+
requestAnimationFrame(s);
|
|
2031
2031
|
}
|
|
2032
|
-
startAnimation(
|
|
2033
|
-
this.finishAnimation(), this.animation = { frames:
|
|
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
|
|
2041
|
-
this.orientation !==
|
|
2040
|
+
const s = this.calculateBoundsRect();
|
|
2041
|
+
this.orientation !== s && (this.orientation = s, this.app.updateOrientation(s));
|
|
2042
2042
|
}
|
|
2043
2043
|
calculateBoundsRect() {
|
|
2044
|
-
let
|
|
2045
|
-
const n = this.getBlockWidth(), a = n / 2, l = this.getBlockHeight() / 2,
|
|
2046
|
-
let
|
|
2047
|
-
return this.setting.size === "stretch" ? (n < 2 * this.setting.minWidth && this.app.getSettings().usePortrait && (
|
|
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(
|
|
2049
|
+
setShadowData(s, n, a, l) {
|
|
2050
2050
|
if (!this.app.getSettings().drawShadow) return;
|
|
2051
|
-
const
|
|
2052
|
-
this.shadow = { pos:
|
|
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(
|
|
2076
|
-
this.pageRect =
|
|
2075
|
+
setPageRect(s) {
|
|
2076
|
+
this.pageRect = s;
|
|
2077
2077
|
}
|
|
2078
|
-
setDirection(
|
|
2079
|
-
this.direction =
|
|
2078
|
+
setDirection(s) {
|
|
2079
|
+
this.direction = s;
|
|
2080
2080
|
}
|
|
2081
|
-
setRightPage(
|
|
2082
|
-
|
|
2081
|
+
setRightPage(s) {
|
|
2082
|
+
s !== null && s.setOrientation(1), this.rightPage = s;
|
|
2083
2083
|
}
|
|
2084
|
-
setLeftPage(
|
|
2085
|
-
|
|
2084
|
+
setLeftPage(s) {
|
|
2085
|
+
s !== null && s.setOrientation(0), this.leftPage = s;
|
|
2086
2086
|
}
|
|
2087
|
-
setBottomPage(
|
|
2088
|
-
|
|
2087
|
+
setBottomPage(s) {
|
|
2088
|
+
s !== null && s.setOrientation(this.direction === 1 ? 0 : 1), this.bottomPage = s;
|
|
2089
2089
|
}
|
|
2090
|
-
setFlippingPage(
|
|
2091
|
-
|
|
2090
|
+
setFlippingPage(s) {
|
|
2091
|
+
s !== null && s.setOrientation(this.direction === 0 && this.orientation !== "portrait" ? 0 : 1), this.flippingPage = s;
|
|
2092
2092
|
}
|
|
2093
|
-
convertToBook(
|
|
2093
|
+
convertToBook(s) {
|
|
2094
2094
|
const n = this.getRect();
|
|
2095
|
-
return { x:
|
|
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(
|
|
2100
|
+
convertToPage(s, n) {
|
|
2101
2101
|
n || (n = this.direction);
|
|
2102
2102
|
const a = this.getRect();
|
|
2103
|
-
return { x: n === 0 ?
|
|
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(
|
|
2106
|
-
if (n || (n = this.direction),
|
|
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 ?
|
|
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(
|
|
2111
|
-
return n || (n = this.direction), { topLeft: this.convertToGlobal(
|
|
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(
|
|
2116
|
-
super(
|
|
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
|
|
2126
|
-
this.orientation === "portrait" && (this.ctx.beginPath(), this.ctx.rect(
|
|
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
|
|
2129
|
+
const s = this.getRect();
|
|
2130
2130
|
this.ctx.save(), this.ctx.beginPath();
|
|
2131
|
-
const n =
|
|
2132
|
-
this.ctx.rect(
|
|
2133
|
-
const a = { x:
|
|
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 *
|
|
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
|
|
2140
|
-
this.ctx.save(), this.ctx.beginPath(), this.ctx.rect(
|
|
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 *
|
|
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
|
|
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,
|
|
2152
|
-
this.shadow.direction === 0 ? (this.ctx.translate(-l, -100),
|
|
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
|
|
2159
|
-
constructor(
|
|
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 = (
|
|
2163
|
-
if (this.checkTarget(
|
|
2164
|
-
const
|
|
2165
|
-
this.app.startUserTouch(
|
|
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 = (
|
|
2168
|
-
if (this.checkTarget(
|
|
2169
|
-
const
|
|
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 ||
|
|
2172
|
+
}, this.swipeTimeout), this.app.getSettings().mobileScrollSupport || d.preventDefault();
|
|
2173
2173
|
}
|
|
2174
|
-
}, this.onMouseUp = (
|
|
2175
|
-
const
|
|
2176
|
-
this.app.userStop(
|
|
2177
|
-
}, this.onMouseMove = (
|
|
2178
|
-
const
|
|
2179
|
-
this.app.userMove(
|
|
2180
|
-
}, this.onTouchMove = (
|
|
2181
|
-
if (
|
|
2182
|
-
const
|
|
2183
|
-
this.app.getSettings().mobileScrollSupport ? (this.touchPoint !== null && (Math.abs(this.touchPoint.point.x - y.x) > 10 || this.app.getState() !== "read") &&
|
|
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 = (
|
|
2186
|
-
if (
|
|
2187
|
-
const
|
|
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
|
|
2191
|
-
Math.abs(
|
|
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 =
|
|
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
|
-
|
|
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(
|
|
2209
|
-
this.wrapper.classList.remove("--portrait", "--landscape"),
|
|
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(
|
|
2217
|
+
getMousePos(s, n) {
|
|
2218
2218
|
const a = this.distElement.getBoundingClientRect();
|
|
2219
|
-
return { x:
|
|
2219
|
+
return { x: s - a.left, y: n - a.top };
|
|
2220
2220
|
}
|
|
2221
|
-
checkTarget(
|
|
2222
|
-
return !this.app.getSettings().clickEventForward || !["a", "button"].includes(
|
|
2221
|
+
checkTarget(s) {
|
|
2222
|
+
return !this.app.getSettings().clickEventForward || !["a", "button"].includes(s.tagName.toLowerCase());
|
|
2223
2223
|
}
|
|
2224
2224
|
}
|
|
2225
|
-
class
|
|
2226
|
-
constructor(
|
|
2227
|
-
super(
|
|
2228
|
-
for (const
|
|
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
|
|
2232
|
+
for (const s of this.items) this.parentElement.appendChild(s);
|
|
2233
2233
|
}
|
|
2234
|
-
updateItems(
|
|
2234
|
+
updateItems(s) {
|
|
2235
2235
|
this.removeHandlers(), this.distElement.innerHTML = "";
|
|
2236
|
-
for (const n of
|
|
2237
|
-
this.items =
|
|
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
|
|
2244
|
-
constructor(
|
|
2245
|
-
super(
|
|
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
|
|
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(
|
|
2260
|
-
super(
|
|
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
|
|
2276
|
-
let a = (100 - n) * (2.5 *
|
|
2277
|
-
a >
|
|
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: ${
|
|
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: ${
|
|
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
|
|
2293
|
-
let n = (100 - (this.shadow.progress > 100 ? 200 - this.shadow.progress : this.shadow.progress)) * (2.5 *
|
|
2294
|
-
n >
|
|
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: ${
|
|
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: ${
|
|
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
|
|
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
|
|
2311
|
-
|
|
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
|
|
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 *
|
|
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(${
|
|
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 =
|
|
2329
|
+
this.innerShadow.style.cssText = E;
|
|
2330
2330
|
}
|
|
2331
2331
|
drawOuterShadow() {
|
|
2332
|
-
const
|
|
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
|
|
2335
|
-
let R = this.getDirection() === 1 ? { x: -
|
|
2336
|
-
R =
|
|
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 *
|
|
2344
|
-
background: linear-gradient(${
|
|
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
|
|
2361
|
-
this.orientation === "portrait" && this.direction === 1 || (this.bottomPage.getElement().style.zIndex = (this.getSettings().startZIndex + 3).toString(10), this.bottomPage.draw(
|
|
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
|
|
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(
|
|
2377
|
+
getSettings(s) {
|
|
2378
2378
|
const n = this._default;
|
|
2379
|
-
if (Object.assign(n,
|
|
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,
|
|
2386
|
-
|
|
2387
|
-
var n =
|
|
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
|
-
}`),
|
|
2452
|
+
}`), i.PageFlip = class extends class {
|
|
2453
2453
|
constructor() {
|
|
2454
2454
|
this.events = /* @__PURE__ */ new Map();
|
|
2455
2455
|
}
|
|
2456
|
-
on(m,
|
|
2457
|
-
return this.events.has(m) ? this.events.get(m).push(
|
|
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,
|
|
2463
|
-
if (this.events.has(m)) for (const a of this.events.get(m)) a({ data: n, object:
|
|
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,
|
|
2467
|
-
super(), this.isUserTouch = !1, this.isUserMove = !1, this.setting = null, this.pages = null, this.setting = new H().getSettings(
|
|
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
|
|
2477
|
-
const
|
|
2478
|
-
this.render = new T(this, this.setting,
|
|
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
|
|
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
|
|
2489
|
-
this.pages.destroy(), this.pages = new u(this, this.render, m), this.pages.load(), this.pages.show(
|
|
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
|
|
2493
|
-
this.pages.destroy(), this.pages = new
|
|
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,
|
|
2514
|
-
this.flipController.flipToPage(m,
|
|
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,
|
|
2562
|
-
this.isUserTouch ||
|
|
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,
|
|
2565
|
-
this.isUserTouch && (this.isUserTouch = !1,
|
|
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(
|
|
2567
|
+
}, Object.defineProperty(i, "__esModule", { value: !0 });
|
|
2568
2568
|
});
|
|
2569
|
-
})(
|
|
2570
|
-
var
|
|
2569
|
+
})(It, It.exports);
|
|
2570
|
+
var fi = It.exports;
|
|
2571
2571
|
/**
|
|
2572
|
-
* @license FlipbookEngine v0.6.
|
|
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
|
|
2585
|
+
function mi() {
|
|
2586
2586
|
return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
2587
2587
|
}
|
|
2588
|
-
function
|
|
2588
|
+
function wi(e, t = mi()) {
|
|
2589
2589
|
return t ? 0 : typeof e == "number" && e >= 0 ? e : 1e3;
|
|
2590
2590
|
}
|
|
2591
|
-
class
|
|
2592
|
-
constructor(t,
|
|
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 =
|
|
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
|
|
2610
|
-
|
|
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,
|
|
2620
|
-
this.pageFlip = new
|
|
2619
|
+
init(t, i) {
|
|
2620
|
+
this.pageFlip = new fi.PageFlip(this.bookContainer, {
|
|
2621
2621
|
width: t,
|
|
2622
|
-
height:
|
|
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
|
-
|
|
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:
|
|
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
|
-
|
|
2650
|
-
const t = this.store.currentPage.value,
|
|
2651
|
-
if (!this.pageFlip || this.isLibraryFlipping ||
|
|
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 = (
|
|
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
|
-
|
|
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
|
-
|
|
2666
|
-
const t = this.store.isAutoPlaying.value,
|
|
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
|
-
},
|
|
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((
|
|
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.
|
|
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
|
|
2719
|
-
constructor(t,
|
|
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 =
|
|
2731
|
+
this.pageViewport = t, this.store = i;
|
|
2731
2732
|
}
|
|
2732
|
-
init(t,
|
|
2733
|
-
this.wrapperElement = t, this.sizerElement =
|
|
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
|
-
|
|
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 = (
|
|
2751
|
-
|
|
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,
|
|
2759
|
-
if (t === 0 ||
|
|
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
|
|
2762
|
-
b >
|
|
2763
|
-
let
|
|
2764
|
-
|
|
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.
|
|
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
|
|
2790
|
-
constructor(t,
|
|
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 =
|
|
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
|
-
|
|
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,
|
|
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,
|
|
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
|
|
2827
|
-
this.updateZoomPan(r +
|
|
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,
|
|
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
|
-
|
|
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(
|
|
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,
|
|
2870
|
+
updateZoomPan(t, i) {
|
|
2870
2871
|
this.store.zoomState.value = {
|
|
2871
2872
|
...this.store.zoomState.value,
|
|
2872
2873
|
translateX: t,
|
|
2873
|
-
translateY:
|
|
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
|
|
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) =>
|
|
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 ??
|
|
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
|
|
2891
|
-
return Array.isArray(e) ? e.map((
|
|
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.
|
|
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
|
|
2900
|
-
function
|
|
2901
|
-
const e = D(0), t = D(0),
|
|
2902
|
-
return { currentPage: e, totalPages: t, isSingleMode:
|
|
2903
|
-
t.value =
|
|
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,
|
|
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
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
function
|
|
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
|
|
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
|
|
2943
|
+
function Si(e) {
|
|
2943
2944
|
return e === "rtl" ? ["right", "left"] : ["left", "right"];
|
|
2944
2945
|
}
|
|
2945
|
-
function
|
|
2946
|
+
function Ti(e) {
|
|
2946
2947
|
const t = [];
|
|
2947
|
-
let
|
|
2948
|
+
let i = 1;
|
|
2948
2949
|
return e.forEach((o, r) => {
|
|
2949
|
-
const h = o.kind ?? "single", u = o.id ?? `asset-${r}`,
|
|
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
|
|
2952
|
-
|
|
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
|
-
}),
|
|
2964
|
+
}), i = k[k.length - 1] + 1;
|
|
2963
2965
|
return;
|
|
2964
2966
|
}
|
|
2965
|
-
const
|
|
2967
|
+
const P = b[0] ?? i;
|
|
2966
2968
|
t.push({
|
|
2967
2969
|
index: t.length,
|
|
2968
2970
|
assetId: u,
|
|
2969
|
-
pageNumber:
|
|
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
|
-
}),
|
|
2977
|
+
}), i = P + 1;
|
|
2975
2978
|
}), t;
|
|
2976
2979
|
}
|
|
2977
|
-
function
|
|
2978
|
-
e
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
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
|
|
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
|
|
2995
|
-
if (
|
|
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,
|
|
3018
|
+
return this.hits++, this.entries.delete(t), this.entries.set(t, i), i;
|
|
3000
3019
|
}
|
|
3001
|
-
set(t,
|
|
3002
|
-
if (!(this.maxEntries === 0 || !
|
|
3003
|
-
for (this.entries.delete(t), this.entries.set(t,
|
|
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
|
-
|
|
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
|
|
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:
|
|
3033
|
-
}, this.cache = new
|
|
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,
|
|
3037
|
-
this.throwIfAborted(
|
|
3038
|
-
const o =
|
|
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
|
-
|
|
3068
|
+
i == null || i.addEventListener("abort", r, { once: !0 });
|
|
3045
3069
|
try {
|
|
3046
|
-
return this.pdfDoc = await o.promise, this.throwIfAborted(
|
|
3070
|
+
return this.pdfDoc = await o.promise, this.throwIfAborted(i), this.pdfDoc.numPages;
|
|
3047
3071
|
} catch (h) {
|
|
3048
|
-
throw
|
|
3072
|
+
throw i != null && i.aborted ? this.createAbortError() : h;
|
|
3049
3073
|
} finally {
|
|
3050
|
-
|
|
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,
|
|
3078
|
+
async renderPageToDataUrl(t, i) {
|
|
3055
3079
|
if (!this.pdfDoc) throw new Error("PDF document is not loaded.");
|
|
3056
|
-
this.throwIfAborted(
|
|
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(
|
|
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
|
|
3065
|
-
if (
|
|
3066
|
-
const b = r.render({ canvasContext:
|
|
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
|
-
|
|
3094
|
+
i == null || i.addEventListener("abort", P, { once: !0 });
|
|
3071
3095
|
try {
|
|
3072
|
-
await b.promise, this.throwIfAborted(
|
|
3096
|
+
await b.promise, this.throwIfAborted(i);
|
|
3073
3097
|
} finally {
|
|
3074
|
-
|
|
3098
|
+
i == null || i.removeEventListener("abort", P);
|
|
3075
3099
|
}
|
|
3076
|
-
const
|
|
3077
|
-
return this.cache.set(t,
|
|
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
|
|
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 =
|
|
3088
|
-
return
|
|
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,
|
|
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
|
|
3130
|
+
const c = async () => {
|
|
3097
3131
|
for (; ; ) {
|
|
3098
3132
|
this.throwIfAborted(t);
|
|
3099
|
-
const
|
|
3100
|
-
if (
|
|
3101
|
-
const
|
|
3102
|
-
r[
|
|
3103
|
-
index:
|
|
3104
|
-
assetId: `pdf-page-${
|
|
3105
|
-
pageNumber:
|
|
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:
|
|
3108
|
-
low:
|
|
3109
|
-
thumb:
|
|
3110
|
-
}, u++,
|
|
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 }, () =>
|
|
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,
|
|
3127
|
-
(
|
|
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.
|
|
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,
|
|
3179
|
+
constructor(t, i = {}) {
|
|
3146
3180
|
v(this, "container", null);
|
|
3147
3181
|
v(this, "options");
|
|
3148
|
-
v(this, "store",
|
|
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: !
|
|
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: !
|
|
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
|
-
|
|
3214
|
+
pdfPageMode: "auto",
|
|
3215
|
+
...i
|
|
3179
3216
|
}, this.setupEventSync();
|
|
3180
3217
|
}
|
|
3181
|
-
async init(t,
|
|
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 (
|
|
3224
|
+
if (i && i.length > 0) {
|
|
3188
3225
|
if (r.signal.aborted) return;
|
|
3189
|
-
const T =
|
|
3190
|
-
h =
|
|
3191
|
-
const
|
|
3192
|
-
if (
|
|
3193
|
-
const
|
|
3194
|
-
if (
|
|
3195
|
-
const N = (
|
|
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
|
|
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
|
|
3212
|
-
T = "render", this.emit("progress", { phase: "loading", completed: 1, total:
|
|
3213
|
-
|
|
3214
|
-
|
|
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:
|
|
3217
|
-
cause:
|
|
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),
|
|
3224
|
-
let
|
|
3225
|
-
const
|
|
3226
|
-
pageFlipAdapterRef:
|
|
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) =>
|
|
3267
|
+
bookWrapperRef: (T) => c = T,
|
|
3229
3268
|
bookSizerRef: (T) => b = T,
|
|
3230
|
-
bookContainerRef: (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
|
|
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(
|
|
3241
|
-
const
|
|
3242
|
-
r.signal.removeEventListener("abort",
|
|
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",
|
|
3245
|
-
if (this.initializationTimer = null, r.signal.removeEventListener("abort",
|
|
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
|
|
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
|
|
3266
|
-
return {
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
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,
|
|
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))
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
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
|
-
}),
|
|
3293
|
-
}).catch((
|
|
3294
|
-
throw r !== this.initGeneration && (
|
|
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:
|
|
3297
|
-
cause:
|
|
3298
|
-
}),
|
|
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 =
|
|
3307
|
-
const
|
|
3308
|
-
[
|
|
3309
|
-
this.renderPdfPage(
|
|
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((
|
|
3371
|
+
return new Promise((i) => {
|
|
3316
3372
|
const o = new Image();
|
|
3317
|
-
o.onload = () =>
|
|
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
|
|
3322
|
-
this.store.currentPage.value = Math.max(0, Math.min(
|
|
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
|
|
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
|
|
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)) : (
|
|
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,
|
|
3351
|
-
const o =
|
|
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 =
|
|
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,
|
|
3423
|
+
async setPages(t, i) {
|
|
3364
3424
|
if (!(t != null && t.length)) {
|
|
3365
|
-
|
|
3425
|
+
i && await this.init(i);
|
|
3366
3426
|
return;
|
|
3367
3427
|
}
|
|
3368
|
-
await this.init(
|
|
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]")),
|
|
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
|
|
3381
|
-
|
|
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
|
|
3387
|
-
Number.isInteger(
|
|
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
|
|
3394
|
-
u.isIntersecting && (
|
|
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 =
|
|
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
|
|
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 = ""),
|
|
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,
|
|
3508
|
+
on(t, i) {
|
|
3449
3509
|
const o = this.listeners[t] ?? /* @__PURE__ */ new Set();
|
|
3450
|
-
return o.add(
|
|
3510
|
+
return o.add(i), this.listeners[t] = o, () => this.off(t, i);
|
|
3451
3511
|
}
|
|
3452
|
-
off(t,
|
|
3512
|
+
off(t, i) {
|
|
3453
3513
|
var o;
|
|
3454
|
-
(o = this.listeners[t]) == null || o.delete(
|
|
3514
|
+
(o = this.listeners[t]) == null || o.delete(i);
|
|
3455
3515
|
}
|
|
3456
|
-
emit(t,
|
|
3516
|
+
emit(t, i) {
|
|
3457
3517
|
var o;
|
|
3458
3518
|
(o = this.listeners[t]) == null || o.forEach((r) => {
|
|
3459
|
-
r(
|
|
3519
|
+
r(i);
|
|
3460
3520
|
});
|
|
3461
3521
|
}
|
|
3462
3522
|
};
|
|
3463
3523
|
v(mt, "DEFAULT_PAGE_VIEWPORT", { width: 420, height: 594 });
|
|
3464
|
-
let
|
|
3465
|
-
const
|
|
3466
|
-
|
|
3467
|
-
|
|
3524
|
+
let Lt = mt;
|
|
3525
|
+
const Se = globalThis, Te = Se.FlipbookEngine || {};
|
|
3526
|
+
Te.FlipbookEngine = Lt;
|
|
3527
|
+
Se.FlipbookEngine = Te;
|
|
3468
3528
|
export {
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
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-
|
|
3535
|
+
//# sourceMappingURL=engine-DhQ2zxpm.js.map
|