@eternalheart/react-file-preview 1.5.0 → 1.5.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/lib/chunks/{index-CTghYlSh.mjs → index-37FMdXja.mjs} +2 -2
- package/lib/chunks/{index-CTghYlSh.mjs.map → index-37FMdXja.mjs.map} +1 -1
- package/lib/chunks/{index-Dc6q1OKl.mjs → index-7aRho9r4.mjs} +3 -3
- package/lib/chunks/{index-Dc6q1OKl.mjs.map → index-7aRho9r4.mjs.map} +1 -1
- package/lib/chunks/{index-Da3FN2-3.mjs → index-BXa7r4uK.mjs} +3 -3
- package/lib/chunks/{index-Da3FN2-3.mjs.map → index-BXa7r4uK.mjs.map} +1 -1
- package/lib/chunks/{index-CKdQL1Bk.mjs → index-BaSsmMZP.mjs} +2 -2
- package/lib/chunks/{index-CKdQL1Bk.mjs.map → index-BaSsmMZP.mjs.map} +1 -1
- package/lib/chunks/{index-DzCLf1Db.mjs → index-Bn0NJNzq.mjs} +2 -2
- package/lib/chunks/{index-DzCLf1Db.mjs.map → index-Bn0NJNzq.mjs.map} +1 -1
- package/lib/chunks/{index-CQYrhe7Z.mjs → index-Btsr3v83.mjs} +2 -2
- package/lib/chunks/{index-CQYrhe7Z.mjs.map → index-Btsr3v83.mjs.map} +1 -1
- package/lib/chunks/{index-CuWzRQZw.mjs → index-C2uu09Eb.mjs} +2 -2
- package/lib/chunks/{index-CuWzRQZw.mjs.map → index-C2uu09Eb.mjs.map} +1 -1
- package/lib/chunks/{index-CRZqNMQ7.mjs → index-C5o_T3Es.mjs} +18 -19
- package/lib/chunks/index-C5o_T3Es.mjs.map +1 -0
- package/lib/chunks/index-CMehLA91.mjs +587 -0
- package/lib/chunks/index-CMehLA91.mjs.map +1 -0
- package/lib/chunks/{index-2sX2d4iv.mjs → index-CTEgp9x8.mjs} +2 -2
- package/lib/chunks/{index-2sX2d4iv.mjs.map → index-CTEgp9x8.mjs.map} +1 -1
- package/lib/chunks/{index-Cz23v-TW.mjs → index-Cbp94jbP.mjs} +20 -20
- package/lib/chunks/{index-Cz23v-TW.mjs.map → index-Cbp94jbP.mjs.map} +1 -1
- package/lib/chunks/{index-Bdj8_B80.mjs → index-CmK5E5Oa.mjs} +3 -3
- package/lib/chunks/{index-Bdj8_B80.mjs.map → index-CmK5E5Oa.mjs.map} +1 -1
- package/lib/chunks/index-CyBXARuf.mjs +5215 -0
- package/lib/chunks/index-CyBXARuf.mjs.map +1 -0
- package/lib/chunks/{index-WLepq2g2.mjs → index-DTNdG1bB.mjs} +3 -3
- package/lib/chunks/{index-WLepq2g2.mjs.map → index-DTNdG1bB.mjs.map} +1 -1
- package/lib/chunks/{index-CCcZzLUM.mjs → index-DfzgQFfx.mjs} +2 -2
- package/lib/chunks/{index-CCcZzLUM.mjs.map → index-DfzgQFfx.mjs.map} +1 -1
- package/lib/chunks/{index-D-Is8qvU.mjs → index-DsIUJXpz.mjs} +8 -9
- package/lib/chunks/index-DsIUJXpz.mjs.map +1 -0
- package/lib/chunks/{index-OXjOFggq.mjs → index-DxUP4apX.mjs} +2 -2
- package/lib/chunks/{index-OXjOFggq.mjs.map → index-DxUP4apX.mjs.map} +1 -1
- package/lib/chunks/{index-FomaQSaL.mjs → index-HRUhzosx.mjs} +2 -2
- package/lib/chunks/{index-FomaQSaL.mjs.map → index-HRUhzosx.mjs.map} +1 -1
- package/lib/chunks/{index-_B5marES.mjs → index-VnjkEX5p.mjs} +2 -2
- package/lib/chunks/{index-_B5marES.mjs.map → index-VnjkEX5p.mjs.map} +1 -1
- package/lib/chunks/{index-CuTz7dbd.mjs → index-qWLZuYn6.mjs} +2 -2
- package/lib/chunks/{index-CuTz7dbd.mjs.map → index-qWLZuYn6.mjs.map} +1 -1
- package/lib/chunks/{useShikiHighlight-Bbs8Fbqs.mjs → useShikiHighlight-BG7pCfB5.mjs} +2 -2
- package/lib/chunks/{useShikiHighlight-Bbs8Fbqs.mjs.map → useShikiHighlight-BG7pCfB5.mjs.map} +1 -1
- package/lib/index.cjs +20 -20
- package/lib/index.cjs.map +1 -1
- package/lib/index.css +1 -1
- package/lib/index.mjs +1 -1
- package/lib/renderers/Audio/index.d.ts.map +1 -1
- package/lib/renderers/Csv/index.d.ts +0 -1
- package/lib/renderers/Csv/index.d.ts.map +1 -1
- package/lib/renderers/Xlsx/index.d.ts +0 -1
- package/lib/renderers/Xlsx/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/lib/chunks/index-CRZqNMQ7.mjs.map +0 -1
- package/lib/chunks/index-D-Is8qvU.mjs.map +0 -1
- package/lib/chunks/index-DoGKcq9y.mjs +0 -531
- package/lib/chunks/index-DoGKcq9y.mjs.map +0 -1
|
@@ -0,0 +1,587 @@
|
|
|
1
|
+
import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as P, useState as l, useEffect as H, useCallback as C, forwardRef as te, useImperativeHandle as ae } from "react";
|
|
3
|
+
import { motion as m, AnimatePresence as ne } from "framer-motion";
|
|
4
|
+
import { Repeat as ie, SkipBack as se, Pause as oe, Play as le, SkipForward as ce, VolumeX as pe, Volume1 as fe, Volume2 as de } from "lucide-react";
|
|
5
|
+
import { u as ue } from "./index-Cbp94jbP.mjs";
|
|
6
|
+
import { R as me } from "./RendererError-D5i8eSpN.mjs";
|
|
7
|
+
function he({
|
|
8
|
+
url: f
|
|
9
|
+
}) {
|
|
10
|
+
const c = P(null), [G, i] = l(!1), [T, s] = l(!0), [I, v] = l(0), [b, p] = l(0), [u, h] = l(1), [y, w] = l(!1), [N, k] = l(!1), [V, L] = l(null);
|
|
11
|
+
H(() => {
|
|
12
|
+
const r = c.current;
|
|
13
|
+
if (!r) return;
|
|
14
|
+
s(!0), L(null);
|
|
15
|
+
const a = () => {
|
|
16
|
+
isNaN(r.currentTime) || v(r.currentTime);
|
|
17
|
+
}, o = () => {
|
|
18
|
+
!isNaN(r.duration) && isFinite(r.duration) && p(r.duration);
|
|
19
|
+
}, O = () => {
|
|
20
|
+
s(!1), o();
|
|
21
|
+
}, j = () => s(!0), g = () => {
|
|
22
|
+
s(!1), i(!0);
|
|
23
|
+
}, S = () => i(!0), W = () => i(!1), M = () => i(!1), F = () => {
|
|
24
|
+
L("音频加载失败"), s(!1);
|
|
25
|
+
};
|
|
26
|
+
return r.addEventListener("timeupdate", a), r.addEventListener("loadedmetadata", o), r.addEventListener("durationchange", o), r.addEventListener("canplay", O), r.addEventListener("waiting", j), r.addEventListener("playing", g), r.addEventListener("play", S), r.addEventListener("pause", W), r.addEventListener("ended", M), r.addEventListener("error", F), r.readyState >= 3 ? (s(!1), o()) : r.readyState >= 1 && o(), () => {
|
|
27
|
+
r.removeEventListener("timeupdate", a), r.removeEventListener("loadedmetadata", o), r.removeEventListener("durationchange", o), r.removeEventListener("canplay", O), r.removeEventListener("waiting", j), r.removeEventListener("playing", g), r.removeEventListener("play", S), r.removeEventListener("pause", W), r.removeEventListener("ended", M), r.removeEventListener("error", F);
|
|
28
|
+
};
|
|
29
|
+
}, [f]);
|
|
30
|
+
const B = C(() => {
|
|
31
|
+
const r = c.current;
|
|
32
|
+
r && (r.paused ? r.play().catch(() => {
|
|
33
|
+
}) : r.pause());
|
|
34
|
+
}, []), D = C((r) => {
|
|
35
|
+
const a = c.current;
|
|
36
|
+
a && (a.currentTime = r, v(r));
|
|
37
|
+
}, []), $ = C(
|
|
38
|
+
(r) => {
|
|
39
|
+
const a = c.current;
|
|
40
|
+
a && (a.currentTime = Math.max(
|
|
41
|
+
0,
|
|
42
|
+
Math.min(a.currentTime + r, a.duration || 1 / 0)
|
|
43
|
+
));
|
|
44
|
+
},
|
|
45
|
+
[]
|
|
46
|
+
), R = C((r) => {
|
|
47
|
+
const a = c.current;
|
|
48
|
+
if (!a) return;
|
|
49
|
+
const o = Math.max(0, Math.min(1, r));
|
|
50
|
+
a.volume = o, h(o), o > 0 && (a.muted = !1, w(!1));
|
|
51
|
+
}, []), t = C(() => {
|
|
52
|
+
const r = c.current;
|
|
53
|
+
r && (r.muted = !r.muted, w(r.muted));
|
|
54
|
+
}, []), z = C(() => {
|
|
55
|
+
const r = c.current;
|
|
56
|
+
if (!r) return;
|
|
57
|
+
const a = !r.loop;
|
|
58
|
+
r.loop = a, k(a);
|
|
59
|
+
}, []), E = C((r) => {
|
|
60
|
+
if (!isFinite(r) || isNaN(r) || r < 0) return "0:00";
|
|
61
|
+
const a = Math.floor(r / 60), o = Math.floor(r % 60);
|
|
62
|
+
return `${a}:${o.toString().padStart(2, "0")}`;
|
|
63
|
+
}, []);
|
|
64
|
+
return {
|
|
65
|
+
audioRef: c,
|
|
66
|
+
isPlaying: G,
|
|
67
|
+
isLoading: T,
|
|
68
|
+
isLoop: N,
|
|
69
|
+
currentTime: I,
|
|
70
|
+
duration: b,
|
|
71
|
+
volume: u,
|
|
72
|
+
isMuted: y,
|
|
73
|
+
error: V,
|
|
74
|
+
togglePlay: B,
|
|
75
|
+
seek: D,
|
|
76
|
+
skip: $,
|
|
77
|
+
setVolume: R,
|
|
78
|
+
toggleMute: t,
|
|
79
|
+
toggleLoop: z,
|
|
80
|
+
formatTime: E
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
const ge = ({ text: f, className: c = "", style: G }) => {
|
|
84
|
+
const i = P(null), T = P(null), [s, I] = l(!1), [v, b] = l(0);
|
|
85
|
+
H(() => {
|
|
86
|
+
const y = () => {
|
|
87
|
+
const N = i.current, k = T.current;
|
|
88
|
+
if (!N || !k) return;
|
|
89
|
+
const V = N.clientWidth, L = k.scrollWidth;
|
|
90
|
+
I(L > V), b(L);
|
|
91
|
+
};
|
|
92
|
+
y();
|
|
93
|
+
const w = new ResizeObserver(y);
|
|
94
|
+
return i.current && w.observe(i.current), () => w.disconnect();
|
|
95
|
+
}, [f]);
|
|
96
|
+
const p = 60, u = v + p, h = u / 40;
|
|
97
|
+
return /* @__PURE__ */ n(
|
|
98
|
+
"div",
|
|
99
|
+
{
|
|
100
|
+
ref: i,
|
|
101
|
+
className: `rfp-overflow-hidden rfp-whitespace-nowrap ${c}`,
|
|
102
|
+
style: G,
|
|
103
|
+
children: [
|
|
104
|
+
s ? /* @__PURE__ */ n(
|
|
105
|
+
m.div,
|
|
106
|
+
{
|
|
107
|
+
className: "rfp-inline-flex rfp-whitespace-nowrap",
|
|
108
|
+
animate: { x: [0, -u] },
|
|
109
|
+
transition: { duration: h, repeat: 1 / 0, ease: "linear", repeatDelay: 1.5 },
|
|
110
|
+
children: [
|
|
111
|
+
/* @__PURE__ */ e("span", { children: f }),
|
|
112
|
+
/* @__PURE__ */ e("span", { style: { width: p }, className: "rfp-inline-block" }),
|
|
113
|
+
/* @__PURE__ */ e("span", { children: f })
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
) : null,
|
|
117
|
+
/* @__PURE__ */ e(
|
|
118
|
+
"div",
|
|
119
|
+
{
|
|
120
|
+
ref: T,
|
|
121
|
+
className: "rfp-whitespace-nowrap",
|
|
122
|
+
style: s ? { position: "absolute", visibility: "hidden", pointerEvents: "none" } : void 0,
|
|
123
|
+
children: f
|
|
124
|
+
}
|
|
125
|
+
)
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
}, xe = ({ isPlaying: f }) => /* @__PURE__ */ e(
|
|
130
|
+
m.div,
|
|
131
|
+
{
|
|
132
|
+
className: "rfp-absolute",
|
|
133
|
+
style: {
|
|
134
|
+
top: "-6px",
|
|
135
|
+
right: "2px",
|
|
136
|
+
width: "100px",
|
|
137
|
+
height: "120px",
|
|
138
|
+
transformOrigin: "76px 16px",
|
|
139
|
+
zIndex: 5
|
|
140
|
+
},
|
|
141
|
+
animate: { rotate: f ? 16 : 0 },
|
|
142
|
+
transition: { duration: 0.8, ease: [0.4, 0, 0.2, 1] },
|
|
143
|
+
children: /* @__PURE__ */ n(
|
|
144
|
+
"svg",
|
|
145
|
+
{
|
|
146
|
+
width: "100",
|
|
147
|
+
height: "120",
|
|
148
|
+
viewBox: "0 0 100 120",
|
|
149
|
+
fill: "none",
|
|
150
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
151
|
+
children: [
|
|
152
|
+
/* @__PURE__ */ e("circle", { cx: "76", cy: "16", r: "13", fill: "rgba(0,0,0,0.3)" }),
|
|
153
|
+
/* @__PURE__ */ e("circle", { cx: "76", cy: "16", r: "11", fill: "url(#baseGrad)" }),
|
|
154
|
+
/* @__PURE__ */ e("circle", { cx: "76", cy: "16", r: "6", fill: "url(#baseInnerGrad)" }),
|
|
155
|
+
/* @__PURE__ */ e("circle", { cx: "76", cy: "16", r: "2.5", fill: "#222", stroke: "#555", strokeWidth: "0.5" }),
|
|
156
|
+
/* @__PURE__ */ e(
|
|
157
|
+
"path",
|
|
158
|
+
{
|
|
159
|
+
d: "M74 22 L56 88",
|
|
160
|
+
stroke: "url(#armGrad)",
|
|
161
|
+
strokeWidth: "3.5",
|
|
162
|
+
strokeLinecap: "round"
|
|
163
|
+
}
|
|
164
|
+
),
|
|
165
|
+
/* @__PURE__ */ e(
|
|
166
|
+
"path",
|
|
167
|
+
{
|
|
168
|
+
d: "M74.8 22 L56.8 88",
|
|
169
|
+
stroke: "rgba(255,255,255,0.06)",
|
|
170
|
+
strokeWidth: "1",
|
|
171
|
+
strokeLinecap: "round"
|
|
172
|
+
}
|
|
173
|
+
),
|
|
174
|
+
/* @__PURE__ */ e("rect", { x: "50", y: "86", width: "12", height: "7", rx: "1.5", fill: "url(#headGrad)" }),
|
|
175
|
+
/* @__PURE__ */ e("rect", { x: "52.5", y: "92", width: "7", height: "9", rx: "1", fill: "url(#cartridgeGrad)" }),
|
|
176
|
+
/* @__PURE__ */ e("line", { x1: "56", y1: "101", x2: "56", y2: "105", stroke: "#bbb", strokeWidth: "1.2", strokeLinecap: "round" }),
|
|
177
|
+
/* @__PURE__ */ e("circle", { cx: "56", cy: "105.5", r: "0.8", fill: "#ddd" }),
|
|
178
|
+
/* @__PURE__ */ n("defs", { children: [
|
|
179
|
+
/* @__PURE__ */ n("radialGradient", { id: "baseGrad", cx: "40%", cy: "35%", children: [
|
|
180
|
+
/* @__PURE__ */ e("stop", { offset: "0%", stopColor: "#555" }),
|
|
181
|
+
/* @__PURE__ */ e("stop", { offset: "100%", stopColor: "#1a1a1a" })
|
|
182
|
+
] }),
|
|
183
|
+
/* @__PURE__ */ n("radialGradient", { id: "baseInnerGrad", cx: "40%", cy: "35%", children: [
|
|
184
|
+
/* @__PURE__ */ e("stop", { offset: "0%", stopColor: "#666" }),
|
|
185
|
+
/* @__PURE__ */ e("stop", { offset: "100%", stopColor: "#333" })
|
|
186
|
+
] }),
|
|
187
|
+
/* @__PURE__ */ n("linearGradient", { id: "armGrad", x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
188
|
+
/* @__PURE__ */ e("stop", { offset: "0%", stopColor: "#555" }),
|
|
189
|
+
/* @__PURE__ */ e("stop", { offset: "50%", stopColor: "#444" }),
|
|
190
|
+
/* @__PURE__ */ e("stop", { offset: "100%", stopColor: "#333" })
|
|
191
|
+
] }),
|
|
192
|
+
/* @__PURE__ */ n("linearGradient", { id: "headGrad", x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
193
|
+
/* @__PURE__ */ e("stop", { offset: "0%", stopColor: "#555" }),
|
|
194
|
+
/* @__PURE__ */ e("stop", { offset: "100%", stopColor: "#333" })
|
|
195
|
+
] }),
|
|
196
|
+
/* @__PURE__ */ n("linearGradient", { id: "cartridgeGrad", x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
197
|
+
/* @__PURE__ */ e("stop", { offset: "0%", stopColor: "#444" }),
|
|
198
|
+
/* @__PURE__ */ e("stop", { offset: "100%", stopColor: "#222" })
|
|
199
|
+
] })
|
|
200
|
+
] })
|
|
201
|
+
]
|
|
202
|
+
}
|
|
203
|
+
)
|
|
204
|
+
}
|
|
205
|
+
), Ee = te(({ url: f, fileName: c }, G) => {
|
|
206
|
+
const i = ue(), {
|
|
207
|
+
audioRef: T,
|
|
208
|
+
isPlaying: s,
|
|
209
|
+
isLoading: I,
|
|
210
|
+
isLoop: v,
|
|
211
|
+
currentTime: b,
|
|
212
|
+
duration: p,
|
|
213
|
+
volume: u,
|
|
214
|
+
isMuted: h,
|
|
215
|
+
error: y,
|
|
216
|
+
togglePlay: w,
|
|
217
|
+
seek: N,
|
|
218
|
+
skip: k,
|
|
219
|
+
setVolume: V,
|
|
220
|
+
toggleMute: L,
|
|
221
|
+
toggleLoop: B,
|
|
222
|
+
formatTime: D
|
|
223
|
+
} = he({ url: f }), [$, R] = l(!1), [t, z] = l(!1), [E, r] = l(1), [a, o] = l(!1), [O, j] = l(0), g = P(null), S = P(null), W = P(), M = a ? O : b, F = p > 0 ? M / p : 0;
|
|
224
|
+
H(() => {
|
|
225
|
+
const d = () => {
|
|
226
|
+
if (g.current) {
|
|
227
|
+
const Z = g.current.clientHeight, J = g.current.clientWidth;
|
|
228
|
+
z(Z < 580);
|
|
229
|
+
const U = 464, ee = 320 / U, re = J >= U ? 1 : Math.max(ee, J / U);
|
|
230
|
+
r(re);
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
d();
|
|
234
|
+
const x = new ResizeObserver(d);
|
|
235
|
+
return g.current && x.observe(g.current), () => x.disconnect();
|
|
236
|
+
}, []), H(() => {
|
|
237
|
+
const d = (x) => {
|
|
238
|
+
S.current && !S.current.contains(x.target) && R(!1);
|
|
239
|
+
};
|
|
240
|
+
return $ && document.addEventListener("mousedown", d), () => document.removeEventListener("mousedown", d);
|
|
241
|
+
}, [$]);
|
|
242
|
+
const q = () => {
|
|
243
|
+
clearTimeout(W.current), R(!0);
|
|
244
|
+
}, X = () => {
|
|
245
|
+
W.current = setTimeout(() => R(!1), 300);
|
|
246
|
+
}, K = h || u === 0 ? pe : u < 0.5 ? fe : de;
|
|
247
|
+
if (ae(G, () => ({
|
|
248
|
+
getToolbarGroups: () => []
|
|
249
|
+
}), []), y)
|
|
250
|
+
return /* @__PURE__ */ e(me, { message: y });
|
|
251
|
+
const Q = t ? 0.72 : 1, Y = 260, _ = 240, A = Q * E;
|
|
252
|
+
return /* @__PURE__ */ n(
|
|
253
|
+
"div",
|
|
254
|
+
{
|
|
255
|
+
ref: g,
|
|
256
|
+
className: `rfp-flex rfp-flex-col rfp-items-center rfp-justify-center rfp-w-full rfp-h-full rfp-select-none rfp-overflow-auto ${t ? "rfp-p-3 rfp-gap-3" : "rfp-p-6 rfp-gap-6"}`,
|
|
257
|
+
children: [
|
|
258
|
+
/* @__PURE__ */ n(
|
|
259
|
+
"div",
|
|
260
|
+
{
|
|
261
|
+
className: "rfp-relative rfp-flex-shrink-0",
|
|
262
|
+
style: {
|
|
263
|
+
width: `${Y}px`,
|
|
264
|
+
height: `${_}px`,
|
|
265
|
+
transform: `scale(${A})`,
|
|
266
|
+
transformOrigin: "center center",
|
|
267
|
+
marginTop: t ? `${-(_ * (1 - A)) / 2}px` : 0,
|
|
268
|
+
marginBottom: t ? `${-(_ * (1 - A)) / 2}px` : 0
|
|
269
|
+
},
|
|
270
|
+
children: [
|
|
271
|
+
/* @__PURE__ */ e(
|
|
272
|
+
m.div,
|
|
273
|
+
{
|
|
274
|
+
className: "rfp-absolute rfp-rounded-full",
|
|
275
|
+
style: {
|
|
276
|
+
width: "220px",
|
|
277
|
+
height: "220px",
|
|
278
|
+
top: "18px",
|
|
279
|
+
left: "8px",
|
|
280
|
+
background: "radial-gradient(circle, rgba(129,140,248,0.12) 0%, transparent 70%)"
|
|
281
|
+
},
|
|
282
|
+
animate: s ? { scale: [1, 1.08, 1], opacity: [0.5, 1, 0.5] } : { scale: 1, opacity: 0.2 },
|
|
283
|
+
transition: s ? { duration: 3, repeat: 1 / 0, ease: "easeInOut" } : { duration: 0.5 }
|
|
284
|
+
}
|
|
285
|
+
),
|
|
286
|
+
/* @__PURE__ */ n(
|
|
287
|
+
"div",
|
|
288
|
+
{
|
|
289
|
+
className: "rfp-absolute rfp-rounded-full rfp-overflow-hidden",
|
|
290
|
+
style: {
|
|
291
|
+
width: "200px",
|
|
292
|
+
height: "200px",
|
|
293
|
+
top: "28px",
|
|
294
|
+
left: "18px",
|
|
295
|
+
background: `
|
|
296
|
+
radial-gradient(circle at center, transparent 95%, rgba(30,30,30,0.8) 95.5%, #111 97%),
|
|
297
|
+
radial-gradient(circle at center, transparent 38%, rgba(50,50,50,0.5) 38.15%, transparent 38.4%),
|
|
298
|
+
radial-gradient(circle at center, transparent 45%, rgba(50,50,50,0.3) 45.15%, transparent 45.4%),
|
|
299
|
+
radial-gradient(circle at center, transparent 52%, rgba(50,50,50,0.5) 52.15%, transparent 52.4%),
|
|
300
|
+
radial-gradient(circle at center, transparent 59%, rgba(50,50,50,0.3) 59.15%, transparent 59.4%),
|
|
301
|
+
radial-gradient(circle at center, transparent 66%, rgba(50,50,50,0.5) 66.15%, transparent 66.4%),
|
|
302
|
+
radial-gradient(circle at center, transparent 73%, rgba(50,50,50,0.3) 73.15%, transparent 73.4%),
|
|
303
|
+
radial-gradient(circle at center, transparent 80%, rgba(50,50,50,0.4) 80.15%, transparent 80.4%),
|
|
304
|
+
radial-gradient(circle at center, transparent 87%, rgba(50,50,50,0.3) 87.15%, transparent 87.4%),
|
|
305
|
+
conic-gradient(from 0deg, #1c1c1c, #232323, #1a1a1a, #262626, #1c1c1c, #212121, #1a1a1a, #252525, #1c1c1c, #232323, #1a1a1a, #262626, #1c1c1c)
|
|
306
|
+
`,
|
|
307
|
+
boxShadow: s ? "0 0 36px rgba(129,140,248,0.1), 0 8px 32px rgba(0,0,0,0.4), inset 0 0 20px rgba(0,0,0,0.4)" : "0 8px 32px rgba(0,0,0,0.4), inset 0 0 20px rgba(0,0,0,0.4)",
|
|
308
|
+
animation: "rfp-vinyl-spin 8s linear infinite",
|
|
309
|
+
animationPlayState: s ? "running" : "paused"
|
|
310
|
+
},
|
|
311
|
+
children: [
|
|
312
|
+
/* @__PURE__ */ n(
|
|
313
|
+
"div",
|
|
314
|
+
{
|
|
315
|
+
className: "rfp-absolute rfp-rounded-full",
|
|
316
|
+
style: {
|
|
317
|
+
width: "34%",
|
|
318
|
+
height: "34%",
|
|
319
|
+
top: "33%",
|
|
320
|
+
left: "33%",
|
|
321
|
+
background: "radial-gradient(circle at 40% 38%, #818cf8, #6366f1, #4f46e5, #4338ca)",
|
|
322
|
+
boxShadow: "inset 0 1px 3px rgba(255,255,255,0.25), inset 0 -1px 3px rgba(0,0,0,0.3), 0 0 8px rgba(0,0,0,0.3)"
|
|
323
|
+
},
|
|
324
|
+
children: [
|
|
325
|
+
/* @__PURE__ */ e(
|
|
326
|
+
"div",
|
|
327
|
+
{
|
|
328
|
+
className: "rfp-absolute rfp-inset-0 rfp-rounded-full rfp-opacity-20",
|
|
329
|
+
style: {
|
|
330
|
+
background: `
|
|
331
|
+
radial-gradient(circle at center, transparent 30%, rgba(0,0,0,0.3) 31%, transparent 32%),
|
|
332
|
+
radial-gradient(circle at center, transparent 50%, rgba(0,0,0,0.2) 51%, transparent 52%),
|
|
333
|
+
radial-gradient(circle at center, transparent 70%, rgba(0,0,0,0.3) 71%, transparent 72%),
|
|
334
|
+
radial-gradient(circle at center, transparent 88%, rgba(0,0,0,0.2) 89%, transparent 90%)
|
|
335
|
+
`
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
),
|
|
339
|
+
/* @__PURE__ */ e(
|
|
340
|
+
"div",
|
|
341
|
+
{
|
|
342
|
+
className: "rfp-absolute rfp-rounded-full",
|
|
343
|
+
style: {
|
|
344
|
+
width: "14%",
|
|
345
|
+
height: "14%",
|
|
346
|
+
top: "43%",
|
|
347
|
+
left: "43%",
|
|
348
|
+
background: "radial-gradient(circle at 40% 40%, #333, #0d0d0d)",
|
|
349
|
+
boxShadow: "inset 0 1px 3px rgba(0,0,0,0.9), 0 0 2px rgba(0,0,0,0.5)"
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
)
|
|
353
|
+
]
|
|
354
|
+
}
|
|
355
|
+
),
|
|
356
|
+
I && /* @__PURE__ */ e(
|
|
357
|
+
m.div,
|
|
358
|
+
{
|
|
359
|
+
className: "rfp-absolute rfp-inset-0 rfp-rounded-full",
|
|
360
|
+
style: { border: "2px solid rgba(129,140,248,0.3)" },
|
|
361
|
+
animate: { scale: [1, 1.02, 1], opacity: [0.3, 0.6, 0.3] },
|
|
362
|
+
transition: { duration: 1.5, repeat: 1 / 0 }
|
|
363
|
+
}
|
|
364
|
+
)
|
|
365
|
+
]
|
|
366
|
+
}
|
|
367
|
+
),
|
|
368
|
+
/* @__PURE__ */ e(xe, { isPlaying: s })
|
|
369
|
+
]
|
|
370
|
+
}
|
|
371
|
+
),
|
|
372
|
+
/* @__PURE__ */ e("div", { className: `rfp-text-center rfp-max-w-md rfp-flex-shrink-0 ${t ? "rfp-px-2" : "rfp-px-4"}`, children: /* @__PURE__ */ e(
|
|
373
|
+
ge,
|
|
374
|
+
{
|
|
375
|
+
text: c,
|
|
376
|
+
className: `rfp-font-medium rfp-text-fg-primary ${t ? "rfp-text-sm" : "rfp-text-lg"}`
|
|
377
|
+
}
|
|
378
|
+
) }),
|
|
379
|
+
/* @__PURE__ */ e(
|
|
380
|
+
"div",
|
|
381
|
+
{
|
|
382
|
+
className: "rfp-w-full rfp-flex rfp-justify-center rfp-flex-shrink-0",
|
|
383
|
+
children: /* @__PURE__ */ n(
|
|
384
|
+
"div",
|
|
385
|
+
{
|
|
386
|
+
className: `rfp-rounded-2xl rfp-border rfp-bg-surface-1 rfp-border-line-weak ${t ? "rfp-p-3" : "rfp-p-5"}`,
|
|
387
|
+
style: {
|
|
388
|
+
width: "448px",
|
|
389
|
+
backdropFilter: "blur(16px)",
|
|
390
|
+
transform: E < 1 ? `scale(${E})` : void 0,
|
|
391
|
+
transformOrigin: "top center",
|
|
392
|
+
marginBottom: E < 1 ? `${-(1 - E) * 100}px` : void 0
|
|
393
|
+
},
|
|
394
|
+
children: [
|
|
395
|
+
/* @__PURE__ */ n("div", { className: t ? "rfp-mb-3" : "rfp-mb-5", children: [
|
|
396
|
+
/* @__PURE__ */ n("div", { className: "rfp-relative rfp-h-4 rfp-flex rfp-items-center", children: [
|
|
397
|
+
/* @__PURE__ */ e("div", { className: "rfp-absolute rfp-w-full rfp-h-[5px] rfp-rounded-full rfp-bg-surface-2" }),
|
|
398
|
+
/* @__PURE__ */ e(
|
|
399
|
+
"div",
|
|
400
|
+
{
|
|
401
|
+
className: "rfp-absolute rfp-h-[5px] rfp-rounded-full rfp-pointer-events-none",
|
|
402
|
+
style: {
|
|
403
|
+
width: `${F * 100}%`,
|
|
404
|
+
background: "linear-gradient(90deg, var(--fp-accent), var(--fp-accent-hover))",
|
|
405
|
+
boxShadow: s ? "0 0 8px rgba(129,140,248,0.4)" : "none",
|
|
406
|
+
transition: a ? "none" : "width 0.1s linear"
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
),
|
|
410
|
+
/* @__PURE__ */ e(
|
|
411
|
+
"input",
|
|
412
|
+
{
|
|
413
|
+
type: "range",
|
|
414
|
+
min: "0",
|
|
415
|
+
max: p > 0 ? p : b || 100,
|
|
416
|
+
step: "any",
|
|
417
|
+
value: M,
|
|
418
|
+
onPointerDown: () => {
|
|
419
|
+
j(b), o(!0);
|
|
420
|
+
},
|
|
421
|
+
onChange: (d) => {
|
|
422
|
+
const x = parseFloat(d.target.value);
|
|
423
|
+
a ? j(x) : N(x);
|
|
424
|
+
},
|
|
425
|
+
onPointerUp: (d) => {
|
|
426
|
+
const x = parseFloat(d.target.value);
|
|
427
|
+
N(x), o(!1);
|
|
428
|
+
},
|
|
429
|
+
onPointerCancel: () => o(!1),
|
|
430
|
+
disabled: p <= 0,
|
|
431
|
+
"aria-label": i("audio.aria.progress"),
|
|
432
|
+
className: "audio-slider rfp-absolute rfp-w-full"
|
|
433
|
+
}
|
|
434
|
+
)
|
|
435
|
+
] }),
|
|
436
|
+
/* @__PURE__ */ n("div", { className: `rfp-flex rfp-justify-between rfp-text-fg-tertiary ${t ? "rfp-text-[10px] rfp-mt-1.5" : "rfp-text-xs rfp-mt-2.5"}`, children: [
|
|
437
|
+
/* @__PURE__ */ e("span", { style: { fontVariantNumeric: "tabular-nums" }, children: D(M) }),
|
|
438
|
+
/* @__PURE__ */ e("span", { style: { fontVariantNumeric: "tabular-nums" }, children: p > 0 ? D(p) : "--:--" })
|
|
439
|
+
] })
|
|
440
|
+
] }),
|
|
441
|
+
/* @__PURE__ */ n("div", { className: `rfp-flex rfp-items-center rfp-justify-center ${t ? "rfp-gap-2" : "rfp-gap-3"}`, children: [
|
|
442
|
+
/* @__PURE__ */ e(
|
|
443
|
+
m.button,
|
|
444
|
+
{
|
|
445
|
+
onClick: B,
|
|
446
|
+
whileHover: { scale: 1.1 },
|
|
447
|
+
whileTap: { scale: 0.92 },
|
|
448
|
+
"aria-label": i(v ? "audio.aria.loop_off" : "audio.aria.loop_on"),
|
|
449
|
+
className: `rfp-rounded-full rfp-flex rfp-items-center rfp-justify-center rfp-transition-colors rfp-flex-shrink-0 ${t ? "rfp-w-8 rfp-h-8" : "rfp-w-9 rfp-h-9"} ${v ? "rfp-bg-accent-soft rfp-text-accent" : "rfp-bg-surface-2 rfp-text-fg-tertiary"}`,
|
|
450
|
+
children: /* @__PURE__ */ e(ie, { className: t ? "rfp-w-3.5 rfp-h-3.5" : "rfp-w-4 rfp-h-4" })
|
|
451
|
+
}
|
|
452
|
+
),
|
|
453
|
+
/* @__PURE__ */ e(
|
|
454
|
+
m.button,
|
|
455
|
+
{
|
|
456
|
+
onClick: () => k(-10),
|
|
457
|
+
whileHover: { scale: 1.1 },
|
|
458
|
+
whileTap: { scale: 0.92 },
|
|
459
|
+
"aria-label": i("audio.aria.backward_10"),
|
|
460
|
+
className: `rfp-rounded-full rfp-flex rfp-items-center rfp-justify-center rfp-transition-colors rfp-bg-surface-2 rfp-text-fg-secondary rfp-flex-shrink-0 ${t ? "rfp-w-9 rfp-h-9" : "rfp-w-10 rfp-h-10"}`,
|
|
461
|
+
children: /* @__PURE__ */ e(se, { className: t ? "rfp-w-4 rfp-h-4" : "rfp-w-[18px] rfp-h-[18px]" })
|
|
462
|
+
}
|
|
463
|
+
),
|
|
464
|
+
/* @__PURE__ */ e(
|
|
465
|
+
m.button,
|
|
466
|
+
{
|
|
467
|
+
onClick: w,
|
|
468
|
+
whileHover: { scale: 1.06 },
|
|
469
|
+
whileTap: { scale: 0.94 },
|
|
470
|
+
"aria-label": i(s ? "audio.aria.pause" : "audio.aria.play"),
|
|
471
|
+
className: `rfp-rounded-full rfp-flex rfp-items-center rfp-justify-center rfp-flex-shrink-0 ${t ? "rfp-w-12 rfp-h-12" : "rfp-w-14 rfp-h-14"}`,
|
|
472
|
+
style: {
|
|
473
|
+
background: "linear-gradient(135deg, var(--fp-accent-hover), var(--fp-accent))",
|
|
474
|
+
color: "#fff",
|
|
475
|
+
boxShadow: "0 4px 20px rgba(99,102,241,0.35)"
|
|
476
|
+
},
|
|
477
|
+
children: s ? /* @__PURE__ */ e(oe, { className: t ? "rfp-w-5 rfp-h-5" : "rfp-w-6 rfp-h-6" }) : /* @__PURE__ */ e(le, { className: t ? "rfp-w-5 rfp-h-5 rfp-ml-0.5" : "rfp-w-6 rfp-h-6 rfp-ml-0.5" })
|
|
478
|
+
}
|
|
479
|
+
),
|
|
480
|
+
/* @__PURE__ */ e(
|
|
481
|
+
m.button,
|
|
482
|
+
{
|
|
483
|
+
onClick: () => k(10),
|
|
484
|
+
whileHover: { scale: 1.1 },
|
|
485
|
+
whileTap: { scale: 0.92 },
|
|
486
|
+
"aria-label": i("audio.aria.forward_10"),
|
|
487
|
+
className: `rfp-rounded-full rfp-flex rfp-items-center rfp-justify-center rfp-transition-colors rfp-bg-surface-2 rfp-text-fg-secondary rfp-flex-shrink-0 ${t ? "rfp-w-9 rfp-h-9" : "rfp-w-10 rfp-h-10"}`,
|
|
488
|
+
children: /* @__PURE__ */ e(ce, { className: t ? "rfp-w-4 rfp-h-4" : "rfp-w-[18px] rfp-h-[18px]" })
|
|
489
|
+
}
|
|
490
|
+
),
|
|
491
|
+
/* @__PURE__ */ n(
|
|
492
|
+
"div",
|
|
493
|
+
{
|
|
494
|
+
ref: S,
|
|
495
|
+
className: "rfp-relative",
|
|
496
|
+
onMouseEnter: q,
|
|
497
|
+
onMouseLeave: X,
|
|
498
|
+
children: [
|
|
499
|
+
/* @__PURE__ */ e(
|
|
500
|
+
m.button,
|
|
501
|
+
{
|
|
502
|
+
onClick: L,
|
|
503
|
+
whileHover: { scale: 1.1 },
|
|
504
|
+
whileTap: { scale: 0.92 },
|
|
505
|
+
"aria-label": i(h ? "audio.aria.unmute" : "audio.aria.mute"),
|
|
506
|
+
className: `rfp-rounded-full rfp-flex rfp-items-center rfp-justify-center rfp-transition-colors rfp-flex-shrink-0 ${t ? "rfp-w-8 rfp-h-8" : "rfp-w-9 rfp-h-9"} ${$ ? "rfp-bg-accent-soft rfp-text-accent" : "rfp-bg-surface-2 rfp-text-fg-secondary"}`,
|
|
507
|
+
children: /* @__PURE__ */ e(K, { className: t ? "rfp-w-3.5 rfp-h-3.5" : "rfp-w-4 rfp-h-4" })
|
|
508
|
+
}
|
|
509
|
+
),
|
|
510
|
+
/* @__PURE__ */ e(ne, { children: $ && /* @__PURE__ */ e(
|
|
511
|
+
m.div,
|
|
512
|
+
{
|
|
513
|
+
initial: { opacity: 0, scale: 0.95 },
|
|
514
|
+
animate: { opacity: 1, scale: 1 },
|
|
515
|
+
exit: { opacity: 0, scale: 0.95 },
|
|
516
|
+
transition: { duration: 0.12 },
|
|
517
|
+
className: "rfp-absolute rfp-bottom-full rfp-mb-2 rfp-rounded-xl rfp-p-3 rfp-border rfp-bg-surface-3 rfp-border-line",
|
|
518
|
+
style: {
|
|
519
|
+
left: "50%",
|
|
520
|
+
marginLeft: "-27px",
|
|
521
|
+
backdropFilter: "blur(16px)"
|
|
522
|
+
},
|
|
523
|
+
onMouseEnter: q,
|
|
524
|
+
onMouseLeave: X,
|
|
525
|
+
children: /* @__PURE__ */ n("div", { className: "rfp-flex rfp-flex-col rfp-items-center rfp-gap-2", style: { height: "100px" }, children: [
|
|
526
|
+
/* @__PURE__ */ n("div", { className: "rfp-relative rfp-flex rfp-items-center rfp-justify-center", style: { width: "24px", height: "80px" }, children: [
|
|
527
|
+
/* @__PURE__ */ e(
|
|
528
|
+
"div",
|
|
529
|
+
{
|
|
530
|
+
className: "rfp-absolute rfp-rounded-full rfp-bg-surface-2",
|
|
531
|
+
style: { width: "3px", height: "100%" }
|
|
532
|
+
}
|
|
533
|
+
),
|
|
534
|
+
/* @__PURE__ */ e(
|
|
535
|
+
"div",
|
|
536
|
+
{
|
|
537
|
+
className: "rfp-absolute rfp-bottom-0 rfp-rounded-full rfp-pointer-events-none",
|
|
538
|
+
style: {
|
|
539
|
+
width: "3px",
|
|
540
|
+
height: `${(h ? 0 : u) * 100}%`,
|
|
541
|
+
background: "var(--fp-accent-hover)",
|
|
542
|
+
transition: "height 0.1s linear"
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
),
|
|
546
|
+
/* @__PURE__ */ e(
|
|
547
|
+
"input",
|
|
548
|
+
{
|
|
549
|
+
type: "range",
|
|
550
|
+
min: "0",
|
|
551
|
+
max: "1",
|
|
552
|
+
step: "0.01",
|
|
553
|
+
value: h ? 0 : u,
|
|
554
|
+
onChange: (d) => V(parseFloat(d.target.value)),
|
|
555
|
+
"aria-label": i("audio.aria.volume"),
|
|
556
|
+
className: "volume-slider-vertical rfp-absolute",
|
|
557
|
+
style: {
|
|
558
|
+
width: "80px",
|
|
559
|
+
height: "24px",
|
|
560
|
+
transform: "rotate(-90deg)",
|
|
561
|
+
transformOrigin: "center center"
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
)
|
|
565
|
+
] }),
|
|
566
|
+
/* @__PURE__ */ e("span", { className: "rfp-text-[10px] rfp-tabular-nums rfp-text-fg-tertiary", children: Math.round((h ? 0 : u) * 100) })
|
|
567
|
+
] })
|
|
568
|
+
}
|
|
569
|
+
) })
|
|
570
|
+
]
|
|
571
|
+
}
|
|
572
|
+
)
|
|
573
|
+
] })
|
|
574
|
+
]
|
|
575
|
+
}
|
|
576
|
+
)
|
|
577
|
+
}
|
|
578
|
+
),
|
|
579
|
+
/* @__PURE__ */ e("audio", { ref: T, src: f, className: "rfp-hidden" })
|
|
580
|
+
]
|
|
581
|
+
}
|
|
582
|
+
);
|
|
583
|
+
});
|
|
584
|
+
export {
|
|
585
|
+
Ee as AudioRenderer
|
|
586
|
+
};
|
|
587
|
+
//# sourceMappingURL=index-CMehLA91.mjs.map
|