@peeekpage/viewer 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +0 -1
- package/dist/index.js +483 -527
- package/dist/peeekviewer.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
1
|
+
import { jsxs as _, jsx as o, Fragment as Ye } from "react/jsx-runtime";
|
|
2
|
+
import { useState as T, useRef as j, useEffect as C, useCallback as E, useMemo as qe } from "react";
|
|
3
|
+
const Je = /* @__PURE__ */ new Set(["http:", "https:"]);
|
|
4
|
+
function G(t) {
|
|
5
5
|
if (typeof t != "string") return null;
|
|
6
6
|
const e = t.trim();
|
|
7
7
|
if (e === "" || e.includes(" ")) return null;
|
|
8
8
|
const n = typeof window < "u" ? window.location.href : void 0;
|
|
9
|
-
let
|
|
9
|
+
let a;
|
|
10
10
|
try {
|
|
11
|
-
|
|
11
|
+
a = new URL(e, n);
|
|
12
12
|
} catch {
|
|
13
13
|
return null;
|
|
14
14
|
}
|
|
15
|
-
return
|
|
15
|
+
return Je.has(a.protocol) ? a.href : null;
|
|
16
16
|
}
|
|
17
|
-
const
|
|
18
|
-
function
|
|
17
|
+
const Qe = /^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/, et = /^rgba?\([ \t]*\d{1,3}[ \t]*,[ \t]*\d{1,3}[ \t]*,[ \t]*\d{1,3}[ \t]*(?:,[ \t]*(?:0|1|0?\.\d+)[ \t]*)?\)$/;
|
|
18
|
+
function se(t) {
|
|
19
19
|
if (typeof t != "string") return null;
|
|
20
20
|
const e = t.trim();
|
|
21
|
-
return
|
|
21
|
+
return Qe.test(e) || et.test(e) ? e : null;
|
|
22
22
|
}
|
|
23
|
-
const
|
|
24
|
-
function
|
|
23
|
+
const tt = /url\(|image\(|image-set\(|element\(|expression|@|\/\*|;|\{|\}|<|>|\\/i, nt = /^(repeating-)?(linear|radial|conic)-gradient\([a-z0-9#.,%()\/\s-]*\)$/i, at = /^hsla?\([a-z0-9.,%\/\s-]*\)$/i;
|
|
24
|
+
function ot(t) {
|
|
25
25
|
if (typeof t != "string") return null;
|
|
26
26
|
const e = t.trim();
|
|
27
|
-
if (e === "" ||
|
|
28
|
-
const n =
|
|
29
|
-
return n !== null ? n :
|
|
27
|
+
if (e === "" || tt.test(e)) return null;
|
|
28
|
+
const n = se(e);
|
|
29
|
+
return n !== null ? n : at.test(e) || nt.test(e) ? e : null;
|
|
30
30
|
}
|
|
31
|
-
const
|
|
31
|
+
const rt = ["en", "pt-BR"], ye = {
|
|
32
32
|
prev: "Previous page",
|
|
33
33
|
next: "Next page",
|
|
34
34
|
zoom: "Zoom level",
|
|
@@ -50,7 +50,7 @@ const ct = ["en", "pt-BR"], Pe = {
|
|
|
50
50
|
rotate: "Rotate page",
|
|
51
51
|
singlePage: "Single page",
|
|
52
52
|
doublePage: "Two pages"
|
|
53
|
-
},
|
|
53
|
+
}, lt = {
|
|
54
54
|
prev: "Página anterior",
|
|
55
55
|
next: "Próxima página",
|
|
56
56
|
zoom: "Nível de zoom",
|
|
@@ -72,94 +72,93 @@ const ct = ["en", "pt-BR"], Pe = {
|
|
|
72
72
|
rotate: "Girar página",
|
|
73
73
|
singlePage: "Página única",
|
|
74
74
|
doublePage: "Duas páginas"
|
|
75
|
-
},
|
|
76
|
-
function
|
|
77
|
-
return
|
|
75
|
+
}, it = { en: ye, "pt-BR": lt };
|
|
76
|
+
function st(t) {
|
|
77
|
+
return it[t] ?? ye;
|
|
78
78
|
}
|
|
79
|
-
const
|
|
80
|
-
function
|
|
79
|
+
const ct = "#6E79D6";
|
|
80
|
+
function I(t, e) {
|
|
81
81
|
return typeof t == "boolean" ? t : e;
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function Y(t, e, n) {
|
|
84
84
|
return e.includes(t) ? t : n;
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function ut(t) {
|
|
87
87
|
return {
|
|
88
88
|
src: typeof t.src == "string" ? t.src : "",
|
|
89
|
-
mode:
|
|
90
|
-
logo:
|
|
91
|
-
logoLink:
|
|
92
|
-
accentColor:
|
|
93
|
-
background:
|
|
94
|
-
backgroundColor:
|
|
95
|
-
backgroundImage:
|
|
96
|
-
layout:
|
|
97
|
-
fillHeight:
|
|
98
|
-
pageShadows:
|
|
99
|
-
rtl:
|
|
100
|
-
animateInteractions:
|
|
101
|
-
skin:
|
|
102
|
-
language:
|
|
103
|
-
autoTransition:
|
|
89
|
+
mode: Y(t.mode, ["flip", "coverflow"], "flip"),
|
|
90
|
+
logo: G(t.logo),
|
|
91
|
+
logoLink: G(t.logoLink),
|
|
92
|
+
accentColor: se(t.accentColor) ?? ct,
|
|
93
|
+
background: Y(t.background, ["color", "image", "transparent"], "color"),
|
|
94
|
+
backgroundColor: ot(t.backgroundColor),
|
|
95
|
+
backgroundImage: G(t.backgroundImage),
|
|
96
|
+
layout: Y(t.layout, ["single", "double"], "double"),
|
|
97
|
+
fillHeight: I(t.fillHeight, !1),
|
|
98
|
+
pageShadows: I(t.pageShadows, !0),
|
|
99
|
+
rtl: I(t.rtl, !1),
|
|
100
|
+
animateInteractions: I(t.animateInteractions, !0),
|
|
101
|
+
skin: Y(t.skin, ["classic", "minimal", "showcase"], "classic"),
|
|
102
|
+
language: Y(t.language, rt, "en"),
|
|
103
|
+
autoTransition: I(t.autoTransition, !1),
|
|
104
104
|
autoTransitionInterval: typeof t.autoTransitionInterval == "number" && t.autoTransitionInterval > 0 ? t.autoTransitionInterval : 5e3,
|
|
105
|
-
navigationControls:
|
|
106
|
-
fullscreen:
|
|
107
|
-
arrows:
|
|
108
|
-
navigationBar:
|
|
109
|
-
pagesOverview:
|
|
110
|
-
downloadUrl:
|
|
111
|
-
aboutButton:
|
|
112
|
-
goToPage:
|
|
113
|
-
rotateControl:
|
|
114
|
-
layoutToggle:
|
|
115
|
-
|
|
116
|
-
loadingImage: V(t.loadingImage),
|
|
105
|
+
navigationControls: I(t.navigationControls, !0),
|
|
106
|
+
fullscreen: I(t.fullscreen, !0),
|
|
107
|
+
arrows: I(t.arrows, !0),
|
|
108
|
+
navigationBar: I(t.navigationBar, !0),
|
|
109
|
+
pagesOverview: I(t.pagesOverview, !0),
|
|
110
|
+
downloadUrl: G(t.downloadUrl),
|
|
111
|
+
aboutButton: I(t.aboutButton, !0),
|
|
112
|
+
goToPage: I(t.goToPage, !0),
|
|
113
|
+
rotateControl: I(t.rotateControl, !0),
|
|
114
|
+
layoutToggle: I(t.layoutToggle, !0),
|
|
115
|
+
loadingImage: G(t.loadingImage),
|
|
117
116
|
loadingCaption: typeof t.loadingCaption == "string" && t.loadingCaption.length > 0 ? t.loadingCaption : null,
|
|
118
|
-
loadingColor:
|
|
117
|
+
loadingColor: se(t.loadingColor),
|
|
119
118
|
pollInterval: typeof t.pollInterval == "number" && t.pollInterval > 0 ? t.pollInterval : 2e3,
|
|
120
119
|
className: typeof t.className == "string" ? t.className : ""
|
|
121
120
|
};
|
|
122
121
|
}
|
|
123
|
-
const
|
|
124
|
-
function
|
|
122
|
+
const ce = 5e3;
|
|
123
|
+
function q(t) {
|
|
125
124
|
return typeof t == "string" ? t : "";
|
|
126
125
|
}
|
|
127
|
-
function
|
|
126
|
+
function dt(t) {
|
|
128
127
|
if (t === null || typeof t != "object" || Array.isArray(t))
|
|
129
128
|
return { ok: !1, error: "manifest is not an object" };
|
|
130
129
|
const e = t;
|
|
131
130
|
if (!Array.isArray(e.pages))
|
|
132
131
|
return { ok: !1, error: "manifest.pages is missing or not an array" };
|
|
133
|
-
if (e.pages.length >
|
|
132
|
+
if (e.pages.length > ce)
|
|
134
133
|
return { ok: !1, error: "manifest.pages exceeds the maximum" };
|
|
135
|
-
const n = e.total_pages,
|
|
136
|
-
if (
|
|
134
|
+
const n = e.total_pages, a = typeof n == "number" && Number.isFinite(n) && n >= 0 ? n : e.pages.length;
|
|
135
|
+
if (a > ce)
|
|
137
136
|
return { ok: !1, error: "manifest.total_pages exceeds the maximum" };
|
|
138
137
|
const l = [];
|
|
139
138
|
for (const g of e.pages) {
|
|
140
139
|
if (g === null || typeof g != "object") continue;
|
|
141
|
-
const
|
|
142
|
-
|
|
140
|
+
const s = G(g.url);
|
|
141
|
+
s && l.push(s);
|
|
143
142
|
}
|
|
144
143
|
if (l.length === 0)
|
|
145
144
|
return { ok: !1, error: "manifest has no usable pages" };
|
|
146
|
-
const c = e.status === "wip" ? "wip" : "done",
|
|
147
|
-
fileId:
|
|
148
|
-
filename:
|
|
149
|
-
creationDate:
|
|
150
|
-
fileSize:
|
|
151
|
-
mimeType:
|
|
145
|
+
const c = e.status === "wip" ? "wip" : "done", b = e.metadata && typeof e.metadata == "object" ? e.metadata : {}, p = {
|
|
146
|
+
fileId: q(b.file_id),
|
|
147
|
+
filename: q(b.filename),
|
|
148
|
+
creationDate: q(b.creation_date),
|
|
149
|
+
fileSize: q(b.file_size),
|
|
150
|
+
mimeType: q(b.mime_type)
|
|
152
151
|
};
|
|
153
152
|
return {
|
|
154
153
|
ok: !0,
|
|
155
|
-
value: { status: c, totalPages:
|
|
154
|
+
value: { status: c, totalPages: a, pages: l, metadata: p }
|
|
156
155
|
};
|
|
157
156
|
}
|
|
158
|
-
function
|
|
159
|
-
if (!Array.isArray(t) || t.length >
|
|
157
|
+
function gt(t, e) {
|
|
158
|
+
if (!Array.isArray(t) || t.length > ce) return null;
|
|
160
159
|
const n = [];
|
|
161
160
|
for (const l of t) {
|
|
162
|
-
const c =
|
|
161
|
+
const c = G(l);
|
|
163
162
|
c && n.push(c);
|
|
164
163
|
}
|
|
165
164
|
return n.length === 0 ? null : {
|
|
@@ -175,44 +174,44 @@ function bt(t, e) {
|
|
|
175
174
|
}
|
|
176
175
|
};
|
|
177
176
|
}
|
|
178
|
-
function
|
|
179
|
-
const [n,
|
|
180
|
-
return
|
|
181
|
-
let
|
|
182
|
-
if (
|
|
177
|
+
function ft(t, e) {
|
|
178
|
+
const [n, a] = T("loading"), [l, c] = T(null), [b, p] = T(null), g = j(null);
|
|
179
|
+
return C(() => {
|
|
180
|
+
let s = !1;
|
|
181
|
+
if (a("loading"), c(null), p(null), !t) return;
|
|
183
182
|
const k = () => {
|
|
184
183
|
g.current !== null && (clearTimeout(g.current), g.current = null);
|
|
185
|
-
},
|
|
186
|
-
let
|
|
184
|
+
}, h = async () => {
|
|
185
|
+
let d;
|
|
187
186
|
try {
|
|
188
|
-
const
|
|
189
|
-
if (!
|
|
190
|
-
|
|
191
|
-
} catch (
|
|
192
|
-
if (
|
|
193
|
-
|
|
187
|
+
const i = await fetch(t);
|
|
188
|
+
if (!i.ok) throw new Error(`HTTP ${i.status}`);
|
|
189
|
+
d = await i.json();
|
|
190
|
+
} catch (i) {
|
|
191
|
+
if (s) return;
|
|
192
|
+
p(i instanceof Error ? i.message : "fetch failed"), a("error");
|
|
194
193
|
return;
|
|
195
194
|
}
|
|
196
|
-
if (
|
|
197
|
-
const
|
|
198
|
-
if (!
|
|
199
|
-
|
|
195
|
+
if (s) return;
|
|
196
|
+
const u = dt(d);
|
|
197
|
+
if (!u.ok) {
|
|
198
|
+
p(u.error), a("error");
|
|
200
199
|
return;
|
|
201
200
|
}
|
|
202
|
-
c(
|
|
201
|
+
c(u.value), a("ready"), u.value.status === "wip" && (g.current = setTimeout(h, e));
|
|
203
202
|
};
|
|
204
|
-
return
|
|
205
|
-
|
|
203
|
+
return h(), () => {
|
|
204
|
+
s = !0, k();
|
|
206
205
|
};
|
|
207
|
-
}, [t, e]), { state: n, manifest: l, error:
|
|
206
|
+
}, [t, e]), { state: n, manifest: l, error: b };
|
|
208
207
|
}
|
|
209
|
-
function
|
|
210
|
-
const [e, n] =
|
|
211
|
-
|
|
208
|
+
function mt(t) {
|
|
209
|
+
const [e, n] = T(!1);
|
|
210
|
+
C(() => {
|
|
212
211
|
const l = () => n(document.fullscreenElement != null);
|
|
213
212
|
return document.addEventListener("fullscreenchange", l), () => document.removeEventListener("fullscreenchange", l);
|
|
214
213
|
}, []);
|
|
215
|
-
const
|
|
214
|
+
const a = E(async () => {
|
|
216
215
|
const l = t.current;
|
|
217
216
|
if (l)
|
|
218
217
|
try {
|
|
@@ -220,30 +219,30 @@ function _t(t) {
|
|
|
220
219
|
} catch {
|
|
221
220
|
}
|
|
222
221
|
}, [t]);
|
|
223
|
-
return { isFullscreen: e, toggle:
|
|
222
|
+
return { isFullscreen: e, toggle: a };
|
|
224
223
|
}
|
|
225
|
-
const
|
|
226
|
-
function
|
|
227
|
-
const [t, e] =
|
|
224
|
+
const _e = "(prefers-reduced-motion: reduce)";
|
|
225
|
+
function ve() {
|
|
226
|
+
const [t, e] = T(() => {
|
|
228
227
|
var n;
|
|
229
|
-
return ((n = matchMedia == null ? void 0 : matchMedia(
|
|
228
|
+
return ((n = matchMedia == null ? void 0 : matchMedia(_e)) == null ? void 0 : n.matches) ?? !1;
|
|
230
229
|
});
|
|
231
|
-
return
|
|
232
|
-
const n = typeof matchMedia == "function" ? matchMedia(
|
|
230
|
+
return C(() => {
|
|
231
|
+
const n = typeof matchMedia == "function" ? matchMedia(_e) : void 0;
|
|
233
232
|
if (!(n != null && n.addEventListener)) return;
|
|
234
|
-
const
|
|
235
|
-
return n.addEventListener("change",
|
|
233
|
+
const a = () => e(n.matches);
|
|
234
|
+
return n.addEventListener("change", a), () => n.removeEventListener("change", a);
|
|
236
235
|
}, []), t;
|
|
237
236
|
}
|
|
238
|
-
function
|
|
239
|
-
return { onKeyDown:
|
|
237
|
+
function we({ go: t, jump: e, total: n, rtl: a }) {
|
|
238
|
+
return { onKeyDown: E(
|
|
240
239
|
(c) => {
|
|
241
240
|
switch (c.key) {
|
|
242
241
|
case "ArrowRight":
|
|
243
|
-
t(
|
|
242
|
+
t(a ? -1 : 1);
|
|
244
243
|
break;
|
|
245
244
|
case "ArrowLeft":
|
|
246
|
-
t(
|
|
245
|
+
t(a ? 1 : -1);
|
|
247
246
|
break;
|
|
248
247
|
case "Home":
|
|
249
248
|
c.preventDefault(), n > 0 && e(0);
|
|
@@ -263,165 +262,165 @@ function Ie({ go: t, jump: e, total: n, rtl: o }) {
|
|
|
263
262
|
break;
|
|
264
263
|
}
|
|
265
264
|
},
|
|
266
|
-
[t, e, n,
|
|
265
|
+
[t, e, n, a]
|
|
267
266
|
) };
|
|
268
267
|
}
|
|
269
|
-
function
|
|
268
|
+
function Te(t, e) {
|
|
270
269
|
if (e <= 0) return null;
|
|
271
270
|
const n = t.trim();
|
|
272
271
|
if (!/^\d+$/.test(n)) return null;
|
|
273
|
-
const
|
|
274
|
-
return Number.isFinite(
|
|
272
|
+
const a = Number(n);
|
|
273
|
+
return Number.isFinite(a) ? Math.max(1, Math.min(e, a)) - 1 : null;
|
|
275
274
|
}
|
|
276
|
-
const
|
|
277
|
-
function
|
|
278
|
-
const [n,
|
|
279
|
-
|
|
280
|
-
const
|
|
281
|
-
if (!
|
|
282
|
-
const k = new ResizeObserver((
|
|
283
|
-
var
|
|
284
|
-
const
|
|
285
|
-
typeof
|
|
275
|
+
const pt = 640;
|
|
276
|
+
function bt(t, e) {
|
|
277
|
+
const [n, a] = T("auto"), [l, c] = T(null);
|
|
278
|
+
C(() => {
|
|
279
|
+
const s = t.current;
|
|
280
|
+
if (!s || (s.clientWidth > 0 && c(s.clientWidth), typeof ResizeObserver > "u")) return;
|
|
281
|
+
const k = new ResizeObserver((h) => {
|
|
282
|
+
var u;
|
|
283
|
+
const d = (u = h[0]) == null ? void 0 : u.contentRect.width;
|
|
284
|
+
typeof d == "number" && d > 0 && c(d);
|
|
286
285
|
});
|
|
287
|
-
return k.observe(
|
|
286
|
+
return k.observe(s), () => k.disconnect();
|
|
288
287
|
}, [t]);
|
|
289
|
-
const
|
|
290
|
-
|
|
291
|
-
}, [
|
|
292
|
-
return { layout:
|
|
288
|
+
const b = l != null && l < pt ? "single" : e, p = n === "auto" ? b : n, g = E(() => {
|
|
289
|
+
a(p === "single" ? "double" : "single");
|
|
290
|
+
}, [p]);
|
|
291
|
+
return { layout: p, toggle: g };
|
|
293
292
|
}
|
|
294
|
-
function
|
|
293
|
+
function ue(t, e) {
|
|
295
294
|
return t <= 0 ? 0 : e === "single" ? t : 1 + Math.ceil((t - 1) / 2);
|
|
296
295
|
}
|
|
297
|
-
function
|
|
296
|
+
function ht(t, e) {
|
|
298
297
|
return e === "single" ? t : t <= 0 ? 0 : Math.floor((t - 1) / 2) + 1;
|
|
299
298
|
}
|
|
300
|
-
function
|
|
299
|
+
function te(t, e, n) {
|
|
301
300
|
if (e <= 0) return { left: -1, right: -1 };
|
|
302
301
|
if (n === "single")
|
|
303
302
|
return { left: -1, right: t >= 0 && t < e ? t : -1 };
|
|
304
303
|
if (t <= 0)
|
|
305
304
|
return { left: -1, right: 0 };
|
|
306
|
-
const
|
|
307
|
-
return { left:
|
|
305
|
+
const a = 2 * t - 1, l = 2 * t;
|
|
306
|
+
return { left: a < e ? a : -1, right: l < e ? l : -1 };
|
|
308
307
|
}
|
|
309
|
-
function
|
|
310
|
-
const { left:
|
|
311
|
-
return
|
|
308
|
+
function Ne(t, e, n) {
|
|
309
|
+
const { left: a, right: l } = te(t, e, n), c = [];
|
|
310
|
+
return a >= 0 && c.push(a), l >= 0 && c.push(l), c;
|
|
312
311
|
}
|
|
313
|
-
function
|
|
314
|
-
const
|
|
315
|
-
return t < 0 ? 0 : t >
|
|
312
|
+
function ie(t, e, n) {
|
|
313
|
+
const a = ue(e, n) - 1;
|
|
314
|
+
return t < 0 ? 0 : t > a ? a : t;
|
|
316
315
|
}
|
|
317
|
-
function
|
|
316
|
+
function _t(t) {
|
|
318
317
|
const {
|
|
319
318
|
strings: e,
|
|
320
319
|
label: n,
|
|
321
|
-
progress:
|
|
320
|
+
progress: a,
|
|
322
321
|
zoom: l,
|
|
323
322
|
minZoom: c,
|
|
324
|
-
maxZoom:
|
|
325
|
-
total:
|
|
323
|
+
maxZoom: b,
|
|
324
|
+
total: p,
|
|
326
325
|
currentPage: g,
|
|
327
|
-
layout:
|
|
326
|
+
layout: s,
|
|
328
327
|
thumbsOpen: k,
|
|
329
|
-
isFullscreen:
|
|
330
|
-
downloadUrl:
|
|
331
|
-
show:
|
|
332
|
-
onZoomIn:
|
|
333
|
-
onZoomOut:
|
|
334
|
-
onZoomSet:
|
|
335
|
-
onJump:
|
|
336
|
-
onRotate:
|
|
337
|
-
onToggleLayout:
|
|
328
|
+
isFullscreen: h,
|
|
329
|
+
downloadUrl: d,
|
|
330
|
+
show: u,
|
|
331
|
+
onZoomIn: i,
|
|
332
|
+
onZoomOut: L,
|
|
333
|
+
onZoomSet: D,
|
|
334
|
+
onJump: M,
|
|
335
|
+
onRotate: O,
|
|
336
|
+
onToggleLayout: x,
|
|
338
337
|
onToggleThumbs: $,
|
|
339
|
-
onToggleFullscreen:
|
|
340
|
-
onAbout:
|
|
341
|
-
} = t, [
|
|
342
|
-
|
|
343
|
-
const
|
|
344
|
-
const
|
|
345
|
-
if (
|
|
346
|
-
|
|
338
|
+
onToggleFullscreen: U,
|
|
339
|
+
onAbout: X
|
|
340
|
+
} = t, [A, z] = T(String(g));
|
|
341
|
+
C(() => z(String(g)), [g]);
|
|
342
|
+
const Z = () => {
|
|
343
|
+
const N = Te(A, p);
|
|
344
|
+
if (N === null) {
|
|
345
|
+
z(String(g));
|
|
347
346
|
return;
|
|
348
347
|
}
|
|
349
|
-
|
|
348
|
+
M(N), z(String(N + 1));
|
|
350
349
|
};
|
|
351
|
-
return /* @__PURE__ */
|
|
352
|
-
/* @__PURE__ */
|
|
353
|
-
|
|
354
|
-
|
|
350
|
+
return /* @__PURE__ */ _("div", { className: "peeek__toolbar", children: [
|
|
351
|
+
/* @__PURE__ */ o("span", { className: "peeek__label", children: n }),
|
|
352
|
+
u.bar && /* @__PURE__ */ o("div", { className: "peeek__scrubber", "aria-hidden": !0, children: /* @__PURE__ */ o("div", { className: "peeek__scrubber-fill", style: { width: `${a}%` } }) }),
|
|
353
|
+
u.goto && /* @__PURE__ */ o(
|
|
355
354
|
"input",
|
|
356
355
|
{
|
|
357
356
|
className: "peeek__goto",
|
|
358
357
|
type: "text",
|
|
359
358
|
inputMode: "numeric",
|
|
360
359
|
"aria-label": e.goToPage,
|
|
361
|
-
value:
|
|
362
|
-
onChange: (
|
|
363
|
-
onBlur:
|
|
364
|
-
onKeyDown: (
|
|
365
|
-
|
|
360
|
+
value: A,
|
|
361
|
+
onChange: (N) => z(N.target.value),
|
|
362
|
+
onBlur: Z,
|
|
363
|
+
onKeyDown: (N) => {
|
|
364
|
+
N.key === "Enter" && (N.preventDefault(), Z());
|
|
366
365
|
}
|
|
367
366
|
}
|
|
368
367
|
),
|
|
369
|
-
/* @__PURE__ */
|
|
368
|
+
/* @__PURE__ */ o(
|
|
370
369
|
"button",
|
|
371
370
|
{
|
|
372
371
|
type: "button",
|
|
373
372
|
className: "peeek__btn",
|
|
374
373
|
"aria-label": e.zoomOut,
|
|
375
374
|
disabled: l <= c,
|
|
376
|
-
onClick:
|
|
375
|
+
onClick: L,
|
|
377
376
|
children: "−"
|
|
378
377
|
}
|
|
379
378
|
),
|
|
380
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ o(
|
|
381
380
|
"input",
|
|
382
381
|
{
|
|
383
382
|
type: "range",
|
|
384
383
|
"aria-label": e.zoom,
|
|
385
384
|
min: c,
|
|
386
|
-
max:
|
|
385
|
+
max: b,
|
|
387
386
|
step: 0.25,
|
|
388
387
|
value: l,
|
|
389
|
-
onChange: (
|
|
388
|
+
onChange: (N) => D(Number(N.target.value))
|
|
390
389
|
}
|
|
391
390
|
),
|
|
392
|
-
/* @__PURE__ */
|
|
391
|
+
/* @__PURE__ */ o(
|
|
393
392
|
"button",
|
|
394
393
|
{
|
|
395
394
|
type: "button",
|
|
396
395
|
className: "peeek__btn",
|
|
397
396
|
"aria-label": e.zoomIn,
|
|
398
|
-
disabled: l >=
|
|
399
|
-
onClick:
|
|
397
|
+
disabled: l >= b,
|
|
398
|
+
onClick: i,
|
|
400
399
|
children: "+"
|
|
401
400
|
}
|
|
402
401
|
),
|
|
403
|
-
|
|
402
|
+
u.rotate && /* @__PURE__ */ o(
|
|
404
403
|
"button",
|
|
405
404
|
{
|
|
406
405
|
type: "button",
|
|
407
406
|
className: "peeek__btn",
|
|
408
407
|
"aria-label": e.rotate,
|
|
409
|
-
onClick:
|
|
408
|
+
onClick: O,
|
|
410
409
|
children: "⟳"
|
|
411
410
|
}
|
|
412
411
|
),
|
|
413
|
-
|
|
412
|
+
u.layoutToggle && /* @__PURE__ */ o(
|
|
414
413
|
"button",
|
|
415
414
|
{
|
|
416
415
|
type: "button",
|
|
417
416
|
className: "peeek__btn",
|
|
418
|
-
"aria-label":
|
|
419
|
-
"aria-pressed":
|
|
420
|
-
onClick:
|
|
421
|
-
children:
|
|
417
|
+
"aria-label": s === "single" ? e.doublePage : e.singlePage,
|
|
418
|
+
"aria-pressed": s === "double",
|
|
419
|
+
onClick: x,
|
|
420
|
+
children: s === "single" ? "▭" : "▥"
|
|
422
421
|
}
|
|
423
422
|
),
|
|
424
|
-
|
|
423
|
+
u.thumbnails && /* @__PURE__ */ o(
|
|
425
424
|
"button",
|
|
426
425
|
{
|
|
427
426
|
type: "button",
|
|
@@ -432,11 +431,11 @@ function wt(t) {
|
|
|
432
431
|
children: "▦"
|
|
433
432
|
}
|
|
434
433
|
),
|
|
435
|
-
|
|
434
|
+
d && /* @__PURE__ */ o(
|
|
436
435
|
"a",
|
|
437
436
|
{
|
|
438
437
|
className: "peeek__btn",
|
|
439
|
-
href:
|
|
438
|
+
href: d,
|
|
440
439
|
"aria-label": e.download,
|
|
441
440
|
target: "_blank",
|
|
442
441
|
rel: "noopener noreferrer",
|
|
@@ -444,401 +443,359 @@ function wt(t) {
|
|
|
444
443
|
children: "↓"
|
|
445
444
|
}
|
|
446
445
|
),
|
|
447
|
-
|
|
446
|
+
u.fullscreen && /* @__PURE__ */ o(
|
|
448
447
|
"button",
|
|
449
448
|
{
|
|
450
449
|
type: "button",
|
|
451
|
-
className: `peeek__btn${
|
|
450
|
+
className: `peeek__btn${h ? " peeek__btn--active" : ""}`,
|
|
452
451
|
"aria-label": e.fullscreen,
|
|
453
|
-
"aria-pressed":
|
|
454
|
-
onClick:
|
|
452
|
+
"aria-pressed": h,
|
|
453
|
+
onClick: U,
|
|
455
454
|
children: "⛶"
|
|
456
455
|
}
|
|
457
456
|
),
|
|
458
|
-
|
|
457
|
+
u.about && /* @__PURE__ */ o(
|
|
459
458
|
"button",
|
|
460
459
|
{
|
|
461
460
|
type: "button",
|
|
462
461
|
className: "peeek__btn",
|
|
463
462
|
"aria-label": e.about,
|
|
464
|
-
onClick:
|
|
463
|
+
onClick: X,
|
|
465
464
|
children: "?"
|
|
466
465
|
}
|
|
467
466
|
)
|
|
468
467
|
] });
|
|
469
468
|
}
|
|
470
|
-
function
|
|
471
|
-
const c = t.length,
|
|
472
|
-
return /* @__PURE__ */
|
|
473
|
-
const k =
|
|
474
|
-
return /* @__PURE__ */
|
|
475
|
-
k.map((
|
|
476
|
-
let
|
|
477
|
-
return
|
|
469
|
+
function kt({ pages: t, layout: e, rtl: n, activePages: a, onJump: l }) {
|
|
470
|
+
const c = t.length, b = new Set(a), p = ue(c, e);
|
|
471
|
+
return /* @__PURE__ */ o("div", { className: "peeek__thumbs", role: "group", "aria-label": "Pages", children: Array.from({ length: p }, (g, s) => {
|
|
472
|
+
const k = Ne(s, c, e), h = k.length === 2;
|
|
473
|
+
return /* @__PURE__ */ _("div", { className: "peeek__thumb-group", children: [
|
|
474
|
+
k.map((d, u) => {
|
|
475
|
+
let i = "";
|
|
476
|
+
return h && (i = (n ? u === 1 : u === 0) ? " peeek__thumb--flat-right" : " peeek__thumb--flat-left"), /* @__PURE__ */ o(
|
|
478
477
|
"button",
|
|
479
478
|
{
|
|
480
479
|
type: "button",
|
|
481
|
-
"aria-label": `Go to page ${
|
|
482
|
-
"aria-current":
|
|
483
|
-
className: `peeek__thumb${
|
|
484
|
-
onClick: () => l(
|
|
485
|
-
children: /* @__PURE__ */
|
|
480
|
+
"aria-label": `Go to page ${d + 1}`,
|
|
481
|
+
"aria-current": b.has(d),
|
|
482
|
+
className: `peeek__thumb${b.has(d) ? " peeek__thumb--active" : ""}${i}`,
|
|
483
|
+
onClick: () => l(d),
|
|
484
|
+
children: /* @__PURE__ */ o("img", { src: t[d], alt: "", loading: "lazy", referrerPolicy: "no-referrer" })
|
|
486
485
|
},
|
|
487
|
-
|
|
486
|
+
d
|
|
488
487
|
);
|
|
489
488
|
}),
|
|
490
|
-
/* @__PURE__ */
|
|
491
|
-
] },
|
|
489
|
+
/* @__PURE__ */ o("span", { className: "peeek__thumb-badge", "aria-hidden": !0, children: k.map((d) => d + 1).join("-") })
|
|
490
|
+
] }, s);
|
|
492
491
|
}) });
|
|
493
492
|
}
|
|
494
|
-
const
|
|
495
|
-
function
|
|
496
|
-
const l = H(null), [c, p] = y(0);
|
|
497
|
-
T(() => {
|
|
498
|
-
if (!e) {
|
|
499
|
-
p(0);
|
|
500
|
-
return;
|
|
501
|
-
}
|
|
502
|
-
const g = l.current;
|
|
503
|
-
if (!g) return;
|
|
504
|
-
const i = g.getBoundingClientRect(), k = t === "tr" || t === "br" ? i.right : i.left, _ = t === "tr" || t === "tl" ? i.top : i.bottom, u = Math.hypot(e.x - k, e.y - _);
|
|
505
|
-
p(Math.max(0, Math.min(1, 1 - u / Nt)));
|
|
506
|
-
}, [e, t]);
|
|
507
|
-
const b = Ce + c * (Ct - Ce);
|
|
508
|
-
return /* @__PURE__ */ a(
|
|
509
|
-
"button",
|
|
510
|
-
{
|
|
511
|
-
ref: l,
|
|
512
|
-
type: "button",
|
|
513
|
-
className: `peeek__curl peeek__curl--${t}`,
|
|
514
|
-
"aria-hidden": !0,
|
|
515
|
-
tabIndex: -1,
|
|
516
|
-
onClick: o,
|
|
517
|
-
style: {
|
|
518
|
-
"--peeek-curl": `${b}px`,
|
|
519
|
-
transition: n ? "none" : void 0
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
);
|
|
523
|
-
}
|
|
524
|
-
const Q = 1, oe = 2, Ne = 0.25;
|
|
525
|
-
function Pt(t) {
|
|
493
|
+
const J = 1, ee = 2, ke = 0.25;
|
|
494
|
+
function yt(t) {
|
|
526
495
|
const {
|
|
527
496
|
pages: e,
|
|
528
497
|
strings: n,
|
|
529
|
-
layout:
|
|
498
|
+
layout: a,
|
|
530
499
|
rtl: l,
|
|
531
500
|
pageShadows: c,
|
|
532
|
-
animateInteractions:
|
|
533
|
-
autoTransition:
|
|
501
|
+
animateInteractions: b,
|
|
502
|
+
autoTransition: p,
|
|
534
503
|
autoTransitionInterval: g,
|
|
535
|
-
show:
|
|
504
|
+
show: s,
|
|
536
505
|
downloadUrl: k,
|
|
537
|
-
isFullscreen:
|
|
538
|
-
onToggleFullscreen:
|
|
539
|
-
onAbout:
|
|
540
|
-
} = t,
|
|
541
|
-
|
|
506
|
+
isFullscreen: h,
|
|
507
|
+
onToggleFullscreen: d,
|
|
508
|
+
onAbout: u
|
|
509
|
+
} = t, i = e.length, D = ve() || !b, [M, O] = T(0), [x, $] = T(1), [U, X] = T(!1), [A, z] = T({ x: 0, y: 0 }), [Z, N] = T(!1), [f, y] = T(0), S = j(null), F = j(null), { layout: v, toggle: Ce } = bt(F, a), ne = ue(i, v), [w, de] = T(null), ge = j(null), [fe, Pe] = T(0.707);
|
|
510
|
+
C(() => {
|
|
542
511
|
if (!e[0]) return;
|
|
543
512
|
const r = new globalThis.Image();
|
|
544
513
|
r.onload = () => {
|
|
545
|
-
r.naturalWidth && r.naturalHeight &&
|
|
514
|
+
r.naturalWidth && r.naturalHeight && Pe(r.naturalWidth / r.naturalHeight);
|
|
546
515
|
}, r.src = e[0];
|
|
547
516
|
}, [e]);
|
|
548
|
-
const
|
|
517
|
+
const R = ie(M, i, v), Ie = R <= 0, ae = R >= ne - 1, K = E(
|
|
549
518
|
(r) => {
|
|
550
|
-
|
|
551
|
-
const
|
|
552
|
-
return
|
|
519
|
+
w || O((m) => {
|
|
520
|
+
const P = ie(m + r, i, v);
|
|
521
|
+
return P === m ? m : D ? P : (de({ dir: r, to: P }), m);
|
|
553
522
|
});
|
|
554
523
|
},
|
|
555
|
-
[
|
|
556
|
-
),
|
|
557
|
-
|
|
524
|
+
[i, v, D, w]
|
|
525
|
+
), xe = E(() => {
|
|
526
|
+
de((r) => (r && O(r.to), null));
|
|
558
527
|
}, []);
|
|
559
|
-
|
|
560
|
-
if (!
|
|
561
|
-
const r =
|
|
528
|
+
C(() => {
|
|
529
|
+
if (!w) return;
|
|
530
|
+
const r = ge.current;
|
|
562
531
|
if (!r) return;
|
|
563
532
|
r.style.transform = "rotateY(0deg)";
|
|
564
533
|
let m = 0;
|
|
565
|
-
const
|
|
534
|
+
const P = requestAnimationFrame(() => {
|
|
566
535
|
m = requestAnimationFrame(() => {
|
|
567
|
-
r.style.transform = `rotateY(${
|
|
536
|
+
r.style.transform = `rotateY(${w.dir === 1 ? -180 : 180}deg)`;
|
|
568
537
|
});
|
|
569
538
|
});
|
|
570
539
|
return () => {
|
|
571
|
-
cancelAnimationFrame(
|
|
540
|
+
cancelAnimationFrame(P), cancelAnimationFrame(m);
|
|
572
541
|
};
|
|
573
|
-
}, [
|
|
574
|
-
const
|
|
542
|
+
}, [w]);
|
|
543
|
+
const oe = E(
|
|
575
544
|
(r) => {
|
|
576
|
-
|
|
545
|
+
O(ie(ht(r, v), i, v));
|
|
577
546
|
},
|
|
578
|
-
[
|
|
579
|
-
), { onKeyDown:
|
|
580
|
-
|
|
581
|
-
if (!
|
|
582
|
-
const r = setTimeout(() =>
|
|
547
|
+
[i, v]
|
|
548
|
+
), { onKeyDown: ze } = we({ go: K, jump: oe, total: i, rtl: l });
|
|
549
|
+
C(() => {
|
|
550
|
+
if (!p || ae) return;
|
|
551
|
+
const r = setTimeout(() => K(1), g);
|
|
583
552
|
return () => clearTimeout(r);
|
|
584
|
-
}, [
|
|
585
|
-
const
|
|
586
|
-
|
|
587
|
-
},
|
|
588
|
-
const
|
|
589
|
-
if (!
|
|
590
|
-
const
|
|
591
|
-
return { x: Math.max(-
|
|
553
|
+
}, [p, g, ae, R, K]);
|
|
554
|
+
const Se = () => $((r) => Math.min(ee, r + ke)), $e = () => $((r) => Math.max(J, r - ke)), Ae = () => {
|
|
555
|
+
w || $((r) => r > J ? J : ee);
|
|
556
|
+
}, Fe = () => y((r) => (r + 90) % 360), Me = f === 90 || f === 270 ? fe : 1, re = E((r, m, P) => {
|
|
557
|
+
const le = F.current;
|
|
558
|
+
if (!le || P <= 1) return { x: 0, y: 0 };
|
|
559
|
+
const be = (P - 1) * le.clientWidth / 2, he = (P - 1) * le.clientHeight / 2;
|
|
560
|
+
return { x: Math.max(-be, Math.min(be, r)), y: Math.max(-he, Math.min(he, m)) };
|
|
592
561
|
}, []);
|
|
593
|
-
|
|
594
|
-
const
|
|
595
|
-
var m,
|
|
596
|
-
|
|
597
|
-
},
|
|
598
|
-
const m =
|
|
599
|
-
m &&
|
|
600
|
-
},
|
|
601
|
-
if (
|
|
602
|
-
|
|
562
|
+
C(() => z((r) => re(r.x, r.y, x)), [x, re]), C(() => z({ x: 0, y: 0 }), [R]);
|
|
563
|
+
const Ee = (r) => {
|
|
564
|
+
var m, P;
|
|
565
|
+
x <= 1 || (S.current = { x: r.clientX, y: r.clientY, px: A.x, py: A.y }, N(!0), (P = (m = r.currentTarget).setPointerCapture) == null || P.call(m, r.pointerId));
|
|
566
|
+
}, Le = (r) => {
|
|
567
|
+
const m = S.current;
|
|
568
|
+
m && z(re(m.px + (r.clientX - m.x), m.py + (r.clientY - m.y), x));
|
|
569
|
+
}, me = (r) => {
|
|
570
|
+
if (S.current) {
|
|
571
|
+
S.current = null, N(!1);
|
|
603
572
|
try {
|
|
604
573
|
r.currentTarget.releasePointerCapture(r.pointerId);
|
|
605
574
|
} catch {
|
|
606
575
|
}
|
|
607
576
|
}
|
|
608
|
-
},
|
|
609
|
-
["left",
|
|
610
|
-
["right",
|
|
577
|
+
}, W = Ne(R, i, v), Q = W[0] ?? 0, De = v === "double" && W.length === 2 ? `${W[0] + 1} - ${W[1] + 1} / ${i}` : `${Q + 1} / ${i}`, Oe = ne <= 1 ? 100 : R / (ne - 1) * 100, Re = n.prev, Be = n.next, Ue = w ? w.to : R, H = te(Ue, i, v), Ze = H.left < 0 && H.right >= 0, He = H.left >= 0 && H.right < 0, Ge = H.left >= 0 && H.right >= 0, je = Ze ? "-25%" : He ? "25%" : "0%", B = te(R, i, v), V = w ? te(w.to, i, v) : B, Ve = w ? w.dir === 1 ? B.right >= 0 ? B.right : B.left : B.left >= 0 ? B.left : B.right : Q, Xe = w ? w.dir === 1 ? V.left >= 0 ? V.left : V.right : V.right >= 0 ? V.right : V.left : Q, Ke = w ? w.dir === 1 ? "left" : "right" : null, pe = (r) => r === Ke ? B[r] : H[r], We = [
|
|
578
|
+
["left", pe("left")],
|
|
579
|
+
["right", pe("right")]
|
|
611
580
|
];
|
|
612
|
-
return /* @__PURE__ */
|
|
613
|
-
/* @__PURE__ */
|
|
581
|
+
return /* @__PURE__ */ _(Ye, { children: [
|
|
582
|
+
/* @__PURE__ */ _(
|
|
614
583
|
"div",
|
|
615
584
|
{
|
|
616
|
-
ref:
|
|
585
|
+
ref: F,
|
|
617
586
|
className: "peeek__stage",
|
|
618
|
-
"data-layout":
|
|
587
|
+
"data-layout": v,
|
|
619
588
|
tabIndex: 0,
|
|
620
|
-
onKeyDown:
|
|
621
|
-
|
|
622
|
-
onPointerLeave: () => E(null),
|
|
623
|
-
style: { "--peeek-aspect": `${he}` },
|
|
589
|
+
onKeyDown: ze,
|
|
590
|
+
style: { "--peeek-aspect": `${fe}` },
|
|
624
591
|
children: [
|
|
625
|
-
|
|
592
|
+
s.arrows && /* @__PURE__ */ o(
|
|
626
593
|
"button",
|
|
627
594
|
{
|
|
628
595
|
type: "button",
|
|
629
596
|
className: "peeek__arrow peeek__arrow--prev",
|
|
630
|
-
"aria-label":
|
|
631
|
-
disabled:
|
|
632
|
-
onClick: () =>
|
|
597
|
+
"aria-label": Re,
|
|
598
|
+
disabled: Ie,
|
|
599
|
+
onClick: () => K(-1),
|
|
633
600
|
children: "‹"
|
|
634
601
|
}
|
|
635
602
|
),
|
|
636
|
-
/* @__PURE__ */
|
|
603
|
+
/* @__PURE__ */ o(
|
|
637
604
|
"div",
|
|
638
605
|
{
|
|
639
|
-
className: `peeek__zoom${
|
|
606
|
+
className: `peeek__zoom${x > 1 ? " peeek__zoom--pannable" : ""}`,
|
|
640
607
|
style: {
|
|
641
|
-
transform: `translate(${
|
|
642
|
-
transition:
|
|
608
|
+
transform: `translate(${A.x}px, ${A.y}px) scale(${x * Me}) rotate(${f}deg)`,
|
|
609
|
+
transition: D || Z ? "none" : void 0
|
|
643
610
|
},
|
|
644
|
-
onDoubleClick:
|
|
645
|
-
onPointerDown:
|
|
646
|
-
onPointerMove:
|
|
647
|
-
onPointerUp:
|
|
648
|
-
onPointerCancel:
|
|
649
|
-
children: /* @__PURE__ */
|
|
611
|
+
onDoubleClick: Ae,
|
|
612
|
+
onPointerDown: Ee,
|
|
613
|
+
onPointerMove: Le,
|
|
614
|
+
onPointerUp: me,
|
|
615
|
+
onPointerCancel: me,
|
|
616
|
+
children: /* @__PURE__ */ _(
|
|
650
617
|
"div",
|
|
651
618
|
{
|
|
652
|
-
className: `peeek__spread${c ? " peeek--shadows" : ""}${
|
|
653
|
-
style: { transform: `translateX(${
|
|
619
|
+
className: `peeek__spread${c ? " peeek--shadows" : ""}${Ge ? " peeek__spread--pair" : ""}`,
|
|
620
|
+
style: { transform: `translateX(${je})` },
|
|
654
621
|
children: [
|
|
655
|
-
|
|
656
|
-
const
|
|
657
|
-
return /* @__PURE__ */
|
|
622
|
+
We.map(([r, m]) => {
|
|
623
|
+
const P = m >= 0 && s.fullscreen && !h && !w && x === 1;
|
|
624
|
+
return /* @__PURE__ */ o(
|
|
658
625
|
"div",
|
|
659
626
|
{
|
|
660
627
|
className: `peeek__page peeek__page--${r}${m < 0 ? " peeek__page--empty" : ""}`,
|
|
661
|
-
children: m >= 0 && (
|
|
628
|
+
children: m >= 0 && (P ? /* @__PURE__ */ o(
|
|
662
629
|
"button",
|
|
663
630
|
{
|
|
664
631
|
type: "button",
|
|
665
632
|
className: "peeek__page-btn",
|
|
666
633
|
"aria-label": n.openFullscreen,
|
|
667
|
-
onClick:
|
|
668
|
-
children: /* @__PURE__ */
|
|
634
|
+
onClick: d,
|
|
635
|
+
children: /* @__PURE__ */ o("img", { src: e[m], alt: `Page ${m + 1}`, loading: "lazy", referrerPolicy: "no-referrer" })
|
|
669
636
|
}
|
|
670
|
-
) : /* @__PURE__ */
|
|
637
|
+
) : /* @__PURE__ */ o("img", { src: e[m], alt: `Page ${m + 1}`, loading: "lazy", referrerPolicy: "no-referrer" }))
|
|
671
638
|
},
|
|
672
639
|
r
|
|
673
640
|
);
|
|
674
641
|
}),
|
|
675
|
-
|
|
642
|
+
w && /* @__PURE__ */ _(
|
|
676
643
|
"div",
|
|
677
644
|
{
|
|
678
|
-
ref:
|
|
679
|
-
className: `peeek__leaf peeek__leaf--${
|
|
680
|
-
onTransitionEnd:
|
|
645
|
+
ref: ge,
|
|
646
|
+
className: `peeek__leaf peeek__leaf--${w.dir === 1 ? "fwd" : "back"}`,
|
|
647
|
+
onTransitionEnd: xe,
|
|
681
648
|
children: [
|
|
682
|
-
/* @__PURE__ */
|
|
683
|
-
/* @__PURE__ */
|
|
649
|
+
/* @__PURE__ */ o("div", { className: "peeek__leaf-face peeek__leaf-face--front", children: /* @__PURE__ */ o("img", { src: e[Ve], alt: "", referrerPolicy: "no-referrer" }) }),
|
|
650
|
+
/* @__PURE__ */ o("div", { className: "peeek__leaf-face peeek__leaf-face--back", children: /* @__PURE__ */ o("img", { src: e[Xe], alt: "", referrerPolicy: "no-referrer" }) })
|
|
684
651
|
]
|
|
685
652
|
}
|
|
686
|
-
)
|
|
687
|
-
i.curl && I === 1 && !v && /* @__PURE__ */ h(ne, { children: [
|
|
688
|
-
!ee && /* @__PURE__ */ h(ne, { children: [
|
|
689
|
-
/* @__PURE__ */ a(ae, { corner: "tr", pointer: M, instant: z, onActivate: () => L(1) }),
|
|
690
|
-
/* @__PURE__ */ a(ae, { corner: "br", pointer: M, instant: z, onActivate: () => L(1) })
|
|
691
|
-
] }),
|
|
692
|
-
!_e && /* @__PURE__ */ h(ne, { children: [
|
|
693
|
-
/* @__PURE__ */ a(ae, { corner: "tl", pointer: M, instant: z, onActivate: () => L(-1) }),
|
|
694
|
-
/* @__PURE__ */ a(ae, { corner: "bl", pointer: M, instant: z, onActivate: () => L(-1) })
|
|
695
|
-
] })
|
|
696
|
-
] })
|
|
653
|
+
)
|
|
697
654
|
]
|
|
698
655
|
}
|
|
699
656
|
)
|
|
700
657
|
}
|
|
701
658
|
),
|
|
702
|
-
|
|
659
|
+
s.arrows && /* @__PURE__ */ o(
|
|
703
660
|
"button",
|
|
704
661
|
{
|
|
705
662
|
type: "button",
|
|
706
663
|
className: "peeek__arrow peeek__arrow--next",
|
|
707
|
-
"aria-label":
|
|
708
|
-
disabled:
|
|
709
|
-
onClick: () =>
|
|
664
|
+
"aria-label": Be,
|
|
665
|
+
disabled: ae,
|
|
666
|
+
onClick: () => K(1),
|
|
710
667
|
children: "›"
|
|
711
668
|
}
|
|
712
669
|
)
|
|
713
670
|
]
|
|
714
671
|
}
|
|
715
672
|
),
|
|
716
|
-
|
|
717
|
-
|
|
673
|
+
s.toolbar && /* @__PURE__ */ o(
|
|
674
|
+
_t,
|
|
718
675
|
{
|
|
719
676
|
strings: n,
|
|
720
|
-
label:
|
|
721
|
-
progress:
|
|
722
|
-
zoom:
|
|
723
|
-
minZoom:
|
|
724
|
-
maxZoom:
|
|
725
|
-
total:
|
|
726
|
-
currentPage:
|
|
727
|
-
layout:
|
|
728
|
-
thumbsOpen:
|
|
729
|
-
isFullscreen:
|
|
677
|
+
label: De,
|
|
678
|
+
progress: Oe,
|
|
679
|
+
zoom: x,
|
|
680
|
+
minZoom: J,
|
|
681
|
+
maxZoom: ee,
|
|
682
|
+
total: i,
|
|
683
|
+
currentPage: Q + 1,
|
|
684
|
+
layout: v,
|
|
685
|
+
thumbsOpen: U,
|
|
686
|
+
isFullscreen: h,
|
|
730
687
|
downloadUrl: k,
|
|
731
688
|
show: {
|
|
732
|
-
bar:
|
|
733
|
-
fullscreen:
|
|
734
|
-
thumbnails:
|
|
735
|
-
about:
|
|
736
|
-
goto:
|
|
737
|
-
rotate:
|
|
738
|
-
layoutToggle:
|
|
689
|
+
bar: s.bar,
|
|
690
|
+
fullscreen: s.fullscreen,
|
|
691
|
+
thumbnails: s.thumbnails && s.overview,
|
|
692
|
+
about: s.about,
|
|
693
|
+
goto: s.goto,
|
|
694
|
+
rotate: s.rotate,
|
|
695
|
+
layoutToggle: s.layoutToggle
|
|
739
696
|
},
|
|
740
|
-
onZoomIn:
|
|
741
|
-
onZoomOut:
|
|
742
|
-
onZoomSet: (r) => $(Math.min(
|
|
743
|
-
onJump:
|
|
744
|
-
onRotate:
|
|
745
|
-
onToggleLayout:
|
|
746
|
-
onToggleThumbs: () =>
|
|
747
|
-
onToggleFullscreen:
|
|
748
|
-
onAbout:
|
|
697
|
+
onZoomIn: Se,
|
|
698
|
+
onZoomOut: $e,
|
|
699
|
+
onZoomSet: (r) => $(Math.min(ee, Math.max(J, r))),
|
|
700
|
+
onJump: oe,
|
|
701
|
+
onRotate: Fe,
|
|
702
|
+
onToggleLayout: Ce,
|
|
703
|
+
onToggleThumbs: () => X((r) => !r),
|
|
704
|
+
onToggleFullscreen: d,
|
|
705
|
+
onAbout: u
|
|
749
706
|
}
|
|
750
707
|
),
|
|
751
|
-
|
|
708
|
+
s.overview && U && /* @__PURE__ */ o(kt, { pages: e, layout: v, rtl: l, activePages: W, onJump: oe })
|
|
752
709
|
] });
|
|
753
710
|
}
|
|
754
|
-
function
|
|
711
|
+
function vt(t, e) {
|
|
755
712
|
const n = e.toLowerCase();
|
|
756
713
|
if (n.includes("pdf")) return "PDF";
|
|
757
714
|
if (n.includes("wordprocessingml")) return "DOCX";
|
|
758
715
|
if (n.includes("msword")) return "DOC";
|
|
759
|
-
const
|
|
760
|
-
return
|
|
716
|
+
const a = t.toLowerCase().split(".").pop() ?? "";
|
|
717
|
+
return a ? a.toUpperCase().slice(0, 4) : "FILE";
|
|
761
718
|
}
|
|
762
|
-
function
|
|
719
|
+
function wt(t, e) {
|
|
763
720
|
if (t === 0) return { transform: "translateX(0) scale(1)", zIndex: 30, opacity: 1 };
|
|
764
|
-
const n = t < 0 ? -1 : 1,
|
|
721
|
+
const n = t < 0 ? -1 : 1, a = e ? -1 : 1;
|
|
765
722
|
return {
|
|
766
|
-
transform: `translateX(${
|
|
723
|
+
transform: `translateX(${a * n * 62}%) scale(0.82) rotateY(${-a * n * 28}deg)`,
|
|
767
724
|
zIndex: 20 - Math.abs(t),
|
|
768
725
|
opacity: 0.55
|
|
769
726
|
};
|
|
770
727
|
}
|
|
771
|
-
function
|
|
728
|
+
function Tt(t) {
|
|
772
729
|
const {
|
|
773
730
|
pages: e,
|
|
774
731
|
strings: n,
|
|
775
|
-
filename:
|
|
732
|
+
filename: a,
|
|
776
733
|
mimeType: l,
|
|
777
734
|
rtl: c,
|
|
778
|
-
autoTransition:
|
|
779
|
-
autoTransitionInterval:
|
|
735
|
+
autoTransition: b,
|
|
736
|
+
autoTransitionInterval: p,
|
|
780
737
|
downloadUrl: g,
|
|
781
|
-
isFullscreen:
|
|
738
|
+
isFullscreen: s,
|
|
782
739
|
onToggleFullscreen: k,
|
|
783
|
-
onAbout:
|
|
784
|
-
show:
|
|
785
|
-
} = t,
|
|
786
|
-
(f) =>
|
|
787
|
-
[
|
|
788
|
-
),
|
|
789
|
-
(f) =>
|
|
790
|
-
[
|
|
791
|
-
),
|
|
792
|
-
|
|
793
|
-
var f,
|
|
794
|
-
(
|
|
795
|
-
}, [
|
|
796
|
-
if (!
|
|
797
|
-
const f = setTimeout(() =>
|
|
740
|
+
onAbout: h,
|
|
741
|
+
show: d
|
|
742
|
+
} = t, u = e.length, [i, L] = T(0), D = ve(), M = E(
|
|
743
|
+
(f) => L((y) => Math.max(0, Math.min(u - 1, y + f))),
|
|
744
|
+
[u]
|
|
745
|
+
), O = E(
|
|
746
|
+
(f) => L(Math.max(0, Math.min(u - 1, f))),
|
|
747
|
+
[u]
|
|
748
|
+
), x = i <= 0, $ = i >= u - 1, U = j([]);
|
|
749
|
+
C(() => {
|
|
750
|
+
var f, y;
|
|
751
|
+
(y = (f = U.current[i]) == null ? void 0 : f.scrollIntoView) == null || y.call(f, { behavior: "smooth", inline: "center", block: "nearest" });
|
|
752
|
+
}, [i]), C(() => {
|
|
753
|
+
if (!b || D || $) return;
|
|
754
|
+
const f = setTimeout(() => M(1), p);
|
|
798
755
|
return () => clearTimeout(f);
|
|
799
|
-
}, [
|
|
800
|
-
const { onKeyDown:
|
|
801
|
-
|
|
802
|
-
const
|
|
803
|
-
const f =
|
|
756
|
+
}, [b, p, D, $, i, M]);
|
|
757
|
+
const { onKeyDown: X } = we({ go: M, jump: O, total: u, rtl: c }), [A, z] = T(String(i + 1));
|
|
758
|
+
C(() => z(String(i + 1)), [i]);
|
|
759
|
+
const Z = () => {
|
|
760
|
+
const f = Te(A, u);
|
|
804
761
|
if (f === null) {
|
|
805
|
-
|
|
762
|
+
z(String(i + 1));
|
|
806
763
|
return;
|
|
807
764
|
}
|
|
808
|
-
|
|
809
|
-
},
|
|
810
|
-
return /* @__PURE__ */
|
|
811
|
-
/* @__PURE__ */
|
|
812
|
-
/* @__PURE__ */
|
|
813
|
-
/* @__PURE__ */
|
|
814
|
-
/* @__PURE__ */
|
|
815
|
-
/* @__PURE__ */
|
|
816
|
-
|
|
765
|
+
O(f);
|
|
766
|
+
}, N = vt(a, l);
|
|
767
|
+
return /* @__PURE__ */ _("div", { className: "peeek__cf", children: [
|
|
768
|
+
/* @__PURE__ */ _("div", { className: "peeek__cf-header", children: [
|
|
769
|
+
/* @__PURE__ */ o("span", { className: "peeek__cf-badge", children: N }),
|
|
770
|
+
/* @__PURE__ */ _("div", { className: "peeek__cf-meta", children: [
|
|
771
|
+
/* @__PURE__ */ o("span", { className: "peeek__cf-name", children: a }),
|
|
772
|
+
/* @__PURE__ */ _("span", { className: "peeek__cf-count", children: [
|
|
773
|
+
u,
|
|
817
774
|
" ",
|
|
818
|
-
|
|
775
|
+
u === 1 ? n.page : n.pages
|
|
819
776
|
] })
|
|
820
777
|
] }),
|
|
821
|
-
/* @__PURE__ */
|
|
822
|
-
|
|
778
|
+
/* @__PURE__ */ _("span", { className: "peeek__cf-indicator", children: [
|
|
779
|
+
i + 1,
|
|
823
780
|
" / ",
|
|
824
|
-
|
|
781
|
+
u
|
|
825
782
|
] }),
|
|
826
|
-
|
|
783
|
+
d.goto && /* @__PURE__ */ o(
|
|
827
784
|
"input",
|
|
828
785
|
{
|
|
829
786
|
className: "peeek__goto",
|
|
830
787
|
type: "text",
|
|
831
788
|
inputMode: "numeric",
|
|
832
789
|
"aria-label": n.goToPage,
|
|
833
|
-
value:
|
|
834
|
-
onChange: (f) =>
|
|
835
|
-
onBlur:
|
|
790
|
+
value: A,
|
|
791
|
+
onChange: (f) => z(f.target.value),
|
|
792
|
+
onBlur: Z,
|
|
836
793
|
onKeyDown: (f) => {
|
|
837
|
-
f.key === "Enter" && (f.preventDefault(),
|
|
794
|
+
f.key === "Enter" && (f.preventDefault(), Z());
|
|
838
795
|
}
|
|
839
796
|
}
|
|
840
797
|
),
|
|
841
|
-
g && /* @__PURE__ */
|
|
798
|
+
g && /* @__PURE__ */ o(
|
|
842
799
|
"a",
|
|
843
800
|
{
|
|
844
801
|
className: "peeek__btn",
|
|
@@ -850,107 +807,107 @@ function zt(t) {
|
|
|
850
807
|
children: "↓"
|
|
851
808
|
}
|
|
852
809
|
),
|
|
853
|
-
|
|
810
|
+
d.fullscreen && /* @__PURE__ */ o(
|
|
854
811
|
"button",
|
|
855
812
|
{
|
|
856
813
|
type: "button",
|
|
857
|
-
className: `peeek__btn${
|
|
814
|
+
className: `peeek__btn${s ? " peeek__btn--active" : ""}`,
|
|
858
815
|
"aria-label": n.fullscreen,
|
|
859
|
-
"aria-pressed":
|
|
816
|
+
"aria-pressed": s,
|
|
860
817
|
onClick: k,
|
|
861
818
|
children: "⛶"
|
|
862
819
|
}
|
|
863
820
|
),
|
|
864
|
-
|
|
821
|
+
d.about && /* @__PURE__ */ o(
|
|
865
822
|
"button",
|
|
866
823
|
{
|
|
867
824
|
type: "button",
|
|
868
825
|
className: "peeek__btn",
|
|
869
826
|
"aria-label": n.about,
|
|
870
|
-
onClick:
|
|
827
|
+
onClick: h,
|
|
871
828
|
children: "?"
|
|
872
829
|
}
|
|
873
830
|
)
|
|
874
831
|
] }),
|
|
875
|
-
/* @__PURE__ */
|
|
832
|
+
/* @__PURE__ */ _(
|
|
876
833
|
"div",
|
|
877
834
|
{
|
|
878
835
|
className: "peeek__cf-stage",
|
|
879
836
|
tabIndex: 0,
|
|
880
|
-
onKeyDown:
|
|
837
|
+
onKeyDown: X,
|
|
881
838
|
children: [
|
|
882
|
-
|
|
839
|
+
d.arrows && /* @__PURE__ */ o(
|
|
883
840
|
"button",
|
|
884
841
|
{
|
|
885
842
|
type: "button",
|
|
886
843
|
className: "peeek__arrow peeek__arrow--prev",
|
|
887
844
|
"aria-label": n.prev,
|
|
888
|
-
disabled:
|
|
889
|
-
onClick: () =>
|
|
845
|
+
disabled: x,
|
|
846
|
+
onClick: () => M(-1),
|
|
890
847
|
children: "‹"
|
|
891
848
|
}
|
|
892
849
|
),
|
|
893
|
-
e.map((f,
|
|
894
|
-
const
|
|
895
|
-
if (Math.abs(
|
|
896
|
-
const
|
|
897
|
-
return /* @__PURE__ */
|
|
850
|
+
e.map((f, y) => {
|
|
851
|
+
const S = y - i;
|
|
852
|
+
if (Math.abs(S) > 1) return null;
|
|
853
|
+
const F = S === 0, v = F && d.fullscreen;
|
|
854
|
+
return /* @__PURE__ */ o(
|
|
898
855
|
"button",
|
|
899
856
|
{
|
|
900
857
|
type: "button",
|
|
901
|
-
className: `peeek__cf-card${
|
|
902
|
-
style:
|
|
903
|
-
tabIndex:
|
|
904
|
-
"aria-label":
|
|
905
|
-
onClick: () =>
|
|
906
|
-
children: /* @__PURE__ */
|
|
858
|
+
className: `peeek__cf-card${F ? " peeek__cf-card--center" : ""}${v ? " peeek__cf-card--zoom" : ""}`,
|
|
859
|
+
style: wt(S, c),
|
|
860
|
+
tabIndex: F ? 0 : -1,
|
|
861
|
+
"aria-label": v ? n.openFullscreen : `Go to page ${y + 1}`,
|
|
862
|
+
onClick: () => v ? k() : L(y),
|
|
863
|
+
children: /* @__PURE__ */ o("img", { src: f, alt: F ? `Page ${y + 1}` : "", loading: "lazy", referrerPolicy: "no-referrer" })
|
|
907
864
|
},
|
|
908
|
-
|
|
865
|
+
y
|
|
909
866
|
);
|
|
910
867
|
}),
|
|
911
|
-
|
|
868
|
+
d.arrows && /* @__PURE__ */ o(
|
|
912
869
|
"button",
|
|
913
870
|
{
|
|
914
871
|
type: "button",
|
|
915
872
|
className: "peeek__arrow peeek__arrow--next",
|
|
916
873
|
"aria-label": n.next,
|
|
917
874
|
disabled: $,
|
|
918
|
-
onClick: () =>
|
|
875
|
+
onClick: () => M(1),
|
|
919
876
|
children: "›"
|
|
920
877
|
}
|
|
921
878
|
)
|
|
922
879
|
]
|
|
923
880
|
}
|
|
924
881
|
),
|
|
925
|
-
|
|
926
|
-
const
|
|
927
|
-
return /* @__PURE__ */
|
|
882
|
+
d.thumbnails && /* @__PURE__ */ o("div", { className: "peeek__cf-thumbs", role: "group", "aria-label": "Pages", children: e.map((f, y) => {
|
|
883
|
+
const S = y === i;
|
|
884
|
+
return /* @__PURE__ */ _(
|
|
928
885
|
"button",
|
|
929
886
|
{
|
|
930
|
-
ref: (
|
|
931
|
-
|
|
887
|
+
ref: (F) => {
|
|
888
|
+
U.current[y] = F;
|
|
932
889
|
},
|
|
933
890
|
type: "button",
|
|
934
|
-
className: `peeek__cf-thumb${
|
|
935
|
-
"aria-label": `Go to page ${
|
|
936
|
-
"aria-current":
|
|
937
|
-
onClick: () =>
|
|
891
|
+
className: `peeek__cf-thumb${S ? " peeek__cf-thumb--active" : ""}`,
|
|
892
|
+
"aria-label": `Go to page ${y + 1}`,
|
|
893
|
+
"aria-current": S ? "page" : void 0,
|
|
894
|
+
onClick: () => L(y),
|
|
938
895
|
children: [
|
|
939
|
-
/* @__PURE__ */
|
|
940
|
-
/* @__PURE__ */
|
|
896
|
+
/* @__PURE__ */ o("img", { src: f, alt: "", loading: "lazy", referrerPolicy: "no-referrer" }),
|
|
897
|
+
/* @__PURE__ */ o("span", { className: "peeek__cf-thumb-num", children: String(y + 1).padStart(2, "0") })
|
|
941
898
|
]
|
|
942
899
|
},
|
|
943
|
-
|
|
900
|
+
y
|
|
944
901
|
);
|
|
945
902
|
}) })
|
|
946
903
|
] });
|
|
947
904
|
}
|
|
948
|
-
function
|
|
905
|
+
function Nt({ logo: t, logoLink: e }) {
|
|
949
906
|
if (!t) return null;
|
|
950
|
-
const n = /* @__PURE__ */
|
|
951
|
-
return /* @__PURE__ */
|
|
907
|
+
const n = /* @__PURE__ */ o("img", { src: t, alt: "Logo", loading: "lazy", referrerPolicy: "no-referrer" });
|
|
908
|
+
return /* @__PURE__ */ o("div", { className: "peeek__branding", children: e ? /* @__PURE__ */ o("a", { href: e, target: "_blank", rel: "noopener noreferrer", children: n }) : n });
|
|
952
909
|
}
|
|
953
|
-
const
|
|
910
|
+
const Ct = [
|
|
954
911
|
{ top: "12%", left: "10%", size: 3, v: "A", dur: 13, delay: 0 },
|
|
955
912
|
{ top: "22%", left: "82%", size: 2, v: "B", dur: 16, delay: 2 },
|
|
956
913
|
{ top: "40%", left: "16%", size: 2, v: "C", dur: 12, delay: 1 },
|
|
@@ -964,40 +921,40 @@ const Mt = [
|
|
|
964
921
|
{ top: "16%", left: "50%", size: 2, v: "B", dur: 14, delay: 3 },
|
|
965
922
|
{ top: "62%", left: "34%", size: 2, v: "C", dur: 12, delay: 2 }
|
|
966
923
|
];
|
|
967
|
-
function
|
|
968
|
-
const n =
|
|
969
|
-
return
|
|
970
|
-
var
|
|
971
|
-
(
|
|
972
|
-
}, []),
|
|
973
|
-
const
|
|
924
|
+
function Pt({ strings: t, onClose: e }) {
|
|
925
|
+
const n = j(null);
|
|
926
|
+
return C(() => {
|
|
927
|
+
var a;
|
|
928
|
+
(a = n.current) == null || a.focus();
|
|
929
|
+
}, []), C(() => {
|
|
930
|
+
const a = (l) => {
|
|
974
931
|
l.key === "Escape" && e();
|
|
975
932
|
};
|
|
976
|
-
return document.addEventListener("keydown",
|
|
977
|
-
}, [e]), /* @__PURE__ */
|
|
933
|
+
return document.addEventListener("keydown", a), () => document.removeEventListener("keydown", a);
|
|
934
|
+
}, [e]), /* @__PURE__ */ o("div", { className: "peeek__about-backdrop", onClick: e, children: /* @__PURE__ */ _(
|
|
978
935
|
"div",
|
|
979
936
|
{
|
|
980
937
|
role: "dialog",
|
|
981
938
|
"aria-modal": "true",
|
|
982
939
|
"aria-label": "Peeek Viewer",
|
|
983
940
|
className: "peeek__about",
|
|
984
|
-
onClick: (
|
|
941
|
+
onClick: (a) => a.stopPropagation(),
|
|
985
942
|
children: [
|
|
986
|
-
/* @__PURE__ */
|
|
943
|
+
/* @__PURE__ */ o("span", { className: "peeek__about-particles", "aria-hidden": "true", children: Ct.map((a, l) => /* @__PURE__ */ o(
|
|
987
944
|
"span",
|
|
988
945
|
{
|
|
989
946
|
className: "peeek__about-particle",
|
|
990
947
|
style: {
|
|
991
|
-
top:
|
|
992
|
-
left:
|
|
993
|
-
width:
|
|
994
|
-
height:
|
|
995
|
-
animation: `peeekAboutDrift${
|
|
948
|
+
top: a.top,
|
|
949
|
+
left: a.left,
|
|
950
|
+
width: a.size,
|
|
951
|
+
height: a.size,
|
|
952
|
+
animation: `peeekAboutDrift${a.v} ${a.dur}s ease-in-out ${a.delay}s infinite`
|
|
996
953
|
}
|
|
997
954
|
},
|
|
998
955
|
l
|
|
999
956
|
)) }),
|
|
1000
|
-
/* @__PURE__ */
|
|
957
|
+
/* @__PURE__ */ o(
|
|
1001
958
|
"button",
|
|
1002
959
|
{
|
|
1003
960
|
ref: n,
|
|
@@ -1008,10 +965,10 @@ function $t({ strings: t, onClose: e }) {
|
|
|
1008
965
|
children: "×"
|
|
1009
966
|
}
|
|
1010
967
|
),
|
|
1011
|
-
/* @__PURE__ */
|
|
1012
|
-
/* @__PURE__ */
|
|
1013
|
-
/* @__PURE__ */
|
|
1014
|
-
/* @__PURE__ */
|
|
968
|
+
/* @__PURE__ */ _("div", { className: "peeek__about-content", children: [
|
|
969
|
+
/* @__PURE__ */ _("div", { className: "peeek__about-orbwrap", children: [
|
|
970
|
+
/* @__PURE__ */ o("span", { className: "peeek__about-ring", "aria-hidden": "true" }),
|
|
971
|
+
/* @__PURE__ */ _(
|
|
1015
972
|
"svg",
|
|
1016
973
|
{
|
|
1017
974
|
className: "peeek__about-mark",
|
|
@@ -1020,13 +977,13 @@ function $t({ strings: t, onClose: e }) {
|
|
|
1020
977
|
viewBox: "0 0 256 256",
|
|
1021
978
|
"aria-hidden": "true",
|
|
1022
979
|
children: [
|
|
1023
|
-
/* @__PURE__ */
|
|
1024
|
-
/* @__PURE__ */
|
|
1025
|
-
/* @__PURE__ */
|
|
1026
|
-
/* @__PURE__ */
|
|
980
|
+
/* @__PURE__ */ o("defs", { children: /* @__PURE__ */ _("radialGradient", { id: "peeek-about-orb", cx: "38%", cy: "30%", r: "80%", children: [
|
|
981
|
+
/* @__PURE__ */ o("stop", { offset: "0%", stopColor: "#9aa2e6" }),
|
|
982
|
+
/* @__PURE__ */ o("stop", { offset: "55%", stopColor: "#6E79D6" }),
|
|
983
|
+
/* @__PURE__ */ o("stop", { offset: "100%", stopColor: "#535cc0" })
|
|
1027
984
|
] }) }),
|
|
1028
|
-
/* @__PURE__ */
|
|
1029
|
-
/* @__PURE__ */
|
|
985
|
+
/* @__PURE__ */ o("circle", { cx: "128", cy: "128", r: "128", fill: "url(#peeek-about-orb)" }),
|
|
986
|
+
/* @__PURE__ */ o(
|
|
1030
987
|
"path",
|
|
1031
988
|
{
|
|
1032
989
|
d: "M90 196 V70 H140 A38 38 0 0 1 140 146 H90",
|
|
@@ -1041,27 +998,27 @@ function $t({ strings: t, onClose: e }) {
|
|
|
1041
998
|
}
|
|
1042
999
|
)
|
|
1043
1000
|
] }),
|
|
1044
|
-
/* @__PURE__ */
|
|
1045
|
-
/* @__PURE__ */
|
|
1046
|
-
/* @__PURE__ */
|
|
1001
|
+
/* @__PURE__ */ o("div", { className: "peeek__about-name", children: "Peeek Viewer" }),
|
|
1002
|
+
/* @__PURE__ */ o("div", { className: "peeek__about-tagline", children: t.aboutTagline }),
|
|
1003
|
+
/* @__PURE__ */ _("div", { className: "peeek__about-version", children: [
|
|
1047
1004
|
"v",
|
|
1048
|
-
"0.4.
|
|
1005
|
+
"0.4.1"
|
|
1049
1006
|
] }),
|
|
1050
|
-
/* @__PURE__ */
|
|
1007
|
+
/* @__PURE__ */ o("p", { className: "peeek__about-desc", children: t.aboutDescription })
|
|
1051
1008
|
] })
|
|
1052
1009
|
]
|
|
1053
1010
|
}
|
|
1054
1011
|
) });
|
|
1055
1012
|
}
|
|
1056
|
-
function
|
|
1057
|
-
const e =
|
|
1058
|
-
() => g ?
|
|
1013
|
+
function St(t) {
|
|
1014
|
+
const e = ut(t), n = st(e.language), a = j(null), { isFullscreen: l, toggle: c } = mt(a), [b, p] = T(!1), g = t.pages !== void 0, s = qe(
|
|
1015
|
+
() => g ? gt(t.pages, { filename: t.filename, mimeType: t.mimeType }) : null,
|
|
1059
1016
|
[g, t.pages, t.filename, t.mimeType]
|
|
1060
|
-
), k =
|
|
1017
|
+
), k = ft(g ? null : e.src, e.pollInterval), h = g ? s : k.manifest, d = g ? s ? "ready" : "loading" : k.state, u = {
|
|
1061
1018
|
"--peeek-accent": e.accentColor
|
|
1062
1019
|
};
|
|
1063
|
-
e.background === "transparent" ?
|
|
1064
|
-
const
|
|
1020
|
+
e.background === "transparent" ? u["--peeek-bg"] = "transparent" : e.background === "color" && e.backgroundColor ? u["--peeek-bg"] = e.backgroundColor : e.background === "image" && e.backgroundImage && (u["--peeek-bg"] = `center / cover no-repeat url("${e.backgroundImage}")`);
|
|
1021
|
+
const i = {
|
|
1065
1022
|
toolbar: e.navigationControls,
|
|
1066
1023
|
bar: e.navigationBar,
|
|
1067
1024
|
fullscreen: e.fullscreen,
|
|
@@ -1071,46 +1028,45 @@ function Lt(t) {
|
|
|
1071
1028
|
about: e.aboutButton,
|
|
1072
1029
|
goto: e.goToPage,
|
|
1073
1030
|
rotate: e.rotateControl,
|
|
1074
|
-
layoutToggle: e.layoutToggle
|
|
1075
|
-
curl: e.pageCurl
|
|
1031
|
+
layoutToggle: e.layoutToggle
|
|
1076
1032
|
};
|
|
1077
|
-
return /* @__PURE__ */
|
|
1033
|
+
return /* @__PURE__ */ _(
|
|
1078
1034
|
"div",
|
|
1079
1035
|
{
|
|
1080
|
-
ref:
|
|
1036
|
+
ref: a,
|
|
1081
1037
|
className: `peeek${e.fillHeight ? " peeek--fill-height" : ""}${e.className ? " " + e.className : ""}`,
|
|
1082
1038
|
"data-skin": e.skin,
|
|
1083
1039
|
"data-layout": e.layout,
|
|
1084
1040
|
dir: e.rtl ? "rtl" : void 0,
|
|
1085
|
-
style:
|
|
1041
|
+
style: u,
|
|
1086
1042
|
children: [
|
|
1087
|
-
/* @__PURE__ */
|
|
1088
|
-
|
|
1089
|
-
e.loadingImage && /* @__PURE__ */
|
|
1090
|
-
/* @__PURE__ */
|
|
1043
|
+
/* @__PURE__ */ o(Nt, { logo: e.logo, logoLink: e.logoLink }),
|
|
1044
|
+
d === "loading" && /* @__PURE__ */ _("div", { className: "peeek__state", style: e.loadingColor ? { color: e.loadingColor } : void 0, children: [
|
|
1045
|
+
e.loadingImage && /* @__PURE__ */ o("img", { className: "peeek__state-img", src: e.loadingImage, alt: "", referrerPolicy: "no-referrer" }),
|
|
1046
|
+
/* @__PURE__ */ o("span", { children: e.loadingCaption ?? n.loading })
|
|
1091
1047
|
] }),
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1048
|
+
d === "error" && /* @__PURE__ */ o("div", { className: "peeek__state", children: n.error }),
|
|
1049
|
+
d === "ready" && h && e.mode === "coverflow" && /* @__PURE__ */ o(
|
|
1050
|
+
Tt,
|
|
1095
1051
|
{
|
|
1096
|
-
pages:
|
|
1052
|
+
pages: h.pages,
|
|
1097
1053
|
strings: n,
|
|
1098
|
-
filename:
|
|
1099
|
-
mimeType:
|
|
1054
|
+
filename: h.metadata.filename,
|
|
1055
|
+
mimeType: h.metadata.mimeType,
|
|
1100
1056
|
rtl: e.rtl,
|
|
1101
1057
|
autoTransition: e.autoTransition,
|
|
1102
1058
|
autoTransitionInterval: e.autoTransitionInterval,
|
|
1103
1059
|
downloadUrl: e.downloadUrl,
|
|
1104
1060
|
isFullscreen: l,
|
|
1105
1061
|
onToggleFullscreen: c,
|
|
1106
|
-
onAbout: () =>
|
|
1062
|
+
onAbout: () => p(!0),
|
|
1107
1063
|
show: { arrows: e.arrows, thumbnails: e.pagesOverview, fullscreen: e.fullscreen, about: e.aboutButton, goto: e.goToPage }
|
|
1108
1064
|
}
|
|
1109
1065
|
),
|
|
1110
|
-
|
|
1111
|
-
|
|
1066
|
+
d === "ready" && h && e.mode === "flip" && /* @__PURE__ */ o(
|
|
1067
|
+
yt,
|
|
1112
1068
|
{
|
|
1113
|
-
pages:
|
|
1069
|
+
pages: h.pages,
|
|
1114
1070
|
strings: n,
|
|
1115
1071
|
layout: e.layout,
|
|
1116
1072
|
rtl: e.rtl,
|
|
@@ -1118,18 +1074,18 @@ function Lt(t) {
|
|
|
1118
1074
|
animateInteractions: e.animateInteractions,
|
|
1119
1075
|
autoTransition: e.autoTransition,
|
|
1120
1076
|
autoTransitionInterval: e.autoTransitionInterval,
|
|
1121
|
-
show:
|
|
1077
|
+
show: i,
|
|
1122
1078
|
downloadUrl: e.downloadUrl,
|
|
1123
1079
|
isFullscreen: l,
|
|
1124
1080
|
onToggleFullscreen: c,
|
|
1125
|
-
onAbout: () =>
|
|
1081
|
+
onAbout: () => p(!0)
|
|
1126
1082
|
}
|
|
1127
1083
|
),
|
|
1128
|
-
|
|
1084
|
+
b && /* @__PURE__ */ o(Pt, { strings: n, onClose: () => p(!1) })
|
|
1129
1085
|
]
|
|
1130
1086
|
}
|
|
1131
1087
|
);
|
|
1132
1088
|
}
|
|
1133
1089
|
export {
|
|
1134
|
-
|
|
1090
|
+
St as PeeekViewer
|
|
1135
1091
|
};
|