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